Class: Hlockey::Mod::Punchy

Inherits:
Object
  • Object
show all
Includes:
Actions, Moddable
Defined in:
lib/hlockey/mod/punchy.rb

Overview

Player can get into a fight at any time

Constant Summary collapse

DESCRIPTION =
"This player may randomly start fights.".freeze

Instance Attribute Summary

Attributes included from Moddable

#game

Instance Method Summary collapse

Methods included from Moddable

#initialize, #on_got_hit, #on_join_fight, #on_swap

Methods included from SelfDescribable

#to_s

Instance Method Details

#on_actionObject



13
14
15
16
17
18
# File 'lib/hlockey/mod/punchy.rb', line 13

def on_action
  return unless random_event_occurs?(prng:)

  send_game_message(:mod_punchy_event, player: @player)
  @game.start_fight(@player)
end