/// <summary> /// Create a new Crew Quarters or Life Sustainer /// </summary> /// <param name="name">name of teh life sustainer of crew quarters</param> /// <param name="types">classes of ship which can use this component</param> /// <param name="power">power used by this component</param> /// <param name="space">space used by this component</param> /// <param name="morale">morale modifier of this component</param> /// <param name="origin">rulebook containing this component</param> /// <param name="page">page this component can be found on</param> /// <param name="special">special rules for this component</param> /// <param name="quality">quality of this component</param> /// <param name="sp">cost of this component</param> /// <param name="loss">modifier to morale loss granted by this component</param> public CrewSustainer(string name, HullType types, int power, int space, int morale, RuleBook origin, byte page, string special = null, Quality quality = Quality.Common, int sp = 0, int loss = 0, ComponentOrigin comp = ComponentOrigin.Standard, Condition cond = Condition.Intact) : base(name, sp, power, space, special, origin, page, types, quality, comp, cond) { this.Morale = morale; this.MoraleLoss = loss; }
//image or at least image path if gonna show /// <summary> /// Create a new hull /// </summary> /// <param name="name">name of the hull</param> /// <param name="speed">base speed of the hull</param> /// <param name="man">base manoeuvrability of hull</param> /// <param name="det">base detection rating of hull</param> /// <param name="hullint">base hull integrity of the hull</param> /// <param name="armour">base armour value of the hull</param> /// <param name="space">base available space in hull</param> /// <param name="sp">cost of the hull</param> /// <param name="type">which type(s) this hull can mount components for</param> /// <param name="special">special rules for this hull</param> /// <param name="origin">rulebook this hull can be found in</param> /// <param name="page">page number to find the hull on</param> /// <param name="turrets">turret rating of the hull</param> /// <param name="prow">number of prow weapon slots</param> /// <param name="dorsal">number of dorsal weapon slots</param> /// <param name="side">number of port weapon slots</param> /// <param name="keel">number of keel weapon slots</param> /// <param name="aft">number of aft weapon slots</param> /// <param name="frontal">Default prow weapon</param> /// <param name="broadside">Default broadside weapons</param> /// <param name="comps">Default supplemental components</param> /// <param name="command">Command modifier of this hull</param> /// <param name="maxspeed">maximum speed of ship. <1 = unlimited</param> /// <param name="power">Power generated(or used)by hull, not including built in systems(those should be listed in themselves)</param> /// <param name="history">History this hull always has</param> /// <param name="bs">Modifier to ballistic skill tests with this hull</param> /// <param name="locked">If the ship has been locked so it may not add more armour</param> /// <param name="navigate">modifier to navigate warp</param> /// <param name="shields">hulltypes of the shields which may be added</param> public Hull(string name, int speed, int man, int det, int hullint, int armour, int space, int sp, HullType type, String special, RuleBook origin, byte page, int turrets = 1, int prow = 0, int dorsal = 0, int side = 0, int keel = 0, int aft = 0, Weapon frontal = null, Weapon broadside = null, Supplemental[] comps = null, int command = 0, int maxspeed = 0, int power = 0, ShipHistory history = ShipHistory.None, int bs = 0, bool locked = false, int navigate = 0, HullType shields = HullType.None) : base(name, sp, power, space, special, origin, page, type) { this.Speed = speed; this.Manoeuvrability = man; this.DetectionRating = det; this.HullIntegrity = hullint; this.Armour = armour; this.TurretRating = turrets; this.ProwSlots = prow; this.DorsalSlots = dorsal; this.SideSlots = side; this.KeelSlots = keel; this.AftSlots = aft; this.DefaultProw = frontal; this.DefaultBroadside = broadside; this.DefaultComponents = comps; this.Command = command; this.MaxSpeed = maxspeed; this.History = history; this.BSModifier = bs; this.ArmourLocked = locked; this.NavigateWarp = navigate; this.VoidShields = (shields == HullType.None ? type : shields); }
/// <summary> /// Create a new Landing Bay /// </summary> /// <param name="name">name of the landing bay</param> /// <param name="hulls">class fo ship that can mount this weapon</param> /// <param name="slots">locatiosn where this weapon can be mounted</param> /// <param name="power">power used by this weapon</param> /// <param name="space">space used by this method</param> /// <param name="sp">cost of this weapon</param> /// <param name="str">strength of the weapon</param> /// <param name="capacity">total ammo capacity of the torpedo tube</param> /// <param name="origin">rulebook containing this weapon</param> /// <param name="page">page this weapon can be found on</param> /// <param name="quality">quality of this weapon</param> /// <param name="wq">enum declaring which qualities to be adjusted</param> /// <param name="special">special rules of this weapon</param> public LandingBay(string name, HullType hulls, WeaponSlot slots, int power, int space, int sp, int str, RuleBook origin, byte page, Quality quality = Quality.Common, WeaponQuality wq = WeaponQuality.None, string special = null, ComponentOrigin comp = ComponentOrigin.Standard, Condition cond = Condition.Intact) : base(name, WeaponType.LandingBay, hulls, slots, power, space, sp, str, default(DiceRoll), 0, 0, origin, page, quality, wq, special, Quality.None, comp, cond) { Squadrons = new List<Squadron>(Strength * 3); }
private void SetBookSource(RuleBook book) { switch (book) { case RuleBook.CoreRuleBook: BookSource = "Rogue Trader Core Rulebook"; break; case RuleBook.StarsOfInequity: BookSource = "Stars of Inequity"; break; case RuleBook.BattlefleetKoronus: BookSource = "Battlefleet Koronus"; break; case RuleBook.TheKoronusBestiary: BookSource = "The Koronus Bestiary"; break; case RuleBook.IntoTheStorm: BookSource = "Into the Storm"; break; case RuleBook.TheSoulReaver: BookSource = "The Soul Reaver"; break; default: throw new ArgumentOutOfRangeException(nameof(book)); } }
static void VoteControllerDeserialize(On.RoR2.VoteController.orig_OnDeserialize orig, VoteController self, NetworkReader reader, bool initialState) { orig(self, reader, initialState); if (reader.Position < reader.Length && !Run.instance) { if (TargetedRuleBook != null && TargetedRuleChoiceMask != null) { byte[] ruleBookBytes = TargetedRuleBook.GetFieldValue <byte[]>("ruleValues"); byte[] ruleChoiceMaskBytes = (byte[])TargetedRuleChoiceMask.GetType().BaseType.GetField("bytes", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(TargetedRuleChoiceMask); for (int i = ruleBookBytes.Length - RegisteredVoteSelections.Count; i < ruleBookBytes.Length; i++) { ruleBookBytes[i] = reader.ReadByte(); } int difference = ruleChoiceMaskBytes.Length - ((RuleCatalog.choiceCount - RegisteredVoteChoices.Count) + 7 >> 3); for (int i = ruleChoiceMaskBytes.Length - difference; i < ruleChoiceMaskBytes.Length; i++) { ruleChoiceMaskBytes[i] = reader.ReadByte(); } TargetedRuleBook = null; TargetedRuleChoiceMask = null; } } }
/// <summary> /// Returns the shortened name of the rulebook for dispaly /// </summary> /// <param name="self">Rulebook to display</param> /// <returns>Shortened name of the rulebook</returns> public static string Name(this RuleBook self) { switch (self) { case RuleBook.CoreRulebook: return("Core Rulebook"); case RuleBook.IntoTheStorm: return("Into the Storm"); case RuleBook.HostileAcquisition: return("Hostile Acquisitions"); case RuleBook.BattlefleetKoronus: return("Battlefleet Koronus"); case RuleBook.LureoftheExpanse: return("Lure of the Expanse"); case RuleBook.SoulReaver: return("The Soul Reaver"); case RuleBook.FaithAndCoin: return("Faith and Coin"); default: return("Custom"); } }
// Start is called before the first frame update void Start() { AM = GameObject.Find("AudioManager").GetComponent <AudioMaster>(); ruleBook = GetComponent <RuleBook>(); GM = GetComponent <GameManager>(); TE = FindObjectOfType <TrapEvent>(); //foreach(GameObject sign in signs) //{ // DontDestroyOnLoad(sign); //} truthfulSigns = new List <bool> { }; allRooms = new List <RoomStats> { }; // Make a new room with some stats. This will have to read back info from the manager object with room generation ruleBook.AddNewRule(); CreateNewRoom(); newRuleHint.gameObject.SetActive(true); if (allRooms.Count == 0) { hintText.text = "Press 'A' or 'D' to check out your environment. \n[A][D]"; } }
/// <summary> /// Returns the full name of the rulebook for dispaly /// </summary> /// <param name="self">Rulebook to display</param> /// <returns>Full name of the rulebook</returns> public static string LongName(this RuleBook self) { switch (self) { case RuleBook.CoreRulebook: return("Rogue Trader Core Rulebook"); case RuleBook.IntoTheStorm: return("Into the Storm: The Explorer's Handbook"); case RuleBook.HostileAcquisition: return("Hostile Acquisitions: Profit and Plunder in the Lawless Expanse"); case RuleBook.BattlefleetKoronus: return("Battlefleet Koronus: Voidships and Warfare in the Koronus Expanse"); case RuleBook.LureoftheExpanse: return("Lure of the Expanse"); case RuleBook.SoulReaver: return("The Soul Reaver"); case RuleBook.FaithAndCoin: return("Faith and Coin: Fortune and Fire in the Koronus Expanse"); default: return("Custom"); } }
/// <summary> /// Create a new Landing Bay /// </summary> /// <param name="name">name of the landing bay</param> /// <param name="hulls">class fo ship that can mount this weapon</param> /// <param name="slots">locatiosn where this weapon can be mounted</param> /// <param name="power">power used by this weapon</param> /// <param name="space">space used by this method</param> /// <param name="sp">cost of this weapon</param> /// <param name="str">strength of the weapon</param> /// <param name="capacity">total ammo capacity of the torpedo tube</param> /// <param name="origin">rulebook containing this weapon</param> /// <param name="page">page this weapon can be found on</param> /// <param name="quality">quality of this weapon</param> /// <param name="wq">enum declaring which qualities to be adjusted</param> /// <param name="special">special rules of this weapon</param> public LandingBay(string name, HullType hulls, WeaponSlot slots, int power, int space, int sp, int str, RuleBook origin, byte page, Quality quality = Quality.Common, WeaponQuality wq = WeaponQuality.None, string special = null, ComponentOrigin comp = ComponentOrigin.Standard, Condition cond = Condition.Intact) : base(name, WeaponType.LandingBay, hulls, slots, power, space, sp, str, default(DiceRoll), 0, 0, origin, page, quality, wq, special, Quality.None, comp, cond) { Squadrons = new List <Squadron>(Strength * 3); }
/// <summary> /// Create a new weapon /// </summary> /// <param name="name">name of the weapon</param> /// <param name="type">class of weapon</param> /// <param name="hulls">class fo ship that can mount this weapon</param> /// <param name="slots">locatiosn where this weapon can be mounted</param> /// <param name="power">power used by this weapon</param> /// <param name="space">space used by this method</param> /// <param name="sp">cost of this weapon</param> /// <param name="str">strength of the weapon</param> /// <param name="damage">damage of the weapon</param> /// <param name="crit">crit rating of the weapon</param> /// <param name="range">range of the weapon</param> /// <param name="origin">rulebook containing this weapon</param> /// <param name="page">page this weapon can be found on</param> /// <param name="quality">quality of this weapon</param> /// <param name="wq">enum declaring which qualities to be adjusted</param> /// <param name="special">special rules of this weapon</param> /// <param name="turbo">Quality of turboweapon battery upgrade if applicable</param> public Weapon(string name, WeaponType type, HullType hulls, WeaponSlot slots, int power, int space, int sp, int str, string damage, int crit, int range, RuleBook origin, byte page, Quality quality = Quality.Common, WeaponQuality wq = WeaponQuality.None, string special = null, Quality turbo = Quality.None, ComponentOrigin comp = ComponentOrigin.Standard, Condition cond = Condition.Intact) : this(name, type, hulls, slots, power, space, sp, str, new DiceRoll(damage), crit, range, origin, page, quality, wq, special, turbo, comp, cond) { }
/// <summary> /// Creates a <see cref="RuleBook"/> by parsing the content of the /// indicated configuration file. /// </summary> /// <param name="filename">The configuration filename.</param> /// <returns>A <see cref="RuleBook"/> instance created using the /// details in the configuration file.</returns> public static RuleBook Load(string filename) { RuleBook ruleBook = new RuleBook(); FileStream stream = File.OpenRead(Application.PathTo(filename)); XmlDocument document = XmlUtility.NonValidatingParse(stream); XmlNodeList list = DOM.GetChildElements(document.DocumentElement); foreach (XmlElement context in list) { if (context.LocalName.Equals("identifier")) { string name = context.GetAttribute("name"); Property [] properties = LoadProperties(XPath.Paths(context, "property")); IFormatter formatter = (IFormatter)LoadClass(XPath.Paths(context, "formatter")); ruleBook.Add(new IdentifierRule(name, properties, formatter)); } else { log.Warn("Unexpected element '" + context.LocalName + "'"); } } return(ruleBook); }
public NovaCannon(String name, HullType hulls, int power, int space, int sp, DiceRoll damage, int range, RuleBook origin, byte page, string special = null, Quality quality = Quality.Common, WeaponQuality wq = WeaponQuality.None, ComponentOrigin comp = ComponentOrigin.Standard, Condition cond = Condition.Intact, int ammo = 0) : base(name, WeaponType.NovaCannon, hulls, WeaponSlot.Prow, power, space, sp, 0, damage, 0, range, origin, page, quality, wq, special, Quality.None, comp, cond) { this.Ammo = ammo; }
public void With_Returns_RuleBook_With_Same_WinnerTuples() { var underTest = new RuleBook(new Game(GameConfiguration.Default)); var newGame = Substitute.For <IGame>(); ((RuleBook)underTest.With(newGame)).WinnerTuples.Should().BeSameAs(underTest.WinnerTuples); }
/// <summary> /// Create a new plasma drive /// </summary> /// <param name="name">name of the plasma drive</param> /// <param name="types">hull classes which can use this drive</param> /// <param name="power">power generated by this drive</param> /// <param name="space">space taken by this drive</param> /// <param name="special">special rules for this drive</param> /// <param name="origin">rulebook which contains this drive</param> /// <param name="page">page to find the drive on</param> /// <param name="sp">cost of this drive</param> /// <param name="quality">quality of this drive</param> /// <param name="speed">speed modifier of this drive</param> /// <param name="man">manoeuvrability modifier of this drive</param> public PlasmaDrive(string name, HullType types, int power, int space, string special, RuleBook origin, byte page, int sp = 0, Quality quality = Quality.Common, int speed = 0, int man = 0, ComponentOrigin comp = ComponentOrigin.Standard, bool modified = false, Condition cond = Condition.Intact) : base(name, sp, power, space, special, origin, page, types, quality, comp, cond) { this.Manoeuvrability = man; this.Speed = speed; Modified = modified; }
public void ResultFor_Discovers_Victory(string input) { var game = SetupGame(input); var result = new RuleBook(game).Result; Assert.AreEqual(GameResult.Victory, result); }
public void ResultFor_Discovers_Undecided(string input) { var game = SetupGame(input); var result = new RuleBook(game).Result; Assert.AreEqual(GameResult.Undecided, result); }
public void With_Returns_RuleBook_With_Passed_Game() { var underTest = new RuleBook(new Game(GameConfiguration.Default)); var newGame = Substitute.For <IGame>(); ((RuleBook)underTest.With(newGame)).Game.Should().BeSameAs(newGame); }
public void LegalMoves(string boardInput, int[] expectedMoveX) { var game = SetupGame(boardInput); var result = new RuleBook(game).LegalMoves.ToArray(); result.All(m => m.StoneKind == StoneKind.Regular).Should().BeTrue(); result.Select(m => m.X).Should().BeEquivalentTo(expectedMoveX); }
static void RuleBookDeserialize(On.RoR2.RuleBook.orig_Deserialize orig, RuleBook self, NetworkReader reader) { byte[] ruleValues = self.GetFieldValue <byte[]>("ruleValues"); for (int i = 0; i < ruleValues.Length - RegisteredVoteSelections.Count; i++) { ruleValues[i] = reader.ReadByte(); } TargetedRuleBook = self; }
public string DeleteSchoolPeriodSettingService(RuleBook ruleBook) { DbParam[] param = new DbParam[] { new DbParam(ruleBook.RulebookUid, typeof(System.String), "_rulebookUid") }; OutParam = db.ExecuteNonQuery("sp_SchoolPeriodTiming_DelById", param, false); return(OutParam); }
public ShipComponent(string componentName, int powerCost, int spaceCost, int pageNumber, RuleBook bookSource, string mountSlot = "") { ComponentName = componentName; PowerCost = powerCost; SpaceCost = spaceCost; PageNumber = pageNumber; BookSource = bookSource; MountSlot = mountSlot; }
public MainWindow() { InitializeComponent(); RuleBook rules = LoadRules(); Database db = new Database(); GameLogic engine = new GameLogic(db, rules); this.Content = new Gui(engine); }
/// <summary> /// Create a new Torpedo Tube /// </summary> /// <param name="name">name of the torpedo tube</param> /// <param name="hulls">class of ship that can mount this weapon</param> /// <param name="slots">locatiosn where this weapon can be mounted</param> /// <param name="power">power used by this weapon</param> /// <param name="space">space used by this method</param> /// <param name="sp">cost of this weapon</param> /// <param name="str">strength of the weapon</param> /// <param name="capacity">total ammo capacity of the torpedo tube</param> /// <param name="origin">rulebook containing this weapon</param> /// <param name="page">page this weapon can be found on</param> /// <param name="quality">quality of this weapon</param> /// <param name="wq">enum declaring which qualities to be adjusted</param> /// <param name="special">special rules of this weapon</param> public TorpedoTubes(string name, HullType hulls, int power, int space, int sp, int str, int capacity, RuleBook origin, byte page, Quality quality = Quality.Common, WeaponQuality wq = WeaponQuality.None, string special = null, ComponentOrigin comp = ComponentOrigin.Standard, Condition cond = Condition.Intact) : base(name, WeaponType.TorpedoTube, hulls, WeaponSlot.Prow | WeaponSlot.Keel, power, space, sp, str, default(DiceRoll), 0, 0, origin, page, quality, wq, special, Quality.None, comp, cond) { this.Capacity = capacity; Ammo = new List <Torpedo>(Capacity); Tubes = new Torpedo[Strength]; }
/// <summary> /// Create a new Torpedo Tube /// </summary> /// <param name="name">name of the torpedo tube</param> /// <param name="hulls">class of ship that can mount this weapon</param> /// <param name="slots">locatiosn where this weapon can be mounted</param> /// <param name="power">power used by this weapon</param> /// <param name="space">space used by this method</param> /// <param name="sp">cost of this weapon</param> /// <param name="str">strength of the weapon</param> /// <param name="capacity">total ammo capacity of the torpedo tube</param> /// <param name="origin">rulebook containing this weapon</param> /// <param name="page">page this weapon can be found on</param> /// <param name="quality">quality of this weapon</param> /// <param name="wq">enum declaring which qualities to be adjusted</param> /// <param name="special">special rules of this weapon</param> public TorpedoTubes(string name, HullType hulls, int power, int space, int sp, int str, int capacity, RuleBook origin, byte page, Quality quality = Quality.Common, WeaponQuality wq = WeaponQuality.None, string special = null, ComponentOrigin comp = ComponentOrigin.Standard, Condition cond = Condition.Intact) : base(name, WeaponType.TorpedoTube, hulls, WeaponSlot.Prow | WeaponSlot.Keel, power, space, sp, str, default(DiceRoll), 0, 0, origin, page, quality, wq, special, Quality.None, comp, cond) { this.Capacity = capacity; Ammo = new List<Torpedo>(Capacity); Tubes = new Torpedo[Strength]; }
static void Main(string[] args) { NumberGenerator ng = new NumberGenerator(); StopLight stopLight = new StopLight(); SignalReaction react = stopLight.ReactionToSignal(Convert.ToInt32(ng.GetRandomNumber())); RuleBook rb = new RuleBook(); Console.WriteLine(rb.GetTrafficRule(react)); Console.Read(); }
/// <summary> /// A new Squadron at full strength /// </summary> /// <param name="rating">Craft Rating of Squad</param> /// <param name="speed">Speed of Squadron</param> /// <param name="size">Maximum Size of Squadron</param> public Squadron(String name, Race race, int rating, int speed, int size, string special = null, RuleBook origin = RuleBook.BattlefleetKoronus, byte page = 14) { this.Name = name; this.Race = race; this.CraftRating = rating; this.Speed = speed; this.CurrentSize = this.MaxSize = size; this.Special = special; this.Origin = origin; this.Page = page; }
internal void UpdateValue(RuleBook ruleBook) { var choice = ruleBook.GetRuleChoice(_ruleDef); if (Value.Equals(choice.extraData)) { return; } _value = choice.extraData; ValueChanged?.Invoke(this, null); }
static void RuleBookSerialize(On.RoR2.RuleBook.orig_Serialize orig, RuleBook self, NetworkWriter writer) { byte[] ruleValues = self.GetFieldValue <byte[]>("ruleValues"); for (int i = 0; i < ruleValues.Length - RegisteredVoteSelections.Count; i++) { writer.Write(ruleValues[i]); } for (int i = ruleValues.Length - RegisteredVoteSelections.Count; i < ruleValues.Length; i++) { RuleBookExtraBytes.Add(ruleValues[i]); } }
static void ApplyVotes(On.RoR2.Run.orig_SetRuleBook orig, Run self, RuleBook newRuleBook) { VoteResults = VoteMask.none; for (int i = 0; i < RegisteredVoteSelections.Count; i++) { VoteChoiceDef voteChoice = (VoteChoiceDef)newRuleBook.GetRuleChoice(RegisteredVoteSelections[i]); if (voteChoice.VoteIndex > 0) { VoteResults.AddVote(voteChoice.VoteIndex); } } orig(self, newRuleBook); }
/// <summary> /// Create a new weapon /// </summary> /// <param name="name">name of the weapon</param> /// <param name="type">class of weapon</param> /// <param name="hulls">class fo ship that can mount this weapon</param> /// <param name="slots">locatiosn where this weapon can be mounted</param> /// <param name="power">power used by this weapon</param> /// <param name="space">space used by this method</param> /// <param name="sp">cost of this weapon</param> /// <param name="str">strength of the weapon</param> /// <param name="damage">damage of the weapon</param> /// <param name="crit">crit rating of the weapon</param> /// <param name="range">range of the weapon</param> /// <param name="origin">rulebook containing this weapon</param> /// <param name="page">page this weapon can be found on</param> /// <param name="quality">quality of this weapon</param> /// <param name="wq">enum declaring which qualities to be adjusted</param> /// <param name="special">special rules of this weapon</param> /// <param name="turbo">Quality of turboweapon battery upgrade if applicable</param> public Weapon(string name, WeaponType type, HullType hulls, WeaponSlot slots, int power, int space, int sp, int str, DiceRoll damage, int crit, int range, RuleBook origin, byte page, Quality quality = Quality.Common, WeaponQuality wq = WeaponQuality.None, string special = null, Quality turbo = Quality.None, ComponentOrigin comp = ComponentOrigin.Standard, Condition cond = Condition.Intact) : base(name, sp, power, space, special, origin, page, hulls, quality, comp, cond) { this.Type = type; this.Slots = slots; this.Strength = str; this.Damage = damage; this.Crit = crit; this.Range = range; this.WeaponQuality = wq; this.TurboWeapon = turbo; }
private static RuleBook LoadRules() { RuleBook standard = new RuleBook(); standard.AddRule(new OnlyMoveOwnPiece()); standard.AddRule(new BishopMovement()); standard.AddRule(new RookMovement()); standard.AddRule(new KnightMovement()); standard.AddRule(new KingMovement()); standard.AddRule(new QueenMovement()); standard.AddRule(new PawnMovement()); return(standard); }
/// <summary> /// Create a new Component object /// </summary> /// <param name="name">name of component</param> /// <param name="sp">cost of the component</param> /// <param name="power">power used or provided by the component</param> /// <param name="space">space taken or provided by the component</param> /// <param name="special">special rules for the component</param> /// <param name="origin">rulebook containing this component</param> /// <param name="page">page of the rulebook that the component may be found on</param> /// <param name="types">hulls which may use this component</param> /// <param name="quality">Quality of this component</param> public Component(string name, int sp, int power, int space, string special, RuleBook origin, byte page, HullType types, Quality quality = Quality.Common, ComponentOrigin comp = ComponentOrigin.Standard, Condition cond = Condition.Intact) { this.Name = name; this.SP = sp; this.Power = power; this.Space = space; this.Special = special; this.Origin = origin; this.PageNumber = page; this.HullTypes = types; this.Quality = quality; this.ComponentOrigin = comp; this.Condition = cond; }
// Token: 0x060024EE RID: 9454 RVA: 0x000A0FB8 File Offset: 0x0009F1B8 private void SetData(RuleChoiceMask choiceAvailability, RuleBook ruleBook) { if (choiceAvailability.Equals(this.cachedRuleChoiceMask) && ruleBook.Equals(this.cachedRuleBook)) { return; } this.cachedRuleChoiceMask.Copy(choiceAvailability); this.cachedRuleBook.Copy(ruleBook); for (int i = 0; i < RuleCatalog.categoryCount; i++) { this.categoryControllers[i].SetData(RuleCatalog.GetCategoryDef(i), this.cachedRuleChoiceMask, this.cachedRuleBook); this.categoryControllers[i].gameObject.SetActive(!this.categoryControllers[i].shouldHide); } }
/// <summary> /// Create new augur array /// </summary> /// <param name="name">name of augur arrray</param> /// <param name="power">power used by this array</param> /// <param name="origin">rulebook containign this array</param> /// <param name="page">page this array can be found on</param> /// <param name="det">detection rating modifier of this array</param> /// <param name="special">special rules of this array</param> /// <param name="quality">quality of this array</param> /// <param name="sp">cost of this array</param> /// <param name="man">manoeuvrability modifier of this array</param> /// <param name="bs">ballistic skill modifier of this array</param> public Augur(string name, int power, RuleBook origin, byte page, int det = 0, String special = null, Quality quality = Quality.Common, int sp = 0, int man = 0, int bs = 0, int mining = 0, int creed = 0, int military = 0, int trade = 0, int criminal = 0, int exploration = 0, ComponentOrigin comp = ComponentOrigin.Standard, Condition cond = Condition.Intact) : base(name, sp, power, 0, special, origin, page, HullType.All, quality, comp, cond) { this.Manoeuvrability = man; this.DetectionRating = det; this.BSModifier = bs; this.MiningObjective = mining; this.CreedObjective = creed; this.MilitaryObjective = military; this.TradeObjective = trade; this.CriminalObjective = criminal; this.ExplorationObjective = exploration; }
/// <summary> /// Create new augur array /// </summary> /// <param name="name">name of augur arrray</param> /// <param name="power">power used by this array</param> /// <param name="origin">rulebook containign this array</param> /// <param name="page">page this array can be found on</param> /// <param name="det">detection rating modifier of this array</param> /// <param name="special">special rules of this array</param> /// <param name="quality">quality of this array</param> /// <param name="sp">cost of this array</param> /// <param name="man">manoeuvrability modifier of this array</param> /// <param name="bs">ballistic skill modifier of this array</param> public Augur(string name, int power, RuleBook origin, byte page, int det = 0, String special = null, Quality quality = Quality.Common, int sp = 0, int man = 0, int bs = 0, int mining = 0, int creed = 0, int military = 0, int trade = 0, int criminal = 0, int exploration = 0, ComponentOrigin comp = ComponentOrigin.Standard, Condition cond = Condition.Intact) : base(name, sp, power, 0, special, origin, page, HullType.All, quality,comp,cond) { this.Manoeuvrability = man; this.DetectionRating = det; this.BSModifier = bs; this.MiningObjective = mining; this.CreedObjective = creed; this.MilitaryObjective = military; this.TradeObjective = trade; this.CriminalObjective = criminal; this.ExplorationObjective = exploration; }
public void Initialize(String XMLFile, bool isHost, Frame_Game frame, Monirator m, GameSimulator s, NetworkManager n, CommandRequester r) { TileMap map = new TileMap(); RuleBook rulebook = new RuleBook(); rulebook.LoadXMLData(XMLFile); monirator = m; simulator = s; NetworkController = n; CmdRequester = r; simulator.Initialize(map); monirator.Initialize(map, rulebook); HostSession = isHost; frame.AddUnitEvent += new EventHandler(CmdRequester.AddButtonHandler); }
/// <summary> /// Create a new bridge /// </summary> /// <param name="name">name of teh component</param> /// <param name="types">ships which can use this bridge</param> /// <param name="power">power used by this bridge</param> /// <param name="space">space used by this bridge</param> /// <param name="origin">rulebook containing this bridge</param> /// <param name="page">page this bridge can be found on</param> /// <param name="special">special rules for this bridge</param> /// <param name="sp">cost of this bridge</param> /// <param name="quality">quality of this bridge</param> /// <param name="man">manoeuvrability modifier of this bridge</param> /// <param name="bs">ballistic skill modifier of this bridge</param> /// <param name="command">command modifier of this bridge</param> /// <param name="repair">modifier to repair tests from this bridge</param> /// <param name="pilot">modifier to pilot tests from this bridge</param> /// <param name="navigate">modifier to navigate the warp from this bridge</param> public Bridge(string name, HullType types, int power, int space, RuleBook origin, byte page, string special = null, int sp = 0, Quality quality = Quality.Common, int man = 0, int bs = 0, int command = 0, int repair = 0, int pilot = 0, int navigate = 0, ComponentOrigin comp = ComponentOrigin.Standard, int mining = 0, int creed = 0, int military = 0, int trade = 0, int criminal = 0, int exploration = 0, Condition cond = Condition.Intact) : base(name, sp, power, space, special, origin, page, types, quality, comp, cond) { this.Manoeuvrability = man; this.BSModifier = bs; this.Command = command; this.Repair = repair; this.Pilot = pilot; this.Repair = repair; this.MiningObjective = mining; this.CreedObjective = creed; this.MilitaryObjective = military; this.TradeObjective = trade; this.CriminalObjective = criminal; this.ExplorationObjective = exploration; }
/// <summary> /// Create a new supplemental Component /// </summary> /// <param name="name">name of the component</param> /// <param name="types">Classes of ship that can use this component</param> /// <param name="power">power used or granted by this component</param> /// <param name="space">space used by this component</param> /// <param name="sp">cost of this component</param> /// <param name="origin">rulebook this component is found in</param> /// <param name="page">page number to find this component</param> /// <param name="special">special rules of the component</param> /// <param name="quality">quality of the component</param> /// <param name="speed">speed modifier of the component</param> /// <param name="man">manoeuvrability modifier of the component</param> /// <param name="hullint">hull integrity modifier of the component</param> /// <param name="armour">armour modifier of the component</param> /// <param name="turrets">turret modifier of the component</param> /// <param name="morale">morale modifier of the component</param> /// <param name="crew">crew population modifier of the component</param> /// <param name="prowArmour">armour modifier to only the prow from this component</param> /// <param name="ramming">Additional damage dealt by ramming with this component</param> /// <param name="crewRating">Bonus or penalty to crew rating</param> /// <param name="mining">modifier to mining objectives</param> /// <param name="creed">modifier to creed objectives</param> /// <param name="military">modifier to military objectives</param> /// <param name="trade">modifier to trade objectives</param> /// <param name="criminal">modifier to criminal objectives</param> /// <param name="exploration">modifier to exploration objectives</param> /// <param name="generated">If the power listed is generated instead of used</param> /// <param name="detection">modifier to detection rating fromt he component</param> /// <param name="aux">Auxiliary weapons like hold landing bay granted by this component</param> /// <param name="macrodamage">damage modifier to macrobatteries such as from the munitorium</param> /// <param name="bs">ballistic skill modifier from this component</param> /// <param name="navigate">modifer to navigate the warp</param> /// <param name="crewLoss">modifier to crew losses</param> /// <param name="moraleLoss">modifier to morale losses</param> public Supplemental(string name, HullType types, int power, int space, int sp, RuleBook origin, byte page, DiceRoll ramming, String special = null, Quality quality = Quality.Common, int speed = 0, int man = 0, int hullint = 0, int armour = 0, int turrets = 0, int morale = 0, int crew = 0, int prowArmour = 0, int crewRating = 0, int mining = 0, int creed = 0, int military = 0, int trade = 0, int criminal = 0, int exploration = 0, bool generated = false, int detection = 0, Weapon aux = null, int macrodamage = 0, int bs = 0, int navigate = 0, int crewLoss = 0, int moraleLoss = 0, ComponentOrigin comp = ComponentOrigin.Standard, string replace = null, int max = 0, Condition cond = Condition.Intact) : base(name, sp, power, space, special, origin, page, types, quality, comp, cond) { this.Speed = speed; this.Manoeuvrability = man; this.HullIntegrity = hullint; this.Armour = armour; this.TurretRating = turrets; this.Morale = morale; this.CrewPopulation = crew; this.ProwArmour = prowArmour; this.RamDamage = ramming; this.CrewRating = crewRating; this.MiningObjective = mining; this.CreedObjective = creed; this.MilitaryObjective = military; this.TradeObjective = trade; this.CriminalObjective = criminal; this.ExplorationObjective = exploration; this.PowerGenerated = generated; this.DetectionRating = detection; this.AuxiliaryWeapon = aux; this.MacrobatteryModifier = macrodamage; this.BSModifier = bs; this.NavigateWarp = navigate; this.CrewLoss = crewLoss; this.MoraleLoss = moraleLoss; this.Replace = replace; this.Max = max; }
/// <summary> /// Create a new gellar field /// </summary> /// <param name="name">name of the gellar field</param> /// <param name="types">hull classes which may use this field</param> /// <param name="power">power used by this field</param> /// <param name="special">special rules of this field</param> /// <param name="origin">rulebook which contains this field</param> /// <param name="page">page number to find this field on</param> /// <param name="sp">cost of this field</param> /// <param name="navigate">modifier to navigate the warp</param> public GellarField(string name, HullType types, int power, string special, RuleBook origin, byte page, int sp = 0, int navigate = 0, Quality quality = Quality.Common, ComponentOrigin comp = ComponentOrigin.Standard, Condition cond = Condition.Intact) : base(name, sp, power, 0, special, origin, page, types, quality, comp, cond) { this.NavigateWarp = navigate; }
/// <summary> /// Create a new Crew Quarters /// </summary> /// <param name="name">name of the crew quarters</param> /// <param name="types">classes of ship which can use this component</param> /// <param name="power">power used by this component</param> /// <param name="space">space used by this component</param> /// <param name="morale">morale modifier of this component</param> /// <param name="origin">rulebook containing this component</param> /// <param name="page">page this component can be found on</param> /// <param name="special">special rules for this component</param> /// <param name="quality">quality of this component</param> /// <param name="sp">cost of this component</param> /// <param name="loss">modifier to morale loss granted by this component</param> public CrewQuarters(string name, HullType types, int power, int space, int morale, RuleBook origin, byte page, string special = null, Quality quality = Quality.Common, int sp = 0, int loss = 0, ComponentOrigin comp = ComponentOrigin.Standard, Condition cond = Condition.Intact) : base(name, types, power, space, morale, origin, page, special, quality, sp, loss, comp, cond) { }
/// <summary> /// Createa new void shield /// </summary> /// <param name="name">name of the void shields</param> /// <param name="types">ship classes which can use these shields</param> /// <param name="power">power these shield use</param> /// <param name="space">space that these shields use</param> /// <param name="str">shield strength of these shields</param> /// <param name="origin">rulebook containing these shields</param> /// <param name="page">page number to find these shields</param> /// <param name="special">special rules for these shields</param> /// <param name="quality">quality of these shields</param> /// <param name="sp">cost of these shields</param> public VoidShield(string name, HullType types, int power, int space, int str, RuleBook origin, byte page, string special = null, Quality quality = Quality.Common, int sp = 0, ComponentOrigin comp = ComponentOrigin.Standard, Condition cond = Condition.Intact) : base(name, sp, power, space, special, origin, page, types, quality, comp, cond) { this.Strength = str; }
/// <summary> /// Create a new supplemental Component /// </summary> /// <param name="name">name of the supplemental component</param> /// <param name="types">Classes of ship that can use this component</param> /// <param name="power">power used or granted by this component</param> /// <param name="space">space used by this component</param> /// <param name="sp">cost of this component</param> /// <param name="origin">rulebook this component is found in</param> /// <param name="page">page number to find this component</param> /// <param name="ramming">Additional damage dealt by ramming with this component</param> /// <param name="special">special rules of the component</param> /// <param name="quality">quality of the component</param> /// <param name="speed">speed modifier of the component</param> /// <param name="man">manoeuvrability modifier of the component</param> /// <param name="hullint">hull integrity modifier of the component</param> /// <param name="armour">armour modifier of the component</param> /// <param name="turrets">turret modifier of the component</param> /// <param name="morale">morale modifier of the component</param> /// <param name="crew">crew population modifier of the component</param> /// <param name="prowArmour">armour modifier to only the prow from this component</param> /// <param name="crewRating">Bonus or penalty to crew rating</param> /// <param name="mining">modifier to mining objectives</param> /// <param name="creed">modifier to creed objectives</param> /// <param name="military">modifier to military objectives</param> /// <param name="trade">modifier to trade objectives</param> /// <param name="criminal">modifier to criminal objectives</param> /// <param name="exploration">modifier to exploration objectives</param> /// <param name="generated">If the power listed is generated instead of used</param> /// <param name="detection">modifier to detection rating fromt he component</param> /// <param name="aux">Auxiliary weapons like hold landing bay granted by this component</param> /// <param name="macrodamage">damage modifier to macrobatteries such as from the munitorium</param> /// <param name="bs">ballistic skill modifier from this component</param> /// <param name="navigate">modifer to navigate the warp</param> /// <param name="crewLoss">modifier to crew losses</param> /// <param name="moraleLoss">modifier to morale losses</param> public Supplemental(string name, HullType types, int power, int space, int sp, RuleBook origin, byte page, String ramming = null, String special = null, Quality quality = Quality.Common, int speed = 0, int man = 0, int hullint = 0, int armour = 0, int turrets = 0, int morale = 0, int crew = 0, int prowArmour = 0, int crewRating = 0, int mining = 0, int creed = 0, int military = 0, int trade = 0, int criminal = 0, int exploration = 0, bool generated = false, int detection = 0, Weapon aux = null, int macrodamage = 0, int bs = 0, int navigate = 0, int crewLoss = 0, int moraleLoss = 0, ComponentOrigin comp = ComponentOrigin.Standard, string replace = null, int max = 0, Condition cond = Condition.Intact) : this(name, types, power, space, sp, origin, page, new DiceRoll(ramming), special, quality, speed, man, hullint, armour, turrets, morale, crew, prowArmour, crewRating, mining, creed, military, trade, criminal, exploration, generated, detection, aux, macrodamage, bs, navigate, crewLoss, moraleLoss, comp, replace, max, cond) { }
/// <summary> /// Create a new Warp Drive /// </summary> /// <param name="name">name of the warp drive</param> /// <param name="types">Types which can use this drive</param> /// <param name="power">power used by this drive</param> /// <param name="space">space used by this drive</param> /// <param name="origin">rulebook containing this drive</param> /// <param name="page">page to find this drive on</param> /// <param name="sp">cost of this drive</param> /// <param name="special">special rules of this drive</param> /// <param name="quality">quality of this drive</param> public WarpDrive(string name, HullType types, int power, int space, RuleBook origin, byte page, int sp = 0, string special = null, Quality quality = Quality.Common, ComponentOrigin comp = ComponentOrigin.Standard, Condition cond = Condition.Intact) : base(name, sp, power, space, special, origin, page, types, quality, comp, cond) { }