mirror of
https://github.com/jmarshall23/CnC_Remastered_Collection.git
synced 2026-08-12 08:00:55 +02:00
Added anim frame range support for buildings in rules.ini. Added prism tower.
This commit is contained in:
BIN
Binary file not shown.
@@ -568,6 +568,36 @@ static BuildingTypeClass const ClassTesla(
|
|||||||
(short const *)OList12 // OVERLAPLIST:List of overlap cell offset.
|
(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(
|
static BuildingTypeClass const ClassTurret(
|
||||||
STRUCT_TURRET,
|
STRUCT_TURRET,
|
||||||
TXT_TURRET, // NAME: Short name of the structure.
|
TXT_TURRET, // NAME: Short name of the structure.
|
||||||
@@ -3133,6 +3163,8 @@ void BuildingTypeClass::Init_Heap(void)
|
|||||||
#ifdef RA_AF
|
#ifdef RA_AF
|
||||||
new BuildingTypeClass(ClassAFV01); // STRUCT_AFV01
|
new BuildingTypeClass(ClassAFV01); // STRUCT_AFV01
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
new BuildingTypeClass(ClassPrisom);
|
||||||
}
|
}
|
||||||
|
|
||||||
Image_t* BuildingTypeClass::LoadHDImage(const char* fullname, int& numHDShapes, bool remapHouse) {
|
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);
|
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) {
|
if (Power < 0) {
|
||||||
Drain = -Power;
|
Drain = -Power;
|
||||||
Power = 0;
|
Power = 0;
|
||||||
|
|||||||
@@ -505,13 +505,23 @@ void BuildingClass::Draw_It(int x, int y, WindowNumberType window) const
|
|||||||
// jmarshall idle/construction animation
|
// jmarshall idle/construction animation
|
||||||
if (Class->IdleAnimShape != NULL) {
|
if (Class->IdleAnimShape != NULL) {
|
||||||
int shapeNum = animFrameNum;
|
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);
|
Techno_Draw_Object(Class->IdleAnimShape, shapeNum, x, y, window);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (BState == BSTATE_ACTIVE && Class->ActiveAnimAnimShape != NULL) {
|
if (BState == BSTATE_ACTIVE && Class->ActiveAnimAnimShape != NULL) {
|
||||||
int shapeNum = Shape_Number();
|
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);
|
Techno_Draw_Object(Class->ActiveAnimAnimShape, shapeNum, x, y, window);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1477,6 +1477,8 @@ typedef enum StructType : char {
|
|||||||
#ifdef RA_AF
|
#ifdef RA_AF
|
||||||
STRUCT_AFV01,
|
STRUCT_AFV01,
|
||||||
#endif
|
#endif
|
||||||
|
STRUCT_PRISOM,
|
||||||
|
|
||||||
STRUCT_COUNT,
|
STRUCT_COUNT,
|
||||||
STRUCT_FIRST=0
|
STRUCT_FIRST=0
|
||||||
} StructType;
|
} StructType;
|
||||||
|
|||||||
@@ -821,6 +821,14 @@ class BuildingTypeClass : public TechnoTypeClass {
|
|||||||
const void* CustomTheatrePalette[3];
|
const void* CustomTheatrePalette[3];
|
||||||
const void* IdleAnimShape;
|
const void* IdleAnimShape;
|
||||||
const void* ActiveAnimAnimShape;
|
const void* ActiveAnimAnimShape;
|
||||||
|
int IdleAnimNonDamagedStart;
|
||||||
|
int IdleAnimNonDamagedFrames;
|
||||||
|
int IdleAnimDamagedStart;
|
||||||
|
int IdleAnimDamagedFrames;
|
||||||
|
int ActiveAnimNonDamagedStart;
|
||||||
|
int ActiveAnimNonDamagedFrames;
|
||||||
|
int ActiveAnimDamagedStart;
|
||||||
|
int ActiveAnimDamagedFrames;
|
||||||
private:
|
private:
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -1422,6 +1422,42 @@ Snow=eapal1sno.pal
|
|||||||
Temperate=eapal1tem.pal
|
Temperate=eapal1tem.pal
|
||||||
IdleAnim=EACNST_A.SHP
|
IdleAnim=EACNST_A.SHP
|
||||||
ActiveAnim=EACNST_WORKING.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
|
; refinery
|
||||||
[PROC]
|
[PROC]
|
||||||
|
|||||||
Reference in New Issue
Block a user