コード例 #1
0
 void StartRound()
 {
     battle.NextPhase();
     if (battle.phase == 3)
     {
         Deactivate();
         gameTurn.EndTurn();
     }
     else
     {
         battlePredictions = new BattlePredictions(battle.GetAttacker().GetCurrentStats(), battle.GetDefender().GetCurrentStats());
         if (battle.away is Player)
         {
         }
         else
         {
             if (battle.attacking)
             {
                 battle.SetDefensiveAction((Battle.Action)Mathf.Floor(UnityEngine.Random.value * 3) + 4);
             }
             else
             {
                 battle.SetOffensiveAction((Battle.Action)Mathf.Floor(UnityEngine.Random.value * 3));
             }
         }
         SetupButtons();
     }
 }
コード例 #2
0
ファイル: ItemSpinnerUI.cs プロジェクト: pjrodrig/BasicRPG
    void AddThing(Inventory inventory, int slot)
    {
        InventoryObject inventoryObject = inventoryObjects[slot];

        if (inventoryObject is Item)
        {
            inventory.AddItem((Item)inventoryObject);
        }
        else if (inventoryObject is Scroll)
        {
        }
        // else if(thing is Weapon) {

        // } else if(thing is Shield) {

        // }
        Deactivate();
        gameTurn.EndTurn();
    }