Ejemplo n.º 1
0
    public void DispenseObject(GameObject dispensable, Vector2 location, Vector2 direction, float speed = 0.2f, string[] input = null, string type = "projectile")
    {
        GameObject   x = Instantiate(dispensable);
        EntityScript y = x.AddComponent <EntityScript>();

        y.Init(type, location, direction, speed, gameObject);
        if (input != null)
        {
            y.rawInput.AddRange(input);
        }
        if (type == "projectile")
        {
            float dmg = stats["ranged"].getCompoundValue();
            y.rawInput.Add("EFFECT damage irrelevant " + dmg.ToString() + " 0 1");
        }
        y.Input();
        Debug.Log(speed);
        y.Init(type, location, direction, speed, gameObject);
    }
Ejemplo n.º 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;
    }