Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 28 additions & 9 deletions docs/Fixed-or-Improved-Logics.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ This page describes all ingame logics that are fixed or improved in Phobos witho
- Fixed `DeployToFire` not recalculating firer's position on land if it cannot currently deploy.
- `Arcing=true` projectile elevation inaccuracy can now be fixed by setting `Arcing.AllowElevationInaccuracy=false`.
- Wall overlays are now drawn with the custom palette defined in `Palette` in `artmd.ini` if possible.
- Setting `ReloadInTransport` to true on units with `Ammo` will allow the ammo to be reloaded according to `Reload` or `EmptyReload` timers even while the unit is inside a transport.
- Setting `ReloadInTransport` to true on units with `Ammo` will allow the ammo to be reloaded according to `Reload` or `EmptyReload` timers even while the unit is inside a transport. Can also be defined at `[General] -> ReloadInTransport` for a global default value.
- It is now possible to enable `Verses` and `PercentAtMax` to be applied on negative damage by setting `ApplyModifiersOnNegativeDamage` to true on the Warhead.
- Attached animations on flying units now have their layer updated immediately after the parent unit, if on same layer they always draw above the parent.
- Fixed an issue where the powered anims of `Powered` / `PoweredSpecial` buildings cease to update when being captured by enemies.
Expand Down Expand Up @@ -754,8 +754,11 @@ CurleyShuffle= ; boolean, default to [General] -> CurleyShuffle

In `rulesmd.ini`:
```ini
[SOMEAIRCRAFT] ; AircraftType
FiringForceScatter=true ; boolean
[General]
AircraftFiringForceScatter=true ; boolean

[SOMEAIRCRAFT] ; AircraftType
FiringForceScatter= ; boolean, default to [General] -> AircraftFiringForceScatter
```

### Extended Aircraft Missions
Expand Down Expand Up @@ -1737,11 +1740,15 @@ DropPod.Weapon.HitLandOnly= ; boolean, default to no

In `rulesmd.ini`:
```ini
[SOMETECHNO] ; TechnoType
[General]
Explodes.KillPassengers=true ; boolean
Explodes.DuringBuildup=true ; boolean

[SOMETECHNO] ; TechnoType
Explodes.KillPassengers= ; boolean, default to [General] -> Explodes.KillPassengers

[SOMEBUILDING] ; BuildingType
Explodes.DuringBuildup=true ; boolean
Explodes.DuringBuildup= ; boolean, default to [General] -> Explodes.DuringBuildup
```

### Forbid parallel AI queues
Expand Down Expand Up @@ -2316,10 +2323,15 @@ KeepTargetOnMove.ExtraDistance=0 ; floating point value, distance in cells

In `rulesmd.ini`:
```ini
[SOMEVEHICLE] ; VehicleType
[General]
Sinkable= ; boolean
SinkSpeed=5 ; integer, leptons per frame
Sinkable.SquidGrab=true ; boolean

[SOMEVEHICLE] ; VehicleType
Sinkable= ; boolean, default to [General] -> Sinkable
SinkSpeed=5 ; integer, leptons per frame, default to [General] -> SinkSpeed
Sinkable.SquidGrab=true ; boolean, default to [General] -> Sinkable.SquidGrab
```

### Stationary vehicles
Expand Down Expand Up @@ -2499,6 +2511,10 @@ Rocker.AmplitudeOverride= ; integer

In `rulesmd.ini`:
```ini
[General]
CreateAnimsOnZeroDamage=false ; boolean
Conventional.IgnoreUnits=false ; boolean

[SOMEWARHEAD] ; WarheadType
AnimList.PickRandom=false ; boolean
AnimList.CreateAll=false ; boolean
Expand All @@ -2511,8 +2527,8 @@ SplashList.CreateAll=false ; boolean
SplashList.CreationInterval=0 ; integer
SplashList.ScatterMin=0.0 ; floating point value, distance in cells
SplashList.ScatterMax=0.0 ; floating point value, distance in cells
CreateAnimsOnZeroDamage=false ; boolean
Conventional.IgnoreUnits=false ; boolean
CreateAnimsOnZeroDamage= ; boolean, default to [General] -> CreateAnimsOnZeroDamage
Conventional.IgnoreUnits=false ; boolean, default to [General] -> Conventional.IgnoreUnits
```

### Customizable Warhead trigger conditions
Expand All @@ -2538,8 +2554,11 @@ EffectsRequireVerses=false ; boolean

In `rulesmd.ini`:
```ini
[SOMEWARHEAD] ; WarheadType
[General]
DecloakDamagedTargets=true ; boolean

[SOMEWARHEAD] ; WarheadType
DecloakDamagedTargets= ; boolean, default to [General] -> DecloakDamagedTargets
```

### Customizing locomotor warhead
Expand Down
43 changes: 32 additions & 11 deletions docs/New-or-Enhanced-Logics.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ This page describes all the engine features that are either new and introduced b
- `ForceDecloak`, if set to true, will uncloak and make the object the effect is attached to unable to cloak itself for duration of the effect.
- `WeaponRange.Multiplier` and `WeaponRange.ExtraRange` can be used to multiply the weapon firing range of the object the effect is attached to, or give it an increase / decrease (measured in cells), respectively. `ExtraRange` is cumulatively applied from all attached effects after all `Multiplier` values have been applied.
- `WeaponRange.AllowWeapons` can be used to list only weapons that can benefit from this range bonus and `WeaponRange.DisallowWeapons` weapons that are not allowed to, respectively.
- On TechnoTypes with `OpenTopped=true`, `OpenTopped.UseTransportRangeModifiers` can be set to true to make passengers firing out use the transport's active range bonuses instead.
- On TechnoTypes with `OpenTopped=true`, `OpenTopped.UseTransportRangeModifiers` can be set to true to make passengers firing out use the transport's active range bonuses instead. `[General] -> OpenTopped.UseTransportRangeModifiers` defines its global default value.
- `Crit.Multiplier` and `Crit.ExtraChance` can be used to multiply the [critical hit](#chance-based-extra-damage-or-warhead-detonation--critical-hits) chance or grant a fixed bonus to it for the object the effect is attached to, respectively.
- `Crit.AllowWarheads` can be used to list only Warheads that can benefit from this critical hit chance multiplier and `Crit.DisallowWarheads` weapons that are not allowed to, respectively.
- `RevengeWeapon` can be used to temporarily grant the specified weapon as a [revenge weapon](#revenge-weapon) for the attached object.
Expand All @@ -56,7 +56,7 @@ This page describes all the engine features that are either new and introduced b
- Warheads can prevent reflect damage from occuring by setting `SuppressReflectDamage` to true. `SuppressReflectDamage.Types` can control which AttachEffectTypes' reflect damage is suppressed, if none are listed then all of them are suppressed. `SuppressReflectDamage.Groups` does the same thing but for all AttachEffectTypes in the listed groups.
- `ReflectDamage.UseInvokerAsOwner` can be used to set the house and TechnoType that created the effect (e.g firer of the weapon that applied it) as the reflected damage's owner & invoker instead of the object the effect is attached to.
- `DisableWeapons` can be used to disable ability to fire any and all weapons.
- On TechnoTypes with `OpenTopped=true`, `OpenTopped.CheckTransportDisableWeapons` can be set to true to make passengers not be able to fire out if transport's weapons are disabled by `DisableWeapons`.
- On TechnoTypes with `OpenTopped=true`, `OpenTopped.CheckTransportDisableWeapons` can be set to true to make passengers not be able to fire out if transport's weapons are disabled by `DisableWeapons`. `[General] -> OpenTopped.CheckTransportDisableWeapons` defines its global default value.
- `Unkillable` can be used to prevent the techno from being killed by taken damage (minimum health will be 1).
- It is possible to set groups for attach effect types by defining strings in `Groups`.
- Groups can be used instead of types for removing effects and weapon filters.
Expand Down Expand Up @@ -152,14 +152,18 @@ Unkillable=false ; boolean
LaserTrail.Type= ; LaserTrailType
Groups= ; comma-separated list of strings (group IDs)

[General]
OpenTopped.UseTransportRangeModifiers=false ; boolean
OpenTopped.CheckTransportDisableWeapons=false ; boolean

[SOMETECHNO] ; TechnoType
AttachEffect.AttachTypes= ; List of AttachEffectTypes
AttachEffect.DurationOverrides= ; integer - duration overrides (comma-separated) for AttachTypes in order from first to last.
AttachEffect.Delays= ; integer - delays (comma-separated) for AttachTypes in order from first to last.
AttachEffect.InitialDelays= ; integer - initial delays (comma-separated) for AttachTypes in order from first to last.
AttachEffect.RecreationDelays= ; integer - recreation delays (comma-separated) for AttachTypes in order from first to last.
OpenTopped.UseTransportRangeModifiers=false ; boolean
OpenTopped.CheckTransportDisableWeapons=false ; boolean
OpenTopped.UseTransportRangeModifiers= ; boolean, default to [General] -> OpenTopped.UseTransportRangeModifiers
OpenTopped.CheckTransportDisableWeapons= ; boolean, default to [General] -> OpenTopped.CheckTransportDisableWeapons

[SOMEWEAPON] ; WeaponType
AttachEffect.RequiredTypes= ; List of AttachEffectTypes
Expand Down Expand Up @@ -819,6 +823,9 @@ BombParachute= ; AnimationType, default to [General] -> BombParachute

In `rulesmd.ini`:
```ini
[General]
Interceptable=false ; boolean

[SOMETECHNO] ; TechnoType
Interceptor=false ; boolean
Interceptor.Weapon=0 ; integer, weapon slot index (0 or 1)
Expand All @@ -839,7 +846,7 @@ Interceptor.KeepIntact=false ; boolean

[SOMEPROJECTILE] ; Projectile
Interceptable=false ; boolean
Interceptable.DeleteOnIntercept=false ; boolean
Interceptable.DeleteOnIntercept= ; boolean, default to [General] -> Interceptable
Interceptable.WeaponOverride= ; WeaponType
Strength=0 ; integer
Armor= ; ArmorType
Expand Down Expand Up @@ -1452,9 +1459,13 @@ PassengerDeletion.UnderEMP=false ; boolean

In `rulesmd.ini`:
```ini
[SOMETECHNO] ; TechnoType
[General]
Passengers.SyncOwner=false ; boolean
Passengers.SyncOwner.RevertOnExit=true ; boolean

[SOMETECHNO] ; TechnoType
Passengers.SyncOwner= ; boolean, default to [General] -> Passengers.SyncOwner
Passengers.SyncOwner.RevertOnExit= ; boolean, default to [General] -> Passengers.SyncOwner.RevertOnExit
```

### Automatically firing weapons
Expand Down Expand Up @@ -1566,22 +1577,29 @@ DrainMoneyDisplay.OnTarget.UseDisplayIncome= ; boolean
In `rulesmd.ini`:
```ini
[General]
OpenTopped.IgnoreRangefinding=false ; boolean
OpenTopped.AllowFiringIfDeactivated=true ; boolean
OpenTopped.ShareTransportTarget=true ; boolean
OpenTopped.AllowFiringIfAttackedByLocomotor=true ; boolean
OpenTopped.DecloakToFire=true ; boolean

[SOMETECHNO] ; TechnoType, transport with OpenTopped=yes
OpenTopped.RangeBonus= ; integer, default to [CombatDamage] -> OpenToppedRangeBonus
OpenTopped.DamageMultiplier= ; floating point value, default to [CombatDamage] -> OpenToppedDamageMultiplier
OpenTopped.WarpDistance= ; integer, default to [CombatDamage] -> OpenToppedWarpDistance
OpenTopped.IgnoreRangefinding=false ; boolean
OpenTopped.AllowFiringIfDeactivated=true ; boolean
OpenTopped.IgnoreRangefinding= ; boolean, defaults to [General] -> OpenTopped.IgnoreRangefinding
OpenTopped.AllowFiringIfDeactivated= ; boolean, defaults to [General] -> OpenTopped.AllowFiringIfDeactivated
OpenTopped.AllowFiringIfAttackedByLocomotor= ; boolean, defaults to [General] -> OpenTopped.AllowFiringIfAttackedByLocomotor
OpenTopped.ShareTransportTarget=true ; boolean
OpenTopped.ShareTransportTarget= ; boolean, defaults to [General] -> OpenTopped.ShareTransportTarget
OpenTopped.DecloakToFire= ; boolean, defaults to [General] -> OpenTopped.DecloakToFire

[SOMETECHNO] ; TechnoType, passenger
[CombatDamage]
OpenTransport.RangeBonus=0 ; integer
OpenTransport.DamageMultiplier=1.0 ; floating point value

[SOMETECHNO] ; TechnoType, passenger
OpenTransport.RangeBonus= ; integer, defaults to [CombatDamage] -> OpenTransport.RangeBonus
OpenTransport.DamageMultiplier= ; floating point value, defaults to [CombatDamage] -> OpenTransport.DamageMultiplier
```

```{note}
Expand Down Expand Up @@ -2305,8 +2323,11 @@ Ammo.DeployUnlockMaximumAmount=-1 ; integer

In `rulesmd.ini`:
```ini
[SOMEVEHICLE] ; VehicleType
[General]
HoverDrownable=true ; boolean

[SOMEVEHICLE] ; VehicleType
HoverDrownable= ; boolean, default to [General] -> HoverDrownable
```

### Damaged unit image changes
Expand Down
6 changes: 3 additions & 3 deletions src/Ext/Aircraft/Hooks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ DEFINE_HOOK(0x41879D, AircraftClass_Mission_Attack_StrafeCell, 0x6)

AircraftExt::FireWeapon(pThis, pTargetCell);

if (pExt->TypeExtData->FiringForceScatter)
if (pExt->TypeExtData->FiringForceScatter.Get(RulesExt::Global()->AircraftFiringForceScatter))
pTargetCell->ScatterContent(pThis->Location, true, false, false);

pThis->SetDestination(pTargetCell, true);
Expand All @@ -344,13 +344,13 @@ DEFINE_HOOK_AGAIN(0x418B46, AircraftClass_MissionAttack_ScatterCell1, 0x6)
DEFINE_HOOK(0x41847E, AircraftClass_MissionAttack_ScatterCell1, 0x6)
{
GET(AircraftClass*, pThis, ESI);
return TechnoTypeExt::ExtMap.Find(pThis->Type)->FiringForceScatter ? 0 : (R->Origin() + 0x44);
return TechnoTypeExt::ExtMap.Find(pThis->Type)->FiringForceScatter.Get(RulesExt::Global()->AircraftFiringForceScatter) ? 0 : (R->Origin() + 0x44);
}

DEFINE_HOOK(0x4186DD, AircraftClass_MissionAttack_ScatterCell2, 0x5)
{
GET(AircraftClass*, pThis, ESI);
return TechnoTypeExt::ExtMap.Find(pThis->Type)->FiringForceScatter ? 0 : (R->Origin() + 0x43);
return TechnoTypeExt::ExtMap.Find(pThis->Type)->FiringForceScatter.Get(RulesExt::Global()->AircraftFiringForceScatter) ? 0 : (R->Origin() + 0x43);
}

#pragma endregion
Expand Down
2 changes: 1 addition & 1 deletion src/Ext/Bullet/Body.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ void BulletExt::ExtData::InterceptBullet(TechnoClass* pSource, BulletClass* pInt
this->InitializeLaserTrails();

// Lose target if the current bullet is no longer interceptable.
if (pSource && (!pTypeExt->Interceptable || (pTypeExt->Armor.isset() && GeneralUtils::GetWarheadVersusArmor(pInterceptor->WH, pTypeExt->Armor.Get()) == 0.0)))
if (pSource && (!pTypeExt->Interceptable.Get(RulesExt::Global()->Interceptable) || (pTypeExt->Armor.isset() && GeneralUtils::GetWarheadVersusArmor(pInterceptor->WH, pTypeExt->Armor.Get()) == 0.0)))
pSource->SetTarget(nullptr);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Ext/Bullet/Hooks.DetonateLogics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ DEFINE_HOOK(0x469B44, BulletClass_Logics_LandTypeCheck, 0x6)

auto const pWHExt = WarheadTypeExt::ExtMap.Find(pThis->WH);

if (pWHExt->Conventional_IgnoreUnits)
if (pWHExt->Conventional_IgnoreUnits.Get(RulesExt::Global()->Conventional_IgnoreUnits))
return SkipChecks;

return 0;
Expand Down
4 changes: 2 additions & 2 deletions src/Ext/BulletType/Body.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class BulletTypeExt
public:
// Valueable<int> Strength; //Use OwnerObject()->ObjectTypeClass::Strength
Nullable<ArmorType> Armor;
Valueable<bool> Interceptable;
Nullable<bool> Interceptable;
Valueable<bool> Interceptable_DeleteOnIntercept;
Valueable<WeaponTypeClass*> Interceptable_WeaponOverride;
ValueableIdxVector<LaserTrailTypeClass> LaserTrail_Types;
Expand Down Expand Up @@ -82,7 +82,7 @@ class BulletTypeExt

ExtData(BulletTypeClass* OwnerObject) : Extension<BulletTypeClass>(OwnerObject)
, Armor {}
, Interceptable { false }
, Interceptable {}
, Interceptable_DeleteOnIntercept { false }
, Interceptable_WeaponOverride {}
, LaserTrail_Types {}
Expand Down
54 changes: 52 additions & 2 deletions src/Ext/Rules/Body.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -349,8 +349,37 @@ void RulesExt::ExtData::LoadBeforeTypeData(RulesClass* pThis, CCINIClass* pINI)

this->FallingDownTargetingFix.Read(exINI, GameStrings::General, "FallingDownTargetingFix");
this->AIAirTargetingFix.Read(exINI, GameStrings::General, "AIAirTargetingFix");
this->OpenTopped_DecloakToFire.Read(exINI, GameStrings::General, "OpenTopped.DecloakToFire");

this->ReloadInTransport.Read(exINI, GameStrings::General, "ReloadInTransport");
this->OpenTopped_IgnoreRangefinding.Read(exINI, GameStrings::General, "OpenTopped.IgnoreRangefinding");
this->OpenTopped_AllowFiringIfDeactivated.Read(exINI, GameStrings::General, "OpenTopped.AllowFiringIfDeactivated");
this->OpenTopped_AllowFiringIfAttackedByLocomotor.Read(exINI, GameStrings::General, "OpenTopped.AllowFiringIfAttackedByLocomotor");
this->OpenTopped_ShareTransportTarget.Read(exINI, GameStrings::General, "OpenTopped.ShareTransportTarget");
this->OpenTopped_UseTransportRangeModifiers.Read(exINI, GameStrings::General, "OpenTopped.UseTransportRangeModifiers");
this->OpenTopped_CheckTransportDisableWeapons.Read(exINI, GameStrings::General, "OpenTopped.CheckTransportDisableWeapons");
this->OpenTopped_DecloakToFire.Read(exINI, GameStrings::General, "OpenTopped.DecloakToFire");
this->OpenTransport_RangeBonus.Read(exINI, GameStrings::CombatDamage, "OpenTransport.RangeBonus");
this->OpenTransport_DamageMultiplier.Read(exINI, GameStrings::CombatDamage, "OpenTransport.DamageMultiplier");

this->Passengers_SyncOwner.Read(exINI, GameStrings::General, "Passengers.SyncOwner");
this->Passengers_SyncOwner_RevertOnExit.Read(exINI, GameStrings::General, "Passengers.SyncOwner.RevertOnExit");

this->Explodes_KillPassengers.Read(exINI, GameStrings::General, "Explodes.KillPassengers");
this->Explodes_DuringBuildup.Read(exINI, GameStrings::General, "Explodes.DuringBuildup");

this->AircraftFiringForceScatter.Read(exINI, GameStrings::General, "AircraftFiringForceScatter");

this->HoverDrownable.Read(exINI, GameStrings::General, "HoverDrownable");

this->Sinkable.Read(exINI, GameStrings::General, "Sinkable");
this->Sinkable_SquidGrab.Read(exINI, GameStrings::General, "Sinkable.SquidGrab");
this->SinkSpeed.Read(exINI, GameStrings::General, "SinkSpeed");

this->CreateAnimsOnZeroDamage.Read(exINI, GameStrings::General, "CreateAnimsOnZeroDamage");
this->Conventional_IgnoreUnits.Read(exINI, GameStrings::General, "Conventional.IgnoreUnits");
this->DecloakDamagedTargets.Read(exINI, GameStrings::General, "DecloakDamagedTargets");

this->Interceptable.Read(exINI, GameStrings::General, "Interceptable");

this->SortCameoByName.Read(exINI, GameStrings::General, "SortCameoByName");

Expand Down Expand Up @@ -687,8 +716,29 @@ void RulesExt::ExtData::Serialize(T& Stm)
.Process(this->IvanBombAttachToCenter)
.Process(this->FallingDownTargetingFix)
.Process(this->AIAirTargetingFix)
.Process(this->OpenTopped_DecloakToFire)
.Process(this->ReloadInTransport)
.Process(this->OpenTopped_IgnoreRangefinding)
.Process(this->OpenTopped_AllowFiringIfDeactivated)
.Process(this->OpenTopped_AllowFiringIfAttackedByLocomotor)
.Process(this->OpenTopped_ShareTransportTarget)
.Process(this->OpenTopped_UseTransportRangeModifiers)
.Process(this->OpenTopped_CheckTransportDisableWeapons)
.Process(this->OpenTopped_DecloakToFire)
.Process(this->OpenTransport_RangeBonus)
.Process(this->OpenTransport_DamageMultiplier)
.Process(this->Passengers_SyncOwner)
.Process(this->Passengers_SyncOwner_RevertOnExit)
.Process(this->Explodes_KillPassengers)
.Process(this->Explodes_DuringBuildup)
.Process(this->AircraftFiringForceScatter)
.Process(this->HoverDrownable)
.Process(this->Sinkable)
.Process(this->Sinkable_SquidGrab)
.Process(this->SinkSpeed)
.Process(this->CreateAnimsOnZeroDamage)
.Process(this->Conventional_IgnoreUnits)
.Process(this->DecloakDamagedTargets)
.Process(this->Interceptable)
.Process(this->SortCameoByName)
.Process(this->MergeBuildingDamage)
.Process(this->BuildingRadioLink_SyncOwner)
Expand Down
Loading
Loading