Soviets will now have paratroopers at the start of soviet mission 1, modified lua GiveSpecialWeapon and super code to allow perputual usage of script granted super weapons even if the prereq requirements aren't met.

This commit is contained in:
Justin Marshall
2020-07-20 11:27:06 -07:00
parent e721d781e5
commit 9fcc2d286d
6 changed files with 17 additions and 5 deletions
+1 -1
View File
@@ -948,7 +948,7 @@ static int Script_GiveSpecialWeapon(lua_State* L) {
if (house->ID == houseType || houseType == -1) {
house->SuperWeapon[weaponType].Enable(TACTION_FULL_SPECIAL, true);
house->SuperWeapon[weaponType].Enable(false, true, false, true);
if (immediate) {
house->SuperWeapon[weaponType].Forced_Charge(true);
+8
View File
@@ -170,6 +170,14 @@ void GL_DrawForegroundText(int color, int x, int y, char* text) {
ImGui::GetForegroundDrawList()->AddText(pos, ImGui::ColorConvertFloat4ToU32(ImVec4(r, g, b, 1)), text);
}
void GL_DrawForegroundText(int color, float fontsize, float r, float g, float b, int x, int y, char* text) {
ImVec2 pos(x, y);
float _r = r / 255.0f;
float _g = r / 255.0f;
float _b = r / 255.0f;
ImGui::GetForegroundDrawList()->AddText(NULL, fontsize, pos, ImGui::ColorConvertFloat4ToU32(ImVec4(_r, _g, _b, 1)), text);
}
void GL_DrawLine(int color, int x, int y, int dx, int dy) {
ImVec2 pos(x, y);
ImVec2 pos2(dx, dy);
+1
View File
@@ -20,6 +20,7 @@ void GL_ResetClipRect(void);
void GL_SetClipRect(int x, int y, int width, int height);
void GL_ForceForegroundRender(bool force);
void GL_DrawForegroundText(int color, int x, int y, char* text);
void GL_DrawForegroundText(int color, float fontsize, float r, float g, float b, int x, int y, char* text);
void GL_SetColor(float r, float g, float b);
void GL_SetRenderTexture(RenderTexture* renderTexture);
void GL_EnableBlend(GLBlendType blendType);
+4 -2
View File
@@ -70,6 +70,7 @@ SuperClass::SuperClass(int recharge, bool powered, VoxType charging, VoxType rea
IsPresent(false),
IsOneTime(false),
IsReady(false),
IsNoPreq(false),
Control(0),
OldStage(-1),
VoxRecharge(ready),
@@ -139,11 +140,12 @@ bool SuperClass::Suspend(bool on)
* HISTORY: *
* 07/28/1995 JLB : Created. *
*=============================================================================================*/
bool SuperClass::Enable(bool onetime, bool player, bool quiet)
bool SuperClass::Enable(bool onetime, bool player, bool quiet, bool skipPreReq)
{
if (!IsPresent) {
IsPresent = true;
IsOneTime = onetime;
IsNoPreq = skipPreReq;
bool retval = Recharge(player && !quiet);
if (quiet) Suspend(true);
return(retval);
@@ -170,7 +172,7 @@ bool SuperClass::Enable(bool onetime, bool player, bool quiet)
*=============================================================================================*/
bool SuperClass::Remove(void)
{
if (IsPresent && !IsOneTime) {
if (IsPresent && !IsOneTime && !IsNoPreq) {
IsReady = false;
IsPresent = false;
return(true);
+2 -1
View File
@@ -44,7 +44,7 @@ class SuperClass {
SuperClass(int recharge, bool powered, VoxType charging=VOX_NONE, VoxType ready=VOX_NONE, VoxType impatient=VOX_NONE, VoxType suspend=VOX_NONE);
bool Suspend(bool on);
bool Enable(bool onetime = false, bool player=false, bool quiet=false);
bool Enable(bool onetime = false, bool player=false, bool quiet=false, bool skipPreReq = false);
void Forced_Charge(bool player=false);
bool AI(bool player=false);
bool Remove(void);
@@ -66,6 +66,7 @@ class SuperClass {
unsigned IsPresent:1;
unsigned IsOneTime:1;
unsigned IsReady:1;
unsigned IsNoPreq : 1;
CDTimerClass<FrameTimerClass> Control;
int OldStage;
+1 -1
View File
@@ -6,7 +6,7 @@ function map_briefing()
end
function map_start()
GiveSpecialWeapon(SpecialWeapons.Paratroops, Houses.USSR, 1)
end
function map_frame()