Skip to content

Commit d2f203b

Browse files
authored
Sandvich rebalance, new Boomer abilities
1 parent a57fc96 commit d2f203b

File tree

1 file changed

+63
-15
lines changed

1 file changed

+63
-15
lines changed

hoovyassault.sp

Lines changed: 63 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ public Plugin myinfo =
201201
name = "Hoovy assault",
202202
author = "breins",
203203
description = "Battle of heavies",
204-
version = "25.05.10",
204+
version = "25.05.11",
205205
url = ""
206206
};
207207
public OnPluginStart()
@@ -280,10 +280,16 @@ public Action OnPlayerRunCmd(int client,int &buttons)
280280
if(HoovyClass[client]==HOOVY_BOOMER)
281281
{
282282
if(getActiveSlot(client)!=TFWeaponSlot_Secondary)return Plugin_Continue
283+
int weapon = GetPlayerWeaponSlot(client,TFWeaponSlot_Secondary)
284+
if(weapon==-1)return Plugin_Continue
285+
int itemIndex = getItemIndex(weapon)
283286
HoovySpecialDelivery[client] = true
284-
float expltime = GetURandomFloat()*3.0
287+
float expltime = (itemIndex!=159)?(GetURandomFloat()*3.0):2.5 // Dalokohs explodes after fixed time
285288
PrintToChatAll("An explosive sandwich has been deployed in this area. Time to take cover, probably.")
286-
CreateTimer(expltime>1.0?expltime:1.0,ExplosiveSandwichTimer,client)
289+
DataPack d = CreateDataPack()
290+
d.WriteCell(client)
291+
d.WriteCell(itemIndex)
292+
CreateTimer(expltime>1.0?expltime:1.0,ExplosiveSandwichTimer,d,TIMER_DATA_HNDL_CLOSE)
287293
EmitSoundToAll(boomer_sounds[GetRandomInt(0,BOOMER_VO_NUM-1)],client)
288294
}
289295
else if(HoovyClass[client]==HOOVY_LEAPER)
@@ -322,7 +328,7 @@ public Action OnTakeDamage(iVictim, &iAttacker, &inflictor, &Float:damage, &dama
322328
APIResult = Hoovyassault_Classapi_TakeDamage(iVictim,iAttacker,inflictor,damage,damagetype,weapon)
323329
if(APIResult!=Plugin_Continue)return APIResult
324330
#endif
325-
if(HoovyClass[iAttacker]==HOOVY_GNOME&&(damagetype&DMG_BURN))return Plugin_Continue
331+
if((HoovyClass[iAttacker]==HOOVY_GNOME||HoovyClass[iAttacker]==HOOVY_BOOMER)&&(damagetype&DMG_BURN))return Plugin_Continue
326332
if(HoovyFlags[iAttacker]&HOOVY_BIT_DMGBONUS)damage *= OFFICER_DMGBONUS
327333
if(validVictim)
328334
{
@@ -526,8 +532,15 @@ public Action Event_StealSandwich(Handle:hEvent, const String:strEventName[], bo
526532
int target = GetClientOfUserId(GetEventInt(hEvent,"target"))
527533
if(HoovyClass[owner]==HOOVY_BOOMER)// I have a new way to kill cowards!
528534
{
529-
PrintToChatAll("Ooops, somebody just stepped on the wrong sandwich")
530-
ExplodeSandwich(target,owner)
535+
if(!IsClientInGame(owner))return Plugin_Continue
536+
int weapon = GetPlayerWeaponSlot(owner,TFWeaponSlot_Secondary)
537+
if(weapon==-1)return Plugin_Continue
538+
int itemIndex = getItemIndex(weapon)
539+
if(itemIndex==1190) // Banana can explode twice
540+
{
541+
PrintToChatAll("Ooops, somebody just stepped on the wrong sandwich")
542+
ExplodeSandwich(target,owner,itemIndex)
543+
}
531544
}
532545
return Plugin_Continue
533546
}
@@ -946,13 +959,16 @@ public Action Timer_RemoveSandwich(Handle timer, int client)
946959
if(ent!=-1&&IsValidEntity(ent))AcceptEntityInput(ent, "Kill")
947960
return Plugin_Stop
948961
}
949-
public Action ExplosiveSandwichTimer(Handle timer,int client)
962+
public Action ExplosiveSandwichTimer(Handle timer,DataPack data)
950963
{
964+
data.Reset()
965+
static int client
966+
client = data.ReadCell()
951967
HoovySpecialDelivery[client] = false
952968
static int entity
953969
entity = findMySandwich(client)
954970
if(entity==-1)return Plugin_Stop
955-
ExplodeSandwich(entity,client)
971+
ExplodeSandwich(entity,client,data.ReadCell())
956972
CreateTimer(1.0,Timer_RemoveSandwich,client)
957973
return Plugin_Stop
958974
}
@@ -1171,12 +1187,31 @@ stock Beam(int from,int to)
11711187
}
11721188
TE_Send(clients, total, 0.0);
11731189
}
1174-
stock ExplodeSandwich(int targetent,int owner)
1190+
stock ExplodeSandwich(int targetent,int owner,int itemIndex)
11751191
{
1176-
static int i
1177-
static float pos[3]
1178-
static float dist
1179-
static float where[3]
1192+
int i
1193+
float pos[3]
1194+
float dist
1195+
float where[3]
1196+
float radius
1197+
float damage = 320.0
1198+
switch(itemIndex)
1199+
{
1200+
case 42,433,863,1002:{
1201+
radius = BOOM_RADIUS
1202+
} // Sandvich
1203+
case 1190:{
1204+
radius = BOOM_RADIUS*0.75 // Banana
1205+
}
1206+
case 311: {
1207+
radius = BOOM_RADIUS * 1.25 // Buffalo steak sandvich
1208+
damage = 250.0
1209+
}
1210+
case 159: { // Dalokohs
1211+
radius = BOOM_RADIUS
1212+
damage = 170.0
1213+
}
1214+
}
11801215
GetEntPropVector(targetent, Prop_Send, "m_vecOrigin", where)
11811216
//if(targetent>=MaxClients)AcceptEntityInput(targetent, "Kill")
11821217
EmitSoundToAll(SOUND_BOOM,SOUND_FROM_WORLD,SNDCHAN_AUTO,SNDLEVEL_NORMAL,SND_NOFLAGS,SNDVOL_NORMAL,SNDPITCH_NORMAL,-1,where)
@@ -1186,9 +1221,22 @@ stock ExplodeSandwich(int targetent,int owner)
11861221
if(!ValidUser(i)||(i!=owner&&TF2_GetClientTeam(i)==TF2_GetClientTeam(owner)))continue;
11871222
GetClientAbsOrigin(i,pos)
11881223
dist = GetVectorDistance(pos,where)
1189-
if(dist<BOOM_RADIUS) // if he shoots you, you'll probably die
1224+
if(dist<radius) // if he shoots you, you'll probably die
11901225
{
1191-
SDKHooks_TakeDamage(i, 0, owner, dist<(BOOM_RADIUS/2.0)?320.0:(320.0*(1.0-dist/BOOM_RADIUS)), DMG_PREVENT_PHYSICS_FORCE|DMG_CRUSH|DMG_ALWAYSGIB)
1226+
switch(itemIndex)
1227+
{
1228+
case(159):{
1229+
float dir[3]
1230+
MakeVectorFromPoints(where,pos,dir)
1231+
dir[2] = 200.0
1232+
ScaleVector(dir,100.0*(1.0-dist/radius))
1233+
//TF2_AddCondition(i,TFCond_KnockedIntoAir,0.1)
1234+
TeleportEntity(i, NULL_VECTOR, NULL_VECTOR, dir)
1235+
}
1236+
case(311):TF2_IgnitePlayer(i,owner,40.0); // Dalokohs
1237+
// Buffalo steak
1238+
}
1239+
SDKHooks_TakeDamage(i, 0, owner, dist<(radius/2.0)?damage:(damage*(1.0-dist/radius)), DMG_PREVENT_PHYSICS_FORCE|DMG_CRUSH|DMG_ALWAYSGIB)
11921240
}
11931241
}
11941242
}

0 commit comments

Comments
 (0)