예제 #1
0
 public Presentation(BattleStage stage, FighterObject user, List <FighterObject> targetList, ActionFinishHandler handler = null)
 {
     bottomEffectLayer = (EffectLayer)Global.world.GetLayer("BottomEffectLayer");
     bottomEffects     = new List <Effect>();
     this.stage        = stage;
     this.user         = user;
     this.targetList   = targetList;
     this.handler      = handler;
 }
예제 #2
0
 public override void Execute(BattleStage stage, FighterObject user, List <FighterObject> targetList, ActionFinishHandler handler)
 {
     foreach (FighterObject target in targetList)
     {
         target.RestoreHP(((Hero)user.fighter).intelligence * 2);
     }
     handler(null);
     base.Execute(stage, user, targetList, handler);
 }
예제 #3
0
            public override List <FighterObject> SelectTarget(BattleStage stage)
            {
                int    count  = stage.fighterLists[(int)StageRow.HeroFront].Count;
                Random random = new Random();
                List <FighterObject> result = new List <FighterObject>();

                result.Add(stage.fighterLists[2][random.Next(count)]);
                return(result);
            }
예제 #4
0
        public void PhaseCheck(BattleStage stage)
        {
            int p = enemy.PhaseCheck(stage);

            if (p == -1)
            {
                return;
            }
            phase = p;
        }
예제 #5
0
 public override bool IsAvailable(BattleStage stage, FighterObject user)
 {
     if (user.state == FighterState.Front)
     {
         return(stage.fighterLists[3].Count < 5 && (stage.fighterLists[2].Count > 1 ||
                                                    (stage.fighterLists[2].Count == 1 && stage.fighterLists[3].Count > 0)));
     }
     else
     {
         return(stage.fighterLists[2].Count < 5);
     }
 }
예제 #6
0
            public override void Execute(BattleStage stage, FighterObject user, List <FighterObject> targetList, ActionFinishHandler handler)
            {
                PresentationGroup p = new PresentationGroup(2, stage, user, targetList, handler);

                p[0].AddEffect(new SlashEffect(targetList[0].x, targetList[0].y, 0));
                p[0].SetUserAnimation(SpriteAnimation.GetSpriteAnimation("MeleeAttackDown"));

                p[1].AddEffect(targetList[0].DealDamage(user.fighter.strength));
                p[1].SetTargetAnimation(SpriteAnimation.GetSpriteAnimation("Shake"));

                p.Start();

                base.Execute(stage, user, targetList, handler);
            }
예제 #7
0
        public PresentationGroup(int length, BattleStage stage, FighterObject user, List <FighterObject> targetList,
                                 ActionFinishHandler handler)
        {
            list = new Presentation[length];
            for (int i = 0; i < length - 1; i++)
            {
                list[i] = new Presentation(stage, user, targetList);
            }
            list[length - 1] = new Presentation(stage, user, targetList, handler);

            for (int i = 0; i < length - 1; i++)
            {
                list[i].ConnectPresentation(list[i + 1]);
            }
        }
예제 #8
0
        public override void Execute(BattleStage stage, FighterObject user, List <FighterObject> targetList, ActionFinishHandler handler)
        {
            PresentationGroup p = new PresentationGroup(3, stage, user, targetList, handler);

            p[0].AddEffect(new SlashEffect(targetList[0].x, targetList[0].y, 0));
            p[0].SetUserAnimation(SpriteAnimation.GetSpriteAnimation("MeleeAttackUp"));

            p[1].SetTargetAnimation(SpriteAnimation.GetSpriteAnimation("Shake"));
            p[1].AddEffect(targetList[0].DealDamage(((Hero)user.fighter).strength));

            p[2].SetExtraMethod(() => targetList[0].AddBuff(new Frozen(), Global.Properties.FRAME_PER_SECOND * 3));

            p.Start();

            base.Execute(stage, user, targetList, handler);
        }
예제 #9
0
 public override bool IsAvailable(BattleStage stage, FighterObject user)
 {
     return(((HeroObject)user).SP >= manaUsage);
 }
예제 #10
0
 public override bool IsAvailable(BattleStage stage, FighterObject user)
 {
     return(stage.fighterLists[(int)StageRow.HeroFront].Count > 0);
 }
예제 #11
0
 public override int PhaseCheck(BattleStage stage)
 {
     // No phase transition.
     return(-1);
 }
예제 #12
0
 public abstract bool IsAvailable(BattleStage stage, FighterObject user);
예제 #13
0
 public override void Execute(BattleStage stage, FighterObject user, List <FighterObject> targetList, ActionFinishHandler handler)
 {
     stage.SwitchLocation(user, targetList[0]);
     handler(null);
     base.Execute(stage, user, targetList, handler);
 }
예제 #14
0
 public override void Execute(BattleStage stage, FighterObject user, List <FighterObject> targetList, ActionFinishHandler handler)
 {
 }
예제 #15
0
 public abstract List <FighterObject> SelectTarget(BattleStage stage);
예제 #16
0
 public abstract int PhaseCheck(BattleStage stage);
예제 #17
0
        protected override void Prepare()
        {
            timespan        = 0;
            transforming    = true;
            timePaused      = true;
            player          = Global.world.GetPlayer();
            guiLayer        = (GUILayer)Global.world.GetLayer("GUILayer");
            gameObjectLayer = (GameObjectLayer)Global.world.GetLayer("GameObjectLayer");
            topEffectLayer  = (EffectLayer)Global.world.GetLayer("TopEffectLayer");

            targetBuffer          = new List <FighterObject>();
            readiedFighterObjects = new Queue <FighterObject>();
            readiedBuff           = new Queue <BuffAction>();
            deadEnemyObjects      = new List <EnemyObject>();

            player.Look(Direction.Up);
            player.Stand();

            guiLayer.RemoveGUI("TeamManagement");
            actionMenu = new ActionMenu("ActionMenu", null, MENUSTART_X, MENUSTART_Y);
            actionMenu.Deactivate();
            guiLayer.AddGUI(actionMenu);
            actionSelect = new ActionSelect("ActionSelect", null, SELECTSTART_X, MENUSTART_Y, null);
            actionSelect.Deactivate();
            guiLayer.AddGUI(actionSelect);
            instruction = new Label("Instruction", null, INSTRUCTION_X, INSTRUCTION_Y, "Select Target", Color.White,
                                    512, Global.content.Load <SpriteFont>("neodgm24"), AlignType.Top, AlignType.Center);
            instruction.Deactivate();
            guiLayer.AddGUI(instruction);

            stage    = new BattleStage();
            selector = new Selector(mirrorMode: true);
            selector.CreateNewMatrix("ActionMenuGroup", 1, 5);
            selector.CreateNewMatrix("ActionSelectGroup", 1, 1);
            selector.CreateNewMatrix("FighterGroup", Global.Properties.FIGHTER_IN_ROW, 4); // Two for NullFighterObject.

            // Key setting
            keyActions.Add(new KeyAction(Keys.W, pressed: () => { selector.SelectNext(Direction.Up); }));
            keyActions.Add(new KeyAction(Keys.S, pressed: () => { selector.SelectNext(Direction.Down); }));
            keyActions.Add(new KeyAction(Keys.A, pressed: () =>
            {
                if (selector.matrixName == "ActionSelectGroup")
                {
                    actionSelect.Next(Direction.Left);
                }
                else
                {
                    selector.SelectNext(Direction.Left);
                }
            }));
            keyActions.Add(new KeyAction(Keys.D, pressed: () =>
            {
                if (selector.matrixName == "ActionSelectGroup")
                {
                    actionSelect.Next(Direction.Right);
                }
                else
                {
                    selector.SelectNext(Direction.Right);
                }
            }));
            keyActions.Add(new KeyAction(Keys.E, pressed: () => { selector.SelectAction(); }));
            keyActions.Add(new KeyAction(Keys.Q, pressed: () => { Rewind(); }));


            base.Prepare();
        }
예제 #18
0
 public abstract void Execute(BattleStage stage, FighterObject user, List <FighterObject> targetList, ActionFinishHandler handler);
예제 #19
0
 public override void Execute(BattleStage stage, FighterObject user, List <FighterObject> targetList, ActionFinishHandler handler)
 {
     ((HeroObject)user).DecreaseSP(manaUsage);
 }
예제 #20
0
 public override bool IsAvailable(BattleStage stage, FighterObject user)
 {
     return(user.state == FighterState.Front);
 }
예제 #21
0
 public override bool IsAvailable(BattleStage stage, FighterObject user)
 {
     return(user.HP > hpUsage);
 }