Yao-class-cpp-studio / battle_game

MIT License
9 stars 87 forks source link

[Utility] and [New Bullet] weight system and better simulation of knockback #476

Closed cylic14790382 closed 1 year ago

cylic14790382 commented 1 year ago

In this pull request, I might finish issue #421 and issue #239 .

首先,原有的队列正如 PR #435 中提到的那样, 对于位置的更新存在一点问题。 于是,在他的启发下更改了更新的逻辑: 所有的类似于PushEventMoveUnit的函数都在队列中只更改Unit::position_change_ 最后所有的更改收集在EndTick函数中一并更新。(和本PR相关的仅仅是位移方向,所以伤害方向并没有更改)。 其次,实现了一个简单的Effect效果:通过增加一个队列AwaitingQueue来实现。 同时,位移雪球以前实现的其实类似于瞬移,通过上述实现将其真正模拟成位移:相当于一段时长的位移buff。 见下

https://user-images.githubusercontent.com/113445014/212667121-b918cce7-d803-4593-8412-17f8fe21eaf3.mp4

https://user-images.githubusercontent.com/113445014/212667659-9d213804-ffd5-42ee-8bab-a31230e81931.mp4

cylic14790382 commented 1 year ago

关于重力系统的更新,仅仅添加一个Unit类中的参数weight,通过调用可以得到推离应该有的距离, 目前附加的buff永远是50个tick,距离是11/(0.1+weight), weight 初始是1。

cylic14790382 commented 1 year ago

关于新的坦克类型,主要实现了技能反重力期间所有非自身单位重力减半,速度加倍,并向四周发射击退子弹(可能有点不平衡[doge])

https://user-images.githubusercontent.com/113445014/212674714-73b4826c-b717-44fe-bc38-8e8a1bbd0a3f.mp4

敌方单位是infernotank,weight是20,子弹是snowball,可以看到开启技能后明显能打动了(但是还是被吊打[doge])