// Hero: Need to know that it is the hero (job) // Enemy: Need to know that it is the enemy (job). Need to generate stats on the fly // Mook: Generated based on PlayercreationData. public void Initialize(JobActionsList jobList, string name) { this.playerCreationData = new PlayerCreationData(name, jobList.job); this.playerRewards = new List <PlayerReward>(); this.CommonInitialization(name); }
public void GenerateEnemyList(int waveIndex) { this.currentWaveIndex = waveIndex; StageInfoContainer stageInfo = GameManager.Instance.gameState.GetCurrentStage(); WaveInfoContainer waveInfo = stageInfo.GetWaveInfo(this.currentWaveIndex); List <JobActionsList> enemyList = waveInfo.GetEnemyList(); // float mult = stageInfo.GetDifficultyMult(); BattleType battleType = stageInfo.GetBattleType(); for (int i = 0; i < enemyList.Count; i++) { JobActionsList jobList = enemyList[i]; string name = jobList.prefab.Name + " (" + GetTargetNameFromIndex(i) + ")"; int index = i; Enemy enemy = new Enemy(); enemy.Initialize(jobList, name); EnemyObject instantiatedEnemy = enemy.InstantiateFromJob <EnemyObject>(jobList, name, index); // Apply stat adjustments based on difficulty PlayerStats stats = instantiatedEnemy.stats; /* * foreach(Stat stat in System.Enum.GetValues(typeof(Stat))) { * stats.ModifyStat(stat, (int) (stats.GetStat(stat) * mult)); * } */ int level = waveInfo.GetWaveInfo().averageLevel; if (battleType == BattleType.HARD_BATTLE) { level += 3; } else if (battleType == BattleType.EASY_BATTLE) { level -= 1; } else if (battleType == BattleType.BOSS) { // level += 10; // Should be done from inspector side } stats.ApplyStatsBasedOnLevel(level); // TODO: Some sort of entrance animation instantiatedEnemy.SetSortingOrder(i); FighterSlot slot = enemySlots[i]; slot.InitializePosition(instantiatedEnemy); GameManager.Instance.gameState.enemyParty.SetFighter(i, enemy); } }
public void CreateHero(string heroName) { // Creates the hero player JobActionsList jobActionsList = GameManager.Instance.models.GetPlayerJobActionsList(Job.HERO); PlayerCreationData heroData = new PlayerCreationData(heroName, Job.HERO); Player hero = new Player(); hero.Initialize(jobActionsList, heroName); hero.stats.ApplyStatsBasedOnLevel(4); this.SetFighter(0, hero); }
public T InstantiateFromJob <T>(JobActionsList jobList, string name, int targetId) where T : FightingEntity { T prefab = (T)jobList.prefab; T instantiatedFighter = GameObject.Instantiate <T>(prefab) as T; instantiatedFighter.Initialize(targetId, this); this.fighter = instantiatedFighter; return(instantiatedFighter); }
private PlayerObject InstantiatePlayer(int index) { Player player = GameManager.Instance.gameState.playerParty.GetFighters <Player>()[index]; if (player == null) { return(null); } JobActionsList jobActionsList = GameManager.Instance.models.GetPlayerJobActionsList(player.playerCreationData.job); PlayerObject playerObject = player.InstantiateFromJob <PlayerObject>(jobActionsList, player.playerCreationData.name, index); return(playerObject); }