Added anim frame range support for buildings in rules.ini. Added prism tower.

This commit is contained in:
Justin Marshall
2020-08-02 18:26:40 -07:00
parent dff22b0d9f
commit 19b9cb16f8
6 changed files with 99 additions and 2 deletions
BIN
View File
Binary file not shown.
+41
View File
@@ -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;
+12 -2
View File
@@ -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);
}
+2
View File
@@ -1477,6 +1477,8 @@ typedef enum StructType : char {
#ifdef RA_AF
STRUCT_AFV01,
#endif
STRUCT_PRISOM,
STRUCT_COUNT,
STRUCT_FIRST=0
} StructType;
+8
View File
@@ -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:
/*
+36
View File
@@ -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]