version 1.2 | | version 1.3 |
---|
| | |
| | |
CFPContext* context_stack; | | CFPContext* context_stack; |
CFPContext* current_context; | | CFPContext* current_context; |
static int current_command = -999; | | |
CFanimation *first_animation=NULL; | | CFanimation *first_animation=NULL; |
| | |
int get_dir_from_name (char*name) | | int get_dir_from_name (char*name) |
| | |
int runghosted(struct CFanimation_struct* animation, long int id, void* parameters) | | int runghosted(struct CFanimation_struct* animation, long int id, void* parameters) |
{ | | { |
object* corpse; | | object* corpse; |
int val; | | |
if ( (id && animation->ghosted) || | | if ( (id && animation->ghosted) || |
(!id && !animation->ghosted) ) | | (!id && !animation->ghosted) ) |
runghosted(animation, !id, parameters); | | runghosted(animation, !id, parameters); |
| | |
} | | } |
int runteleport(struct CFanimation_struct* animation, long int id, void* parameters) | | int runteleport(struct CFanimation_struct* animation, long int id, void* parameters) |
{ | | { |
int val=0; | | |
teleport_params* teleport=(teleport_params*)parameters; | | teleport_params* teleport=(teleport_params*)parameters; |
if (!parameters) | | if (!parameters) |
return 0; | | return 0; |
| | |
void animate_one(CFanimation* animation, long int milliseconds) | | void animate_one(CFanimation* animation, long int milliseconds) |
{ | | { |
CFmovement* current; | | CFmovement* current; |
int val; | | |
if (animation->time_representation==time_second) | | if (animation->time_representation==time_second) |
animation->tick_left+=milliseconds; | | animation->tick_left+=milliseconds; |
else animation->tick_left++; | | else animation->tick_left++; |
if (animation->verbose) | | if (animation->verbose) |
printf("CFAnim: Ticking %s for %s. Tickleft is %d\n", | | printf("CFAnim: Ticking %s for %s. Tickleft is %ld\n", |
animation->name,animation->victim->name,animation->tick_left); | | animation->name,animation->victim->name,animation->tick_left); |
if (animation->invisible) | | if (animation->invisible) |
animation->victim->invisible=10; | | animation->victim->invisible=10; |
| | |
| | |
void pushContext(CFPContext* context) | | void pushContext(CFPContext* context) |
{ | | { |
CFPContext* stack_context; | | |
if (current_context == NULL) | | if (current_context == NULL) |
{ | | { |
context_stack = context; | | context_stack = context; |
| | |
int initPlugin(const char* iversion, f_plug_api gethooksptr) | | int initPlugin(const char* iversion, f_plug_api gethooksptr) |
{ | | { |
gethook = gethooksptr; | | gethook = gethooksptr; |
int i; | | |
printf("CFAnim 2.0a init\n"); | | printf("CFAnim 2.0a init\n"); |
| | |
/* Place your initialization code here */ | | /* Place your initialization code here */ |
| | |
{ | | { |
va_list args; | | va_list args; |
char* propname; | | char* propname; |
int i; | | |
va_start(args, type); | | va_start(args, type); |
propname = va_arg(args, char *); | | propname = va_arg(args, char *); |
printf("Property name: %s\n", propname); | | printf("Property name: %s\n", propname); |
| | |
context = malloc(sizeof(CFPContext)); | | context = malloc(sizeof(CFPContext)); |
char* buf; | | char* buf; |
player* pl; | | player* pl; |
object* op; | | |
| | |
va_start(args, type); | | va_start(args, type); |
context->event_code = va_arg(args, int); | | context->event_code = va_arg(args, int); |