UFO: Alien Invasion
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
g_combat.h
Go to the documentation of this file.
1 
6 /*
7 Copyright (C) 2002-2020 UFO: Alien Invasion.
8 
9 This program is free software; you can redistribute it and/or
10 modify it under the terms of the GNU General Public License
11 as published by the Free Software Foundation; either version 2
12 of the License, or (at your option) any later version.
13 
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
17 
18 See the GNU General Public License for more details.
19 
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23 
24 */
25 
26 #pragma once
27 
28 #include "g_local.h"
29 
31 typedef struct shot_mock_s {
32  int enemyCount;
34  int civilian;
35  int self;
36  int damage;
37  bool allow_self;
38 
39  inline shot_mock_s () {
40  OBJZERO(*this);
41  }
42 } shot_mock_t;
43 
44 int G_ApplyProtection(const Edict* target, const byte dmgWeight, int damage);
45 void G_CheckDeathOrKnockout(Actor* target, Actor* attacker, const fireDef_t* fd, int damage);
46 bool G_ClientShoot(const Player& player, Actor* actor, const pos3_t at, shoot_types_t shootType, fireDefIndex_t firemode, shot_mock_t* mock, bool allowReaction, int z_align);
47 void G_CalcEffectiveSpread(const Actor* ent, const fireDef_t* fd, vec2_t effSpread);
bool G_ClientShoot(const Player &player, Actor *actor, const pos3_t at, shoot_types_t shootType, fireDefIndex_t firemode, shot_mock_t *mock, bool allowReaction, int z_align)
Setup for shooting, either real or mock.
Definition: g_combat.cpp:1183
this is a fire definition for our weapons/ammo
Definition: inv_shared.h:110
int civilian
Definition: g_combat.h:34
struct shot_mock_s shot_mock_t
used in shot probability calculations (pseudo shots)
int enemyCount
Definition: g_combat.h:32
used in shot probability calculations (pseudo shots)
Definition: g_combat.h:31
int damage
Definition: g_combat.h:36
int friendCount
Definition: g_combat.h:33
#define OBJZERO(obj)
Definition: shared.h:178
int32_t shoot_types_t
Available shoot types - also see the ST_ constants.
Definition: q_shared.h:206
int32_t fireDefIndex_t
Definition: inv_shared.h:78
An Edict of type Actor.
Definition: g_edict.h:348
shot_mock_s()
Definition: g_combat.h:39
pos_t pos3_t[3]
Definition: ufotypes.h:58
Local definitions for game module.
bool allow_self
Definition: g_combat.h:37
void G_CalcEffectiveSpread(const Actor *ent, const fireDef_t *fd, vec2_t effSpread)
Calculate the effective spread for the given actor and firemode.
Definition: g_combat.cpp:671
vec_t vec2_t[2]
Definition: ufotypes.h:38
void G_CheckDeathOrKnockout(Actor *target, Actor *attacker, const fireDef_t *fd, int damage)
Definition: g_combat.cpp:499
Definition: g_edict.h:45
uint8_t byte
Definition: ufotypes.h:34
int G_ApplyProtection(const Edict *target, const byte dmgWeight, int damage)
Reduces damage by armour and natural protection.
Definition: g_combat.cpp:362