-
Notifications
You must be signed in to change notification settings - Fork 148
Harpy rework #646
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
base: master
Are you sure you want to change the base?
Harpy rework #646
Changes from 6 commits
affa18e
caef65d
555ccb8
38a157c
c6f124b
b528f1a
765e11e
d6ed068
f009157
0a2f782
5fde5a8
4f8f68d
f220a8a
1e2c6e3
7f6f078
aa65b83
9a27bb7
f689928
f86e144
09d0b55
014dca3
32f2473
b89e933
a6057d0
9f1ebc2
97bfb41
4a5c020
d6124b4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| using Robust.Shared.GameStates; | ||
|
|
||
| namespace Content.Shared._Omu.Proficiencies; | ||
|
|
||
| [RegisterComponent] | ||
| public sealed partial class ProficiencyComponent : Component | ||
| { | ||
|
|
||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| using Robust.Shared.Prototypes; | ||
| using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype; | ||
|
|
||
|
|
||
|
|
||
| namespace Content.Shared._Omu.Proficiencies; | ||
|
|
||
| [Prototype("Proficiency")] | ||
| [DataDefinition] | ||
| public sealed partial class ProficiencyPrototype : IPrototype | ||
| { | ||
|
|
||
| [IdDataField] | ||
| public string ID { get; private set; } = default!; | ||
|
|
||
| [DataField] | ||
| public List<EntProtoId>? Items; | ||
|
|
||
| [DataField] | ||
| public float proficiencyMultiplier { get; private set; } = 1f; | ||
|
|
||
| [DataField] | ||
| public float surgeryProficiency { get; private set; } = 1f; | ||
|
|
||
| //the lower the reloadspeed modifier the faster it goes | ||
| [DataField] | ||
| public float reloadSpeedProficiency { get; private set; } = 1f; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,107 @@ | ||
| using Content.Shared._Shitmed.Medical.Surgery; | ||
| using Content.Shared.GameTicking; | ||
| using Content.Shared.Hands; | ||
| using Content.Shared.Tools.Components; | ||
| using Robust.Shared.Prototypes; | ||
| using Content.Shared.Weapons.Ranged.Components; | ||
| namespace Content.Shared._Omu.Proficiencies; | ||
|
|
||
| public sealed class ProficiencySystem : EntitySystem | ||
| { | ||
| [Dependency] private readonly IPrototypeManager _prototypeManager = default!; | ||
| [Dependency] private readonly IEntityManager _entityManager = default!; | ||
|
|
||
| string? proficiencyID; | ||
| ProficiencyPrototype? proto; | ||
|
|
||
| public override void Initialize(){ | ||
| SubscribeLocalEvent<ProficiencyComponent, DidEquipHandEvent>(OnEquip); | ||
| SubscribeLocalEvent<ProficiencyComponent, DidUnequipHandEvent>(OnUnequip); | ||
| SubscribeLocalEvent<ProficiencyComponent, PlayerSpawnCompleteEvent>(OnPlayerSpawnComplete); | ||
| } | ||
|
|
||
|
|
||
| private void OnEquip(Entity<ProficiencyComponent> entity, ref DidEquipHandEvent args){ | ||
| if(proto != null && proto.Items != null) | ||
| { | ||
| bool handled = false; | ||
|
|
||
| if(TryComp<BallisticAmmoProviderComponent>(args.Equipped, out var ammoComp)) | ||
| { | ||
| ammoComp.FillDelay *= proto.reloadSpeedProficiency; | ||
| } | ||
|
|
||
| foreach (var Item in proto.Items){ | ||
| if(TryComp<MetaDataComponent>(args.Equipped, out var data) && data.EntityPrototype != null) | ||
| { | ||
| if(data.EntityPrototype.ID == Item.Id){ | ||
| handled = true; | ||
|
|
||
| if(TryComp<ToolComponent>(args.Equipped, out var toolComp)){ | ||
| toolComp.SpeedModifier *= proto.proficiencyMultiplier; | ||
|
|
||
| Dirty(args.Equipped, toolComp); | ||
| } | ||
|
|
||
| } | ||
| } | ||
| } | ||
| // If it isnt in the list of items buffed, debuff it instead | ||
| if (!handled) | ||
| { | ||
| if(TryComp<ToolComponent>(args.Equipped, out var toolComp)) | ||
| { | ||
| toolComp.SpeedModifier *= MathF.Pow(proto.proficiencyMultiplier, -1); | ||
|
|
||
| Dirty(args.Equipped, toolComp); | ||
| } | ||
| } | ||
| } | ||
| } | ||
|
|
||
| private void OnUnequip(Entity<ProficiencyComponent> entity, ref DidUnequipHandEvent args) | ||
| { | ||
| if(proto != null && proto.Items != null) | ||
| { | ||
| if (TryComp<MetaDataComponent>(args.Unequipped, out var data) && data.EntityPrototype != null) | ||
| { | ||
| if (TryComp<ToolComponent>(args.Unequipped, out var toolComp)) | ||
| { | ||
| toolComp.SpeedModifier *= MathF.Pow(toolComp.SpeedModifier, -1); | ||
|
|
||
| Dirty(args.Unequipped, toolComp); | ||
| } | ||
|
|
||
| } | ||
| if (TryComp<BallisticAmmoProviderComponent>(args.Unequipped, out var ammoComp)) | ||
| { | ||
| ammoComp.FillDelay *= MathF.Pow(proto.reloadSpeedProficiency, -1); | ||
| } | ||
| } | ||
| } | ||
|
|
||
| private void OnPlayerSpawnComplete(Entity<ProficiencyComponent> entity, ref PlayerSpawnCompleteEvent args) | ||
| { | ||
| proficiencyID = args.JobId; | ||
|
|
||
| proto = null; | ||
|
|
||
| if (proficiencyID == null) | ||
| { | ||
| return; | ||
| } | ||
|
|
||
| if (proficiencyID != null && args.JobId != null && _prototypeManager.TryIndex<ProficiencyPrototype>(args.JobId, out var proficiencyPrototype)) | ||
| { | ||
| proto = proficiencyPrototype; | ||
|
|
||
| if (proto.surgeryProficiency != 1f) | ||
| { | ||
| var surgerySpeedComp = _entityManager.EnsureComponent<SurgerySpeedModifierComponent>(args.Mob); | ||
| surgerySpeedComp.SpeedModifier *= proto.surgeryProficiency; | ||
|
|
||
| Dirty(args.Mob, surgerySpeedComp); | ||
| } | ||
| } | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| - type: Proficiency | ||
| id: BaseTools | ||
| items: | ||
| - Crowbar | ||
| - Wrench | ||
| - Screwdriver | ||
| - Wirecutter | ||
| - Welder | ||
| - Multitool | ||
|
|
||
| - type: Proficiency | ||
| id: advancedTools | ||
| items: | ||
| - WelderExperimental | ||
| - PowerDrill | ||
| - JawsOfLife | ||
|
|
||
| - type: Proficiency | ||
| id: BaseSci | ||
| items: | ||
| - Crowbar | ||
| - Wrench | ||
| - Screwdriver | ||
| - Wirecutter | ||
| - Welder | ||
| - Multitool | ||
| proficiencyMultiplier: 1.2 | ||
| # give sci a minor surgery speed buff, robotics exists and needs surgery to function | ||
| surgeryProficiency: 1.1 | ||
|
|
||
| - type: Proficiency | ||
| id: BaseEngi | ||
| items: | ||
| - Crowbar | ||
| - Wrench | ||
| - Screwdriver | ||
| - Wirecutter | ||
| - Welder | ||
| - WelderIndustrial | ||
| - Multitool | ||
| - WelderExperimental | ||
| - PowerDrill | ||
| - JawsOfLife | ||
| proficiencyMultiplier: 1.2 | ||
|
Comment on lines
+1
to
+44
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is bad. You might want to consider some type of parenting system, or listing proficiencies based on some other factor, i.e. checking for a For example, abductor tools here are not supported.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i was planning on doing this, i couldn't find a way where i could make it work at that time, but i probably just forgot something; i'll have a look into it later |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| - type: Proficiency | ||
| id: CargoTechnician | ||
| items: | ||
| - Crowbar | ||
| - Wrench | ||
| - Screwdriver | ||
| - Wirecutter | ||
| - Welder | ||
| - Multitool | ||
| proficiencyMultiplier: 1.1 | ||
|
|
||
| - type: Proficiency | ||
| id: ShaftMiner | ||
| items: | ||
| - Crowbar | ||
|
Comment on lines
+1
to
+15
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See other Comment about changing the base proficiencies, that way you could add a singular thing here (i.e. Ideally you should make the
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Additionally, you could add more jobs to this datafield, that way you don't need multiple prototypes to set the same proficiency to multiple jobs. |
||
| - Wrench | ||
| - Screwdriver | ||
| - Wirecutter | ||
| - Welder | ||
| - Multitool | ||
| proficiencyMultiplier: 1.2 | ||
|
|
||
| - type: Proficiency | ||
| id: SalvageSpecialist | ||
| items: | ||
| - Crowbar | ||
| - Wrench | ||
| - Screwdriver | ||
| - Wirecutter | ||
| - Welder | ||
| - Multitool | ||
| proficiencyMultiplier: 1.2 | ||
|
|
||
| - type: Proficiency | ||
| id: Quartermaster | ||
| items: | ||
| - Crowbar | ||
| - Wrench | ||
| - Screwdriver | ||
| - Wirecutter | ||
| - Welder | ||
| - Multitool | ||
| proficiencyMultiplier: 1.4 | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| - type: Proficiency | ||
| id: StationEngineer | ||
| items: | ||
| - Crowbar | ||
| - Wrench | ||
| - Screwdriver | ||
| - Wirecutter | ||
| - Welder | ||
| - Multitool | ||
| - WelderExperimental | ||
| - PowerDrill | ||
| #- JawsOfLife | ||
| #so many buffs we can't have them ALL be fast | ||
| proficiencyMultiplier: 1.15 | ||
|
|
||
| - type: Proficiency | ||
| #basically just engi+ | ||
| id: AtmosphericsTechnician | ||
| items: | ||
| - Crowbar | ||
| - Wrench | ||
| - Screwdriver | ||
| - Wirecutter | ||
| - Welder | ||
| - Multitool | ||
| - WelderExperimental | ||
| - PowerDrill | ||
| #- JawsOfLife | ||
| proficiencyMultiplier: 1.25 | ||
|
|
||
| - type: Proficiency | ||
| #basically just engi+ | ||
| id: ChiefEngineer | ||
| items: | ||
| - Crowbar | ||
| - Wrench | ||
| - Screwdriver | ||
| - Wirecutter | ||
| - Welder | ||
| - Multitool | ||
| - WelderExperimental | ||
| - PowerDrill | ||
| #- JawsOfLife | ||
| #same as RD | ||
| proficiencyMultiplier: 1.4 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| - type: Proficiency | ||
| id: MedicalDoctor | ||
| # specifying proficiency anyways to debuff tool use, go do your job and stop tiding | ||
| proficiencyMultiplier: 1.20 | ||
| surgeryProficiency: 1.25 | ||
|
|
||
| - type: Proficiency | ||
| id: Chemist | ||
| # specifying proficiency anyways to debuff tool use, go do your job and stop tiding | ||
| proficiencyMultiplier: 1.20 | ||
| surgeryProficiency: 1.25 | ||
|
|
||
| - type: Proficiency | ||
| id: Virologist | ||
| # specifying proficiency anyways to debuff tool use, go do your job and stop tiding | ||
| proficiencyMultiplier: 1.20 | ||
|
|
||
| - type: Proficiency | ||
| id: Paramedic | ||
| items: | ||
| # lets buff jaws for paramed, this could be huge and if it is feel free to come back and change it | ||
| - JawsOfLife | ||
| proficiencyMultiplier: 1.20 | ||
| surgeryProficiency: 1.10 | ||
|
|
||
| - type: Proficiency | ||
| id: ChiefMedicalOfficer | ||
| # less tool speed malus because you may need them more than docs, more surgery buff | ||
| proficiencyMultiplier: 1.10 | ||
| surgeryProficiency: 1.5 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
|
|
||
| - type: Proficiency | ||
| id: Captain | ||
| items: | ||
| - Crowbar | ||
| - Wrench | ||
| - Screwdriver | ||
| - Wirecutter | ||
| - Welder | ||
| - Multitool | ||
| proficiencyMultiplier: 1.2 | ||
|
|
||
| - type: Proficiency | ||
| id: AdministrativeAssistant | ||
| items: | ||
| - Crowbar | ||
| - Wrench | ||
| - Screwdriver | ||
| - Wirecutter | ||
| - Welder | ||
| - Multitool | ||
| proficiencyMultiplier: 1.1 | ||
|
|
||
| - type: Proficiency | ||
| id: Assistant | ||
| items: | ||
| - Crowbar | ||
| - Wrench | ||
| - Screwdriver | ||
| - Wirecutter | ||
| - Welder | ||
| - Multitool | ||
| proficiencyMultiplier: 1.1 |
Uh oh!
There was an error while loading. Please reload this page.