Class: Pokemongodb::Move
- Inherits:
-
Pokemongodb
- Object
- Pokemongodb
- Pokemongodb::Move
- Defined in:
- lib/pokemongodb/move.rb,
lib/pokemongodb/moves/cut.rb,
lib/pokemongodb/moves/dig.rb,
lib/pokemongodb/moves/acid.rb,
lib/pokemongodb/moves/bite.rb,
lib/pokemongodb/moves/lick.rb,
lib/pokemongodb/moves/peck.rb,
lib/pokemongodb/moves/wrap.rb,
lib/pokemongodb/moves/brine.rb,
lib/pokemongodb/moves/ember.rb,
lib/pokemongodb/moves/pound.rb,
lib/pokemongodb/moves/scald.rb,
lib/pokemongodb/moves/spark.rb,
lib/pokemongodb/moves/stomp.rb,
lib/pokemongodb/moves/swift.rb,
lib/pokemongodb/moves/bubble.rb,
lib/pokemongodb/moves/sludge.rb,
lib/pokemongodb/moves/splash.rb,
lib/pokemongodb/moves/tackle.rb,
lib/pokemongodb/moves/psybeam.rb,
lib/pokemongodb/moves/psychic.rb,
lib/pokemongodb/moves/scratch.rb,
lib/pokemongodb/moves/thunder.rb,
lib/pokemongodb/moves/twister.rb,
lib/pokemongodb/moves/aqua_jet.rb,
lib/pokemongodb/moves/blizzard.rb,
lib/pokemongodb/moves/bug_bite.rb,
lib/pokemongodb/moves/bug_buzz.rb,
lib/pokemongodb/moves/bulldoze.rb,
lib/pokemongodb/moves/ice_beam.rb,
lib/pokemongodb/moves/icy_wind.rb,
lib/pokemongodb/moves/low_kick.rb,
lib/pokemongodb/moves/megahorn.rb,
lib/pokemongodb/moves/mud_bomb.rb,
lib/pokemongodb/moves/mud_shot.rb,
lib/pokemongodb/moves/mud_slap.rb,
lib/pokemongodb/moves/psyshock.rb,
lib/pokemongodb/moves/struggle.rb,
lib/pokemongodb/moves/aqua_tail.rb,
lib/pokemongodb/moves/body_slam.rb,
lib/pokemongodb/moves/bone_club.rb,
lib/pokemongodb/moves/confusion.rb,
lib/pokemongodb/moves/discharge.rb,
lib/pokemongodb/moves/drill_run.rb,
lib/pokemongodb/moves/fire_fang.rb,
lib/pokemongodb/moves/gunk_shot.rb,
lib/pokemongodb/moves/heat_wave.rb,
lib/pokemongodb/moves/hurricane.rb,
lib/pokemongodb/moves/ice_punch.rb,
lib/pokemongodb/moves/ice_shard.rb,
lib/pokemongodb/moves/iron_head.rb,
lib/pokemongodb/moves/low_sweep.rb,
lib/pokemongodb/moves/moonblast.rb,
lib/pokemongodb/moves/power_gem.rb,
lib/pokemongodb/moves/rock_tomb.rb,
lib/pokemongodb/moves/seed_bomb.rb,
lib/pokemongodb/moves/vice_grip.rb,
lib/pokemongodb/moves/vine_whip.rb,
lib/pokemongodb/moves/water_gun.rb,
lib/pokemongodb/moves/x_scissor.rb,
lib/pokemongodb/moves/aerial_ace.rb,
lib/pokemongodb/moves/air_cutter.rb,
lib/pokemongodb/moves/cross_chop.rb,
lib/pokemongodb/moves/dark_pulse.rb,
lib/pokemongodb/moves/drill_peck.rb,
lib/pokemongodb/moves/earthquake.rb,
lib/pokemongodb/moves/fire_blast.rb,
lib/pokemongodb/moves/fire_punch.rb,
lib/pokemongodb/moves/hydro_pump.rb,
lib/pokemongodb/moves/hyper_beam.rb,
lib/pokemongodb/moves/hyper_fang.rb,
lib/pokemongodb/moves/leaf_blade.rb,
lib/pokemongodb/moves/metal_claw.rb,
lib/pokemongodb/moves/play_rough.rb,
lib/pokemongodb/moves/poison_jab.rb,
lib/pokemongodb/moves/power_whip.rb,
lib/pokemongodb/moves/psycho_cut.rb,
lib/pokemongodb/moves/razor_leaf.rb,
lib/pokemongodb/moves/rock_slide.rb,
lib/pokemongodb/moves/rock_smash.rb,
lib/pokemongodb/moves/rock_throw.rb,
lib/pokemongodb/moves/solar_beam.rb,
lib/pokemongodb/moves/steel_wing.rb,
lib/pokemongodb/moves/stone_edge.rb,
lib/pokemongodb/moves/submission.rb,
lib/pokemongodb/moves/brick_break.rb,
lib/pokemongodb/moves/bubble_beam.rb,
lib/pokemongodb/moves/dragon_claw.rb,
lib/pokemongodb/moves/flame_burst.rb,
lib/pokemongodb/moves/flame_wheel.rb,
lib/pokemongodb/moves/fury_cutter.rb,
lib/pokemongodb/moves/horn_attack.rb,
lib/pokemongodb/moves/karate_chop.rb,
lib/pokemongodb/moves/magnet_bomb.rb,
lib/pokemongodb/moves/night_slash.rb,
lib/pokemongodb/moves/poison_fang.rb,
lib/pokemongodb/moves/shadow_ball.rb,
lib/pokemongodb/moves/shadow_claw.rb,
lib/pokemongodb/moves/signal_beam.rb,
lib/pokemongodb/moves/sludge_bomb.rb,
lib/pokemongodb/moves/sludge_wave.rb,
lib/pokemongodb/moves/thunderbolt.rb,
lib/pokemongodb/moves/water_pulse.rb,
lib/pokemongodb/moves/wing_attack.rb,
lib/pokemongodb/moves/bullet_punch.rb,
lib/pokemongodb/moves/cross_poison.rb,
lib/pokemongodb/moves/dragon_pulse.rb,
lib/pokemongodb/moves/feint_attack.rb,
lib/pokemongodb/moves/flame_charge.rb,
lib/pokemongodb/moves/flamethrower.rb,
lib/pokemongodb/moves/flash_cannon.rb,
lib/pokemongodb/moves/frost_breath.rb,
lib/pokemongodb/moves/ominous_wind.rb,
lib/pokemongodb/moves/poison_sting.rb,
lib/pokemongodb/moves/quick_attack.rb,
lib/pokemongodb/moves/sucker_punch.rb,
lib/pokemongodb/moves/zen_headbutt.rb,
lib/pokemongodb/moves/ancient_power.rb,
lib/pokemongodb/moves/dragon_breath.rb,
lib/pokemongodb/moves/draining_kiss.rb,
lib/pokemongodb/moves/thunder_punch.rb,
lib/pokemongodb/moves/thunder_shock.rb,
lib/pokemongodb/moves/dazzling_gleam.rb,
lib/pokemongodb/moves/petal_blizzard.rb,
lib/pokemongodb/moves/disarming_voice.rb
Direct Known Subclasses
Acid, AerialAce, AirCutter, AncientPower, AquaJet, AquaTail, Bite, Blizzard, BodySlam, BoneClub, BrickBreak, Brine, Bubble, BubbleBeam, BugBite, BugBuzz, Bulldoze, BulletPunch, Confusion, CrossChop, CrossPoison, Cut, DarkPulse, DazzlingGleam, Dig, DisarmingVoice, Discharge, DragonBreath, DragonClaw, DragonPulse, DrainingKiss, DrillPeck, DrillRun, Earthquake, Ember, FeintAttack, FireBlast, FireFang, FirePunch, FlameBurst, FlameCharge, FlameWheel, Flamethrower, FlashCannon, FrostBreath, FuryCutter, GunkShot, HeatWave, HornAttack, Hurricane, HydroPump, HyperBeam, HyperFang, IceBeam, IcePunch, IceShard, IcyWind, IronHead, KarateChop, LeafBlade, Lick, LowKick, LowSweep, MagnetBomb, Megahorn, MetalClaw, Moonblast, MudBomb, MudShot, MudSlap, NightSlash, OminousWind, Peck, PetalBlizzard, PlayRough, PoisonFang, PoisonJab, PoisonSting, Pound, PowerGem, PowerWhip, Psybeam, Psychic, PsychoCut, Psyshock, QuickAttack, RazorLeaf, RockSlide, RockSmash, RockThrow, RockTomb, Scald, Scratch, SeedBomb, ShadowBall, ShadowClaw, SignalBeam, Sludge, SludgeBomb, SludgeWave, SolarBeam, Spark, Splash, SteelWing, Stomp, StoneEdge, Struggle, Submission, SuckerPunch, Swift, Tackle, Thunder, ThunderPunch, ThunderShock, Thunderbolt, Twister, ViceGrip, VineWhip, WaterGun, WaterPulse, WingAttack, Wrap, XScissor, ZenHeadbutt
Defined Under Namespace
Classes: Acid, AerialAce, AirCutter, AncientPower, AquaJet, AquaTail, Bite, Blizzard, BodySlam, BoneClub, BrickBreak, Brine, Bubble, BubbleBeam, BugBite, BugBuzz, Bulldoze, BulletPunch, Category, Confusion, CrossChop, CrossPoison, Cut, DarkPulse, DazzlingGleam, Dig, DisarmingVoice, Discharge, DragonBreath, DragonClaw, DragonPulse, DrainingKiss, DrillPeck, DrillRun, Earthquake, Ember, FeintAttack, FireBlast, FireFang, FirePunch, FlameBurst, FlameCharge, FlameWheel, Flamethrower, FlashCannon, FrostBreath, FuryCutter, GunkShot, HeatWave, HornAttack, Hurricane, HydroPump, HyperBeam, HyperFang, IceBeam, IcePunch, IceShard, IcyWind, IronHead, KarateChop, LeafBlade, Lick, LowKick, LowSweep, MagnetBomb, Megahorn, MetalClaw, Moonblast, MudBomb, MudShot, MudSlap, NightSlash, OminousWind, Peck, PetalBlizzard, PlayRough, PoisonFang, PoisonJab, PoisonSting, Pound, PowerGem, PowerWhip, Psybeam, Psychic, PsychoCut, Psyshock, QuickAttack, RazorLeaf, RockSlide, RockSmash, RockThrow, RockTomb, Scald, Scratch, SeedBomb, ShadowBall, ShadowClaw, SignalBeam, Sludge, SludgeBomb, SludgeWave, SolarBeam, Spark, Splash, SteelWing, Stomp, StoneEdge, Struggle, Submission, SuckerPunch, Swift, Tackle, Thunder, ThunderPunch, ThunderShock, Thunderbolt, Twister, ViceGrip, VineWhip, WaterGun, WaterPulse, WingAttack, Wrap, XScissor, ZenHeadbutt
Class Method Summary collapse
-
.all ⇒ Object
Returns array of all moves.
-
.category ⇒ Object
Returns category enum based on energy value.
-
.charge ⇒ Object
Returns array of all charge moves.
-
.dps ⇒ Object
Returns float of calculated damage per second.
-
.eps ⇒ Object
Returns float of calculated energy per second.
-
.fast ⇒ Object
Returns array of all fast moves.
-
.used_by ⇒ Object
Returns array of pokemon who can use the move.
Methods inherited from Pokemongodb
Class Method Details
.all ⇒ Object
Returns array of all moves
Example:
>> Pokemongodb::Move.all
=> [Pokemongodb::Move::Acid, Pokemongodb::Move::BugBite, ...]
.category ⇒ Object
Returns category enum based on energy value.
Example:
>> Pokemongodb::Move::Acid.category
=> :fast
>> Pokemongodb::Move::AerielAce.category
=> :charge
150 151 152 |
# File 'lib/pokemongodb/move.rb', line 150 def self.category energy > 0 ? Category::FAST : Category::CHARGE end |
.charge ⇒ Object
Returns array of all charge moves
Example:
>> Pokemongodb::Move.charge
=> [Pokemongodb::Move::AerielAce, Pokemongodb::Move::AirCutter, ...]
159 160 161 162 163 |
# File 'lib/pokemongodb/move.rb', line 159 def self.charge self.all.select do |move| move.category == Category::CHARGE end end |
.dps ⇒ Object
Returns float of calculated damage per second.
Example:
>> Pokemongodb::Move::Acid.dps
=> 9.52
170 171 172 |
# File 'lib/pokemongodb/move.rb', line 170 def self.dps (power / cooldown).round(2) end |
.eps ⇒ Object
Returns float of calculated energy per second.
Example:
>> Pokemongodb::Move::Acid.eps
=> 6.67
179 180 181 |
# File 'lib/pokemongodb/move.rb', line 179 def self.eps (energy / cooldown).round(2) end |
.fast ⇒ Object
Returns array of all fast moves
Example:
>> Pokemongodb::Move.fast
=> [Pokemongodb::Move::Acid, Pokemongodb::Move::BugBite, ...]
188 189 190 191 192 |
# File 'lib/pokemongodb/move.rb', line 188 def self.fast self.all.select do |move| move.category == Category::FAST end end |
.used_by ⇒ Object
Returns array of pokemon who can use the move
Example:
>> Pokemongodb::Move::Acid.used_by
=> [Pokemongodb::Pokemon::Arbok, Pokemongodb::Pokemon::Bellsprout...]
199 200 201 |
# File 'lib/pokemongodb/move.rb', line 199 def self.used_by Pokemongodb::Pokemon.all.select { |x| x.moves.include?(self) } end |