Skip to content

Commit

Permalink
proper credits, no hurt notes, 3d pain
Browse files Browse the repository at this point in the history
  • Loading branch information
Snirozu committed Jan 11, 2025
1 parent 44cb0e9 commit 836d2e1
Show file tree
Hide file tree
Showing 11 changed files with 37 additions and 36 deletions.
Binary file added art/flashFiles/default_credit.fla
Binary file not shown.
Binary file added assets/preload/images/bf1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/preload/images/bf2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/preload/images/credits/missing_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion source/backend/ClientPrefs.hx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class SaveVariables {
'practice' => false,
'botplay' => false,
'opponentplay' => false,
'nospecialnotes' => false,
'nobadnotes' => false,
];

public var comboOffset:Array<Int> = [0, 0, 0, 0];
Expand Down
15 changes: 1 addition & 14 deletions source/online/network/FunkinNetwork.hx
Original file line number Diff line number Diff line change
Expand Up @@ -277,20 +277,7 @@ class FunkinNetwork {

public static function getDefaultAvatar():BitmapData
{
var output = new BytesOutput();
var avatarResponse = FunkinNetwork.requestAPI({
path: 'images/bf' + FlxG.random.int(1, 2) + ".png",
bodyOutput: output
});

try {
var bytes = output.getBytes();
return BitmapData.fromBytes(bytes);
}
catch (exc) {
trace(exc);
return null;
}
return Paths.image('bf' + FlxG.random.int(1, 2)).bitmap;
}

public static function requestAPI(request:HTTPRequest, ?alertError:Bool = true):Null<HTTPResponse> {
Expand Down
1 change: 1 addition & 0 deletions source/online/states/SkinsState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -635,6 +635,7 @@ class SkinsState extends MusicBeatState {

var daCharacter = new Character(0, 0, curCharName, flipped);
daCharacter.scrollFactor.set(1.2, 1.2);
daCharacter.graphic.bitmap.disposeImage();
character.add(daCharacter);

character.members[0].x = 420 + character.members[0].positionArray[0];
Expand Down
7 changes: 5 additions & 2 deletions source/states/CreditsState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,14 @@ class CreditsState extends MusicBeatState

var defaultList:Array<Array<String>> = [ //Name - Icon name - Description - Link - BG Color
['Psych Online'],
['Snirozu', 'snirozu', 'Developer', 'https://bsky.app/profile/sniro.boo', 'FFCC33'],
['Snirozu', 'snirozu', 'Developer', 'https://sniro.boo', 'FFCC33'],
[''],
['Contributors'],
['Magniill', 'notmagniill', 'Remade the Online button sprite!', 'https://twitter.com/magniill', '910000'],
['xenkap', '', 'Contributed some cool stuff to the source code!', 'https://github.com/xenkap', '9370DB'],
['xenkap', '', 'Swag Contributor!', 'https://github.com/xenkap', '9370DB'],
['Lily', '', 'Cool Contributor!', 'https://github.com/mcagabe19', 'FFC0CB'],
['Til', '', 'Awesome Contributor!', 'https://github.com/TechnikTil', 'FFFF00'],
['Vortex', '', 'Neat Contributor!', 'https://github.com/Vortex2Oblivion', '00FFFF'],
[''],
['Psych Engine Team'],
['Shadow Mario', 'shadowmario', 'Main Programmer of Psych Engine', 'https://twitter.com/Shadow_Mario_', '444444'],
Expand Down
22 changes: 12 additions & 10 deletions source/states/PlayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ class PlayState extends MusicBeatState
return cpuControlled;
}
public var practiceMode:Bool = false;
public var noSpecialNotes:Bool = false;
public var noBadNotes:Bool = false;

public var botplaySine:Float = 0;
@:unreflective public var botplayTxt:FlxText;
Expand Down Expand Up @@ -548,7 +548,7 @@ class PlayState extends MusicBeatState
practiceMode = ClientPrefs.getGameplaySetting('practice');
cpuControlled = ClientPrefs.getGameplaySetting('botplay');
opponentMode = ClientPrefs.getGameplaySetting('opponentplay');
noSpecialNotes = ClientPrefs.getGameplaySetting('nospecialnotes');
noBadNotes = ClientPrefs.getGameplaySetting('nobadnotes');
});

preloadTasks.push(() -> {
Expand Down Expand Up @@ -672,7 +672,7 @@ class PlayState extends MusicBeatState
case 'mall': new states.stages.Mall(); // Week 5 - Cocoa, Eggnog
case 'mallEvil': new states.stages.MallEvil(); // Week 5 - Winter Horrorland
case 'school': new states.stages.School(); // Week 6 - Senpai, Roses
case 'schoolEvil': new states.stages.SchoolEvil(); // Week 6 - Thorns
#if !AWAY_TEST case 'schoolEvil': new states.stages.SchoolEvil(); #end // Week 6 - Thorns
case 'tank': new states.stages.Tank(); // Week 7 - Ugh, Guns, Stress
}

Expand Down Expand Up @@ -2007,13 +2007,7 @@ class PlayState extends MusicBeatState
else {
gottaHitNote = songNotes[1] < maniaKeys;
}

if (noSpecialNotes && songNotes[3] != null)
continue;

if (playsAsBF() ? gottaHitNote : !gottaHitNote && daStrumTime - lastStrumTime > 10) {
playingNoteCount++;
}
lastStrumTime = daStrumTime;

var oldNote:Note;
Expand All @@ -2029,12 +2023,20 @@ class PlayState extends MusicBeatState
swagNote.noteType = songNotes[3];
if(!Std.isOfType(songNotes[3], String)) swagNote.noteType = ChartingState.noteTypeList[songNotes[3]]; //Backward compatibility + compatibility with Week 7 charts

if (noBadNotes && (swagNote.hitCausesMiss || swagNote.hitHealth < 0)) {
swagNote.destroy();
continue;
}

swagNote.scrollFactor.set();

var susLength:Float = swagNote.sustainLength;

susLength = susLength / Conductor.stepCrochet;

unspawnNotes.push(swagNote);
if (playsAsBF() ? gottaHitNote : !gottaHitNote && daStrumTime - lastStrumTime > 10)
playingNoteCount++;

var floorSus:Int = Math.floor(susLength);
if(floorSus > 0) {
Expand Down Expand Up @@ -4908,7 +4910,7 @@ class PlayState extends MusicBeatState
#end

function isInvalidScore() {
return cpuControlled || controls.moodyBlues != null || noSpecialNotes;
return cpuControlled || controls.moodyBlues != null || noBadNotes;
}

// MULTIPLAYER STUFF HERE
Expand Down
24 changes: 16 additions & 8 deletions source/states/stages/AwayStage.hx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package states.stages;

import away3d.animators.SpriteSheetAnimator;
import openfl.geom.Point;
import openfl.geom.Rectangle;
import openfl.geom.Matrix;
Expand Down Expand Up @@ -54,7 +55,7 @@ class AwayStage extends Sprite {
debugText.selectable = false;
debugText.defaultTextFormat = new TextFormat(Assets.getFont('assets/fonts/vcr.ttf').fontName, 16, 0xFFFFFFFF);
debugText.multiline = true;
debugText.wordWrap = true;
debugText.wordWrap = false;
stage.addChild(debugText);

addEventListener(Event.ENTER_FRAME, _onEnterFrame);
Expand All @@ -65,6 +66,8 @@ class AwayStage extends Sprite {
public function setupOnlineStage() {
switch (PlayState.SONG.song.toLowerCase()) {
case "thorns":
PlayState.instance.dad.useFramePixels = true;

// walkway
var _plainBitmap = Assets.getBitmapData(Paths.getLibraryPathForce("images/weeb/evilWalkway.png", "week_assets", "week6"));
var plainBitmap = new BitmapData(1024, 1024, FlxColor.TRANSPARENT); // why THE FUCK does it need to be a power of 2 value???
Expand Down Expand Up @@ -128,9 +131,9 @@ class AwayStage extends Sprite {

dad = new Mesh(geom, material);

dad.x = 399;
dad.y = 761;
dad.z = 1056;
dad.x = 169;
dad.y = -233;
dad.z = -620;
dad.rotationX = -90;

_view.scene.addChild(dad);
Expand Down Expand Up @@ -210,7 +213,7 @@ class AwayStage extends Sprite {
// _view.camera.z = (FlxG.camera.zoom - 1) * (zoomMult + 200);

if (ClientPrefs.isDebug()) {
var moveSpeed = 0.01 * (FlxG.keys.pressed.CONTROL ? 10 : 1) * (FlxG.keys.pressed.ALT ? 100 : 1);
var moveSpeed = 0.02 * (FlxG.keys.pressed.CONTROL ? 10 : 1) * (FlxG.keys.pressed.ALT ? 100 : 1);

if (FlxG.keys.justPressed.TAB) {
debugSprite++;
Expand Down Expand Up @@ -274,17 +277,22 @@ class AwayStage extends Sprite {
function drawSpriteOnMesh(mesh:Mesh, sprite:FlxSprite) {
// note: seems that sprite.frame.parent.bitmap fucks up rendering lol

var fullBitmap = sprite.pixels;
var fullBitmap = sprite.graphic.bitmap;
//var fullBitmap = sprite.framePixels;
var targetBitmap = cast(cast(mesh.material, TextureMaterial).texture, BitmapTexture).bitmapData;
var frame = sprite.frames.frames[sprite.animation.frameIndex];

if (frame == null)
return;

//Sys.println(sprite.animation.frameIndex + " " + frame.frame.x + " " + frame.frame.y);
//shows correct coordinates
//ig spritesheet animator class should be used for that?

//should copy these pixels correctly, but it doesnt and stays on the first frame?????
targetBitmap.copyPixels(fullBitmap, frame.frame.copyToFlash(_rect), frame.offset.copyToFlash(_point), null, null, true);
targetBitmap.copyPixels(fullBitmap, frame.frame.copyToFlash(_rect), new Point(0, 0), null, null, true);
// targetBitmap.draw(fullBitmap, null, null, null, frame.frame.copyToFlash(_rect));

// doesn't change?
//targetBitmap.setPixel(i++, Math.ceil(i / 500), FlxColor.YELLOW);
}
}
2 changes: 1 addition & 1 deletion source/substates/GameplayChangersSubstate.hx
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class GameplayChangersSubstate extends MusicBeatSubstate
optionsArray.push(option);
}

var option:GameplayOption = new GameplayOption('No Special Notes', 'nospecialnotes', 'bool', false);
var option:GameplayOption = new GameplayOption('No Hurt Notes', 'nobadnotes', 'bool', false);
optionsArray.push(option);

GameClient.send("status", "In the Game Changers Menu");
Expand Down

0 comments on commit 836d2e1

Please sign in to comment.