Example #1
0
    // Update is called once per frame
    public void Update()
    {
        health = (int)parentScript.stats["health"].getCompoundValue();
        armor  = (int)parentScript.stats["armor"].getCompoundValue();
        FloatStat MD = parentScript.stats["damage"];

        MD.removeFactor("isDangerous");
        meleeDamage = (int)MD.getCompoundValue();
        myAi        = parent.GetComponent <AiScriptBase>();
        MD.setFactor("isDangerous", myAi.isDangerous() ? 1 : 0);
        //if (start) Start();
        //parent.GetComponent<Rigidbody2D>().GetVector();
        direction = direction.normalized;
    }
Example #2
0
    public EnemyController(EntityScript ps)
    {
        parentScript = ps;
        parent       = ps.gameObject;
        myAi         = parent.GetComponent <AiScriptBase>();
        myAi.getStats(ref health, ref armor, ref poiseMax, ref meleeDamage, ref rangeDamage);
        stun = poiseMax;
        parentScript.stats.Add("projectileRange", new FloatStat("projectileRange", 10f));
        parentScript.stats["ranged"] = new FloatStat("ranged", (float)rangeDamage);
        parentScript.stats["health"] = new FloatStat("health", (float)health);
        parentScript.stats["armor"]  = new FloatStat("armor", (float)armor);
        parentScript.stats["damage"] = new FloatStat("damage", (float)meleeDamage);
        if (meleeDamage != 0)
        {
            parentScript.rawInput.Add("EFFECT damage irrelevant " + meleeDamage.ToString() + " 0 1");
            parentScript.Input();
        }

        _killQuestController = GameObject.FindWithTag("Manager").GetComponent <KillQuestController>();
        dead = false;
    }