diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index c3b65cd35f..bea505fedd 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -15,7 +15,7 @@ env: jobs: build: - runs-on: windows-latest + runs-on: windows-2019 steps: - uses: actions/checkout@v2 diff --git a/Phobos.vcxproj b/Phobos.vcxproj index 4c154c045b..206bb87e0e 100644 --- a/Phobos.vcxproj +++ b/Phobos.vcxproj @@ -175,7 +175,7 @@ 15.0 {3FAF7126-F38C-4D1E-9973-C21A37870F60} Phobos - 10.0 + 7.0 Phobos diff --git a/README.md b/README.md index cb8aa6d64a..6a273d3bbe 100644 --- a/README.md +++ b/README.md @@ -95,7 +95,7 @@ Credits - **4SG** - help with docs - **wiktorderelf** - overhauled Unicode font - **Uranusian (Thrifinesma)** - Mind Control enhancement, custom warhead splash list, harvesters counter, promoted spawns, shields, death after dead fix, customizeable missing cameo, cameo sorting priority, placement mode responding of tab hotkeys fix, producing progress, custom ore gathering anim, NoManualMove, weapon target house filtering, DeathWeapon fix, re-enable obsolete `JumpjetControls`, AITrigger Building Upgrades recognition, Wall-Gate links, deployed infantry using both weapons, overhauled Unicode font, docs maintenance, CN docs translation -- **secsome (SEC-SOME)** - debug info dump hotkey, refactoring & porting of Ares helper code, introducing more Ares-derived stuff, disguise removal warhead, Mind Control removal warhead, Mind Control enhancement, shields, AnimList.PickRandom, MoveToCell fix, unlimited waypoints, Build At trigger action buildup anim fix, Undeploy building into a unit plays `EVA_NewRallyPointEstablished` fix, custom ore gathering anim, TemporaryClass related crash, Retry dialog on mission failure, Default disguise for individual InfantryTypes, PowerPlant Enhancer, SaveGame Trigger Action, QuickSave command, Numeric variables, Custom gravity for projectiles, Retint map actions bugfix +- **secsome (SEC-SOME)** - debug info dump hotkey, refactoring & porting of Ares helper code, introducing more Ares-derived stuff, disguise removal warhead, Mind Control removal warhead, Mind Control enhancement, shields, AnimList.PickRandom, MoveToCell fix, unlimited waypoints, Build At trigger action buildup anim fix, Undeploy building into a unit plays `EVA_NewRallyPointEstablished` fix, custom ore gathering anim, TemporaryClass related crash, Retry dialog on mission failure, Default disguise for individual InfantryTypes, PowerPlant Enhancer, SaveGame Trigger Action, QuickSave command, Numeric variables, Custom gravity for projectiles, Retint map actions bugfix, Sharpnel enhancement - **Otamaa (Fahroni, BoredEXE)** - help with CellSpread, ported and fixed custom RadType code, togglable ElectricBolt bolts, customizable Chrono Locomotor properties per TechnoClass, DebrisMaximums fixes, Anim-to-Unit, NotHuman anim sequences improvements, Customizable OpenTopped Properties, hooks for ScriptType Actions 92 & 93, ore stage threshold for `HideIfNoOre`, occupied building `MuzzleFlashX` bugfix,`EnemyUIName=` for other TechnoTypes, TerrainType `DestroyAnim` & `DestroySound` - **E1 Elite** - TileSet 255 and above bridge repair fix - **FS-21** - Dump Object Info enhancements, Powered.KillSpawns, Spawner.LimitRange, ScriptType Actions 71 to 113, MC deployer fixes, help with docs, Automatic Passenger Deletion, Customize resource storage diff --git a/YRpp b/YRpp index 7c7a04b939..edebf4aeb7 160000 --- a/YRpp +++ b/YRpp @@ -1 +1 @@ -Subproject commit 7c7a04b9398a2c193dc3f962ded866296ede05a4 +Subproject commit edebf4aeb7f173d151ffb10d158bbc3b25bcbf4b diff --git a/docs/New-or-Enhanced-Logics.md b/docs/New-or-Enhanced-Logics.md index 5227d73bbb..9342c09624 100644 --- a/docs/New-or-Enhanced-Logics.md +++ b/docs/New-or-Enhanced-Logics.md @@ -627,6 +627,14 @@ Interceptor.EliteMinimumGuardRange=0.0 ; double Interceptable=no ; boolean ``` +### Shrapnel enhancement +- Shrapnel behavior can be triggered on the ground and buildings. + +In `rulesmd.ini` +[SOMEPROJECTILE] ; Projectile +Shrapnel.AffectsGround=no ; boolean +Shrapnel.AffectsBuildings=no ; boolean + ## Trigger events ### `500-511` Variable comparation diff --git a/docs/Whats-New.md b/docs/Whats-New.md index 3399125190..7f9e4e6a00 100644 --- a/docs/Whats-New.md +++ b/docs/Whats-New.md @@ -231,7 +231,8 @@ New: - Quicksave hotkey command (by secsome) - Save Game Trigger Action (by secsome) - Numeric Variables (by secsome) -- TechnoType's tooltip would display it's build time now (by secsome) +- TechnoType's tooltip would display it's build time now (by secsome) +- Sharpnel enhancement (by secsome) - Allow `NotHuman=yes` infantry to use random `Death` anim sequence (by Otamaa) - Ability for warheads to trigger specific `NotHuman=yes` infantry `Death` anim sequence (by Otamaa) - XDrawOffset for animations (by Morton) diff --git a/src/Ext/Bullet/Hooks.cpp b/src/Ext/Bullet/Hooks.cpp index 56273abe9d..93e585d422 100644 --- a/src/Ext/Bullet/Hooks.cpp +++ b/src/Ext/Bullet/Hooks.cpp @@ -175,4 +175,23 @@ DEFINE_HOOK(0x6FF031, TechnoClass_FireAt_ReverseVelocityWhileGravityIsZero, 0xA) } return 0; +} + +DEFINE_HOOK(0x46A3D6, BulletClass_Shrapnel_Forced, 0xA) +{ + enum { Shrapnel = 0x46A40C, Skip = 0x46ADCD }; + + GET(BulletClass*, pBullet, EDI); + + auto const pData = BulletTypeExt::ExtMap.Find(pBullet->Type); + + if (auto const pObject = pBullet->GetCell()->FirstObject) + { + if (pObject->WhatAmI() != AbstractType::Building || pData->Shrapnel_AffectsBuildings) + return Shrapnel; + } + else if (pData->Shrapnel_AffectsGround) + return Shrapnel; + + return Skip; } \ No newline at end of file diff --git a/src/Ext/BulletType/Body.cpp b/src/Ext/BulletType/Body.cpp index fc126b8109..74b1203235 100644 --- a/src/Ext/BulletType/Body.cpp +++ b/src/Ext/BulletType/Body.cpp @@ -26,6 +26,8 @@ void BulletTypeExt::ExtData::LoadFromINIFile(CCINIClass* const pINI) this->Interceptable.Read(exINI, pSection, "Interceptable"); this->Gravity.Read(exINI, pSection, "Gravity"); this->Gravity_HeightFix.Read(exINI, pSection, "Gravity.HeightFix"); + this->Shrapnel_AffectsGround.Read(exINI, pSection, "Shrapnel.AffectsGround"); + this->Shrapnel_AffectsBuildings.Read(exINI, pSection, "Shrapnel.AffectsBuildings"); INI_EX exArtINI(CCINIClass::INI_Art); @@ -43,6 +45,8 @@ void BulletTypeExt::ExtData::Serialize(T& Stm) .Process(this->LaserTrail_Types) .Process(this->Gravity) .Process(this->Gravity_HeightFix) + .Process(this->Shrapnel_AffectsGround) + .Process(this->Shrapnel_AffectsBuildings) ; } diff --git a/src/Ext/BulletType/Body.h b/src/Ext/BulletType/Body.h index 2dddedb24a..b10e54e119 100644 --- a/src/Ext/BulletType/Body.h +++ b/src/Ext/BulletType/Body.h @@ -19,12 +19,16 @@ class BulletTypeExt ValueableIdxVector LaserTrail_Types; Nullable Gravity; Valueable Gravity_HeightFix; + Valueable Shrapnel_AffectsGround; + Valueable Shrapnel_AffectsBuildings; ExtData(BulletTypeClass* OwnerObject) : Extension(OwnerObject) , Interceptable { false } , LaserTrail_Types {} , Gravity {} , Gravity_HeightFix { false } + , Shrapnel_AffectsGround { false } + , Shrapnel_AffectsBuildings { false } { } virtual ~ExtData() = default;