Skip to content

Commit 1e0fed3

Browse files
authored
Merge pull request #183 from Permafrost-Game/bugfixes-showcase
Minor bug fixes
2 parents a55be7e + 014a860 commit 1e0fed3

4 files changed

Lines changed: 16 additions & 6 deletions

File tree

TeamProject/GlobalWarmingGame/Interactions/Interactables/Buildings/CampFire.cs

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public CampFire() : base(Vector2.Zero, Textures.MapSet[TextureSetTypes.CampFire]
3232

3333
[PFSerializable]
3434
public float timeUntilBurntout;
35-
private const float burnoutTime = 15000f;
35+
private const float burnoutTime = 30000f;
3636

3737
public CampFire(Vector2 position, bool heating = true, float timeUntilBurntout = burnoutTime) : base
3838
(
@@ -59,9 +59,18 @@ public CampFire(Vector2 position, bool heating = true, float timeUntilBurntout =
5959

6060
private void Fuel(Instruction instruction)
6161
{
62-
Heating = true;
63-
TextureGroupIndex = 1;
64-
InstructionTypes.Clear();
62+
if (instruction.ActiveMember.Inventory.ContainsAll(instruction.Type.RequiredResources))
63+
{
64+
foreach (ResourceItem item in instruction.Type.RequiredResources)
65+
{
66+
instruction.ActiveMember.Inventory.RemoveItem(item);
67+
}
68+
69+
Heating = true;
70+
TextureGroupIndex = 1;
71+
InstructionTypes.Clear();
72+
73+
}
6574
}
6675

6776
public override void Update(GameTime gameTime)

TeamProject/GlobalWarmingGame/Interactions/Interactables/InteractablesFactory.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ public static IInteractable MakeInteractable(Interactable interactable, Vector2
2929
case Interactable.Colonist:
3030
Inventory i = new Inventory(Colonist.COLONIST_DEFAULT_INVENTORY_SIZE);
3131
i.AddItem(new ResourceItem(Resource.Food, 10));
32+
i.AddItem(new ResourceItem(Resource.Wood, 10));
3233
return new Colonist(position, i);
3334
case Interactable.Merchant:
3435
return new Merchant(position);

TeamProject/GlobalWarmingGame/UI/Controllers/GameUIController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ private static void UpdateTemperature(Vector2 gameHover, Vector2 screenHover)
451451

452452
if (t != null && !view.Hovering)
453453
{
454-
int temperature = MathHelper.Clamp((int)Math.Round(t.Temperature.Value), -50, +50);
454+
int temperature = MathHelper.Clamp((int)Math.Round(t.Temperature.Value), -50, +50) - 30;
455455
if (temperature == 0)
456456
temp = "±";
457457
else if (temperature > 0)

TeamProject/GlobalWarmingGame/ZoneGenerator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ namespace GlobalWarmingGame
1212
{
1313
static class ZoneGenerator
1414
{
15-
private static readonly int towerDistance = 7;
15+
private static readonly int towerDistance = 3;
1616
private static readonly int towerSpan = 100;
1717

1818
/// <summary>

0 commit comments

Comments
 (0)