Adding health stuff to Modcharts

This commit is contained in:
craftersshaft
2021-05-25 16:03:45 -04:00
parent e02d9a546f
commit 1af694d72d
3 changed files with 43 additions and 3 deletions

View File

@ -125,7 +125,7 @@ class PlayState extends MusicBeatState
private var curSong:String = "";
private var gfSpeed:Int = 1;
private var health:Float = 1;
public var health:Float = 1; //making public for modchart's sake, but things could go wrong
private var combo:Int = 0;
public static var misses:Int = 0;
private var accuracy:Float = 0.00;
@ -143,8 +143,8 @@ class PlayState extends MusicBeatState
private var generatedMusic:Bool = false;
private var startingSong:Bool = false;
private var iconP1:HealthIcon;
private var iconP2:HealthIcon;
public var iconP1:HealthIcon; //making these public for modcharts cause i dont know how else to do it
public var iconP2:HealthIcon; //what could go wrong?
public var camHUD:FlxCamera;
private var camGame:FlxCamera;
@ -1833,6 +1833,7 @@ class PlayState extends MusicBeatState
if (health > 2)
health = 2;
if (executeModchart && luaModchart != null){luaModchart.setVar('health', health);};
if (healthBar.percent < 20)
iconP1.animation.curAnim.curFrame = 1;
@ -2362,6 +2363,7 @@ class PlayState extends MusicBeatState
else
{
health -= 0.075;
if (executeModchart && luaModchart != null){ luaModchart.setVar('health', health);};
vocals.volume = 0;
if (theFunne)
noteMiss(daNote.noteData, daNote);
@ -2557,6 +2559,7 @@ class PlayState extends MusicBeatState
combo = 0;
misses++;
health -= 0.2;
if (executeModchart && luaModchart != null){ luaModchart.setVar('health', health);};
ss = false;
shits++;
if (FlxG.save.data.accuracyMod == 0)
@ -2565,6 +2568,7 @@ class PlayState extends MusicBeatState
daRating = 'bad';
score = 0;
health -= 0.06;
if (executeModchart && luaModchart != null){ luaModchart.setVar('health', health);};
ss = false;
bads++;
if (FlxG.save.data.accuracyMod == 0)
@ -2576,11 +2580,13 @@ class PlayState extends MusicBeatState
goods++;
if (health < 2)
health += 0.04;
if (executeModchart && luaModchart != null){ luaModchart.setVar('health', health);};
if (FlxG.save.data.accuracyMod == 0)
totalNotesHit += 0.75;
case 'sick':
if (health < 2)
health += 0.1;
if (executeModchart && luaModchart != null){ luaModchart.setVar('health', health);};
if (FlxG.save.data.accuracyMod == 0)
totalNotesHit += 1;
sicks++;