Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into fix/mod-versioning
Browse files Browse the repository at this point in the history
Alystrasz authored Dec 31, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
2 parents a1783b7 + 037760a commit 9f2d087
Showing 3 changed files with 59 additions and 20 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/compile-check.yml
Original file line number Diff line number Diff line change
@@ -17,6 +17,14 @@ jobs:
with:
mods-directory: "${{ github.workspace }}/mods"
native-json: "${{ github.workspace }}/mods/.github/nativefuncs.json"
vanilla: false

- name: Compile Scripts (Vanilla)
uses: ASpoonPlaysGames/squirrel-re-compiler@v3
with:
mods-directory: "${{ github.workspace }}/mods"
native-json: "${{ github.workspace }}/mods/.github/nativefuncs.json"
vanilla: true

# It's important that scripts compile when Northstar.Custom isn't enabled/installed, so run again without it
- name: Remove Northstar.Custom
@@ -28,3 +36,11 @@ jobs:
with:
mods-directory: "${{ github.workspace }}/mods"
native-json: "${{ github.workspace }}/mods/.github/nativefuncs.json"
vanilla: false

- name: Compile Scripts (Vanilla, No Northstar.Custom)
uses: ASpoonPlaysGames/squirrel-re-compiler@v3
with:
mods-directory: "${{ github.workspace }}/mods"
native-json: "${{ github.workspace }}/mods/.github/nativefuncs.json"
vanilla: true
Original file line number Diff line number Diff line change
@@ -366,7 +366,7 @@ void function DamageIndicators( DamageHistoryStruct damageHistory, bool playerIs
cockpit.AddToTitanHudDamageHistory( COCKPIT_PANEL_LEFT, damageHistory.damage )
}

if ( damageHistory.attacker && damageHistory.attacker.GetParent() == localViewPlayer )
if ( damageHistory.damageSourceId != eDamageSourceId.mp_weapon_arc_launcher && damageHistory.attacker && damageHistory.attacker.GetParent() == localViewPlayer )
{
damageHistory.rodeoDamage = true
return
61 changes: 42 additions & 19 deletions Northstar.Custom/mod/scripts/vscripts/weapons/sh_stim.gnut
Original file line number Diff line number Diff line change
@@ -40,20 +40,23 @@ void function StimPlayer( entity player, float duration, float severity = STIM_E

void function StimPlayer_Internal( entity player, float duration, float effectSeverity )
{
int endlessStatusEffectHandle = 0
// Handles for tracking status effects
int statusEffectHandle_SpeedBoost = 0
int statusEffectHandle_StimVFX = 0
if ( duration == USE_TIME_INFINITE )
{
endlessStatusEffectHandle = StatusEffect_AddEndless( player, eStatusEffect.speed_boost, effectSeverity )
statusEffectHandle_SpeedBoost = StatusEffect_AddEndless( player, eStatusEffect.speed_boost, effectSeverity )
statusEffectHandle_StimVFX = StatusEffect_AddEndless( player, eStatusEffect.stim_visual_effect, 1.0 )
}
else
{
StatusEffect_AddTimed( player, eStatusEffect.speed_boost, effectSeverity, duration + 0.5, 0.25 ) // sound is slightly off
StatusEffect_AddTimed( player, eStatusEffect.stim_visual_effect, 1.0, duration, duration )
statusEffectHandle_SpeedBoost = StatusEffect_AddTimed( player, eStatusEffect.speed_boost, effectSeverity, duration + 0.5, 0.25 ) // sound is slightly off
statusEffectHandle_StimVFX = StatusEffect_AddTimed( player, eStatusEffect.stim_visual_effect, 1.0, duration, duration )
}

#if SERVER
thread StimThink( player, duration, endlessStatusEffectHandle )
#else
thread StimThink( player, duration, statusEffectHandle_SpeedBoost, statusEffectHandle_StimVFX )
#else // CLIENT
entity cockpit = player.GetCockpit()
if ( !IsValid( cockpit ) )
return
@@ -63,15 +66,25 @@ void function StimPlayer_Internal( entity player, float duration, float effectSe
}

#if SERVER
void function StimThink( entity player, float duration, int endlessStatusEffectHandle )
void function StimThink( entity player, float duration, int statusEffectHandle_SpeedBoost, int statusEffectHandle_StimVFX )
{
player.EndSignal( "OnDeath" )
player.EndSignal( "OnChangedPlayerClass" )
if ( endlessStatusEffectHandle != 0 )
player.EndSignal( "StopEndlessStim" )
player.EndSignal( "player_embarks_titan" ) // Prevent transferring active Stim ability to Titan.

EmitSoundOnEntityOnlyToPlayer( player, player, "pilot_stimpack_loop_1P" )
EmitSoundOnEntityExceptToPlayer( player, player, "pilot_stimpack_loop_3P" )
if ( duration == USE_TIME_INFINITE )
{
player.EndSignal( "StopEndlessStim" )
// TF|2 stim loop sounds don't actually loop, use TF|1 loop sound.
// TF|1 sound is very quiet, is there a way to boost its volume (it has 300% volume in TF|1), except playing 3 sounds at once?
// BUG: It still stops playing sometimes for whatever reason ( Too many sounds? )
EmitSoundOnEntity( player, "Pilot_Stimpack_Loop" )
}
else
{
EmitSoundOnEntityOnlyToPlayer( player, player, "pilot_stimpack_loop_1P" )
EmitSoundOnEntityExceptToPlayer( player, player, "pilot_stimpack_loop_3P" )
}

int attachmentIndex = player.LookupAttachment( "CHESTFOCUS" )

@@ -82,19 +95,29 @@ void function StimThink( entity player, float duration, int endlessStatusEffectH
//thread StimSlowmoAim( player, duration )

OnThreadEnd(
function() : ( player, stimFX, endlessStatusEffectHandle )
function() : ( player, duration, stimFX, statusEffectHandle_SpeedBoost, statusEffectHandle_StimVFX )
{
if ( !IsValid( player ) )
return

if ( IsValid( stimFX ) )
EffectStop( stimFX )

StopSoundOnEntity( player, "pilot_stimpack_loop_1P" )
StopSoundOnEntity( player, "pilot_stimpack_loop_3P" )

if ( endlessStatusEffectHandle != 0 )
StatusEffect_Stop( player, endlessStatusEffectHandle )
if ( duration == USE_TIME_INFINITE )
{
StopSoundOnEntity( player, "Pilot_Stimpack_Loop" )
}
else
{
StopSoundOnEntity( player, "pilot_stimpack_loop_1P" )
StopSoundOnEntity( player, "pilot_stimpack_loop_3P" )
}

if ( statusEffectHandle_SpeedBoost != 0 )
StatusEffect_Stop( player, statusEffectHandle_SpeedBoost )

if ( statusEffectHandle_StimVFX != 0 )
StatusEffect_Stop( player, statusEffectHandle_StimVFX )

player.Signal( "EndStim" )
}
@@ -111,7 +134,7 @@ void function StimThink( entity player, float duration, int endlessStatusEffectH
wait 2.0
}

#else // #if SERVER
#else // CLIENT
void function StimVisualsEnabled( entity ent, int statusEffect, bool actuallyChanged )
{
if ( ent != GetLocalViewPlayer() )
@@ -164,4 +187,4 @@ void function StimScreenFXThink( entity player, int fxHandle, entity cockpit )
}
}

#endif // #else // #if SERVER
#endif

0 comments on commit 9f2d087

Please sign in to comment.