Skip to content

Commit

Permalink
monkey (#360)
Browse files Browse the repository at this point in the history
  • Loading branch information
dvir001 committed Sep 27, 2023
1 parent 919b8b7 commit 67c3b83
Show file tree
Hide file tree
Showing 11 changed files with 33 additions and 20 deletions.
8 changes: 7 additions & 1 deletion Content.Server/Cargo/Components/MobPriceComponent.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Content.Server.Cargo.Components;
namespace Content.Server.Cargo.Components;

/// <summary>
/// This is used for calculating the price of mobs.
Expand All @@ -23,4 +23,10 @@ public sealed partial class MobPriceComponent : Component
/// </summary>
[DataField("deathPenalty")]
public double DeathPenalty = 0.2f;

/// <summary>
/// The percentage of the actual price that should be granted should the appraised mob be lab grown calc added after DeathPenalty, will use tag "LabGrown".
/// </summary>
[DataField("labGrownPenalty")]
public double LabGrownPenalty = 0.2f;
}
5 changes: 4 additions & 1 deletion Content.Server/Cargo/Systems/PricingSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
using Robust.Shared.Map;
using Robust.Shared.Prototypes;
using Robust.Shared.Utility;
using Content.Shared.Tag;

namespace Content.Server.Cargo.Systems;

Expand All @@ -32,6 +33,8 @@ public sealed class PricingSystem : EntitySystem
[Dependency] private readonly BodySystem _bodySystem = default!;
[Dependency] private readonly MobStateSystem _mobStateSystem = default!;

[Dependency] private readonly TagSystem _tagSystem = default!;

/// <inheritdoc/>
public override void Initialize()
{
Expand Down Expand Up @@ -103,7 +106,7 @@ private void CalculateMobPrice(EntityUid uid, MobPriceComponent component, ref P
var partRatio = totalPartsPresent / (double) totalParts;
var partPenalty = component.Price * (1 - partRatio) * component.MissingBodyPartPenalty;

args.Price += (component.Price - partPenalty) * (_mobStateSystem.IsAlive(uid, state) ? 1.0 : component.DeathPenalty);
args.Price += (component.Price - partPenalty) * (_mobStateSystem.IsAlive(uid, state) ? 1.0 : component.DeathPenalty) * (!_tagSystem.HasTag(uid, "LabGrown") ? 1.0 : component.LabGrownPenalty);
}

private double GetSolutionPrice(SolutionContainerManagerComponent component)
Expand Down
2 changes: 1 addition & 1 deletion Resources/Prototypes/Body/Organs/Animal/animal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
- type: Sprite
sprite: Mobs/Species/Human/organs.rsi
- type: StaticPrice
price: 50
price: 5 # Why will anyone pay big money for animal organs


- type: entity
Expand Down
2 changes: 1 addition & 1 deletion Resources/Prototypes/Body/Parts/animal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
bodypart: !type:Container
ents: []
- type: StaticPrice
price: 50
price: 5 # Why will anyone pay big money for animal organs
- type: Tag
tags:
- Trash
Expand Down
2 changes: 1 addition & 1 deletion Resources/Prototypes/Catalog/Cargo/cargo_livestock.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
sprite: Mobs/Animals/monkey.rsi
state: monkey
product: CrateNPCMonkeyCube
cost: 4500
cost: 900
category: Livestock
group: market

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
ReagentContainerRice: 2
FoodCondimentPacketSalt: 4
FoodCondimentBottleEnzyme: 2
FoodCondimentBottleHotsauce: 1
FoodCondimentBottleKetchup: 1
FoodCondimentBottleBBQ: 1
FoodCondimentBottleHotsauce: 2
FoodCondimentBottleKetchup: 2
FoodCondimentBottleBBQ: 2
FoodCondimentBottleVinegar: 2
ReagentContainerOliveoil: 2
MonkeyCubeBox: 1
FoodContainerEgg: 1
MonkeyCubeBox: 3
FoodContainerEgg: 2
ReagentContainerMilk: 2
ReagentContainerMilkSoy: 1
ReagentContainerMilkSoy: 2
FoodButter: 4
FoodCheese: 1
FoodCheese: 2
FoodMeat: 6
3 changes: 3 additions & 0 deletions Resources/Prototypes/Entities/Mobs/NPCs/animals.yml
Original file line number Diff line number Diff line change
Expand Up @@ -882,6 +882,9 @@
clumsySound:
path: /Audio/Animals/monkey_scream.ogg
- type: IdExaminable
- type: Tag
tags:
- LabGrown

- type: entity
name: guidebook monkey
Expand Down
4 changes: 2 additions & 2 deletions Resources/Prototypes/Entities/Objects/Misc/monkeycube.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
- type: StaticPrice
price: 20
- type: VendPrice
price: 4500 # Yep, same price as the crate
price: 900 # 150 per monkey (Meat worth 200)

- type: entity
parent: BaseItem
Expand All @@ -40,7 +40,7 @@
tags:
- MonkeyCube
- type: StaticPrice
price: 460 # The same price as dead (-20)
price: 55 # The same price as dead (-20)

- type: entity
parent: BoxCardboard
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
layer:
- LowImpassable
- type: StaticPrice
price: 460 # The same price as dead (-20)
price: 35 # The same price as dead (-20)

- type: entity
parent: PlushieCarp
Expand Down Expand Up @@ -104,7 +104,7 @@
sound:
path: /Audio/Effects/bite.ogg
- type: StaticPrice
price: 580 # The same price as dead (-20)
price: 220 # The same price as dead (-20)

- type: entity
parent: BaseItem
Expand Down
5 changes: 5 additions & 0 deletions Resources/Prototypes/_NF/tags.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
- type: Tag
id: CaveFactory

- type: Tag
id: LabGrown
4 changes: 0 additions & 4 deletions Resources/Prototypes/tags.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1036,7 +1036,3 @@

- type: Tag
id: ModularReceiver

##Custom ones here I suppose
- type: Tag
id: CaveFactory

0 comments on commit 67c3b83

Please sign in to comment.