Пример #1
0
        public void LoadContent(Resources res, GameHandler gameHandler, int backgroundTexID, int floorTexID)
        {
            this.countdownFont = res.Battle_CountDownFont;

            this.backgroundTex = res.Battle_BackgroundTexList[backgroundTexID];
            this.floorTex      = res.Battle_FloorTexList[floorTexID];

            this.timeSlowOverlayTex = res.Battle_FadeRect;

            this.fighterShadowTex = res.Battle_FighterShadow;

            this.timeUntilFightState = 10 * 1000; //The battle starts with 10 seconds until fightMode

            LoadFighters(res, gameHandler);

            this.mainSelectionWheel = new OptionWheel(new Vector2(player.standbyScreenPos.X + 6, player.standbyScreenPos.Y - 30), 4);
            this.mainSelectionWheel.LoadContent(res);

            //System.Diagnostics.Debug.WriteLine("player attack count: " + this.player.attackList.Count());
            this.fightWheel = new OptionWheel(new Vector2(player.standbyScreenPos.X + 6, player.standbyScreenPos.Y - 30), this.player.attackList.Count());
            List <Texture2D> icons = new List <Texture2D>();

            for (int i = 0; i < this.player.attackList.Count(); i++)
            {
                icons.Add(res.MoveIconTexDict[Move.ID_DICT[this.player.attackList[i].moveName]]);
            }
            this.fightWheel.LoadContent(res, icons);

            this.enemySelectorAnim = new FrameAnim(res.Battle_UI_SelectorArrowSpriteSheet, 6, 32, 18, 24, true, false);
        }
Пример #2
0
        public override void LoadContent(Resources res)
        {
            base.LoadContent(res);

            List <int> idleAnimData  = res.GetBasicBattleAnimData(this.enemyID, "idle"); //This block loads the idle animation
            Texture2D  idleAnimSheet = res.GetBasicBattleSpriteSheet(this.enemyID, "idle");

            this.idleAnim = new FrameAnim(idleAnimSheet, idleAnimData[0], idleAnimSheet.Width / idleAnimData[0], idleAnimSheet.Height, idleAnimData[1], true, true);

            this.baseDims = new Vector2(idleAnimSheet.Width / idleAnimData[0], idleAnimSheet.Height);


            List <int> fleeAnimData  = res.GetBasicBattleAnimData(this.enemyID, "flee"); //This block loads the fleeing animation
            Texture2D  fleeAnimSheet = res.GetBasicBattleSpriteSheet(this.enemyID, "flee");

            this.fleeAnim = new FrameAnim(fleeAnimSheet, fleeAnimData[0], fleeAnimSheet.Width / fleeAnimData[0], fleeAnimSheet.Height, fleeAnimData[1], true, false);

            List <Texture2D>   fightAnimSheets     = res.GetFightBattleSpriteSheets(this.enemyID); //This block loads all of the fighting animations
            List <List <int> > fightAnimSheetsData = res.GetFightBattleAnimData(this.enemyID);

            for (int i = 0; i < fightAnimSheets.Count(); i++)
            {
                Texture2D  sheetTex  = fightAnimSheets[i];
                List <int> frameData = fightAnimSheetsData[i];
                this.fightAnims.Add(new FrameAnim(sheetTex, frameData[0], sheetTex.Width / frameData[0], sheetTex.Height, frameData[1], true, false));
            }

            this.healthFont = res.Battle_HealthFont;
            this.maxHealth  = Enemy.getMaxHealthFromID(this.enemyID);
            this.curHealth  = this.maxHealth;
        }
Пример #3
0
        public override void LoadContent(Resources res)
        {
            this.villagerAnim = new FrameAnim(res.NPC_VillagerAnim, 2, 32, 64, 1000, true, true);

            this.welcomeBoxTex            = res.World_Interaction_TalkWindowOpen;
            this.welcomeBoxOpenAnimation  = new FrameAnim(res.World_Interaction_TalkWindowAnim, 15, 64, 32, 1, true, false);
            this.welcomeBoxCloseAnimation = new FrameAnim(res.World_Interaction_TalkWindowAnim, 15, 64, 32, 1, false, false);
        }
Пример #4
0
        public override void LoadContent(Resources res)
        {
            spriteAnim = res.MovePrimaryAnims[0]; //This is super placeholder

            this.bounds = new Rectangle((int)this.worldPos.X, (int)this.worldPos.Y, spriteAnim.frameWidth, spriteAnim.frameHeight);

            this.debugTex = res.Debug_BoundsRect;
            this.pulseFX  = res.Player_Affinity_ManaPulse;
        }
Пример #5
0
    public void showWait()
    {
        RoomMgr   rm    = RoomMgr.GetInstance();
        NetMgr    nm    = NetMgr.GetInstance();
        GameMaima maima = rm.state.maima;

        bool      act  = maima.seatindex == rm.seatindex;
        Transform mas  = tmaima.Find("mas");
        UIGrid    grid = mas.GetComponent <UIGrid>();

        tmaima.gameObject.SetActive(true);

        title.text = act ? "请选择飞苍蝇" : "请等待飞苍蝇";
        score.text = "";

        int count = maima.mas.Count;
        int i     = 0;

        for (i = 0; i < mas.childCount && i < count; i++)
        {
            Transform board = mas.GetChild(i);
            Transform tile  = board.Find("tile");
            FrameAnim anim  = board.GetComponent <FrameAnim>();

            board.gameObject.SetActive(true);

            tile.gameObject.SetActive(false);
            anim.reset();

            GameObject _fire = board.Find("fire").gameObject;
            _fire.SetActive(false);

            int j = i;

            PUtils.onClick(board, () => {
                if (!act)
                {
                    return;
                }

                nm.send("maima", "index", j);
            });
        }

        for (int j = i; j < mas.childCount; j++)
        {
            Transform board = mas.GetChild(j);
            board.gameObject.SetActive(false);
        }

        grid.Reposition();
    }
Пример #6
0
        public override void LoadContent(Resources res)
        {
            this.enemyID = Enemy.ID_SLIME;
            this.tex     = res.Enemy_Slime;

            this.anim = getFrameAnimFromID(res);

            this.level = 1;

            this.PopulateWithThisFighterRandomCount();
            maxHealth = 30;

            this.Bounds = new Bounds((int)this.superPos.X, (int)this.superPos.Y, (int)(this.anim.frameWidth * this.size), (int)(this.anim.frameHeight * this.size));
        }
Пример #7
0
        public void DrawTilemap(SpriteBatch sb)
        {
            Vector2 firstSquare = new Vector2(Camera.Location.X / Tile.TileWidth, Camera.Location.Y / Tile.TileHeight);
            int     firstX      = (int)firstSquare.X;
            int     firstY      = (int)firstSquare.Y;

            //System.Diagnostics.Debug.WriteLine("firstX: " + firstX + "   firstY: " + firstY);

            squaresAcross = (int)Math.Ceiling((double)(Camera.viewWidth / Tile.TileWidth)) + 1;
            squaresDown   = (int)Math.Ceiling((double)(Camera.viewHeight / Tile.TileHeight)) + 2;

            //System.Diagnostics.Debug.WriteLine("Squaresdown: " + squaresDown + "   SquaresAcross: " + squaresAcross);

            for (int y = 0; y < squaresDown; y++)
            {
                for (int x = 0; x < squaresAcross; x++)
                {
                    int mapX = firstX + x;
                    int mapY = firstY + y;


                    if ((mapX >= map.mapWidth) || (mapY >= map.mapHeight))   //Makes sure we're not out of bounds
                    {
                        continue;
                    }

                    foreach (int tileID in map.Rows[mapY].Columns[mapX].BaseTiles)
                    {
                        if (tileID == Tile.OVERWORLD_WATER)   //maybe changethis to an isAnimated value later
                        {
                            FrameAnim tileAnim = new FrameAnim(this.tileAnimSpiteSheets[Tile.OVERWORLD_WATER], map.waterMaxAnimFrame + 1, Tile.TileWidth, Tile.TileHeight, map.waterAnimFrameMS, true, false);
                            tileAnim.curFrameID = map.curWaterAnimFrame;
                            tileAnim.Draw(sb, Camera.WorldToScreen(new Vector2(mapX * Tile.TileWidth, mapY * Tile.TileHeight)));
                        }
                        else
                        {
                            sb.Draw(Tile.TileSetTexture,             //this calls the tileset that the tile texture comes from
                                    Camera.WorldToScreen(new Vector2(mapX * Tile.TileWidth, mapY * Tile.TileHeight)),
                                    Tile.GetSourceRectangle(tileID), //this calls the position from the tileset of the tile
                                    Color.White,
                                    0.0f,
                                    Vector2.Zero,
                                    1.0f,
                                    SpriteEffects.None,
                                    1.0f);
                        }
                    }
                }
            }
        }
Пример #8
0
        public void LoadContent(Resources res)
        {
            highlightAnim = new FrameAnim(res.Battle_UI_OptionWheel_HighlighterSpriteSheet, 2, 20, 20, 200, true, true);

            if (optionCount == 4)
            {
                this.optionTextures.Add(res.Battle_UI_OptionWheel_Fight);
                this.optionTextures.Add(res.Battle_UI_OptionWheel_Item);
                this.optionTextures.Add(res.Battle_UI_OptionWheel_Pass);
                this.optionTextures.Add(res.Battle_UI_OptionWheel_Flee);
                curSelectedID = 1;
            }

            SolveScreenPositionsByPosID(optionCount);
        }
Пример #9
0
        public override void LoadContent(Resources res)
        {
            //this.mousePointerTex = res.Menu_MousePointer;
            this.mousePointer = new FrameAnim(res.Menu_MousePointer_anim, 6, 16, 16, 80, false, false);


            this.gameHandler = new GameHandler();
            this.gameHandler.inputHandler = new InputHandler(Keyboard.GetState(), Mouse.GetState());
            this.gameHandler.curSceneID   = Scene.ID_OVERWORLD;

            this.worldScene = new OverworldScene();
            this.worldScene.LoadContent(res, gameHandler);

            this.battleScene = new BattleScene();
            this.battleScene.LoadContent(res, gameHandler);
        }
Пример #10
0
        public void LoadContent(Resources res)
        {
            this.titleFont   = res.Menu_Font;
            this.emptySquare = res.Inventory_Square_Empty;
            this.fullSqaure  = res.Inventory_Square_Full;

            this.statIcons = new List <Texture2D>();
            this.statIcons.Add(res.Menu_Stats_ATK);
            this.statIcons.Add(res.Menu_Stats_DEF);
            this.statIcons.Add(res.Menu_Stats_VIT);
            this.statIcons.Add(res.Menu_Stats_DEX);
            this.statIcons.Add(res.Menu_Stats_INT);
            this.statIcons.Add(res.Menu_Stats_WIS);
            this.statIcons.Add(res.Menu_Stats_VIR);
            this.statIcons.Add(res.Menu_Stats_EVL);

            this.folderArrow_Right = new FrameAnim(res.Inventory_ArrowAnim_Right, 8, 8, 15, 50, true, true);
            this.folderArrow_Left  = new FrameAnim(res.Inventory_ArrowAnim_Left, 8, 8, 15, 50, false, true);

            this.backgroundTint     = res.Battle_FadeRect;
            this.backgroundTintRect = new Rectangle(0, 0, (int)Window.resolution.X, (int)Window.resolution.Y);

            this.expBar.LoadContent(res);
        }
Пример #11
0
    public void showResult(Action cb)
    {
        RoomMgr   rm    = RoomMgr.GetInstance();
        NetMgr    nm    = NetMgr.GetInstance();
        GameMaima maima = rm.state.maima;

        bool      act  = false;
        Transform mas  = tmaima.Find("mas");
        UIGrid    grid = mas.GetComponent <UIGrid>();

        tmaima.gameObject.SetActive(true);

        title.text = "请等待飞苍蝇";
        score.text = "";

        int id    = maima.selected;
        int i     = 0;
        int count = maima.mas.Count;

        for (i = 0; i < mas.childCount && i < count; i++)
        {
            Transform board = mas.GetChild(i);
            Transform tile  = board.Find("tile");
            FrameAnim anim  = board.GetComponent <FrameAnim>();

            board.gameObject.SetActive(true);
            tile.gameObject.SetActive(false);
            anim.reset();

            PUtils.onClick(board, () => {});

            if (i == id)
            {
                continue;
            }

            int        _mjid = maima.mas[i];
            GameObject _fire = board.Find("fire").gameObject;
            _fire.SetActive(false);

            anim.run(() => {
                tile.gameObject.SetActive(true);
                UISprite t   = tile.GetComponent <UISprite>();
                t.spriteName = "" + _mjid;

                UISpriteData sp = t.GetAtlasSprite();
                t.width         = sp.width;
                t.height        = sp.height;
            });
        }

        for (int j = i; j < mas.childCount; j++)
        {
            Transform board = mas.GetChild(j);
            board.gameObject.SetActive(false);
        }

        grid.Reposition();

        int mjid = maima.mas[id];
        int add  = maima.scores[id];

        Transform  _board = mas.GetChild(id);
        FrameAnim  frame  = _board.GetComponent <FrameAnim>();
        Transform  _tile  = _board.Find("tile");
        GameObject fire   = _board.Find("fire").gameObject;

        fire.SetActive(true);

        frame.run(() => {
            _tile.gameObject.SetActive(true);
            UISprite t = _tile.GetComponent <UISprite>();

            t.spriteName    = "" + mjid;
            UISpriteData sp = t.GetAtlasSprite();
            t.width         = sp.width;
            t.height        = sp.height;

            _tile.localScale = new Vector3(1.8f, 1.8f, 1.0f);

            score.text = add > 0 ? "+" + add : "" + add;

            end(cb);
        });
    }
 public void Parse(GameBitBuffer buffer)
 {
     Field0 = buffer.ReadInt(32);
     Field1 = buffer.ReadInt(32);
     Field2 = new FrameAnim();
     Field2.Parse(buffer);
     snoSound = buffer.ReadInt(32);
     Field4 = buffer.ReadInt(32);
     serFrames = new SerializeData();
     serFrames.Parse(buffer);
     Field6 = new DT_VARIABLEARRAY();
     Field6.Parse(buffer);
 }
 public void Parse(GameBitBuffer buffer)
 {
     Field0 = buffer.ReadInt(32);
     Field1 = new Matrix4x4();
     Field1.Parse(buffer);
     Field2 = buffer.ReadFloat32();
     Field3 = buffer.ReadFloat32();
     Field4 = buffer.ReadFloat32();
     Field5 = buffer.ReadFloat32();
     Field6 = buffer.ReadFloat32();
     Field7 = buffer.ReadFloat32();
     Field8 = buffer.ReadFloat32();
     Field9 = buffer.ReadFloat32();
     Field10 = buffer.ReadFloat32();
     Field11 = buffer.ReadFloat32();
     Field12 = buffer.ReadFloat32();
     Field13 = buffer.ReadFloat32();
     Field14 = buffer.ReadFloat32();
     Field15 = buffer.ReadFloat32();
     Field16 = buffer.ReadFloat32();
     Field17 = buffer.ReadFloat32();
     Field18 = buffer.ReadFloat32();
     Field19 = buffer.ReadInt(32);
     Field20 = buffer.ReadInt(32);
     Field21 = buffer.ReadInt(32);
     Field22 = buffer.ReadInt(32);
     Field23 = new FrameAnim();
     Field23.Parse(buffer);
     Field24 = buffer.ReadInt(32);
 }
Пример #14
0
 public Frame(FrameEffect effect, FrameAnim anim)
 {
     this.effect = effect;
     this.anim   = anim;
 }
Пример #15
0
 protected void SetDefaultFrame(FrameEffect effect, FrameAnim anim)
 {
     defaultFrame = new Frame(effect, anim);
 }
Пример #16
0
 protected void AddFrame(FrameEffect effect, FrameAnim anim)
 {
     frames.Add(new Frame(effect, anim));
 }