Class: GamesAndRpgParadise::Gamebook::LoneWolf::Character
- Inherits:
-
Object
- Object
- GamesAndRpgParadise::Gamebook::LoneWolf::Character
show all
- Includes:
- Base::Extensions
- Defined in:
- lib/games_and_rpg_paradise/gamebooks/lone_wolf/character.rb
Overview
Constant Summary
collapse
- ARRAY_CIRCLE_OF_SPIRIT =
#
GamesAndRpgParadise::Gamebook::LoneWolf::Character::ARRAY_CIRCLE_OF_SPIRIT
#
%w( Psi-surge Psi-screen Nexus Divination )
- ARRAY_CIRCLE_OF_SOLARIS =
#
GamesAndRpgParadise::Gamebook::LoneWolf::Character::ARRAY_CIRCLE_OF_SOLARIS
#
%w( Invisibility Huntmastery Pathsmanship )
- ARRAY_CIRCLE_OF_FIRE =
#
GamesAndRpgParadise::Gamebook::LoneWolf::Character::ARRAY_CIRCLE_OF_FIRE
#
%w( Weaponmastery Huntmastery )
- ARRAY_CIRCLE_OF_LIGHT =
#
GamesAndRpgParadise::Gamebook::LoneWolf::Character::ARRAY_CIRCLE_OF_LIGHT
#
['Animal Control','Curing']
CommonExtensions::CONTROL_C_CODE, CommonExtensions::N
Class Method Summary
collapse
Instance Method Summary
collapse
-
#add_a_random_discipline ⇒ Object
# === add_a_random_discipline ========================================================================= #.
-
#add_n_gold_coins(i) ⇒ Object
# === add_n_gold_coins.
-
#add_n_to_max_endurance(i) ⇒ Object
(also: #increase_max_endurance_by)
# === add_n_to_max_endurance ========================================================================= #.
-
#add_new_combat_skill_and_endurance_value ⇒ Object
# === add_new_combat_skill_and_endurance_value ========================================================================= #.
-
#add_this_equipment(i) ⇒ Object
(also: #add, #add_this_item_to_the_equipment)
# === add_this_equipment (add tag) ========================================================================= #.
-
#available_kai_disciplines? ⇒ Boolean
# === available_kai_disciplines?.
-
#batch_add(i) ⇒ Object
# === batch_add ========================================================================= #.
-
#circle_of_fire_completed? ⇒ Boolean
# === circle_of_fire_completed?.
-
#circle_of_light_completed? ⇒ Boolean
# === circle_of_light_completed?.
-
#circle_of_solaris_completed? ⇒ Boolean
# === circle_of_solaris_completed?.
-
#circle_of_spirit_completed? ⇒ Boolean
# === circle_of_spirit_completed?.
-
#combat_skill? ⇒ Boolean
(also: #current_stärke?, #current_combat_skill?, #current_CS?)
# === combat_skill? ========================================================================= #.
-
#comments? ⇒ Boolean
-
#completed_circles? ⇒ Boolean
# === completed_circles? ========================================================================= #.
-
#current_endurance? ⇒ Boolean
(also: #endurance?)
# === current_endurance?.
-
#debug_method_add_custom_values_for_now ⇒ Object
# === debug_method_add_custom_values_for_now.
-
#do_die ⇒ Object
(also: #dies)
# === do_die ========================================================================= #.
-
#do_heal ⇒ Object
(also: #heal)
# === do_heal (heal tag).
-
#do_save(store_here = log_dir?+'lone_wolf_character_'+ name?.to_s. downcase.tr(' ','_')+'.yml', dataset = internal_hash? ) ⇒ Object
(also: #save, #store, #save_into_file)
# === do_save (save tag, do_save tag).
-
#equipment? ⇒ Boolean
# === equipment? ========================================================================= #.
-
#has_curing_ability? ⇒ Boolean
# === has_curing_ability?.
-
#has_healing_ability? ⇒ Boolean
# === has_healing_ability?.
-
#increase_combat_skill_by(i = 1) ⇒ Object
# === increase_combat_skill_by ========================================================================= #.
-
#initial_combat_skill? ⇒ Boolean
(also: #combat_skill_base_value?, #initial_CS?)
# === combat_skill_base_value? ========================================================================= #.
-
#initialize ⇒ Character
constructor
# === initialize ========================================================================= #.
-
#internal_hash? ⇒ Boolean
(also: #internal_hash)
# === internal_hash ========================================================================= #.
-
#is_alive? ⇒ Boolean
# === is_alive? ========================================================================= #.
-
#is_lone_wolf? ⇒ Boolean
# === is_lone_wolf? ========================================================================= #.
-
#is_now_dead ⇒ Object
# === is_now_dead ========================================================================= #.
-
#kai_disciplines? ⇒ Boolean
(also: #disciplines?, #array_kai_disciplines)
# === kai_disciplines? ========================================================================= #.
-
#load_this_file(this_file) ⇒ Object
(also: #load_character, #load_dataset_from_this_file, #load_from_this_file)
# === load_this_file (load tag).
-
#log_dir? ⇒ Boolean
# === log_dir? ========================================================================= #.
-
#max_endurance? ⇒ Boolean
(also: #maximal_endurance?)
# === max_endurance? ========================================================================= #.
-
#n_alether_potions? ⇒ Boolean
# === n_alether_potions? ========================================================================= #.
-
#n_arrows? ⇒ Boolean
# === n_arrows? ========================================================================= #.
-
#n_gold_coins? ⇒ Boolean
(also: #gold?)
# === n_gold_coins? ========================================================================= #.
-
#n_kai_disciplines? ⇒ Boolean
# === n_kai_disciplines?.
-
#n_laumspur_potions? ⇒ Boolean
(also: #n_laumspur?)
# === n_laumspur_potions? ========================================================================= #.
-
#n_meals? ⇒ Boolean
# === n_meals? ========================================================================= #.
-
#n_quivers? ⇒ Boolean
# === n_quivers? ========================================================================= #.
-
#name? ⇒ Boolean
# === name? ========================================================================= #.
-
#reset ⇒ Object
# === reset (reset tag) ========================================================================= #.
-
#reset_to_the_original_gamestate ⇒ Object
# === reset_to_the_original_gamestate ========================================================================= #.
-
#set_comments(i) ⇒ Object
-
#set_completed_circles(i) ⇒ Object
# === set_completed_circles ========================================================================= #.
-
#set_current_combat_skill(i) ⇒ Object
(also: #set_combat_skill, #set_current_stärke, #set_max_combat_skill)
# === set_current_combat_skill.
-
#set_current_endurance(i) ⇒ Object
(also: #set_endurance, #endurance=, #set_base_endurance)
# === set_current_endurance ========================================================================= #.
-
#set_equipment(i) ⇒ Object
(also: #equipment=)
# === set_equipment ========================================================================= #.
-
#set_initial_combat_skill(i) ⇒ Object
(also: #set_combat_skill_base_value, #combat_skill=)
# === set_initial_combat_skill ========================================================================= #.
-
#set_is_alive(i) ⇒ Object
# === set_is_alive ========================================================================= #.
-
#set_kai_disciplines(i) ⇒ Object
# === set_kai_disciplines ========================================================================= #.
-
#set_max_endurance(i) ⇒ Object
# === set_max_endurance ========================================================================= #.
-
#set_n_alether_potions(i) ⇒ Object
(also: #set_n_alether, #alether=)
# === set_n_alether_potions ========================================================================= #.
-
#set_n_arrows(i) ⇒ Object
(also: #arrows=)
# === set_n_arrows ========================================================================= #.
-
#set_n_gold_coins(i) ⇒ Object
(also: #set_n_gold, #n_gold_coins=)
# === set_n_gold_coins ========================================================================= #.
-
#set_n_laumspur_potions(i) ⇒ Object
(also: #set_n_laumspur, #laumspur=)
# === set_n_laumspur_potions ========================================================================= #.
-
#set_n_meals(i) ⇒ Object
(also: #n_meals=, #meals=)
# === set_n_meals ========================================================================= #.
-
#set_n_quivers(i) ⇒ Object
(also: #quivers=)
# === set_n_quivers ========================================================================= #.
-
#set_weapons(i) ⇒ Object
(also: #weapons=)
# === set_weapons.
-
#show_short_summary ⇒ Object
(also: #summary, #summary?, #report)
# === show_short_summary ========================================================================= #.
-
#tai_disciplines=(i) ⇒ Object
# === tai_disciplines ========================================================================= #.
-
#try_to_add_n_hitpoints(i) ⇒ Object
# === try_to_add_n_hitpoints.
-
#try_to_regenerate_n_hp(i = 1) ⇒ Object
# === try_to_regenerate_n_hp ========================================================================= #.
-
#weapons? ⇒ Boolean
# === weapons? ========================================================================= #.
#commandline_arguments?, #filter_away_commandline_arguments, #first_argument?, #first_non_hyphened_argument?, #set_commandline_arguments
#cat, #cd, #cliner, #copy_file, #delete, #dirname_but_retains_the_trailing_slash, #disable_colours, #ensure_that_the_log_directory_exists, #esystem, #get_user_input, #infer_the_namespace, #is_on_roebe?, #mkdir, #mkdir_then_cd_into_it, #mv, #namespace?, #opne, #opnn, #project_base_directory?, #project_image_directory?, #project_yaml_directory?, #rds, #register_sigint, #remove_this_directory, #rename_file, #reset_the_internal_hash, #return_pwd, #return_today, #touch_file, #wrap, #write_what_into
Constructor Details
62
63
64
|
# File 'lib/games_and_rpg_paradise/gamebooks/lone_wolf/character.rb', line 62
def initialize
reset
end
|
Class Method Details
.available_kai_disciplines? ⇒ Boolean
#
GamesAndRpgParadise::Gamebook::LoneWolf::Character.available_kai_disciplines?
This method will return an Array, containing all registered kai-disciplines. This depends on a certain .yml file.
#
857
858
859
860
|
# File 'lib/games_and_rpg_paradise/gamebooks/lone_wolf/character.rb', line 857
def self.available_kai_disciplines?
_ = file_all_kai_disciplines
return YAML.load_file(_).keys
end
|
.file_all_kai_disciplines ⇒ Object
#
GamesAndRpgParadise::Gamebook::LoneWolf::Character.file_all_kai_disciplines
#
865
866
867
868
|
# File 'lib/games_and_rpg_paradise/gamebooks/lone_wolf/character.rb', line 865
def self.file_all_kai_disciplines
return ::GamesAndRpgParadise.project_base_dir?+
'yaml/gamebooks/misc/all_kai_disciplines_for_the_lone_wolf_series.yml'
end
|
.load_character(from_here = log_dir?+'long_wolf_character.yml') ⇒ Object
#
GamesAndRpgParadise::Gamebook::LoneWolf::Character.load_character
This method must return the loaded character as-is.
#
559
560
561
562
563
564
565
|
# File 'lib/games_and_rpg_paradise/gamebooks/lone_wolf/character.rb', line 559
def self.load_character(
from_here = log_dir?+'long_wolf_character.yml'
)
character = Character.new
character.load_this_file(from_here)
return character
end
|
.save_character(dataset, store_here = log_dir?+'long_wolf_character.yml') ⇒ Object
#
GamesAndRpgParadise::Gamebook::LoneWolf::Character.save_character
#
873
874
875
876
877
878
879
|
# File 'lib/games_and_rpg_paradise/gamebooks/lone_wolf/character.rb', line 873
def self.save_character(
dataset,
store_here = log_dir?+'long_wolf_character.yml'
)
character = Character.new(dataset)
character.do_save(store_here)
end
|
Instance Method Details
#add_a_random_discipline ⇒ Object
#
add_a_random_discipline
#
259
260
261
262
263
264
265
266
267
268
269
270
|
# File 'lib/games_and_rpg_paradise/gamebooks/lone_wolf/character.rb', line 259
def add_a_random_discipline
_ = available_kai_disciplines?
_ = _.sample
array = kai_disciplines?
if array.include? _
e 'Can not add '+_+' as it is already part '\
'of the available kai disciplines.'
else
array << _
end
set_kai_disciplines(_)
end
|
#add_n_gold_coins(i) ⇒ Object
#
add_n_gold_coins
This method can be used to add n gold coins.
#
321
322
323
324
|
# File 'lib/games_and_rpg_paradise/gamebooks/lone_wolf/character.rb', line 321
def add_n_gold_coins(i)
i = i.to_i
set_n_gold_coins(n_gold_coins? + i)
end
|
#add_n_to_max_endurance(i) ⇒ Object
Also known as:
increase_max_endurance_by
#
add_n_to_max_endurance
#
593
594
595
|
# File 'lib/games_and_rpg_paradise/gamebooks/lone_wolf/character.rb', line 593
def add_n_to_max_endurance(i)
@internal_hash[:max_endurance] += i.to_i
end
|
#add_new_combat_skill_and_endurance_value ⇒ Object
#
add_new_combat_skill_and_endurance_value
#
422
423
424
425
426
|
# File 'lib/games_and_rpg_paradise/gamebooks/lone_wolf/character.rb', line 422
def add_new_combat_skill_and_endurance_value
set_current_combat_skill(GamesAndRpgParadise.roll_complex_die('1W10+10').to_s) set_current_endurance(GamesAndRpgParadise.roll_complex_die('1W10+20').to_s) @internal_hash[:max_endurance] = current_endurance?
end
|
#add_this_equipment(i) ⇒ Object
Also known as:
add, add_this_item_to_the_equipment
#
add_this_equipment (add tag)
#
402
403
404
|
# File 'lib/games_and_rpg_paradise/gamebooks/lone_wolf/character.rb', line 402
def add_this_equipment(i)
@internal_hash[:equipment] << i
end
|
#available_kai_disciplines? ⇒ Boolean
#
available_kai_disciplines?
This method will return an Array holding all tai-disciplines.
This does NOT mean that the character at hand has these disciplines.
This method also assumes that the .yml file at hand will exist at all times, which may not be the case.
Actually it had to be changed, because an instance of character may not always be available, so it was moved into its own toplevel-method here.
#
#batch_add(i) ⇒ Object
410
411
412
413
414
415
416
417
|
# File 'lib/games_and_rpg_paradise/gamebooks/lone_wolf/character.rb', line 410
def batch_add(i)
i = i.dup if i.frozen?
i.strip!
splitted = i.split("\n")
splitted.each {|this_item|
add_this_equipment(this_item)
}
end
|
#circle_of_fire_completed? ⇒ Boolean
#
circle_of_fire_completed?
A completed Circle of Fire will add 1 CS and 2 EP.
#
694
695
696
697
698
699
700
701
702
703
|
# File 'lib/games_and_rpg_paradise/gamebooks/lone_wolf/character.rb', line 694
def circle_of_fire_completed?
_ = disciplines?
if _ and
_.include?(ARRAY_CIRCLE_OF_FIRE[0]) and
_.include?(ARRAY_CIRCLE_OF_FIRE[1])
true
else
false
end
end
|
#circle_of_light_completed? ⇒ Boolean
#
circle_of_light_completed?
A completed Circle of Light will add 0 CS and 3 EP.
#
745
746
747
748
749
750
751
752
753
754
|
# File 'lib/games_and_rpg_paradise/gamebooks/lone_wolf/character.rb', line 745
def circle_of_light_completed?
_ = disciplines?
if _ and
_.include?(ARRAY_CIRCLE_OF_LIGHT[0]) and
_.include?(ARRAY_CIRCLE_OF_LIGHT[1])
true
else
false
end
end
|
#circle_of_solaris_completed? ⇒ Boolean
#
circle_of_solaris_completed?
A completed Circle of Solaris will add 1 CS and 3 EP.
#
#circle_of_spirit_completed? ⇒ Boolean
#
circle_of_spirit_completed?
A completed Circle of Spirit will add 3 CS and 3 EP.
#
#combat_skill? ⇒ Boolean
Also known as:
current_stärke?, current_combat_skill?, current_CS?
600
601
602
|
# File 'lib/games_and_rpg_paradise/gamebooks/lone_wolf/character.rb', line 600
def combat_skill?
@internal_hash[:current_combat_skill]
end
|
329
330
331
|
# File 'lib/games_and_rpg_paradise/gamebooks/lone_wolf/character.rb', line 329
def
@internal_hash[:comments]
end
|
#completed_circles? ⇒ Boolean
230
231
232
|
# File 'lib/games_and_rpg_paradise/gamebooks/lone_wolf/character.rb', line 230
def completed_circles?
@internal_hash[:completed_circles]
end
|
#current_endurance? ⇒ Boolean
Also known as:
endurance?
#
current_endurance?
This method will return the current endurance-value.
#
784
785
786
|
# File 'lib/games_and_rpg_paradise/gamebooks/lone_wolf/character.rb', line 784
def current_endurance?
internal_hash[:current_endurance]
end
|
#debug_method_add_custom_values_for_now ⇒ Object
#
debug_method_add_custom_values_for_now
The following method is not called regularly - only if I need to initialize a new game for any custom character. Or testing a custom character.
#
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
|
# File 'lib/games_and_rpg_paradise/gamebooks/lone_wolf/character.rb', line 73
def debug_method_add_custom_values_for_now
@internal_hash[:kai_disciplines] = []
@internal_hash[:kai_disciplines] << 'Healing'
@internal_hash[:kai_disciplines] << 'Mindshield'
@internal_hash[:kai_disciplines] << 'Sixth Sense'
@internal_hash[:kai_disciplines] << 'Camouflage'
@internal_hash[:kai_disciplines].sort!
@internal_hash[:kai_disciplines] << 'Invisibility'
@internal_hash[:kai_disciplines] << 'Divination'
@internal_hash[:kai_disciplines] << 'Pathsmanship'
set_n_gold_coins(37)
set_endurance(26)
set_max_endurance(26)
set_initial_combat_skill(19)
set_current_combat_skill(19)
set_n_laumspur_potions(0)
set_n_arrows(4)
set_completed_circles(
[:circle_of_light]
)
add_n_to_max_endurance(3) batch_add('
- Summersword +8 CS
- Silver Bow of Duadon +3 on each roll, +2 because of weapon mastery
- Brass Whistle # 2
- Vial of Blue Pills for breahe underwater # 3
- Silk Jacket # 4
- Crystal Decanter # 5
- Silver Bowl #6
- Vial of Gold Dust #7
- Psychic Ring # -, small, can be worn freely
- Signet Ring # -, small, can be worn freely
- Laumspur: 0
- Fireseeds: 3
- Black Key (Special Item)
- Potion of Alether: 1, will increase effective CS by +2
- 3x laumspur MEALs
')
end
|
#do_die ⇒ Object
Also known as:
dies
252
253
254
|
# File 'lib/games_and_rpg_paradise/gamebooks/lone_wolf/character.rb', line 252
def do_die
set_is_alive(false)
end
|
#do_heal ⇒ Object
Also known as:
heal
#
do_heal (heal tag)
This method will heal the character, that is, set the current number of endurance points to the maximal number.
#
629
630
631
|
# File 'lib/games_and_rpg_paradise/gamebooks/lone_wolf/character.rb', line 629
def do_heal
set_current_endurance(:maximum)
end
|
#do_save(store_here = log_dir?+'lone_wolf_character_'+
name?.to_s.
downcase.tr(' ','_')+'.yml', dataset = internal_hash?
) ⇒ Object
Also known as:
save, store, save_into_file
#
do_save (save tag, do_save tag)
This method will save the important parts of this class.
#
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
|
# File 'lib/games_and_rpg_paradise/gamebooks/lone_wolf/character.rb', line 829
def do_save(
store_here = log_dir?+'lone_wolf_character_'+
name?.to_s.
downcase.tr(' ','_')+'.yml',
dataset = internal_hash?
)
require 'save_file'
base_dir = File.dirname(store_here)
unless File.directory? base_dir
mkdir(base_dir)
end
what = YAML.dump(dataset)
SaveFile.write_what_into(what, store_here)
return store_here end
|
#equipment? ⇒ Boolean
371
372
373
|
# File 'lib/games_and_rpg_paradise/gamebooks/lone_wolf/character.rb', line 371
def equipment?
@internal_hash[:equipment]
end
|
#has_curing_ability? ⇒ Boolean
#
has_curing_ability?
This method can be used to query whether the main actor has the curing discipline, whcih is an advanced Magnakai ability.
#
639
640
641
|
# File 'lib/games_and_rpg_paradise/gamebooks/lone_wolf/character.rb', line 639
def has_curing_ability?
disciplines?.include?('Curing')
end
|
#has_healing_ability? ⇒ Boolean
#
has_healing_ability?
This method can be used to query whether the main actor has the healing discipline.
#
619
620
621
|
# File 'lib/games_and_rpg_paradise/gamebooks/lone_wolf/character.rb', line 619
def has_healing_ability?
disciplines? and disciplines?.include?('Healing')
end
|
#increase_combat_skill_by(i = 1) ⇒ Object
#
increase_combat_skill_by
#
609
610
611
|
# File 'lib/games_and_rpg_paradise/gamebooks/lone_wolf/character.rb', line 609
def increase_combat_skill_by(i = 1)
@internal_hash[:current_combat_skill] += i
end
|
#initial_combat_skill? ⇒ Boolean
Also known as:
combat_skill_base_value?, initial_CS?
#
combat_skill_base_value?
#
482
483
484
|
# File 'lib/games_and_rpg_paradise/gamebooks/lone_wolf/character.rb', line 482
def initial_combat_skill?
@internal_hash[:initial_combat_skill]
end
|
#internal_hash? ⇒ Boolean
Also known as:
internal_hash
438
439
440
|
# File 'lib/games_and_rpg_paradise/gamebooks/lone_wolf/character.rb', line 438
def internal_hash?
@internal_hash
end
|
#is_alive? ⇒ Boolean
490
491
492
|
# File 'lib/games_and_rpg_paradise/gamebooks/lone_wolf/character.rb', line 490
def is_alive?
@internal_hash[:is_alive]
end
|
#is_lone_wolf? ⇒ Boolean
586
587
588
|
# File 'lib/games_and_rpg_paradise/gamebooks/lone_wolf/character.rb', line 586
def is_lone_wolf?
true
end
|
#is_now_dead ⇒ Object
497
498
499
|
# File 'lib/games_and_rpg_paradise/gamebooks/lone_wolf/character.rb', line 497
def is_now_dead
@internal_hash[:is_alive] = false
end
|
#kai_disciplines? ⇒ Boolean
Also known as:
disciplines?, array_kai_disciplines
809
810
811
|
# File 'lib/games_and_rpg_paradise/gamebooks/lone_wolf/character.rb', line 809
def kai_disciplines?
@internal_hash[:kai_disciplines]
end
|
#load_this_file(this_file) ⇒ Object
Also known as:
load_character, load_dataset_from_this_file, load_from_this_file
#
load_this_file (load tag)
This method can be used for load-related functionality.
#
572
573
574
575
576
577
578
579
|
# File 'lib/games_and_rpg_paradise/gamebooks/lone_wolf/character.rb', line 572
def load_this_file(this_file)
@internal_hash.clear
dataset = YAML.load_file(this_file)
dataset.each_pair {|key, value|
setter_method = "set_#{key}"
send(setter_method, value)
}
end
|
#log_dir? ⇒ Boolean
550
551
552
|
# File 'lib/games_and_rpg_paradise/gamebooks/lone_wolf/character.rb', line 550
def log_dir?
'/home/x/Temp/rpg_paradise/'
end
|
#max_endurance? ⇒ Boolean
Also known as:
maximal_endurance?
685
686
687
|
# File 'lib/games_and_rpg_paradise/gamebooks/lone_wolf/character.rb', line 685
def max_endurance?
@internal_hash[:max_endurance]
end
|
#n_alether_potions? ⇒ Boolean
385
386
387
|
# File 'lib/games_and_rpg_paradise/gamebooks/lone_wolf/character.rb', line 385
def n_alether_potions?
@internal_hash[:n_alether_potions]
end
|
#n_arrows? ⇒ Boolean
518
519
520
|
# File 'lib/games_and_rpg_paradise/gamebooks/lone_wolf/character.rb', line 518
def n_arrows?
@internal_hash[:n_arrows]
end
|
#n_gold_coins? ⇒ Boolean
Also known as:
gold?
304
305
306
|
# File 'lib/games_and_rpg_paradise/gamebooks/lone_wolf/character.rb', line 304
def n_gold_coins?
@internal_hash[:n_gold_coins]
end
|
#n_kai_disciplines? ⇒ Boolean
#
n_kai_disciplines?
Return how many tai-disciplines this actor knows.
#
287
288
289
|
# File 'lib/games_and_rpg_paradise/gamebooks/lone_wolf/character.rb', line 287
def n_kai_disciplines?
@internal_hash[:kai_disciplines].size
end
|
#n_laumspur_potions? ⇒ Boolean
Also known as:
n_laumspur?
378
379
380
|
# File 'lib/games_and_rpg_paradise/gamebooks/lone_wolf/character.rb', line 378
def n_laumspur_potions?
@internal_hash[:n_laumspur_potions]
end
|
#n_meals? ⇒ Boolean
431
432
433
|
# File 'lib/games_and_rpg_paradise/gamebooks/lone_wolf/character.rb', line 431
def n_meals?
@internal_hash[:n_meals]
end
|
#n_quivers? ⇒ Boolean
525
526
527
|
# File 'lib/games_and_rpg_paradise/gamebooks/lone_wolf/character.rb', line 525
def n_quivers?
@internal_hash[:n_quivers]
end
|
#name? ⇒ Boolean
343
344
345
|
# File 'lib/games_and_rpg_paradise/gamebooks/lone_wolf/character.rb', line 343
def name?
@name
end
|
#reset ⇒ Object
350
351
352
353
354
355
356
|
# File 'lib/games_and_rpg_paradise/gamebooks/lone_wolf/character.rb', line 350
def reset
reset_to_the_original_gamestate
@internal_hash[:equipment] = []
end
|
#reset_to_the_original_gamestate ⇒ Object
#
reset_to_the_original_gamestate
#
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
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
|
# File 'lib/games_and_rpg_paradise/gamebooks/lone_wolf/character.rb', line 130
def reset_to_the_original_gamestate
@internal_hash = {}
@internal_hash[:n_arrows] = 0
@internal_hash[:n_quivers] = 0
@internal_hash[:n_meals] = 0
@internal_hash[:n_gold_coins] = 0
@internal_hash[:n_laumspur_potions] = 0
@internal_hash[:n_alether_potions] = 0
@internal_hash[:current_endurance] = 0
@internal_hash[:max_endurance] = 0
@internal_hash[:current_combat_skill] = 0
@internal_hash[:initial_combat_skill] = 0 @internal_hash[:completed_circles] = []
@internal_hash[:is_alive] = true
@internal_hash[:weapons] = []
@internal_hash[:comments] = []
@internal_hash[:kai_disciplines] = []
@name = 'Lone Wolf Actor'
end
|
336
337
338
|
# File 'lib/games_and_rpg_paradise/gamebooks/lone_wolf/character.rb', line 336
def (i)
@internal_hash[:comments] = [i].flatten.compact
end
|
#set_completed_circles(i) ⇒ Object
#
set_completed_circles
#
223
224
225
|
# File 'lib/games_and_rpg_paradise/gamebooks/lone_wolf/character.rb', line 223
def set_completed_circles(i)
@internal_hash[:completed_circles] = [i].flatten
end
|
#set_current_combat_skill(i) ⇒ Object
Also known as:
set_combat_skill, set_current_stärke, set_max_combat_skill
#
set_current_combat_skill
This is the effective combat skill - that is the one that is used for the current combat at hand.
#
465
466
467
|
# File 'lib/games_and_rpg_paradise/gamebooks/lone_wolf/character.rb', line 465
def set_current_combat_skill(i)
@internal_hash[:current_combat_skill] = i.to_i
end
|
#set_current_endurance(i) ⇒ Object
Also known as:
set_endurance, endurance=, set_base_endurance
#
set_current_endurance
#
759
760
761
762
763
764
765
766
767
768
|
# File 'lib/games_and_rpg_paradise/gamebooks/lone_wolf/character.rb', line 759
def set_current_endurance(i)
case i
when :maximum
i = max_endurance?
end
internal_hash[:current_endurance] = i.to_i
end
|
#set_equipment(i) ⇒ Object
Also known as:
equipment=
361
362
363
364
365
366
|
# File 'lib/games_and_rpg_paradise/gamebooks/lone_wolf/character.rb', line 361
def set_equipment(i)
if i.is_a?(String) and i.strip.include?("\n")
i = i.strip.split("\n")
end
@internal_hash[:equipment] = [i].flatten.compact
end
|
#set_initial_combat_skill(i) ⇒ Object
Also known as:
set_combat_skill_base_value, combat_skill=
#
set_initial_combat_skill
#
474
475
476
|
# File 'lib/games_and_rpg_paradise/gamebooks/lone_wolf/character.rb', line 474
def set_initial_combat_skill(i)
@internal_hash[:initial_combat_skill] = i.to_i
end
|
#set_is_alive(i) ⇒ Object
245
246
247
|
# File 'lib/games_and_rpg_paradise/gamebooks/lone_wolf/character.rb', line 245
def set_is_alive(i)
@internal_hash[:is_alive] = i
end
|
#set_kai_disciplines(i) ⇒ Object
275
276
277
278
279
280
|
# File 'lib/games_and_rpg_paradise/gamebooks/lone_wolf/character.rb', line 275
def set_kai_disciplines(i)
if i.is_a?(String) and i.include?("\n")
i = i.strip.split("\n")
end
@internal_hash[:kai_disciplines] = [i].flatten.compact
end
|
#set_max_endurance(i) ⇒ Object
775
776
777
|
# File 'lib/games_and_rpg_paradise/gamebooks/lone_wolf/character.rb', line 775
def set_max_endurance(i)
@internal_hash[:max_endurance] = i.to_i
end
|
#set_n_alether_potions(i) ⇒ Object
Also known as:
set_n_alether, alether=
#
set_n_alether_potions
#
817
818
819
820
821
|
# File 'lib/games_and_rpg_paradise/gamebooks/lone_wolf/character.rb', line 817
def set_n_alether_potions(i)
i = i.to_i i = 0 if i < 0
@internal_hash[:n_alether_potions] = i
end
|
#set_n_arrows(i) ⇒ Object
Also known as:
arrows=
504
505
506
|
# File 'lib/games_and_rpg_paradise/gamebooks/lone_wolf/character.rb', line 504
def set_n_arrows(i)
@internal_hash[:n_arrows] = i.to_i end
|
#set_n_gold_coins(i) ⇒ Object
Also known as:
set_n_gold, n_gold_coins=
311
312
313
|
# File 'lib/games_and_rpg_paradise/gamebooks/lone_wolf/character.rb', line 311
def set_n_gold_coins(i)
@internal_hash[:n_gold_coins] = i.to_i
end
|
#set_n_laumspur_potions(i) ⇒ Object
Also known as:
set_n_laumspur, laumspur=
#
set_n_laumspur_potions
#
392
393
394
395
396
|
# File 'lib/games_and_rpg_paradise/gamebooks/lone_wolf/character.rb', line 392
def set_n_laumspur_potions(i)
i = i.to_i i = 0 if i < 0
@internal_hash[:n_laumspur_potions] = i
end
|
#set_n_meals(i) ⇒ Object
Also known as:
n_meals=, meals=
237
238
239
|
# File 'lib/games_and_rpg_paradise/gamebooks/lone_wolf/character.rb', line 237
def set_n_meals(i)
@internal_hash[:n_meals] = i.to_i end
|
#set_n_quivers(i) ⇒ Object
Also known as:
quivers=
511
512
513
|
# File 'lib/games_and_rpg_paradise/gamebooks/lone_wolf/character.rb', line 511
def set_n_quivers(i)
@internal_hash[:n_quivers] = i.to_i end
|
#set_weapons(i) ⇒ Object
Also known as:
weapons=
#
set_weapons
Note that this method will turn Strings into an Array, if they contain at the least one newline character.
#
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
|
# File 'lib/games_and_rpg_paradise/gamebooks/lone_wolf/character.rb', line 659
def set_weapons(i)
if i.is_a?(String)
i = i.split("\n").map {|entry|
if entry.include? '#'
entry = entry.split('#').first end
entry.rstrip
}
end
i = [i].flatten.compact
@internal_hash[:weapons] = i
end
|
#show_short_summary ⇒ Object
Also known as:
summary, summary?, report
791
792
793
794
795
796
797
798
799
800
801
802
|
# File 'lib/games_and_rpg_paradise/gamebooks/lone_wolf/character.rb', line 791
def show_short_summary
e 'CS: '+initial_CS?.to_s+' / '+current_CS?.to_s
e '='*80
e 'EN: '+current_endurance?.to_s
e 'EN (max): '+max_endurance?.to_s
e 'Weapons:'
weapons?.each {|this_weapon|
e " - #{this_weapon}"
}
e 'n gold coins: '+n_gold_coins?.to_s
e '='*80
end
|
#tai_disciplines=(i) ⇒ Object
294
295
296
297
298
299
|
# File 'lib/games_and_rpg_paradise/gamebooks/lone_wolf/character.rb', line 294
def tai_disciplines=(i)
if i.is_a?(String) and i.include? "\n"
i = i.split("\n")
end
@internal_hash[:kai_disciplines] = [i].flatten
end
|
#try_to_add_n_hitpoints(i) ⇒ Object
#
try_to_add_n_hitpoints
This actually adds to endurance.
#
447
448
449
450
451
452
453
454
455
456
457
|
# File 'lib/games_and_rpg_paradise/gamebooks/lone_wolf/character.rb', line 447
def try_to_add_n_hitpoints(i)
i = i.to_i
if current_endurance?.is_a? String
set_current_endurance(current_endurance?.to_i)
end
if (current_endurance? + i) <= max_endurance?.to_i
set_current_endurance(current_endurance? + i)
else
set_endurance(max_endurance?)
end
end
|
#try_to_regenerate_n_hp(i = 1) ⇒ Object
#
try_to_regenerate_n_hp
#
646
647
648
649
650
651
|
# File 'lib/games_and_rpg_paradise/gamebooks/lone_wolf/character.rb', line 646
def try_to_regenerate_n_hp(i = 1)
new_value = current_endurance?.to_i + 1
if new_value <= max_endurance?
set_current_endurance(new_value)
end
end
|
#weapons? ⇒ Boolean
678
679
680
|
# File 'lib/games_and_rpg_paradise/gamebooks/lone_wolf/character.rb', line 678
def weapons?
@internal_hash[:weapons]
end
|