Announcement

Collapse
No announcement yet.

Firepower+Armor+HP ?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Firepower+Armor+HP ?

    Another game basics question...

    I generally see little change between these three:


    Firepower 1
    Armor 1
    MaxHP 10

    Armor and firepower change but never HP, any one know why?
    Formerly known as "E" on Apolyton

    See me at Civfanatics.com

  • #2
    From what i remember in combat armour basically acts as a multiplier for hitpoints. So 3 armour will basically equal 30hp for your unit when hitpoints is left at 10.
    Call to Power 2: Apolyton Edition - download the latest version (12th June 2011)
    CtP2 AE Wiki & Modding Reference
    One way to compile the CtP2 Source Code.

    Comment


    • #3
      Is firepower a multiplier for attack/defence?

      Comment


      • #4
        yeah, i think so. I upped the firepower on a a weak attack cataput andit does a lot of attack damage.


        EDIT: a quick check through the code and it looks like firepower is used to determine hoe much HP is taken away when hit?

        armydata GetArmytrength has this

        Code:
        			attack_strength += (sint32) (rec->GetAttack() * hitpoints * fire_power);
        				defense_strength += (sint32) (rec->GetDefense() * hitpoints * fire_power);
        				ranged_strength += (sint32) (rec->GetZBRangeAttack() * hitpoints * fire_power);
        unitdata:bombard has this
        Code:
        	sint32 f = (sint32)(rec->GetFirepower() /  
        		g_theUnitDB->Get(defender.GetType())->GetArmor());
        and i see this

        Code:
        BOOL UnitData::FightOneLineDanceRangedAttack(Unit &defender)
        {
        	double d = defender.GetDefense(Unit(m_id));
        	const UnitRecord *rec = g_theUnitDB->Get(m_type);
        	double r = rec->GetZBRangeAttack();
        	sint32 firepower = rec->GetFirepower();
        
        	double chance = r / (r + d);
        
        	
        	if(!(rec->GetCanAttack() & defender.GetDBRec()->GetMovementType())) {
        		return FALSE;
        	}
        
        	if(g_rand->Next(1000) < sint32(chance * 1000)) {
        		if(firepower > 1) {
        			defender.DeductHP(g_rand->Next(rec->GetFirepower() - 1) + 1);
        		} else {
        			defender.DeductHP(1);
        		}
        		return TRUE;
        	}
        	return FALSE;
        }
        Last edited by Ekmek; April 14, 2006, 18:08.
        Formerly known as "E" on Apolyton

        See me at Civfanatics.com

        Comment

        Working...
        X