Exemple #1
0
bool inf_atk(struct unt *slf,struct unt *def){
    
    /* determine if can attack */
    if(inf_can_atk(slf,def) == FALSE){return FALSE;}
    
    // make changes and "fire shot"
    slf->ammo--; slf->did_fire = TRUE;
    
    float tDMG = tDamage(slf,def);
    
    bool kill = def->def(def,slf,&tDMG);
    bool spKil =  splash(slf,&def->loc[0]);
    
    if(kill == TRUE || spKil == TRUE){
        slf->promote(slf);
    }
    
    return TRUE;
}
void Defense::addTDamage(float damage, int turns, string type)
{
	cDamage.push_back(tDamage(damage, turns, type));
}