protected override void InitializeAbility() { cooldown = enemy.baseEnemy.GetSpecialAbilityFloat("cooldown");; //Default values that won't clobber inspector values if (cooldown <= 0) { cooldown = 6; } enemyType = enemy.baseEnemy.GetSpecialAbilityInt("type"); MonsterData.Level monster = GameData.instance.GetMonster(enemyType); if (monster != null) { enemyPrefab = monster.GetPrefab(); if (enemyPrefab == null) { monster = GameData.instance.GetMonster(0); if (monster != null) { enemyPrefab = monster.GetPrefab(); } if (enemyPrefab == null) { Destroy(this); Debug.LogWarning("Summoned enemy not found! Removing Summon ability"); } } } myScript = GetComponent <Enemy> (); }
public void AddMonster(int _amount, float _seconds, MonsterData.Level _monster) { Monster newMonster = new Monster(); newMonster.amount = _amount; newMonster.seconds = _seconds; newMonster.monster = _monster; monsters.Add(newMonster); }
public void SetStats(int level) { MonsterData.Level monster = GameData.instance.GetMonster(level); if (monster != null) { damage = monster.damage; range = monster.range; } }
public void Load(MonsterData.Level baseProperties) { damage = baseProperties.damage; hp = maxHp = baseProperties.hp; armor = baseProperties.armor; range = baseProperties.range; rateOfFire = baseProperties.rateOfFire; coins = baseProperties.gain; this.originalSpeed = speed = baseProperties.speed; mana = baseProperties.mana; flying = baseProperties.monster.air; }
void Start() { this.baseEnemy = GameData.instance.GetMonster(level); //load enemy paramaters from the excelsheet EnemyProperties baseProperties = new EnemyProperties(); baseProperties.Load(this.baseEnemy); properties = new EnemyPropertiesQueue(); properties.Initialize(baseProperties, Time.time); InvokeRepeating("Attack", (float)properties.active.rateOfFire, (float)properties.active.rateOfFire); //dynamic health bar wayPoints = Grid.instance.wayPoints; //position the object at the start of the path if (nextPointIndex > 0 && nextPointIndex < wayPoints.Length && wayPoints.Length > 0 && wayPoints[nextPointIndex - 1] != null) { this.transform.position = wayPoints[nextPointIndex - 1].position; } healthBar = UIManager.instance.GetHealthBar(); healthBar.UpdateName(this.baseEnemy.name); }