Skip to content

Instantly share code, notes, and snippets.

View Dobby233Liu's full-sized avatar

Liu Wenyuan Dobby233Liu

View GitHub Profile
@Dobby233Liu
Dobby233Liu / gen.py
Created July 27, 2022 01:38
attempted sprite font generator
from PIL import Image, ImageFont, ImageDraw, ImageColor
SEPERATOR_COLOR = ImageColor.getrgb("#0000ffff")
GLYPHS = " abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.:<[=>\\{]!|@~_\"`$%'()&}+*,-^#?/;"
SIZE = 12
ANCHOR = "la"
FILL = "white"
FEATURES = ""
font = ImageFont.truetype("arial.ttf", SIZE)
from pydub import AudioSegment
org = input("org file : ")
out = input("out file : ")
aud = AudioSegment.from_file(org)
channels = aud.split_to_mono()
for i in range(0, len(channels), 2):
l_sub_r = channels[i].overlay(channels[i + 1].invert_phase())
r_sub_l = channels[i + 1].overlay(channels[i].invert_phase())
@Dobby233Liu
Dobby233Liu / USAGE.txt
Last active July 4, 2022 09:19
hacky script to extract Deltarune: A Different Snowgrave text
python sc.py <project.json> <scan.json> > text.json
@Dobby233Liu
Dobby233Liu / damage.js
Last active June 11, 2022 02:46
cleanup of scr_damage in DELTARUNE Chapter 2 for reference
function selectRandomTarget()
{
if (!partyCharacter[0].targetable && !partyCharacter[1].targetable && !partyCharacter[2].targetable)
return 3
var _target = choose(0, 1, 2)
while (!partyCharacter[_target].targetable)
_target = choose(0, 1, 2)
return _target
}
; ---------------------------------------------------------------------------
cpu 68000
include "sonic3k.macrosetup.asm" ; include a few basic macros
include "sonic3k.macros.asm" ; include some simplifying macros and functions
include "sonic3k.constants.asm" ; include some constants
org 0
; ---------------------------------------------------------------------------
strip_padding = 1
Size_of_Snd_driver_guess = $1200
import json
lang_en = {}
with open("lang_en.json", "r", encoding="utf-8") as l_en_file:
lang_en = json.load(l_en_file)
lang_ja = {}
with open("lang_ja.json", "r", encoding="utf-8") as l_ja_file:
lang_ja = json.load(l_ja_file)
items = {}
@Dobby233Liu
Dobby233Liu / change_inst.py
Last active April 4, 2022 07:29
Change all instruments in a MIDI file.
# 2022 Dobby233Liu
#
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either in source code form or as a compiled
# binary, for any purpose, commercial or non-commercial, and by any
# means.
#
# In jurisdictions that recognize copyright laws, the author or authors
"""Tool that helps decompiling a Ren'Py game. Early prototype."""
import glob
import unrpyc
import unrpa
import os
import tarfile
import traceback
import shutil
import sys
import random
random.seed()
lettertable = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz "
def rand_word():
while True:
random.seed()
r = ""
len = random.randint(6, 12)
@Dobby233Liu
Dobby233Liu / thbgm_cmt.py
Created May 23, 2021 07:07
dirty py3 to parse musiccmt.txt
with open("musiccmt.txt","r",encoding="shift-jis") as c:
cmt = c.readlines()
writemode=None
linen=0
max=9
total=0
m3u8=open("musicroom.m3u8","w",encoding="utf-8")
m3u8.write("#EXTM3U\n")
str=""
for line in cmt: