diff --git a/EXPAND3.mix b/EXPAND3.mix index b35e568..fccbcde 100644 Binary files a/EXPAND3.mix and b/EXPAND3.mix differ diff --git a/code/redalert/bdata.cpp b/code/redalert/bdata.cpp index b3808d3..1da4f3d 100644 --- a/code/redalert/bdata.cpp +++ b/code/redalert/bdata.cpp @@ -568,6 +568,36 @@ static BuildingTypeClass const ClassTesla( (short const *)OList12 // OVERLAPLIST:List of overlap cell offset. ); +static BuildingTypeClass const ClassPrisom( + STRUCT_PRISOM, + TXT_TESLA, // NAME: Short name of the structure. + "GGPRIS", // NAME: Short name of the structure. + FACING_S, // Foundation direction from center of building. + XYP_COORD(0, 0), // Exit point for produced units. + REMAP_ALTERNATE, // Sidebar remap logic. + 0x00C8, // Vertical offset. + 0x0000, // Primary weapon offset along turret centerline. + 0x0000, // Primary weapon lateral offset along turret centerline. + false, // Is this building a fake (decoy?) + false, // Animation rate is regulated for constant speed? + false, // Always use the given name for the building? + false, // Is this a wall type structure? + false, // Simple (one frame) damage imagery? + false, // Is it invisible to radar? + true, // Can the player select this? + true, // Is this a legal target for attack or move? + false, // Is this an insignificant building? + false, // Theater specific graphic image? + false, // Does it have a rotating turret? + true, // Can the building be color remapped to indicate owner? + RTTI_NONE, // The object type produced at this factory. + DIR_N, // Starting idle frame to match construction. + BSIZE_12, // SIZE: Building size. + NULL, // Preferred exit cell list. + (short const*)List12, // OCCUPYLIST: List of active foundation squares. + (short const*)OList12 // OVERLAPLIST:List of overlap cell offset. +); + static BuildingTypeClass const ClassTurret( STRUCT_TURRET, TXT_TURRET, // NAME: Short name of the structure. @@ -3133,6 +3163,8 @@ void BuildingTypeClass::Init_Heap(void) #ifdef RA_AF new BuildingTypeClass(ClassAFV01); // STRUCT_AFV01 #endif + + new BuildingTypeClass(ClassPrisom); } Image_t* BuildingTypeClass::LoadHDImage(const char* fullname, int& numHDShapes, bool remapHouse) { @@ -4052,6 +4084,15 @@ bool BuildingTypeClass::Read_INI(CCINIClass & ini) ActiveAnimAnimShape = MFCD::Retrieve(ConstructAnimName); } + IdleAnimNonDamagedStart = ini.Get_Int(Name(), "IdleAnimNonDamagedStart", -1); + IdleAnimNonDamagedFrames = ini.Get_Int(Name(), "IdleAnimNonDamagedFrames", -1); + IdleAnimDamagedStart = ini.Get_Int(Name(), "IdleAnimDamagedStart", -1); + IdleAnimDamagedFrames = ini.Get_Int(Name(), "IdleAnimDamagedFrames", -1); + ActiveAnimNonDamagedStart = ini.Get_Int(Name(), "ActiveAnimNonDamagedStart", -1); + ActiveAnimNonDamagedFrames = ini.Get_Int(Name(), "ActiveAnimNonDamagedFrames", -1); + ActiveAnimDamagedStart = ini.Get_Int(Name(), "ActiveAnimDamagedStart", -1); + ActiveAnimDamagedFrames = ini.Get_Int(Name(), "ActiveAnimDamagedFrames", -1); + if (Power < 0) { Drain = -Power; Power = 0; diff --git a/code/redalert/building.cpp b/code/redalert/building.cpp index cc9f27e..6bb4c89 100644 --- a/code/redalert/building.cpp +++ b/code/redalert/building.cpp @@ -505,13 +505,23 @@ void BuildingClass::Draw_It(int x, int y, WindowNumberType window) const // jmarshall idle/construction animation if (Class->IdleAnimShape != NULL) { int shapeNum = animFrameNum; - shapeNum = shapeNum % Get_Build_Frame_Count(Class->IdleAnimShape); + int maxframes = Get_Build_Frame_Count(Class->IdleAnimShape); + if (Class->IdleAnimNonDamagedFrames != -1) { + maxframes = Class->IdleAnimNonDamagedFrames; + } + + shapeNum = shapeNum % maxframes; Techno_Draw_Object(Class->IdleAnimShape, shapeNum, x, y, window); } if (BState == BSTATE_ACTIVE && Class->ActiveAnimAnimShape != NULL) { int shapeNum = Shape_Number(); - shapeNum = shapeNum % Get_Build_Frame_Count(Class->ActiveAnimAnimShape); + int maxframes = Get_Build_Frame_Count(Class->ActiveAnimAnimShape); + if (Class->ActiveAnimNonDamagedFrames != -1) { + maxframes = Class->ActiveAnimNonDamagedFrames; + } + + shapeNum = shapeNum % maxframes; Techno_Draw_Object(Class->ActiveAnimAnimShape, shapeNum, x, y, window); } diff --git a/code/redalert/defines.h b/code/redalert/defines.h index dc13015..5595f1a 100644 --- a/code/redalert/defines.h +++ b/code/redalert/defines.h @@ -1477,6 +1477,8 @@ typedef enum StructType : char { #ifdef RA_AF STRUCT_AFV01, #endif + STRUCT_PRISOM, + STRUCT_COUNT, STRUCT_FIRST=0 } StructType; diff --git a/code/redalert/type.h b/code/redalert/type.h index bd44842..cc4e31c 100644 --- a/code/redalert/type.h +++ b/code/redalert/type.h @@ -821,6 +821,14 @@ class BuildingTypeClass : public TechnoTypeClass { const void* CustomTheatrePalette[3]; const void* IdleAnimShape; const void* ActiveAnimAnimShape; + int IdleAnimNonDamagedStart; + int IdleAnimNonDamagedFrames; + int IdleAnimDamagedStart; + int IdleAnimDamagedFrames; + int ActiveAnimNonDamagedStart; + int ActiveAnimNonDamagedFrames; + int ActiveAnimDamagedStart; + int ActiveAnimDamagedFrames; private: /* diff --git a/rules.ini b/rules.ini index 427752d..318dea8 100644 --- a/rules.ini +++ b/rules.ini @@ -1422,6 +1422,42 @@ Snow=eapal1sno.pal Temperate=eapal1tem.pal IdleAnim=EACNST_A.SHP ActiveAnim=EACNST_WORKING.SHP +IdleAnimNonDamagedStart=0 +IdleAnimNonDamagedFrames=6 +IdleAnimDamagedStart=0 +IdleAnimDamagedFrames=6 +ActiveAnimNonDamagedStart=0 +ActiveAnimNonDamagedFrames=41 +ActiveAnimDamagedStart=0 +ActiveAnimDamagedFrames=41 + +; Tesla coil +[GGPRIS] +Primary=TeslaZap +Strength=400 +Armor=heavy +TechLevel=1 +Sight=8 +Owner=allies +Cost=5 +Points=80 +Power=-10 +Ammo=3 +Powered=true +Sensors=yes +Crewed=yes +IdleAnim=GGPRIS_B.SHP +ActiveAnim=GGPRIS_A.SHP +Snow=eapal1sno.pal +Temperate=eapal1tem.pa +IdleAnimNonDamagedStart=0 +IdleAnimNonDamagedFrames=8 +IdleAnimDamagedStart=9 +IdleAnimDamagedFrames=8 +ActiveAnimNonDamagedStart=0 +ActiveAnimNonDamagedFrames=9 +ActiveAnimDamagedStart=10 +ActiveAnimDamagedFrames=9 ; refinery [PROC]