54 lines
1.2 KiB
C++
54 lines
1.2 KiB
C++
// 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.
|
|
//
|
|
// DESCRIPTION:
|
|
// Shotgun
|
|
//
|
|
|
|
#include "g_local.h"
|
|
#include "bullet.h"
|
|
#include "shotgun.h"
|
|
|
|
|
|
CLASS_DECLARATION( BulletWeapon, Shotgun, "weapon_shotgun" );
|
|
|
|
ResponseDef Shotgun::Responses[] =
|
|
{
|
|
{ &EV_Weapon_Shoot, ( Response )Shotgun::Shoot },
|
|
{ NULL, NULL }
|
|
};
|
|
|
|
Shotgun::Shotgun()
|
|
{
|
|
SetModels( "shotgun.def", "view_shotgun.def" );
|
|
SetAmmo( "ShotgunClip", 1, 10 );
|
|
SetRank( 30, 30 );
|
|
SetType( WEAPON_2HANDED_HI );
|
|
modelIndex( "shotgunclip.def" );
|
|
}
|
|
|
|
void Shotgun::Shoot
|
|
(
|
|
Event *ev
|
|
)
|
|
|
|
{
|
|
// Non clients use a toned down version of the shotgun
|
|
if ( owner->isClient() )
|
|
FireBullets( 10, "375 375 375", 8, 16, DAMAGE_BULLET, MOD_SHOTGUN, false );
|
|
else
|
|
FireBullets( 5, "100 100 100", 5, 10, DAMAGE_BULLET, MOD_SHOTGUN, false );
|
|
|
|
NextAttack( 0.95f );
|
|
}
|
|
|
|
//###
|
|
void Shotgun::SecondaryUse (Event *ev)
|
|
{
|
|
// switch to the plasma bow
|
|
owner->useWeapon("PlasmaBow");
|
|
}
|
|
//###
|