public Skill(string name, int level, int[] requireAPArray, int[] cooldownArray, Dictionary<string, float[]> powerFactor, SkillType skillType, RangeForm firstRangeForm, int firstMinReach, int firstMaxReach, int firstWidth, RangeForm secondRangeForm, int secondMinReach, int secondMaxReach, int secondWidth, SkillApplyType skillApplyType, float[] penetrationArray, string effectName, EffectVisualType effectVisualType, EffectMoveType effectMoveType) { this.name = name; this.level = level; this.requireAPArray = requireAPArray; this.cooldownArray = cooldownArray; this.powerFactor = powerFactor; this.skillType = skillType; this.firstRangeForm = firstRangeForm; this.firstMinReach = firstMinReach; this.firstMaxReach = firstMaxReach; this.firstWidth = firstWidth; this.secondRangeForm = secondRangeForm; this.secondMinReach = secondMinReach; this.secondMaxReach = secondMaxReach; this.secondWidth = secondWidth; this.skillApplyType = skillApplyType; this.penetrationArray = penetrationArray; this.effectName = effectName; this.effectVisualType = effectVisualType; this.effectMoveType = effectMoveType; }
public StatusEffect(string name, int level, StatusEffectType statusEffectType, bool isBuff, bool isInfinite, bool isStackable, bool isRemovable, float[] degreeArray, Stat amountStat, float[] amountFactorArray, int remainAmount, int remainPhase, int remainStack, int cooldown, bool toBeRemoved, string effectName, EffectVisualType effectVisualType, EffectMoveType effectMoveType) { this.name = name; this.level = level; this.statusEffectType = statusEffectType; this.isBuff = isBuff; this.isInfinite = isInfinite; this.isStackable = isStackable; this.isRemovable = isRemovable; this.degreeArray = degreeArray; this.amountStat = amountStat; this.amountFactorArray = amountFactorArray; this.remainAmount = remainAmount; this.remainPhase = remainPhase; this.remainStack = remainStack; this.cooldown = cooldown; this.toBeRemoved = toBeRemoved; this.effectName = effectName; this.effectVisualType = effectVisualType; this.effectMoveType = effectMoveType; }
public SkillInfo(string data) { CommaStringParser commaParser = new CommaStringParser(data); this.owner = commaParser.Consume(); this.requireLevel = commaParser.ConsumeInt(); string name = commaParser.Consume(); int level = 0; // default level : 0 this.column = commaParser.ConsumeInt(); string originRequireAPString = commaParser.Consume(); string[] requireAPStringArray = originRequireAPString.Split(' '); int[] requireAPArray = new int[5]; for (int i = 0; i < 5; i++) { int parsed = 0; try { parsed = Int32.Parse(requireAPStringArray[i]); } catch { Debug.LogWarning("Parse error in requireAPs : " + originRequireAPString); parsed = -1; } requireAPArray[i] = parsed; } string originCooldownString = commaParser.Consume(); string[] cooldownStringArray = originCooldownString.Split(' '); int[] cooldownArray = new int[5]; for (int i = 0; i < 5; i++) { int parsed = 0; try { parsed = Int32.Parse(cooldownStringArray[i]); } catch { Debug.LogWarning("Parse error in requireAPs : " + originCooldownString); parsed = -1; } cooldownArray[i] = parsed; } // parsing coefficients for damage calculation string originStatTypeString = commaParser.Consume(); string[] statTypeArray = originStatTypeString.Split('/'); string originPowerFactorString = commaParser.Consume(); string[] powerFactorStringArray = originPowerFactorString.Split('/'); float[][] powerFactorArrayArray = new float[powerFactorStringArray.Length][]; for (int i = 0; i < powerFactorStringArray.Length; i++) { powerFactorArrayArray[i] = new float[5]; string[] powerFactorString = powerFactorStringArray[i].Split(' '); for (int j = 0; j < 5; j++) { float parsed = 0.0f; try { parsed = Convert.ToSingle(powerFactorString[j]); } catch { Debug.LogWarning("Parse error in powerFactors : " + originRequireAPString); parsed = -1; } powerFactorArrayArray[i][j] = parsed; } } Dictionary <string, float[]> powerFactor = new Dictionary <string, float[]>(); for (int i = 0; i < statTypeArray.Length; i++) { powerFactor.Add(statTypeArray[i], powerFactorArrayArray[i]); } SkillType skillType = commaParser.ConsumeEnum <SkillType>(); RangeForm firstRangeForm = commaParser.ConsumeEnum <RangeForm>(); int firstMinReach = commaParser.ConsumeInt(); int firstMaxReach = commaParser.ConsumeInt(); int firstWidth = commaParser.ConsumeInt(); RangeForm secondRangeForm = commaParser.ConsumeEnum <RangeForm>(); int secondMinReach = commaParser.ConsumeInt(); int secondMaxReach = commaParser.ConsumeInt(); int secondWidth = commaParser.ConsumeInt(); SkillApplyType skillApplyType = commaParser.ConsumeEnum <SkillApplyType>(); string originPenetrationString = commaParser.Consume(); string[] penetrationStringArray = originPenetrationString.Split(' '); float[] penetrationArray = new float[5]; for (int i = 0; i < 5; i++) { int parsed = 0; try { parsed = Int32.Parse(penetrationStringArray[i]); } catch { Debug.LogWarning("Parse error in penetrations : " + originPenetrationString); parsed = -1; } penetrationArray[i] = parsed; } string effectName = commaParser.Consume(); EffectVisualType effectVisualType = commaParser.ConsumeEnum <EffectVisualType>(); EffectMoveType effectMoveType = commaParser.ConsumeEnum <EffectMoveType>(); this.skill = new Skill(name, level, requireAPArray, cooldownArray, powerFactor, skillType, firstRangeForm, firstMinReach, firstMaxReach, firstWidth, secondRangeForm, secondMinReach, secondMaxReach, secondWidth, skillApplyType, penetrationArray, effectName, effectVisualType, effectMoveType); }
public StatusEffectInfo(string data) { Debug.Log(data); CommaStringParser commaParser = new CommaStringParser(data); this.owner = commaParser.Consume(); this.skillName = commaParser.Consume(); string name = commaParser.Consume(); int level = 0; StatusEffectType statusEffectType = commaParser.ConsumeEnum <StatusEffectType>(); bool isBuff = commaParser.ConsumeBool(); bool isInfinite = commaParser.ConsumeBool(); bool isStackable = commaParser.ConsumeBool(); bool isRemovable = commaParser.ConsumeBool(); string originDegreeString = commaParser.Consume(); string[] degreeStringArray = originDegreeString.Split(' '); float[] degreeArray = new float[5]; for (int i = 0; i < 5; i++) { float parsed = 0.0f; try { parsed = Convert.ToSingle(degreeStringArray[i]); } catch { Debug.LogWarning("Parse error in degrees : " + originDegreeString); parsed = -1; } degreeArray[i] = parsed; } Stat amountStat = commaParser.ConsumeEnum <Stat>(); string originAmountFactorString = commaParser.Consume(); string[] amountFactorStringArray = originAmountFactorString.Split(' '); float[] amountFactorArray = new float[5]; for (int i = 0; i < 5; i++) { float parsed = 0; try { parsed = Convert.ToSingle(amountFactorStringArray[i]); } catch { Debug.LogWarning("Parse error in amountFactors : " + originAmountFactorString); parsed = -1; } amountFactorArray[i] = parsed; } int remainAmount = 0; // 남은 보호막 체크용 int remainPhase = commaParser.ConsumeInt(); int remainStack = commaParser.ConsumeInt(); int cooldown = commaParser.ConsumeInt(); bool toBeRemoved = false; string effectName = commaParser.Consume(); EffectVisualType effectVisualType = commaParser.ConsumeEnum <EffectVisualType>(); EffectMoveType effectMoveType = commaParser.ConsumeEnum <EffectMoveType>(); this.statusEffect = new StatusEffect(name, level, statusEffectType, isBuff, isInfinite, isStackable, isRemovable, degreeArray, amountStat, amountFactorArray, remainAmount, remainPhase, remainStack, cooldown, toBeRemoved, effectName, effectVisualType, effectMoveType); }