ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/server/time.C
(Generate patch)

Comparing deliantra/server/server/time.C (file contents):
Revision 1.95 by root, Mon Oct 26 11:31:39 2009 UTC vs.
Revision 1.98 by root, Fri Nov 6 13:03:34 2009 UTC

90 } 90 }
91 91
92 op->drop_and_destroy (); 92 op->drop_and_destroy ();
93} 93}
94 94
95void 95static void
96generate_monster (object *gen) 96generate_monster (object *gen)
97{ 97{
98 if (!gen->map) 98 if (!gen->map)
99 return; 99 return;
100 100
158 } 158 }
159 159
160 op->destroy (); 160 op->destroy ();
161} 161}
162 162
163void 163static void
164remove_force (object *op) 164remove_force (object *op)
165{ 165{
166 if (--op->duration > 0) 166 if (--op->duration > 0)
167 return; 167 return;
168 168
180 } 180 }
181 181
182 op->destroy (); 182 op->destroy ();
183} 183}
184 184
185void 185static void
186remove_blindness (object *op) 186remove_blindness (object *op)
187{ 187{
188 if (--op->stats.food > 0) 188 if (--op->stats.food > 0)
189 return; 189 return;
190 190
197 } 197 }
198 198
199 op->destroy (); 199 op->destroy ();
200} 200}
201 201
202void 202static void
203poison_more (object *op) 203poison_more (object *op)
204{ 204{
205 if (op->env == NULL || !QUERY_FLAG (op->env, FLAG_ALIVE) || op->env->stats.hp < 0) 205 if (op->env == NULL || !QUERY_FLAG (op->env, FLAG_ALIVE) || op->env->stats.hp < 0)
206 { 206 {
207 op->destroy (); 207 op->destroy ();
232 232
233 hit_player (op->env, op->stats.dam, op, AT_INTERNAL, 1); 233 hit_player (op->env, op->stats.dam, op, AT_INTERNAL, 1);
234} 234}
235 235
236 236
237void 237static void
238move_gate (object *op) 238move_gate (object *op)
239{ /* 1 = going down, 0 = going up */ 239{ /* 1 = going down, 0 = going up */
240 object *tmp; 240 object *tmp;
241 241
242 if (op->stats.wc < 0 || (int) op->stats.wc >= NUM_ANIMATIONS (op)) 242 if (op->stats.wc < 0 || (int) op->stats.wc >= NUM_ANIMATIONS (op))
376 376
377/* hp : how long door is open/closed 377/* hp : how long door is open/closed
378 * maxhp : initial value for hp 378 * maxhp : initial value for hp
379 * sp : 1 = open, 0 = close 379 * sp : 1 = open, 0 = close
380 */ 380 */
381void 381static void
382move_timed_gate (object *op) 382move_timed_gate (object *op)
383{ 383{
384 int v = op->value; 384 int v = op->value;
385 385
386 if (op->stats.sp) 386 if (op->stats.sp)
405 * speed: frequency of 'glances' 405 * speed: frequency of 'glances'
406 * connected: connected value of detector 406 * connected: connected value of detector
407 * sp: 1 if detection sets buttons 407 * sp: 1 if detection sets buttons
408 * -1 if detection unsets buttons 408 * -1 if detection unsets buttons
409 */ 409 */
410 410static void
411void
412move_detector (object *op) 411move_detector (object *op)
413{ 412{
414 object *tmp; 413 object *tmp;
415 int last = op->value; 414 int last = op->value;
416 int detected; 415 int detected;
483 SET_ANIMATION (op, op->stats.wc); 482 SET_ANIMATION (op, op->stats.wc);
484 update_object (op, UP_OBJ_FACE); 483 update_object (op, UP_OBJ_FACE);
485 } 484 }
486} 485}
487 486
488void 487static void
489move_hole (object *op) 488move_hole (object *op)
490{ /* 1 = opening, 0 = closing */ 489{ /* 1 = opening, 0 = closing */
491 if (op->value) 490 if (op->value)
492 { /* We're opening */ 491 { /* We're opening */
493 if (--op->stats.wc <= 0) 492 if (--op->stats.wc <= 0)
825 824
826 /* Move the arrow. */ 825 /* Move the arrow. */
827 op->move_to (pos); 826 op->move_to (pos);
828} 827}
829 828
830void 829static void
831change_object (object *op) 830change_object (object *op)
832{ /* Doesn`t handle linked objs yet */ 831{ /* Doesn`t handle linked objs yet */
833 int i, j; 832 int i, j;
834 833
835 if (!op->other_arch) 834 if (!op->other_arch)
942/* This object will teleport someone to a different map 941/* This object will teleport someone to a different map
943 and will also apply changes to the player from its inventory. 942 and will also apply changes to the player from its inventory.
944 This was invented for giving classes, but there's no reason it 943 This was invented for giving classes, but there's no reason it
945 can't be generalized. 944 can't be generalized.
946*/ 945*/
947void 946static void
948move_player_changer (object *op) 947move_player_changer (object *op)
949{ 948{
950 object *player; 949 object *player;
951 object *walk; 950 object *walk;
952 951
1018 * moves them in the op->stats.sp direction. speed is how often it'll move. 1017 * moves them in the op->stats.sp direction. speed is how often it'll move.
1019 * If attacktype is nonzero it will paralyze the player. If lifesave is set, 1018 * If attacktype is nonzero it will paralyze the player. If lifesave is set,
1020 * it'll dissapear after hp+1 moves. If hp is set and attacktype is set, 1019 * it'll dissapear after hp+1 moves. If hp is set and attacktype is set,
1021 * it'll paralyze the victim for hp*his speed/op->speed 1020 * it'll paralyze the victim for hp*his speed/op->speed
1022 */ 1021 */
1023void 1022static void
1024move_player_mover (object *op) 1023move_player_mover (object *op)
1025{ 1024{
1026 int dir = op->stats.sp; 1025 int dir = op->stats.sp;
1027 sint16 nx, ny; 1026 sint16 nx, ny;
1028 maptile *m; 1027 maptile *m;
1072 /* only level >=1 movers move people */ 1071 /* only level >=1 movers move people */
1073 if (op->level) 1072 if (op->level)
1074 { 1073 {
1075 /* Following is a bit of hack. We need to make sure it 1074 /* Following is a bit of hack. We need to make sure it
1076 * is cleared, otherwise the player will get stuck in 1075 * is cleared, otherwise the player will get stuck in
1077 * place. This can happen if the player used a spell to 1076 * place. This can happen if the player used a spell to
1078 * get to this space. 1077 * get to this space.
1079 */ 1078 */
1080 victim->contr->fire_on = 0; 1079 victim->contr->fire_on = 0;
1081 victim->speed_left = 1.f; 1080 victim->speed_left = 1.f;
1082 move_player (victim, dir); 1081 move_player (victim, dir);
1254 } 1253 }
1255} 1254}
1256 1255
1257// mapscript objects activate themselves (only) then their timer fires 1256// mapscript objects activate themselves (only) then their timer fires
1258// TODO: maybe they should simply trigger the link like any other object? 1257// TODO: maybe they should simply trigger the link like any other object?
1259void 1258static void
1260move_mapscript (object *op) 1259move_mapscript (object *op)
1261{ 1260{
1262 op->set_speed (0); 1261 op->set_speed (0);
1263 cfperl_mapscript_activate (op, true, op, 0); 1262 cfperl_mapscript_activate (op, true, op, 0);
1264} 1263}
1265 1264
1265static void
1266void move_lamp (object *op) 1266move_lamp (object *op)
1267{ 1267{
1268 // if the lamp/torch is off, we should disable it. 1268 // if the lamp/torch is off, we should disable it.
1269 if (!op->glow_radius) 1269 if (!op->glow_radius)
1270 { 1270 {
1271 op->set_speed (0); 1271 op->set_speed (0);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines