コード例 #1
0
ファイル: p2Cell.cs プロジェクト: Yetij/LumberjackDuel
    public void OnPlayerPlantTree(AbsTree t, p2Player p, int deltaTurn)
    {
        tree = t;
        tree.OnBeingPlant(p, deltaTurn);

        t.transform.position = transform.position;
        t.cell = this;
    }
コード例 #2
0
    virtual public void OnBeingPlant(p2Player p, int deltaTurn)
    {
        turnToLifeCounter = defaultTurnToLife + deltaTurn;
        p2Scene.Instance.treesInScene.Add(this);

        fx      = 0;
        fz      = 0;
        dealDmg = false;
        state   = TreeState.InSeed;
        graphicalModel.localScale = startScale;
    }
コード例 #3
0
    //List<p2FallRecord > markedToFallList = new List<p2FallRecord>();
//	bool hasJobInThisTurn = false;

    public void OnPlayerChop(p2Player p, p2Cell chopedCell, int acCost)
    {
        if (chopedCell.tree != null)
        {
            chopedCell.tree.OnBeingChoped(p, p.currentCell, 0, acCost);
        }
        if (chopedCell.player != null & chopedCell.player != p)
        {
            chopedCell.player.OnBeingChoped(p, acCost);
        }
    }
コード例 #4
0
ファイル: p2Cell.cs プロジェクト: Yetij/LumberjackDuel
 public void Reset()
 {
     if (tree != null)
     {
         tree.gameObject.SetActive(false);
     }
     tree   = null;
     player = null;
     highlight.SetActive(false);
     selected.SetActive(false);
 }
コード例 #5
0
    virtual public void OnBeingChoped(p2Player player, p2Cell sourceCell, int tier, int acCost = 0)
    {
        if (state == TreeState.Falling | state == TreeState.WaitDomino)
        {
            return;
        }
        fx     = cell.x - sourceCell.x;
        fz     = cell.z - sourceCell.z;
        choper = player;

        ActivateOnChop(player, ref fx, ref fz);

        if (!(fx == 0 & fz == 0))
        {
            if (tier == 0)
            {
                player.OnChopDone(acCost);
            }
            fallingQuat     = Angle.Convert(fx, fz);
            dominoDelayTime = tier * p2Scene.Instance.globalDominoDelay;

            if (PassDominoFuther())
            {
                p2Cell c;
                if ((c = cell.Get(fx, fz)) != null)
                {
                    if (c.tree == null ? false : c.tree.CanBeAffectedByDomino())
                    {
                        c.tree.OnBeingChoped(player, cell, tier + 1);
                    }
                    else
                    {
                        player.OnCredit(tier);
                    }
                }
                else
                {
                    player.OnCredit(tier);
                }
            }
            else
            {
                player.OnCredit(state == TreeState.InSeed? tier - 1 : tier);
            }

            dealDmg = state != TreeState.InSeed;
            state   = TreeState.WaitDomino;
        }
    }
コード例 #6
0
ファイル: p2Player.cs プロジェクト: Yetij/LumberjackDuel
 public void OnBeingChoped(p2Player chopper, int acCost)
 {
     if (photonView.isMine & basic.hp > 0)
     {
         chopper.OnChopDone(acCost);
         if (bonus.hp > 0)
         {
             bonus.hp--;
         }
         else
         {
             basic.hp--;
         }
         gui.myHp.text = "HP: " + (basic.hp + bonus.hp).ToString();
         if (basic.hp == 0)
         {
             globalScene.OnVictoryConditionsReached(chopper.photonView.owner.ID);
         }
     }
 }
コード例 #7
0
ファイル: p2Scene.cs プロジェクト: Yetij/LumberjackDuel
    public void OnPlayerReady(p2Player p)
    {
        if (!players.Contains(p))
        {
            players.Add(p);
        }
        p.gameObject.SetActive(false);

        if (!PhotonNetwork.isMasterClient & player_verf_count >= PhotonNetwork.room.maxPlayers)
        {
            photonView.RPC("NonMasterClientReady", PhotonTargets.MasterClient);
        }

        if (PhotonNetwork.isMasterClient & player_verf_count >= PhotonNetwork.room.maxPlayers)
        {
            masterReady = true;
            if (nonMasterReady & !_run)
            {
                photonView.RPC("OnGameStart", PhotonTargets.All, Random.Range(0, 2));
            }
        }
    }
コード例 #8
0
 virtual protected void ActivateOnFall(p2Player player)
 {
 }
コード例 #9
0
 virtual protected void ActivateOnChop(p2Player player, ref int fx, ref int fz)
 {
 }
コード例 #10
0
ファイル: p2Scene.cs プロジェクト: Yetij/LumberjackDuel
 public void OnBackgroundStart(p2Player invoker, int treenb)
 {
     SceneGenTree(treenb);
     photonView.RPC("_OnBackgroundStart", PhotonTargets.All);
 }
コード例 #11
0
ファイル: AbsBuff.cs プロジェクト: Yetij/LumberjackDuel
 virtual public void OnBuffRemovedFromPlayer(p2Player p)
 {
     targets.Remove(p);
 }
コード例 #12
0
ファイル: AbsBuff.cs プロジェクト: Yetij/LumberjackDuel
 virtual public void ApplyBuff(p2Player _target)
 {
     targets.Add(_target);
 }
コード例 #13
0
ファイル: AbsBuff.cs プロジェクト: Yetij/LumberjackDuel
 abstract protected void Activate(p2Player _invoker);
コード例 #14
0
ファイル: p2Cell.cs プロジェクト: Yetij/LumberjackDuel
 public void OnPlayerMoveOut( )
 {
     this.player = null;
 }
コード例 #15
0
ファイル: p2Cell.cs プロジェクト: Yetij/LumberjackDuel
 public void OnPlayerMoveIn(p2Player player)
 {
     player.transform.position = transform.position;
     player.currentCell        = this;
     this.player = player;
 }