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

Kitsune #586

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all 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
7 changes: 7 additions & 0 deletions Content.Server/Abilities/Kitsune/FoxFireComponent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace Content.Server.Abilities.Kitsune;

[RegisterComponent]
public sealed partial class FoxFireComponent : Component
{
public new EntityUid? Owner;
}
22 changes: 22 additions & 0 deletions Content.Server/Abilities/Kitsune/KitsuneComponent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
using Robust.Shared.Prototypes;
using Content.Shared.Actions;
using Robust.Shared.Utility;

namespace Content.Server.Abilities.Kitsune;

[RegisterComponent]
public sealed partial class KitsuneComponent : Component
{
/// <summary>
/// The foxfire prototype to use.
/// </summary>
[DataField("foxfirePrototype")]
public EntProtoId FoxfirePrototype = "Foxfire";

[DataField]
public EntProtoId FoxfireActionId = "ActionFoxfire";

public EntityUid? FoxfireAction;
}

62 changes: 62 additions & 0 deletions Content.Server/Abilities/Kitsune/KitsuneSystem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
using System.Drawing.Printing;
using Content.Shared.Actions;
using Content.Shared.Actions.Events;
using YamlDotNet.Core.Tokens;

namespace Content.Server.Abilities.Kitsune;

public sealed class KitsuneSystem : EntitySystem
{
[Dependency] private readonly SharedActionsSystem _actions = default!;

public override void Initialize()
{
base.Initialize();

SubscribeLocalEvent<KitsuneComponent, ComponentStartup>(OnStartup);

SubscribeLocalEvent<KitsuneComponent, CreateFoxfireActionEvent>(OnCreateFoxfire);

SubscribeLocalEvent<FoxFireComponent, ComponentShutdown>(OnFoxFireShutdown);

SubscribeLocalEvent<KitsuneComponent, FoxFireDestroyedEvent>(OnFoxFireDestroyed);
}

private void OnStartup(EntityUid uid, KitsuneComponent component, ComponentStartup args)
{
Log.Error("Kitsune broke");

component.FoxfireAction = _actions.AddAction(uid, component.FoxfireActionId);
}

private void OnCreateFoxfire(EntityUid uid, KitsuneComponent component, CreateFoxfireActionEvent args)
{
Log.Error("Fire still broke");
if (_actions.GetCharges(component.FoxfireAction) is not int charges || charges < 1)
return;

var fireEnt = Spawn(component.FoxfirePrototype, Transform(uid).Coordinates);
var fireComp = EnsureComp<FoxFireComponent>(fireEnt);
fireComp.Owner = uid;

args.Handled = true;


}

private void OnFoxFireShutdown(EntityUid uid, FoxFireComponent component, ComponentShutdown args)
{
Log.Error("Fire won't break");
if (component.Owner is null)
return;
RaiseLocalEvent<FoxFireDestroyedEvent>(component.Owner.Value, new());
}

private void OnFoxFireDestroyed(EntityUid uid, KitsuneComponent component, FoxFireDestroyedEvent args)
{
Log.Error("Fire didn't break");
_actions.AddCharges(component.FoxfireAction, 1);
_actions.SetEnabled(component.FoxfireAction, true);

}
}
5 changes: 5 additions & 0 deletions Content.Shared/Actions/Events/CreateFoxfireEvent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
namespace Content.Shared.Actions.Events;

public sealed partial class CreateFoxfireActionEvent : InstantActionEvent {}

public readonly record struct FoxFireDestroyedEvent;
3 changes: 3 additions & 0 deletions Resources/Locale/en-US/actions/actions/kitsune.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
action-name-foxfire = Create Foxfire
action-description-foxfire = Form a cool, gently glowing wisp of flame
petting-success-soft-floofy-kitsune = You gently pat {THE($target)}
2 changes: 2 additions & 0 deletions Resources/Locale/en-US/markings/kitsune.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
marking-KitsuneTailDefault = Kitsune Tail
marking-KitsuneEarsDefault = Kitsune Ears
10 changes: 10 additions & 0 deletions Resources/Prototypes/Actions/kitsune.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
- type: entity
id: ActionFoxfire
name: action-name-foxfire
description: action-description-foxfire
noSpawn: true
components:
- type: InstantAction
charges: 1
icon: { sprite: Structures\Specific\Species\Kitsune\foxfire.rsi, state: icon }
event: !type:CreateFoxfireActionEvent
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# All the Kitsune customization

# Tail Markings
- type: marking
id: KitsuneTailDefault
bodyPart: Tail
markingCategory: Tail
speciesRestriction: [Kitsune]
coloring:
default:
type:
!type:CategoryColoring
category: Hair
fallbackTypes:
- !type:SimpleColoring
color: "#fffafa"
sprites:
- sprite: Mobs\Customization\kitsune\tails.rsi
state: kitsune_primary
- sprite: Mobs\Customization\kitsune\tails.rsi
state: kitsune_secondary

# Ear Markings

- type: marking
id: KitsuneEarsDefault
bodyPart: Head
markingCategory: HeadTop
speciesRestriction: [Kitsune]
coloring:
default:
type:
!type:CategoryColoring
category: Hair
fallbackTypes:
- !type:SimpleColoring
color: "#fffafa"
sprites:
- sprite: Mobs\Customization\kitsune\ears.rsi
state: kitsune_fluffy_ears
- sprite: Mobs\Customization\kitsune\ears.rsi
state: kitsune_fluffy_fluff
37 changes: 37 additions & 0 deletions Resources/Prototypes/Entities/Mobs/Player/kitsune.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
- type: entity
save: false
name: Urist McKitsune
parent: MobKitsuneBase
id: MobKitsune
components:
- type: CombatMode
- type: InteractionPopup
successChance: 0.5
interactSuccessString: petting-success-soft-floofy-kitsune
interactFailureString: petting-failure-generic
interactSuccessSpawn: EffectHearts
interactSuccessSound:
path: /Audio/Animals/fox_squeak.ogg
- type: MindContainer
showExamineInfo: true
- type: Input
context: "human"
- type: MobMover
- type: InputMover
- type: Respirator
damage:
types:
Asphyxiation: 1.0
damageRecovery:
types:
Asphyxiation: -1.0
- type: Alerts
- type: Actions
- type: Eye
- type: CameraRecoil
- type: Examiner
- type: CanHostGuardian
- type: NpcFactionMember
factions:
- NanoTrasen
- type: PotentialPsionic
80 changes: 80 additions & 0 deletions Resources/Prototypes/Entities/Mobs/Species/kitsune.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
- type: entity
save: false
name: Urist McKitsune
parent: BaseMobHuman
id: MobKitsuneBase
abstract: true
components:
- type: Sprite
scale: 0.8, 0.8
- type: HumanoidAppearance
species: Felinid
- type: Fixtures
fixtures: # TODO: This needs a second fixture just for mob collisions.
fix1:
shape:
!type:PhysShapeCircle
radius: 0.35
density: 50
restitution: 0.0
mask:
- MobMask
layer:
- MobLayer
- type: Body
prototype: Felinid
- type: Damageable
- type: MeleeWeapon
soundHit:
path: /Audio/Items/hiss.ogg
animation: WeaponArcClaw
damage:
types:
Heat: 5
- type: Speech
speechSounds: Alto
- type: Vocal
wilhelm: "/Audio/Nyanotrasen/Voice/Felinid/cat_wilhelm.ogg"
sounds:
Male: MaleFelinid
Female: FemalFelinid
Unsexed: MaleFelinid
- type: Polymorphable
innatePolymorphs:
- KitsuneMorph
- type: InteractionPopup
successChance: 0.5
interactSuccessString: petting-success-soft-floofy-kitsune
interactFailureString: petting-failure-generic
interactSuccessSpawn: EffectHearts
interactSuccessSound:
path: /Audio/Animals/fox_squeak.ogg
- type: Kitsune
- type: PseudoItem
storedOffset: 0,17
shape:
- 0,0,1,4
- 0,2,3,4
- 4,0,5,4
- type: LanguageKnowledge
speaks:
- GalacticCommon
- Kitsune
- SolCommon
understands:
- GalacticCommon
- Kitsune
- SolCommon



- type: entity
save: false
name: Urist McKitsune
parent: MobHumanDummy
id: MobKitsuneDummy
noSpawn: true
description: A dummy kitsune meant to be used in character setup.
components:
- type: HumanoidAppearance
species: Kitsune
45 changes: 45 additions & 0 deletions Resources/Prototypes/Entities/Objects/Specific/Species/kitsune.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
- type: entity
parent: BaseItem
id: Foxfire
name: foxfire
description: An oddly cool wisp of flame giving off a comfortable glow.
components:
- type: FoxFire
- type: Sprite
noRot: true
drawdepth: Effects
sprite: Structures/Specific/Species/Kitsune/foxfire.rsi
state: foxfire
- type: PointLight
radius: 1.5
energy: 1.5
color: "#fca3c0"
castShadows: false
- type: Transform
anchored: false
- type: Physics
bodyType: Static
bodyStatus: InAir
- type: Fixtures
fixtures:
fix1:
shape:
!type:PhysShapeCircle
radius: 0.35
density: 50
mask:
- MobMask
layer:
- MobLayer
- type: Damageable
damageContainer: Organic
damageModifierSet: Wood
- type: Destructible
thresholds:
- trigger:
!type:DamageTrigger
damage: 5
behaviors:
- !type:DoActsBehavior
acts: ["Destruction"]
- type: InteractionOutline
36 changes: 36 additions & 0 deletions Resources/Prototypes/Species/kitsune.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
- type: species
id: Kitsune
name: Kitsune
roundStart: true
prototype: MobKitsune
sprites: MobHumanSprites
markingLimits: MobKitsuneMarkingLimits
dollPrototype: MobKitsuneDummy
skinColoration: HumanToned

- type: markingPoints
id: MobKitsuneMarkingLimits
points:
Hair:
points: 1
required: false
FacialHair:
points: 1
required: false
Tail:
points: 1
required: true
defaultMarkings: [ KitsuneTailDefault ]
HeadTop:
points: 1
required: true
defaultMarkings: [ KitsuneEarsDefault ]
Chest:
points: 1
required: false
Legs:
points: 2
required: false
Arms:
points: 2
required: false
2 changes: 1 addition & 1 deletion Resources/Prototypes/Voice/speech_emote_sounds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -404,4 +404,4 @@
sound:
path: /Audio/Animals/parrot_raught.ogg
params:
variation: 0.125
variation: 0.125
2 changes: 1 addition & 1 deletion Resources/Prototypes/Voice/speech_sounds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -131,4 +131,4 @@
askSound:
path: /Audio/Animals/dog_bark3.ogg
exclaimSound:
path: /Audio/Animals/dog_bark2.ogg
path: /Audio/Animals/dog_bark2.ogg
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.
Loading
Loading