Skip to content
This repository has been archived by the owner on Jul 9, 2023. It is now read-only.

Dave and Bambi engine (WIP) #235

Closed
wants to merge 44 commits into from
Closed
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
81b4b05
Ok, heres the things!
Wither362 Aug 24, 2022
8023ad9
This shouldn’t be here
Wither362 Aug 26, 2022
8a4f652
Is this the problem?
Wither362 Aug 26, 2022
293c0c0
Update PlayState.hx
Wither362 Aug 27, 2022
88512ac
Merge branch 'main' into 10--For-dave-and-bambi-lovers
Theoyeah Aug 28, 2022
9ac9a9c
No more by default shaders
Wither362 Sep 4, 2022
2b87d77
Merge branch 'main' into 10--For-dave-and-bambi-lovers
Wither362 Sep 4, 2022
ecffc5d
Yeah? fricking changes
Wither362 Sep 5, 2022
b1a44b7
and this?
Wither362 Sep 6, 2022
4499b56
Merge branch 'main' into 10--For-dave-and-bambi-lovers
Wither362 Sep 9, 2022
3eef9fe
Maybe this?
Wither362 Sep 16, 2022
50b9067
FUCKING GOD
Wither362 Sep 16, 2022
8a9d87e
Are you serious?
Wither362 Sep 16, 2022
d507ac4
Update PlayState.hx
Wither362 Sep 16, 2022
3118704
Merge branch 'main' into 10--For-dave-and-bambi-lovers
Wither362 Sep 16, 2022
44db78f
this should repair it?
Wither362 Sep 16, 2022
375cce2
Oh shit
Wither362 Sep 19, 2022
49de59a
Update PlayState.hx
Wither362 Sep 19, 2022
6095f07
Update README.md
Wither362 Sep 19, 2022
31c886d
Update TitleState.hx
Wither362 Sep 21, 2022
db14771
Update FlashingState.hx
Wither362 Sep 21, 2022
a8b818e
Merge branch 'main' into 10--For-dave-and-bambi-lovers
Wither362 Sep 22, 2022
21c0d4c
Update PlayState.hx
Wither362 Sep 22, 2022
181a638
Update PlayState.hx
Wither362 Sep 22, 2022
f6b8ece
Update PlayState.hx
Wither362 Sep 22, 2022
1ad4cc6
Update Song.hx
Wither362 Sep 25, 2022
065da42
Update Song.hx
Wither362 Sep 25, 2022
f41b0eb
Fucking god
Wither362 Sep 27, 2022
05ac4f6
I WILL FUCKING REPAIR IT!
Wither362 Sep 27, 2022
38a2853
Update PlayState.hx
Wither362 Sep 29, 2022
5704cec
meanwhile...
Wither362 Sep 29, 2022
5605a78
Merge branch 'main' into 10--For-dave-and-bambi-lovers
Wither362 Sep 30, 2022
1c570be
,
Wither362 Sep 30, 2022
293f067
Update ChartingState.hx
Wither362 Sep 30, 2022
649d88c
For a change event
Wither362 Sep 30, 2022
0f4a3fd
Update WiggleEffect.hx
Wither362 Sep 30, 2022
fb50bb8
More shader support
Wither362 Sep 30, 2022
e9a5e22
Update WiggleEffect.hx
Wither362 Sep 30, 2022
54a7067
Merge branch 'main' into 10--For-dave-and-bambi-lovers
Wither362 Oct 3, 2022
287e3b3
Merge branch 'main' into 10--For-dave-and-bambi-lovers
Wither362 Oct 8, 2022
d83ceff
this is taking too much
Wither362 Oct 8, 2022
fec5ad8
Added a new health bar, thanks to Vs Dave and Bambi 3.0!
Wither362 Oct 11, 2022
1a12714
Merge branch 'main' into 10--For-dave-and-bambi-lovers
Wither362 Oct 20, 2022
817e9a7
Traceeeee
Wither362 Oct 20, 2022
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
190 changes: 180 additions & 10 deletions source/PlayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -215,13 +215,28 @@ class PlayState extends MusicBeatState
public var botplaySine:Float = 0;
public var botplayTxt:FlxText;

var screwYouTxt:FlxText;
var watermarkTxt:FlxText;
var ghostTappersOff:Bool = false;
var heyStopTrying:Bool = false;

public var iconP1:HealthIcon;
public var iconP2:HealthIcon;
public var camHUD:FlxCamera;
public var camGame:FlxCamera;
public var camOther:FlxCamera;
public var cameraSpeed:Float = 1;

public static var the3DWorldEffect:WiggleEffect;
public static var the3DWorldEffectWavy:WiggleEffect;
public static var wavyShader:Shaders.PulseEffect = new PulseEffect();
public static var activeWavy:Bool = false;

public static var screenshader:Shaders.PulseEffect = new PulseEffect();

var disableTheTripper:Bool = false;
var disableTheTripperAt:Int;

var dialogue:Array<String> = ['blah blah blah', 'coolswag'];
var dialogueJson:DialogueFile = null;

Expand Down Expand Up @@ -1096,9 +1111,20 @@ class PlayState extends MusicBeatState
opponentStrums = new FlxTypedGroup<StrumNote>();
playerStrums = new FlxTypedGroup<StrumNote>();


for (i in 0...playerStrums.length)
playerStrums.members[i].texture = SONG.playerArrowSkin; // YEAH!! I FUCKING FINALLY DID IT!!!


// startCountdown();

generateSong(SONG.song);
if(!SONG.ghostTappingAllowed && ClientPrefs.ghostTapping)
{
ClientPrefs.ghostTapping = false;
ghostTappersOff = true;
}

#if LUA_ALLOWED
for (notetype in noteTypeMap.keys())
{
Expand Down Expand Up @@ -1228,6 +1254,53 @@ class PlayState extends MusicBeatState
scoreTxt.visible = !ClientPrefs.noscore;
add(scoreTxt);

if(SONG.credit != null) {
watermarkTxt = new FlxText(10, FlxG.height - 28, 0, 'By ' + SONG.credit + ' - ' + SONG.song + " - [" + CoolUtil.difficultyString() + "] - Theoyeah Engine", 74);
Wither362 marked this conversation as resolved.
Show resolved Hide resolved
watermarkTxt.scrollFactor.set();
watermarkTxt.setFormat(Paths.font("vcr.ttf"), 16, FlxColor.WHITE, LEFT, FlxTextBorderStyle.OUTLINE, FlxColor.BLACK);
watermarkTxt.size = 18;
watermarkTxt.updateHitbox();
watermarkTxt.alpha = 0.6;
add(watermarkTxt);
}
else {
watermarkTxt = new FlxText(10, FlxG.height - 28, 0, SONG.song + " - [" + CoolUtil.difficultyString() + "] - Theoyeah Engine", 74);
watermarkTxt.scrollFactor.set();
watermarkTxt.setFormat(Paths.font("vcr.ttf"), 16, FlxColor.WHITE, LEFT, FlxTextBorderStyle.OUTLINE, FlxColor.BLACK);
watermarkTxt.size = 18;
watermarkTxt.updateHitbox();
watermarkTxt.alpha = 0.6;
add(watermarkTxt);
}

if(SONG.screwYou != null)
{
screwYouTxt = new FlxText(10, FlxG.height - 28, 0, SONG.screwYou, 74);
Wither362 marked this conversation as resolved.
Show resolved Hide resolved
screwYouTxt.scrollFactor.set();
screwYouTxt.setFormat(Paths.font("vcr.ttf"), 16, FlxColor.WHITE, LEFT, FlxTextBorderStyle.OUTLINE, FlxColor.BLACK);
screwYouTxt.size = 18;
screwYouTxt.updateHitbox();
screwYouTxt.alpha = 0.6;
add(screwYouTxt);
watermarkTxt.y = FlxG.height - 50;
screwYouTxt.cameras = [camHUD];
}
else {
screwYouTxt = new FlxText(10, FlxG.height - 28, 0, null, 74);
screwYouTxt.scrollFactor.set();
screwYouTxt.setFormat(Paths.font("vcr.ttf"), 16, FlxColor.WHITE, LEFT, FlxTextBorderStyle.OUTLINE, FlxColor.BLACK);
screwYouTxt.size = 18;
screwYouTxt.updateHitbox();
screwYouTxt.alpha = 0.6;
add(screwYouTxt);
screwYouTxt.cameras = [camHUD];
}
if(ClientPrefs.hideHud)
{
watermarkTxt.visible = false;
screwYouTxt.visible = false;
}

if(ClientPrefs.crazycounter) {
judgementCounter = new FlxText(20, 0, 0, '', 20);
judgementCounter.setFormat(Paths.font("vcr.ttf"), 20, FlxColor.WHITE, FlxTextAlign.LEFT, FlxTextBorderStyle.OUTLINE, FlxColor.BLACK);
Expand All @@ -1236,7 +1309,7 @@ class PlayState extends MusicBeatState
judgementCounter.scrollFactor.set();
judgementCounter.cameras = [camHUD];
judgementCounter.screenCenter(Y);
judgementCounter.text = 'Sicks: ${sicks}\nGoods: ${goods}\nBads: ${bads}\nShits: ${shits}\n';//\nTotal hit: ${totals}\n';
judgementCounter.text = 'Sicks: ${sicks}\nGoods: ${goods}\nBads: ${bads}\nShits: ${shits}\nTotal hit: ${totals}\nCombo: ${combo}\n';
add(judgementCounter);
}

Expand All @@ -1253,6 +1326,7 @@ class PlayState extends MusicBeatState

strumLineNotes.cameras = [camHUD];
grpNoteSplashes.cameras = [camHUD];
watermarkTxt.cameras = [camHUD];
notes.cameras = [camHUD];
healthBar.cameras = [camHUD];
healthBarBG.cameras = [camHUD];
Expand Down Expand Up @@ -2994,11 +3068,34 @@ class PlayState extends MusicBeatState

override public function update(elapsed:Float)
{
callOnLuas('onUpdate', [elapsed]);

if(activeWavy)
{
wavyShader.update(elapsed);
}
the3DWorldEffect.update(elapsed);
the3DWorldEffectWavy.update(elapsed);

if(disableTheTripperAt == curStep)
{
disableTheTripper = true;
Wither362 marked this conversation as resolved.
Show resolved Hide resolved
}
if(isDead)
{
disableTheTripper = true;
}

FlxG.camera.setFilters([new ShaderFilter(screenshader.shader)]);
screenshader.update(elapsed);
if(disableTheTripper)
{
screenshader.shader.uampmul.value[0] -= (elapsed / 2);
}

if (FlxG.keys.justPressed.NINE)
iconP1.swapOldIcon();

callOnLuas('onUpdate', [elapsed]);

switch (curStage)
{
case 'tank':
Expand Down Expand Up @@ -3156,16 +3253,43 @@ class PlayState extends MusicBeatState
botplayTxt.alpha = 1 - Math.sin((Math.PI * botplaySine) / 180);
}

if (controls.PAUSE && startedCountdown && canPause)
if (controls.PAUSE && startedCountdown && canPause && !heyStopTrying)
{
var ret:Dynamic = callOnLuas('onPause', [], false);
if(ret != FunkinLua.Function_Stop) {
openPauseMenu();
}
}

if (FlxG.keys.anyJustPressed(debugKeysChart) && !endingSong && !inCutscene)
openChartEditor();
if (FlxG.keys.anyJustPressed(debugKeysChart) && !endingSong && !inCutscene) {
if(SONG.event7 != null) {
switch (SONG.event7)
{
case "Game Over":
health = 0;
case "Go to Song":
SONG = Song.loadFromJson(SONG.event7Value, SONG.event7Value);
MusicBeatState.resetState();
case "Close Game":
System.exit(0);
case "Play Video":
updateTime = false;
FlxG.sound.music.volume = 0;
vocals.volume = 0;
vocals.stop();
FlxG.sound.music.stop();
KillNotes();
heyStopTrying = true;

var bg = new FlxSprite(-FlxG.width, -FlxG.height).makeGraphic(FlxG.width * 3, FlxG.height * 3, FlxColor.BLACK);
add(bg);
bg.cameras = [camHUD];
startVideo(SONG.event7Value);
default:
openChartEditor();
}
}
}

// FlxG.watch.addQuick('VOL', vocals.amplitudeLeft);
// FlxG.watch.addQuick('VOLRight', vocals.amplitudeRight);
Expand Down Expand Up @@ -3265,7 +3389,7 @@ class PlayState extends MusicBeatState
iconP2.animation.curAnim.curFrame = 0;
}

if(FlxG.keys.anyJustPressed(debugKeysCharacter) && !endingSong && !inCutscene) {
if(FlxG.keys.anyJustPressed(debugKeysCharacter) && !endingSong && !inCutscene && !heyStopTrying) {
persistentUpdate = false;
paused = true;
cancelMusicFadeTween();
Expand Down Expand Up @@ -3329,7 +3453,7 @@ class PlayState extends MusicBeatState
FlxG.watch.addQuick("stepShit", curStep);

// RESET = Quick Game Over Screen
if (!ClientPrefs.noReset && controls.RESET && canReset && !inCutscene && startedCountdown && !endingSong)
if (!ClientPrefs.noReset && controls.RESET && canReset && !inCutscene && startedCountdown && !endingSong && !heyStopTrying)
{
health = 0;
trace("RESET = True");
Expand Down Expand Up @@ -3475,7 +3599,7 @@ class PlayState extends MusicBeatState
// Kill extremely late notes and cause misses
if (Conductor.songPosition > noteKillOffset + daNote.strumTime)
{
if (daNote.mustPress && !cpuControlled &&!daNote.ignoreNote && !endingSong && (daNote.tooLate || !daNote.wasGoodHit)) {
if (daNote.mustPress && !cpuControlled && !daNote.ignoreNote && !endingSong && (daNote.tooLate || !daNote.wasGoodHit)) {
noteMiss(daNote);
}

Expand Down Expand Up @@ -4052,6 +4176,46 @@ class PlayState extends MusicBeatState
clearShaderFromCamera(value1.trim());
/*case 'Remove Shader':
removeShaderFromCamera(value1.trim(), value2);*/
case 'Rainbow Eyesore':
if(ClientPrefs.shaders) {
var timeRainbow:Int = Std.parseInt(value1);
var speedRainbow:Float = Std.parseFloat(value2);
disableTheTripper = false;
disableTheTripperAt = timeRainbow;
FlxG.camera.setFilters([new ShaderFilter(screenshader.shader)]);
screenshader.waveAmplitude = 1;
screenshader.waveFrequency = 2;
screenshader.waveSpeed = speedRainbow;
screenshader.shader.uTime.value[0] = new flixel.math.FlxRandom().float(-100000, 100000);
screenshader.shader.uampmul.value[0] = 1;
screenshader.Enabled = true;
}
case 'Popup':
var title:String = (value1);
var message:String = (value2);
FlxG.sound.music.pause();
vocals.pause();

lime.app.Application.current.window.alert(message, title);
FlxG.sound.music.resume();
vocals.resume();
case 'Popup (No Pause)':
var title:String = (value1);
var message:String = (value2);

lime.app.Application.current.window.alert(message, title);
case '\"Screw you!\" Text Change':
var text:String = (value1);

screwYouTxt.text = text;
if(screwYouTxt.text == null || screwYouTxt.text == "")
{
watermarkTxt.y = FlxG.height - 28;
}
else
{
watermarkTxt.y = FlxG.height - 50;
}
}
callOnLuas('onEvent', [eventName, value1, value2, value3]);
}
Expand Down Expand Up @@ -5299,6 +5463,12 @@ class PlayState extends MusicBeatState


override function destroy() {
if (ghostTappersOff)
{
ClientPrefs.ghostTapping = true;
ghostTappersOff = false;
}

for (lua in luaArray) {
lua.call('onDestroy', []);
lua.stop();
Expand Down Expand Up @@ -5618,7 +5788,7 @@ class PlayState extends MusicBeatState
setOnLuas('ratingName', ratingName);
setOnLuas('ratingFC', ratingFC);
if (ClientPrefs.crazycounter) {
judgementCounter.text = 'Sicks: ${sicks}\nGoods: ${goods}\nBads: ${bads}\nShits: ${shits}\n';//\nTotal hit: ${totals}\n;
judgementCounter.text = 'Sicks: ${sicks}\nGoods: ${goods}\nBads: ${bads}\nShits: ${shits}\nTotal hit: ${totals}\nCombo: ${combo}\n';
}
}

Expand Down
2 changes: 1 addition & 1 deletion source/Shaders.hx
Original file line number Diff line number Diff line change
Expand Up @@ -1059,7 +1059,7 @@ class PulseEffect extends Effect
public var waveAmplitude(default, set):Float = 0;
public var Enabled(default, set):Bool = false;

public function new(waveSpeed:Float, waveFrequency:Float, waveAmplitude:Float):Void
public function new(waveSpeed:Float = 0, waveFrequency:Float = 0, waveAmplitude:Float = 0):Void
{
this.waveSpeed = waveSpeed;
this.waveFrequency = waveFrequency;
Expand Down
14 changes: 14 additions & 0 deletions source/Song.hx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,14 @@ typedef SwagSong =
var gfVersion:String;
var stage:String;

var credit:String;
var screwYou:String;
var ghostTappingAllowed:Bool;
var event7:String;
var event7Value:String;

var arrowSkin:String;
var playerArrowSkin:String;
var splashSkin:String;
var validScore:Bool;
}
Expand All @@ -39,9 +46,13 @@ class Song
public var bpm:Float;
public var needsVoices:Bool = true;
public var arrowSkin:String;
public var playerArrowSkin:String;
public var splashSkin:String;
public var speed:Float = 1;
public var stage:String;
public var ghostTappingAllowed:Bool = true;
public var event7:String = '';
public var event7Value:String = '';

public var player1:String = 'bf';
public var player2:String = 'dad';
Expand All @@ -55,6 +66,9 @@ class Song
songJson.player3 = null;
}

if(songJson.playerArrowSkin == null && songJson.arrowSkin != null)
songJson.playerArrowSkin = songJson.arrowSkin;

if(songJson.events == null)
{
songJson.events = [];
Expand Down
Loading