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); }
public void ApplyStrategy(World world) { if (CombatStrategy != null) { CombatStrategy.ApplyStrategy(this, world); } }
public virtual void FinishSequence() { State = SpellState.None; if (Caster.Spell == this) { Caster.Spell = null; } CombatStrategy.GetStrategy(Caster).ResetAttackAfterCast(Caster); }
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(); } }
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; }
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); } }