1 | /* |
1 | /* |
2 | * static char *rcsid_swamp_c = |
2 | * static char *rcsid_swamp_c = |
3 | * "$Id: swamp.C,v 1.2 2006/08/29 08:01:38 root Exp $"; |
3 | * "$Id: swamp.C,v 1.3 2006/09/03 00:18:42 root Exp $"; |
4 | */ |
4 | */ |
5 | |
5 | |
6 | /* |
6 | /* |
7 | CrossFire, A Multiplayer game for X-windows |
7 | CrossFire, A Multiplayer game for X-windows |
8 | |
8 | |
… | |
… | |
36 | */ |
36 | */ |
37 | |
37 | |
38 | void walk_on_deep_swamp (object *op, object *victim) |
38 | void walk_on_deep_swamp (object *op, object *victim) |
39 | { |
39 | { |
40 | if (victim->type == PLAYER && victim->stats.hp >= 0 && !(victim->move_type & MOVE_FLYING)) { |
40 | if (victim->type == PLAYER && victim->stats.hp >= 0 && !(victim->move_type & MOVE_FLYING)) { |
41 | new_draw_info_format(NDI_UNIQUE, 0, victim, "You are down to your knees in the %s.", op->name); |
41 | new_draw_info_format(NDI_UNIQUE, 0, victim, "You are down to your knees in the %s.", &op->name); |
42 | op->stats.food = 1; |
42 | op->stats.food = 1; |
43 | victim->speed_left -= op->move_slow_penalty; |
43 | victim->speed_left -= op->move_slow_penalty; |
44 | } |
44 | } |
45 | } |
45 | } |
46 | |
46 | |
… | |
… | |
60 | |
60 | |
61 | switch(op->stats.food) { |
61 | switch(op->stats.food) { |
62 | case 1: |
62 | case 1: |
63 | if (rndm(0, 2) == 0) { |
63 | if (rndm(0, 2) == 0) { |
64 | new_draw_info_format(NDI_UNIQUE, 0,above, |
64 | new_draw_info_format(NDI_UNIQUE, 0,above, |
65 | "You are down to your waist in the wet %s.", op->name); |
65 | "You are down to your waist in the wet %s.", &op->name); |
66 | op->stats.food = 2; |
66 | op->stats.food = 2; |
67 | above->speed_left -= op->move_slow_penalty; |
67 | above->speed_left -= op->move_slow_penalty; |
68 | } |
68 | } |
69 | break; |
69 | break; |
70 | |
70 | |
71 | case 2: |
71 | case 2: |
72 | if (rndm(0, 2) == 0) { |
72 | if (rndm(0, 2) == 0) { |
73 | new_draw_info_format(NDI_UNIQUE | NDI_RED, 0,above, |
73 | new_draw_info_format(NDI_UNIQUE | NDI_RED, 0,above, |
74 | "You are down to your NECK in the dangerous %s.", op->name); |
74 | "You are down to your NECK in the dangerous %s.", &op->name); |
75 | op->stats.food = 3; |
75 | op->stats.food = 3; |
76 | sprintf(above->contr->killer,"drowning in a %s", op->name); |
76 | sprintf(above->contr->killer,"drowning in a %s", &op->name); |
77 | above->stats.hp--; |
77 | above->stats.hp--; |
78 | above->speed_left -= op->move_slow_penalty; |
78 | above->speed_left -= op->move_slow_penalty; |
79 | } |
79 | } |
80 | break; |
80 | break; |
81 | |
81 | |
… | |
… | |
85 | |
85 | |
86 | /* player is ready to drown - only woodsman skill can save him */ |
86 | /* player is ready to drown - only woodsman skill can save him */ |
87 | if (!woodsman) { |
87 | if (!woodsman) { |
88 | op->stats.food = 0; |
88 | op->stats.food = 0; |
89 | new_draw_info_format(NDI_UNIQUE | NDI_ALL, 1, NULL, |
89 | new_draw_info_format(NDI_UNIQUE | NDI_ALL, 1, NULL, |
90 | "%s disappeared into a %s.",above->name, op->name); |
90 | "%s disappeared into a %s.", &above->name, &op->name); |
91 | sprintf(above->contr->killer,"drowning in a %s", op->name); |
91 | sprintf(above->contr->killer,"drowning in a %s", &op->name); |
92 | |
92 | |
93 | above->stats.hp = -1; |
93 | above->stats.hp = -1; |
94 | kill_player(above); /* player dies in the swamp */ |
94 | kill_player(above); /* player dies in the swamp */ |
95 | } |
95 | } |
96 | else { |
96 | else { |
97 | op->stats.food = 2; |
97 | op->stats.food = 2; |
98 | new_draw_info_format(NDI_UNIQUE, 0,above, |
98 | new_draw_info_format(NDI_UNIQUE, 0,above, |
99 | "You almost drowned in the %s! You survived due to your woodsman skill.", op->name); |
99 | "You almost drowned in the %s! You survived due to your woodsman skill.", &op->name); |
100 | } |
100 | } |
101 | } |
101 | } |
102 | break; |
102 | break; |
103 | } |
103 | } |
104 | } else if (!QUERY_FLAG(above, FLAG_ALIVE) && !(above->move_type & MOVE_FLYING) && |
104 | } else if (!QUERY_FLAG(above, FLAG_ALIVE) && !(above->move_type & MOVE_FLYING) && |