/*
===========================================================================
Copyright (C) 2000 - 2013, Raven Software, Inc.
Copyright (C) 2001 - 2013, Activision, Inc.
Copyright (C) 2013 - 2015, OpenJK contributors
This file is part of the OpenJK source code.
OpenJK is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License version 2 as
published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, see .
===========================================================================
*/
#ifndef __WP_SABER_H
#define __WP_SABER_H
#include "b_public.h"
#define ARMOR_EFFECT_TIME 500
#define JSF_AMBUSH 16 //ambusher Jedi
//saberEventFlags
#define SEF_HITENEMY 0x1 //Hit the enemy
#define SEF_HITOBJECT 0x2 //Hit some other object
#define SEF_HITWALL 0x4 //Hit a wall
#define SEF_PARRIED 0x8 //Parried a saber swipe
#define SEF_DEFLECTED 0x10 //Deflected a missile or saberInFlight
#define SEF_BLOCKED 0x20 //Was blocked by a parry
#define SEF_EVENTS (SEF_HITENEMY|SEF_HITOBJECT|SEF_HITWALL|SEF_PARRIED|SEF_DEFLECTED|SEF_BLOCKED)
#define SEF_LOCKED 0x40 //Sabers locked with someone else
#define SEF_INWATER 0x80 //Saber is in water
#define SEF_LOCK_WON 0x100 //Won a saberLock
//saberEntityState
#define SES_LEAVING 1
#define SES_HOVERING 2
#define SES_RETURNING 3
#define SABER_EXTRAPOLATE_DIST 16.0f
#define SABER_MAX_DIST 400.0f
#define SABER_MAX_DIST_SQUARED (SABER_MAX_DIST*SABER_MAX_DIST)
#define FORCE_POWER_MAX 100
#define SABER_REFLECT_MISSILE_CONE 0.2f
#define SABER_RADIUS_STANDARD 3.0f
#define SABER_LOCK_TIME 10000
#define SABER_LOCK_DELAYED_TIME 9500
typedef enum
{
LOCK_VICTORY = 0,//one side won
LOCK_STALEMATE,//neither side won
LOCK_DRAW//both people fall back
} saberLockResult_t;
typedef enum
{
LOCK_FIRST = 0,
LOCK_TOP = LOCK_FIRST,
LOCK_DIAG_TR,
LOCK_DIAG_TL,
LOCK_DIAG_BR,
LOCK_DIAG_BL,
LOCK_R,
LOCK_L,
LOCK_RANDOM,
LOCK_KYLE_GRAB1,
LOCK_KYLE_GRAB2,
LOCK_KYLE_GRAB3,
LOCK_FORCE_DRAIN
} sabersLockMode_t;
enum
{
SABERLOCK_TOP,
SABERLOCK_SIDE,
SABERLOCK_LOCK,
SABERLOCK_BREAK,
SABERLOCK_SUPERBREAK,
SABERLOCK_WIN,
SABERLOCK_LOSE
};
enum
{
DIR_RIGHT,
DIR_LEFT,
DIR_FRONT,
DIR_BACK
};
#define FORCE_LIGHTSIDE 1
#define FORCE_DARKSIDE 2
#define MAX_FORCE_HEAL_HARD 25
#define MAX_FORCE_HEAL_MEDIUM 50
#define MAX_FORCE_HEAL_EASY 75
#define FORCE_HEAL_INTERVAL 200//FIXME: maybe level 1 is slower or level 2 is faster?
#define FORCE_GRIP_3_MIN_DIST 128.0f
#define FORCE_GRIP_3_MAX_DIST 256.0f
#define FORCE_GRIP_DIST 512.0f//FIXME: vary by power level?
#define FORCE_GRIP_DIST_SQUARED (FORCE_GRIP_DIST*FORCE_GRIP_DIST)
#define FORCE_DRAIN_DIST 64.0f//FIXME: vary by power level?
#define FORCE_DRAIN_DIST_SQUARED (FORCE_DRAIN_DIST*FORCE_DRAIN_DIST)
#define MAX_DRAIN_DISTANCE 512
#define MIN_SABERBLADE_DRAW_LENGTH 0.5f
#define STAFF_KICK_RANGE 16
#define JUMP_OFF_WALL_SPEED 200.0f
#define FORCE_LONG_LEAP_SPEED 475.0f//300
//#define DUAL_SPIN_PROTECT_POWER 50 //power required to do the dual spin attack
//#define SINGLE_SPECIAL_POWER 20 //power required to do the single saber special attacks
#define SABER_ALT_ATTACK_POWER 50//75?
#define SABER_ALT_ATTACK_POWER_LR 10//30?
#define SABER_ALT_ATTACK_POWER_FB 25//30/50?
#define FORCE_LONGJUMP_POWER 20
#define WALL_RUN_UP_BACKFLIP_SPEED -150.0f//was -300.0f
#define MAX_WALL_RUN_Z_NORMAL 0.4f//was 0.0f
#define PLAYER_KNOCKDOWN_HOLD_EXTRA_TIME 4000 //player stays down after a knockdown for 4 whole seconds before automatically doing one of the slow get-ups
#define MAX_WALL_GRAB_SLOPE 0.2f
//"Matrix" effect flags
#define MEF_NO_TIMESCALE 0x000001 //no timescale
#define MEF_NO_VERTBOB 0x000002 //no vert bob
#define MEF_NO_SPIN 0x000004 //no spin
#define MEF_NO_RANGEVAR 0x000008 //no camera range variation
#define MEF_HIT_GROUND_STOP 0x000010 //stop effect when subject hits the ground
#define MEF_REVERSE_SPIN 0x000020 //spin counter-clockwise instead of clockwise
#define MEF_MULTI_SPIN 0x000040 //spin once every second, until the effect stops
#define MEF_LOOK_AT_ENEMY 0x000200
#define SABER_PITCH_HACK 90
extern float forceJumpStrength[];
extern float forceJumpHeight[];
extern float forceJumpHeightMax[];
extern float forcePushPullRadius[];
extern void ForceSpeed( gentity_t *self, int duration = 0 );
extern float forceSpeedValue[];
extern float forceSpeedRangeMod[];
extern float forceSpeedFOVMod[];
extern const char *saberColorStringForColor[];
#define FORCE_SPEED_DURATION 10000.0f
#define FORCE_RAGE_DURATION 10000.0f
#define MASK_FORCE_PUSH (MASK_OPAQUE|CONTENTS_SOLID)
enum
{
FORCE_LEVEL_0,
FORCE_LEVEL_1,
FORCE_LEVEL_2,
FORCE_LEVEL_3,
NUM_FORCE_POWER_LEVELS
};
#define FORCE_LEVEL_4 (FORCE_LEVEL_3+1)
#define FORCE_LEVEL_5 (FORCE_LEVEL_4+1)
enum
{
FJ_FORWARD,
FJ_BACKWARD,
FJ_RIGHT,
FJ_LEFT,
FJ_UP
};
#define FORCE_JUMP_CHARGE_TIME 1000.0f //Force jump reaches maximum power in one second
#define FORCE_POWERS_ROSH_FROM_TWINS ((1<