using UnityEngine;
using System.Collections;

public class MiladyMans : BaseEnemy {

	// Use this for initialization
	protected override void Start () 
    {
	    base.Start();
	}
	
	// Update is called once per frame
	void Update () 
    {
        base.Update();
	}

    public override void OnCollisionEnter2D(Collision2D coll)
    {
        //did we hit the player?
        if (playerScript != null && coll.gameObject == playerScript.gameObject && currentAiEnemyBehaviorState != AIEnemyBehaviorState.run_left_really_fast)
        {
            WalkingSpeedUnitsPerSecond = 1.0f;
            //currentAiEnemyBehaviorState = AIEnemyBehaviorState.run_left_really_fast;
            SaySomething(GetWreckbeardDisapproval(), 4.0f);
            gameObject.layer = LayerMask.NameToLayer("MiladyFleeCollide");
            playerScript.ExpressFrustrationAtRejection();
            Rigidbody2D myBody = GetComponent<Rigidbody2D>();
            myBody.AddForce(Vector2.up * 100.0f);
            myBody.gravityScale = -1.0f;

            playerScript.ChangeFrustration(10.0f);
            Destroy(gameObject, 5.0f);
        }
    }

    public override void StartDying()
    {
        base.StartDying();
        playerScript.ChangeEthics(-20.0f);
    }

    public string GetWreckbeardDisapproval()
    {
        int iRoll = Random.Range(1, 8);
        string strAngry = "";
        switch (iRoll)
        {
            case 1:
                strAngry = "Yuck!";
                break;
            case 2:
                strAngry = "No touching!";
                break;
            case 3:
                strAngry = "Ewww!";
                break;
            case 4:
                strAngry = "Shave! Shaaaaaave!";
                break;
            case 5:
                strAngry = "Ugh, why!?";
                break;
            case 6:
                strAngry = "Baaaaarf!";
                break;
            case 7:
                strAngry = "Gross!";
                break;
        }

        return strAngry;
    }
}
