Ejemplo n.º 1
0
 // --- Constructors ---
 public GameStateManager(GameExt pmGame)
 {
     game=	pmGame;
     states=	new Map<string, GameState>();
     currState=	-1;
     bInit=	false;
 }
Ejemplo n.º 2
0
        // --- Static Methods ---
        // Loads in the team
        public static Team load(string filename, GameExt game)
        {
            // Variables
            BinaryReader	reader=	new BinaryReader(File.OpenRead(filename));
            Team	team=	new Team(game, true);
            int	size;
            int	passiveSize=	0;

            team.money=	reader.ReadInt32();
            size=	reader.ReadInt32();
            for(int i= 0; i< size; i++)
            {
                team.units.add(
                    new Unit(
                        reader.ReadString(),
                        reader.ReadString(),
                        reader.ReadString(),
                        game,
                        game.registry.get<ProfessionRegistry>().get(reader.ReadChar()+""+reader.ReadChar()+""+reader.ReadChar()+""+reader.ReadChar())
                    )
                );
                team.units.items[i].statVariance=	new BaseStats(reader.ReadUInt64());
                team.units.items[i].setExp(reader.ReadInt32());
                passiveSize=	reader.ReadInt32();
                for(int k= 0; k< passiveSize; k++)
                {
                    team.units.items[i].assignPassive(
                        team.units.items[i].decryptPassive(reader.ReadChar()),
                        k
                    );
                }
            }

            return team;
        }
Ejemplo n.º 3
0
 // --- Constructors ---
 public CursorArrow(GameExt pmGame, Vector3 pmPos)
     : base(pmGame, pmGame.models.get("arrow"), pmPos)
 {
     color=	game.getColor("green");
     color.A=	200;
     texture=	game.textures.get("white_background");
 }
Ejemplo n.º 4
0
 // --- Constructors ---
 public Unit(string pmFirstName, string pmNickname, string pmLastName, GameExt pmGame, Profession pmProf)
     : base(pmGame, pmGame.models.get(pmProf.getUnitModelID()), 16f*Vector3.UnitY)
 {
     if(pmFirstName.Length> 10)
         pmFirstName=	pmFirstName.Substring(0, 10);
     if(pmLastName.Length> 8)
         pmLastName=	pmLastName.Substring(0, 8);
     if(pmNickname.Length> 10)
         pmNickname=	pmNickname.Substring(0, 10);
     firstName=	pmFirstName;
     lastName=	pmLastName;
     nickname=	pmNickname;
     prof=	pmProf;
     color=	game.getColor("black");
     texture=	game.textures.get("unit_uv");
     pos+=	Vector3.UnitY*16f;
     mapPos=	new int[]	{-1, -1};
     isWalkingDone=	false;
     isAttackingDone=	false;
     originalStats=	new int[8];
     battleStats=	new int[8];
     pExp=	0;
     pLevel=	1;
     statEffects=	new List<StatEffect>();
     isAI=	false;
     statVariance=	new BaseStats(
         0, 0, // HP, Mana
         0, 0, // Atk, Def
         0, 0, // Mag, Res
         0, 0 // Spd, Move
     );
 }
Ejemplo n.º 5
0
 // --- Constructors ---
 public Label(GameExt pmGame)
     : base(pmGame)
 {
     texStates=	new ControlStateItems<Texture2D>(null, this);
     bRenderText=	true;
     textAlignment=	TextAlignment.CenterVerticalAlign;
 }
Ejemplo n.º 6
0
        // --- Methods ---
        // Creates an icon of the passive's info
        public Control createIcon(GameExt game)
        {
            // Variable
            Control	ctrl=	new Control(game);
            Label	nameLbl=	new Label(game);

            ctrl.backColorStates.normal=	game.getColor("white");
            ctrl.texStates.normal=	icon;
            ctrl.setState(ControlState.Normal);
            ctrl.canHover=	false;

            ctrl.tooltip=	new Tooltip(game);
            ctrl.tooltip.font=	game.fonts.get("default_font");
            ctrl.tooltip.text=	getTooltipText();
            ctrl.tooltip.size=	new Point(488, 96);
            ctrl.tooltip.backColorStates.normal=	game.getColor("paleturquoise");
            ctrl.tooltip.setState(ControlState.Normal);
            ctrl.tooltip.border.size=	1;
            ctrl.tooltip.xPad=	-ctrl.tooltip.size.X;
            ctrl.tooltip.yPad=	24;

            nameLbl.text=	name+":";
            nameLbl.bounds.X=	16;
            nameLbl.bounds.Y=	8;

            ctrl.tooltip.addChild(nameLbl);

            return ctrl;
        }
Ejemplo n.º 7
0
        // --- Constructors ---
        public AttackDecisionGui(GSGameplay pmGState, ref GameExt pmGame, ref BattleMap pmMap)
        {
            gstate=	pmGState;
            game=	pmGame;
            map=	pmMap;

            background=	new Control(game);
            leftPanel=	new Control(game);
            rightPanel=	new Control(game);
            lpName=	new Label(game);
            lpStats=	new Label[8];
            for(int i= 0; i< lpStats.Length; i++)
                lpStats[i]=	new Label(game);
            rpName=	new Label(game);
            rpStats=	new Label[8];
            for(int i= 0; i< rpStats.Length; i++)
                rpStats[i]=	new Label(game);
            accuracyLbl=	new Label(game);
            accuracy=	new Label(game);
            critLbl=	new Label(game);
            crit=	new Label(game);
            dmgLbl=	new Label(game);
            dmg=	new Label(game);
            commit=	new Button(game);
            cancel=	new Button(game);
        }
Ejemplo n.º 8
0
        // Centers the mouse on the game window
        public void centerMouse(GameExt game)
        {
            // Variables
            Point	pos=	new Point(game.Window.ClientBounds.Width/2, game.Window.ClientBounds.Height/2);

            Mouse.SetPosition(pos.X, pos.Y);
            game.lastMousePosition=	pos;
        }
Ejemplo n.º 9
0
 // Initiates the particle system
 public virtual void init(GameExt game, Random rng)
 {
     for(int i= 0; i< maxParticles; i++)
     {
         particles.add(createParticle(game));
         resetParticle(i, rng);
     }
 }
Ejemplo n.º 10
0
 // --- Constructors ---
 public SkillsGui(GSGameplay pmGState, ref GameExt pmGame, ref BattleMap pmMap)
 {
     gstate=	pmGState;
     game=	pmGame;
     map=	pmMap;
     tick=	0;
     set=	new Control(game);
 }
Ejemplo n.º 11
0
        // --- Constructors ---
        public Sorcerer(GameExt pmGame)
            : base(pmGame, "Sorcerer", "000i", new BaseStats(
			60, 60,
			60, 60,
			60, 60,
			60, 4
		))
        {
        }
Ejemplo n.º 12
0
        // --- Constructors ---
        public Technomancer(GameExt pmGame)
            : base(pmGame, "Technomancer", "000j", new BaseStats(
			60, 60,
			60, 60,
			60, 60,
			60, 4
		))
        {
        }
Ejemplo n.º 13
0
        // --- Constructors ---
        public Crusader(GameExt pmGame)
            : base(pmGame, "Crusader", "0005", new BaseStats(
			60, 60,
			60, 60,
			60, 60,
			60, 4
		))
        {
        }
Ejemplo n.º 14
0
        // --- Constructors ---
        public Witch(GameExt pmGame)
            : base(pmGame, "Witch", "000m", new BaseStats(
			60, 60,
			60, 60,
			60, 60,
			60, 4
		))
        {
        }
Ejemplo n.º 15
0
        // --- Constructors ---
        public Thug(GameExt pmGame)
            : base(pmGame, "Thug", "000k", new BaseStats(
			60, 60,
			60, 60,
			60, 60,
			60, 4
		))
        {
        }
Ejemplo n.º 16
0
        // --- Constructors ---
        public Ballista(GameExt pmGame)
            : base(pmGame, "Ballista", "0001", new BaseStats(
			60, 60,
			60, 60,
			60, 60,
			60, 4
		))
        {
        }
Ejemplo n.º 17
0
        // --- Constructors ---
        public Scholar(GameExt pmGame)
            : base(pmGame, "Scholar", "000f", new BaseStats(
			60, 60,
			60, 60,
			60, 60,
			60, 4
		))
        {
        }
Ejemplo n.º 18
0
        // --- Constructors ---
        public Necromancer(GameExt pmGame)
            : base(pmGame, "Necromancer", "000d", new BaseStats(
			60, 60,
			60, 60,
			60, 60,
			60, 4
		))
        {
        }
Ejemplo n.º 19
0
        // --- Constructors ---
        public General(GameExt pmGame)
            : base(pmGame, "General", "0009", new BaseStats(
			60, 60,
			60, 60,
			60, 60,
			60, 4
		))
        {
        }
Ejemplo n.º 20
0
        // --- Constructors ---
        public Siphon(GameExt pmGame)
            : base(pmGame, "Siphon", "000g", new BaseStats(
			60, 60,
			60, 60,
			60, 60,
			60, 4
		))
        {
        }
Ejemplo n.º 21
0
        // --- Constructors ---
        public TimeTraveler(GameExt pmGame)
            : base(pmGame, "Time Traveler", "000l", new BaseStats(
			60, 60,
			60, 60,
			60, 60,
			60, 4
		))
        {
        }
Ejemplo n.º 22
0
        // --- Constructors ---
        public Druid(GameExt pmGame)
            : base(pmGame, "Druid", "0007", new BaseStats(
			60, 60,
			60, 60,
			60, 60,
			60, 4
		))
        {
        }
Ejemplo n.º 23
0
 // --- Constructors ---
 public Tooltip(GameExt pmGame)
     : base(pmGame)
 {
     xPad=	4;
     yPad=	8;
     bRenderText=	true;
     areChildrenRelativePos=	true;
     bVisible=	false;
 }
Ejemplo n.º 24
0
        // --- Constructors ---
        public Bard(GameExt pmGame)
            : base(pmGame, "Bard", "0002", new BaseStats(
			60, 60,
			60, 60,
			60, 60,
			60, 4
		))
        {
        }
Ejemplo n.º 25
0
        // --- Constructors ---
        public Fisherman(GameExt pmGame)
            : base(pmGame, "Fisherman", "0008", new BaseStats(
			60, 60,
			60, 60,
			60, 60,
			60, 4
		))
        {
        }
Ejemplo n.º 26
0
        // --- Constructors ---
        public Huntsman(GameExt pmGame)
            : base(pmGame, "Huntsman", "000b", new BaseStats(
			60, 60,
			60, 60,
			60, 60,
			60, 4
		))
        {
        }
Ejemplo n.º 27
0
        // --- Constructors ---
        public DarkKnight(GameExt pmGame)
            : base(pmGame, "Dark Knight", "0006", new BaseStats(
			60, 60,
			60, 60,
			60, 60,
			60, 4
		))
        {
        }
Ejemplo n.º 28
0
        // --- Constructors ---
        public Artificer(GameExt pmGame)
            : base(pmGame, "Artificer", "0000", new BaseStats(
			60, 60,
			60, 60,
			60, 60,
			60, 4
		))
        {
        }
Ejemplo n.º 29
0
        // --- Constructors ---
        public Gladiator(GameExt pmGame)
            : base(pmGame, "Gladiator", "000a", new BaseStats(
			60, 60,
			60, 60,
			60, 60,
			60, 4
		))
        {
        }
Ejemplo n.º 30
0
 // --- Constructors ---
 public Profession(GameExt pmGame, string name, string pmRegname, BaseStats stats)
 {
     game=	pmGame;
     Name=	name;
     Stats=	stats;
     passives=	new HashTable<Passive>(4);
     currPassives=	new string[3];
     updatingAI=	false;
     pRegname=	pmRegname;
 }