1 | /* |
1 | /* |
2 | * static char *rcsid_player_c = |
2 | * static char *rcsid_player_c = |
3 | * "$Id: player.C,v 1.2 2006/08/15 16:19:55 elmex Exp $"; |
3 | * "$Id: player.C,v 1.3 2006/08/25 13:24:50 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 | |
… | |
… | |
974 | |
974 | |
975 | /* this must before then initial items are given */ |
975 | /* this must before then initial items are given */ |
976 | esrv_new_player(op->contr, op->weight+op->carrying); |
976 | esrv_new_player(op->contr, op->weight+op->carrying); |
977 | create_treasure(find_treasurelist("starting_wealth"),op, 0, 0, 0); |
977 | create_treasure(find_treasurelist("starting_wealth"),op, 0, 0, 0); |
978 | |
978 | |
979 | /* Lauwenmark : Here we handle the BORN global event */ |
979 | INVOKE_PLAYER (BIRTH, op->contr); |
980 | execute_global_event(EVENT_BORN, op); |
980 | INVOKE_PLAYER (LOGIN, op->contr); |
981 | |
981 | |
982 | /* Lauwenmark : We then generate a LOGIN event */ |
|
|
983 | execute_global_event(EVENT_LOGIN, op->contr, op->contr->socket.host); |
|
|
984 | op->contr->state=ST_PLAYING; |
982 | op->contr->state=ST_PLAYING; |
985 | |
983 | |
986 | if (op->msg) { |
984 | if (op->msg) { |
987 | free_string(op->msg); |
985 | free_string(op->msg); |
988 | op->msg=NULL; |
986 | op->msg=NULL; |
… | |
… | |
1075 | op->contr->state=ST_PLAYING; |
1073 | op->contr->state=ST_PLAYING; |
1076 | new_draw_info(NDI_UNIQUE, 0,op,"OK, continuing to play."); |
1074 | new_draw_info(NDI_UNIQUE, 0,op,"OK, continuing to play."); |
1077 | return 1; |
1075 | return 1; |
1078 | } |
1076 | } |
1079 | |
1077 | |
1080 | /* Lauwenmark : Here we handle the REMOVE global event */ |
1078 | INVOKE_PLAYER (LOGOUT, op->contr); |
1081 | execute_global_event(EVENT_REMOVE, op); |
1079 | INVOKE_PLAYER (QUIT , op->contr); |
|
|
1080 | |
1082 | terminate_all_pets(op); |
1081 | terminate_all_pets(op); |
1083 | leave_map(op); |
1082 | leave_map(op); |
1084 | op->direction=0; |
1083 | op->direction=0; |
1085 | new_draw_info_format(NDI_UNIQUE | NDI_ALL, 5, NULL, |
1084 | new_draw_info_format(NDI_UNIQUE | NDI_ALL, 5, NULL, |
1086 | "%s quits the game.",op->name); |
1085 | "%s quits the game.",op->name); |
… | |
… | |
2675 | |
2674 | |
2676 | /* Lauwenmark: Handle for plugin death event */ |
2675 | /* Lauwenmark: Handle for plugin death event */ |
2677 | if (execute_event(op, EVENT_DEATH,NULL,NULL,NULL,SCRIPT_FIX_ALL) != 0) |
2676 | if (execute_event(op, EVENT_DEATH,NULL,NULL,NULL,SCRIPT_FIX_ALL) != 0) |
2678 | return; |
2677 | return; |
2679 | |
2678 | |
|
|
2679 | INVOKE_PLAYER (DEATH, op->contr); |
|
|
2680 | |
2680 | command_kill_pets (op, 0); |
2681 | command_kill_pets (op, 0); |
2681 | |
2682 | |
2682 | /* Lauwenmark: Handle for the global death event */ |
|
|
2683 | execute_global_event(EVENT_PLAYER_DEATH, op); |
|
|
2684 | if(op->stats.food<0) { |
2683 | if(op->stats.food<0) { |
2685 | if (op->contr->explore) { |
2684 | if (op->contr->explore) { |
2686 | new_draw_info(NDI_UNIQUE, 0,op,"You would have starved, but you are"); |
2685 | new_draw_info(NDI_UNIQUE, 0,op,"You would have starved, but you are"); |
2687 | new_draw_info(NDI_UNIQUE, 0,op,"in explore mode, so..."); |
2686 | new_draw_info(NDI_UNIQUE, 0,op,"in explore mode, so..."); |
2688 | op->stats.food=999; |
2687 | op->stats.food=999; |