mirror of
https://github.com/wega-team/ss14-wega.git
synced 2026-06-09 10:06:49 +02:00
Культ крови и его ручные заклинания (#411)
* da
* Revert "da"
This reverts commit fb9b5ef577.
* additional method
* meow
* Update bloodcultist.yml
This commit is contained in:
@@ -37,6 +37,8 @@ using Content.Shared.Standing;
|
||||
using Content.Shared.StatusEffectNew;
|
||||
using Content.Shared.Stunnable;
|
||||
using Content.Shared.Timing;
|
||||
using Content.Shared.Hands.Components;
|
||||
using Content.Shared.Examine;
|
||||
using Robust.Server.GameObjects;
|
||||
using Robust.Shared.Audio;
|
||||
using Robust.Shared.Containers;
|
||||
@@ -46,7 +48,6 @@ using Robust.Shared.Physics.Systems;
|
||||
using Robust.Shared.Player;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Random;
|
||||
using Content.Shared.Examine;
|
||||
|
||||
namespace Content.Server.Blood.Cult;
|
||||
|
||||
@@ -186,28 +187,20 @@ public sealed partial class BloodCultSystem
|
||||
|
||||
private void OnStun(EntityUid cultist, BloodCultistComponent component, BloodCultStunActionEvent args)
|
||||
{
|
||||
var spellGear = new ProtoId<StartingGearPrototype>("BloodCultSpellStunGear");
|
||||
|
||||
var dropEvent = new DropHandItemsEvent();
|
||||
RaiseLocalEvent(cultist, ref dropEvent);
|
||||
List<ProtoId<StartingGearPrototype>> gear = new() { spellGear };
|
||||
_loadout.Equip(cultist, gear, null);
|
||||
|
||||
args.Handled = true;
|
||||
EmpoweringCheck(args.Action, component);
|
||||
if (TrySpawnSpellInHand(cultist, "BloodCultSpellStun"))
|
||||
{
|
||||
args.Handled = true;
|
||||
EmpoweringCheck(args.Action, component);
|
||||
}
|
||||
}
|
||||
|
||||
private void OnTeleport(EntityUid cultist, BloodCultistComponent component, BloodCultTeleportActionEvent args)
|
||||
{
|
||||
var spellGear = new ProtoId<StartingGearPrototype>("BloodCultSpellTeleportGear");
|
||||
|
||||
var dropEvent = new DropHandItemsEvent();
|
||||
RaiseLocalEvent(cultist, ref dropEvent);
|
||||
List<ProtoId<StartingGearPrototype>> gear = new() { spellGear };
|
||||
_loadout.Equip(cultist, gear, null);
|
||||
|
||||
args.Handled = true;
|
||||
EmpoweringCheck(args.Action, component);
|
||||
if (TrySpawnSpellInHand(cultist, "BloodCultSpellTeleport"))
|
||||
{
|
||||
args.Handled = true;
|
||||
EmpoweringCheck(args.Action, component);
|
||||
}
|
||||
}
|
||||
|
||||
private void OnElectromagneticPulse(EntityUid cultist, BloodCultistComponent component, BloodCultElectromagneticPulseActionEvent args)
|
||||
@@ -248,41 +241,29 @@ public sealed partial class BloodCultSystem
|
||||
|
||||
private void OnShadowShackles(EntityUid cultist, BloodCultistComponent component, BloodCultShadowShacklesActionEvent args)
|
||||
{
|
||||
var spellGear = new ProtoId<StartingGearPrototype>("BloodCultSpellShadowShacklesGear");
|
||||
|
||||
var dropEvent = new DropHandItemsEvent();
|
||||
RaiseLocalEvent(cultist, ref dropEvent);
|
||||
List<ProtoId<StartingGearPrototype>> gear = new() { spellGear };
|
||||
_loadout.Equip(cultist, gear, null);
|
||||
|
||||
args.Handled = true;
|
||||
EmpoweringCheck(args.Action, component);
|
||||
if (TrySpawnSpellInHand(cultist, "BloodCultSpellShadowShackles"))
|
||||
{
|
||||
args.Handled = true;
|
||||
EmpoweringCheck(args.Action, component);
|
||||
}
|
||||
}
|
||||
|
||||
private void OnTwistedConstruction(EntityUid cultist, BloodCultistComponent component, BloodCultTwistedConstructionActionEvent args)
|
||||
{
|
||||
var spellGear = new ProtoId<StartingGearPrototype>("BloodCultSpellTwistedConstructionGear");
|
||||
|
||||
var dropEvent = new DropHandItemsEvent();
|
||||
RaiseLocalEvent(cultist, ref dropEvent);
|
||||
List<ProtoId<StartingGearPrototype>> gear = new() { spellGear };
|
||||
_loadout.Equip(cultist, gear, null);
|
||||
|
||||
args.Handled = true;
|
||||
EmpoweringCheck(args.Action, component);
|
||||
if (TrySpawnSpellInHand(cultist, "BloodCultSpellTwistedConstruction"))
|
||||
{
|
||||
args.Handled = true;
|
||||
EmpoweringCheck(args.Action, component);
|
||||
}
|
||||
}
|
||||
|
||||
private void OnSummonEquipment(EntityUid cultist, BloodCultistComponent component, BloodCultSummonEquipmentActionEvent args)
|
||||
{
|
||||
var spellGear = new ProtoId<StartingGearPrototype>("BloodCultSpellSummonEquipmentGear");
|
||||
|
||||
var dropEvent = new DropHandItemsEvent();
|
||||
RaiseLocalEvent(cultist, ref dropEvent);
|
||||
List<ProtoId<StartingGearPrototype>> gear = new() { spellGear };
|
||||
_loadout.Equip(cultist, gear, null);
|
||||
|
||||
args.Handled = true;
|
||||
EmpoweringCheck(args.Action, component);
|
||||
if (TrySpawnSpellInHand(cultist, "BloodCultSpellSummonEquipment"))
|
||||
{
|
||||
args.Handled = true;
|
||||
EmpoweringCheck(args.Action, component);
|
||||
}
|
||||
}
|
||||
|
||||
private void OnSummonDagger(EntityUid cultist, BloodCultistComponent component, BloodCultSummonDaggerActionEvent args)
|
||||
@@ -398,15 +379,11 @@ public sealed partial class BloodCultSystem
|
||||
#region Blood Rites
|
||||
private void OnBloodRites(EntityUid cultist, BloodCultistComponent component, BloodCultBloodRitesActionEvent args)
|
||||
{
|
||||
var spellGear = new ProtoId<StartingGearPrototype>("BloodCultSpellBloodRitesGear");
|
||||
|
||||
var dropEvent = new DropHandItemsEvent();
|
||||
RaiseLocalEvent(cultist, ref dropEvent);
|
||||
List<ProtoId<StartingGearPrototype>> gear = new() { spellGear };
|
||||
_loadout.Equip(cultist, gear, null);
|
||||
|
||||
args.Handled = true;
|
||||
EmpoweringCheck(args.Action, component);
|
||||
if (TrySpawnSpellInHand(cultist, "BloodCultSpellBloodRites"))
|
||||
{
|
||||
args.Handled = true;
|
||||
EmpoweringCheck(args.Action, component);
|
||||
}
|
||||
}
|
||||
|
||||
private void OnExamine(EntityUid uid, BloodSpellComponent spell, ExaminedEvent args)
|
||||
@@ -603,16 +580,13 @@ public sealed partial class BloodCultSystem
|
||||
_popup.PopupEntity(Loc.GetString("blood-cult-bolt-barrage-failed"), cultist, cultist, PopupType.SmallCaution);
|
||||
return;
|
||||
}
|
||||
|
||||
var boltBarrageGear = new ProtoId<StartingGearPrototype>("BloodCultSpellBloodBarrageGear");
|
||||
var dropEvent = new DropHandItemsEvent();
|
||||
RaiseLocalEvent(cultist, ref dropEvent);
|
||||
List<ProtoId<StartingGearPrototype>> gear = new() { boltBarrageGear };
|
||||
_loadout.Equip(cultist, gear, null);
|
||||
|
||||
component.BloodCount -= 200;
|
||||
_action.RemoveAction(cultist, args.Action!);
|
||||
args.Handled = true;
|
||||
|
||||
if (TrySpawnSpellInHand(cultist, "BloodCultSpellBloodBarrage"))
|
||||
{
|
||||
component.BloodCount -= 200;
|
||||
_action.RemoveAction(cultist, args.Action!);
|
||||
args.Handled = true;
|
||||
}
|
||||
}
|
||||
#endregion Blood Rites
|
||||
#endregion Abilities
|
||||
@@ -1055,5 +1029,25 @@ public sealed partial class BloodCultSystem
|
||||
_action.RemoveAction(spell);
|
||||
}
|
||||
}
|
||||
|
||||
private bool TrySpawnSpellInHand(EntityUid uid, EntProtoId proto)
|
||||
{
|
||||
if (!TryComp<HandsComponent>(uid, out var hands))
|
||||
return false;
|
||||
|
||||
var spell = Spawn(proto, Transform(uid).Coordinates);
|
||||
var activeHand = _hands.GetActiveHand((uid, hands));
|
||||
|
||||
if (_hands.TryPickupAnyHand(uid, spell))
|
||||
return true;
|
||||
|
||||
else if (activeHand != null && _hands.TryForcePickup((uid, hands), spell, activeHand))
|
||||
return true;
|
||||
|
||||
else
|
||||
QueueDel(spell);
|
||||
return false;
|
||||
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
||||
@@ -69,37 +69,3 @@
|
||||
inhand:
|
||||
- WeaponHellDagger
|
||||
|
||||
- type: startingGear
|
||||
id: BloodCultSpellStunGear
|
||||
inhand:
|
||||
- BloodCultSpellStun
|
||||
|
||||
- type: startingGear
|
||||
id: BloodCultSpellTeleportGear
|
||||
inhand:
|
||||
- BloodCultSpellTeleport
|
||||
|
||||
- type: startingGear
|
||||
id: BloodCultSpellShadowShacklesGear
|
||||
inhand:
|
||||
- BloodCultSpellShadowShackles
|
||||
|
||||
- type: startingGear
|
||||
id: BloodCultSpellTwistedConstructionGear
|
||||
inhand:
|
||||
- BloodCultSpellTwistedConstruction
|
||||
|
||||
- type: startingGear
|
||||
id: BloodCultSpellSummonEquipmentGear
|
||||
inhand:
|
||||
- BloodCultSpellSummonEquipment
|
||||
|
||||
- type: startingGear
|
||||
id: BloodCultSpellBloodRitesGear
|
||||
inhand:
|
||||
- BloodCultSpellBloodRites
|
||||
|
||||
- type: startingGear
|
||||
id: BloodCultSpellBloodBarrageGear
|
||||
inhand:
|
||||
- BloodCultSpellBloodBarrage
|
||||
|
||||
Reference in New Issue
Block a user