예제 #1
0
    // Use this for initialization
    void Start()
    {
        animationController = GetComponent <Animator>();
        spriteImage         = GetComponent <SpriteRenderer>();
        turnController      = gameManager.GetComponent <TurnController>();
        paladinController   = paladin.GetComponent <Paladin>();
        sageController      = sage.GetComponent <Sage>();

        TR_petrified   = transform.Find("V_Petrified");
        petrifiedImage = TR_petrified.GetComponentInChildren <SpriteRenderer>();

        TR_special   = transform.Find("V_Special");
        specialImage = TR_special.GetComponentInChildren <SpriteRenderer>();

        TR_magic   = transform.Find("V_Magic");
        magicImage = TR_magic.GetComponentInChildren <SpriteRenderer>();

        GO_guardUp   = GameObject.FindWithTag("V_GuardUp");
        guardUpImage = GO_guardUp.GetComponent <SpriteRenderer>();

        TR_win   = transform.Find("V_Win");
        winImage = TR_win.GetComponentInChildren <SpriteRenderer>();

        TR_wounded   = transform.Find("V_Wounded");
        woundedImage = TR_wounded.GetComponentInChildren <SpriteRenderer>();

        TR_dead   = transform.Find("V_Dead");
        deadImage = TR_dead.GetComponentInChildren <SpriteRenderer>();

        b_isDead    = false;
        b_isWounded = false;

        //Derived Stats
        attackPower  = STRENGTH * 10; // 1000 avg damage
        magicPower   = 0;             // No magic offense
        dodge        = AGILITY * 2;   // 10% Chance of dodging
        defencePower = DEFENCE * 2;   //10% Defence
        special      = 0;
        health       = MAX_HEALTH;
        magic        = MAX_MAGIC;

        AudioSource[] audios = GetComponents <AudioSource>();
        takeDamageSound = audios[0];
        attackSound     = audios[1];
        magicSound      = audios[2];

        specialExecute = false;

        UpdateStats();

        enemy           = GameObject.FindWithTag("Enemy");
        enemyController = enemy.GetComponent <Enemy>();
    }
예제 #2
0
    // Use this for initialization
    void Start()
    {
        spriteImage = GetComponent <SpriteRenderer>();

        animationController = GetComponent <Animator>();

        TR_petrified   = transform.Find("S_Petrified");
        petrifiedImage = TR_petrified.GetComponentInChildren <SpriteRenderer>();

        TR_special   = transform.Find("S_Special");
        specialImage = TR_special.GetComponentInChildren <SpriteRenderer>();

        TR_magic   = transform.Find("S_Magic");
        magicImage = TR_magic.GetComponentInChildren <SpriteRenderer>();

        GO_guardUp   = GameObject.FindWithTag("S_GuardUp");
        guardUpImage = GO_guardUp.GetComponent <SpriteRenderer>();

        TR_win   = transform.Find("S_Win");
        winImage = TR_win.GetComponentInChildren <SpriteRenderer>();

        TR_wounded   = transform.Find("S_Wounded");
        woundedImage = TR_wounded.GetComponentInChildren <SpriteRenderer>();

        TR_dead   = transform.Find("S_Dead");
        deadImage = TR_dead.GetComponentInChildren <SpriteRenderer>();

        enemy              = GameObject.FindWithTag("Enemy");
        enemyController    = enemy.GetComponent <Enemy>();
        turnController     = gameManager.GetComponent <TurnController>();
        paladinController  = paladin.GetComponent <Paladin>();
        valkyrieController = valkyrie.GetComponent <Valkyrie>();

        AudioSource[] audios = GetComponents <AudioSource>();
        takeDamageSound = audios[0];
        attackSound     = audios[1];
        magicSound      = audios[2];

        b_isDead    = false;
        b_isWounded = false;

        blueButtonImage   = blueButton.GetComponent <Image>();
        greenButtonImage  = greenButton.GetComponent <Image>();
        orangeButtonImage = orangeButton.GetComponent <Image>();
        redButtonImage    = redButton.GetComponent <Image>();

        //Initialise Stats



        //Derived Stats
        attackPower  = STRENGTH * 10; // 200 avg damage
        magicPower   = SPIRIT * 10;   // 1000 avg earth spell damage
        dodge        = AGILITY * 2;   // 16% Chance of dodging
        defencePower = DEFENCE * 2;   //6%
        special      = 0;
        health       = MAX_HEALTH;
        magic        = MAX_MAGIC;



        tileIds       = new List <int>();
        selectedOrder = new List <int>();
        tileIds.Add(1);
        tileIds.Add(2);
        tileIds.Add(3);
        tileIds.Add(4);

        UpdateStats();
    }