public void TestInit() { DndTimeClock dndTimeClock = new DndTimeClock(); DateTime now = DateTime.Now; dndTimeClock.SetTime(now); dndTimeClock.Advance(DndTimeSpan.FromRounds(1)); TimeSpan difference = dndTimeClock.Time - now; Assert.AreEqual(6, difference.TotalSeconds); dndTimeClock.SetTime(now); dndTimeClock.Advance(new DndTimeSpan(TimeMeasure.instant, 5)); difference = dndTimeClock.Time - now; Assert.AreEqual(0, difference.TotalSeconds); dndTimeClock.SetTime(now); dndTimeClock.Advance(DndTimeSpan.FromMinutes(5)); difference = dndTimeClock.Time - now; Assert.AreEqual(5, difference.TotalMinutes); dndTimeClock.SetTime(now); dndTimeClock.Advance(DndTimeSpan.FromHours(3)); difference = dndTimeClock.Time - now; Assert.AreEqual(3, difference.TotalHours); dndTimeClock.SetTime(now); dndTimeClock.Advance(DndTimeSpan.FromDays(2)); difference = dndTimeClock.Time - now; Assert.AreEqual(2, difference.TotalDays); }
public static Monster BuildVrock() { Monster vrock = new Monster(); vrock.name = "Clyde"; vrock.raceClass = "Vrock"; vrock.creatureSize = CreatureSize.Large; vrock.alignment = AlignmentNames.ChaoticEvil; vrock.kind = CreatureKinds.Fiends; vrock.baseArmorClass = 15; vrock.naturalArmor = true; vrock.hitPoints = 104; vrock.hitPointsDice = Dice.d10x11.Plus(44);; vrock.baseSpeed = 40; vrock.flyingSpeed = 60; vrock.SetAbilities(17, +3, 15, +2, 18, +4, 8, -1, 13, +1, 8, -1); vrock.savingDexterityMod = +5; vrock.savingWisdomMod = +4; vrock.savingCharismaMod = +2; vrock.advantages = Against.spellsAndMagicalEffects; vrock.AddDamageResistance(DamageType.Cold | DamageType.Fire | DamageType.Lightning | DamageType.Bludgeoning | DamageType.Piercing | DamageType.Slashing, AttackKind.NonMagical); vrock.AddDamageImmunity(DamageType.Poison); vrock.conditionImmunities = Conditions.Poisoned; vrock.darkvisionRadius = 120; vrock.passivePerception = 11; vrock.AddLanguages(Languages.Abyssal); vrock.telepathyRadius = 120; vrock.challengeRating = 6; vrock.experiencePoints = 2300; vrock.AddAttack(Attack.Melee(AttackNames.Beak, +6, 5, 1).AddDamage(DamageType.Piercing, Dice.d6x2.Plus(3), AttackKind.NonMagical)); vrock.AddAttack(Attack.Melee(AttackNames.Talons, +6, 5, 1).AddDamage(DamageType.Slashing, Dice.d10x2.Plus(3), AttackKind.NonMagical)); Attack sporesAttack = Attack.Area(AttackNames.Spores, 15).AddDamage(DamageType.Poison, Dice.d10x1, AttackKind.NonMagical, TimePoint.StartOfTurn, TimePoint.EndOfTurn, Conditions.Poisoned, 14, Ability.Constitution); sporesAttack.description = "A 15-foot-radius cloud of toxic spores extends out from the vrock. The spores spread around corners. Each creature in that area must succeed on a DC 14 Constitution saving throw or become poisoned. While poisoned in this way, a target takes 5 (1d10) poison damage at the start of each of its turns. A target can repeat the saving throw at the end of each of its turns, ending the effect on itself on a success. Emptying a vial of holy water on the target also ends the effect on it."; //sporesAttack.releaseTrigger = new ReleaseTrigger("Target receives splashes of holy water."); sporesAttack.AddRecharge(RechargeOdds.OneInSix); vrock.AddAttack(sporesAttack); Attack screech = Attack.Area(AttackNames.StunningScreech, 20).AddCondition(Conditions.Stunned, 14, Ability.Constitution); screech.LastDamage.IncludeTargetSenses = Senses.Hearing; // TODO: Add test to determine if an attack hits a player using screech.includeTargetSenses. screech.LastDamage.ExcludeCreatureKinds(CreatureKinds.Fiends); screech.recharges = DndTimeSpan.FromDays(1); vrock.AddAttack(screech); vrock.AddMultiAttack(AttackNames.Beak, AttackNames.Talons); vrock.traits.Add("Magic Resistance. The vrock has advantage on saving throws against spells and other magical effects."); return(vrock); }
private void BtnAddMonth_Click(object sender, RoutedEventArgs e) { dndTimeClock.Advance(DndTimeSpan.FromDays(30), ShiftKeyDown); }