Weapons: Go over the bullet penetration details, I think we got that mostly figured out now.
Also fix some other CS specific entities and their touch functions.
This commit is contained in:
parent
78f779a07e
commit
ea1f3067ad
28 changed files with 86 additions and 63 deletions
|
@ -104,15 +104,15 @@ class armoury_entity:CBaseEntity
|
|||
int m_iItem;
|
||||
|
||||
void(void) armoury_entity;
|
||||
virtual void(void) touch;
|
||||
virtual void(entity) Touch;
|
||||
virtual void(void) Respawn;
|
||||
virtual void(string, string) SpawnKey;
|
||||
};
|
||||
|
||||
void
|
||||
armoury_entity::touch(void)
|
||||
armoury_entity::Touch(entity eToucher)
|
||||
{
|
||||
if (other.classname != "player") {
|
||||
if (eToucher.classname != "player") {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -120,12 +120,12 @@ armoury_entity::touch(void)
|
|||
if (m_iItem == 17 || m_iItem == 16)
|
||||
return;
|
||||
|
||||
if (Weapons_AddItem((player)other, m_iItem, -1) == FALSE) {
|
||||
if (Weapons_AddItem((player)eToucher, m_iItem, -1) == FALSE) {
|
||||
return;
|
||||
}
|
||||
|
||||
Logging_Pickup(other, this, __NULL__);
|
||||
sound(other, CHAN_ITEM, "items/gunpickup2.wav", 1, ATTN_NORM);
|
||||
Logging_Pickup(eToucher, this, __NULL__);
|
||||
sound(eToucher, CHAN_ITEM, "items/gunpickup2.wav", 1, ATTN_NORM);
|
||||
|
||||
m_iLeft--;
|
||||
if (m_iLeft <= 0) {
|
||||
|
|
|
@ -32,14 +32,14 @@ class func_bomb_target:NSBrushTrigger
|
|||
void(void) func_bomb_target;
|
||||
|
||||
virtual void(void) Respawn;
|
||||
virtual void(void) touch;
|
||||
virtual void(entity) Touch;
|
||||
};
|
||||
|
||||
void
|
||||
func_bomb_target::touch(void)
|
||||
func_bomb_target::Touch(entity eToucher)
|
||||
{
|
||||
player pl = (player)other;
|
||||
if (!(other.flags & FL_CLIENT)) {
|
||||
player pl = (player)eToucher;
|
||||
if (!(eToucher.flags & FL_CLIENT)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -44,15 +44,15 @@ class func_buyzone:NSBrushTrigger
|
|||
{
|
||||
void(void) func_buyzone;
|
||||
|
||||
virtual void(void) touch;
|
||||
virtual void(entity) Touch;
|
||||
virtual void(void) Respawn;
|
||||
};
|
||||
|
||||
void
|
||||
func_buyzone::touch(void)
|
||||
func_buyzone::Touch(entity eToucher)
|
||||
{
|
||||
player pl = (player)other;
|
||||
if (!(other.flags & FL_CLIENT))
|
||||
player pl = (player)eToucher;
|
||||
if (!(eToucher.flags & FL_CLIENT))
|
||||
return;
|
||||
|
||||
if (team == 0 || team == pl.team)
|
||||
|
|
|
@ -32,30 +32,30 @@ class func_hostage_rescue:NSBrushTrigger
|
|||
{
|
||||
void(void) func_hostage_rescue;
|
||||
|
||||
virtual void(void) touch;
|
||||
virtual void(entity) Touch;
|
||||
virtual void(void) Respawn;
|
||||
};
|
||||
|
||||
void
|
||||
func_hostage_rescue::touch(void)
|
||||
func_hostage_rescue::Touch(entity eToucher)
|
||||
{
|
||||
if (other.flags & FL_CLIENT) {
|
||||
player pl = (player)other;
|
||||
if (eToucher.flags & FL_CLIENT) {
|
||||
player pl = (player)eToucher;
|
||||
pl.gflags |= GF_RESCUEZONE;
|
||||
return;
|
||||
}
|
||||
|
||||
if (other.classname != "hostage_entity") {
|
||||
if (eToucher.classname != "hostage_entity") {
|
||||
return;
|
||||
}
|
||||
|
||||
CBaseNPC hosty = (CBaseNPC)other;
|
||||
hostage_entity hosty = (hostage_entity)eToucher;
|
||||
|
||||
if (hosty.solid == SOLID_NOT) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!((player)hosty.m_eFollowing))
|
||||
if (!(hosty.m_eFollowing))
|
||||
return;
|
||||
|
||||
Radio_BroadcastMessage(RADIO_RESCUED);
|
||||
|
@ -68,8 +68,7 @@ func_hostage_rescue::touch(void)
|
|||
* bonus for every hostage that was rescued, even if they lose the round. */
|
||||
Money_QueTeamReward(TEAM_CT, 850);
|
||||
|
||||
CBaseEntity targa = (CBaseEntity)other;
|
||||
targa.Hide();
|
||||
hosty.Hide();
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -131,6 +131,9 @@ hostage_entity::OnPlayerUse(void)
|
|||
void
|
||||
hostage_entity::Pain(void)
|
||||
{
|
||||
if (style == MONSTER_DEAD)
|
||||
return;
|
||||
|
||||
switch (g_dmg_iHitBody) {
|
||||
case BODY_HEAD:
|
||||
case BODY_DEFAULT:
|
||||
|
@ -176,25 +179,24 @@ hostage_entity::Death(void)
|
|||
SetFrame(HOSA_DIE_SIMPLE + floor(random(0,4)));
|
||||
break;
|
||||
}
|
||||
|
||||
if (g_dmg_eAttacker.classname == "player") {
|
||||
if (g_dmg_iDamage >= 100)
|
||||
Money_AddMoney((base_player)g_dmg_eAttacker, -2500);
|
||||
else
|
||||
Money_AddMoney((base_player)g_dmg_eAttacker, -500);
|
||||
|
||||
Radio_BroadcastMessage(RADIO_HOSDOWN);
|
||||
}
|
||||
}
|
||||
|
||||
/* HACK: don't let them gib */
|
||||
health = 0;
|
||||
solid = SOLID_NOT;
|
||||
|
||||
/* now mark our state as 'dead' */
|
||||
CBaseNPC::Death();
|
||||
|
||||
/* penalties */
|
||||
if (g_dmg_eAttacker.classname != "player")
|
||||
return;
|
||||
|
||||
if (g_dmg_iDamage >= 100)
|
||||
Money_AddMoney((base_player)g_dmg_eAttacker, -2500);
|
||||
else
|
||||
Money_AddMoney((base_player)g_dmg_eAttacker, -500);
|
||||
|
||||
Radio_BroadcastMessage(RADIO_HOSDOWN);
|
||||
super::Death();
|
||||
SetSolid(SOLID_NOT);
|
||||
health = 0;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -18,14 +18,14 @@ class item_suit:CBaseTrigger
|
|||
{
|
||||
void(void) item_suit;
|
||||
|
||||
virtual void(void) touch;
|
||||
virtual void(entity) Touch;
|
||||
virtual void(void) Respawn;
|
||||
};
|
||||
|
||||
void
|
||||
item_suit::touch(void)
|
||||
item_suit::Touch(entity eToucher)
|
||||
{
|
||||
player pl = (player)other;
|
||||
player pl = (player)eToucher;
|
||||
|
||||
if (pl.classname != "player") {
|
||||
return;
|
||||
|
@ -35,10 +35,10 @@ item_suit::touch(void)
|
|||
return;
|
||||
}
|
||||
|
||||
sound(other, CHAN_ITEM, "items/tr_kevlar.wav", 1, ATTN_NORM);
|
||||
sound(eToucher, CHAN_ITEM, "items/tr_kevlar.wav", 1, ATTN_NORM);
|
||||
pl.g_items |= ITEM_SUIT;
|
||||
|
||||
UseTargets(other, TRIG_TOGGLE, m_flDelay);
|
||||
UseTargets(eToucher, TRIG_TOGGLE, m_flDelay);
|
||||
|
||||
if (cvar("sv_playerslots") == 1) {
|
||||
remove(self);
|
||||
|
|
|
@ -177,7 +177,8 @@ w_ak47_primary(player pl)
|
|||
View_SetMuzzleflash(MUZZLE_RIFLE);
|
||||
View_AddEvent(w_rifle_ejectshell, 0.0f);
|
||||
#else
|
||||
TraceAttack_SetPenetrationPower(1);
|
||||
TraceAttack_SetRangeModifier(0.98);
|
||||
TraceAttack_SetPenetrationPower(2);
|
||||
TraceAttack_FireBullets(1, pl.origin + pl.view_ofs, 36, [accuracy,accuracy], WEAPON_AK47);
|
||||
Sound_Play(pl, CHAN_WEAPON, "weapon_ak47.fire");
|
||||
#endif
|
||||
|
|
|
@ -143,7 +143,8 @@ w_aug_primary(player pl)
|
|||
View_SetMuzzleflash(MUZZLE_RIFLE);
|
||||
View_AddEvent(w_rifle_ejectshell, 0.0f);
|
||||
#else
|
||||
TraceAttack_SetPenetrationPower(1);
|
||||
TraceAttack_SetRangeModifier(0.96);
|
||||
TraceAttack_SetPenetrationPower(2);
|
||||
TraceAttack_FireBullets(1, pl.origin + pl.view_ofs, 32, [accuracy,accuracy], WEAPON_AUG);
|
||||
Sound_Play(pl, CHAN_WEAPON, "weapon_aug.fire");
|
||||
#endif
|
||||
|
|
|
@ -234,7 +234,8 @@ w_awp_primary(player pl)
|
|||
View_SetMuzzleflash(MUZZLE_RIFLE);
|
||||
View_AddEvent(w_sniper_ejectshell, 0.9f);
|
||||
#else
|
||||
TraceAttack_SetPenetrationPower(2);
|
||||
TraceAttack_SetRangeModifier(0.99);
|
||||
TraceAttack_SetPenetrationPower(3);
|
||||
TraceAttack_FireBullets(1, pl.origin + pl.view_ofs, 115, [accuracy,accuracy], WEAPON_AWP);
|
||||
|
||||
Sound_Play(pl, CHAN_WEAPON, "weapon_awp.fire");
|
||||
|
|
|
@ -176,7 +176,8 @@ w_deagle_primary(player pl)
|
|||
View_SetMuzzleflash(MUZZLE_RIFLE);
|
||||
View_AddEvent(w_pistol_ejectshell, 0.0f);
|
||||
#else
|
||||
TraceAttack_SetPenetrationPower(1);
|
||||
TraceAttack_SetRangeModifier(0.81);
|
||||
TraceAttack_SetPenetrationPower(2);
|
||||
TraceAttack_FireBullets(1, pl.origin + pl.view_ofs, 54, [accuracy,accuracy], WEAPON_DEAGLE);
|
||||
Sound_Play(pl, CHAN_WEAPON, "weapon_deagle.fire");
|
||||
#endif
|
||||
|
|
|
@ -248,7 +248,8 @@ w_elites_primary(player pl)
|
|||
else
|
||||
View_AddEvent(w_pistol_ejectshell_right, 0.0f);
|
||||
#else
|
||||
TraceAttack_SetPenetrationPower(0);
|
||||
TraceAttack_SetRangeModifier(0.75);
|
||||
TraceAttack_SetPenetrationPower(1);
|
||||
TraceAttack_FireBullets(1, pl.origin + pl.view_ofs, 45, [accuracy,accuracy], WEAPON_ELITES);
|
||||
Sound_Play(pl, CHAN_WEAPON, "weapon_elites.fire");
|
||||
#endif
|
||||
|
|
|
@ -147,7 +147,8 @@ w_fiveseven_primary(player pl)
|
|||
View_SetMuzzleflash(MUZZLE_RIFLE);
|
||||
View_AddEvent(w_pistol_ejectshell, 0.0f);
|
||||
#else
|
||||
TraceAttack_SetPenetrationPower(0);
|
||||
TraceAttack_SetRangeModifier(0.885);
|
||||
TraceAttack_SetPenetrationPower(1);
|
||||
TraceAttack_FireBullets(1, pl.origin + pl.view_ofs, 25, [accuracy,accuracy], WEAPON_FIVESEVEN);
|
||||
Sound_Play(pl, CHAN_WEAPON, "weapon_fiveseven.fire");
|
||||
#endif
|
||||
|
|
|
@ -138,7 +138,8 @@ w_g3sg1_primary(player pl)
|
|||
View_SetMuzzleflash(MUZZLE_RIFLE);
|
||||
View_AddEvent(w_rifle_ejectshell, 0.0f);
|
||||
#else
|
||||
TraceAttack_SetPenetrationPower(2);
|
||||
TraceAttack_SetRangeModifier(0.98);
|
||||
TraceAttack_SetPenetrationPower(3);
|
||||
TraceAttack_FireBullets(1, pl.origin + pl.view_ofs, 80, [accuracy,accuracy], WEAPON_G3SG1);
|
||||
Sound_Play(pl, CHAN_WEAPON, "weapon_g3sg1.fire");
|
||||
#endif
|
||||
|
|
|
@ -146,7 +146,8 @@ w_glock18_primary(player pl)
|
|||
float accuracy = Cstrike_CalculateAccuracy(pl, (pl.mode_glock18) ? 175 : 200);
|
||||
pl.glock18_mag--;
|
||||
#ifdef SERVER
|
||||
TraceAttack_SetPenetrationPower(0);
|
||||
TraceAttack_SetRangeModifier(0.75);
|
||||
TraceAttack_SetPenetrationPower(1);
|
||||
TraceAttack_FireBullets(1, pl.origin + pl.view_ofs, 25, [accuracy,accuracy], WEAPON_GLOCK18);
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -193,7 +193,8 @@ w_m3_primary(player pl)
|
|||
View_SetMuzzleflash(MUZZLE_RIFLE);
|
||||
View_AddEvent(w_m3_ejectshell, 0.6f);
|
||||
#else
|
||||
TraceAttack_SetPenetrationPower(0);
|
||||
TraceAttack_SetRangeModifier(0.70);
|
||||
TraceAttack_SetPenetrationPower(1);
|
||||
|
||||
if (self.flags & FL_CROUCHING)
|
||||
Animation_PlayerTop(pl, ANIM_SHOOT_SHOTGUN, 0.45f);
|
||||
|
|
|
@ -184,7 +184,8 @@ w_m4a1_primary(player pl)
|
|||
Sound_Play(pl, CHAN_WEAPON, "weapon_m4a1.fire");
|
||||
}
|
||||
|
||||
TraceAttack_SetPenetrationPower(1);
|
||||
TraceAttack_SetRangeModifier(0.97);
|
||||
TraceAttack_SetPenetrationPower(2);
|
||||
TraceAttack_FireBullets(1, pl.origin + pl.view_ofs, 33, [accuracy,accuracy], WEAPON_M4A1);
|
||||
#endif
|
||||
|
||||
|
|
|
@ -142,7 +142,8 @@ w_mac10_primary(player pl)
|
|||
View_SetMuzzleflash(MUZZLE_RIFLE);
|
||||
View_AddEvent(w_pistol_ejectshell, 0.0f);
|
||||
#else
|
||||
TraceAttack_SetPenetrationPower(0);
|
||||
TraceAttack_SetRangeModifier(0.82);
|
||||
TraceAttack_SetPenetrationPower(1);
|
||||
TraceAttack_FireBullets(1, pl.origin + pl.view_ofs, 29, [accuracy,accuracy], WEAPON_MAC10);
|
||||
Sound_Play(pl, CHAN_WEAPON, "weapon_mac10.fire");
|
||||
#endif
|
||||
|
|
|
@ -140,7 +140,8 @@ w_mp5_primary(player pl)
|
|||
View_SetMuzzleflash(MUZZLE_RIFLE);
|
||||
View_AddEvent(w_pistol_ejectshell, 0.0f);
|
||||
#else
|
||||
TraceAttack_SetPenetrationPower(0);
|
||||
TraceAttack_SetRangeModifier(0.84);
|
||||
TraceAttack_SetPenetrationPower(1);
|
||||
TraceAttack_FireBullets(1, pl.origin + pl.view_ofs, 26, [accuracy,accuracy], WEAPON_MP5);
|
||||
Sound_Play(pl, CHAN_WEAPON, "weapon_mp5.fire");
|
||||
#endif
|
||||
|
|
|
@ -147,7 +147,8 @@ w_p228_primary(player pl)
|
|||
View_SetMuzzleflash(MUZZLE_RIFLE);
|
||||
View_AddEvent(w_pistol_ejectshell, 0.0f);
|
||||
#else
|
||||
TraceAttack_SetPenetrationPower(0);
|
||||
TraceAttack_SetRangeModifier(0.80);
|
||||
TraceAttack_SetPenetrationPower(1);
|
||||
TraceAttack_FireBullets(1, pl.origin + pl.view_ofs, 40, [accuracy,accuracy], WEAPON_P228);
|
||||
Sound_Play(pl, CHAN_WEAPON, "weapon_p228.fire");
|
||||
#endif
|
||||
|
|
|
@ -140,7 +140,8 @@ w_p90_primary(player pl)
|
|||
View_SetMuzzleflash(MUZZLE_RIFLE);
|
||||
View_AddEvent(w_pistol_ejectshell, 0.0f);
|
||||
#else
|
||||
TraceAttack_SetPenetrationPower(0);
|
||||
TraceAttack_SetRangeModifier(0.84);
|
||||
TraceAttack_SetPenetrationPower(1);
|
||||
TraceAttack_FireBullets(1, pl.origin + pl.view_ofs, 26, [accuracy,accuracy], WEAPON_P90);
|
||||
Sound_Play(pl, CHAN_WEAPON, "weapon_p90.fire");
|
||||
#endif
|
||||
|
|
|
@ -136,7 +136,8 @@ w_para_primary(player pl)
|
|||
View_SetMuzzleflash(MUZZLE_RIFLE);
|
||||
View_AddEvent(w_rifle_ejectshell, 0.0f);
|
||||
#else
|
||||
TraceAttack_SetPenetrationPower(1);
|
||||
TraceAttack_SetRangeModifier(0.97);
|
||||
TraceAttack_SetPenetrationPower(2);
|
||||
TraceAttack_FireBullets(1, pl.origin + pl.view_ofs, 35, [accuracy,accuracy], WEAPON_PARA);
|
||||
Sound_Play(pl, CHAN_WEAPON, "weapon_para.fire");
|
||||
#endif
|
||||
|
|
|
@ -197,7 +197,8 @@ w_scout_primary(player pl)
|
|||
View_SetMuzzleflash(MUZZLE_RIFLE);
|
||||
View_AddEvent(w_rifle_ejectshell, 0.5f);
|
||||
#else
|
||||
TraceAttack_SetPenetrationPower(2);
|
||||
TraceAttack_SetRangeModifier(0.98);
|
||||
TraceAttack_SetPenetrationPower(3);
|
||||
TraceAttack_FireBullets(1, pl.origin + pl.view_ofs, 75, [accuracy,accuracy], WEAPON_SCOUT);
|
||||
Sound_Play(pl, CHAN_WEAPON, "weapon_scout.fire");
|
||||
#endif
|
||||
|
|
|
@ -137,7 +137,8 @@ w_sg550_primary(player pl)
|
|||
View_SetMuzzleflash(MUZZLE_RIFLE);
|
||||
View_AddEvent(w_rifle_ejectshell, 0.0f);
|
||||
#else
|
||||
TraceAttack_SetPenetrationPower(1);
|
||||
TraceAttack_SetRangeModifier(0.98);
|
||||
TraceAttack_SetPenetrationPower(2);
|
||||
TraceAttack_FireBullets(1, pl.origin + pl.view_ofs, 70, [accuracy,accuracy], WEAPON_SG550);
|
||||
Sound_Play(pl, CHAN_WEAPON, "weapon_sg550.fire");
|
||||
#endif
|
||||
|
|
|
@ -140,7 +140,8 @@ w_sg552_primary(player pl)
|
|||
View_SetMuzzleflash(MUZZLE_RIFLE);
|
||||
View_AddEvent(w_rifle_ejectshell, 0.0f);
|
||||
#else
|
||||
TraceAttack_SetPenetrationPower(1);
|
||||
TraceAttack_SetRangeModifier(0.955);
|
||||
TraceAttack_SetPenetrationPower(2);
|
||||
TraceAttack_FireBullets(1, pl.origin + pl.view_ofs, 33, [accuracy,accuracy], WEAPON_SG552);
|
||||
Sound_Play(pl, CHAN_WEAPON, "weapon_sg552.fire");
|
||||
#endif
|
||||
|
|
|
@ -140,7 +140,8 @@ w_tmp_primary(player pl)
|
|||
View_SetMuzzleflash(MUZZLE_RIFLE);
|
||||
View_AddEvent(w_pistol_ejectshell, 0.0f);
|
||||
#else
|
||||
TraceAttack_SetPenetrationPower(0);
|
||||
TraceAttack_SetRangeModifier(0.84);
|
||||
TraceAttack_SetPenetrationPower(1);
|
||||
TraceAttack_FireBullets(1, pl.origin + pl.view_ofs, 26, [accuracy,accuracy], WEAPON_TMP);
|
||||
Sound_Play(pl, CHAN_WEAPON, "weapon_tmp.fire");
|
||||
#endif
|
||||
|
|
|
@ -140,7 +140,8 @@ w_ump45_primary(player pl)
|
|||
View_SetMuzzleflash(MUZZLE_RIFLE);
|
||||
View_AddEvent(w_pistol_ejectshell, 0.0f);
|
||||
#else
|
||||
TraceAttack_SetPenetrationPower(0);
|
||||
TraceAttack_SetRangeModifier(0.02);
|
||||
TraceAttack_SetPenetrationPower(1);
|
||||
TraceAttack_FireBullets(1, pl.origin + pl.view_ofs, 30, [accuracy,accuracy], WEAPON_UMP45);
|
||||
Sound_Play(pl, CHAN_WEAPON, "weapon_ump45.fire");
|
||||
#endif
|
||||
|
|
|
@ -196,7 +196,8 @@ w_usp45_primary(player pl)
|
|||
}
|
||||
|
||||
/* actual firing */
|
||||
TraceAttack_SetPenetrationPower(0);
|
||||
TraceAttack_SetRangeModifier(0.79);
|
||||
TraceAttack_SetPenetrationPower(1);
|
||||
TraceAttack_FireBullets(1, pl.origin + pl.view_ofs, 33, [accuracy,accuracy], WEAPON_USP45);
|
||||
#endif
|
||||
|
||||
|
|
|
@ -198,7 +198,8 @@ w_xm1014_primary(player pl)
|
|||
View_SetMuzzleflash(MUZZLE_RIFLE);
|
||||
View_AddEvent(w_xm1014_ejectshell, 0.0f);
|
||||
#else
|
||||
TraceAttack_SetPenetrationPower(0);
|
||||
TraceAttack_SetRangeModifier(0.70);
|
||||
TraceAttack_SetPenetrationPower(1);
|
||||
Sound_Play(pl, CHAN_WEAPON, "weapon_xm1014.fire");
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Reference in a new issue