Skip to content

Commit ec71910

Browse files
OneBox update test (#8)
1 parent 6661ee4 commit ec71910

25 files changed

Lines changed: 333 additions & 42 deletions

CREDITS.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -411,6 +411,7 @@ This page lists all the individual contributions to the project by their author.
411411
- Vehicle Deployment Enhancement
412412
- Fix an issue where miners affected by `Passengers/DeployFire` were unable to unload minerals
413413
- Fix an issue where mining vehicles could not move after leaving a tank bunker
414+
- Fixed the bug in AI scripts 56 and 57 that forced the launch of superweapons with index numbers 3 and 4
414415
- **NetsuNegi**:
415416
- Forbidding parallel AI queues by type
416417
- Jumpjet crash speed fix when crashing onto building
@@ -496,6 +497,8 @@ This page lists all the individual contributions to the project by their author.
496497
- Fix the bug that techno in attack move will move to target if it cannot attack it
497498
- Penetrates damage on transporter
498499
- Add amount limit of `LimboKill`
500+
- Spawns particle when spawns tiberium by terrain
501+
- Allow draw SuperWeapon timer as percentage
499502
- **Apollo** - Translucent SHP drawing patches
500503
- **ststl**:
501504
- Customizable `ShowTimer` priority of superweapons
@@ -696,6 +699,7 @@ This page lists all the individual contributions to the project by their author.
696699
- Fix an issue where units recruited by a team with `AreTeamMembersRecruitable=false` cannot be recruited even if they have been liberated by that team
697700
- Global default value for `DefaultToGuardArea`
698701
- Weapon range finding in cylinder
702+
- Allow jumpjet climbing ignore building height
699703
- **solar-III (凤九歌)**
700704
- Target scanning delay customization (documentation)
701705
- Skip target scanning function calling for unarmed technos (documentation)

YRpp

docs/Fixed-or-Improved-Logics.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,8 @@ This page describes all ingame logics that are fixed or improved in Phobos witho
297297
- Allow the default value of `DefaultToGuardArea` to be defined by `[General] -> DefaultToGuardArea`.
298298
- Fixed the bug that cause technos teleport to cell 0,0 by ChronoSphere superweapon.
299299
- Fixed the bug that techno in attack move will move to target if it cannot attack it.
300+
- Fixed the bug in AI scripts 56 and 57 that forced the launch of superweapons with index numbers 3 and 4.
301+
- Buildings with `NeedsEngineer=true` are now considered to have threat value of 0 under ownership of `MultiplayPassive=true` houses regardless of their `ThreatPosed` value.
300302

301303
## Fixes / interactions with other extensions
302304

@@ -486,12 +488,17 @@ ForceShield.ExtraTintIntensity=0.0 ; floating point value
486488
- You can now let the jumpjets increase their height earlier by set `JumpjetClimbPredictHeight` to true. The jumpjet will raise its height 5 cells in advance, instead of only raising its height when encountering cliffs or buildings in front of it.
487489
- You can also let them simply skip the stop check by set `JumpjetClimbWithoutCutOut` to true. The jumpjet will not stop moving horizontally when encountering cliffs or buildings in front of it, but will continue to move forward while raising its altitude.
488490
- When `JumpjetClimbPredictHeight` is enabled, if the height raised five grids in advance is still not enough to cross cliffs or buildings, it will stop and move horizontally as before, unless `JumpjetClimbWithoutCutOut` is also enabled.
491+
- You can set `JumpjetClimbIgnoreBuilding` to true to make the jumpjet treat the building height as 0 when climbing.
489492

490493
In `rulesmd.ini`:
491494
```ini
492495
[General]
493-
JumpjetClimbPredictHeight=false ; boolean
494-
JumpjetClimbWithoutCutOut=false ; boolean
496+
JumpjetClimbPredictHeight=false ; boolean
497+
JumpjetClimbWithoutCutOut=false ; boolean
498+
JumpjetClimbIgnoreBuilding=false ; boolean
499+
500+
[SOMETECHNO] ; technotype
501+
JumpjetClimbIgnoreBuilding= ; boolean, default to [General] -> JumpjetClimbIgnoreBuilding
495502
```
496503

497504
### Move IvanBomb Position
@@ -1944,6 +1951,7 @@ SpawnsTiberium.Type=0 ; tiberium/ore type index
19441951
SpawnsTiberium.Range=1 ; integer, radius in cells
19451952
SpawnsTiberium.GrowthStage=3 ; integer - single or comma-sep. range
19461953
SpawnsTiberium.CellsPerAnim=1 ; integer - single or comma-sep. range
1954+
SpawnsTiberium.Particle= ; particle
19471955
```
19481956

19491957
### Damaged frames and crumbling animation

docs/New-or-Enhanced-Logics.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -595,17 +595,18 @@ DetachedReport= ; Sound entry
595595

596596
- There are now additional customizations available for building placement next to other buildings.
597597
- `Adjacent.Allowed` lists BuildingTypes this BuildingType can be placed off (within distance defined by `Adjacent`). If empty, any BuildingType not listed in `Adjacent.Disallowed` is okay.
598-
- `Adjacent.Disallowed` lists BuildingTypes this BuildingType cannot be placed next to. If empty, any BuildingTypes are okay as long as `Adjacent.Allowed` is empty or they are listed on it.
599-
- If `Adjacent.Disallowed.ExtraDistance` is set to value other than 0, this value is added to `Adjacent` value when checking for disallowed buildings.
598+
- `Adjacent.Disallowed` lists BuildingTypes this BuildingType cannot be placed off from. If empty, any BuildingTypes are okay as long as `Adjacent.Allowed` is empty or they are listed on it.
599+
- `Adjacent.Disallowed.Prohibit` if set to true makes this behaviour strict and disallows placement even if there are eligible buildings around if the placement is within range of a disallowed one. `Adjacent.Disallowed.ProhibitDistance` can be used to override `Adjacent` for this check if set to value higher than 0.
600600
- If `NoBuildAreaOnBuildup` is set to true, no building can be built next to this building regardless of any other settings if it is currently displaying its buildup animation.
601601

602602
In `rulesmd.ini`:
603603
```ini
604-
[SOMEBUILDING] ; BuildingType
605-
Adjacent.Allowed= ; List of BuildingTypes
606-
Adjacent.Disallowed= ; List of BuildingTypes
607-
Adjacent.Disallowed.ExtraDistance=0 ; integer, cell offset
608-
NoBuildAreaOnBuildup=false ; boolean
604+
[SOMEBUILDING] ; BuildingType
605+
Adjacent.Allowed= ; List of BuildingTypes
606+
Adjacent.Disallowed= ; List of BuildingTypes
607+
Adjacent.Disallowed.Prohibit=false ; boolean
608+
Adjacent.Disallowed.ProhibitDistance=0 ; integer, cell offset
609+
NoBuildAreaOnBuildup=false ; boolean
609610
```
610611

611612
### Destroyable pathfinding obstacles

docs/User-Interface.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,19 @@ In `rulesmd.ini`:
391391
ShowTimer.Priority=0 ; integer
392392
```
393393

394+
### Allow draw SuperWeapon timer as percentage
395+
396+
- Superweapon cd timer can now draw as percentage.
397+
398+
In `rulesmd.ini`:
399+
```ini
400+
[AudioVisual]
401+
SuperWeaponTimer.Percentage=false ; boolean
402+
403+
[SOMESW] ; SuperWeaponType, with ShowTimer=yes
404+
ShowTimer.Percentage= ; boolean
405+
```
406+
394407
### Task subtitles display in the middle of the screen
395408

396409
![Message Display In Center](_static/images/messagedisplayincenter.gif)

docs/Whats-New.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,7 @@ New:
525525
- [Warhead effect filtering by target veterancy](Fixed-or-Improved-Logics.md#customizable-warhead-trigger-conditions) (by Flactine)
526526
- [Vehicle Deployment Enhancement](Fixed-or-Improved-Logics.md#deployment-enhancement) (by FlyStar)
527527
- `ProductionAnim` is now available for `Factory=InfantryType` as well as non-`ConstructionYard=true` `Factory=BuildingType` buildings (by Starkku)
528-
- [Extra distance modifier for `Adjacent.Disallowed`](New-or-Enhanced-Logics.md#build-area-customizations) (by Starkku)
528+
- [Extra settings for `Adjacent.Disallowed`](New-or-Enhanced-Logics.md#build-area-customizations) (by Starkku)
529529
- [Allow customizing how many times `FactoryPlant` bonuses can be applied from a BuildingType](Fixed-or-Improved-Logics.md#factoryplant-customizations) (by Starkku)
530530
- [Maximum amount for power plant enhancer](New-or-Enhanced-Logics.md#power-plant-enhancer) (by Ollerus)
531531
- [Return warhead](New-or-Enhanced-Logics.md#return-warhead) (by Ollerus)
@@ -539,6 +539,9 @@ New:
539539
- [Penetrates damage on transporter](New-or-Enhanced-Logics.md#penetrates-damage-on-transporter) (by NetsuNegi)
540540
- Added amount limit of `LimboKill` (by NetsuNegi)
541541
- [Customizations for techno type target scan/guard range](Fixed-or-Improved-Logics.md#target-scan-guard-range-customizations) (by Starkku)
542+
- Spawns particle when spawns tiberium by terrain (by NetsuNegi)
543+
- Allow jumpjet climbing ignore building height (by TaranDahl)
544+
- Allow draw SuperWeapon timer as percentage (by NetsuNegi)
542545
543546
Vanilla fixes:
544547
- Fixed sidebar not updating queued unit numbers when adding or removing units when the production is on hold (by CrimRecya)
@@ -596,6 +599,8 @@ Vanilla fixes:
596599
- Fixed the issue where units recruited by a team with `AreTeamMembersRecruitable=false` cannot be recruited even if they have been liberated by that team (by TaranDahl)
597600
- Fixed the bug that cause technos teleport to cell 0,0 by ChronoSphere superweapon (by NetsuNegi)
598601
- Fixed the bug that techno in attack move will move to target if it cannot attack it (by NetsuNegi)
602+
- Fixed the bug in AI scripts 56 and 57 that forced the launch of superweapons with index numbers 3 and 4 (by FlyStar)
603+
- Buildings with `NeedsEngineer=true` are now considered to have threat value of 0 under ownership of `MultiplayPassive=true` houses regardless of their `ThreatPosed` value (by Starkku)
599604
600605
Phobos fixes:
601606
- Fixed the bug that `AllowAirstrike=no` cannot completely prevent air strikes from being launched against it (by NetsuNegi)
@@ -623,6 +628,7 @@ Phobos fixes:
623628
- LimboDelivery buildings cannot be selected (by FlyStar)
624629
- Fixed the positive value of `Reveal` on warhead (by NetsuNegi)
625630
- Fixed `Adjacent.Disallowed` not blocking placement if other eligible buildings were in range (by Starkku)
631+
- Fixed the issue where `AIChronoSphereSW` and `AIChronoWarpSW` did not function correctly with AI scripts 56 and 57 (by FlyStar)
626632
627633
Fixes / interactions with other extensions:
628634
<!-- - Allowed `AuxBuilding` and Ares' `SW.Aux/NegBuildings` to count building upgrades (by Ollerus) -->

src/Ext/BuildingType/Body.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,8 @@ void BuildingTypeExt::ExtData::LoadFromINIFile(CCINIClass* const pINI)
181181
this->NoBuildAreaOnBuildup.Read(exINI, pSection, "NoBuildAreaOnBuildup");
182182
this->Adjacent_Allowed.Read(exINI, pSection, "Adjacent.Allowed");
183183
this->Adjacent_Disallowed.Read(exINI, pSection, "Adjacent.Disallowed");
184-
this->Adjacent_Disallowed_ExtraDistance.Read(exINI, pSection, "Adjacent.Disallowed.ExtraDistance");
184+
this->Adjacent_Disallowed_Prohibit.Read(exINI, pSection, "Adjacent.Disallowed.Prohibit");
185+
this->Adjacent_Disallowed_ProhibitDistance.Read(exINI, pSection, "Adjacent.Disallowed.ProhibitDistance");
185186

186187
this->BarracksExitCell.Read(exINI, pSection, "BarracksExitCell");
187188

@@ -334,8 +335,9 @@ void BuildingTypeExt::ExtData::Serialize(T& Stm)
334335
.Process(this->Units_UseRepairCost)
335336
.Process(this->NoBuildAreaOnBuildup)
336337
.Process(this->Adjacent_Allowed)
337-
.Process(this->Adjacent_Disallowed_ExtraDistance)
338338
.Process(this->Adjacent_Disallowed)
339+
.Process(this->Adjacent_Disallowed_Prohibit)
340+
.Process(this->Adjacent_Disallowed_ProhibitDistance)
339341
.Process(this->BarracksExitCell)
340342
.Process(this->Overpower_KeepOnline)
341343
.Process(this->Overpower_ChargeWeapon)

src/Ext/BuildingType/Body.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,8 @@ class BuildingTypeExt
7777
Valueable<bool> NoBuildAreaOnBuildup;
7878
ValueableVector<BuildingTypeClass*> Adjacent_Allowed;
7979
ValueableVector<BuildingTypeClass*> Adjacent_Disallowed;
80-
Valueable<int> Adjacent_Disallowed_ExtraDistance;
80+
Valueable<bool> Adjacent_Disallowed_Prohibit;
81+
Valueable<int> Adjacent_Disallowed_ProhibitDistance;
8182

8283
Nullable<Point2D> BarracksExitCell;
8384

@@ -160,7 +161,8 @@ class BuildingTypeExt
160161
, NoBuildAreaOnBuildup { false }
161162
, Adjacent_Allowed {}
162163
, Adjacent_Disallowed {}
163-
, Adjacent_Disallowed_ExtraDistance { 0 }
164+
, Adjacent_Disallowed_Prohibit { false }
165+
, Adjacent_Disallowed_ProhibitDistance { 0 }
164166
, BarracksExitCell {}
165167
, Overpower_KeepOnline { 2 }
166168
, Overpower_ChargeWeapon { 1 }

src/Ext/BuildingType/Hooks.cpp

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ DEFINE_HOOK(0x5F5416, ObjectClass_ReceiveDamage_CanC4DamageRounding, 0x6)
194194

195195
namespace ProximityTemp
196196
{
197-
int ExtraDistance = 0;
197+
int DistanceOverride = 0;
198198
bool SkipDisallowed = false;
199199
BuildingTypeClass* pType = nullptr;
200200
}
@@ -205,29 +205,30 @@ DEFINE_HOOK(0x4A8F3E, DisplayClass_BuildingProximityCheck_BeforeChecks, 0x6)
205205

206206
GET(BuildingTypeClass*, pType, ESI);
207207
GET_STACK(const int, houseArrayIndex, STACK_OFFSET(0x30, 0x8));
208-
LEA_STACK(CellStruct*, foundationData, STACK_OFFSET(0x30, 0xC));
209-
LEA_STACK(CellStruct*, currentPosition, STACK_OFFSET(0x30, 0x10));
208+
GET_STACK(CellStruct*, foundationData, STACK_OFFSET(0x30, 0xC));
209+
GET_STACK(CellStruct*, currentPosition, STACK_OFFSET(0x30, 0x10));
210210

211211
auto const pTypeExt = BuildingTypeExt::ExtMap.Find(pType);
212212
ProximityTemp::pType = pType;
213213
ProximityTemp::SkipDisallowed = false;
214214

215-
if (pTypeExt->Adjacent_Disallowed_ExtraDistance != 0 && ProximityTemp::ExtraDistance == 0)
215+
if (pTypeExt->Adjacent_Disallowed_Prohibit && pTypeExt->Adjacent_Disallowed_ProhibitDistance > 0 && ProximityTemp::DistanceOverride == 0)
216216
{
217-
ProximityTemp::ExtraDistance = pTypeExt->Adjacent_Disallowed_ExtraDistance;
217+
ProximityTemp::DistanceOverride = pTypeExt->Adjacent_Disallowed_ProhibitDistance;
218+
bool result = DisplayClass::Instance.PassesProximityCheck(pType, houseArrayIndex, foundationData, currentPosition);
219+
ProximityTemp::DistanceOverride = 0;
218220

219-
if (!DisplayClass::Instance.PassesProximityCheck(pType, houseArrayIndex, foundationData, currentPosition))
221+
if (!result)
220222
{
221223
R->EAX(false);
222224
return ReturnFromFunction;
223225
}
224226

225-
ProximityTemp::ExtraDistance = 0;
226227
ProximityTemp::SkipDisallowed = true;
227228
}
228229

229-
R->EAX(pType->Adjacent + ProximityTemp::ExtraDistance);
230-
230+
int distance = ProximityTemp::DistanceOverride > 0 ? ProximityTemp::DistanceOverride : pType->Adjacent;
231+
R->EAX(distance);
231232
return SkipGameCode;
232233
}
233234

@@ -255,8 +256,15 @@ DEFINE_HOOK(0x4A8FD7, DisplayClass_BuildingProximityCheck_BuildArea, 0x6)
255256

256257
if (pBuildingsDisallowed.size() > 0 && pBuildingsDisallowed.Contains(pCellBuilding->Type))
257258
{
258-
R->EAX(false);
259-
return ReturnFromFunction;
259+
if (pTmpTypeExt->Adjacent_Disallowed_Prohibit)
260+
{
261+
R->EAX(false);
262+
return ReturnFromFunction;
263+
}
264+
else
265+
{
266+
return SkipBuilding;
267+
}
260268
}
261269
}
262270

src/Ext/Rules/Body.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ void RulesExt::ExtData::LoadBeforeTypeData(RulesClass* pThis, CCINIClass* pINI)
112112
this->PlacementPreview.Read(exINI, GameStrings::AudioVisual, "PlacementPreview");
113113
this->PlacementPreview_Translucency.Read(exINI, GameStrings::AudioVisual, "PlacementPreview.Translucency");
114114

115+
this->SuperWeaponTimer_Percentage.Read(exINI, GameStrings::AudioVisual, "SuperWeaponTimer.Percentage");
115116
this->SuperWeaponSidebar_AllowByDefault.Read(exINI, GameStrings::AudioVisual, "SuperWeaponSidebar.AllowByDefault");
116117

117118
this->ConditionYellow_Terrain.Read(exINI, GameStrings::AudioVisual, "ConditionYellow.Terrain");
@@ -238,6 +239,7 @@ void RulesExt::ExtData::LoadBeforeTypeData(RulesClass* pThis, CCINIClass* pINI)
238239

239240
this->JumpjetClimbPredictHeight.Read(exINI, GameStrings::General, "JumpjetClimbPredictHeight");
240241
this->JumpjetClimbWithoutCutOut.Read(exINI, GameStrings::General, "JumpjetClimbWithoutCutOut");
242+
this->JumpjetClimbIgnoreBuilding.Read(exINI, GameStrings::General, "JumpjetClimbIgnoreBuilding");
241243

242244
this->DamageOwnerMultiplier.Read(exINI, GameStrings::CombatDamage, "DamageOwnerMultiplier");
243245
this->DamageAlliesMultiplier.Read(exINI, GameStrings::CombatDamage, "DamageAlliesMultiplier");
@@ -472,6 +474,7 @@ void RulesExt::ExtData::Serialize(T& Stm)
472474
.Process(this->PlacementGrid_TranslucencyWithPreview)
473475
.Process(this->PlacementPreview)
474476
.Process(this->PlacementPreview_Translucency)
477+
.Process(this->SuperWeaponTimer_Percentage)
475478
.Process(this->SuperWeaponSidebar_AllowByDefault)
476479
.Process(this->ConditionYellow_Terrain)
477480
.Process(this->Shield_ConditionYellow)
@@ -571,6 +574,7 @@ void RulesExt::ExtData::Serialize(T& Stm)
571574
.Process(this->PodImage)
572575
.Process(this->JumpjetClimbPredictHeight)
573576
.Process(this->JumpjetClimbWithoutCutOut)
577+
.Process(this->JumpjetClimbIgnoreBuilding)
574578
.Process(this->DamageOwnerMultiplier)
575579
.Process(this->DamageAlliesMultiplier)
576580
.Process(this->DamageEnemiesMultiplier)

0 commit comments

Comments
 (0)