Пример #1
0
    public static int getRepairDroidSlots(this HullType type)
    {
        switch (type)
        {
        case HullType.LITTLE:
        case HullType.NEEDLE:
        case HullType.GNOME:
        case HullType.CRICKET:
        case HullType.ARGO:
        case HullType.FALCON: return(1);

        case HullType.ADVENTURER:
        case HullType.CORVETTE:
        case HullType.BUFFALO:
        case HullType.LEGIONNAIRE: return(2);

        case HullType.STARWALKER:
        case HullType.WARSHIP:
        case HullType.ASTERIX:
        case HullType.PRIME: return(3);

        case HullType.TITAN:
        case HullType.DREADNAUT:
        case HullType.ARMAGEDDON: return(4);

        default: return(0);
        }
    }
Пример #2
0
 /// <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)
 {
 }
Пример #3
0
 //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. &lt;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);
 }
Пример #4
0
 /// <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)
 {
 }
Пример #5
0
 /// <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;
 }
Пример #6
0
        internal HullInfo(HullType hullType, int level)
        {
            this.Type  = hullType;
            this.Level = level;

            this.levelVar = new Var(AComponentType.LevelKey, level).Get;
        }
Пример #7
0
 /// <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);
 }
Пример #8
0
 /// <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);
 }
 // Some of the bridges need to be initialized with a specific hull type.
 public Bridges(HullType inHull)
 {
     combatBridge = new CombatBridge(inHull);
     commandBridge = new CommandBridge(inHull);
     commerceBridge = new CommerceBridge(inHull);
     armoredCommandBridge = new ArmoredCommandBridge(inHull);
     shipMasterBridge = new ShipMasterBridge(inHull);
 }
Пример #10
0
 /// <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;
 }
Пример #11
0
 public void setHullType(HullType hullType, int health)
 {
     this.hullType = hullType;
     setSlotPositions();
     setSlotAvailables();
     setHullSprite();
     setCurrentHealth(health);
 }
Пример #12
0
 /// <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;
 }
Пример #13
0
        internal SpecialEquipInfo(SpecialEquipmentType type, int level, HullType shipHull)
        {
            this.Type  = type;
            this.Level = level;

            this.vars = new Var(AComponentType.LevelKey, level).
                        And(HullType.SizeKey, shipHull.Size).Get;
        }
Пример #14
0
 /// <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];
 }
Пример #15
0
 /// <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];
 }
Пример #16
0
    private void refreshMarket()
    {
        Array types = Enum.GetValues(typeof(HullType));

        foreach (HullDisplay display in displays)
        {
            HullType type = (HullType)types.GetValue(UnityEngine.Random.Range(0, types.Length - 1));
            display.setHull(type, getHullSprite(type));
        }
    }
Пример #17
0
 /// <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)
 {
 }
Пример #18
0
 /// <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;
 }
Пример #19
0
 /// <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;
 }
Пример #20
0
 public void setHull(HullType hullType, Sprite image)
 {
     this.hullType         = hullType;
     hullImage.sprite      = image;
     hullName.text         = hullType.getName();
     hullHealth.text       = "HP: " + hullType.getMaxHealth();
     weaponCount.text      = hullType.getWeaponSlots().ToString();
     armorCount.text       = hullType.getArmorSlots().ToString();
     shieldCount.text      = hullType.getShieldSlots().ToString();
     generatorCount.text   = hullType.getGeneratorSlots().ToString();
     repairDroidCount.text = hullType.getRepairDroidSlots().ToString();
     harvesterCount.text   = hullType.getHarvesterSlots().ToString();
     updateCost();
 }
Пример #21
0
        public void AddHull(HullType type, PhysicMaterial material, bool isTrigger)
        {
            hulls.Add(new Hull());

            // Name the new hull
            hulls [hulls.Count - 1].name = "Hull " + hulls.Count;

            // Set selection to new hull
            activeHull = hulls.Count - 1;

            // Set the colour for the new hull
            hulls[hulls.Count - 1].colour    = hullColours[activeHull % hullColours.Length];
            hulls[hulls.Count - 1].type      = type;
            hulls[hulls.Count - 1].material  = material;
            hulls[hulls.Count - 1].isTrigger = isTrigger;
        }
Пример #22
0
    public static Vector3 getSlotPosition(HullType hullType, Type slotType, int index)
    {
        if (slotPositions == null)
        {
            slotPositions = new Dictionary <HullType, List <Vector3> >();
            foreach (HullType hType in Enum.GetValues(typeof(HullType)))
            {
                List <Vector3> pos = new List <Vector3>();
                fillPositions(hType, pos);
                slotPositions.Add(hType, pos);
            }
        }

        List <Vector3> points = slotPositions[hullType];

        return(points[getStartIndex(slotType) + index]);
    }
Пример #23
0
    public static bool checkSlotAvailability(HullType hullType, HullSlot.Type slotType, int index)
    {
        if (slotAvailables == null)
        {
            slotAvailables = new Dictionary <HullType, List <bool> >();
            foreach (HullType hType in Enum.GetValues(typeof(HullType)))
            {
                List <bool> avail = new List <bool>();
                fillAvailable(hType, avail);
                slotAvailables.Add(hType, avail);
            }
        }

        List <bool> avails = slotAvailables[hullType];

        return(avails[getStartIndex(slotType) + index]);
    }
Пример #24
0
        /// <summary>
        /// Pretty print Hulltype bit array
        /// </summary>
        /// <param name="self">Hulltype to print</param>
        /// <returns>Pretty printed names of the hull classes</returns>
        public static string AllHulls(this HullType self)
        {
            StringBuilder output = new StringBuilder();

            HullType[] toPrint = self.GetFlags().Cast <HullType>().ToArray();
            for (int i = 0; i < toPrint.Length; i++)
            {
                if (toPrint[i] != HullType.None && toPrint[i] != HullType.CruiserPlus && toPrint[i] != HullType.AllCruiser && toPrint[i] != HullType.All)
                {
                    if (output.Length != 0)
                    {
                        output.Append(", ");
                    }
                    output.Append(toPrint[i].HighName());
                }
            }
            return(output.ToString());
        }
Пример #25
0
 public HullData RandomHull(HullType type, Predicate <HullData> hullFilter = null)
 {
     return(ItemManager.ItemData.GetAll <HullData>()
            .Where(item =>
                   item.Price > 0 &&
                   (hullFilter?.Invoke(item) ?? true) &&
                   item.HullType == type &&
                   item.Manufacturer != Guid.Empty &&
                   (Galaxy?.ContainsFaction(item.Manufacturer) ?? true) &&
                   (Faction == null || item.Manufacturer == Faction.ID || Faction.Allegiance.ContainsKey(item.Manufacturer)))
            .WeightedRandomElements(ref Random,
                                    item =>
                                    (Faction == null || item.Manufacturer == Faction.ID ? 1 : Faction.Allegiance[item.Manufacturer]) / // Prioritize items from allied manufacturers
                                    (Zone?.Distance[Galaxy.HomeZones[ItemManager.ItemData.Get <Faction>(item.Manufacturer)]] ?? 1) /   // Penalize distance to manufacturer headquarters
                                    pow(item.Price, PriceExponent),                                                                    // Penalize item price to a controllable degree
                                    1
                                    ).FirstOrDefault());
 }
Пример #26
0
 /// <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;
 }
Пример #27
0
    public ArmoredCommandBridge(HullType hull)
    {
        allowableHulls.Add(HullType.Raider);
        allowableHulls.Add(HullType.Frigate);
        allowableHulls.Add(HullType.LightCruiser);
        allowableHulls.Add(HullType.Cruiser);
        bitIndex = ShipComponentEffects.ARMORED_BRIDGE;

        if ((hull == HullType.LightCruiser) || (hull == HullType.Cruiser))
        {
            powerCost = 3;
            spaceCost = 2;
        }
        else
        {
            powerCost = 2;
            spaceCost = 2;
        }
    }
Пример #28
0
 /// <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;
 }
Пример #29
0
        private void DrawDefaultType(float[] collumnWidths)
        {
            HullPainter currentHullPainter = sceneManipulator.GetCurrentHullPainter();

            GUILayout.BeginHorizontal();
            {
                GUILayout.Label("Default type:", GUILayout.Width(collumnWidths[0]));

                defaultType = (HullType)EditorGUILayout.EnumPopup(defaultType, GUILayout.Width(100));

                GUILayout.Label("", GUILayout.Width(collumnWidths[1] - 100));

                if (GUILayout.Button("Apply To All", GUILayout.Width(collumnWidths[2])))
                {
                    currentHullPainter.SetAllTypes(defaultType);
                }
            }
            GUILayout.EndHorizontal();
        }
Пример #30
0
    public static int getMaxHealth(this HullType type)
    {
        switch (type)
        {
        case HullType.LITTLE:           return(70);

        case HullType.NEEDLE:           return(100);

        case HullType.GNOME:            return(120);

        case HullType.CRICKET:          return(150);

        case HullType.ARGO:             return(300);

        case HullType.FALCON:           return(400);

        case HullType.ADVENTURER:       return(450);

        case HullType.CORVETTE:         return(550);

        case HullType.BUFFALO:          return(800);

        case HullType.LEGIONNAIRE:      return(900);

        case HullType.STARWALKER:       return(1050);

        case HullType.WARSHIP:          return(1200);

        case HullType.ASTERIX:          return(1400);

        case HullType.PRIME:            return(2000);

        case HullType.TITAN:            return(2500);

        case HullType.DREADNAUT:        return(3200);

        case HullType.ARMAGEDDON:       return(3800);

        default: return(0);
        }
    }
Пример #31
0
    private Sprite getHullSprite(HullType type)
    {
        switch (type)
        {
        case HullType.LITTLE: return(hullImages[0]);

        case HullType.NEEDLE: return(hullImages[1]);

        case HullType.GNOME: return(hullImages[2]);

        case HullType.CRICKET: return(hullImages[3]);

        case HullType.ARGO: return(hullImages[4]);

        case HullType.FALCON: return(hullImages[5]);

        case HullType.ADVENTURER: return(hullImages[6]);

        case HullType.CORVETTE: return(hullImages[7]);

        case HullType.BUFFALO: return(hullImages[8]);

        case HullType.LEGIONNAIRE: return(hullImages[9]);

        case HullType.STARWALKER: return(hullImages[10]);

        case HullType.WARSHIP: return(hullImages[11]);

        case HullType.ASTERIX: return(hullImages[12]);

        case HullType.PRIME: return(hullImages[13]);

        case HullType.TITAN: return(hullImages[14]);

        case HullType.DREADNAUT: return(hullImages[15]);

        case HullType.ARMAGEDDON: return(hullImages[16]);

        default: Debug.Log("Unknown hull type: " + type); return(null);
        }
    }
Пример #32
0
    public static int getStorageCapacity(this HullType type)
    {
        switch (type)
        {
        case HullType.LITTLE:           return(10);

        case HullType.NEEDLE:           return(14);

        case HullType.GNOME:            return(18);

        case HullType.CRICKET:          return(22);

        case HullType.ARGO:             return(28);

        case HullType.FALCON:           return(34);

        case HullType.ADVENTURER:       return(40);

        case HullType.CORVETTE:         return(48);

        case HullType.BUFFALO:          return(56);

        case HullType.LEGIONNAIRE:      return(64);

        case HullType.STARWALKER:       return(74);

        case HullType.WARSHIP:          return(86);

        case HullType.ASTERIX:          return(100);

        case HullType.PRIME:            return(120);

        case HullType.TITAN:            return(140);

        case HullType.DREADNAUT:        return(170);

        case HullType.ARMAGEDDON:       return(200);

        default: return(0);
        }
    }
Пример #33
0
    public static int cost(this HullType type)
    {
        switch (type)
        {
        case HullType.LITTLE:           return(100);

        case HullType.NEEDLE:           return(200);

        case HullType.GNOME:            return(240);

        case HullType.CRICKET:          return(300);

        case HullType.ARGO:             return(600);

        case HullType.FALCON:           return(800);

        case HullType.ADVENTURER:       return(900);

        case HullType.CORVETTE:         return(1100);

        case HullType.BUFFALO:          return(1600);

        case HullType.LEGIONNAIRE:      return(1800);

        case HullType.STARWALKER:       return(2100);

        case HullType.WARSHIP:          return(2400);

        case HullType.ASTERIX:          return(2800);

        case HullType.PRIME:            return(4000);

        case HullType.TITAN:            return(5000);

        case HullType.DREADNAUT:        return(6400);

        case HullType.ARMAGEDDON:       return(7600);

        default: return(0);
        }
    }
Пример #34
0
    public static string getName(this HullType type)
    {
        switch (type)
        {
        case HullType.LITTLE: return("Малыш");

        case HullType.NEEDLE: return("Игла");

        case HullType.GNOME: return("Гном");

        case HullType.CRICKET: return("Сверчёк");

        case HullType.ARGO: return("Арго");

        case HullType.FALCON: return("Фалкон");

        case HullType.ADVENTURER: return("Авантюрист");

        case HullType.CORVETTE: return("Корвет");

        case HullType.BUFFALO: return("Буйвол");

        case HullType.LEGIONNAIRE: return("Легионер");

        case HullType.STARWALKER: return("Звёздоход");

        case HullType.WARSHIP: return("Воршип");

        case HullType.ASTERIX: return("Астерикс");

        case HullType.PRIME: return("Прайм");

        case HullType.TITAN: return("Титан");

        case HullType.DREADNAUT: return("Дреднаут");

        case HullType.ARMAGEDDON: return("Армагеддон");

        default: return("Неизвестный тип корпуса");
        }
    }
Пример #35
0
 /// <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;
 }
Пример #36
0
 /// <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;
 }
Пример #37
0
 /// <summary>
 /// Returns the highest Hulltype for checking what the main type of a hull is
 /// </summary>
 /// <param name="self">Hulltype to check</param>
 /// <returns>The single highest bit of the hulltype</returns>
 public static HullType Priority(this HullType self)
 {
     if ((self & HullType.BattleShip) != 0)
     {
         return(HullType.BattleShip);
     }
     if ((self & HullType.GrandCruiser) != 0)
     {
         return(HullType.GrandCruiser);
     }
     if ((self & HullType.BattleCruiser) != 0)
     {
         return(HullType.BattleCruiser);
     }
     if ((self & HullType.Cruiser) != 0)
     {
         return(HullType.Cruiser);
     }
     if ((self & HullType.LightCruiser) != 0)
     {
         return(HullType.LightCruiser);
     }
     if ((self & HullType.Frigate) != 0)
     {
         return(HullType.Frigate);
     }
     if ((self & HullType.Raider) != 0)
     {
         return(HullType.Raider);
     }
     if ((self & HullType.Transport) != 0)
     {
         return(HullType.Transport);
     }
     return(HullType.None);
 }
Пример #38
0
 /// <summary>
 /// Returns the display name of the highest Hulltype for naming ship classes
 /// </summary>
 /// <param name="self">Hulltype to display</param>
 /// <returns>Display name of HullType</returns>
 public static string HighName(this HullType self)
 {
     if ((self & HullType.BattleShip) != 0)
     {
         return("Battleship");
     }
     if ((self & HullType.GrandCruiser) != 0)
     {
         return("Grand Cruiser");
     }
     if ((self & HullType.BattleCruiser) != 0)
     {
         return("Battlecruiser");
     }
     if ((self & HullType.Cruiser) != 0)
     {
         return("Cruiser");
     }
     if ((self & HullType.LightCruiser) != 0)
     {
         return("Light Cruiser");
     }
     if ((self & HullType.Frigate) != 0)
     {
         return("Frigate");
     }
     if ((self & HullType.Raider) != 0)
     {
         return("Raider");
     }
     if ((self & HullType.Transport) != 0)
     {
         return("Transport");
     }
     return(null);
 }
Пример #39
0
 public ShipMasterBridge(HullType hull)
 {
     allowableHulls.Add(HullType.Cruiser);
     bitIndex = ShipComponentEffects.SHIP_MASTERS_BRIDGE;
     powerCost = 4;
     spaceCost = 3;
 }
Пример #40
0
    public PressedCrewQuarters(HullType hull)
    {
        allowableHulls.Add(HullType.All);
        bitIndex = ShipComponentEffects.PRESSED_CREW_QUARTERS;

        // Power and space costs depend on the type of hull!
        if ((hull == HullType.LightCruiser) || (hull == HullType.Cruiser))
        {
            powerCost = 2;
            spaceCost = 3;
        }
        else
        {
            powerCost = 1;
            spaceCost = 2;
        }
    }
Пример #41
0
 /// <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;
 }
Пример #42
0
    public M1LifeSustainer(HullType hull)
    {
        allowableHulls.Add(HullType.All);
        bitIndex = ShipComponentEffects.MARK1_LIFE_SUSTAINER;

        // Power and space costs depend on the type of hull!
        if ((hull == HullType.LightCruiser) || (hull == HullType.Cruiser))
        {
            powerCost = 4;
            spaceCost = 2;
        }
        else
        {
            powerCost = 3;
            spaceCost = 1;
        }
    }
Пример #43
0
 public CommerceBridge(HullType hull)
 {
     allowableHulls.Add(HullType.Transport);
     bitIndex = ShipComponentEffects.COMMERCE_BRIDGE;
     powerCost = 1;
     spaceCost = 1;
 }
Пример #44
0
 /// <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)
 {
 }
Пример #45
0
 public EntityTypeRestrictionAttribute(HullType type)
 {
     Type = type;
 }
Пример #46
0
 /// <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)
 {
 }
Пример #47
0
 /// <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)
 {
 }
Пример #48
0
    public VitaePatternLifeSustainer(HullType hull)
    {
        allowableHulls.Add(HullType.All);

        // Power and space costs depend on the type of hull!
        if ((hull == HullType.LightCruiser) || (hull == HullType.Cruiser))
        {
            powerCost = 5;
            spaceCost = 3;
        }
        else
        {
            powerCost = 4;
            spaceCost = 2;
        }
    }
Пример #49
0
    public VoidsmenQuarters(HullType hull)
    {
        allowableHulls.Add(HullType.All);

        // Power and space costs depend on the type of hull!
        if ((hull == HullType.LightCruiser) || (hull == HullType.Cruiser))
        {
            powerCost = 2;
            spaceCost = 4;
        }
        else
        {
            powerCost = 1;
            spaceCost = 3;
        }
    }
Пример #50
0
 public NovaCannon(String name, HullType hulls, int power, int space, int sp,
                   int range, RuleBook origin, byte page, string damage = null, string special = null, Quality quality    = Quality.Common,
                   WeaponQuality wq = WeaponQuality.None, ComponentOrigin comp = ComponentOrigin.Standard, Condition cond = Condition.Intact, int ammo = 0)
     : this(name, hulls, power, space, sp, new DiceRoll(damage), range, origin, page, special, quality, wq, comp, cond, ammo)
 {
 }
Пример #51
0
    public CombatBridge(HullType hull)
    {
        allowableHulls.Add(HullType.All);
        bitIndex = ShipComponentEffects.COMBAT_BRIDGE;

        if ((hull == HullType.LightCruiser) || (hull == HullType.Cruiser))
        {
            powerCost = 2;
            spaceCost = 2;
        }
        else
        {
            powerCost = 1;
            spaceCost = 1;
        }
    }
Пример #52
0
 /// <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;
 }
 // Some of the life sustainers need to be initialized with a specific hull type.
 public LifeSustainers(HullType inHull)
 {
     m1LifeSustainer = new M1LifeSustainer(inHull);
     vitaePatternLifeSustainer = new VitaePatternLifeSustainer(inHull);
 }
Пример #54
0
    public void initializeRandomShip(HullType initType)
    {
        if (initialized)
        {
            return;
        }

        setHullType(initType, initType.getMaxHealth());

        int generatorSlots = hullType.getGeneratorSlots();
        int harvesterSlots = hullType.getHarvesterSlots();
        int repairDroids   = hullType.getRepairDroidSlots();
        int shieldSlots    = hullType.getShieldSlots();
        int weaponSlots    = hullType.getWeaponSlots();
        int armorSlots     = hullType.getArmorSlots();

        Item radar = null, engine = null, generator_1 = null, generator_2 = null, generator_3 = null,
             harvester_1 = null, harvester_2 = null,
             repairDroid_1 = null, repairDroid_2 = null, repairDroid_3 = null, repairDroid_4 = null,
             shield_1 = null, shield_2 = null, shield_3 = null,
             weapon_1 = null, weapon_2 = null, weapon_3 = null, weapon_4 = null, weapon_5 = null,
             armor_1 = null, armor_2 = null, armor_3 = null, armor_4 = null, armor_5 = null;

        radar  = Instantiate <Transform>(ItemFactory.itemPrefab).GetComponent <Item>();
        engine = Instantiate <Transform>(ItemFactory.itemPrefab).GetComponent <Item>();
        if (generatorSlots >= 1)
        {
            generator_1 = Instantiate <Transform>(ItemFactory.itemPrefab).GetComponent <Item>();
        }
        if (generatorSlots >= 2)
        {
            generator_2 = Instantiate <Transform>(ItemFactory.itemPrefab).GetComponent <Item>();
        }
        if (generatorSlots >= 3)
        {
            generator_3 = Instantiate <Transform>(ItemFactory.itemPrefab).GetComponent <Item>();
        }
        if (harvesterSlots >= 1)
        {
            harvester_1 = Instantiate <Transform>(ItemFactory.itemPrefab).GetComponent <Item>();
        }
        if (harvesterSlots >= 2)
        {
            harvester_2 = Instantiate <Transform>(ItemFactory.itemPrefab).GetComponent <Item>();
        }
        if (repairDroids >= 1)
        {
            repairDroid_1 = Instantiate <Transform>(ItemFactory.itemPrefab).GetComponent <Item>();
        }
        if (repairDroids >= 2)
        {
            repairDroid_2 = Instantiate <Transform>(ItemFactory.itemPrefab).GetComponent <Item>();
        }
        if (repairDroids >= 3)
        {
            repairDroid_3 = Instantiate <Transform>(ItemFactory.itemPrefab).GetComponent <Item>();
        }
        if (repairDroids >= 4)
        {
            repairDroid_4 = Instantiate <Transform>(ItemFactory.itemPrefab).GetComponent <Item>();
        }
        if (shieldSlots >= 1)
        {
            shield_1 = Instantiate <Transform>(ItemFactory.itemPrefab).GetComponent <Item>();
        }
        if (shieldSlots >= 2)
        {
            shield_2 = Instantiate <Transform>(ItemFactory.itemPrefab).GetComponent <Item>();
        }
        if (shieldSlots >= 3)
        {
            shield_3 = Instantiate <Transform>(ItemFactory.itemPrefab).GetComponent <Item>();
        }
        if (weaponSlots >= 1)
        {
            weapon_1 = Instantiate <Transform>(ItemFactory.itemPrefab).GetComponent <Item>();
        }
        if (weaponSlots >= 2)
        {
            weapon_2 = Instantiate <Transform>(ItemFactory.itemPrefab).GetComponent <Item>();
        }
        if (weaponSlots >= 3)
        {
            weapon_3 = Instantiate <Transform>(ItemFactory.itemPrefab).GetComponent <Item>();
        }
        if (weaponSlots >= 4)
        {
            weapon_4 = Instantiate <Transform>(ItemFactory.itemPrefab).GetComponent <Item>();
        }
        if (weaponSlots >= 5)
        {
            weapon_5 = Instantiate <Transform>(ItemFactory.itemPrefab).GetComponent <Item>();
        }
        if (armorSlots >= 1)
        {
            armor_1 = Instantiate <Transform>(ItemFactory.itemPrefab).GetComponent <Item>();
        }
        if (armorSlots >= 2)
        {
            armor_2 = Instantiate <Transform>(ItemFactory.itemPrefab).GetComponent <Item>();
        }
        if (armorSlots >= 3)
        {
            armor_3 = Instantiate <Transform>(ItemFactory.itemPrefab).GetComponent <Item>();
        }
        if (armorSlots >= 4)
        {
            armor_4 = Instantiate <Transform>(ItemFactory.itemPrefab).GetComponent <Item>();
        }
        if (armorSlots >= 5)
        {
            armor_5 = Instantiate <Transform>(ItemFactory.itemPrefab).GetComponent <Item>();
        }

        getSlot(HullSlot.Type.RADAR, 0).setItem(radar);
        getSlot(HullSlot.Type.ENGINE, 0).setItem(engine);
        if (generatorSlots >= 1)
        {
            getSlot(HullSlot.Type.GENERATOR, 0).setItem(generator_1);
        }
        if (generatorSlots >= 2)
        {
            getSlot(HullSlot.Type.GENERATOR, 1).setItem(generator_2);
        }
        if (generatorSlots >= 3)
        {
            getSlot(HullSlot.Type.GENERATOR, 2).setItem(generator_3);
        }
        if (harvesterSlots >= 1)
        {
            getSlot(HullSlot.Type.HARVESTER, 0).setItem(harvester_1);
        }
        if (harvesterSlots >= 2)
        {
            getSlot(HullSlot.Type.HARVESTER, 1).setItem(harvester_2);
        }
        if (repairDroids >= 1)
        {
            getSlot(HullSlot.Type.REPAIR_DROID, 0).setItem(repairDroid_1);
        }
        if (repairDroids >= 2)
        {
            getSlot(HullSlot.Type.REPAIR_DROID, 1).setItem(repairDroid_2);
        }
        if (repairDroids >= 3)
        {
            getSlot(HullSlot.Type.REPAIR_DROID, 2).setItem(repairDroid_3);
        }
        if (repairDroids >= 4)
        {
            getSlot(HullSlot.Type.REPAIR_DROID, 3).setItem(repairDroid_4);
        }
        if (shieldSlots >= 1)
        {
            getSlot(HullSlot.Type.SHIELD, 0).setItem(shield_1);
        }
        if (shieldSlots >= 2)
        {
            getSlot(HullSlot.Type.SHIELD, 1).setItem(shield_2);
        }
        if (shieldSlots >= 3)
        {
            getSlot(HullSlot.Type.SHIELD, 2).setItem(shield_3);
        }
        if (weaponSlots >= 1)
        {
            getSlot(HullSlot.Type.WEAPON, 0).setItem(weapon_1);
        }
        if (weaponSlots >= 2)
        {
            getSlot(HullSlot.Type.WEAPON, 1).setItem(weapon_2);
        }
        if (weaponSlots >= 3)
        {
            getSlot(HullSlot.Type.WEAPON, 2).setItem(weapon_3);
        }
        if (weaponSlots >= 4)
        {
            getSlot(HullSlot.Type.WEAPON, 3).setItem(weapon_4);
        }
        if (weaponSlots >= 5)
        {
            getSlot(HullSlot.Type.WEAPON, 4).setItem(weapon_5);
        }
        if (armorSlots >= 1)
        {
            getSlot(HullSlot.Type.ARMOR, 0).setItem(armor_1);
        }
        if (armorSlots >= 2)
        {
            getSlot(HullSlot.Type.ARMOR, 1).setItem(armor_2);
        }
        if (armorSlots >= 3)
        {
            getSlot(HullSlot.Type.ARMOR, 2).setItem(armor_3);
        }
        if (armorSlots >= 4)
        {
            getSlot(HullSlot.Type.ARMOR, 3).setItem(armor_4);
        }
        if (armorSlots >= 5)
        {
            getSlot(HullSlot.Type.ARMOR, 4).setItem(armor_5);
        }

        radar.init(ItemFactory.createRadarData());
        engine.init(ItemFactory.createEngineData());
        if (generatorSlots >= 1)
        {
            generator_1.init(ItemFactory.createGeneratorData());
        }
        if (generatorSlots >= 2)
        {
            generator_2.init(ItemFactory.createGeneratorData());
        }
        if (generatorSlots >= 3)
        {
            generator_3.init(ItemFactory.createGeneratorData());
        }
        if (harvesterSlots >= 1)
        {
            harvester_1.init(ItemFactory.createHarvesterData());
        }
        if (harvesterSlots >= 2)
        {
            harvester_2.init(ItemFactory.createHarvesterData());
        }
        if (repairDroids >= 1)
        {
            repairDroid_1.init(ItemFactory.createRepairDroidData());
        }
        if (repairDroids >= 2)
        {
            repairDroid_2.init(ItemFactory.createRepairDroidData());
        }
        if (repairDroids >= 3)
        {
            repairDroid_3.init(ItemFactory.createRepairDroidData());
        }
        if (repairDroids >= 4)
        {
            repairDroid_4.init(ItemFactory.createRepairDroidData());
        }
        if (shieldSlots >= 1)
        {
            shield_1.init(ItemFactory.createShieldData());
        }
        if (shieldSlots >= 2)
        {
            shield_2.init(ItemFactory.createShieldData());
        }
        if (shieldSlots >= 3)
        {
            shield_3.init(ItemFactory.createShieldData());
        }
        if (weaponSlots >= 1)
        {
            weapon_1.init(ItemFactory.createWeaponData());
        }
        if (weaponSlots >= 2)
        {
            weapon_2.init(ItemFactory.createWeaponData());
        }
        if (weaponSlots >= 3)
        {
            weapon_3.init(ItemFactory.createWeaponData());
        }
        if (weaponSlots >= 4)
        {
            weapon_4.init(ItemFactory.createWeaponData());
        }
        if (weaponSlots >= 5)
        {
            weapon_5.init(ItemFactory.createWeaponData());
        }
        if (armorSlots >= 1)
        {
            armor_1.init(ItemFactory.createArmorData());
        }
        if (armorSlots >= 2)
        {
            armor_2.init(ItemFactory.createArmorData());
        }
        if (armorSlots >= 3)
        {
            armor_3.init(ItemFactory.createArmorData());
        }
        if (armorSlots >= 4)
        {
            armor_4.init(ItemFactory.createArmorData());
        }
        if (armorSlots >= 5)
        {
            armor_5.init(ItemFactory.createArmorData());
        }

        arrangeItemsToSlots();

        setCurrentShield(getShield());
        setCurrentHealth(hullType.getMaxHealth());
        calculateRepairCost();

        initialized = true;
    }
 // Some of the crew quarters need to be initialized with a specific hull type.
 public AllCrewQuarters(HullType inHull)
 {
     pressedCrewQuarters = new PressedCrewQuarters(inHull);
     voidsmenQuarters = new VoidsmenQuarters(inHull);
 }