Ejemplo n.º 1
0
        public static int GetArmourValue(ArmourType type)
        {
            switch (type)
            {
            case ArmourType.UNDEFINED:
                return(0);

            case ArmourType.BOOT:
                return(boot_dval);

            case ArmourType.SHINGUARD:
                return(shinguard_dval);

            case ArmourType.GREAVES:
                return(greaves_dval);

            case ArmourType.BREASTPLATE:
                return(breastplate_dval);

            case ArmourType.GAUNTLET:
                return(gauntlet_dval);

            case ArmourType.SHOULDERGUARD:
                return(shoulderguard_dval);

            case ArmourType.HELMET:
                return(helmet_dval);

            case ArmourType.SHIELD:
                return(shield_dval);

            default:
                return(0);
            }
        }
Ejemplo n.º 2
0
        public static IArmourItem GetArmour(ArmourType type)
        {
            switch (type)
            {
            case ArmourType.BOOT:
                return(new Boot());

            case ArmourType.SHINGUARD:
                return(new Shinguard());

            case ArmourType.GREAVES:
                return(new Greaves());

            case ArmourType.BREASTPLATE:
                return(new Breastplate());

            case ArmourType.GAUNTLET:
                return(new Gauntlet());

            case ArmourType.SHOULDERGUARD:
                return(new Shoulderguard());

            case ArmourType.HELMET:
                return(new Helmet());

            case ArmourType.SHIELD:
                return(new Shield());

            default:
                throw new ArgumentNullException("Undefined");
            }
        }
Ejemplo n.º 3
0
	public Item_Armour (string itemname = "", int lvlmin = 1, ArmourType type = ArmourType.HELMET, int itemdef = 1)
	{
		name = itemname;
		lvlMin = lvlmin;
		Type = type;
		def = itemdef;
	}
Ejemplo n.º 4
0
        public static Type GetArmourType(ArmourType type)
        {
            switch (type)
            {
            case ArmourType.UNDEFINED:
                return(null);

            case ArmourType.BOOT:
                return(typeof(Boot));

            case ArmourType.SHINGUARD:
                return(typeof(Shinguard));

            case ArmourType.GREAVES:
                return(typeof(Greaves));

            case ArmourType.BREASTPLATE:
                return(typeof(Breastplate));

            case ArmourType.GAUNTLET:
                return(typeof(Gauntlet));

            case ArmourType.SHOULDERGUARD:
                return(typeof(Shoulderguard));

            case ArmourType.HELMET:
                return(typeof(Helmet));

            case ArmourType.SHIELD:
                return(typeof(Shield));

            default:
                return(null);
            }
        }
Ejemplo n.º 5
0
    void ManageStats()
    {
        // Limiting the players health points
        if (m_PlayerHealth > 2)
        {
            m_PlayerHealth = 2;
        }
        if (m_PlayerHealth <= 0)
        {
            m_PlayerHealth = 0;
        }

        // Limiting the players armour points
        if (m_ArmourPoints > 3)
        {
            m_ArmourPoints = 3;
        }
        if (m_ArmourPoints <= 0)
        {
            m_ArmourPoints = 0;
            m_Armour       = ArmourType.None;
        }

        // Check for player death
        if (m_PlayerHealth <= 0 && "death" != SceneManager.GetActiveScene().name)
        {
            KillEntity();
        }
    }
        public static List <Prerequisite> GetPrerequisites(ArmourType key)
        {
            switch (key)
            {
            case ArmourType.None:
                return(new List <Prerequisite>());

            case ArmourType.Light:
                return(new List <Prerequisite>());

            case ArmourType.Medium:
                return(new List <Prerequisite>
                {
                    new Prerequisite("Strength: 2", c => c.Attribute.Strength >= 2)
                });

            case ArmourType.Heavy:
                return(new List <Prerequisite>
                {
                    new Prerequisite("Strength: 3", c => c.Attribute.Strength >= 3)
                });

            default:
                throw new ArgumentOutOfRangeException(nameof(key), key, null);
            }
        }
    //returns the damage (rounded to int) of the gun to the armour type passed in (with random variation too)
    public override int GetDamage(ArmourType armour)
    {
        float multiplier = Database.ArmourMultiplier(gunClass, armour, ammo);

        //clamp with max to keep number non-negative (due to random)
        return(Mathf.Max(0, ((int)((finalDamage * multiplier)) + Random.Range(-1, 3))));
    }
Ejemplo n.º 8
0
 public Armour(string name, int armourClass, int cost, bool useableByThieves, EquipsTo equipsTo, ArmourType type) : base(EquipmentCategory.Armour, name)
 {
     ArmourClass = armourClass;
     Cost = cost;
     UseableByThieves = useableByThieves;
     EquipsTo = equipsTo;
     Type = type;
 }
Ejemplo n.º 9
0
 public Armour(string name, int def, ArmourType armourType)
 {
     Name              = name;
     Def               = def;
     ArmourType        = armourType;
     _staticName       = name;
     _staticDef        = def;
     _staticArmourType = armourType;
 }
Ejemplo n.º 10
0
        public ArmourTypeInfo(ArmourType key, string name, int cost, string effect, int defence, int dr, List <Prerequisite> prerequisites, Character character)
        {
            Key             = key;
            Name            = name;
            Cost            = cost;
            Effect          = effect;
            Defence         = defence;
            DamageReduction = dr;

            Prerequisites = prerequisites.Select(p => new PrerequisiteInfo(p.Name, p.Func, character)).ToList();
        }
Ejemplo n.º 11
0
    /// <summary>
    ///     Remove an armour type
    /// </summary>
    /// <param name="armourType"> The type of armour to remove </param>
    public void UnequipArmour(ArmourType armourType)
    {
        switch (armourType)
        {
        case ArmourType.HEAD: HeadSlot = null; break;

        case ArmourType.BODY: BodySlot = null; break;

        case ArmourType.LEG: LegSlot = null; break;

        case ArmourType.SHIELD: ShieldSlot = null; break;
        }
    }
Ejemplo n.º 12
0
 public Armour(int _id, string _name, string _description, uint _value, ArmourType _type, EquipmentEffect _stats, int _level,
                 Uri _icon)
 {
     id = _id;
     name = _name;
     description = _description;
     value = _value;
     type = _type;
     stackable = false;
     _stats.modifyEffect(1 + (_level - 1) * ItemSet.levelMultipler);
     stats = _stats;
     level = _level;
     icon = _icon;
 }
Ejemplo n.º 13
0
    //sets ship's stats from loadoutData (includes its gun's stats too)
    public void Init(ShipLoadoutData loadoutData, string targetTag)
    {
        ShipData ship = loadoutData.Ship;

        this.targetTag = targetTag;

        gameObject.GetComponent <SpriteRenderer>().sprite = ship.Sprite;
        healthBar.color     = healthBarColour;
        gameObject.name     = ship.name;
        maxHealth           = ship.Health;
        speed               = ship.Speed;
        reload              = ship.Reload;
        firepower           = ship.Firepower;
        torpedo             = ship.Torpedo;
        armour              = ship.Armour;
        aviation            = ship.Aviation;
        accuracy            = ship.Accuracy;
        evasion             = ship.Evasion;
        luck                = ship.Luck;
        antiAir             = ship.AntiAir;
        slotMounts[0]       = ship.Slot1Mounts;
        slotMounts[1]       = ship.Slot2Mounts;
        slotMounts[2]       = ship.Slot3Mounts;
        slotEfficiencies[0] = ship.Slot1Efficiency;
        slotEfficiencies[1] = ship.Slot2Efficiency;
        slotEfficiencies[2] = ship.Slot3Efficiency;

        if (loadoutData.Slot1)
        {
            firepower += loadoutData.Slot1.Firepower;
            torpedo   += loadoutData.Slot1.Torpedo;
            antiAir   += loadoutData.Slot1.AntiAir;
        }
        if (loadoutData.Slot2)
        {
            firepower += loadoutData.Slot2.Firepower;
            torpedo   += loadoutData.Slot2.Torpedo;
            antiAir   += loadoutData.Slot2.AntiAir;
        }
        if (loadoutData.Slot3)
        {
            firepower += loadoutData.Slot3.Firepower;
            torpedo   += loadoutData.Slot3.Torpedo;
            antiAir   += loadoutData.Slot3.AntiAir;
        }

        health = maxHealth;
    }
        public static string GetEffect(ArmourType key)
        {
            switch (key)
            {
            case ArmourType.None:
                return("");

            case ArmourType.Light:
                return("Dexterity-based defence only.");

            case ArmourType.Medium:
                return("Dexterity or stamina-based defence.");

            case ArmourType.Heavy:
                return("Stamina-based defence. -2d10 stealth, -1d10 dexterity-based athletics rolls. If more than 10 damage is taken, take an additional 2 DR from the attack.");

            default:
                throw new ArgumentOutOfRangeException(nameof(key), key, null);
            }
        }
        public static string GetName(ArmourType key)
        {
            switch (key)
            {
            case ArmourType.None:
                return("None");

            case ArmourType.Light:
                return("Light");

            case ArmourType.Medium:
                return("Medium");

            case ArmourType.Heavy:
                return("Heavy");

            default:
                throw new ArgumentOutOfRangeException(nameof(key), key, null);
            }
        }
        public static int GetDefence(ArmourType key)
        {
            switch (key)
            {
            case ArmourType.None:
                return(0);

            case ArmourType.Light:
                return(2);

            case ArmourType.Medium:
                return(1);

            case ArmourType.Heavy:
                return(-1);

            default:
                throw new ArgumentOutOfRangeException(nameof(key), key, null);
            }
        }
Ejemplo n.º 17
0
    void GetItemData()
    {
        //Debug.LogWarning(selectedItem.ItemType);

        itemName      = EditorGUILayout.TextField("Name: ", selectedItem.ItemName, GUILayout.Width(300));
        itemID        = EditorGUILayout.IntField("ID: ", selectedItem.ItemID, GUILayout.Width(300));
        itemShortDesc = EditorGUILayout.TextField("Short Desc.: ", selectedItem.ItemShortDesc, GUILayout.Width(500));
        EditorGUILayout.LabelField("Long description:");
        itemLongDesc   = EditorGUILayout.TextArea(selectedItem.ItemLongDesc, GUILayout.MinHeight(100));
        itemWeight     = EditorGUILayout.IntField("Weight: ", selectedItem.ItemWeight, GUILayout.Width(300));
        itemCost       = EditorGUILayout.IntField("Cost: ", selectedItem.ItemCost, GUILayout.Width(300));
        itemIcon       = EditorGUILayout.ObjectField("Icon: ", selectedItem.GetIcon(), typeof(Texture2D), true) as Texture2D;
        itemModel      = EditorGUILayout.ObjectField("Model: ", selectedItem.GetModel(), typeof(GameObject), true) as GameObject;
        itemType       = (ItemType)EditorGUILayout.EnumPopup("Type: ", selectedItem.ItemType);
        itemReqPerkIDs = selectedItem.ItemPerkReqIDs;
        CheckPerks();

        switch (selectedItem.ItemType)
        {
        case (ItemType.Weapon):
            baseDamage   = EditorGUILayout.IntField("Base Damage: ", selectedItem.WStats.BaseDamage);
            attackSpeed  = EditorGUILayout.IntField("Attack Speed: ", selectedItem.WStats.AttackSpeed);
            bluntDamage  = EditorGUILayout.IntField("Blunt", selectedItem.WStats.BluntDamage);
            pierceDamage = EditorGUILayout.IntField("Pierce", selectedItem.WStats.PierceDamage);
            slashDamage  = EditorGUILayout.IntField("Slash", selectedItem.WStats.SlashDamage);

            conditions = selectedItem.WStats.Auras;
            CheckAuras();
            break;

        case (ItemType.Armour):
            baseDefence    = EditorGUILayout.IntField("Base Defence: ", selectedItem.AStats.BaseDefence);
            bluntDefence   = EditorGUILayout.IntField("Blunt", selectedItem.AStats.BluntDefence);
            pierceDefence  = EditorGUILayout.IntField("Pierce", selectedItem.AStats.PierceDefence);
            slashDefence   = EditorGUILayout.IntField("Slash", selectedItem.AStats.SlashDefence);
            natureDefence  = EditorGUILayout.IntField("Nature", selectedItem.AStats.NatureDefence);
            thermalDefence = EditorGUILayout.IntField("Thermal", selectedItem.AStats.ThermalDefence);
            armourType     = (ArmourType)EditorGUILayout.EnumPopup("Slot: ", selectedItem.AStats.ArmourType);
            armourMaterial = (ArmourMaterial)EditorGUILayout.EnumPopup("Material: ", selectedItem.AStats.ArmourMaterial);

            conditions = selectedItem.AStats.Auras;
            CheckAuras();
            break;

        case (ItemType.Consumable):
            consumableType    = (ConsumableType)EditorGUILayout.EnumPopup("Type: ", selectedItem.ConStats.ConsumableType);
            consumableCharges = EditorGUILayout.IntField("Charges", selectedItem.ConStats.Charges);

            conditions = selectedItem.ConStats.Auras;
            CheckAuras();
            break;

        case (ItemType.Container):
            contentItems      = selectedItem.CtnStats.ContentItems;
            contentQuantities = selectedItem.CtnStats.ContentQuantities;
            CheckContents();
            break;

        case (ItemType.Ingredient):
            isStackable = selectedItem.IngStats.IsStackable;
            break;

        case (ItemType.Misc):
            isStackable = selectedItem.MiscStats.IsStackable;
            break;
        }
    }
    //returns the damage (rounded to int) of the gun to the armour type passed in
    public override int GetDamage(ArmourType armour)
    {
        float multiplier = Database.ArmourMultiplier(gunClass, armour, ammo);

        return((int)((finalDamage * multiplier)));
    }
Ejemplo n.º 19
0
 public void SetArmourType(ArmourType argsType)
 {
     m_Armour = argsType;
 }
Ejemplo n.º 20
0
 public Armour(string title, string name, int price, int durability, int dp, ArmourType armourType) : base(title, name, price, durability)
 {
     this.dp         = dp;
     this.armourType = armourType;
 }
Ejemplo n.º 21
0
 public ProtectiveFields(string model, int price, int weight, int points, int reflection, int refraction, ArmourType armourType)
     : base(model, price, weight, points, armourType)
 {
     this.Reflection        = reflection;
     this.Refraction        = refraction;
     this.ArmourCoefficient = this.Points + this.Reflection - this.Refraction;
 }
Ejemplo n.º 22
0
 public Armour(string setName, ArmourType setType, int setLevel)
 {
     name = setName;
     type = setType;
     level = setLevel;
 }
 public ArmourAbstractMock(string model, int price, int weight, int points, ArmourType armourType)
     : base(model, price, weight, points, armourType)
 {
 }
Ejemplo n.º 24
0
 //If the armour type is changed, this is a nice little method to call.
 int ChangeArmourTypeTo(ArmourType armour)
 {
     return((int)armour);
 }
Ejemplo n.º 25
0
 public DenseArmour(string model, int price, int weight, int points, int hardness, int toughness, ArmourType armourType)
     : base(model, price, weight, points, armourType)
 {
     this.Hardness          = hardness;
     this.Toughness         = toughness;
     this.ArmourCoefficient = this.Points + this.Hardness + this.Toughness;
 }
Ejemplo n.º 26
0
 public ArmourAbstract(string model, int price, int weight, int points, ArmourType armourType)
     : base(model, price, weight)
 {
     this.Points     = points;
     this.ArmourType = armourType;
 }
Ejemplo n.º 27
0
 public Armour(int resistance, int weight, ArmourType armourtype)
 {
     _Resistance = resistance;
     _Weight     = weight;
     ArmourType  = armourtype;
 }
Ejemplo n.º 28
0
    void ShowCreateWindow()
    {
        editScrollPos = EditorGUILayout.BeginScrollView(editScrollPos, false, false, GUILayout.MinWidth(540), GUILayout.MinHeight(550));

        itemName      = EditorGUILayout.TextField("Name: ", itemName, GUILayout.Width(300));
        itemID        = EditorGUILayout.IntField("ID: ", itemID, GUILayout.Width(300));
        itemShortDesc = EditorGUILayout.TextField("Short Desc.: ", itemShortDesc, GUILayout.Width(450));
        EditorGUILayout.LabelField("Long description:");
        itemLongDesc = EditorGUILayout.TextArea(itemLongDesc, GUILayout.Width(450), GUILayout.MinHeight(100));
        itemWeight   = EditorGUILayout.IntField("Weight: ", itemWeight, GUILayout.Width(300));
        itemCost     = EditorGUILayout.IntField("Cost: ", itemCost, GUILayout.Width(300));
        itemIcon     = EditorGUILayout.ObjectField("Icon: ", itemIcon, typeof(Texture2D), true, GUILayout.Width(450)) as Texture2D;
        itemModel    = EditorGUILayout.ObjectField("Model: ", itemModel, typeof(GameObject), true, GUILayout.Width(450)) as GameObject;
        itemType     = (ItemType)EditorGUILayout.EnumPopup("Type: ", itemType, GUILayout.Width(480));

        EditorGUILayout.Space();

        switch (itemType)
        {
        case (ItemType.Weapon):
            EditorGUILayout.LabelField("Weapon-specific Attributes", EditorStyles.boldLabel);
            baseDamage   = EditorGUILayout.IntField("Base Damage: ", baseDamage, GUILayout.Width(300));
            attackSpeed  = EditorGUILayout.IntField("Attack Speed: ", attackSpeed, GUILayout.Width(300));
            bluntDamage  = EditorGUILayout.IntField("Blunt", bluntDamage, GUILayout.Width(300));
            pierceDamage = EditorGUILayout.IntField("Pierce", pierceDamage, GUILayout.Width(300));
            slashDamage  = EditorGUILayout.IntField("Slash", slashDamage, GUILayout.Width(300));

            EditorGUILayout.Space();

            showContentsOrAuras = EditorGUILayout.Foldout(showContentsOrAuras, "ON-EQUIP Auras");
            if (showContentsOrAuras)
            {
                DisplayAuras();
            }

            break;

        case (ItemType.Armour):
            EditorGUILayout.LabelField("Armour-specific Attributes", EditorStyles.boldLabel);
            baseDefence    = EditorGUILayout.IntField("Base Defence: ", baseDefence, GUILayout.Width(300));
            bluntDefence   = EditorGUILayout.IntField("Blunt", bluntDefence, GUILayout.Width(300));
            pierceDefence  = EditorGUILayout.IntField("Pierce", pierceDefence, GUILayout.Width(300));
            slashDefence   = EditorGUILayout.IntField("Slash", slashDefence, GUILayout.Width(300));
            natureDefence  = EditorGUILayout.IntField("Nature", natureDefence, GUILayout.Width(300));
            thermalDefence = EditorGUILayout.IntField("Thermal", thermalDefence, GUILayout.Width(300));
            armourType     = (ArmourType)EditorGUILayout.EnumPopup("Slot: ", armourType, GUILayout.Width(450));
            armourMaterial = (ArmourMaterial)EditorGUILayout.EnumPopup("Material: ", armourMaterial, GUILayout.Width(450));

            EditorGUILayout.Space();

            showContentsOrAuras = EditorGUILayout.Foldout(showContentsOrAuras, "ON-EQUIP Auras");
            if (showContentsOrAuras)
            {
                DisplayAuras();
            }

            break;

        case (ItemType.Consumable):
            EditorGUILayout.LabelField("Consumable-specific Attributes", EditorStyles.boldLabel);
            consumableType    = (ConsumableType)EditorGUILayout.EnumPopup("Type: ", consumableType, GUILayout.Width(450));
            consumableCharges = EditorGUILayout.IntField("Uses: ", consumableCharges, GUILayout.Width(300));

            EditorGUILayout.Space();

            showContentsOrAuras = EditorGUILayout.Foldout(showContentsOrAuras, "ON-USE Auras");
            if (showContentsOrAuras)
            {
                DisplayAuras();
            }

            break;

        case (ItemType.Container):
            EditorGUILayout.LabelField("Container-specific Attributes", EditorStyles.boldLabel);
            showContentsOrAuras = EditorGUILayout.Foldout(showContentsOrAuras, "CONTAINER CONTENTS");
            if (showContentsOrAuras)
            {
                DisplayContainerEditor();
            }

            break;

        case (ItemType.Ingredient):
            EditorGUILayout.LabelField("Ingredient-specific Attributes", EditorStyles.boldLabel);
            isStackable = EditorGUILayout.Toggle("Stackable: ", isStackable);
            break;

        case (ItemType.Misc):
            EditorGUILayout.LabelField("Miscellaneous-specific Attributes", EditorStyles.boldLabel);
            isStackable = EditorGUILayout.Toggle("Stackable: ", isStackable);
            break;
        }

        EditorGUILayout.Space();

        showRequirements = EditorGUILayout.Foldout(showRequirements, "REQUIRED PERKS");
        if (showRequirements)
        {
            DisplayRequirements();
        }

        EditorGUILayout.Space();

        EditorGUILayout.BeginHorizontal();
        if (GUILayout.Button("Save", GUILayout.Width(150.0f)))
        {
            // Save this item to the database, either as a new item
            // or as an existing item.
            if (editorState == EditorState.Create)
            {
                SaveNewItem(itemType);
            }
            else
            {
                SaveExistingItem(itemType);
            }

            EditorUtility.SetDirty(itemDatabase);
            editorState = EditorState.Home;
        }
        if (GUILayout.Button("Cancel", GUILayout.Width(150.0f)))
        {
            EditorUtility.SetDirty(itemDatabase);
            editorState = EditorState.Home;
        }
        EditorGUILayout.EndHorizontal();


        EditorGUILayout.EndScrollView();
    }
Ejemplo n.º 29
0
 /// <summary>
 /// Used to pass agent details from the pool of the players current agents
 /// </summary>
 /// <param name="details">Details of a given agent</param>
 public void CreateNewAgent(AgentDetails details, WeaponType weapon, ArmourType armour)
 {
     CreateNewAgent(details.IdTag, details.PersonName, details.Portrait, details.AgentClass, details.MaxHealth,
                    details.Health, weapon, armour);
 }
 //returns the damage (rounded to int) of the gun to the armour type passed in (with random variation too)
 public virtual int GetDamage(ArmourType armour)
 {
     return(0);
 }
Ejemplo n.º 31
0
        /// <summary>
        /// Creates a new Agent
        /// </summary>
        /// <param name="i"> Unique id of agent</param>
        /// <param name="n"> Name of agent</param>
        /// <param name="p"> Portrait sprite of agent</param>
        /// <param name="c"> Class of the agent</param>
        /// <param name="mH"> Max Health of agent</param>
        /// <param name="h"> Health of agent</param>
        /// <param name="eFla"> Exp needed to reach first level</param>
        /// <param name="wea"> Weapon that the agent is using</param>
        /// <param name="hasArm"> Is Agent wearing armour</param>
        public void CreateNewAgent(int i, string n, Sprite p, ClassType c, float mH, float h, WeaponType weaType, ArmourType armour)
        {
            Weapon[] weapons = GetComponentsInChildren <Weapon>();
            if (weapons.Length == 0)
            {
                Debug.Log("Agent " + IdTag + ": No Weapons Found");
            }

            foreach (Weapon weapon in weapons)
            {
                switch (weapon.Type)
                {
                case WeaponType.pistol:
                    glockObject = weapon;
                    break;

                case WeaponType.rifle:
                    assualtRifleObject = weapon;
                    break;

                case WeaponType.shotgun:
                    doubleShotgunObject = weapon;
                    break;

                case WeaponType.tazer:
                    tazerObject = weapon;
                    break;
                }
            }
            SetWeaponObjectByType(weaType);

            Armour arm = GetComponentInChildren <Armour>();

            if (arm == null)
            {
                Debug.Log("Agent " + IdTag + ": No Armour Found");
            }
            else
            {
                currArmour = arm;
                currArmour.ResetValues();
            }

            if (armour == ArmourType.Vest)
            {
                currArmour.gameObject.SetActive(true);
            }
            else
            {
                currArmour.gameObject.SetActive(false);
            }

            IdTag      = i;
            PersonName = n;
            Portrait   = p;
            AgentClass = c;
            MaxHealth  = mH;
            Health     = h;

            lineRenderer = GetComponent <LineRenderer>();
            SetToIdle(true);
            fireTimer  = currWeapon.FireRate;
            deathTimer = 0.0f;
            IsInCover  = false;
            UpdateMarker(false);
            hasBeenTazed = false;
        }
 public static ArmourTypeInfo Build(ArmourType key, Character character)
 {
     return(new ArmourTypeInfo(key, GetName(key), GetCost(key), GetEffect(key), GetDefence(key), GetDamageReduction(key), GetPrerequisites(key), character));
 }