Skip to content
Merged
Show file tree
Hide file tree
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
458 changes: 260 additions & 198 deletions addons/sourcemod/configs/zombie_riot/fast_zs.cfg

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions addons/sourcemod/scripting/zombie_riot/elemental.sp
Original file line number Diff line number Diff line change
Expand Up @@ -1356,6 +1356,10 @@ static void Zombie_Spawning(int entity, int count)
//it was the same bug alaxios had, in this case, it has to be reversed.
health = RoundToNearest(float(health) / MultiGlobalHealth);
}
if(health > 30000)
{
health = 30000;
}

Enemy enemy;
enemy.Index = NPC_GetByPlugin(name);
Expand Down
22 changes: 22 additions & 0 deletions addons/sourcemod/scripting/zombie_riot/npc.sp
Original file line number Diff line number Diff line change
Expand Up @@ -1238,6 +1238,7 @@ void NPC_ConfigSetup()
Nest_OnMapStart_NPC();
ZSZmain_OnMapStart_NPC();
ZombieSummonRandom_OnMapStart_NPC();
PoyoSummonRandom_OnMapStart_NPC();
Amplification_Precache();
Pregnant_Precache();
ZSHeadcrabZombie_OnMapStart_NPC();
Expand Down Expand Up @@ -1282,6 +1283,16 @@ void NPC_ConfigSetup()
DasNaggenvatcher_OnMapStart();
StoneAgeMaker_OnMapStart_NPC();
MassShootingLover_OnMapStart_NPC();
ZSZombine_OnMapStart_NPC();
ZSMainHeadcrab_OnMapStart_NPC();
ZSMainHeadcrabZombie_OnMapStart_NPC();
ZSMainPoisonZombie_OnMapStart_NPC();
ZSSoldierGiant_OnMapStart_NPC();
ZSSoldierMinion_OnMapStart_NPC();
Angryheadcrab_MapStart();
Headcrabmilloperator_OnMapStart_NPC();
ManhattanParrot_OnMapStart_NPC();
InfectedTomislavMain_OnMapStart_NPC();
Allymedic_OnMapStart_NPC();
Allysoldier_OnMapStart_NPC();
Allyheavy_OnMapStart_NPC();
Expand Down Expand Up @@ -2738,6 +2749,9 @@ Action NpcSpecificOnTakeDamage(int victim, int &attacker, int &inflictor, float
#include "npc/gmod_zs/45/npc_zs_zombie_engineer.sp"
#include "npc/gmod_zs/45/npc_zs_medic_healer.sp"
#include "npc/gmod_zs/45/npc_zs_huntsman.sp"
#include "npc/gmod_zs/45/npc_angryheadcrab.sp"
#include "npc/gmod_zs/45/npc_zs_hmo.sp"
#include "npc/gmod_zs/45/npc_infected_tomislav_main.sp"
#include "npc/gmod_zs/60/npc_zs_eradicator.sp"
#include "npc/gmod_zs/60/npc_zs_zombie_fatspy.sp"
#include "npc/gmod_zs/60/npc_zs_medic_main.sp"
Expand All @@ -2753,10 +2767,12 @@ Action NpcSpecificOnTakeDamage(int victim, int &attacker, int &inflictor, float
#include "npc/gmod_zs/60/npc_zs_sniper.sp"
#include "npc/gmod_zs/60/npc_zs_sam.sp"
#include "npc/gmod_zs/60/npc_zs_mlsm.sp"
#include "npc/gmod_zs/60/npc_zs_manhattan_parrot.sp"
#include "npc/gmod_zs/npc_zs_zmain.sp"
#include "npc/gmod_zs/special/npc_zs_flesh_creeper.sp"
#include "npc/gmod_zs/special/npc_zs_nest.sp"
#include "npc/gmod_zs/special/npc_random_zombie.sp"
#include "npc/gmod_zs/special/npc_random_poyo.sp"
#include "npc/gmod_zs/special/npc_zs_amplification.sp"
#include "npc/gmod_zs/special/npc_zs_howler.sp"
#include "npc/gmod_zs/special/npc_zs_poisonzombie_fortified_giant.sp"
Expand All @@ -2766,6 +2782,12 @@ Action NpcSpecificOnTakeDamage(int victim, int &attacker, int &inflictor, float
#include "npc/gmod_zs/special/npc_zs_malfunctioning_heavy.sp"
#include "npc/gmod_zs/special/npc_zs_red_marrow.sp"
#include "npc/gmod_zs/special/npc_zs_bonemesh.sp"
#include "npc/gmod_zs/special/npc_zs_zombine.sp"
#include "npc/gmod_zs/special/npc_zs_zmain_headcrab.sp"
#include "npc/gmod_zs/special/npc_zs_zmain_headcrabzombie.sp"
#include "npc/gmod_zs/special/npc_zs_zmain_poisonzombie.sp"
#include "npc/gmod_zs/special/npc_zs_soldier_giant_grave.sp"
#include "npc/gmod_zs/special/npc_zs_soldier_minion_grave.sp"
#include "npc/gmod_zs/bosses/npc_zs_nightmare.sp"
#include "npc/gmod_zs/bosses/npc_zs_sphynx.sp"
#include "npc/gmod_zs/bosses/npc_zs_pregnant.sp"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ void ZSHeadcrab_OnMapStart_NPC()
strcopy(data.Icon, sizeof(data.Icon), "gmod_zs_headcrab");
data.IconCustom = true;
data.Flags = 0;
data.Category = Type_Mutation;
data.Category = Type_GmodZS;
data.Func = ClotSummon;
NPC_Add(data);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ void FastHeadcrab_OnMapStart_NPC()
strcopy(data.Icon, sizeof(data.Icon), "gmod_zs_fast_headcrab");
data.IconCustom = true;
data.Flags = 0;
data.Category = Type_Mutation;
data.Category = Type_GmodZS;
data.Func = ClotSummon;
NPC_Add(data);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,9 @@ methodmap ZsSpitter < CSeaBody
if(iActivity > 0) npc.StartActivity(iActivity);
KillFeed_SetKillIcon(npc.index, "huntsman");

npc.m_iBleedType = BLEEDTYPE_SEABORN;
npc.m_iStepNoiseType = STEPSOUND_NORMAL;
npc.m_iNpcStepVariation = STEPTYPE_SEABORN;
npc.m_iBleedType = BLEEDTYPE_NORMAL;
npc.m_iStepNoiseType = STEPSOUND_NORMAL;
npc.m_iNpcStepVariation = STEPTYPE_NORMAL;

func_NPCDeath[npc.index] = ZsSpitter_NPCDeath;
func_NPCOnTakeDamage[npc.index] = ZsSpitter_OnTakeDamage;
Expand Down Expand Up @@ -170,7 +170,7 @@ public void ZsSpitter_ClotThink(int iNPC)
npc.FaceTowards(vecTarget, 15000.0);

npc.PlayRangedSound();
int entity = npc.FireArrow(vecTarget, npc.m_bElite ? 40.0 : 40.0, 800.0, "models/weapons/w_bugbait.mdl");
int entity = npc.FireArrow(vecTarget, 40.0, 800.0, "models/weapons/w_bugbait.mdl");
// 280 * 0.15
// 320 * 0.15

Expand Down Expand Up @@ -250,10 +250,9 @@ static Action zs_spitter_StartTouch(int entity, int target)
if(inflictor == -1)
inflictor = owner;

float DamageDeal = fl_rocket_particle_dmg[entity];
float DamageDeal = 40.0;
if(ShouldNpcDealBonusDamage(target))
DamageDeal *= h_BonusDmgToSpecialArrow[entity];
KillFeed_SetKillIcon(owner, "ball");
DamageDeal *= 0.5;
SDKHooks_TakeDamage(target, owner, inflictor, DamageDeal, DMG_BULLET|DMG_PREVENT_PHYSICS_FORCE, -1); //acts like a kinetic rocket
if(target <= MaxClients && !IsInvuln(target))
if(!HasSpecificBuff(target, "Fluid Movement"))
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,245 @@
#pragma semicolon 1
#pragma newdecls required

static const char g_DeathSounds[][] = {
"npc/headcrab/die1.wav",
"npc/headcrab/die2.wav"
};

static const char g_HurtSound[][] = {
"npc/headcrab/pain1.wav",
"npc/headcrab/pain2.wav",
"npc/headcrab/pain3.wav"
};

static const char g_IdleSound[][] = {
"npc/headcrab/alert1.wav",
"npc/headcrab/idle3.wav"
};

static const char g_MeleeHitSounds[][] = {
"npc/headcrab/headbite.wav"
};

static const char g_MeleeAttackSounds[][] = {
"npc/headcrab/attack1.wav",
"npc/headcrab/attack2.wav",
"npc/headcrab/attack3.wav"
};

void Angryheadcrab_MapStart()
{
PrecacheSoundArray(g_DeathSounds);
PrecacheSoundArray(g_MeleeAttackSounds);
PrecacheSoundArray(g_MeleeHitSounds);
PrecacheSoundArray(g_IdleSound);
PrecacheSoundArray(g_HurtSound);

PrecacheModel("models/headcrabclassic.mdl");

NPCData data;
strcopy(data.Name, sizeof(data.Name), "Angry Headcrab");
strcopy(data.Plugin, sizeof(data.Plugin), "npc_angryheadcrab");
strcopy(data.Icon, sizeof(data.Icon), "ds_runner");
data.IconCustom = true;
data.Flags = 0;
data.Category = Type_GmodZS;
data.Func = ClotSummon;
NPC_Add(data);
}

static any ClotSummon(int client, float vecPos[3], float vecAng[3], int team, const char[] data)
{
return Angryheadcrab(vecPos, vecAng, team, data);
}

methodmap Angryheadcrab < CSeaBody
{
public void PlayIdleSound()
{
if(this.m_flNextIdleSound > GetGameTime(this.index))
return;

EmitSoundToAll(g_IdleSound[GetRandomInt(0, sizeof(g_IdleSound) - 1)], this.index, SNDCHAN_VOICE, NORMAL_ZOMBIE_SOUNDLEVEL, _, NORMAL_ZOMBIE_VOLUME,_);
this.m_flNextIdleSound = GetGameTime(this.index) + GetRandomFloat(12.0, 24.0);
}
public void PlayHurtSound()
{
EmitSoundToAll(g_HurtSound[GetRandomInt(0, sizeof(g_HurtSound) - 1)], this.index, SNDCHAN_VOICE, NORMAL_ZOMBIE_SOUNDLEVEL, _, NORMAL_ZOMBIE_VOLUME,_);
}
public void PlayDeathSound()
{
EmitSoundToAll(g_DeathSounds[GetRandomInt(0, sizeof(g_DeathSounds) - 1)], this.index, SNDCHAN_VOICE, NORMAL_ZOMBIE_SOUNDLEVEL, _, NORMAL_ZOMBIE_VOLUME,_);
}
public void PlayMeleeSound()
{
EmitSoundToAll(g_MeleeAttackSounds[GetRandomInt(0, sizeof(g_MeleeAttackSounds) - 1)], this.index, SNDCHAN_AUTO, NORMAL_ZOMBIE_SOUNDLEVEL, _, NORMAL_ZOMBIE_VOLUME,_);
}
public void PlayMeleeHitSound()
{
EmitSoundToAll(g_MeleeHitSounds[GetRandomInt(0, sizeof(g_MeleeHitSounds) - 1)], this.index, SNDCHAN_AUTO, NORMAL_ZOMBIE_SOUNDLEVEL, _, NORMAL_ZOMBIE_VOLUME,_);
}

public Angryheadcrab(float vecPos[3], float vecAng[3], int ally, const char[] data)
{
Angryheadcrab npc = view_as<Angryheadcrab>(CClotBody(vecPos, vecAng, "models/headcrabclassic.mdl", "1.35", data[0] ? "600" : "400", ally, false));
// 3000 x 0.15
// 4000 x 0.15

npc.SetElite(view_as<bool>(data[0]));
i_NpcWeight[npc.index] = 0;
npc.SetActivity("ACT_RUN");
KillFeed_SetKillIcon(npc.index, "bread_bite");

npc.m_iBleedType = BLEEDTYPE_NORMAL;
npc.m_iStepNoiseType = STEPSOUND_NORMAL;
npc.m_iNpcStepVariation = STEPTYPE_NORMAL;

func_NPCDeath[npc.index] = Angryheadcrab_NPCDeath;
func_NPCOnTakeDamage[npc.index] = Angryheadcrab_OnTakeDamage;
func_NPCThink[npc.index] = Angryheadcrab_ClotThink;

npc.m_flSpeed = data[0] ? 475.0 : 330.0; // 1.9 x 250
npc.m_flGetClosestTargetTime = 0.0;
npc.m_flNextMeleeAttack = 0.0;
npc.m_flAttackHappens = 0.0;
f_ExtraOffsetNpcHudAbove[npc.index] = -65.0;

SetEntityRenderColor(npc.index, 255, 0, 0, 255);
return npc;
}
}

public void Angryheadcrab_ClotThink(int iNPC)
{
Angryheadcrab npc = view_as<Angryheadcrab>(iNPC);

float gameTime = GetGameTime(npc.index);
if(npc.m_flNextDelayTime > gameTime)
return;

npc.m_flNextDelayTime = gameTime + DEFAULT_UPDATE_DELAY_FLOAT;
npc.Update();

if(npc.m_blPlayHurtAnimation)
{
//npc.AddGesture("ACT_GESTURE_FLINCH_HEAD", false);
npc.PlayHurtSound();
npc.m_blPlayHurtAnimation = false;
}

if(npc.m_flNextThinkTime > gameTime)
return;

npc.m_flNextThinkTime = gameTime + 0.1;

if(npc.m_iTarget && !IsValidEnemy(npc.index, npc.m_iTarget))
npc.m_iTarget = 0;

if(!npc.m_iTarget || npc.m_flGetClosestTargetTime < gameTime)
{
npc.m_iTarget = GetClosestTarget(npc.index);
npc.m_flGetClosestTargetTime = gameTime + 1.0;
}

if(npc.m_iTarget > 0)
{
float vecTarget[3]; WorldSpaceCenter(npc.m_iTarget, vecTarget );
float VecSelfNpc[3]; WorldSpaceCenter(npc.index, VecSelfNpc);
float distance = GetVectorDistance(vecTarget, VecSelfNpc, true);

if(distance < npc.GetLeadRadius())
{
float vPredictedPos[3]; PredictSubjectPosition(npc, npc.m_iTarget,_,_, vPredictedPos);
npc.SetGoalVector(vPredictedPos);
}
else
{
npc.SetGoalEntity(npc.m_iTarget);
}

npc.StartPathing();

if(npc.m_flAttackHappens)
{
if(npc.m_flAttackHappens < gameTime)
{
npc.m_flAttackHappens = 0.0;

Handle swingTrace;
npc.FaceTowards(vecTarget, 15000.0);
if(npc.DoSwingTrace(swingTrace, npc.m_iTarget, _, _, _, _))
{
int target = TR_GetEntityIndex(swingTrace);

float vecHit[3];
TR_GetEndPosition(vecHit, swingTrace);

if(target > 0)
{
npc.PlayMeleeHitSound();
SDKHooks_TakeDamage(target, npc.index, npc.index, npc.m_bElite ? 150.0 : 100.0, DMG_CLUB);
StartBleedingTimer(target, npc.index, 5.0, 2, -1, DMG_TRUEDAMAGE, 0);
// 280 x 0.15
// 340 x 0.15
}
}

delete swingTrace;
}
}

if(distance < 10000.0 && npc.m_flNextMeleeAttack < gameTime)
{
int target = Can_I_See_Enemy(npc.index, npc.m_iTarget);
if(IsValidEnemy(npc.index, target))
{
npc.m_iTarget = target;

npc.AddGesture("ACT_RANGE_ATTACK1");

npc.PlayMeleeSound();

npc.m_flAttackHappens = gameTime + 0.45;

//npc.m_flDoingAnimation = gameTime + 1.2;
npc.m_flNextMeleeAttack = gameTime + 1.25;
npc.m_flHeadshotCooldown = gameTime + 1.25;
}
}
}
else
{
npc.StopPathing();
}

npc.PlayIdleSound();
}

public Action Angryheadcrab_OnTakeDamage(int victim, int &attacker, int &inflictor, float &damage, int &damagetype, int &weapon, float damageForce[3], float damagePosition[3], int damagecustom)
{
if(attacker < 1)
return Plugin_Continue;

Angryheadcrab npc = view_as<Angryheadcrab>(victim);
if(npc.m_flHeadshotCooldown < GetGameTime(npc.index))
{
npc.m_flHeadshotCooldown = GetGameTime(npc.index) + DEFAULT_HURTDELAY;
npc.m_blPlayHurtAnimation = true;
}
return Plugin_Changed;
}

void Angryheadcrab_NPCDeath(int entity)
{
Angryheadcrab npc = view_as<Angryheadcrab>(entity);
if(!npc.m_bGib)
npc.PlayDeathSound();

float vecMe[3]; WorldSpaceCenter(npc.index, vecMe);
Explode_Logic_Custom(40.0, npc.index, npc.index, -1, vecMe, 200.0, 1.0, _, true, 15, _, _, Angryheadcrab_ExplodePost);
}
static void Angryheadcrab_ExplodePost(int attacker, int victim, float damage, int weapon)
{
StartBleedingTimer(victim, attacker, 5.0, 2, -1, DMG_TRUEDAMAGE, 0);
}
Loading