<commit_before>﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class YukariCakeController : MonoBehaviour {

    // Properties
    public YukariCakeReimu Enemy;
    public List<AudioSource> AudioSources;
    public Animator YukariAnimator;
    public AudioSource YukariSource;
    public AudioClip YukariSoundSnatch, YukariCakeDimension, YukariSoundVictory, YukariSoundFail;
    public GameObject YukariFailSprites;

    // Game Variables
    public bool IsVulnerable = false;

	// Use this for initialization
	void Start () {
        foreach (var a in AudioSources)
            a.pitch = Time.timeScale;
	}
	
	// Update is called once per frame
	void Update () {
        
        if(YukariAnimator.GetCurrentAnimatorStateInfo(0).IsName("YukariCakeYukariSnatch"))
        {
            if (Enemy.IsAlert && IsVulnerable)
                SetGameFailure();
        }

        if(!MicrogameController.instance.getVictoryDetermined())
        {
            if(Input.GetKeyDown(KeyCode.Space))
            {
                // Here comes the snatch sequence. Better not get caught.
                YukariAnimator.Play("YukariCakeYukariSnatch");
            }
        }
	}

    public void SetGameVictory()
    {
        PlayVictoryAnimation();
        MicrogameController.instance.setVictory(true, true);
        Enemy.Stop();
    }

    public void SetGameFailure()
    {
        PlayFailureAnimation();
        MicrogameController.instance.setVictory(false, true);
        Enemy.Stop();
    }

    public void PlayVictoryAnimation()
    {
        YukariAnimator.Play("YukariCakeYukariVictory");
    }

    public void PlayFailureAnimation()
    {
        PlayFailureSound();
        YukariAnimator.Stop();
        YukariFailSprites.SetActive(true);
        Enemy.PlayFailureAnimation();
    }

    public void PlayDimensionSound()<commit_msg>Fix YukariCake animator in new version<commit_after>﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class YukariCakeController : MonoBehaviour {

    // Properties
    public YukariCakeReimu Enemy;
    public List<AudioSource> AudioSources;
    public Animator YukariAnimator;
    public AudioSource YukariSource;
    public AudioClip YukariSoundSnatch, YukariCakeDimension, YukariSoundVictory, YukariSoundFail;
    public GameObject YukariFailSprites;

    // Game Variables
    public bool IsVulnerable = false;

	// Use this for initialization
	void Start () {
        foreach (var a in AudioSources)
            a.pitch = Time.timeScale;
	}
	
	// Update is called once per frame
	void Update () {
        
        if(YukariAnimator.GetCurrentAnimatorStateInfo(0).IsName("YukariCakeYukariSnatch"))
        {
            if (Enemy.IsAlert && IsVulnerable)
                SetGameFailure();
        }

        if(!MicrogameController.instance.getVictoryDetermined())
        {
            if(Input.GetKeyDown(KeyCode.Space))
            {
                // Here comes the snatch sequence. Better not get caught.
                YukariAnimator.Play("YukariCakeYukariSnatch");
            }
        }
	}

    public void SetGameVictory()
    {
        PlayVictoryAnimation();
        MicrogameController.instance.setVictory(true, true);
        Enemy.Stop();
    }

    public void SetGameFailure()
    {
        PlayFailureAnimation();
        MicrogameController.instance.setVictory(false, true);
        Enemy.Stop();
    }

    public void PlayVictoryAnimation()
    {
        YukariAnimator.Play("YukariCakeYukariVictory");
    }

    public void PlayFailureAnimation()
    {
        PlayFailureSound();
		YukariAnimator.enabled = false;
        YukariFailSprites.SetActive(true);
        Enemy.PlayFailureAnimation();
    }

    public void PlayDimensionSound()
{'fraction_non_alphanumeric': 0.08372952984680401, 'fraction_numerical': 0.0005282620179609086, 'mean_word_length': 2.532649253731343, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '140016', 'n_tokens_mistral': 1140, 'n_tokens_neox': 1085, 'n_words': 213}