o Onos charge done, needs PT testing and feedback

o Leap no longer does friendly fire damage

git-svn-id: https://unknownworlds.svn.cloudforge.com/ns1@412 67975925-1194-0748-b3d5-c16f83f1a3a1
This commit is contained in:
tankefugl 2006-04-25 21:35:07 +00:00
parent a12bd64a40
commit 2de5be3e9e
7 changed files with 59 additions and 29 deletions

Binary file not shown.

View File

@ -496,7 +496,7 @@ void CBasePlayerWeapon::ItemPostFrame( void )
}
// Properly propagate the end animation
if (this->PrevAttack2Status == true && !(m_pPlayer->pev->button & IN_ATTACK2) && (gHUD.GetHUDUser3() == AVH_USER3_ALIEN_PLAYER4))
if (this->PrevAttack2Status == true && !(m_pPlayer->pev->button & IN_ATTACK2))
{
switch (gHUD.GetCurrentWeaponID())
{
@ -506,6 +506,15 @@ void CBasePlayerWeapon::ItemPostFrame( void )
case AVH_WEAPON_ACIDROCKET:
this->SendWeaponAnim(8);
break;
case AVH_WEAPON_CLAWS:
this->SendWeaponAnim(9);
break;
case AVH_WEAPON_STOMP:
this->SendWeaponAnim(8);
break;
case AVH_WEAPON_DEVOUR:
this->SendWeaponAnim(11);
break;
}
}
@ -558,6 +567,20 @@ void CBasePlayerWeapon::ItemPostFrame( void )
break;
}
break;
case AVH_USER3_ALIEN_PLAYER5:
switch (gHUD.GetCurrentWeaponID())
{
case AVH_WEAPON_CLAWS:
this->SendWeaponAnim(5);
break;
case AVH_WEAPON_DEVOUR:
this->SendWeaponAnim(18);
break;
case AVH_WEAPON_STOMP:
this->SendWeaponAnim(15);
break;
}
break;
}
}

View File

@ -265,7 +265,7 @@ void AvHCharge::Precache(void)
PRECACHE_UNMODIFIED_MODEL(kLevel5ViewModel);
PRECACHE_UNMODIFIED_MODEL(kNullModel);
PRECACHE_UNMODIFIED_SOUND(kChargeSound);
PRECACHE_UNMODIFIED_SOUND(kChargeSound2);
PRECACHE_UNMODIFIED_SOUND(kChargeKillSound);
this->mEvent = PRECACHE_EVENT(1, kChargeEventName);

View File

@ -47,6 +47,7 @@ const float kLeapDuration = 1.0f;
// Charge constants.
const float kChargePunch = 2.5;
#define kChargeSound "weapons/charge1.wav"
#define kChargeSound2 "weapons/charge2.wav"
#define kChargeKillSound "weapons/chargekill.wav"
#define kChargeEventName "events/Charge.sc"
const float kChargeROF = 5.0f;

View File

@ -2272,7 +2272,7 @@ void AvHPlayer::PlayerTouch(CBaseEntity* inOther)
if((this->mTimeLeapEnd != -1) && (gpGlobals->time < this->mTimeLeapEnd))
{
// Do damage to entity
if(GetGameRules()->CanEntityDoDamageTo(this, inOther, &theScalar))
if(GetGameRules()->CanEntityDoDamageTo(this, inOther, &theScalar) && (inOther->pev->team != this->pev->team))
{
float theDamage = BALANCE_VAR(kLeapDamage)*theScalar*theTouchDamageInterval;
inOther->TakeDamage(theInflictor, theAttacker, theDamage, NS_DMG_NORMAL);
@ -2282,22 +2282,23 @@ void AvHPlayer::PlayerTouch(CBaseEntity* inOther)
}
// Are we charging?
if(false) // GetHasUpgrade(this->pev->iuser4, MASK_ALIEN_MOVEMENT))
{
if(GetGameRules()->CanEntityDoDamageTo(this, inOther, &theScalar))
{
float theDamage = BALANCE_VAR(kChargeDamage)*theScalar*theTouchDamageInterval;
inOther->TakeDamage(theInflictor, theAttacker, theDamage, NS_DMG_NORMAL);
if(inOther->IsPlayer() && !inOther->IsAlive())
{
EMIT_SOUND(ENT(this->pev), CHAN_WEAPON, kChargeKillSound, 1.0, ATTN_NORM);
}
this->mTimeOfLastTouchDamage = gpGlobals->time;
}
}
// if(GetHasUpgrade(this->pev->iuser4, MASK_ALIEN_MOVEMENT))
// {
// // Don't do friendly fire
// if(GetGameRules()->CanEntityDoDamageTo(this, inOther, &theScalar))
// {
// float theDamage = BALANCE_VAR(kChargeDamage)*theScalar*theTouchDamageInterval;
//
// inOther->TakeDamage(theInflictor, theAttacker, theDamage, NS_DMG_NORMAL);
//
// if(inOther->IsPlayer() && !inOther->IsAlive())
// {
// EMIT_SOUND(ENT(this->pev), CHAN_WEAPON, kChargeKillSound, 1.0, ATTN_NORM);
// }
//
// this->mTimeOfLastTouchDamage = gpGlobals->time;
// }
// }
}
}
}
@ -3062,11 +3063,11 @@ void AvHPlayer::GetSpeeds(int& outBaseSpeed, int& outUnemcumberedSpeed) const
//theAlienBaseSpeed = this->mMaxGallopSpeed;
theAlienBaseSpeed = BALANCE_VAR(kOnosBaseSpeed);
if(GetHasUpgrade(this->pev->iuser4, MASK_ALIEN_MOVEMENT))
{
theAlienBaseSpeed *= kChargingFactor;
theSpeedUpgradeAmount *= kChargingFactor;
}
// if(GetHasUpgrade(this->pev->iuser4, MASK_ALIEN_MOVEMENT))
// {
// theAlienBaseSpeed *= kChargingFactor;
// theSpeedUpgradeAmount *= kChargingFactor;
// }
break;
}
@ -6437,7 +6438,7 @@ void AvHPlayer::InternalAlienThink()
}
}
// Uncloak if we are charging
// Uncloak if we are charging, leaping or blinking
if(GetHasUpgrade(this->pev->iuser4, MASK_ALIEN_MOVEMENT))
{
this->TriggerUncloak();
@ -6718,12 +6719,16 @@ void AvHPlayer::InternalPreThink()
this->InternalHUDThink();
PROFILE_END(kPlayerHUDThink)
this->InternalChargeThink();
this->InternalMovementThink();
}
// Charge pushback
void AvHPlayer::InternalChargeThink()
void AvHPlayer::InternalMovementThink()
{
// Ensure that we do leap damage
if(GetHasUpgrade(this->pev->iuser4, MASK_ALIEN_MOVEMENT) && (GetUser3() == AVH_USER3_ALIEN_PLAYER1))
this->StartLeap();
// Check whether we're in a charge
if(GetHasUpgrade(this->pev->iuser4, MASK_ALIEN_MOVEMENT) && (GetUser3() == AVH_USER3_ALIEN_PLAYER5))
{
@ -6751,6 +6756,7 @@ void AvHPlayer::InternalChargeThink()
float dot = DotProduct(heading, direction);
if (dot > 0.0f)
{
direction[0] = 50;
VectorScale(direction, factor * dot, direction);
VectorAdd(theEntity->pev->velocity, direction, theEntity->pev->velocity);
if (Length(theEntity->pev->velocity) > theEntity->pev->maxspeed * maxpushbackspeedfactor)

View File

@ -534,7 +534,7 @@ private:
void InternalPreThink();
void InternalProgressBarThink();
void InternalSpeakingThink();
void InternalChargeThink();
void InternalMovementThink();
void EXPORT PlayerTouch(CBaseEntity* inOther);

View File

@ -4629,7 +4629,7 @@ bool PM_ChargeMove()
{
int theSilenceUpgradeLevel = AvHGetAlienUpgradeLevel(pmove->iuser4, MASK_UPGRADE_6);
float theVolumeScalar = 1.0f - theSilenceUpgradeLevel/3.0f;
PM_NSPlaySound( CHAN_WEAPON, "player/pl_fallpain3-7.wav", theVolumeScalar, ATTN_NORM, 0, PITCH_NORM );
PM_NSPlaySound( CHAN_WEAPON, "weapons/charge2.wav", theVolumeScalar, ATTN_NORM, 0, PITCH_NORM );
pmove->fuser4 = 0.3f;
}
pmove->fuser4 += (float)pmove->frametime;