Generic Temple #133

Parent #118Owner #36Flags read, fertileSource QuestCore.db

Aliases: Generic Temple, temple

8 verbs · 69 properties · 0 children

Verbs

VerbSpecFlagsDefinerLines
worship prayany any anyrd#13322
joinany none nonerd#13327
donate tithe offerany any anyrd#13322
add_donorthis none thisrxd#1337
rem_donorthis none thisrxd#1334
donor_tallythis none thisrxd#1335
init_for_corethis none thisrxd#13319
help_msgthis none thisrxd#13314

Properties

PropertyDefinerFlagsOwnerValue
gods#133rc#36{}
orgs#133rc#36{}
min_stats#133rc#36{2.0, 2.0, 8.5, 1.5}
stat_to_heal#133rc#364
donors#133r#36{}
gold#133r#360.0
is_temple#133rc#361
antigods#133rc#36{}
virtual_exit_task#118r#2<clear>
defaulting_exit_oleave_msg#118rc#36<clear>
blessed_entrances#118rc#36<clear>
virtual_exits#118rc#36{}
give_short_alias#118rc#36<clear>
virtual_exit_to_use#118r#2<clear>
lit_from_outside#118rc#36<clear>
bot_locked#104rc#36<clear>
fakes#104r#36<clear>
retail#104rc#360
seat#104r#36<clear>
pool#104r#36<clear>
seat_desc#104r#36<clear>
pool_desc#104r#36<clear>
sit_phrase#104rc#36<clear>
stand_phrase#104rc#36<clear>
swim_phrase#104rc#36<clear>
dry_phrase#104rc#36<clear>
push_phrase#104rc#36<clear>
seat_aliai#104r#36<clear>
pool_aliai#104r#36<clear>
seat_contents#104r#36<clear>
pool_contents#104r#36<clear>
seat_max#104r#36<clear>
pool_max#104r#36<clear>
details#104rc#36<clear>
temp_detail_index#104rc#36<clear>
temp_detail_desc#104rc#36<clear>
outdoors#104r#36<clear>
attack_queue#104r#2<clear>
battle_on#104r#2<clear>
stop_msg#104rc#36<clear>
remove_msg#104rc#36<clear>
dump_msg#104rc#36<clear>
dump_loc#104rc#36#62
sanctuary#104rc#361
ansi_title#104r#36<clear>
dark_desc#104rc#36<clear>
title_style#104rc#36<clear>
build_help#104rc#36
list of 9{" The temple can be modified to allow a player to join any organization, not just the religious type. For non-religious orgs, turn off the .is_temple property. The second argument in each org pair is for the \"help here\" message, and the third argument is for gender restrictions: 0=ANY 1=MALE 2=FEMALE 3=MALE/FEMALE.", "", "@set these props:", " temple.gods {\"god1\", \"god2\"}", " temple.antigods {\"antigod1\", \"antigod2\"}", " temple.orgs {{\"org1\", \"info1\", 0}, {\"org2\", \"info2\", 0}}", " temple.min_stats {2.0, 2.0, 8.5, 1.5}", " temple.stat_to_heal 1-4", " temple.is_temple 0-1"}
battle_task#104r#2<clear>
dig_level#104rc#36<clear>
holes#104r#2<clear>
help_msg#104rc#36{" donate/tithe/offer <any>", " worship/pray [any]", " join <any>"}
who_location_msg#3rc#36<clear>
free_home#3rc#36<clear>
victim_ejection_msg#3rc#36<clear>
ejection_msg#3rc#36<clear>
oejection_msg#3rc#36<clear>
residents#3rc#36<clear>
free_entry#3rc#36<clear>
entrances#3c#36<clear>
blessed_object#3rc#36<clear>
blessed_task#3rc#36<clear>
exits#3c#36<clear>
dark#3rc#36<clear>
ctype#3rc#36<clear>
key#1c#360
aliases#1rc#36{"Generic Temple", "temple"}
description#1rc#36<clear>
object_size#1r#36{9471, -1090650497}

Ancestry

Ancestors (nearest first): #118 virtual exit room#104 RPG room#3 generic room#1 Root Class

Children: none

Call graph

calls n133_0 #133:worship n35_1 #35:say_action n133_0->n35_1 n6_18 #6:tell n133_0->n6_18 n133_5 #133:donor_tally n133_0->n133_5 n133_3 #133:add_donor n133_0->n133_3 n55_16 #55:slice n133_5->n55_16 n133_3->n55_16 n133_1 #133:join n133_1->n6_18 n133_1->n55_16 n20_6 #20:english_list n133_1->n20_6 n133_2 #133:donate n133_2->n35_1 n133_2->n6_18 n133_2->n133_3 n103_0 #103:_has_currency n133_2->n103_0 n103_1 #103:_from_to n133_2->n103_1 n3_4 #3:announce n133_2->n3_4 n102_4 #102:title n133_2->n102_4 n104_42 #104:title n133_2->n104_42 n6_7 #6:my_match_object n133_2->n6_7 n133_4 #133:rem_donor n133_4->n55_16 n133_6 #133:init_for_core n118_19 #118:init_for_core n133_6->n118_19 n133_7 #133:help_msg n133_7->n20_6 n104_46 #104:help_msg n133_7->n104_46

Source

worship pray

Spec any any anyFlags rdOwner #36Definer #133

Referenced by

none

Source

1if (!this.is_temple)
2return $you:say_action(tostr("%N %<says> a quick prayer."));
3elseif (dobjstr || iobjstr)
4if ((g = iobjstr in this.gods) || (g = dobjstr in this.gods))
5god = this.gods[g];
6elseif ((g = iobjstr in this.antigods) || (g = dobjstr in this.antigods))
7player:tell("Your blasphemous desecration brings a curse upon you!");
8player:tell("You feel your ", player.stats[1][this.stat_to_heal], " drain away!");
9player.stats_current[2][this.stat_to_heal] = player.stats_current[2][this.stat_to_heal] * 0.75;
10else
11god = `this.gods[random($)] ! ANY => "the powers that be"';
12endif
13else
14god = `this.gods[random($)] ! ANY => "the powers that be"';
15endif
16$you:say_action(tostr("%N %<says> a prayer to ", god, "."));
17if (((heal = player.stats[2][this.stat_to_heal] - player.stats_current[2][this.stat_to_heal]) > 0.0) && (0.0 < (val = this:donor_tally(player))))
18heal = ((x = val * 0.05) < heal) ? x | heal;
19player.stats_current[2][this.stat_to_heal] = player.stats_current[2][this.stat_to_heal] + heal;
20player:tell("You feel the grace of ", god, " restore your ", player.stats[1][this.stat_to_heal], ".");
21this:add_donor(player, heal / -0.1);
22endif

join

Spec any none noneFlags rdOwner #36Definer #133

Referenced by

none

Source

1if (!(org = dobjstr in $list_utils:slice(this.orgs)))
2player:tell("You may only join ", $string_utils:english_list(this.orgs), ".");
3else
4okay = 1;
5for s in [1..4]
6if (player.stats_current[2][s] < this.min_stats[s])
7okay = 0;
8break;
9endif
10endfor
11"gender from .orgs[org][3] => 0=ANY, 1=Male, 2=Female 3=Male/Female";
12if ((this.orgs[org][3] == 1) && (!(player.gender == "male")))
13player:tell("A member of ", this.orgs[org][1], "must be male.");
14okay = 0;
15elseif ((this.orgs[org][3] == 2) && (!(player.gender == "female")))
16player:tell("A member of ", this.orgs[org][1], "must be female.");
17okay = 0;
18elseif ((this.orgs[org][3] == 3) && (!(player.gender in {"male", "female"})))
19player:tell("A member of ", this.orgs[org][1], "must be either female or male.");
20okay = 0;
21endif
22if (okay)
23player:tell("You join ", this.orgs[org][1], ".");
24else
25player:tell("You don't meet the minimum requirements for ", this.orgs[org][1], ".");
26endif
27endif

donate tithe offer

Spec any any anyFlags rdOwner #36Definer #133

Referenced by

none

Source

1args = setremove(args, "to");
2if (toint(args[1]) < 0)
3return player:tell("You can't give a negative amount.");
4elseif (toint(args[1]) && $money_utils:_has_currency(args[2]))
5left = player:_rem_money(args[2], tofloat(args[1]));
6if (left != 0)
7return player:tell("You don't have that many ", args[2], ".");
8endif
9value = $money_utils:_from_to(args[2], "Gold", tofloat(args[1]));
10this.gold = this.gold + value;
11this:announce(player:title(), " donates some money to ", this:title(), ".");
12player:tell("You offer ", args[1], " ", args[2], " to ", this:title(), ".");
13this:add_donor(player, value);
14elseif (valid(o = player:my_match_object(dobjstr)) && (o.value_base > 0.0))
15value = o.value_base;
16this:add_donor(player, value);
17o:moveto(`$local.dead_object_container ! ANY => $nothing');
18this.gold = this.gold + value;
19$you:say_action(tostr("%N %<donates> ", o:title(), " to ", this:title(), "."));
20else
21player:tell("The temple can't use that.");
22endif

add_donor

Spec this none thisFlags rxdOwner #36Definer #133

Referenced by

Source

1"USAGE: add_donor(donor, gold value)";
2if (d = args[1] in $list_utils:slice(this.donors))
3this.donors[d][2] = this.donors[d][2] + tofloat(args[2]);
4this.donors[d][2] = (this.donors[d][2] > 0.0001) ? this.donors[d][2] | 0.0;
5else
6this.donors = {@this.donors, {args[1], tofloat(args[2])}};
7endif

rem_donor

Spec this none thisFlags rxdOwner #36Definer #133

Referenced by

none

Source

1"USAGE: rem_donor(donor)";
2if (d = args[1] in $list_utils:slice(this.donors))
3this.donors = setremove(this.donors, this.donors[d]);
4endif

donor_tally

Spec this none thisFlags rxdOwner #36Definer #133

Referenced by

Source

1"USAGE: donor_tally(donor) => amount donor has given recently";
2if (d = args[1] in $list_utils:slice(this.donors))
3return this.donors[d][2];
4endif
5return 0.0;

init_for_core

Spec this none thisFlags rxdOwner #2Definer #133

Referenced by

none

Source

1if (caller_perms().wizard)
2if (this == $temple)
3this.gods = {};
4this.antigods = {};
5this.orgs = {};
6this.min_stats = {2.0, 2.0, 8.5, 1.5};
7this.stat_to_heal = 4;
8this.donors = {};
9this.gold = 0.0;
10this.sanctuary = 1;
11else
12for p in (properties($temple))
13if ((!p) in {"build_help", "help_msg"})
14clear_property(this, p);
15endif
16endfor
17endif
18return pass(@args);
19endif

help_msg

Spec this none thisFlags rxdOwner #2Definer #133

Referenced by

none

Source

1msg = (this.is_temple && this.gods) ? {"Deities worshipped here:", "  " + $string_utils:english_list(this.gods), "", "Organizations to join:"} | {"Organizations to join:"};
2for o in (this.orgs)
3if (o[3] == 1)
4blurb = "(male only)";
5elseif (o[3] == 2)
6blurb = "(female only)";
7elseif (o[3] == 3)
8blurb = "(male or female only)";
9else
10blurb = "";
11endif
12msg = {@msg, (((("  " + o[1]) + " -- ") + o[2]) + " ") + blurb};
13endfor
14return {@msg, "", @pass(@args)};