Module: Yharian
- Defined in:
- lib/plugins/yhara.rb
Overview
based on new-harizon.rb
Defined Under Namespace
Classes: Alex, Jenifer, Remark, Speaker, Vicki, Yhara
Constant Summary collapse
- VOICES =
%w(Agnes Albert Bad\ News Bahh Bells Boing Bruce Bubbles Cellos Deranged Fred Hysterical Junior Kathy Pipe\ Organ Princess Ralph Trinoids Vicki Victoria Whisper Zarvox)
- @@context =
[]
- @@speakers =
[Alex.new, Vicki.new]
Class Method Summary collapse
Class Method Details
.text ⇒ Object
112 113 114 115 116 117 118 119 120 121 122 123 124 |
# File 'lib/plugins/yhara.rb', line 112 def self.text if ( @@context.last && Yhara === @@context.last.speaker && rand < 0.25 ) || rand < 0.01 speaker = Jenifer.new elsif @@context.last && @@context.last.words =~ /y hara/ and @@context.last.interrogative? and rand < 0.25 speaker = Yhara.new else speaker = @@speakers[rand(2)] end remark = speaker.talk(@@context).first @@context.push remark remark.text end |