Skip to content

Commit

Permalink
use new VariableReplace api
Browse files Browse the repository at this point in the history
  • Loading branch information
HeladoDeBrownie committed Oct 12, 2021
1 parent b8abec5 commit f8ba1f2
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 28 deletions.
52 changes: 26 additions & 26 deletions AutomaticBrewer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,44 +61,44 @@ public void Activate(GameObject activator = null)
GetAnnoyed(activator);

AddPlayerMessage(VariableReplace(
Input: MESSAGE_REFUSAL_WORKING,
obj: ParentObject
MESSAGE_REFUSAL_WORKING,
Subject: ParentObject
));
}
else if (!ParentObject.UseCharge(CHARGE_COST_TO_ACTIVATE))
{
// Refuse to work because no charge is available.

AddPlayerMessage(VariableReplace(
Input: MESSAGE_REFUSAL_NO_CHARGE,
obj: ParentObject
MESSAGE_REFUSAL_NO_CHARGE,
Subject: ParentObject
));
}
else if (IsAggravated() || ParentObject.IsHostileTowards(activator))
{
// Refuse to work because we're too aggravated.

AddPlayerMessage(VariableReplace(
Input: MESSAGE_REFUSAL_AGGRAVATED,
obj: ParentObject
MESSAGE_REFUSAL_AGGRAVATED,
Subject: ParentObject
));
}
else if (inventory.GetObjectCount() == 0)
{
// Refuse to work because our intake is empty.

AddPlayerMessage(VariableReplace(
Input: MESSAGE_REFUSAL_INTAKE_EMPTY,
obj: ParentObject
MESSAGE_REFUSAL_INTAKE_EMPTY,
Subject: ParentObject
));
}
else if (!liquid.IsEmpty())
{
// Refuse to work because our dish has liquid in it already.

AddPlayerMessage(VariableReplace(
Input: MESSAGE_REFUSAL_DISH_OCCUPIED,
obj: ParentObject
MESSAGE_REFUSAL_DISH_OCCUPIED,
Subject: ParentObject
));
}
else
Expand Down Expand Up @@ -231,9 +231,9 @@ public override bool HandleEvent(InventoryActionEvent e)
e.Actor.UseEnergy(1000);

var message = VariableReplace(
Input: MESSAGE_ACTIVATE,
obj: e.Actor,
altObj: ParentObject
MESSAGE_ACTIVATE,
Subject: e.Actor,
Object: ParentObject
);

if (e.Actor.IsPlayer())
Expand Down Expand Up @@ -274,8 +274,8 @@ public bool HandleEvent(BrewingStartedEvent e)
}

AddPlayerMessage(VariableReplace(
Input: MESSAGE_BREWING_BEGIN,
obj: ParentObject
MESSAGE_BREWING_BEGIN,
Subject: ParentObject
));

return true;
Expand All @@ -284,9 +284,9 @@ public bool HandleEvent(BrewingStartedEvent e)
public bool HandleEvent(BrewingContinueEvent e)
{
AddPlayerMessage(VariableReplace(
Input: e.Recipe.Mistake ? MESSAGE_BREWING_CONTINUE_POOR
: MESSAGE_BREWING_CONTINUE_FINE,
obj: ParentObject
e.Recipe.Mistake ? MESSAGE_BREWING_CONTINUE_POOR
: MESSAGE_BREWING_CONTINUE_FINE,
Subject: ParentObject
));
return true;
}
Expand Down Expand Up @@ -316,12 +316,12 @@ public bool HandleEvent(BrewingFinishedEvent e)
: MESSAGE_BREWING_SUCCESS;

AddPlayerMessage(VariableReplace(
Input: message.Replace(
message.Replace(
"=liquid=",
liquidVolume.GetLiquidName()
),

obj: ParentObject
Subject: ParentObject
));

if (e.Recipe.Mistake)
Expand All @@ -332,8 +332,8 @@ public bool HandleEvent(BrewingFinishedEvent e)
else
{
AddPlayerMessage(VariableReplace(
Input: MESSAGE_BREWING_HUH,
obj: ParentObject
MESSAGE_BREWING_HUH,
Subject: ParentObject
));
}

Expand All @@ -347,8 +347,8 @@ public bool HandleEvent(BrewingInterruptedEvent e)
ParentObject.ApplyEffect(new Broken());

AddPlayerMessage(VariableReplace(
Input: MESSAGE_BREWING_INTERRUPTED,
obj: ParentObject
MESSAGE_BREWING_INTERRUPTED,
Subject: ParentObject
));

return true;
Expand Down Expand Up @@ -376,8 +376,8 @@ public override void TurnTick(long turnNumber)
NeedsToCalmDown = false;

AddPlayerMessage(VariableReplace(
Input: MESSAGE_CONCILIATION,
obj: ParentObject
MESSAGE_CONCILIATION,
Subject: ParentObject
));

break;
Expand Down
2 changes: 1 addition & 1 deletion README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Find one on every run in Dardi's kitchen!

See [the spoilers](Spoilers.markdown) for more information.

This version of this mod was tested with Caves of Qud versions 2.0.201.114 Early Access, 2.0.202.74 Beta, and 2.0.202.76 Beta.
This version of this mod was tested with Caves of Qud version 2.0.202.87 Beta.

# Installing

Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"id": "helado_BrewedBeverages",
"title": "Brewed Beverages",
"author": "helado de brownie",
"version": "1.0.1",
"version": "1.0.3",
"description": "Things go in, liquid sustenance comes out",
"tags": "Artifact,Liquid,Script",
"previewImage": "preview.png"
Expand Down

0 comments on commit f8ba1f2

Please sign in to comment.