diff --git a/blocks/Array.h b/blocks/Array.h index d13a241..716d23c 100644 --- a/blocks/Array.h +++ b/blocks/Array.h @@ -28,12 +28,12 @@ class Array { T operator [] (FuncNode id) { return get(id); } - bool outputed = false; + // bool outputed = false; SonolusApi indexOf(T obj, let en) { // 时间复杂度 O(capacity * classSize) FUNCBEGIN - // FOR (i, 0, Min(capacity, en), 1) { // 暂时禁用 en 选项 - FOR (i, 0, capacity, 1) { - if (!outputed) cout << get(i) << endl << obj << endl, outputed = true; + FOR (i, 0, Min(capacity, en), 1) { + // FOR (i, 0, capacity, 1) { // 暂时禁用 en 选项 + // if (!outputed) cout << get(i) << endl << obj << endl, outputed = true; IF (get(i) == obj) Return(i); FI } DONE Return(-1); diff --git a/blocks/Variable.h b/blocks/Variable.h index 549fc1b..3914eed 100644 --- a/blocks/Variable.h +++ b/blocks/Variable.h @@ -53,10 +53,12 @@ class Variable { R(FuncNode(RuntimeFunction.Set, {identifierId, offset, val.get()})); } - Variable operator = (Variable val) { set(val); return *this; } - // Variable operator = (FuncNode val) { set(val); return *this; } - template - Variable operator = (T val) { set(val); return *this; }; + // template + // Variable operator = (Variable val) { set(val); return *this; } + Variable operator = (double val) { set(val); return Variable(offset, true); } + Variable operator = (FuncNode val) { set(val); return Variable(offset, true); } + // template + // Variable operator = (T val) { set(val); return *this; }; operator FuncNode() { return get(); diff --git a/dist/EngineData b/dist/EngineData index 8a489c7..87ed1a9 100644 Binary files a/dist/EngineData and b/dist/EngineData differ diff --git a/engine/data/archetypes/FlickNote.cpp b/engine/data/archetypes/FlickNote.cpp index d0cc96a..6488924 100644 --- a/engine/data/archetypes/FlickNote.cpp +++ b/engine/data/archetypes/FlickNote.cpp @@ -10,7 +10,6 @@ class FlickNote : public Archetype { Variable enLane; Variable inputTimeMin; Variable inputTimeMax; - Variable touchTime; Variable activate; SonolusApi spawnOrder() { return 1000 + beat; } @@ -22,7 +21,6 @@ class FlickNote : public Archetype { enLane = lane + laneLength - 1; inputTimeMin = beat - judgment.bad + RuntimeEnvironment.get(3); inputTimeMax = beat + judgment.bad + RuntimeEnvironment.get(3); - touchTime = -1; activate = 0; return VOID; // beat.set(Buckets.NormalNote), @@ -48,7 +46,6 @@ class FlickNote : public Archetype { SonolusApi updateSequential() { FUNCBEGIN IF (times.now < inputTimeMin) Return(0); FI - IF (activate == 0 && touchTime != -1) activate = 1; FI IF (times.now > inputTimeMax) { IF (activate == 1) complete(inputTimeMax); ELSE complete(-1); FI @@ -72,10 +69,10 @@ class FlickNote : public Archetype { SonolusApi touch() { FUNCBEGIN IF (times.now < inputTimeMin) Return(0); FI - IF (touchTime != -1) Return(0); FI + // IF (touchTime != -1) Return(0); FI let index = getClaimedStart(EntityInfo.get(0)); IF (index == -1) Return(0); FI - touchTime = times.now; + activate = 1; return VOID; } diff --git a/engine/data/archetypes/InputManager.cpp b/engine/data/archetypes/InputManager.cpp index d8f7c71..481ee4d 100644 --- a/engine/data/archetypes/InputManager.cpp +++ b/engine/data/archetypes/InputManager.cpp @@ -52,7 +52,7 @@ class ClaimManager { res = touches[i].id; minDis = dis; CONTINUE; } FI - + IF (claim.hitbox.contain(touches[i].x, touches[i].y) == 1) CONTINUE; FI IF (origin.hitbox.contain(touches[i].x, touches[i].y) == 0) CONTINUE; FI res = touches[i].id; minDis = dis; @@ -68,6 +68,7 @@ class ClaimManager { WHILE (true) { var touchIndex = findBestTouchIndex(currentId); IF (touchIndex == -1) BREAK; FI + // Debuglog(touchIndex); disallowEmptiesNow.set(touchIndex, 1); let claimIndex = claimed.indexOf(touchIndex); @@ -80,13 +81,18 @@ class ClaimManager { BREAK; } FI - // ClaimInfo replaced = getInfo(cldaimIndex); + // ClaimInfo replaced = getInfo(cldaimIndex) + // Debuglog(claimed.indexOf(touchIndex)); var tmp = currentId; currentId = claimed.getValById(claimIndex); + // Debuglog(tmp); + // Debuglog(claimed.indexOf(touchIndex)); + claimed.set(touchIndex, tmp); + // DebugPause(); + // claimed.val.set(claimIndex, tmp); // Debuglog(touchIndex); - // claimed.set(touchIndex, tmp); - claimed.val.set(claimIndex, tmp); // Debuglog(claimed.getValById(claimIndex)); + // IF (claimed.getValById(claimIndex) != tmp) DebugPause(); FI // Debuglog(claimed.size); } DONE return VOID; diff --git a/engine/data/archetypes/flatNotes/FlatNote.cpp b/engine/data/archetypes/flatNotes/FlatNote.cpp index 4ef76ac..799bcc5 100644 --- a/engine/data/archetypes/flatNotes/FlatNote.cpp +++ b/engine/data/archetypes/flatNotes/FlatNote.cpp @@ -21,6 +21,7 @@ class FlatNote : public Archetype { SonolusApi preprocess() { FUNCBEGIN IF (LevelOption.get(Options.Mirror)) lane = 14 - lane - laneLength; FI + // cout << lane.offset << endl; enLane = lane + laneLength - 1; inputTimeMin = beat - judgment.bad + RuntimeEnvironment.get(3); inputTimeMax = beat + judgment.bad + RuntimeEnvironment.get(3); @@ -55,9 +56,8 @@ class FlatNote : public Archetype { } SonolusApi updateSequential() { FUNCBEGIN - IF (touchTime != -1) complete(touchTime); FI IF (times.now < inputTimeMin) Return(0); FI - IF (times.now > inputTimeMax) complete(-2); FI + IF (times.now > inputTimeMax) complete(-1); FI claimStart(EntityInfo.get(0)); // IF (mapId != -1 && inputList_old.getValById(mapId) != -1) complete(); FI // mapId = inputList.size; @@ -76,10 +76,11 @@ class FlatNote : public Archetype { SonolusApi touch() { FUNCBEGIN IF (times.now < inputTimeMin) Return(0); FI - IF (touchTime != -1) Return(0); FI + // IF (touchTime != -1) Return(0); FI let index = getClaimedStart(EntityInfo.get(0)); IF (index == -1) Return(0); FI - touchTime = times.now; + // Debuglog(index); + complete(times.now); return VOID; } diff --git a/engine/data/archetypes/holdNotes/ScratchHoldEnd.cpp b/engine/data/archetypes/holdNotes/ScratchHoldEnd.cpp index 30e6250..d2474c5 100644 --- a/engine/data/archetypes/holdNotes/ScratchHoldEnd.cpp +++ b/engine/data/archetypes/holdNotes/ScratchHoldEnd.cpp @@ -50,7 +50,7 @@ class SiriusScratchHoldEnd: public Archetype { EntityInput.set(3, t - beat); IF (res2 == 1) Play(Clips.Scratch, minSFXDistance); FI IF (res2 == 2) Play(Clips.CriticalGood, minSFXDistance); FI - IF (res2 != 0) spawnEffect(Effects.ScratchLinear, Effects.ScratchCircular, lane, enLane); FI + IF (res2 != 0) spawnEffect(Effects.ScratchLinear, Effects.ScratchCircular, scratchLane, scratchEnLane); FI IF (res == 0) SpawnSubJudgeText(Sprites.JudgeMiss); FI IF (res == 1) SpawnSubJudgeText(Sprites.JudgePerfectPlus); FI IF (res == 3) SpawnSubJudgeText(Sprites.JudgeGreat); FI diff --git a/main b/main index 2ca5db9..7972c52 100755 Binary files a/main and b/main differ