diff options
| author | Magnus Auvinen <magnus.auvinen@gmail.com> | 2008-03-22 13:03:52 +0000 |
|---|---|---|
| committer | Magnus Auvinen <magnus.auvinen@gmail.com> | 2008-03-22 13:03:52 +0000 |
| commit | 0761a483a2247dca816b2c355588360515c088ae (patch) | |
| tree | 09aaad9b87711cfdd4f7dfe3a478a43d1249610b /src/game | |
| parent | fc814009553cac9180a9009cd1bf206d809d6e73 (diff) | |
| download | zcatch-0761a483a2247dca816b2c355588360515c088ae.tar.gz zcatch-0761a483a2247dca816b2c355588360515c088ae.zip | |
made the hook length more apparent
Diffstat (limited to 'src/game')
| -rw-r--r-- | src/game/g_game.cpp | 9 | ||||
| -rw-r--r-- | src/game/g_game.h | 3 | ||||
| -rw-r--r-- | src/game/g_protocol.def | 2 |
3 files changed, 10 insertions, 4 deletions
diff --git a/src/game/g_game.cpp b/src/game/g_game.cpp index 800c41ba..747b832a 100644 --- a/src/game/g_game.cpp +++ b/src/game/g_game.cpp @@ -246,8 +246,13 @@ void player_core::tick() hook_tick = 0; triggered_events |= COREEVENT_HOOK_LAUNCH; } - else if(hook_state == HOOK_GOING_TO_RETRACT) + else if(hook_state >= HOOK_RETRACT_START && hook_state < HOOK_RETRACT_END) { + hook_state++; + } + else if(hook_state == HOOK_RETRACT_END) + { + hook_state = HOOK_RETRACTED; triggered_events |= COREEVENT_HOOK_RETRACT; hook_state = HOOK_RETRACTED; } @@ -256,7 +261,7 @@ void player_core::tick() vec2 new_pos = hook_pos+hook_dir*world->tuning.hook_fire_speed; if(distance(pos, new_pos) > world->tuning.hook_length) { - hook_state = HOOK_GOING_TO_RETRACT; + hook_state = HOOK_RETRACT_START; new_pos = pos + normalize(new_pos-pos) * world->tuning.hook_length; } diff --git a/src/game/g_game.h b/src/game/g_game.h index 3a98aac6..4c46beab 100644 --- a/src/game/g_game.h +++ b/src/game/g_game.h @@ -96,8 +96,9 @@ enum { HOOK_RETRACTED=-1, HOOK_IDLE=0, + HOOK_RETRACT_START=1, + HOOK_RETRACT_END=3, HOOK_FLYING, - HOOK_GOING_TO_RETRACT, HOOK_GRABBED, COREEVENT_GROUND_JUMP=0x01, diff --git a/src/game/g_protocol.def b/src/game/g_protocol.def index 6f3a3b14..363795f2 100644 --- a/src/game/g_protocol.def +++ b/src/game/g_protocol.def @@ -114,7 +114,7 @@ object player_core range(0, 3) jumped range(-1,MAX_CLIENTS-1) hooked_player - range(-1,3) hook_state + range(-1,5) hook_state range(0, max_int) hook_tick any hook_x |