コード例 #1
0
 public void ResetControl()
 {
     _intCharacterID      = 0;
     _intArmorID          = 0;
     _intCharacterArmorID = 0;
     _OriginalCharArmorID = 0;
     _cwObjCA             = new CharacterArmor();
 }
コード例 #2
0
    // Use this for initialization
    public void AssignProfile(CharacterArmor characterArmor)
    {
        profile = characterArmor;

        button = GetComponent <Button>();
        button.GetComponentInChildren <Text>().text = profile.profileName;

        button.onClick.RemoveAllListeners();
        button.onClick.AddListener(OnClickHandler);
    }
コード例 #3
0
    //
    static public void storeArmor <A>(A iArmor, int i) where A : IArmor
    {
        CharacterArmor inventoryArmor = new CharacterArmor();

        inventoryArmor.armorName = iArmor.Name;
        inventoryArmor.Defense   = iArmor.Defense;
        inventoryArmor.Weight    = iArmor.Weight;
        inventoryArmor.Value     = iArmor.Value;

        armorArray[i] = inventoryArmor;
    }
コード例 #4
0
    public void SelectArmorProfle(CharacterArmor profile)
    {
        for (int x = 0; x < CharacterArmor.ARMOR_LOCATIONS; x++)
        {
            //Enter the values of the current profile into the input fields and then disable their interaction.
            armorInputFields[x].text         = profile.armorVal[x].ToString();
            armorInputFields[x].interactable = false;

            armorhardnessToggles[x].isOn         = profile.isHard[x];
            armorhardnessToggles[x].interactable = false;
        }
    }
コード例 #5
0
        public void SetControlWithCharacterArmor(Character objCharacter, CharacterArmor objCA)
        {
            _intCharacterID = objCA.CharacterID;
            _intArmorID     = objCA.ArmorID;
            _cwObjCA        = objCA;
            string strArmorAvail = "";

            if ((_OriginalCharArmorID == 0) && (objCA.CharacterArmorID != 0))
            {
                _OriginalCharArmorID = objCA.CharacterArmorID;
            }

            //Move to Character the Attack and Damage Bonuses
            grpCharacterArmor.Text      = objCA.objArmor.ArmorName;
            txtArmorDescription.Text    = objCA.objArmor.ArmorDescription;
            txtCharacterArmorNotes.Text = objCA.Notes;
            txtReflexAdjustment.Text    = objCA.objArmor.ReflexAdjustment.ToString();
            txtFortitudeAdjustment.Text = objCA.objArmor.FortitudeAdjustment.ToString();
            txtCost.Text              = objCA.objArmor.Cost.ToString();
            txtArmorChkPenalty.Text   = objCA.objArmor.objArmorType.ArmorCheckPenalty.ToString();
            txtMaxDefBonus.Text       = objCA.objArmor.MaxDefBonus.ToString();
            txtWeight.Text            = objCA.objArmor.Weight.ToString();
            txtBook.Text              = objCA.objArmor.objBook.BookName;
            txtEmplacementPoints.Text = objCA.objArmor.EmplacementPoints.ToString();

            if (objCA.objArmor.lstArmorAvailability.Count > 0)
            {
                foreach (ItemAvailabilityType objIAT in objCA.objArmor.lstArmorAvailability)
                {
                    strArmorAvail = strArmorAvail + objIAT.ItemAvailabilityTypeName + ", ";
                }
                strArmorAvail = strArmorAvail.Substring(0, strArmorAvail.Length - 2);
            }
            txtArmorAvailability.Text = strArmorAvail;

            txtArmorType.Text = objCA.objArmor.objArmorType.ArmorTypeName;
            txtSpeed6.Text    = objCA.objArmor.objArmorType.Speed_6.ToString();
            txtSpeed4.Text    = objCA.objArmor.objArmorType.Speed_4.ToString();
            txtSpeed8.Text    = objCA.objArmor.objArmorType.Speed_8.ToString();
            txtModificationDescription.Text = "";

            LoadModificationListView();
            //SetButtons();
        }
コード例 #6
0
        private void RemoveModsFromDevice()
        {
            CharacterEquipment objCharEquip  = new CharacterEquipment();
            CharacterArmor     objCharArmor  = new CharacterArmor();
            CharacterWeapon    objCharWeapon = new CharacterWeapon();;

            switch (enumModType)
            {
            case Common.ModificationType.Armor:
                objCharArmor.GetCharacterArmor(intModedObjID);
                break;

            case Common.ModificationType.Equipment:
                objCharEquip.GetCharacterEquipment(intModedObjID);
                break;

            case Common.ModificationType.Weapon:
                objCharWeapon.GetCharacterWeapon(intModedObjID);
                break;
            }

            //Delete the mod if its not in the selected list
            foreach (Modification objOrigMod in lstOriginalModfications)
            {
                if (!Modification.IsModificationInList(objOrigMod, lstModficationsSelected))
                {
                    switch (enumModType)
                    {
                    case Common.ModificationType.Armor:
                        objCharArmor.DeleteCharacterArmorModification(intModedObjID, objOrigMod.ModificationID);
                        break;

                    case Common.ModificationType.Equipment:
                        objCharEquip.DeleteCharacterEquipmentModification(intModedObjID, objOrigMod.ModificationID);
                        break;

                    case Common.ModificationType.Weapon:
                        objCharWeapon.DeleteCharacterWeaponModification(intModedObjID, objOrigMod.ModificationID);
                        break;
                    }
                }
            }

            //Add the mod if its not in the Original List
            foreach (Modification objSelMod in lstModficationsSelected)
            {
                if (!Modification.IsModificationInList(objSelMod, lstOriginalModfications))
                {
                    switch (enumModType)
                    {
                    case Common.ModificationType.Armor:
                        objSelMod.SaveCharacterArmorModification(objCharArmor.CharacterArmorID, objSelMod.ModificationID);
                        break;

                    case Common.ModificationType.Equipment:
                        objSelMod.SaveCharacterEquipmentModification(objCharEquip.CharacterEquipmentID, objSelMod.ModificationID);
                        break;

                    case Common.ModificationType.Weapon:
                        objSelMod.SaveCharacterWeaponModification(objCharWeapon.CharacterWeaponID, objSelMod.ModificationID);
                        break;
                    }
                }
            }
        }