Vinifera-Developers / Vinifera

Vinifera is a C&C: Tiberian Sun engine extension implementing new logics and fixing bugs.
GNU General Public License v3.0
46 stars 10 forks source link

[New Feature] Recoil support for objects with SHP turrets #142

Open Rampastring opened 3 years ago

Rampastring commented 3 years ago

Description:

When turreted objects fire in Red Alert 1, their turrets move back by 1 pixel to simulate a recoil effect. This is no longer the case in Tiberian Sun.

Possible Implementation:

Red Alert 1 has a check for IsInRecoilState in UnitClass::Draw_It: https://github.com/electronicarts/CnC_Remastered_Collection/blob/master/REDALERT/UNIT.CPP#L2197

The recoil state is toggled by the object firing, and toggled off with a frame-based timer.

Looking at TS++, IsInRecoilState still exists for TechnoTypes, but I guess it's unused? https://github.com/Vinifera-Developers/TSpp/blob/master/src/techno.h#L307

tomsons26 commented 3 years ago

Its handled for Voxel units at 0065299F by translating the Matrix of the turret -2.0 back on X, indeed gone for SHP units In YR recoil is handled by a whole dedicated class so probably not as simple as bringing back Recoil_Adjust