Fix cannon super charge speed (#883)

* Fix cannon

* Update SGCannon.cpp
This commit is contained in:
David Markowitz 2022-12-16 13:23:09 -08:00 committed by GitHub
parent a2ca273370
commit cd78a3dec7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -722,7 +722,7 @@ void SGCannon::ToggleSuperCharge(Entity* self, bool enable) {
Game::logger->Log("SGCannon", "Player has %d equipped items", equippedItems.size()); Game::logger->Log("SGCannon", "Player has %d equipped items", equippedItems.size());
auto skillID = constants.cannonSkill; auto skillID = constants.cannonSkill;
auto coolDown = constants.cannonRefireRate; auto cooldown = constants.cannonRefireRate;
auto* selfInventoryComponent = self->GetComponent<InventoryComponent>(); auto* selfInventoryComponent = self->GetComponent<InventoryComponent>();
@ -738,7 +738,7 @@ void SGCannon::ToggleSuperCharge(Entity* self, bool enable) {
// TODO: Equip items // TODO: Equip items
skillID = constants.cannonSuperChargeSkill; skillID = constants.cannonSuperChargeSkill;
coolDown = 400; cooldown = 400;
} else { } else {
selfInventoryComponent->UpdateSlot("greeble_r", { ObjectIDManager::GenerateRandomObjectID(), 0, 0, 0 }); selfInventoryComponent->UpdateSlot("greeble_r", { ObjectIDManager::GenerateRandomObjectID(), 0, 0, 0 });
selfInventoryComponent->UpdateSlot("greeble_l", { ObjectIDManager::GenerateRandomObjectID(), 0, 0, 0 }); selfInventoryComponent->UpdateSlot("greeble_l", { ObjectIDManager::GenerateRandomObjectID(), 0, 0, 0 });
@ -761,7 +761,7 @@ void SGCannon::ToggleSuperCharge(Entity* self, bool enable) {
} }
} }
} }
cooldown = 800;
self->SetVar<uint32_t>(NumberOfChargesVariable, 0); self->SetVar<uint32_t>(NumberOfChargesVariable, 0);
} }
@ -777,7 +777,7 @@ void SGCannon::ToggleSuperCharge(Entity* self, bool enable) {
properties.cannonFOV = 58.6f; properties.cannonFOV = 58.6f;
properties.cannonVelocity = 129.0; properties.cannonVelocity = 129.0;
properties.cannonRefireRate = 800; properties.cannonRefireRate = cooldown;
properties.cannonMinDistance = 30; properties.cannonMinDistance = 30;
properties.cannonTimeout = -1; properties.cannonTimeout = -1;