Example #1
0
        public override string ToString()
        {
            StringBuilder sb = new StringBuilder();

            sb.AppendLine(" AbilityState : ");
            sb.AppendFormat("\tfrom {0} to {1}", Performer.Name, Target[0].Name);
            sb.AppendLine();
            sb.AppendFormat("\ttype: {0}", _type.ToString());
            return(sb.ToString());
        }
Example #2
0
    public override string GetDescription()
    {
        StringBuilder sb = new StringBuilder(base.GetDescription());

        sb.Append($"\nDamage type: {attackType.ToString()}");
        sb.Append($"\nDamage value: {damage.ToString()}");
        sb.Append($"\nReuse time: {recastInterval.ToString("n2")} s");

        return(sb.ToString());
    }
Example #3
0
        public override string ToString()
        {
            string toString = Name + ", " + DamageType.ToString() + ", ";

            toString += AttackType.ToString() + ", ";
            toString += DieType.ToString() + ", ";
            toString += NumberOfDice.ToString() + ", ";
            toString += Modifier.ToString();

            return(toString);
        }
Example #4
0
 public void PlaySound(AttackType attack)
 {
     if (attackSounds[attack] != null)
     {
         attackSounds[attack].Play();
     }
     else
     {
         Debug.Log("Attack sound of type " + attack.ToString() + " not found.");
     }
 }
Example #5
0
 public override void getHit(double damage, AttackType attackType)
 {
     enemyIsHit = true;
     if(attackType == AttackType.Fire){
         damage = damage - (int)((damage * .75f));
     }
     health = health - (int)damage;
     Debug.Log (attackType.ToString());
     if (health < 0) {
         health = 0;
     }
 }
Example #6
0
 public static ParticleSystem GetAttackEffect(TowerType towerType, AttackType attackType)
 {
     try
     {
         var effectData = ContentLoader.Load <ParticleSystemData>(towerType + attackType.ToString() +
                                                                  EffectType.Attack);
         return(new ParticleSystem(effectData));
     }
     catch             //ncrunch: no coverage start, MockContentLoader will have the above lines always pass
     {
         return(FallbackEffects.AttackEffect());
     }             //ncrunch: no coverage end
 }
Example #7
0
		public static ParticleSystem GetAttackEffect(TowerType towerType, AttackType attackType)
		{
			try
			{
				var effectData = ContentLoader.Load<ParticleSystemData>(towerType + attackType.ToString() + 
					EffectType.Attack);
				return new ParticleSystem(effectData);
			}
			catch //ncrunch: no coverage start, MockContentLoader will have the above lines always pass
			{
				return FallbackEffects.AttackEffect();
			} //ncrunch: no coverage end
		}
Example #8
0
		public static ParticleSystem GetProjectileEffect(TowerType towerType, AttackType attackType)
		{
			try
			{
				var effectData = ContentLoader.Load<ParticleSystemData>(towerType + attackType.ToString() +
						EffectType.Projectile);
				var effect = new ParticleSystem(effectData);
				foreach (var emitter in effect.AttachedEmitters)
					emitter.EmitterData.DoParticlesTrackEmitter = true;
				return effect;
			}
			catch //ncrunch: no coverage start
			{
				return FallbackEffects.ProjectileEffect();
			} //ncrunch: no coverage end
		}
Example #9
0
 public static ParticleSystem GetProjectileEffect(TowerType towerType, AttackType attackType)
 {
     try
     {
         var effectData = ContentLoader.Load<ParticleSystemData>(towerType + attackType.ToString() +
                 EffectType.Projectile);
         var effect = new ParticleSystem(effectData);
         foreach (var emitter in effect.AttachedEmitters)
             emitter.EmitterData.DoParticlesTrackEmitter = true;
         return effect;
     }
     catch //ncrunch: no coverage start
     {
         return FallbackEffects.ProjectileEffect();
     } //ncrunch: no coverage end
 }
Example #10
0
        public IEnumerable <bool> GetAtkBooleanModifiers(AttackType atkType, AttackStat attackStat)
        {
            if (buffList.Count == 0)
            {
                yield return(false);
            }

            bool result = false;

            //Run through each active buff
            foreach (string id in buffList.Keys)
            {
                EffectName effect = (EffectName)Enum.Parse(typeof(EffectName), id);
                // Check if effect type boosts Attack, otherwise desired EffectStats aren't assigned
                if (effectDB.GetEffectStat(EffectStat.EffectType, effect) == "Atk Boost")
                {
                    // Skip if not a boolean buff value
                    if (int.Parse(effectDB.GetEffectStat(EffectStat.Additive, effect)) != 2)
                    {
                        continue;
                    }

                    // Get affected skill list and compare with the provided AtkType
                    string fxAttackTypes = effectDB.GetEffectStat(EffectStat.AtkTypesAffected, effect);
                    if (fxAttackTypes == "All" || fxAttackTypes.Contains(atkType.ToString()))
                    {
                        string fxAttackStats = effectDB.GetEffectStat(EffectStat.AtkStatsAffected, effect);
                        // Compare the Effect stat to the provided stat
                        if (fxAttackStats.Contains(attackStat.ToString()))
                        {
                            // Check and assign value, then check if buff is consumed on activation
                            if (effectDB.GetEffectStat(EffectStat.AtkEffectValues, effect).ToLower() == "true")
                            {
                                result = true;
                            }
                            if (int.Parse(effectDB.GetEffectStat(EffectStat.Consumed, effect)) == 1)
                            {
                                removeIDs.Add(id);
                            }
                        }
                    }
                }
            }

            yield return(result);
        }
Example #11
0
        public IEnumerable <float[]> GetAtkStatModifiers(AttackType atkType, AttackStat attackStat)
        {
            if (buffList.Count == 0)
            {
                yield return new float[] { 0, 0 }
            }
            ;

            float[] result = new float[] { 0, 0 };
            //Run through each active buff
            foreach (string id in buffList.Keys)
            {
                EffectName effect = (EffectName)Enum.Parse(typeof(EffectName), id);

                // Check if effect type boosts Attack, otherwise desired EffectStats aren't assigned
                if (effectDB.GetEffectStat(EffectStat.EffectType, effect) == "Atk Boost")
                {
                    // Skip if buff value is a bool
                    int modType = int.Parse(effectDB.GetEffectStat(EffectStat.Additive, effect));
                    if (modType == 2)
                    {
                        continue;
                    }

                    // Get affected skill list and compare with the provided AtkType
                    string fxAttackTypes = effectDB.GetEffectStat(EffectStat.AtkTypesAffected, effect);
                    if (fxAttackTypes == "All" || fxAttackTypes.Contains(atkType.ToString()))
                    {
                        string fxAttackStats = effectDB.GetEffectStat(EffectStat.AtkStatsAffected, effect);
                        // Compare the Effect stat to the provided stat
                        if (fxAttackStats.Contains(attackStat.ToString()))
                        {
                            // Check and assign value, then check if buff is consumed on activation
                            result[modType] += float.Parse(effectDB.GetEffectStat(EffectStat.AtkEffectValues, effect));
                            if (int.Parse(effectDB.GetEffectStat(EffectStat.Consumed, effect)) == 1 && !removeIDs.Contains(id))
                            {
                                removeIDs.Add(id);
                            }
                        }
                    }
                }
            }

            yield return(result);
        }
Example #12
0
        public static (string, string) MessageOnShoot(AttackType status, string username, string username2, string direction)
        {
            switch (status)
            {
            case AttackType.NoTarget:
                return(string.Format(Answers.ShootWall.RandomAnswer(), username, username2, direction),
                       string.Format(AnswersForOther.ShootWall.RandomAnswer(), username, username2, direction));

            case AttackType.Kill:
                return(string.Format(Answers.ShootKill.RandomAnswer(), username2, direction),
                       string.Format(AnswersForOther.ShootKill.RandomAnswer(), username, username2, direction));

            case AttackType.Hit:
                return(string.Format(Answers.ShootHit.RandomAnswer(), username2, direction),
                       string.Format(AnswersForOther.ShootHit.RandomAnswer(), username, username2, direction));
            }

            throw new ArgumentException(status.ToString());
        }
Example #13
0
        public static int Cap(this AttackType type)
        {
            switch (type)
            {
            case AttackType.ArtilleryDuelSub:
                return(100);

            case AttackType.NightBattle:
                return(300);

            case AttackType.ArtilleryDuel:
            case AttackType.ArtilleryDuelAir:
                return(180);

            case AttackType.AirAttack:
            case AttackType.LightningBattle:
                return(150);

            default:
                throw new ArgumentException(type.ToString());
            }
        }
    string GetAttackAnim(AttackType type, Direction dir)
    {
        string s = type.ToString().ToLower();

        switch (dir)
        {
        case Direction.RIGHT: s += "_side_";
            break;

        case Direction.LEFT: s += "_side_";
            break;

        case Direction.UP: s += "_side_";
            break;

        case Direction.DOWN: s += "_side_";
            break;

        default: s += "_side_";
            break;
        }
        s += attackAnimRight ? "r" : "l";
        return(s);
    }
Example #15
0
    public static string species(float size, float weirdChance = 0, float dietChance = 0, 
	                             AttackType attType = AttackType.Null, DefenceType defType = DefenceType.Null,
	                             MovementType movType = MovementType.Null, Targets targets = Targets.Null, float speed = 1, int complexity = 0)
    {
        //TODO: Come up with a name-generating system.
        string result = "";
        DietType Diet;
        if(weirdChance == 0){
            weirdChance = Random.value;
        }
        if(dietChance == 0){
            dietChance = Random.value;
        }
        result += "Fish ";

        if(dietChance >= .85){
            result += DietType.Omnivore.ToString();
            Diet = DietType.Omnivore;
        }
        else if(dietChance >= .65){
            result += DietType.Carnivore.ToString();
            Diet = DietType.Carnivore;
        }
        else{
            result += DietType.Herbivore.ToString();
            Diet = DietType.Herbivore;
        }
        result += " ";

        if(weirdChance >= 0.9f){
            if(Random.value >= 0.5){
                //Debug.Log("Flounder");
                result += (Random.Range(1f, 1.7f)*size + " ");
                result += (Random.Range(0.3f, 0.6f)*size + " ");
                result += (Random.Range(1f, 1.7f)*size + " ");
            }
            else{
                //Debug.Log ("Sunfish");
                result += (Random.Range(0.3f, 0.6f)*size + " ");
                result += (Random.Range(1.6f, 4.5f)*size + " ");
                result += (Random.Range(0.8f, 1.7f)*size + " ");
            }
        }
        else{
            result += (Random.Range(0.8f, 1.2f)*size + " ");
            result += (Random.Range(0.8f, 1.2f)*size + " ");
            result += (Random.Range(0.8f, 1.2f)*size + " ");
        }

        if(attType==AttackType.Null){
            attType = determineAttack(Diet);
        }
        result += attType.ToString() + " ";

        if(defType==DefenceType.Null){
            defType = determineDefence(Diet);
        }
        result += defType.ToString() + " ";

        if(movType==MovementType.Null){
            movType = determineMovement();
        }
        result += movType.ToString() + " ";

        if(targets==Targets.Null){
            targets = determineTargets(size, Diet, attType);
        }
        result += targets.ToString() + " ";

        //TODO:Generate Speed
        result += (speed);
        result += addMods(complexity);
        return result;
    }
 public override string ToString()
 {
     return(string.Format("{0} {1}", enemyAttackType.ToString(), duration.ToString()));
 }
Example #17
0
 public override string ToString()
 {
     return("HumanActionAttack " + (target != null ? target.name : "no target") + " " + attackType.ToString());
 }
Example #18
0
        public static void CallInAttack(CoffinUser Target, AttackType attackType)
        {
            var attack = new Exploits.Attack(Target, PlayerManager.GetCurrentPlayer().ToCoffin());

            attack.attackType = attackType;
            ExploitAPI.CalledInAttacks.Add(attack);

            ConsoleUtils.Success($"Attack on {Target.Username} has been called in successfully. Attack of Type {attackType.ToString()} will now be executed.");
        }
Example #19
0
        public void SaveToFile(string filename)
        {
            using (FileStream fs = File.Open(filename, FileMode.Create, FileAccess.Write))
            {
                using (XmlWriter writer = XmlWriter.Create(fs)) // This forces the XmlWriter to flush to the file
                {
                    writer.WriteStartDocument();
                    writer.WriteStartElement("UnitType");

                    writer.WriteAttributeString("name", name);
                    writer.WriteAttributeString("maxHealth", XmlConvert.ToString(maxHealth));
                    writer.WriteAttributeString("attackType", attackType.ToString());
                    writer.WriteAttributeString("attackStrength", XmlConvert.ToString(attackStrength));
                    writer.WriteAttributeString("attackRange", XmlConvert.ToString(attackRange));
                    writer.WriteAttributeString("attackSpeed", XmlConvert.ToString(attackSpeed));
                    writer.WriteAttributeString("defense", XmlConvert.ToString(defense));
                    writer.WriteAttributeString("movementType", movementType.ToString());
                    writer.WriteAttributeString("movementSpeed", XmlConvert.ToString(movementSpeed));

                    writer.WriteAttributeString("gatherRate", XmlConvert.ToString(gatherRate));
                    writer.WriteAttributeString("goldCost", XmlConvert.ToString(goldCost));
                    writer.WriteAttributeString("ironCost", XmlConvert.ToString(ironCost));
                    writer.WriteAttributeString("manaCrystalsCost", XmlConvert.ToString(manaCrystalsCost));
                    writer.WriteAttributeString("textureFilename", textureFilename);
                    writer.WriteAttributeString("textureFilename", textureFilename);
                    writer.WriteAttributeString("frameWidth", XmlConvert.ToString(frameWidth));
                    writer.WriteAttributeString("frameHeight", XmlConvert.ToString(frameHeight));

                    foreach (var action in actions)
                    {
                        writer.WriteElementString("Action", action.ToString());
                    }
                    foreach (var spell in spells)
                    {
                        writer.WriteElementString("Spell", spell.ToString());
                    }
                    int directionIndex = 0;
                    foreach (var direction in new [] { "Right", "Down", "Left", "Up" })
                    {
                        writer.WriteStartElement("Idle" + direction);
                        foreach (var idleIndex in idleIndices[directionIndex++])
                        {
                            writer.WriteElementString("Frame", XmlConvert.ToString(idleIndex));
                        }
                        writer.WriteEndElement();
                    }
                    directionIndex = 0;
                    foreach (var direction in new[] { "Right", "Down", "Left", "Up" })
                    {
                        writer.WriteStartElement("Walk" + direction);
                        foreach (var idleIndex in walkIndices[directionIndex++])
                        {
                            writer.WriteElementString("Frame", XmlConvert.ToString(idleIndex));
                        }
                        writer.WriteEndElement();
                    }
                    directionIndex = 0;
                    foreach (var direction in new[] { "Right", "Down", "Left", "Up" })
                    {
                        writer.WriteStartElement("Attack" + direction);
                        foreach (var idleIndex in attackIndices[directionIndex++])
                        {
                            writer.WriteElementString("Frame", XmlConvert.ToString(idleIndex));
                        }
                        writer.WriteEndElement();
                    }

                    writer.WriteEndElement(); // UnitType
                    writer.WriteEndDocument();
                }
            }
        }
        public static LootStats LootStats(WorldObject wo, LootStats ls, bool logstats)
        {
            // Weapon Properties
            double missileDefMod = 0.00f;
            double magicDefMod   = 0.00f;
            double wield         = 0.00f;
            int    value         = 0;

            ls.TotalItems++;

            // Loop depending on how many items you are creating
            for (int i = 0; i < 1; i++)
            {
                var testItem = wo;
                if (testItem is null)
                {
                    ls.NullCount++;
                    continue;
                }
                string itemType = testItem.ItemType.ToString();
                if (itemType == null)
                {
                    ls.NullCount++;

                    continue;
                }

                switch (testItem.ItemType)
                {
                case ItemType.None:
                    break;

                case ItemType.MeleeWeapon:
                    ls.MeleeWeaponCount++;
                    string strikeType = "N";
                    if (testItem.WeaponMagicDefense != null)
                    {
                        magicDefMod = testItem.WeaponMagicDefense.Value;
                    }
                    if (testItem.Value != null)
                    {
                        value = testItem.Value.Value;
                    }
                    if (testItem.WeaponMissileDefense != null)
                    {
                        missileDefMod = testItem.WeaponMissileDefense.Value;
                    }
                    if (testItem.WieldDifficulty != null)
                    {
                        wield = testItem.WieldDifficulty.Value;
                    }
                    if (testItem.WeaponSkill == Skill.TwoHandedCombat)
                    {
                        if (logstats == true)
                        {
                            ls.MeleeWeapons += $"{testItem.WeaponSkill},{wield},{testItem.Damage.Value},{strikeType},{testItem.DamageVariance.Value},{testItem.WeaponDefense.Value},{magicDefMod},{missileDefMod},{value},{testItem.Name}\n";
                        }
                        else
                        {
                            ls.MeleeWeapons += $" {testItem.WeaponSkill}\t {wield}\t {testItem.Damage.Value}\t\t {strikeType} \t\t {testItem.DamageVariance.Value}\t\t {testItem.WeaponDefense.Value}\t\t {magicDefMod}\t\t {missileDefMod}\t\t {value}\t {testItem.Name}\n";
                        }
                    }
                    else
                    {
                        AttackType attackType = testItem.W_AttackType;
                        string     at         = attackType.ToString("F");
                        if (at.Contains("DoubleSlash") || at.Contains("DoubleThrust"))
                        {
                            strikeType = "2x";
                        }
                        else if (at.Contains("TripleSlash") || at.Contains("TripleThrust"))
                        {
                            strikeType = "3x";
                        }
                        if (logstats == true)
                        {
                            ls.MeleeWeapons += $"{testItem.WeaponSkill},{wield},{testItem.Damage.Value},{strikeType},{testItem.DamageVariance.Value},{testItem.WeaponDefense.Value},{magicDefMod},{missileDefMod},{value},{testItem.Name}\n";
                        }
                        else
                        {
                            ls.MeleeWeapons += $" {testItem.WeaponSkill}\t\t {wield}\t {testItem.Damage.Value}\t\t {strikeType}\t\t {testItem.DamageVariance.Value}\t\t {testItem.WeaponDefense.Value}\t\t {magicDefMod}\t\t {missileDefMod}\t\t {value}\t {testItem.Name}\n";
                        }
                    }
                    break;

                case ItemType.Armor:
                    ls.ArmorCount++;
                    string equipmentSet = "None";
                    if (testItem.EquipmentSetId != null)
                    {
                        equipmentSet = Enum.GetName(typeof(EquipmentSet), testItem.EquipmentSetId);
                    }
                    if (logstats == true)
                    {
                        ls.Armor += $"{testItem.ArmorLevel},{equipmentSet},{testItem.Value.Value},{testItem.Name}\n";
                    }
                    else
                    {
                        ls.Armor += $" {testItem.ArmorLevel}\t {equipmentSet}\t\t {testItem.Value.Value} \t {testItem.Name}\n";
                    }
                    if (testItem.Name.Contains("Sheild"))
                    {
                        break;
                    }
                    if (testItem.ArmorLevel > ls.MaxAL)
                    {
                        ls.MaxAL     = testItem.ArmorLevel.Value;
                        ls.MaxALItem = testItem.Name;
                    }
                    if (testItem.ArmorLevel < ls.MinAL)
                    {
                        ls.MinAL     = testItem.ArmorLevel.Value;
                        ls.MinALItem = testItem.Name;
                    }
                    break;

                case ItemType.Clothing:
                    ls.ClothingCount++;
                    break;

                case ItemType.Jewelry:
                    ls.JewelryCount++;
                    break;

                case ItemType.Creature:
                    break;

                case ItemType.Food:
                    ls.Food++;
                    break;

                case ItemType.Money:
                    break;

                case ItemType.Misc:

                    string spirit  = "Spirit";
                    string potionA = "Philtre";
                    string potionB = "Elixir";
                    string potionC = "Tonic";
                    string potionD = "Brew";
                    string potionE = "Potion";
                    string potionF = "Draught";
                    string potionG = "Tincture";

                    string healingKits    = "Kit";
                    string spellcompGlyph = "Glyph";
                    string spellcompInk   = "Ink";
                    string spellcompQuill = "Quill";

                    if (testItem.Name.Contains(spirit))
                    {
                        ls.Spirits++;
                    }
                    else if (testItem is PetDevice petDevice)
                    {
                        ls.PetsCount++;
                        int totalRatings     = 0;
                        int damage           = 0;
                        int damageResist     = 0;
                        int crit             = 0;
                        int critDamage       = 0;
                        int critDamageResist = 0;
                        int critResist       = 0;
                        int petLevel         = 0;

                        if (petDevice.UseRequiresSkillLevel == 570)
                        {
                            petLevel = 200;
                        }
                        else if (petDevice.UseRequiresSkillLevel == 530)
                        {
                            petLevel = 180;
                        }
                        else if (petDevice.UseRequiresSkillLevel == 475)
                        {
                            petLevel = 150;
                        }
                        else if (petDevice.UseRequiresSkillLevel == 430)
                        {
                            petLevel = 125;
                        }
                        else if (petDevice.UseRequiresSkillLevel == 400)
                        {
                            petLevel = 100;
                        }
                        else if (petDevice.UseRequiresSkillLevel == 370)
                        {
                            petLevel = 80;
                        }
                        else if (petDevice.UseRequiresSkillLevel == 310 || petDevice.UseRequiresSkillLevel == 320)
                        {
                            petLevel = 50;
                        }
                        if (petLevel == 0)
                        {
                            Console.WriteLine("Skill= " + petDevice.UseRequiresSkillLevel);
                        }

                        if (petDevice.GearDamage != null)
                        {
                            totalRatings += petDevice.GearDamage.Value;
                            damage        = petDevice.GearDamage.Value;
                        }
                        if (petDevice.GearDamageResist != null)
                        {
                            totalRatings += petDevice.GearDamageResist.Value;
                            damageResist  = petDevice.GearDamageResist.Value;
                        }
                        if (petDevice.GearCrit != null)
                        {
                            totalRatings += petDevice.GearCrit.Value;
                            crit          = petDevice.GearCrit.Value;
                        }
                        if (petDevice.GearCritDamage != null)
                        {
                            totalRatings += petDevice.GearCritDamage.Value;
                            critDamage    = petDevice.GearCritDamage.Value;
                        }
                        if (petDevice.GearCritDamageResist != null)
                        {
                            totalRatings    += petDevice.GearCritDamageResist.Value;
                            critDamageResist = petDevice.GearCritDamageResist.Value;
                        }
                        if (petDevice.GearCritResist != null)
                        {
                            totalRatings += petDevice.GearCritResist.Value;
                            critResist    = petDevice.GearCritResist.Value;
                        }
                        if (logstats == true)
                        {
                            ls.Pets += $"{petLevel},{damage},{damageResist},{crit},{critDamage},{critDamageResist},{critResist},{totalRatings}\n";
                        }
                        else
                        {
                            ls.Pets += $" {petLevel}\t {damage}\t {damageResist}\t {crit}\t {critDamage}\t {critDamageResist}\t {critResist}\t {totalRatings}\n";
                        }

                        if (totalRatings > 99)
                        {
                            ls.PetRatingsOverHundred++;
                        }
                        else if (totalRatings > 89)
                        {
                            ls.PetRatingsOverNinety++;
                        }
                        else if (totalRatings > 79)
                        {
                            ls.PetRatingsOverEighty++;
                        }
                        else if (totalRatings > 69)
                        {
                            ls.PetRatingsOverSeventy++;
                        }
                        else if (totalRatings > 59)
                        {
                            ls.PetRatingsOverSixty++;
                        }
                        else if (totalRatings > 49)
                        {
                            ls.PetRatingsOverFifty++;
                        }
                        else if (totalRatings > 39)
                        {
                            ls.PetRatingsOverForty++;
                        }
                        else if (totalRatings > 29)
                        {
                            ls.PetRatingsOverThirty++;
                        }
                        else if (totalRatings > 19)
                        {
                            ls.PetRatingsOverTwenty++;
                        }
                        else if (totalRatings > 9)
                        {
                            ls.PetRatingsOverTen++;
                        }
                        else if (totalRatings > 0)
                        {
                            ls.PetRatingsEqualOne++;
                        }
                        else if (totalRatings < 1)
                        {
                            ls.PetRatingsEqualZero++;
                        }
                    }
                    else if (testItem.Name.Contains(potionA) || testItem.Name.Contains(potionB) || testItem.Name.Contains(potionC) || testItem.Name.Contains(potionD) || testItem.Name.Contains(potionE) || testItem.Name.Contains(potionF) || testItem.Name.Contains(potionG))
                    {
                        ls.Poitions++;
                    }
                    else if (testItem.Name.Contains(spellcompGlyph) || testItem.Name.Contains(spellcompInk) || testItem.Name.Contains(spellcompQuill))
                    {
                        ls.LevelEightComp++;
                    }
                    else if (testItem.Name.Contains(healingKits))
                    {
                        ls.HealingKit++;
                    }
                    else
                    {
                        Console.WriteLine($"ItemType.Misc Name={testItem.Name}");
                        ls.Misc++;
                    }
                    break;

                case ItemType.MissileWeapon:
                    double eleBonus    = 0.00f;
                    double damageMod   = 0.00f;
                    string missileType = "Other";
                    if (testItem.AmmoType != null)
                    {
                        switch (testItem.AmmoType.Value)
                        {
                        case ACE.Entity.Enum.AmmoType.None:
                            break;

                        case ACE.Entity.Enum.AmmoType.Arrow:
                            missileType = " Bow";
                            ls.MissileWeaponCount++;
                            break;

                        case ACE.Entity.Enum.AmmoType.Bolt:
                            missileType = " X Bow";
                            ls.MissileWeaponCount++;
                            break;

                        case ACE.Entity.Enum.AmmoType.Atlatl:
                            missileType = " Thrown";
                            ls.MissileWeaponCount++;
                            break;

                        case ACE.Entity.Enum.AmmoType.ArrowCrystal:
                            break;

                        case ACE.Entity.Enum.AmmoType.BoltCrystal:
                            break;

                        case ACE.Entity.Enum.AmmoType.AtlatlCrystal:
                            break;

                        case ACE.Entity.Enum.AmmoType.ArrowChorizite:
                            break;

                        case ACE.Entity.Enum.AmmoType.BoltChorizite:
                            break;

                        case ACE.Entity.Enum.AmmoType.AtlatlChorizite:
                            break;

                        default:
                            break;
                        }
                    }
                    if (testItem.WeaponMagicDefense != null)
                    {
                        magicDefMod = testItem.WeaponMagicDefense.Value;
                    }
                    if (testItem.Value != null)
                    {
                        value = testItem.Value.Value;
                    }
                    if (testItem.WeaponMissileDefense != null)
                    {
                        missileDefMod = testItem.WeaponMissileDefense.Value;
                    }
                    if (testItem.WieldDifficulty != null)
                    {
                        wield = testItem.WieldDifficulty.Value;
                    }
                    if (testItem.ElementalDamageBonus != null)
                    {
                        eleBonus = testItem.ElementalDamageBonus.Value;
                    }
                    if (testItem.DamageMod != null)
                    {
                        damageMod = testItem.DamageMod.Value;
                    }

                    if (missileType == "Other")
                    {
                        ls.DinnerWare++;
                    }
                    else
                    {
                        if (logstats == true)
                        {
                            ls.MissileWeapons += $"{missileType},{wield},{Math.Round(damageMod, 2)},{eleBonus},{testItem.WeaponDefense.Value},{magicDefMod},{missileDefMod},{value}\n";
                        }
                        else
                        {
                            ls.MissileWeapons += $" {missileType}\t {wield}\t {Math.Round(damageMod, 2)}\t\t{eleBonus}\t\t {testItem.WeaponDefense.Value}\t\t {magicDefMod}\t\t {missileDefMod}\t\t {value}\n";
                        }
                    }

                    break;

                case ItemType.Container:
                    break;

                case ItemType.Useless:
                    Console.WriteLine($"ItemType.Useless Name={testItem.Name}");
                    break;

                case ItemType.Gem:
                    string aetheriaColor = "None";
                    if (testItem.Name.Contains("Aetheria"))
                    {
                        ls.AetheriaCount++;
                        if (testItem.WieldDifficulty == 75)
                        {
                            aetheriaColor = "Blue  ";
                        }
                        else if (testItem.WieldDifficulty == 150)
                        {
                            aetheriaColor = "Yellow";
                        }
                        else if (testItem.WieldDifficulty == 225)
                        {
                            aetheriaColor = "Red   ";
                        }
                        if (logstats == true)
                        {
                            ls.Aetheria += $"{aetheriaColor},{testItem.ItemMaxLevel}\n";
                        }
                        else
                        {
                            ls.Aetheria += $" {aetheriaColor}\t {testItem.ItemMaxLevel}\n";
                        }
                    }
                    else
                    {
                        ls.GemCount++;
                    }
                    break;

                case ItemType.SpellComponents:
                    ls.SpellComponents++;
                    break;

                case ItemType.Writable:
                    string scrolls = "Scroll";

                    if (testItem.Name.Contains(scrolls))
                    {
                        ls.Scrolls++;
                    }
                    else
                    {
                        Console.WriteLine($"ItemType.Writeable Name={testItem.Name}");
                    }
                    break;

                case ItemType.Key:
                    ls.Key++;
                    break;

                case ItemType.Caster:
                    ls.CasterCount++;
                    double eleMod = 0.00f;
                    if (testItem.WeaponMagicDefense != null)
                    {
                        magicDefMod = testItem.WeaponMagicDefense.Value;
                    }
                    if (testItem.Value != null)
                    {
                        value = testItem.Value.Value;
                    }
                    if (testItem.WeaponMissileDefense != null)
                    {
                        missileDefMod = testItem.WeaponMissileDefense.Value;
                    }
                    if (testItem.WieldDifficulty != null)
                    {
                        wield = testItem.WieldDifficulty.Value;
                    }
                    if (testItem.ElementalDamageMod != null)
                    {
                        eleMod = testItem.ElementalDamageMod.Value;
                    }
                    if (testItem.ItemMaxMana != null)
                    {
                        ls.ItemMaxMana = testItem.ItemMaxMana.Value;
                    }
                    if (logstats == true)
                    {
                        ls.CasterWeapons += $"{wield},{eleMod},{testItem.WeaponDefense.Value},{magicDefMod},{missileDefMod},{value},{ls.ItemMaxMana}\n";
                    }
                    else
                    {
                        ls.CasterWeapons += $" {wield}\t {eleMod}\t\t {testItem.WeaponDefense.Value}\t\t  {magicDefMod}\t\t {missileDefMod}\t\t {value}\t {ls.ItemMaxMana}\n";
                    }
                    break;

                case ItemType.Portal:
                    break;

                case ItemType.Lockable:
                    break;

                case ItemType.PromissoryNote:
                    break;

                case ItemType.ManaStone:
                    ls.ManaStone++;
                    break;

                case ItemType.Service:
                    break;

                case ItemType.MagicWieldable:
                    break;

                case ItemType.CraftCookingBase:
                    ls.OtherCount++;
                    break;

                case ItemType.CraftAlchemyBase:
                    ls.OtherCount++;
                    break;

                case ItemType.CraftFletchingBase:
                    ls.OtherCount++;
                    break;

                case ItemType.CraftAlchemyIntermediate:
                    ls.OtherCount++;
                    break;

                case ItemType.CraftFletchingIntermediate:
                    ls.OtherCount++;
                    break;

                case ItemType.LifeStone:
                    break;

                case ItemType.TinkeringTool:
                    ls.OtherCount++;
                    break;

                case ItemType.TinkeringMaterial:
                    ls.OtherCount++;
                    break;

                case ItemType.Gameboard:
                    break;

                case ItemType.PortalMagicTarget:
                    break;

                case ItemType.LockableMagicTarget:
                    break;

                case ItemType.Vestements:
                    break;

                case ItemType.Weapon:
                    break;

                case ItemType.WeaponOrCaster:
                    break;

                case ItemType.Item:
                    Console.WriteLine($"ItemType.item Name={testItem.Name}");
                    break;

                case ItemType.RedirectableItemEnchantmentTarget:
                    break;

                case ItemType.ItemEnchantableTarget:
                    break;

                case ItemType.VendorShopKeep:
                    break;

                case ItemType.VendorGrocer:
                    break;

                default:
                    ls.OtherCount++;
                    break;
                }
                switch (itemType)
                {
                case "Armor":
                    break;

                case "MeleeWeapon":
                    break;

                case "Caster":
                    break;

                case "MissileWeapon":
                    break;

                case "Jewelry":
                    break;

                case "Gem":
                    break;

                case "Clothing":
                    break;

                default:

                    break;
                }
                if (testItem.ItemMaxMana != null)
                {
                    if (testItem.ItemMaxMana > ls.MaxMana)
                    {
                        ls.MaxMana = testItem.ItemMaxMana.Value;
                    }
                    if (testItem.ItemMaxMana < ls.MinMana)
                    {
                        ls.MinMana = testItem.ItemMaxMana.Value;
                    }
                    ls.HasManaCount++;
                    ls.TotalMaxMana += testItem.ItemMaxMana.Value;
                }
                if (testItem == null)
                {
                    Console.WriteLine("*Name is Null*");
                    continue;
                }
                else
                {
                }
            }
            return(ls);
        }
Example #21
0
 public void StopFiring(AttackType attackType)
 {
     StopCoroutine(attackType.ToString());  //atttackType 열거형의 이름과 같은 코루틴을 중지
 }
Example #22
0
 public void StartFiring(AttackType attackType)
 {
     StartCoroutine(attackType.ToString()); //atttackType 열거형의 이름과 같은 코루틴을 실행
 }
Example #23
0
    override public void Load(XmlNode node)
    {
        base.Load(node);

        Name = node.Attributes["name"].Value;
        XmlAttribute desc_attr = node.Attributes["description"];

        if (desc_attr != null)
        {
            Desc = desc_attr.Value.Replace("\\n", "\n");
        }

        AttackType   = (eAttackType)Enum.Parse(typeof(eAttackType), node.Attributes["attack_type"].Value);
        CreatureType = (eCreatureType)Enum.Parse(typeof(eCreatureType), node.Attributes["creature_type"].Value);
        CreatureTags.Add(AttackType.ToString());
        CreatureTags.Add(CreatureType.ToString());

        XmlAttribute position_attr = node.Attributes["position"];

        if (position_attr != null)
        {
            Position = (eCreaturePosition)Enum.Parse(typeof(eCreaturePosition), position_attr.Value);
        }
        else
        {
            Position = eCreaturePosition.front;
        }

        CreatureTags.Add(Position.ToString());

        XmlAttribute tag_attr = node.Attributes["tag"];

        if (tag_attr != null)
        {
            string split = tag_attr.Value;
            Array.ForEach(split.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries), tag => CreatureTags.Add(tag));
        }

        XmlAttribute preset_attr = node.Attributes["preset_type"];

        if (preset_attr != null && CreatureInfoManager.Instance.StatPresets != null)
        {
            string preset_type = preset_attr.Value;
            StatPreset   = CreatureInfoManager.Instance.StatPresets.Find(e => e.type == preset_type);
            Stat         = StatPreset.Stat(AttackType);
            StatIncrease = StatPreset.StatIncrease(AttackType);
        }
        else
        {
            //throw new System.Exception("StatPreset is not exist.");
            Stat         = CreatureStatPreset.GetStatInfo(node.SelectSingleNode("Stat"), AttackType);
            StatIncrease = CreatureStatPreset.GetStatInfo(node.SelectSingleNode("IncreaseStatPerLevel"), AttackType);
        }

        Skills = new List <SkillInfo>();
        foreach (XmlNode skill_node in node.SelectNodes("Skill"))
        {
            if (skill_node.NodeType == XmlNodeType.Comment)
            {
                continue;
            }

            Skills.Add(SkillInfoManager.Instance.GetInfoByID(skill_node.Attributes["id"].Value));
        }

        XmlNode teamSkillNode = node.SelectSingleNode("TeamSkill");

        if (teamSkillNode != null)
        {
            if (teamSkillNode.NodeType != XmlNodeType.Comment)
            {
                TeamSkill = SkillInfoManager.Instance.GetInfoByID(teamSkillNode.Attributes["id"].Value);
            }
        }

        XmlNode equipNode = node.SelectSingleNode("Equip");

        EquipWeaponCategory = EquipInfoManager.Instance.GetCategory(equipNode.Attributes["weapon"].Value);
        EquipArmorCategory  = EquipInfoManager.Instance.GetCategory(equipNode.Attributes["armor"].Value);

        Skins.Add("default");
    }
        public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
        {
            AttackType attackType = (AttackType)value;

            writer.WriteValue(attackType.ToString());
        }