예제 #1
0
    public void ChangeWeapon(int newWeapon)
    {
        thePlayerStats.RemoveStatsToCharacter(weapons[activeWeapon].GetComponent <WARStats>().strength,
                                              weapons[activeWeapon].GetComponent <WARStats>().defense,
                                              weapons[activeWeapon].GetComponent <WARStats>().magicAtt,
                                              weapons[activeWeapon].GetComponent <WARStats>().magicDef,
                                              weapons[activeWeapon].GetComponent <WARStats>().speed,
                                              weapons[activeWeapon].GetComponent <WARStats>().luck,
                                              weapons[activeWeapon].GetComponent <WARStats>().accuracy);
        weapons[activeWeapon].SetActive(false);

        weapons[newWeapon].SetActive(true);
        activeWeapon = newWeapon;

        thePlayerStats.AddStatsToCharacter(weapons[newWeapon].GetComponent <WARStats>().strength,
                                           weapons[newWeapon].GetComponent <WARStats>().defense,
                                           weapons[newWeapon].GetComponent <WARStats>().magicAtt,
                                           weapons[newWeapon].GetComponent <WARStats>().magicDef,
                                           weapons[newWeapon].GetComponent <WARStats>().speed,
                                           weapons[newWeapon].GetComponent <WARStats>().luck,
                                           weapons[newWeapon].GetComponent <WARStats>().accuracy);


        FindObjectOfType <UIManager>().ChangeAvatarImage(weapons[activeWeapon].GetComponent <SpriteRenderer>().sprite);
    }
예제 #2
0
    public void ChangeAccesory(int newAccesory)
    {
        thePlayerStats.RemoveStatsToCharacter(accesories[activeAccesory].GetComponent <WARStats>().strength,
                                              accesories[activeAccesory].GetComponent <WARStats>().defense,
                                              accesories[activeAccesory].GetComponent <WARStats>().magicAtt,
                                              accesories[activeAccesory].GetComponent <WARStats>().magicDef,
                                              accesories[activeAccesory].GetComponent <WARStats>().speed,
                                              accesories[activeAccesory].GetComponent <WARStats>().luck,
                                              accesories[activeAccesory].GetComponent <WARStats>().accuracy);
        accesories[activeAccesory].SetActive(false);
        accesories[newAccesory].SetActive(true);
        activeAccesory = newAccesory;

        thePlayerStats.AddStatsToCharacter(accesories[newAccesory].GetComponent <WARStats>().strength,
                                           accesories[newAccesory].GetComponent <WARStats>().defense,
                                           accesories[newAccesory].GetComponent <WARStats>().magicAtt,
                                           accesories[newAccesory].GetComponent <WARStats>().magicDef,
                                           accesories[newAccesory].GetComponent <WARStats>().speed,
                                           accesories[newAccesory].GetComponent <WARStats>().luck,
                                           accesories[newAccesory].GetComponent <WARStats>().accuracy);
    }
예제 #3
0
    public void ChangeArmor(int newArmor)
    {
        thePlayerStats.RemoveStatsToCharacter(armors[activeArmor].GetComponent <WARStats>().strength,
                                              armors[activeArmor].GetComponent <WARStats>().defense,
                                              armors[activeArmor].GetComponent <WARStats>().magicAtt,
                                              armors[activeArmor].GetComponent <WARStats>().magicDef,
                                              armors[activeArmor].GetComponent <WARStats>().speed,
                                              armors[activeArmor].GetComponent <WARStats>().luck,
                                              armors[activeArmor].GetComponent <WARStats>().accuracy);
        armors[activeArmor].SetActive(false);
        armors[newArmor].SetActive(true);
        activeArmor = newArmor;

        thePlayerStats.AddStatsToCharacter(armors[newArmor].GetComponent <WARStats>().strength,
                                           armors[newArmor].GetComponent <WARStats>().defense,
                                           armors[newArmor].GetComponent <WARStats>().magicAtt,
                                           armors[newArmor].GetComponent <WARStats>().magicDef,
                                           armors[newArmor].GetComponent <WARStats>().speed,
                                           armors[newArmor].GetComponent <WARStats>().luck,
                                           armors[newArmor].GetComponent <WARStats>().accuracy);
    }