version 1.54 | | version 1.55 |
---|
| | |
/* | | /* |
* static char *rcsid_time_c = | | * static char *rcsid_time_c = |
* "$Id: time.c,v 1.54 2003/03/20 07:21:05 mwedel Exp $"; | | * "$Id: time.c,v 1.55 2003/06/26 11:27:43 gros Exp $"; |
*/ | | */ |
| | |
/* | | /* |
| | |
| | |
static void stop_arrow (object *op) | | static void stop_arrow (object *op) |
{ | | { |
| | event *evt; |
/* GROS: Handle for plugin stop event */ | | /* GROS: Handle for plugin stop event */ |
if(op->event_hook[EVENT_STOP] != NULL) | | if ((evt = find_event(op, EVENT_STOP)) != NULL) |
{ | | { |
CFParm CFP; | | CFParm CFP; |
int k, l, m; | | int k, l, m; |
| | |
CFP.Value[6] = &m; | | CFP.Value[6] = &m; |
CFP.Value[7] = &m; | | CFP.Value[7] = &m; |
CFP.Value[8] = &l; | | CFP.Value[8] = &l; |
CFP.Value[9] = op->event_hook[k]; | | CFP.Value[9] = evt->hook; |
CFP.Value[10]= op->event_options[k]; | | CFP.Value[10]= evt->options; |
if (findPlugin(op->event_plugin[k])>=0) | | if (findPlugin(evt->plugin)>=0) |
((PlugList[findPlugin(op->event_plugin[k])].eventfunc) (&CFP)); | | ((PlugList[findPlugin(evt->plugin)].eventfunc) (&CFP)); |
} | | } |
if (op->inv) { | | if (op->inv) { |
object *payload = op->inv; | | object *payload = op->inv; |
| | |
| | |
void move_teleporter(object *op) { | | void move_teleporter(object *op) { |
object *tmp, *head=op; | | object *tmp, *head=op; |
| | event *evt; |
/* if this is a multipart teleporter, handle the other parts | | /* if this is a multipart teleporter, handle the other parts |
* The check for speed isn't strictly needed - basically, if | | * The check for speed isn't strictly needed - basically, if |
* there is an old multipart teleporter in which the other parts | | * there is an old multipart teleporter in which the other parts |
| | |
if(op->above->type==PLAYER) | | if(op->above->type==PLAYER) |
{ | | { |
/* GROS: Handle for plugin TRIGGER event */ | | /* GROS: Handle for plugin TRIGGER event */ |
if(op->event_hook[EVENT_TRIGGER] != NULL) | | if ((evt = find_event(op, EVENT_TRIGGER)) != NULL) |
{ | | { |
CFParm CFP; | | CFParm CFP; |
CFParm* CFR; | | CFParm* CFR; |
| | |
CFP.Value[6] = &m; | | CFP.Value[6] = &m; |
CFP.Value[7] = &m; | | CFP.Value[7] = &m; |
CFP.Value[8] = &l; | | CFP.Value[8] = &l; |
CFP.Value[9] = op->event_hook[k]; | | CFP.Value[9] = evt->hook; |
CFP.Value[10]= op->event_options[k]; | | CFP.Value[10]= evt->options; |
if (findPlugin(op->event_plugin[k])>=0) | | if (findPlugin(evt->plugin)>=0) |
{ | | { |
CFR = (PlugList[findPlugin(op->event_plugin[k])].eventfunc) (&CFP); | | CFR = (PlugList[findPlugin(evt->plugin)].eventfunc) (&CFP); |
rtn_script = *(int *)(CFR->Value[0]); | | rtn_script = *(int *)(CFR->Value[0]); |
} | | } |
if (rtn_script!=0) return; | | if (rtn_script!=0) return; |
| | |
return; | | return; |
} | | } |
/* GROS: Handle for plugin TRIGGER event */ | | /* GROS: Handle for plugin TRIGGER event */ |
if(op->event_hook[EVENT_TRIGGER] != NULL) | | if ((evt = find_event(op, EVENT_TRIGGER)) != NULL) |
{ | | { |
CFParm CFP; | | CFParm CFP; |
CFParm* CFR; | | CFParm* CFR; |
| | |
CFP.Value[6] = &m; | | CFP.Value[6] = &m; |
CFP.Value[7] = &m; | | CFP.Value[7] = &m; |
CFP.Value[8] = &l; | | CFP.Value[8] = &l; |
CFP.Value[9] = op->event_hook[k]; | | CFP.Value[9] = evt->hook; |
CFP.Value[10]= op->event_options[k]; | | CFP.Value[10]= evt->options; |
if (findPlugin(op->event_plugin[k])>=0) | | if (findPlugin(evt->plugin)>=0) |
{ | | { |
CFR = (PlugList[findPlugin(op->event_plugin[k])].eventfunc) (&CFP); | | CFR = (PlugList[findPlugin(evt->plugin)].eventfunc) (&CFP); |
rtn_script = *(int *)(CFR->Value[0]); | | rtn_script = *(int *)(CFR->Value[0]); |
} | | } |
if (rtn_script!=0) return; | | if (rtn_script!=0) return; |
| | |
{ | | { |
/* Random teleporter */ | | /* Random teleporter */ |
/* GROS: Handle for plugin TRIGGER event */ | | /* GROS: Handle for plugin TRIGGER event */ |
if(op->event_hook[EVENT_TRIGGER] != NULL) | | if ((evt = find_event(op, EVENT_TRIGGER)) != NULL) |
{ | | { |
CFParm CFP; | | CFParm CFP; |
CFParm* CFR; | | CFParm* CFR; |
| | |
CFP.Value[6] = &m; | | CFP.Value[6] = &m; |
CFP.Value[7] = &m; | | CFP.Value[7] = &m; |
CFP.Value[8] = &l; | | CFP.Value[8] = &l; |
CFP.Value[9] = op->event_hook[k]; | | CFP.Value[9] = evt->hook; |
CFP.Value[10]= op->event_options[k]; | | CFP.Value[10]= evt->options; |
if (findPlugin(op->event_plugin[k])>=0) | | if (findPlugin(evt->plugin)>=0) |
{ | | { |
CFR = (PlugList[findPlugin(op->event_plugin[k])].eventfunc) (&CFP); | | CFR = (PlugList[findPlugin(evt->plugin)].eventfunc) (&CFP); |
rtn_script = *(int *)(CFR->Value[0]); | | rtn_script = *(int *)(CFR->Value[0]); |
} | | } |
if (rtn_script!=0) return; | | if (rtn_script!=0) return; |
| | |
void move_player_changer(object *op) { | | void move_player_changer(object *op) { |
object *player; | | object *player; |
object *walk; | | object *walk; |
| | event *evt; |
char c; | | char c; |
if(op->above!=NULL) { | | if(op->above!=NULL) { |
if(EXIT_PATH(op)) { | | if(EXIT_PATH(op)) { |
if(op->above->type==PLAYER) { | | if(op->above->type==PLAYER) { |
/* GROS: Handle for plugin TRIGGER event */ | | /* GROS: Handle for plugin TRIGGER event */ |
if(op->event_hook[EVENT_TRIGGER] != NULL) | | if ((evt = find_event(op, EVENT_TRIGGER)) != NULL) |
{ | | { |
CFParm CFP; | | CFParm CFP; |
CFParm* CFR; | | CFParm* CFR; |
| | |
CFP.Value[6] = &m; | | CFP.Value[6] = &m; |
CFP.Value[7] = &m; | | CFP.Value[7] = &m; |
CFP.Value[8] = &l; | | CFP.Value[8] = &l; |
CFP.Value[9] = op->event_hook[k]; | | CFP.Value[9] = evt->hook; |
CFP.Value[10]= op->event_options[k]; | | CFP.Value[10]= evt->options; |
if (findPlugin(op->event_plugin[k])>=0) | | if (findPlugin(evt->plugin)>=0) |
{ | | { |
CFR = (PlugList[findPlugin(op->event_plugin[k])].eventfunc) (&CFP); | | CFR = (PlugList[findPlugin(evt->plugin)].eventfunc) (&CFP); |
rtn_script = *(int *)(CFR->Value[0]); | | rtn_script = *(int *)(CFR->Value[0]); |
} | | } |
if (rtn_script!=0) return; | | if (rtn_script!=0) return; |
| | |
| | |
int process_object(object *op) { | | int process_object(object *op) { |
| | |
| | event *evt; |
| | |
if(QUERY_FLAG(op, FLAG_MONSTER)) | | if(QUERY_FLAG(op, FLAG_MONSTER)) |
if(move_monster(op) || QUERY_FLAG(op, FLAG_FREED)) | | if(move_monster(op) || QUERY_FLAG(op, FLAG_FREED)) |
return 1; | | return 1; |
| | |
return 1; | | return 1; |
} | | } |
/* GROS: Handle for plugin time event */ | | /* GROS: Handle for plugin time event */ |
if(op->event_hook[EVENT_TIME] != NULL) | | if ((evt = find_event(op, EVENT_TIME)) != NULL) |
{ | | { |
CFParm CFP; | | CFParm CFP; |
int k, l, m; | | int k, l, m; |
| | |
CFP.Value[6] = &m; | | CFP.Value[6] = &m; |
CFP.Value[7] = &m; | | CFP.Value[7] = &m; |
CFP.Value[8] = &l; | | CFP.Value[8] = &l; |
CFP.Value[9] = op->event_hook[k]; | | CFP.Value[9] = evt->hook; |
CFP.Value[10]= op->event_options[k]; | | CFP.Value[10]= evt->options; |
if (findPlugin(op->event_plugin[k])>=0) | | if (findPlugin(evt->plugin)>=0) |
((PlugList[findPlugin(op->event_plugin[k])].eventfunc) (&CFP)); | | ((PlugList[findPlugin(evt->plugin)].eventfunc) (&CFP)); |
} | | } |
switch(op->type) { | | switch(op->type) { |
case ROD: | | case ROD: |