Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/simulation/components/GuiInterface.js
Show First 20 Lines • Show All 448 Lines • ▼ Show 20 Lines | for (let type of types) | ||||
// else, take the average elevation around it: angle = 2 * pi. | // else, take the average elevation around it: angle = 2 * pi. | ||||
ret.attack[type].elevationAdaptedRange = cmpRangeManager.GetElevationAdaptedRange(cmpPosition.GetPosition(), cmpPosition.GetRotation(), range.max, range.elevationBonus, cmpUnitAI ? 0 : 2 * Math.PI); | ret.attack[type].elevationAdaptedRange = cmpRangeManager.GetElevationAdaptedRange(cmpPosition.GetPosition(), cmpPosition.GetRotation(), range.max, range.elevationBonus, cmpUnitAI ? 0 : 2 * Math.PI); | ||||
else | else | ||||
// Not in world, set a default? | // Not in world, set a default? | ||||
ret.attack[type].elevationAdaptedRange = ret.attack.maxRange; | ret.attack[type].elevationAdaptedRange = ret.attack.maxRange; | ||||
} | } | ||||
} | } | ||||
let cmpArmour = Engine.QueryInterface(ent, IID_Resistance); | let cmpResistance = Engine.QueryInterface(ent, IID_Resistance); | ||||
if (cmpArmour) | if (cmpResistance) | ||||
ret.armour = cmpArmour.GetArmourStrengths("Damage"); | ret.resistance = cmpResistance.GetResistanceOfType(cmpFoundation ? "Foundation" : "Entity"); | ||||
wraitii: Think I'd rather you called different functions directly. | |||||
let cmpBuildingAI = Engine.QueryInterface(ent, IID_BuildingAI); | let cmpBuildingAI = Engine.QueryInterface(ent, IID_BuildingAI); | ||||
Done Inline ActionsI guess all resistance strengths should be passed to the gui, so I suppose we should pass everything in guiinterface bb: I guess all resistance strengths should be passed to the gui, so I suppose we should pass… | |||||
if (cmpBuildingAI) | if (cmpBuildingAI) | ||||
ret.buildingAI = { | ret.buildingAI = { | ||||
"defaultArrowCount": cmpBuildingAI.GetDefaultArrowCount(), | "defaultArrowCount": cmpBuildingAI.GetDefaultArrowCount(), | ||||
"maxArrowCount": cmpBuildingAI.GetMaxArrowCount(), | "maxArrowCount": cmpBuildingAI.GetMaxArrowCount(), | ||||
"garrisonArrowMultiplier": cmpBuildingAI.GetGarrisonArrowMultiplier(), | "garrisonArrowMultiplier": cmpBuildingAI.GetGarrisonArrowMultiplier(), | ||||
"garrisonArrowClasses": cmpBuildingAI.GetGarrisonArrowClasses(), | "garrisonArrowClasses": cmpBuildingAI.GetGarrisonArrowClasses(), | ||||
"arrowCount": cmpBuildingAI.GetArrowCount() | "arrowCount": cmpBuildingAI.GetArrowCount() | ||||
}; | }; | ||||
▲ Show 20 Lines • Show All 1,578 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator
Think I'd rather you called different functions directly.