Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add parameter to rage_cloneattack to allow bosses to become minions #150

Merged
merged 1 commit into from
Dec 15, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 33 additions & 6 deletions addons/sourcemod/scripting/ff2r_default_abilities.sp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"slot" "0" // Ability slot
"amount" "n/3 + 1" // Amount of clones to summon
"die on boss death" "true" // If clones die when the boss dies
"allow bosses" "false" //Allow bosses to become minions (in the process the boss becomes normal player)

"character"
{
Expand Down Expand Up @@ -2579,6 +2580,8 @@ void Rage_CloneAttack(int client, ConfigData cfg)
GetEntPropVector(client, Prop_Send, "m_vecOrigin", pos);

int owner = cfg.GetBool("die on boss death", true) ? client : -1;
bool allowBosses = cfg.GetBool("allow bosses", false);

ConfigData minion = cfg.GetSection("character");

int victims;
Expand All @@ -2587,9 +2590,17 @@ void Rage_CloneAttack(int client, ConfigData cfg)
{
for(int target = 1; target <= MaxClients; target++)
{
if(client == target || !IsClientInGame(target) || FF2R_GetBossData(target) || IsPlayerAlive(target) || GetClientTeam(target) != team)
if(client == target || !IsClientInGame(target) || IsPlayerAlive(target) || GetClientTeam(target) != team)
continue;


if(FF2R_GetBossData(target))
{
if(!allowBosses)
continue;
else
FF2R_CreateBoss(target, null);
}

// Same team dead players
victim[victims++] = target;
}
Expand All @@ -2602,9 +2613,17 @@ void Rage_CloneAttack(int client, ConfigData cfg)
{
for(int target = 1; target <= MaxClients; target++)
{
if(client == target || !IsClientInGame(target) || FF2R_GetBossData(target) || IsPlayerAlive(target) || GetClientTeam(target) == team)
if(client == target || !IsClientInGame(target) || IsPlayerAlive(target) || GetClientTeam(target) == team)
continue;


if(FF2R_GetBossData(target))
{
if(!allowBosses)
continue;
else
FF2R_CreateBoss(target, null);
}

// Same team alive players
victim[victims++] = target;
}
Expand All @@ -2616,9 +2635,17 @@ void Rage_CloneAttack(int client, ConfigData cfg)
{
for(int target = 1; target <= MaxClients; target++)
{
if(client == target || !IsClientInGame(target) || FF2R_GetBossData(target) || IsPlayerAlive(target) || GetClientTeam(target) <= view_as<int>(TFTeam_Spectator))
if(client == target || !IsClientInGame(target) || IsPlayerAlive(target) || GetClientTeam(target) <= view_as<int>(TFTeam_Spectator))
continue;


if(FF2R_GetBossData(target))
{
if(!allowBosses)
continue;
else
FF2R_CreateBoss(target, null);
}

// Any dead players
victim[victims++] = target;
}
Expand Down
Loading