Initial Prism zap support.

This commit is contained in:
Justin Marshall
2020-08-04 10:49:25 -07:00
parent 6ee6c84777
commit cbd359e387
7 changed files with 42 additions and 2 deletions
+11
View File
@@ -67,6 +67,17 @@ void GL_ResetClipRect(void) {
ImGui::GetBackgroundDrawList()->PopClipRect();
}
void GL_RenderLine(int x1, int y1, int x2, int y2, int r, int g, int b, float thickness) {
ImVec2 p1(x1, y1);
ImVec2 p2(x2, y2);
float _r = r / 255.0f;
float _g = g / 255.0f;
float _b = b / 255.0f;
ImGui::GetBackgroundDrawList()->AddLine(p1, p2, ImGui::ColorConvertFloat4ToU32(ImVec4(_r, _g, _b, 1)), thickness);
}
void GL_RenderImage(Image_t* image, int x, int y, int width, int height, int colorRemap, int shapeId, bool ignoreOutOfScreenPixels, bool flipUV) {
if (!ignoreOutOfScreenPixels)
{
+2 -1
View File
@@ -24,4 +24,5 @@ void GL_DrawForegroundText(int color, float fontsize, float r, float g, float b,
void GL_SetColor(float r, float g, float b);
void GL_SetRenderTexture(RenderTexture* renderTexture);
void GL_EnableBlend(GLBlendType blendType);
void GL_DrawText(int color, float fontsize, float r, float g, float b, int x, int y, char* text);
void GL_DrawText(int color, float fontsize, float r, float g, float b, int x, int y, char* text);
void GL_RenderLine(int x1, int y1, int x2, int y2, int r, int g, int b, float thickness);
+2
View File
@@ -703,6 +703,8 @@ bool RulesClass::Heap_Maximums(CCINIClass & ini)
new WeaponTypeClass("AirAssault");
#endif
new WeaponTypeClass("PrismZap");
return(true);
}
+10
View File
@@ -3023,6 +3023,15 @@ bool TechnoClass::Electric_Zap(COORDINATE target_coord, int which, WindowNumberT
gonnadraw = true;
}
TechnoTypeClass const& tclass = *Techno_Type_Class();
WeaponTypeClass const* weapon = (which == 0) ? tclass.PrimaryWeapon : tclass.SecondaryWeapon;
if (weapon->Prism) {
CellClass::ConvertCoordsToIsometric(x, y);
CellClass::ConvertCoordsToIsometric(x1, y1);
GL_RenderLine(x, y, x1, y1, 163, 203, 205, 3.0f);
return true;
}
static int _shape[]={ 2, 3, 1, 0, 2, 3, 1, 0};
static int _xadd[8][8]={
{ 0, 8, 8, 8, 0, 0, 0, 0},
@@ -3091,6 +3100,7 @@ bool TechnoClass::Electric_Zap(COORDINATE target_coord, int which, WindowNumberT
int xx = x;
int yy = y;
CellClass::ConvertCoordsToIsometric(xx, yy);
if (remap != NULL) {
CC_Draw_Shape(this, "LITNING", LightningShapes, _shape[facing]+(shots ? 4 : 0), xx, yy, (window != WINDOW_PARTIAL) ? window : WINDOW_TACTICAL, SHAPE_FADING|SHAPE_CENTER|SHAPE_WIN_REL, remap);
} else {
+1
View File
@@ -211,6 +211,7 @@ bool WeaponTypeClass::Read_INI(CCINIClass & ini)
Anim = ini.Get_AnimType(Name(), "Anim", Anim);
IsCamera = ini.Get_Bool(Name(), "Camera", IsCamera);
IsElectric = ini.Get_Bool(Name(), "Charges", IsElectric);
Prism = ini.Get_Bool(Name(), "Prism", 0);
IsTurboBoosted = ini.Get_Bool(Name(), "TurboBoost", IsTurboBoosted);
WarheadType wtype = (WarheadPtr != NULL) ? WarheadType(WarheadPtr->ID) : WARHEAD_NONE;
+3
View File
@@ -154,6 +154,9 @@ class WeaponTypeClass
** This is the animation to display at the firing coordinate.
*/
AnimType Anim;
// Is this a prism weapon.
unsigned Prism:1;
};
+13 -1
View File
@@ -1433,7 +1433,7 @@ ActiveAnimDamagedFrames=41
; Pirsm Tower
[GGPRIS]
Primary=TeslaZap
Primary=PrismZap
Strength=400
Armor=heavy
TechLevel=1
@@ -2383,6 +2383,18 @@ Warhead=Super
Report=TESLA1
Charges=yes
; Prisom zap
[PrismZap]
Damage=100
ROF=120
Range=8.5
Projectile=Invisible
Speed=100
Warhead=Super
Report=TESLA1
Charges=yes
Prism=1
; anti-aircraft missile (fired from SAM site)
[Nike]
Damage=50