From 633f6d646e2af2e075c64037de2a6b8eac834406 Mon Sep 17 00:00:00 2001 From: Steve Date: Sat, 28 Nov 2015 14:33:40 +0000 Subject: [PATCH] Set tow rope attach distance to same as separation distance. Fire script when attached. --- src/battle/rope.c | 4 +++- src/battle/rope.h | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/battle/rope.c b/src/battle/rope.c index 1fd33be..7cfed29 100644 --- a/src/battle/rope.c +++ b/src/battle/rope.c @@ -35,7 +35,7 @@ void attachRope(void) { distance = getDistance(e->x, e->y, self->x, self->y); - if (distance > 0 && distance <= 64) + if (distance > 0 && distance <= self->separationRadius) { self->towing = e; e->owner = self; @@ -44,6 +44,8 @@ void attachRope(void) e->flags |= EF_RETREATING; + runScriptFunction("TOWING %s", e->name); + if (self == player) { battle.stats[STAT_NUM_TOWED]++; diff --git a/src/battle/rope.h b/src/battle/rope.h index 6472a88..93a77dc 100644 --- a/src/battle/rope.h +++ b/src/battle/rope.h @@ -29,6 +29,7 @@ extern float getAngle(int x1, int y1, int x2, int y2); extern int getDistance(int x1, int y1, int x2, int y2); extern Entity **getAllEntsWithin(int x, int y, int w, int h, Entity *ignore); extern void addHudMessage(SDL_Color c, char *format, ...); +extern void runScriptFunction(char *format, ...); extern App app; extern Battle battle;