Re: Damage formula
Gj Esthlos, is there value for directions?
("+Bows Def" also applies against the rocks thrown by Rogues)
Gj Esthlos, is there value for directions?
//Base damage is the unit attack strength + AttackHorse if the enemy is mounted
Damage := gRes.UnitDat[fUnit.UnitType].Attack;
if (fOpponent.UnitType in [low(UnitGroups) .. high(UnitGroups)]) and (UnitGroups[fOpponent.UnitType] = gt_Mounted) then
Damage := Damage + gRes.UnitDat[fUnit.UnitType].AttackHorse;
Damage := Damage * (GetDirModifier(fUnit.Direction,fOpponent.Direction)+1); //Direction modifier
//Defence modifier
Damage := Damage div Math.max(gRes.UnitDat[fOpponent.UnitType].Defence, 1); //Not needed, but animals have 0 defence
IsHit := (Damage >= KaMRandom(101)); //Damage is a % chance to hit
if IsHit then
fOpponent.HitPointsDecrease(1, fUnit);
Former Site Admin
Posts: 3814
Joined: 08 Jan 2009, 23:00
Location: California - Pacific Time (UTC -8/-7 Summer Time)
These values all refer to r6720
Are you sure this is right? Because I know scouts have the same LoS as other units (no longer 18). Also I think they moved xbow defense back to .50?
Former Site Admin
Posts: 3814
Joined: 08 Jan 2009, 23:00
Location: California - Pacific Time (UTC -8/-7 Summer Time)
Well scouts don't have 18 line of sight.
function TKMScriptStates.aaaGetData(aUnitType: Integer): String;
var aString: String;
var aaaType: TUnitType;
begin
aaaType := UnitIndexToType[aUnitType];
aString := 'Type: '+IntToStr(aUnitType)+'; ';
aString := aString+' Health: '+IntToStr(gRes.UnitDat[aaaType].HitPoints)+'; ';
aString := aString+' Attack: '+IntToStr(gRes.UnitDat[aaaType].Attack)+'; ';
aString := aString+' AttackHorse: '+IntToStr(gRes.UnitDat[aaaType].AttackHorse)+'; ';
aString := aString+' Defence: '+IntToStr(gRes.UnitDat[aaaType].Defence)+'; ';
aString := aString+' CrossBowsDef: '+FloatToStr(gRes.UnitDat[aaaType].GetDefenceVsProjectiles(True))+'; ';
aString := aString+' BowsDef: '+FloatToStr(gRes.UnitDat[aaaType].GetDefenceVsProjectiles(False))+'; ';
aString := aString+' Sight: '+IntToStr(gRes.UnitDat[aaaType].Sight)+'; ';
result := aString;
end;
function aName(aType: Integer): String;
begin
case aType of
0: result := 'Serf ';
1: result := 'Woodcutter ';
2: result := 'Miner ';
3: result := 'Animal Breeder ';
4: result := 'Farmer ';
5: result := 'Carpenter ';
6: result := 'Baker ';
7: result := 'Butcher ';
8: result := 'Fisherman ';
9: result := 'Laborer ';
10: result := 'Stone Mason ';
11: result := 'Blacksmith ';
12: result := 'Metallurgist ';
13: result := 'Recruit ';
14: result := 'Militia ';
15: result := 'Axe Fighter ';
16: result := 'Sword Fighter ';
17: result := 'Bowman ';
18: result := 'Crossbowman ';
19: result := 'Lance Carrier';
20: result := 'Pikeman ';
21: result := 'Scout ';
22: result := 'Knight ';
23: result := 'Barbarian ';
24: result := 'Rebel ';
25: result := 'Rogue ';
26: result := 'Warrior ';
27: result := 'Vagabond ';
end;
end;
procedure OnBeacon(aPlayerIndex: Integer; aX: Integer; aY: Integer);
var i: Integer;
begin
for i := 0 to 27 do Actions.Log(aName(i)+': '+States.aaaGetData(i));
end;
Esthlos, do you think that you could add the "Attack speed" to the table, to make it totally complete?
I know that archers attack faster than crossbowmen (and even faster in KaM Remake), but how much faster? What about infantry, cavalry, etc?
But these stats are for remake, right?
Edit: I saw in another post of yours that you are using "market values". A bit of a rough estimate in my opinion, but I have no idea how to do it better
[...]
Users browsing this forum: No registered users and 4 guests
Powered by phpBB® Forum Software © phpBB Group Designed by ST Software |