Skip to content

Commit

Permalink
MAKE CHANGECHARACTER EVENTS WORK AGAIN!!!
Browse files Browse the repository at this point in the history
  • Loading branch information
FluffyOMC committed Jun 30, 2024
1 parent 81005a1 commit 67e4a9c
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions psychtobase/src/FileContents.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import funkin.play.character.CharacterDataParser;
import funkin.play.event.ScriptedSongEvent;
import funkin.play.PlayState;
import openfl.utils.Assets;
//import Reflect;
/**
Expand Down Expand Up @@ -69,7 +70,7 @@ class ChangeCharacterEvent extends ScriptedSongEvent {
//helper function
function getValue(field:String, def:Dynamic) {
var value = Type.resolveClass("Reflect").field(dataValue, field);
var value = Assets.resolveClass("Reflect").field(dataValue, field);
if (value == null)
return def;
else
Expand Down Expand Up @@ -169,15 +170,16 @@ class ChangeCharacterHandler extends Module {
ok = true;
var i = 0;
for(char in [PlayState.instance.currentStage.getBoyfriend(), PlayState.instance.currentStage.getDad(), PlayState.instance.currentStage.getGirlfriend()]) {
if (char == null) continue;
chars[i].set(char.characterId, char);
defaults[i] = char;
i++;
}
for(event in PlayState.instance.songEvents) {
if(event.value != null) {
//??????????????????
var char = Type.resolveClass("Reflect").field(event.value, 'char');
var target = Type.resolveClass("Reflect").field(event.value, 'target');
var char = Assets.resolveClass("Reflect").field(event.value, 'char');
var target = Assets.resolveClass("Reflect").field(event.value, 'target');
if(char != null && target != null && !chars[target].exists(char)) {
var hi = CharacterDataParser.fetchCharacter(char);
chars[strid.indexOf(target)].set(char, hi);
Expand All @@ -195,4 +197,7 @@ class ChangeCharacterHandler extends Module {
# https://youtu.be/22tVWwmTie8?si=2TNmHTDoT7UgQvZ-

# Calm down, dude! This song is better!
# https://youtu.be/VMp55KH_3wo
# https://youtu.be/VMp55KH_3wo

# Shoutout to simpleflips
# https://www.youtube.com/watch?v=JmK98ehX6rc

1 comment on commit 67e4a9c

@BombasticTom
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So about that..

Please sign in to comment.