Game_Event.prototype.meetsConditions = function(page) {
var c = page.conditions;
if (c.switch1Valid) {
if (!$gameSwitches.value(c.switch1Id)) {
return false;
}
}
if (c.script) {
if (!eval(c.script)) {
return false;
}
}
if (c.variableValid) {
if ($gameVariables.value(c.variableId) < c.variableValue) {
return false;
}
}
if (c.selfSwitchValid) {
var key = [this._mapId, this._eventId, c.selfSwitchCh];
if ($gameSelfSwitches.value(key) !== true) {
return false;
}
}
if (c.itemValid) {
var item = $dataItems[c.itemId];
if (!$gameParty.hasItem(item)) {
return false;
}
}
if (c.actorValid) {
var actor = $gameActors.actor(c.actorId);
if (!$gameParty.members().contains(actor)) {
return false;
}
}
return true;
};