Advertisement
Wolfrost

PokeBattle_BattlerEffects TRADUZIONE ITA

Jun 28th, 2016
1,896
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 41.31 KB | None | 0 0
  1. class PokeBattle_Battler
  2. #===============================================================================
  3. # Sleep
  4. #===============================================================================
  5.   def pbCanSleep?(attacker,showMessages,move=nil,ignorestatus=false)
  6.     return false if isFainted?
  7.     selfsleep=(attacker && attacker.index==self.index)
  8.     if !ignorestatus && status==PBStatuses::SLEEP
  9.       @battle.pbDisplay(_INTL("{1} sta già dormendo!",pbThis)) if showMessages
  10.       return false
  11.     end
  12.     if !selfsleep
  13.       if self.status!=0 ||
  14.          (@effects[PBEffects::Substitute]>0 && (!move || !move.ignoresSubstitute?(attacker)))
  15.         @battle.pbDisplay(_INTL("Ma fallisce!")) if showMessages
  16.         return false
  17.       end
  18.     end
  19.     if !self.isAirborne?(attacker && attacker.hasMoldBreaker)
  20.       if @battle.field.effects[PBEffects::ElectricTerrain]>0
  21.         @battle.pbDisplay(_INTL("Il terreno elettrico ha impedito a {1} di addormentarsi!",pbThis(true))) if showMessages
  22.         return false
  23.       elsif @battle.field.effects[PBEffects::MistyTerrain]>0
  24.         @battle.pbDisplay(_INTL("Il campo nebbioso ha impedito a {1} di addormentarsi!",pbThis(true))) if showMessages
  25.         return false
  26.       end
  27.     end
  28.     if (attacker && attacker.hasMoldBreaker) || !hasWorkingAbility(:SOUNDPROOF)
  29.       for i in 0...4
  30.         if @battle.battlers[i].effects[PBEffects::Uproar]>0
  31.           @battle.pbDisplay(_INTL("Ma la baraonda tiene {1} sveglio!",pbThis(true))) if showMessages
  32.           return false
  33.         end
  34.       end
  35.     end
  36.     if !attacker || attacker.index==self.index || !attacker.hasMoldBreaker
  37.       if hasWorkingAbility(:VITALSPIRIT) ||
  38.          hasWorkingAbility(:INSOMNIA) ||
  39.          hasWorkingAbility(:SWEETVEIL) ||
  40.          (hasWorkingAbility(:FLOWERVEIL) && pbHasType?(:GRASS)) ||
  41.          (hasWorkingAbility(:LEAFGUARD) && (@battle.pbWeather==PBWeather::SUNNYDAY ||
  42.                                             @battle.pbWeather==PBWeather::HARSHSUN))
  43.         abilityname=PBAbilities.getName(self.ability)
  44.         @battle.pbDisplay(_INTL("{1} è rimasto sveglio grazie a {2}!",pbThis,abilityname)) if showMessages
  45.         return false
  46.       end
  47.       if pbPartner.hasWorkingAbility(:SWEETVEIL) ||
  48.          (pbPartner.hasWorkingAbility(:FLOWERVEIL) && pbHasType?(:GRASS))
  49.         abilityname=PBAbilities.getName(pbPartner.ability)
  50.         @battle.pbDisplay(_INTL("{1} è rimasto sveglio grazie a {2} del Pokémon compagno!",pbThis,abilityname)) if showMessages
  51.         return false
  52.       end
  53.     end
  54.     if !selfsleep
  55.       if pbOwnSide.effects[PBEffects::Safeguard]>0 &&
  56.          (!attacker || !attacker.hasWorkingAbility(:INFILTRATOR))
  57.         @battle.pbDisplay(_INTL("Il team di {1} è protetto da Salvaguardia!",pbThis)) if showMessages
  58.         return false
  59.       end
  60.     end
  61.     return true
  62.   end
  63.  
  64.   def pbCanSleepYawn?
  65.     return false if status!=0
  66.     if !hasWorkingAbility(:SOUNDPROOF)
  67.       for i in 0...4
  68.         return false if @battle.battlers[i].effects[PBEffects::Uproar]>0
  69.       end
  70.     end
  71.     if !self.isAirborne?
  72.       return false if @battle.field.effects[PBEffects::ElectricTerrain]>0
  73.       return false if @battle.field.effects[PBEffects::MistyTerrain]>0
  74.     end
  75.     if hasWorkingAbility(:VITALSPIRIT) ||
  76.        hasWorkingAbility(:INSOMNIA) ||
  77.        hasWorkingAbility(:SWEETVEIL) ||
  78.        (hasWorkingAbility(:LEAFGUARD) && (@battle.pbWeather==PBWeather::SUNNYDAY ||
  79.                                           @battle.pbWeather==PBWeather::HARSHSUN))
  80.       return false
  81.     end
  82.     return false if pbPartner.hasWorkingAbility(:SWEETVEIL)
  83.     return true
  84.   end
  85.  
  86.   def pbSleep(msg=nil)
  87.     self.status=PBStatuses::SLEEP
  88.     self.statusCount=2+@battle.pbRandom(3)
  89.     self.statusCount=(self.statusCount/2).floor if self.hasWorkingAbility(:EARLYBIRD)
  90.     pbCancelMoves
  91.     @battle.pbCommonAnimation("Sleep",self,nil)
  92.     if msg && msg!=""
  93.       @battle.pbDisplay(msg)
  94.     else
  95.       @battle.pbDisplay(_INTL("{1} si è addormentato!",pbThis))
  96.     end
  97.     PBDebug.log("[Status change] #{pbThis} fell asleep (#{self.statusCount} turns)")
  98.   end
  99.  
  100.   def pbSleepSelf(duration=-1)
  101.     self.status=PBStatuses::SLEEP
  102.     if duration>0
  103.       self.statusCount=duration
  104.     else
  105.       self.statusCount=2+@battle.pbRandom(3)
  106.     end
  107.     self.statusCount=(self.statusCount/2).floor if self.hasWorkingAbility(:EARLYBIRD)
  108.     pbCancelMoves
  109.     @battle.pbCommonAnimation("Sleep",self,nil)
  110.     PBDebug.log("[Status change] #{pbThis} made itself fall asleep (#{self.statusCount} turns)")
  111.   end
  112.  
  113. #===============================================================================
  114. # Poison
  115. #===============================================================================
  116.   def pbCanPoison?(attacker,showMessages,move=nil)
  117.     return false if isFainted?
  118.     if status==PBStatuses::POISON
  119.       @battle.pbDisplay(_INTL("{1} è già avvelenato.",pbThis)) if showMessages
  120.       return false
  121.     end
  122.     if self.status!=0 ||
  123.        (@effects[PBEffects::Substitute]>0 && (!move || !move.ignoresSubstitute?(attacker)))
  124.       @battle.pbDisplay(_INTL("Ma fallisce!")) if showMessages
  125.       return false
  126.     end
  127.     if (pbHasType?(:POISON) || pbHasType?(:STEEL)) && !hasWorkingItem(:RINGTARGET)
  128.       @battle.pbDisplay(_INTL("Non ha effetto su {1}...",pbThis(true))) if showMessages
  129.       return false
  130.     end
  131.     if @battle.field.effects[PBEffects::MistyTerrain]>0 &&
  132.        !self.isAirborne?(attacker && attacker.hasMoldBreaker)
  133.       @battle.pbDisplay(_INTL("Il campo nebbioso ha impedito a {1} di essere avvelenato!",pbThis(true))) if showMessages
  134.       return false
  135.     end
  136.     if !attacker || !attacker.hasMoldBreaker
  137.       if hasWorkingAbility(:IMMUNITY) ||
  138.          (hasWorkingAbility(:FLOWERVEIL) && pbHasType?(:GRASS)) ||
  139.          (hasWorkingAbility(:LEAFGUARD) && (@battle.pbWeather==PBWeather::SUNNYDAY ||
  140.                                             @battle.pbWeather==PBWeather::HARSHSUN))
  141.         @battle.pbDisplay(_INTL("{2} di {1} impedisce l'avvelenamento!",pbThis,PBAbilities.getName(self.ability))) if showMessages
  142.         return false
  143.       end
  144.       if pbPartner.hasWorkingAbility(:FLOWERVEIL) && pbHasType?(:GRASS)
  145.         abilityname=PBAbilities.getName(pbPartner.ability)
  146.         @battle.pbDisplay(_INTL("{2} del partner di {1} impedisce l'avvelenamento!",pbThis,abilityname)) if showMessages
  147.         return false
  148.       end
  149.     end
  150.     if pbOwnSide.effects[PBEffects::Safeguard]>0 &&
  151.        (!attacker || !attacker.hasWorkingAbility(:INFILTRATOR))
  152.       @battle.pbDisplay(_INTL("Il team di {1} è protetto da Salvaguardia!",pbThis)) if showMessages
  153.       return false
  154.     end
  155.     return true
  156.   end
  157.  
  158.   def pbCanPoisonSynchronize?(opponent)
  159.     return false if isFainted?
  160.     if (pbHasType?(:POISON) || pbHasType?(:STEEL)) && !hasWorkingItem(:RINGTARGET)
  161.       @battle.pbDisplay(_INTL("{2} di {1} non ha avuto effetto su {3}!",
  162.          opponent.pbThis,PBAbilities.getName(opponent.ability),pbThis(true)))
  163.       return false
  164.     end  
  165.     return false if self.status!=0
  166.     if hasWorkingAbility(:IMMUNITY) ||
  167.        (hasWorkingAbility(:FLOWERVEIL) && pbHasType?(:GRASS)) ||
  168.        (hasWorkingAbility(:LEAFGUARD) && (@battle.pbWeather==PBWeather::SUNNYDAY ||
  169.                                           @battle.pbWeather==PBWeather::HARSHSUN))
  170.       @battle.pbDisplay(_INTL("{2} di {1} impedisce a {4} di {3} di funzionare!",
  171.          pbThis,PBAbilities.getName(self.ability),
  172.          opponent.pbThis(true),PBAbilities.getName(opponent.ability)))
  173.       return false
  174.     end
  175.     if pbPartner.hasWorkingAbility(:FLOWERVEIL) && pbHasType?(:GRASS)
  176.       @battle.pbDisplay(_INTL("{2} di {1} impedisce a {4} di {3} di funzionare!",
  177.          pbPartner.pbThis,PBAbilities.getName(pbPartner.ability),
  178.          opponent.pbThis(true),PBAbilities.getName(opponent.ability)))
  179.       return false
  180.     end
  181.     return true
  182.   end
  183.  
  184.   def pbCanPoisonSpikes?(moldbreaker=false)
  185.     return false if isFainted?
  186.     return false if self.status!=0
  187.     return false if pbHasType?(:POISON) || pbHasType?(:STEEL)
  188.     if !moldbreaker
  189.       return false if hasWorkingAbility(:IMMUNITY) ||
  190.                       (hasWorkingAbility(:FLOWERVEIL) && pbHasType?(:GRASS)) ||
  191.                       (pbPartner.hasWorkingAbility(:FLOWERVEIL) && pbHasType?(:GRASS))
  192.       return false if hasWorkingAbility(:LEAFGUARD) &&
  193.                       (@battle.pbWeather==PBWeather::SUNNYDAY ||
  194.                       @battle.pbWeather==PBWeather::HARSHSUN)
  195.     end
  196.     return false if pbOwnSide.effects[PBEffects::Safeguard]>0
  197.     return true
  198.   end
  199.  
  200.   def pbPoison(attacker,msg=nil,toxic=false)
  201.     self.status=PBStatuses::POISON
  202.     self.statusCount=(toxic) ? 1 : 0
  203.     self.effects[PBEffects::Toxic]=0
  204.     @battle.pbCommonAnimation("Poison",self,nil)
  205.     if msg && msg!=""
  206.       @battle.pbDisplay(msg)
  207.     else
  208.       if toxic
  209.         @battle.pbDisplay(_INTL("{1} è iperavvelenato!",pbThis))
  210.       else
  211.         @battle.pbDisplay(_INTL("{1} è avvelenato!",pbThis))
  212.       end
  213.     end
  214.     if toxic
  215.       PBDebug.log("[Status change] #{pbThis} was badly poisoned]")
  216.     else
  217.       PBDebug.log("[Status change] #{pbThis} was poisoned")
  218.     end
  219.     if attacker && self.index!=attacker.index &&
  220.        self.hasWorkingAbility(:SYNCHRONIZE)
  221.       if attacker.pbCanPoisonSynchronize?(self)
  222.         PBDebug.log("[Ability triggered] #{self.pbThis}'s Synchronize")
  223.         attacker.pbPoison(nil,_INTL("{2} di {1} ha avvelenato {3}!",self.pbThis,
  224.            PBAbilities.getName(self.ability),attacker.pbThis(true)),toxic)
  225.       end
  226.     end
  227.   end
  228.  
  229. #===============================================================================
  230. # Burn
  231. #===============================================================================
  232.   def pbCanBurn?(attacker,showMessages,move=nil)
  233.     return false if isFainted?
  234.     if self.status==PBStatuses::BURN
  235.       @battle.pbDisplay(_INTL("{1} ha già una scottatura.",pbThis)) if showMessages
  236.       return false
  237.     end
  238.     if self.status!=0 ||
  239.        (@effects[PBEffects::Substitute]>0 && (!move || !move.ignoresSubstitute?(attacker)))
  240.       @battle.pbDisplay(_INTL("Ma fallisce!")) if showMessages
  241.       return false
  242.     end
  243.     if @battle.field.effects[PBEffects::MistyTerrain]>0 &&
  244.        !self.isAirborne?(attacker && attacker.hasMoldBreaker)
  245.       @battle.pbDisplay(_INTL("Il campo nebbioso ha impedito a {1} di scottarsi!",pbThis(true))) if showMessages
  246.       return false
  247.     end
  248.     if pbHasType?(:FIRE) && !hasWorkingItem(:RINGTARGET)
  249.       @battle.pbDisplay(_INTL("Non ha effetto su {1}...",pbThis(true))) if showMessages
  250.       return false
  251.     end
  252.     if !attacker || !attacker.hasMoldBreaker
  253.       if hasWorkingAbility(:WATERVEIL) ||
  254.          (hasWorkingAbility(:FLOWERVEIL) && pbHasType?(:GRASS)) ||
  255.          (hasWorkingAbility(:LEAFGUARD) && (@battle.pbWeather==PBWeather::SUNNYDAY ||
  256.                                             @battle.pbWeather==PBWeather::HARSHSUN))
  257.         @battle.pbDisplay(_INTL("{2} di {1} impedisce la scottatura!",pbThis,PBAbilities.getName(self.ability))) if showMessages
  258.         return false
  259.       end
  260.       if pbPartner.hasWorkingAbility(:FLOWERVEIL) && pbHasType?(:GRASS)
  261.         abilityname=PBAbilities.getName(pbPartner.ability)
  262.         @battle.pbDisplay(_INTL("{2} del partner di {1} impedisce la scottatura!",pbThis,abilityname)) if showMessages
  263.         return false
  264.       end
  265.     end
  266.     if pbOwnSide.effects[PBEffects::Safeguard]>0 &&
  267.        (!attacker || !attacker.hasWorkingAbility(:INFILTRATOR))
  268.       @battle.pbDisplay(_INTL("Il team di {1} è protetto da Salvaguardia!",pbThis)) if showMessages
  269.       return false
  270.     end
  271.     return true
  272.   end
  273.  
  274.   def pbCanBurnSynchronize?(opponent)
  275.     return false if isFainted?
  276.     return false if self.status!=0
  277.     if pbHasType?(:FIRE) && !hasWorkingItem(:RINGTARGET)
  278.        @battle.pbDisplay(_INTL("{2} di {1} non ha avuto effetto su {3}!",
  279.           opponent.pbThis,PBAbilities.getName(opponent.ability),pbThis(true)))
  280.        return false
  281.     end  
  282.     if hasWorkingAbility(:WATERVEIL) ||
  283.        (hasWorkingAbility(:FLOWERVEIL) && pbHasType?(:GRASS)) ||
  284.        (hasWorkingAbility(:LEAFGUARD) && (@battle.pbWeather==PBWeather::SUNNYDAY ||
  285.                                           @battle.pbWeather==PBWeather::HARSHSUN))
  286.       @battle.pbDisplay(_INTL("{2} di {1} impedisce a {4} di {3} di funzionare!",
  287.          pbThis,PBAbilities.getName(self.ability),
  288.          opponent.pbThis(true),PBAbilities.getName(opponent.ability)))
  289.       return false
  290.     end
  291.     if pbPartner.hasWorkingAbility(:FLOWERVEIL) && pbHasType?(:GRASS)
  292.       @battle.pbDisplay(_INTL("{2} di {1} impedisce a {4} di {3} di funzionare!",
  293.          pbPartner.pbThis,PBAbilities.getName(pbPartner.ability),
  294.          opponent.pbThis(true),PBAbilities.getName(opponent.ability)))
  295.       return false
  296.     end
  297.     return true
  298.   end
  299.  
  300.   def pbBurn(attacker,msg=nil)
  301.     self.status=PBStatuses::BURN
  302.     self.statusCount=0
  303.     @battle.pbCommonAnimation("Burn",self,nil)
  304.     if msg && msg!=""
  305.       @battle.pbDisplay(msg)
  306.     else
  307.       @battle.pbDisplay(_INTL("{1} si è scottato!",pbThis))
  308.     end
  309.     PBDebug.log("[Status change] #{pbThis} was burned")
  310.     if attacker && self.index!=attacker.index &&
  311.        self.hasWorkingAbility(:SYNCHRONIZE)
  312.       if attacker.pbCanBurnSynchronize?(self)
  313.         PBDebug.log("[Ability triggered] #{self.pbThis}'s Synchronize")
  314.         attacker.pbBurn(nil,_INTL("{2} di {1} ha scottato {3}!",self.pbThis,
  315.            PBAbilities.getName(self.ability),attacker.pbThis(true)))
  316.       end
  317.     end
  318.   end
  319.  
  320. #===============================================================================
  321. # Paralyze
  322. #===============================================================================
  323.   def pbCanParalyze?(attacker,showMessages,move=nil)
  324.     return false if isFainted?
  325.     if status==PBStatuses::PARALYSIS
  326.       @battle.pbDisplay(_INTL("{1} è già paralizzato!",pbThis)) if showMessages
  327.       return false
  328.     end
  329.     if self.status!=0 ||
  330.        (@effects[PBEffects::Substitute]>0 && (!move || !move.ignoresSubstitute?(attacker)))
  331.       @battle.pbDisplay(_INTL("Ma fallisce!")) if showMessages
  332.       return false
  333.     end
  334.     if @battle.field.effects[PBEffects::MistyTerrain]>0 &&
  335.        !self.isAirborne?(attacker && attacker.hasMoldBreaker)
  336.       @battle.pbDisplay(_INTL("Il campo nebbioso impedisce la paralisi di {1}!",pbThis(true))) if showMessages
  337.       return false
  338.     end
  339.     if pbHasType?(:ELECTRIC) && !hasWorkingItem(:RINGTARGET) && USENEWBATTLEMECHANICS
  340.       @battle.pbDisplay(_INTL("Non ha effetto su {1}...",pbThis(true))) if showMessages
  341.       return false
  342.     end
  343.     if !attacker || !attacker.hasMoldBreaker
  344.       if hasWorkingAbility(:LIMBER) ||
  345.          (hasWorkingAbility(:FLOWERVEIL) && pbHasType?(:GRASS)) ||
  346.          (hasWorkingAbility(:LEAFGUARD) && (@battle.pbWeather==PBWeather::SUNNYDAY ||
  347.                                             @battle.pbWeather==PBWeather::HARSHSUN))
  348.         @battle.pbDisplay(_INTL("{2} di {1} impedisce la paralisi!",pbThis,PBAbilities.getName(self.ability))) if showMessages
  349.         return false
  350.       end
  351.       if pbPartner.hasWorkingAbility(:FLOWERVEIL) && pbHasType?(:GRASS)
  352.         abilityname=PBAbilities.getName(pbPartner.ability)
  353.         @battle.pbDisplay(_INTL("{2} del partner di {1} impedisce la paralisi!",pbThis,abilityname)) if showMessages
  354.         return false
  355.       end
  356.     end
  357.     if pbOwnSide.effects[PBEffects::Safeguard]>0 &&
  358.        (!attacker || !attacker.hasWorkingAbility(:INFILTRATOR))
  359.       @battle.pbDisplay(_INTL("Il team di {1} è protetto da Salvaguardia!",pbThis)) if showMessages
  360.       return false
  361.     end
  362.     return true
  363.   end
  364.  
  365.   def pbCanParalyzeSynchronize?(opponent)
  366.     return false if self.status!=0
  367.     return false if @battle.field.effects[PBEffects::MistyTerrain]>0 && !self.isAirborne?
  368.     return false if pbHasType?(:ELECTRIC) && !hasWorkingItem(:RINGTARGET) && USENEWBATTLEMECHANICS
  369.     if hasWorkingAbility(:LIMBER) ||
  370.        (hasWorkingAbility(:FLOWERVEIL) && pbHasType?(:GRASS)) ||
  371.        (hasWorkingAbility(:LEAFGUARD) && (@battle.pbWeather==PBWeather::SUNNYDAY ||
  372.                                           @battle.pbWeather==PBWeather::HARSHSUN))
  373.       @battle.pbDisplay(_INTL("{2} di {1} impedisce a {4} di {3} di funzionare!",
  374.          pbThis,PBAbilities.getName(self.ability),
  375.          opponent.pbThis(true),PBAbilities.getName(opponent.ability)))
  376.       return false
  377.     end
  378.     if pbPartner.hasWorkingAbility(:FLOWERVEIL) && pbHasType?(:GRASS)
  379.       @battle.pbDisplay(_INTL("{2} di {1} impedisce a {4} di {3} di funzionare!",
  380.          pbPartner.pbThis,PBAbilities.getName(pbPartner.ability),
  381.          opponent.pbThis(true),PBAbilities.getName(opponent.ability)))
  382.       return false
  383.     end
  384.     return true
  385.   end
  386.  
  387.   def pbParalyze(attacker,msg=nil)
  388.     self.status=PBStatuses::PARALYSIS
  389.     self.statusCount=0
  390.     @battle.pbCommonAnimation("Paralysis",self,nil)
  391.     if msg && msg!=""
  392.       @battle.pbDisplay(msg)
  393.     else
  394.       @battle.pbDisplay(_INTL("{1} è paralizzato! Forse non riuscirà ad attaccare!",pbThis))
  395.     end
  396.     PBDebug.log("[Status change] #{pbThis} was paralyzed")
  397.     if attacker && self.index!=attacker.index &&
  398.        self.hasWorkingAbility(:SYNCHRONIZE)
  399.       if attacker.pbCanParalyzeSynchronize?(self)
  400.         PBDebug.log("[Ability triggered] #{self.pbThis}'s Synchronize")
  401.         attacker.pbParalyze(nil,_INTL("{2} di {1} ha paralizzato {3}! Forse non riuscirà ad attaccare!",
  402.            self.pbThis,PBAbilities.getName(self.ability),attacker.pbThis(true)))
  403.       end
  404.     end
  405.   end
  406.  
  407. #===============================================================================
  408. # Freeze
  409. #===============================================================================
  410.   def pbCanFreeze?(attacker,showMessages,move=nil)
  411.     return false if isFainted?
  412.     if status==PBStatuses::FROZEN
  413.       @battle.pbDisplay(_INTL("{1} è già congelato!",pbThis)) if showMessages
  414.       return false
  415.     end
  416.     if self.status!=0 ||
  417.        (@effects[PBEffects::Substitute]>0 && (!move || !move.ignoresSubstitute?(attacker))) ||
  418.        @battle.pbWeather==PBWeather::SUNNYDAY ||
  419.        @battle.pbWeather==PBWeather::HARSHSUN
  420.       @battle.pbDisplay(_INTL("Ma fallisce!")) if showMessages
  421.       return false
  422.     end
  423.     if pbHasType?(:ICE) && !hasWorkingItem(:RINGTARGET)
  424.       @battle.pbDisplay(_INTL("Non ha effetto su {1}...",pbThis(true))) if showMessages
  425.       return false
  426.     end
  427.     if @battle.field.effects[PBEffects::MistyTerrain]>0 &&
  428.        !self.isAirborne?(attacker && attacker.hasMoldBreaker)
  429.       @battle.pbDisplay(_INTL("Il campo nebbioso ha impedito a {1} di congelarsi!",pbThis(true))) if showMessages
  430.       return false
  431.     end
  432.     if !attacker || !attacker.hasMoldBreaker
  433.       if hasWorkingAbility(:MAGMAARMOR) ||
  434.          (hasWorkingAbility(:FLOWERVEIL) && pbHasType?(:GRASS)) ||
  435.          (hasWorkingAbility(:LEAFGUARD) && (@battle.pbWeather==PBWeather::SUNNYDAY ||
  436.                                             @battle.pbWeather==PBWeather::HARSHSUN))
  437.         @battle.pbDisplay(_INTL("{2} di {1} impedisce il congelamento!",pbThis,PBAbilities.getName(self.ability))) if showMessages
  438.         return false
  439.       end
  440.       if pbPartner.hasWorkingAbility(:FLOWERVEIL) && pbHasType?(:GRASS)
  441.         abilityname=PBAbilities.getName(pbPartner.ability)
  442.         @battle.pbDisplay(_INTL("{2} del partner di {1} impedisce il congelamento!",pbThis,abilityname)) if showMessages
  443.         return false
  444.       end
  445.     end
  446.     if pbOwnSide.effects[PBEffects::Safeguard]>0 &&
  447.        (!attacker || !attacker.hasWorkingAbility(:INFILTRATOR))
  448.       @battle.pbDisplay(_INTL("Il team di {1} è protetto da Salvaguardia!",pbThis)) if showMessages
  449.       return false
  450.     end
  451.     return true
  452.   end
  453.  
  454.   def pbFreeze(msg=nil)
  455.     self.status=PBStatuses::FROZEN
  456.     self.statusCount=0
  457.     pbCancelMoves
  458.     @battle.pbCommonAnimation("Frozen",self,nil)
  459.     if msg && msg!=""
  460.       @battle.pbDisplay(msg)
  461.     else
  462.       @battle.pbDisplay(_INTL("{1} è stato congelato!",pbThis))
  463.     end
  464.     PBDebug.log("[Status change] #{pbThis} was frozen")
  465.   end
  466.  
  467. #===============================================================================
  468. # Generalised status displays
  469. #===============================================================================
  470.   def pbContinueStatus(showAnim=true)
  471.     case self.status
  472.     when PBStatuses::SLEEP
  473.       @battle.pbCommonAnimation("Sleep",self,nil)
  474.       @battle.pbDisplay(_INTL("{1} è addormentato.",pbThis))
  475.     when PBStatuses::POISON
  476.       @battle.pbCommonAnimation("Poison",self,nil)
  477.       @battle.pbDisplay(_INTL("{1} è stato danneggiato dal veleno!",pbThis))
  478.     when PBStatuses::BURN
  479.       @battle.pbCommonAnimation("Burn",self,nil)
  480.       @battle.pbDisplay(_INTL("{1} è stato danneggiato dalla scottatura!",pbThis))
  481.     when PBStatuses::PARALYSIS
  482.       @battle.pbCommonAnimation("Paralysis",self,nil)
  483.       @battle.pbDisplay(_INTL("{1} è paralizzato! Non può agire!",pbThis))
  484.     when PBStatuses::FROZEN
  485.       @battle.pbCommonAnimation("Frozen",self,nil)
  486.       @battle.pbDisplay(_INTL("{1} è congelato!",pbThis))
  487.     end
  488.   end
  489.  
  490.   def pbCureStatus(showMessages=true)
  491.     oldstatus=self.status
  492.     self.status=0
  493.     self.statusCount=0
  494.     if showMessages
  495.       case oldstatus
  496.       when PBStatuses::SLEEP
  497.         @battle.pbDisplay(_INTL("{1} si è svegliato!",pbThis))
  498.       when PBStatuses::POISON
  499.       when PBStatuses::BURN
  500.       when PBStatuses::PARALYSIS
  501.         @battle.pbDisplay(_INTL("La paralisi di {1} è stata curata.",pbThis))
  502.       when PBStatuses::FROZEN
  503.         @battle.pbDisplay(_INTL("{1} si è scongelato!",pbThis))
  504.       end
  505.     end
  506.     PBDebug.log("[Status change] #{pbThis}'s status was cured")
  507.   end
  508.  
  509. #===============================================================================
  510. # Confuse
  511. #===============================================================================
  512.   def pbCanConfuse?(attacker=nil,showMessages=true,move=nil)
  513.     return false if isFainted?
  514.     if effects[PBEffects::Confusion]>0
  515.       @battle.pbDisplay(_INTL("{1} è già confuso!",pbThis)) if showMessages
  516.       return false
  517.     end
  518.     if @effects[PBEffects::Substitute]>0 && (!move || !move.ignoresSubstitute?(attacker))
  519.       @battle.pbDisplay(_INTL("Ma fallisce!")) if showMessages
  520.       return false
  521.     end
  522.     if !attacker || !attacker.hasMoldBreaker
  523.       if hasWorkingAbility(:OWNTEMPO)
  524.         @battle.pbDisplay(_INTL("{2} di {1} impedisce la confusione!",pbThis,PBAbilities.getName(self.ability))) if showMessages
  525.         return false
  526.       end
  527.     end
  528.     if pbOwnSide.effects[PBEffects::Safeguard]>0 &&
  529.        (!attacker || !attacker.hasWorkingAbility(:INFILTRATOR))
  530.       @battle.pbDisplay(_INTL("Il team di {1} è protetto da Salvaguardia!",pbThis)) if showMessages
  531.       return false
  532.     end
  533.     return true
  534.   end
  535.  
  536.   def pbCanConfuseSelf?(showMessages)
  537.     return false if isFainted?
  538.     if effects[PBEffects::Confusion]>0
  539.       @battle.pbDisplay(_INTL("{1} è già confuso!",pbThis)) if showMessages
  540.       return false
  541.     end
  542.     if hasWorkingAbility(:OWNTEMPO)
  543.       @battle.pbDisplay(_INTL("{2} di {1} impedisce la confusione!",pbThis,PBAbilities.getName(self.ability))) if showMessages
  544.       return false
  545.     end
  546.     return true
  547.   end
  548.  
  549.   def pbConfuse
  550.     @effects[PBEffects::Confusion]=2+@battle.pbRandom(4)
  551.     @battle.pbCommonAnimation("Confusion",self,nil)
  552.     PBDebug.log("[Lingering effect triggered] #{pbThis} became confused (#{@effects[PBEffects::Confusion]} turns)")
  553.   end
  554.  
  555.   def pbConfuseSelf
  556.     if pbCanConfuseSelf?(false)
  557.       @effects[PBEffects::Confusion]=2+@battle.pbRandom(4)
  558.       @battle.pbCommonAnimation("Confusion",self,nil)
  559.       @battle.pbDisplay(_INTL("{1} è confuso!",pbThis))
  560.       PBDebug.log("[Lingering effect triggered] #{pbThis} became confused (#{@effects[PBEffects::Confusion]} turns)")
  561.     end
  562.   end
  563.  
  564.   def pbContinueConfusion
  565.     @battle.pbCommonAnimation("Confusion",self,nil)
  566.     @battle.pbDisplayBrief(_INTL("{1} è confuso!",pbThis))
  567.   end
  568.  
  569.   def pbCureConfusion(showMessages=true)
  570.     @effects[PBEffects::Confusion]=0
  571.     @battle.pbDisplay(_INTL("{1} non è più confuso!",pbThis)) if showMessages
  572.     PBDebug.log("[End of effect] #{pbThis} was cured of confusion")
  573.   end
  574.  
  575. #===============================================================================
  576. # Attraction
  577. #===============================================================================
  578.   def pbCanAttract?(attacker,showMessages=true)
  579.     return false if isFainted?
  580.     return false if !attacker || attacker.isFainted?
  581.     if @effects[PBEffects::Attract]>=0
  582.       @battle.pbDisplay(_INTL("Ma fallisce!")) if showMessages
  583.       return false
  584.     end
  585.     agender=attacker.gender
  586.     ogender=self.gender
  587.     if agender==2 || ogender==2 || agender==ogender
  588.       @battle.pbDisplay(_INTL("Ma fallisce!")) if showMessages
  589.       return false
  590.     end
  591.     if (!attacker || !attacker.hasMoldBreaker) && hasWorkingAbility(:OBLIVIOUS)
  592.       @battle.pbDisplay(_INTL("{2} di {1} impedisce l'infatuazione!",pbThis,
  593.          PBAbilities.getName(self.ability))) if showMessages
  594.       return false
  595.     end
  596.     return true
  597.   end
  598.  
  599.   def pbAttract(attacker,msg=nil)
  600.     @effects[PBEffects::Attract]=attacker.index
  601.     @battle.pbCommonAnimation("Attract",self,nil)
  602.     if msg && msg!=""
  603.       @battle.pbDisplay(msg)
  604.     else
  605.       @battle.pbDisplay(_INTL("{1} si è innamorato!",pbThis))
  606.     end
  607.     PBDebug.log("[Lingering effect triggered] #{pbThis} became infatuated (with #{attacker.pbThis(true)})")
  608.     if self.hasWorkingItem(:DESTINYKNOT) &&
  609.        attacker.pbCanAttract?(self,false)
  610.       PBDebug.log("[Item triggered] #{pbThis}'s Destiny Knot")
  611.       attacker.pbAttract(self,_INTL("{1}'s {2} made {3} fall in love!",pbThis,
  612.          PBItems.getName(self.item),attacker.pbThis(true)))
  613.     end
  614.   end
  615.  
  616.   def pbAnnounceAttract(seducer)
  617.     @battle.pbCommonAnimation("Attract",self,nil)
  618.     @battle.pbDisplayBrief(_INTL("{1} è innamorato di {2}!",
  619.        pbThis,seducer.pbThis(true)))
  620.   end
  621.  
  622.   def pbContinueAttract
  623.     @battle.pbDisplay(_INTL("{1} è innamorato! Non può attaccare!",pbThis))
  624.   end
  625.  
  626.   def pbCureAttract
  627.     @effects[PBEffects::Attract]=-1
  628.     PBDebug.log("[End of effect] #{pbThis} was cured of infatuation")
  629.   end
  630.  
  631. #===============================================================================
  632. # Flinching
  633. #===============================================================================
  634.   def pbFlinch(attacker)
  635.     return false if (!attacker || !attacker.hasMoldBreaker) && hasWorkingAbility(:INNERFOCUS)
  636.     @effects[PBEffects::Flinch]=true
  637.     return true
  638.   end
  639.  
  640. #===============================================================================
  641. # Increase stat stages
  642. #===============================================================================
  643.   def pbTooHigh?(stat)
  644.     return @stages[stat]>=6
  645.   end
  646.  
  647.   def pbCanIncreaseStatStage?(stat,attacker=nil,showMessages=false,move=nil,moldbreaker=false,ignoreContrary=false)
  648.     if !moldbreaker
  649.       if !attacker || attacker.index==self.index || !attacker.hasMoldBreaker
  650.         if hasWorkingAbility(:CONTRARY) && !ignoreContrary
  651.           return pbCanReduceStatStage?(stat,attacker,showMessages,moldbreaker,true)
  652.         end
  653.       end
  654.     end
  655.     return false if isFainted?
  656.     if pbTooHigh?(stat)
  657.       @battle.pbDisplay(_INTL("{2} di {1} non può aumentare!",
  658.          pbThis,PBStats.getName(stat))) if showMessages
  659.       return false
  660.     end
  661.     return true
  662.   end
  663.  
  664.   def pbIncreaseStatBasic(stat,increment,attacker=nil,moldbreaker=false,ignoreContrary=false)
  665.     if !moldbreaker
  666.       if !attacker || attacker.index==self.index || !attacker.hasMoldBreaker
  667.         if hasWorkingAbility(:CONTRARY) && !ignoreContrary
  668.           return pbReduceStatBasic(stat,increment,attacker,moldbreaker,true)
  669.         end
  670.         increment*=2 if hasWorkingAbility(:SIMPLE)
  671.       end
  672.     end
  673.     increment=[increment,6-@stages[stat]].min
  674.     PBDebug.log("[Stat change] #{pbThis}'s #{PBStats.getName(stat)} rose by #{increment} stage(s) (was #{@stages[stat]}, now #{@stages[stat]+increment})")
  675.     @stages[stat]+=increment
  676.     return increment
  677.   end
  678.  
  679.   def pbIncreaseStat(stat,increment,attacker,showMessages,move=nil,upanim=true,moldbreaker=false,ignoreContrary=false)
  680.     if !moldbreaker
  681.       if !attacker || attacker.index==self.index || !attacker.hasMoldBreaker
  682.         if hasWorkingAbility(:CONTRARY) && !ignoreContrary
  683.           return pbReduceStat(stat,increment,attacker,showMessages,move,upanim,moldbreaker,true)
  684.         end
  685.       end
  686.     end
  687.     return false if stat!=PBStats::ATTACK && stat!=PBStats::DEFENSE &&
  688.                     stat!=PBStats::SPATK && stat!=PBStats::SPDEF &&
  689.                     stat!=PBStats::SPEED && stat!=PBStats::EVASION &&
  690.                     stat!=PBStats::ACCURACY
  691.     if pbCanIncreaseStatStage?(stat,attacker,showMessages,move,moldbreaker,ignoreContrary)
  692.       increment=pbIncreaseStatBasic(stat,increment,attacker,moldbreaker,ignoreContrary)
  693.       if increment>0
  694.         if ignoreContrary
  695.           @battle.pbDisplay(_INTL("{2} di {1} attivato!",pbThis,PBAbilities.getName(self.ability))) if upanim
  696.         end
  697.         @battle.pbCommonAnimation("StatUp",self,nil) if upanim
  698.         arrStatTexts=[_INTL("{2} di {1} aumenta!",pbThis,PBStats.getName(stat)),
  699.            _INTL("{2} di {1} aumenta velocemente!",pbThis,PBStats.getName(stat)),
  700.            _INTL("{2} di {1} aumenta drasticamente!",pbThis,PBStats.getName(stat))]
  701.         @battle.pbDisplay(arrStatTexts[[increment-1,2].min])
  702.         return true
  703.       end
  704.     end
  705.     return false
  706.   end
  707.  
  708.   def pbIncreaseStatWithCause(stat,increment,attacker,cause,showanim=true,showmessage=true,moldbreaker=false,ignoreContrary=false)
  709.     if !moldbreaker
  710.       if !attacker || attacker.index==self.index || !attacker.hasMoldBreaker
  711.         if hasWorkingAbility(:CONTRARY) && !ignoreContrary
  712.           return pbReduceStatWithCause(stat,increment,attacker,cause,showanim,showmessage,moldbreaker,true)
  713.         end
  714.       end
  715.     end
  716.     return false if stat!=PBStats::ATTACK && stat!=PBStats::DEFENSE &&
  717.                     stat!=PBStats::SPATK && stat!=PBStats::SPDEF &&
  718.                     stat!=PBStats::SPEED && stat!=PBStats::EVASION &&
  719.                     stat!=PBStats::ACCURACY
  720.     if pbCanIncreaseStatStage?(stat,attacker,false,nil,moldbreaker,ignoreContrary)
  721.       increment=pbIncreaseStatBasic(stat,increment,attacker,moldbreaker,ignoreContrary)
  722.       if increment>0
  723.         if ignoreContrary
  724.           @battle.pbDisplay(_INTL("{2} di {1} attivato!",pbThis,PBAbilities.getName(self.ability))) if upanim
  725.         end
  726.         @battle.pbCommonAnimation("StatUp",self,nil) if showanim
  727.         if attacker.index==self.index
  728.           arrStatTexts=[_INTL("{2} di {1} ha aumentato {3}!",pbThis,cause,PBStats.getName(stat)),
  729.              _INTL("{2} di {1} ha aumentato {3} velocemente!",pbThis,cause,PBStats.getName(stat)),
  730.              _INTL("{2} di {1} aumenta a vista d'occhio!",pbThis,PBStats.getName(stat))]
  731.         else
  732.           arrStatTexts=[_INTL("{2} di {1} ha aumentato {4} di {3}!",attacker.pbThis,cause,pbThis(true),PBStats.getName(stat)),
  733.              _INTL("{2} di {1} ha aumentato velocemente {4} di {3}!",attacker.pbThis,cause,pbThis(true),PBStats.getName(stat)),
  734.              _INTL("{2} di {1} ha aumentato drasticamente {4} di {3}!",attacker.pbThis,cause,pbThis(true),PBStats.getName(stat))]
  735.         end
  736.         @battle.pbDisplay(arrStatTexts[[increment-1,2].min]) if showmessage
  737.         return true
  738.       end
  739.     end
  740.     return false
  741.   end
  742.  
  743. #===============================================================================
  744. # Decrease stat stages
  745. #===============================================================================
  746.   def pbTooLow?(stat)
  747.     return @stages[stat]<=-6
  748.   end
  749.  
  750.   # Tickle (04A) and Noble Roar (13A) can't use this, but replicate it instead.
  751.   # (Reason is they lowers more than 1 stat independently, and therefore could
  752.   # show certain messages twice which is undesirable.)
  753.   def pbCanReduceStatStage?(stat,attacker=nil,showMessages=false,move=nil,moldbreaker=false,ignoreContrary=false)
  754.     if !moldbreaker
  755.       if !attacker || attacker.index==self.index || !attacker.hasMoldBreaker
  756.         if hasWorkingAbility(:CONTRARY) && !ignoreContrary
  757.           return pbCanIncreaseStatStage?(stat,attacker,showMessages,move,moldbreaker,true)
  758.         end
  759.       end
  760.     end
  761.     return false if isFainted?
  762.     selfreduce=(attacker && attacker.index==self.index)
  763.     if !selfreduce
  764.       if @effects[PBEffects::Substitute]>0 && (!move || !move.ignoresSubstitute?(attacker))
  765.         @battle.pbDisplay(_INTL("Ma fallisce!")) if showMessages
  766.         return false
  767.       end
  768.       if pbOwnSide.effects[PBEffects::Mist]>0 &&
  769.         (!attacker || !attacker.hasWorkingAbility(:INFILTRATOR))
  770.         @battle.pbDisplay(_INTL("{1} è protetto dalla Nebbia!",pbThis)) if showMessages
  771.         return false
  772.       end
  773.       if !moldbreaker && (!attacker || !attacker.hasMoldBreaker)
  774.         if hasWorkingAbility(:CLEARBODY) || hasWorkingAbility(:WHITESMOKE)
  775.           abilityname=PBAbilities.getName(self.ability)
  776.           @battle.pbDisplay(_INTL("{2} di {1} impedisce l'abbassamento di statistiche!",pbThis,abilityname)) if showMessages
  777.           return false
  778.         end
  779.         if pbHasType?(:GRASS)
  780.           if hasWorkingAbility(:FLOWERVEIL)
  781.             abilityname=PBAbilities.getName(self.ability)
  782.             @battle.pbDisplay(_INTL("{2} di {1} impedisce l'abbassamento di statistiche!",pbThis,abilityname)) if showMessages
  783.             return false
  784.           elsif pbPartner.hasWorkingAbility(:FLOWERVEIL)
  785.             abilityname=PBAbilities.getName(pbPartner.ability)
  786.             @battle.pbDisplay(_INTL("{2} di {1} impedisce a {3} l'abbassamento di statistiche!",pbPartner.pbThis,abilityname,pbThis(true))) if showMessages
  787.             return false
  788.           end
  789.         end
  790.         if stat==PBStats::ATTACK && hasWorkingAbility(:HYPERCUTTER)
  791.           abilityname=PBAbilities.getName(self.ability)
  792.           @battle.pbDisplay(_INTL("{2} di {1} impedisce la perdita di Attacco",pbThis,abilityname)) if showMessages
  793.           return false
  794.         end
  795.         if stat==PBStats::DEFENSE && hasWorkingAbility(:BIGPECKS)
  796.           abilityname=PBAbilities.getName(self.ability)
  797.           @battle.pbDisplay(_INTL("{2} di {1} impedisce la perdita di Difesa!",pbThis,abilityname)) if showMessages
  798.           return false
  799.         end
  800.         if stat==PBStats::ACCURACY && hasWorkingAbility(:KEENEYE)
  801.           abilityname=PBAbilities.getName(self.ability)
  802.           @battle.pbDisplay(_INTL("{2} di {1} impedisce la perdita di precisione!",pbThis,abilityname)) if showMessages
  803.           return false
  804.         end
  805.       end
  806.     end
  807.     if pbTooLow?(stat)
  808.       @battle.pbDisplay(_INTL("{2} di {1} non può scendere oltre!",
  809.          pbThis,PBStats.getName(stat))) if showMessages
  810.       return false
  811.     end
  812.     return true
  813.   end
  814.  
  815.   def pbReduceStatBasic(stat,increment,attacker=nil,moldbreaker=false,ignoreContrary=false)
  816.     if !moldbreaker # moldbreaker is true only when Roar forces out a Pokémon into Sticky Web
  817.       if !attacker || attacker.index==self.index || !attacker.hasMoldBreaker
  818.         if hasWorkingAbility(:CONTRARY) && !ignoreContrary
  819.           return pbIncreaseStatBasic(stat,increment,attacker,moldbreaker,true)
  820.         end
  821.         increment*=2 if hasWorkingAbility(:SIMPLE)
  822.       end
  823.     end
  824.     increment=[increment,6+@stages[stat]].min
  825.     PBDebug.log("[Stat change] #{pbThis}'s #{PBStats.getName(stat)} fell by #{increment} stage(s) (was #{@stages[stat]}, now #{@stages[stat]-increment})")
  826.     @stages[stat]-=increment
  827.     return increment
  828.   end
  829.  
  830.   def pbReduceStat(stat,increment,attacker,showMessages,move=nil,downanim=true,moldbreaker=false,ignoreContrary=false)
  831.     if !moldbreaker
  832.       if !attacker || attacker.index==self.index || !attacker.hasMoldBreaker
  833.         if hasWorkingAbility(:CONTRARY) && !ignoreContrary
  834.           return pbIncreaseStat(stat,increment,attacker,showMessages,move,downanim,moldbreaker,true)
  835.         end
  836.       end
  837.     end
  838.     return false if stat!=PBStats::ATTACK && stat!=PBStats::DEFENSE &&
  839.                     stat!=PBStats::SPATK && stat!=PBStats::SPDEF &&
  840.                     stat!=PBStats::SPEED && stat!=PBStats::EVASION &&
  841.                     stat!=PBStats::ACCURACY
  842.     if pbCanReduceStatStage?(stat,attacker,showMessages,move,moldbreaker,ignoreContrary)
  843.       increment=pbReduceStatBasic(stat,increment,attacker,moldbreaker,ignoreContrary)
  844.       if increment>0
  845.         if ignoreContrary
  846.           @battle.pbDisplay(_INTL("{2} di {1} attivato!",pbThis,PBAbilities.getName(self.ability))) if downanim
  847.         end
  848.         @battle.pbCommonAnimation("StatDown",self,nil) if downanim
  849.         arrStatTexts=[_INTL("{2} di {1} cala!",pbThis,PBStats.getName(stat)),
  850.            _INTL("{2} di {1} cala parecchio!",pbThis,PBStats.getName(stat)),
  851.            _INTL("{2} di {1} cala a picco!",pbThis,PBStats.getName(stat))]
  852.         @battle.pbDisplay(arrStatTexts[[increment-1,2].min])
  853.         # Defiant
  854.         if hasWorkingAbility(:DEFIANT) && (!attacker || attacker.pbIsOpposing?(self.index))
  855.           pbIncreaseStatWithCause(PBStats::ATTACK,2,self,PBAbilities.getName(self.ability))
  856.         end
  857.         # Competitive
  858.         if hasWorkingAbility(:COMPETITIVE) && (!attacker || attacker.pbIsOpposing?(self.index))
  859.           pbIncreaseStatWithCause(PBStats::SPATK,2,self,PBAbilities.getName(self.ability))
  860.         end
  861.         return true
  862.       end
  863.     end
  864.     return false
  865.   end
  866.  
  867.   def pbReduceStatWithCause(stat,increment,attacker,cause,showanim=true,showmessage=true,moldbreaker=false,ignoreContrary=false)
  868.     if !moldbreaker
  869.       if !attacker || attacker.index==self.index || !attacker.hasMoldBreaker
  870.         if hasWorkingAbility(:CONTRARY) && !ignoreContrary
  871.           return pbIncreaseStatWithCause(stat,increment,attacker,cause,showanim,showmessage,moldbreaker,true)
  872.         end
  873.       end
  874.     end
  875.     return false if stat!=PBStats::ATTACK && stat!=PBStats::DEFENSE &&
  876.                     stat!=PBStats::SPATK && stat!=PBStats::SPDEF &&
  877.                     stat!=PBStats::SPEED && stat!=PBStats::EVASION &&
  878.                     stat!=PBStats::ACCURACY
  879.     if pbCanReduceStatStage?(stat,attacker,false,nil,moldbreaker,ignoreContrary)
  880.       increment=pbReduceStatBasic(stat,increment,attacker,moldbreaker,ignoreContrary)
  881.       if increment>0
  882.         if ignoreContrary
  883.           @battle.pbDisplay(_INTL("{2} di {1} attivato!",pbThis,PBAbilities.getName(self.ability))) if downanim
  884.         end
  885.         @battle.pbCommonAnimation("StatDown",self,nil) if showanim
  886.         if attacker.index==self.index
  887.           arrStatTexts=[_INTL("{2} di {1} ha ridotto {3}!",pbThis,cause,PBStats.getName(stat)),
  888.              _INTL("{2} di {1} ha ridotto di molto {3}!",pbThis,cause,PBStats.getName(stat)),
  889.              _INTL("{2} di {1} ha ridotto di parecchio {3}!",pbThis,PBStats.getName(stat))]
  890.         else
  891.           arrStatTexts=[_INTL("{2} di {1} ha ridotto {4} di {3}!",attacker.pbThis,cause,pbThis(true),PBStats.getName(stat)),
  892.              _INTL("{2} di {1} ha ridotto di molto {4} di {3}!",attacker.pbThis,cause,pbThis(true),PBStats.getName(stat)),
  893.              _INTL("{2} di {1} ha ridotto di parecchio {4} di {3}!",attacker.pbThis,cause,pbThis(true),PBStats.getName(stat))]
  894.         end
  895.         @battle.pbDisplay(arrStatTexts[[increment-1,2].min]) if showmessage
  896.         # Defiant
  897.         if hasWorkingAbility(:DEFIANT) && (!attacker || attacker.pbIsOpposing?(self.index))
  898.           pbIncreaseStatWithCause(PBStats::ATTACK,2,self,PBAbilities.getName(self.ability))
  899.         end
  900.         # Competitive
  901.         if hasWorkingAbility(:COMPETITIVE) && (!attacker || attacker.pbIsOpposing?(self.index))
  902.           pbIncreaseStatWithCause(PBStats::SPATK,2,self,PBAbilities.getName(self.ability))
  903.         end
  904.         return true
  905.       end
  906.     end
  907.     return false
  908.   end
  909.  
  910.   def pbReduceAttackStatIntimidate(opponent)
  911.     return false if isFainted?
  912.     if effects[PBEffects::Substitute]>0
  913.       @battle.pbDisplay(_INTL("Il sostituto di {1} lo ha protetto da {3} di {2}!",
  914.          pbThis,opponent.pbThis(true),PBAbilities.getName(opponent.ability)))
  915.       return false
  916.     end
  917.     if !opponent.hasWorkingAbility(:CONTRARY)
  918.       if pbOwnSide.effects[PBEffects::Mist]>0
  919.         @battle.pbDisplay(_INTL("{1} è protetto da {3} di {2} dalla Nebbia!",
  920.            pbThis,opponent.pbThis(true),PBAbilities.getName(opponent.ability)))
  921.         return false
  922.       end
  923.       if hasWorkingAbility(:CLEARBODY) || hasWorkingAbility(:WHITESMOKE) ||
  924.          hasWorkingAbility(:HYPERCUTTER) ||
  925.          (hasWorkingAbility(:FLOWERVEIL) && pbHasType?(:GRASS))
  926.         abilityname=PBAbilities.getName(self.ability)
  927.         oppabilityname=PBAbilities.getName(opponent.ability)
  928.         @battle.pbDisplay(_INTL("{2} di {1} ha impedito a {4} di {3} di funzionare!",
  929.            pbThis,abilityname,opponent.pbThis(true),oppabilityname))
  930.         return false
  931.       end
  932.       if pbPartner.hasWorkingAbility(:FLOWERVEIL) && pbHasType?(:GRASS)
  933.         abilityname=PBAbilities.getName(pbPartner.ability)
  934.         oppabilityname=PBAbilities.getName(opponent.ability)
  935.         @battle.pbDisplay(_INTL("{2} di {1} ha impedito a {4} di {3} di funzionare!",
  936.            pbPartner.pbThis,abilityname,opponent.pbThis(true),oppabilityname))
  937.         return false
  938.       end
  939.     end
  940.     return pbReduceStatWithCause(PBStats::ATTACK,1,opponent,PBAbilities.getName(opponent.ability))
  941.   end
  942. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement