Game_Interpreter.prototype.operateVariable = function(variableId, operationType, value) {
try {
var oldValue = $gameVariables.value(variableId);
switch (operationType) {
case 0: // Set
$gameVariables.setValue(variableId, oldValue = value);
break;
case 1: // Add
$gameVariables.setValue(variableId, oldValue + value);
break;
case 2: // Sub
$gameVariables.setValue(variableId, oldValue - value);
break;
case 3: // Mul
$gameVariables.setValue(variableId, oldValue * value);
break;
case 4: // Div
$gameVariables.setValue(variableId, oldValue / value);
break;
case 5: // Mod
$gameVariables.setValue(variableId, oldValue % value);
break;
}
} catch (e) {
$gameVariables.setValue(variableId, 0);
}
};
Game_Interpreter.prototype.operateVariable = function(variableId, operationType, value) {
try {
var oldValue = $gameVariables.value(variableId);
switch (operationType) {
case 0: // Set
$gameVariables.setValue(variableId, oldValue = value);
break;
case 1: // Add
$gameVariables.setValue(variableId, oldValue + value);
break;
case 2: // Sub
$gameVariables.setValue(variableId, oldValue - value);
break;
case 3: // Mul
$gameVariables.setValue(variableId, oldValue * value);
break;
case 4: // Div
$gameVariables.setValue(variableId, oldValue / value);
break;
case 5: // Mod
$gameVariables.setValue(variableId, oldValue % value);
break;
}
} catch (e) {
$gameVariables.setValue(variableId, 0);
}
};