internal override void Process() { base.Process(); LuaTurnSetInfo ltsiTo = EncounterInfo.currentTurn().toLuaTurnSetInfo(); LuaTurnSetInfo ltsiFrom = EncounterInfo.getTurnSetFrom(lci.parent).toLuaTurnSetInfo(); LuaCharacterTurnInfo lcti = EncounterInfo.getCharacterTurnFrom(lci.parent).toLuaCharacterTurnInfo(); ltsiTo.HandleChangeSide(lcti, ltsiFrom, ltsiTo, LuaTurnSetInfo.SideTurnType.MindControl); }
internal void Execute(LuaTurnSetInfo ltsi) { if (state == null) { state = new NLua.Lua(); state.LoadCLRPackage(); if (fileNameLoc.StartsWith(@"\")) { fileNameLoc = fileNameLoc.Remove(0, 1); } String comp = System.IO.Path.Combine(TBAGW.Game1.rootContent, fileNameLoc); state.DoFile(comp); } if (state.GetFunction(functionName) != null) { if (bNoParameter) { (state[functionName] as NLua.LuaFunction).Call(); } else if (!bNoParameter) { //var temp = ltsi.otherGroups[0].RandomMember(); if (eventType == EventType.updateEV) { (state[functionName] as NLua.LuaFunction).Call(ltsi, msTime); } else { (state[functionName] as NLua.LuaFunction).Call(ltsi); } } } else { Console.WriteLine("Lua error from " + fileNameLoc + " , @function-name " + functionName); eventType = EventType.None; } }
public static void EndTurn(LuaTurnSetInfo ltsi) { ltsi.parent.groupTurnSet.ForEach(e => e.bIsCompleted = true); }
public void HandleChangeSide(LuaCharacterTurnInfo lci, LuaTurnSetInfo lsiFrom, LuaTurnSetInfo lsiTo, SideTurnType stt = SideTurnType.Normal) { lsiFrom.parent.Remove(lci.parent, stt); lsiTo.parent.AddViaChangeSide(lci.parent, stt); }