17 Star 367 Fork 77

ibc-dabing / Landlords

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
LGPL-3.0

landlord-bk

1. 游戏部署

1.1 开发环境

  1. 平台:Windows,Qt是跨平台的其他平台应该也是没问题的。
  2. IDE:QtCreator
  3. Qt版本要求:5.10 及以上版本
    • 开发该项目使用的Qt版本:5.15.2,其他版本可能会出现二进制资源文件(xxx.rcc)无法加载的问题。
    • 不要使用 Qt6(使用的多媒体类在Qt6中已经不存在了)
  4. 使用的编译套件:MinGW
    • 使用 MSVC 编译套件应该也可以,但可能会出现乱码(可自测)

1.2 关于资源文件的部署

  1. 使用 QtCreator 打开项目文件 Landlords.pro,编译并生成可执行程序。

  2. 关于资源文件的加载:

    • 使用QtCreator启动程序

      将项目目录中的资源文件resource.rcc拷贝到生成的build目录下即可,build 目录名示例:build-Landlords-Desktop_Qt_5_15_2_MinGW_32_bit-Debug

    • 直接双击.exe可执行文件启动程序

      将项目目录中的资源文件resource.rcc拷贝到和.exe文件同级目录即可。

    • 如果使用的编译套件是 MSVC,资源文件直接放到可执行程序.exe对应的目录中。

  3. 游戏效果图

    33333

2. 游戏规则

不同地域游戏规则可能有些许差异,游戏按照如下规则进行实现。

2.1 牌型

牌型 描述
王炸 大王+小王,最大的牌
炸弹 四张同数值牌(如四个 9)
单牌 单张的牌(如红桃 3 )
对牌 数值相同的两张牌(如梅花 4+ 方块 4 )
三张牌 数值相同的三张牌(如三个 Q )
三带一 数值相同的三张牌 + 1张单牌,例如: 333+6
三带二 数值相同的三张牌 + 1对牌,例如: 666+33
顺子 五张或更多的连续单牌,不包括 2 和双王
连对 三对或更多的连续对牌,不包括 2 和双王
飞机 二个或更多的连续三张牌,不包括 2 和双王
飞机带翅膀 飞机+同数量的单牌(或同数量的对牌)
四带二 四张点数相同的牌 + 两手牌 (两单或两双)
王炸带二 王炸 + 两手牌 (两单或两双)

2.2 牌型的大小

  • 王炸最大,可以压任意其他的牌型。

  • 炸弹比王炸小,比其它牌型大。都是炸弹时按牌的点数比大小。

  • 除火箭和炸弹外,其它牌必须要牌型相同且总数量相同才能比大小。

  • 单牌按点数比大小(不分花色),依次是:

    大王 > 小王 > 2 > A > K > Q > J > 10 > 9 > 8 > 7 > 6 > 5 > 4 > 3

  • 对牌,三张点数相同的牌都按点数比大小。

  • 顺子按最大的一张牌的点数来比大小。

  • 飞机带翅膀和四带二按其中的三顺和四张部分来比,带的副牌不参与牌型大小的比较。

2.3 游戏角色

参与游戏的玩家一共需要三个人,这三个人有两种角色,分别是:

  • 地主:1人,三人下注抢地主,分数最高者可称为地主,地主自己一伙。
  • 农民:2人,没有抢到地主的玩家为农民,此二人一伙。

2.4 游戏规则

  1. 发牌

    一副牌 54 张,一人 17 张,留 3 张做底牌,在确定地主之前玩家不能看到底牌。

  2. 叫地主 / 抢地主

    • 叫地主按出牌的顺序轮流进行,每人只能叫一次。
    • 叫地主时可以叫 “1 分 ” , “2 分 ” , “3 分 ” , “ 不叫 ” 。
    • 后抢地主者只能叫比前面玩家高的分或者不叫。
    • 抢地主结束后下注分值最大的玩家为地主;如果有玩家叫 “3 分 ” 则立即结束叫地主,该玩家为地主;如果都不叫,则重新发牌,重新叫地主。
  3. 第一轮叫地主的玩家

    • 由于是单机版斗地主,直接指定了用户玩家为第一个叫地主的玩家
    • 也可以由系统随机选定
  4. 出牌

    • 将三张底牌交给地主,并亮出底牌让所有人都能看到。
    • 地主首先出牌,然后按逆时针顺序依次出牌,轮到用户跟牌时,用户可以选择 “ 不出 ” 或出比上一个玩家大的牌。
    • 某一玩家出完牌时结束本局。

2.5 游戏的胜负

任意一家出完牌后结束游戏,先出完牌的玩家代表的角色获胜:

  • 地主先出完牌地主获胜
  • 任意一个农民先出完牌则农民获胜

2.6 游戏计分规则

  • 底分:叫地主时的下注分数,可下注分数分别为:1分、2分、3分。
  • 倍数:初始为 1 ,每出一个炸弹或王炸翻一倍(留在手上没出的不算)。

当一局游戏结束后,基于低分和倍数计算个玩家得分:

  • 地主胜:
    • 地主:2 * 底分 * 倍数
    • 农民:- 底分 * 倍数
  • 农民胜:
    • 地主:-2 * 底分 * 倍数
    • 农民:底分 * 倍数

在实现的游戏代码中,没有处理春天的情况(一个玩家牌已出完,另外两个玩家的牌一张未出),如若需要,可自行添加。

3. 其他

欢迎关注作者:

个人博客:https://subingwen.cn

B站个人主页:https://space.bilibili.com/147020887

微信公众号:ibc_dabing

GNU LESSER GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. This version of the GNU Lesser General Public License incorporates the terms and conditions of version 3 of the GNU General Public License, supplemented by the additional permissions listed below. 0. Additional Definitions. As used herein, "this License" refers to version 3 of the GNU Lesser General Public License, and the "GNU GPL" refers to version 3 of the GNU General Public License. "The Library" refers to a covered work governed by this License, other than an Application or a Combined Work as defined below. An "Application" is any work that makes use of an interface provided by the Library, but which is not otherwise based on the Library. Defining a subclass of a class defined by the Library is deemed a mode of using an interface provided by the Library. A "Combined Work" is a work produced by combining or linking an Application with the Library. The particular version of the Library with which the Combined Work was made is also called the "Linked Version". The "Minimal Corresponding Source" for a Combined Work means the Corresponding Source for the Combined Work, excluding any source code for portions of the Combined Work that, considered in isolation, are based on the Application, and not on the Linked Version. The "Corresponding Application Code" for a Combined Work means the object code and/or source code for the Application, including any data and utility programs needed for reproducing the Combined Work from the Application, but excluding the System Libraries of the Combined Work. 1. Exception to Section 3 of the GNU GPL. You may convey a covered work under sections 3 and 4 of this License without being bound by section 3 of the GNU GPL. 2. Conveying Modified Versions. If you modify a copy of the Library, and, in your modifications, a facility refers to a function or data to be supplied by an Application that uses the facility (other than as an argument passed when the facility is invoked), then you may convey a copy of the modified version: a) under this License, provided that you make a good faith effort to ensure that, in the event an Application does not supply the function or data, the facility still operates, and performs whatever part of its purpose remains meaningful, or b) under the GNU GPL, with none of the additional permissions of this License applicable to that copy. 3. Object Code Incorporating Material from Library Header Files. The object code form of an Application may incorporate material from a header file that is part of the Library. You may convey such object code under terms of your choice, provided that, if the incorporated material is not limited to numerical parameters, data structure layouts and accessors, or small macros, inline functions and templates (ten or fewer lines in length), you do both of the following: a) Give prominent notice with each copy of the object code that the Library is used in it and that the Library and its use are covered by this License. b) Accompany the object code with a copy of the GNU GPL and this license document. 4. Combined Works. You may convey a Combined Work under terms of your choice that, taken together, effectively do not restrict modification of the portions of the Library contained in the Combined Work and reverse engineering for debugging such modifications, if you also do each of the following: a) Give prominent notice with each copy of the Combined Work that the Library is used in it and that the Library and its use are covered by this License. b) Accompany the Combined Work with a copy of the GNU GPL and this license document. c) For a Combined Work that displays copyright notices during execution, include the copyright notice for the Library among these notices, as well as a reference directing the user to the copies of the GNU GPL and this license document. d) Do one of the following: 0) Convey the Minimal Corresponding Source under the terms of this License, and the Corresponding Application Code in a form suitable for, and under terms that permit, the user to recombine or relink the Application with a modified version of the Linked Version to produce a modified Combined Work, in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source. 1) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (a) uses at run time a copy of the Library already present on the user's computer system, and (b) will operate properly with a modified version of the Library that is interface-compatible with the Linked Version. e) Provide Installation Information, but only if you would otherwise be required to provide such information under section 6 of the GNU GPL, and only to the extent that such information is necessary to install and execute a modified version of the Combined Work produced by recombining or relinking the Application with a modified version of the Linked Version. (If you use option 4d0, the Installation Information must accompany the Minimal Corresponding Source and Corresponding Application Code. If you use option 4d1, you must provide the Installation Information in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source.) 5. Combined Libraries. You may place library facilities that are a work based on the Library side by side in a single library together with other library facilities that are not Applications and are not covered by this License, and convey such a combined library under terms of your choice, if you do both of the following: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities, conveyed under the terms of this License. b) Give prominent notice with the combined library that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 6. Revised Versions of the GNU Lesser General Public License. The Free Software Foundation may publish revised and/or new versions of the GNU Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library as you received it specifies that a certain numbered version of the GNU Lesser General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that published version or of any later version published by the Free Software Foundation. If the Library as you received it does not specify a version number of the GNU Lesser General Public License, you may choose any version of the GNU Lesser General Public License ever published by the Free Software Foundation. If the Library as you received it specifies that a proxy can decide whether future versions of the GNU Lesser General Public License shall apply, that proxy's public statement of acceptance of any version is permanent authorization for you to choose that version for the Library.

简介

一个基于Qt开发的 *斗*地*主*小游戏。 展开 收起
C++ 等 2 种语言
LGPL-3.0
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
1
https://gitee.com/subingwen/landlords.git
git@gitee.com:subingwen/landlords.git
subingwen
landlords
Landlords
master

搜索帮助

14c37bed 8189591 565d56ea 8189591