Skip to content

Commit

Permalink
stub in witches' brew
Browse files Browse the repository at this point in the history
  • Loading branch information
HeladoDeBrownie committed Sep 1, 2021
1 parent 11fa665 commit b8abec5
Show file tree
Hide file tree
Showing 4 changed files with 142 additions and 2 deletions.
8 changes: 7 additions & 1 deletion Books.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,14 @@ in ion. T n the page!
1 lumin s h rshro m : dram of {{C|con a es ens }}
1 u be ry : 1 d am o {{B| reshw ter}}, {{cider|cid }}, {{w|ho y}}, {{m|wine}}, or
(v r rar l ) {{cloning|c i drau t}}
1 goc a bean : a of {{b-B sequence|g coa ex ra t}}
1 s all/lar e ton : {{r|??? ?}}
</page>
<page>
1 goc a bean : a of {{b-B sequence|g coa ex ra t}}
1 str p f i ch o bark and 1 ur y
: 1 f {{M-m sequence|wit h ' rew}}
If o e o n t h an urb r t and, stara pl an th ember d limb
of a sapie t plant will suf ice.

{{c|Not :}} The may othe reci that ren't dete ed.
</page>
Expand Down
67 changes: 67 additions & 0 deletions LiquidWitchesBrew.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
using System.Collections.Generic;
using XRL.World;
using XRL.World.Parts;

namespace XRL.Liquids
{
[IsLiquid]
[System.Serializable]
public class helado_LiquidWitchesBrew : BaseLiquid
{
public new const string ID = "witchesbrew";
public const string ADJECTIVE = "{{M-m sequence|bewitched}}";

public static List<string> Colors = new List<string>(2)
{
"M",
"m",
};

public helado_LiquidWitchesBrew() : base(ID) { }

public override string GetName(LiquidVolume _)
{
return "{{M-m sequence|witches' brew}}";
}

public override string GetAdjective(LiquidVolume _)
{
return ADJECTIVE;
}

public override string GetSmearedAdjective(LiquidVolume _)
{
return ADJECTIVE;
}

public override string GetSmearedName(LiquidVolume _)
{
return ADJECTIVE;
}

public override string GetStainedName(LiquidVolume _)
{
return "{{M-m sequence|witchy}}";
}

public override string GetColor()
{
return Colors[0];
}

public override List<string> GetColors()
{
return Colors;
}

public override float GetValuePerDram()
{
return 50;
}

public override string GetPreparedCookingIngredient()
{
return "helado_Brewed Beverages_Witches Brew";
}
}
}
27 changes: 26 additions & 1 deletion ObjectBlueprints.xml
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,15 @@

<object Name="ProceduralCookingIngredient_helado_Brewed Beverages_Gocoa Extract" Inherits="IngredientMapping">
<tag Name="Units" Value="helado_BrewedBeverages_CookingDomainGocoa_Unit" />
<tag Name="Description" Value="leaping-based" />
<tag Name="Description" Value="movement-based" />
<tag Name="RandomWeight" Value="0" /> <!-- Don't select this ingredient when cooking Canned Have-It-All. -->
</object>

<object Name="ProceduralCookingIngredient_helado_Brewed Beverages_Witches Brew" Inherits="IngredientMapping">
<tag Name="Description" Value="confusion-based" />
<tag Name="RandomWeight" Value="0" />
</object>

<!-- Brewing -->

<object Name="helado_Brewed Beverages_Base Recipe" Inherits="DataBucket">
Expand Down Expand Up @@ -142,11 +147,31 @@
<tag Name="helado_Brewed Beverages_Beverage" Value="helado_Brewed Beverages_Vinewafer Recipe Results" />
</object>

<object Name="helado_Brewed Beverages_Witches Brew Recipe A" Inherits="helado_Brewed Beverages_Base Recipe">
<tag Name="helado_Brewed Beverages_Ingredients" Value="Witchwood Bark,Starapple,PlantLimb" />
<tag Name="helado_Brewed Beverages_Duration" Value="41" />
<tag Name="helado_Brewed Beverages_Beverage" Value="witchesbrew" />
<tag Name="helado_Brewed Beverages_Tricky" />
</object>

<object Name="helado_Brewed Beverages_Witches Brew Recipe B" Inherits="helado_Brewed Beverages_Base Recipe">
<tag Name="helado_Brewed Beverages_Ingredients" Value="Witchwood Bark,Urberry" />
<tag Name="helado_Brewed Beverages_Duration" Value="31" />
<tag Name="helado_Brewed Beverages_Beverage" Value="witchesbrew" />
<tag Name="helado_Brewed Beverages_Tricky" />
</object>

<!-- Debug -->

<object Name="helado_Brewed Beverages_Gocoa Extract Phial" Inherits="Phial">
<part Name="LiquidVolume" StartVolume="1" InitialLiquid="gocoaextract-1000" />

<tag Name="ExcludeFromDynamicEncounters" Value="*noinherit" />
</object>

<object Name="helado_Brewed Beverages_Witches Brew Phial" Inherits="Phial">
<part Name="LiquidVolume" StartVolume="1" InitialLiquid="witchesbrew-1000" />

<tag Name="ExcludeFromDynamicEncounters" Value="*noinherit" />
</object>
</objects>
42 changes: 42 additions & 0 deletions faded.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/usr/bin/env python3
from random import random
from sys import argv, stderr, stdin

DEFAULT_FADED_CHARACTER = ' '
DEFAULT_FADED_CHANCE = 0.35

USAGE = '''\
Usage: ./faded.py [faded character] [faded chance]
faded character:
a string (not necessarily a single character) to randomly replace
characters with
faded chance:
a decimal number between 0 and 1 inclusive representing the probability
that any given character will be replaced with the faded character
'''

def main(
faded_character=DEFAULT_FADED_CHARACTER,
faded_chance=DEFAULT_FADED_CHANCE,
):
faded_chance = float(faded_chance)

for line in stdin:
print(''.join([
maybe_faded(character, faded_character, faded_chance)
for character in line.rstrip()
]))

def maybe_faded(
character,
faded_character=DEFAULT_FADED_CHARACTER,
faded_chance=DEFAULT_FADED_CHANCE,
):
return faded_character if random() < faded_chance else character

if __name__ == '__main__':
try:
main(*argv[1:])
except TypeError:
stderr.write(USAGE)

0 comments on commit b8abec5

Please sign in to comment.