From c22fc71adacaf6222f7e6fb70f83758298f25904 Mon Sep 17 00:00:00 2001 From: Ira Rice Date: Fri, 31 Oct 2008 04:05:51 +0000 Subject: Added critical notifications to the client. While I had originally planned to do this (I still did it my way), TMW beat me to implementing, so I'll credit them with their commit reminding me to do it. This is not done the exact same way, as I prefer to see an actual "crit!" show above the being, instead of an ambiguous particle. --- src/being.cpp | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) (limited to 'src/being.cpp') diff --git a/src/being.cpp b/src/being.cpp index 19c2224d..3214b491 100644 --- a/src/being.cpp +++ b/src/being.cpp @@ -189,10 +189,6 @@ void Being::takeDamage(int amount) } else { - // Hit particle effect - controlParticle(particleEngine->addEffect( - "graphics/particles/hit.particle.xml", 0, 0)); - if (getType() == MONSTER) { font = hitBlueFont; @@ -208,6 +204,26 @@ void Being::takeDamage(int amount) mPx + 16, mPy + 16); } +void Being::showCrit() +{ + gcn::Font *font; + std::string text = "crit!"; + + // Selecting the right color + if (getType() == MONSTER) + { + font = hitBlueFont; + } + else + { + font = hitRedFont; + } + + // Show crit notice + particleEngine->addTextRiseFadeOutEffect(text, font, + mPx + 16, mPy - 16); +} + void Being::handleAttack(Being *victim, int damage) { setAction(Being::ATTACK); -- cgit v1.2.3-70-g09d2