public Monster() { Name = ""; Size = new CreatureSize(); Source = "User Custom"; Type = ""; HP = new HP(); AC = new AC(); InitiativeModifier = 0; Tags = new SortableBindingList <string>(); Speed = new SortableBindingList <BindableString>(); Abilities = new Abilities(); DamageVulnerabilities = new SortableBindingList <BindableString>(); DamageResistances = new SortableBindingList <BindableString>(); DamageImmunities = new SortableBindingList <BindableString>(); ConditionImmunities = new SortableBindingList <BindableString>(); Saves = new SortableBindingList <Save>(); Skills = new SortableBindingList <Skill>(); Senses = new SortableBindingList <BindableString>(); Languages = new SortableBindingList <BindableString>(); Challenge = new Fraction("0"); Traits = new SortableBindingList <Trait>(); Actions = new SortableBindingList <Action>(); Reactions = new SortableBindingList <Reaction>(); LegendaryActions = new SortableBindingList <LegendaryAction>(); Spells = new SortableBindingList <BindableString>(); ReadOnly = false; }
public static void SetWeaponFinesseSize(BaseItem baseItem, CreatureSize nSize) { Internal.NativeFunctions.nwnxSetFunction(PLUGIN_NAME, "SetWeaponFinesseSize"); Internal.NativeFunctions.nwnxPushInt((int)nSize); Internal.NativeFunctions.nwnxPushInt((int)baseItem); Internal.NativeFunctions.nwnxCallFunction(); }
public DamageConditions(Conditions conditions, CreatureSize creatureSizeFilter, int escapeDC, int concurrentTargets) { ConcurrentTargets = concurrentTargets; EscapeDC = escapeDC; CreatureSizeFilter = creatureSizeFilter; Conditions = conditions; }
public static int GetSpeed(CreatureSize size) { switch (size) { case CreatureSize.Tiny: case CreatureSize.Small: { return(4); } case CreatureSize.Medium: { return(6); } case CreatureSize.Large: { return(6); } case CreatureSize.Huge: { return(8); } case CreatureSize.Gargantuan: { return(10); } } return(6); }
public string CanCastSpell(NWCreature oPC, NWObject oTarget, int spellTier) { var size = _.GetCreatureSize(oTarget); CreatureSize maxSize = CreatureSize.Invalid; switch (spellTier) { case 1: maxSize = CreatureSize.Small; break; case 2: maxSize = CreatureSize.Medium; break; case 3: maxSize = CreatureSize.Large; break; case 4: maxSize = CreatureSize.Huge; break; } if (size > maxSize) { return("Your target is too large to force push."); } return(string.Empty); }
// Sets the creature size. Use CREATURE_SIZE_* constants public static void SetSize(uint creature, CreatureSize size) { Internal.NativeFunctions.nwnxSetFunction(PluginName, "SetSize"); Internal.NativeFunctions.nwnxPushInt((int)size); Internal.NativeFunctions.nwnxPushObject(creature); Internal.NativeFunctions.nwnxCallFunction(); }
//private void TestComplexRole(IRole iRole, RoleType roleType, RoleFlag rf, bool isLeader) //{ // ComplexRole cr = iRole as ComplexRole; // Assert.IsNotNull(cr); // Assert.AreEqual(isLeader, cr.Leader); // Assert.AreEqual(roleType, cr.Type); // Assert.AreEqual(rf, cr.Flag); //} //private static void TestMinion(Creature c, bool HasRole, RoleType? roleType) //{ // Minion cr = (Minion)c.Role; // Assert.AreEqual(HasRole, cr.HasRole); // if (roleType != null) // { // Assert.IsTrue(cr.HasRole); // Assert.AreEqual(roleType, cr.Type); // } // else // { // Assert.IsFalse(cr.HasRole); // } //} private void TestSizeOriginType(Creature c, CreatureSize creatureSize, CreatureOrigin creatureOrigin, CreatureType creatureType, int level, string keyword) { Assert.AreEqual(creatureSize, c.Size); Assert.AreEqual(creatureOrigin, c.Origin); Assert.AreEqual(creatureType, c.Type); Assert.AreEqual(level, c.Level); Assert.AreEqual(CleanForCompare(keyword), CleanForCompare(c.Keywords)); }
public Attack AddGrapple(int savingThrow, CreatureSize includeCreatureSizes = CreatureSizes.All) { Damage damage = new Damage(DamageType.Condition, AttackKind.Any, Dice.NoRoll, TimePoint.Immediately, TimePoint.Immediately, Conditions.Grappled | Conditions.Restrained, savingThrow, Ability.strength | Ability.dexterity); damage.IncludeCreatureSizes = includeCreatureSizes; damages.Add(damage); return(this); }
public PersonalInfo(string name, CreatureSize size, RacialType type, string typeTag, string alignment) { Name = name; Size = size; Type = type; TypeTag = typeTag; Alignment = alignment; }
/// <summary> /// Creates a copy of <see cref="MonsterModel"/> /// </summary> public MonsterModel(MonsterModel monsterModel) : base(monsterModel) { _size = monsterModel.Size; _type = monsterModel.Type; _alignment = monsterModel.Alignment; _ac = monsterModel.AC; _hp = monsterModel.HP; _speed = monsterModel.Speed; _str = monsterModel.Strength; _dex = monsterModel.Dexterity; _con = monsterModel.Constitution; _int = monsterModel.Intelligence; _wis = monsterModel.Wisdom; _cha = monsterModel.Charisma; _description = monsterModel.Description; _saves = new Dictionary <Ability, int>(monsterModel.Saves); _skills = new Dictionary <Skill, int>(monsterModel.Skills); _resistances = monsterModel.Resistances; _vulnerabilities = monsterModel.Vulnerabilities; _immunities = monsterModel.Immunities; _conditionImmunities = monsterModel.ConditionImmunities; _senses = monsterModel.Senses; _passivePerception = monsterModel.PassivePerception; _languages = monsterModel.Languages; _cr = monsterModel.CR; _spells = new List <string>(monsterModel.Spells); _spellSlots = new List <string>(monsterModel.SpellSlots); _traits = new List <TraitModel>(); foreach (TraitModel traitModel in monsterModel.Traits) { _traits.Add(new TraitModel(traitModel)); } _actions = new List <MonsterActionModel>(); foreach (MonsterActionModel monsterActionModel in monsterModel.Actions) { _actions.Add(new MonsterActionModel(monsterActionModel)); } _reactions = new List <MonsterActionModel>(); foreach (MonsterActionModel monsterActionModel in monsterModel.Reactions) { _reactions.Add(new MonsterActionModel(monsterActionModel)); } _legendaryActions = new List <MonsterActionModel>(); foreach (MonsterActionModel monsterActionModel in monsterModel.LegendaryActions) { _legendaryActions.Add(new MonsterActionModel(monsterActionModel)); } _environment = monsterModel.Environment; _xml = monsterModel.XML; }
public static float GetCreatureAgeAtSize(CreatureSize size) { switch (size) { case CreatureSize.Small: return(0.0f); case CreatureSize.Medium: return(0.33f); case CreatureSize.Large: return(0.66f); } return(0.0f); }
public static float GetCreatureSizeScale(CreatureSize Size) { switch (Size) { case CreatureSize.Small: return(0.3f); case CreatureSize.Medium: return(0.4f); case CreatureSize.Large: return(0.6f); } return(1.0f); }
public static string GetCreatureSizeDisplayString(CreatureSize Size) { switch (Size) { case CreatureSize.Small: return("Small"); case CreatureSize.Medium: return("Medium"); case CreatureSize.Large: return("Large"); } return("INVALID"); }
/// <summary> /// Gets the square size of a creature of the given size. /// </summary> /// <param name="size">The creature size.</param> /// <returns>Returns the size in squares.</returns> public static int GetSize(CreatureSize size) { switch (size) { case CreatureSize.Large: return(2); case CreatureSize.Huge: return(3); case CreatureSize.Gargantuan: return(4); } return(1); }
/// <summary> /// Creates a copy of <see cref="RaceModel"/> /// </summary> public RaceModel(RaceModel raceModel) : base(raceModel) { _size = raceModel.Size; _walkSpeed = raceModel.WalkSpeed; _flySpeed = raceModel.FlySpeed; _abilities = new Dictionary <Ability, int>(raceModel.Abilities); _skillProficiencies = new List <Skill>(raceModel.SkillProficiencies); _languages = new List <string>(raceModel.Languages); _weaponProficiencies = new List <string>(raceModel.WeaponProficiencies); _armorProficiencies = new List <string>(raceModel.ArmorProficiencies); _toolProficiencies = new List <string>(raceModel.ToolProficiencies); _languageTrait = raceModel.LanguageTrait; _traits = new List <TraitModel>(); foreach (TraitModel traitModel in raceModel.Traits) { _traits.Add(new TraitModel(traitModel)); } _xml = raceModel.XML; }
public PlayerRace(string name, CreatureSize size, int baseSpeed) { this.name = name; this.size = size; this.baseSpeed = baseSpeed; }
public SizeEqualTo(CreatureSize creatureSize) { CreatureSize = creatureSize; }
public void CollectDamages(Creature creature, List <Damage> mainDamages, List <Damage> successfulSavedDamages, int savingThrow, CreatureSize creatureSize) { hitPointChange = 0; foreach (Damage damage in successfulSavedDamages) { if (damage.Saves(savingThrow)) { if (damage.Conditions != Conditions.None) { if (damage.IncludeCreatureSizes.HasFlag(creatureSize)) { conditionsAdded |= damage.Conditions; } } if (damage.DamageType != DamageType.None && !creature.IsImmuneTo(damage.DamageType, damage.AttackKind)) { damageTypes |= damage.DamageType; hitPointChange += (int)-Math.Round(damage.GetDamageRoll()); } } } foreach (Damage damage in mainDamages) { if (!damage.Saves(savingThrow)) { if (damage.Conditions != Conditions.None) { if (damage.IncludeCreatureSizes.HasFlag(creatureSize)) { conditionsAdded |= damage.Conditions; damageTypes |= DamageType.Condition; } } DamageType damageType = damage.DamageType & ~(DamageType.Condition | DamageType.None); if (damageType != DamageType.None && !creature.IsImmuneTo(damageType, damage.AttackKind)) { damageTypes |= damageType; hitPointChange += (int)-Math.Round(damage.GetDamageRoll()); } } } }
public Attack AddCondition(Conditions conditions, int savingThrow, Ability savingThrowAbility, CreatureSize includeCreatureSizes = CreatureSizes.All) { Damage damage = new Damage(DamageType.Condition, AttackKind.Any, Dice.NoRoll, TimePoint.Immediately, TimePoint.Immediately, conditions, savingThrow, savingThrowAbility); damage.Conditions = conditions; damage.IncludeCreatureSizes = includeCreatureSizes; damages.Add(damage); return(this); }
public static T SetWieldingSize <T>(this T entity, CreatureSize value) where T : CharacterSizeDefinition { entity.SetField("wieldingSize", value); return(entity); }
private bool IsSize(RaceModel raceModel, CreatureSize size) { return(size == CreatureSize.None || raceModel.Size == size); }
public static T SetCarryingSize <T>(this T entity, CreatureSize value) where T : RulesetCharacter { entity.SetField("carryingSize", value); return(entity); }
public SizeSmallerThan(CreatureSize creatureSize) { CreatureSize = creatureSize; }
public SizeGreaterThan(CreatureSize creatureSize) { CreatureSize = creatureSize; }
private bool IsSize(MonsterModel monsterModel, CreatureSize size) { return(size == CreatureSize.None || monsterModel.Size == size); }