Ejemplo n.º 1
0
        public CombatCursor(Combat combat)
            : base()
        {
            Combat = combat;

            Cursor = new CombatCursorShape();
            FastCursorMode = false;

            CellPosition = new Vector2I();
        }
Ejemplo n.º 2
0
 void Combat_OnCombatantStartTurning(Combat sender, CombatCombatantEventArgs e)
 {
     Build(e.Combatant);
 }
Ejemplo n.º 3
0
 public SpellMenu(Combat combat)
     : base(combat)
 {
     Combat.OnCombatantStartTurning += new CombatCombatantEventHandler(Combat_OnCombatantStartTurning);
 }
Ejemplo n.º 4
0
 public Menu(BlazeraLib.Combat combat)
     : base(DEFAULT_ALIGNMENT, ITEM_OFFSET, MARGINS)
 {
     Combat = combat;
 }
Ejemplo n.º 5
0
        /// <summary>
        /// Constructs a default CombatMap from a given Map
        /// </summary>
        /// <param name="map">Base map of combat</param>
        public CombatMap(Map map)
            : base()
        {
            Ground = new Ground(map.Ground);

            SetPhysicsIsRunning(false);
            ActivateLightEngine(false);

            //!\\ TMP //!\\
            foreach (WorldObject wObj in map.GetObjects())
            {
                if (wObj is Player || wObj is Door || wObj is NPC || wObj is Platform)
                    continue;

                ((WorldObject)wObj.Clone()).SetMap(this, wObj.Position.X, wObj.Position.Y);
            }

            Grid = new GridShape(CELL_SIZE, (uint)Width * (uint)(GameData.TILE_SIZE / CELL_SIZE), (uint)Height * (uint)(GameData.TILE_SIZE / CELL_SIZE));
            AddObjectToDraw(DrawOrder.Grid, Grid);

            Combat = new Combat(this);
            Combat.OnCombatantJoining += new CombatCombatantEventHandler(Combat_OnCombatantJoiningCombat);
            Combat.OnCombatantLeaving += new CombatCombatantEventHandler(Combat_OnCombatantLeavingCombat);

            #region tests
            Team t1 = new Team();

            for (int k = 0; k < 1; ++k)
            {
                PlayerCombatant p1 = new PlayerCombatant(Create.Player("Vlad"));
                p1.Name = "Player 1";
                p1.Move(new Vector2I(10 + k, 15 + k));
                p1.Status[BaseCaracteristic.Hp, BaseStatistic.Attribute.Max] = 300;
                p1.Status[BaseCaracteristic.Sp, BaseStatistic.Attribute.Max] = 10;
                p1.Status[BaseCaracteristic.Mp, BaseStatistic.Attribute.Max] = 3;
                p1.Status[Caracteristic.Intelligence] = 2;

                for (int i = 0; i < 19; ++i)
                {
                    Spell sp = Create.Spell("LightningTest");
                    sp.Name = "LightningTest " + i;
                    p1.SpellPanoply.AddSpell(sp);
                }

                t1.AddCombatant(p1);
            }

            Combat.InfoPanel.AddBox(new CombatantInfoPanelBox());

            PlayerCombatant p2 = new PlayerCombatant(Create.Player("Vlad"));
            p2.Name = "Player 2";
            p2.Status[BaseCaracteristic.Hp, BaseStatistic.Attribute.Max] = 30000;
            p2.Status[BaseCaracteristic.Sp, BaseStatistic.Attribute.Max] = 100;
            p2.Status[BaseCaracteristic.Mp, BaseStatistic.Attribute.Max] = 60;
            for (int i = 0; i < 2; ++i)
            {
                Spell sp = Create.Spell("LightningTest");
                sp.Name = "LightningTest " + i;
                p2.SpellPanoply.AddSpell(sp);
            }
            p2.Move(new Vector2I(8, 10));
            t1.AddCombatant(p2);

            MapEffectManager.Instance.AddEffect(new TextMapEffect("2044", Color.Blue), new Vector2f(200, 200));

            Combat.AddTeam(t1);
            #endregion

            Pathfinding = new Game.Pathfinding.Pathfinding();
            Pathfinding.InitNodeSet(this);

            AlphaMode = false;
        }
Ejemplo n.º 6
0
 void Combat_OnCombatantLeavingCombat(Combat sender, CombatCombatantEventArgs e)
 {
     RemoveObjectToDraw(DrawOrder.Normal, e.Combatant);
 }
Ejemplo n.º 7
0
 void Combat_OnCombatantJoiningCombat(Combat sender, CombatCombatantEventArgs e)
 {
     e.Combatant.SetMap(this);
     AddObjectToDraw(DrawOrder.Normal, e.Combatant);
 }
Ejemplo n.º 8
0
 /// <summary>
 /// Constructs combatant combat event arguments from the given combat.
 /// </summary>
 /// <param name="combat"></param>
 public CombatantCombatEventArgs(Combat combat)
     : base()
 {
     Combat = combat;
 }
Ejemplo n.º 9
0
 bool CallOnLeavingCombat(Combat combat)
 {
     if (OnLeavingCombat == null) return false; OnLeavingCombat(this, new CombatantCombatEventArgs(combat)); return true;
 }