private void Neededvaribles(out Damageable[] d, out Characters fromvc) { Damageable[] e; Damageable[] vc; if ((Target & Kernel_bin.Target.Single_Target) != 0) { e = new Enemy[] { Enemy.Party[TargetParty.CURSOR_SELECT < Enemy.Party.Count ? TargetParty.CURSOR_SELECT : Enemy.Party.Count - 1] }; var charvar = Memory.State.Party.Where(x => x != Characters.Blank).ToList()[TargetParty.CURSOR_SELECT]; vc = new Saves.CharacterData[] { Memory.State[charvar] }; } else { vc = Memory.State.Party.Where(x => x != Characters.Blank).Select(y => Memory.State[y]).ToArray(); e = Enemy.Party.ToArray(); } Characters c = Memory.State.PartyData.Where(x => x != Characters.Blank).ToList()[TargetParty.CURSOR_SELECT]; int p = BattleMenus.Player; Characters fromc = Memory.State.PartyData.Where(x => x != Characters.Blank).ToList()[p]; fromvc = Memory.State.Party.Where(x => x != Characters.Blank).ToList()[p]; d = vc; if ((TargetEnemies.Cursor_Status & Cursor_Status.Enabled) != 0 && TargetEnemies.Enabled) { d = e; } DebugMessageCommand(TargetEnemies, d, fromvc); }
public override void Refresh() { if (Memory.State?.Characters != null) { List <KeyValuePair <int, Characters> > party = Memory.State.Party.Select((element, index) => new { element, index }).ToDictionary(m => m.index, m => m.element).Where(m => !m.Value.Equals(Characters.Blank)).ToList(); byte pos = 0; foreach (KeyValuePair <int, Characters> pm in party) { Saves.CharacterData data = Memory.State[Memory.State.PartyData[pm.Key]]; bool ded = data.IsDead; ITEM[pos, 0] = new IGMDataItem.Text(Memory.Strings.GetName(pm.Value), SIZE[pos], ded ? Font.ColorID.Dark_Gray : Font.ColorID.White); pos++; } } }
/// <summary> /// Test if an ability can trigger for Angelo. /// </summary> /// <param name="ability"></param> /// <returns></returns> private static bool TestAngeloAbilityTriggers(Angelo ability) { //else if (8 >= [0..255] Angelo Recover is used (3.3 %) //else if (2 >= [0..255] Angelo Reverse is used (1 %) //else if (8 >= [0..255] Angelo Search is used (3.2 %) //Angelo_Disabled I think is set when Rinoa is in space so angelo is out of reach; //https://gamefaqs.gamespot.com/ps/197343-final-fantasy-viii/faqs/25194 if (Memory.State.BattleMiscFlags.HasFlag(Saves.BattleMiscFlags.AngeloDisabled) || !Memory.State.PartyData.Contains(Characters.Rinoa_Heartilly) || !Memory.State.LimitBreakAngeloCompleted.HasFlag(ability)) { return(false); } else { switch (ability) { case Angelo.Recover: return(Memory.State.Characters.Any(x => x.Value.IsCritical && !x.Value.IsDead && Memory.State.PartyData.Contains(x.Key)) && Memory.Random.Next(256) < 8); case Angelo.Reverse: return(Memory.State.Characters.Any(x => x.Value.IsDead && Memory.State.PartyData.Contains(x.Key)) && Memory.Random.Next(256) < 2); case Angelo.Search: Saves.CharacterData c = Memory.State[Characters.Rinoa_Heartilly]; if (!(c.IsGameOver || c.Statuses1.HasFlag(Kernel_bin.Battle_Only_Statuses.Sleep) || c.Statuses1.HasFlag(Kernel_bin.Battle_Only_Statuses.Stop) || c.Statuses1.HasFlag(Kernel_bin.Battle_Only_Statuses.Confuse) || c.Statuses0.HasFlag(Kernel_bin.Persistent_Statuses.Berserk) || c.Statuses1.HasFlag(Kernel_bin.Battle_Only_Statuses.Angel_Wing))) { return(Memory.Random.Next(256) < 8); } break; } } return(false); }
public Dictionary <Kernel_bin.J_Statuses, byte> getTotal(Saves.CharacterData source, out Enum[] availableFlagsarray) => getTotal <Kernel_bin.J_Statuses>(out availableFlagsarray, 100, Kernel_bin.Stat.ST_Atk, source.Stat_J[Kernel_bin.Stat.ST_Atk]);
public Dictionary <Kernel_bin.Element, byte> getTotal(Saves.CharacterData source, out Enum[] availableFlagsarray) => getTotal <Kernel_bin.Element>(out availableFlagsarray, 200, Kernel_bin.Stat.EL_Def_1, source.Stat_J[Kernel_bin.Stat.EL_Def_1], source.Stat_J[Kernel_bin.Stat.EL_Def_2], source.Stat_J[Kernel_bin.Stat.EL_Def_3], source.Stat_J[Kernel_bin.Stat.EL_Def_4]);
public Dictionary <Kernel.JunctionStatuses, byte> getTotal(Saves.CharacterData source, out Enum[] availableFlagsarray) => getTotal <Kernel.JunctionStatuses>(out availableFlagsarray, 100, Kernel.Stat.StDef1, source.StatJ[Kernel.Stat.StDef1], source.StatJ[Kernel.Stat.StDef2], source.StatJ[Kernel.Stat.StDef3], source.StatJ[Kernel.Stat.StDef4]);
protected void PrevSettingEvent(object sender, Saves.CharacterData e) => //shadowcopy prevSetting = e;
public Dictionary <Kernel.Element, byte> getTotal(Saves.CharacterData source, out Enum[] availableFlagsarray) => getTotal <Kernel.Element>(out availableFlagsarray, 200, Kernel.Stat.ElAtk, source.StatJ[Kernel.Stat.ElAtk]);
public override void Refresh() { if (Memory.State?.Characters != null) { List <KeyValuePair <int, Characters> > party = Memory.State.Party.Select((element, index) => new { element, index }).ToDictionary(m => m.index, m => m.element).Where(m => !m.Value.Equals(Characters.Blank)).ToList(); byte pos = (byte)party.FindIndex(x => x.Value == VisableCharacter); foreach (KeyValuePair <int, Characters> pm in party.Where(x => x.Value == VisableCharacter)) { Saves.CharacterData c = Memory.State.Characters[Memory.State.PartyData[pm.Key]]; FF8String name = Memory.Strings.GetName(pm.Value); int HP = c.CurrentHP(pm.Value); //int MaxHP = c.MaxHP(pm.Value); //float HPpercent = c.PercentFullHP(pm.Value); int CriticalHP = c.CriticalHP(pm.Value); Font.ColorID colorid = Font.ColorID.White; byte palette = 2; if (HP < CriticalHP) { colorid = Font.ColorID.Yellow; palette = 6; } if (HP <= 0) { colorid = Font.ColorID.Red; palette = 5; } byte? fadedpalette = null; Font.ColorID?fadedcolorid = null; bool blink = false; if (mode == Mode.YourTurn) { blink = true; fadedpalette = 7; fadedcolorid = Font.ColorID.Grey; ITEM[pos, 2] = new IGMDataItem_Texture(dot, new Rectangle(SIZE[pos].X + 230, SIZE[pos].Y + 12, 150, 15), Color.LightYellow * .8f, new Color(125, 125, 0, 255) * .8f) { Blink = blink }; } else if (mode == Mode.ATB_Charged) { ITEM[pos, 2] = new IGMDataItem_Texture(dot, new Rectangle(SIZE[pos].X + 230, SIZE[pos].Y + 12, 150, 15), Color.Yellow * .8f); } // insert gradient atb bar here. Though this probably belongs in the update // method as it'll be in constant flux. else { ITEM[pos, 2] = null; } // TODO: make a font render that can draw right to left from a point. For Right aligning the names. ITEM[pos, 0] = new IGMDataItem_String(name, new Rectangle(SIZE[pos].X, SIZE[pos].Y, 0, 0), colorid, faded_fontcolor: fadedcolorid) { Blink = blink }; ITEM[pos, 1] = new IGMDataItem_Int(HP, new Rectangle(SIZE[pos].X + 128, SIZE[pos].Y, 0, 0), palette: palette, faded_palette: fadedpalette, spaces: 4, numtype: Icons.NumType.Num_8x16_1) { Blink = blink }; ITEM[pos, 3] = new IGMDataItem_Icon(Icons.ID.Size_08x64_Bar, new Rectangle(SIZE[pos].X + 230, SIZE[pos].Y + 12, 150, 15), 0); pos++; } base.Refresh(); } }
public bool GetCharacterData(out Saves.CharacterData character) => GetCast(out character);