示例#1
0
    // Adds amount to the status effect.
    public override void ApplyStatusEffect(BattleManager.StatusEffectEnum status, int amount)
    {
        Debug.Log("Status effect applied: " + status.ToString() + " w/ power " + amount);
        if (statusEffects.ContainsKey(status))
        {
            StatusEffectDataHolder x = statusEffects[status];
            // we have the status effect. Add to it.
            x.EffectValue += amount;

            // If the value is <= 0, we need to remove it.
            if (x.EffectValue <= 0)
            {
                puim.RemoveStatusEffect(x);
                statusEffects.Remove(status);
            }
        }
        else
        {
            // We don't have the status effect. Add it.
            statusEffects.Add(status, puim.AddNewStatusEffect(status, amount));
        }

        if (statusEffects.TryGetValue(status, out var val))
        {
            Debug.Log("We now have " + val.EffectValue + " power");
        }
    }
示例#2
0
    public override int GetStatusEffectValue(BattleManager.StatusEffectEnum status)
    {
        if (statusEffects.TryGetValue(status, out StatusEffectDataHolder x))
        {
            return(x.EffectValue);
        }

        return(0);
    }
示例#3
0
    /// <summary>
    /// Applies a status effect to the entity on the specified tile.
    /// </summary>
    /// <param name="target">A Vector2Int specifying which tile to target</param>
    /// <param name="status">Enum located in BattleManager that corresponds to which status effect you want to apply</param>
    /// <param name="power">How much status to apply</param>
    /// <returns>True if there was something on this tile.</returns>
    public bool ApplyStatusEffectOnTile(Vector2Int target, BattleManager.StatusEffectEnum status, int power)
    {
        Debug.Log("Applying status effect " + status.ToString() + " on tile " + target + ", with power " + power);
        Roguelike.Tile targetTile  = map[target.x, target.y];
        TileCreature   tarCreature = targetTile.GetEntityOnTile() as TileCreature;

        if (tarCreature != null)
        {
            tarCreature.ApplyStatusEffect(status, power);
            return(true);
        }
        return(false);
    }
示例#4
0
    /*private void Start()
     * {
     *  string[] names = new string[] { "StatusEffectArtwork", "StatusEffectIconTextObject"};
     *  Type[] types = new Type[] { typeof(UnityEngine.UI.Image), typeof(TextMeshProUGUI)};
     *  Component[] foundComponents = BattleManager.RecursiveVariableAssign(gameObject, names, types);
     *  statusIcon = foundComponents[0] as Image;
     *  numberText = foundComponents[1] as TextMeshProUGUI;
     * }*/

    public void SetStatusEffect(BattleManager.StatusEffectEnum type)
    {
        Debug.Log("Setting status effect " + type + ", " + (int)type);

        // Set up vars
        string[]    names           = new string[] { "StatusEffectArtwork", "StatusEffectIconTextObject" };
        Type[]      types           = new Type[] { typeof(UnityEngine.UI.Image), typeof(TextMeshProUGUI) };
        Component[] foundComponents = BattleManager.RecursiveVariableAssign(gameObject, names, types);
        statusIcon = foundComponents[0] as Image;
        numberText = foundComponents[1] as TextMeshProUGUI;


        Sprite targetImage = BattleManager.instance.statusEffectReference[(int)type];

        statusIcon.sprite = targetImage;
        setType           = type;

        tooltipBackground.gameObject.SetActive(false);
        switch (setType)
        {
        case BattleManager.StatusEffectEnum.defense:
            tooltipText.SetText("Defense takes damage before your health does.");
            break;

        case BattleManager.StatusEffectEnum.insight:
            tooltipText.SetText("Each point of insight boosts your next instance of damage by 100%.");
            break;

        case BattleManager.StatusEffectEnum.momentum:
            tooltipText.SetText("Momentum X boosts each instance of damage done by your next card by X.");
            break;

        case BattleManager.StatusEffectEnum.spiritLoss:
            tooltipText.SetText("You're low on spirit. Go down floors faster to recover.\nEach stage slows your card draw, and lowers your redraw amount. If you're out of spirit, you'll start losing health instead.");
            break;
        }
    }
示例#5
0
 public DamageBasedOnStatus(BattleManager.StatusEffectEnum effect)
 {
     StatusEffect = effect;
 }
示例#6
0
 public GetStatusEffectVal(BattleManager.StatusEffectEnum effect, bool selfTar = true)
 {
     StatusEffect = effect;
     SelfTar      = selfTar;
 }
示例#7
0
 public ApplyStatusEffect(IEffect powerFromEffect, BattleManager.StatusEffectEnum initStatusEffect, bool selfTar)
 {
     PowerFromEffect = powerFromEffect;
     StatusEffect    = initStatusEffect;
     SelfTar         = selfTar;
 }
示例#8
0
 public ApplyStatusEffect(int initPower, BattleManager.StatusEffectEnum initStatusEffect, bool selfTar)
 {
     StaticPower  = initPower;
     StatusEffect = initStatusEffect;
     SelfTar      = selfTar;
 }
示例#9
0
 public override void ApplyStatusEffect(BattleManager.StatusEffectEnum status, int amount)
 {
     Debug.LogError("Generic Enemy -- I was asked to apply a status effect, but that's not implemented.");
 }
示例#10
0
 public abstract void ApplyStatusEffect(BattleManager.StatusEffectEnum status, int amount);
示例#11
0
 public abstract int GetStatusEffectValue(BattleManager.StatusEffectEnum status);