Inheritance: MonoBehaviour
        /// <summary>
        /// Calculate secondary attributes from primary attributes.
        /// i.e. How much critical strike chance does the characters agility provide?
        /// </summary>
        public override SecondaryAttributes CalculateSecondaryAttributes(PrimaryAttributes primaryAttributes)
        {
            // (Source: https://rankedboost.com/world-of-warcraft/classic-stats/)
            // 2 Melee Attack Power per 1 point of Strength.
            var meleeAttackPower = new MeleeAttackPower(primaryAttributes.Strength.Value * 2);
            // Block 1 Damage for every 20 points of Strength.
            var blockDamage = new BlockDamage(primaryAttributes.Strength.Value / 20);
            // 2 Armor for every 1 point of Agility.
            var armor = new ArmorAmount(primaryAttributes.Agility.Value / 2);
            // 1% Critical Strike Chance for every 20 points of Agility.
            var criticalStrike = new CriticalStrike(primaryAttributes.Agility.Value / 20);
            // 1 Ranged Attack Power per 1 point of Agility.
            var rangedAttackPower = new RangedAttackPower(primaryAttributes.Agility.Value);
            // 1% Dodge per 20 point of Agility.
            var dodge = new Dodge(primaryAttributes.Agility.Value / 20);
            // 5% base chance to Parry. (Source: https://worldofwarcraft.fandom.com/et/wiki/Parry)
            var parry = new Parry(5);
            // 10 Health for every 1 point of Stamina.
            var health = new Health((int)primaryAttributes.Stamina.Value / 10);

            var attributes = new SecondaryAttributes(
                health,
                criticalStrike,
                Hit.Zero,
                dodge,
                parry,
                Defense.Zero,
                blockDamage,
                meleeAttackPower,
                rangedAttackPower,
                armor,
                new WeaponSkills());

            return(attributes);
        }
Beispiel #2
0
 public SecondaryAttributes(
     Health health,
     CriticalStrike criticalStrike,
     Hit hit,
     Dodge dodge,
     Parry parry,
     Defense defense,
     BlockDamage blockDamage,
     MeleeAttackPower meleeAttackPower,
     RangedAttackPower rangedAttackPower,
     ArmorAmount armor,
     WeaponSkills weaponSkills)
 {
     Health            = health;
     CriticalStrike    = criticalStrike;
     Hit               = hit;
     Dodge             = dodge;
     Parry             = parry;
     Defense           = defense;
     BlockDamage       = blockDamage;
     MeleeAttackPower  = meleeAttackPower;
     RangedAttackPower = rangedAttackPower;
     Armor             = armor;
     WeaponSkills      = weaponSkills;
 }
Beispiel #3
0
    void Update()
    {
        if (playerInRange && !isAttacking)
        {
            t += Time.deltaTime;
            if (t >= timeBetween)
            {
                startAttack();
                resetTimer();
            }
        }
        else if (isCheckingHits)
        {
            if (player == null)
            {
                wasDodged = false;
                return;
            }
            Dodge dodge = player.GetComponent <Dodge>();

            if (!dodge.checkDodge(currentAttack, new Vector2(-transform.localScale.x, 0f), health != null))
            {
                isCheckingHits = false;
                wasDodged      = false;
            }
        }
    }
 void Awake()
 {
     m_movement = Avatar.GetComponent<Movement>();
     m_light_attack = Avatar.GetComponent<LightAttack>();
     m_lock_on = Avatar.GetComponent<LockOn>();
     m_dodge = Avatar.GetComponent<Dodge>();
 }
Beispiel #5
0
        public ContextTurret()
        {
            ContextBehaviors.Add(Navigation = new NavigateToPoint(this)
            {
                BehaviorWeight = 0.00f
            });
            ContextBehaviors.Add(Efficiency = new Efficiency(this)
            {
                BehaviorWeight = 1f, MaximumAngle = MathF.PI / 4
            });
            ContextBehaviors.Add(Dodge0 = new Dodge(this)
            {
                LookAheadMS = 250, BehaviorWeight = 2
            });
            ContextBehaviors.Add(Dodge1 = new Dodge(this)
            {
                LookAheadMS = 500, BehaviorWeight = 2
            });
            ContextBehaviors.Add(Dodge2 = new Dodge(this)
            {
                LookAheadMS = 1000, BehaviorWeight = 2
            });
            ContextBehaviors.Add(Separation = new Separation(this)
            {
                LookAheadMS = 500, BehaviorWeight = 0f
            });
            ContextBehaviors.Add(StayInBounds = new StayInBounds(this)
            {
                LookAheadMS = 1000, BehaviorWeight = 1f
            });

            Navigation.TargetPoint = new Vector2(0, 0);
            Steps = 16;
        }
Beispiel #6
0
        private FighterBase CreateFighter()
        {
            FighterBase fighter;
            int         points = Constants.pointsNumber;

            Console.WriteLine("Назовите своего бойца\n");
            string name = Console.ReadLine();

            Console.WriteLine("\nВыберите класс героя:\n1: Воин\n2: Ловкач\n3: Маг");
            string fighterType = Console.ReadLine();

            switch (fighterType)
            {
            case "1":
                fighter = new Warrior(name);
                break;

            case "2":
                fighter = new Dodge(name);
                break;

            default:
                fighter = new Mage(name);
                break;
            }

            while (points > 0)
            {
                Console.Clear();
                Console.WriteLine(fighter);
                Console.WriteLine("Распределите очки умений среди характеристик персонажа:");
                Console.WriteLine("+1 Силы:      +{0} к урону", Constants.damageMultiplier);
                Console.WriteLine("+1 Ловкости:  +{0}% увернуться от атаки", Constants.dodgeMultiplier);
                Console.WriteLine("+1 Живучести: +{0} HP", Constants.hpMultiplier);
                Console.WriteLine();
                Console.WriteLine("Осталось очков умений: {0}", points);
                Console.WriteLine("1: +1 Силы");
                Console.WriteLine("2: +1 Ловкости");
                Console.WriteLine("3: +1 Живучести");
                switch (Console.ReadLine())
                {
                case "1":
                    fighter.Strength += 1;
                    break;

                case "2":
                    fighter.Agility += 1;
                    break;

                default:
                    fighter.Vitality += 1;
                    break;
                }
                points -= 1;
            }

            fighter.IsDead += () => fightState = FightState.Stopped;
            return(fighter);
        }
Beispiel #7
0
        private void Render()
        {
            int?    actualMaxHealth    = player.troop.health.MaxValue();
            double  actualActionPoints = player.actionPoints.MaxValue().Value;
            Defense actualDefense      = player.troop.defense;
            Dodge   actualDodge        = player.troop.dodge;
            int     actualMana         = player.mana.MaxValue().Value;
            string  strength           = player.strength.ToString();
            string  agility            = player.agility.ToString();
            string  endurance          = player.endurance.ToString();
            string  vitality           = player.vitality.ToString();
            string  wisdom             = player.wisdom.ToString();
            string  intelligence       = player.intelligence.ToString();

            //Now simulate player change
            player.vitality.RawValue     += VitatlityUp;
            player.endurance.RawValue    += EnduranceUp;
            player.agility.RawValue      += AgilityUp;
            player.wisdom.RawValue       += WisdomUp;
            player.intelligence.RawValue += IntelligenceUp;
            player.strength.RawValue     += StrengthUp;

            playerStrength.Text     = $"{strength} ({player.strength.Value})";
            playerAgiltiy.Text      = $"{agility} ({player.agility.Value})";
            playerEndurance.Text    = $"{endurance} ({player.endurance.Value})";
            playerVitality.Text     = $"{vitality} ({player.vitality.Value})";
            playerWisdom.Text       = $"{wisdom} ({player.wisdom.Value})";
            playerIntelligence.Text = $"{intelligence} ({player.intelligence.Value})";

            strengthUp.Enabled     = points != 0;
            agilityUp.Enabled      = points != 0;
            enduranceUp.Enabled    = points != 0;
            vitalityUp.Enabled     = points != 0;
            wisdomUp.Enabled       = points != 0;
            intelligenceUp.Enabled = points != 0;

            strengthDown.Enabled     = StrengthUp != 0;
            agilityDown.Enabled      = AgilityUp != 0;
            enduranceDown.Enabled    = EnduranceUp != 0;
            vitalityDown.Enabled     = VitatlityUp != 0;
            wisdomDown.Enabled       = WisdomUp != 0;
            intelligenceDown.Enabled = IntelligenceUp != 0;

            playerMaxHealth.Text    = $"{actualMaxHealth} ({player.troop.health.MaxValue().Value})";
            playerActionPoints.Text = $"{actualActionPoints} ({player.actionPoints.MaxValue().Value})";
            playerDefense.Text      = $"{actualDefense} ({player.troop.defense.Value})";
            playerDodge.Text        = $"{actualDodge} ({player.troop.dodge.Value})";
            playerMana.Text         = $"{actualMana} ({player.mana.MaxValue().Value})";

            //Undo changes
            player.vitality.RawValue     -= VitatlityUp;
            player.endurance.RawValue    -= EnduranceUp;
            player.agility.RawValue      -= AgilityUp;
            player.wisdom.RawValue       -= WisdomUp;
            player.intelligence.RawValue -= IntelligenceUp;
            player.strength.RawValue     -= StrengthUp;

            ok.Enabled = points == 0;
        }
        public void Default()
        {
            // Arrange
            Dodge feat = new Dodge();

            // Assert
            Assert.AreEqual("Dodge", feat.Name.Text);
        }
Beispiel #9
0
 public DealDmgToEnemy(Crit crit, Dodge dodge, ArmorReduction armorReduction, MagicReduction magicReduction, UserAccounts accounts, UpdateFightPage updateFightPage)
 {
     _crit            = crit;
     _dodge           = dodge;
     _armorReduction  = armorReduction;
     _magicReduction  = magicReduction;
     _accounts        = accounts;
     _updateFightPage = updateFightPage;
 }
Beispiel #10
0
    IEnumerator SkillDuration()
    {
        yield return(new WaitForSeconds(7f));

        PDEF.RemoveModifier(PDEFModifierBySkill);
        MDEF.RemoveModifier(MDEFModifierBySkill);
        Dodge.RemoveModifier(DodgeModifierBySkill);
        Block.RemoveModifier(BlockModifierBySkill);
        particleEffect.Stop();
        Debug.Log("DEF back to normal");
    }
Beispiel #11
0
 public override void ExSkill()
 {
     //duration time
     Debug.Log("DEF up");
     particleEffect.Play();
     PDEF.AddModifier(PDEFModifierBySkill);
     MDEF.AddModifier(MDEFModifierBySkill);
     Dodge.AddModifier(DodgeModifierBySkill);
     Block.AddModifier(BlockModifierBySkill);
     StartCoroutine("SkillDuration");
 }
Beispiel #12
0
        public override void RestoreSkillChanges(SkillSet set, ActiveSkill melee)
        {
            Dodge skill = set.GetSkill(SkillId.Dodge) as Dodge;

            if (skill == null)
            {
                return;
            }

            skill.infiniteRange = false;
        }
Beispiel #13
0
        public override void RestoreSkillChanges(SkillSet set, ActiveSkill melee)
        {
            Dodge skill = set.GetSkill(SkillId.Dodge) as Dodge;

            if (skill == null)
            {
                return;
            }

            skill.skillToBeRechargedOnThisUse = 0;
        }
 void Start()
 {
     this.rb      = GetComponent <Rigidbody2D>();
     this.anim    = GetComponent <Animator>();
     this.health  = GetComponent <Health>();
     this.recover = GetComponent <Recover>();
     this.walk    = GetComponent <Walk>();
     this.dodge   = GetComponent <Dodge>();
     this.rapid   = GetComponent <RapidShot>();
     this.bomb    = GetComponent <RemoteBomb>();
 }
Beispiel #15
0
        public override void ApplySkillChanges(SkillSet set, ActiveSkill melee)
        {
            Dodge skill = set.GetSkill(SkillId.Dodge) as Dodge;

            if (skill == null)
            {
                return;
            }

            skill.hitEnemyDamage += (int)AddValueByLevel(DAMAGE, LEVEL_ADD);
        }
Beispiel #16
0
        public override void RestoreSkillChanges(SkillSet set, ActiveSkill melee)
        {
            Dodge skill = set.GetSkill(SkillId.Dodge) as Dodge;

            if (skill == null)
            {
                return;
            }

            skill.range -= (int)AddValueByLevel(VALUE, LEVEL_ADD);
        }
Beispiel #17
0
        public override void RestoreSkillChanges(SkillSet set, ActiveSkill melee)
        {
            Dodge skill = set.GetSkill(SkillId.Dodge) as Dodge;

            if (skill == null)
            {
                return;
            }

            skill.reuse += temp;
        }
Beispiel #18
0
        public override void RestoreSkillChanges(SkillSet set, ActiveSkill melee)
        {
            Dodge skill = set.GetSkill(SkillId.Dodge) as Dodge;

            if (skill == null)
            {
                return;
            }

            skill.numOfTraps -= 1;
        }
Beispiel #19
0
        public override void RestoreSkillChanges(SkillSet set, ActiveSkill melee)
        {
            Dodge skill = set.GetSkill(SkillId.Dodge) as Dodge;

            if (skill == null)
            {
                return;
            }

            skill.penetrateThroughTargets = false;
            skill.hitEnemyDamage         -= (int)AddValueByLevel(DAMAGE, LEVEL_ADD);
        }
Beispiel #20
0
        public override void ApplySkillChanges(SkillSet set, ActiveSkill melee)
        {
            Dodge skill = set.GetSkill(SkillId.Dodge) as Dodge;

            if (skill == null)
            {
                return;
            }

            skill.spreadshotOnLand = true;
            skill.spreadshotDamage = (int)AddValueByLevel(DAMAGE, LEVEL_ADD);
        }
        public void ApplyTo_NullICharacter_Throws()
        {
            // Arrange
            ICharacter character = null;
            Dodge      feat      = new Dodge();

            // Act
            TestDelegate constructor = () => feat.ApplyTo(character);

            // Assert
            Assert.Throws <ArgumentNullException>(constructor);
        }
Beispiel #22
0
    void Start()
    {
        stageManager            = GameObject.Find("StageManager").GetComponent <StageManager>();
        recordController        = GetComponent <RecordController>();
        dodge                   = GetComponent <Dodge>();
        rigid                   = GetComponent <Rigidbody2D>();
        shot                    = GetComponent <Shot>();
        playerSprite            = GetComponentInChildren <SpriteRenderer>();
        playerInput.onFirstTap += () => recordController.StartRecord();//記録しはじめる

        enableDodge = true;
    }
Beispiel #23
0
        public override void ApplySkillChanges(SkillSet set, ActiveSkill melee)
        {
            Dodge skill = set.GetSkill(SkillId.Dodge) as Dodge;

            if (skill == null)
            {
                return;
            }

            temp         = skill.reuse * 0.3f;
            skill.reuse -= temp;
        }
Beispiel #24
0
        public override void RestoreSkillChanges(SkillSet set, ActiveSkill melee)
        {
            Dodge skill = set.GetSkill(SkillId.Dodge) as Dodge;

            if (skill == null)
            {
                return;
            }

            skill.spreadshotOnLand = false;
            skill.spreadshotDamage = 0;
        }
Beispiel #25
0
        public override void ApplySkillChanges(SkillSet set, ActiveSkill melee)
        {
            Dodge skill = set.GetSkill(SkillId.Dodge) as Dodge;

            if (skill == null)
            {
                return;
            }

            skill.maxConsecutiveCharges += 1;
            skill.consecutiveTimelimit   = 3f;
        }
Beispiel #26
0
        public override void RestoreSkillChanges(SkillSet set, ActiveSkill melee)
        {
            Dodge skill = set.GetSkill(SkillId.Dodge) as Dodge;

            if (skill == null)
            {
                return;
            }

            skill.maxConsecutiveCharges -= 1;
            skill.consecutiveTimelimit  -= AddValueByLevel(3, 1f);
        }
Beispiel #27
0
        public override SkillEffect[] CreateAdditionalSkillEffects(Skill sk, SkillEffect[] effects)
        {
            if (sk.GetSkillId() == SkillId.Dodge)
            {
                Dodge         dg         = sk as Dodge;
                SkillEffect[] newEffects = new SkillEffect[1];
                newEffects[0] = new EffectDash(0.3f, DURATION);

                return(newEffects);
            }

            return(null);
        }
Beispiel #28
0
    protected virtual void LoadSkills()
    {
        //skill1 = new ProjectileAttack("Sprites/Menu/Skills/spr_skill_6", "Sprites/Items/Projectiles/spr_ice_", 8, "Sprites/Items/Particles/spr_ice_explosion@4");
        //skill1 = new ProjectileAttack("Sprites/Menu/Skills/spr_skill_9", "Sprites/Items/Projectiles/spr_rock", 1, "Sprites/Items/Particles/spr_rock_explosion@4", 1, 5);
        skill1 = new CloseAttack("Sprites/Menu/Skills/spr_skill_0");

        //skill2 = new ProjectileAttack("Sprites/Menu/Skills/spr_skill_7", "Sprites/Items/Projectiles/spr_fire_", 8, "Sprites/Items/Particles/spr_fire_explosion@3x4", 1.5f, 12, MouseButton.Right);
        skill2 = new Block("Sprites/Menu/Skills/spr_skill_4");
        //skill2 = new SpeedBuff("Sprites/Menu/Skills/spr_skill_2", "Sprites/Items/Particles/spr_stamina@4");

        skill3 = new Dodge("Sprites/Menu/Skills/spr_skill_5");
        //skill3 = new BlockHold("Sprites/Menu/Skills/spr_skill_8", "Sprites/Items/Particles/spr_shield@4");
        //skill3 = new AreaHeal("Sprites/Menu/Skills/spr_skill_1", "Sprites/Items/Particles/spr_heal@6");
    }
    void UpdateDexterity()
    {
        DexField.GetComponent <Text> ().text = Dex + "";

        this.Att_Dmg        = 4 * Str + 1 * Dex;
        this.Att_Speed      = 4 * Dex;
        this.Att_Dodge      = 3 * Dex;
        this.Att_CritChance = 2 * Dex + 6 * Luck;

        Dmg.GetComponent <Text> ().text        = Att_Dmg + "";
        Speed.GetComponent <Text> ().text      = Att_Speed + "";
        Dodge.GetComponent <Text> ().text      = Att_Dodge + "";
        CritChance.GetComponent <Text> ().text = Att_CritChance + " %";
    }
        public override Dictionary <string, string> GetCharacterDisplayCalculationValues()
        {
            Dictionary <string, string> dictValues = new Dictionary <string, string>();
            int   armorCap        = (int)Math.Ceiling((1402.5f * TargetLevel) - 66502.5f);
            float levelDifference = 0.2f * (TargetLevel - 70);

            dictValues.Add("Health", BasicStats.Health.ToString());
            dictValues.Add("Armor", BasicStats.Armor.ToString());
            dictValues.Add("Stamina", BasicStats.Stamina.ToString());
            dictValues.Add("Agility", BasicStats.Agility.ToString());
            dictValues.Add("Defense", Defense.ToString());
            dictValues.Add("Miss", Miss.ToString() + "%");
            dictValues.Add("Dodge", Dodge.ToString() + "%");
            dictValues.Add("Parry", Parry.ToString() + "%");
            dictValues.Add("Block", Block.ToString() + "%");
            dictValues.Add("Block Value", BlockValue.ToString() + "%");
            dictValues.Add("Avoidance", Avoidance.ToString() + "%");
            dictValues.Add("Mitigation", Mitigation.ToString());
            dictValues.Add("Spell Damage", _basicStats.SpellDamageRating.ToString());
            dictValues.Add("Total Mitigation", TotalMitigation.ToString() + "%");
            if (CritAvoidance == (5f + levelDifference))
            {
                dictValues.Add("Chance to be Crit", ((5f + levelDifference) - CritAvoidance).ToString()
                               + "%*Exactly enough defense rating/resilience to be uncrittable by bosses.");
            }
            else if (CritAvoidance < (5f + levelDifference))
            {
                dictValues.Add("Chance to be Crit", ((5f + levelDifference) - CritAvoidance).ToString()
                               + string.Format("%*CRITTABLE! Short by {0} defense rating or {1} resilience to be uncrittable by bosses.",
                                               Math.Ceiling(((5f + levelDifference) - CritAvoidance) * 60f), Math.Ceiling(((5f + levelDifference) - CritAvoidance) * 39.423f)));
            }
            else
            {
                dictValues.Add("Chance to be Crit", ((5f + levelDifference) - CritAvoidance).ToString()
                               + string.Format("%*Uncrittable by bosses. {0} defense rating or {1} resilience over the crit cap.",
                                               Math.Floor(((5f + levelDifference) - CritAvoidance) * -60f), Math.Floor(((5f + levelDifference) - CritAvoidance) * -39.423f)));
            }
            dictValues.Add("Overall Points", OverallPoints.ToString());
            dictValues.Add("Mitigation Points", MitigationPoints.ToString());
            dictValues.Add("Survival Points", SurvivalPoints.ToString());
            dictValues.Add("Overall", Math.Round(OverallTPS) + " tps");
            dictValues.Add("Holy Shield", Math.Round(HolyShieldTPS) + " tps");
            dictValues.Add("Seal of Right", Math.Round(SoRTPS) + " tps");
            dictValues.Add("Judgement of Right", Math.Round(JoRTPS) + " tps");
            dictValues.Add("Consecrate", Math.Round(ConsecrateTPS) + " tps");
            dictValues.Add("Misc", Math.Round(MiscTPS) + " tps");

            return(dictValues);
        }
Beispiel #31
0
    public Wizard(int level, GameObject characterObject)
        : base("Wizard", level, 100 + Application.loadedLevel * 50)
    {
        CharacterObject = characterObject;
        WaypointPosition = new Vector3(0.9f, 0.65f, -1.0f);
        Speed = 0.5f; // 100f;

        BasicAttack = new Frostbolt();
        StrongAttack = new ArcaneBarrage();
        SpecialAttack = new Meteor();

        BasicDefend = new Shield();
        StrongDefend = new IceBarrier();
        SpecialDefend = new Dodge();
    }
Beispiel #32
0
	void Awake()
	{
		AwakeBaseClass ();

		myAIScript = GetComponent<AIFighter> ();

		rollSkill = normalRollSkill;

		dodgeScript = GetComponentInChildren<Dodge>();

		startSprite = GetComponent<SpriteRenderer> ().sprite;

		if(this.tag == "PlayerFighter")
			thisIsPlayer = true;
	}
Beispiel #33
0
    /// <summary>
    /// Collects references to the scout's game states.
    /// </summary>
    protected override void OnStart()
    {
        this.health = this.maxHealth.Value;

        this.Animator.SetFloat("PreferredDistance", preferredDistance.Value);

        this.seekBehavior      = this.animator.GetBehaviour <Seek>();
        this.seekBehavior.Self = this;

        this.attackBehavior      = this.animator.GetBehaviour <Attack>();
        this.attackBehavior.Self = this;

        this.dodgeBehavior      = this.animator.GetBehaviour <Dodge>();
        this.dodgeBehavior.Self = this;
    }
Beispiel #34
0
	void Awake()
	{
		if(instance == null)
		{
			instance = this;
		}
		else
		{
			Debug.LogError("There were 2 PlayerAILogic scripts");
			Destroy(gameObject);
			return;
		}
		healthScript = GetComponent<HealthFighter> ();
		engineScript = GetComponent<PlayerFighterMovement> ();
		shootScript = GetComponentInChildren<WeaponsPrimaryFighter> ();
		missilesScript = GetComponentInChildren<WeaponsSecondaryFighter> ();
		dodgeScript = GetComponentInChildren<Dodge>();
	}
Beispiel #35
0
        public UnitDodgeSystem()
            : base(Aspect.All(typeof(Unit), typeof(Dodge)))
        {
            AIUtils.UnitDodgeHandler += (object sender, EventArgs e) =>
            {

                AIUtils.UnitDodgeHandlerEventArgs args = (AIUtils.UnitDodgeHandlerEventArgs)e;
                Entity unit = args.unit;
                var state = AIUtils.GetState(unit);
                if (AIUtils.IsDead(unit))
                    return;

                if(state == UnitState.State.idle || state == UnitState.State.move)
                {
                    AIUtils.SetState(unit, UnitState.State.dodge);
                    var dodge = new Dodge();
                    dodge.timer = unit.GetComponent<Unit>().dodgeDuration;
                    unit.AddComponent(dodge);
                }

            };
        }