Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
PuroSlavKing committed Dec 24, 2024
1 parent 50e0a8c commit ef5c81d
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 34 deletions.
8 changes: 4 additions & 4 deletions Content.Server/_White/Headcrab/HeadcrabComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@ public sealed partial class HeadcrabComponent : Component
[DataField("paralyzeTime"), ViewVariables(VVAccess.ReadWrite)]
public float ParalyzeTime = 3f;

[DataField("chansePounce"), ViewVariables(VVAccess.ReadWrite)]
public int ChansePounce = 33;
[DataField("chancePounce"), ViewVariables(VVAccess.ReadWrite)]
public int ChancePounce = 33;

[DataField("damage", required: true)]
[ViewVariables(VVAccess.ReadWrite)]
public DamageSpecifier Damage = default!;

public bool IsDeath = false;
public bool IsDead = false;

public EntityUid EquipedOn;
public EntityUid EquippedOn;

[ViewVariables] public float Accumulator = 0;

Expand Down
24 changes: 12 additions & 12 deletions Content.Server/_White/Headcrab/HeadcrabSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ private void OnStartup(EntityUid uid, HeadcrabComponent component, ComponentStar

private void OnHeadcrabDoHit(EntityUid uid, HeadcrabComponent component, ThrowDoHitEvent args)
{
if (component.IsDeath)
if (component.IsDead)
return;
if (HasComp<ZombieComponent>(args.Target))
return;
Expand All @@ -85,7 +85,7 @@ private void OnHeadcrabDoHit(EntityUid uid, HeadcrabComponent component, ThrowDo
if (!_inventory.TryEquip(args.Target, uid, "mask", true))
return;

component.EquipedOn = args.Target;
component.EquippedOn = args.Target;

_popup.PopupEntity(Loc.GetString("headcrab-hit-entity-head"),
args.Target, args.Target, PopupType.LargeCaution);
Expand All @@ -106,7 +106,7 @@ private void OnGotEquipped(EntityUid uid, HeadcrabComponent component, GotEquipp
{
if (args.Slot != "mask")
return;
component.EquipedOn = args.Equipee;
component.EquippedOn = args.Equipee;
EnsureComp<PacifiedComponent>(uid);
_npcFaction.AddFaction(uid, "Zombie");
}
Expand All @@ -115,7 +115,7 @@ private void OnUnequipAttempt(EntityUid uid, HeadcrabComponent component, BeingU
{
if (args.Slot != "mask")
return;
if (component.EquipedOn != args.Unequipee)
if (component.EquippedOn != args.Unequipee)
return;
if (HasComp<ZombieComponent>(args.Unequipee))
return;
Expand All @@ -128,7 +128,7 @@ private void OnGotEquippedHand(EntityUid uid, HeadcrabComponent component, GotEq
{
if (HasComp<ZombieComponent>(args.User))
return;
if (component.IsDeath)
if (component.IsDead)
return;
// _handsSystem.TryDrop(args.User, uid, checkActionBlocker: false);
_damageableSystem.TryChangeDamage(args.User, component.Damage);
Expand All @@ -140,7 +140,7 @@ private void OnGotUnequipped(EntityUid uid, HeadcrabComponent component, GotUneq
{
if (args.Slot != "mask")
return;
component.EquipedOn = EntityUid.Invalid;
component.EquippedOn = EntityUid.Invalid;
RemCompDeferred<PacifiedComponent>(uid);
var combatMode = EnsureComp<CombatModeComponent>(uid);
_combat.SetInCombatMode(uid, true, combatMode);
Expand Down Expand Up @@ -170,15 +170,15 @@ private void OnMeleeHit(EntityUid uid, HeadcrabComponent component, MeleeHitEven
if (HasComp<IngestionBlockerComponent>(headItem))
return;

var shouldEquip = _random.Next(1, 101) <= component.ChansePounce;
var shouldEquip = _random.Next(1, 101) <= component.ChancePounce;
if (!shouldEquip)
return;

var equipped = _inventory.TryEquip(entity, uid, "mask", true);
if (!equipped)
return;

component.EquipedOn = entity;
component.EquippedOn = entity;

_popup.PopupEntity(Loc.GetString("headcrab-eat-entity-face"),
entity, entity, PopupType.LargeCaution);
Expand All @@ -200,7 +200,7 @@ private static void OnMobStateChanged(EntityUid uid, HeadcrabComponent component
{
if (args.NewMobState == MobState.Dead)
{
component.IsDeath = true;
component.IsDead = true;
}
}
private void OnJump(EntityUid uid, HeadcrabComponent component, JumpActionEvent args)
Expand Down Expand Up @@ -233,16 +233,16 @@ public override void Update(float frameTime)

comp.Accumulator = 0;

if (comp.EquipedOn is not { Valid: true } targetId)
if (comp.EquippedOn is not { Valid: true } targetId)
continue;
if (HasComp<ZombieComponent>(comp.EquipedOn))
if (HasComp<ZombieComponent>(comp.EquippedOn))
return;
if (TryComp(targetId, out MobStateComponent? mobState))
{
if (mobState.CurrentState is not MobState.Alive)
{
_inventory.TryUnequip(targetId, "mask", true, true);
comp.EquipedOn = EntityUid.Invalid;
comp.EquippedOn = EntityUid.Invalid;
return;
}
}
Expand Down
26 changes: 13 additions & 13 deletions Resources/Prototypes/_White/Entities/Mobs/NPCs/headcrab.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
50: Dead
- type: Headcrab
paralyzeTime: 3
chansePounce: 33
chancePounce: 33
damage:
types:
Piercing: 2
Expand Down Expand Up @@ -98,9 +98,9 @@
- Hissing
- Draconic
- TauCetiBasic
# - type: GuideHelp
# guides:
# - Headcrabs
- type: GuideHelp
guides:
- Headcrabs

# HEADCRABS

Expand All @@ -112,9 +112,9 @@
sprite: _White/Mobs/Animals/headcrab.rsi
- type: Clothing
sprite: _White/Mobs/Animals/headcrab.rsi
# - type: GuideHelp
# guides:
# - Headcrab
- type: GuideHelp
guides:
- Headcrab

- type: entity
parent: BaseMobHeadcrab
Expand All @@ -128,9 +128,9 @@
- type: MovementSpeedModifier
baseWalkSpeed: 3.2
baseSprintSpeed: 4.2
# - type: GuideHelp
# guides:
# - HeadcrabFast
- type: GuideHelp
guides:
- HeadcrabFast

- type: entity
parent: BaseMobHeadcrab
Expand All @@ -152,6 +152,6 @@
- type: MovementSpeedModifier
baseWalkSpeed: 2.6
baseSprintSpeed: 3.6
# - type: GuideHelp
# guides:
# - HeadcrabPoison
- type: GuideHelp
guides:
- HeadcrabPoison
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
thresholds:
- trigger:
!type:DamageTrigger
damage: 180
damage: 250
behaviors:
- !type:PlaySoundBehavior
sound:
Expand All @@ -45,7 +45,7 @@
- MobHeadcrabPoison
intervalSeconds: 60
minimumEntitiesSpawned: 1
maximumEntitiesSpawned: 1
# - type: GuideHelp
# guides:
# - Headcrabs
maximumEntitiesSpawned: 2
- type: GuideHelp
guides:
- Headcrabs

0 comments on commit ef5c81d

Please sign in to comment.