Define for maximal value of mana added.

This commit is contained in:
johns 2002-03-10 04:48:49 +00:00
parent 0226085ef7
commit 283b6edd30
3 changed files with 6 additions and 5 deletions

View file

@ -472,6 +472,7 @@ struct _unit_ {
unsigned Constructed : 1; /// unit is in construction
unsigned Active : 1; /// unit is active for AI
#define MaxMana 255 /// maximal mana for units
unsigned Mana : 8; /// mana points
unsigned HP; /// hit points
unsigned XP; /// experience points

View file

@ -1240,7 +1240,7 @@ global void UnitIncrementMana(void)
--unit->Blink;
}
if( unit->Type->CanCastSpell && unit->Mana!=255 ) {
if( unit->Type->CanCastSpell && unit->Mana!=MaxMana ) {
unit->Mana++;
// some frames delayed done my color cycling

View file

@ -673,8 +673,8 @@ local void DrawDecoration(const Unit* unit,const UnitType* type,int x,int y)
// Mana bar on right side of unit. FIXME: combine bar and sprite
//
if( ShowManaBar ) {
if( type->CanCastSpell && !(ShowNoFull && unit->Mana==255) ) {
DrawManaBar(x,y,type,255,unit->Mana);
if( type->CanCastSpell && !(ShowNoFull && unit->Mana==MaxMana) ) {
DrawManaBar(x,y,type,MaxMana,unit->Mana);
} else if( type->GivesOil || type->GoldMine || type->OilPatch ) {
DrawManaBar(x,y,type,655350,unit->Value);
}
@ -736,8 +736,8 @@ local void DrawDecoration(const Unit* unit,const UnitType* type,int x,int y)
// Mana dot on right side of unit.
//
if( ShowManaDot ) {
if( type->CanCastSpell && !(ShowNoFull && unit->Mana==255) ) {
DrawManaSprite(x,y,type,255,unit->Mana);
if( type->CanCastSpell && !(ShowNoFull && unit->Mana==MaxMana) ) {
DrawManaSprite(x,y,type,MaxMana,unit->Mana);
} else if( type->GivesOil || type->GoldMine || type->OilPatch ) {
DrawManaSprite(x,y,type,655350,unit->Value);
}