Skip to content

Commit

Permalink
Merge pull request space-wizards#38 from impstation/master
Browse files Browse the repository at this point in the history
Upstream
  • Loading branch information
AirFryerBuyOneGetOneFree authored Feb 14, 2025
2 parents 23b98d9 + cb675aa commit fad3302
Show file tree
Hide file tree
Showing 9 changed files with 91 additions and 42 deletions.
3 changes: 3 additions & 0 deletions Content.Server/Atmos/EntitySystems/FlammableSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,7 @@ public void Extinguish(EntityUid uid, FlammableComponent? flammable = null)
if (flammable.ToggleAmbientSound && TryComp<AmbientSoundComponent>(uid, out var ambient))
_ambient.SetAmbience(uid, false, ambient);


UpdateAppearance(uid, flammable);
}

Expand Down Expand Up @@ -491,3 +492,5 @@ public override void Update(float frameTime)
}
}
}


Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,13 @@ namespace Content.Server.Temperature.Components;
/// </summary>
[RegisterComponent, Access(typeof(EntityHeaterSystem))]
public sealed partial class EntityHeaterComponent : Component
{
{ //Imp Edit
/// <summary>
/// Does this heater require electicity to work.
/// </summary>
[DataField, ViewVariables(VVAccess.ReadWrite)]
public bool RequirePower = true;

/// <summary>
/// Power used when heating at the high setting.
/// Low and medium are 33% and 66% respectively.
Expand Down
36 changes: 27 additions & 9 deletions Content.Server/Temperature/Systems/EntityHeaterSystem.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using Content.Server.Atmos.Components;
using Content.Server.Power.Components;
using Content.Server.Temperature.Components;
using Content.Shared.Examine;
Expand Down Expand Up @@ -33,16 +34,27 @@ public override void Initialize()

public override void Update(float deltaTime)
{
var query = EntityQueryEnumerator<EntityHeaterComponent, ItemPlacerComponent, ApcPowerReceiverComponent>();
while (query.MoveNext(out var uid, out var comp, out var placer, out var power))
var query = EntityQueryEnumerator<EntityHeaterComponent, ItemPlacerComponent>(); //Imp edit
while (query.MoveNext(out var uid, out var comp, out var placer))
{
if (!power.Powered)
var energy = comp.Power * deltaTime; //Just use base power if no power required
if (comp.RequirePower)
{
TryComp<ApcPowerReceiverComponent>(uid, out var power);
if (power == null)
continue;
if (!power.Powered)
continue;

// don't divide by total entities since its a big grill
// excess would just be wasted in the air but that's not worth simulating
// if you want a heater thermomachine just use that...
energy = power.PowerReceived * deltaTime;
}

if (TryComp<FlammableComponent>(uid, out var flammable) && !flammable.OnFire)
continue;

// don't divide by total entities since its a big grill
// excess would just be wasted in the air but that's not worth simulating
// if you want a heater thermomachine just use that...
var energy = power.PowerReceived * deltaTime;
foreach (var ent in placer.PlacedEntities)
{
_temperature.ChangeHeat(ent, energy);
Expand All @@ -52,6 +64,9 @@ public override void Update(float deltaTime)

private void OnExamined(EntityUid uid, EntityHeaterComponent comp, ExaminedEvent args)
{
if (!comp.RequirePower) //Imp edit
return;

if (!args.IsInDetailsRange)
return;

Expand All @@ -63,10 +78,13 @@ private void OnGetVerbs(EntityUid uid, EntityHeaterComponent comp, GetVerbsEvent
if (!args.CanAccess || !args.CanInteract)
return;

var setting = (int) comp.Setting;
if (!comp.RequirePower) //Imp edit
return;

var setting = (int)comp.Setting;
setting++;
setting %= SettingCount;
var nextSetting = (EntityHeaterSetting) setting;
var nextSetting = (EntityHeaterSetting)setting;

args.Verbs.Add(new AlternativeVerb()
{
Expand Down
29 changes: 14 additions & 15 deletions Resources/Changelog/Impstation.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,4 @@
Entries:
- author: Darkmajia
changes:
- message: 'The Animal Friends Kit has an additional line to make its function clearer:
subjuzine requires mixing with blood.'
type: Add
id: 623
time: '2024-12-02T12:48:22.0000000+00:00'
url: https://github.com/impstation/imp-station-14/pull/870
- author: Darkmajia
changes:
- message: Ultraviolet lights can now be crafted in autolathes.
type: Add
id: 624
time: '2024-12-02T13:09:17.0000000+00:00'
url: https://github.com/impstation/imp-station-14/pull/871
- author: starlighthowls
changes:
- message: Adds cruise 2 for testing!!
Expand Down Expand Up @@ -4199,3 +4184,17 @@
id: 1122
time: '2025-02-13T22:38:49.0000000+00:00'
url: https://github.com/impstation/imp-station-14/pull/1607
- author: formlessnameless
changes:
- message: Bonfires can cook things now. Start the cookout.
type: Add
id: 1123
time: '2025-02-14T01:39:44.0000000+00:00'
url: https://github.com/impstation/imp-station-14/pull/1677
- author: ruddygreat
changes:
- message: Some cargo items can no longer be bought for less than their sell price.
type: Tweak
id: 1124
time: '2025-02-14T02:22:50.0000000+00:00'
url: https://github.com/impstation/imp-station-14/pull/1681
2 changes: 1 addition & 1 deletion Resources/Prototypes/Announcers/sinister.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
- type: announcer
id: Sinister
basePath: /Audio/_Impstation/Announcers/
basePath: /Audio/_Impstation/Announcers/Sinister
baseAudioParams:
volume: -12
announcements:
Expand Down
2 changes: 1 addition & 1 deletion Resources/Prototypes/Catalog/Cargo/cargo_materials.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
sprite: Objects/Materials/Sheets/other.rsi
state: plasma_3
product: CrateMaterialPlasma
cost: 2000
cost: 2200 #imp edit to prevent abritrage - was 2k.
category: cargoproduct-category-name-materials
group: market

Expand Down
4 changes: 2 additions & 2 deletions Resources/Prototypes/Catalog/Cargo/cargo_vending.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
sprite: Objects/Specific/Service/vending_machine_restock.rsi
state: base
product: CrateVendingMachineRestockClothesFilled
cost: 2440
cost: 3000 #imp edit to prevent abritrage - was 2440.
category: cargoproduct-category-name-service
group: market

Expand Down Expand Up @@ -84,7 +84,7 @@
sprite: Objects/Specific/Service/vending_machine_restock.rsi
state: base
product: CrateVendingMachineRestockGamesFilled
cost: 750
cost: 1000 #imp edit to prevent arbitrage - was 750.
category: cargoproduct-category-name-service
group: market

Expand Down
47 changes: 35 additions & 12 deletions Resources/Prototypes/Entities/Structures/Decoration/bonfire.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,14 @@
range: 5
sound:
path: /Audio/Ambience/Objects/fireplace.ogg

# imp edit - most of these components are new, with old ones rolled into BaseBonfire. and yet, we are still in an upstream file
- type: entity
id: Bonfire
parent: BonfireBase
name: bonfire
description: What can be better than a late evening under the sky with guitar and friends?
components:
- type: Sprite
layers:
- state: bonfire
- type: Appearance
- type: EntityHeater
requirePower: false
- type: ItemPlacer
maxEntities: 6 # big fire, many steaks
whitelist:
components:
- Temperature
- type: PlaceableSurface
- type: Fixtures
fixtures:
fix1:
Expand All @@ -50,8 +46,22 @@
mask:
- MachineMask
layer:
- Impassable
- MidImpassable
- LowImpassable
hard: false

# imp edit - most of these components are new, with old ones rolled into BaseBonfire. and yet, we are still in an upstream file
- type: entity
id: Bonfire
parent: BonfireBase
name: bonfire
description: What can be better than a late evening under the sky with guitar and friends?
components:
- type: Sprite
layers:
- state: bonfire
- type: Appearance
- type: Destructible
thresholds:
- trigger:
Expand Down Expand Up @@ -110,6 +120,19 @@
- type: Sprite
layers:
- state: legionnaire_bonfire
- type: Fixtures
fixtures:
fix1:
shape:
!type:PhysShapeCircle
radius: 0.35
density: 130
mask:
- MachineMask
layer:
- Impassable
- MidImpassable
- LowImpassable
# imp edits
- type: PointLight
radius: 5
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
sprite: _Impstation/Objects/Consumable/Food/snacks.rsi
state: shrimps
product: FoodSnackShrimpspack
cost: 35 #votv cost
cost: 45 #was 35 because votv, upped to 45 because arbitrage and I'm no fun.
category: cargoproduct-category-name-food
group: market

Expand Down

0 comments on commit fad3302

Please sign in to comment.