public override void Refresh() { if (Memory.State?.Characters != null && Damageable != null && Damageable.GetCharacterData(out Saves.CharacterData _c)) { List <KeyValuePair <int, Characters> > party = GetParty(); byte pos = GetCharPos(party); foreach (KeyValuePair <int, Characters> pm in party.Where(x => x.Value == _c.ID)) { bool blink = false; bool charging = false; if (Damageable.GetBattleMode().Equals(Damageable.BattleMode.YourTurn)) { ((IGMDataItem.Texture)ITEM[pos, (int)DepthID.ATBCharged]).Color = Color.LightYellow * .8f; blink = true; } else if (Damageable.GetBattleMode().Equals(Damageable.BattleMode.ATB_Charged)) { ((IGMDataItem.Texture)ITEM[pos, (int)DepthID.ATBCharged]).Color = Color.Yellow * .8f; } else if (Damageable.GetBattleMode().Equals(Damageable.BattleMode.ATB_Charging)) { charging = true; ((IGMDataItem.Gradient.ATB)ITEM[pos, (int)DepthID.ATBCharging]).Refresh(Damageable); } ((IGMDataItem.Texture)ITEM[pos, (int)DepthID.ATBCharged]).Blink = blink; if (charging) { ITEM[pos, (int)DepthID.ATBCharged].Hide(); ITEM[pos, (int)DepthID.ATBCharging].Show(); } else { ITEM[pos, (int)DepthID.ATBCharging].Hide(); ITEM[pos, (int)DepthID.ATBCharged].Show(); } ((IGMDataItem.Text)ITEM[pos, (byte)DepthID.Name]).Blink = blink; ((IGMDataItem.Integer)ITEM[pos, (byte)DepthID.HP]).Blink = blink; pos++; } base.Refresh(); } }
/// <summary> /// Things that may of changed before screen loads or junction is changed. /// </summary> public override void Refresh() { if (Memory.State.Characters != null && Damageable.GetCharacterData(out Saves.CharacterData c)) { base.Refresh(); ITEM[0, 0] = new IGMDataItem.Face(c.ID.ToFacesID(), new Rectangle(X + 12, Y, 96, 144)); ITEM[0, 2] = new IGMDataItem.Text(Damageable.Name, new Rectangle(X + 117, Y + 0, 0, 0)); ITEM[0, 4] = new IGMDataItem.Integer(Damageable.Level, new Rectangle(X + 117 + 35, Y + 54, 0, 0), 13, numtype: Icons.NumType.sysFntBig, padding: 1, spaces: 6); ITEM[0, 5] = Memory.State.Party != null && Memory.State.Party.Contains(c.ID) ? new IGMDataItem.Icon(Icons.ID.InParty, new Rectangle(X + 278, Y + 48, 0, 0), 6) : null; ITEM[0, 7] = new IGMDataItem.Integer(Damageable.CurrentHP(), new Rectangle(X + 152, Y + 108, 0, 0), 13, numtype: Icons.NumType.sysFntBig, padding: 1, spaces: 6); ITEM[0, 9] = new IGMDataItem.Integer(Damageable.MaxHP(), new Rectangle(X + 292, Y + 108, 0, 0), 13, numtype: Icons.NumType.sysFntBig, padding: 1, spaces: 5); ITEM[0, 11] = new IGMDataItem.Integer((int)c.Experience, new Rectangle(X + 192, Y + 198, 0, 0), 13, numtype: Icons.NumType.Num_8x8_2, padding: 1, spaces: 9); ITEM[0, 13] = new IGMDataItem.Integer(c.ExperienceToNextLevel, new Rectangle(X + 192, Y + 231, 0, 0), 13, numtype: Icons.NumType.Num_8x8_2, padding: 1, spaces: 9); } }
public override void Refresh(Damageable damageable) { if (Damageable != damageable) { if (Damageable != null) { Damageable.BattleModeChangeEventHandler -= ModeChangeEvent; } base.Refresh(damageable); if (Damageable != null) { Damageable.BattleModeChangeEventHandler += ModeChangeEvent; SetMode(Damageable.BattleMode.ATB_Charging); } } else { base.Refresh(Damageable); } }
/// <summary> /// Things that may of changed before screen loads or junction is changed. /// </summary> public override void Refresh() { if (Memory.State?.Characters != null && Damageable != null && Damageable.GetCharacterData(out var c)) { base.Refresh(); ((IGMDataItem.Face)ITEM[0, 0]).Data = c.ID.ToFacesID(); ((IGMDataItem.Text)ITEM[0, 2]).Data = Damageable.Name; ((IGMDataItem.Integer)ITEM[0, 4]).Data = Damageable.Level; if (Memory.State.Party != null && Memory.State.Party.Contains(c.ID)) { ITEM[0, 5].Show(); } else { ITEM[0, 5].Hide(); } ((IGMDataItem.Integer)ITEM[0, 7]).Data = Damageable.CurrentHP(); ((IGMDataItem.Integer)ITEM[0, 9]).Data = Damageable.MaxHP(); ((IGMDataItem.Integer)ITEM[0, 11]).Data = (int)c.Experience; ((IGMDataItem.Integer)ITEM[0, 13]).Data = c.ExperienceToNextLevel; } }
private void ReInitEvent(object sender, Damageable e) => Refresh(e);
public override bool Update() { if (!Enabled) { return(false); } bool done = false; bool hot = false; ((IGMDataItem.Icon)ITEM[Count - 5, 0]).Data = Icons.ID._0_Hit_ + _count; ((IGMDataItem.Texture)ITEM[Count - 4, 0]).Color = HitSlider.Update(); int hotcnt = 0; int pos = 0; foreach (Menu_Base i in ITEM) { if (i?.GetType() == typeof(IGMDataItem.Gradient.Renzokeken) && pos++ < _hits) { IGMDataItem.Gradient.Renzokeken gr = (IGMDataItem.Gradient.Renzokeken)i; done = !gr.Done || done; hot = gr.Trigger || hot; if (gr.Done) { hotcnt++; } } } if (!done) { if ((delayMS += Memory.gameTime.ElapsedGameTime.TotalMilliseconds) > 1000) { Damageable.EndTurn(); } } if (hot) { ((IGMDataItem.Icon)ITEM[Count - 3, 0]).Palette = 6; ((IGMDataItem.Icon)ITEM[Count - 2, 0]).Palette = 6; ((IGMDataItem.Texture)ITEM[0, 0]).Color = rc; ITEM[Count - 1, 0].Show(); ITEM[Count - 5, 0].Hide(); ITEM[Count - 6, 0].Hide(); } else { ((IGMDataItem.Icon)ITEM[Count - 3, 0]).Palette = 2; ((IGMDataItem.Icon)ITEM[Count - 2, 0]).Palette = 2; ((IGMDataItem.Texture)ITEM[0, 0]).Color = rcdim; if ((hotcnt >= _hits) || !done)// && ITEM[Count - 1, 0].Enabled) { if (_count >= _hits) { ITEM[Count - 6, 0].Show(); } else if (_count > 0) { ITEM[Count - 5, 0].Show(); } } //else if (hotcnt > 0) Debug.WriteLine(hotcnt); ITEM[Count - 1, 0].Hide(); } base.Update(); return(true); }
public ATBTimer(Damageable damageable) => Refresh(damageable);
/// <summary> /// if you use this you will get no exp, ap, or items, No character specifics for this menu. /// </summary> public override void Refresh(Damageable damageable, bool backup = false) { }
/// <summary> /// Things that may of changed before screen loads or junction is changed. /// </summary> public override void Refresh() { if (Memory.State?.Characters != null) { Contents = Array.ConvertAll(Contents, c => c = default); base.Refresh(); if (unlocked != null) { ((IGMDataItem.Icon)ITEM[5, 0]).Palette = (byte)(unlocked.Contains(Kernel_bin.Abilities.ST_Atk_J) ? 2 : 7); ((IGMDataItem.Icon)ITEM[5, 1]).Palette = (byte)(unlocked.Contains(Kernel_bin.Abilities.ST_Def_Jx1) || unlocked.Contains(Kernel_bin.Abilities.ST_Def_Jx2) || unlocked.Contains(Kernel_bin.Abilities.ST_Def_Jx4) ? 2 : 7); ((IGMDataItem.Icon)ITEM[5, 2]).Palette = (byte)(unlocked.Contains(Kernel_bin.Abilities.EL_Atk_J) ? 2 : 7); ((IGMDataItem.Icon)ITEM[5, 3]).Palette = (byte)(unlocked.Contains(Kernel_bin.Abilities.EL_Def_Jx1) || unlocked.Contains(Kernel_bin.Abilities.EL_Def_Jx2) || unlocked.Contains(Kernel_bin.Abilities.EL_Def_Jx4) ? 2 : 7); BLANKS[5] = true; foreach (Kernel_bin.Stat stat in Stat2Icon.Keys.OrderBy(o => (byte)o)) { if (Damageable.GetCharacterData(out Saves.CharacterData c)) { bool isUnlocked = unlocked.Contains(Kernel_bin.Stat2Ability[stat]); int pos = (int)stat; if (pos >= 5) { pos++; } Contents[pos] = stat; FF8String name = Kernel_bin.MagicData[c.Stat_J[stat]].Name; if (name == null || name.Length == 0) { name = Strings.Name._; } ushort currentValue = Damageable.TotalStat(stat); ushort previousValue = GetPrevSetting()?.TotalStat(stat) ?? currentValue; ((IGMDataItem.Text)ITEM[pos, 1]).Data = name; ((IGMDataItem.Integer)ITEM[pos, 2]).Data = currentValue; if (previousValue == currentValue) { ITEM[pos, 4].Hide(); if (isUnlocked) { SetPalettes(pos, 2); SetFontColor(pos, Font.ColorID.White); } else { SetPalettes(pos, 7); SetFontColor(pos, Font.ColorID.Grey); } } else if (previousValue > currentValue) { SetPalettes(pos, 5, 16, Icons.ID.Arrow_Down); SetFontColor(pos, Font.ColorID.Red); } else { SetPalettes(pos, 6, 17, Icons.ID.Arrow_Up); SetFontColor(pos, Font.ColorID.Yellow); } BLANKS[pos] = !isUnlocked; } } } } }
/// <summary> /// Things that may of changed before screen loads or junction is changed. /// </summary> public override void Refresh() { if (Memory.State.Characters != null) { Contents = Array.ConvertAll(Contents, c => c = default); base.Refresh(); if (Memory.State.Characters != null && unlocked != null) { ITEM[5, 0] = new IGMDataItem.Icon(Icons.ID.Icon_Status_Attack, new Rectangle(SIZE[5].X + 200, SIZE[5].Y, 0, 0), (byte)(unlocked.Contains(Kernel_bin.Abilities.ST_Atk_J) ? 2 : 7)); ITEM[5, 1] = new IGMDataItem.Icon(Icons.ID.Icon_Status_Defense, new Rectangle(SIZE[5].X + 240, SIZE[5].Y, 0, 0), (byte)(unlocked.Contains(Kernel_bin.Abilities.ST_Def_Jx1) || unlocked.Contains(Kernel_bin.Abilities.ST_Def_Jx2) || unlocked.Contains(Kernel_bin.Abilities.ST_Def_Jx4) ? 2 : 7)); ITEM[5, 2] = new IGMDataItem.Icon(Icons.ID.Icon_Elemental_Attack, new Rectangle(SIZE[5].X + 280, SIZE[5].Y, 0, 0), (byte)(unlocked.Contains(Kernel_bin.Abilities.EL_Atk_J) ? 2 : 7)); ITEM[5, 3] = new IGMDataItem.Icon(Icons.ID.Icon_Elemental_Defense, new Rectangle(SIZE[5].X + 320, SIZE[5].Y, 0, 0), (byte)(unlocked.Contains(Kernel_bin.Abilities.EL_Def_Jx1) || unlocked.Contains(Kernel_bin.Abilities.EL_Def_Jx2) || unlocked.Contains(Kernel_bin.Abilities.EL_Def_Jx4) ? 2 : 7)); BLANKS[5] = true; foreach (Kernel_bin.Stat stat in (Kernel_bin.Stat[])Enum.GetValues(typeof(Kernel_bin.Stat))) { if (Stat2Icon.ContainsKey(stat) && Damageable.GetCharacterData(out Saves.CharacterData c)) { int pos = (int)stat; if (pos >= 5) { pos++; } Contents[pos] = stat; FF8String name = Kernel_bin.MagicData[c.Stat_J[stat]].Name; if (name == null || name.Length == 0) { name = Misc[Items._]; } ITEM[pos, 0] = new IGMDataItem.Icon(Stat2Icon[stat], new Rectangle(SIZE[pos].X, SIZE[pos].Y, 0, 0), 2); ITEM[pos, 1] = new IGMDataItem.Text(name, new Rectangle(SIZE[pos].X + 80, SIZE[pos].Y, 0, 0)); if (!unlocked.Contains(Kernel_bin.Stat2Ability[stat])) { ((IGMDataItem.Icon)ITEM[pos, 0]).Palette = ((IGMDataItem.Icon)ITEM[pos, 0]).Faded_Palette = 7; ((IGMDataItem.Text)ITEM[pos, 1]).FontColor = Font.ColorID.Grey; BLANKS[pos] = true; } else { BLANKS[pos] = false; } ITEM[pos, 2] = new IGMDataItem.Integer(Damageable.TotalStat(stat), new Rectangle(SIZE[pos].X + 152, SIZE[pos].Y, 0, 0), 2, Icons.NumType.sysFntBig, spaces: 10); ITEM[pos, 3] = stat == Kernel_bin.Stat.HIT || stat == Kernel_bin.Stat.EVA ? new IGMDataItem.Text(Misc[Items.Percent], new Rectangle(SIZE[pos].X + 350, SIZE[pos].Y, 0, 0)) : null; if (GetPrevSetting() == null || (Damageable.GetCharacterData(out Saves.CharacterData _c) && GetPrevSetting().Stat_J[stat] == _c.Stat_J[stat]) || GetPrevSetting().TotalStat(stat) == Damageable.TotalStat(stat)) { ITEM[pos, 4] = null; } else if (GetPrevSetting().TotalStat(stat) > Damageable.TotalStat(stat)) { ((IGMDataItem.Icon)ITEM[pos, 0]).Palette = 5; ((IGMDataItem.Icon)ITEM[pos, 0]).Faded_Palette = 5; ((IGMDataItem.Text)ITEM[pos, 1]).FontColor = Font.ColorID.Red; ((IGMDataItem.Integer)ITEM[pos, 2]).FontColor = Font.ColorID.Red; if (ITEM[pos, 3] != null) { ((IGMDataItem.Text)ITEM[pos, 3]).FontColor = Font.ColorID.Red; } ITEM[pos, 4] = new IGMDataItem.Icon(Icons.ID.Arrow_Down, new Rectangle(SIZE[pos].X + 250, SIZE[pos].Y, 0, 0), 16); } else { ((IGMDataItem.Icon)ITEM[pos, 0]).Palette = 6; ((IGMDataItem.Icon)ITEM[pos, 0]).Faded_Palette = 6; ((IGMDataItem.Text)ITEM[pos, 1]).FontColor = Font.ColorID.Yellow; ((IGMDataItem.Integer)ITEM[pos, 2]).FontColor = Font.ColorID.Yellow; if (ITEM[pos, 3] != null) { ((IGMDataItem.Text)ITEM[pos, 3]).FontColor = Font.ColorID.Yellow; } ITEM[pos, 4] = new IGMDataItem.Icon(Icons.ID.Arrow_Up, new Rectangle(SIZE[pos].X + 250, SIZE[pos].Y, 0, 0), 17); } } } } }
//private Mode _mode = Mode.Waiting; #region Methods //public BattleMenu(Damageable damageable) : base(damageable) //{ //} public static BattleMenu Create(Damageable damageable) => Create <BattleMenu>(damageable);
public IGMData_HP(Rectangle pos, Damageable damageable) : base(3, 5, new IGMDataItem.Empty(pos), 1, 3, damageable) { }
//private Mode _mode = Mode.Waiting; #region Constructors public BattleMenu(Damageable damageable) : base(damageable) { }
public override bool SetMode(Enum mode) => Damageable.SetBattleMode(mode);
public Menu(Damageable damageable) { _damageable = damageable; InitConstructor(); // because base() would always run first :( }
public override void Refresh(Damageable damageable) { base.Refresh(damageable); Draw_Pool?.Refresh(damageable); }
protected override void Init() { if (CommandFunc == null) { CommandFunc = new Dictionary <int, Func <bool> > { //{0,Command00 }, { 1, Command01_ATTACK }, { 2, Command02_MAGIC }, //{3,Command03_GF }, { 4, Command04_ITEM }, { 5, Command05_RENZOKUKEN }, { 6, Command06_DRAW }, { 7, Command07_DEVOUR }, //{8,Command08_UNNAMED }, //{9,Command09_CAST }, //{10,Command10_STOCK }, { 11, Command11_DUEL }, { 12, Command12_MUG }, //{13,Command13_NOMSG }, { 14, Command14_SHOT }, { 15, Command15_BLUE_MAGIC }, //{16,Command16_SLOT }, { 17, Command17_FIRE_CROSS_NO_MERCY }, { 18, Command18_SORCERY_ICE_STRIKE }, { 19, Command19_COMBINE }, { 20, Command20_DESPERADO }, { 21, Command21_BLOOD_PAIN }, { 22, Command22_MASSIVE_ANCHOR }, //{23,Command23_DEFEND }, { 24, Command24_MADRUSH }, { 25, Command25_TREATMENT }, { 26, Command26_RECOVERY }, { 27, Command27_REVIVE }, { 28, Command28_DARKSIDE }, { 29, Command29_CARD }, { 30, Command30_DOOM }, { 31, Command31_KAMIKAZI }, { 32, Command32_ABSORB }, { 33, Command33_LVL_DOWN }, { 34, Command34_LVL_UP }, { 35, Command35_SINGLE }, { 36, Command36_DOUBLE }, { 37, Command37_TRIPLE }, { 38, Command38_MINIMOG }, } } ; base.Init(); //bool Command00() => throw new NotImplementedException(); bool Command01_ATTACK() { Neededvaribles(out Damageable[] d, out Characters fromvc); Damageable.EndTurn(); return(true); } bool Command02_MAGIC() { Neededvaribles(out Damageable[] d, out Characters fromvc); Debug.WriteLine($"{Memory.Strings.GetName(fromvc)} casts {Magic.Name}({Magic.ID}) spell on { DebugMessageSuffix(d) }"); Damageable.EndTurn(); return(true); } //bool Command03_GF() => throw new NotImplementedException(); bool Command04_ITEM() { Neededvaribles(out Damageable[] d, out Characters fromvc); Debug.WriteLine($"{Memory.Strings.GetName(fromvc)} uses {Item.Name}({Item.ID}) item on { DebugMessageSuffix(d) }"); Damageable.EndTurn(); return(true); } bool Command05_RENZOKUKEN() { Neededvaribles(out Damageable[] d, out Characters fromvc); if (d.First().GetType() == typeof(Enemy)) { //Renzokuken byte w = Memory.State[fromvc].WeaponID; int hits = 0; if (Memory.State[fromvc].CurrentCrisisLevel > 0) { hits = Memory.State[fromvc].CurrentCrisisLevel < Renzokuken_hits.Length ? Renzokuken_hits[Memory.State[fromvc].CurrentCrisisLevel] : Renzokuken_hits.Last(); } //else return false; else { hits = Renzokuken_hits.First(); } int finisherchance = (Memory.State[fromvc].CurrentCrisisLevel + 1) * 60; bool willfinish = Memory.Random.Next(byte.MaxValue + 1) <= finisherchance; int choosefinish = Memory.Random.Next(3 + 1); Kernel_bin.Weapons_Data wd = Kernel_bin.WeaponsData[w]; Kernel_bin.Renzokeken_Finisher r = wd.Renzokuken; if (r == 0) { willfinish = false; } //per wiki the chance of which finisher is 25% each and the highest value finisher get the remaining of 100 percent. //so rough divide is 100% when you only only have that //when you unlock 2 one is 75% chance //when you onlock 3 last one is 50% //when you unlock all 4 it's 25% each. //finishers each have their own target BattleMenus.GetCurrentBattleMenu().Renzokeken.Reset(hits); BattleMenus.GetCurrentBattleMenu().Renzokeken.Show(); if (willfinish) { List <Kernel_bin.Renzokeken_Finisher> flags = Enum.GetValues(typeof(Kernel_bin.Renzokeken_Finisher)) .Cast <Kernel_bin.Renzokeken_Finisher>() .Where(f => (f & r) != 0) .ToList(); Kernel_bin.Renzokeken_Finisher finisher = choosefinish >= flags.Count ? flags.Last() : flags[choosefinish]; Debug.WriteLine($"{Memory.Strings.GetName(fromvc)} hits {hits} times with {Command.Name}({Command.ID}) then uses {Kernel_bin.RenzokukenFinishersData[finisher].Name}."); } else { Debug.WriteLine($"{Memory.Strings.GetName(fromvc)} hits {hits} times with {Command.Name}({Command.ID}) then fails to use a finisher."); } } return(true); } bool Command06_DRAW() { Neededvaribles(out Damageable[] d, out Characters fromvc); //draw //spawn a 1 page 4 row pool of the magic/gfs that the selected enemy has. if (d.First().GetType() == typeof(Enemy)) { var e = (Enemy)d.First(); DrawMagic(e.DrawList); Draw_Pool.Refresh(e.DrawList); Draw_Pool.Show(); } return(true); } bool Command07_DEVOUR() { Neededvaribles(out Damageable[] d, out Characters fromvc); //TODO add devour commands Debug.WriteLine($"{Memory.Strings.GetName(fromvc)} used {Command.Name}({Command.ID}) on { DebugMessageSuffix(d) }"); Damageable.EndTurn(); return(true); } //bool Command08_UNNAMED() => throw new NotImplementedException(); //bool Command09_CAST() => throw new NotImplementedException(); //bool Command10_STOCK() => throw new NotImplementedException(); bool Command11_DUEL() { Neededvaribles(out Damageable[] d, out Characters fromvc); Debug.WriteLine($"{Memory.Strings.GetName(fromvc)} used {Command.Name}({Command.ID}) on { DebugMessageSuffix(d) }"); Damageable.EndTurn(); return(true); } bool Command12_MUG() { Neededvaribles(out Damageable[] d, out Characters fromvc); if (d.First().GetType() == typeof(Enemy)) { var e = (Enemy)d.First(); //unsure if party member being ejected or if they need to be in the party for rare item to work Saves.Item i = e.Mug(Memory.State[fromvc].SPD, Memory.State.PartyHasAbility(Kernel_bin.Abilities.RareItem)); Debug.WriteLine($"{Memory.Strings.GetName(fromvc)} stole {i.DATA?.Name}({i.ID}) x {i.QTY} from { DebugMessageSuffix(d) }"); } Damageable.EndTurn(); return(true); } //bool Command13_NOMSG() => throw new NotImplementedException(); bool Command14_SHOT() { Neededvaribles(out Damageable[] d, out Characters fromvc); Debug.WriteLine($"{Memory.Strings.GetName(fromvc)} used {Command.Name}({Command.ID}) on { DebugMessageSuffix(d) }"); Damageable.EndTurn(); return(true); } bool Command15_BLUE_MAGIC() { Neededvaribles(out Damageable[] d, out Characters fromvc); Debug.WriteLine($"{Memory.Strings.GetName(fromvc)} casts {BlueMagic.Name}({BlueMagic.ID}) spell on { DebugMessageSuffix(d) }"); Damageable.EndTurn(); return(false); } //bool Command16_SLOT() => throw new NotImplementedException(); bool Command17_FIRE_CROSS_NO_MERCY() { Neededvaribles(out Damageable[] d, out Characters fromvc); Debug.WriteLine($"{Memory.Strings.GetName(fromvc)} used {Command.Name}({Command.ID}) on { DebugMessageSuffix(d) }"); Damageable.EndTurn(); return(true); } bool Command18_SORCERY_ICE_STRIKE() { Neededvaribles(out Damageable[] d, out Characters fromvc); Debug.WriteLine($"{Memory.Strings.GetName(fromvc)} used {Command.Name}({Command.ID}) on { DebugMessageSuffix(d) }"); Damageable.EndTurn(); return(true); } bool Command19_COMBINE() { //perform angelo attack unless angel wing is unlocked and chosen in menu. Neededvaribles(out Damageable[] d, out Characters fromvc); Debug.WriteLine($"{Memory.Strings.GetName(fromvc)} used {Command.Name}({Command.ID}) on { DebugMessageSuffix(d) }"); Damageable.EndTurn(); return(true); } bool Command20_DESPERADO() { Neededvaribles(out Damageable[] d, out Characters fromvc); Debug.WriteLine($"{Memory.Strings.GetName(fromvc)} used {Command.Name}({Command.ID}) on { DebugMessageSuffix(d) }"); Damageable.EndTurn(); return(true); } bool Command21_BLOOD_PAIN() { Neededvaribles(out Damageable[] d, out Characters fromvc); Debug.WriteLine($"{Memory.Strings.GetName(fromvc)} used {Command.Name}({Command.ID}) on { DebugMessageSuffix(d) }"); Damageable.EndTurn(); return(true); } bool Command22_MASSIVE_ANCHOR() { Neededvaribles(out Damageable[] d, out Characters fromvc); Debug.WriteLine($"{Memory.Strings.GetName(fromvc)} used {Command.Name}({Command.ID}) on { DebugMessageSuffix(d) }"); Damageable.EndTurn(); return(true); } //bool Command23_DEFEND() => throw new NotImplementedException(); bool Command24_MADRUSH() { Neededvaribles(out Damageable[] d, out Characters fromvc); Debug.WriteLine($"{Memory.Strings.GetName(fromvc)} used {Command.Name}({Command.ID}) on { DebugMessageSuffix(d) }"); Damageable.EndTurn(); return(true); } bool Command25_TREATMENT() { Neededvaribles(out Damageable[] d, out Characters fromvc); Debug.WriteLine($"{Memory.Strings.GetName(fromvc)} used {Command.Name}({Command.ID}) on { DebugMessageSuffix(d) }"); Damageable.EndTurn(); return(true); } bool Command26_RECOVERY() { Neededvaribles(out Damageable[] d, out Characters fromvc); Debug.WriteLine($"{Memory.Strings.GetName(fromvc)} used {Command.Name}({Command.ID}) on { DebugMessageSuffix(d) }"); Damageable.EndTurn(); return(true); } bool Command27_REVIVE() { Neededvaribles(out Damageable[] d, out Characters fromvc); Debug.WriteLine($"{Memory.Strings.GetName(fromvc)} used {Command.Name}({Command.ID}) on { DebugMessageSuffix(d) }"); Damageable.EndTurn(); return(true); } bool Command28_DARKSIDE() { Neededvaribles(out Damageable[] d, out Characters fromvc); Damageable.EndTurn(); return(true); } bool Command29_CARD() { Neededvaribles(out Damageable[] d, out Characters fromvc); if (d.First().GetType() == typeof(Enemy)) { var e = (Enemy)d.First(); Cards.ID c = e.Card(); if (c == Cards.ID.Fail) { Debug.WriteLine($"{Memory.Strings.GetName(fromvc)} Failed to use {Command.Name}({Command.ID}) on { DebugMessageSuffix(d) }"); } else if (c == Cards.ID.Immune) { Debug.WriteLine($"{Memory.Strings.GetName(fromvc)} Failed to use {Command.Name}({Command.ID}) on { DebugMessageSuffix(d) } because they are immune!"); } else { Debug.WriteLine($"{Memory.Strings.GetName(fromvc)} used {Command.Name}({Command.ID}) on { DebugMessageSuffix(d) } and got a {c} card"); } Damageable.EndTurn(); } return(true); } bool Command30_DOOM() { Neededvaribles(out Damageable[] d, out Characters fromvc); Damageable.EndTurn(); return(true); } bool Command31_KAMIKAZI() { Neededvaribles(out Damageable[] d, out Characters fromvc); Debug.WriteLine($"{Memory.Strings.GetName(fromvc)} used {Command.Name}({Command.ID}) on { DebugMessageSuffix(d) }"); Damageable.EndTurn(); return(true); } bool Command32_ABSORB() { Neededvaribles(out Damageable[] d, out Characters fromvc); Debug.WriteLine($"{Memory.Strings.GetName(fromvc)} used {Command.Name}({Command.ID}) on { DebugMessageSuffix(d) }"); Damageable.EndTurn(); return(true); } bool Command33_LVL_DOWN() { Neededvaribles(out Damageable[] d, out Characters fromvc); Debug.WriteLine($"{Memory.Strings.GetName(fromvc)} used {Command.Name}({Command.ID}) on { DebugMessageSuffix(d) }"); Damageable.EndTurn(); return(true); } bool Command34_LVL_UP() { Neededvaribles(out Damageable[] d, out Characters fromvc); Debug.WriteLine($"{Memory.Strings.GetName(fromvc)} used {Command.Name}({Command.ID}) on { DebugMessageSuffix(d) }"); Damageable.EndTurn(); return(true); } bool Command35_SINGLE() => Command02_MAGIC(); bool Command36_DOUBLE() { // CHOOSE 2X TARGETS throw new NotImplementedException(); } bool Command37_TRIPLE() { // CHOOSE 3X TARGETS throw new NotImplementedException(); } bool Command38_MINIMOG() { Neededvaribles(out Damageable[] d, out Characters fromvc); Debug.WriteLine($"{Memory.Strings.GetName(fromvc)} used {Command.Name}({Command.ID}) on { DebugMessageSuffix(d) }"); Damageable.EndTurn(); return(true); } }
public override void BackupSetting() => SetPrevSetting((Saves.CharacterData)Damageable.Clone());
private void RefreshCharacter(sbyte pos, Damageable damageable) { if (SIZE != null) { ((IGMDataItem.Box)ITEM[pos, 0]).Pos = SIZE[pos]; if (damageable != null) { Contents[pos] = damageable; float yoff = 6; ((IGMDataItem.Box)ITEM[pos, 0]).Data = damageable.Name; ((IGMDataItem.Box)ITEM[pos, 0]).Title = Icons.ID.STATUS; BoxReturn dims = DrawBox(SIZE[pos], ((IGMDataItem.Box)ITEM[pos, 0]).Data, options: Box_Options.SkipDraw); Rectangle r = dims.Font; CURSOR[pos] = dims.Cursor; r = dims.Font; r.Offset(184, yoff); ((IGMDataItem.Icon)ITEM[pos, 1]).Pos = r; r = dims.Font; r.Offset((229), yoff); ((IGMDataItem.Integer)ITEM[pos, 2]).Data = damageable.Level; ((IGMDataItem.Integer)ITEM[pos, 2]).Pos = r; r = dims.Font; r.Offset(304, yoff); ((IGMDataItem.Icon)ITEM[pos, 3]).Pos = r; r = dims.Font; r.Offset((354), yoff); ((IGMDataItem.Integer)ITEM[pos, 4]).Data = damageable.CurrentHP(); ((IGMDataItem.Integer)ITEM[pos, 4]).Pos = r; r = dims.Font; r.Offset(437, yoff); ((IGMDataItem.Icon)ITEM[pos, 5]).Pos = r; r = dims.Font; r.Offset((459), yoff); ((IGMDataItem.Integer)ITEM[pos, 6]).Data = damageable.MaxHP(); ((IGMDataItem.Integer)ITEM[pos, 6]).Pos = r; for (int i = 0; i <= 6; i++) { ITEM[pos, i].Show(); } if ((Memory.State.TeamLaguna || Memory.State.SmallTeam) && damageable.GetCharacterData(out Saves.CharacterData c)) { BLANKS[pos] = false; r = dims.Font; r.Offset(145, 36); FF8String s = Strings.Name.CurrentEXP + "\n" + Strings.Name.NextLEVEL; ((IGMDataItem.Text)ITEM[pos, 7]).Data = s; ((IGMDataItem.Text)ITEM[pos, 7]).Pos = r; r = dims.Font; r.Offset((340), 42); ((IGMDataItem.Integer)ITEM[pos, 8]).Data = checked ((int)c.Experience); ((IGMDataItem.Integer)ITEM[pos, 8]).Pos = r; r = dims.Font; r.Offset(520, 42); ((IGMDataItem.Icon)ITEM[pos, 9]).Pos = r; r = dims.Font; r.Offset((340), 75); ((IGMDataItem.Integer)ITEM[pos, 10]).Data = c.ExperienceToNextLevel; ((IGMDataItem.Integer)ITEM[pos, 10]).Pos = r; r = dims.Font; r.Offset(520, 75); ((IGMDataItem.Icon)ITEM[pos, 11]).Pos = r; for (int i = 7; i < Depth; i++) { ITEM[pos, i].Show(); } } else { for (int i = 7; i < Depth; i++) { ITEM[pos, i].Hide(); } } } else { BlankArea(pos); } } }
private void ReInitCharacter(sbyte pos, Damageable damageable) { if (SIZE != null) { if (damageable != null) { Contents[pos] = damageable; float yoff = 6; ITEM[pos, 0] = new IGMDataItem.Box(damageable.Name, title: Icons.ID.STATUS); Tuple <Rectangle, Point, Rectangle> dims = DrawBox(SIZE[pos], ((IGMDataItem.Box)ITEM[pos, 0]).Data, options: Box_Options.SkipDraw); Rectangle r = dims.Item3; ((IGMDataItem.Box)ITEM[pos, 0]).Pos = dims.Item1; CURSOR[pos] = dims.Item2; r = dims.Item3; r.Offset(184, yoff); ITEM[pos, 1] = new IGMDataItem.Icon(Icons.ID.Lv, r, 13); r = dims.Item3; r.Offset((229), yoff); ITEM[pos, 2] = new IGMDataItem.Integer(damageable.Level, r, 2, 0, 1, 3); r = dims.Item3; r.Offset(304, yoff); ITEM[pos, 3] = new IGMDataItem.Icon(Icons.ID.HP2, r, 13); r = dims.Item3; r.Offset((354), yoff); ITEM[pos, 4] = new IGMDataItem.Integer(damageable.CurrentHP(), r, 2, 0, 1, 4); r = dims.Item3; r.Offset(437, yoff); ITEM[pos, 5] = new IGMDataItem.Icon(Icons.ID.Slash_Forward, r, 13); r = dims.Item3; r.Offset((459), yoff); ITEM[pos, 6] = new IGMDataItem.Integer(damageable.MaxHP(), r, 2, 0, 1, 4); if ((Memory.State.TeamLaguna || Memory.State.SmallTeam) && Damageable.GetCharacterData(out Saves.CharacterData c)) { BLANKS[pos] = false; r = dims.Item3; r.Offset(145, 36); FF8String s = Strings[Items.CurrentEXP] + "\n" + Strings[Items.NextLEVEL]; ITEM[pos, 7] = new IGMDataItem.Text(s, r); r = dims.Item3; r.Offset((340), 42); ITEM[pos, 8] = new IGMDataItem.Integer(checked ((int)c.Experience), r, 2, 0, 1, 9); r = dims.Item3; r.Offset(520, 42); ITEM[pos, 9] = new IGMDataItem.Icon(Icons.ID.P, r, 2); r = dims.Item3; r.Offset((340), 75); ITEM[pos, 10] = new IGMDataItem.Integer(c.ExperienceToNextLevel, r, 2, 0, 1, 9); r = dims.Item3; r.Offset(520, 75); ITEM[pos, 11] = new IGMDataItem.Icon(Icons.ID.P, r, 2); } else { for (int i = 7; i < Depth; i++) { ITEM[pos, i] = null; } } } else { ITEM[pos, 0] = new IGMDataItem.Box(pos: SIZE[pos]); BLANKS[pos] = true; for (int i = 1; i < Depth; i++) { ITEM[pos, i] = null; } } } }
/// <summary> /// Things that may of changed before screen loads or junction is changed. /// </summary> public override void Refresh() { if (Memory.State?.Characters == null) { return; } Contents = Array.ConvertAll(Contents, c => { if (!Enum.IsDefined(typeof(Stat), c)) { throw new InvalidEnumArgumentException(nameof(c), (int)c, typeof(Stat)); } return(Stat.None); }); base.Refresh(); if (unlocked == null) { return; } { ((IGMDataItem.Icon)ITEM[5, 0]).Palette = (byte)(unlocked.Contains(Abilities.StAtkJ) ? 2 : 7); ((IGMDataItem.Icon)ITEM[5, 1]).Palette = (byte)(unlocked.Contains(Abilities.StDefJ) || unlocked.Contains(Abilities.StDefJ2) || unlocked.Contains(Abilities.StDefJ4) ? 2 : 7); ((IGMDataItem.Icon)ITEM[5, 2]).Palette = (byte)(unlocked.Contains(Abilities.ElAtkJ) ? 2 : 7); ((IGMDataItem.Icon)ITEM[5, 3]).Palette = (byte)(unlocked.Contains(Abilities.ElDefJ) || unlocked.Contains(Abilities.ElDefJ2) || unlocked.Contains(Abilities.ElDefJ4) ? 2 : 7); BLANKS[5] = true; foreach (var stat in Stat2Icon.Keys.OrderBy(o => (byte)o)) { if (Damageable.GetCharacterData(out var c)) { var isUnlocked = unlocked.Contains(Kernel.KernelBin.Stat2Ability[stat]); var pos = (int)stat; if (pos >= 5) { pos++; } Contents[pos] = stat; var name = Memory.KernelBin.MagicData[c.StatJ[stat]].Name; if (name == null || name.Length == 0) { name = Strings.Name._; } var currentValue = Damageable.TotalStat(stat); var previousValue = GetPrevSetting()?.TotalStat(stat) ?? currentValue; ((IGMDataItem.Text)ITEM[pos, 1]).Data = name; ((IGMDataItem.Integer)ITEM[pos, 2]).Data = currentValue; if (previousValue == currentValue) { ITEM[pos, 4].Hide(); if (isUnlocked) { SetPalettes(pos, 2); SetFontColor(pos, Font.ColorID.White); } else { SetPalettes(pos, 7); SetFontColor(pos, Font.ColorID.Grey); } } else if (previousValue > currentValue) { SetPalettes(pos, 5, 16, Icons.ID.Arrow_Down); SetFontColor(pos, Font.ColorID.Red); } else { SetPalettes(pos, 6, 17, Icons.ID.Arrow_Up); SetFontColor(pos, Font.ColorID.Yellow); } BLANKS[pos] = !isUnlocked; } } } }
public override Enum GetMode() => Damageable.GetBattleMode();
protected override void Init() { Contents = new Damageable[Count]; base.Init(); }