* - fix: Fix teleport scroll.

* - add: Spell book.

* - add: Smite scroll & update shuttle.

* - tweak: Tweak cost.
This commit is contained in:
Aviu00
2024-06-10 10:57:32 +00:00
committed by GitHub
parent d8e71e4926
commit 01511adbb2
24 changed files with 650 additions and 328 deletions

View File

@@ -3,7 +3,7 @@
xmlns:gfx="clr-namespace:Robust.Client.Graphics;assembly=Robust.Client"
Title="{Loc 'store-ui-default-title'}"
MinSize="512 512"
SetSize="512 512">
SetSize="768 512">
<BoxContainer Orientation="Vertical">
<BoxContainer Orientation="Vertical" VerticalExpand="True">
<BoxContainer Margin="4,4,4,4" Orientation="Horizontal">

View File

@@ -1,5 +1,6 @@
using System.Linq;
using System.Numerics;
using Content.Server._White.Wizard.Magic;
using Content.Server.Body.Components;
using Content.Server.Body.Systems;
using Content.Server.Chat.Systems;
@@ -44,6 +45,7 @@ public sealed class MagicSystem : EntitySystem
[Dependency] private readonly SharedTransformSystem _transformSystem = default!;
[Dependency] private readonly SharedAudioSystem _audio = default!;
[Dependency] private readonly ChatSystem _chat = default!;
[Dependency] private readonly WizardSpellsSystem _wizardSpells = default!;
public override void Initialize()
{
@@ -157,7 +159,7 @@ public sealed class MagicSystem : EntitySystem
private void OnKnockSpell(KnockSpellEvent args)
{
if (args.Handled)
if (!_wizardSpells.CanCast(args)) // WD EDIT
return;
args.Handled = true;
@@ -180,7 +182,7 @@ public sealed class MagicSystem : EntitySystem
private void OnSmiteSpell(SmiteSpellEvent ev)
{
if (ev.Handled)
if (!_wizardSpells.CanCast(ev)) // WD EDIT
return;
ev.Handled = true;

View File

@@ -736,7 +736,7 @@ public sealed class WizardSpellsSystem : EntitySystem
RaiseLocalEvent(uid, new EnergyDomeClothesTurnOffEvent());
}
private bool CanCast(BaseActionEvent msg)
public bool CanCast(BaseActionEvent msg)
{
return !msg.Handled && CheckRequirements(msg.Action, msg.Performer) &&
!_statusEffectsSystem.HasStatusEffect(msg.Performer, "Incorporeal");

View File

@@ -1,11 +1,17 @@
using Content.Server.Pinpointer;
using Content.Server.Station.Systems;
using Content.Server.Warps;
using Content.Shared.Coordinates.Helpers;
using Content.Shared.Maps;
using Content.Shared.Physics;
namespace Content.Server._White.Wizard.Teleport;
public sealed class TeleportLocationSystem : EntitySystem
{
[Dependency] private readonly SharedTransformSystem _transformSystem = default!;
[Dependency] private readonly StationSystem _station = default!;
[Dependency] private readonly TurfSystem _turf = default!;
public override void Initialize()
{
@@ -20,10 +26,30 @@ public sealed class TeleportLocationSystem : EntitySystem
if (!TryComp(ent, out WarpPointComponent? warpPoint) || warpPoint.Location == null)
return;
var newEnt = Spawn(null, Transform(ent).Coordinates);
var xForm = EnsureComp<TransformComponent>(newEnt);
_transformSystem.AttachToGridOrMap(newEnt, xForm);
var xForm = Transform(ent);
if (!CanTeleport(ent, xForm))
return;
var newEnt = Spawn(null, xForm.Coordinates);
var newXForm = EnsureComp<TransformComponent>(newEnt);
_transformSystem.AttachToGridOrMap(newEnt, newXForm);
var location = EnsureComp<TeleportLocationComponent>(newEnt);
location.Location = warpPoint.Location;
}
public bool CanTeleport(EntityUid uid, TransformComponent xForm)
{
var station = _station.GetOwningStation(uid, xForm);
if (!HasComp<TeleportLocationTargetStationComponent>(station))
return false;
var turf = xForm.Coordinates.SnapToGrid(EntityManager).GetTileRef(EntityManager);
if (turf == null)
return false;
return !_turf.IsTileBlocked(turf.Value, CollisionGroup.Impassable);
}
}

View File

@@ -0,0 +1,6 @@
namespace Content.Server._White.Wizard.Teleport;
[RegisterComponent]
public sealed partial class TeleportLocationTargetStationComponent : Component
{
}

View File

@@ -1,7 +1,6 @@
using System.Linq;
using Content.Server.EUI;
using Content.Server.Popups;
using Content.Server.Station.Systems;
using Content.Shared._White.Wizard.Teleport;
using Content.Shared.Eui;
using Robust.Shared.Timing;
@@ -13,7 +12,7 @@ public sealed class TeleportSpellEui : BaseEui
{
[Dependency] private readonly EntityManager _entityManager = default!;
private readonly SharedTransformSystem _transformSystem;
private readonly StationSystem _station;
private readonly TeleportLocationSystem _teleportLocation;
private readonly PopupSystem _popupSystem;
private readonly EntityUid _performer;
@@ -25,7 +24,7 @@ public sealed class TeleportSpellEui : BaseEui
IoCManager.InjectDependencies(this);
_transformSystem = _entityManager.System<SharedTransformSystem>();
_station = _entityManager.System<StationSystem>();
_teleportLocation = _entityManager.System<TeleportLocationSystem>();
_popupSystem = _entityManager.System<PopupSystem>();
_performer = performer;
@@ -40,12 +39,8 @@ public sealed class TeleportSpellEui : BaseEui
while (locationQuery.MoveNext(out var locationUid, out var locationComponent, out var transformComponent))
{
var station = _station.GetOwningStation(locationUid, transformComponent);
if (_entityManager.EntityQuery<WizardRuleComponent>(true)
.Any(wizardRule => wizardRule.TargetStation == station))
{
if (_teleportLocation.CanTeleport(locationUid, transformComponent))
state.Locations.Add((int) locationUid, locationComponent.Location);
}
}
return state;

View File

@@ -14,7 +14,7 @@ public sealed partial class WizardRuleComponent : Component
{
public readonly List<EntityUid> WizardMinds = new();
[ViewVariables(VVAccess.ReadWrite)]
[ViewVariables]
public EntityUid? TargetStation;
[DataField("minPlayers")]

View File

@@ -310,7 +310,7 @@ public sealed class WizardRuleSystem : GameRuleSystem<WizardRuleComponent>
if (meta.EntityPrototype?.ID != component.SpawnPointProto.Id)
continue;
if (xform.ParentUid != component.ShuttleMap)
if (xform.MapUid != component.ShuttleMap)
continue;
spawn = xform.Coordinates;

View File

@@ -15,6 +15,7 @@ scroll-component-clown = бананы
scroll-component-silence = тишину
scroll-component-recall = призыв
scroll-component-teleport = телепортацию
scroll-component-smite = кару
ent-BaseScroll = магический свиток
.desc = Этот древний пергамент, ставший реликвией в арканных преданиях, хранит в себе бесчисленные мистические заклятия и забытые заклинания.
@@ -46,3 +47,5 @@ ent-ScrollInstantRecall = свиток мгновенного призыва
.desc = { ent-BaseScroll.desc }
ent-ScrollTeleport = свиток телепортации
.desc = { ent-BaseScroll.desc }
ent-ScrollSmite = свиток кары
.desc = { ent-BaseScroll.desc }

View File

@@ -20,3 +20,13 @@ magic-component-missing-req = Недостающие требования! Ва
ent-WizardSurviveObjective = Переживете смену, устроив как можно больше хаоса.
.desc = Федерация Космических Волшебников отправила вас на станцию Nanotrasen, чтобы навести там смуту. Не разочаруйте их.
ent-SpellBook = книга заклинаний
.desc = Неземной фолиант, излучающий силу.
store-currency-display-spell-point = Очки заклинаний
store-category-spells-attack = Атакующие заклинания
store-category-spells-defence = Защитные заклинания
store-category-spells-utility = Вспомогательные заклинания
store-category-magic-items = Магические предметы

File diff suppressed because it is too large Load Diff

View File

@@ -545,6 +545,7 @@
Slash: 0.9
Piercing: 0.9
Heat: 0.9
- type: WizardClothes
#Organic Space Suit
- type: entity

View File

@@ -703,6 +703,7 @@
useRate: 0
- type: UseDelay
delay: 10.0
- type: WizardClothes
#Ling Space Suit
- type: entity

View File

@@ -120,4 +120,10 @@
id: BaseStationAllEventsEligible
abstract: true
components:
- type: StationEventEligible # For when someone makes this more granular in the future.
- type: StationEventEligible # For when someone makes this more granular in the future.
- type: entity
id: BaseStationTeleportLocation
abstract: true
components:
- type: TeleportLocationTargetStation

View File

@@ -25,6 +25,7 @@
- BaseStationSiliconLawCrewsimov
- BaseStationAllEventsEligible
- BaseStationNanotrasen
- BaseStationTeleportLocation
noSpawn: true
components:
- type: Transform

View File

@@ -4,12 +4,11 @@
description: This spell opens nearby doors.
noSpawn: true
components:
- type: Magic
requiresClothes: false
- type: InstantAction
useDelay: 8
itemIconStyle: BigAction
checkCanInteract: false
alwaysPlaySound: false
icon:
sprite: Objects/Magic/magicactions.rsi
state: knock

View File

@@ -1,9 +1,11 @@
- type: entity
- type: entity
id: ActionSmite
name: Smite
description: Instantly gibs a target.
noSpawn: true
components:
- type: Magic
requiresClothes: true
- type: EntityTargetAction
useDelay: 60
itemIconStyle: BigAction
@@ -12,6 +14,7 @@
- Body
canTargetSelf: false
interactOnMiss: false
alwaysPlaySound: false
sound: !type:SoundPathSpecifier
path: /Audio/Magic/disintegrate.ogg
icon:

View File

@@ -217,6 +217,9 @@
noSpawn: true
components:
- type: EntityTargetAction
whitelist:
components:
- HumanoidAppearance
canTargetSelf: false
range: 3
useDelay: 60
@@ -233,6 +236,9 @@
noSpawn: true
components:
- type: EntityTargetAction
whitelist:
components:
- HumanoidAppearance
canTargetSelf: false
range: 3
useDelay: 30
@@ -249,6 +255,9 @@
noSpawn: true
components:
- type: EntityTargetAction
whitelist:
components:
- HumanoidAppearance
canTargetSelf: false
range: 3
useDelay: 30
@@ -278,8 +287,6 @@
name: Teleport
noSpawn: true
components:
- type: Magic
requiresClothes: true
- type: InstantAction
checkCanInteract: false
useDelay: 60

View File

@@ -36,7 +36,6 @@
- HolyKatana
- MultiverseBlade
- VorpalScythe
- HighFrequencyBlade
- SpellBlade
- PossessedBlade
- ChainsawHand
@@ -196,29 +195,6 @@
sprite: White/Objects/Weapons/Chaplain/scythe-inhands.rsi
- type: HolyWeapon
- type: entity
name: высокочастотный клинок
parent: HolyKatana
id: HighFrequencyBlade
description: Клинок, способный отражать выстрелы.
components:
- type: Sprite
sprite: White/Objects/Weapons/Chaplain/hfrequency.rsi
- type: MeleeWeapon
damage:
types:
Slash: 18
- type: Clothing
sprite: White/Objects/Weapons/Chaplain/hfrequency.rsi
slots:
- back
- suitStorage
- type: Reflect
reflectProb: 0.33
- type: Item
sprite: White/Objects/Weapons/Chaplain/hfrequency.rsi
- type: HolyWeapon
- type: entity
name: клинок заклинаний
parent: HolyKatana

View File

@@ -142,3 +142,12 @@
- type: Scroll
actionId: ActionTeleportSpell
learnPopup: scroll-component-teleport
- type: entity
id: ScrollSmite
parent: BaseScroll
name: "Smite scroll"
components:
- type: Scroll
actionId: ActionSmite
learnPopup: scroll-component-smite

View File

@@ -0,0 +1,23 @@
- type: entity
name: высокочастотный клинок
parent: Katana
id: HighFrequencyBlade
description: Клинок, атакующий с невероятной быстротой, а также способный отражать выстрелы.
components:
- type: Sprite
sprite: White/Objects/Weapons/Chaplain/hfrequency.rsi
- type: MeleeWeapon
autoAttack: true
attackRate: 4
damage:
types:
Slash: 10
- type: Clothing
sprite: White/Objects/Weapons/Chaplain/hfrequency.rsi
slots:
- back
- suitStorage
- type: Reflect
reflectProb: 0.4
- type: Item
sprite: White/Objects/Weapons/Chaplain/hfrequency.rsi

View File

@@ -0,0 +1,63 @@
- type: entity
id: SpellBook
parent: BaseItem
name: spell book
description: An unearthly tome that glows with power.
components:
- type: Sprite
sprite: Objects/Misc/books.rsi
layers:
- state: paper
- state: cover_old
color: "#473F40"
- state: decor_wingette
color: "#352D2F"
- state: icon_stars
color: gold
- type: UserInterface
interfaces:
- key: enum.StoreUiKey.Key
type: StoreBoundUserInterface
- type: ActivatableUI
key: enum.StoreUiKey.Key
- type: Store
preset: StorePresetSpellBook
balance:
SpellPoint: 10
- type: GiftIgnore
- type: storePreset
id: StorePresetSpellBook
storeName: Spell Book
categories:
- AttackSpells
- DefenceSpells
- UtilitySpells
- MagicItems
currencyWhitelist:
- SpellPoint
- type: currency
id: SpellPoint
displayName: store-currency-display-spell-point
canWithdraw: false
- type: storeCategory
id: AttackSpells
name: store-category-spells-attack
priority: 0
- type: storeCategory
id: DefenceSpells
name: store-category-spells-defence
priority: 1
- type: storeCategory
id: UtilitySpells
name: store-category-spells-utility
priority: 2
- type: storeCategory
id: MagicItems
name: store-category-magic-items
priority: 3

View File

@@ -0,0 +1,249 @@
- type: listing
id: SpellBookFireball
name: spellbook-fireball-name
description: spellbook-fireball-desc
icon:
sprite: Objects/Magic/magicactions.rsi
state: fireball
productEntity: ScrollFireball
cost:
SpellPoint: 2
categories:
- AttackSpells
conditions:
- !type:ListingLimitedStockCondition
stock: 1
- type: listing
id: SpellBookForcewall
name: spellbook-forcewall-name
description: spellbook-forcewall-desc
productEntity: ScrollForcewall
icon:
sprite: Objects/Magic/magicactions.rsi
state: shield
cost:
SpellPoint: 1
categories:
- DefenceSpells
conditions:
- !type:ListingLimitedStockCondition
stock: 1
- type: listing
id: SpellBookKnock
name: spellbook-knock-name
description: spellbook-knock-desc
productEntity: ScrollKnock
icon:
sprite: Objects/Magic/magicactions.rsi
state: knock
cost:
SpellPoint: 1
categories:
- UtilitySpells
conditions:
- !type:ListingLimitedStockCondition
stock: 1
- type: listing
id: SpellBookArc
name: spellbook-arc-name
description: spellbook-arc-desc
productEntity: ScrollArc
icon:
sprite: Objects/Magic/magicactions.rsi
state: thunder
cost:
SpellPoint: 2
categories:
- AttackSpells
conditions:
- !type:ListingLimitedStockCondition
stock: 1
- type: listing
id: SpellBookForce
name: spellbook-force-name
description: spellbook-force-desc
productEntity: ScrollForce
icon:
sprite: Objects/Magic/magicactions.rsi
state: push
cost:
SpellPoint: 2
categories:
- UtilitySpells
conditions:
- !type:ListingLimitedStockCondition
stock: 1
- type: listing
id: SpellBookCards
name: spellbook-cards-name
description: spellbook-cards-desc
productEntity: ScrollCards
icon:
sprite: Objects/Magic/card.rsi
state: icon
cost:
SpellPoint: 2
categories:
- AttackSpells
conditions:
- !type:ListingLimitedStockCondition
stock: 1
- type: listing
id: SpellBookBlink
name: spellbook-blink-name
description: spellbook-blink-desc
productEntity: ScrollBlink
icon:
sprite: Objects/Magic/magicactions.rsi
state: blink
cost:
SpellPoint: 1
categories:
- UtilitySpells
conditions:
- !type:ListingLimitedStockCondition
stock: 1
- type: listing
id: SpellBookEtherealJaunt
name: spellbook-jaunt-name
description: spellbook-jaunt-desc
productEntity: ScrollEtherealJaunt
icon:
sprite: Objects/Magic/magicactions.rsi
state: jaunt
cost:
SpellPoint: 2
categories:
- UtilitySpells
conditions:
- !type:ListingLimitedStockCondition
stock: 1
- type: listing
id: SpellBookEmp
name: spellbook-emp-name
description: spellbook-emp-desc
productEntity: ScrollEmp
icon:
sprite: Objects/Magic/magicactions.rsi
state: emp_new
cost:
SpellPoint: 1
categories:
- DefenceSpells
conditions:
- !type:ListingLimitedStockCondition
stock: 1
- type: listing
id: SpellBookCluwneCurse
name: spellbook-cluwne-name
description: spellbook-cluwne-desc
productEntity: ScrollCluwneCurse
icon:
sprite: Objects/Magic/magicactions.rsi
state: cluwne
cost:
SpellPoint: 2
categories:
- UtilitySpells
conditions:
- !type:ListingLimitedStockCondition
stock: 1
- type: listing
id: SpellBookBananaTouch
name: spellbook-clown-name
description: spellbook-clown-desc
productEntity: ScrollBananaTouch
icon:
sprite: Objects/Magic/magicactions.rsi
state: clown
cost:
SpellPoint: 1
categories:
- UtilitySpells
conditions:
- !type:ListingLimitedStockCondition
stock: 1
- type: listing
id: SpellBookMimeTouch
name: spellbook-mime-name
description: spellbook-mime-desc
productEntity: ScrollMimeTouch
icon:
sprite: Objects/Magic/magicactions.rsi
state: mime_curse
cost:
SpellPoint: 1
categories:
- UtilitySpells
conditions:
- !type:ListingLimitedStockCondition
stock: 1
- type: listing
id: SpellBookInstantRecall
name: spellbook-recall-name
description: spellbook-recall-desc
productEntity: ScrollInstantRecall
icon:
sprite: Objects/Magic/magicactions.rsi
state: summons
cost:
SpellPoint: 1
categories:
- UtilitySpells
conditions:
- !type:ListingLimitedStockCondition
stock: 1
- type: listing
id: SpellBookSmite
name: spellbook-smite-name
description: spellbook-smite-desc
productEntity: ScrollSmite
icon:
sprite: Objects/Magic/magicactions.rsi
state: gib
cost:
SpellPoint: 2
categories:
- AttackSpells
conditions:
- !type:ListingLimitedStockCondition
stock: 1
- type: listing
id: SpellBookHardsuit
name: spellbook-hardsuit-name
description: spellbook-hardsuit-desc
productEntity: ClothingOuterHardsuitWizard
cost:
SpellPoint: 4
categories:
- MagicItems
conditions:
- !type:ListingLimitedStockCondition
stock: 1
- type: listing
id: SpellBookHighFrequencyBlade
name: spellbook-hfrequency-name
description: spellbook-hfrequency-desc
productEntity: HighFrequencyBlade
cost:
SpellPoint: 2
categories:
- MagicItems
conditions:
- !type:ListingLimitedStockCondition
stock: 1

View File

@@ -42,6 +42,7 @@
head: ClothingHeadHatRealWizardFancy
outerClothing: ClothingOuterRealWizardFancy
shoes: ClothingShoesWizard
pocket1: SpellBook
innerClothingSkirt: ClothingUniformJumpskirtColorDarkBlue
satchel: ClothingBackpackSatchelFilled
duffelbag: ClothingBackpackDuffelFilled