示例#1
0
 public EntityStats(int might, int agility, int fortitude, int intellect, int resolve)
 {
     this.might     = new Might(might);
     this.agility   = new Agility(agility);
     this.fortitude = new Fortitude(fortitude);
     this.intellect = new Intellect(intellect);
     this.resolve   = new Resolve(resolve);
 }
 protected override void ShowScrollViewElements(int marginTop, GUIStyle labelStyle)
 {
     if (MightUi.scrollBarsToZero)
     {
         base.SetScrollbarPosition(Vector2.zero);
         MightUi.scrollBarsToZero = false;
     }
     foreach (Might current in App.State.AllMights)
     {
         if (current.ShadowCloneCount > 0)
         {
             current.ShouldUpdateText = true;
         }
         if (current.TypeEnum == Might.MightType.focused_breathing)
         {
             marginTop           += 35;
             labelStyle.alignment = TextAnchor.UpperCenter;
             labelStyle.fontStyle = FontStyle.Bold;
             labelStyle.fontSize  = GuiBase.FontSize(18);
             GUI.Label(new Rect(GuiBase.Width(15f), GuiBase.Height((float)marginTop), GuiBase.Width(220f), GuiBase.Height(30f)), "Usable Skills");
             labelStyle.fontStyle = FontStyle.Normal;
             marginTop           += 35;
         }
         labelStyle.fontSize = GuiBase.FontSize(16);
         GuiBase.CreateProgressBar(marginTop, current.getPercent(), current.Name, current.Description, GuiBase.progressBg, GuiBase.progressFgBlue);
         GUI.Label(new Rect(GuiBase.Width(210f), GuiBase.Height((float)marginTop), GuiBase.Width(110f), GuiBase.Height(30f)), current.Level.CommaFormatted);
         GUI.Label(new Rect(GuiBase.Width(380f), GuiBase.Height((float)marginTop), GuiBase.Width(100f), GuiBase.Height(30f)), current.ShadowCloneCount.CommaFormatted);
         if (App.CurrentPlattform == Plattform.Android)
         {
             GUIStyle textField = Gui.ChosenSkin.textField;
             if (GUI.Button(new Rect(GuiBase.Width(315f), GuiBase.Height((float)marginTop), GuiBase.Width(55f), GuiBase.Height(25f)), current.NextAt.ToString(), textField))
             {
                 Might migh = current;
                 base.ShowNumberInput("Next at for " + migh.Name, migh.NextAt, 2147483647, delegate(CDouble x)
                 {
                     migh.NextAt = x.ToInt();
                 });
             }
         }
         else
         {
             int    num = 0;
             string s   = GUI.TextField(new Rect(GuiBase.Width(315f), GuiBase.Height((float)marginTop), GuiBase.Width(55f), GuiBase.Height(25f)), current.NextAt.ToString());
             int.TryParse(s, out num);
             if (num >= 0)
             {
                 current.NextAt = num;
             }
         }
         if (GUI.Button(new Rect(GuiBase.Width(500f), GuiBase.Height((float)marginTop), GuiBase.Width(40f), GuiBase.Height(30f)), "+"))
         {
             current.AddCloneCount(App.State.GameSettings.ClonesToAddCount);
         }
         if (GUI.Button(new Rect(GuiBase.Width(560f), GuiBase.Height((float)marginTop), GuiBase.Width(40f), GuiBase.Height(30f)), "-"))
         {
             current.RemoveCloneCount(App.State.GameSettings.ClonesToAddCount);
         }
         if (current.IsUsable)
         {
             marginTop += 35;
             if (current.DurationLeft > 0L)
             {
                 float num2 = GuiBase.Width(185f);
                 GUI.BeginGroup(new Rect(GuiBase.Width(30f), GuiBase.Height((float)marginTop), num2, GuiBase.Height(25f)));
                 GUI.DrawTexture(new Rect(0f, 0f, num2, GuiBase.Height(25f)), GuiBase.progressBg);
                 float num3  = (float)current.DurationLeft / ((float)current.UseDuration * 1000f);
                 float width = num3 * num2;
                 float x2    = 0f;
                 GUI.DrawTexture(new Rect(x2, 0f, width, GuiBase.Height(25f)), GuiBase.progressFgGreen);
                 GUI.EndGroup();
             }
             else if (current.UseCoolDown > 0L)
             {
                 double percent = (double)current.UseCoolDown / 3600000.0;
                 GuiBase.CreateProgressBar(marginTop, percent, Conv.MsToGuiText(current.UseCoolDown, true), current.UnleashDesc + "\n\nYou can use it again when timer hits zero.", GuiBase.progressBg, GuiBase.progressFgRed);
             }
             else if (GUI.Button(new Rect(GuiBase.Width(60f), GuiBase.Height((float)marginTop), GuiBase.Width(120f), GuiBase.Height(30f)), new GUIContent("Unleash", current.UnleashDesc)))
             {
                 if (SpecialFightUi.IsFighting)
                 {
                     GuiBase.ShowToast("Please finish your special fight first!");
                 }
                 else
                 {
                     current.Unleash();
                 }
             }
         }
         marginTop += 35;
     }
 }
示例#3
0
        private void CalcMight(long timeMS, StringBuilder infoBuilder)
        {
            long num = 0L;

            if (this.State.PremiumBoni.TotalMightIsUnlocked)
            {
                using (List <Might> .Enumerator enumerator = this.State.AllMights.GetEnumerator())
                {
                    while (enumerator.MoveNext())
                    {
                        Might might = enumerator.Current;
                        if (might.ShadowCloneCount > 0)
                        {
                            long value = timeMS;
                            if (num > 0L)
                            {
                                value = num;
                                num   = 0L;
                            }
                            int  num2 = might.ShadowCloneCount.ToInt();
                            long num3 = might.DurationInMS(1, this.State);
                            long num4 = num3 / (might.Level.ToLong() + 1L);
                            if (num3 < 30L)
                            {
                                num3 = 30L;
                            }
                            if (num4 < 30L)
                            {
                                num4 = 30L;
                            }
                            CDouble rightSide = might.Level * (num3 - num4) / 2 + might.CurrentDuration;
                            CDouble leftSide  = value * might.ShadowCloneCount + rightSide;
                            CDouble cDouble   = Math.Sqrt((leftSide / num4).Double) * 1.414215;
                            int     num5      = (cDouble.Floored - might.Level).ToInt();
                            if (num5 > 0)
                            {
                                if (might.NextAt > 0 && might.Level + num5 >= might.NextAt)
                                {
                                    int num6 = num5;
                                    num5 = 0;
                                    if (might.Level < might.NextAt)
                                    {
                                        num5 = might.NextAt - might.Level.ToInt();
                                    }
                                    num6 -= num5;
                                    num   = (num4 * might.Level.ToLong() * (long)num6 + num4 * (might.Level.ToLong() + (long)num5 + (long)num6) * (long)num6) / 2L / (long)num2;
                                    might.RemoveCloneCount(num2);
                                    Might might2 = this.State.AllMights.FirstOrDefault((Might x) => x.TypeEnum == might.TypeEnum + 1);
                                    if (might2 == null)
                                    {
                                        might2 = this.State.AllMights[0];
                                    }
                                    might2.AddCloneCount(num2);
                                }
                                if (num5 > 0)
                                {
                                    might.CurrentDuration              = (num3 * (cDouble - cDouble.Floored)).ToLong();
                                    might.Level                       += num5;
                                    this.State.PremiumBoni.TotalMight += (long)num5;
                                    infoBuilder.Append("- gained ").Append(num5).Append(" levels in ' ").Append(might.Name).Append(" '\n");
                                }
                            }
                            if (num5 == 0 && might.Level < might.NextAt)
                            {
                                might.CurrentDuration += timeMS * (long)num2;
                            }
                        }
                        if (might.DurationLeft > 0L)
                        {
                            might.DurationLeft -= timeMS;
                            if (might.DurationLeft <= 0L)
                            {
                                might.DurationLeft = 0L;
                                might.UseCoolDown  = 3600000L;
                            }
                        }
                        if (might.UseCoolDown > 0L)
                        {
                            might.UseCoolDown -= timeMS;
                            if (might.UseCoolDown <= 0L)
                            {
                                might.UseCoolDown = 0L;
                            }
                        }
                    }
                }
            }
        }
示例#4
0
 internal MightFlame(StatAllocationGUI gui, Might stat, Vector2 position) : base(gui, stat, position)
 {
 }