import numpy as np

# [0象棋开关, 1轮到谁, 2结束游戏的人, 3[红方, 黑方], 4当前棋盘]
CCList = [False, None, None, [None, None], []]
# [0真心话开关, 1{昵称：摇出的数字}, 2[玩游戏中的hash]]
truthList = [False, {}, []]
# [0炸弹数字, 1[在玩的人], 2轮到序号, 3初始最小值, 4初始最大值, 5是否在玩, 6本轮最小值, 7本轮最大值]
bombs = [0, [], 0, 1, 1000, False, 1, 1000]
# [0扑克开关, 1{在玩的人:[拥有的牌]}, 2轮到序号, 3当前牌堆, 4底牌, 5地主, 6是否在叫牌阶段, 7[玩家名称], 8谁拿地主牌, 9{叫牌人:叫几分}, 10本轮第一出牌的序号, 11上家的牌]
pokers = [False, {}, 0, [], [], None, False, [], None, {}, None, None]
# [0uno开关, 1玩家列表, 2玩家的牌, 3牌堆, 4轮到玩家, 5当前的牌]
unos = [False, [], [], [], "", "+4"]
# [0游戏数据data, 1初始牌组group, 2卡牌列表card, 3剧情词组:通用general, 4剧情词组:预言家prophet, 5剧情词组:狼人werewolf, 6剧情词组:女巫witch, 7药水列表potion, 8其他项目other]
werewolf=[{"uwu":False}, [1,2,3,4], {0:{True:"好人",False:"坏人"},1:["平民","夜晚：注意旁白 安静等待\n白天：提出意见 跟随大家投票",True],2:["预言家","夜晚：选择一位得知身份\n白天：领导大家投票",True],3:["狼人","夜晚：选择一位杀死\n白天：隐藏身份 跟随大家投票",False],4:["女巫","夜晚：选择一位使用药水 每种药只能使用一次\n白天：隐藏身份 跟随大家投票",True]}, [["选择","决定","打算","想要"],["断了气","没了动静","停了心跳","一命呜呼"],["深夜","半夜三更","凌晨两点","午夜时分"],["失去理智","愤愤不平","闹腾","愤怒"],["绿色","白色","翻折","皱巴巴","缺了角","整齐叠好"],["收回伸出纸片的手","不知如何抉择","有些迷茫","仔细思考"],["误入","闯入","跳进","来到"],["欺负","诅咒","戏弄","鞭尸"],["飘走了","被偷走了","被捡走了","不翼而飞"],["家里","身上","背后","手中"]], [["犯了心肌梗塞","脑子不太清醒","撞到了头","摔了一跤"],["叹了口气","沉默不语","喃喃自语","摇了摇头"],["瞪大了双眼","惊掉了下巴","陷入沉思","不敢置信"],["熟","甜","香","舒服"],["没有回应","没有行动","家里没人","不在家中"]], [["惨叫","哀嚎","悲鸣","呜咽"],["四分五裂","难以辨认","被撕咬过","不成样"],["呼唤同伴","追赶","奔走","嬉闹"],["迷路","走丢","离群","去找对象"],["或许是想赌一把","真有心机呢","这样好吗","这样可以吗"],["做可以吗","真的好吗","是在协助吗","有没有好处"],["伤心欲绝","重情重义","讲义气","悲伤"],["沉思中","略显憔悴","望向远方","不太坚定"]], [["自动写代码","让鱼变好吃","让人变性","压缩纸片"],["死一般的寂静","看似一派祥和","已经没有人影了","偶有远处的呼喊"],["无声","安静","静悄悄","悄无声息"],["大声","默默","神秘","诡异"],["想要休息","不知所踪","的纸片丢失了","的小屋无人打扫"]], {True:["解药","救活"],False:["毒药","毒死"]}, {"op":"村长","core":"村民","game":"狼人杀"}]

CLOLUMN, LETTERS = ["| \\ |1|2|3|4|5|6|7|8|9|", "|-|-|-|-|-|-|-|-|-|-|"], list("ABCDEFGHIJ")
RED, BLACK = ["==车==", "==马==", "==相==", "==士==", "==帥==", "==兵==", "==炮=="], ["車", "馬", "象", "仕", "將", "卒", "砲"]
CARDS = ['3', '4', '5', '6', '7', '8', '9', 'H', 'J', 'Q', 'K', 'A', '2']
JOKERS = ["小", "大"]
SORT = dict(zip(CARDS+JOKERS, range(15)))
PINIT = CARDS*4 + JOKERS
UNO_SORT = {'红0': 0, '红1': 1, '红2': 2, '红3': 3, '红4': 4, '红5': 5, '红6': 6, '红7': 7, '红8': 8, '红9': 9, '红转向': 10, '红禁': 11, '红+2': 12, '黄0': 13, '黄1': 14, '黄2': 15, '黄3': 16, '黄4': 17, '黄5': 18, '黄6': 19, '黄7': 20, '黄8': 21, '黄9': 22, '黄转向': 23, '黄禁': 24, '黄+2': 25, '蓝0': 26, '蓝1': 27, '蓝2': 28, '蓝3': 29, '蓝4': 30, '蓝5': 31, '蓝6': 32, '蓝7': 33, '蓝8': 34, '蓝9': 35, '蓝转向': 36, '蓝禁': 37, '蓝+2': 38, '绿0': 39, '绿1': 40, '绿2': 41, '绿3': 42, '绿4': 43, '绿5': 44, '绿6': 45, '绿7': 46, '绿8': 47, '绿9': 48, '绿转向': 49, '绿禁': 50, '绿+2': 51, '变色': 52, '+4': 53}

RULE = "\n".join([
    "好、的，听清楚规则了哦~",
    "如你所见，棋盘一共有10行，从上到下依次为ABCDEFGHIJ；又有9列，从左到右依次为123456789。",
    "用这个方法可以表示出棋盘上的任何位置，例如左上角的马，其坐标应为A2。",
    "发送`@nick 旧位置 新位置`移动棋子，例如`@nick C2 C3`可以将左上角的炮向右挪动一格。",
    "明白了吗？开始吧~",
    "温馨提示：使用暗色主题棋盘显示效果更佳~"
])
CCMENU = "\n".join([
    "/w sender 使·用·说·明\\~\n哟，这不是sender吗，很高兴认识你\\~",
    "以下是我能做的事情，如果能帮上你的忙的话我会很高兴的！~~请随意使用我吧~~",
    "`@Bot名 加入游戏`：加入游戏或者创建一个游戏\\~",
    "`@Bot名 结束游戏`：结束游戏，如果你执意要这么做的话……",
    "`@Bot名 帮助`：显示这一段话~~，也就是套娃啦！~~",
    "芜湖，就这么多了，虽然我也知道我很棒不过毕竟人的能力是有限的嘛~但放心，我每天都在努力学习，也许明天，下个小时或者下一分钟，\
    在你不注意的时候，我就有新功能啦，ᕕ( ᐛ )ᕗ\\~"
])
BOMBMENU = "\n".join([
    "/w sender 数字炸弹——",
    "规则很简单，在一个给定的范围中设某个数字为「炸弹」，玩家轮流猜数缩小范围，直到某人猜到炸弹。以下是关于数字炸弹的命令：",
    "`bomber` : 加入数字炸弹游戏！",
    "`bomber t`: 在开始之前退出游戏~",
    "`*bom` : 让机器人加入！",
    "`开始b` : 开始数字炸弹，至少需要两个人。",
    "`结束b` : 结束数字炸弹……",
    "`b 数字` : 猜数。",
    "就是这么多了，祝你好运，ᕕ( ᐛ )ᕗ\\~"
])
POKERMENU = "\n".join([
    "/w sender 斗地主...",
    "poker: 创建或加入一场斗地主，满三人后自动开始。",
    "poker t: 在开始之前退出对局。",
    "p 牌: 出牌，具体规则请查看出牌规则。",
    "@nick 结束p: 在对局中结束游戏。",
    "@nick 扑克规则: 获取扑克的出牌规则。",
])
POKERRULE = "\n".join([
    "/w sender 游戏规则请自行参考[此处](https://baike.baidu.com/item/%E4%B8%89%E4%BA%BA%E6%96%97%E5%9C%B0%E4%B8%BB/9429860)，要注意的是这里用==H==代表==10==，==小==代表小王，==大==代表大王。以下是出牌规则：",
    "使用==p 牌==出牌，例如==p 1==, ==p J==，大小写均可；",
    "使用==p .==跳过回合、==p check==查看自己目前的牌；",
    "多张相同面值的牌间使用==牌*张数==，例如==p 3*2==，==p 4*3==；",
    "顺子使用==最小牌-最大牌==，例如==p 4-8==，==p 6-A==；",
    "双顺或三顺使用==最小-最大*张数==，例如==p 3-5*2==，==p 4-5*3==；",
    "三带二、飞机等带的对子中不使用==*==，例如==p K*3 77==，==p 8-9*3 33 44==",
    "王炸直接发送==p 王炸==即可；",
    "剩余的就将这两种组合，不同组别用空格隔开即可，例如==p 4-5*3 7 9== ==p 7*4 99 HH==……",
    "玩得开心~"
])
UNORULE = "\n".join([
    "简而言之就是出与上家的牌颜色或数字相同的牌。更细节的玩法请自行百度。",
    "程序由@Blaze (geGDVS)提供。"
])
CINIT=np.array([
    [RED[0], RED[1], RED[2], RED[3], RED[4], RED[3],RED[2], RED[1], RED[0]],
    ["&ensp;"]*9,
    ["&ensp;", RED[6], "&ensp;", "&ensp;", "&ensp;", "&ensp;", "&ensp;", RED[6], "&ensp;"],
    [RED[5], "&ensp;", RED[5], "&ensp;", RED[5], "&ensp;", RED[5], "&ensp;", RED[5]],
    ["&ensp;"]*9,

    ["&ensp;"]*9,
    [BLACK[5], "&ensp;", BLACK[5], "&ensp;", BLACK[5], "&ensp;", BLACK[5], "&ensp;", BLACK[5]],
    ["&ensp;", BLACK[6], "&ensp;", "&ensp;", "&ensp;", "&ensp;", "&ensp;", BLACK[6], "&ensp;"],
    ["&ensp;"]*9,
    [BLACK[0], BLACK[1], BLACK[2], BLACK[3], BLACK[4], BLACK[3], BLACK[2], BLACK[1], BLACK[0]],
])
GAMEMENU = "\n".join([
    "真心话现在开始啦，发送*r*来获取随机数，*结算*来结算，*结束游戏*来结束游戏~",
    "以下是注意事项：",
    "1\\.愿赌服输，所谓的**真心话**的意思是什么，参与了就不能后悔了，",
    "2\\.不要把游戏当成拷问，提的问题请在能够接受的范围内，",
    "3\\.尺度请自行把握，不用过于勉强自己也不要勉强他人，感到不适可以要求对方更换问题，",
    "4\\.玩得愉快。",
    "PS: ***实在***没活整了可以发送==@nick 提问==获取些离谱小问题，当然你要是把这当成功能的一部分的话我就\\*优美的中国话\\*",
    "PSS: 获取随机数只能用*r*，而不是*r 数字*，后者在真心话中会被忽略。"
])