public override void OnStartGame() { base.OnStartGame(); //动态设置关卡回合数上线 Game.TotalCount = Game.PlayerCount; Game.TotalTurn = Game.PlayerCount * 6; Game.SendMissionInfo(); //这里需要随机,有多少个人,就随机多少次,设置State=1的木板 // CreatePhysicalObj(int x, int y,string name, string model, string defaultAction, int scale, int rotation) m_bord.Add(Game.CreatePhysicalObj(76, 167, "board1", "game.crazytank.assetmap.Board001", "1", 1, 336)); m_bord.Add(Game.CreatePhysicalObj(402, 159, "board2", "game.crazytank.assetmap.Board001", "1", 1, 23)); m_bord.Add(Game.CreatePhysicalObj(699, 156, "board3", "game.crazytank.assetmap.Board001", "1", 1, 350)); m_bord.Add(Game.CreatePhysicalObj(959, 148, "board4", "game.crazytank.assetmap.Board001", "1", 1, 325)); m_bord.Add(Game.CreatePhysicalObj(177, 261, "board5", "game.crazytank.assetmap.Board001", "1", 1, 22)); m_bord.Add(Game.CreatePhysicalObj(514, 277, "board6", "game.crazytank.assetmap.Board001", "1", 1, 336)); m_bord.Add(Game.CreatePhysicalObj(782, 285, "board7", "game.crazytank.assetmap.Board001", "1", 1, 23)); m_bord.Add(Game.CreatePhysicalObj(1061, 280, "board8", "game.crazytank.assetmap.Board001", "1", 1, 22)); m_bord.Add(Game.CreatePhysicalObj(273, 406, "board9", "game.crazytank.assetmap.Board001", "1", 1, 350)); m_bord.Add(Game.CreatePhysicalObj(620, 408, "board10", "game.crazytank.assetmap.Board001", "1", 1, 23)); m_bord.Add(Game.CreatePhysicalObj(873, 414, "board11", "game.crazytank.assetmap.Board001", "1", 1, 336)); m_bord.Add(Game.CreatePhysicalObj(1155, 428, "board12", "game.crazytank.assetmap.Board001", "1", 1, 336)); m_door = Game.CreatePhysicalObj(1275, 556, "door", "game.crazytank.assetmap.CrystalDoor001", "start", 1, 0); int[] num = new int[] { 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12 }; for (int i = 0; i < Game.TotalCount; i++) { int index = Game.Random.Next(0, 12); if (num[index] == index) { i--; } else { num[index] = index; m_bord.ToArray()[index].PlayMovie("2", 0, 0); KeyIndex = string.Format("Key{0}", index); m_key.Add(Game.CreatePhysicalObj(m_bord.ToArray()[index].X, m_bord.ToArray()[index].Y - 8, KeyIndex, "game.crazytank.assetmap.Key", "1", 1, 0)); Game.SendGameObjectFocus(1, m_bord.ToArray()[index].Name, 0, 0); } } Game.SendGameObjectFocus(1, "door", 1000, 0); List<LoadingFileInfo> loadingFileInfos = new List<LoadingFileInfo>(); loadingFileInfos.Add(new LoadingFileInfo(2, "sound/Sound201.swf", "Sound201")); loadingFileInfos.Add(new LoadingFileInfo(2, "sound/Sound202.swf", "Sound202")); Game.SendLoadResource(loadingFileInfos); Game.GameOverResources.Add("game.crazytank.assetmap.CrystalDoor001"); }
public override void OnStartGame() { base.OnStartGame(); for (int i = 0; i < 4; i++) { SomeNpc.Add(Game.CreateNpc(201, (i + 1) * 100, 500, 1)); } SomeNpc.Add(Game.CreateNpc(202, 500, 500, 1)); Tip = Game.CreateTip(390, 120, "firstFront", "com.map.trainer.TankTrainerAssetII", "Empty", 1, 0); }
public override void OnPrepareNewGame() { base.OnPrepareNewGame(); m_kingMoive = Game.Createlayer(0, 0, "kingmoive", "game.asset.living.BossBgAsset", "out", 1, 1, 0); m_front = Game.Createlayer(710, 380, "font", "game.asset.living.BombKingAsset", "out", 1, 1, 0); m_king = Game.CreateBoss(bossID, 888, 590, -1, 0); m_king.FallFrom(888, 690, "fall", 0, 2, 1000); m_king.SetRelateDemagemRect(-41, -187, 83, 140); m_kingMoive.PlayMovie("in", 1000, 0); m_front.PlayMovie("in", 2000, 2000); m_king.AddDelay(16); }
//public override void OnPrepareStartGame() //{ // base.OnPrepareStartGame(); //} //public override void OnStartGame() //{ // base.OnStartGame(); //} public override void OnStartGame() { base.OnStartGame(); m_moive = Game.Createlayer(0, 0, "moive", "game.asset.living.BossBgAsset", "out", 1, 1); m_front = Game.Createlayer(1131, 150, "font", "game.asset.living.AntQueenAsset", "out", 1, 1); boss = Game.CreateBoss(bossID, 1316, 444, -1, 1); boss.SetRelateDemagemRect(-42, -200, 84, 194); boss.Say(LanguageMgr.GetTranslation("GameServerScript.AI.Messions.DCNM2102.msg1"), 0, 200, 0); m_moive.PlayMovie("in", 6000, 0); m_front.PlayMovie("in", 6100, 0); m_moive.PlayMovie("out", 10000, 1000); m_front.PlayMovie("out", 9900, 0); }
public override void OnBeginNewTurn() { base.OnBeginNewTurn(); if (Game.TurnIndex > 1) { if (m_moive != null) { Game.RemovePhysicalObj(m_moive, true); m_moive = null; } if (m_front != null) { Game.RemovePhysicalObj(m_front, true); m_front = null; } } }
public override void OnPrepareNewGame() { base.OnPrepareNewGame(); m_kingMoive = Game.Createlayer(0, 0, "kingmoive", "game.asset.living.BossBgAsset", "out", 1, 1, 0); m_kingFront = Game.Createlayer(720, 495, "font", "game.asset.living.boguoKingAsset", "out", 1, 1, 0); m_king = Game.CreateBoss(m_state, 888, 590, -1, 0); m_king.FallFrom(888, 690, "fall", 0, 2, 1000); m_king.SetRelateDemagemRect(-21, -87, 72, 59); m_king.AddDelay(10); m_king.Say(LanguageMgr.GetTranslation("GameServerScript.AI.Messions.CHM1076.msg2"), 0, 3000); m_kingMoive.PlayMovie("in", 9000, 0); m_kingFront.PlayMovie("in", 9000, 0); m_kingMoive.PlayMovie("out", 13000, 0); m_kingFront.PlayMovie("out", 13400, 0); turn = Game.TurnIndex; }
public override void OnPrepareNewGame() { base.OnPrepareNewGame(); m_moive = Game.Createlayer(0, 0, "moive", "game.asset.living.BossBgAsset", "out", 1, 1, 0); m_front = Game.Createlayer(680, 330, "font", "game.asset.living.boguoLeaderAsset", "out", 1, 1, 0); m_boss = Game.CreateBoss(bossID, 770, -1500, -1, 1); m_boss.FallFrom(770, 301, "fall", 0, 2, 1000); m_boss.SetRelateDemagemRect(34, -35, 11, 18); m_boss.AddDelay(10); m_boss.Say(LanguageMgr.GetTranslation("GameServerScript.AI.Messions.CHM1073.msg2"), 0, 6000); m_boss.PlayMovie("call", 5900, 0); m_moive.PlayMovie("in", 9000, 0); m_boss.PlayMovie("weakness", 10000, 5000); m_front.PlayMovie("in", 9000, 0); m_moive.PlayMovie("out", 15000, 0); }
public override void OnStartGame() { base.OnStartGame(); m_moive = Game.Createlayer(0, 0, "moive", "game.asset.living.BossBgAsset", "out", 1, 0); m_front = Game.Createlayer(680, 330, "font", "game.asset.living.boguoLeaderAsset", "out", 1, 0); m_boss = Game.CreateBoss(bossID, 770, -1500, -1, 1); m_boss.FallFrom(770, 301, "fall", 0, 2, 1000); m_boss.SetRelateDemagemRect(34, -35, 11, 18); m_boss.AddDelay(10); m_boss.Say("你们胆敢闯入我的地盘,准备受死吧!", 0, 6000); m_boss.PlayMovie("call", 5900, 0); m_moive.PlayMovie("in", 9000, 0); m_boss.PlayMovie("weakness", 10000, 5000); m_front.PlayMovie("in", 9000, 0); m_moive.PlayMovie("out", 15000, 0); //设置本关卡为Boss关卡,关卡胜利后,玩家可以翻一张牌 Game.BossCardCount = 1; }
internal void SendRemovePhysicalObj(PhysicalObj obj) { GSPacketIn pkg = new GSPacketIn((byte)ePackageType.GAME_CMD); pkg.WriteByte((byte)eTankCmdType.DISAPPEAR); pkg.WriteInt(obj.Id); SendToAll(pkg); //TODO 完成删除物品 }
internal void SendPhysicalObjPlayAction(PhysicalObj obj) { GSPacketIn pkg = new GSPacketIn((byte)ePackageType.GAME_CMD); pkg.WriteByte((byte)eTankCmdType.UPDATE_BOARD_STATE); pkg.WriteInt(obj.Id); pkg.WriteString(obj.CurrentAction); SendToAll(pkg); }
internal void SendAddPhysicalTip(PhysicalObj obj) { GSPacketIn pkg = new GSPacketIn((byte)ePackageType.GAME_CMD); pkg.WriteByte((byte)eTankCmdType.ADD_TIP_LAYER); pkg.WriteInt(obj.Id); pkg.WriteInt(obj.Type); pkg.WriteInt(obj.X); pkg.WriteInt(obj.Y); pkg.WriteString(obj.Model); pkg.WriteString(obj.CurrentAction); pkg.WriteInt(obj.Scale); pkg.WriteInt(obj.Rotation); SendToAll(pkg); }
internal void SendAddPhysicalObj(PhysicalObj obj) { GSPacketIn pkg = new GSPacketIn((byte)ePackageType.GAME_CMD); pkg.WriteByte((byte)eTankCmdType.ADD_BOX); pkg.WriteInt(obj.Id); pkg.WriteInt(obj.Type); pkg.WriteInt(obj.X); pkg.WriteInt(obj.Y); pkg.WriteString(obj.Model); pkg.WriteString(obj.CurrentAction); pkg.WriteInt(obj.Scale); pkg.WriteInt(obj.Scale); pkg.WriteInt(obj.Rotation); pkg.WriteInt(0); pkg.WriteInt(0); //var id:int = evt.pkg.readInt(); //var type:int = evt.pkg.readInt(); //var px:int = evt.pkg.readInt(); //var py:int = evt.pkg.readInt(); //var model:String = evt.pkg.readUTF(); //var action:String = evt.pkg.readUTF(); //var pscaleX:int = evt.pkg.readInt(); //var pscaleY:int = evt.pkg.readInt(); //var protation:int = evt.pkg.readInt(); //var layer:int = evt.pkg.readInt(); SendToAll(pkg); }
private void ProtectingWall() { if (IsEixt == 0) { m_wallLeft = ((PVEGame)Game).CreatePhysicalObj(Body.X - 65, 510, "wallLeft", "com.mapobject.asset.WaveAsset_01_left", "1", 1, 0); m_wallRight = ((PVEGame)Game).CreatePhysicalObj(Body.X + 65, 510, "wallLeft", "com.mapobject.asset.WaveAsset_01_right", "1", 1, 0); m_wallLeft.SetRect(-165, -169, 43, 330); m_wallRight.SetRect(128, -165, 41, 330); IsEixt = 1; } int index = Game.Random.Next(0, WallChat.Length); Body.Say(WallChat[index], 1, 0); }
public PhysicalObj CreatePhysicalObj(int x, int y, string name, string model, string defaultAction, int scale, int rotation) { PhysicalObj obj = new PhysicalObj(PhysicalId++, name, model, defaultAction, scale, rotation); obj.SetXY(x, y); AddPhysicalObj(obj, true); return obj; }
public override void OnBeginNewTurn() { base.OnBeginNewTurn(); IsSay = 0; if (Game.TurnIndex > turn + 1) { if (m_kingMoive != null) { Game.RemovePhysicalObj(m_kingMoive, true); m_kingMoive = null; } if (m_kingFront != null) { Game.RemovePhysicalObj(m_kingFront, true); m_kingFront = null; } } }
public PhysicalObjDoAction(PhysicalObj obj, string action, int delay, int movieTime) : base(delay, movieTime) { m_obj = obj; m_action = action; }
public override void OnStartGame() { CreateNpc(); tip = Game.CreateTip(390, 120, "firstFront", "com.map.trainer.TankTrainerAssetII", "Empty", 1, 1); }
public override void OnBeginNewTurn() { base.OnBeginNewTurn(); if (m_kingMoive != null) { Game.RemovePhysicalObj(m_kingMoive, true); m_kingMoive = null; } if (m_front != null) { Game.RemovePhysicalObj(m_front, true); m_front = null; } foreach (Player player in Game.GetAllFightPlayers()) { if (player.IsLiving == false) player.OffSeal(player, 0); } }
public override void OnStartGame() { base.OnStartGame(); m_kingMoive = Game.Createlayer(0, 0, "kingmoive", "game.asset.living.BossBgAsset", "out", 1, 0); m_kingFront = Game.Createlayer(610, 380, "font", "game.asset.living.boguoKingAsset", "out", 1, 0); m_king = Game.CreateBoss(m_state, 750, 668, -1, 0); m_king.FallFrom(750, 640, "fall", 0, 2, 1000); m_king.SetRelateDemagemRect(-21, -79, 72, 51); m_king.AddDelay(10); m_king.Say("你们这些低等的庶民,竟敢来到我的王国放肆!", 0, 3000); m_kingMoive.PlayMovie("in", 9000, 0); m_kingFront.PlayMovie("in", 9000, 0); m_kingMoive.PlayMovie("out", 13000, 0); m_kingFront.PlayMovie("out", 13400, 0); turn = Game.TurnIndex; }
public override bool CanGameOver() { base.CanGameOver(); //回合数到100的时候结束游戏 if (Game.TurnIndex > Game.MissionInfo.TotalTurn - 1) { return true; } if (m_king.IsLiving == false) { if (m_state == firstBossID) { m_state++; } } if (m_state == secondBossID && m_secondKing == null) { m_kingMoive = Game.Createlayer(0, 0, "moive", "game.asset.living.BossBgAsset", "out", 1, 0); m_secondKing = Game.CreateBoss(m_state, m_king.X, m_king.Y, m_king.Direction, 1); Game.RemoveLiving(m_king.Id); if (m_secondKing.Direction == -1) { m_secondKing.SetRectBomb(24, -159, 66, 38); m_secondKing.SetRelateDemagemRect(58, -142, 5, 3); } else { m_secondKing.SetRectBomb(-90, -159, 66, 38); m_secondKing.SetRelateDemagemRect(-63, -142, 5, 3); } m_secondKing.Say("<span class='red'>你们把我激怒了,我饶不了你们!</span>", 0, 3000); m_kingMoive.PlayMovie("in", 5000, 0); m_secondKing.PlayMovie("weakness", 6100, 0); m_kingMoive.PlayMovie("out", 12000, 0); List<Player> players = Game.GetAllFightPlayers(); int minDelay = Game.FindRandomPlayer().Delay; foreach (Player player in players) { if (player.Delay < minDelay) { minDelay = player.Delay; } } m_secondKing.AddDelay(minDelay - 2000); turn = Game.TurnIndex; } if (m_secondKing != null && m_secondKing.IsLiving == false) { m_leftWall = Game.FindPhysicalObjByName("wallLeft", false); m_rightWall = Game.FindPhysicalObjByName("wallRight", false); if (m_leftWall != null) { Game.RemovePhysicalObj(m_leftWall[0], true); } if (m_rightWall != null) { Game.RemovePhysicalObj(m_rightWall[0], true); } Game.CreatePhysicalObj(m_secondKing.X, m_secondKing.Y, "king", "game.living.LivingRecover005", "0", 0, 0); m_kill++; return true; } return false; }
public virtual void AddPhysicalTip(PhysicalObj phy, bool sendToClient) { m_map.AddPhysical(phy); phy.SetGame(this); if (sendToClient) { SendAddPhysicalTip(phy); } }
public void RemovePhysicalObj(PhysicalObj phy, bool sendToClient) { m_map.RemovePhysical(phy); phy.SetGame(null); if (sendToClient) { SendRemovePhysicalObj(phy); } }
public override void OnStartGame() { base.OnStartGame(); m_kingMoive = Game.Createlayer(0, 0, "kingmoive", "game.asset.living.BossBgAsset", "out", 1, 1, 0); m_front = Game.Createlayer(725, 395, "font", "game.asset.living.BombKingAsset", "out", 1, 1, 0); //再试一次跳过剧情动画 if (Game.WantTryAgain == 1) { return; } Game.SendPlayBackgroundSound(false); Game.AddAction(new LockFocusAction(false, 0, 0)); m_king = Game.CreateBoss(kingID, 888, 715, 1, 0); Game.AddAction(new FocusAction(m_king.X, m_king.Y - 90, 0, 0, 0)); m_king.PlayMovie("cry", 4000, 2000); m_king.Say(LanguageMgr.GetTranslation("GameServerScript.AI.Messions.CHM1277.msg1"), 2, 4000); m_king.Say(LanguageMgr.GetTranslation("GameServerScript.AI.Messions.CHM1277.msg2"), 2, 9000); m_king.MoveTo(500, m_king.Y, "walk", 13000); m_king.Say(LanguageMgr.GetTranslation("GameServerScript.AI.Messions.CHM1277.msg3"), 2, 21000); m_king.Say(LanguageMgr.GetTranslation("GameServerScript.AI.Messions.CHM1277.msg4"), 2, 25000); m_king.Say(LanguageMgr.GetTranslation("GameServerScript.AI.Messions.CHM1277.msg5"), 2, 29000); m_king.Say(LanguageMgr.GetTranslation("GameServerScript.AI.Messions.CHM1277.msg6"), 2, 33000); m_king.Say(LanguageMgr.GetTranslation("GameServerScript.AI.Messions.CHM1277.msg7"), 2, 37000); m_king.Say(LanguageMgr.GetTranslation("GameServerScript.AI.Messions.CHM1277.msg8"), 2, 41000); m_king.Say(LanguageMgr.GetTranslation("GameServerScript.AI.Messions.CHM1277.msg9"), 2, 45000); m_king.Say(LanguageMgr.GetTranslation("GameServerScript.AI.Messions.CHM1277.msg10"), 2, 49000); m_king.Say(LanguageMgr.GetTranslation("GameServerScript.AI.Messions.CHM1277.msg11"), 2, 53000, 4000); foreach (Player player in Game.GetAllFightPlayers()) { Game.SendLivingToTop(player); } }