设计和实现回合制战斗系统Combat

上传者: 24982627 | 上传时间: 2022-07-06 21:05:38 | 文件大小: 217KB | 文件类型: ZIP
C++课程设计需要的哥们可以自提,包含主函数,可以正常一键运行。 3)Soldier被创建后,maxHP和HP为100,maxSP和SP为100,damage为20,exp为0, level为1,drugNum为5; 4)每回合Soldier通过决策(makeDecision)来决定需要发出哪一个动作(攻击attack、休息rest或吃药takingDrug,注意每回合只能做其中一个动作)。请自行设计和调整每种动作发出的必要条件,例如:生命值若低于最大值的30%该回合就吃药,体力低于最大值的50%该回合就休息,生命力和体力都充足该回合就发起攻击,等等; 5)攻击(attack)敌人一次,体力(SP)减少10,经验(exp)增加5。敌人的生命值(HP)减去攻击方攻击力值(damage)的大小。敌人生命值(HP)减少到0时死去,如果敌人被自己打死,获得敌人身上的所有药瓶;WarSystem类可以发出战斗开始即startWar()动作。在startWar()中,随机决定由哪一方率先发起攻击(恐怕是每个回合都随机决定谁先出手会比较公平,如果每回合先出手都是固定一方,那么战斗结果完全是确定性的。

文件下载

资源详情

[{"title":"( 53 个子文件 217KB ) 设计和实现回合制战斗系统Combat","children":[{"title":"Combat","children":[{"title":"cmake-build-debug","children":[{"title":"build.ninja <span style='color:#111;'> 10.35KB </span>","children":null,"spread":false},{"title":"CMakeCache.txt <span style='color:#111;'> 16.47KB </span>","children":null,"spread":false},{"title":".cmake","children":[{"title":"api","children":[{"title":"v1","children":[{"title":"reply","children":[{"title":"target-test1-Debug-5747d803ccc4e5c48b93.json <span style='color:#111;'> 2.18KB </span>","children":null,"spread":false},{"title":"toolchains-v1-4fa4a7d4b058941239f7.json <span style='color:#111;'> 3.71KB </span>","children":null,"spread":false},{"title":"cache-v2-0a8e5598c30aba6f3bd3.json <span style='color:#111;'> 25.60KB </span>","children":null,"spread":false},{"title":"directory-.-Debug-d0094a50bb2071803777.json <span style='color:#111;'> 168B </span>","children":null,"spread":false},{"title":"codemodel-v2-f25299b8b4891565ded4.json <span style='color:#111;'> 996B </span>","children":null,"spread":false},{"title":"cmakeFiles-v1-83703b1a5a765b359071.json <span style='color:#111;'> 5.17KB </span>","children":null,"spread":false},{"title":"index-2022-06-30T02-04-17-0833.json <span style='color:#111;'> 1.97KB </span>","children":null,"spread":false}],"spread":true},{"title":"query","children":[{"title":"toolchains-v1 <span style='color:#111;'> 0B </span>","children":null,"spread":false},{"title":"cache-v2 <span style='color:#111;'> 0B </span>","children":null,"spread":false},{"title":"codemodel-v2 <span style='color:#111;'> 0B </span>","children":null,"spread":false},{"title":"cmakeFiles-v1 <span style='color:#111;'> 0B </span>","children":null,"spread":false}],"spread":true}],"spread":true}],"spread":true}],"spread":true},{"title":".ninja_log <span style='color:#111;'> 758B </span>","children":null,"spread":false},{"title":".ninja_deps <span style='color:#111;'> 42.87KB </span>","children":null,"spread":false},{"title":"cmake_install.cmake <span style='color:#111;'> 1.60KB </span>","children":null,"spread":false},{"title":"test1.exe <span style='color:#111;'> 207.21KB </span>","children":null,"spread":false},{"title":"Testing","children":[{"title":"Temporary","children":[{"title":"LastTest.log <span style='color:#111;'> 154B </span>","children":null,"spread":false}],"spread":true}],"spread":true},{"title":"CMakeFiles","children":[{"title":"cmake.check_cache <span style='color:#111;'> 86B </span>","children":null,"spread":false},{"title":"rules.ninja <span style='color:#111;'> 2.29KB </span>","children":null,"spread":false},{"title":"3.22.3","children":[{"title":"CMakeDetermineCompilerABI_C.bin <span style='color:#111;'> 43.82KB </span>","children":null,"spread":false},{"title":"CMakeSystem.cmake <span style='color:#111;'> 395B </span>","children":null,"spread":false},{"title":"CompilerIdCXX","children":[{"title":"a.exe <span style='color:#111;'> 43.92KB </span>","children":null,"spread":false},{"title":"tmp","children":null,"spread":false},{"title":"CMakeCXXCompilerId.cpp <span style='color:#111;'> 24.70KB </span>","children":null,"spread":false}],"spread":false},{"title":"CMakeCCompiler.cmake <span style='color:#111;'> 3.24KB </span>","children":null,"spread":false},{"title":"CMakeCXXCompiler.cmake <span style='color:#111;'> 6.42KB </span>","children":null,"spread":false},{"title":"CMakeRCCompiler.cmake <span style='color:#111;'> 277B </span>","children":null,"spread":false},{"title":"CompilerIdC","children":[{"title":"a.exe <span style='color:#111;'> 43.90KB </span>","children":null,"spread":false},{"title":"CMakeCCompilerId.c <span style='color:#111;'> 24.96KB </span>","children":null,"spread":false},{"title":"tmp","children":null,"spread":false}],"spread":false},{"title":"CMakeDetermineCompilerABI_CXX.bin <span style='color:#111;'> 43.84KB </span>","children":null,"spread":false}],"spread":true},{"title":"test1.dir","children":[{"title":"Wizard.cpp.obj <span style='color:#111;'> 57.07KB </span>","children":null,"spread":false},{"title":"soilder.cpp.obj <span style='color:#111;'> 63.71KB </span>","children":null,"spread":false},{"title":"main.cpp.obj <span style='color:#111;'> 59.65KB </span>","children":null,"spread":false}],"spread":false},{"title":"clion-log.txt <span style='color:#111;'> 412B </span>","children":null,"spread":false},{"title":"TargetDirectories.txt <span style='color:#111;'> 232B </span>","children":null,"spread":false},{"title":"CMakeOutput.log <span style='color:#111;'> 58.08KB </span>","children":null,"spread":false},{"title":"clion-environment.txt <span style='color:#111;'> 182B </span>","children":null,"spread":false},{"title":"CMakeTmp","children":null,"spread":false}],"spread":true}],"spread":true},{"title":"Wizard.cpp <span style='color:#111;'> 2.21KB </span>","children":null,"spread":false},{"title":"soilder.cpp <span style='color:#111;'> 3.23KB </span>","children":null,"spread":false},{"title":".idea","children":[{"title":"misc.xml <span style='color:#111;'> 140B </span>","children":null,"spread":false},{"title":"test1.iml <span style='color:#111;'> 98B </span>","children":null,"spread":false},{"title":"modules.xml <span style='color:#111;'> 269B </span>","children":null,"spread":false},{"title":"encodings.xml <span style='color:#111;'> 541B </span>","children":null,"spread":false},{"title":"workspace.xml <span style='color:#111;'> 4.23KB </span>","children":null,"spread":false},{"title":".gitignore <span style='color:#111;'> 184B </span>","children":null,"spread":false}],"spread":true},{"title":"Warsystem.cpp <span style='color:#111;'> 1.07KB </span>","children":null,"spread":false},{"title":"main.cpp <span style='color:#111;'> 480B </span>","children":null,"spread":false},{"title":"Master.cpp <span style='color:#111;'> 2.34KB </span>","children":null,"spread":false},{"title":"CMakeLists.txt <span style='color:#111;'> 466B </span>","children":null,"spread":false},{"title":"source","children":[{"title":"soilder.h <span style='color:#111;'> 786B </span>","children":null,"spread":false},{"title":"Warsystem.h <span style='color:#111;'> 476B </span>","children":null,"spread":false},{"title":"Master.h <span style='color:#111;'> 404B </span>","children":null,"spread":false},{"title":"Wizard.h <span style='color:#111;'> 449B </span>","children":null,"spread":false}],"spread":true}],"spread":true}],"spread":true}]

评论信息

免责申明

【只为小站】的资源来自网友分享,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,【只为小站】 无法对用户传输的作品、信息、内容的权属或合法性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论 【只为小站】 经营者是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。
本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二条之规定,若资源存在侵权或相关问题请联系本站客服人员,zhiweidada#qq.com,请把#换成@,本站将给予最大的支持与配合,做到及时反馈和处理。关于更多版权及免责申明参见 版权及免责申明