Ejemplo n.º 1
0
				public BattleInit(NPCBattlesRow aNPCBattle,BetterList<NPCBattleMonstersRow> aNPCMonsters) {
					battleBackground = aNPCBattle._BattleBG;
					if(REF!=null) {
						REF.cleanUp();
					}
					REF = this;
					_npcRef = aNPCBattle;
					this.itemsToAward = aNPCBattle._ItemsReward;
					this.money = aNPCBattle._CashReward;
					teams[0] = new BattleInitTeam();
					teams[0].controlType = ETeamControllerType.SinglePlayerUser;
					Debug.Log("Including NPC Actor: "+aNPCBattle._IncludedNPCActor);
					if(aNPCBattle._IncludedNPCActor!=null&&aNPCBattle._IncludedNPCActor.Length>0) {
						string alliesMonster = DialogueLua.GetActorField(aNPCBattle._IncludedNPCActor,"PrimaryMonster").AsString;
						Debug.Log ("Allies monster is: "+alliesMonster);
						int lev = PlayerMain.REF.highMonster.level;
						MonsterDataMain m = new MonsterDataMain();
						m.initMonster(MonsterLibrary.REF.getMonster(alliesMonster).ID,(byte) lev,true);
						teams[0].addFightingMonster(m,2,aNPCBattle._IncludedNPCActor);
					} 
			
					teams[1] = new BattleInitTeam();
					teams[1].controlType = ETeamControllerType.RegularAI;
					teams[1].initTeamFromBattlesRow(aNPCBattle,aNPCMonsters);;
					forcedConversation = aNPCBattle._ForcedConversation;
					convoNPCName = aNPCBattle._ConversationMainActor;
				}
Ejemplo n.º 2
0
				public void initTeamFromBattlesRow(NPCBattlesRow aData,BetterList<NPCBattleMonstersRow> aMonsters) {
					for(int i = 0;i<aMonsters.size;i++) {
						MonsterLibraryRecord m = MonsterLibrary.REF.getMonster(aMonsters[i]._Monster);
						if(m!=null) {
							if(aData._NPCInBattleName.Length==0) {
								aData._NPCInBattleName = aData._NPCName;
							}
							MonsterDataMain monster = addNPCMonster(m.ID,Convert.ToByte(aMonsters[i]._Level),EMoveBranch.NoMove,aData._NPCInBattleName,aMonsters[i]._OverrideMove1,aMonsters[i]._OverrideMove2,aMonsters[i]._OverrideMove3,aMonsters[i]._OverrideMove4);
							if(aMonsters[i]._OverrideName!=null&&aMonsters[i]._OverrideName.Length>0) {
								monster.name = aMonsters[i]._OverrideName;
							}
							PlayerMain.REF.addMonsterToSeen(monster.monsterBreedRef.ID);
						} else {  
							Debug.LogError ("Monster that I wanted to add is: "+aMonsters[i]._Monster);
						}
					}
					this.name = aData._NPCName;
					battlesConversation = aData._ForcedConversation;
				}
Ejemplo n.º 3
0
				public void cleanUp() {
					teams = null;
					REF = null;
					_npcRef = null; 
				}