Class: Oakdex::Battle::StatusConditions::Paralysis

Inherits:
NonVolatile show all
Defined in:
lib/oakdex/battle/status_conditions/paralysis.rb

Overview

Represents Paralysis status condition

Instance Attribute Summary

Attributes inherited from Base

#pokemon

Instance Method Summary collapse

Methods inherited from NonVolatile

#after_fainted

Methods inherited from Base

#after_fainted, #after_received_damage, #after_switched_out, #after_turn, #before_turn, #damage_modifier, #initialize

Constructor Details

This class inherits a constructor from Oakdex::Battle::StatusConditions::Base

Instance Method Details

#prevents_move?(move_execution) ⇒ Boolean

Returns:

  • (Boolean)


11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/oakdex/battle/status_conditions/paralysis.rb', line 11

def prevents_move?(move_execution)
  if rand(1..100) <= 25
    move_execution
      .battle
      .add_to_log('paralysed',
                  move_execution.pokemon.trainer.name,
                  move_execution.pokemon.name)
    true
  else
    false
  end
end

#stat_modifier(stat) ⇒ Object



6
7
8
9
# File 'lib/oakdex/battle/status_conditions/paralysis.rb', line 6

def stat_modifier(stat)
  return 0.5 if stat == :speed
  super
end