コード例 #1
0
    public void AddStatusEffect(BuffsAndDebuffs buffAndDebuff, float percentage, float duration, int attacker)
    {
        GameObject   attackingPokemon = PhotonView.Find(attacker).gameObject;
        StatusEffect effect           = new StatusEffect(buffAndDebuff, percentage, duration);

        hud.playerPokemonPortrait.SpawnStatusEffectIcon(effect);
        AddBuffDebuff(buffAndDebuff, percentage, duration, attackingPokemon);
        StatusEffect.Add(effect);
        if (attackingPokemon != gameObject && attackingPokemon.GetComponent <Pokemon>().isCaptured&& !PokemonToGiveEXPTo.Contains(attacker))
        {
            PokemonToGiveEXPTo.Add(attacker);
        }
    }
コード例 #2
0
 public void RemoveBuffDebuff(BuffsAndDebuffs buffOrDebuff, float percentage, float duration, GameObject attacker)
 {
     if (buffOrDebuff == BuffsAndDebuffs.ACC_DWN)
     {
         accuracy = accuracy + percentage;
     }
     if (buffOrDebuff == BuffsAndDebuffs.ACC_UP)
     {
         accuracy = accuracy - percentage;
     }
     if (buffOrDebuff == BuffsAndDebuffs.ACC_DWN)
     {
         evasion = evasion + percentage;
     }
     if (buffOrDebuff == BuffsAndDebuffs.ACC_UP)
     {
         evasion = evasion - percentage;
     }
     if (buffOrDebuff == BuffsAndDebuffs.ATK_DWN)
     {
         curATK = (int)(curATK + ((float)maxATK * percentage));
     }
     if (buffOrDebuff == BuffsAndDebuffs.ATK_UP)
     {
         curATK = (int)(curATK - ((float)maxATK * percentage));
     }
     if (buffOrDebuff == BuffsAndDebuffs.DEF_DWN)
     {
         curDEF = (int)(curDEF + ((float)maxDEF * percentage));
     }
     if (buffOrDebuff == BuffsAndDebuffs.DEF_UP)
     {
         curDEF = (int)(curDEF - ((float)maxDEF * percentage));
     }
     if (buffOrDebuff == BuffsAndDebuffs.SPATK_DWN)
     {
         curSPATK = (int)(curSPATK + ((float)maxSPATK * percentage));
     }
     if (buffOrDebuff == BuffsAndDebuffs.SPATK_UP)
     {
         curSPATK = (int)(curSPATK - ((float)maxSPATK * percentage));
     }
     if (buffOrDebuff == BuffsAndDebuffs.SPDEF_DWN)
     {
         curSPDEF = (int)(curSPDEF + ((float)maxSPDEF * percentage));
     }
     if (buffOrDebuff == BuffsAndDebuffs.SPDEF_UP)
     {
         curSPDEF = (int)(curSPDEF - ((float)maxSPDEF * percentage));
     }
     if (buffOrDebuff == BuffsAndDebuffs.SPD_DWN)
     {
         curSPD = (int)(curSPD + ((float)maxSPD * percentage));
     }
     if (buffOrDebuff == BuffsAndDebuffs.SPD_UP)
     {
         curSPD = (int)(curSPD - ((float)maxSPD * percentage));
     }
     if (buffOrDebuff == BuffsAndDebuffs.BURNED)
     {
         burned = false;
     }
     if (buffOrDebuff == BuffsAndDebuffs.FROZEN)
     {
         frozen = false;
     }
     if (buffOrDebuff == BuffsAndDebuffs.PARALYZED)
     {
         paralyzed = false;
     }
     if (buffOrDebuff == BuffsAndDebuffs.POISONED)
     {
         poisoned = false;
     }
     if (buffOrDebuff == BuffsAndDebuffs.SEEDED)
     {
         seeded   = false;
         seededBy = null;
     }
     if (buffOrDebuff == BuffsAndDebuffs.SLEEPING)
     {
         sleeping = false;
         WakeUp();
     }
 }