Example #1
0
    public void AddEnemyToBattle(RPGCharacter ch)
    {
        UnityEngine.Assertions.Assert.AreEqual(ch.GetCamp(), EnumCharacterCamp.Enemy);
        RPGEnemy player = ch as RPGEnemy;

        enemies.Enemies.Add(player);
    }
Example #2
0
 public void SetEnemy(RPGEnemy e)
 {
     if (transform.childCount > 0)
     {
         transform.DetachChildren();
     }
     _enemy = e;
     e.transform.parent = transform;
     SceneManager.LoadScene(0);
 }
Example #3
0
    public static RPGEnemy Create(int id, CharacterAttribute customAttribute = null)
    {
        EnemyDef def = ResourceManager.GetEnemyDef(id);
        RPGEnemy r   = new RPGEnemy(def);

        if (customAttribute != null)
        {
            r.logic.SetAttribute(customAttribute);
        }
        return(r);
    }
Example #4
0
	public void PreloadArena(List<PhotonPlayer> admissionPlayers, int enemyID, int newOwnerID, int newViewID )
	
	{
		arenaState = ArenaState.waitingForPlayersToLoad;
		Debug.Log("preloading Arena data");
		admittedPlayers = admissionPlayers;
		rpgEnemy = Storage.LoadById<RPGEnemy>(enemyID, new RPGEnemy());
		ownerViewID = newViewID;
		ownerID = newOwnerID;
		SpawnEnemyWave(0);

		//instantiate enemy
	}
Example #5
0
 public override void OnEnter()
 {
     if (UseDefaultAttribute)
     {
         Attribute = null;
     }
     if (Camp == EnumCharacterCamp.Player)
     {
         RPGCharacter ch = RPGPlayer.Create(ID, Attribute);
         gameMode.BattlePlayer.AddUnitToMap(ch, Coord);
     }
     if (Camp == EnumCharacterCamp.Enemy)
     {
         RPGCharacter ch = RPGEnemy.Create(ID, Attribute);
         gameMode.BattlePlayer.AddUnitToMap(ch, Coord);
     }
     Continue();
 }
Example #6
0
	protected override void StartNewIItem()
	{
		currentItem = new RPGEnemy();
	}
Example #7
0
    public static RPGEnemy Create(CharacterInfo info)
    {
        RPGEnemy r = new RPGEnemy(info);

        return(r);
    }
	void Start () {
        _battle = FindObjectOfType<RPGBattle>();
        _player = _battle._player;
        _enemy = _battle._enemy;
	}
Example #9
0
	public void NetworkCleanUp()
	{
		Debug.Log("clean up arena");
		for (int i = 0; i < enemyFSMs.Count; i++) 
		{
			Destroy(enemyFSMs[i].gameObject);
		}
		rpgEnemy = null;
		ownerID = 0;
		ownerViewID = 0;
		playerCharacterStatuses.Clear();
		photonPlayers.Clear();
		admittedPlayers.Clear();
		enemyFSMs.Clear();
		arenaState = ArenaState.inactive;
	}