Skip to content

Commit

Permalink
a
Browse files Browse the repository at this point in the history
  • Loading branch information
artvin01 committed Oct 11, 2024
1 parent 86183c7 commit cd0d3ca
Show file tree
Hide file tree
Showing 8 changed files with 80 additions and 37 deletions.
1 change: 0 additions & 1 deletion addons/sourcemod/configs/zombie_riot/weapons.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -4500,7 +4500,6 @@
}
"Fire Axe"
{
"author" "Batfoxkid"
"tags" "DPS;Survival;Fast-Recovery;Debuff"
"starter" "1"
"cost" "1000"
Expand Down
77 changes: 55 additions & 22 deletions addons/sourcemod/scripting/rpg_fortress/custom/weapon_boom_stick.sp
Original file line number Diff line number Diff line change
Expand Up @@ -12,31 +12,64 @@ void BoomStick_MapPrecache()

public void Weapon_Boom_Stick(int client, int weapon, const char[] classname, bool &result)
{
static float anglesB[3];
GetClientEyeAngles(client, anglesB);
static float velocity[3];
GetAngleVectors(anglesB, velocity, NULL_VECTOR, NULL_VECTOR);
float knockback = -150.0;
float Ratio = BoomstickAdjustDamageAndAmmoCount(weapon, 4);

// if(!TF2_IsPlayerInCondition(client, TFCond_RuneHaste))
{
static float anglesB[3];
GetClientEyeAngles(client, anglesB);
static float velocity[3];
GetAngleVectors(anglesB, velocity, NULL_VECTOR, NULL_VECTOR);
float knockback = -200.0 * Ratio;

ScaleVector(velocity, knockback);
if ((GetEntityFlags(client) & FL_ONGROUND) != 0 || GetEntProp(client, Prop_Send, "m_nWaterLevel") >= 1)
velocity[2] = fmax(velocity[2], 300.0);
else
velocity[2] += 100.0; // a little boost to alleviate arcing issues

float TempRatio = Ratio;
if(TempRatio > 1.0)
TempRatio = 1.0;

ScaleVector(velocity, knockback);
if ((GetEntityFlags(client) & FL_ONGROUND) != 0 || GetEntProp(client, Prop_Send, "m_nWaterLevel") >= 1)
velocity[2] = fmax(velocity[2], 300.0 * TempRatio);
else
velocity[2] += 100.0 * TempRatio; // a little boost to alleviate arcing issues


float newVel[3];
float newVel[3];

newVel[0] = GetEntPropFloat(client, Prop_Send, "m_vecVelocity[0]");
newVel[1] = GetEntPropFloat(client, Prop_Send, "m_vecVelocity[1]");
newVel[2] = GetEntPropFloat(client, Prop_Send, "m_vecVelocity[2]");
newVel[0] = GetEntPropFloat(client, Prop_Send, "m_vecVelocity[0]");
newVel[1] = GetEntPropFloat(client, Prop_Send, "m_vecVelocity[1]");
newVel[2] = GetEntPropFloat(client, Prop_Send, "m_vecVelocity[2]");

for (int i = 0; i < 3; i++)
{
velocity[i] += newVel[i];
}
for (int i = 0; i < 3; i++)
{
velocity[i] += newVel[i];
}

TeleportEntity(client, NULL_VECTOR, NULL_VECTOR, velocity);
EmitSoundToAll("weapons/shotgun/shotgun_dbl_fire.wav", client, SNDCHAN_STATIC, 80, _, 1.0);
Client_Shake(client, 0, 35.0, 20.0, 0.8);
TeleportEntity(client, NULL_VECTOR, NULL_VECTOR, velocity);
}
float SoundRatio = 0.5 * Ratio;
if(SoundRatio > 1.0)
SoundRatio = 1.0;

EmitSoundToAll("weapons/shotgun/shotgun_dbl_fire.wav", client, SNDCHAN_STATIC, 80, _, SoundRatio);
EmitSoundToAll("weapons/shotgun/shotgun_dbl_fire.wav", client, SNDCHAN_STATIC, 80, _, SoundRatio);
float ShakeRatio = Ratio;
if(ShakeRatio > 1.3)
ShakeRatio = 1.3;
Client_Shake(client, 0, 35.0 * ShakeRatio, 30.0 * ShakeRatio, 0.8 * ShakeRatio);
}

float BoomstickAdjustDamageAndAmmoCount(int weapon, int bulletsmax)
{
int iAmmoTable = FindSendPropInfo("CBaseCombatWeapon", "m_iClip1");
int CurrentClip = GetEntData(weapon, iAmmoTable, 4);

float RatioMax;

RatioMax = float(CurrentClip) / float(bulletsmax);

SetEntData(weapon, iAmmoTable, 1);
SetEntProp(weapon, Prop_Send, "m_iClip1", 1); // weapon clip amount bullets
Attributes_Set(weapon, 1, RatioMax);

return RatioMax;
}
10 changes: 7 additions & 3 deletions addons/sourcemod/scripting/rpg_fortress/rpg_core.sp
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ void RPG_MapEnd()
MapConfig[0] = 0;
}

void RPG_ConfigSetup(const char[] mapname)
void RPG_SetupMapSpecific(const char[] mapname)
{
bool found;
char buffer[PLATFORM_MAX_PATH];
Expand All @@ -311,6 +311,11 @@ void RPG_ConfigSetup(const char[] mapname)

if(!found)
SetFailState("Can not find folder in '%s' for map '%s'", buffer, mapname);
BuildPath(Path_SM, buffer, sizeof(buffer), CONFIG ... "/%s/soundscript.txt", MapConfig);
LoadSoundScript(buffer);
}
void RPG_ConfigSetup()
{

Zones_ConfigSetup();
Actor_ConfigSetup();
Expand All @@ -329,8 +334,7 @@ void RPG_ConfigSetup(const char[] mapname)

TextStore_ConfigSetup();

BuildPath(Path_SM, buffer, sizeof(buffer), CONFIG ... "/%s/soundscript.txt", MapConfig);
LoadSoundScript(buffer);

}

bool RPG_BuildPath(char[] buffer, int length, const char[] name)
Expand Down
7 changes: 5 additions & 2 deletions addons/sourcemod/scripting/shared/configs.sp
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ void Configs_ConfigsExecuted()
}
}

#if defined RPG
RPG_SetupMapSpecific(mapname);
#endif

#if defined RPG
FileNetwork_ConfigSetup();
NPC_ConfigSetup();
Expand All @@ -73,9 +77,8 @@ void Configs_ConfigsExecuted()
Waves_SetupVote(kv);
Waves_SetupMiniBosses(kv);
#endif

#if defined RPG
RPG_ConfigSetup(mapname);
RPG_ConfigSetup();
#endif

#if defined RTS
Expand Down
2 changes: 1 addition & 1 deletion addons/sourcemod/scripting/shared/core.sp
Original file line number Diff line number Diff line change
Expand Up @@ -1562,7 +1562,7 @@ public void OnPluginStart()
LoadTranslations("zombieriot.phrases.bob");
LoadTranslations("zombieriot.phrases.icons");
LoadTranslations("zombieriot.phrases.item.gift.desc");
LoadTranslations("realtime.phrases");
// LoadTranslations("realtime.phrases");
LoadTranslations("common.phrases");

DHook_Setup();
Expand Down
16 changes: 10 additions & 6 deletions addons/sourcemod/scripting/shared/filenetwork.sp
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,14 @@ void FileNetwork_ConfigSetup(KeyValues map)

KeyValues kv = new KeyValues("Downloads");
kv.ImportFromFile(buffer);


#if defined RPG
//This adds another ''//'' for no reason.
/*
2 addons\sourcemod\configs\rpg_fortress\downloads.cfg
3 addons\sourcemod\configs\rpg_fortress\\downloads.cfg
*/
RPG_BuildPath(buffer, sizeof(buffer), "downloads");
KeyValues enabled = new KeyValues("Packages");
enabled.ImportFromFile(buffer);
Expand All @@ -106,7 +111,6 @@ void FileNetwork_ConfigSetup(KeyValues map)

if(!enabled)
{
#if defined ZR
zr_downloadconfig.GetString(buffer, sizeof(buffer));
if(buffer[0])
{
Expand All @@ -121,7 +125,7 @@ void FileNetwork_ConfigSetup(KeyValues map)
enabled = kv;
enabled.JumpToKey("Default");
}
#endif

}
#endif

Expand Down Expand Up @@ -337,7 +341,7 @@ static void SendNextFile(int client)
Downloading[client] = false;

PrintToConsole(client, "---");
PrintToConsole(client, "[ZR] Finished Downloading/Verifying Files! You will hear and see everything as intended now.");
PrintToConsole(client, "[ZR/RPG] Finished Downloading/Verifying Files! You will hear and see everything as intended now.");
PrintToConsole(client, "---");
}
}
Expand Down Expand Up @@ -380,7 +384,7 @@ public void FileNetwork_RequestResults(int client, const char[] file, int id, bo
else
{
// So the client doesn't freak out about existing CreateFragmentsFromFile spam
PrintToConsole(client, "[ZR] Downloading '%s'", download);
PrintToConsole(client, "[ZR/RPG] Downloading '%s'", download);
if(FileNet_SendFile(client, download, FileNetwork_SendResults, pack))
return;

Expand All @@ -405,7 +409,7 @@ public void FileNetwork_SendResults(int client, const char[] file, bool success,
File filec = OpenFile(filecheck, "wt");
if(filec)
{
filec.WriteLine("Used for file checks for ZR");
filec.WriteLine("Used for file checks for ZR/RPG");
filec.Close();
if(!FileNet_SendFile(client, filecheck, FileNetwork_SendFileCheck))
{
Expand Down
2 changes: 1 addition & 1 deletion addons/sourcemod/scripting/shared/sdkhooks.sp
Original file line number Diff line number Diff line change
Expand Up @@ -887,13 +887,13 @@ public void OnPostThink(int client)
IsReady = false;
had_An_ability = true;
}
#endif

if(had_An_ability)
{
HudY -= 0.035;
Format(buffer, sizeof(buffer), "%s\n", buffer);
}
#endif
float percentage = 100.0;
float percentage_Global = 1.0;
float value = 1.0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -732,7 +732,7 @@ static void Irene_Weapon_Lines(Iberiainqusitor_irene npc, int client)
case 2:
Format(Text_Lines, sizeof(Text_Lines), "{crimson}Liran's{default} legacy will move on with us {gold}%N{default}!",client);
case 3:
Format(Text_Lines, sizeof(Text_Lines), "We both can finish what {crimson}Liran{default} failed, eradicade the {gold}%N{default}!",client);
Format(Text_Lines, sizeof(Text_Lines), "We both can finish what {crimson}Liran{default} failed, eradicade the seaborn {gold}%N{default}!",client);
}
}

Expand Down

0 comments on commit cd0d3ca

Please sign in to comment.