1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
|
#include "defs.h"
#include "trigtable.h"
#include "raptor.h"
#include "bitmap.h"
#include "hull.h"
#include "hull_ship_shield.h"
#include "hull_protect.h"
#include "ebox.h"
#define shield_size 8
ShieldHull::ShieldHull( Bitmap * me, double life, int level, ECollide * eb ):
HullObject( me, life, SHIP_DAMAGE, 1, level, 10, false, eb ) {
for ( int q = 0; q < shield_max; q++ )
pr[ q ] = new ProtectHull( 1, level );
}
void ShieldHull::Draw( const Bitmap & work, int x, int y ) {
HullObject::Draw( work, x, y );
//circlefill( work, x, y, shield_size, color );
for ( int q = 0; q < shield_max; q++ )
pr[q]->Draw( work, x, y );
}
double ShieldHull::Damage( double much ) {
double total = much;
for ( int q = 0; q < shield_max; q++ )
if ( pr[q]->haveBeenHit() )
total = 0;
return total;
}
ShieldHull::~ShieldHull() {
for ( int q = 0; q < shield_max; q++ )
delete pr[q];
}
|