コード例 #1
0
    public void Melee(int id, int normal, int blunt, int piercing, int poison)
    {
        currentNormalAttack   += normal + currentRage;
        currentBluntAttack    += blunt;
        currentPiercingAttack += piercing;
        currentPoisonttack    += poison;

        GameObject        newEquipment  = (GameObject)Instantiate(weapon, transform.position, transform.rotation);
        Sc_MeleeEquipment newCardScript = newEquipment.GetComponent <Sc_MeleeEquipment>();

        newCardScript.id = id;
    }
コード例 #2
0
 public void EndTurn()
 {
     for (int i = 0; i < currentEquipmentMelee.Count; i++)
     {
         Sc_MeleeEquipment meleeScript = currentEquipmentMelee[i].GetComponent <Sc_MeleeEquipment>();
         meleeScript.moveToDiscard = true;
         // Destroy(currentEquipmentMelee[i]);
     }
     if (currentStage != 10)
     {
         currentStage = 2;
     }
     for (int i = 0; i < currentNumberOfAttacks; i++)
     {
         if (currentNormalAttack + currentBluntAttack + currentPiercingAttack + currentPoisonttack > 0)
         {
             DamageCalc(target: 1, damage: currentNormalAttack, blunt: currentBluntAttack, piercing: currentPiercingAttack, poison: currentPoisonttack);
         }
         else
         {
             DamageCalc(target: 1, damage: currentBrawl);
         }
     }
 }
コード例 #3
0
    public void SaveGameData()
    {
        saveData.isNewGame = false;

        if (scene.name == "Battle")
        {
            saveData.currentDeckSave      = battleManager.currentDeck;
            saveData.currentDiscardSave   = battleManager.currentDiscard;
            saveData.currentBanishedSave  = battleManager.currentBanished;
            saveData.currentStageSave     = battleManager.currentStage;
            saveData.currentApUsedSave    = battleManager.currentApUsed;
            saveData.currentUtilityAPSave = battleManager.currentUtilityAP;
            saveData.currentApMaxSave     = battleManager.currentApMax;
            saveData.currentMonsterSave   = battleManager.monster.monsterID;
            print("Monster id is " + battleManager.monster.monsterID);


            saveData.currentHandObjectsSave.Clear();
            for (int i = 0; i < Sc_BattleManager.currentHandObjects.Count; i++)
            {
                cardInHand = Sc_BattleManager.currentHandObjects[i].GetComponent <Sc_Card>();
                Debug.Log(cardInHand.cardID);
                saveData.currentHandObjectsSave.Add(cardInHand.cardID);
            }

            saveData.currentEquipmentArmorSave.Clear();
            for (int i = 0; i < battleManager.currentEquipmentArmor.Count; i++)
            {
                armorEquipmentSave = battleManager.currentEquipmentArmor[i].GetComponent <Sc_DefenceEquipment>();
                Debug.Log(armorEquipmentSave.id);
                saveData.currentEquipmentArmorSave.Add(armorEquipmentSave.id);
            }
            saveData.currentEquipmentMeleeSave.Clear();
            for (int i = 0; i < battleManager.currentEquipmentMelee.Count; i++)
            {
                meleeEquipmentSave = battleManager.currentEquipmentMelee[i].GetComponent <Sc_MeleeEquipment>();
                Debug.Log(meleeEquipmentSave.id);
                saveData.currentEquipmentMeleeSave.Add(meleeEquipmentSave.id);
            }

            saveData.currentEffectsSave.Clear();
            for (int i = 0; i < battleManager.currentEffects.Count; i++)
            {
                effectSave = battleManager.currentEffects[i];
                Debug.Log(effectSave);
                saveData.currentEffectsSave.Add(effectSave);
            }
        }

        if (scene.name == "Navigation" || scene.name == "Battle")
        {
            saveData.eventsDoneSave  = gameManager.eventsDone;
            saveData.monsterDoneSave = gameManager.monsterDone;
            saveData.fullDeckSave    = gameManager.fullDeck;


            saveData.slayCountSave = gameManager.slayCount;
            saveData.lostCardsSave = gameManager.lostCards;
        }
        if (scene.name == "Navigation")
        {
            saveData.firstEventSave   = navManager.firstEvent;
            saveData.currentEventSave = gameManager.currentEvent;
        }

        SaveDataWrapper wrapper = new SaveDataWrapper();

        wrapper.saveData = saveData;
        string contents = JsonUtility.ToJson(wrapper, true);

        System.IO.File.WriteAllText(path, contents);
    }