public BattleAction(Type theType, string theName, int hitMod = 0, Roll theRoll = null) { type = theType; name = theName; if (null != theRoll) // leave it uninitialized, bleh { roll = theRoll; } hitModifier = hitMod; }
public Weapon(string theName, Type theType, int dmgMod, int spdMod, int defMod, int weaponLevel, Roll weaponRoll) { name = theName; // A human-readable name to be displayed in the UI type = theType; // See Weapon.Type damageModifier = dmgMod; // Additional modifiers that the weapon adds to the damage-roll speedModifier = spdMod; // A modifier effecting the weilder's speed defenseModifier = defMod; // A modifier effecting the weilder's defense level = weaponLevel; roll = weaponRoll; attacks = new Dictionary <string, Attack>(); }
void NewWeapon(string theName, Weapon.Type theType, int dmgMod, int spdMod, int defMod, int weaponLevel, Roll weaponRoll, params Attack[] attacks) { Weapon weapon; // Don't create a weapon that doesn't have any attacks if (null == attacks || 0 == attacks.Length) { return; } weapon = new Weapon(theName, theType, dmgMod, spdMod, defMod, weaponLevel, weaponRoll); // Add the attacks to the weapon foreach (Attack attack in attacks) { attack.roll = weaponRoll; weapon.AddAttack(attack); } // Ensure the weapons Dict is allocated if (null == weapons) { weapons = new Dictionary <int, Dictionary <string, Weapon> >(); } // Ensure the specified level in 'weapons' is allocated if (false == weapons.ContainsKey(weaponLevel)) { weapons[weaponLevel] = new Dictionary <string, Weapon>(); } // Add the weapon weapons[weaponLevel].Add(weapon.name, weapon); }
void WeaponItemTopBar(string name, Weapon.Type type, Roll roll) { string weaponType = "WeaponTypeIcon"; string dieColor = "WeaponRoll_"; dieColor += roll.dieName; if(type == Weapon.Type.Melee) weaponType += "Melee"; else if(type == Weapon.Type.Ranged) weaponType += "Ranged"; else if(type == Weapon.Type.Magical) weaponType += "Magical"; GUILayout.BeginHorizontal(GUILayout.Height(25)); GUILayout.Space(10); GUILayout.Box("", weaponType, GUILayout.Width(30), GUILayout.Height(30)); GUILayout.FlexibleSpace(); GUILayout.Box(string.Format("{0}", name), "ShortLabel", GUILayout.Width(180)); GUILayout.FlexibleSpace(); GUILayout.Box(string.Format("{0}{1}", roll.count, roll.dieName), "WeaponLevel", GUILayout.Width(30), GUILayout.Height(30)); //GUILayout.Box(string.Format("{0}", roll.count), dieColor, GUILayout.Width(30), GUILayout.Height(30)); GUILayout.Space(10); GUILayout.EndHorizontal(); }
public void ThrowDice(Roll roll, bool bLookAt=true) { DiceController().ThrowDice(roll, bLookAt); }
public void ThrowDice(Roll roll, bool bLookAt = true) { DiceController().ThrowDice(roll, bLookAt); }
public Weapon(string theName, Type theType, int dmgMod, int spdMod, int defMod, int weaponLevel, Roll weaponRoll) { name = theName; // A human-readable name to be displayed in the UI type = theType; // See Weapon.Type damageModifier = dmgMod; // Additional modifiers that the weapon adds to the damage-roll speedModifier = spdMod; // A modifier effecting the weilder's speed defenseModifier = defMod; // A modifier effecting the weilder's defense level = weaponLevel; roll = weaponRoll; attacks = new Dictionary<string, Attack>(); }
public BattleAction(Type theType, string theName, int hitMod=0, Roll theRoll=null) { type = theType; name = theName; if(null != theRoll) // leave it uninitialized, bleh roll = theRoll; hitModifier = hitMod; }
void NewWeapon(string theName, Weapon.Type theType, int dmgMod, int spdMod, int defMod, int weaponLevel, Roll weaponRoll, params Attack[] attacks) { Weapon weapon; // Don't create a weapon that doesn't have any attacks if(null == attacks || 0 == attacks.Length) return; weapon = new Weapon(theName, theType, dmgMod, spdMod, defMod, weaponLevel, weaponRoll); // Add the attacks to the weapon foreach(Attack attack in attacks) { attack.roll = weaponRoll; weapon.AddAttack(attack); } // Ensure the weapons Dict is allocated if(null == weapons) weapons = new Dictionary<int, Dictionary<string, Weapon>>(); // Ensure the specified level in 'weapons' is allocated if(false == weapons.ContainsKey(weaponLevel)) weapons[weaponLevel] = new Dictionary<string, Weapon>(); // Add the weapon weapons[weaponLevel].Add(weapon.name, weapon); }