class Weapon

Used w/ Creature and its subclasses. Weapons add to the attacking power of Creature#attack. There are two ways to create one:

1. Directly initialize it
        _weapon_ = Weapon()
        _weapon_ = Weapon _power_
2. Create a subclass
        class _Dragonfire_ < Weapon
                def initialize; @power = _1000_; end
        end

You can change your power after initialization:

(Lets say your weapon was damaged)
_weapon_.power -= _lostPower_
(Now you get it improved)
_weapon_.power += _gainedPower_

end

Attributes

power[RW]

Public Class Methods

new(power) click to toggle source

Creates a new Weapon. Set the original power of the Weapon here. Aliases: Weapon()

# File lib/battlefield.rb, line 40
def initialize(power); @power = power; end