Esempio n. 1
0
	public PassiveEffect hasPassiveEffectForTime(EWhenToApply aTimeToApply,float aTargetHPVal,float aMyHP,ElementalType aAttackerType,ElementalType aDefendentType,BetterList<BattleMonster> aAllies,BetterList<BattleMonster> aOpponents,ERangedStatus aRange,BattleMonster aAttacker,ElementalType aAttackingMoveElement,EStatusEffects aStatusEffectInduced = EStatusEffects.None) {
		for(int i = 0;i<_effects.size;i++) {
			if(_effects[i].applyAt==aTimeToApply) {
				
				if((_effects[i].applyAt==EWhenToApply.AtEndOfMoveQueue)||
				   (_effects[i].applyAt==EWhenToApply.BattleStart)||
				   (_effects[i].applyAt==EWhenToApply.WhenHit)
				) {
					return _effects[i];
				}
				if((_effects[i].applyAt==EWhenToApply.WhenAttackingWithMoveType)&&(aAttackingMoveElement==_effects[i].whenMoveElementType)) {
					return _effects[i];
				}
				if((_effects[i].applyAt==EWhenToApply.WhenTheirHPHigherThan)&&(aTargetHPVal>_effects[i].HPPercentage)) {
					return _effects[i];
				}
				if((_effects[i].applyAt==EWhenToApply.WhenTheirHPLowerThan)&&(aTargetHPVal<_effects[i].HPPercentage)) {
					return _effects[i];
				}
				if((_effects[i].applyAt==EWhenToApply.WhenMyHPHigherThan)&&(aMyHP>(1/_effects[i].HPPercentage))) {
					return _effects[i];
				}
				if((_effects[i].applyAt==EWhenToApply.WhenMyHPLowerThan)&&(aMyHP<(1/_effects[i].HPPercentage))) {
					return _effects[i];
				}
				if((_effects[i].applyAt==EWhenToApply.WhenAttackerIsType)&&(aAttackerType==_effects[i].whenMoveElementType)) {
					return _effects[i];
				}
				if((_effects[i].applyAt==EWhenToApply.WhenDefendentIsType)&&(aDefendentType==_effects[i].whenMoveElementType)) {
					return _effects[i];
				}
				if((_effects[i].applyAt==EWhenToApply.WhenAlliesAreType)&&(listContainsElement(_effects[i].whenMoveElementType,aAllies).size>0)) {
					return _effects[i];
				}
				if((_effects[i].applyAt==EWhenToApply.WhenDefendentIsType)&&(listContainsElement(_effects[i].whenMoveElementType,aOpponents).size>0)) {
					return _effects[i];
				}
				if((_effects[i].applyAt==EWhenToApply.WhenOneOpponentisSameAsEffectOwner)&&(listContainsElement(aAttackerType,aOpponents).size>0)) {
					return _effects[i];
				}
				if((_effects[i].applyAt==EWhenToApply.WhenHitByMoveType)&&(aAttackerType==_effects[i].whenMoveElementType)) {
					return _effects[i];
				}
				if((_effects[i].applyAt==EWhenToApply.WhenHitByRangeType)&&(aRange==_effects[i].whenRangeType)) {
					return _effects[i];
				}
				if((_effects[i].applyAt==EWhenToApply.WhenOpponentHasStatusEffect)&&(listContainsStatusEffect(_effects[i].whenStatusEffects,aOpponents).size>0)) {
					return _effects[i];
				}
				if((_effects[i].applyAt==EWhenToApply.WhenStatusEffectsSuffered)&&((_effects[i].whenStatusEffects&aAttacker.statusEffects)!=EStatusEffects.None)) {
					return _effects[i];
				}
				
				if((_effects[i].applyAt==EWhenToApply.WhenHitByMoveTypeAtEndOfMoveQueue)&&(_effects[i].whenMoveElementType==aAttackingMoveElement)) {
					return _effects[i];
				}
			}
		}
		return null;
	}
Esempio n. 2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="from"></param>
        /// <param name="to"></param>
        /// <returns>
        /// 1: Win
        /// 0: Draw
        /// -1: Lose
        /// </returns>
        public static ElementalResult GetBattleResult(this ElementalType from, ElementalType to)
        {
            if (from == ElementalType.Normal)
            {
                return(ElementalResult.Draw);
            }

            if (from == to)
            {
                return(ElementalResult.Draw);
            }

            if (from.TryGetWinCase(out var lose) &&
                lose == to)
            {
                return(ElementalResult.Win);
            }

            if (from.TryGetLoseCase(out var win) &&
                win == to)
            {
                return(ElementalResult.Lose);
            }

            return(ElementalResult.Draw);
        }
Esempio n. 3
0
 public override void OnSpellDamage(Mobile attacker, Mobile defender, ElementalType damageType, ref int damage)
 {
     if (damageType == ElementalType.Physical)
     {
         damage -= (int)(damage * ((double)Value / 100));
     }
 }
Esempio n. 4
0
 public void StartTarget(float duration, Vector2Int pos, float damage, ElementalType ele)
 {
     Pos       = pos;
     Damage    = damage;
     Elemental = ele;
     StartCoroutine(TargetAnim(duration));
 }
Esempio n. 5
0
        private void CreateNewData()
        {
            AssetDatabase.CreateAsset(_elementalType, "Assets/Scriptable Objects/ElementalTypes/" + _name + ".asset");
            AssetDatabase.SaveAssets();

            _elementalType = CreateInstance <ElementalType>();
        }
Esempio n. 6
0
 public DamagePackage(ElementalType newType, float newDamage, string newName, bool newCrit)
 {
     type   = newType;
     damage = newDamage;
     name   = newName;
     isCrit = newCrit;
 }
Esempio n. 7
0
 public override bool SetDamage(float damage, ElementalType elemental, bool isCritical, bool isAttackBlocking)
 {
     if (CanGetDamage && CharInfo.Health > 0)
     {
         return(base.SetDamage(damage, elemental, isCritical));
     }
     return(false);
 }
Esempio n. 8
0
 protected ItemBase(ItemSheet.Row data)
 {
     Id            = data.Id;
     Grade         = data.Grade;
     ItemType      = data.ItemType;
     ItemSubType   = data.ItemSubType;
     ElementalType = data.ElementalType;
 }
Esempio n. 9
0
    /* public override IEnumerator AttackAction()
     * {
     *   while (true)
     *   {
     *       while (!CanAttack && !VFXTestMode)
     *       {
     *           yield return null;
     *       }
     *
     *       while (!VFXTestMode && (BattleManagerScript.Instance.CurrentBattleState != BattleState.Battle || !CanGetDamage))
     *       {
     *           yield return null;
     *       }
     *
     *       isAttackStarted = false;
     *       isAttackCompletetd = false;
     *       isAttackGoing = false;
     *       while (!isAttackCompletetd)
     *       {
     *           if (!isAttackStarted)
     *           {
     *               isAttackStarted = true;
     *               isAttackGoing = true;
     *               SetAnimation(CharacterAnimationStateType.Atk);
     *           }
     *
     *           if (isAttackStarted && !isAttackGoing && !isMoving)
     *           {
     *               isAttackGoing = true;
     *               SetAnimation(CharacterAnimationStateType.Atk);
     *           }
     *           yield return null;
     *       }
     *
     *
     *       float timer = 0;
     *       while (timer <= CharInfo.AttackSpeedRatio)
     *       {
     *           yield return new WaitForFixedUpdate();
     *           while (!VFXTestMode && (BattleManagerScript.Instance.CurrentBattleState == BattleState.Pause))
     *           {
     *               yield return new WaitForEndOfFrame();
     *           }
     *
     *           while (isSpecialLoading)
     *           {
     *               yield return new WaitForEndOfFrame();
     *               timer = 0;
     *           }
     *
     *           timer += Time.fixedDeltaTime;
     *       }
     *   }
     * }*/

    public override bool SetDamage(float damage, ElementalType elemental, bool isCritical)
    {
        if (CanGetDamage)
        {
            return(base.SetDamage(damage, elemental, isCritical));
        }
        return(false);
    }
Esempio n. 10
0
        public SkillCastingVFX Get(Vector3 position, ElementalType elementalType)
        {
            var skillName = $"casting_{elementalType}".ToLower();
            var go        = _pool.Get(skillName, false, position) ??
                            _pool.Get(skillName, true, position);

            return(GetEffect <SkillCastingVFX>(go));
        }
Esempio n. 11
0
 public SimpleSkill(string newName, bool newSelfTar, ElementalType newType, float newAPMult, bool newSelfDam = false)
 {
     name       = newName;
     selfTar    = newSelfTar;
     selfDam    = newSelfDam;
     type       = newType;
     APMult     = newAPMult;
     CDduration = 0;
 }
Esempio n. 12
0
        public static IElementalResistance Create(ElementalType elementalType, float amount)
        {
            ElementalResistance newElementalResistance = new ElementalResistance(elementalType, amount)
            {
                ResistanceInfo = { type = elementalType, value = amount }
            };

            return(newElementalResistance);
        }
        protected override void OnModelCreating(ModelBuilder builder)
        {
            base.OnModelCreating(builder);

            Event.ConfigureForDatabase(builder);
            Region.ConfigureForDatabase(builder);
            LocationGroup.ConfigureForDatabase(builder);
            Location.ConfigureForDatabase(builder);

            BagCategory.ConfigureForDatabase(builder);
            Item.ConfigureForDatabase(builder);
            PlacedItem.ConfigureForDatabase(builder);
            Currency.ConfigureForDatabase(builder);
            CurrencyAmount.ConfigureForDatabase(builder);

            ElementalType.ConfigureForDatabase(builder);
            ElementalTypeRelation.ConfigureForDatabase(builder);
            Ability.ConfigureForDatabase(builder);
            PvpTier.ConfigureForDatabase(builder);
            PokemonAvailability.ConfigureForDatabase(builder);
            PokemonVarietyUrl.ConfigureForDatabase(builder);

            Entities.PokemonSpecies.ConfigureForDatabase(builder);
            PokemonVariety.ConfigureForDatabase(builder);
            PokemonForm.ConfigureForDatabase(builder);
            Evolution.ConfigureForDatabase(builder);

            MoveDamageClass.ConfigureForDatabase(builder);
            Move.ConfigureForDatabase(builder);
            MoveTutor.ConfigureForDatabase(builder);
            MoveTutorMove.ConfigureForDatabase(builder);
            MoveTutorMovePrice.ConfigureForDatabase(builder);
            MoveLearnMethod.ConfigureForDatabase(builder);
            MoveLearnMethodLocation.ConfigureForDatabase(builder);
            MoveLearnMethodLocationPrice.ConfigureForDatabase(builder);
            LearnableMove.ConfigureForDatabase(builder);
            LearnableMoveLearnMethod.ConfigureForDatabase(builder);

            TimeOfDay.ConfigureForDatabase(builder);
            Season.ConfigureForDatabase(builder);
            SeasonTimeOfDay.ConfigureForDatabase(builder);
            SpawnType.ConfigureForDatabase(builder);
            Spawn.ConfigureForDatabase(builder);
            SpawnOpportunity.ConfigureForDatabase(builder);

            Nature.ConfigureForDatabase(builder);
            HuntingConfiguration.ConfigureForDatabase(builder);
            Build.ConfigureForDatabase(builder);
            ItemOption.ConfigureForDatabase(builder);
            MoveOption.ConfigureForDatabase(builder);
            NatureOption.ConfigureForDatabase(builder);

            ItemStatBoost.ConfigureForDatabase(builder);
            Entities.ItemStatBoostPokemon.ConfigureForDatabase(builder);

            ImportSheet.ConfigureForDatabase(builder);
        }
Esempio n. 14
0
 public IValue Serialize() =>
 Bencodex.Types.Dictionary.Empty
 .Add("id", Id)
 .Add("elemental_type", ElementalType.ToString())
 .Add("skill_type", SkillType.ToString())
 .Add("skill_category", SkillCategory.ToString())
 .Add("skill_target_type", SkillTargetType.ToString())
 .Add("hit_count", HitCount)
 .Add("cooldown", Cooldown);
Esempio n. 15
0
 public IElementalResistance GetResistanceByType(ElementalType typeToCheck)
 {
     if (ResistanceTypes.ContainsKey(typeToCheck))
     {
         return(ResistanceTypes[typeToCheck]);
     }
     AddResistance(typeToCheck, DefaultValue);
     return(ResistanceTypes[typeToCheck]);
 }
Esempio n. 16
0
		public bool addRemovedWeakness(ElementalType aElementalType) {
			for(int i = 0;i<removedWeaknesses.size;i++) {
				if(removedWeaknesses[i]==aElementalType) {
					return false;
				}
			}
			removedWeaknesses.Add(aElementalType);
			return true;
		}
Esempio n. 17
0
 public override bool SetDamage(float damage, ElementalType elemental, bool isCritical, bool isAttackBlocking)
 {
     if (baseForme.BossPhase == Stage09_Boss_Geisha.bossPhasesType.Monster_ && !isImmune)
     {
         bool boolToReturn = base.SetDamage(damage, elemental, isCritical, isAttackBlocking);
         return(boolToReturn);
     }
     return(false);
 }
Esempio n. 18
0
 public ElementalRayTests()
 {
     sorcerer        = CharacterTestTemplates.Sorcerer();
     type            = new ElementalType();
     type.EnergyType = "acid";
     sorcerer.Add(type);
     ray = new ElementalRay();
     sorcerer.Add(ray);
 }
Esempio n. 19
0
        /// <summary>
        /// Creates the skill.
        /// </summary>
        /// <param name="number">The number.</param>
        /// <param name="name">The name of the skill.</param>
        /// <param name="characterClasses">The character classes.</param>
        /// <param name="damageType">Type of the damage.</param>
        /// <param name="damage">The damage.</param>
        /// <param name="distance">The distance.</param>
        /// <param name="abilityConsumption">The ability consumption.</param>
        /// <param name="manaConsumption">The mana consumption.</param>
        /// <param name="levelRequirement">The level requirement.</param>
        /// <param name="energyRequirement">The energy requirement.</param>
        /// <param name="leadershipRequirement">The leadership requirement.</param>
        /// <param name="elementalModifier">The elemental modifier.</param>
        /// <param name="skillType">Type of the skill.</param>
        /// <param name="skillTarget">The skill target.</param>
        /// <param name="implicitTargetRange">The implicit target range.</param>
        /// <param name="targetRestriction">The target restriction.</param>
        /// <param name="movesToTarget">If set to <c>true</c>, the skill moves the player to the target.</param>
        /// <param name="movesTarget">If set to <c>true</c>, it moves target randomly.</param>
        /// <param name="cooldownMinutes">The cooldown minutes.</param>
        protected void CreateSkill(
            SkillNumber number,
            string name,
            CharacterClasses characterClasses = CharacterClasses.None,
            DamageType damageType             = DamageType.None,
            int damage                               = 0,
            short distance                           = 0,
            int abilityConsumption                   = 0,
            int manaConsumption                      = 0,
            int levelRequirement                     = 0,
            int energyRequirement                    = 0,
            int leadershipRequirement                = 0,
            ElementalType elementalModifier          = ElementalType.Undefined,
            SkillType skillType                      = SkillType.DirectHit,
            SkillTarget skillTarget                  = SkillTarget.Explicit,
            short implicitTargetRange                = 0,
            SkillTargetRestriction targetRestriction = SkillTargetRestriction.Undefined,
            bool movesToTarget                       = false,
            bool movesTarget                         = false,
            int cooldownMinutes                      = 0)
        {
            var skill = this.Context.CreateNew <Skill>();

            this.GameConfiguration.Skills.Add(skill);
            skill.Number        = (short)number;
            skill.Name          = name;
            skill.MovesToTarget = movesToTarget;
            skill.MovesTarget   = movesTarget;
            skill.AttackDamage  = damage;

            this.CreateSkillRequirementIfNeeded(skill, Stats.Level, levelRequirement);
            this.CreateSkillRequirementIfNeeded(skill, Stats.TotalLeadership, leadershipRequirement);
            this.CreateSkillRequirementIfNeeded(skill, Stats.TotalEnergy, energyRequirement);
            this.CreateSkillConsumeRequirementIfNeeded(skill, Stats.CurrentMana, manaConsumption);
            this.CreateSkillConsumeRequirementIfNeeded(skill, Stats.CurrentAbility, abilityConsumption);

            skill.Range      = distance;
            skill.DamageType = damageType;
            skill.SkillType  = skillType;

            skill.ImplicitTargetRange = implicitTargetRange;
            skill.Target            = skillTarget;
            skill.TargetRestriction = targetRestriction;
            var classes = this.GameConfiguration.DetermineCharacterClasses(characterClasses);

            foreach (var characterClass in classes)
            {
                skill.QualifiedCharacters.Add(characterClass);
            }

            if (elementalModifier != ElementalType.Undefined)
            {
                this.ApplyElementalModifier(elementalModifier, skill);
            }
        }
Esempio n. 20
0
        //Constructors. Can pass in all values manually, another weapon to copy,
        //a WeaponType enmum for randomized values with specified type, or nothing for all randomized vales.

        /// <summary>
        /// A weapon with specified stats.
        /// </summary>
        /// <param name="name">The name of the weapon. "Iron Sword"</param>
        /// <param name="description">A quick description. "This sword is somewhat beat up."</param>
        /// <param name="damageRange">A 2-element array representing the damage range. [min, max]</param>
        /// <param name="elementalType">The elemental type of the weapon.</param>
        /// <param name="weaponType">The type of weapon. Range is automatically set based off of this value.</param>
        /// <param name="health">How much damage the weapon can take.</param>
        /// <param name="missChance">Chance to miss with this weapon.</param>
        public Weapon(string name, string description, int[] damageRange, ElementalType elementalType,
                      WeaponType weaponType, int health, int missChance)
        {
            this.Name        = name;
            this.Description = description;
            this.DamageRange = damageRange;
            this.Element     = elementalType;
            this.Type        = weaponType;
            this.Health      = health;
            this.MissChance  = missChance;
        }
Esempio n. 21
0
	public BetterList<MonsterLibraryRecord> getMonstersOfElement(ElementalType aElementalType) {
		BetterList<MonsterLibraryRecord> rec = new BetterList<MonsterLibraryRecord>();
		for(int i = 0; i < list.size ; i++) {
			if((list[i].PrimaryElement==aElementalType)||(list[i].SecondaryElement==aElementalType)) {
				if(list[i].Name!="No Creature")
					rec.Add(list[i]);
			
			}
		}
		return rec;
	}
Esempio n. 22
0
 public float this[ElementalType i]
 {
     get {
         Weakness w = Weaknesses.FirstOrDefault(weakness => weakness.ElementalType == i);
         if (default(Weakness).Equals(w))
         {
             return(1);
         }
         return(w.DamageMultiplier);
     }
 }
Esempio n. 23
0
	public float getWeaknessStrengthToElement(ElementalType aOther) {
		switch(aOther.Name) {
			case("Earth"):return strengthVsEarth;
			case("Water"):return strengthVsWater;
			case("Ice"):return strengthVsIce; 
			case("Air"):return strengthVsAir;
			case("Fire"):return strengthVsFire;
			case("Arcane"):return strengthVsArcane;
			case("Electric"):return strengthVsElectric;
		}
		return 1.0f;
	} 
Esempio n. 24
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Enemy"/> class.
 /// </summary>
 /// <param name="newType">New type.</param>
 /// <param name="newLevel">New level.</param>
 /// <param name="number">Number</param>
 public Enemy(ElementalType newType, int newLevel, int number)
 {
     type            = newType;
     level           = newLevel;
     health          = level * 100000;
     damageReduction = 11.0F;
     critChance      = level;
     //Instansiate healthbar with max hp.
     VisualController._instance.CreateEnemyHealthbar(health);
     AP = level + number;
     addAbilities();
 }
Esempio n. 25
0
        protected virtual IEnumerator CoAnimationCast(ElementalType elementalType)
        {
            var sfxCode = AudioController.GetElementalCastingSFX(elementalType);

            AudioController.instance.PlaySfx(sfxCode);
            Animator.Cast();
            var pos    = transform.position;
            var effect = Game.instance.Stage.SkillController.Get(pos, elementalType);

            effect.Play();
            yield return(new WaitForSeconds(0.6f));
        }
        public static IEnumerable <string> GetOptions(this ElementalType from, StatType statType)
        {
            if (statType != StatType.ATK &&
                statType != StatType.DEF)
            {
                return(new List <string>());
            }

            if (GetOptionsCache.ContainsKey(from) &&
                GetOptionsCache[from].ContainsKey(statType))
            {
                return(GetOptionsCache[from][statType]);
            }

            if (!GetOptionsCache.ContainsKey(from))
            {
                GetOptionsCache[from] = new Dictionary <StatType, List <string> >(StatTypeComparer.Instance);
            }

            var dict = GetOptionsCache[from];

            if (!dict.ContainsKey(statType))
            {
                dict[statType] = new List <string>();
            }

            var list = dict[statType];

            if (from == ElementalType.Normal)
            {
                return(list);
            }

            if (statType == StatType.ATK)
            {
                if (from.TryGetWinCase(out var lose))
                {
                    var format = L10nManager.Localize("ELEMENTAL_TYPE_OPTION_ATK_WIN_FORMAT");
                    list.Add(string.Format(format, lose.GetLocalizedString(), ElementalTypeExtension.WinMultiplier - 1));
                }
            }
            else if (statType == StatType.DEF)
            {
                if (from.TryGetLoseCase(out var win))
                {
                    var format = L10nManager.Localize("ELEMENTAL_TYPE_OPTION_DEF_LOSE_FORMAT");
                    list.Add(string.Format(format, win.GetLocalizedString(), ElementalTypeExtension.WinMultiplier - 1));
                }
            }

            return(list);
        }
Esempio n. 27
0
	public static GameObject getBGForMonsterType(ElementalType aType) {
		List<GameBackgroundsRow> all = GameBackgrounds.Instance.Rows;
		for(int i = 0;i<all.Count;i++)
		{
			if(all[i]._DefaultBackgroundFor == aType.Name) {
				GameObject prefab = UnityEngine.Object.Instantiate(Resources.Load("Battles/Backgrounds/Prefabs/"+all[i]._BackgroundFile)) as GameObject;
				prefab.GetComponent<Renderer>().sortingLayerName = "BackgroundLayer";
				prefab.transform.localPosition = new Vector3();
				return prefab;
			}
		}
		return null;
	}
Esempio n. 28
0
 public int GetResist(ElementalType protectionType)
 {
     return(protectionType switch
     {
         ElementalType.Water => Get((WaterProtection e) => e.Value),
         ElementalType.Air => Get((AirProtection e) => e.Value),
         ElementalType.Physical => Get((PhysicalProtection e) => e.Value),
         ElementalType.Fire => Get((FireProtection e) => e.Value),
         ElementalType.Poison => Get((PoisonProtection e) => e.Value),
         ElementalType.Earth => Get((EarthProtection e) => e.Value),
         ElementalType.Necro => Get((NecroProtection e) => e.Value),
         _ => throw new ArgumentOutOfRangeException(nameof(protectionType), protectionType, null)
     });
Esempio n. 29
0
 public SkillInfo(CharacterBase character, int effect, bool critical, SkillCategory skillCategory,
                  int waveTurn, ElementalType elementalType = ElementalType.Normal,
                  SkillTargetType targetType = SkillTargetType.Enemy, [CanBeNull] Model.Buff.Buff buff = null)
 {
     Target          = character;
     Effect          = effect;
     Critical        = critical;
     SkillCategory   = skillCategory;
     ElementalType   = elementalType;
     SkillTargetType = targetType;
     Buff            = buff;
     WaveTurn        = waveTurn;
 }
Esempio n. 30
0
		public float getWeaknessStrengthToElement(ElementalType aElementalType) {
			float defaultValue = this.monster.getWeaknessStrengthToElement(aElementalType);
			if(defaultValue<=1.0f) {
				return defaultValue;
			} else {
				for(int i= 0;i<this.removedWeaknesses.size;i++) {
					if(removedWeaknesses[i]==aElementalType) {
						return 1.0f;
					}
				}
				return defaultValue;
			}
		}
Esempio n. 31
0
        public void GrantsImmunitiesBasedOnElementType()
        {
            var sorcerer    = CharacterTestTemplates.Sorcerer();
            var elementType = new ElementalType();

            elementType.EnergyType = "acid";
            sorcerer.Add(elementType);
            sorcerer.Add(new ElementalBody());

            AssertCharacter.IsImmuneTo("acid", sorcerer);
            AssertCharacter.IsImmuneTo("sneak attacks", sorcerer);
            AssertCharacter.IsImmuneTo("critical hits", sorcerer);
        }
Esempio n. 32
0
    public void SetAttack(float duration, Vector2Int pos, float damage, ElementalType ele, BaseCharacter attacker, List <ScriptableObjectAttackEffect> atkEffects, float effectChances)
    {
        GameObject nextT = TargetIndicatorManagerScript.Instance.GetTargetIndicator(AttackType.Tile);

        nextT.SetActive(true);
        TargetClass tc = new TargetClass(duration, nextT);

        nextT.transform.parent        = transform;
        nextT.transform.localPosition = TargetsPosition[0];
        Targets.Add(tc);
        UpdateQueue();
        StartCoroutine(FireTarget(tc, pos, damage, ele, attacker, atkEffects, effectChances));
    }
Esempio n. 33
0
    public void OnEnemyHitPlayerElemental(int damage, ElementalType damageType)
    {
        float mod = 1;

        if (Player.Armor.Value.ElementalWeakness.Value != null)
        {
            mod = Player.Armor.Value.ElementalWeakness.Value[damageType];
        }
        float fdamage = damage * mod;

        damage = Mathf.RoundToInt(fdamage);
        Player.DamagePlayer(damage);
        PlayerDamageNumberSpawner.SpawnNumber(damage, damageType.DamageColor);
    }
Esempio n. 34
0
        public void CanChangeEnergyDamageToTypeOfElemental()
        {
            var sorcerer      = CharacterTestTemplates.Sorcerer();
            var elementalType = new ElementalType();

            elementalType.EnergyType = "cold";
            sorcerer.Add(elementalType);

            var arcana = new ElementalArcana();

            sorcerer.Add(arcana);

            Assert.Equal("change energy damage spells to cold", arcana.BonusAbility);
        }
Esempio n. 35
0
    } //calvin's tips

    //Helper function, turns ElementalType into string - calvin's tips
    public string typeToString(ElementalType type)
    {
        string returnstring = "";

        switch ((int)type)
        {
        case 0: returnstring = "Air";
            break;

        case 1:
        default: Debug.Log("Something broke");
            break;
        }
        return(returnstring);
    }
Esempio n. 36
0
        private void EvaluateState(ElementalType elementalType)
        {
            if (currentState == UnitStates.Checkmate)
            {
                return;
            }

            var tryGetElement = unitBase._elementalWeaknesses.Any
                                    (kvp => kvp.Key._type == elementalType);

            if (tryGetElement)
            {
                EvaluateShield();
            }
        }
Esempio n. 37
0
	public float getEffectOnAttackPower(ERangedStatus aRangedStatus,ElementalType aElementType) {
		bool elementPassed = false;
		if(this.moveRef.elementType==ElementalLibrary.REF.getElement("Normal")) {
			elementPassed = true;
		} else {
			if(this.moveRef.elementType==aElementType) {
				elementPassed = true;
			}
		}
		if(elementPassed) {
			if(aRangedStatus==ERangedStatus.Melee) {
				return this.moveRef.meleeAttackMultiplier;
			}
			if(aRangedStatus==ERangedStatus.Ranged) {
				return this.moveRef.rangeAttackMultiplier;
			}
		}
		return 1.0f;
	}
Esempio n. 38
0
	public PassiveEffect (PassiveEffectsRow aRow) {
		id = aRow._ID;
		name = aRow._EffectName;
		elementType = ElementalLibrary.REF.getElement(aRow._EffectType);
		description = aRow._Description;
		moveRef = MovesLib.REF.getMove(aRow._TakeEffectsFromMove);
		switch(aRow._EffectClass) {
			case("Class 1"):effectClass = 1;break;
			case("Class 2"):effectClass = 2;break;
			case("Class 3"):effectClass = 4;break;
			case("Class 4"):effectClass = 8;break;
		}
		weighting = aRow._Weighting;
		switch(aRow._ApplyWhen) {
			case("At battle start"):applyAt = EWhenToApply.BattleStart;break;
			case("When hit by %FIELDMOVETYPE%"):applyAt = EWhenToApply.WhenHitByMoveType;break;
			case("When using move of type %FIELDMOVETYPE%"):applyAt = EWhenToApply.WhenAttackingWithMoveType;break;
			case("When %STATUSEFFECTSUFFERED%"):applyAt = EWhenToApply.WhenStatusEffectsSuffered;break;
			case("When defendant is same type"):applyAt = EWhenToApply.WhenDefendentIsType;break;
			case("When allies are of type %FIELDMOVETYPE%"):applyAt = EWhenToApply.WhenAlliesAreType;break;
			case("When hit"):applyAt = EWhenToApply.WhenHit;break;
			case("When HP Higher than %HPPERCENTAGE%"):applyAt = EWhenToApply.WhenMyHPHigherThan;break;
			case("When HP Lower than %HPPERCENTAGE%"):applyAt = EWhenToApply.WhenMyHPLowerThan;break;
			case("When defendant HP Lower than %HPPERCENTAGE%"):applyAt = EWhenToApply.WhenTheirHPLowerThan;break;
			case("When defendant HP Higher than %HPPERCENTAGE%"):applyAt = EWhenToApply.WhenTheirHPHigherThan;break;
			case("When hit by %MOVERANGETYPE%"):applyAt = EWhenToApply.WhenHitByRangeType;break;
			case("At end of move queue"):applyAt = EWhenToApply.AtEndOfMoveQueue;break;
			case("When hit by %FIELDMOVETYPE% at end of move queue"):applyAt = EWhenToApply.WhenHitByMoveTypeAtEndOfMoveQueue;break;
			case("When one opponent is %FIELDMOVETYPE%"):applyAt = EWhenToApply.WhenOneOpponentisType;break;
			case("When one opponent is same as effect owner"):applyAt = EWhenToApply.WhenOneOpponentisSameAsEffectOwner;break;
			
		}
		whenMoveElementType = ElementalLibrary.REF.getElement(aRow._MoveElementType);
		switch(aRow._MoveRangeType) {
			default: this.whenRangeType = ERangedStatus.MeleeAndRanged;break;
			case("Melee"):this.whenRangeType = ERangedStatus.Melee;break;
			case("Ranged"):this.whenRangeType = ERangedStatus.Ranged;break;
		}
		
		whenStatusEffects = (EStatusEffects) aRow._StatusEffectSuffered;
		HPPercentage = aRow._HPPercentage;
	}
Esempio n. 39
0
	public MonsterLibraryRecord(TMMonstersRow aInitData) {
		_id = aInitData._ID;
		_name = aInitData._Name;
		_description = aInitData._Description;
		_evolvesToID = aInitData._EvolvesTo;
		_primaryElement = ElementalLibrary.REF.getElement (aInitData._PrimaryElement);
		_secondaryElement = ElementalLibrary.REF.getElement (aInitData._SecondaryElement);
		_evolvesAt = Convert.ToByte( aInitData._EvolvesAt);
		_hp = aInitData._HP;
		_hpPerLevel = aInitData._HPPerLevel;
		_meleeAttack = aInitData._MeleeAttack;
		_meleeDefense = aInitData._MeleeDefense;
		_rangeAttack = aInitData._RangeAttack;
		_rangeDefense = aInitData._RangeDefense;
		_speed = aInitData._Speed;
	//	_resistance = aInitData._resistance;
		_accuracy = aInitData._Accuracy;
		_agility = aInitData._Agility;
		_meleeAttackPerLevel = aInitData._MeleeAttackPerLevel;
		_meleeDefensePerLevel = aInitData._MeleeDefensePerLevel;
		_rangeAttackPerLevel = aInitData._RangeAttackPerLevel;
		_rangeDefensePerLevel = aInitData._RangeDefensePerLevel;
		_energy = aInitData._Energy;
		_energyPerLevel = aInitData._EnergyPerLevel;
		this._accuracyPerLevel = aInitData._AccuracyPerLevel;
		_speedPerLevel = aInitData._SpeedPerLevel;
		_catchRate = aInitData._CatchRate;
		_moveTree1 = MoveTreeLibrary.REF.GetMoveTree (aInitData._MoveTree1);
		_moveTree2 = MoveTreeLibrary.REF.GetMoveTree (aInitData._MoveTree2);
		_moveTree3 = MoveTreeLibrary.REF.GetMoveTree (aInitData._MoveTree3);
		_moveTree4 = MoveTreeLibrary.REF.GetMoveTree (aInitData._MoveTree4);
		passiveClass = aInitData._PassiveEffectClasses;
		_expVal = aInitData._BaseExperienceYield;
		_xpDevModel = XPDevModelLib.REF.getXPDevModel (aInitData._XPDevModel);
		
		this.companionAString = aInitData._CompanionA;
		this.companionBString = aInitData._CompanionB;
		this.companionALevelDiff = aInitData._CompanionALevelDiff;
		this.companionBLevelDiff = aInitData._CompanionBLevelDiff;
	}
Esempio n. 40
0
    public Effect(ActionComponent actionComponent, Character _sourceUnit, Character _targetUnit)
    {
        hitType = actionComponent.hitType;
        elementalType = actionComponent.elementalType;
        effectType = actionComponent.effectType;
        basePower = actionComponent.basePower;
        baseToHit = actionComponent.baseToHit;
        duration = actionComponent.duration;

        priPowerStat = actionComponent.priPowerStat;
        priPowerWeight = actionComponent.priPowerWeight;
        secPowerStat = actionComponent.secPowerStat;
        secPowerWeight = actionComponent.secPowerWeight;

        priResistStat = actionComponent.priResistStat;
        priResistWeight = actionComponent.priResistWeight;
        secResistStat = actionComponent.secResistStat;
        secResistWeight = actionComponent.secResistWeight;

        sourceUnit = _sourceUnit;
        targetUnit = _targetUnit;

        sourcePowerStat = GetStatPower(_sourceUnit);
    }
Esempio n. 41
0
		private void showMonsters(ElementalType aElementType) {
			StartCoroutine(spreadCreation (0));
			
	}
Esempio n. 42
0
	public AdditionalWeaknesses (ElementalType aElement,byte aTurns)
	{
		_weakness = aElement;
		_turns = aTurns;
	}
Esempio n. 43
0
	public void addEffect(ElementalType aElementType,byte aTurns) {
		if(aTurns==0) {
			aTurns = 255;
		}
		for(byte c = 0;c < this._extraWeaknesses.size;c++) {
			if(_extraWeaknesses[c].type.ID==aElementType.ID) {
				if(_extraWeaknesses[c].turnsRemaining<aTurns) {
					_extraWeaknesses[c].turnsRemaining = aTurns;
				
				}
				return;
			}
		}
		_extraWeaknesses.Add(new AdditionalWeaknesses(aElementType,aTurns));
	}
Esempio n. 44
0
	public float hasElementWeakness(ElementalType aElement) {
		for(byte c = 0;c<_extraWeaknesses.size;c++) {
			_extraWeaknesses[c].turnsRemaining--;
			if(_extraWeaknesses[c].turnsRemaining<0) {
				_extraWeaknesses.RemoveAt(c);
				c--;
			}
		}
		for(byte c = 0;c<_extraWeaknesses.size;c++) {
			if(_extraWeaknesses[c].type.ID==aElement.ID) {
				return 2f;
			}
		}
		return 0.0f;
	}
Esempio n. 45
0
 public void LoadMiniGames(ElementalType miniGame1, ElementalType miniGame2 = ElementalType.None)
 {
     MiniGameManager.Instance.LoadMiniGames(miniGame1, miniGame2);
 }
Esempio n. 46
0
    public void StartScene(int sceneId, ElementalType elementalType)
    {
        if(sceneId == 2)
        {
            mInitialElement = elementalType;
        }

        Application.LoadLevel(sceneId);
    }
Esempio n. 47
0
	public BetterList<BattleMonster> listContainsElement(ElementalType aElement,BetterList<BattleMonster> aMonster) {
		BetterList<BattleMonster> r = new BetterList<BattleMonster>();
		for(int i = 0;i<aMonster.size;i++) {
			if(aElement == aMonster[i].monster.elementType) {
				r.Add(aMonster[i]);
			}
		}
		return r;
	}
Esempio n. 48
0
    public ActionComponent(Dictionary<string,string> data)
    {
        /*
        foreach(KeyValuePair<string, string> e in data)
        {
            Debug.Log(e.Key.ToString() + " : " + e.Value.ToString());
        }
        */

        executionOrder = int.Parse(data["Component"]);
        targetType = (TargetType)System.Enum.Parse(typeof(TargetType), data["TargetType"].ToString());
        hitType = (HitType)System.Enum.Parse(typeof(HitType), data["HitType"].ToString());
        elementalType = (ElementalType)System.Enum.Parse(typeof(ElementalType), data["ElementalType"].ToString());
        effectType = (EffectType)System.Enum.Parse(typeof(EffectType), data["EffectType"].ToString());
        basePower = float.Parse(data["BasePower"]);
        baseToHit = float.Parse(data["BaseToHit"]);
        duration = int.Parse(data["Duration"]);

        string[] powerStats = data["PowerStats"].Split(char.Parse(","));
        priPowerStat = (StatType)System.Enum.Parse(typeof(StatType), powerStats[0].ToString());
        if(powerStats.Length > 1)
        {
            secPowerStat = (StatType)System.Enum.Parse(typeof(StatType), powerStats[1].ToString());
        }
        priPowerWeight = float.Parse(data["PrimaryPowerStatWeight"]);
        secPowerWeight = 1f - priPowerWeight;

        string[] resistStats = data["DefenseStats"].Split(char.Parse(","));
        priResistStat = (StatType)System.Enum.Parse(typeof(StatType), resistStats[0].ToString());
        if(resistStats.Length > 1)
        {
            secResistStat = (StatType)System.Enum.Parse(typeof(StatType), resistStats[1].ToString());
        }
        priResistWeight = float.Parse(data["PrimaryDefenseStatWeight"]);
        secResistWeight = 1f - priResistWeight;
    }
Esempio n. 49
0
	public MoveLibItem(MoveDataRow aInitData) {
		 
	
		this._id = aInitData._ID;
		this._name = aInitData._MoveName; 
		this._moveSpeedMultiplier = aInitData._MoveSpeedMultiplier;

		switch (aInitData._PowerApplicationType) {
			case("Normal"):this._powerApplicationType = EPowerApplicationTypes.Normal;break;
			case("Power is HP"): this._powerApplicationType = EPowerApplicationTypes.PowerIsHP;break;
			case("Power is Percentage of HP"): this._powerApplicationType = EPowerApplicationTypes.PowerIsPercentOfHP;break;
		}
		this._description = aInitData._Description;
		oneHitKillInvulnerable = aInitData._AddsOneHitKOInvulnerability;
		decisiveBlowsImmunity = aInitData._DecisiveBlowsImmunity;
		
		this._elementalType = ElementalLibrary.REF.getElement (aInitData._ElementalType);
		switch (aInitData._MeleeRangedStatus) {
			case("Melee"):this._meleeRangedStatus = ERangedStatus.Melee;break;
			case("Ranged"):this._meleeRangedStatus = ERangedStatus.Ranged;break;
		}

		this._effort = aInitData._Effort;
		this._power = aInitData._Power;
		this._splashpercent = aInitData._SplashPercent;
		cameraShake = aInitData._CameraShake;
		switch (aInitData._SplashRange) {
			case("Hit 1 Only"):this._splashRange = ESplashRange.Hit1Only;break;
			case("Hit All"):this._splashRange = ESplashRange.HitAll;break;		
			case("Splash Range 1"):this._splashRange = ESplashRange.SplashRange1;break;
			case("Boost Me"):this._splashRange = ESplashRange.BoostMe;break;	
			case("Boost 1"):this._splashRange = ESplashRange.Boost1;break;	
			case("Boost 1 And Me"):this._splashRange = ESplashRange.Boost1AndMe;break;
			case("Boost All"):this._splashRange = ESplashRange.BoostAll;break;
			case("Boost 2"):this._splashRange = ESplashRange.Boost2;break;
			case("Boost whole Field"):this._splashRange = ESplashRange.BoostWholeField;break;
			case("Random Opponent"):this._splashRange = ESplashRange.RandomOpponent;break;
		}
		this._accuracy = aInitData._Accuracy;
		this._particlesAnimation = MovesAnimationLib.REF.getAnimation(aInitData._AttackParticlesAnimation);
		this._hitParticlesAnimation = MovesAnimationLib.REF.getAnimation(aInitData._AttackParticlesAnimationHit);
		this._attackMecanim = aInitData._AttackMecanim;
		this._hitMecanim = aInitData._HitMecanim;
		this._paralyzePercent = aInitData._ParalyzePercent;
		this._sleepPercent = aInitData._SleepPercent;
		this._poisonPercent = aInitData._PoisonPercent;
		this._freezePercent = aInitData._FreezePercent;
		this._flinchPercent = aInitData._FlinchPercent;
		this._confusionPercent = aInitData._ConfusionPercent;
		this._burnPercent = aInitData._BurnPercent;
		this._rangeAttackMultiplier = aInitData._RangeAttackMultiplier;
		this._meleeAttackMultiplier = aInitData._MeleeAttackMultiplier;
		this._rangeDefenseMultiplier = aInitData._RangeDefenseMultiplier;
		this._meleeDefenseMultiplier = aInitData._MeleeDefenseMultiplier;
		this._speedStatMultiplier = aInitData._SpeedStatMultiplier;
		this.agilityMultiplier = aInitData._AgilityMultiplier;
		this._accuracyMultiplier = aInitData._AccuracyMultiplier;
		this._minHitsPerTurn = aInitData._MinHitsPerTurn;
		this._maxHitsPerTurn = aInitData._MaxHitsPerTurn;
		this._minTurns = aInitData._MinTurns;
		this._maxTurns = aInitData._MaxTurns;
		this._effectsDuration = aInitData._EffectsDuration;
		this._criticalHitChance = aInitData._CriticalHitChance;
		this.powerOnlyIfTheseStatusEffects = (EStatusEffects) aInitData._OnlyApplyPowerIfTheirStatusEffect;
		switch (aInitData._DamageDistribution) {
			case("Standard"):default:this._damageDistribution = EDamageDistributionTypes.Standard;break;		
		}
		this._addsVulnerability = ElementalLibrary.REF.getElement (aInitData._AddVulnerabilityType);
		this._changeIfIHaveStatusEffects = aInitData._IfMyStatusEffect;
		this._changeToThisIfIHaveStatusEffects = aInitData._DoAlternativeMove;
		this._changeIfTheyHaveStatusEffects = aInitData._IfTheirStatusEffect;
		this._changeToThisIfIHaveStatusEffects = aInitData._DoAlternativeMove;
		this._maxUnlockLevel = (byte) aInitData._MaxUnlockLevel;
		this._chanceOfAddVulnerability = aInitData._PercentChangeOfVulnerability;
		this._addsInvulnerabilityStatTo = (EMonsterStat) aInitData._AddInvulnerabilityToStatChange;
		this._addsInvulnerabilityToStatus = (EStatusEffects) aInitData._AddInvulnerabilityToStatus;
		this.isPassiveEffect = aInitData._IsPassiveEffect;
		this.decisiveBlowsChangeMultiplier = aInitData._DecisiveBlowsChanceMultiplier;
		_selfHitPercent = aInitData._HitMyselfWithThisPercentageOfMove;
		removesWeaknessesTo = aInitData._RemovesWeaknessTo;
		
		mirrorStatusEffects = aInitData._MirrorStatusEffects;
		this.alsoApplyThisString = aInitData._AlsoApplyThisMove;
		this.percentChanceOfFollowOn = aInitData._PercentChanceOfFollowOn;
		
		if(aInitData._Struggle==1) {
			isStruggleMove = true;
		}
//		this.removesWeaknessesTo = aInitData._
	//	this.agilityMultiplier = aInitData.A
	}