-
-
Notifications
You must be signed in to change notification settings - Fork 550
Expand file tree
/
Copy pathCWeaponStatManagerSA.h
More file actions
104 lines (86 loc) · 4.48 KB
/
CWeaponStatManagerSA.h
File metadata and controls
104 lines (86 loc) · 4.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
/*****************************************************************************
*
* PROJECT: Multi Theft Auto v1.0
* (Shared logic for modifications)
* LICENSE: See LICENSE in the top level directory
* FILE: game_sa/CWeaponStatManagerSA.h
* PURPOSE: header file for the custom weapon stats manager.
*
*****************************************************************************/
#pragma once
#include <list>
#include <game/CWeaponStatManager.h>
#include "CWeaponStatSA.h"
// Straight out of CGameSA.h
#define CLASSSIZE_WeaponInfo 112 // ##SA##
#define NUM_WeaponInfosStdSkill WEAPONTYPE_LAST_WEAPONTYPE
#define NUM_WeaponInfosOtherSkill 11
#define NUM_WeaponInfosTotal (NUM_WeaponInfosStdSkill + (3 * NUM_WeaponInfosOtherSkill)) // std, (poor, pro, special)
#define WEAPON_STAT_MAX 112
struct sWeaponInfo
{
eFireType fire_type; // type - instant hit (e.g. pistol), projectile (e.g. rocket launcher), area effect (e.g. flame thrower)
float target_range; // max targeting range
float weapon_range; // absolute gun range / default melee attack range
int model; // modelinfo id
int model2; // second modelinfo id
eWeaponSlot weapon_slot;
int flags; // flags defining characteristics
// instead of storing pointers directly to anims, use anim association groups
// NOTE: this is used for stealth kill anims for melee weapons
DWORD anim_group;
//////////////////////////////////
// Gun Data
/////////////////////////////////
short maximum_clip_ammo; // ammo in one clip
short damage; // damage inflicted per hit
CVector fire_offset; // offset from weapon origin to projectile starting point
// skill settings
eWeaponSkill skill_level; // what's the skill level of this weapontype
int required_skill_level; // what stat level is required for this skill level
float accuracy; // modify accuracy of weapon
float move_speed; // how fast can move with weapon
// anim timings
float anim_loop_start; // start of animation loop
float anim_loop_stop; // end of animation loop
float anim_loop_bullet_fire; // time in animation when weapon should be fired
float anim2_loop_start; // start of animation2 loop
float anim2_loop_stop; // end of animation2 loop
float anim2_loop_bullet_fire; // time in animation2 when weapon should be fired
float anim_breakout_time; // time after which player can break out of attack and run off
// projectile/area effect specific info
float firing_speed; // speed of projectile
float radius; // radius affected
float life_span; // time taken for shot to dissipate
float spread; // angle inside which shots are created
short aim_offset; // index into array of aiming offsets
//////////////////////////////////
// Melee Data
/////////////////////////////////
BYTE default_combo; // base combo for this melee weapon
BYTE combos_available; // how many further combos are available
};
class CWeaponStatManagerSA : public CWeaponStatManager
{
public:
CWeaponStatManagerSA();
~CWeaponStatManagerSA();
CWeaponStat* GetWeaponStats(eWeaponType type, eWeaponSkill skill = WEAPONSKILL_STD);
CWeaponStat* GetWeaponStatsFromSkillLevel(eWeaponType type, float fSkillLevel);
CWeaponStat* GetOriginalWeaponStats(eWeaponType type, eWeaponSkill skill = WEAPONSKILL_STD);
void Init();
void InitLists();
void ResetLists();
bool LoadDefault(CWeaponStat* pDest, eWeaponType weaponType, eWeaponSkill skill = WEAPONSKILL_STD);
void CreateWeaponStat(CWeaponInfo* pInterface, eWeaponType weaponType, eWeaponSkill weaponSkill);
CWeaponStat* CreateWeaponStatUnlisted(eWeaponType weaponType, eWeaponSkill weaponSkill);
eWeaponSkill GetWeaponSkillFromSkillLevel(eWeaponType type, float fSkillLevel);
private:
bool LoadDefaultInternal(CWeaponStatSA* pDest, eWeaponType weaponType, eWeaponSkill skill = WEAPONSKILL_STD);
std::list<CWeaponStat*> m_OriginalWeaponData;
std::list<CWeaponStat*> m_WeaponData;
static sWeaponInfo OriginalPoorWeaponData[WEAPONTYPE_MAX + 1];
static sWeaponInfo OriginalNormalWeaponData[WEAPONTYPE_MAX + 1];
static sWeaponInfo OriginalHitmanWeaponData[WEAPONTYPE_MAX + 1];
static sWeaponInfo OriginalSpecialWeaponData[WEAPONTYPE_MAX + 1];
};