50 lines
1,009 B
C++
50 lines
1,009 B
C++
// 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.
|
|
//
|
|
// 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 );
|
|
}
|
|
|