Inexor
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Namespaces | Macros | Functions | Variables
weapon.cpp File Reference
#include <ctype.h>
#include <math.h>
#include <string.h>
#include <algorithm>
#include "inexor/engine/decal.hpp"
#include "inexor/engine/dynlight.hpp"
#include "inexor/engine/lightmap.hpp"
#include "inexor/engine/particles.hpp"
#include "inexor/engine/rendergl.hpp"
#include "inexor/engine/renderparticles.hpp"
#include "inexor/fpsgame/ai.hpp"
#include "inexor/fpsgame/client.hpp"
#include "inexor/fpsgame/fps.hpp"
#include "inexor/fpsgame/fpsent.hpp"
#include "inexor/fpsgame/guns.hpp"
#include "inexor/fpsgame/movable.hpp"
#include "inexor/fpsgame/player.hpp"
#include "inexor/fpsgame/projectile.hpp"
#include "inexor/fpsgame/weapon.hpp"
#include "inexor/gamemode/gamemode.hpp"
#include "inexor/model/model.hpp"
#include "inexor/network/SharedVar.hpp"
#include "inexor/network/legacy/cube_network.hpp"
#include "inexor/network/legacy/game_types.hpp"
#include "inexor/physics/physics.hpp"
#include "inexor/shared/command.hpp"
#include "inexor/shared/cube_formatting.hpp"
#include "inexor/shared/cube_loops.hpp"
#include "inexor/shared/cube_types.hpp"
#include "inexor/shared/cube_vector.hpp"
#include "inexor/shared/ents.hpp"
#include "inexor/shared/geom.hpp"
#include "inexor/shared/tools.hpp"
#include "inexor/sound/sound.hpp"
#include "inexor/util/legacy_time.hpp"

Classes

struct  game::hitmsg
 

Namespaces

 game
 implementation of basic game functionsand cubescript bindings
 

Macros

#define bbarr_type   8
 
#define bbarr_dir   3
 
#define bbarr_num   1
 
#define bbarr_fade   2000
 
#define bbarr_size   1.2f
 
#define bbarr_gravity   0
 
#define bbarr_overlap   4.0f
 
#define bbarr_height   5.0f
 
#define bbarr_color   0X2E7187
 
#define bbarr_tremblepeak   7
 

Functions

 game::VARP (maxdebris, 10, 25, 1000)
 
 game::VARP (maxbarreldebris, 5, 10, 1000)
 
 game::ICOMMAND (getweapon,"",(), intret(player1->gunselect))
 
void game::gunselect (int gun, fpsent *d)
 
void game::nextweapon (int dir, bool force=false)
 
 game::ICOMMAND (nextweapon,"ii",(int *dir, int *force), nextweapon(*dir,*force!=0))
 
int game::getweapon (const char *name)
 
void game::setweapon (const char *name, bool force=false)
 
 game::ICOMMAND (setweapon,"si",(char *name, int *force), setweapon(name,*force!=0))
 
void game::cycleweapon (int numguns, int *guns, bool force=false)
 
 game::ICOMMAND (cycleweapon,"V",(tagval *args, int numargs),{int numguns=min(numargs, 8);int guns[8];loopi(numguns) guns[i]=getweapon(args[i].getstr());cycleweapon(numguns, guns);})
 
void game::weaponswitch (fpsent *d)
 
 game::ICOMMAND (weapon,"V",(tagval *args, int numargs),{if(player1->state!=CS_ALIVE) return;loopi(8){const char *name=i< numargs?args[i].getstr():"";if(name[0]){int gun=getweapon(name);if(gun >=GUN_FIST &&gun<=GUN_BOMB &&gun!=player1->gunselect &&player1->ammo[gun]){gunselect(gun, player1);return;}}else{weaponswitch(player1);return;}}playsound(S_NOAMMO);})
 
void game::offsetray (const vec &from, const vec &to, int spread, float range, vec &dest)
 
void game::createrays (int gun, const vec &from, const vec &to)
 
vec game::hudgunorigin (int gun, const vec &from, const vec &to, fpsent *d)
 
void game::newbouncer (const vec &from, const vec &to, bool local, int id, fpsent *owner, int type, int lifetime, int speed, entitylight *light=nullptr, int generation=0)
 
void game::bounced (physent *d, const vec &surface)
 
void game::spawnnextsplinter (const vec &p, const vec &vel, fpsent *d, int generation)
 
void game::spawnsplinters (const vec &p, fpsent *d)
 
void game::updatebouncers (int time)
 
void game::removebouncers (fpsent *owner)
 
void game::clearbouncers ()
 
void game::clearprojectiles ()
 
void game::newprojectile (const vec &from, const vec &to, float speed, bool local, int id, fpsent *owner, int gun)
 
void game::removeprojectiles (fpsent *owner)
 
 game::VARP (blood, 0, 1, 1)
 
void game::damageeffect (int damage, fpsent *d, bool thirdperson)
 
void game::spawnbouncer (const vec &p, const vec &vel, fpsent *d, int type, entitylight *light=nullptr)
 
void game::gibeffect (int damage, const vec &vel, fpsent *d)
 
void game::hit (int damage, dynent *d, fpsent *at, const vec &vel, int gun, float info1, int info2=1)
 
void game::hitpush (int damage, dynent *d, fpsent *at, vec &from, vec &to, int gun, int rays)
 
float game::projdist (dynent *o, vec &dir, const vec &v)
 
void game::radialeffect (dynent *o, const vec &v, int qdam, fpsent *at, int gun)
 
void game::radialbombeffect (bouncer *b, const vec &v)
 
void game::explode (bool local, fpsent *owner, const vec &v, dynent *safe, int damage, int gun)
 
void game::projsplash (projectile &p, vec &v, dynent *safe, int damage)
 
void game::explodeeffects (int gun, fpsent *d, bool local, int id)
 
bool game::projdamage (dynent *o, projectile &p, vec &v, int qdam)
 
void game::updateprojectiles (int time)
 
 game::VARP (muzzleflash, 0, 1, 1)
 
 game::VARP (muzzlelight, 0, 1, 1)
 
void game::shoteffects (int gun, const vec &from, const vec &to, fpsent *d, bool local, int id, int prevaction)
 
void game::particletrack (physent *owner, vec &o, vec &d)
 
void game::dynlighttrack (physent *owner, vec &o, vec &hud)
 
bool game::intersect (dynent *d, const vec &from, const vec &to, float &dist)
 
dynentgame::intersectclosest (const vec &from, const vec &to, fpsent *at, float &bestdist)
 
void game::shorten (vec &from, vec &target, float dist)
 
void game::raydamage (vec &from, vec &to, fpsent *d)
 
void game::shoot (fpsent *d, const vec &targ)
 
void game::adddynlights ()
 
void game::preloadbouncers ()
 
 game::VARP (bombcolliderad, 0, 16, 1000)
 
 game::VARP (bombbarrier, 0, 1, 1)
 
void game::renderbouncers ()
 
void game::renderprojectiles ()
 
void game::checkattacksound (fpsent *d, bool local)
 
void game::checkidlesound (fpsent *d, bool local)
 
void game::removeweapons (fpsent *d)
 
void game::updateweapons (int curtime)
 
bool game::weaponcollide (physent *d, const vec &dir)
 
void game::avoidweapons (ai::avoidset &obstacles, float radius)
 

Variables

static const int game::MONSTERDAMAGEFACTOR = 4
 
static const int game::OFFSETMILLIS = 500
 
vec game::rays [MAXRAYS]
 
vector< hitmsg > game::hits
 
SharedVar< int > game::chainsawhudgun
 
float game::intersectdist = 1e16f
 
static const char *const game::projnames [3] = { "projectile/grenade", "projectile/rocket", "projectile/bomb" }
 
static const char *const game::gibnames [3] = { "particle/gibs/gib01", "particle/gibs/gib02", "particle/gibs/gib03" }
 
static const char *const game::debrisnames [4] = { "particle/debris/debris01", "particle/debris/debris02", "particle/debris/debris03", "particle/debris/debris04" }
 

Class Documentation

struct game::hitmsg
Class Members
ivec dir
int info1
int info2
int lifesequence
int target

Macro Definition Documentation

#define bbarr_color   0X2E7187

Referenced by game::renderbouncers().

#define bbarr_dir   3

Referenced by game::renderbouncers().

#define bbarr_fade   2000

Referenced by game::renderbouncers().

#define bbarr_gravity   0

Referenced by game::renderbouncers().

#define bbarr_height   5.0f

Referenced by game::renderbouncers().

#define bbarr_num   1

Referenced by game::renderbouncers().

#define bbarr_overlap   4.0f

Referenced by game::renderbouncers().

#define bbarr_size   1.2f

Referenced by game::renderbouncers().

#define bbarr_tremblepeak   7

Referenced by game::renderbouncers().

#define bbarr_type   8

Referenced by game::renderbouncers().