Module: Lich::DragonRealms::DRCS
- Defined in:
- documented/dragonrealms/commons/common-summoning.rb
Class Method Summary collapse
-
.break_summoned_weapon(item) ⇒ void
Breaks the summoned weapon if it exists.
-
.get_ingot(ingot, swap) ⇒ void
Retrieves the specified ingot for use in summoning.
-
.identify_summoned_weapon ⇒ String?
Returns what kind of summoned weapon you’re holding.
-
.pull_summoned_weapon ⇒ void
Pulls the summoned weapon back.
-
.push_summoned_weapon ⇒ void
Pushes the summoned weapon forward.
-
.shape_summoned_weapon(skill, ingot = nil) ⇒ void
Shapes the summoned weapon to a specified skill.
-
.stow_ingot(ingot) ⇒ void
Stows the specified ingot back into inventory.
-
.summon_admittance ⇒ void
Handles the admittance process for summoning.
-
.summon_weapon(moon = nil, element = nil, ingot = nil, skill = nil) ⇒ void
Summons a weapon based on the provided parameters.
-
.turn_summoned_weapon ⇒ void
Turns the summoned weapon in the specified direction.
Class Method Details
.break_summoned_weapon(item) ⇒ void
This method does nothing if the item is nil.
This method returns an undefined value.
Breaks the summoned weapon if it exists.
69 70 71 72 73 |
# File 'documented/dragonrealms/commons/common-summoning.rb', line 69 def break_summoned_weapon(item) return if item.nil? DRC.bput("break my #{item}", 'Focusing your will', 'disrupting its matrix', "You can't break", "Break what") end |
.get_ingot(ingot, swap) ⇒ void
This method does nothing if the ingot is nil.
This method returns an undefined value.
Retrieves the specified ingot for use in summoning.
44 45 46 47 48 49 |
# File 'documented/dragonrealms/commons/common-summoning.rb', line 44 def get_ingot(ingot, swap) return unless ingot DRC.bput("get my #{ingot} ingot", 'You get') DRC.bput('swap', 'You move') if swap end |
.identify_summoned_weapon ⇒ String?
Returns what kind of summoned weapon you’re holding. Will be the <adj> <noun> like ‘red-hot moonblade’ or ‘electric sword. Identifies the type of summoned weapon currently held.
110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 |
# File 'documented/dragonrealms/commons/common-summoning.rb', line 110 def identify_summoned_weapon if DRStats.moon_mage? return DRC.right_hand if DRCMM.is_moon_weapon?(DRC.right_hand) return DRC.left_hand if DRCMM.is_moon_weapon?(DRC.left_hand) elsif DRStats.warrior_mage? weapon_regex = /^You tap (?:a|an|some)(?:[\w\s\-]+)((stone|fiery|icy|electric) [\w\s\-]+) that you are holding.$/ # For a two-worded weapon like 'short sword' the only way to know # which element it was summoned with is by tapping it. That's the only # way we can infer if it's a summoned sword or a regular one. # However, the <adj> <noun> of the item we return must be what's in # their hands, not what the regex matches in the tap. return DRC.right_hand if DRCI.tap(DRC.right_hand) =~ weapon_regex return DRC.left_hand if DRCI.tap(DRC.left_hand) =~ weapon_regex else echo "Unable to summon weapons as a #{DRStats.guild}" end end |
.pull_summoned_weapon ⇒ void
This method returns an undefined value.
Pulls the summoned weapon back.
163 164 165 166 167 168 169 170 171 |
# File 'documented/dragonrealms/commons/common-summoning.rb', line 163 def pull_summoned_weapon case DRC.bput("pull my #{GameObj.right_hand.noun}", 'You lack the elemental charge', 'Closing your eyes', 'That\'s as') when 'You lack the elemental charge' summon_admittance pull_summoned_weapon end pause 1 waitrt? end |
.push_summoned_weapon ⇒ void
This method returns an undefined value.
Pushes the summoned weapon forward.
148 149 150 151 152 153 154 155 156 |
# File 'documented/dragonrealms/commons/common-summoning.rb', line 148 def push_summoned_weapon case DRC.bput("push my #{GameObj.right_hand.noun}", 'You lack the elemental charge', 'Closing your eyes', 'That\'s as') when 'You lack the elemental charge' summon_admittance push_summoned_weapon end pause 1 waitrt? end |
.shape_summoned_weapon(skill, ingot = nil) ⇒ void
This method returns an undefined value.
Shapes the summoned weapon to a specified skill.
82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 |
# File 'documented/dragonrealms/commons/common-summoning.rb', line 82 def shape_summoned_weapon(skill, ingot = nil) if DRStats.moon_mage? skill_to_shape = { 'Staves' => 'blunt', 'Twohanded Edged' => 'huge', 'Large Edged' => 'heavy', 'Small Edged' => 'normal' } shape = skill_to_shape[skill] if DRCMM.hold_moon_weapon? DRC.bput("shape #{identify_summoned_weapon} to #{shape}", 'you adjust the magic that defines its shape', 'already has', 'You fumble around') end elsif DRStats.warrior_mage? get_ingot(ingot, false) case DRC.bput("shape my #{identify_summoned_weapon} to #{skill}", 'You lack the elemental charge', 'You reach out', 'You fumble around', "You don't know how to manipulate your weapon in that way") when 'You lack the elemental charge' summon_admittance shape_summoned_weapon(skill, nil) end stow_ingot(ingot) else echo "Unable to shape weapons as a #{DRStats.guild}" end pause 1 waitrt? end |
.stow_ingot(ingot) ⇒ void
This method does nothing if the ingot is nil.
This method returns an undefined value.
Stows the specified ingot back into inventory.
57 58 59 60 61 |
# File 'documented/dragonrealms/commons/common-summoning.rb', line 57 def stow_ingot(ingot) return unless ingot DRC.bput("stow my #{ingot} ingot", 'You put') end |
.summon_admittance ⇒ void
This method returns an undefined value.
Handles the admittance process for summoning.
178 179 180 181 182 183 184 185 186 187 |
# File 'documented/dragonrealms/commons/common-summoning.rb', line 178 def summon_admittance case DRC.bput('summon admittance', 'You align yourself to it', 'further increasing your proximity', 'Going any further while in this plane would be fatal', 'Summon allows Warrior Mages to draw', 'You are a bit too distracted') when 'You are a bit too distracted' DRC.retreat summon_admittance end pause 1 waitrt? DRC.fix_standing end |
.summon_weapon(moon = nil, element = nil, ingot = nil, skill = nil) ⇒ void
This method returns an undefined value.
Summons a weapon based on the provided parameters.
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'documented/dragonrealms/commons/common-summoning.rb', line 18 def summon_weapon(moon = nil, element = nil, ingot = nil, skill = nil) if DRStats.moon_mage? DRCMM.hold_moon_weapon? elsif DRStats.warrior_mage? get_ingot(ingot, true) case DRC.bput("summon weapon #{element} #{skill}", 'You lack the elemental charge', 'you draw out') when 'You lack the elemental charge' summon_admittance summon_weapon(moon, element, nil, skill) end stow_ingot(ingot) else echo "Unable to summon weapons as a #{DRStats.guild}" end pause 1 waitrt? DRC.fix_standing end |
.turn_summoned_weapon ⇒ void
This method returns an undefined value.
Turns the summoned weapon in the specified direction.
133 134 135 136 137 138 139 140 141 |
# File 'documented/dragonrealms/commons/common-summoning.rb', line 133 def turn_summoned_weapon case DRC.bput("turn my #{GameObj.right_hand.noun}", 'You lack the elemental charge', 'You reach out') when 'You lack the elemental charge' summon_admittance turn_summoned_weapon end pause 1 waitrt? end |