Beispiel #1
0
 public void ConfirmTrigger()
 {
     if (triggerMessage == "BloodThirsty")
     {
         trigger.BloodThirsty();
     }
     else if (triggerMessage == "AfterMove")
     {
         trigger.AfterMove();
     }
     else if (triggerMessage == "InEnemyCastle")
     {
         trigger.InEnemyCastle();
     }
     else if (triggerMessage == "InEnemyRegion")
     {
         trigger.InEnemyRegion();
     }
     else if (triggerMessage == "InEnemyPalace")
     {
         trigger.InEnemyPalace();
     }
     else if (triggerMessage == "AtEnemyBottom")
     {
         trigger.AtEnemyBottom();
     }
     CancelTrigger();
 }
Beispiel #2
0
    private static void Move(GameObject target, Location from, Location to, bool upload = true)
    {
        /// Set Location Data
        if (upload)
        {
            new GameEvent(from, to, Login.playerID).Upload();
        }
        OnEnterGame.gameInfo.Move(from, to);
        target.GetComponent <PieceInfo>().piece.location = to;
        target.transform.parent        = boardCanvas.Find(to.ToString());
        target.transform.localPosition = Vector3.Lerp(target.transform.localPosition, new Vector3(0, 0, target.transform.position.z), speed);
        GameObject fromObject = boardSetup.pieces[from];

        boardSetup.pieces.Remove(from);
        boardSetup.pieces.Add(to, fromObject);

        if (OnEnterGame.gameInfo.traps.ContainsKey(to))
        {
            onEnterGame.TriggerTrap(to);
        }
        // need to add game events
        Trigger trigger = target.GetComponent <PieceInfo>().trigger;

        trigger.AfterMove();
        if (boardAttributes.InEnemyRegion(to.x, to.y))
        {
            trigger.InEnemyRegion();
        }
        else if (boardAttributes.InEnemyPalace(to.x, to.y))
        {
            trigger.InEnemyRegion();
        }
        else if (boardAttributes.InEnemyCastle(to.x, to.y))
        {
            trigger.InEnemyCastle();
        }
        else if (boardAttributes.AtEnemyBottom(to.x, to.y))
        {
            trigger.AtEnemyBottom();
        }
        //onEnterGame.AskTrigger(pieceInfo.piece, trigger, "AfterMove");
        //if (boardAttributes.InEnemyRegion(to.x, to.y)) onEnterGame.AskTrigger(pieceInfo.piece, trigger, "InEnemyRegion");
        //else if (boardAttributes.InEnemyPalace(to.x, to.y)) onEnterGame.AskTrigger(pieceInfo.piece, trigger, "InEnemyPalace");
        //else if (boardAttributes.InEnemyCastle(to.x, to.y)) onEnterGame.AskTrigger(pieceInfo.piece, trigger, "InEnemyCastle");
        //else if (boardAttributes.AtEnemyBottom(to.x,to.y)) onEnterGame.AskTrigger(pieceInfo.piece, trigger, "AtEnemyBottom");
    }