Skip to content

Commit

Permalink
i hate tbis 2
Browse files Browse the repository at this point in the history
  • Loading branch information
EladNLG committed Jan 18, 2023
1 parent 6f57b76 commit 51de410
Show file tree
Hide file tree
Showing 8 changed files with 47 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ function SpawnArmor( var chest, var player )

string crarity = RARITY_LEGENDARYARMOR
string rrarity = RARITY_EXOTIC
switch (levelCount)
switch (GetConVarInt("level_count"))
{
case 0:
crarity = RARITY_COMMON
Expand Down Expand Up @@ -154,7 +154,7 @@ bool function CC_SpawnArmor( entity player, array<string> args )

string crarity = RARITY_LEGENDARYARMOR
string rrarity = RARITY_EXOTIC
switch (levelCount)
switch (GetConVarInt("level_count"))
{
case 0:
crarity = RARITY_COMMON
Expand All @@ -177,24 +177,31 @@ bool function CC_SpawnArmor( entity player, array<string> args )

void function UpdateCooldowns( entity player )
{
player.SetSharedEnergyRegenRate( 100.0 + (Roguelike_GetEntityStat( player, "strength" ) +
Roguelike_GetEntityStat( player, "intelligence" ) +
Roguelike_GetEntityStat( player, "discipline" ) ) / 3.0 )
array<int> offhandIndices = [ OFFHAND_LEFT, OFFHAND_TITAN_CENTER, OFFHAND_RIGHT ]
foreach ( index in offhandIndices )
{
float lastUseTime = player.p.lastPilotOffhandUseTime[ index ]
if (player.IsTitan())
lastUseTime = player.p.lastTitanOffhandUseTime[ index ]
float lastChargeFrac = player.p.lastPilotOffhandChargeFrac[ index ]
if (player.IsTitan())
lastChargeFrac = player.p.lastTitanOffhandChargeFrac[ index ]

//printt("OFFHAND", index, "LAST TIME", lastUseTime)
if ( lastUseTime >= 0.0 )
{
entity weapon = player.GetOffhandWeapon( index )
if (!IsValid( weapon ))
return
continue
int curAmmo = weapon.GetWeaponPrimaryClipCount()
if ( !IsValid( weapon ) )
continue

string weaponClassName = weapon.GetWeaponClassName()

switch ( GetWeaponInfoFileKeyField_Global( weaponClassName, "cooldown_type" ) )
string cooldownType = GetWeaponInfoFileKeyField_GlobalString( weaponClassName, "cooldown_type" )
switch ( cooldownType )
{
case "grapple":
// GetPlayerSettingsField isn't working for moddable fields? - Bug 129567
Expand Down Expand Up @@ -227,12 +234,15 @@ void function UpdateCooldowns( entity player )
switch (index)
{
case OFFHAND_LEFT:
//print("LEFT")
stat = "intelligence"
break
case OFFHAND_RIGHT:
//print("RIGHT")
stat = "strength"
break
case OFFHAND_TITAN_CENTER:
//print("CENTER")
stat = "discipline"
break
}
Expand All @@ -244,7 +254,9 @@ void function UpdateCooldowns( entity player )

float regenStartTime = lastUseTime + fireDuration + regenRefillDelay

// printt("REGEN RATE", regenRefillRate)
int newAmmo = weapon.GetWeaponPrimaryClipCount()
//printt("CUR AMMO", newAmmo)
if (Time() > regenStartTime)
{
file.cooldownTimes[player][index] += 0.1
Expand All @@ -254,13 +266,16 @@ void function UpdateCooldowns( entity player )
newAmmo += 1
}
}
//printt("NEW AMMO", newAmmo)

weapon.SetWeaponPrimaryClipCountNoRegenReset( minint( weapon.GetWeaponPrimaryClipCountMax(), newAmmo ) )
break

case "charged_shot":
case "chargeFrac":
print("fuck")
case "vortex_drain":
if (player.GetActiveWeapon() == weapon)
break
float chargeCooldownDelay = weapon.GetWeaponSettingFloat( eWeaponVar.charge_cooldown_delay )
float chargeCooldownTime = weapon.GetWeaponSettingFloat( eWeaponVar.charge_cooldown_time )
float regenStartTime = lastUseTime + chargeCooldownDelay
Expand All @@ -269,6 +284,7 @@ void function UpdateCooldowns( entity player )
switch (index)
{
case OFFHAND_LEFT:
//print("LEFT")
stat = "intelligence"
break
case OFFHAND_RIGHT:
Expand All @@ -280,7 +296,7 @@ void function UpdateCooldowns( entity player )
}
float regenRefillTime = weapon.GetWeaponChargeFraction() * chargeCooldownTime
* 0.01 * Roguelike_GetEntityStat( player, stat )
print(regenRefillTime)
//print(regenRefillTime)

float newCharge = weapon.GetWeaponChargeFraction()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,6 @@ array<vector> colors = [
void function ClArmor_Init()
{
AddServerToClientStringCommandCallback( "UpdateArmor", UpdateArmor )
thread TestProgressBar()
}

void function TestProgressBar()
{
wait 1
}

void function ArmorDropGainedFocus( entity ent )
Expand Down Expand Up @@ -65,7 +59,7 @@ void function UpdateArmor( array<string> args )
}
argStr = argStr.slice(0, argStr.len() - 1)
ArmorData data = StringToArmorData( argStr )
print(argStr)
//print(argStr)
entity player = GetLocalClientPlayer()
Roguelike_GiveEntityArmor( player, StringToArmorData( argStr ) )

Expand All @@ -82,6 +76,6 @@ function UpdateAmmoChargesBarSegments( var bar, int count )
int width = Hud_GetHeight( bar )
int gap = 1
int segmentWidth = (width - ( (count - 1) * gap) ) / count
print(segmentWidth)
//print(segmentWidth)
bar.SetBarSegmentInfo( gap, segmentWidth )
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,22 +41,20 @@ ArmorData function Armor_Create( string name, string rarity )
int titanPoints = 0
int pilotPoints = 0

int highMin = int(GraphCapped( GetRarityValue(rarity), 0, 3, 2, 10 ))
int highMax = int(GraphCapped( GetRarityValue(rarity), 0, 3, 6, 18 ))
int medMin = int(GraphCapped( GetRarityValue(rarity), 0, 3, 2, 10 ))
int highMin = int(GraphCapped( GetRarityValue(rarity), 0, 3, 2, 24 ))
int highMax = int(GraphCapped( GetRarityValue(rarity), 0, 3, 6, 24 ))
int medMin = int(GraphCapped( GetRarityValue(rarity), 0, 3, 2, 18 ))
int medMax = int(GraphCapped( GetRarityValue(rarity), 0, 3, 6, 18 ))
int lowMin = 2
int lowMin = 6
int lowMax = 6
string stat = pilotGroup.getrandom()
int val = RandomIntRangeOuterRange(
highMin, highMax, 1 + GetRarityValue(rarity)
) // 10
int val = RandomIntRangeOuterRange(highMin, highMax, 0) // 10
SetArmorStat(data, stat, val)
pilotPoints += val
pilotGroup.remove(pilotGroup.find(stat))

stat = pilotGroup.getrandom()
val = RandomIntRangeOuterRange(medMin, medMax, GetRarityValue(rarity)) // 6
val = RandomIntRangeOuterRange(medMin, medMax, 0) // 6
SetArmorStat(data, stat, val)
pilotPoints += val
pilotGroup.remove(pilotGroup.find(stat))
Expand All @@ -69,13 +67,13 @@ ArmorData function Armor_Create( string name, string rarity )
/// TITAN ///

stat = titanGroup.getrandom()
val = RandomIntRangeOuterRange(highMin, highMax, GetRarityValue(rarity)) // 10
val = RandomIntRangeOuterRange(highMin, highMax, 0) // 10
SetArmorStat(data, stat, val)
titanPoints += val
titanGroup.remove(titanGroup.find(stat))

stat = titanGroup.getrandom()
val = RandomIntRangeOuterRange(medMin, medMax, GetRarityValue(rarity)) // 8
val = RandomIntRangeOuterRange(medMin, medMax, 0) // 8
SetArmorStat(data, stat, val)
titanPoints += val
titanGroup.remove(titanGroup.find(stat))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ void function MoneyRUI_Update()
if (IsLobby()) return
if (!IsNewThread()) throw "MoneyRUI_Update() must be called from a new thread."

float lastTSLDC = 0
while (true)
{
if (file.requiredToPay > 0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ struct
void function _Shop_Init()
{
if (IsLobby()) return
if (IsSingleplayer())
SetConVarInt( "sv_quota_stringcmdspersecond", 1000 )
else SetConVarInt( "sv_quota_stringcmdspersecond", 60 )
AddClientCommandCallback( "buyammo", CC_BuyAmmo )
AddClientCommandCallback( "buyitem", CC_BuyItem )
if (GetDeveloperLevel() <= 0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,7 @@ int function GetChestSpawnAmount()
switch (GetMapName())
{
case "sp_training":
return 100
return 50
case "sp_boomtown":
return 100
case "mp_thaw":
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1013,7 +1013,9 @@ void function SPTitanLoadout_SetupForLevelStart()
{
int loadoutIndex = GetSPTitanLoadoutIndexForWeapon( weaponName )
}
SetBTLoadoutsUnlockedBitfield( 1 )
if (GetMapName() == "sp_crashsite")
SetBTLoadoutsUnlockedBitfield( 1 )
else SetBTLoadoutsUnlockedBitfield( 511 )
}

void function LoadoutsSP_OnPlayerRespawned( entity player )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,13 @@ void function InventoryMenuInit()
file.weaponSelected = null
}
})


file.gridData.rows = 4

file.gridData.rows = 3
file.gridData.columns = 4
file.gridData.paddingVert = 8
file.gridData.paddingHorz = 8
file.gridData.numElements = 12
file.gridData.numElements = 8
file.gridData.tileWidth = 180
print(file.gridData.tileWidth)
file.gridData.tileHeight = 100
Expand All @@ -118,7 +118,7 @@ void function InventoryMenuInit()
GridMenuInit( file.menu, file.gridData )

thread UpdateTooltip( Hud_GetChild( file.menu, "ArmorUI" ) )
}
}

void function OnMenuOpened()
{
Expand All @@ -144,7 +144,7 @@ void function UpdateTooltip( var button )
WaitFrame()
if (GetFocus() != null)
{
if (IsElementParent( button, GetFocus() ))
if (IsElementParent( button, GetFocus() ) || !Hud_IsVisible( GetFocus() ))
{
Hud_SetVisible( button, false )
continue
Expand Down Expand Up @@ -180,6 +180,7 @@ bool function OnModButtonReady( var button, int element )
{
RuiSetImage( Hud_GetRui( button ), "buttonImage",
$"r2_ui/menus/loadout_icons/primary_weapon/primary_r102" )
Hud_SetVisible( button, true )
//Hud_SetSelected( button, true )
return true
}
Expand Down

0 comments on commit 51de410

Please sign in to comment.