| Game_Interpreter.prototype.command301 = function(params) {    if ($gameParty.hasEncounterNone()) {        $gameMap.eraseEvent(this._eventId);        return true;    } // 开头新增几行:如果当前队伍有【免疫遇敌】状态则怪物直接消失    if (!$gameParty.inBattle()) {        let troopId;        if (params[0] === 0) {            // Direct designation            troopId = params[1];        } else if (params[0] === 1) {            // Designation with a variable            troopId = $gameVariables.value(params[1]);        } else {            // Same as Random Encounters            troopId = $gamePlayer.makeEncounterTroopId();        }        if ($dataTroops[troopId]) {            BattleManager.setup(troopId, params[2], params[3]);            BattleManager.setEventCallback(n => {                this._branch[this._indent] = n;            });            $gamePlayer.makeEncounterCount();            SceneManager.push(Scene_Battle);        }    }    return true;};
Game_Interpreter.prototype.command301 = function(params) { 
    if ($gameParty.hasEncounterNone()) { 
        $gameMap.eraseEvent(this._eventId); 
        return true; 
    } // 开头新增几行:如果当前队伍有【免疫遇敌】状态则怪物直接消失 
    if (!$gameParty.inBattle()) { 
        let troopId; 
        if (params[0] === 0) { 
            // Direct designation 
            troopId = params[1]; 
        } else if (params[0] === 1) { 
            // Designation with a variable 
            troopId = $gameVariables.value(params[1]); 
        } else { 
            // Same as Random Encounters 
            troopId = $gamePlayer.makeEncounterTroopId(); 
        } 
        if ($dataTroops[troopId]) { 
            BattleManager.setup(troopId, params[2], params[3]); 
            BattleManager.setEventCallback(n => { 
                this._branch[this._indent] = n; 
            }); 
            $gamePlayer.makeEncounterCount(); 
            SceneManager.push(Scene_Battle); 
        } 
    } 
    return true; 
}; 
 |