Ejemplo n.º 1
0
        public SubStateRuneSelect(StateAbstract theparent, Character thePC)
            : base(theparent)
        {
            curr = (PC) thePC;

            parent = theparent;
            StateHandler.AddDelay();
            messageBoxes = new MessageBox[1];

            int i, size = calcSize();
            colors = new Color[size];
            menu = new string[size];

            for (i = 0; i < size; i++)
                menu[i] = curr.runes[i].Name;

            for (; i < size; i++)
                menu[i] = "";

            if(colors.Length > 0)
                colors[0] = Color.White;

            for (i = 1; i < colors.Length; i++)
                colors[i] = Color.DarkGray;

            mX = 100;
            mY = 45;
            width = 900;
            height = 630;

            messageBoxes[0] = new MessageBox(mX, mY, width, height, menu, colors, true, true, true);
        }
Ejemplo n.º 2
0
        public SubStateOptionsMenu(StateAbstract theparent)
            : base(theparent)
        {
            int i;
            parent = theparent;
            StateHandler.AddDelay();
            messageBoxes = new MessageBox[1];

            colors = new Color[1];
            menu = new string[colors.Length];

            colors[0] = Color.White;
            for (i = 1; i < colors.Length; i++)
                colors[i] = Color.DarkGray;

            menu[0] = "Difficulty";

            for (i = 1; i < menu.Length; i++)
                menu[i] = "Option " + i;

            mX = 100;
            mY = 45;
            width = 900;
            height = 630;

            messageBoxes[0] = new MessageBox(mX, mY, width, height, menu, colors, true, true, true);
        }
        public SubStateDifficultySelect(StateAbstract theparent)
            : base(theparent)
        {
            int i;

            parent = theparent;
            StateHandler.AddDelay();
            messageBoxes = new MessageBox[1];

            colors = new Color[6];
            menu   = new string[6];

            menu[0] = "Child";
            menu[1] = "Youth";
            menu[2] = "Standard";
            menu[3] = "Challenging";
            menu[4] = "Expert";
            menu[5] = "Insane";

            for (i = 1; i < colors.Length; i++)
            {
                colors[i] = Color.DarkGray;
            }
            colors[0] = Color.White;

            mX     = 100;
            mY     = 45;
            width  = 900;
            height = 630;

            messageBoxes[0] = new MessageBox(mX, mY, width, height, menu, colors, true, true, true);
        }
        public SubStateOptionsMenu(StateAbstract theparent)
            : base(theparent)
        {
            int i;

            parent = theparent;
            StateHandler.AddDelay();
            messageBoxes = new MessageBox[1];

            colors = new Color[1];
            menu   = new string[colors.Length];

            colors[0] = Color.White;
            for (i = 1; i < colors.Length; i++)
            {
                colors[i] = Color.DarkGray;
            }

            menu[0] = "Difficulty";

            for (i = 1; i < menu.Length; i++)
            {
                menu[i] = "Option " + i;
            }

            mX     = 100;
            mY     = 45;
            width  = 900;
            height = 630;

            messageBoxes[0] = new MessageBox(mX, mY, width, height, menu, colors, true, true, true);
        }
Ejemplo n.º 5
0
        public SubStateSpellSelect(StateAbstract theparent, SpellAbstract[] theSpells, PC thePC)
            : base(theparent)
        {
            spells = theSpells;
            curr = thePC;

            parent = theparent;
            StateHandler.AddDelay();
            messageBoxes = new MessageBox[1];

            int i;
            colors = new Color[spells.Length];
            menu = new string[spells.Length];

            for (i = 0; i < spells.Length && spells[i] != null; i++)
                menu[i] = spells[i].Name;

            for (; i < spells.Length; i++)
                menu[i] = "";

            if (colors.Length > 0)
                colors[0] = Color.White;

            for (i = 1; i < colors.Length; i++)
                colors[i] = Color.DarkGray;

            mX = 190;
            mY = 75;
            width = 780;
            height = 570;

            messageBoxes[0] = new MessageBox(mX, mY, width, height, menu, colors, true, true, true);
        }
        public SubStateDifficultySelect(StateAbstract theparent)
            : base(theparent)
        {
            int i;
            parent = theparent;
            StateHandler.AddDelay();
            messageBoxes = new MessageBox[1];

            colors = new Color[6];
            menu = new string[6];

            menu[0] = "Child";
            menu[1] = "Youth";
            menu[2] = "Standard";
            menu[3] = "Challenging";
            menu[4] = "Expert";
            menu[5] = "Insane";

            for (i = 1; i < colors.Length; i++)
                colors[i] = Color.DarkGray;
            colors[0] = Color.White;

            mX = 100;
            mY = 45;
            width = 900;
            height = 630;

            messageBoxes[0] = new MessageBox(mX, mY, width, height, menu, colors, true, true, true);
        }
        public SubStateAttackSelect(StateAbstract theparent, Character theAttacker)
            : base(theparent)
        {
            attacker = theAttacker;
            int i = 0, alive = 0;

            for (i = 0; i < StateCombat.MonsterList.Length; i++)
            {
                if (StateCombat.MonsterList[i].Health > 0)
                {
                    alive++;
                }
            }

            StateHandler.AddDelay();
            messageBoxes = new MessageBox[1];
            colors       = new Color[alive];
            menu         = new string[colors.Length];
            targets      = new Character[colors.Length];

            int unavailable = 0;

            for (i = 0; i < StateCombat.MonsterList.Length; i++)
            {
                if (StateCombat.MonsterList[i].Health < 1)
                {
                    unavailable++;
                }
                else
                {
                    targets[i - unavailable] = StateCombat.MonsterList[i];
                }
            }

            for (i = 0; i < menu.Length; i++)
            {
                menu[i] = targets[i].Name;
            }

            for (i = 1; i < colors.Length; i++)
            {
                colors[i] = Color.DarkGray;
            }
            colors[0] = Color.White;

            mX     = 450;
            mY     = 450;
            width  = 125;
            height = 100;


            messageBoxes[0] = new MessageBox(mX, mY, width, height, menu, colors, true, true);
        }//end EVC
        public SubStateRuneChange(StateAbstract parent, int thePC, int runeSlot, int theCount)
            : base(parent)
        {
            this.PCid   = thePC;
            this.slot   = runeSlot;
            this.itemID = theCount;

            StateHandler.AddDelay();
            messageBoxes = new MessageBox[1];
            colors       = new Color[4];
            menu         = new string[4];

            if (itemID < ItemHandler.runeList.Count)
            {
                RuneAbstract run  = ItemHandler.runeList[itemID];
                string       flag = generateFlag(run.Wearflags);
                menu[0] = run.Name;
                menu[1] = "Level " + run.Level.ToString();
                menu[2] = "Slot: " + flag;
                menu[3] = "";

                SpellAbstract[] sp = run.getSpells();
                if (sp != null)
                {
                    foreach (SpellAbstract s in sp)
                    {
                        menu[3] += s.Name + "\n";
                    }
                }
            }
            else
            {
                for (int i = 0; i < menu.Length; i++)
                {
                    menu[i] = "";
                }
            }


            for (int i = 0; i < colors.Length; i++)
            {
                colors[i] = Color.DarkGray;
            }

            colors[0] = Color.White;

            mX     = 380;
            mY     = 90;
            width  = 140;
            height = 170;

            messageBoxes[0] = new MessageBox(mX, mY, width, height, menu, colors, true, true);
        }
Ejemplo n.º 9
0
        /// <summary>
        ///   Tworzy modul sieciowy
        /// </summary>
        public NetworkModule()
        {
            Processor proc = ServiceModule.CreateProcessor();

            AssignProcessor(ServiceModule, proc);

            netQueue = new NetQueue(ServiceModule, proc);
            netQueue.Start();

            _interfaceLink = new InterfaceModuleLink(this);
            _fileLink = new FileModulelLink(this);
            NetworkManager = new NetworkManager(this);
            TaskCenter = new TaskCenter(this);

            _networkState = new StateDisconnected(this);
        }
Ejemplo n.º 10
0
        public SubStateRuneChange(StateAbstract parent, int thePC, int runeSlot, int theCount)
            : base(parent)
        {
            this.PCid = thePC;
            this.slot = runeSlot;
            this.itemID = theCount;

            StateHandler.AddDelay();
            messageBoxes = new MessageBox[1];
            colors = new Color[4];
            menu = new string[4];

            if (itemID < ItemHandler.runeList.Count)
            {
                RuneAbstract run = ItemHandler.runeList[itemID];
                string flag = generateFlag(run.Wearflags);
                menu[0] = run.Name;
                menu[1] = "Level " + run.Level.ToString();
                menu[2] = "Slot: " + flag;
                menu[3] = "";

                SpellAbstract[] sp = run.getSpells();
                if (sp != null)
                    foreach (SpellAbstract s in sp)
                        menu[3] += s.Name + "\n";
            }
            else
            {
                for (int i = 0; i < menu.Length; i++)
                    menu[i] = "";
            }

            for (int i = 0; i < colors.Length; i++)
                colors[i] = Color.DarkGray;

            colors[0] = Color.White;

            mX = 380;
            mY = 90;
            width = 140;
            height = 170;

            messageBoxes[0] = new MessageBox(mX, mY, width, height, menu, colors, true, true);
        }
        public SubStateSpellSelect(StateAbstract theparent, SpellAbstract[] theSpells, PC thePC)
            : base(theparent)
        {
            spells = theSpells;
            curr   = thePC;

            parent = theparent;
            StateHandler.AddDelay();
            messageBoxes = new MessageBox[1];

            int i;

            colors = new Color[spells.Length];
            menu   = new string[spells.Length];

            for (i = 0; i < spells.Length && spells[i] != null; i++)
            {
                menu[i] = spells[i].Name;
            }

            for (; i < spells.Length; i++)
            {
                menu[i] = "";
            }

            if (colors.Length > 0)
            {
                colors[0] = Color.White;
            }

            for (i = 1; i < colors.Length; i++)
            {
                colors[i] = Color.DarkGray;
            }

            mX     = 190;
            mY     = 75;
            width  = 780;
            height = 570;

            messageBoxes[0] = new MessageBox(mX, mY, width, height, menu, colors, true, true, true);
        }
        public SubStateRuneSelect(StateAbstract theparent, Character thePC)
            : base(theparent)
        {
            curr = (PC)thePC;

            parent = theparent;
            StateHandler.AddDelay();
            messageBoxes = new MessageBox[1];

            int i, size = calcSize();

            colors = new Color[size];
            menu   = new string[size];

            for (i = 0; i < size; i++)
            {
                menu[i] = curr.runes[i].Name;
            }

            for (; i < size; i++)
            {
                menu[i] = "";
            }

            if (colors.Length > 0)
            {
                colors[0] = Color.White;
            }

            for (i = 1; i < colors.Length; i++)
            {
                colors[i] = Color.DarkGray;
            }

            mX     = 100;
            mY     = 45;
            width  = 900;
            height = 630;

            messageBoxes[0] = new MessageBox(mX, mY, width, height, menu, colors, true, true, true);
        }
Ejemplo n.º 13
0
        public SubStateAttackSelect(StateAbstract theparent, Character theAttacker)
            : base(theparent)
        {
            attacker = theAttacker;
            int i = 0, alive = 0;

            for (i = 0; i < StateCombat.MonsterList.Length; i++)
                if (StateCombat.MonsterList[i].Health > 0)
                    alive++;

            StateHandler.AddDelay();
            messageBoxes = new MessageBox[1];
            colors = new Color[alive];
            menu = new string[colors.Length];
            targets = new Character[colors.Length];

            int unavailable = 0;
            for (i = 0; i < StateCombat.MonsterList.Length; i++)
            {
                if (StateCombat.MonsterList[i].Health < 1)
                    unavailable++;
                else
                    targets[i - unavailable] = StateCombat.MonsterList[i];
            }

            for (i = 0; i < menu.Length; i++)
                menu[i] = targets[i].Name;

            for (i = 1; i < colors.Length; i++)
                colors[i] = Color.DarkGray;
            colors[0] = Color.White;

            mX = 450;
            mY = 450;
            width = 125;
            height = 100;

            messageBoxes[0] = new MessageBox(mX, mY, width, height, menu, colors, true, true);
        }
Ejemplo n.º 14
0
 internal void SetState(StateAbstract state)
 {
     currentState = state;
 }
Ejemplo n.º 15
0
 /// <summary>
 ///   Zmiana stanu polaczenia z siecia na zadany
 /// </summary>
 /// <param name = "state">Zadany stan</param>
 public void ChangeStateTo(StateAbstract state)
 {
     //SendNotification("State changed to:" + state.GetType().Name, NotificationType.STATE);
     _networkState = state;
     if (NetworkState is StateDisconnected)
     {
         //PeerCenter.StartConnectToNetwork();
     }
 }
Ejemplo n.º 16
0
        public SubStateStatChange(StateAbstract parent, int thePC, int itemSlot, int theCount)
            : base(parent)
        {
            this.PCid = thePC;
            this.slot = itemSlot;
            this.itemID = theCount;

            StateHandler.AddDelay();
            messageBoxes = new MessageBox[1];
            colors = new Color[10];
            menu = new string[10];

            PC temp = StateHandler.GetPC(PCid);

            if (itemExists() && equipped())
            {
                EquipmentAbstract equip = ItemHandler.equipList[itemID];
                EquipmentAbstract curr = temp.GetEquipment(slot);
                string wflag = getFlags(equip.Wearflags);

                menu[0] = temp.Name;
                menu[1] = temp.getTitle();
                menu[2] = "Health: " + (temp.Health - curr.Hpmod + equip.Hpmod) + "/" + (temp.MaxHealth - curr.Hpmod + equip.Hpmod) + " (" + calcDiff(curr.Hpmod, equip.Hpmod) + ")";
                menu[3] = "MP: " + (temp.Mp - curr.Mpmod + equip.Mpmod) + "/" + (temp.MaxMp - curr.Mpmod + equip.Mpmod) + " (" + calcDiff(curr.Mpmod, equip.Mpmod) + ")";
                menu[4] = "Attack: " + (temp.getAttack() - curr.Attackmod + equip.Attackmod) + " (" + calcDiff(curr.Attackmod, equip.Attackmod) + ")";
                menu[5] = "Defense: " + (temp.getDefense() - curr.Defensemod + equip.Defensemod) + " (" + calcDiff(curr.Defensemod, equip.Defensemod) + ")";
                menu[6] = "Magic: " + (temp.getMagic() - curr.Magicmod + equip.Magicmod) + " (" + calcDiff(curr.Magicmod, equip.Magicmod) + ")";
                menu[7] = "Magic Defense: " + (temp.getMagicDefense() - curr.Magicdefensemod + equip.Magicdefensemod) + " (" + calcDiff(curr.Magicdefensemod, equip.Magicdefensemod) + ")";
                menu[8] = "Slot: " + wflag;
                menu[9] = ItemHandler.equipList[itemID].Name;
            }
            else if (!itemExists() && equipped())
            {
                EquipmentAbstract curr = StateHandler.GetPC(PCid).equipped[slot];
                menu[0] = temp.Name;
                menu[1] = temp.getTitle();
                menu[2] = "Health: " + (temp.Health - curr.Hpmod) + "/" + (temp.MaxHealth - curr.Hpmod) + " (" + calcDiff(curr.Hpmod, 0) + ")";
                menu[3] = "MP: " + (temp.Mp - curr.Mpmod) + "/" + (temp.MaxMp - curr.Mpmod) + " (" + calcDiff(curr.Mpmod, 0) + ")";
                menu[4] = "Attack: " + (temp.getAttack() - curr.Attackmod) + " (" + calcDiff(curr.Attackmod, 0) + ")";
                menu[5] = "Defense: " + (temp.getDefense() - curr.Defensemod) + " (" + calcDiff(curr.Defensemod, 0) + ")";
                menu[6] = "Magic: " + (temp.getMagic() -  curr.Magicmod) + " (" + calcDiff(curr.Magicmod, 0) + ")";
                menu[7] = "Magic Defense: " + (temp.getMagicDefense() - curr.Magicdefensemod) +" (" + calcDiff(curr.Magicdefensemod, 0) + ")";
                menu[8] = "";
                menu[9] = "";
            }
            else if (itemExists() && !equipped())
            {
                EquipmentAbstract equip = ItemHandler.equipList[itemID];
                string wflag = getFlags(equip.Wearflags);
                menu[0] = temp.Name;
                menu[1] = temp.getTitle();
                menu[2] = "Health: " + (temp.Health + equip.Hpmod) + "/" + (temp.MaxHealth + equip.Hpmod) + " (" + calcDiff(0, equip.Hpmod) + ")";
                menu[3] = "MP: " + (temp.Mp + equip.Mpmod) +"/" + (temp.MaxMp + equip.Mpmod) + " (" + calcDiff(0, equip.Mpmod) + ")";
                menu[4] = "Attack: " + (temp.getAttack() + equip.Attackmod) + " (" + calcDiff(0, equip.Attackmod) + ")";
                menu[5] = "Defense: " + (temp.getDefense() + equip.Defensemod) + " (" + calcDiff(0, equip.Defensemod) + ")";
                menu[6] = "Magic: " + (temp.getMagic() + equip.Magicmod) + " (" + calcDiff(0, equip.Magicmod) + ")";
                menu[7] = "Magic Defense: " + (temp.getMagicDefense() + equip.Magicdefensemod) + " (" + calcDiff(0, equip.Magicdefensemod) + ")";
                menu[8] = "Slot: " + wflag;
                menu[9] = ItemHandler.equipList[itemID].Name;
            }
            else//!itemExists() && !equipped()
            {
                menu[0] = temp.Name;
                menu[1] = temp.getTitle();
                menu[2] = "Health: " + temp.Health + "/" + temp.MaxHealth;
                menu[3] = "MP: " + temp.Mp + "/" + temp.MaxMp;
                menu[4] = "Attack: " + temp.getAttack();
                menu[5] = "Defense: " + temp.getDefense();
                menu[6] = "Magic: " + temp.getMagic();
                menu[7] = "Magic Defense: " + temp.getMagicDefense();
                menu[8] = "";
                menu[9] = "";
            }

            for (int i = 0; i < colors.Length; i++)
                colors[i] = Color.DarkGray;

            colors[0] = Color.White;

            mX = 380;
            mY = 90;
            width = 140;
            height = 200;

            messageBoxes[0] = new MessageBox(mX, mY, width, height, menu, colors, true, true);
        }