Class: Lich::Gemstone::Warcry

Inherits:
Object
  • Object
show all
Defined in:
documented/gemstone/psms/warcry.rb

Overview

Class for managing and using Warcries in GemStone IV.

Warcries are cost-based vocal abilities that provide buffs or perform effects. This class provides:

  • Metadata for each known warcry (cost, regex, optional buff name)
  • Checks for knowledge, affordability, cooldown, and buff activity
  • Execution logic including FORCERT handling

Dynamic singleton methods are created for each warcry by long and short name.

Constant Summary collapse

@@warcries =

Internal table of all warcry abilities.

Returns:

  • (Hash<String, Hash>)

    Mapping from long name to metadata, including:

    • :long_name [String]
    • :short_name [String]
    • :cost [Integer]
    • :regex [Regexp]
    • :buff [String, optional]
{
  "bertrandts_bellow" => {
    :long_name  => "bertrandts_bellow",
    :short_name => "bellow",
    :type       => :setup,
    :cost       => { stamina: 20 }, # @todo only 10 for single
    :regex      => /You glare at .+ and let out a nerve-shattering bellow!/,
  },
  "yerties_yowlp"     => {
    :long_name  => "yerties_yowlp",
    :short_name => "yowlp",
    :type       => :buff,
    :cost       => { stamina: 20 },
    :regex      => /You throw back your shoulders and let out a resounding yowlp!/,
    :buff       => "Yertie's Yowlp",
  },
  "gerrelles_growl"   => {
    :long_name  => "gerrelles_growl",
    :short_name => "growl",
    :type       => :setup,
    :cost       => { stamina: 14 }, # @todo only 7 for single
    :regex      => /Your face contorts as you unleash a guttural, deep-throated growl at .+!/,
  },
  "seanettes_shout"   => {
    :long_name  => "seanettes_shout",
    :short_name => "shout",
    :type       => :buff,
    :cost       => { stamina: 20 },
    :regex      => /You let loose an echoing shout!/,
    :buff       => 'Empowered (+20)',
  },
  "carns_cry"         => {
    :long_name  => "carns_cry",
    :short_name => "cry",
    :type       => :setup,
    :cost       => { stamina: 20 },
    :regex      => /You stare down .+ and let out an eerie, modulating cry!/,
  },
  "horlands_holler"   => {
    :long_name  => "horlands_holler",
    :short_name => "holler",
    :type       => :buff,
    :cost       => { stamina: 20 },
    :regex      => /You throw back your head and let out a thundering holler!/,
    :buff       => 'Enh. Health (+20)',
  },
}

Class Method Summary collapse

Class Method Details

.warcry_lookupsArray<Hash>

Returns a summary array of all warcries, including long name, short name, and cost.

Returns:

  • (Array<Hash>)

    Each hash has :long_name, :short_name, :cost



73
74
75
76
77
78
79
80
81
# File 'documented/gemstone/psms/warcry.rb', line 73

def self.warcry_lookups
  @@warcries.map do |long_name, psm|
    {
      long_name: long_name,
      short_name: psm[:short_name],
      cost: psm[:cost]
    }
  end
end