-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
11fa665
commit b8abec5
Showing
4 changed files
with
142 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |