Commit 29c1cf4d authored by Mikleo's avatar Mikleo
Browse files

--

parent b61486ad
Pipeline #14940 passed with stages
in 20 seconds
......@@ -10,7 +10,7 @@
#include <SteamWorks>
#define PluginVersion "1.48"
#define PluginVersion "1.49"
float pVersion;
// note linearmap field is unstable
......@@ -40,7 +40,7 @@ int currentHammerID = BASEHAMMERID;
bool usedFlagIndex[32] = {false,...};
ConVar ef_baseswap,ef_scenario_reload_map_config,ef_downloadeditorcfg,ef_dynamic_prop_shadows,ef_save_research;
ConVar ef_baseswap,ef_scenario_reload_map_config,ef_downloadeditorcfg,ef_dynamic_prop_shadows,ef_save_research,ef_buildings_damagedestroy;
ConVar emp_sv_commander_freeze_time, emp_sv_player_refinery_multiplier, emp_sv_refinery_multiplier;
......@@ -165,6 +165,8 @@ public void OnPluginStart()
ef_scenario_reload_map_config= CreateConVar("ef_scenario_reload_map_config", "0", "Reload the map config when loading a scenario ");
// leave off for now. may be needed in the future.
ef_buildings_damagedestroy = CreateConVar("ef_buildings_damagedestroy", "0", "Use takedamage to destroy buildings, it is safer");
ef_dynamic_prop_shadows = CreateConVar("ef_dynamic_prop_shadows","1","Add shadows to props");
......@@ -693,7 +695,7 @@ ExecuteRemoveEntity(int entity)
float cornerPosition[3] = {-16000.0,-16000.0,-16000.0};
TeleportEntity(entity,cornerPosition, NULL_VECTOR, NULL_VECTOR);
}
else if(IsEngineerBuildable(entity,className))
else if(IsBuilding(entity) && (IsEngineerBuildable(entity,className) || ef_buildings_damagedestroy.IntValue == 1))
{
// entity needs to be "destroyed" for proper cleanup or it will cause a crash.
SDKHooks_TakeDamage(entity, 0, 0, 100000.0, 0, 0);
......
......@@ -1187,10 +1187,10 @@ public Action Rotate_Entity(int client, int entity)
new String:clientName[128];
GetClientName(client,clientName,sizeof(clientName));
if(lastMinorEditTime + 5.0 < GetTime())
if(CanShowMinorEdit())
{
lastMinorEditTime = GetTime();
PrintToChatAll("%s rotated %s",clientName,className);
}
......@@ -1263,9 +1263,8 @@ public Action Shift_Entity(int client, int entity)
new String:clientName[128];
GetClientName(client,clientName,sizeof(clientName));
if(lastMinorEditTime + 5.0 < GetTime())
if(CanShowMinorEdit())
{
lastMinorEditTime = GetTime();
PrintToChatAll("%s moved %s",clientName,className);
}
......@@ -1278,7 +1277,15 @@ public Action Shift_Entity(int client, int entity)
return Plugin_Handled;
}
bool CanShowMinorEdit()
{
if(lastMinorEditTime + 10.0 < GetTime())
{
lastMinorEditTime = GetTime();
return true;
}
return false;
}
public Action Edit_Entity(int client, int entity,float position[3],bool editExistingEntity)
{
......@@ -1327,6 +1334,12 @@ public Action Edit_Entity(int client, int entity,float position[3],bool editExis
if (!BreakArg(args,arg1, sizeof(arg1),argIndex) || !BreakArgRemainder(args,arg2,sizeof(arg2),argIndex))
{
PrintToChat(client,"/editent [key] [value] \nSee console for a list the list of keys for this entity");
if(CanShowMinorEdit())
{
new String:clientName[128];
GetClientName(client,clientName,sizeof(clientName));
PrintToChatAll("%s looked at %s info",clientName,className);
}
}
else
{
......
......@@ -175,6 +175,8 @@ public Action Command_Add_Script(int client, int args)
ProcessScriptFromKV(kv);
// load initializers of new scripts.
LoadScriptBeginningFromKV(kv,"i_",EU_ParamEntity());
if(EU_HasGameStarted())
LoadScriptBeginningFromKV(kv,"s_",EU_ParamEntity());
if(removeAfter)
{
......
......@@ -56,6 +56,7 @@ public bool SetupScenarioVote()
char path[128];
GetActingSelectionPath(path,sizeof(path));
bool succeeded = true;
if(!kv.ImportFromFile(path))
{
......@@ -100,6 +101,7 @@ public Action Timer_VoteWarnTimer(Handle timer,int entity)
}
bool StartDefaultScenarioVote()
{
CancelScenarioVote();
ScenarioVoteKV = new KeyValues("ScenarioSelection");
char path[128];
......@@ -155,9 +157,7 @@ public bool StartScenarioVote(KeyValues kv)
EU_SetWaitTime(ef_scenario_vote_min_timeleft.IntValue);
}
char path[128];
ScenarioVoteMenu = new Menu(Handle_VoteMenu);
......@@ -280,7 +280,6 @@ public bool StartScenarioVote(KeyValues kv)
char display[128];
int style;
if(ScenarioVoteMenu.ItemCount == 0)
{
CancelScenarioVote();
......@@ -290,7 +289,7 @@ public bool StartScenarioVote(KeyValues kv)
ScenarioVoteMenu.GetItem(0, info, sizeof(info),style,display,sizeof(display));
// execute this item.
LoadOption(info);
CancelScenarioVote();
}
else if(ScenarioVoteMenu.ItemCount > 1)
{
......@@ -306,7 +305,6 @@ public bool StartScenarioVote(KeyValues kv)
PrintToChatAll("(Randomly Chose Option %d/%d %s)",index+1,ScenarioVoteMenu.ItemCount,info);
LoadOption(info);
CancelScenarioVote();
}
else
{
......@@ -332,7 +330,7 @@ public int Handle_VoteMenu(Menu menu, MenuAction action, int param1, int param2)
{
// clear everything to do with the vote.
if(menu == ScenarioVoteMenu)
CancelScenarioVote();
CancelScenarioVote(false);
}
}
......@@ -342,27 +340,37 @@ public int Handle_VoteMenu(Menu menu, MenuAction action, int param1, int param2)
void LoadOption(char[] option)
{
// default scenario.
if(StrEqual(option,"current scenario",false))
{
PrintToChatAll("Scenario will not change");
CancelScenarioVote();
}
else if(ScenarioVoteKV.JumpToKey(option,false))
else
{
char buffer[32];
ScenarioVoteKV.GetString("Method",buffer,sizeof(buffer),"");
if(strlen(buffer) > 0)
if(ScenarioVoteKV.JumpToKey(option,false))
{
CancelScenarioVote(false);
// load the option
StartScenarioVote(ScenarioVoteKV);
char buffer[32];
ScenarioVoteKV.GetString("Method",buffer,sizeof(buffer),"");
if(strlen(buffer) > 0)
{
CancelScenarioVote(false);
// load the option
StartScenarioVote(ScenarioVoteKV);
}
else
{
CancelScenarioVote();
PrintToChatAll("Loading Scenario: %s",option);
LoadScenario(0,option);
ShowScenarioInfo(-1,30);
}
}
else
{
PrintToChatAll("Loading Scenario: %s",option);
LoadScenario(0,option);
ShowScenarioInfo(-1,30);
CancelScenarioVote();
PrintToChatAll("Selection Error: option %s not found",option);
}
}
......@@ -380,6 +388,7 @@ public void Handle_VoteResults(Menu menu, int num_votes, int num_clients, const
if(num_items < 0)
{
//noone has voted, do not continue
CancelScenarioVote();
return;
}
......@@ -532,7 +541,7 @@ public Action Command_Scenario_Vote(int client, int args)
// just cancel the existing vote.
CancelScenarioVote(false);
CancelScenarioVote();
......@@ -553,6 +562,7 @@ public Action Command_Scenario_Vote(int client, int args)
ScenarioVoteKV.GoBack();
}
ScenarioVoteKV.GoBack();
ScenarioVoteKV.SetNum("IncludeCurrentScenario",1);
StartScenarioVote(ScenarioVoteKV);
}
......
......@@ -3,7 +3,9 @@
"$string_MainText" "King of the Hill\Hold both flags for 8 minutes to win"
"$string_NeutralText" "King of the hill"
"$string_Warning" "King of the hill:TXTCLR_DF Hold onto both flags for 8 minutes to win. TXTCLR_G!scenario"
"$int_TimerLength" "480"
"$int_TimerLength" "500"
"$int_TimerDecrease" "20"
"$int_TimerLengthMin" "260"
//automatically calculated
"$int_FlagNumber" "0"
......@@ -15,7 +17,7 @@
"s_OnStart" "Run NooneHasFlags"
"BEHasFlags" "Cancel KOTHTimer -> TextTimer $int_TimerLength *BE Victory in TIME_LEFT* _ KOTHTimer -> TargetParams -> Input InputImpWin 0 "
"NFHasFlags" "Cancel KOTHTimer -> TextTimer $int_TimerLength *NF Victory in TIME_LEFT* _ KOTHTimer -> TargetParams -> Input InputNFWin 0 "
"NooneHasFlags" "Cancel KOTHTimer -> TextTimer -1 *$string_NeutralText* _ KOTHTimer"
"NooneHasFlags" "Cancel KOTHTimer -> Run ReduceTime -> TextTimer -1 *$string_NeutralText* _ KOTHTimer"
"i_Warn" "Every 240 -> ChatText *$string_Warning*"
"$int_BEFlags" "0"
......@@ -24,4 +26,6 @@
"CountBEFlag" "Inc $int_BEFlags"
"CountNFFlag" "Inc $int_NFFlags"
"ReduceTime" "Set $int_TimerLength = $int_TimerLength - $int_TimerDecrease -> If *$int_TimerLength < $int_TimerLengthMin* -> Set $int_TimerLength = $int_TimerLengthMin"
}
\ No newline at end of file
......@@ -8,21 +8,20 @@
{
"Main"
{
"i_OnScenarioLoaded" "Run Introduction Introduction2 Setup BlockArty"
"Introduction" "After 60 -> ChatText *Gen. Strickland:TXTCLR_DF Listen up, the artifact in the ruins will provide us an enormous technological advantage in the war to come* *Gen. Mendez:TXTCLR_DF Intel has detected an artifact in the south east ruins with enormous strategic value* **"
"Introduction2" "After 65 -> ChatText *Gen. Strickland:TXTCLR_DF Our objective is clear, defend the artifact at any cost.* *Gen. Mendez:TXTCLR_DF Our objective is clear, destroy the artifact at any cost.* **"
"i_OnScenarioLoaded" "Run Introduction Introduction2 Setup"
"Introduction" "After 120 -> ChatText *Gen. Strickland:TXTCLR_DF Listen up, the artifact in the ruins will provide us an enormous technological advantage in the war to come* *Gen. Mendez:TXTCLR_DF Intel has detected an artifact in the south east ruins with enormous strategic value* **"
"Introduction2" "After 125 -> ChatText *Gen. Strickland:TXTCLR_DF Our objective is clear, defend the artifact at any cost.* *Gen. Mendez:TXTCLR_DF Our objective is clear, destroy the artifact at any cost.* **"
"Setup" "TargetName artifact -> AddDamageFilter NoTeamDamage -> HookOutput OnBreak NFVictory -> Run ObjectiveTimer"
"ObjectiveTimer" "TextTimer 1200 *Defend The Artifact\TIME_LEFT $m_iHealth HP* *Destroy The Artifact\TIME_LEFT $m_iHealth HP* -> TargetParams -> Input InputNFWin 0 EndActivator"
"ObjectiveTimer" "TextTimer 900 *Defend The Artifact\TIME_LEFT $m_iHealth HP* *Destroy The Artifact\TIME_LEFT $m_iHealth HP* -> TargetParams -> Input InputNFWin 0 EndActivator"
"NFVictory" "TargetParams -> Input InputImpWin 0 EndActivator"
"BlockArty" "OnCommand *emp_comm_research 34* Handle -> PrintToTarget *Artillery tanks are disabled in this scenario*"
"s_OnGameStart" "Run Warning AirStrikeExec1 AirStrikeExec2 SmartIdeas AirStrikeExec3"
"Warning" "After 600 -> ChatText *Gen. Strickland:TXTCLR_DF Intel has revealed that the enemy are planning airstrikes on key buildings at our location. Don't take any defences for granted!* *Gen. Mendez:TXTCLR_DF Be alert, We have allied bombers in the area which will deliver precision airstrikes on enemy targets* **"
"AirStrikeExec1" "After 800 -> TargetClassname emp_building_radar 2 -> Run AircraftEffect -> TakeDamage 500 -> After 2 -> Run AirStrikeNotice1 "
"Warning" "After 300 -> ChatText *Gen. Strickland:TXTCLR_DF Intel has revealed that the enemy are planning airstrikes on key buildings at our location. Don't take any defences for granted!* *Gen. Mendez:TXTCLR_DF Be alert, We have allied bombers in the area which will deliver precision airstrikes on enemy targets* **"
"AirStrikeExec1" "After 500 -> TargetClassname emp_building_radar 2 -> Run AircraftEffect -> TakeDamage 500 -> After 2 -> Run AirStrikeNotice1 "
"AirStrikeNotice1" "ChatText *Gen. Strickland:TXTCLR_DF Oh no! Our radar has just been taken out by a precision airstrike!* *Gen. Mendez:TXTCLR_DF Great news! A precision allied airstrike has just taken out the enemy radar! *"
"AirStrikeExec2" "After 900 -> TargetClassname emp_building_vehiclefactory 2 -> Run AircraftEffect -> TakeDamage 500 -> After 2 -> Run AirStrikeNotice2"
"AirStrikeExec2" "After 600 -> TargetClassname emp_building_vehiclefactory 2 -> Run AircraftEffect -> TakeDamage 500 -> After 2 -> Run AirStrikeNotice2"
"AirStrikeNotice2" "ChatText *Gen. Strickland:TXTCLR_DF Oh no! Our vehicle factory has just been taken out by a precision airstrike!* *Gen. Mendez:TXTCLR_DF Great news! A precision allied airstrike has just taken out the enemy vehicle factory! *"
"SmartIdeas" "After 1000 -> ChatText ** *Gen. Mendez:TXTCLR_DF Listen up maggot, anyone else with 'smart' suggestions about airstriking the artifact will be reassigned to the bioweapon research division.* **"
"AirStrikeExec3" "After 1050 -> Run AirStrikeWarning3 -> After 50 -> TargetParams -> Run AircraftDownEffect -> Input SetNFTickets 1 -> After 2 -> Run AirStrikeNotice3"
"SmartIdeas" "After 700 -> ChatText ** *Gen. Mendez:TXTCLR_DF Listen up maggot, anyone else with 'smart' suggestions about airstriking the artifact will be reassigned to the bioweapon research division.* **"
"AirStrikeExec3" "After 750 -> Run AirStrikeWarning3 -> After 50 -> TargetParams -> Run AircraftDownEffect -> Input SetNFTickets 1 -> After 2 -> Run AirStrikeNotice3"
"AirStrikeWarning3" "ChatText *Gen. Strickland:TXTCLR_DF We have a mole, intel has revealed that someone has just leaked our flight plans. Be prepared to run out of reinforcements soon.* *Gen. Mendez:TXTCLR_DF We have just recieved intel on enemy reinforcement flight plans, dispatching fighters. *"
"AirStrikeNotice3" "ChatText *Gen. Strickland:TXTCLR_DF Oh no! Enemy Fighters have shot down our remaining reinforcements. You're on your own now!* *Gen. Mendez:TXTCLR_DF Our Fighters have just shot down enemy reinforcements. Use this to your advantage, strike now! *"
"AircraftEffect" "EmitSound *ambient/explosions/explode_2.wav*"
......@@ -30,8 +29,8 @@
}
}
"Description" "Destroy/Defend the artifact in 20 minutes"
"details" "A timer will appear when the game starts.\Artillery is disabled."
"Description" "Destroy/Defend the artifact in 15 minutes"
"details" "A timer will appear when the game starts."
"Tags" "Version 2"
"version" "1.040000"
"hLimit" "172105"
......
......@@ -4,7 +4,7 @@
{
"Version"
{
"Latest" "1.48"
"Latest" "1.49"
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment