# Crystal-Demo **Repository Path**: mengtest/Crystal-Demo ## Basic Information - **Project Name**: Crystal-Demo - **Description**: No description available - **Primary Language**: C# - **License**: MPL-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 1 - **Created**: 2020-08-10 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Crystal-Demo ### 项目说明 练手项目,基于《XCom》和《SlayTheSpire》的回合制卡牌游戏 当前该项目仅仅是完成了核心功能初期DEMO版,仅有1个关卡 ### 实现说明 #### 卡牌系统 实例创建由卡牌模板与卡牌实例两部分组成 先是创建对应的卡牌SO作为卡牌模板,随后再把需要的卡牌SO与数量设置到预设卡组SO/当前卡组SO中 最后在游戏启动时再根据卡组SO中的卡牌来实例出对应的卡牌实例 效果处理是使用了类似多叉树的嵌套结构来进行层层处理 #### 移动逻辑 4向网格移动,寻路以A*为主,用双方目标的距离,邻近掩体,移动距离与射程四者作为判定分数 场景用TilePalette绘制,实际移动的场地Tile由开发时设置的范围进行生成,通过layer来控制可以移动的Tile #### 玩家逻辑 在网格上进行移动,通过使用手里的卡牌进行攻击或者使用增益效果 使用过的卡牌进入回收区,等待抽区的卡牌抽完则回收所有使用过的卡牌并重新抽取卡牌 每回合未使用的卡牌会自动进入回收区 #### 敌人逻辑 以自定义行为树为主,但被攻击等交互逻辑还是放到行为树之外进行处理 #### 场景入口 Assets/Scenes 的 0_Title 或 1_Main ### 演示截图 ![选关界面](https://images.gitee.com/uploads/images/2019/1211/173914_466724af_876858.png "QQ截图20191210172800.png") ![查看卡组](https://images.gitee.com/uploads/images/2019/1211/173930_29a76d20_876858.png "QQ截图20191210172746.png") ![战斗场景](https://images.gitee.com/uploads/images/2019/1211/173956_ef743590_876858.png "QQ截图20191210173708.png") ![战斗结束](https://images.gitee.com/uploads/images/2019/1211/174022_dff8d223_876858.png "QQ截图20191210173939.png") ![卡牌选择](https://images.gitee.com/uploads/images/2019/1211/174009_a82786c8_876858.png "QQ截图20191210173949.png") ### 依赖插件 - [Behaviour Designer](https://assetstore.unity.com/packages/tools/visual-scripting/behavior-designer-behavior-trees-for-everyone-15277) 行为树 - [Serialized Dictionary Lite](https://assetstore.unity.com/packages/tools/utilities/serialized-dictionary-lite-110992) 字典 - [DOTween](https://assetstore.unity.com/packages/tools/animation/dotween-hotween-v2-27676) 路径动画 - PP后处理 - Cinemachine ### 用到的美术资源 - [lpc-terrain-repack](https://opengameart.org/content/lpc-terrain-repack) - [Animated Pixel Adventurer](https://rvros.itch.io/animated-pixel-hero) - [Skeleton Sprite Pack](https://jesse-m.itch.io/skeleton-pack) - [gothicvania](https://ansimuz.itch.io/gothicvania-patreon-collection)