This repository has been archived by the owner on Sep 13, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
assaultrifle.cpp
151 lines (145 loc) · 3.86 KB
/
assaultrifle.cpp
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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
//-----------------------------------------------------------------------------
//
// $Logfile:: /Quake 2 Engine/Sin/code/game/assaultrifle.cpp $
// $Revision:: 33 $
// $Author:: Markd $
// $Date:: 11/15/98 9:12p $
//
// Copyright (C) 1998 by Ritual Entertainment, Inc.
// All rights reserved.
//
// This source is may not be distributed and/or modified without
// expressly written permission by Ritual Entertainment, Inc.
//
// $Log:: /Quake 2 Engine/Sin/code/game/assaultrifle.cpp $
//
// 33 11/15/98 9:12p Markd
// Put in more precaching for models and sprites
//
// 32 11/13/98 3:30p Markd
// put in more precaching on weapons
//
// 31 10/05/98 10:18p Aldie
// Covnverted over to new silencer methods
//
// 30 8/29/98 5:26p Markd
// added specialfx, replaced misc with specialfx where appropriate
//
// 29 8/19/98 6:37p Markd
// Moved Assault rifle tracer into def file
//
// 28 8/06/98 10:53p Aldie
// Added weapon tweaks and kickback. Also modified blast radius damage and
// rocket jumping.
//
// 27 8/04/98 11:57a Aldie
// Increased spread
//
// 26 8/01/98 3:24p Aldie
// Added server effects flag for specific weapons
//
// 25 8/01/98 3:03p Aldie
// Client side muzzle flash (dynamic light)
//
// 24 7/26/98 4:06p Aldie
//
// 23 7/26/98 3:59p Aldie
// Less muzzleflashes
//
// 22 7/22/98 10:40p Aldie
// Fixed tracers
//
// 21 7/22/98 9:57p Markd
// Defined weapon type
//
// 20 7/21/98 1:10p Aldie
// Added meansofdeath to obituaries
//
// 19 7/12/98 5:48p Jimdose
// changed timing on tracers to once every 5 frames
//
// 18 7/12/98 5:37p Jimdose
// Recoded the tracer fire based on framenum. Frametime was being used as if
// it had millisecond precision.
//
// 17 6/19/98 9:29p Jimdose
// Moved gun orientation code to Weapon
//
// 16 6/18/98 3:56p Aldie
// Made a tracer for the assaultrifle.
//
// 15 6/15/98 9:08p Aldie
// Added SilencedBullet class for silencers
//
// 14 6/10/98 2:10p Aldie
// Updated damage function.
//
// 13 6/08/98 7:21p Aldie
// Updated attack time
//
// 12 4/20/98 1:56p Markd
// SINED decelration is now in def file
//
// 11 4/18/98 3:08p Markd
// Changed view weapon naming convention
//
// 10 4/09/98 3:29p Jimdose
// Removed sound from shoot since anim plays it
//
// 9 4/07/98 6:42p Jimdose
// Rewrote weapon code.
// Added order to rank
//
// 8 4/05/98 2:58a Jimdose
// changed attack time (again)
//
// 7 4/04/98 6:01p Jimdose
// Changed attack time
//
// 6 4/02/98 4:20p Jimdose
// Tweaked for DM
//
// 5 3/30/98 9:54p Jimdose
// Changed location of .def files
//
// 4 3/30/98 2:34p Jimdose
// Moved firing to BulletWeapon to make more general
// Added Ammo
// Added world models
//
// 3 3/27/98 11:04p Jimdose
// added muzzle flash
//
// 2 3/27/98 6:34p Jimdose
// created file
//
// DESCRIPTION:
// Assault rifle
//
#include "g_local.h"
#include "assaultrifle.h"
CLASS_DECLARATION( BulletWeapon, AssaultRifle, "weapon_assaultrifle" );
ResponseDef AssaultRifle::Responses[] =
{
{ &EV_Weapon_Shoot, ( Response )AssaultRifle::Shoot },
{ NULL, NULL }
};
AssaultRifle::AssaultRifle()
{
SetModels( "asrifle.def", "view_asrifle.def" );
SetAmmo( "Bullet10mm", 1, 30 );
SetRank( 40, 40 );
SetType( WEAPON_2HANDED_LO );
modelIndex( "10mm.def" );
modelIndex( "sprites/gunblast.spr" );
modelIndex( "shell.def" );
silenced = true;
}
void AssaultRifle::Shoot
(
Event *ev
)
{
FireBullets( 1, "120 120 120", 8, 14, DAMAGE_BULLET, MOD_ASSRIFLE, false );
NextAttack( 0 );
}