Class: Hlockey::Mod::Immaterial
- Inherits:
-
Object
- Object
- Hlockey::Mod::Immaterial
- Includes:
- Moddable
- Defined in:
- lib/hlockey/mod/immaterial.rb
Overview
The player this mod is applied to has a chance of avoiding hits by temporarily losing their physical form
Constant Summary collapse
- DESCRIPTION =
"This player may be a hallucination.".freeze
Instance Attribute Summary
Attributes included from Moddable
Instance Method Summary collapse
Methods included from Moddable
#initialize, #on_action, #on_join_fight, #on_swap
Methods included from SelfDescribable
Instance Method Details
#on_got_hit(hitting_player) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/hlockey/mod/immaterial.rb', line 14 def on_got_hit(hitting_player) return false if prng.rand(3).zero? if @game.pre_tmp_change_stats[@player].nil? @game.pre_tmp_change_stats[@player] = @player.stats.clone end @player.stats[:defense] += 0.5 (:mod_immaterial_event, hitting_player:, player: @player) true # Other player shouldn't take puck end |