Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Ignore release output
release/output
*.xdelta
*.xdelta
*.win
64 changes: 35 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Difficulty options for DELTARUNE. Make the game easy, hard, or nightmare! ( or n
<img src="https://github.com/user-attachments/assets/9e9be8b9-0c3c-4b28-9a12-3aa2d328189c" width="480" />

## Download
**[Latest release](https://github.com/Emmehehe/CustomDifficultyModForDeltarune/releases/tag/1.6.1)**
**[Latest release](https://github.com/Emmehehe/CustomDifficultyModForDeltarune/releases/tag/1.7.0)**

## What you can change
- **Presets** — Select from various difficulty presets
Expand Down Expand Up @@ -220,48 +220,54 @@ Example:

1. Download [UndertaleModTool CLI](https://github.com/UnderminersTeam/UndertaleModTool/releases) for your platform
2. Extract it next to the game files
3. Apply scripts in this order: `modmenu_ch1to4.csx` then `customdifficulty_ch1to4.csx`
3. Apply scripts in this order: `modmenu_ch1to5.csx` then `customdifficulty_ch1to5.csx`

**Windows**

```bat
UndertaleModCli.exe load "chapter1_windows\data.win" --scripts "src\modmenu_ch1to4.csx" --verbose false --output "chapter1_windows\data.win"
UndertaleModCli.exe load "chapter2_windows\data.win" --scripts "src\modmenu_ch1to4.csx" --verbose false --output "chapter2_windows\data.win"
UndertaleModCli.exe load "chapter3_windows\data.win" --scripts "src\modmenu_ch1to4.csx" --verbose false --output "chapter3_windows\data.win"
UndertaleModCli.exe load "chapter4_windows\data.win" --scripts "src\modmenu_ch1to4.csx" --verbose false --output "chapter4_windows\data.win"

UndertaleModCli.exe load "chapter1_windows\data.win" --scripts "src\customdifficulty_ch1to4.csx" --verbose false --output "chapter1_windows\data.win"
UndertaleModCli.exe load "chapter2_windows\data.win" --scripts "src\customdifficulty_ch1to4.csx" --verbose false --output "chapter2_windows\data.win"
UndertaleModCli.exe load "chapter3_windows\data.win" --scripts "src\customdifficulty_ch1to4.csx" --verbose false --output "chapter3_windows\data.win"
UndertaleModCli.exe load "chapter4_windows\data.win" --scripts "src\customdifficulty_ch1to4.csx" --verbose false --output "chapter4_windows\data.win"
UndertaleModCli.exe load "chapter1_windows\data.win" --scripts "src\modmenu_ch1to5.csx" --verbose false --output "chapter1_windows\data.win"
UndertaleModCli.exe load "chapter2_windows\data.win" --scripts "src\modmenu_ch1to5.csx" --verbose false --output "chapter2_windows\data.win"
UndertaleModCli.exe load "chapter3_windows\data.win" --scripts "src\modmenu_ch1to5.csx" --verbose false --output "chapter3_windows\data.win"
UndertaleModCli.exe load "chapter4_windows\data.win" --scripts "src\modmenu_ch1to5.csx" --verbose false --output "chapter4_windows\data.win"
UndertaleModCli.exe load "chapter5_windows\data.win" --scripts "src\modmenu_ch1to5.csx" --verbose false --output "chapter5_windows\data.win"

UndertaleModCli.exe load "chapter1_windows\data.win" --scripts "src\customdifficulty_ch1to5.csx" --verbose false --output "chapter1_windows\data.win"
UndertaleModCli.exe load "chapter2_windows\data.win" --scripts "src\customdifficulty_ch1to5.csx" --verbose false --output "chapter2_windows\data.win"
UndertaleModCli.exe load "chapter3_windows\data.win" --scripts "src\customdifficulty_ch1to5.csx" --verbose false --output "chapter3_windows\data.win"
UndertaleModCli.exe load "chapter4_windows\data.win" --scripts "src\customdifficulty_ch1to5.csx" --verbose false --output "chapter4_windows\data.win"
UndertaleModCli.exe load "chapter5_windows\data.win" --scripts "src\customdifficulty_ch1to5.csx" --verbose false --output "chapter5_windows\data.win"
```

**macOS**

```bash
./UndertaleModCli load chapter1_mac/game.ios --scripts src/modmenu_ch1to4.csx --verbose false --output chapter1_mac/game.ios
./UndertaleModCli load chapter2_mac/game.ios --scripts src/modmenu_ch1to4.csx --verbose false --output chapter2_mac/game.ios
./UndertaleModCli load chapter3_mac/game.ios --scripts src/modmenu_ch1to4.csx --verbose false --output chapter3_mac/game.ios
./UndertaleModCli load chapter4_mac/game.ios --scripts src/modmenu_ch1to4.csx --verbose false --output chapter4_mac/game.ios

./UndertaleModCli load chapter1_mac/game.ios --scripts src/customdifficulty_ch1to4.csx --verbose false --output chapter1_mac/game.ios
./UndertaleModCli load chapter2_mac/game.ios --scripts src/customdifficulty_ch1to4.csx --verbose false --output chapter2_mac/game.ios
./UndertaleModCli load chapter3_mac/game.ios --scripts src/customdifficulty_ch1to4.csx --verbose false --output chapter3_mac/game.ios
./UndertaleModCli load chapter4_mac/game.ios --scripts src/customdifficulty_ch1to4.csx --verbose false --output chapter4_mac/game.ios
./UndertaleModCli load chapter1_mac/game.ios --scripts src/modmenu_ch1to5.csx --verbose false --output chapter1_mac/game.ios
./UndertaleModCli load chapter2_mac/game.ios --scripts src/modmenu_ch1to5.csx --verbose false --output chapter2_mac/game.ios
./UndertaleModCli load chapter3_mac/game.ios --scripts src/modmenu_ch1to5.csx --verbose false --output chapter3_mac/game.ios
./UndertaleModCli load chapter4_mac/game.ios --scripts src/modmenu_ch1to5.csx --verbose false --output chapter4_mac/game.ios
./UndertaleModCli load chapter5_mac/game.ios --scripts src/modmenu_ch1to5.csx --verbose false --output chapter5_mac/game.ios

./UndertaleModCli load chapter1_mac/game.ios --scripts src/customdifficulty_ch1to5.csx --verbose false --output chapter1_mac/game.ios
./UndertaleModCli load chapter2_mac/game.ios --scripts src/customdifficulty_ch1to5.csx --verbose false --output chapter2_mac/game.ios
./UndertaleModCli load chapter3_mac/game.ios --scripts src/customdifficulty_ch1to5.csx --verbose false --output chapter3_mac/game.ios
./UndertaleModCli load chapter4_mac/game.ios --scripts src/customdifficulty_ch1to5.csx --verbose false --output chapter4_mac/game.ios
./UndertaleModCli load chapter5_mac/game.ios --scripts src/customdifficulty_ch1to5.csx --verbose false --output chapter5_mac/game.ios
```

**Linux w\ Proton**

```bash
./UndertaleModCli load chapter1_windows/data.win --scripts src/modmenu_ch1to4.csx --verbose false --output chapter1_windows/data.win
./UndertaleModCli load chapter2_windows/data.win --scripts src/modmenu_ch1to4.csx --verbose false --output chapter2_windows/data.win
./UndertaleModCli load chapter3_windows/data.win --scripts src/modmenu_ch1to4.csx --verbose false --output chapter3_windows/data.win
./UndertaleModCli load chapter4_windows/data.win --scripts src/modmenu_ch1to4.csx --verbose false --output chapter4_windows/data.win

./UndertaleModCli load chapter1_windows/data.win --scripts src/customdifficulty_ch1to4.csx --verbose false --output chapter1_windows/data.win
./UndertaleModCli load chapter2_windows/data.win --scripts src/customdifficulty_ch1to4.csx --verbose false --output chapter2_windows/data.win
./UndertaleModCli load chapter3_windows/data.win --scripts src/customdifficulty_ch1to4.csx --verbose false --output chapter3_windows/data.win
./UndertaleModCli load chapter4_windows/data.win --scripts src/customdifficulty_ch1to4.csx --verbose false --output chapter4_windows/data.win
./UndertaleModCli load chapter1_windows/data.win --scripts src/modmenu_ch1to5.csx --verbose false --output chapter1_windows/data.win
./UndertaleModCli load chapter2_windows/data.win --scripts src/modmenu_ch1to5.csx --verbose false --output chapter2_windows/data.win
./UndertaleModCli load chapter3_windows/data.win --scripts src/modmenu_ch1to5.csx --verbose false --output chapter3_windows/data.win
./UndertaleModCli load chapter4_windows/data.win --scripts src/modmenu_ch1to5.csx --verbose false --output chapter4_windows/data.win
./UndertaleModCli load chapter5_windows/data.win --scripts src/modmenu_ch1to5.csx --verbose false --output chapter5_windows/data.win

./UndertaleModCli load chapter1_windows/data.win --scripts src/customdifficulty_ch1to5.csx --verbose false --output chapter1_windows/data.win
./UndertaleModCli load chapter2_windows/data.win --scripts src/customdifficulty_ch1to5.csx --verbose false --output chapter2_windows/data.win
./UndertaleModCli load chapter3_windows/data.win --scripts src/customdifficulty_ch1to5.csx --verbose false --output chapter3_windows/data.win
./UndertaleModCli load chapter4_windows/data.win --scripts src/customdifficulty_ch1to5.csx --verbose false --output chapter4_windows/data.win
./UndertaleModCli load chapter5_windows/data.win --scripts src/customdifficulty_ch1to5.csx --verbose false --output chapter5_windows/data.win
```

**Notes**
Expand Down
4 changes: 2 additions & 2 deletions install-linux-proton.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ set -euo pipefail

SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
SCRIPTS_DIR="$SCRIPT_DIR/src"
MOD_SCRIPTS=("$SCRIPTS_DIR/modmenu_ch1to4.csx" "$SCRIPTS_DIR/customdifficulty_ch1to4.csx")
MOD_SCRIPTS=("$SCRIPTS_DIR/modmenu_ch1to5.csx" "$SCRIPTS_DIR/customdifficulty_ch1to5.csx")
CACHE_DIR="$HOME/.cache/diffmod-utmt"
mkdir -p "$CACHE_DIR"

Expand Down Expand Up @@ -118,7 +118,7 @@ detect_game_dir_if_needed() {
find_chapter_files() {
local RES="$1"
local files=()
for ch in 1 2 3 4; do
for ch in 1 2 3 4 5; do
local f="$RES/chapter${ch}_windows/data.win"
[[ -f "$f" ]] && files+=("$f")
done
Expand Down
4 changes: 2 additions & 2 deletions install-macos.command
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ set -euo pipefail

SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
SCRIPTS_DIR="$SCRIPT_DIR/src"
MOD_SCRIPTS=("$SCRIPTS_DIR/modmenu_ch1to4.csx" "$SCRIPTS_DIR/customdifficulty_ch1to4.csx")
MOD_SCRIPTS=("$SCRIPTS_DIR/modmenu_ch1to5.csx" "$SCRIPTS_DIR/customdifficulty_ch1to5.csx")
CACHE_DIR="$HOME/.cache/diffmod-utmt"
mkdir -p "$CACHE_DIR"

Expand Down Expand Up @@ -131,7 +131,7 @@ APP
find_chapter_files() {
local RES="$1"
local files=()
for ch in 1 2 3 4; do
for ch in 1 2 3 4 5; do
local f="$RES/chapter${ch}_mac/game.ios"
[[ -f "$f" ]] && files+=("$f")
done
Expand Down
6 changes: 3 additions & 3 deletions install-windows.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ function Die($m){ Write-Host "`n[ERROR] $m" -ForegroundColor Red; exit 1 }
# Resolve script & mod script paths
$ScriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path
$ScriptsDir = Join-Path $ScriptDir 'src'
$ModMenuScript = (Join-Path $ScriptsDir 'modmenu_ch1to4.csx')
$CustDiffScript = (Join-Path $ScriptsDir 'customdifficulty_ch1to4.csx')
$ModMenuScript = (Join-Path $ScriptsDir 'modmenu_ch1to5.csx')
$CustDiffScript = (Join-Path $ScriptsDir 'customdifficulty_ch1to5.csx')

# Verify scripts exist
if (-not $NoModMenu) {
Expand Down Expand Up @@ -187,7 +187,7 @@ function Detect-GameDir {
function Find-ChapterFiles {
param([string]$GamePath)
$files = @()
for ($ch = 1; $ch -le 4; $ch++) {
for ($ch = 1; $ch -le 5; $ch++) {
# Windows uses chapterX_windows\data.win pattern
$f = Join-Path $GamePath "chapter${ch}_windows\data.win"
if (Test-Path $f) {
Expand Down
2 changes: 1 addition & 1 deletion release/custom-difficulty-drmod-demo/_deltamodInfo.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"metadata": {
"name": "Custom Difficulty",
"version": "1.6.1",
"version": "1.7.0",
"description": "Difficulty options for DELTARUNE. Make the game Easy, Hard, or Nightmare. No-hit options included.",
"author": ["Emmahaha"],
"packageID": "com.emmahaha.customdiffdemo",
Expand Down
Binary file modified release/custom-difficulty-drmod-demo/_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 7 additions & 2 deletions release/custom-difficulty-drmod-fullgame/_deltamodInfo.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"metadata": {
"name": "Custom Difficulty",
"version": "1.6.1",
"version": "1.7.0",
"description": "Difficulty options for DELTARUNE. Make the game Easy, Hard, or Nightmare. No-hit options included.",
"author": ["Emmahaha"],
"packageID": "com.emmahaha.customdiff",
"game": "toby.deltarune",
"url": "https://gamebanana.com/mods/613308",
"tags": ["customization", "gameplay"]
},
"deltaruneTargetVersion": "1.04",
"deltaruneTargetVersion": "TODO",
"neededFiles": [
{
"file": "chapter1_windows/data.win",
Expand All @@ -30,5 +30,10 @@
"file": "chapter4_windows/data.win",
"checksum": "07e2df1088e56532b992fc9c59f88a4d66420ada4da9ff49ba6823a7f2cc3d47"
}

{
"file": "chapter5_windows/data.win",
"checksum": "TODO"
}
]
}
Binary file modified release/custom-difficulty-drmod-fullgame/_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions release/custom-difficulty-drmod-fullgame/modding.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
<patch type="xdelta" patch="./chapter2.xdelta" to="./chapter2_windows/data.win" />
<patch type="xdelta" patch="./chapter3.xdelta" to="./chapter3_windows/data.win" />
<patch type="xdelta" patch="./chapter4.xdelta" to="./chapter4_windows/data.win" />
<patch type="xdelta" patch="./chapter5.xdelta" to="./chapter5_windows/data.win" />
2 changes: 1 addition & 1 deletion release/modmenu-drmod-demo/_deltamodInfo.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"metadata": {
"name": "Mod Menu",
"version": "1.6.0",
"version": "1.7.0",
"description": "Mod menu for DELTARUNE. Framework for mods to add option menus.",
"author": ["Emmahaha"],
"packageID": "com.emmahaha.modmenudemo",
Expand Down
Binary file modified release/modmenu-drmod-demo/_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 7 additions & 2 deletions release/modmenu-drmod-fullgame/_deltamodInfo.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"metadata": {
"name": "Mod Menu",
"version": "1.6.0",
"version": "1.7.0",
"description": "Mod menu for DELTARUNE. Framework for mods to add option menus.",
"author": ["Emmahaha"],
"packageID": "com.emmahaha.modmenu",
"game": "toby.deltarune",
"url": "https://gamebanana.com/mods/615910",
"tags": ["other"]
},
"deltaruneTargetVersion": "1.04",
"deltaruneTargetVersion": "TODO",
"neededFiles": [
{
"file": "chapter1_windows/data.win",
Expand All @@ -30,5 +30,10 @@
"file": "chapter4_windows/data.win",
"checksum": "07e2df1088e56532b992fc9c59f88a4d66420ada4da9ff49ba6823a7f2cc3d47"
}

{
"file": "chapter5_windows/data.win",
"checksum": "TODO"
}
]
}
Binary file modified release/modmenu-drmod-fullgame/_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions release/modmenu-drmod-fullgame/modding.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
<patch type="xdelta" patch="./chapter2.xdelta" to="./chapter2_windows/data.win" />
<patch type="xdelta" patch="./chapter3.xdelta" to="./chapter3_windows/data.win" />
<patch type="xdelta" patch="./chapter4.xdelta" to="./chapter4_windows/data.win" />
<patch type="xdelta" patch="./chapter5.xdelta" to="./chapter5_windows/data.win" />
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ if (alreadyInstalled != null) {
}

// Prefire checks
const string expectedDisplayName = "DELTARUNE \\S+ ([1-4](?:&2)?)";
const string expectedDisplayName = "DELTARUNE \\S+ ([1-5](?:&2)?)";
if (!Regex.IsMatch(displayName, expectedDisplayName, RegexOptions.IgnoreCase, TimeSpan.FromMilliseconds(500)))
{
ScriptError($"Error 0: data file display name does not match expected: '{expectedDisplayName}', actual display name: '{displayName}'.");
Expand Down Expand Up @@ -240,6 +240,21 @@ if (ch_no > 3)
string[] loadCh3 = {"gml_GlobalScript_scr_load_chapter3"};
loadLikes = loadLikes.Concat(loadCh3).ToArray();
}
if (ch_no > 4)
{
string[] loadCh4 = {"gml_GlobalScript_scr_load_chapter4"};
loadLikes = loadLikes.Concat(loadCh3).ToArray();
}
// if (ch_no > 5)
// {
// string[] loadCh5 = {"gml_GlobalScript_scr_load_chapter5"};
// loadLikes = loadLikes.Concat(loadCh3).ToArray();
// }
// if (ch_no > 6)
// {
// string[] loadCh6 = {"gml_GlobalScript_scr_load_chapter6"};
// loadLikes = loadLikes.Concat(loadCh3).ToArray();
// }
foreach (string scrName in loadLikes)
{
importGroup.QueueTrimmedLinesFindReplace(scrName, $"ossafe_file_text_close{(scrName.EndsWith("_ch1") ? "_ch1" : "")}(myfileid);", @$"
Expand Down Expand Up @@ -1091,6 +1106,15 @@ if (ch_no == 2 || ch_no == 0) {
importGroup.QueueFindReplace("gml_Object_obj_sneo_wireheart_Draw_0", "global.monsterhp[0] -= ceil(global.monstermaxhp[0] * 0.03);",
"global.monsterhp[0] -= ceil(global.diff_plrdmg * global.monstermaxhp[0] * 0.03);");
}
// fix susie vs. lancer softlock
if (ch_no == 1 || ch_no == 0) {
importGroup.QueueFindReplace("gml_GlobalScript_scr_monstersetup", "global.monstermaxhp[myself] = 2400;", "global.monstermaxhp[myself] = ceil(global.diff_plrdmg * 2400);");
importGroup.QueueFindReplace("gml_GlobalScript_scr_monstersetup", "global.monsterhp[myself] = 2400;", "global.monsterhp[myself] = ceil(global.diff_plrdmg * 2400);");
if (ch_no == 0) {
importGroup.QueueFindReplace("gml_GlobalScript_scr_monstersetup_ch1", "global.monstermaxhp[myself] = 2400;", "global.monstermaxhp[myself] = ceil(global.diff_plrdmg * 2400);");
importGroup.QueueFindReplace("gml_GlobalScript_scr_monstersetup_ch1", "global.monsterhp[myself] = 2400;", "global.monsterhp[myself] = ceil(global.diff_plrdmg * 2400);");
}
}

// Apply Game Board Player Damage
if (ch_no == 3)
Expand Down
5 changes: 3 additions & 2 deletions src/modmenu_ch1to4.csx → src/modmenu_ch1to5.csx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ if (alreadyInstalled != null) {
}

// Prefire checks
const string expectedDisplayName = "DELTARUNE \\S+ ([1-4](?:&2)?)";
const string expectedDisplayName = "DELTARUNE \\S+ ([1-5](?:&2)?)";
if (!Regex.IsMatch(displayName, expectedDisplayName, RegexOptions.IgnoreCase, TimeSpan.FromMilliseconds(500)))
{
ScriptError($"Error 0: data file display name does not match expected: '{expectedDisplayName}', actual display name: '{displayName}'.");
Expand Down Expand Up @@ -136,7 +136,7 @@ UndertaleModLib.Compiler.CodeImportGroup importGroup = new(Data){
ThrowOnNoOpFindReplace = true
};

// The demo is on an old version of game maker that doesn't have the string_split, string_ends_with, or string_trim functions so add implementations
// The demo is on an old version of game maker that doesn't have the string_split, string_ends_with, or string_trim functions so add (very) basic implementations
string[] darkcons = {"gml_Object_obj_darkcontroller"};
if (ch_no == 0)
{
Expand Down Expand Up @@ -253,6 +253,7 @@ string global_lang = @"(global.modmenu_langoverride != """" ? global.modmenu_lan
Func<string,string,string> ds_map_find_value_lang =
(id, key) => @$"(ds_map_exists({id}, {key} + ""_"" + {global_lang}) ? ds_map_find_value({id}, {key} + ""_"" + {global_lang}) : ds_map_find_value({id}, {key} + ""_en""))";


// Add menu draw code
foreach (string darkcon in darkcons)
{
Expand Down