Skip to content

Instantly share code, notes, and snippets.

@vmedea
vmedea / fallow.txt
Last active November 24, 2024 20:06
All text from Ada Rook's fallow
# Text from the game "Fallow"
All the text and dialog from the game Fallow from Ada Rook, 2021.
Roughly sorted per location and according to the game timeline. Includes only the game story, does not include the out of bounds areas.
Warning: spoilers (by definition).
## Intro
@vmedea
vmedea / stream.py
Created March 23, 2024 09:33
Print and colorize "dream stream" from dreams-of-an-electric-mind.webflow.io into the active terminal.
#!/usr/bin/env python3
# Mara Huldra 2024
# SPDX-License-Identifier: MIT
'''
Print and colorize "dream stream" from dreams-of-an-electric-mind.webflow.io into the active terminal.
'''
import argparse
import datetime
from html.parser import HTMLParser
import os
@vmedea
vmedea / FoxNav.gd
Created May 30, 2023 17:08
AStar2D+physics based navigation for Godot 4
# Physics-collision-based navigation grid, a quick and simple alternative for navigation polygons.
# Part of "Xenomusa" (C) Mara Huldra 2022
# SPDX-License-Identifier: MIT
extends Node2D
@export var tilemap: TileMap
@export var excludes: Array[CollisionObject2D]
@export_flags_2d_physics var nav_physics_layers: int = 1
var update_nav_grid: bool = false
@vmedea
vmedea / ScreenshotHandler.gd
Last active May 22, 2023 15:35
Godot 4 screenshot handler
# Godot screenshot handler.
# Part of "Xenomusa" (C) Mara Huldra 2022-2023
# SPDX-License-Identifier: MIT
#
# To configure in project settings:
# - Add script as autoload.
# - Assign a key (say, F12) to action "screenshot".
extends Node
# Screenshot target setup.
@vmedea
vmedea / RexPaint.gd
Last active July 8, 2024 16:24
Rexpaint .xp loader, updated for Godot 4
# Rexpaint .xp loader, updated for Godot 4.
# Part of "Xenomusa" (C) Mara Huldra 2022
# Based on rex-is-godot by RisingThumb.
# SPDX-License-Identifier: MIT
extends Object # DO NOT INSTANTIATE
class_name RexPaint
## Offset into image pixel for glyph.
const OFS_GLYPH := 0
## Offset into image pixel for foreground color.
@vmedea
vmedea / tileset_templater.gd
Last active December 5, 2022 23:23
Godot tile data instancing plugin for consistent tile configurations
# Tile data instancing plugin for consistent tile configurations.
# Part of "Xenomusa" (C) Mara Huldra 2022
# SPDX-License-Identifier: MIT
@tool
extends EditorPlugin
# Avaiable tileset templates
enum TemplateType {
TERRAIN = 0, # 7x7 terrain template
WALL = 1, # 4x4 wall template
@vmedea
vmedea / parse_xbin.py
Last active February 3, 2025 12:05
Command line tarot
#!/usr/bin/env python3
# (C) Mara Huldra 2022
# SPDX-License-Identifier: MIT
'''
Parser for XBin file (ANSI/ASCII/PETSCII art grid).
Convert to unicode and print it out.
'''
import itertools
import struct
import sys
@vmedea
vmedea / install-fallow.sh
Last active September 3, 2021 22:54
Build and install script for Fallow under Linux using mkxp
#!/bin/bash
# Install and build dependencies for mkxp for running the game Fallow by Ada Rook.
# Script by Mara Huldra 2021.
# SPDX-License-Identifier: MIT
# Tested on Ubuntu 20.04 and Debian.
set -e
PREFIX="${PWD}/fallow-install"
BUILDDIR="${PWD}/fallow-build"
FALLOWHOME="${HOME}/.steam/debian-installation/steamapps/common/Fallow"
PAR=1
@vmedea
vmedea / riscv-assembler.py
Last active April 23, 2021 07:18
Minimalistic RISC-V assembler Python class
'''
RISC-V assembler.
'''
# Mara Huldra 2021, based on riscv-assembler by Kaya Celebi
# SPDX-License-Identifier: MIT
from collections import namedtuple
__all__ = ['Assembler']
class UnknownInstruction(Exception):
@vmedea
vmedea / fontconv.py
Last active March 29, 2021 19:53
Font conversion utility (rexpaint)
'''
Font conversion utility (rexpaint).
'''
# Mara Huldra 2021 :: SPDX-License-Identifier: MIT
from collections import namedtuple
from PIL import Image, ImageFont, ImageDraw
# Hardcoded text and background color RGBA, this matches rexpaint's existing fonts
FG_COLOR = (255, 255, 255, 255)