1.2.3.b2
This commit is contained in:
parent
0e86f54e0a
commit
98f6e65b01
98 changed files with 3391 additions and 397 deletions
|
|
@ -120,28 +120,19 @@ namespace src.player.skills
|
|||
}, CounterStrikeSharp.API.Modules.Timers.TimerFlags.STOP_ON_MAPCHANGE);
|
||||
}
|
||||
|
||||
public static void PlayerHurt(EventPlayerHurt @event)
|
||||
public static bool PlayerHurtPre(EventPlayerHurt @event)
|
||||
{
|
||||
var attacker = PlayerManager.GetPlayerEvent(@event.Attacker);
|
||||
var victim = PlayerManager.GetPlayerEvent(@event.Userid);
|
||||
if (!Instance.IsPlayerValid(victim)) return false;
|
||||
|
||||
if (!Instance.IsPlayerValid(victim)) return;
|
||||
|
||||
if (!Instance.IsPlayerValid(attacker))
|
||||
if (!IsActiveJester(victim!.Index))
|
||||
{
|
||||
if (IsActiveJester(victim!.Index))
|
||||
{
|
||||
SkillUtils.RestoreHealth(victim);
|
||||
RestoreArmor(victim, @event.DmgArmor);
|
||||
}
|
||||
return;
|
||||
var attacker = PlayerManager.GetPlayerEvent(@event.Attacker);
|
||||
if (!Instance.IsPlayerValid(attacker) || !IsActiveJester(attacker!.Index)) return false;
|
||||
}
|
||||
|
||||
if (IsActiveJester(victim!.Index) || IsActiveJester(attacker!.Index))
|
||||
{
|
||||
SkillUtils.RestoreHealth(victim);
|
||||
RestoreArmor(victim, @event.DmgArmor);
|
||||
}
|
||||
SkillUtils.RestoreHealth(victim);
|
||||
return true;
|
||||
}
|
||||
|
||||
public static bool IsActiveJester(uint playerIndex)
|
||||
|
|
@ -150,17 +141,6 @@ namespace src.player.skills
|
|||
return PlayerManager.GetPlayerByIndex(playerIndex)?.Skill == skillName;
|
||||
}
|
||||
|
||||
private static void RestoreArmor(CCSPlayerController? victim, int dmgArmor)
|
||||
{
|
||||
if (victim == null || !victim.IsValid || dmgArmor <= 0) return;
|
||||
|
||||
var pawn = victim.PlayerPawn?.Value;
|
||||
if (pawn == null || !pawn.IsValid) return;
|
||||
|
||||
pawn.ArmorValue += dmgArmor;
|
||||
Utilities.SetStateChanged(pawn, "CCSPlayerPawn", "m_ArmorValue");
|
||||
}
|
||||
|
||||
public static void EnableSkill(CCSPlayerController player)
|
||||
{
|
||||
var minTime = SkillsInfo.GetValue<float>(skillName, "minTime");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue