From 17e285e4a7eb80ee6090f090075f7aa8d243fe01 Mon Sep 17 00:00:00 2001 From: yvt Date: Sun, 15 Sep 2013 01:01:07 +0900 Subject: [PATCH 1/2] Tuned hurt effect --- Sources/Client/Client.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Sources/Client/Client.cpp b/Sources/Client/Client.cpp index a6047b40..6438699b 100644 --- a/Sources/Client/Client.cpp +++ b/Sources/Client/Client.cpp @@ -700,12 +700,13 @@ namespace spades { break; } - hurtSprites.resize(12); float hpper = player->GetHealth() / 100.f; + int cnt = 18 - (int)(player->GetHealth() / 100.f * 8.f); + hurtSprites.resize(std::max(cnt, 6)); for(size_t i = 0; i < hurtSprites.size(); i++) { HurtSprite& spr = hurtSprites[i]; spr.angle = GetRandom() * (2.f * M_PI); - spr.scale = .2f + GetRandom() * .6f; + spr.scale = .2f + GetRandom() * GetRandom() * .7f; spr.horzShift = GetRandom(); spr.strength = .3f + GetRandom() * .7f; if(hpper > .5f) { @@ -997,7 +998,7 @@ namespace spades { } } - if(name == "h" && down && false) { + if(name == "h" && down) { // debug int h = p->GetHealth(); h -= 10; if(h <= 0) h = 100; @@ -2945,7 +2946,7 @@ namespace spades { } void Client::DrawHurtSprites() { - float per = (world->GetTime() - lastHurtTime) / .6f; + float per = (world->GetTime() - lastHurtTime) / 1.5f; if(per > 1.f) return; if(per < 0.f) return; Handle img = renderer->RegisterImage("Gfx/HurtSprite.png"); From 5164c29e0a0650df0f35425b53d3260ba17c5a90 Mon Sep 17 00:00:00 2001 From: yvt Date: Sun, 15 Sep 2013 02:40:47 +0900 Subject: [PATCH 2/2] Disabled debug code --- Sources/Client/Client.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/Client/Client.cpp b/Sources/Client/Client.cpp index 6438699b..24c9760e 100644 --- a/Sources/Client/Client.cpp +++ b/Sources/Client/Client.cpp @@ -998,7 +998,7 @@ namespace spades { } } - if(name == "h" && down) { + if(name == "h" && down && false) { // debug int h = p->GetHealth(); h -= 10; if(h <= 0) h = 100;