Ejemplo n.º 1
0
        public double GetChances(Mobile atk, Mobile def)
        {
            double chances = 0;

            chances  = GetBonus(atk.Skills[SkillName.Vol].Value, StealingScaling, StealingBonus);
            chances += GetBonus(atk.Skills[SkillName.Fouille].Value, SnoopingScaling, SnoopingBonus);

            Item weapon = Weapon(def);

            if (weapon != null)
            {
                chances -= GetBonus(def.Skills[(CombatStrategy.GetStrategy(def).ToucherSkill)].Value, 0.05, 5);

                if (weapon.Layer == Layer.TwoHanded)
                {
                    chances -= 0.15;
                }
                if (def.FindItemOnLayer(Layer.TwoHanded) as BaseShield != null)
                {
                    chances -= GetBonus(def.Skills[SkillName.Parer].Value, 0.15, 5);
                }
            }

            return(chances);
        }
Ejemplo n.º 2
0
 public void ApplyStrategy(World world)
 {
     if (CombatStrategy != null)
     {
         CombatStrategy.ApplyStrategy(this, world);
     }
 }
Ejemplo n.º 3
0
        public virtual void FinishSequence()
        {
            State = SpellState.None;

            if (Caster.Spell == this)
            {
                Caster.Spell = null;
            }

            CombatStrategy.GetStrategy(Caster).ResetAttackAfterCast(Caster);
        }
Ejemplo n.º 4
0
        public virtual void DoFizzle()
        {
            Caster.LocalOverheadMessage(MessageType.Regular, 0x3B2, 502632);               // The spell fizzles.

            if (Caster.Player)
            {
                Effects.SendTargetEffect(Caster, 0x3735, 6, 30);
                Caster.PlaySound(0x5C);
            }

            CombatStrategy.GetStrategy(Caster).ResetAttackAfterCast(Caster);
        }
 public override void TriggerCombat(Character charIn)
 {
     CurrentEnemyTarget = charIn;
     charIn.GetCombatController().TriggerCombat(myCharacter);
     if (MyCombatStrategyPrefab != null)
     {
         GameObject combatStrategy = Instantiate(MyCombatStrategyPrefab, new Vector3(0f, 0f, 0f), Quaternion.identity) as GameObject;
         print(combatStrategy);
         combatStrategy.transform.SetParent(myCharacter.transform, false);
         myCombatStrategy             = combatStrategy.GetComponent <CombatStrategy>();
         myCombatStrategy.MyCharacter = myCharacter;
         myCombatStrategy.StartNextAction();
     }
 }
Ejemplo n.º 6
0
    public override void init()
    {
        base.init();
        AbstractStrategy captureStrategy = new CaptureStrategy (_creature);
        this.addState (captureStrategy);

        AbstractStrategy deafStrategy = new DeafStrategy (_creature);
        this.addState (deafStrategy);

        AbstractStrategy moveStrategy = new MoveStrategy (_creature);
        this.addState (moveStrategy, true);

        AbstractStrategy combatStrategy = new CombatStrategy (_creature);
        this.addState (combatStrategy);

        _init = true;
    }
Ejemplo n.º 7
0
        private double TypeMultiplier(Mobile atk, Mobile def)
        {
            CombatStrategy strategy = ((BaseWeapon)atk.Weapon).Strategy;

            if (strategy is StrategyMonstre)
            {
                return(MonsterScal);
            }
            else if (atk.InRange(def, 1))
            {
                return(MeleeScal);
            }
            else if (atk.InRange(def, 5))
            {
                return(RangedScal);
            }
            else
            {
                return(0);
            }
        }