// Token: 0x06001188 RID: 4488 RVA: 0x00056F7C File Offset: 0x0005517C
        public void ApplyElement(MageElement element)
        {
            this.mageElement = element;
            int num = (int)(element - MageElement.Fire);

            this.targetSkill.skillNameToken        = this.elementSkillInfos[num].nameToken;
            this.targetSkill.skillDescriptionToken = this.elementSkillInfos[num].descriptionToken;
            this.targetSkill.icon = this.elementSkillInfos[num].sprite;
        }
        // Token: 0x0600117E RID: 4478 RVA: 0x00056D58 File Offset: 0x00054F58
        private MageElement GetAwardedElementFromInventory()
        {
            Inventory inventory = this.characterBody.inventory;

            if (inventory)
            {
                MageElement mageElement = (MageElement)inventory.GetItemCount(ItemIndex.MageAttunement);
                if (mageElement >= MageElement.None && mageElement < MageElement.Count)
                {
                    return(mageElement);
                }
            }
            return(MageElement.None);
        }
 // Token: 0x0600117D RID: 4477 RVA: 0x00056CEC File Offset: 0x00054EEC
 private void FixedUpdate()
 {
     base.enabled        = false;
     this.currentElement = this.GetAwardedElementFromInventory();
     if (this.hasEffectiveAuthority && this.currentElement == MageElement.None)
     {
         MageElement mageElement = this.CalcElementToAward();
         if (mageElement != MageElement.None && !(this.stateMachine.state is MageCalibrate))
         {
             MageCalibrate mageCalibrate = new MageCalibrate();
             mageCalibrate.element = mageElement;
             this.stateMachine.SetInterruptState(mageCalibrate, this.calibrationStateInterruptPriority);
         }
     }
 }
        // Token: 0x06001181 RID: 4481 RVA: 0x00056ED0 File Offset: 0x000550D0
        public void SetElement(MageElement newElement)
        {
            if (!NetworkServer.active)
            {
                return;
            }
            Inventory inventory = this.characterBody.inventory;

            if (inventory)
            {
                MageElement mageElement = (MageElement)inventory.GetItemCount(ItemIndex.MageAttunement);
                if (mageElement != newElement)
                {
                    int count = (int)(newElement - mageElement);
                    inventory.GiveItem(ItemIndex.MageAttunement, count);
                }
            }
        }
Beispiel #5
0
        // Token: 0x06002DC4 RID: 11716 RVA: 0x000C2860 File Offset: 0x000C0A60
        private void InitElement(MageElement defaultElement)
        {
            MageCalibrationController component = base.GetComponent <MageCalibrationController>();

            if (component)
            {
                MageElement activeCalibrationElement = component.GetActiveCalibrationElement();
                if (activeCalibrationElement != MageElement.None)
                {
                    defaultElement = activeCalibrationElement;
                }
            }
            switch (defaultElement)
            {
            case MageElement.Fire:
                this.damageCoefficient       = FireRoller.fireDamageCoefficient;
                this.attackString            = FireRoller.fireAttackSoundString;
                this.projectilePrefab        = FireRoller.fireProjectilePrefab;
                this.muzzleflashEffectPrefab = FireRoller.fireMuzzleflashEffectPrefab;
                this.areaIndicatorPrefab     = FireRoller.fireAreaIndicatorPrefab;
                return;

            case MageElement.Ice:
                this.damageCoefficient       = FireRoller.iceDamageCoefficient;
                this.attackString            = FireRoller.iceAttackSoundString;
                this.projectilePrefab        = FireRoller.iceProjectilePrefab;
                this.muzzleflashEffectPrefab = FireRoller.iceMuzzleflashEffectPrefab;
                this.areaIndicatorPrefab     = FireRoller.iceAreaIndicatorPrefab;
                return;

            case MageElement.Lightning:
                this.damageCoefficient       = FireRoller.lightningDamageCoefficient;
                this.attackString            = FireRoller.lightningAttackSoundString;
                this.projectilePrefab        = FireRoller.lightningProjectilePrefab;
                this.muzzleflashEffectPrefab = FireRoller.lightningMuzzleflashEffectPrefab;
                this.areaIndicatorPrefab     = FireRoller.lightningAreaIndicatorPrefab;
                return;

            default:
                return;
            }
        }
Beispiel #6
0
        // Token: 0x06000E12 RID: 3602 RVA: 0x0003ED4C File Offset: 0x0003CF4C
        private MageElement CalcElementToAward()
        {
            for (int i = 0; i < MageCalibrationController.elementCounter.Length; i++)
            {
                MageCalibrationController.elementCounter[i] = 0;
            }
            Inventory inventory = this.characterBody.inventory;

            if (!inventory)
            {
                return(MageElement.None);
            }
            List <ItemIndex> itemAcquisitionOrder = inventory.itemAcquisitionOrder;

            for (int j = 0; j < itemAcquisitionOrder.Count; j++)
            {
                ItemCatalog.GetItemDef(itemAcquisitionOrder[j]);
            }
            EquipmentDef equipmentDef = EquipmentCatalog.GetEquipmentDef(inventory.currentEquipmentIndex);

            if (equipmentDef != null && equipmentDef.mageElement != MageElement.None)
            {
                MageCalibrationController.elementCounter[(int)equipmentDef.mageElement] += 2;
            }
            MageElement result = MageElement.None;
            int         num    = 0;

            for (MageElement mageElement = MageElement.Fire; mageElement < MageElement.Count; mageElement += 1)
            {
                int num2 = MageCalibrationController.elementCounter[(int)mageElement];
                if (num2 > num)
                {
                    result = mageElement;
                    num    = num2;
                }
            }
            if (num >= 5)
            {
                return(result);
            }
            return(MageElement.None);
        }
        // Token: 0x0600117F RID: 4479 RVA: 0x00056D90 File Offset: 0x00054F90
        private MageElement CalcElementToAward()
        {
            for (int i = 0; i < MageCalibrationController.elementCounter.Length; i++)
            {
                MageCalibrationController.elementCounter[i] = 0;
            }
            Inventory inventory = this.characterBody.inventory;

            if (!inventory)
            {
                return(MageElement.None);
            }
            List <ItemIndex> itemAcquisitionOrder = inventory.itemAcquisitionOrder;

            for (int j = 0; j < itemAcquisitionOrder.Count; j++)
            {
                ItemIndex itemIndex = itemAcquisitionOrder[j];
                ItemDef   itemDef   = ItemCatalog.GetItemDef(itemIndex);
                if (itemDef.mageElement != MageElement.None)
                {
                    int num = 0;
                    switch (itemDef.tier)
                    {
                    case ItemTier.Tier1:
                        num = 1;
                        break;

                    case ItemTier.Tier2:
                        num = 2;
                        break;

                    case ItemTier.Tier3:
                        num = 3;
                        break;

                    case ItemTier.Lunar:
                        num = 3;
                        break;
                    }
                    MageCalibrationController.elementCounter[(int)itemDef.mageElement] += num * inventory.GetItemCount(itemIndex);
                }
            }
            EquipmentDef equipmentDef = EquipmentCatalog.GetEquipmentDef(inventory.currentEquipmentIndex);

            if (equipmentDef != null && equipmentDef.mageElement != MageElement.None)
            {
                MageCalibrationController.elementCounter[(int)equipmentDef.mageElement] += 2;
            }
            MageElement result = MageElement.None;
            int         num2   = 0;

            for (MageElement mageElement = MageElement.Fire; mageElement < MageElement.Count; mageElement += 1)
            {
                int num3 = MageCalibrationController.elementCounter[(int)mageElement];
                if (num3 > num2)
                {
                    result = mageElement;
                    num2   = num3;
                }
            }
            if (num2 >= 5)
            {
                return(result);
            }
            return(MageElement.None);
        }
 // Token: 0x06001182 RID: 4482 RVA: 0x00056F18 File Offset: 0x00055118
 public void RefreshCalibrationElement(MageElement targetElement)
 {
     MageCalibrationController.CalibrationInfo calibrationInfo = this.calibrationInfos[(int)targetElement];
     this.calibrationOverlayRenderer.enabled  = calibrationInfo.enableCalibrationOverlay;
     this.calibrationOverlayRenderer.material = calibrationInfo.calibrationOverlayMaterial;
 }