public void LuaCreateMobileTest() { var result = LuaMobFunctions.LuaProcessMob(GetMobLuaScript()); Assert.That(result, Is.Not.Null); Assert.That(result.ID, Is.EqualTo(801)); Assert.That(result.Name, Is.EqualTo("nightmare")); Assert.That(result.ShortDescription, Is.EqualTo("A pitch-black nightmare")); Assert.That(result.LongDescription, Is.EqualTo("A nightmare is here, kicking at you with its flaming hooves.")); Assert.That(result.Description.StartsWith("The nightmare is a wholly evil being,"), Is.True); Assert.That(result.Race, Is.EqualTo("magical")); Assert.That(result.Class, Is.EqualTo("warrior")); Assert.That(result.Position, Is.EqualTo("standing")); Assert.That(result.DefensivePosition, Is.EqualTo("standing")); Assert.That(result.GetGender(), Is.EqualTo(GenderTypes.Neuter)); Assert.That(result.SpecFun, Is.EqualTo("DoSpecCastMage")); Assert.That(result.Speaks, Is.EqualTo("magical")); Assert.That(result.Speaking, Is.EqualTo("magical")); Assert.That(result.BodyParts, Is.EqualTo("head legs heart guts feet")); Assert.That(result.Resistance, Is.EqualTo("sleep charm hold")); Assert.That(result.Susceptibility, Is.EqualTo("fire blunt")); Assert.That(result.Immunity, Is.EqualTo("nonmagic")); Assert.That(result.Attacks, Is.EqualTo("kick firebreath")); Assert.That(result.Defenses, Is.EqualTo("dodge")); }
public void LuaCreateMobile_SetStats3_Test() { var result = LuaMobFunctions.LuaProcessMob(GetMobLuaScript()); Assert.That(result, Is.Not.Null); Assert.That(result.DamageDice, Is.Not.Null); Assert.That(result.DamageDice.NumberOf, Is.EqualTo(5)); Assert.That(result.DamageDice.SizeOf, Is.EqualTo(3)); Assert.That(result.DamageDice.Bonus, Is.EqualTo(10)); }
public void LuaCreateMobile_MudProgs_Test() { var result = LuaMobFunctions.LuaProcessMob(GetMobLuaScript()); Assert.That(result, Is.Not.Null); Assert.That(result.MudProgs.Count(), Is.EqualTo(1)); Assert.That(result.MudProgs.First().Type, Is.EqualTo(MudProgTypes.Greet)); Assert.That(result.MudProgs.First().ArgList, Is.EqualTo("100")); Assert.That(result.MudProgs.First().Script, Is.EqualTo("LMobCommand(\"cac\");LMobSay(\"Now your soul shall be mine!\");")); }
public void LuaCreateMobile_SetStats4_Test() { var result = LuaMobFunctions.LuaProcessMob(GetMobLuaScript()); Assert.That(result, Is.Not.Null); Assert.That(result.GetStatistic <int>(StatisticTypes.Height), Is.EqualTo(50)); Assert.That(result.GetStatistic <int>(StatisticTypes.Weight), Is.EqualTo(100)); Assert.That(result.GetStatistic <int>(StatisticTypes.NumberOfAttacks), Is.EqualTo(2)); Assert.That(result.GetStatistic <int>(StatisticTypes.Hitroll), Is.EqualTo(5)); Assert.That(result.GetStatistic <int>(StatisticTypes.Damroll), Is.EqualTo(6)); }
public void LuaCreateMobile_SetSaves_Test() { var result = LuaMobFunctions.LuaProcessMob(GetMobLuaScript()); Assert.That(result, Is.Not.Null); Assert.That(result.SavingThrows, Is.Not.Null); Assert.That(result.SavingThrows.SaveVsPoisonDeath, Is.EqualTo(3)); Assert.That(result.SavingThrows.SaveVsWandRod, Is.EqualTo(5)); Assert.That(result.SavingThrows.SaveVsParalysisPetrify, Is.EqualTo(3)); Assert.That(result.SavingThrows.SaveVsBreath, Is.EqualTo(5)); Assert.That(result.SavingThrows.SaveVsSpellStaff, Is.EqualTo(3)); }
public void LuaCreateMobile_SetStats1_Test() { var result = LuaMobFunctions.LuaProcessMob(GetMobLuaScript()); Assert.That(result, Is.Not.Null); Assert.That(result.GetStatistic <int>(StatisticTypes.Alignment), Is.EqualTo(-950)); Assert.That(result.Level, Is.EqualTo(18)); Assert.That(result.GetStatistic <int>(StatisticTypes.ToHitArmorClass0), Is.EqualTo(2)); Assert.That(result.GetStatistic <int>(StatisticTypes.ArmorClass), Is.EqualTo(-2)); Assert.That(result.GetStatistic <int>(StatisticTypes.Coin), Is.EqualTo(6000)); Assert.That(result.GetStatistic <int>(StatisticTypes.Experience), Is.EqualTo(32000)); }
public void LuaCreateMobile_SetAttribs_Test() { var result = LuaMobFunctions.LuaProcessMob(GetMobLuaScript()); Assert.That(result, Is.Not.Null); Assert.That(result.GetStatistic <int>(StatisticTypes.PermanentStrength), Is.EqualTo(11)); Assert.That(result.GetStatistic <int>(StatisticTypes.PermanentIntelligence), Is.EqualTo(12)); Assert.That(result.GetStatistic <int>(StatisticTypes.PermanentWisdom), Is.EqualTo(13)); Assert.That(result.GetStatistic <int>(StatisticTypes.PermanentDexterity), Is.EqualTo(14)); Assert.That(result.GetStatistic <int>(StatisticTypes.PermanentConstitution), Is.EqualTo(15)); Assert.That(result.GetStatistic <int>(StatisticTypes.PermanentCharisma), Is.EqualTo(16)); Assert.That(result.GetStatistic <int>(StatisticTypes.PermanentLuck), Is.EqualTo(17)); }
public void LuaCreateMobile_Shop_Test() { var result = LuaMobFunctions.LuaProcessMob(GetMobLuaScript()); Assert.That(result, Is.Not.Null); Assert.That(result.Shop, Is.Not.Null); Assert.That(result.Shop.ShopType, Is.EqualTo(ShopTypes.Item)); Assert.That(result.Shop.OpenHour, Is.EqualTo(7)); Assert.That(result.Shop.CloseHour, Is.EqualTo(21)); Assert.That(result.Shop.ItemTypes.Count(), Is.EqualTo(2)); Assert.That(result.Shop.ItemTypes.Contains(ItemTypes.Armor), Is.True); Assert.That(result.Shop.ItemTypes.Contains(ItemTypes.Weapon), Is.True); var itemShop = result.Shop.CastAs <ItemShopData>(); Assert.That(itemShop, Is.Not.Null); Assert.That(itemShop.ProfitBuy, Is.EqualTo(130)); Assert.That(itemShop.ProfitSell, Is.EqualTo(90)); }