Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PenPlus 🖊️ (Fixed for newest update) #134

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Content.Server/Explosion/EntitySystems/TriggerSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ private void HandleExplodeTrigger(EntityUid uid, ExplodeOnTriggerComponent compo
private void HandleFlashTrigger(EntityUid uid, FlashOnTriggerComponent component, TriggerEvent args)
{
// TODO Make flash durations sane ffs.
_flashSystem.FlashArea(uid, args.User, component.Range, component.Duration * 1000f);
_flashSystem.FlashArea(uid, args.User, force: false, component.Range, component.Duration * 1000f);
args.Handled = true;
}

Expand Down
21 changes: 12 additions & 9 deletions Content.Server/Flash/FlashSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ private void OnFlashMeleeHit(EntityUid uid, FlashComponent comp, MeleeHitEvent a
args.Handled = true;
foreach (var e in args.HitEntities)
{
Flash(e, args.User, uid, comp.FlashDuration, comp.SlowTo, melee: true);
Flash(e, args.User, comp.ForceFlash, uid, comp.FlashDuration, comp.SlowTo, melee: true);
}
}

Expand All @@ -73,7 +73,7 @@ private void OnFlashUseInHand(EntityUid uid, FlashComponent comp, UseInHandEvent
return;

args.Handled = true;
FlashArea(uid, args.User, comp.Range, comp.AoeFlashDuration, comp.SlowTo, true);
FlashArea(uid, args.User, comp.ForceFlash, comp.Range, comp.AoeFlashDuration, comp.SlowTo, true);
}

private bool UseFlash(EntityUid uid, FlashComponent comp, EntityUid user)
Expand Down Expand Up @@ -108,6 +108,7 @@ private bool UseFlash(EntityUid uid, FlashComponent comp, EntityUid user)

public void Flash(EntityUid target,
EntityUid? user,
bool force,
EntityUid? used,
float flashDuration,
float slowTo,
Expand All @@ -118,11 +119,13 @@ public void Flash(EntityUid target,
if (!Resolve(target, ref flashable, false))
return;

var attempt = new FlashAttemptEvent(target, user, used);
RaiseLocalEvent(target, attempt, true);

if (attempt.Cancelled)
return;
if (!force)
{
var attempt = new FlashAttemptEvent(target, user, used);
RaiseLocalEvent(target, attempt, true);
if (attempt.Cancelled)
return;
}

if (melee)
{
Expand All @@ -148,7 +151,7 @@ public void Flash(EntityUid target,

}

public void FlashArea(EntityUid source, EntityUid? user, float range, float duration, float slowTo = 0.8f, bool displayPopup = false, SoundSpecifier? sound = null)
public void FlashArea(EntityUid source, EntityUid? user, bool force, float range, float duration, float slowTo = 0.8f, bool displayPopup = false, SoundSpecifier? sound = null)
{
var transform = EntityManager.GetComponent<TransformComponent>(source);
var mapPosition = _transform.GetMapCoordinates(transform);
Expand All @@ -165,7 +168,7 @@ public void FlashArea(EntityUid source, EntityUid? user, float range, float dura
continue;

// They shouldn't have flash removed in between right?
Flash(entity, user, source, duration, slowTo, displayPopup, flashableQuery.GetComponent(entity));
Flash(entity, user, force, source, duration, slowTo, displayPopup, flashableQuery.GetComponent(entity));
}

if (sound != null)
Expand Down
4 changes: 4 additions & 0 deletions Content.Shared/Flash/Components/FlashComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ public sealed partial class FlashComponent : Component
[ViewVariables(VVAccess.ReadWrite)]
public float Range { get; set; } = 7f;

[DataField("forceFlash")]
[ViewVariables(VVAccess.ReadWrite)]
public bool ForceFlash { get; set; } = false;

[ViewVariables(VVAccess.ReadWrite)]
[DataField("aoeFlashDuration")]
public int AoeFlashDuration { get; set; } = 2000;
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
pen-gets-small-damage = Ручка дрожит от удара!
pen-gets-medium-damage = Конструкция ручки издаёт громкий стук!
pen-gets-heavy-damage = Элементы ручки чуть ли не отваливаются!
pen-becomes-broken = Детали ручки ломаются из-за удара о поверхность!
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
- type: constructionGraph
id: JanBeacon
start: unpack
graph:
- node: unpack
edges:
- to: pack
steps:
- tool: JanitorKey
completed:
- !type:SpawnPrototype
prototype: JanBeaconClosed
amount: 1
- !type:DeleteEntity

- node: pack
entity: JanBeacon
edges:
- to: unpack
steps:
- tool: JanitorKey
completed:
- !type:SpawnPrototype
prototype: JanBeacon
amount: 1
- !type:DeleteEntity

Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
- type: entity
name: ручка капитана
parent: PenBaseNoThrow
suffix: Андромеда
id: CapPen
description: 'Шикарная перьевая ручка капитана. Имеет экстренную кнопку сигнализации, которая звучит так громко, что способна оглушить любого, кто её услышит, даже самого капитана.'
components:
- type: Sprite
sprite: Andromeda/Valikzant/Penplus/cappen.rsi
state: cappen
- type: Item
sprite: Andromeda/Valikzant/Penplus/cappen.rsi
heldPrefix: pen
- type: Flash
forceFlash: true
sound:
path: /Audio/Andromeda/Valikzant/Penplus/pen_signal.ogg
params:
volume: 2
- type: UseDelay
delay: 120 # Чтобы не флудили кнопкой
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
- type: entity
name: ручка старшего инженера
parent: BaseItem
suffix: Андромеда
id: CeScrewFlashPen
description: 'Удобная ручка с отвёрткой и встроенным маломощным фонариком.'
components:
- type: Tag
tags:
- Flashlight
- Write
- type: EmitSoundOnLand
sound:
path: /Audio/Andromeda/Valikzant/Penplus/pen_fall.ogg
params:
volume: -4
- type: MeleeWeapon
wideAnimationRotation: 90
attackRate: 1
damage:
types:
Piercing: 10
soundHit:
path: "/Audio/Weapons/bladeslice.ogg"
- type: HandheldLight
addPrefix: false
- type: PointLight
enabled: false
mask: /Textures/Effects/LightMasks/cone.png
autoRot: true
radius: 3
netsync: false
- type: Sprite
sprite: Andromeda/Valikzant/Penplus/cepen.rsi
layers:
- state: cepen
- state: cepen-overlay
shader: unshaded
visible: false
map: [ "light" ]
- type: EmbeddableProjectile
offset: 0.3,0.0
removalTime: 0.0
- type: ThrowingAngle
angle: 135
- type: DamageOtherOnHit
damage:
types:
Piercing: 8
- type: Appearance
- type: ToggleableLightVisuals
spriteLayer: light
inhandVisuals:
left:
- state: inhand-left-light
shader: unshaded
right:
- state: inhand-right-light
shader: unshaded
- type: PowerCellSlot
cellSlotId: cell_slot
- type: ContainerContainer
containers:
cell_slot: !type:ContainerSlot
- type: ItemSlots
slots:
cell_slot:
name: power-cell-slot-component-slot-name-default
startingItem: PowerCellMicroreactor
- type: Tool
qualities:
- Screwing
useSound:
collection: Screwdriver
- type: Item
size: Tiny
- type: GuideHelp
guides:
- Engineering
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
- type: entity
name: ручка главного врача
id: CmSprayPen
parent: BaseItem
suffix: Андромеда
description: 'Оснащена распылителем для равномерного нанесения препаратов. "Не оказывать сильное давление" - надпись рядом с пером.'
components:
- type: Tag
tags:
- Spray
- Write
- type: EmitSoundOnLand
sound:
path: /Audio/Andromeda/Valikzant/Penplus/pen_fall.ogg
params:
volume: -4
- type: MeleeWeapon
wideAnimationRotation: 90
attackRate: 1
damage:
types:
Blunt: 5
- type: Sprite
sprite: Andromeda/Valikzant/Penplus/cmpen.rsi
state: pencm
- type: Item
sprite: Andromeda/Valikzant/Penplus/cmpen.rsi
heldPrefix: pencm
size: Tiny
- type: SolutionContainerManager
solutions:
spray:
maxVol: 30
- type: MeleeChemicalInjector
solution: spray
- type: InjectableSolution
solution: spray
- type: RefillableSolution
solution: spray
- type: DrainableSolution
solution: spray
- type: SolutionTransfer
maxTransferAmount: 30
- type: SolutionInjectOnCollide
transferAmount: 15
blockSlots: NONE
- type: UseDelay
- type: Spray
transferAmount: 2
sprayVelocity: 5
spraySound:
path: /Audio/Effects/spray2.ogg
params:
volume: -5
- type: EmbeddableProjectile
offset: 0.3,0.0
removalTime: 0.0
- type: ThrowingAngle
angle: 315
- type: DamageOtherOnHit
damage:
types:
Piercing: 5
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
- type: entity
name: ручка главы персонала
parent: PenBaseDefault
suffix: Андромеда
id: HopPen
description: 'Шикарная перьевая ручка для любителя бюрократии. Имеет держатель для печатей.'
components:
- type: Sprite
sprite: Andromeda/Valikzant/Penplus/hoppen.rsi
layers:
- state: hoppen
- type: Item
sprite: Andromeda/Valikzant/Penplus/hoppen.rsi
heldPrefix: hoppen
- type: ItemSlots
slots:
stamp:
whitelist:
tags:
- RubberStampBase
insertOnInteract: true
- type: Appearance
- type: ItemMapper
mapLayers:
penstamp:
whitelist:
tags:
- RubberStampBase
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
- type: entity
name: ручка главы службы безопасности
parent: BaseItem
suffix: Андромеда
id: HosStunPen
description: 'Грозная ручка главы службы безопасности. В разложенном виде позволяет легко смотреть оставшиеся чернила, а также бить убегающих преступников.'
components:
- type: Tag
tags:
- Write
- type: EmitSoundOnLand
sound:
path: /Audio/Andromeda/Valikzant/Penplus/pen_fall.ogg
params:
volume: -4
- type: Stunbaton
secret: true
energyPerUse: 10
- type: StaminaDamageOnHit
damage: 35
sound: /Audio/Weapons/egloves.ogg
- type: StaminaDamageOnCollide
damage: 35
sound: /Audio/Weapons/egloves.ogg
- type: ItemToggle
predictable: false
soundActivate:
collection: StunPenActivation
params:
volume: -3
variation: 0.1
soundDeactivate:
collection: StunPenDeactivation
params:
volume: -3
variation: 0.1
soundFailToActivate:
collection: StunPenFalied
params:
volume: -3
variation: 0.250
- type: ItemToggleMeleeWeapon
activatedDamage:
types:
Blunt: 0
- type: MeleeWeapon
attackRate: 1.5
wideAnimationRotation: -200
damage:
types:
Blunt: 10
animation: WeaponArcSlash
- type: Sprite
sprite: Andromeda/Valikzant/Penplus/hospen.rsi
layers:
- state: pen-off
map: [ "enum.ToggleVisuals.Layer" ]
- type: Item
heldPrefix: off
size: Tiny
- type: Battery
maxCharge: 50
startingCharge: 50
- type: EmbeddableProjectile
offset: 0.3,0.0
removalTime: 0.0
- type: ThrowingAngle
angle: 315
- type: DamageOtherOnHit
damage:
types:
Piercing: 5
- type: Appearance
- type: GenericVisualizer
visuals:
enum.ToggleVisuals.Toggled:
enum.ToggleVisuals.Layer:
True: {state: pen-on}
False: {state: pen-off}
- type: GuideHelp
guides:
- Security
Loading
Loading