protected void MidMagicEffect(MagicEffectType type)
    {
        GameObject newText = Instantiate(text);

        if (currentCharacter == TargetCharacter.Player)
        {
            newText.GetComponent <TextScript>().SetPlayerPos();
        }
        else if (currentCharacter == TargetCharacter.Enemy)
        {
            newText.GetComponent <TextScript>().SetEnemyPos();
        }
        switch (type)
        {
        case MagicEffectType.Armor:
            int armorMagicEffectNum = (int)((float)armor / 100f * armorBuffPer);
            ///
            mainBattleScript.MagicEffectManager.AddMagicEffect(currentCharacter, type, armorMagicEffectNum, 2, false);
            ///
            newText.GetComponent <TextScript>().SetColor(2);
            newText.GetComponent <TextScript>().SetText("+" + System.Convert.ToString(armorMagicEffectNum));
            break;

        case MagicEffectType.Healing:
            float healingMagicEffectNum = maxHealthPoint / 100 * healingPer;
            ///
            Healing(healingMagicEffectNum);
            ///
            mainBattleScript.MagicEffectManager.AddMagicEffect(currentCharacter, type, healingMagicEffectNum, 4, false);
            ///
            newText.GetComponent <TextScript>().SetColor(1);
            newText.GetComponent <TextScript>().SetText("+" + System.Convert.ToString(healingMagicEffectNum));
            break;
        }
    }
Exemplo n.º 2
0
 internal PotionEffect(SpellItemData subRecord)
 {
     effect            = (MagicEffectType)subRecord.EffectId;
     affectedAttribute = effect.ByteConvertToAttribute(subRecord.AttributeId);
     affectedSkill     = effect.ByteConvertToSkill(subRecord.SkillId);
     Duration          = subRecord.Duration;
     Magnitude         = subRecord.MagMin;
 }
Exemplo n.º 3
0
 internal PotionEffect(MagicEffectType effect, AttributeType affectedAttribute, SkillType affectedSkill, int duration, int magnitude)
 {
     this.effect            = effect;
     this.affectedAttribute = affectedAttribute;
     this.affectedSkill     = affectedSkill;
     Duration  = duration;
     Magnitude = magnitude;
 }
Exemplo n.º 4
0
        private static float GetAddedDamageType(MagicItem magicItem, MagicEffectType effect)
        {
            if (magicItem.HasEffect(effect))
            {
                return(magicItem.GetTotalEffectValue(effect));
            }

            return(0);
        }
Exemplo n.º 5
0
 internal SpellEffect(SpellItemData subRecord)
 {
     effect            = (MagicEffectType)subRecord.EffectId;
     affectedSkill     = effect.ByteConvertToSkill(subRecord.SkillId);
     affectedAttribute = effect.ByteConvertToAttribute(subRecord.AttributeId);
     Range             = (RangeType)subRecord.RangeType;
     area         = subRecord.Area;
     duration     = subRecord.Duration;
     minMagnitude = subRecord.MagMin;
     maxMagnitude = subRecord.MagMax;
 }
 public bool CheckMagicEffect(TargetCharacter character, MagicEffectType effectType)
 {
     foreach (MagicEffect effect in activeMagicEffects)
     {
         if ((effect.TargetCharacter == character) && (effect.Type == effectType))
         {
             return(true);
         }
     }
     return(false);
 }
 public void Clear(TargetCharacter character, MagicEffectType type)
 {
     for (int i = 0; i < activeMagicEffects.Count; i++)
     {
         if ((activeMagicEffects[i].TargetCharacter == character) && (activeMagicEffects[i].Type == type))
         {
             activeMagicEffects.RemoveAt(i);
             i = 0;
         }
     }
 }
Exemplo n.º 8
0
 public static void CheckAttribute(this MagicEffectType effect, AttributeType attribute)
 {
     if (!effect.AffectsAttribute() && attribute != AttributeType.None)
     {
         throw new InvalidOperationException($"This effect does not affect an Attribute: {effect}");
     }
     if (attribute == AttributeType.None && effect.AffectsAttribute())
     {
         throw new InvalidOperationException($"Affected attribute required for this effect: {effect}");
     }
 }
Exemplo n.º 9
0
 public static void CheckSkill(this MagicEffectType effect, SkillType skill)
 {
     if (!effect.AffectsSkill() && skill != SkillType.None)
     {
         throw new InvalidOperationException($"This effect does not affect a Skill: {effect}");
     }
     if (skill == SkillType.None && effect.AffectsSkill())
     {
         throw new InvalidOperationException($"Affected skill required for this effect: {effect}");
     }
 }
Exemplo n.º 10
0
 internal SpellEffect(MagicEffectType effect, SkillType affectedSkill, AttributeType affectedAttribute, RangeType range, int area, int duration, int minMagnitude, int maxMagnitude)
 {
     this.effect            = effect;
     this.affectedSkill     = affectedSkill;
     this.affectedAttribute = affectedAttribute;
     Range             = range;
     this.area         = area;
     this.duration     = duration;
     this.minMagnitude = minMagnitude;
     this.maxMagnitude = maxMagnitude;
 }
Exemplo n.º 11
0
    // コピーコンストラクタ
    public MagicProfile(MagicProfile source)
    {
        this.Name            = source.Name;
        this.ID              = source.ID;
        this.EffectTypeValue = source.EffectTypeValue;
        this.EffectValue     = source.EffectValue;

        // 武器性能
        this.Attack             = source.Attack;
        this.AttackCriticalRate = source.AttackCriticalRate;
        this.AttackTimes        = source.AttackTimes;
    }
    public void StartMagicEffect(MagicEffectType type)
    {
        switch (type)
        {
        case MagicEffectType.Armor:
            animator.SetBool("Def", true);
            break;

        case MagicEffectType.Healing:
            animator.SetBool("Healing", true);
            break;
        }
    }
    public virtual void EndMagicEffect(MagicEffectType type)
    {
        switch (type)
        {
        case MagicEffectType.Armor:
            animator.SetBool("Def", false);
            break;

        case MagicEffectType.Healing:
            animator.SetBool("Healing", false);
            break;
        }
        mainBattleScript.SwitchTurn();
    }
Exemplo n.º 14
0
        public static bool AffectsSkill(this MagicEffectType effect)
        {
            switch (effect)
            {
            case MagicEffectType.FortifySkill:
            case MagicEffectType.DrainSkill:
            case MagicEffectType.AbsorbSkill:
            case MagicEffectType.DamageSkill:
            case MagicEffectType.RestoreSkill:
                return(true);

            default:
                return(false);
            }
        }
Exemplo n.º 15
0
        public static bool AffectsAttribute(this MagicEffectType effect)
        {
            switch (effect)
            {
            case MagicEffectType.FortifyAttribute:
            case MagicEffectType.DrainAttribute:
            case MagicEffectType.AbsorbAttribute:
            case MagicEffectType.DamageAttribute:
            case MagicEffectType.RestoreAttribute:
                return(true);

            default:
                return(false);
            }
        }
Exemplo n.º 16
0
    public void ParseStr()
    {
        if (EffectType != "")
        {
            EffectTypeValue = (MagicEffectType)System.Enum.Parse(typeof(MagicEffectType), EffectType);
        }
        if (FigureType != "")
        {
            FigureTypeValue = (MagicFigureType)System.Enum.Parse(typeof(MagicFigureType), FigureType);
        }

        foreach (string attri in Attribute.Split(','))
        {
            switch (attri)
            {
            default:
                break;
            }
        }
    }
        public MagicEffect(TargetCharacter character, MagicEffectType type, float value, int currentTurn, int lTime, bool infinit)
        {
            startTurn       = currentTurn;
            endTurn         = startTurn + lTime;
            this.infinit    = infinit;
            targetCharacter = character;
            this.type       = type;
            switch (type)
            {
            case MagicEffectType.Armor:
                this.value = value;
                ChangeArmor((int)value);
                break;

            case MagicEffectType.Fire:
                this.value = value / 10;
                break;

            case MagicEffectType.Healing:
                this.value = value;
                break;

            case MagicEffectType.IncreaseMaxHealthPoint:
                this.value = value;
                ChangeMaxHealthPoint(value);
                break;

            case MagicEffectType.Ice:
                this.value = value * 3;
                ChangeAgility((int)this.value);
                break;

            case MagicEffectType.Water:
                this.value = value * 2;
                ChangeAgility((int)this.value);
                break;
            }
        }
Exemplo n.º 18
0
 public static byte ByteConvertToSkillId(this MagicEffectType effect, SkillType skill)
 {
     return(effect.AffectsSkill() ? (byte)skill : BYTE_AFFECTED_ITEM_NONE);
 }
Exemplo n.º 19
0
 public static int IntConvertToAttributeId(this MagicEffectType effect, AttributeType attribute)
 {
     return(effect.AffectsAttribute() ? (int)attribute : INT_AFFECTED_ITEM_NONE);
 }
Exemplo n.º 20
0
 public static AttributeType IntConvertToAttribute(this MagicEffectType effect, int id)
 {
     return(effect.AffectsAttribute() ? (AttributeType)id : AttributeType.None);
 }
Exemplo n.º 21
0
 public static byte ByteConvertToAttributeId(this MagicEffectType effect, AttributeType attribute)
 {
     return(effect.AffectsAttribute() ? (byte)attribute : BYTE_AFFECTED_ITEM_NONE);
 }
Exemplo n.º 22
0
 public override void EndMagicEffect(MagicEffectType type)
 {
     base.EndMagicEffect(type);
 }
Exemplo n.º 23
0
 public override void EndMagicEffect(MagicEffectType type)
 {
     base.EndMagicEffect(type);
     mainBattleScript.PlayerScript.UnBlockButtons();
 }
Exemplo n.º 24
0
 public MagicEffect(MagicEffectType type) : base(type)
 {
 }
Exemplo n.º 25
0
 internal IngredientEffect(MagicEffectType effect, AttributeType affectedAttribute, SkillType affectedSkill)
 {
     Effect            = effect;
     AffectedAttribute = affectedAttribute;
     AffectedSkill     = affectedSkill;
 }
Exemplo n.º 26
0
 public PotionEffect(MagicEffectType effect)
 {
     Effect = effect;
 }
Exemplo n.º 27
0
 public PotionEffect(MagicEffectType effect, AttributeType affectedAttribute)
 {
     Effect            = effect;
     AffectedAttribute = affectedAttribute;
 }
Exemplo n.º 28
0
 public static SkillType IntConvertToSkill(this MagicEffectType effect, int id)
 {
     return(effect.AffectsSkill() ? (SkillType)id : SkillType.None);
 }
Exemplo n.º 29
0
 public static int IntConvertToSkillId(this MagicEffectType effect, SkillType skill)
 {
     return(effect.AffectsSkill() ? (int)skill : INT_AFFECTED_ITEM_NONE);
 }
Exemplo n.º 30
0
 public PotionEffect(MagicEffectType effect, SkillType affectedSkill)
 {
     Effect        = effect;
     AffectedSkill = affectedSkill;
 }