generic poison #1760
Aliases: generic poison, poison
12 verbs · 22 properties · 0 children
Verbs
| Verb | Spec | Flags | Definer | Lines |
|---|---|---|---|---|
effect | this none this | | #1760 | 15 |
schedule | this none this | | #1760 | 31 |
instant_effect | this none this | | #1760 | 2 |
delayed_effect | this none this | | #1760 | 3 |
announce_poisoning | this none this | | #1760 | 3 |
damage | this none this | | #1760 | 42 |
make_fertile | this none this | | #1760 | 13 |
cancel | this none this | | #1760 | 8 |
death_effect | this none this | | #1760 | 12 |
schedule(old) | this none this | | #1760 | 25 |
death_msg stun_msg damage_msg odeath_msg ostun_msg odamage_msg cure_msg ocure_msg | this none this | | #1760 | 2 |
damage(old) | this none this | | #1760 | 24 |
Properties
| Property | Definer | Flags | Owner | Value |
|---|---|---|---|---|
data | #1760 | r | — | {} |
task | #1760 | r | — | 1698963992 |
delayed | #1760 | rc | — | 0 |
poisoner | #1760 | rc | — | "empty slot" |
death_msg | #1760 | rc | — | "" |
stun_msg | #1760 | rc | — | "" |
damage_msg | #1760 | rc | — | "" |
ostun_msg | #1760 | rc | — | "" |
odamage_msg | #1760 | rc | — | "" |
odeath_msg | #1760 | rc | — | "" |
cure_msg | #1760 | rc | — | "" |
ocure_msg | #1760 | rc | — | "" |
manufactured | #1760 | | — | 947275400 |
worth | #1760 | | — | -1 |
condition | #1760 | | — | E_NONE |
odrop_failed_msg | #1760 | | — | "%<tries> to drop %t but fails!" |
odrop_succeeded_msg | #1760 | | — | "%<drops> %t." |
otake_succeeded_msg | #1760 | | — | "%<picks> up %t." |
key | #1760 | | — | not readable (E_PERM) |
aliases | #1760 | | — | {"generic poison", "poison"} |
description | #1760 | | — | value (450 chars){"Ok, so here's how it works:", "", "Design the effect object with combat and/or armour and/or magic effects ", "and make it a child of Generic Armour/Combat/Magic Effect (#8868) as ", "appropriate.", "", "Set the .effects to be {\"magic_effects\", \"combat_effects\"} or whatever ", "you've defined.", "", "Now you can use this:add(<doll>) and this:remove(<doll>) to add/remove ", "this object from the correct effects properties on <doll>. Whee."} |
object_size | #1760 | | — | {11716, 1141286558} |
Ancestry
Ancestors (nearest first): #8868 Generic Casting/Armour/View/Freeze/Combat/Magic Effect → #517 Generic LRPG Thing
Children: none
Call graph
Source
effect
Referenced by
none
Source
1"poison:effect(OBJ doll, OBJ source, INT quality, LIST body areas) => Poison the target with whatever the poison does."; 2$local.rpg:secure(); 3"We need some sort of dollish hook here. Like maybe the following?"; 4"This might be able to substitute for monster:receive_damage_poison."; 5{doll, source, qual, areas} = args; 6if (typeof(effect = doll:chemical_effects(source, this, qual)) != INT) 7 return; 8endif 9qual = qual - effect; 10"Such a hook should probably be checked in :delayed_effect too."; 11if (this.delayed) 12 this:schedule(doll, source, qual, areas); 13endif 14this:announce_poisoning(doll, source, qual, areas); 15this:instant_effect(doll, source, qual, areas);
schedule
Referenced by
- #1760:effect line 12:
this:schedule
Source
1":schedule(OBJ doll, OBJ source, INT quality, LIST body areas) => Schedule an even with the root poison task."; 2"We're not using doll.schedule, well, because it's icky."; 3{doll, source, qual, areas} = args; 4$local.rpg:secure(); 5root = $code_utils:verb_loc(); 6root.data = listappend(root.data, {this, doll, source, qual, areas}); 7this:add(doll); 8if (!$code_utils:task_valid(root.task)) 9 fork t (0) 10 n = length(root.data); 11 while (root.data) 12 current = root.data[1]; 13 if ((!is_player(current[3])) || (`idle_seconds(current[3]) ! E_INVARG' != E_INVARG)) 14 fork (0) 15 current[1]:delayed_effect(@current[2..$]); 16 current[1]:remove(current[2]); 17 endfork 18 root.data = root.data[2..$]; 19 endif 20 n = n - 1; 21 suspend(random(20) + 5); 22 if (n < 1) 23 suspend(200 + random(100)); 24 n = length(root.data); 25 endif 26 endwhile 27 endfork 28 root.task = t; 29endif 30"THX (#105941) - Wed Oct 13, 1999 - Changed listappend(this.data to listappend(root.data on line 5"; 31"Profane (#30788) - Wed Feb 14, 2001 - disconnected players get poison saved for them when they come back on.";
instant_effect
Referenced by
- #1760:effect line 15:
this:instant_effect
Source
1":instant_effect(OBJ doll, OBJ source, INT quality, LIST body areas) => What happens when the poison first takes effect."; 2return 0;
delayed_effect
Referenced by
none
Source
1":delayed_effect(OBJ doll, OBJ source, INT quality, LIST body areas) => What happens when they've been poisoned for a while."; 2"This will get called within 5 minutes of the poisoning. If it wants to continue the effects, it should call :schedule again, presumably with decreased quality (unless the poison is permanent :>)."; 3return 0;
announce_poisoning
Referenced by
- #1760:effect line 14:
this:announce_poisoning
Source
1":announce_poisoning(OBJ doll, OBJ source, INT quality, LIST body areas) => Hi, we'd like you to know that you've been poisoned."; 2"If the poison was from a weapon, tell the player, mention what part of them feels queasy, etc, etc."; 3return 0;
damage
Referenced by
none
Source
1":damage(OBJ doll, OBJ amount, [STR type]) => doll takes damage from poison. Like :receive_damage, but no critical hits and no armour or other wackiness. Damage _is_ modified for size."; 2"We _may_ want to check some dollish hook, so there is some sort of protection possible against poisons. At least monsters will be covered in their :receive_damage_poison, though. I'll stick the hook in as soon as I figure out what it should be."; 3"The optional type arg should probably be \"inj\", \"ins\", or \"fat\", though it _could_ be something wacky like pot ;). Not sure if there's a point to this, because ins and fat don't affect shock rolls anymore, but what the heck."; 4(rpg = $local.rpg):secure(); 5{doll, amount, ?type = "inj"} = args; 6who = doll.character; 7amount = amount / doll.size; 8if (amount < 1) 9 ret_val = 0; 10 msgname = "cure_msg"; 11else 12 resolve = rpg:resolve(who, "shock", -amount); 13 "We do the resolve _first_, to give shock a chance to improve."; 14 doll:mod_att(type, amount, 0); 15 end = doll.end; 16 "You can announce your own messages from the ret_val = value if you feel like it."; 17 if (((killer = doll:read_misc_note(this.poisoner)) != E_PROPNF) && (resolve < (-(4 * end)))) 18 ret_val = -9; 19 msgname = "death_msg"; 20 elseif (resolve < (-end)) 21 ret_val = -3; 22 msgname = "stun_msg"; 23 else 24 ret_val = -2; 25 msgname = "damage_msg"; 26 endif 27endif 28if (msg = this:(msgname)(who)) 29 if ((type == "inj") && (ret_val != 0)) 30 rpg:tell_damage(who, msg); 31 else 32 rpg:playertell(who, msg); 33 endif 34endif 35if (msg = this:("o" + msgname)(who)) 36 rpg:rpg_announce_all_but(who.location, {who}, msg); 37endif 38if (ret_val == -9) 39 doll:die(killer, this); 40endif 41return ret_val; 42"Profane (#30788) - Tue Jan 2, 2001 - Move messaging inside this verb to avoid forking off the :die, which was dumb code.";
make_fertile
Referenced by
none
Source
1":make_fertile() -- Temporarily toggles the 'f' bit, allowing GMs (and not builders in general) to create a child of adventure gear. To be used as follows:"; 2";;#equipment:make_fertile();return player:_create(#equipment)"; 3"Where '#equipment' is the number of the object you're wanting to create. The blank object returned will be your child. Congratulations, Mommy."; 4if ($local.rpg:trusted(caller_perms())) 5 if (!this.f) 6 this.f = 1; 7 fork (0) 8 this.f = 0; 9 endfork 10 endif 11 return this.f; 12endif 13"Quinn 09-JUL-93 0343: Changed :trust call to :trusted(caller_perms()); Updated comment lines; eliminated check for ownership in first 'if'. Let it crash if a kid not owned by GM uses the parent; Now returns status of f-bit.";
cancel
Referenced by
none
Source
1":cancel(LIST element in this.data) => remove poisoning task from the queue"; 2$local.rpg:secure(); 3{elem} = args; 4root = $code_utils:verb_loc(); 5if (elem in root.data) 6 root.data = setremove(root.data, elem); 7endif 8return length(root.data);
death_effect
Referenced by
none
Source
1{victim, attacker} = args; 2if (caller.character != victim) 3 return 0; 4endif 5(rpg = $local.rpg):secure(); 6for item in (rpg.poison.data) 7 if (item[2] == caller) 8 rpg.poison.data = setremove(rpg.poison.data, item); 9 endif 10endfor 11this:remove(caller); 12return 0;
schedule(old)
Referenced by
none
Source
1":schedule(OBJ doll, OBJ source, INT quality, LIST body areas) => Schedule an even with the root poison task."; 2"We're not using doll.schedule, well, because it's icky."; 3{doll, source, qual, areas} = args; 4$local.rpg:secure(); 5root = $code_utils:verb_loc(); 6root.data = listappend(this.data, {this, doll, source, qual, areas}); 7if (!$code_utils:task_valid(root.task)) 8 fork t (0) 9 n = length(root.data); 10 while (root.data) 11 current = root.data[1]; 12 fork (0) 13 current[1]:delayed_effect(@current[2..$]); 14 endfork 15 root.data = root.data[2..$]; 16 n = n - 1; 17 suspend(random(20) + 5); 18 if (n < 1) 19 suspend(200 + random(100)); 20 n = length(root.data); 21 endif 22 endwhile 23 endfork 24 root.task = t; 25endif
death_msg stun_msg damage_msg odeath_msg ostun_msg odamage_msg cure_msg ocure_msg
Referenced by
none
Source
1msg = this.(verb); 2return msg ? $string_utils:pronoun_sub(msg, @args) | "";
damage(old)
Referenced by
none
Source
1":damage(OBJ doll, OBJ amount, [STR type]) => doll takes damage from poison. Like :receive_damage, but no critical hits and no armour or other wackiness. Damage _is_ modified for size."; 2"We _may_ want to check some dollish hook, so there is some sort of protection possible against poisons. At least monsters will be covered in their :receive_damage_poison, though. I'll stick the hook in as soon as I figure out what it should be."; 3"The optional type arg should probably be \"inj\", \"ins\", or \"fat\", though it _could_ be something wacky like pot ;). Not sure if there's a point to this, because ins and fat don't affect shock rolls anymore, but what the heck."; 4(rpg = $local.rpg):secure(); 5{doll, amount, ?type = "inj"} = args; 6amount = amount / doll.size; 7if (amount < 1) 8 return 0; 9endif 10resolve = rpg:resolve(doll.character, "shock", -amount); 11"We do the resolve _first_, to give shock a chance to improve."; 12doll:mod_att(type, amount, 0); 13end = doll.end; 14"You can announce your own messages from the return value if you feel like it."; 15if (((killer = doll:read_misc_note(this.poisoner)) != E_PROPNF) && (resolve < (-(4 * end)))) 16 fork (0) 17 doll:die(killer, this); 18 endfork 19 return -9; 20elseif (resolve < (-end)) 21 return -3; 22else 23 return -2; 24endif