Пример #1
0
    public bool CureEntity(IEffectable toCure, float noop)
    {
        SOEffect thisEffect = SOEffect.GetByID(CONSTANTS.EFFECT_CURE);

        if (applyAffect(thisEffect, toCure))
        {
            toCure.RemoveEffect(SOEffect.GetByID(CONSTANTS.EFFECT_POISON));
        }
        toCure.RemoveEffect(thisEffect);
        return(false);
    }
Пример #2
0
    public SOEffect[] getCurrentEffects()
    {
        int[]           IDs  = currentEffects.ToArray();
        List <SOEffect> temp = new List <SOEffect>(0);

        for (int i = 0; i < IDs.Length; i++)
        {
            temp.Add(SOEffect.GetByID(IDs[i]));
        }

        return(temp.ToArray());
    }
Пример #3
0
    public bool KillEntity(IEffectable toKill, float noop)
    {
        SOEffect thisEffect = SOEffect.GetByID(CONSTANTS.EFFECT_DEATH);

        if (applyAffect(thisEffect, toKill))
        {
            toKill.Harm(toKill.MaxHP);
        }

        toKill.RemoveEffect(thisEffect);

        return(true);
    }
Пример #4
0
    public bool HealEntity(IEffectable toHeal, float potency)
    {
        float    value      = 20;
        SOEffect thisEffect = SOEffect.GetByID(CONSTANTS.EFFECT_HEAL);

        if (applyAffect(thisEffect, toHeal))
        {
            toHeal.Heal(value * potency);
        }

        toHeal.RemoveEffect(thisEffect);

        return(true);
    }
Пример #5
0
    public bool HealOverTime(IEffectable toHeal, float potency)
    {
        float    heal       = 1;
        int      time       = 10;
        SOEffect thisEffect = SOEffect.GetByID(CONSTANTS.EFFECT_REGEN);

        if (applyAffect(thisEffect, toHeal))
        {
            // Coroutine
            StartCoroutine(DoT(heal * potency, time, toHeal, thisEffect));
        }

        return(true);
    }
Пример #6
0
    public bool PoisonEntity(IEffectable toPoison, float potency)
    {
        float    damage     = 1;
        int      time       = 10;
        SOEffect thisEffect = SOEffect.GetByID(CONSTANTS.EFFECT_POISON);

        if (applyAffect(thisEffect, toPoison))
        {
            // Coroutine
            StartCoroutine(DoT(damage * potency, time, toPoison, thisEffect));
        }

        return(true);
    }
Пример #7
0
    public bool HighGravEntity(IEffectable target, float potency)
    {
        float scaleup = 5f;
        float time    = 10;

        // Conflicting
        target.RemoveEffect(SOEffect.GetByID(CONSTANTS.EFFECT_LOW_GRAV));
        SOEffect thisEffect = SOEffect.GetByID(CONSTANTS.EFFECT_HIGH_GRAV);

        if (applyAffect(thisEffect, target))
        {
            StartCoroutine(Gravupdown(scaleup, time * potency, target, thisEffect));
        }

        return(true);
    }
Пример #8
0
    public bool SlowEntity(IEffectable target, float potency)
    {
        float scaleup = 0.5f;
        float time    = 10;

        // Conflicting
        target.RemoveEffect(SOEffect.GetByID(CONSTANTS.EFFECT_SPEED));
        SOEffect thisEffect = SOEffect.GetByID(CONSTANTS.EFFECT_SLOW);

        if (applyAffect(thisEffect, target))
        {
            StartCoroutine(SpeedSlow(scaleup, time * potency, target, thisEffect));
        }

        return(true);
    }
Пример #9
0
    public bool ShrinkEntity(IEffectable target, float potency)
    {
        float scaleup = 0.5f;
        float time    = 10;

        // Conflicting
        target.RemoveEffect(SOEffect.GetByID(CONSTANTS.EFFECT_ENLARGE));
        SOEffect thisEffect = SOEffect.GetByID(CONSTANTS.EFFECT_SHRINK);

        if (applyAffect(thisEffect, target))
        {
            StartCoroutine(ShrinkLarge(scaleup, time * potency, target, thisEffect));
        }

        return(true);
    }
Пример #10
0
    bool DevCommandAddEffect(string[] parms)
    {
        if (parms.Length != 1)
        {
            DeveloperConsole.instance.writeError("Missing Effect ID or too many parameters.");
            return(false);
        }
        if (!Int32.TryParse(parms[0].Trim(), out int id))
        {
            DeveloperConsole.instance.writeError("Effect ID must be a number.");
            return(false);
        }

        SOEffect s = SOEffect.GetByID(id);

        if (s == null)
        {
            DeveloperConsole.instance.writeError("Unknown Effect ID " + id);
            return(false);
        }
        GameObject charo = gc.GetCharacter();

        if (charo == null)
        {
            DeveloperConsole.instance.writeError("Unable to get player.(1)");
            return(false);
        }
        IEffectable toEffect = charo.GetComponent <IEffectable>();

        if (toEffect == null)
        {
            DeveloperConsole.instance.writeError("Unable to get player.(2)");
            return(false);
        }

        s.onEffect(toEffect, 1);
        DeveloperConsole.instance.writeMessage("Applied effect " + s.PrintString() + " to player");
        return(true);
    }