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
/
genericrocket.cpp
65 lines (55 loc) · 1.6 KB
/
genericrocket.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
//-----------------------------------------------------------------------------
//
// $Logfile:: /Quake 2 Engine/Sin/code/game/genericrocket.cpp $
// $Revision:: 3 $
// $Author:: Markd $
// $Date:: 10/04/98 10:23p $
//
// Copyright (C) 1998 by Ritual Entertainment, Inc.
// All rights reserved.
//
// This source may not be distributed and/or modified without
// expressly written permission by Ritual Entertainment, Inc.
//
// $Log:: /Quake 2 Engine/Sin/code/game/genericrocket.cpp $
//
// 3 10/04/98 10:23p Markd
// Took out NextAttack stuff
//
// 2 9/15/98 6:46p Aldie
// Generic rocket for pinphat
//
// DESCRIPTION:
// Generic Rocket Launcher - to be used on monsters that have rocket launchers
// shown in their models
#include "g_local.h"
#include "genericrocket.h"
#include "rocketlauncher.h"
CLASS_DECLARATION( RocketLauncher, GenericRocket, "weapon_genericrocket" );
ResponseDef GenericRocket::Responses[] =
{
{ &EV_Weapon_Shoot, ( Response )GenericRocket::Shoot },
{ NULL, NULL }
};
GenericRocket::GenericRocket()
{
SetModels( NULL, "view_genrocket.def" );
SetAmmo( "Rockets", 1, 5 );
}
void GenericRocket::Shoot
(
Event *ev
)
{
Rocket *rocket;
Vector pos;
Vector dir;
assert( owner );
if ( !owner )
{
return;
}
GetMuzzlePosition( &pos, &dir );
rocket = new Rocket;
rocket->Setup( owner, pos, dir );
}