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