-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy paththrow.txt
More file actions
121 lines (96 loc) · 3.56 KB
/
throw.txt
File metadata and controls
121 lines (96 loc) · 3.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
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
ACMD(do_throw)
{
struct char_data *vict;
struct obj_data *obj;
int percent, prob;
int damage_val;
two_arguments(argument, buf, buf2);
if (!GET_SKILL(ch, SKILL_THROW)) {
send_to_char("You don't know how!\r\n", ch);
return;
}
if (!(vict = get_char_room_vis(ch, buf2))) {
if (FIGHTING(ch)) {
vict = FIGHTING(ch);
} else {
send_to_char("Throw what at who?\r\n", ch);
return;
}
}
if (!pk_allowed && !pkill_ok(ch, vict)) {
send_to_char("You are forbidden to attack players here.\r\n", ch);
return;
}
if (!(obj = get_obj_in_list_vis(ch, buf, ch->carrying))) {
send_to_char("Throw what at who?\r\n", ch);
return;
}
if (vict == ch) {
send_to_char("That would be funny to see.\r\n", ch);
return;
}
percent = number(1, 101); /* 101% is a complete failure */
prob = GET_SKILL(ch, SKILL_THROW);
damage_val = GET_STR(ch) / 2 + GET_OBJ_WEIGHT(obj) + GET_LEVEL(ch);
if (percent > prob) {
/* miss like a mother fucker. */
damage(ch, vict, 0, SKILL_THROW);
/* victim */
act("$N throws $p at you and misses by a long shot.", FALSE, vict, obj, ch, TO_CHAR);
/* ch */
act("You throw $p at $n but, miss by a long shot.", FALSE, vict, obj, ch, TO_VICT);
/* everyone else */
act("$N throws $p at $n but, misses by a long shot.", FALSE, vict, obj, ch, TO_NOTVICT);
return;
}
else {
if (GET_OBJ_TYPE(obj) == ITEM_SCROLL || (GET_OBJ_TYPE(obj) == ITEM_NOTE)) {
/* victim */
act("$N hits you upside the head with $p and exclaims, Bad Doggie!", FALSE, vict, obj, ch, TO_CHAR);
/* ch */
act("You hit $n in the head with $p and exclaim, Bad Doggie!", FALSE, vict, obj, ch, TO_VICT);
/* everyone else */
act("$N hits $n in the head with $p and exclaims, Bad Doggie!", FALSE, vict, obj, ch, TO_NOTVICT);
extract_obj(obj);
}
else if (GET_OBJ_TYPE(obj) == ITEM_WEAPON) {
/* victim */
act("$N throws $p at you and cuts your chest.", FALSE, vict, obj, ch, TO_CHAR);
/* ch */
act("You throw $p at $n and cut $m chest.", FALSE, vict, obj, ch, TO_VICT);
/* everyone else */
act("$N throws $p at $n and cuts $m chest.", FALSE, vict, obj, ch, TO_NOTVICT);
extract_obj(obj);
}
else if (GET_OBJ_TYPE(obj) == ITEM_POTION) {
/* victim */
act("$N throws $p at you and it goes right down your throat!", FALSE, vict, obj, ch, TO_CHAR);
/* ch */
act("You throw $p at $n and it goes right down $m throat!", FALSE, vict, obj, ch, TO_VICT);
/* everyone else */
act("$N throws $p at $n and it goes right down $m throat!", FALSE, vict, obj, ch, TO_NOTVICT);
if (chance(50)) {
mag_objectmagic(vict, obj, buf);
}
else {
/* victim */
act("You gag and spit out $p.", FALSE, vict, obj, ch, TO_CHAR);
/* ch */
act("$n gags and spits out $p.", FALSE, vict, obj, ch, TO_VICT);
/* everyone else */
act("$n gags and spits out $p.", FALSE, vict, obj, ch, TO_NOTVICT);
}
}
else {
act("$N throws $p and hits you square in the chest.", FALSE, vict, obj, ch, TO_CHAR);
/* ch */
act("You throw $p at $n and hit $m in the chest.", FALSE, vict, obj, ch, TO_VICT);
/* everyone else */
act("$N throws $p at $n and hits $m in the chest.", FALSE, vict, obj, ch, TO_NOTVICT);
extract_obj(obj);
}
}
damage(ch, vict, damage_val, SKILL_THROW);
WAIT_STATE(ch, PULSE_VIOLENCE * 3);
/* all done */
}