Пример #1
0
    private void InitPhysicalAttacks()
    {
        Attacks = new List<csPhysicalPower>();

        var highAttack = new csPhysicalPower()
        {
            Factor = 0.01f,
            Focus = 0.0f,
            Name = "High Kick",
            AttackType = csPhysicalAttack.HighKick,
            CasterLevel = Level,
            BaseStatus = Strength,
            StaminaBase = 10.0f
        };
        highAttack.Init();
        Attacks.Add(highAttack);

        var attack = new csPhysicalPower()
        {
            Factor = 0.01f,
            Focus = 0.0f,
            Name = "Punch",
            AttackType = csPhysicalAttack.Punch,
            CasterLevel = Level,
            BaseStatus = Strength,
            StaminaBase = 10.0f
        };
        attack.Init();
        Attacks.Add(attack);

        var lowAttack = new csPhysicalPower()
        {
            Factor = 0.01f,
            Focus = 0.0f,
            Name = "Low Kick",
            AttackType = csPhysicalAttack.LowKick,
            CasterLevel = Level,
            BaseStatus = Strength,
            StaminaBase = 10.0f
        };
        lowAttack.Init();
        Attacks.Add(lowAttack);
    }
Пример #2
0
 public void OnCmbAttacksChanged(Dropdown dropdown)
 {
     var selectedOption = dropdown.options[dropdown.value];
     PhysicalPower = csGameController.control.Kagotchi.Attacks.FirstOrDefault(i => i.Name == selectedOption.text);
     if (PhysicalPower == null)
         staminaSlider.value += lastSelectedPhysical.Stamina;
     else
     {
         staminaSlider.value -= PhysicalPower.Stamina;
         lastSelectedPhysical = PhysicalPower;
     }
     txtStamina.text = Mathf.Round(staminaSlider.value).ToString() + "%";
 }