Farming rebalance (#1171)
* farming rebalance * Update base.yml * Update CP14FarmingSystem.Resourse.cs
This commit is contained in:
@@ -9,28 +9,10 @@ public sealed partial class CP14FarmingSystem
|
||||
{
|
||||
SubscribeLocalEvent<CP14PlantEnergyFromLightComponent, CP14PlantUpdateEvent>(OnTakeEnergyFromLight);
|
||||
SubscribeLocalEvent<CP14PlantMetabolizerComponent, CP14PlantUpdateEvent>(OnPlantMetabolizing);
|
||||
SubscribeLocalEvent<CP14PlantFadingComponent, CP14PlantUpdateEvent>(OnPlantFade);
|
||||
SubscribeLocalEvent<CP14PlantFadingComponent, MapInitEvent>(OnMapInit);
|
||||
|
||||
SubscribeLocalEvent<CP14PlantGrowingComponent, CP14AfterPlantUpdateEvent>(OnPlantGrowing);
|
||||
}
|
||||
|
||||
private void OnMapInit(Entity<CP14PlantFadingComponent> ent, ref MapInitEvent args)
|
||||
{
|
||||
ent.Comp.BirthTime = _timing.CurTime;
|
||||
}
|
||||
|
||||
private void OnPlantFade(Entity<CP14PlantFadingComponent> ent, ref CP14PlantUpdateEvent args)
|
||||
{
|
||||
var age = _timing.CurTime - ent.Comp.BirthTime;
|
||||
var realFade = ent.Comp.ResourcePerMinute * (float)age.TotalMinutes;
|
||||
if (args.Plant.Comp.Resource < realFade)
|
||||
{
|
||||
_damageable.TryChangeDamage(ent, ent.Comp.FadeDamage, true);
|
||||
}
|
||||
AffectResource(args.Plant, -realFade);
|
||||
}
|
||||
|
||||
private void OnTakeEnergyFromLight(Entity<CP14PlantEnergyFromLightComponent> regeneration, ref CP14PlantUpdateEvent args)
|
||||
{
|
||||
var gainEnergy = false;
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
using Content.Shared.Damage;
|
||||
using Content.Shared.FixedPoint;
|
||||
|
||||
namespace Content.Shared._CP14.Farming.Components;
|
||||
|
||||
/// <summary>
|
||||
/// Gradually wastes the plant's resources, killing it if there aren't enough. The waste gradually increases over time, reflecting the "Old Age" of the plant
|
||||
/// </summary>
|
||||
[RegisterComponent, Access(typeof(CP14SharedFarmingSystem))]
|
||||
public sealed partial class CP14PlantFadingComponent : Component
|
||||
{
|
||||
[DataField]
|
||||
public TimeSpan BirthTime = TimeSpan.Zero;
|
||||
|
||||
[DataField]
|
||||
public float ResourcePerMinute = 0f;
|
||||
|
||||
[DataField]
|
||||
public DamageSpecifier FadeDamage = new()
|
||||
{
|
||||
DamageDict = new Dictionary<string, FixedPoint2>
|
||||
{
|
||||
{ "Cellular", 0.05 },
|
||||
},
|
||||
};
|
||||
}
|
||||
@@ -20,5 +20,5 @@
|
||||
id: CP14GatherCabbage
|
||||
entries:
|
||||
- id: CP14FoodCabbage
|
||||
amount: 3
|
||||
maxAmount: 4
|
||||
amount: 6
|
||||
maxAmount: 8
|
||||
@@ -20,5 +20,5 @@
|
||||
id: CP14GatherCucumber
|
||||
entries:
|
||||
- id: CP14FoodCucumber
|
||||
amount: 2
|
||||
maxAmount: 4
|
||||
amount: 4
|
||||
maxAmount: 8
|
||||
|
||||
@@ -20,5 +20,5 @@
|
||||
id: CP14GatherOnion
|
||||
entries:
|
||||
- id: CP14FoodOnion
|
||||
amount: 2
|
||||
maxAmount: 4
|
||||
amount: 5
|
||||
maxAmount: 8
|
||||
|
||||
@@ -22,5 +22,5 @@
|
||||
id: CP14GatherPepper
|
||||
entries:
|
||||
- id: CP14FoodPepper
|
||||
amount: 2
|
||||
maxAmount: 4
|
||||
amount: 4
|
||||
maxAmount: 8
|
||||
|
||||
@@ -22,5 +22,5 @@
|
||||
id: CP14GatherPotato
|
||||
entries:
|
||||
- id: CP14FoodPotato
|
||||
amount: 2
|
||||
maxAmount: 4
|
||||
amount: 4
|
||||
maxAmount: 8
|
||||
|
||||
@@ -20,5 +20,5 @@
|
||||
id: CP14GatherPumpkin
|
||||
entries:
|
||||
- id: CP14FoodPumpkin
|
||||
amount: 2
|
||||
maxAmount: 4
|
||||
amount: 4
|
||||
maxAmount: 8
|
||||
|
||||
@@ -22,5 +22,5 @@
|
||||
id: CP14GatherSage
|
||||
entries:
|
||||
- id: CP14WildSage
|
||||
amount: 2
|
||||
maxAmount: 4
|
||||
amount: 4
|
||||
maxAmount: 8
|
||||
|
||||
@@ -20,5 +20,5 @@
|
||||
id: CP14GatherTomatoes
|
||||
entries:
|
||||
- id: CP14FoodTomatoes
|
||||
amount: 2
|
||||
maxAmount: 4
|
||||
amount: 4
|
||||
maxAmount: 8
|
||||
|
||||
@@ -25,5 +25,5 @@
|
||||
id: CP14GatherWheat
|
||||
entries:
|
||||
- id: CP14Wheat
|
||||
amount: 2
|
||||
maxAmount: 4
|
||||
amount: 5
|
||||
maxAmount: 8
|
||||
|
||||
@@ -108,18 +108,6 @@
|
||||
behaviors:
|
||||
- !type:DoActsBehavior
|
||||
acts: [ "Destruction" ]
|
||||
- trigger:
|
||||
!type:DamageGroupTrigger #Rot
|
||||
damageGroup: Genetic
|
||||
damage: 1
|
||||
behaviors:
|
||||
- !type:DoActsBehavior
|
||||
acts: [ "Destruction" ]
|
||||
- !type:SpawnEntitiesBehavior
|
||||
spawn:
|
||||
CP14CompostMaterial1:
|
||||
min: 2
|
||||
max: 3
|
||||
- trigger:
|
||||
!type:DamageTypeTrigger #Heat
|
||||
damageType: Heat
|
||||
@@ -157,16 +145,14 @@
|
||||
- type: CP14PlantMetabolizer
|
||||
metabolizerId: Base
|
||||
- type: CP14PlantEnergyFromLight
|
||||
energy: 1
|
||||
energy: 0.5
|
||||
daytime: true
|
||||
- type: CP14PlantVisuals
|
||||
growthSteps: 6
|
||||
- type: CP14PlantGrowing
|
||||
energyCost: 1
|
||||
resourceCost: 1
|
||||
growthPerUpdate: 0.05 # 20 minute to full grow
|
||||
- type: CP14PlantFading
|
||||
resourcePerMinute: 0.25 #20 minute from water
|
||||
energyCost: 0.25
|
||||
resourceCost: 0.25
|
||||
growthPerUpdate: 0.02 # 20 minute to full grow
|
||||
- type: FireVisuals
|
||||
sprite: _CP14/Effects/fire.rsi
|
||||
normalState: full
|
||||
@@ -180,8 +166,6 @@
|
||||
abstract: true
|
||||
components:
|
||||
- type: CP14PlantGrowing
|
||||
growthPerUpdate: 0.025
|
||||
- type: CP14PlantFading
|
||||
resourcePerMinute: 0.20
|
||||
growthPerUpdate: 0.12
|
||||
- type: CP14PlantGatherable
|
||||
deleteAfterHarvest: false
|
||||
Reference in New Issue
Block a user