Skip to content

Instantly share code, notes, and snippets.

View egocarib's full-sized avatar
🌴
On vacation

egocarib

🌴
On vacation
View GitHub Profile
Qud look: Maximum depth >> 3
=======================================
<div class="qud-box-wrapper {{#ifeq:
{{{bordercolor|}}}| y |white-border|
}}"><div class="qud-box"><span class="qud-box-header">
{{Qud text|&amp;y
{{{title|
@egocarib
egocarib / characterInfobox.css
Last active December 26, 2019 07:52
CSS for Qud Wiki Character Infobox
/*
* QUD COLORS AND FONTS
* ====================
*/
:root {
--qud-color-y: #ffffff;
--qud-color-y-dark: #b1c9c3;
--qud-color-r: #d74200;
--qud-color-r-dark: #a64a2e;
--qud-color-o: #e99f10;
@egocarib
egocarib / gist:806436f21aacfd7f77740281e061d34d
Created August 11, 2019 19:24
qud character inventory module
character inventory module
==========================
Requirements: allow specifying an item list, quantity for each item, and whether each item is equipped. Then parse those items/details and output the HTML.
For example, the module call might look like this:
{{#invoke:Inventory | FormatInventory | powered exoskeleton~1~yes`overloaded laser pistol~2~yes`plastifier jerkin~1~no }}
Maybe there's a nicer way to format the input string instead of using ~ and ` delimiters, but I'm not sure. Or maybe it could be split into two modules (one for the wrapper HTML, and one for individual items). Feel free to do whatever makes the most sense!
@egocarib
egocarib / Example Qud Transpiler
Created August 20, 2020 04:56
Example Qud Transpiler
using System;
using System.Linq;
using System.Reflection;
using System.Reflection.Emit;
using System.Collections.Generic;
using HarmonyLib;
using XRL.Core;
using XRL.World.Parts;
using UnityEngine;
@egocarib
egocarib / gist:ea022799cca8a102d14c54a22c45efe0
Created October 22, 2020 01:50
pillow transparent gif creation workaround
# This code adapted from https://github.com/python-pillow/Pillow/issues/4644 to resolve an issue
# described in https://github.com/python-pillow/Pillow/issues/4640
#
# There is a known issue with the Pillow library that messes up GIF transparency by replacing the
# transparent pixels with black pixels (among other issues) when the GIF is saved using PIL.Image.save().
# This code works around the issue and allows us to properly generate transparent GIFs.
from typing import Tuple, List, Union
from collections import defaultdict
from random import randrange
------------------
TEST HISTORY 1:
------------------
*** Region added to history: the bulb-worshipping Autarchy of Kimor ***
------------New location: Sapad
############### UNORDERED EVENTS START ##################
Gospel: 206 In 4273 BR, Antidokht II won a decisive victory against the combined forces of Saarrakesh Barrio at the bloody Battle of Kinevuh, though he lost his prized {{R-c-r-C-R-c-r-C sequence|Token's Star}} during the course of the conflict. As a result of the battle, Kinevuh was so rife with bad omens that it was renamed the Fateful Flats.
TombIn: 206 In the Year of the Abandoned Monk, Antidokht II vanquished the Astral-Temple Society, who usurped his star torus. Let the rotten luck of the Fateful Flats serve as testament to the might of Antidokht II and a lesson to those who would challenge him.
Gospel: 198 Sometime in 4281 BR, after several tumultuous years, the sultan of Qud abdicated the throne. Because of Antidokht II's reputation for murdering someone by flipping a coin and agreeing to kill either her or himself based on the outcome, he was chosen as the successor.
TombIn: 198 Remember the godly Year of the Viridian Companion,
@egocarib
egocarib / gist:59e1632fa13e601b294911a86f02a4ee
Created November 20, 2020 14:24
Historic Site / Sultan Info Dump
==============================================
SULTAN CULT INFO
==============================================
-----------------------------------------
SULTAN: Dapur I
-----------------------------------------
PERIOD: 1
SULTAN DOMAINS: [ice]
@egocarib
egocarib / HistorySpiceHelper.cs
Last active December 6, 2020 19:54
Helper Method to Add Data to HistorySpice.json
using SimpleJSON;
namespace YourModName
{
public static class History
{
// Adds an string to the specified history spice node array. For example, if we want to add
// a new item to the winter eremite profession array, we might call this method as follows:
//
// AddToHistorySpice("spice.professions.winter eremite.items", "snowy ideal");
@egocarib
egocarib / RemoveFungalVisionWish.cs
Last active December 9, 2020 15:36
Removes fungal vision if it was wished for with fungalvision wish. You'll need to save this as a .cs file and put it in your Mods directory. For more info, see https://cavesofqud.gamepedia.com/Modding:Installing_a_mod
using XRL.Wish;
using XRL.World.Effects;
namespace MiscWishes
{
[HasWishCommand]
class RemoveFungalVisionWish
{
[WishCommand(Command = "removefungalvision")]
public static void SaveBlueprintTexture()