Added activate and shift functions

This commit is contained in:
Kaan Soral
2016-12-18 03:02:50 +03:00
committed by GitHub
parent 47af2bcf5f
commit 8f38ff3fb3
+13 -1
View File
@@ -3,6 +3,19 @@ var character=parent.character;
var G=parent.G; // Game data var G=parent.G; // Game data
var safeties=true; var safeties=true;
function activate(num) // activates an item, likely a booster, in the num-th inventory slot
{
parent.activate(num);
}
function shift(num,name) // shifts an item, likely a booster, in the num-th inventory slot
{
// shift(0,'xpbooster')
// shift(0,'luckbooster')
// shift(0,'goldbooster')
parent.shift(num,name);
}
function item_properties(item) // example: item_properties(character.items[0]) function item_properties(item) // example: item_properties(character.items[0])
{ {
if(!item || !item.name) return {}; if(!item || !item.name) return {};
@@ -24,7 +37,6 @@ function item_value(item) // example: item_value(character.items[0])
return calculate_item_value(item); return calculate_item_value(item);
} }
function get_socket() function get_socket()
{ {
return parent.socket; return parent.socket;