Skip to content

Commit

Permalink
Merge branch 'main' into new-items
Browse files Browse the repository at this point in the history
  • Loading branch information
GeckoEidechse authored Nov 3, 2023
2 parents 988690e + 82f8712 commit 00fd693
Show file tree
Hide file tree
Showing 7 changed files with 65 additions and 63 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/add-to-project.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: add-to-project

on:
issues:
types:
- opened
pull_request_target:
types:
- opened

jobs:
add-to-project:
name: Add to project
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
with:
project-url: "https://github.com/orgs/R2Northstar/projects/3"
github-token: "${{ secrets.ADD_TO_PROJECT_PAT }}"
2 changes: 0 additions & 2 deletions Northstar.Custom/keyvalues/playlists_v2.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ playlists
max_teams 12
classic_mp 1

scorelimit 21 // temp until we have a way of dynamically setting non-default scorelimit in code

gamemode_score_hint #GAMEMODE_SCORE_HINT_FFA
gamemode_bullet_001 #GAMEMODE_BULLET_FFA_001
gamemode_bullet_002 #GAMEMODE_BULLET_FFA_002
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,6 @@ void function GamemodeGG_Init()
AddCallback_GameStateEnter( eGameState.WinnerDetermined, OnWinnerDetermined )

AddCallback_GGEarnMeterFull( OnGGEarnMeterFilled )

// set scorelimit if it's wrong, sort of a jank way to do it but best i've got rn
try
{
if ( GetCurrentPlaylistVarInt( "scorelimit", GetGunGameWeapons().len() ) != GetGunGameWeapons().len() )
SetPlaylistVarOverride( "scorelimit", GetGunGameWeapons().len().tostring() )
}
catch ( ex ) {}
}

void function OnPlayerDisconnected(entity player)
Expand Down
62 changes: 22 additions & 40 deletions Northstar.Custom/mod/scripts/vscripts/weapons/_arc_cannon.nut
Original file line number Diff line number Diff line change
Expand Up @@ -536,12 +536,6 @@ function ZapTarget( zapInfo, target, beamStartPos, beamEndPos, chainNum = 1 )
thread CreateArcCannonBeam( zapInfo.weapon, target, beamStartPos, beamEndPos, zapInfo.player, ARC_CANNON_BEAM_LIFETIME, zapInfo.radius, boltWidth, 5, true, firstBeam )

#if SERVER
local isMissile = ( target.GetClassName() == "rpg_missile" )
if ( !isMissile )
wait ARC_CANNON_FORK_DELAY
else
wait 0.05

local deathPackage = damageTypes.arcCannon

float damageAmount
Expand Down Expand Up @@ -569,40 +563,20 @@ function ZapTarget( zapInfo, target, beamStartPos, beamEndPos, chainNum = 1 )
bool hasFastPacitor = false
bool noArcing = false

if ( IsValid( zapInfo.weapon ) )
{
entity weap = expect entity( zapInfo.weapon )
hasFastPacitor = weap.GetWeaponInfoFileKeyField( "push_apart" ) != null && weap.GetWeaponInfoFileKeyField( "push_apart" ) == 1
noArcing = weap.GetWeaponInfoFileKeyField( "no_arcing" ) != null && weap.GetWeaponInfoFileKeyField( "no_arcing" ) == 1
}
entity weapon = expect entity( zapInfo.weapon )
hasFastPacitor = weapon.GetWeaponInfoFileKeyField( "push_apart" ) != null && weapon.GetWeaponInfoFileKeyField( "push_apart" ) == 1
noArcing = weapon.GetWeaponInfoFileKeyField( "no_arcing" ) != null && weapon.GetWeaponInfoFileKeyField( "no_arcing" ) == 1
float critScale = weapon.GetWeaponSettingFloat( eWeaponVar.critical_hit_damage_scale )

if ( target.GetArmorType() == ARMOR_TYPE_HEAVY )
{
if ( IsValid( zapInfo.weapon ) )
{
entity weapon = expect entity( zapInfo.weapon )
damageMin = weapon.GetWeaponSettingInt( damageFarValueTitanArmor )
damageMax = weapon.GetWeaponSettingInt( damageNearValueTitanArmor )
}
else
{
damageMin = 100
damageMax = zapInfo.player.IsNPC() ? 1200 : 800
}
damageMin = weapon.GetWeaponSettingInt( damageFarValueTitanArmor )
damageMax = weapon.GetWeaponSettingInt( damageNearValueTitanArmor )
}
else
{
if ( IsValid( zapInfo.weapon ) )
{
entity weapon = expect entity( zapInfo.weapon )
damageMin = weapon.GetWeaponSettingInt( damageFarValue )
damageMax = weapon.GetWeaponSettingInt( damageNearValue )
}
else
{
damageMin = 120
damageMax = zapInfo.player.IsNPC() ? 140 : 275
}
damageMin = weapon.GetWeaponSettingInt( damageFarValue )
damageMax = weapon.GetWeaponSettingInt( damageNearValue )

if ( target.IsNPC() )
{
Expand All @@ -612,11 +586,10 @@ function ZapTarget( zapInfo, target, beamStartPos, beamEndPos, chainNum = 1 )
}


local chargeRatio = GetArcCannonChargeFraction( zapInfo.weapon )
if ( IsValid( zapInfo.weapon ) && !zapInfo.weapon.GetWeaponSettingBool( eWeaponVar.charge_require_input ) )
local chargeRatio = GetArcCannonChargeFraction( weapon )
if ( !weapon.GetWeaponSettingBool( eWeaponVar.charge_require_input ) )
{
// use distance for damage if the weapon auto-fires
entity weapon = expect entity( zapInfo.weapon )
float nearDist = weapon.GetWeaponSettingFloat( damageNearDistance )
float farDist = weapon.GetWeaponSettingFloat( damageFarDistance )

Expand All @@ -629,10 +602,19 @@ function ZapTarget( zapInfo, target, beamStartPos, beamEndPos, chainNum = 1 )
damageAmount = GraphCapped( zapInfo.chargeFrac, 0, chargeRatio, damageMin, damageMax )
}
local damageFalloff = ARC_CANNON_DAMAGE_FALLOFF_SCALER
if ( IsValid( zapInfo.weapon ) && zapInfo.weapon.HasMod( "splitter" ) )
if ( weapon.HasMod( "splitter" ) )
damageFalloff = SPLITTER_DAMAGE_FALLOFF_SCALER
damageAmount *= pow( damageFalloff, chainNum - 1 )

local isMissile = ( target.GetClassName() == "rpg_missile" )
if ( !isMissile )
wait ARC_CANNON_FORK_DELAY
else
wait 0.05

if ( !IsValid( target ) || !IsValid( zapInfo.player ) )
return

local dmgSourceID = zapInfo.dmgSourceID

// Update Later - This shouldn't be done here, this is not where we determine if damage actually happened to the target
Expand Down Expand Up @@ -660,13 +642,13 @@ function ZapTarget( zapInfo, target, beamStartPos, beamEndPos, chainNum = 1 )
// Do 3rd person effect on the body
asset effect
string tag
target.TakeDamage( damageAmount, zapInfo.player, zapInfo.player, { origin = beamEndPos, force = Vector(0,0,0), scriptType = deathPackage, weapon = zapInfo.weapon, damageSourceId = dmgSourceID,criticalHitScale = zapInfo.weapon.GetWeaponSettingFloat( eWeaponVar.critical_hit_damage_scale ) } )
target.TakeDamage( damageAmount, zapInfo.player, zapInfo.player, { origin = beamEndPos, force = Vector(0,0,0), scriptType = deathPackage, weapon = zapInfo.weapon, damageSourceId = dmgSourceID,criticalHitScale = critScale } )
//vector dir = Normalize( beamEndPos - beamStartPos )
//vector velocity = dir * 600
//PushPlayerAway( target, velocity )
//PushPlayerAway( expect entity( zapInfo.player ), -velocity )

if ( IsValid( zapInfo.weapon ) && hasFastPacitor )
if ( IsValid( weapon ) && hasFastPacitor )
{
if ( IsAlive( target ) && IsAlive( expect entity( zapInfo.player ) ) && target.IsTitan() )
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -628,6 +628,10 @@ void function SetRecalculateRespawnAsTitanStartPointCallback( entity functionref

bool function ShouldEntTakeDamage_SPMP( entity ent, var damageInfo )
{
// dropships are immune to being crushed
if ( ( IsDropship( ent ) || IsEvacDropship( ent ) ) && IsTitanCrushDamage( damageInfo ) )
return false

return true
}

Expand Down
25 changes: 15 additions & 10 deletions Northstar.CustomServers/mod/scripts/vscripts/mp/_score.nut
Original file line number Diff line number Diff line change
Expand Up @@ -202,18 +202,23 @@ void function ScoreEvent_TitanKilled( entity victim, entity attacker, var damage
AddPlayerScore( attacker, "KillTitan" )
}

table<int, bool> alreadyAssisted
foreach( DamageHistoryStruct attackerInfo in victim.e.recentDamageHistory )
entity soul = victim.GetTitanSoul()
if ( IsValid( soul ) )
{
if ( !IsValid( attackerInfo.attacker ) || !attackerInfo.attacker.IsPlayer() || attackerInfo.attacker == victim )
continue

bool exists = attackerInfo.attacker.GetEncodedEHandle() in alreadyAssisted ? true : false
if( attackerInfo.attacker != attacker && !exists )
table<int, bool> alreadyAssisted

foreach( DamageHistoryStruct attackerInfo in soul.e.recentDamageHistory )
{
alreadyAssisted[attackerInfo.attacker.GetEncodedEHandle()] <- true
AddPlayerScore(attackerInfo.attacker, "TitanAssist" )
Remote_CallFunction_NonReplay( attackerInfo.attacker, "ServerCallback_SetAssistInformation", attackerInfo.damageSourceId, attacker.GetEncodedEHandle(), victim.GetEncodedEHandle(), attackerInfo.time )
if ( !IsValid( attackerInfo.attacker ) || !attackerInfo.attacker.IsPlayer() || attackerInfo.attacker == soul )
continue

bool exists = attackerInfo.attacker.GetEncodedEHandle() in alreadyAssisted ? true : false
if( attackerInfo.attacker != attacker && !exists )
{
alreadyAssisted[attackerInfo.attacker.GetEncodedEHandle()] <- true
AddPlayerScore(attackerInfo.attacker, "TitanAssist" )
Remote_CallFunction_NonReplay( attackerInfo.attacker, "ServerCallback_SetAssistInformation", attackerInfo.damageSourceId, attacker.GetEncodedEHandle(), soul.GetEncodedEHandle(), attackerInfo.time )
}
}
}

Expand Down
8 changes: 5 additions & 3 deletions Northstar.CustomServers/mod/scripts/vscripts/mp/_stats.nut
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ void function Stats_IncrementStat( entity player, string statCategory, string st
// persistence string, we can't save the persistence so we have to just return
if ( str != saveVar )
{
printt( ex )
//printt( ex, str, GetMapName(), mode ) // Commented out due to spamming logs on invalid modes (e.g. Gun Game, Infection, ...)
return
}
}
Expand Down Expand Up @@ -571,9 +571,11 @@ void function HandleKillStats( entity victim, entity attacker, var damageInfo )
// assistsTotal ( weapon_kill_stats )
// note: eww
table<int, bool> alreadyAssisted
foreach( DamageHistoryStruct attackerInfo in victim.e.recentDamageHistory )
// titans store their recentDamageHistory in the soul
entity assistVictim = ( victim.IsTitan() && IsValid( victim.GetTitanSoul() ) ) ? victim.GetTitanSoul() : victim
foreach( DamageHistoryStruct attackerInfo in assistVictim.e.recentDamageHistory )
{
if ( !IsValid( attackerInfo.attacker ) || !attackerInfo.attacker.IsPlayer() || attackerInfo.attacker == victim )
if ( !IsValid( attackerInfo.attacker ) || !attackerInfo.attacker.IsPlayer() || attackerInfo.attacker == assistVictim )
continue

bool exists = attackerInfo.attacker.GetEncodedEHandle() in alreadyAssisted ? true : false
Expand Down

0 comments on commit 00fd693

Please sign in to comment.