Ejemplo n.º 1
0
        public void UseMoveOnFoes(BattleSetup setup, TargetCollection targets)
        {
            Parties.Party party = null;
            if (owner.Player.IsInParty()) {
                party = Parties.PartyManager.FindPlayerParty(owner);
            }

            //List<ICharacter> targets = MoveProcessor.GetTargetsInRange(setup.Move.RangeType, setup.Move.Range, setup.AttackerMap, this, owner.Player.X, owner.Player.Y, owner.Player.Direction);

            Move move = setup.SetdownMove();

            foreach (ICharacter i in targets.Foes) {
                // Don't attack allies
                if (i.CharacterType == Enums.CharacterType.Recruit) {
                    Recruit recruit = i as Recruit;
                    if (Ranks.IsAllowed(recruit.Owner, Enums.Rank.Moniter) && !recruit.Owner.Player.Hunted
                        || (recruit.Owner.Player.Map.Tile[recruit.Owner.Player.X, recruit.Owner.Player.Y].Type == Enums.TileType.Arena) != (Owner.Player.Map.Tile[X, Y].Type == Enums.TileType.Arena)) {

                    } else {
                        setup.Defender = i;
                        BattleProcessor.MoveHitCharacter(setup);
                        setup.SetupMove(move);
                        if (setup.Cancel) {
                            return;
                        }
                    }
                } else if (i.CharacterType == Enums.CharacterType.MapNpc && (((MapNpc)i).Num <= 0 || ((MapNpc)i).HP <= 0)) {
                } else if (i.CharacterType == Enums.CharacterType.MapNpc) {
                    MapNpc npc = i as MapNpc;
                    if (Npcs.NpcManager.Npcs[npc.Num].Behavior == Enums.NpcBehavior.Scripted) {
                        if (setup.moveIndex == -1) {
                            Scripting.ScriptManager.InvokeSub("ScriptedNpc", setup.Attacker, Npcs.NpcManager.Npcs[npc.Num].AIScript, npc.Num, owner.Player.Map, i);
                        }
                    } else if (!string.IsNullOrEmpty(Npcs.NpcManager.Npcs[npc.Num].AttackSay) && (Npcs.NpcManager.Npcs[npc.Num].Behavior == Enums.NpcBehavior.Friendly || Npcs.NpcManager.Npcs[npc.Num].Behavior == Enums.NpcBehavior.Shopkeeper)) {
                        if (setup.moveIndex == -1) {
                            Stories.Story story = new Stories.Story();
                            Stories.StoryBuilderSegment segment = Stories.StoryBuilder.BuildStory();
                            Stories.StoryBuilder.AppendSaySegment(segment, Npcs.NpcManager.Npcs[npc.Num].Name.Trim() + ": " + Npcs.NpcManager.Npcs[npc.Num].AttackSay.Trim(),
                                Npcs.NpcManager.Npcs[npc.Num].Species, 0, 0);
                            segment.AppendToStory(story);
                            Stories.StoryManager.PlayStory(owner, story);
                        }
                    } else {
                        setup.Defender = i;
                        BattleProcessor.MoveHitCharacter(setup);
                        setup.SetupMove(move);
                        if (setup.Cancel) {
                            return;
                        }
                    }
                } else {
                    setup.Defender = i;
                    BattleProcessor.MoveHitCharacter(setup);
                    setup.SetupMove(move);
                    if (setup.Cancel) {
                        return;
                    }
                }

            }
        }
Ejemplo n.º 2
0
        public void UseMoveOnFoes(BattleSetup setup, TargetCollection targets)
        {
            // Attack any players that are on the map
            //List<ICharacter> targets = MoveProcessor.GetTargetsInRange(setup.Move.RangeType, setup.Move.Range, setup.AttackerMap, this, X, Y, Direction);
            Move move = setup.SetdownMove();

            foreach (ICharacter i in targets.Foes) {
                setup.Defender = i;
                BattleProcessor.MoveHitCharacter(setup);
                setup.SetupMove(move);
                if (setup.Cancel) {
                    return;
                }
            }
        }
Ejemplo n.º 3
0
 public void UseMoveOnAllies(BattleSetup setup, TargetCollection targets)
 {
     Parties.Party party = null;
     if (owner.Player.IsInParty()) {
         party = Parties.PartyManager.FindPlayerParty(owner);
     }
     //List<ICharacter> targets = MoveProcessor.GetTargetsInRange(setup.Move.RangeType, setup.Move.Range, setup.AttackerMap, this, owner.Player.X, owner.Player.Y, owner.Player.Direction);
     Move move = setup.SetdownMove();
     // Attack any players that are on the map
     foreach (ICharacter i in targets.Friends) {
         if (i.CharacterType == Enums.CharacterType.Recruit && Ranks.IsAllowed(((Recruit)i).Owner, Enums.Rank.Moniter)
                 && !((Recruit)i).Owner.Player.Hunted && !((Recruit)i).Owner.Player.Dead) {
         } else {
             setup.Defender = i;
             BattleProcessor.MoveHitCharacter(setup);
             setup.SetupMove(move);
             if (setup.Cancel) {
                 return;
             }
         }
     }
 }
Ejemplo n.º 4
0
        public void UseMoveOnAllies(BattleSetup setup, TargetCollection targets)
        {
            //List<ICharacter> targets = MoveProcessor.GetTargetsInRange(setup.Move.RangeType, setup.Move.Range, setup.AttackerMap, this, X, Y, Direction);
            Move move = setup.SetdownMove();

            foreach (ICharacter i in targets.Friends) {
                if (i.CharacterType == Enums.CharacterType.MapNpc && ((MapNpc)i).Num <= 0) {

                } else {
                    setup.Defender = i;
                    BattleProcessor.MoveHitCharacter(setup);
                    setup.SetupMove(move);
                    if (setup.Cancel) {
                        return;
                    }
                }
            }
        }