1
0
Fork 0
mirror of https://github.com/ninjamuffin99/Funkin.git synced 2024-12-24 14:16:56 +00:00

cheats on debug only

This commit is contained in:
George FunBook 2021-02-23 18:57:49 -06:00
parent d9371cc8eb
commit 38496ea74d
3 changed files with 26 additions and 4 deletions

View file

@ -116,7 +116,7 @@
<haxelib name="newgrounds" unless="switch"/>
<haxelib name="faxe" if='switch'/>
<haxelib name="polymod"/>
<!-- <haxelib name="hxcpp-debug-server" if="desktop"/> -->
<haxelib name="hxcpp-debug-server" if="desktop debug"/>
<!-- <haxelib name="markdown" /> -->
<!-- <haxelib name="HtmlParser" /> -->
@ -168,6 +168,7 @@
<!-- <haxedef name="SKIP_TO_PLAYSTATE" if="debug" /> -->
<haxedef name="CAN_OPEN_LINKS" unless="switch"/>
<haxedef name="CAN_CHEAT" if="switch debug"/>
<section if="newgrounds">
<!-- Enables Ng.core.verbose -->

View file

@ -30,7 +30,9 @@ enum abstract Action(String) to String from String
var BACK = "back";
var PAUSE = "pause";
var RESET = "reset";
#if CAN_CHEAT
var CHEAT = "cheat";
#end
}
#else
@:enum
@ -52,7 +54,9 @@ abstract Action(String) to String from String
var BACK = "back";
var PAUSE = "pause";
var RESET = "reset";
#if CAN_CHEAT
var CHEAT = "cheat";
#end
}
#end
@ -77,7 +81,9 @@ enum Control
ACCEPT;
BACK;
PAUSE;
#if CAN_CHEAT
CHEAT;
#end
}
enum KeyboardScheme
@ -110,8 +116,10 @@ class Controls extends FlxActionSet
var _back = new FlxActionDigital(Action.BACK);
var _pause = new FlxActionDigital(Action.PAUSE);
var _reset = new FlxActionDigital(Action.RESET);
#if CAN_CHEAT
var _cheat = new FlxActionDigital(Action.CHEAT);
#end
#if (haxe >= "4.0.0")
var byName:Map<String, FlxActionDigital> = [];
#else
@ -201,11 +209,13 @@ class Controls extends FlxActionSet
inline function get_RESET()
return _reset.check();
#if CAN_CHEAT
public var CHEAT(get, never):Bool;
inline function get_CHEAT()
return _cheat.check();
#end
#if (haxe >= "4.0.0")
public function new(name, scheme = None)
{
@ -227,7 +237,9 @@ class Controls extends FlxActionSet
add(_back);
add(_pause);
add(_reset);
#if CAN_CHEAT
add(_cheat);
#end
for (action in digitalActions)
byName[action.name] = action;
@ -255,7 +267,9 @@ class Controls extends FlxActionSet
add(_back);
add(_pause);
add(_reset);
#if CAN_CHEAT
add(_cheat);
#end
for (action in digitalActions)
byName[action.name] = action;
@ -309,7 +323,9 @@ class Controls extends FlxActionSet
case BACK: _back;
case PAUSE: _pause;
case RESET: _reset;
#if CAN_CHEAT
case CHEAT: _cheat;
#end
}
}
@ -353,8 +369,10 @@ class Controls extends FlxActionSet
func(_pause, JUST_PRESSED);
case RESET:
func(_reset, JUST_PRESSED);
#if CAN_CHEAT
case CHEAT:
func(_cheat, JUST_PRESSED);
#end
}
}
@ -644,7 +662,9 @@ class Controls extends FlxActionSet
Control.PAUSE => [START],
//Swap Y and X for switch
Control.RESET => [Y],
#if CAN_CHEAT
Control.CHEAT => [X]
#end
]);
#end
}

View file

@ -1452,12 +1452,13 @@ class PlayState extends MusicBeatState
trace("RESET = True");
}
// CHEAT = brandon's a pussy
#if CAN_CHEAT // brandon's a pussy
if (controls.CHEAT)
{
health += 1;
trace("User is cheating!");
}
#end
if (health <= 0)
{