generic medical kit #120
Aliases: generic medical kit, medical kit, medkit
4 verbs · 30 properties · 0 children
Verbs
| Verb | Spec | Flags | Definer | Lines |
|---|---|---|---|---|
use heal | any any any | rd | #120 | 16 |
do_heal | this none this | rxd | #120 | 48 |
look_self | this none this | rxd | #120 | 15 |
value | this none this | rxd | #120 | 1 |
Properties
| Property | Definer | Flags | Owner | Value |
|---|---|---|---|---|
figure_out_msg | #120 | rc | #36 | {"You study it long enough to figure out the basic procedures.", "USAGE: heal <person> with <this>", " use <this> on <person>"} |
effect | #120 | r | #36 | 1.0 |
in_use | #120 | r | #36 | 0 |
help_msg | #120 | rc | #36 | "You can probably figure it out if you look at it carefully." |
returning | #108 | rc | #36 | <clear> |
how_long | #108 | rc | #36 | <clear> |
been_told | #108 | rc | #36 | <clear> |
home | #108 | rc | #36 | <clear> |
child_limit | #108 | rc | #36 | <clear> |
recycle_at_death | #108 | rc | #36 | <clear> |
drop_failed_msg | #5 | rc | #36 | <clear> |
drop_succeeded_msg | #5 | rc | #36 | <clear> |
odrop_failed_msg | #5 | rc | #36 | <clear> |
odrop_succeeded_msg | #5 | rc | #36 | <clear> |
otake_succeeded_msg | #5 | rc | #36 | <clear> |
otake_failed_msg | #5 | rc | #36 | <clear> |
take_succeeded_msg | #5 | rc | #36 | <clear> |
take_failed_msg | #5 | rc | #36 | <clear> |
value_base | #102 | r | #2 | <clear> |
damage_base | #102 | r | #2 | <clear> |
x_loc | #102 | r | #36 | <clear> |
y_loc | #102 | r | #36 | <clear> |
ansi_title | #102 | r | #36 | <clear> |
obvious | #102 | r | #36 | <clear> |
build_help | #102 | rc | #36 | <clear> |
key | #1 | c | #36 | 0 |
aliases | #1 | rc | #36 | {"generic medical kit", "medical kit", "medkit"} |
description | #1 | rc | #36 | "This can be a first-aid kit, a bag of herbs, or whatever you want it to be." |
object_size | #1 | r | #36 | {5003, -1090650497} |
html | #1 | rc | #36 | <clear> |
Ancestry
Ancestors (nearest first): #108 generic replicating & returning thing → #5 generic thing → #102 subthing → #1 Root Class
Children: none
Call graph
Source
use heal
Referenced by
none
Source
1if (player.owner != player) 2return player:notify("Guests can't use that object."); 3elseif ((!dobjstr) || (!iobjstr)) 4player:tell("USAGE: heal <person> with ", this:title()); 5return player:tell(" use ", this:title(), " on <person>"); 6endif 7person = (dobj == this) ? iobjstr | dobjstr; 8medical = "medical" in player.skills[1]; 9med_skill = player.skills[2][medical]; 10if (med_skill < 0.1) 11return player:tell("You have no idea how to use ", this:title(), "."); 12endif 13result = player:my_match_object(person); 14if (!$rp_regulator:person_match_failed(result, person)) 15this:do_heal(result); 16endif
do_heal
Referenced by
- #120:use line 15:
this:do_heal
Source
1"USAGE: do_heal(person)"; 2person = args[1]; 3dobj = person; 4iobj = this; 5if (this.in_use) 6return player:tell(this:titlec(), " is currently in use."); 7elseif (`player.stats_current[2][3] < 6.0 ! E_PROPNF => 1') 8return player:tell("You don't understand how to use it."); 9elseif (!`person.alive ! E_PROPNF => 0') 10return player:tell(person:titlec(), " cannot be healed."); 11elseif (person.stats_current[2][4] >= person.stats[2][4]) 12return player:tell(person:titlec(), " does not need healing."); 13elseif (valid(player.last_healed)) 14return player:tell("Not enough time has passed since your last attempted healing of ", player.last_healed:title(), "."); 15endif 16this.in_use = 1; 17fork (2) 18this.in_use = 0; 19endfork 20attempt = player:roll_against("medical", this.effect); 21diff = person.stats[2][4] - person.stats_current[2][4]; 22points = (diff * player:medical()) / 18.0; 23points = (points > diff) ? diff | points; 24if (attempt == 2) 25$you:say_action2(player, person, "%N %<heals> %d, with excellent results!"); 26points = ((2.0 * points) > diff) ? diff | (2.0 * points); 27person:take_health(points); 28free = (points < 1.0) ? 1.0 | points; 29player.free_points = player.free_points + (sqrt(free) / (player:medical() + 36.0)); 30elseif (attempt == 1) 31$you:say_action2(player, person, "%N %<heals> %d using %i."); 32person:take_health(points); 33else 34$you:say_action2(player, person, "%N %<attempts> to heal %d, but %<does/do>n't get very good results from %i."); 35points = points / 2.0; 36endif 37medical = "medical" in player.skills[1]; 38points = (points < 1.0) ? 1.0 | points; 39if (player:medical() > 0.0) 40medmod = (player.skills[2][medical] < 1.0) ? 1.0 | player.skills[2][medical]; 41player.skills[2][medical] = player.skills[2][medical] + (sqrt(points) / ((player:medical() * player:medical()) * medmod)); 42endif 43player.last_healed = person; 44delay = ((pause = 90 - toint(player:medical() * 2.0)) > 10) ? pause | 10; 45fork (delay) 46player:tell("You're ready to heal again."); 47player.last_healed = $nothing; 48endfork
look_self
Referenced by
none
Source
1pass(@args); 2try 3medical = "medical" in player.skills[1]; 4med_skill = player.skills[2][medical]; 5if (med_skill < 0.1) 6suspend(2); 7if (player.stats_current[2][3] < 6.0) 8return player:tell("You're too dumb to figure out how to use it."); 9endif 10player.skills[2][medical] = 0.1; 11player:tell_lines(this.figure_out_msg); 12endif 13except v (ANY) 14"probably a guest"; 15endtry
value
Referenced by
none
Source
1return (50.0 * this.effect) - 10.0;