public void should_throw_exception_if_buffs_not_provided() { var cmd = new Meditate { PlayerId = 100 }; Assert.That(() => Repository.Execute(cmd), Throws.TypeOf <DomainException>().With.Message.EqualTo("Buffs are required!")); }
public void should_throw_exception_if_player_not_found() { new PlayerBuilder() .With(p => p.Id, 100) .BuildAndSave(); var cmd = new Meditate { PlayerId = 3, Buffs = buffs }; Assert.That(() => Repository.Execute(cmd), Throws.TypeOf <DomainException>().With.Message.EqualTo("Player with ID '3' could not be found")); }
public void should_throw_exception_if_player_not_animate() { new PlayerBuilder() .With(p => p.Id, 100) .With(p => p.Mobility, PvPStatics.MobilityInanimate) .BuildAndSave(); var cmd = new Meditate { PlayerId = 100, Buffs = buffs }; Assert.That(() => Repository.Execute(cmd), Throws.TypeOf <DomainException>().With.Message.EqualTo("You must be animate in order to meditate!")); }
public void should_throw_exception_if_player_has_cleansed_or_meditated_too_much() { new PlayerBuilder() .With(p => p.Id, 100) .With(p => p.CleansesMeditatesThisRound, PvPStatics.MaxCleansesMeditatesPerUpdate) .BuildAndSave(); var cmd = new Meditate { PlayerId = 100, Buffs = buffs }; Assert.That(() => Repository.Execute(cmd), Throws.TypeOf <DomainException>().With.Message .EqualTo("You have cleansed and meditated the maximum number of times this update.")); }
public void should_throw_exception_if_player_has_insufficient_AP() { new PlayerBuilder() .With(p => p.Id, 100) .With(p => p.ActionPoints, PvPStatics.MeditateCost - 1) .BuildAndSave(); var cmd = new Meditate { PlayerId = 100, Buffs = buffs }; Assert.That(() => Repository.Execute(cmd), Throws.TypeOf <DomainException>().With.Message .EqualTo("You don't have enough action points to meditate!")); }
public static AttackResult ExecuteAttack(ShardedCommandContext context, Core.Entities.Chomusuke activeChomusuke, string attack) { var result = new AttackResult(); switch (attack) { case "Slash": result = Slash.SlashAttack(context); break; case "Block": result = Block.BlockAttack(context); break; case "Deflect": result = Deflect.DeflectAttack(context); break; case "Absorb": result = Absorb.AbsorbAttack(context); break; case "Bash": result = Bash.BashAttack(context); break; case "Fireball": result = Fireball.FireballAttack(context); break; case "Earthquake": result = Earthquake.EarthquakeAttack(context); break; case "Meditate": result = Meditate.MeditateAttack(context, activeChomusuke); break; } return(result); }
public void should_throw_exception_if_player_has_mc_antimeditate_debuff() { var mcs = new List <VictimMindControl>() { new VictimMindControlBuilder().With(t => t.FormSourceId, MindControlStatics.MindControl__MeditateFormSourceId).BuildAndSave() }; var player = new PlayerBuilder() .With(p => p.Id, 100) .With(p => p.VictimMindControls, mcs) .With(p => p.User, new UserBuilder() .With(u => u.Id, "bob") .BuildAndSave()) .BuildAndSave(); var cmd = new Meditate { PlayerId = player.Id, Buffs = buffs }; Assert.That(() => Repository.Execute(cmd), Throws.TypeOf <DomainException>().With.Message.EqualTo( "You try to meditate but find you cannot! The moment you try and focus, your head swims with nonsensical thoughts implanted by someone partially mind controlling you!")); }