public HumanFighter(string name, int level, List <Spell> spells = null, List <SpecialMove> specialMoves = null) : base(name , level , LevelUpManager.GetHealthByLevel(level) , LevelUpManager.GetManaByLevel(level) , LevelUpManager.GetStrengthByLevel(level) , LevelUpManager.GetDefenseByLevel(level) , LevelUpManager.GetSpeedByLevel(level) , LevelUpManager.GetEvadeByLevel(level) , LevelUpManager.GetLuckByLevel(level) , SpellFactory.GetSpellsByLevel <HumanFighter>(level) , MoveFactory.GetMovesByLevel <HumanFighter>(level) ) { if (spells != null) { Spells.AddRange(spells); } if (specialMoves != null) { SpecialMoves.AddRange(specialMoves); } _extraSpecialMoves = new List <BattleMove>(); CurrentExp = LevelUpManager.GetExpForLevel(level); _expToNextLevel = LevelUpManager.GetExpForLevel(level + 1); }
internal static void UpdateSAHighLight(int ID) { if (m_open) { int displayMethod = RazorEnhanced.Settings.General.ReadInt("SpellGridStyle"); if (displayMethod == 0) { foreach (PanelGrid p in m_panellist) { if (p.Group == GroupType.Abilities) { if (ID == 0) { p.AbilityEnabled = false; if (p.Spell == "Primary") { p.BackgroundImage = Ultima.Gumps.GetGump(SpecialMoves.GetPrimaryIcon(p.AbilityID)); } else { p.BackgroundImage = Ultima.Gumps.GetGump(SpecialMoves.GetSecondaryIcon(p.AbilityID)); } } else { if (p.AbilityID == ID) { p.AbilityEnabled = true; p.BackgroundImage = ColorizeIcon((Bitmap)p.BackgroundImage); } else { if (p.AbilityEnabled) { if (p.Spell == "Primary") { p.BackgroundImage = Ultima.Gumps.GetGump(SpecialMoves.GetPrimaryIcon(p.AbilityID)); } else { p.BackgroundImage = Ultima.Gumps.GetGump(SpecialMoves.GetSecondaryIcon(p.AbilityID)); } } } } } } } else { Close(); Open(); } } }
internal static void UpdateSAIcon() { if (Assistant.World.Player == null || m_form == null) { return; } Assistant.Item wep = null; Assistant.Item right = World.Player.GetItemOnLayer(Layer.RightHand); Assistant.Item left = World.Player.GetItemOnLayer(Layer.LeftHand); if (right != null) { wep = right; } else { if (left != null) { wep = left; } } int primaryAbilityID = SpecialMoves.GetPrimaryAbility(wep); int secondaryAbilityID = SpecialMoves.GetSecondaryAbility(wep); foreach (PanelGrid p in m_panellist) { if (p.Group == GroupType.Abilities) { if (p.Spell == "Primary") { if (p.AbilityID != primaryAbilityID) { p.AbilityID = primaryAbilityID; p.BackgroundImage = Ultima.Gumps.GetGump(SpecialMoves.GetPrimaryIcon(primaryAbilityID)); } } else if (p.Spell == "Secondary") { if (p.AbilityID != secondaryAbilityID) { p.AbilityID = secondaryAbilityID; p.BackgroundImage = Ultima.Gumps.GetGump(SpecialMoves.GetSecondaryIcon(secondaryAbilityID)); } } } } }
public void SpecialMoveChance(Character attacker, Character defender, Fight1v1 fight) { bool activateSpecialMove = false; float specialChanceDivisonFactor = 1000f; float fighterSpecialChanceValue = attacker.Magic + attacker.Strategy; float fighterSpecialChance = fighterSpecialChanceValue / specialChanceDivisonFactor; activateSpecialMove = StandardFunctions.CheckPercentageChance(fighterSpecialChance); if (activateSpecialMove) { //TODO_P: Add a system for handling selection of special moves SpecialMoves.PowerStrike(attacker, defender, fight); } }
private static bool SetAbility(ref ASTNode node, bool quiet, bool force) { node = node.Next(); // walk past COMMAND List <ASTNode> args = ParseArguments(ref node); if (args.Count < 1) { throw new ArgumentException("Usage: setability ('primary'/'secondary'/'stun'/'disarm') ['on'/'off']"); } if (!abilities.Contains(args[0].Lexeme)) { throw new ArgumentException("Usage: setability ('primary'/'secondary'/'stun'/'disarm') ['on'/'off']"); } if (args.Count == 2 && args[1].Lexeme == "on" || args.Count == 1) { switch (args[0].Lexeme) { case "primary": SpecialMoves.SetPrimaryAbility(); break; case "secondary": SpecialMoves.SetSecondaryAbility(); break; case "stun": Client.Instance.SendToServer(new StunRequest()); break; case "disarm": Client.Instance.SendToServer(new DisarmRequest()); break; default: break; } } else if (args.Count == 2 && args[1].Lexeme == "off") { Client.Instance.SendToServer(new UseAbility(AOSAbility.Clear)); Client.Instance.SendToClient(ClearAbility.Instance); } return(true); }
//Quando o Codigo começa a rodar public void Start() { movePlateUtilitaries = FindObjectOfType <MovePlateUtilitaries>(); specialMoves = FindObjectOfType <SpecialMoves>(); if (Attack) { //Muda a cor MovePlate para Vermelho gameObject.GetComponent <SpriteRenderer>().color = new Color(1.0f, 0.0f, 0.0f, 1.0f); } else if (Castling) { gameObject.GetComponent <SpriteRenderer>().color = new Color(0.0f, 1.0f, 0.0f, 1.0f); } else if (EnPassant) { gameObject.GetComponent <SpriteRenderer>().color = new Color(0.0f, 1.0f, 1.0f, 1.0f); } }
internal static void UpdateSAHighLight(int ID) { foreach (PanelGrid p in m_panellist) { if (p.Group == GroupType.Abilities) { if (ID == 0) { p.AbilityEnabled = false; if (p.Spell == "Primary") { p.BackgroundImage = Ultima.Gumps.GetGump(SpecialMoves.GetPrimaryIcon(p.AbilityID)); } else { p.BackgroundImage = Ultima.Gumps.GetGump(SpecialMoves.GetSecondaryIcon(p.AbilityID)); } } else { if (p.AbilityID == ID) { p.AbilityEnabled = true; p.BackgroundImage = ColorizeIcon((Bitmap)p.BackgroundImage); } else { if (p.AbilityEnabled) { if (p.Spell == "Primary") { p.BackgroundImage = Ultima.Gumps.GetGump(SpecialMoves.GetPrimaryIcon(p.AbilityID)); } else { p.BackgroundImage = Ultima.Gumps.GetGump(SpecialMoves.GetSecondaryIcon(p.AbilityID)); } } } } } } }
private static bool SetAbility(string command, Argument[] args, bool quiet, bool force) { if (args.Length < 1 || !abilities.Contains(args[0].AsString())) { ScriptUtilities.ScriptErrorMsg("Usage: setability ('primary'/'secondary'/'stun'/'disarm') ['on'/'off']"); return(true); } if (args.Length == 2 && args[1].AsString() == "on" || args.Length == 1) { switch (args[0].AsString()) { case "primary": SpecialMoves.SetPrimaryAbility(); break; case "secondary": SpecialMoves.SetSecondaryAbility(); break; case "stun": Client.Instance.SendToServer(new StunRequest()); break; case "disarm": Client.Instance.SendToServer(new DisarmRequest()); break; default: break; } } else if (args.Length == 2 && args[1].AsString() == "off") { Client.Instance.SendToServer(new UseAbility(AOSAbility.Clear)); Client.Instance.SendToClient(ClearAbility.Instance); } return(true); }
internal static void SpellGrid_MouseClick_Control(object sender, MouseEventArgs e) { PanelGrid pl = (PanelGrid)sender; switch (pl.Group) { case GroupType.Magery: Spells.CastMagery(pl.Spell, false); break; case GroupType.Abilities: if (pl.Spell == "Primary") { SpecialMoves.SetPrimaryAbility(false); } else { SpecialMoves.SetSecondaryAbility(false); } break; case GroupType.Bushido: Spells.CastBushido(pl.Spell, false); break; case GroupType.Chivalry: Spells.CastChivalry(pl.Spell, false); break; case GroupType.Necromancy: Spells.CastNecro(pl.Spell, false); break; case GroupType.Ninjitsu: Spells.CastNinjitsu(pl.Spell, false); break; case GroupType.Mysticism: Spells.CastMysticism(pl.Spell, false); break; case GroupType.Spellweaving: Spells.CastSpellweaving(pl.Spell, false); break; case GroupType.Mastery: Spells.CastMastery(pl.Spell, false); break; case GroupType.Cleric: Spells.CastMastery(pl.Spell, false); break; case GroupType.Druid: Spells.CastMastery(pl.Spell, false); break; case GroupType.Script: Misc.ScriptRun(pl.Spell); break; case GroupType.Skills: Player.UseSkill(pl.Spell, false); break; default: break; } DLLImport.Win.SetForegroundWindow(Assistant.Client.Instance.GetWindowHandle()); }
/// <summary> /// Process the Legacy GameMasters /// </summary> /// <param name="legacyGameMasters"></param> public static void Initialize(GameMasterTemplate currentGameMasterTemplate, IEnumerable <GameMasterTemplate> legacyGameMasterTemplates, PokemonAvailability pokemonReleases, SpecialMoves specialMoves) { PokemonReleases = pokemonReleases; foreach (var legacyGameMasterTemplate in legacyGameMasterTemplates) { foreach (var itemTemplate in legacyGameMasterTemplate.GameMaster.item_templates) { if (IsValidItemTemplate(itemTemplate, legacyGameMasterTemplate.GameMaster.timestamp_ms)) { // Get the Legacy Moves. if (!FastMoves.ContainsKey(itemTemplate.template_id)) { FastMoves.Add(itemTemplate.template_id, new List <PokemonMove>()); } List <PokemonMove> fastMoves = FastMoves[itemTemplate.template_id]; foreach (var move in itemTemplate.pokemon_settings.quick_moves) { if (!fastMoves.Contains(move)) { fastMoves.Add(move); } } if (!ChargedMoves.ContainsKey(itemTemplate.template_id)) { ChargedMoves.Add(itemTemplate.template_id, new List <PokemonMove>()); } List <PokemonMove> chargedMoves = ChargedMoves[itemTemplate.template_id]; foreach (var move in itemTemplate.pokemon_settings.cinematic_moves) { if (!chargedMoves.Contains(move)) { chargedMoves.Add(move); } } } } } foreach (var specialMove in specialMoves.Move) { if (specialMove.IsFast) { if (!FastMoves.ContainsKey(specialMove.pokemonTemplateId)) { FastMoves.Add(specialMove.pokemonTemplateId, new List <PokemonMove>()); } List <PokemonMove> fastMoves = FastMoves[specialMove.pokemonTemplateId]; if (!fastMoves.Contains(specialMove.movementId)) { fastMoves.Add(specialMove.movementId); } } else { if (!ChargedMoves.ContainsKey(specialMove.pokemonTemplateId)) { ChargedMoves.Add(specialMove.pokemonTemplateId, new List <PokemonMove>()); } List <PokemonMove> chargedMoves = ChargedMoves[specialMove.pokemonTemplateId]; if (!chargedMoves.Contains(specialMove.movementId)) { chargedMoves.Add(specialMove.movementId); } } } }
public void AddSpecialMove(SpecialMove specialMove) { SpecialMoves.Add(specialMove); }