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; } }
internal PotionEffect(SpellItemData subRecord) { effect = (MagicEffectType)subRecord.EffectId; affectedAttribute = effect.ByteConvertToAttribute(subRecord.AttributeId); affectedSkill = effect.ByteConvertToSkill(subRecord.SkillId); Duration = subRecord.Duration; Magnitude = subRecord.MagMin; }
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; }
private static float GetAddedDamageType(MagicItem magicItem, MagicEffectType effect) { if (magicItem.HasEffect(effect)) { return(magicItem.GetTotalEffectValue(effect)); } return(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; } } }
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}"); } }
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}"); } }
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; }
// コピーコンストラクタ 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(); }
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); } }
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); } }
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; } }
public static byte ByteConvertToSkillId(this MagicEffectType effect, SkillType skill) { return(effect.AffectsSkill() ? (byte)skill : BYTE_AFFECTED_ITEM_NONE); }
public static int IntConvertToAttributeId(this MagicEffectType effect, AttributeType attribute) { return(effect.AffectsAttribute() ? (int)attribute : INT_AFFECTED_ITEM_NONE); }
public static AttributeType IntConvertToAttribute(this MagicEffectType effect, int id) { return(effect.AffectsAttribute() ? (AttributeType)id : AttributeType.None); }
public static byte ByteConvertToAttributeId(this MagicEffectType effect, AttributeType attribute) { return(effect.AffectsAttribute() ? (byte)attribute : BYTE_AFFECTED_ITEM_NONE); }
public override void EndMagicEffect(MagicEffectType type) { base.EndMagicEffect(type); }
public override void EndMagicEffect(MagicEffectType type) { base.EndMagicEffect(type); mainBattleScript.PlayerScript.UnBlockButtons(); }
public MagicEffect(MagicEffectType type) : base(type) { }
internal IngredientEffect(MagicEffectType effect, AttributeType affectedAttribute, SkillType affectedSkill) { Effect = effect; AffectedAttribute = affectedAttribute; AffectedSkill = affectedSkill; }
public PotionEffect(MagicEffectType effect) { Effect = effect; }
public PotionEffect(MagicEffectType effect, AttributeType affectedAttribute) { Effect = effect; AffectedAttribute = affectedAttribute; }
public static SkillType IntConvertToSkill(this MagicEffectType effect, int id) { return(effect.AffectsSkill() ? (SkillType)id : SkillType.None); }
public static int IntConvertToSkillId(this MagicEffectType effect, SkillType skill) { return(effect.AffectsSkill() ? (int)skill : INT_AFFECTED_ITEM_NONE); }
public PotionEffect(MagicEffectType effect, SkillType affectedSkill) { Effect = effect; AffectedSkill = affectedSkill; }