some improve game ui and bugfixes

This commit is contained in:
2011-09-11 01:26:06 +04:00
committed by unknown
parent 9f90c1e676
commit 714154a6fd
19 changed files with 363 additions and 392 deletions

View File

@@ -81,16 +81,16 @@ void Splashes::addSplash(SplashType * spl)
case srcTriggerType::onDestination :
tod.src = trig;
spl->trigsOnDest.append(tod);
break;
break;
case srcTriggerType::onAlienInRadius :
toa.src = trig;
spl->trigsOnAlien.append(toa);
break;
break;
case srcTriggerType::onTimer :
tot.src = trig;
tot.timer = 0;
spl->trigsOnTimer.append(tot);
break;
break;
}
}
@@ -177,7 +177,10 @@ void Splashes::update()
delSplash(*j);
for (QHash<int,DeadAlienIndex>::iterator j = dead.begin();
j != dead.end(); ++j)
{
gameData->curTowers[j->tower].experience += gameData->curTowers[j->tower].src->expByKill;
emit killAlien(j->player,j->id);
}
dead.clear();
}
@@ -212,7 +215,8 @@ void Splashes::doTriggerOnTimer(QHash<int, SplashType>::iterator
if (gameData->aliens->curAliens.contains(spl->AlienId))
{
hh = gameData->aliens->curAliens[spl->AlienId].health -= dmg;
if (hh <= 0) dead.insert(spl->AlienId, DeadAlienIndex(spl->AlienId, spl->PlayerId));
if (hh <= 0) dead.insert(spl->AlienId, DeadAlienIndex(spl->AlienId, spl->PlayerId, spl->towerId));
else gameData->curTowers[spl->towerId].experience += hh * gameData->curTowers[spl->towerId].src->expByDamage;
}
} else {
for (QHash<int, AlienType>::iterator
@@ -222,7 +226,8 @@ void Splashes::doTriggerOnTimer(QHash<int, SplashType>::iterator
if (distance2(spl->pos, a->pos) < rad*rad)
{
hh = a->health -= dmg;
if (hh <= 0) dead.insert(a->id, DeadAlienIndex(a->id, spl->PlayerId));
if (hh <= 0) dead.insert(a->id, DeadAlienIndex(a->id, spl->PlayerId, spl->towerId));
else gameData->curTowers[spl->towerId].experience += hh * gameData->curTowers[spl->towerId].src->expByDamage;
}
}
}
@@ -263,7 +268,7 @@ void Splashes::doTriggerOnDest(QHash<int, SplashType>::iterator
{
case srcTriggerType::parentAim :
aim = spl->AlienId;
break;
break;
/// TODO : other aim types
case srcTriggerType::nearestAlien :
@@ -289,7 +294,8 @@ void Splashes::doTriggerOnDest(QHash<int, SplashType>::iterator
if (!badAl)
{
hh = gameData->aliens->curAliens[spl->AlienId].health -= dmg;
if (hh <= 0) dead.insert(spl->AlienId, DeadAlienIndex(spl->AlienId, spl->PlayerId));
if (hh <= 0) dead.insert(spl->AlienId, DeadAlienIndex(spl->AlienId, spl->PlayerId, spl->towerId));
else gameData->curTowers[spl->towerId].experience += hh * gameData->curTowers[spl->towerId].src->expByDamage;
}
} else {
for (QHash<int, AlienType>::iterator
@@ -299,7 +305,8 @@ void Splashes::doTriggerOnDest(QHash<int, SplashType>::iterator
if (distance2(spl->pos, i->pos) < rad*rad)
{
hh = i->health -= dmg;
if (hh <= 0) dead.insert(i->id, DeadAlienIndex(i->id, spl->PlayerId));
if (hh <= 0) dead.insert(i->id, DeadAlienIndex(i->id, spl->PlayerId, spl->towerId));
else gameData->curTowers[spl->towerId].experience += hh * gameData->curTowers[spl->towerId].src->expByDamage;
}
}
}
@@ -326,7 +333,8 @@ void Splashes::doTriggerOnAlien(QHash<int, SplashType>::iterator spl, QHash<int,
if (distance2(spl->pos, i->pos) < rad*rad)
{
hh = i->health -= dmg;
if (hh <= 0) dead.insert(i->id, DeadAlienIndex(i->id, spl->PlayerId));
if (hh <= 0) dead.insert(i->id, DeadAlienIndex(i->id, spl->PlayerId, spl->towerId));
else gameData->curTowers[spl->towerId].experience += hh * gameData->curTowers[spl->towerId].src->expByDamage;
if (t.src->count > 0 && t.src->childId > 0)
{
if (!t.triggerAliens.contains(i->id))