Example #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;
				}
Example #2
0
				public BattleInit ()
				{
				
					if(REF!=null) {
						REF.cleanUp();
					}
			
					REF = this;
				}
Example #3
0
				//TODO Reenable when multiplayer
				/*
				public BattleInit(SFSObject aData) {
					if(REF!=null) {
						REF.cleanUp();
					}
			
					battleBackground = "";//aNPCBattle._BATTLEBG;
					REF = this;
					
					BattleBase.DebugText("BattleInit(SFSObject aData) ->Making Team 1");
					teams[0] = new BattleInitTeam((SFSObject) aData.GetSFSArray("arr").GetSFSObject(0));
					BattleRandomizer.loadFromSFSArray((SFSArray) aData.GetSFSArray("arr").GetSFSObject(0).GetSFSArray("r"));
					
					BattleBase.DebugText("BattleInit(SFSObject aData) ->Making Team 2");
					teams[1] = new BattleInitTeam((SFSObject) aData.GetSFSArray("arr").GetSFSObject(1));
			
					
					
				}
		*/
				public BattleInit(SpawnAreaMonster aSpawnAreaMonster,string aBattleBG) {
					// General Spawn Point
					battleBackground = aBattleBG;
					if(REF!=null) {
						REF.cleanUp();
					}
					REF = this;
	
					teams[0] = new BattleInitTeam();
					teams[0].controlType = ETeamControllerType.SinglePlayerUser;
					
			
					teams[1] = new BattleInitTeam();
					teams[1].controlType = ETeamControllerType.WildAI;
					teams[1].initTeamFromSpawnAreaMonster(aSpawnAreaMonster);;
		

				}
Example #4
0
				public void cleanUp() {
					teams = null;
					REF = null;
					_npcRef = null; 
				}
Example #5
0
		private IEnumerator UnpackTeamsThroughFrames(BattleInit aInitData) {
			yield return null;
			Debug.Log ("Unpacking team 1");
			_teams[0].initFromData(aInitData.teams[0],ETeamPosition.LeftTeam);
			yield return null;
			Debug.Log ("Unpacking team 2");
			_teams[1].initFromData(aInitData.teams[1],ETeamPosition.RightTeam);
			yield return null;
			
		}