Skip to content
This repository has been archived by the owner on Jul 27, 2018. It is now read-only.

Commit

Permalink
fix bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
Cyl18 committed Feb 18, 2018
1 parent c2a773c commit 24a47f7
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
6 changes: 4 additions & 2 deletions CardSharp/GameComponents/Desk.cs
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,9 @@ private void SendCards()
cards = cards.Skip(17 * 1);
}

_currentParser = new LandlordDiscuss(cards, this);
var landlordDiscuss = new LandlordDiscuss(cards, this);
_currentParser = landlordDiscuss;
landlordDiscuss.Prepare(this);
}

public void SetLandlord(Player player)
Expand All @@ -223,7 +225,7 @@ public void BoardcastCards()
AddMessageLine($"{CurrentPlayer.ToAtCodeWithRole()}请出牌");
}
else
AddMessage($"{CurrentRule.ToString()}-{LastCards.ToFormatString()} {CurrentPlayer.ToAtCode()}请出牌");
AddMessage($"{CurrentRule.ToString()}-{LastCards.ToFormatString()} {CurrentPlayer.ToAtCodeWithRole()}请出牌");
}

public void FinishGame(Player player)
Expand Down
15 changes: 11 additions & 4 deletions CardSharp/GameSteps/LandlordDiscuss.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,12 @@ public LandlordDiscuss(IEnumerable<Card> landlordCards, Desk desk)
_landlordCards = landlordCards;
var player = desk.GetPlayerFromIndex(CurrentIndex);
desk.AddMessage($"开始游戏, {player.ToAtCode()}你要抢地主吗?[抢地主/不抢]");
if (player is FakePlayer) {
Parse(desk, player, "不抢");
}

public void Prepare(Desk desk)
{
if (desk.CurrentPlayer is FakePlayer) {
Parse(desk, desk.CurrentPlayer, "不抢");
}
}

Expand Down Expand Up @@ -86,6 +90,7 @@ public void Parse(Desk desk, Player player, string command)
}

switch (command) {
case "y":
case "抢":
case "抢地主":
case "抢他妈的":
Expand All @@ -97,18 +102,20 @@ public void Parse(Desk desk, Player player, string command)
desk.SetLandlord(player);
desk.SendCardsMessage();
break;
case "n":
case "不":
case "不抢":
case "抢你妈":
case "抢个鸡毛掸子": // 应LG的要求。你开心就好
case "抢你妈的飞旋回踢张大麻子苟枫凌他当妈rbq":
MoveNext();
desk.AddMessage(
$"{player.ToAtCode()}不抢地主, {desk.CurrentPlayer.ToAtCode()}你要抢地主嘛?");
$"{player.ToAtCode()}不抢地主, {desk.CurrentPlayer.ToAtCode()}你要抢地主嘛? ");
_count++;
break;
}
if (desk.CurrentPlayer is FakePlayer) {
Parse(desk, player, "不抢");
Parse(desk, desk.CurrentPlayer, "不抢");
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion CardSharp/GameSteps/StandardParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ 带有[R]的命令 是正式功能,'一般'不会做更改
[B]|安静出牌启用|:所有信息都会私聊发送
[B]|安静出牌禁用|:所有信息不都会私聊发送
插件为重置版,先前积分都被清除了,在此当妈对大家致以歉意。插件不稳定有可能在游戏中崩溃,如果崩溃请大家多多包涵,游戏愉快。
如果崩溃请大家多多包涵,游戏愉快。
");
break;
case "安静出牌启用":
Expand Down

0 comments on commit 24a47f7

Please sign in to comment.