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

Comparing deliantra/server/server/player.C (file contents):
Revision 1.38 by root, Thu Dec 14 04:30:32 2006 UTC vs.
Revision 1.41 by root, Fri Dec 15 04:21:29 2006 UTC

234 op->speed_left = 0.5; 234 op->speed_left = 0.5;
235 op->speed = 1.0; 235 op->speed = 1.0;
236 op->direction = 5; /* So player faces south */ 236 op->direction = 5; /* So player faces south */
237 op->stats.wc = 2; 237 op->stats.wc = 2;
238 op->run_away = 25; /* Then we panick... */ 238 op->run_away = 25; /* Then we panick... */
239
240 {
241 int oldmon = p->socket->monitor_spells; // what a hack
239 p->socket->monitor_spells = 0; /* Needed because esrv_update_spells( ) gets called by roll_stats */ 242 p->socket->monitor_spells = 0; /* Needed because esrv_update_spells( ) gets called by roll_stats */
240
241 roll_stats (op); 243 roll_stats (op);
244 p->socket->monitor_spells = oldmon;
245 }
242 p->state = ST_ROLL_STAT; 246 p->state = ST_ROLL_STAT;
243 clear_los (op); 247 clear_los (op);
244 248
245 p->gen_sp_armour = 10; 249 p->gen_sp_armour = 10;
246 p->last_speed = -1; 250 p->last_speed = -1;
1875 SET_ANIMATION (arrow, arrow->direction); 1879 SET_ANIMATION (arrow, arrow->direction);
1876 arrow->stats.sp = arrow->stats.wc; /* save original wc and dam */ 1880 arrow->stats.sp = arrow->stats.wc; /* save original wc and dam */
1877 arrow->stats.hp = arrow->stats.dam; 1881 arrow->stats.hp = arrow->stats.dam;
1878 arrow->stats.grace = arrow->attacktype; 1882 arrow->stats.grace = arrow->attacktype;
1879 if (arrow->slaying != NULL) 1883 if (arrow->slaying != NULL)
1880 arrow->spellarg = strdup_local (arrow->slaying); 1884 arrow->spellarg = strdup (arrow->slaying);
1881 1885
1882 /* Note that this was different for monsters - they got their level 1886 /* Note that this was different for monsters - they got their level
1883 * added to the damage. I think the strength bonus is more proper. 1887 * added to the damage. I think the strength bonus is more proper.
1884 */ 1888 */
1885 1889
2560 if (op->speed_left > 0) 2564 if (op->speed_left > 0)
2561 return 1; 2565 return 1;
2562 else 2566 else
2563 return 0; 2567 return 0;
2564 } 2568 }
2569
2565 return 0; 2570 return 0;
2566} 2571}
2567 2572
2568int 2573int
2569save_life (object *op) 2574save_life (object *op)
2570{ 2575{
2571 object *tmp;
2572
2573 if (!QUERY_FLAG (op, FLAG_LIFESAVE)) 2576 if (!QUERY_FLAG (op, FLAG_LIFESAVE))
2574 return 0; 2577 return 0;
2575 2578
2576 for (tmp = op->inv; tmp != NULL; tmp = tmp->below) 2579 for (object *tmp = op->inv; tmp; tmp = tmp->below)
2577 if (QUERY_FLAG (tmp, FLAG_APPLIED) && QUERY_FLAG (tmp, FLAG_LIFESAVE)) 2580 if (QUERY_FLAG (tmp, FLAG_APPLIED) && QUERY_FLAG (tmp, FLAG_LIFESAVE))
2578 { 2581 {
2579 play_sound_map (op->map, op->x, op->y, SOUND_OB_EVAPORATE); 2582 play_sound_map (op->map, op->x, op->y, SOUND_OB_EVAPORATE);
2580 new_draw_info_format (NDI_UNIQUE, 0, op, "Your %s vibrates violently, then evaporates.", query_name (tmp)); 2583 new_draw_info_format (NDI_UNIQUE, 0, op, "Your %s vibrates violently, then evaporates.", query_name (tmp));
2581 2584
2592 op->stats.food = 999; 2595 op->stats.food = 999;
2593 2596
2594 fix_player (op); 2597 fix_player (op);
2595 return 1; 2598 return 1;
2596 } 2599 }
2600
2597 LOG (llevError, "Error: LIFESAVE set without applied object.\n"); 2601 LOG (llevError, "Error: LIFESAVE set without applied object.\n");
2598 CLEAR_FLAG (op, FLAG_LIFESAVE); 2602 CLEAR_FLAG (op, FLAG_LIFESAVE);
2599 enter_player_savebed (op); /* bring him home. */ 2603 enter_player_savebed (op); /* bring him home. */
2600 return 0; 2604 return 0;
2601} 2605}
2624 esrv_del_item (env->contr, op->count); 2628 esrv_del_item (env->contr, op->count);
2625 insert_ob_in_map (op, env->map, NULL, 0); 2629 insert_ob_in_map (op, env->map, NULL, 0);
2626 } 2630 }
2627 else if (op->inv) 2631 else if (op->inv)
2628 remove_unpaid_objects (op->inv, env); 2632 remove_unpaid_objects (op->inv, env);
2633
2629 op = next; 2634 op = next;
2630 } 2635 }
2631} 2636}
2632 2637
2633 2638
2648 strcpy (buf2, " R.I.P.\n\n"); 2653 strcpy (buf2, " R.I.P.\n\n");
2649 if (op->type == PLAYER) 2654 if (op->type == PLAYER)
2650 sprintf (buf, "%s the %s\n", &op->name, op->contr->title); 2655 sprintf (buf, "%s the %s\n", &op->name, op->contr->title);
2651 else 2656 else
2652 sprintf (buf, "%s\n", &op->name); 2657 sprintf (buf, "%s\n", &op->name);
2658
2653 strncat (buf2, " ", 20 - strlen (buf) / 2); 2659 strncat (buf2, " ", 20 - strlen (buf) / 2);
2654 strcat (buf2, buf); 2660 strcat (buf2, buf);
2655 if (op->type == PLAYER) 2661 if (op->type == PLAYER)
2656 sprintf (buf, "who was in level %d when killed\n", op->level); 2662 sprintf (buf, "who was in level %d when killed\n", op->level);
2657 else 2663 else
2658 sprintf (buf, "who was in level %d when died.\n\n", op->level); 2664 sprintf (buf, "who was in level %d when died.\n\n", op->level);
2665
2659 strncat (buf2, " ", 20 - strlen (buf) / 2); 2666 strncat (buf2, " ", 20 - strlen (buf) / 2);
2660 strcat (buf2, buf); 2667 strcat (buf2, buf);
2661 if (op->type == PLAYER) 2668 if (op->type == PLAYER)
2662 { 2669 {
2663 sprintf (buf, "by %s.\n\n", op->contr->killer); 2670 sprintf (buf, "by %s.\n\n", op->contr->killer);
2664 strncat (buf2, " ", 21 - strlen (buf) / 2); 2671 strncat (buf2, " ", 21 - strlen (buf) / 2);
2665 strcat (buf2, buf); 2672 strcat (buf2, buf);
2666 } 2673 }
2674
2667 strftime (buf, MAX_BUF, "%b %d %Y\n", localtime (&now)); 2675 strftime (buf, MAX_BUF, "%b %d %Y\n", localtime (&now));
2668 strncat (buf2, " ", 20 - strlen (buf) / 2); 2676 strncat (buf2, " ", 20 - strlen (buf) / 2);
2669 strcat (buf2, buf); 2677 strcat (buf2, buf);
2678
2670 return buf2; 2679 return buf2;
2671} 2680}
2672 2681
2673 2682
2674 2683

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines