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; }
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); }
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); }
public void PhaseCheck(BattleStage stage) { int p = enemy.PhaseCheck(stage); if (p == -1) { return; } phase = p; }
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); } }
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); }
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]); } }
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); }
public override bool IsAvailable(BattleStage stage, FighterObject user) { return(((HeroObject)user).SP >= manaUsage); }
public override bool IsAvailable(BattleStage stage, FighterObject user) { return(stage.fighterLists[(int)StageRow.HeroFront].Count > 0); }
public override int PhaseCheck(BattleStage stage) { // No phase transition. return(-1); }
public abstract bool IsAvailable(BattleStage stage, FighterObject user);
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); }
public override void Execute(BattleStage stage, FighterObject user, List <FighterObject> targetList, ActionFinishHandler handler) { }
public abstract List <FighterObject> SelectTarget(BattleStage stage);
public abstract int PhaseCheck(BattleStage stage);
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(); }
public abstract void Execute(BattleStage stage, FighterObject user, List <FighterObject> targetList, ActionFinishHandler handler);
public override void Execute(BattleStage stage, FighterObject user, List <FighterObject> targetList, ActionFinishHandler handler) { ((HeroObject)user).DecreaseSP(manaUsage); }
public override bool IsAvailable(BattleStage stage, FighterObject user) { return(user.state == FighterState.Front); }
public override bool IsAvailable(BattleStage stage, FighterObject user) { return(user.HP > hpUsage); }