static public void Update(GameTime gt) { bBattleWon = objective.ObjectiveReached(encounterGroups); bIsRunning = bBattleWon; if (EncounterObjective.Lost(objective)) { CombatProcessor.bLostBattle = true; } if (bBattleWon && !CombatProcessor.bAfterBattleScreen) { CombatProcessor.InitiateVictory(); } else if (!bBattleWon) { LUA.LuaBScriptEvent.msTime = gt.ElapsedGameTime.Milliseconds; if (bGenerateLuaTurnInfo) { turnSetInfo = currentTurn().toLuaTurnSetInfo(); bGenerateLuaTurnInfo = false; } BattleScriptHandler.Execute(LUA.LuaBScriptEvent.EventType.updateEV, turnSetInfo); encounterGroups[currentGroupIndex].Update(); } }
internal LUA.LuaTurnSetInfo toLuaTurnSetInfo() { LUA.LuaTurnSetInfo ltsi = new LUA.LuaTurnSetInfo(); ltsi.bIsAssist = this.bIsAssistTurnSet; ltsi.bIsEnemy = this.bIsEnemyTurnSet; ltsi.bIsPlayer = this.bIsPlayerTurnSet; ltsi.parent = this; ltsi.charactersInGroup = this.charactersInGroup; this.groupTurnSet.ForEach(ct => ltsi.charTurnInfos.Add(ct.toLuaCharacterTurnInfo())); if (EncounterInfo.currentTurn().bIsPlayerTurnSet&& !bPlayerTurnEnemyOverriden) { ltsi.CTCallFrom = selectedCharTurn == null ? null : selectedCharTurn.toLuaCharacterTurnInfo(); } else { ltsi.CTCallFrom = currentEnemy == null ? null : currentEnemy.toLuaCharacterTurnInfo(); } var tempL = EncounterInfo.encounterGroups.FindAll(g => g != this); foreach (var item in tempL) { ltsi.otherGroups.Add(item.toLuaTurnSetInfoSimple()); } return(ltsi); }
private void EndModifier() { if (mci != null) { LUA.LuaTurnSetInfo ogFrom = mci.ogFrom.toLuaTurnSetInfo(); LUA.LuaTurnSetInfo currentlyIn = mci.currentlyIn.toLuaTurnSetInfo(); LUA.LuaCharacterTurnInfo lcti = mci.ct.toLuaCharacterTurnInfo(); ogFrom.HandleChangeSide(lcti, currentlyIn, ogFrom, LUA.LuaTurnSetInfo.SideTurnType.Normal); mci = null; } }
internal static void Execute(LUA.LuaBScriptEvent.EventType et, LUA.LuaTurnSetInfo ltsi) { switch (et) { case LUA.LuaBScriptEvent.EventType.postCT: BScripts.Where(s => s.eventType == et).ToList().ForEach(s => s.Execute(ltsi)); EncounterInfo.bGenerateLuaTurnInfo = true; break; case LUA.LuaBScriptEvent.EventType.postPT: BScripts.Where(s => s.eventType == et).ToList().ForEach(s => s.Execute(ltsi)); EncounterInfo.bGenerateLuaTurnInfo = true; break; case LUA.LuaBScriptEvent.EventType.postET: BScripts.Where(s => s.eventType == et).ToList().ForEach(s => s.Execute(ltsi)); EncounterInfo.bGenerateLuaTurnInfo = true; break; case LUA.LuaBScriptEvent.EventType.startPT: BScripts.Where(s => s.eventType == et).ToList().ForEach(s => s.Execute(ltsi)); EncounterInfo.bGenerateLuaTurnInfo = true; break; case LUA.LuaBScriptEvent.EventType.startET: BScripts.Where(s => s.eventType == et).ToList().ForEach(s => s.Execute(ltsi)); EncounterInfo.bGenerateLuaTurnInfo = true; break; case LUA.LuaBScriptEvent.EventType.startCT: BScripts.Where(s => s.eventType == et).ToList().ForEach(s => s.Execute(ltsi)); EncounterInfo.bGenerateLuaTurnInfo = true; break; case LUA.LuaBScriptEvent.EventType.None: break; case LUA.LuaBScriptEvent.EventType.updateEV: // BScripts.Where(s => s.eventType == et).ToList().ForEach(s => s.Execute(ltsi)); break; default: break; } }
internal LUA.LuaTurnSetInfo toLuaTurnSetInfoSimple() { LUA.LuaTurnSetInfo ltsi = new LUA.LuaTurnSetInfo(); ltsi.bIsAssist = this.bIsAssistTurnSet; ltsi.bIsEnemy = this.bIsEnemyTurnSet; ltsi.bIsPlayer = this.bIsPlayerTurnSet; ltsi.parent = this; ltsi.charactersInGroup = this.charactersInGroup; this.groupTurnSet.ForEach(ct => ltsi.charTurnInfos.Add(ct.toLuaCharacterTurnInfo())); if (EncounterInfo.currentTurn().bIsPlayerTurnSet) { ltsi.CTCallFrom = selectedCharTurn == null ? null : selectedCharTurn.toLuaCharacterTurnInfo(); } else { ltsi.CTCallFrom = currentEnemy == null ? null : currentEnemy.toLuaCharacterTurnInfo(); } return(ltsi); }