diff --git a/code/redalert/newblit.cpp b/code/redalert/newblit.cpp index be8c622..27a0046 100644 --- a/code/redalert/newblit.cpp +++ b/code/redalert/newblit.cpp @@ -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) { diff --git a/code/redalert/newblit.h b/code/redalert/newblit.h index 503f816..29adaf8 100644 --- a/code/redalert/newblit.h +++ b/code/redalert/newblit.h @@ -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); \ No newline at end of file +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); \ No newline at end of file diff --git a/code/redalert/rules.cpp b/code/redalert/rules.cpp index 7c49413..e166e98 100644 --- a/code/redalert/rules.cpp +++ b/code/redalert/rules.cpp @@ -703,6 +703,8 @@ bool RulesClass::Heap_Maximums(CCINIClass & ini) new WeaponTypeClass("AirAssault"); #endif + new WeaponTypeClass("PrismZap"); + return(true); } diff --git a/code/redalert/techno.cpp b/code/redalert/techno.cpp index e92e4cb..28f35ab 100644 --- a/code/redalert/techno.cpp +++ b/code/redalert/techno.cpp @@ -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 { diff --git a/code/redalert/weapon.cpp b/code/redalert/weapon.cpp index 6eb90db..604ce1f 100644 --- a/code/redalert/weapon.cpp +++ b/code/redalert/weapon.cpp @@ -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; diff --git a/code/redalert/weapon.h b/code/redalert/weapon.h index 966d5c9..4b21281 100644 --- a/code/redalert/weapon.h +++ b/code/redalert/weapon.h @@ -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; }; diff --git a/rules.ini b/rules.ini index 893e9d3..703d0ba 100644 --- a/rules.ini +++ b/rules.ini @@ -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