Character Creation #60

Parent #2Owner #5Flags read, writeSource MurpgCore-0.4/MurpgCore-0.4.db

3 verbs · 21 properties · 0 children

Verbs

VerbSpecFlagsDefinerLines
describe_tothis none thisrwxd#6061
spec*iesany any anyrwd#6050
full*nameany any anyrwd#6015

Properties

PropertyDefinerFlagsOwnerValue
how_full#2rw#10<clear>
exits#2rw#10<clear>
entrances#2rw#10<clear>
colors#2rw#10{"%W", "%w", "%G", "%C", "%W"}
combatants#2rw#10<clear>
combat_pid#2rw#10<clear>
endurance_cost#2rw#10<clear>
description#1rw#10
list of 11{"%W1.%w Set the following attributes by typing <attribute> <value>.", "%W2.%w You need to fill in at least name and full name. Anything else that you", " don't set will be automatically completed for you.", "%W3.%w The \"points left\" tells you how many points you have left to distribute", " amongst your six ability scores.", "%W4.%w For Height, do not include the ' and \" (e.g. HEIGHT 5 11).", "%W5.%w Most things can be abbreviated with the first four characters (e.g. stre,", " inte, dext, conc, full, lang).", "", "%WNote:%w Changing your species may alter your ability scores, height, and weight,", " as different species have different minimum and maximum values."}
aliases#1rw#10{}
home#1rw#10<clear>
short_desc#1rw#10<clear>
core#1rw#101
handedness#1rw#10<clear>
base_enc#1rw#10<clear>
base_weight#1rw#10<clear>
capacity#1rw#10<clear>
max_fit#1rw#10<clear>
pprep#1rw#10<clear>
gprep#1rw#10<clear>
generic_name#1rw#10<clear>
age#1rw#10<clear>

Ancestry

Ancestors (nearest first): #2 Room Class#11 Game Class#1 Root Class

Children: none

Call graph

calls n60_0 #60:describe_to n2_5 #2:describe_to n60_0->n2_5 n20_20 #20:height_str n60_0->n20_20 n60_1 #60:spec*ies n3_2 #3:tell n60_1->n3_2 n60_2 #60:full*name n60_2->n3_2

Source

describe_to

Spec this none thisFlags rwxdOwner #10Definer #60

Referenced by

none

Source

1"Char Creation Room:describe_to this none this";
2"returns 0 if target isn't a valid animate objidnum";
3{target} = args;
4if (pass(@args))
5return 0;
6elseif (target.finished == 1)
7target:tell("Your character is already finished.  You can't do anything here.  Go away!");
8else
9target:tell("");
10"species";
11target:tell("~", $utils:padr("  Species:", 16), $utils:padr(target.species.generic_name, 20), "(");
12allowed_species = $player_species;
13target:tell("~", allowed_species[1].generic_name);
14for each in (allowed_species[2..$])
15target:tell("~, ", each.generic_name);
16endfor
17target:tell(")");
18"name";
19target:tell($utils:padr("  Name:", 16), $utils:padr(target.name, 20), "(20 chars, no spaces)");
20target:tell($utils:padr("  Full Name:", 16), $utils:padr(target.full_name, 20), "(20 chars, including spaces)");
21"gender";
22target:tell("~", $utils:padr("  Gender:", 16), $utils:padr(target.gender, 20), "(");
23allowed_genders = $genders;
24target:tell("~", allowed_genders[1]);
25for each in (allowed_genders[2..$])
26target:tell("~, ", each);
27endfor
28target:tell(")");
29"height";
30target:tell($utils:padr("  Height:", 16), $utils:padr(target:height_str(), 20), "(", $utils:height_str(target.species.min_height), " - ", $utils:height_str(target.species.max_height), ")");
31"weight";
32target:tell($utils:padr("  Weight:", 16), $utils:padr(tostr(target.base_weight) + " lbs.", 20), "(", target.species.min_weight, " - ", target.species.max_weight, " lbs.)");
33"languages";
34if (length(target.known_languages) == 0)
35lang_str = "";
36elseif (length(target.known_languages) == 1)
37lang_str = target.known_languages[1].name;
38else
39lang_str = target.known_languages[1].name;
40for each in (target.known_languages[2..$])
41lang_str = (lang_str + ", ") + each.name;
42endfor
43endif
44target:tell("~", $utils:padr("  Languages:", 16), $utils:padr(lang_str, 20), "(");
45allowed_langs = $languages;
46target:tell("~", allowed_langs[1].name);
47for each in (allowed_langs[2..$])
48target:tell("~, ", each.name);
49endfor
50target:tell(")");
51"ability scores";
52target:tell($utils:padr("  Strength:", 16), $utils:padr(tostr(target.base_str), 20), "(", target.species.min_str, " - ", target.species.max_str, ")");
53target:tell($utils:padr("  Intelligence:", 16), $utils:padr(tostr(target.base_int), 20), "(", target.species.min_int, " - ", target.species.max_int, ")");
54target:tell($utils:padr("  Dexterity:", 16), $utils:padr(tostr(target.base_dex), 20), "(", target.species.min_dex, " - ", target.species.max_dex, ")");
55target:tell($utils:padr("  Constitution:", 16), $utils:padr(tostr(target.base_con), 20), "(", target.species.min_con, " - ", target.species.max_con, ")");
56target:tell($utils:padr("  Concentration:", 16), $utils:padr(tostr(target.base_cnc), 20), "(", target.species.min_cnc, " - ", target.species.max_cnc, ")");
57target:tell($utils:padr("  Speed:", 16), $utils:padr(tostr(target.base_spd), 20), "(", target.species.min_spd, " - ", target.species.max_spd, ")");
58target:tell("");
59points_left = (target.total_points - target.base_str) - ((((target.base_int + target.base_dex) + target.base_spd) + target.base_con) + target.base_cnc);
60target:tell("You have ", points_left, " points left.  Type CREATE to create this character and start playing!");
61endif

spec*ies

Spec any any anyFlags rwdOwner #10Definer #60

Referenced by

none

Source

1"char creation room : species any any any";
2"sets player's species, checks scores for min/max values";
3"assigns extra points for modifying primary attributes.";
4species = $utils:trimr(argstr);
5species_names = {};
6for each in ($player_species)
7species_names = {@species_names, each.generic_name};
8endfor
9if (species in species_names)
10player:tell("Good choice.");
11player.species = $player_species[species in species_names];
12player.total_points = 60 + random(player.species.bonus_points);
13"adjust ability scores";
14player.base_str = (player.base_str > player.species.max_str) ? player.species.max_str | player.base_str;
15player.base_str = (player.base_str < player.species.min_str) ? player.species.min_str | player.base_str;
16player.base_int = (player.base_int > player.species.max_int) ? player.species.max_int | player.base_int;
17player.base_int = (player.base_int < player.species.min_int) ? player.species.min_int | player.base_int;
18player.base_dex = (player.base_dex > player.species.max_dex) ? player.species.max_dex | player.base_dex;
19player.base_dex = (player.base_dex < player.species.min_dex) ? player.species.min_dex | player.base_dex;
20player.base_spd = (player.base_spd > player.species.max_spd) ? player.species.max_spd | player.base_spd;
21player.base_spd = (player.base_spd < player.species.min_spd) ? player.species.min_spd | player.base_spd;
22player.base_con = (player.base_con > player.species.max_con) ? player.species.max_con | player.base_con;
23player.base_con = (player.base_con < player.species.min_con) ? player.species.min_con | player.base_con;
24player.base_cnc = (player.base_cnc > player.species.max_cnc) ? player.species.max_cnc | player.base_cnc;
25player.base_cnc = (player.base_cnc < player.species.min_cnc) ? player.species.min_cnc | player.base_cnc;
26"if total of scores is greater than total points, then reduce everything to minimums.";
27total_scores = ((((player.base_str + player.base_int) + player.base_dex) + player.base_spd) + player.base_con) + player.base_cnc;
28if (total_scores > player.total_points)
29player.base_str = player.species.min_str;
30player.base_int = player.species.min_int;
31player.base_dex = player.species.min_dex;
32player.base_spd = player.species.min_spd;
33player.base_cnc = player.species.min_cnc;
34player.base_con = player.species.min_con;
35endif
36"adjust height and weight";
37player.height = (player.height > player.species.max_height) ? player.species.max_height | player.height;
38player.height = (player.height < player.species.min_height) ? player.species.min_height | player.height;
39player.base_weight = (player.base_weight > player.species.max_weight) ? player.species.max_weight | player.base_weight;
40player.base_weight = (player.base_weight < player.species.min_weight) ? player.species.min_weight | player.base_weight;
41else
42if (species == "")
43player:tell("Please select a species from the following list:");
44else
45player:tell("That is not a valid species.  Please select from the following list:");
46endif
47for each in (species_names)
48player:tell("  " + each);
49endfor
50endif

full*name

Spec any any anyFlags rwdOwner #10Definer #60

Referenced by

none

Source

1"Char creation : full*name any any any";
2"assigns name to player, letters only, no spaces.";
3fullnamestr = argstr;
4invalid = 0;
5for x in [1..length(fullnamestr)]
6if (!(index($letters, fullnamestr[x]) || (fullnamestr[x] == " ")))
7invalid = 1;
8endif
9endfor
10if (invalid || (length(fullnamestr) > 20))
11player:tell("Your full name can only be 20 characters long, and must only contain letters and spaces.");
12else
13player.full_name = fullnamestr;
14player:tell("Your full name has been changed.");
15endif