Skip to content

Instantly share code, notes, and snippets.

# =============================================================================
# Copyright(c) 2021 luckytyphlosion
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
@luckytyphlosion
luckytyphlosion / bn5c_xy.lua
Created March 14, 2021 17:22
Script to modify XYZ coords based on an XYZ tuple.
-- =============================================================================
-- Copyright (c) 2021 luckytyphlosion
--
-- Permission to use, copy, modify, and/or distribute this software for any
-- purpose with or without fee is hereby granted.
--
-- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
-- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
-- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
@luckytyphlosion
luckytyphlosion / SF1 Potential jobs.
Created December 19, 2020 02:33
SF1 Potential jobs.
Echo Ridge
===
Person: Little Kid near the school entrance
Reward: SrchEye
Overview: This kid thinks he saw a ghost near the vending machines.
Talk to him and head over there. You see... nothing. Put on your
visualizer and you’ll see a program behind the card shop. Talk to it,
then return to the kid. You convince him he’ll never see it again and
he’ll reward you.
@luckytyphlosion
luckytyphlosion / Pokemon Clover Trainer Data (v1.2)
Last active March 30, 2025 20:46
Pokémon Clover Trainer Data (v1.2)
Anything without IVs means 0 IVs straight, not perfect IVs.
I don't actually know the internal trainer format. I dumped trainer sets using a Bizhawk Lua script which loaded
every single trainer and dumped the trainer party from RAM (link: https://github.com/luckytyphlosion/PokemonBizhawkLua ,
requires nightly Bizhawk build to run). Likewise, any level scaled trainer does not mention if it's level scaled.
I set my party to all L80s, so if a Trainer has around those levels, it's probably level scaled. Note that this means
some mook trainers with Pokémon that learn moves past L80 may have different moves depending on your party levels.
-------------------------------------------------------

If the Battle scene (in Porymap) is MAP_BATTLE_SCENE_NORMAL, then the game will use a default terrain based on various attributes. For example, being in tall grass sets the battle terrain to a tall grass background. Editing these requires adding new code at src/battle_setup.c#L637.

The default battle terrains are defined at src/battle_bg.c#L601 and the pointers to the graphics are defined at src/data/graphics/battle_terrrain.h#L60. You can replace the filepaths with the files of your choosing to replace the default battle terrains. Note that the pointers are scattered about the file so you'll need to track down all the pointers within [src/data/graphics/battle_terrrain.h#L60](https://github.com/rh-hideout/pokeemerald-expans

real_world_map_number_names = (
("ACDCTown", "Class6A"),
("CentralTown", "LansHouse", "LansRoom", "Bathroom", "AsterLand"),
("Class6_1", "Class6_2", "Class1_1", "Class1_2", "1FHallway", "2FHallway", "FoyerHall", "TeachersRoom", "PrincipalsOffice", "ResearchLab1", "ResearchLab2"),
("SeasideTown", "Aquarium1", "Aquarium2", "Auditorium", "ControlRoom"),
("GreenTown", "CourtFoyer", "Courtroom", "PunishmentRoom", "UndergroundRoom"),
("Admin", "SkyTown", "OperatorRoom", "ForceRoom"),
("ExpoSite", "CentralHall", "SeasideHall", "GreenHall", "SkyHall", "CopyBotControlRoom"),
)
@luckytyphlosion
luckytyphlosion / bn6f_map_data.txt
Last active November 20, 2023 04:08
Dump of map/cutscene/npc scripts for MMBN6 Falzar, EXE6 Gregar, and EXE6 Falzar (some standalone cutscene scripts missing)
This file has been truncated, but you can view the full file.
off_8005A78::
.incbin "baserom.gba", 0x5a78, 0x4
off_8005A7C::
.incbin "baserom.gba", 0x5a7c, 0x4
off_8005A80::
.incbin "baserom.gba", 0x5a80, 0x4
off_8005A84::
@luckytyphlosion
luckytyphlosion / sim_spawns.py
Created February 27, 2020 00:41
simulate spawns
import random
def get_num_endermen(simulating, chunks):
chunks = [{} for i in range(256)]
num_mobs = 0
MOB_CAP = 70
num_endermen = 0
MOB_CHOICES = ("spider", "zombie", "zombie_villager", "skeleton", "creeper", "slime", "enderman", "witch")
MOB_WEIGHTS = (100, 95, 5, 100, 100, 100, 10, 5)
@luckytyphlosion
luckytyphlosion / MMBN4 Red Sun All Icons Route (Game 1)
Last active May 20, 2020 15:25
MMBN4 Red Sun All Icons Route
- TalkToMom
- Jack into stove, do the tutorial
- TalkToDad, he gives you 500Z
- Jack back into stove, get 500Z BMD (corner right), jack out
- Jack into Lan's PC
- Check GMDs for Zenny
- You can also get 2000Z from in-battle GMDs in ACDC
- Pick up MiniEnrg BMD
- Go to ACDC3, and pick up CopyDmg *
- Reg Guard1 A immediately once you have one
@luckytyphlosion
luckytyphlosion / payoff_matrix_estimate.py
Created June 12, 2019 01:36
Estimates the Nash Equilibrium of a game. Currently only supports zero-sum games, can probably support nonzero-sum games.
import random
import operator
import timeit
import time
TOTAL_TRIALS = 100
p1_matrix = [
[6, 8, -8, 6],
[9, 10, 1, 9],