Beispiel #1
0
    public override IEnumerator Execute(PlayerManager pm, CardActionExecutor cae, int currentAction)
    {
        Vector3Int[]      enemyAdjs      = GridHelper.GetAdjacentTiles(pm.EnemyCoords());
        List <Vector3Int> standableTiles = new List <Vector3Int>();

        for (int i = 0; i < enemyAdjs.Length; ++i)
        {
            if (GridHelper.CanStandOn(enemyAdjs[i]))
            {
                standableTiles.Add(enemyAdjs[i]);
            }
        }

        if (standableTiles.Count > 0)
        {
            int    random = Random.Range(0, standableTiles.Count);
            Pommel pommel = PhotonNetwork.Instantiate(
                "Prefabs/Items/Pommel",
                GridHelper.grid.CellToWorld(standableTiles[random]),
                Quaternion.identity).GetComponent <Pommel>();
            pommel.photonView.RPC("SetSpawner", RpcTarget.All, pm.photonView.ViewID);
        }

        cae.cardPlayState[currentAction] = 1;
        yield return(null);
    }
Beispiel #2
0
    public Sword(int _bladeWeaponSet, int _gripWeaponSet, int _guardWeaponSet, int _pommelWeaponSet)
    {
        //		transform.gameObject.AddComponent<Blade> ();
        //		transform.gameObject.AddComponent<Grip> ();
        //		transform.gameObject.AddComponent<Guard> ();
        //		transform.gameObject.AddComponent<Pommel> ();
        //
        //		blade = transform.gameObject.GetComponent<Blade> ();
        //		grip = transform.gameObject.GetComponent<Grip> ();
        //		guard = transform.gameObject.GetComponent<Guard> ();
        //		pommel = transform.gameObject.GetComponent<Pommel> ();

        blade = new Blade (_bladeWeaponSet);
        grip = new Grip (_gripWeaponSet);
        guard = new Guard (_guardWeaponSet);
        pommel = new Pommel (_pommelWeaponSet);
    }