Class: GamesAndRpgParadise::DnD::Character

Inherits:
Object
  • Object
show all
Includes:
Formulas
Defined in:
lib/games_and_rpg_paradise/rpg/dnd/character/character.rb

Overview

GamesAndRpgParadise::DnD::Character

Constant Summary collapse

EMPHASIS_COLOUR =
#

EMPHASIS_COLOUR

Denote which colour is to be used for CSS. Could be darkblue or lightcyan.

#
'navy'

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(character_name_to_use = 'del', use_this_yaml_dataset = :load_the_yaml_dataset, run_already = true) ⇒ Character

#

initialize

#


42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
# File 'lib/games_and_rpg_paradise/rpg/dnd/character/character.rb', line 42

def initialize(
    character_name_to_use = 'del',
    use_this_yaml_dataset = :load_the_yaml_dataset,
    run_already           = true
  )
  reset
  set_character_name_to_use(character_name_to_use)
  @yaml_dataset = use_this_yaml_dataset
  case use_this_yaml_dataset
  # ======================================================================= #
  # === :load_the_yaml_dataset
  #
  # This is also the :default, so that we can be lazy.
  # ======================================================================= #
  when :load_the_yaml_dataset,
       :default
    @yaml_dataset = YAML.load_file(FILE_DND_CHARACTERS)
  end
  # ======================================================================= #
  # Store into the variable @character_info.
  # ======================================================================= #
  @character_info = @yaml_dataset[@character_name_to_use]
  @character_info.default = ''
  # ======================================================================= #
  # === @character_short_name
  #
  # Short name of the character in question
  # ======================================================================= #
  @character_short_name = @character_info['short_name'].to_s
  # ======================================================================= #
  # DnD Attributes come next.
  # ======================================================================= #
  # ======================================================================= #
  # === @str
  # ======================================================================= #
  @str = @character_info['str'].to_s
  # ======================================================================= #
  # === @dex
  # ======================================================================= #
  @dex = @character_info['dex'].to_s
  # ======================================================================= #
  # === @con
  # ======================================================================= #
  @con = @character_info['con'].to_s
  # ======================================================================= #
  # === @int
  # ======================================================================= #
  @int = @character_info['int'].to_s
  # ======================================================================= #
  # === @wis
  # ======================================================================= #
  @wis = @character_info['wis'].to_s
  # ======================================================================= #
  # === @cha
  # ======================================================================= #
  @cha = @character_info['cha'].to_s
  # ======================================================================= #
  # === @ac
  # ======================================================================= #
  @ac  = @character_info['ac'].to_s
  # ======================================================================= #
  # === @gender
  #
  # Character Gender is stored in @gender.
  # ======================================================================= #
  @gender = @character_info['character_gender']
  # ======================================================================= #
  # === @character_equipment
  # ======================================================================= #
  @character_equipment = @character_info['equipment']
  # ======================================================================= #
  # === @character_max_hp
  #
  # Character Max HP
  # ======================================================================= #
  @character_max_hp = @character_info['max_hp'].to_s
  @character_current_hp = @character_max_hp # can be changed
  # ======================================================================= #
  # === @character_xp
  # ======================================================================= #
  @character_xp = @character_info['xp'].to_s
  # ======================================================================= #
  # === @character_race
  # ======================================================================= #
  @character_race = @character_info['character_race']
  # ======================================================================= #
  # Character Saves
  # ======================================================================= #
  @character_fort_save   = @character_info['character_saving_throws'][0].to_s
  # ======================================================================= #
  # === @character_reflex_save
  # ======================================================================= #
  @character_reflex_save = @character_info['character_saving_throws'][1].to_s
  # ======================================================================= #
  # === @character_will_save
  # ======================================================================= #
  @character_will_save   = @character_info['character_saving_throws'][2].to_s
  # ======================================================================= #
  # === @character_height
  #
  # Character Height and Weight
  # ======================================================================= #
  @character_height = @character_info['character_height'].to_s
  # ======================================================================= #
  # === @character_weight
  # ======================================================================= #
  @character_weight = @character_info['character_weight'].to_s
  @character_hair_color = @character_info['character_hair_color']
  # ======================================================================= #
  # === @character_eye_color
  # ======================================================================= #
  @character_eye_color = @character_info['character_eye_color'].to_s
  @character_level = @character_info['level']
  @character_feats = @character_info['character_feats']
  # ======================================================================= #
  # === @skill_list
  # ======================================================================= #
  @skill_list = []
  @skill_list = @character_info['skill_list']
  # ======================================================================= #
  # === @character_description
  # ======================================================================= #
  @character_description = @character_info['character_description'].strip
  # ======================================================================= #
  # === @gold_coins
  # ======================================================================= #
  @gold_coins = @character_info['gold_coins']
  # ======================================================================= #
  # === @character_age
  #
  # The next variable keeps track how old the character at hand is.
  # ======================================================================= #
  @character_age = @character_info['character_age'].to_s
  # ======================================================================= #
  # === @character_alignment
  # ======================================================================= #
  @character_alignment = @character_info['character_alignment']
  # ======================================================================= #
  # === @bab
  # ======================================================================= #
  @bab = @character_info['character_bab'].to_s
  # ======================================================================= #
  # === @extra_information
  # ======================================================================= #
  @extra_information = @character_info['extra_information']
  @character_history = @character_info['history']
  # ======================================================================= #
  # === @character_image_location
  # ======================================================================= #
  @character_image_location = @character_info['character_image']
  @character_name_to_use = @character_info['character_name']
  @character_lifestory = @character_info['character_lifestory'].to_s
  run if run_already
end

Class Method Details

.[](i = ARGV) ⇒ Object

#

GamesAndRpgParadise::DndCharacter[]

#


775
776
777
# File 'lib/games_and_rpg_paradise/rpg/dnd/character/character.rb', line 775

def self.[](i = ARGV)
  new(i)
end

Instance Method Details

#bab?Boolean Also known as: char_BAB?

#

bab?

#

Returns:

  • (Boolean)


586
587
588
# File 'lib/games_and_rpg_paradise/rpg/dnd/character/character.rb', line 586

def bab?
  @bab
end

#character_armour_class?Boolean Also known as: AC?

#

character_armour_class?

#

Returns:

  • (Boolean)


640
641
642
# File 'lib/games_and_rpg_paradise/rpg/dnd/character/character.rb', line 640

def character_armour_class?
  @character_armour_class
end

#character_eye_color?Boolean

#

character_eye_color?

#

Returns:

  • (Boolean)


600
601
602
# File 'lib/games_and_rpg_paradise/rpg/dnd/character/character.rb', line 600

def character_eye_color?
  @character_eye_color
end

#character_history?Boolean

#

character_history?

#

Returns:

  • (Boolean)


579
580
581
# File 'lib/games_and_rpg_paradise/rpg/dnd/character/character.rb', line 579

def character_history?
  @character_history
end

#character_image_location?Boolean

#

character_image_location?

#

Returns:

  • (Boolean)


453
454
455
# File 'lib/games_and_rpg_paradise/rpg/dnd/character/character.rb', line 453

def character_image_location?
  @character_image_location
end

#character_race?Boolean

#

character_race?

#

Returns:

  • (Boolean)


378
379
380
# File 'lib/games_and_rpg_paradise/rpg/dnd/character/character.rb', line 378

def character_race?
  @character_race
end

#character_reflex_save?Boolean Also known as: CharReflexSave

#

character_reflex_save?

#

Returns:

  • (Boolean)


626
627
628
# File 'lib/games_and_rpg_paradise/rpg/dnd/character/character.rb', line 626

def character_reflex_save?
  @character_reflex_save
end

#character_short_name?Boolean Also known as: name?

#

character_short_name?

#

Returns:

  • (Boolean)


310
311
312
# File 'lib/games_and_rpg_paradise/rpg/dnd/character/character.rb', line 310

def character_short_name?
  @character_short_name
end

#character_weight?Boolean

#

character_weight?

#

Returns:

  • (Boolean)


550
551
552
# File 'lib/games_and_rpg_paradise/rpg/dnd/character/character.rb', line 550

def character_weight?
  @character_weight
end

#character_will_save?Boolean Also known as: CharWillSave

#

character_will_save?

#

Returns:

  • (Boolean)


572
573
574
# File 'lib/games_and_rpg_paradise/rpg/dnd/character/character.rb', line 572

def character_will_save?
  @character_will_save
end

#character_xp?Boolean Also known as: CharXp

#

character_xp?

#

Returns:

  • (Boolean)


446
447
448
# File 'lib/games_and_rpg_paradise/rpg/dnd/character/character.rb', line 446

def character_xp?
  @character_xp
end

#charisma?Boolean

#

charisma?

#

Returns:

  • (Boolean)


432
433
434
# File 'lib/games_and_rpg_paradise/rpg/dnd/character/character.rb', line 432

def charisma?
  @cha
end

#con?Boolean Also known as: charCON

#

con?

#

Returns:

  • (Boolean)


246
247
248
# File 'lib/games_and_rpg_paradise/rpg/dnd/character/character.rb', line 246

def con?
  @con
end

#dex?Boolean Also known as: charDEX

#

dex?

#

Returns:

  • (Boolean)


260
261
262
# File 'lib/games_and_rpg_paradise/rpg/dnd/character/character.rb', line 260

def dex?
  @dex
end

#extra_information?Boolean Also known as: char_extra?, extra_information

#

extra_information?

#

Returns:

  • (Boolean)


557
558
559
# File 'lib/games_and_rpg_paradise/rpg/dnd/character/character.rb', line 557

def extra_information?
  @extra_information
end

#gender?Boolean

#

gender?

#

Returns:

  • (Boolean)


303
304
305
# File 'lib/games_and_rpg_paradise/rpg/dnd/character/character.rb', line 303

def gender?
  @gender
end

#gold_coins?Boolean Also known as: character_gold_coins?

#

gold_coins?

#

Returns:

  • (Boolean)


282
283
284
# File 'lib/games_and_rpg_paradise/rpg/dnd/character/character.rb', line 282

def gold_coins?
  @gold_coins
end

#reportObject

#

report (report tag)

#


460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
# File 'lib/games_and_rpg_paradise/rpg/dnd/character/character.rb', line 460

def report
  div(STD_FONT+' pad1em mar5px',
      'a_dnd_char',
      'border: 3px solid papayawhip;') {
    # ===================================================================== #
    # The character-image has to show up quite early, if we use it.
    # ===================================================================== #
    if @character_image_location
      dimg(@character_image_location, 'bblack1')
    end
    table2('','','',
      "<b class=\""+EMPHASIS_COLOUR+"\">Race</b>: #{race?}",
      "<b class=\"padl2em "+EMPHASIS_COLOUR+"\">Feats</b>: #{feats?}"
    )
    e "<b class=\""+EMPHASIS_COLOUR+"\">Hp</b>: #{hp?}"
    s2 "<b class=\""+EMPHASIS_COLOUR+"\">Saving Throws:</b> "
    # The little scale image comes next.
    scale = sg('RPG/STD/SCALE.png','marr8px')
    p('marbpx',name_of_the_character?) {
      e "#{scale} #{name_of_the_character?}"
      e "<b class=\" "+EMPHASIS_COLOUR+"\">Name</b>: 
      <b class=\" "+EMPHASIS_COLOUR+"\">Char Level</b>:
      #{char_level_total?} (#{character_classes?}) </b><br>
      <b class=\""+EMPHASIS_COLOUR+"\">Beschreibung</b>:
      #{character_description?}"
    }
    # ===================================================================== #
    # === Show the history of the character
    # ===================================================================== #
    boldbr 'History: '+character_history?.to_s,
           'FI padr1em '+EMPHASIS_COLOUR
    table2('mart0px','','',
      "<b class=\""+EMPHASIS_COLOUR+"\">Height</b>: #{char_height?} cm",
      "<b class=\""+EMPHASIS_COLOUR+"\">Weight</b>: #{char_weight?} kg"
    )
    table2('','','',
      "<b class=\""+EMPHASIS_COLOUR+"\">BAB</b>: #{char_BAB?}",
      "<b class=\""+EMPHASIS_COLOUR+"\">Extra</b>: #{char_extra?}"
    )
    table2('','','',
      "<b class=\""+EMPHASIS_COLOUR+"\">EyeColor</b>: #{eye_colour?}",
      "<b class=\""+EMPHASIS_COLOUR+"\">HairColor</b>: #{hair_colour?}"
    )
    # ===================================================================== #
    # Show the saves next:
    # ===================================================================== #
    table3('marl2em','','',
      "<b>Fortitude</b>: #{character_fortitude_save?}",
      "<b>Reflex</b>:    #{character_reflex_save?}", 
      "<b>Will</b>:      #{character_will_save?}"
    )
    div('bblack1 pad12px','',
        'min-height:100px;background-color:#e7e3de') {
      e sg("RPG/STD/EQUIPMENT.png",'FLL mar3px pad5px','EquipImage')+
        "<b class=\"FI "+EMPHASIS_COLOUR+"\">Equipment:</b> #{character_equipment?}"
      br
      e "<b class=\"FI "+EMPHASIS_COLOUR+"\">Gold Coins:</b> #{gold_coins?}"
    }
    # ===================================================================== #
    # === Show the XP next:
    # ===================================================================== #
    p {
      e "<b class=\"padr1em "+EMPHASIS_COLOUR+"\">Xp:</b>#{character_XP?} Xp",'s5px'
    }
    p {
      e "<b class=\""+EMPHASIS_COLOUR+"\">Attribute</b>:",'marl1em' 
      e "<b class=\""+EMPHASIS_COLOUR+"\">STR</b>: #{str?}",'marl2em'
      e "<b class=\""+EMPHASIS_COLOUR+"\">DEX</b>: #{dex?}",'marl2em'
      e "<b class=\""+EMPHASIS_COLOUR+"\">INT</b>: #{int?}",'marl2em'
      e "<b class=\""+EMPHASIS_COLOUR+"\">WIS</b>: #{wis?}",'marl2em'
      e "<b class=\""+EMPHASIS_COLOUR+"\">CON</b>: #{con?}",'marl2em'
      e "<b class=\""+EMPHASIS_COLOUR+"\">CHA</b>: #{cha?}",'marl2em'
      e "<b class=\""+EMPHASIS_COLOUR+"\">AC</b>: #{AC?}",'marl1em'
    }
    div {
      e "<b class=\"padr1em "+EMPHASIS_COLOUR+"\">Skills:</b> #{skill_list?}"
    }
  }
end

#resetObject

#

reset (reset tag)

#


200
201
202
203
204
205
206
207
208
209
210
211
212
213
# File 'lib/games_and_rpg_paradise/rpg/dnd/character/character.rb', line 200

def reset
  # ======================================================================= #
  # === @_
  # ======================================================================= #
  @_ = ''.dup # This is our return-String.
  # ======================================================================= #
  # === @yaml_dataset
  # ======================================================================= #
  @yaml_dataset = nil
  # ======================================================================= #
  # === @character_armour_class
  # ======================================================================= #
  @character_armour_class = 20
end

#runObject Also known as: generate, char_gen_start

#

run (run tag)

#


647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
# File 'lib/games_and_rpg_paradise/rpg/dnd/character/character.rb', line 647

def run
  show_height_and_weight
  show_hp
  show_the_lifestory
  # ======================================================================= #
  # Display the image of the character
  # ======================================================================= #
  div 'pad1em','','border:1px solid white;'
    unless @character_image_location.empty?
      abr("##{@sanitized_id}", 
        sg(@character_image_location,
          'FLL marr8px mar6px bblack1')
      )
    end
    scale_image = sg('RPG/STD/SCALE.png','marr5px') # The little scale image
    p('marbpx pad0_5em', @character_name_to_use.to_s.gsub(/ /,'').gsub(/,/,'')) {
      e scale_image+' '+'<b class="FS1_3em '+EMPHASIS_COLOUR+'">Name</b>: '+
      @character_name_to_use
      s2 'Beschreibung:',
         'BO '+EMPHASIS_COLOUR
      e @character_description
    }
    # ===================================================================== #
    # Display the alignment and age of the character.
    # ===================================================================== #
    table2('mart0px','','',
      '<b class="'+EMPHASIS_COLOUR+'">Alignment</b>: '+@character_alignment,
      '<b class="marl1em '+EMPHASIS_COLOUR+'">Age</b>: '+@character_age
    )
    # ===================================================================== #
    # eye colour, hair colour
    # ===================================================================== #
    table2('','','',
      '<b class="'+EMPHASIS_COLOUR+'">EyeColor</b>: '+@character_eye_color,
      '<b class="marl1em '+EMPHASIS_COLOUR+'">HairColor</b>: '+@character_hair_color
    )
    # ===================================================================== #
    # feats tag
    # ===================================================================== #
    div('mar1px marl1em'){
      feats = @character_feats.map {|entry|
        string_s2(entry)
      }.join '<br>'
      table2 'mar2px','','',
        '<b class="'+EMPHASIS_COLOUR+'">Race</b>: '+@character_race,
        '<b class="padl2em '+EMPHASIS_COLOUR+'">Feats</b>: '+feats
    }
    # ===================================================================== #
    # BAB tag
    # ===================================================================== #
    s2 '<b class="'+EMPHASIS_COLOUR+'">BAB</b>: '+@bab
    # ===================================================================== #
    # Saving throws tag
    # ===================================================================== #        
    s2 sg(:kleeblatt)+'<b class="'+EMPHASIS_COLOUR+'">Saving Throws:</b> ','BO'
    p('marl2em mart1px ind0px') {
      e "<b>Fortitude</b>: #{@character_fort_save}"
      e "<b>Reflex</b>: #{@character_reflex_save}" 
      e "<b>Will</b>: #{@character_will_save}"
    }
    p {
      s2 'Character Level:','BO '+EMPHASIS_COLOUR
      s2 @character_level.to_s
    }
    # ===================================================================== #
    # AC tag
    # ===================================================================== #
    e '<a href="#AC_'+@sanitized_id+'">'+sg(:shield)+'</a>
       <b id="AC_'+@sanitized_id+'" class="'+EMPHASIS_COLOUR+'">AC</b>: '+@ac
    # ===================================================================== #
    # Attributes
    # ===================================================================== #
    p('pad8px bblack1 FLR marr1em'){
      e '<b class="BO FS1_1em '+EMPHASIS_COLOUR+'">'+
      dot(101)+'Attributes</b>','mars0_2em'
      e '<b class="'+EMPHASIS_COLOUR+'">STR</b>:'+@str,'marl1_5em'
      e '<b class="'+EMPHASIS_COLOUR+'">DEX</b>:'+@dex,'marl1_5em'
      e '<b class="'+EMPHASIS_COLOUR+'">INT</b>:'+@int,'marl1_5em'
      e '<b class="'+EMPHASIS_COLOUR+'">WIS</b>:'+@wis,'marl1_5em'
      e '<b class="'+EMPHASIS_COLOUR+'">CON</b>:'+@con,'marl1_5em'
      e '<b class="'+EMPHASIS_COLOUR+'">CHA</b>:'+@cha,'marl1_5em'
    }
    # ===================================================================== #
    # Equipment
    # ===================================================================== #
    div('pad1px'){
      img 'RPG/STD/EQUIP1.png','mar4px pad2px','EquipImage'
      e 'Equipment:','BO FI '+EMPHASIS_COLOUR
      @character_equipment.each { |equipment| e '- '+equipment.to_s }
    }
    # ===================================================================== #
    # Gold coins
    # ===================================================================== #
    div('pad1px'){
      s2 sg('RPG/STD/DUKAT.png')+' Gold coins:','BO '+EMPHASIS_COLOUR
      s2 @gold_coins.to_s
    }
    # ===================================================================== #
    # === XP tag
    # ===================================================================== #
    link '#xp_table',string_s2('XP:','padr1em '+EMPHASIS_COLOUR)
    e @character_xp
    # ===================================================================== #
    # Skill List tag
    # ===================================================================== #        
    e 'Skill List:','padr1em '+EMPHASIS_COLOUR
    @skill_list.each { |hash|
      e '-'+hash.keys.to_s+': '+hash.values.to_s,'marl3em'
    } unless @skill_list.empty?
    div_default {
      s2 '<b class="'+EMPHASIS_COLOUR+'">ExtraInformation</b>:
      <pre>'+
      @extra_information+
      '</pre>'
    }
    # ===================================================================== #
    # Character History
    # ===================================================================== #        
    div_default {
      h4 'Character History',EMPHASIS_COLOUR
    }
    e 'bl $RPG/DnD/'+YAML_FILE_LOCATION,'marl2em'
end

#set_bab(i) ⇒ Object Also known as: set_CharBAB

#

set_bab

#


593
594
595
# File 'lib/games_and_rpg_paradise/rpg/dnd/character/character.rb', line 593

def set_bab(i)
  @bab = i
end

#set_character_age(i) ⇒ Object Also known as: set_char_age

#

set_character_age

#


289
290
291
# File 'lib/games_and_rpg_paradise/rpg/dnd/character/character.rb', line 289

def set_character_age(i)
  @character_age = i.to_i
end

#set_character_alignment(i) ⇒ Object Also known as: set_CharAlignment

#

set_character_alignment

#


218
219
220
# File 'lib/games_and_rpg_paradise/rpg/dnd/character/character.rb', line 218

def set_character_alignment(i)
  @character_alignment = i
end

#set_character_armour_class(i) ⇒ Object Also known as: set_CharAC

#

set_character_armour_class

#


633
634
635
# File 'lib/games_and_rpg_paradise/rpg/dnd/character/character.rb', line 633

def set_character_armour_class(i)
  @character_armour_class = i
end

#set_character_equipment(i) ⇒ Object Also known as: set_equipment, set_CharEquip

#

set_character_equipment

#


267
268
269
# File 'lib/games_and_rpg_paradise/rpg/dnd/character/character.rb', line 267

def set_character_equipment(i)
  @character_equipment = i
end

#set_character_eye_colorObject Also known as: set_CharEyeColor

#

set_character_eye_color

#


607
608
609
# File 'lib/games_and_rpg_paradise/rpg/dnd/character/character.rb', line 607

def set_character_eye_color
  @character_eye_color = i
end

#set_character_height(i) ⇒ Object Also known as: set_CharHeight

#

set_character_height

#


364
365
366
# File 'lib/games_and_rpg_paradise/rpg/dnd/character/character.rb', line 364

def set_character_height(i)
  @character_height = i
end

#set_character_history(i) ⇒ Object Also known as: set_CharHistory

#

set_character_history

#


565
566
567
# File 'lib/games_and_rpg_paradise/rpg/dnd/character/character.rb', line 565

def set_character_history(i)
  @character_history = i
end

#set_character_image_location(i) ⇒ Object

#

set_character_image_locatio

#


232
233
234
# File 'lib/games_and_rpg_paradise/rpg/dnd/character/character.rb', line 232

def set_character_image_location(i)
  @character_image_location = i 
end

#set_character_name_to_use(i) ⇒ Object

#

set_character_name_to_use

#


296
297
298
# File 'lib/games_and_rpg_paradise/rpg/dnd/character/character.rb', line 296

def set_character_name_to_use(i)
  @character_name_to_use = i
end

#set_character_race(i) ⇒ Object Also known as: set_CharRace

#

set_character_race

#


385
386
387
# File 'lib/games_and_rpg_paradise/rpg/dnd/character/character.rb', line 385

def set_character_race(i)
  @character_race = i
end

#set_character_saving_throws(f, r, w) ⇒ Object Also known as: set_CharSavingThrows

#

set_character_saving_throws

f is for “fortitude”. r is for “reflex”.

#


617
618
619
620
621
# File 'lib/games_and_rpg_paradise/rpg/dnd/character/character.rb', line 617

def set_character_saving_throws(f, r, w)
  @character_fort_save = f
  @character_fort_r    = r
  @character_fort_w    = w
end

#set_character_weight(i) ⇒ Object Also known as: set_CharWeight

#

set_character_weight

#


543
544
545
# File 'lib/games_and_rpg_paradise/rpg/dnd/character/character.rb', line 543

def set_character_weight(i)
  @character_weight = i.to_f
end

#set_character_xp(i) ⇒ Object Also known as: set_CharXp

#

set_character_xp

#


439
440
441
# File 'lib/games_and_rpg_paradise/rpg/dnd/character/character.rb', line 439

def set_character_xp(i)
  @character_xp = i
end

#set_charisma(i) ⇒ Object Also known as: set_char_cha

#

set_charisma

#


403
404
405
# File 'lib/games_and_rpg_paradise/rpg/dnd/character/character.rb', line 403

def set_charisma(i)
  @cha = i
end

#set_current_hp(i) ⇒ Object Also known as: set_hp, set_charHP

#

set_current_hp

Use this to set how many hp (hitpoints) the given character at hand has. Must be an integer (a number).

#


395
396
397
# File 'lib/games_and_rpg_paradise/rpg/dnd/character/character.rb', line 395

def set_current_hp(i)
  @character_current_hp = i.to_i
end

#set_extra_information(i) ⇒ Object Also known as: set_CharExtra

#

set_extra_information

#


225
226
227
# File 'lib/games_and_rpg_paradise/rpg/dnd/character/character.rb', line 225

def set_extra_information(i)
  @extra_information = i
end

#set_gold_coins(i) ⇒ Object Also known as: gold_coins=

#

set_gold_coins

#


275
276
277
# File 'lib/games_and_rpg_paradise/rpg/dnd/character/character.rb', line 275

def set_gold_coins(i)
  @gold_coins = i
end

#set_hair_colour(i) ⇒ Object Also known as: set_hair_color

#

set_hair_colour

#


239
240
241
# File 'lib/games_and_rpg_paradise/rpg/dnd/character/character.rb', line 239

def set_hair_colour(i)
  @hair_colour = i
end

#set_intelligence(i) ⇒ Object Also known as: set_int

#

set_intelligence

#


417
418
419
# File 'lib/games_and_rpg_paradise/rpg/dnd/character/character.rb', line 417

def set_intelligence(i)
  @int = i
end

#set_str(i) ⇒ Object Also known as: set_CharSTR

#

set_str

#


410
411
412
# File 'lib/games_and_rpg_paradise/rpg/dnd/character/character.rb', line 410

def set_str(i)
  @str = i
end

#set_wisdom(i) ⇒ Object Also known as: set_wis, set_charWIS

#

set_wisdom

#


424
425
426
# File 'lib/games_and_rpg_paradise/rpg/dnd/character/character.rb', line 424

def set_wisdom(i)
  @wis = i
end

#show_height_and_weightObject

#

show_height_and_weight

#


317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
# File 'lib/games_and_rpg_paradise/rpg/dnd/character/character.rb', line 317

def show_height_and_weight
  # ======================================================================= #
  # height and weight
  # ======================================================================= #
  ee(
    '<table class="mart0px">'\
    '<tr>'\
    '<td>'+
    '<b class="'+EMPHASIS_COLOUR+'">Height</b>: '+@character_height.to_s+' cm'+
    '</td>'+
    '<td>'+
    '<b class="marl2em '+EMPHASIS_COLOUR+'">Weight</b>: '+@character_weight.to_s+' kg'+
    '</td></tr>'+
    '</table>'
  )
end

#show_hpObject

#

show_hp

#


348
349
350
351
352
353
354
355
356
357
358
359
# File 'lib/games_and_rpg_paradise/rpg/dnd/character/character.rb', line 348

def show_hp    
  # ======================================================================= #
  # hp tag
  # ======================================================================= #
  s2 sg(:heart)+
     '<b class="'+EMPHASIS_COLOUR+'">Hp</b>: '+@character_max_hp
  e 'Current HP: '+@character_current_hp.to_s
  # inputbr :field,
  #         @character_current_hp.to_s,
  #         'mars2px pad1px s4px bblack1','','','',
  #         'onKeyPress="return only_numbers(this, event)"'
end

#show_the_lifestoryObject

#

show_the_lifestory

#


337
338
339
340
341
342
343
# File 'lib/games_and_rpg_paradise/rpg/dnd/character/character.rb', line 337

def show_the_lifestory
  # ======================================================================= #
  # Lifestory des chars.
  # ======================================================================= #
  ee '<div><h3>Lifestory des Charakters:</h3>'
  ee HtmlTags.span(@character_lifestory, 'marl1em')
end

#skill_list?Boolean Also known as: char_skill_list

#

skill_list?

#

Returns:

  • (Boolean)


371
372
373
# File 'lib/games_and_rpg_paradise/rpg/dnd/character/character.rb', line 371

def skill_list?
  @skill_list
end

#str?Boolean Also known as: charSTR

#

str?

#

Returns:

  • (Boolean)


253
254
255
# File 'lib/games_and_rpg_paradise/rpg/dnd/character/character.rb', line 253

def str?
  @str
end