예제 #1
0
 public uint cost(int speciality, int index)
 {
     if (Level.info != null && Level.info.type != ELevelType.ARENA)
     {
         byte b = 0;
         while ((int)b < PlayerSkills.SKILLSETS[(int)((byte)base.channel.owner.skillset)].Length)
         {
             SpecialitySkillPair specialitySkillPair = PlayerSkills.SKILLSETS[(int)((byte)base.channel.owner.skillset)][(int)b];
             if (speciality == specialitySkillPair.speciality && index == specialitySkillPair.skill)
             {
                 return(this.skills[speciality][index].cost / 2u);
             }
             b += 1;
         }
     }
     return(this.skills[speciality][index].cost);
 }
예제 #2
0
 private void onLifeUpdated(bool isDead)
 {
     if (isDead && Provider.isServer)
     {
         if (Level.info == null || Level.info.type == ELevelType.SURVIVAL)
         {
             float num = (!base.player.life.wasPvPDeath) ? Provider.modeConfigData.Players.Lose_Skills_PvE : Provider.modeConfigData.Players.Lose_Skills_PvP;
             byte  b   = 0;
             while ((int)b < this.skills.Length)
             {
                 byte[] array = new byte[this.skills[(int)b].Length];
                 byte   b2    = 0;
                 while ((int)b2 < array.Length)
                 {
                     bool flag = true;
                     byte b3   = 0;
                     while ((int)b3 < PlayerSkills.SKILLSETS[(int)((byte)base.channel.owner.skillset)].Length)
                     {
                         SpecialitySkillPair specialitySkillPair = PlayerSkills.SKILLSETS[(int)((byte)base.channel.owner.skillset)][(int)b3];
                         if ((int)b == specialitySkillPair.speciality && (int)b2 == specialitySkillPair.skill)
                         {
                             flag = false;
                             break;
                         }
                         b3 += 1;
                     }
                     if (flag)
                     {
                         array[(int)b2] = (byte)((float)this.skills[(int)b][(int)b2].level * num);
                     }
                     else
                     {
                         array[(int)b2] = this.skills[(int)b][(int)b2].level;
                     }
                     b2 += 1;
                 }
                 base.channel.send("tellSkills", ESteamCall.ALL, ESteamPacket.UPDATE_RELIABLE_BUFFER, new object[]
                 {
                     b,
                     array
                 });
                 b += 1;
             }
             this._experience = (uint)(this.experience * num);
         }
         else
         {
             byte b4 = 0;
             while ((int)b4 < this.skills.Length)
             {
                 byte b5 = 0;
                 while ((int)b5 < this.skills[(int)b4].Length)
                 {
                     this.skills[(int)b4][(int)b5].level = 0;
                     b5 += 1;
                 }
                 b4 += 1;
             }
             byte b6 = 0;
             while ((int)b6 < this.skills.Length)
             {
                 byte[] array2 = new byte[this.skills[(int)b6].Length];
                 byte   b7     = 0;
                 while ((int)b7 < array2.Length)
                 {
                     array2[(int)b7] = this.skills[(int)b6][(int)b7].level;
                     b7 += 1;
                 }
                 base.channel.send("tellSkills", ESteamCall.ALL, ESteamPacket.UPDATE_RELIABLE_BUFFER, new object[]
                 {
                     b6,
                     array2
                 });
                 b6 += 1;
             }
             if (Level.info.type == ELevelType.ARENA)
             {
                 this._experience = 0u;
             }
             else
             {
                 this._experience = (uint)(this.experience * 0.75f);
             }
         }
         this._boost = EPlayerBoost.NONE;
         base.channel.send("tellExperience", ESteamCall.ALL, ESteamPacket.UPDATE_RELIABLE_BUFFER, new object[]
         {
             this.experience
         });
         base.channel.send("tellBoost", ESteamCall.ALL, ESteamPacket.UPDATE_RELIABLE_BUFFER, new object[]
         {
             (byte)this.boost
         });
     }
 }
예제 #3
0
        // Token: 0x06003335 RID: 13109 RVA: 0x0014CA84 File Offset: 0x0014AE84
        public SleekSkill(byte speciality, byte index, Skill skill)
        {
            base.init();
            this.fontStyle     = FontStyle.Bold;
            this.fontAlignment = TextAnchor.MiddleCenter;
            this.fontSize      = SleekRender.FONT_SIZE;
            this.calculateContent();
            for (byte b = 0; b < skill.max; b += 1)
            {
                SleekImageTexture sleekImageTexture = new SleekImageTexture();
                sleekImageTexture.positionOffset_X = -20 - (int)(b * 20);
                sleekImageTexture.positionOffset_Y = 10;
                sleekImageTexture.positionScale_X  = 1f;
                sleekImageTexture.sizeOffset_X     = 10;
                sleekImageTexture.sizeOffset_Y     = -10;
                sleekImageTexture.sizeScale_Y      = 0.5f;
                if (b < skill.level)
                {
                    sleekImageTexture.texture = (Texture2D)PlayerDashboardSkillsUI.icons.load("Unlocked");
                }
                else
                {
                    sleekImageTexture.texture = (Texture2D)PlayerDashboardSkillsUI.icons.load("Locked");
                }
                base.add(sleekImageTexture);
            }
            base.add(new SleekLabel
            {
                positionOffset_X = 5,
                positionOffset_Y = 5,
                sizeOffset_X     = -10,
                sizeOffset_Y     = 30,
                sizeScale_X      = 0.5f,
                fontAlignment    = TextAnchor.UpperLeft,
                text             = PlayerDashboardSkillsUI.localization.format("Skill", new object[]
                {
                    PlayerDashboardSkillsUI.localization.format(string.Concat(new object[]
                    {
                        "Speciality_",
                        speciality,
                        "_Skill_",
                        index
                    })),
                    PlayerDashboardSkillsUI.localization.format("Level_" + skill.level)
                }),
                foregroundColor = Palette.COLOR_Y,
                foregroundTint  = ESleekTint.NONE,
                fontSize        = 14
            });
            SleekImageTexture sleekImageTexture2 = new SleekImageTexture();

            sleekImageTexture2.positionOffset_X = 10;
            sleekImageTexture2.positionOffset_Y = -10;
            sleekImageTexture2.positionScale_Y  = 0.5f;
            sleekImageTexture2.sizeOffset_X     = 20;
            sleekImageTexture2.sizeOffset_Y     = 20;
            sleekImageTexture2.backgroundTint   = ESleekTint.FOREGROUND;
            byte b2 = 0;

            while ((int)b2 < PlayerSkills.SKILLSETS.Length)
            {
                byte b3 = 0;
                while ((int)b3 < PlayerSkills.SKILLSETS[(int)b2].Length)
                {
                    SpecialitySkillPair specialitySkillPair = PlayerSkills.SKILLSETS[(int)b2][(int)b3];
                    if ((int)speciality == specialitySkillPair.speciality && (int)index == specialitySkillPair.skill)
                    {
                        sleekImageTexture2.texture = (Texture2D)MenuSurvivorsCharacterUI.icons.load("Skillset_" + b2);
                        break;
                    }
                    b3 += 1;
                }
                b2 += 1;
            }
            base.add(sleekImageTexture2);
            base.add(new SleekLabel
            {
                positionOffset_X = 5,
                positionOffset_Y = -35,
                positionScale_Y  = 1f,
                sizeOffset_X     = -10,
                sizeOffset_Y     = 30,
                sizeScale_X      = 0.5f,
                foregroundTint   = ESleekTint.NONE,
                fontAlignment    = TextAnchor.LowerLeft,
                text             = PlayerDashboardSkillsUI.localization.format(string.Concat(new object[]
                {
                    "Speciality_",
                    speciality,
                    "_Skill_",
                    index,
                    "_Tooltip"
                }))
            });
            if (skill.level > 0)
            {
                base.add(new SleekLabel
                {
                    positionOffset_X = 5,
                    positionOffset_Y = 5,
                    positionScale_X  = 0.25f,
                    sizeOffset_X     = -10,
                    sizeOffset_Y     = -10,
                    sizeScale_X      = 0.5f,
                    sizeScale_Y      = 0.5f,
                    foregroundTint   = ESleekTint.NONE,
                    fontAlignment    = TextAnchor.MiddleCenter,
                    text             = PlayerDashboardSkillsUI.localization.format("Bonus_Current", new object[]
                    {
                        PlayerDashboardSkillsUI.localization.format(string.Concat(new object[]
                        {
                            "Speciality_",
                            speciality,
                            "_Skill_",
                            index,
                            "_Level_",
                            skill.level
                        }))
                    }),
                    foregroundColor = Palette.COLOR_G
                });
            }
            if (skill.level < skill.max)
            {
                base.add(new SleekLabel
                {
                    positionOffset_X = 5,
                    positionOffset_Y = 5,
                    positionScale_X  = 0.25f,
                    positionScale_Y  = 0.5f,
                    sizeOffset_X     = -10,
                    sizeOffset_Y     = -10,
                    sizeScale_X      = 0.5f,
                    sizeScale_Y      = 0.5f,
                    fontAlignment    = TextAnchor.MiddleCenter,
                    foregroundTint   = ESleekTint.NONE,
                    text             = PlayerDashboardSkillsUI.localization.format("Bonus_Next", new object[]
                    {
                        PlayerDashboardSkillsUI.localization.format(string.Concat(new object[]
                        {
                            "Speciality_",
                            speciality,
                            "_Skill_",
                            index,
                            "_Level_",
                            (int)(skill.level + 1)
                        }))
                    }),
                    foregroundColor = Palette.COLOR_G
                });
            }
            SleekLabel sleekLabel = new SleekLabel();

            sleekLabel.positionOffset_X = 5;
            sleekLabel.positionOffset_Y = -35;
            sleekLabel.positionScale_X  = 0.5f;
            sleekLabel.positionScale_Y  = 1f;
            sleekLabel.sizeOffset_X     = -10;
            sleekLabel.sizeOffset_Y     = 30;
            sleekLabel.sizeScale_X      = 0.5f;
            sleekLabel.foregroundColor  = Palette.COLOR_Y;
            sleekLabel.foregroundTint   = ESleekTint.NONE;
            sleekLabel.fontAlignment    = TextAnchor.LowerRight;
            if (skill.level < skill.max)
            {
                sleekLabel.text = PlayerDashboardSkillsUI.localization.format("Cost", new object[]
                {
                    Player.player.skills.cost((int)speciality, (int)index)
                });
            }
            else
            {
                sleekLabel.text = PlayerDashboardSkillsUI.localization.format("Full");
            }
            base.add(sleekLabel);
            base.tooltip = PlayerDashboardSkillsUI.localization.format(string.Concat(new object[]
            {
                "Speciality_",
                speciality,
                "_Skill_",
                index,
                "_Tooltip"
            }));
        }