public Cannoneer GetCannoneer(Ship ship) { Cannoneer cannoneer; if (!cannoneers.TryGetValue(ship.id, out cannoneer)) { cannoneers.Add(ship.id, cannoneer = new Cannoneer(ship.id, this)); } return(cannoneer); }
public void SpawnCharacters() { //Spawn Archer Cell cell = SearchFreeCell(); GameObject prefab = Resources.Load("Archer") as GameObject; GameObject gameObject = (GameObject)GameObject.Instantiate(prefab, new Vector3(cell.transform.position.x, cell.transform.position.y, -9.6f), transform.rotation); Archer archer = gameObject.GetComponent <Archer>(); archer.owner = owner; cell.hoverCharacter = archer; archer.actualCell = cell; owner.characters.Add(archer); //Spawn Canoneer cell = SearchFreeCell(); prefab = Resources.Load("Cannoneer") as GameObject; gameObject = (GameObject)GameObject.Instantiate(prefab, new Vector3(cell.transform.position.x, cell.transform.position.y, -9.6f), transform.rotation); Cannoneer cannoneer = gameObject.GetComponent <Cannoneer>(); cannoneer.owner = owner; cell.hoverCharacter = cannoneer; cannoneer.actualCell = cell; owner.characters.Add(cannoneer); //Spawn King cell = SearchFreeCell(); prefab = Resources.Load("King") as GameObject; gameObject = (GameObject)GameObject.Instantiate(prefab, new Vector3(cell.transform.position.x, cell.transform.position.y, -9.6f), transform.rotation); King king = gameObject.GetComponent <King>(); king.owner = owner; cell.hoverCharacter = king; king.actualCell = cell; owner.characters.Add(king); //Spawn Archer cell = SearchFreeCell(); prefab = Resources.Load("Mage") as GameObject; gameObject = (GameObject)GameObject.Instantiate(prefab, new Vector3(cell.transform.position.x, cell.transform.position.y, -9.6f), transform.rotation); Mage mage = gameObject.GetComponent <Mage>(); mage.owner = owner; cell.hoverCharacter = mage; mage.actualCell = cell; owner.characters.Add(mage); foreach (Character character in owner.characters) { SetCharacterSprite(character); } SetCharacterSprite(this); }
public static void NewClass() { Cannoneer.Clear(); Cannoneer.level = 0; CurrentGame.game.memoryGeneral.impClassProgress.cannoneer.level = 0; CurrentGame.game.memoryGeneral.impClassProgress.cannoneer.name = "Cannoneer"; CurrentGame.game.memoryGeneral.impClassProgress.cannoneer.movement = 5; CurrentGame.game.memoryGeneral.impClassProgress.cannoneer.classWeapons.classWeapon1.type = "Ranged"; CurrentGame.game.memoryGeneral.impClassProgress.cannoneer.classWeapons.classWeapon1.rank = 3; CurrentGame.game.memoryGeneral.impClassProgress.cannoneer.classWeapons.classWeapon2.type = "Close"; CurrentGame.game.memoryGeneral.impClassProgress.cannoneer.classWeapons.classWeapon2.rank = 3; CurrentGame.game.memoryGeneral.impClassProgress.cannoneer.caps = Cannoneer.Caplist(); LevelUpClass(); }
private void InitCannoneer() { cannoneer = new Cannoneer(this); }