private void QuestDropItem(AbstractGame game,int copyId,int npcId,bool playResult) { if (m_player.GetItemCount(m_info.Para1) < m_info.Para2) { List<ItemInfo> infos = null; int golds=0, moneys=0, gifttokens=0; if (game is PVEGame) { DropInventory.PvEQuestsDrop(npcId, ref infos); } if (game is PVPGame) { DropInventory.PvPQuestsDrop(game.RoomType, playResult, ref infos); } if (infos != null) { foreach (ItemInfo info in infos) { ItemInfo.FindSpecialItemInfo(info, ref golds,ref moneys,ref gifttokens); if (info != null) { m_player.TempBag.AddTemplate(info, info.Count); } } m_player.AddGold(golds); m_player.AddGiftToken(gifttokens); m_player.AddMoney(moneys); LogMgr.LogMoneyAdd(LogMoneyType.Award, LogMoneyType.Award_Drop, m_player.PlayerCharacter.ID, moneys, m_player.PlayerCharacter.Money, 0, 0, 0, "", "", "");//添加日志 } } }
void player_MissionOver(AbstractGame game, int missionId, int turnCount) { if (((missionId == m_info.Para1) || (m_info.Para1 == -1))&&(turnCount<=m_info.Para2) && (Value > 0)) { Value=0; } }
void player_MissionOver(AbstractGame game, int missionId, bool isWin) { if (((missionId == m_info.Para1) || (m_info.Para1 == -1)) && (Value > 0)) { Value--; } }
void player_GameOver(AbstractGame game, bool isWin, int gainXp) { switch (game.RoomType) { case eRoomType.Match: if (((m_info.Para1 == 0) || (m_info.Para1 == -1)) && (Value > 0)) Value = Value - 1; break; case eRoomType.Freedom: if (((m_info.Para1 == 1) || (m_info.Para1 == -1)) && (Value > 0)) Value = Value - 1; break; case eRoomType.Exploration: if (((m_info.Para1 == 2) || (m_info.Para1 == -1)) && (Value > 0)) Value = Value - 1; break; case eRoomType.Boss: if (((m_info.Para1 == 3) || (m_info.Para1 == -1)) && (Value > 0)) Value = Value - 1; break; case eRoomType.Treasure: if (((m_info.Para1 == 4) || (m_info.Para1 == -1)) && (Value > 0)) Value = Value - 1; break; default: break; } if (Value < 0) { Value = 0; } }
void player_MissionOver(AbstractGame game, int missionId, bool isWin) { if ((isWin == true) && (missionId == m_info.Para1) && (Value > 0)) { Value--; } }
void player_GameOver(AbstractGame game, bool isWin, int gainXp) { switch (game.RoomType) { case eRoomType.Match: //撮合战 if (((m_info.Para1 == 0) || (m_info.Para1 == -1)) && (Value > 0)) Value--; break; case eRoomType.Freedom://自由战 if (((m_info.Para1 == 1) || (m_info.Para1 == -1)) && (Value > 0)) Value--; break; default: break; } }
void player_AfterKillingLiving(AbstractGame game, int type, int id, bool isLiving, int demage) { if ((!isLiving)&&(type==1)) { switch (game.GameType) { case eGameType.Free: if (((m_info.Para1 == 0) || (m_info.Para1 == -1))&&(Value>0)) Value = Value - 1; break; case eGameType.Guild: if (((m_info.Para1 == 1) || (m_info.Para1 == -1))&&(Value>0)) Value = Value - 1; break; case eGameType.Training: if (((m_info.Para1 == 2) || (m_info.Para1 == -1)) && (Value > 0)) Value = Value - 1; break; case eGameType.ALL: if (((m_info.Para1 == 4) || (m_info.Para1 == -1)) && (Value > 0)) Value = Value - 1; break; case eGameType.Exploration: if (((m_info.Para1 == 5) || (m_info.Para1 == -1)) && (Value > 0)) Value = Value - 1; break; case eGameType.Boss: if (((m_info.Para1 == 6) || (m_info.Para1 == -1)) && (Value > 0)) Value = Value - 1; break; case eGameType.Treasure: if (((m_info.Para1 == 7) || (m_info.Para1 == -1)) && (Value > 0)) Value = Value - 1; break; default: break; } if (Value < 0) { Value = 0; } } }
void player_GameOver(AbstractGame game, bool isWin, int gainXp) { if (isWin == true) { switch (game.GameType) { case eGameType.Free: if (((m_info.Para1 == 0) || (m_info.Para1 == -1)) && (Value > 0)) Value = Value - 1; break; case eGameType.Guild: if (((m_info.Para1 == 1) || (m_info.Para1 == -1)) && (Value > 0)) Value = Value - 1; break; //case eGameType.Training: // if (((m_info.Para1 == 2) || (m_info.Para1 == -1)) && (Value > 0)) // Value = Value - 1; // break; case eGameType.ALL: if (((m_info.Para1 == 4) || (m_info.Para1 == -1)) && (Value > 0)) Value = Value - 1; break; //case eGameType.Exploration: // if (((m_info.Para1 == 5) || (m_info.Para1 == -1)) && (Value > 0)) // Value = Value - 1; // break; //case eGameType.Boss: // if (((m_info.Para1 == 6) || (m_info.Para1 == -1)) && (Value > 0)) // Value = Value - 1; // break; case eGameType.Dungeon: if (((m_info.Para1 == 7) || (m_info.Para1 == -1)) && (Value > 0)) Value = Value - 1; break; default: break; } if (Value < 0) { Value = 0; } } }
void player_AfterKillingLiving(AbstractGame game, int type, int id, bool isLiving, int demage) { if (isLiving == false) { } //Console.WriteLine("是否活" + isLiving.ToString() + ":房间类型" + game.RoomType.ToString()); if ((!isLiving)&&(type==1)) { switch (game.RoomType) { case eRoomType.Match: if (((m_info.Para1 == 0) || (m_info.Para1 == -1))&&(Value>0)) Value = Value - 1; break; case eRoomType.Freedom: if (((m_info.Para1 == 1) || (m_info.Para1 == -1))&&(Value>0)) Value = Value - 1; break; case eRoomType.Exploration: if (((m_info.Para1 == 2) || (m_info.Para1 == -1)) && (Value > 0)) Value = Value - 1; break; case eRoomType.Boss: if (((m_info.Para1 == 3) || (m_info.Para1 == -1)) && (Value > 0)) Value = Value - 1; break; case eRoomType.Treasure: if (((m_info.Para1 == 4) || (m_info.Para1 == -1)) && (Value > 0)) Value = Value - 1; break; default: break; } if (Value < 0) { Value = 0; } } }
public void SendPlayerOnMissionOver(int playerId, AbstractGame game, bool isWin, int MissionID, int turnNum) { GSPacketIn pkg = new GSPacketIn((byte)eFightPackageType.PLAYER_ONMISSION_OVER, playerId); // pkg.WriteInt(game.Id); pkg.WriteBoolean(isWin); pkg.WriteInt(MissionID); pkg.WriteInt(turnNum); SendTCP(pkg); }
public void SendPlayerOnKillingLiving(int playerId, AbstractGame game, int type, int id, bool isLiving, int demage) { GSPacketIn pkg = new GSPacketIn((byte)eFightPackageType.PLAYER_ONKILLING_LIVING, playerId); // pkg.WriteInt(game.Id); pkg.WriteInt(type); pkg.WriteBoolean(isLiving); pkg.WriteInt(demage); SendTCP(pkg); }
public void SendStartGame(int roomId, AbstractGame game) { GSPacketIn pkg = new GSPacketIn((byte)eFightPackageType.ROOM_START_GAME); pkg.Parameter1 = roomId; pkg.Parameter2 = game.Id; pkg.WriteInt((int)game.RoomType); pkg.WriteInt((int)game.GameType); pkg.WriteInt(game.TimeType); SendTCP(pkg); }
/// <summary> ///【7、完成副本(无论胜败)/副本ID/次数】【8、通关副本(要求胜利)/副本ID/次数】<服务器触发> /// </summary> /// <param name="game"></param> public void OnMissionOver(AbstractGame game, bool isWin, int missionId, int turnNum) { if (MissionOver != null) { MissionOver(game, missionId, isWin); } if (MissionTurnOver != null && isWin) { MissionTurnOver(game, missionId, turnNum); } }
void game_GameStopped(AbstractGame game) { m_game.GameStopped -= game_GameStopped; IsPlaying = false; m_client.SendStopGame(m_orientRoomId, m_game.Id); }
public void OnKillingLiving(AbstractGame game, int type, int id, bool isLiving, int demage) { Console.WriteLine("游戏结束:玩家编号【{0}】 目标类型【{1}】 目标编号【{2}】 是否活着【{3}】 伤害【{4}】", m_character.ID, type, id, isLiving, demage); m_client.SendPlayerOnKillingLiving(m_character.ID, game, type, id, isLiving, demage); }
private void m_game_GameStopped(AbstractGame game) { if (game != null) { m_game.GameStopped -= m_game_GameStopped; m_game = null; IsPlaying = false; RoomMgr.WaitingRoom.SendUpdateRoom(this); } }
public void Stop() { if (m_isUsing) { m_isUsing = false; if (m_game != null) { m_game.GameStopped -= m_game_GameStopped; m_game = null; IsPlaying = false; } RoomMgr.WaitingRoom.SendUpdateRoom(this); } }
public void StartGame(AbstractGame game) { if (m_game != null) { List<GamePlayer> list = GetPlayers(); foreach (GamePlayer player in list) { m_game.RemovePlayer(player, false); } m_game_GameStopped(m_game); //log.Error("Old game didn't remove?"); } m_game = game; IsPlaying = true; m_game.GameStopped += new GameEventHandle(m_game_GameStopped); }
public bool UsePropItem(AbstractGame game, int bag, int place, int templateId, bool isLiving) { m_client.SendPlayerUsePropInGame(PlayerCharacter.ID, bag, place, templateId, isLiving); //等待服务器处理 game.Pause(500); return false; }
public void OnGameOver(AbstractGame game, bool isWin, int gainXp) { Console.WriteLine("游戏结束:玩家编号【{0}】 房间编号【{1}】 是否胜利【{2}】 伤害【{3}】", PlayerCharacter.ID, game.Id, isWin, gainXp); m_client.SendPlayerOnGameOver(PlayerCharacter.ID, game.Id, isWin, gainXp); }
public bool UsePropItem(AbstractGame game, int bag, int place, int templateId, bool isLiving) { //背包中的道具 if (bag == (int)eBageType.PropBag) { ItemTemplateInfo template = PropItemMgr.FindFightingProp(templateId); if (isLiving && template != null) { OnUsingItem(template.TemplateID); if (place == -1 && CanUseProp) { return true; } else { ItemInfo item = GetItemAt(eBageType.PropBag, place); if (item != null && item.IsValidItem() && item.Count >= 0) { item.Count--; UpdateItem(item); return true; } } } } //道具栏的道具 else { ItemInfo item = GetItemAt(eBageType.FightBag, place); if (item.TemplateID == templateId) { OnUsingItem(item.TemplateID); return RemoveAt(eBageType.FightBag, place); } } return false; }
public void OnMissionOver(AbstractGame game, bool isWin, int MissionID, int turnNum) { m_client.SendPlayerOnMissionOver(m_character.ID, game, isWin, MissionID, turnNum); }
/// <summary> ///【5、完成一场战斗】【 6、战斗胜利/房间模式/数量】【23、完成战斗(无论胜败)/游戏模式/数量】<服务器触发> /// </summary> /// <param name="game">房间</param> /// <param name="isWin">是否胜利</param> /// <param name="gainXp">获利</param> public void OnGameOver(AbstractGame game, bool isWin, int gainXp) { if (game.RoomType == eRoomType.Match) { //PlayerInfo playerCharacter = PlayerCharacter; //playerCharacter.CheckCount++; //Out.SendCheckCode(); if (isWin) { m_character.Win++; } //UpdateProperties(); m_character.Total++; } if (GameOver != null) { GameOver(game, isWin, gainXp); } }
/// <summary> ///【5、完成一场战斗】【 6、战斗胜利/房间模式/数量】【23、完成战斗(无论胜败)/游戏模式/数量】<服务器触发> /// </summary> /// <param name="game">房间</param> /// <param name="isWin">是否胜利</param> /// <param name="gainXp">获利</param> public void OnGameOver(AbstractGame game, bool isWin, int gainXp) { if (game.RoomType == eRoomType.Match) { if (isWin) { m_character.Win++; } m_character.Total++; } if (GameOver != null) { GameOver(game, isWin, gainXp); } }
/// <summary> /// 【4、击杀玩家若干人次/房间模式/数量】【13、游戏中杀死玩家或者怪物】【22、击杀玩家若干人次/游戏模式/数量】<服务器触发> /// </summary> /// <param name="game">游戏类型</param> /// <param name="type">1表示玩家、2表示NPC</param> /// <param name="id">目标ID</param> /// <param name="isLiving">是否活着</param> /// <param name="damage">伤害</param> public void OnKillingLiving(AbstractGame game, int type, int id, bool isLiving, int damage) { if (AfterKillingLiving != null) AfterKillingLiving(game, type, id, isLiving, damage); if ((GameKillDrop != null) && (isLiving == false)) GameKillDrop(game, type, id, isLiving); }