Chaplain stuff (#98)
* - add: Null rod. * - add: Only chaplain can use holy weapons. * - add: Chaplain is cult immune. * - fix: Fix component granting. * - add: Only chaplain can use null rod. * - add: Armaments beacon. * - add: Chaplain playtime requirement.
This commit is contained in:
@@ -93,3 +93,8 @@ public record struct GetMeleeAttackRateEvent(EntityUid Weapon, float Rate, float
|
||||
/// </summary>
|
||||
[ByRefEvent]
|
||||
public record struct GetHeavyDamageModifierEvent(EntityUid Weapon, FixedPoint2 DamageModifier, float Multipliers, EntityUid User);
|
||||
|
||||
// WD START
|
||||
[ByRefEvent]
|
||||
public record struct MeleeBlockAttemptEvent(EntityUid Attacker, bool Blocked = false);
|
||||
// WD END
|
||||
|
||||
@@ -60,10 +60,14 @@ public sealed partial class MeleeWeaponComponent : Component
|
||||
[ViewVariables(VVAccess.ReadWrite), AutoNetworkedField]
|
||||
public bool Attacking = false;
|
||||
|
||||
// WD
|
||||
// WD START
|
||||
[ViewVariables(VVAccess.ReadWrite), DataField]
|
||||
public bool CanHeavyAttack = true;
|
||||
|
||||
[ViewVariables(VVAccess.ReadWrite), DataField]
|
||||
public bool IgnoreResistances;
|
||||
// WD END
|
||||
|
||||
/// <summary>
|
||||
/// If true, attacks will be repeated automatically without requiring the mouse button to be lifted.
|
||||
/// </summary>
|
||||
|
||||
@@ -22,6 +22,7 @@ using Content.Shared.Weapons.Ranged.Components;
|
||||
using Content.Shared.Weapons.Ranged.Events;
|
||||
using Content.Shared.Weapons.Ranged.Systems;
|
||||
using Content.Shared._White;
|
||||
using Content.Shared._White.Chaplain;
|
||||
using Robust.Shared.Audio;
|
||||
using Robust.Shared.Audio.Systems;
|
||||
using Robust.Shared.Configuration;
|
||||
@@ -500,6 +501,13 @@ public abstract class SharedMeleeWeaponSystem : EntitySystem
|
||||
if (hitEvent.Handled)
|
||||
return;
|
||||
|
||||
// WD START
|
||||
var blockEvent = new MeleeBlockAttemptEvent(user);
|
||||
RaiseLocalEvent(target.Value, ref blockEvent);
|
||||
if (blockEvent.Blocked)
|
||||
return;
|
||||
// WD END
|
||||
|
||||
var targets = new List<EntityUid>(1)
|
||||
{
|
||||
target.Value
|
||||
@@ -519,7 +527,7 @@ public abstract class SharedMeleeWeaponSystem : EntitySystem
|
||||
RaiseLocalEvent(target.Value, attackedEvent);
|
||||
|
||||
var modifiedDamage = DamageSpecifier.ApplyModifierSets(damage + hitEvent.BonusDamage + attackedEvent.BonusDamage, hitEvent.ModifiersList);
|
||||
var damageResult = Damageable.TryChangeDamage(target, modifiedDamage, origin:user);
|
||||
var damageResult = Damageable.TryChangeDamage(target, modifiedDamage, component.IgnoreResistances, origin:user); // WD EDIT
|
||||
|
||||
if (damageResult != null && damageResult.Any())
|
||||
{
|
||||
@@ -658,11 +666,18 @@ public abstract class SharedMeleeWeaponSystem : EntitySystem
|
||||
if (!Blocker.CanAttack(user, entity, (weapon, component)))
|
||||
continue;
|
||||
|
||||
// WD START
|
||||
var blockEvent = new MeleeBlockAttemptEvent(user);
|
||||
RaiseLocalEvent(entity, ref blockEvent);
|
||||
if (blockEvent.Blocked)
|
||||
continue;
|
||||
// WD END
|
||||
|
||||
var attackedEvent = new AttackedEvent(meleeUid, user, GetCoordinates(ev.Coordinates));
|
||||
RaiseLocalEvent(entity, attackedEvent);
|
||||
var modifiedDamage = DamageSpecifier.ApplyModifierSets(damage + hitEvent.BonusDamage + attackedEvent.BonusDamage, hitEvent.ModifiersList);
|
||||
|
||||
var damageResult = Damageable.TryChangeDamage(entity, modifiedDamage, origin:user);
|
||||
var damageResult = Damageable.TryChangeDamage(entity, modifiedDamage, component.IgnoreResistances, origin:user); // WD EDIT
|
||||
|
||||
if (damageResult != null && damageResult.GetTotal() > FixedPoint2.Zero)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user