예제 #1
0
    void Awake()
    {
        name = GetComponent <Text>();
        EquipmentType equipType = gameObject.GetComponentInParent <EquipmentSlot>().EquipmentType;

        name.text = equipType.ToString();
    }
예제 #2
0
        public StanceTypes GetStanceType()
        {
            if (EquipmentType.ToString().Contains("Both"))
            {
                return(StanceTypes.BothHands);
            }

            if (EquipmentType.ToString().Contains("Single"))
            {
                return(StanceTypes.SingleHanded);
            }

            if (EquipmentType.ToString().Contains("Dual"))
            {
                return(StanceTypes.DualHanded);
            }

            if (EquipmentType.ToString().Contains("AndShield"))
            {
                return(StanceTypes.DualHanded);
            }

            if (EquipmentType == EquipmentTypes.Fists)
            {
                return(StanceTypes.Fists);
            }

            throw new Exception("'EquipmentType' must contain one of these to be valid: 'Single', Dual', 'AndShield', or 'Both'. Incorrect value is: " + EquipmentType.ToString());
        }
예제 #3
0
        /// <summary>
        /// Applique les passifs de l'équipement passif passé en paramètre.
        /// </summary>
        public void ApplyPassives(EquipmentType equip)
        {
            StateAlterationSource src;
            PassiveEquipment      passiveEquip;

            switch (equip)
            {
            case EquipmentType.Armor:
                src = StateAlterationSource.Armor; passiveEquip = m_armor; break;

            case EquipmentType.Boots:
                src = StateAlterationSource.Boots; passiveEquip = m_boots; break;

            /*case EquipmentType.Amulet:
             *  src = StateAlterationSource.Amulet; passiveEquip = m_amulet; break;*/
            default:
                throw new NotImplementedException();
            }

            StateAlterations.EndAlterations(src);
            if (passiveEquip != null)
            {
                foreach (StateAlterationModel model in passiveEquip.GetPassives())
                {
                    model.BaseDuration = StateAlteration.DURATION_INFINITY;
                    AddAlteration(new StateAlteration("equip-passive-" + equip.ToString(),
                                                      this,
                                                      model,
                                                      new StateAlterationParameters(), src), false);
                }
            }
        }
예제 #4
0
 protected override void Awake()
 {
     base.Awake();
     gameObject.name = EquipmentType.ToString() + "Slots";
     image           = GetComponent <Image>();
     //image.color = new Color(image.color.r, image.color.g, image.color.b, 0f);
 }
        protected override void InternalToXML(XmlWriter writer)
        {
            writer.WriteAttributeString("Type", type.ToString());
            writer.WriteAttributeString("IssuingMemberState", issuingMemberState.ToString());

            base.InternalToXML(writer);
        }
예제 #6
0
    protected override void OnValidate()
    {
        base.OnValidate();

        // Automatically name the slot
        gameObject.name = equipmentType.ToString() + " Slot";
    }
예제 #7
0
        public virtual void BuildMachine(EquipmentType type)
        {
            var name = type.ToString();

            m_machine           = new Machine(name);
            m_equipment.Name    = name;
            m_equipment.Machine = m_machine;
        }
 public EquipmentId(string floorId, string corridorId, EquipmentType type, string sequenceId)
 {
     this.floorId    = floorId;
     this.corridorId = $"{floorId}{idSeparator}{corridorId}";
     this.type       = type;
     this.sequenceId = sequenceId;
     string[] keys = { floorId, corridorId, type.ToString(), sequenceId };
     this.value = string.Join(idSeparator.ToString(), keys);
 }
예제 #9
0
        public ItemCollection GetValues()
        {
            var col = new ItemCollection();

            for (EquipmentType i = 0; i < EquipmentType.Num; i++)
            {
                col.Add(i, i.ToString().SplitCamelCase());
            }
            return(col);
        }
예제 #10
0
        protected override void ProcessInternal(CustomBinaryReader reader, XmlWriter writer)
        {
            type = (EquipmentType)reader.ReadByte();
            issuingMemberState = reader.ReadByte();

            writer.WriteAttributeString("Type", type.ToString());
            writer.WriteAttributeString("IssuingMemberState", issuingMemberState.ToString());

            base.ProcessInternal(reader, writer);
        }
예제 #11
0
 public void AddEquipment(Equipment newItem)
 {
     equipment          = newItem;
     equipmentName.text = slot.ToString();
     if (!newItem.isDefaultItem)
     {
         equipmentButton.interactable = true;
         equipmentName.text           = equipment.name;
         icon.sprite         = equipment.icon;
         icon.enabled        = true;
         icon.preserveAspect = true;
     }
 }
예제 #12
0
    public void Refresh()
    {
        foreach (var go in itemSlots)
        {
            go.gameObject.SetActive(false);
        }

        selectedCha  = chaController.selectedCharacter;
        selectedItem = null;
        SetUpChaEquipment(activedType);

        int count = 0;

        foreach (var kvp in PF_PlayerData.inventoryByCategory)
        {
            foreach (var id in kvp.Value.inventory)
            {
                bool addItem = false;

                if (string.Equals(kvp.Value.catalogRef.ItemClass, activedType.ToString()) && !PF_PlayerData.characterEquipedItem.Contains(id.ItemInstanceId))
                {
                    addItem = true;
                }
                else
                {
                    continue;
                }

                if (addItem == true)
                {
                    itemSlots[count].gameObject.SetActive(true);
                    itemSlots[count].Init(this);
                    itemSlots[count].SetUpButton(kvp.Value, id.ItemInstanceId);

                    count++;
                }
            }
        }
    }
예제 #13
0
        protected override void ProcessInternal(CustomBinaryReader reader, XmlWriter writer)
        {
            type = (EquipmentType)reader.ReadByte();
            issuingMemberState   = reader.ReadByte();
            driverIdentification = reader.ReadString(14);
            replacementIndex     = reader.ReadByte();
            renewalIndex         = reader.ReadByte();

            writer.WriteAttributeString("Type", type.ToString());
            writer.WriteAttributeString("IssuingMemberState", issuingMemberState.ToString());
            writer.WriteAttributeString("ReplacementIndex", replacementIndex.ToString());
            writer.WriteAttributeString("RenewalIndex", renewalIndex.ToString());

            writer.WriteString(driverIdentification);
        }
예제 #14
0
    public Effect GenerateEffect(EquipmentType ET, Rarity rarity)
    {
        LevelAndTypeSpecificEffects.Clear();
        foreach (Effect effect in Effects.EffectList)
        {
            if (effect.EquipmentType == ET.ToString() && effect.Rarity == rarity.ToString())
            {
                LevelAndTypeSpecificEffects.Add(effect);
            }
        }
        Effect newEffect;
        int    effectIndex;

        switch (ET)
        {
        case EquipmentType.Weapon:
            effectIndex = Random.Range(0, WeaponEffects.Count);
            newEffect   = CheckForEffect(WeaponEffects[effectIndex]);
            return(newEffect);

        case EquipmentType.Armor:
            effectIndex = Random.Range(0, ArmorEffects.Count);
            newEffect   = CheckForEffect(ArmorEffects[effectIndex]);
            return(newEffect);

        case EquipmentType.Accessory:
            effectIndex = Random.Range(0, AccessoryEffects.Count);
            newEffect   = CheckForEffect(AccessoryEffects[effectIndex]);
            return(newEffect);

        case EquipmentType.Upgrade:
            effectIndex = Random.Range(0, UpgradeEffects.Count);
            newEffect   = CheckForEffect(UpgradeEffects[effectIndex]);
            return(newEffect);

        default:
            return(null);
        }
    }
예제 #15
0
    public ExtraItemData_JSON ToExtraItemData_JSON()
    {
        ExtraItemData_JSON eid = new ExtraItemData_JSON();

        eid.MaxHealthIncrease   = this.MaxHealthIncrease;
        eid.MaxManaIncrease     = this.MaxManaIncrease;
        eid.ManaRegenIncrease   = this.ManaRegenIncrease;
        eid.HealthRegenIncrease = this.HealthRegenIncrease;

        eid.ElementStrings = new Dictionary <string, string>();
        if (this.Elements != null)  //TODO: Check to see if enclosing in if statement messed up anything~~~~~~~~~~
        {
            foreach (KeyValuePair <Element, float> element in this.Elements)
            {
                eid.ElementStrings.Add(element.Key.ToString(), element.Value.ToString());
            }
        }

        eid.EquipmentTypeString = EquipmentType.ToString();
        eid.CastSpeedString     = this.CastSpeed.ToString();

        return(eid);
    }
예제 #16
0
        protected override void getCommaSeparatedToStringProps(out string className, out string commaSeparatedProps)
        {
            className = "EquipmentItemModel";

            string[] abilityStrings = new string[AbilityItemModels.Length];
            for (int i = 0; i < abilityStrings.Length; i++)
            {
                abilityStrings[i] = AbilityItemModels[i].ToString();
            }
            string abilities = "[" + string.Join(",", abilityStrings) + "]";

            commaSeparatedProps =
                "EquipmentType: " + EquipmentType.ToString() + ", " +
                "MaxHealthBoost: " + MaxHealthBoost + ", " +
                "HealthRegenBoost: " + HealthRegenBoost + ", " +
                "MaxManaBoost: " + MaxManaBoost + ", " +
                "ArmorBoost: " + ArmorBoost + ", " +
                "SpellResistBoost: " + SpellResistBoost + ", " +
                "MeleeDamageBoost: " + MeleeDamageBoost + ", " +
                "MeleeCritBoost: " + MeleeCritBoost + ", " +
                "SpellDamageBoost: " + SpellDamageBoost + ", " +
                "SpellCritBoost: " + SpellCritBoost + ", " +
                "AbilityItemModels: " + abilities;
        }
예제 #17
0
 protected override void OnValidate()
 {
     base.OnValidate();
     gameObject.name = equipmentType.ToString() + " Slot";
 }
예제 #18
0
    public void Init(EquipSlotModel slotModel)
    {
        this.slotModel              = slotModel;
        this.slotModel.onEquipItem += EquipItem;

        if (equipController != null)
        {
            if (equipController.equipType != equipType)
            {
                Debug.Log(string.Format("Can't equip item. Mismatch types: {0} >> {1}", equipType.ToString(), equipController.equipType.ToString()));
                return;
            }
            InstantiateItem(equipController.gameObject);
        }
    }
예제 #19
0
 public override string GetItemType()
 {
     return(EquipmentType.ToString());
 }
예제 #20
0
 private void UpdateItemTypeLabel()
 {
     ItemTypeLabel.text = ((_EquipType == EquipmentType.None) ? "All" : _EquipType.ToString());
 }
예제 #21
0
 protected void Start()
 {
     gameObject.name = EquipmentType.ToString() + " Slot";
 }
예제 #22
0
 public string getItemType()
 {
     return(itemType.ToString());
 }
예제 #23
0
    public override string ItemType()
    {
        itemtype = equipment_type.ToString();

        return(itemtype);
    }
예제 #24
0
    private void showText(Equipment e, EquipmentType type)
    {
        if (e != null)
        {
            euipmentName.text = "name:" + e.ename;
            TypeName.text     = "type:" + e.EquipmentType.ToString();
            value.text        = "value:" + equipment.value.ToString();
            image.sprite      = setSprite(e.path);
            if (type == EquipmentType.Helmet)
            {
                PDEF.text            = "PDEF:" + equipment.PDEF;
                MDEF.text            = "MDEF:" + equipment.MDEF;
                FirstAttribute.text  = "ACC:" + equipment.ACC;
                SecondAttribute.text = "Block:" + equipment.Block;
                TypeName.text        = "Type:" + EquipmentType.Helmet.ToString();
            }

            else if (type == EquipmentType.Gloves)
            {
                PDEF.text            = "PDEF:" + equipment.PDEF;
                MDEF.text            = "MDEF:" + equipment.MDEF;
                TypeName.text        = "Type:" + EquipmentType.Helmet.ToString();
                FirstAttribute.text  = "Pernetration:" + equipment.Pernetration;
                SecondAttribute.text = "Crit:" + equipment.Crit;
            }

            else if (type == EquipmentType.Pants)
            {
                PDEF.text            = "PDEF:" + equipment.PDEF;
                MDEF.text            = "MDEF:" + equipment.MDEF;
                TypeName.text        = "Type:" + EquipmentType.Pants.ToString();
                FirstAttribute.text  = "HP:" + equipment.HP;
                SecondAttribute.text = "Crit:" + equipment.Crit;
            }

            else if (type == EquipmentType.Shoes)
            {
                PDEF.text            = "PDEF:" + equipment.PDEF;
                MDEF.text            = "MDEF:" + equipment.MDEF;
                TypeName.text        = "Type:" + EquipmentType.Shoes.ToString();
                FirstAttribute.text  = "ACC:" + equipment.ACC;
                SecondAttribute.text = "Dodge:" + equipment.Dodge;
            }

            else if (type == EquipmentType.Armor)
            {
                PDEF.text            = "PDEF:" + equipment.PDEF;
                MDEF.text            = "MDEF:" + equipment.MDEF;
                TypeName.text        = "Type:" + EquipmentType.Armor.ToString();
                FirstAttribute.text  = "Block:" + equipment.Block;
                SecondAttribute.text = "CritResistance:" + equipment.CritResistance;
            }

            else
            {
                PDEF.text            = "ATK:" + equipment.PATK;
                MDEF.text            = "MATK:" + equipment.MATK;
                TypeName.text        = "Type:" + type.ToString();
                FirstAttribute.text  = "Crit:" + equipment.Crit;
                SecondAttribute.text = "CritDMG:" + equipment.CritDMG;
            }
        }
        else
        {
            euipmentName.text    = "name:none";
            TypeName.text        = "type:none";
            value.text           = "value:none";
            PDEF.text            = "none";
            MDEF.text            = "none";
            FirstAttribute.text  = "none";
            SecondAttribute.text = "none";
        }
    }
예제 #25
0
 public static string GetLocalize(this EquipmentType equipmentType)
 {
     return(LocalizationText.GetString(equipmentType.ToString().ToUpper()));
 }
예제 #26
0
 private void OnValidate()
 {
     gameObject.name = equipmentType.ToString() + " Slot";
     icon.enabled    = false;
 }
예제 #27
0
 protected override void OnValidate()
 {
     base.OnValidate();
     // Set Name
     gameObject.name = type.ToString() + " Slot";
 }
예제 #28
0
 private void Awake()
 {
     gameObject.name = equipmentType.ToString() + " Slot";
 }
예제 #29
0
 public override string GetItemType()
 {
     return(equipmentType.ToString());//weaponType.ToString();
 }
예제 #30
0
    public EquipmentType EquipmentType; //Enum created before

    protected override void OnValidate()
    {
        base.OnValidate();
        gameObject.name = EquipmentType.ToString() + " Slot";
        // Name the slot automatically depending on the equipment type
    }
예제 #31
0
        protected override void ProcessInternal(CustomBinaryReader reader, XmlWriter writer)
        {
            type=(EquipmentType) reader.ReadByte();
            issuingMemberState=reader.ReadByte();
            driverIdentification=reader.ReadString(14);
            replacementIndex=reader.ReadByte();
            renewalIndex=reader.ReadByte();

            writer.WriteAttributeString("Type", type.ToString());
            writer.WriteAttributeString("IssuingMemberState", issuingMemberState.ToString());
            writer.WriteAttributeString("ReplacementIndex", replacementIndex.ToString());
            writer.WriteAttributeString("RenewalIndex", renewalIndex.ToString());

            writer.WriteString(driverIdentification);
        }