Skip to content

DeployFire supports buildings#2104

Open
Fly-Star-him wants to merge 16 commits intoPhobos-developers:developfrom
Fly-Star-him:Building_DeployFire
Open

DeployFire supports buildings#2104
Fly-Star-him wants to merge 16 commits intoPhobos-developers:developfrom
Fly-Star-him:Building_DeployFire

Conversation

@Fly-Star-him
Copy link
Contributor

@Fly-Star-him Fly-Star-him commented Feb 12, 2026

  • Fixed an issue where OmniFire was ineffective on buildings with Turret=yes.
  • Fixed an issue where setting a production building as Primary could cause it to enter an unload state.

  • Building types now also support using DeployFire and DeployFireWeapon.
    • If a building has other configurations such as Factory, GapGenerator, or Passengers, it will prioritize executing those deployment actions instead.
    • DeployFireDelay specifies the frame interval at which deployed weapons attempt to fire. If the weapon is unavailable due to ROF, CanTarget, or other reasons, the deployed weapon will not fire.

In rulesmd.ini:

[SOMEBUILDING]      ; BuildingType
DeployFireDelay=    ; integer, The default value is in the range of 14 to 16.

@github-actions
Copy link

github-actions bot commented Feb 12, 2026

Nightly build for this pull request:

This comment is automatic and is meant to allow guests to get latest nightly builds for this pull request without registering. It is updated on every successful build.

@NetsuNegi NetsuNegi added Needs testing ⚙️T1 T1 maintainer review is sufficient labels Feb 12, 2026

auto const pTypeExt = BuildingTypeExt::ExtMap.Find(pType);
const int result = pTypeExt->DeployFireDelay.isset() ?
pTypeExt->DeployFireDelay : (ScenarioClass::Instance->Random.RandomRanged(0, 2) + 14);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default value should be RearmTimer.TimeLeft.
In addition, the Nullable template should be used like this: nullableVar.Get(default).

Comment on lines 73 to 74
pThis->QueueMission(Mission::Guard, false);
pThis->NextMission();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same

Comment on lines 103 to 117
const auto pBuilding = static_cast<BuildingClass*>(pObject);
auto const pType = pBuilding->Type;
const auto pHouse = pBuilding->Owner;

if (!pHouse->IsControlledByCurrentPlayer() || !pType->DeployFire || pType->Factory != AbstractType::None)
continue;

const Mission currentMission = pBuilding->CurrentMission;

if (currentMission == Mission::Construction || currentMission == Mission::Selling)
continue;

if (pBuilding->EMPLockRemaining > 0 || !pBuilding->WasOnline || pBuilding->BunkerLinkedItem)
continue;

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be wrapped into a function.

Comment on lines +899 to +900
pBuilding->QueueMission(Mission::Guard, false);
pBuilding->NextMission();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same

- Fix an issue where mining vehicles could not move after leaving a tank bunker
- Fixed the bug in AI scripts 56 and 57 that forced the launch of superweapons with index numbers 3 and 4
- DeployFire supports buildings
- Fixed an issue where `OmniFire` was ineffective on buildings with `Turret=yes`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OmniFire is actually a tag limited to UnitClass. AircraftClass uses Fighter, BuildingClass must face the target to fire, while InfantryClass ignores the facing.

Comment on lines +60 to +61
pThis->QueueMission(Mission::Guard, false);
pThis->NextMission();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should use ForceMission

Fly-Star-him and others added 2 commits February 14, 2026 21:15
add link, correct the comment format
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs testing ⚙️T1 T1 maintainer review is sufficient

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants