public AudicaTargetHitState TargetHit(GameplayStats gameplayStats, SongCues.Cue cue, Vector2 targetHitPos)
        {
            AudicaTargetHitState targetHit = new AudicaTargetHitState();

            targetHit.targetIndex       = cue.index;
            targetHit.type              = this.cueToTargetType(cue);
            targetHit.hand              = this.cueToHand(cue);
            targetHit.timingScore       = gameplayStats.GetLastTimingScore();
            targetHit.aimScore          = gameplayStats.GetLastAimScore();
            targetHit.score             = targetHit.timingScore + targetHit.aimScore; // TODO: may need to multiply by combo? Need to test
            targetHit.tick              = cue.tick;
            targetHit.targetHitPosition = targetHitPos;

            return(targetHit);
        }
Beispiel #2
0
        public string TargetHitEvent(AudicaTargetHitState targetHit)
        {
            JSONObject targetHitPosition = new JSONObject();

            targetHitPosition["x"] = targetHit.targetHitPosition.x;
            targetHitPosition["y"] = targetHit.targetHitPosition.y;

            JSONObject eventJSON = new JSONObject();

            eventJSON["event"]             = "target-hit";
            eventJSON["targetIndex"]       = targetHit.targetIndex;
            eventJSON["targetType"]        = targetHit.type;
            eventJSON["hand"]              = targetHit.hand;
            eventJSON["score"]             = targetHit.score;
            eventJSON["timingScore"]       = targetHit.timingScore;
            eventJSON["aimScore"]          = targetHit.aimScore;
            eventJSON["tick"]              = targetHit.tick;
            eventJSON["targetHitPosition"] = targetHitPosition;

            return(eventJSON.ToString());
        }
Beispiel #3
0
 public static void Postfix(ref GameplayStats __instance, ref SongCues.Cue cue, ref Vector2 targetHitPos)
 {
     MelonLoader.MelonModLogger.Log("Target Hit! " + targetHitPos.ToString());
     AudicaTargetHitState targetHit = AudicaHTTPStatus.AudicaTargetState.TargetHit(__instance, cue, targetHitPos);
     // TODO: feed output into JSON parser then to HTTP server as websocket event
 }