Skip to content

Commit

Permalink
Merge pull request #396 from Fansana/rubyfang-oc
Browse files Browse the repository at this point in the history
Add Rubyfang OC
  • Loading branch information
FoxxoTrystan authored Dec 7, 2024
2 parents 4355f23 + 708e739 commit 0942002
Show file tree
Hide file tree
Showing 7 changed files with 211 additions and 1 deletion.
13 changes: 13 additions & 0 deletions Content.Server/Polymorph/Components/PolymorphProviderComponent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using Content.Server.Polymorph.Systems;
using Content.Shared.Polymorph;
using Robust.Shared.Prototypes;

namespace Content.Server.Polymorph.Components;

[RegisterComponent]
[Access(typeof(PolymorphSystem))]
public sealed partial class PolymorphProviderComponent : Component
{
[DataField]
public ProtoId<PolymorphPrototype> Polymorph;
}
31 changes: 31 additions & 0 deletions Content.Server/Polymorph/Systems/PolymorphSystem.Provider.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
using Content.Server.Actions;
using Content.Server.Polymorph.Components;
using Content.Shared.Actions;
using Content.Shared.Inventory.Events;
using Content.Shared.Polymorph;
using Robust.Shared.Prototypes;
using Robust.Shared.Utility;

namespace Content.Server.Polymorph.Systems;

public sealed partial class PolymorphSystem
{
private void InitializeProvider()
{
SubscribeLocalEvent<PolymorphProviderComponent, GotEquippedEvent>(OnEquipped);
SubscribeLocalEvent<PolymorphProviderComponent, GotUnequippedEvent>(OnUnEquipped);
}

private void OnUnEquipped(EntityUid uid, PolymorphProviderComponent component, ref GotUnequippedEvent args)
{
if (TryComp<PolymorphableComponent>(args.Equipee, out var polymorphable))
RemovePolymorphAction(component.Polymorph, (args.Equipee, polymorphable));
}

private void OnEquipped(EntityUid uid, PolymorphProviderComponent component, ref GotEquippedEvent args)
{
var polymorphable = EnsureComp<PolymorphableComponent>(args.Equipee);
CreatePolymorphAction(component.Polymorph, (args.Equipee, polymorphable));
}

}
6 changes: 5 additions & 1 deletion Content.Server/Polymorph/Systems/PolymorphSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ public override void Initialize()

InitializeCollide();
InitializeMap();
InitializeProvider();
}

public override void Update(float frameTime)
Expand Down Expand Up @@ -365,8 +366,11 @@ private void OnDestruction(Entity<PolymorphedEntityComponent> ent, ref Destructi
public void CreatePolymorphAction(ProtoId<PolymorphPrototype> id, Entity<PolymorphableComponent> target)
{
target.Comp.PolymorphActions ??= new();
if (target.Comp.PolymorphActions.ContainsKey(id))
if (target.Comp.PolymorphActions.TryGetValue(id, out var actionBla))
{
_actions.AddAction(target, actionBla, target);
return;
}

if (!_proto.TryIndex(id, out var polyProto))
return;
Expand Down
144 changes: 144 additions & 0 deletions Resources/Prototypes/Floof/Entities/Clothing/Neck/amulet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@

- type: entity
parent: ClothingNeckBase
id: ClothingNeckDragonAmuletPolymorph
name: dragon amulet
description: A beautiful gold amulet, featuring a ruby that shines with an otherworldly glow.
components:
- type: Sprite
sprite: Floof/Clothing/Neck/amulet_dragon.rsi
- type: Clothing
sprite: Floof/Clothing/Neck/amulet_dragon.rsi
- type: PolymorphProvider
polymorph: PolymorphDragonRubyFang

- type: polymorph
id: PolymorphDragonRubyFang
configuration:
entity: MobDragonRubyFang
forced: false
inventory: None
transferName: true
transferDamage: true
revertOnCrit: true
revertOnDeath: true

- type: entity
parent: [ SimpleSpaceMobBase, FlyingMobBase ]
id: MobDragonRubyFang
suffix: ""
name: Rubyfang
description: A giant dragon, probably a couple thousand years old.
components:
- type: Bloodstream
bloodMaxVolume: 650
- type: Speech
speechVerb: LargeMob
- type: CombatMode
- type: MobMover
- type: InputMover
- type: MovementSpeedModifier
baseWalkSpeed: 3
baseSprintSpeed: 5
weightlessModifier: 1.5
- type: Sprite
color: "#cc0000ff"
sprite: Mobs/Aliens/Carps/dragon.rsi
noRot: true
layers:
- map: [ "enum.DamageStateVisualLayers.Base" ]
state: alive
- map: [ "enum.DamageStateVisualLayers.BaseUnshaded" ]
state: alive-unshaded
shader: unshaded
- type: Appearance
- type: DamageStateVisuals
states:
Alive:
Base: alive
BaseUnshaded: alive-unshaded
Critical:
Base: crit
Dead:
Base: dead
BaseUnshaded: dead-unshaded
- type: Physics
bodyType: KinematicController
- type: Fixtures
fixtures:
fix1:
shape:
!type:PhysShapeCircle
radius: 0.40
density: 100
mask:
- FlyingMobMask
layer:
- FlyingMobLayer
- type: MobState
- type: MobStateActions
actions:
Critical:
- ActionCritSuccumb
- ActionCritLastWords
- type: MobThresholds
thresholds:
0: Alive
450: Critical
500: Dead
- type: SlowOnDamage
speedModifierThresholds:
250: 0.7
400: 0.5
# disable taking damage from fire, since its a fire breathing dragon
- type: Flammable
damage:
types: {}
- type: Temperature
heatDamageThreshold: 800
- type: Metabolizer
solutionOnBody: false
updateInterval: 0.25
metabolizerTypes: [ Dragon ]
groups:
- id: Medicine
- id: Poison
- type: Butcherable
spawned:
- id: FoodMeatDragon
amount: 2
- type: InteractionPopup
successChance: 0.25 # It's no goose, but you better smell like carp.
interactSuccessString: petting-success-dragon
interactFailureString: petting-failure-dragon
interactFailureSound:
path: /Audio/Animals/space_dragon_roar.ogg
soundPerceivedByOthers: false # A 75% chance for a loud roar would get old fast.
- type: MeleeWeapon
altDisarm: false
soundHit:
path: /Audio/Weapons/Xeno/alien_claw_flesh3.ogg
damage:
types:
Piercing: 15
Slash: 15
- type: Devourer
foodPreference: Humanoid
shouldStoreDevoured: true
chemical: Ichor
healRate: 15.0
whitelist:
components:
- MobState
- Door
tags:
- Wall
- type: Tag
tags:
- CannotSuicide
- DoorBumpOpener
- type: UserInterface
- type: Puller
needsHands: false
- type: Hands

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions Resources/Textures/Floof/Clothing/Neck/amulet_dragon.rsi/meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"version": 1,
"license": "CC-BY-SA-3.0",
"copyright": "Pire Discord #plazmaspirit",
"size": {
"x": 32,
"y": 32
},
"states": [
{
"name": "icon"
},
{
"name": "equipped-NECK",
"directions": 4
}
]
}

0 comments on commit 0942002

Please sign in to comment.