This commit is contained in:
MarcEricMartel
2023-12-18 11:10:10 -05:00
parent 2c346139d5
commit 9a669acd9c
5 changed files with 140 additions and 45 deletions

View File

@@ -12,7 +12,9 @@ Bullet::~Bullet() {}
bool Bullet::Update(World* world, float elapsedtime, int perframe, std::unordered_map<uint64_t, Player*> mapPlayer, netprot::ChunkMod** chunkmod) {
int max = 100 / perframe;
float damage = 0.098f;
Player* shooter = mapPlayer.at(m_shooter_id);
float damage = shooter->boostdamage? 0.123f: 0.098f;
for (int x = 0; x < max; ++x) {
m_currentpos += m_velocity * elapsedtime;
@@ -29,7 +31,7 @@ bool Bullet::Update(World* world, float elapsedtime, int perframe, std::unordere
hit = true;
}
if (hit && !player->AmIDead()) {
if (m_canhurt)
if (m_canhurt && !player->boostinvincible)
player->InflictDamage(damage);
player->m_hit = true;