From fd1573a77dcf71b42cab488094e12aafa716315a Mon Sep 17 00:00:00 2001 From: Vectozavr <60608292+vectozavr@users.noreply.github.com> Date: Sun, 7 Nov 2021 15:02:16 +0700 Subject: [PATCH] damage from the weapon depends on the place where you will hit the enemy --- ShooterClient.cpp | 3 ++- weapon/Weapon.cpp | 15 +++++++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/ShooterClient.cpp b/ShooterClient.cpp index a444683..32e09c1 100644 --- a/ShooterClient.cpp +++ b/ShooterClient.cpp @@ -150,7 +150,8 @@ void ShooterClient::processCustomPacket(sf::Packet &packet) { camera->rotateLeft(-camera->angleLeftUpLookAt().x()); camera->transform(Matrix4x4::Rotation(-_player->angle())); - Timeline::animate(AnimationListTag("camera_anim"), std::make_shared(camera, Vec3D(-20, 30, -100))); + Timeline::animate(AnimationListTag("camera_anim"), std::make_shared(camera, Vec3D(0, 30, -100))); + Timeline::animate(AnimationListTag("camera_anim"), std::make_shared(0)); Timeline::animate(AnimationListTag("camera_anim"), std::make_shared(camera, Vec3D(0), Vec3D{0, Consts::PI, 0}, 5, Animation::LoopOut::None, Animation::InterpolationType::Linear)); Timeline::animate(AnimationListTag("camera_anim"), std::make_shared(0)); Timeline::animate(AnimationListTag("camera_anim"), std::make_shared([this, camera](){ diff --git a/weapon/Weapon.cpp b/weapon/Weapon.cpp index 7fe52d6..9357bd3 100644 --- a/weapon/Weapon.cpp +++ b/weapon/Weapon.cpp @@ -72,7 +72,7 @@ void Weapon::reload() { Log::log("Weapon::reload (" + std::to_string(_stockAmmo) + " : " + std::to_string(_clipAmmo) + ")"); _lastReloadTime = Time::time(); - if(_reloadCallBack != nullptr) { + if (_reloadCallBack != nullptr) { _reloadCallBack(); } } @@ -99,11 +99,22 @@ Weapon::addTrace(std::function