2023-08-25 18:50:46 +10:00
using Content.Shared.Actions ;
using Robust.Shared.GameStates ;
2023-09-08 18:16:05 -07:00
using Robust.Shared.Prototypes ;
2023-08-25 18:50:46 +10:00
namespace Content.Shared.Ghost ;
[RegisterComponent, NetworkedComponent, Access(typeof(SharedGhostSystem))]
2023-09-10 21:36:26 -07:00
[AutoGenerateComponentState(true)]
2023-08-25 18:50:46 +10:00
public sealed partial class GhostComponent : Component
{
2023-09-24 13:34:08 -07:00
// Actions
[DataField]
public EntProtoId ToggleLightingAction = "ActionToggleLighting" ;
2023-09-08 18:16:05 -07:00
2023-09-23 04:49:39 -04:00
[DataField, AutoNetworkedField]
2023-09-08 18:16:05 -07:00
public EntityUid ? ToggleLightingActionEntity ;
2023-09-24 13:34:08 -07:00
[DataField]
public EntProtoId ToggleFoVAction = "ActionToggleFov" ;
2023-09-08 18:16:05 -07:00
2023-09-23 04:49:39 -04:00
[DataField, AutoNetworkedField]
2023-09-08 18:16:05 -07:00
public EntityUid ? ToggleFoVActionEntity ;
2023-09-24 13:34:08 -07:00
[DataField]
public EntProtoId ToggleGhostsAction = "ActionToggleGhosts" ;
2023-09-08 18:16:05 -07:00
2023-09-23 04:49:39 -04:00
[DataField, AutoNetworkedField]
2023-09-08 18:16:05 -07:00
public EntityUid ? ToggleGhostsActionEntity ;
2023-08-25 18:50:46 +10:00
2023-09-24 13:34:08 -07:00
[DataField]
public EntProtoId ToggleGhostHearingAction = "ActionToggleGhostHearing" ;
2023-08-25 18:50:46 +10:00
2023-09-24 13:34:08 -07:00
[DataField]
public EntityUid ? ToggleGhostHearingActionEntity ;
2023-08-25 18:50:46 +10:00
2023-09-23 04:49:39 -04:00
[DataField]
public EntProtoId BooAction = "ActionGhostBoo" ;
2023-09-08 18:16:05 -07:00
2023-09-23 04:49:39 -04:00
[DataField, AutoNetworkedField]
public EntityUid ? BooActionEntity ;
2023-08-25 18:50:46 +10:00
2023-09-24 13:34:08 -07:00
// End actions
[ViewVariables(VVAccess.ReadWrite), DataField]
public TimeSpan TimeOfDeath = TimeSpan . Zero ;
2023-11-19 15:17:53 -05:00
[DataField("booRadius"), ViewVariables(VVAccess.ReadWrite)]
2023-09-24 13:34:08 -07:00
public float BooRadius = 3 ;
2023-11-19 15:17:53 -05:00
[DataField("booMaxTargets"), ViewVariables(VVAccess.ReadWrite)]
2023-09-24 13:34:08 -07:00
public int BooMaxTargets = 3 ;
2023-08-25 18:50:46 +10:00
// TODO: instead of this funny stuff just give it access and update in system dirtying when needed
[ViewVariables(VVAccess.ReadWrite)]
public bool CanGhostInteract
{
get = > _canGhostInteract ;
set
{
if ( _canGhostInteract = = value ) return ;
_canGhostInteract = value ;
Dirty ( ) ;
}
}
[DataField("canInteract"), AutoNetworkedField]
private bool _canGhostInteract ;
/// <summary>
/// Changed by <see cref="SharedGhostSystem.SetCanReturnToBody"/>
/// </summary>
// TODO MIRROR change this to use friend classes when thats merged
[ViewVariables(VVAccess.ReadWrite)]
public bool CanReturnToBody
{
get = > _canReturnToBody ;
set
{
if ( _canReturnToBody = = value ) return ;
_canReturnToBody = value ;
Dirty ( ) ;
}
}
/// <summary>
/// Ghost color
/// </summary>
/// <remarks>Used to allow admins to change ghost colors. Should be removed if the capability to edit existing sprite colors is ever added back.</remarks>
2023-09-10 21:36:26 -07:00
[DataField("color"), ViewVariables(VVAccess.ReadWrite), AutoNetworkedField]
2023-08-25 18:50:46 +10:00
public Color color = Color . White ;
[DataField("canReturnToBody"), AutoNetworkedField]
private bool _canReturnToBody ;
}
2023-09-24 13:34:08 -07:00
public sealed partial class ToggleFoVActionEvent : InstantActionEvent { }
2023-08-25 18:50:46 +10:00
2023-09-24 13:34:08 -07:00
public sealed partial class ToggleGhostsActionEvent : InstantActionEvent { }
2023-08-25 18:50:46 +10:00
2023-09-24 13:34:08 -07:00
public sealed partial class ToggleLightingActionEvent : InstantActionEvent { }
2023-08-25 18:50:46 +10:00
2023-09-24 13:34:08 -07:00
public sealed partial class ToggleGhostHearingActionEvent : InstantActionEvent { }
Magic Refactor + Wizard Grimoire (#22568)
* Brings over changes from the original magic refactor PR
* Adds Master Spellbook, spellbook categories, WizCoin currency, and locale
* Wiz€oin™
* Adds currency whitelist to Spellbook preset, grants contained actions on action added.
* Adds grant contained action and remove provided action.
* adds a way for actions to be upgraded to the store
* Adds Fireball 3 and fixes action upgrade logic so that it checks if the action can level or if the action can upgrade separately
* Fixes upgrade logic in ActionUpgradeSystem to allow for level ups without an actual upgrade. Fixed action upgrade logic in store system as well
* Removes current action entity from the bought entities list and adds new or old action entity
* Removes Current Entity
* Removes old comments, fixes TransferAllActionsWithNewAttached
* Removes TODO
* Removes Product Action Upgrade Event
* reverts changes to immovablerodrule
* Removes stale event reference
* fixes mind action grant logic
* reverts shared gun system change to projectile anomaly system
* forgor to remove the using
* Reverts unintended changes to action container
* Adds refund button to the store
* Refreshes store back to origin.
* Refund with correct currency
* Init refund
* Check for terminating and update interface
* Disables refund button
* Removes preset allow refund
* dont refund if map changed
* adds refunds to stores
* Adds method to check for starting map
* comments, datafields, some requested changes
* turns event into ref event
* Adds datafields
* Switches to entity terminating event
* Changes store entity to be nullable and checks if store is terminating to remove reference.
* Tryadd instead of containskey
* Adds a refund disable method, disables refund on bought ent container changes if not an action
* Removes duplicate refundcomp
* Removes unintended merges
* Removed another unintended change from merge
* removes extra using statement
* readds using statement
* might as well just remove both usings since it won't leave the PR
* Fixes Action upgrades from stores
* Changes to non obsolete method uses
* Shares spawn code between instant and world
* Adds action entity to action event, adds beforecastspellevent, adds spell requirements to magic component
* puts prereq check in spell methods, sets up template code for before cast event
* checks for required wizard clothes
* Networks Magic Comp and Wizard Clothes Comp. Renames MagicSpawnData to MagicInstantSpawnData.
* Removes posdata from projectiles
* Speech > RequiresSpeech
* Fixes ActionOnInteract
* checks for muted
* popup for missing reqs
* Validate click loc for blink spell
* Checks if doors are in range and not obstructed before opening
* Check ents by map coords
* Adds speak event
* Comments spellbooks
* Removes comments
* Unobsoletes smite spell
* Invert if
* Requirements loc
* Fixes spell reqs
* Inverts an if
* Comment updates
* Starts doafter work
* Removes doafter references
* Balances fireball upgrades to be more reasonable
* Enables refund on master spellbooks
* Spells to do
* update spellbook doafter
* knock toggles bolts
* Touch Spell comments
* Comments for pending spells
* more comments
* adds spider polymorph to spellbook
* TODOs for spells
* reorganizes spellbook categories and adds wands
* fixes spacing and adds limited conditions
* commented owner only for future store PR
* reenables owner only for the grimoire
* fixes grimoire sprite
* Adds wizard rod polymorph
* summon ghosts event
* Moves rod form to offensive category
* Adds charge spell and loc for rod polymorph
* Oops forgor the actual chages
* Item Recall comment
* Fixes UI
* removes extra field for wizard rod
* Cleanup
* New Condition (INCOMPLETE)
* Fix linter
* Fix linter (for real)
* fixed some descriptions
* adds regions to magic
* Adds a non-refund wizard grimoire, fixes blink to deselect after teleporting, reduces force wall despawn time to 12 seconds
* removes limited upgrade condition
---------
Co-authored-by: AJCM <AJCM@tutanota.com>
2024-05-11 19:06:49 -04:00
public sealed partial class ToggleGhostVisibilityToAllEvent : InstantActionEvent { }
2023-09-24 13:34:08 -07:00
public sealed partial class BooActionEvent : InstantActionEvent { }