diff options
author | BobTheBob <32057864+BobTheBob9@users.noreply.github.com> | 2021-10-20 20:11:43 +0100 |
---|---|---|
committer | BobTheBob <32057864+BobTheBob9@users.noreply.github.com> | 2021-10-20 20:11:43 +0100 |
commit | e79a58640e1ef1ea1c3c954aefccd36c3cb55286 (patch) | |
tree | 8c7b822f8777ccdf6b0d86587da853b8451953c1 /Northstar.Custom/mod/scripts/vscripts/rodeo | |
parent | d37c5ae333b4e622ebd0d18cf02a87d66aac62f9 (diff) | |
download | NorthstarMods-e79a58640e1ef1ea1c3c954aefccd36c3cb55286.tar.gz NorthstarMods-e79a58640e1ef1ea1c3c954aefccd36c3cb55286.zip |
automatic mod enable/disable, refactors and item registration callbacks
Diffstat (limited to 'Northstar.Custom/mod/scripts/vscripts/rodeo')
-rw-r--r-- | Northstar.Custom/mod/scripts/vscripts/rodeo/sh_classic_rodeo.gnut | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/Northstar.Custom/mod/scripts/vscripts/rodeo/sh_classic_rodeo.gnut b/Northstar.Custom/mod/scripts/vscripts/rodeo/sh_classic_rodeo.gnut index 6e2f0259..038305c0 100644 --- a/Northstar.Custom/mod/scripts/vscripts/rodeo/sh_classic_rodeo.gnut +++ b/Northstar.Custom/mod/scripts/vscripts/rodeo/sh_classic_rodeo.gnut @@ -50,12 +50,15 @@ void function OnRodeoWeakpointDamaged( entity weakpoint, var damageInfo ) attacker.NotifyDidDamage( weakpoint, DamageInfo_GetHitBox( damageInfo ), DamageInfo_GetDamagePosition( damageInfo ), DamageInfo_GetCustomDamageType( damageInfo ) | DF_CRITICAL, damageAmount, DamageInfo_GetDamageFlags( damageInfo ), DamageInfo_GetHitGroup( damageInfo ), DamageInfo_GetWeapon( damageInfo ), DamageInfo_GetDistFromAttackOrigin( damageInfo ) ) // figure out damage to deal to titan - entity attackerWeapon = attacker.GetActiveWeapon() + entity attackerWeapon = DamageInfo_GetWeapon( damageInfo ) + if ( !IsValid( attackerWeapon ) ) + attackerWeapon = attacker.GetActiveWeapon() + int rodeoDamage = attackerWeapon.GetWeaponSettingInt( eWeaponVar.damage_rodeo ) // only really on weapons that were in tf1, unfortunately - if ( rodeoDamage == 0 ) - rodeoDamage = int( attackerWeapon.GetWeaponSettingInt( eWeaponVar.damage_near_value_titanarmor ) * ( attackerWeapon.GetWeaponSettingFloat( eWeaponVar.damage_headshot_scale ) * 1.5 ) ) // would use headshot scale, but it's a bit low in most cases to be competitive + if ( rodeoDamage == 0 ) // would use headshot scale, but it's a bit low in most cases to be competitive with weapons with a valid damage_rodeo + rodeoDamage = int( attackerWeapon.GetWeaponSettingInt( eWeaponVar.damage_near_value_titanarmor ) * ( attackerWeapon.GetWeaponSettingFloat( eWeaponVar.damage_headshot_scale ) * 1.5 ) ) - // damage titan - titan.TakeDamage( rodeoDamage, attacker, attackerWeapon, { damageSourceId = eDamageSourceId.rodeo } ) + // damage titan, make sure DF_BYPASS_SHIELD is a thing for proper behaviour + titan.TakeDamage( rodeoDamage, attacker, attackerWeapon, { damageSourceId = eDamageSourceId.rodeo, scriptType = DamageInfo_GetCustomDamageType( damageInfo ) | DF_BYPASS_SHIELD } ) } #endif
\ No newline at end of file |