-
Notifications
You must be signed in to change notification settings - Fork 1
/
ZScript.zsc
107 lines (95 loc) · 4.37 KB
/
ZScript.zsc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
Version "4.12.0"
//Base classes and common functions shared across all actors.
#Include "ZScript/Vehicles/Base/Base.zsc"
#Include "ZScript/Vehicles/Projectiles.zsc" //Projectiles used by multiple vehicle types.
#Include "ZScript/Vehicles/Base/CommonFunctions.zsc"
//#Include "ZScript/Vehicles/Base/TurretFunctions.zsc"
#Include "ZScript/Vehicles/Base/EventHandlers.zsc"
#Include "ZScript/SFX.zsc"
#Include "ZScript/Radio.zsc"
#Include "ZScript/BasicMarine.zsc"
//=====|The vehicles|=====\\
//Army Car
#Include "ZScript/Vehicles/Army Car/ArmyCar.zsc"
#Include "ZScript/Vehicles/Army Car/OtherActors.zsc"
//Army Truck
#Include "ZScript/Vehicles/Army Truck/ArmyTruck.zsc"
#Include "ZScript/Vehicles/Army Truck/OtherActors.zsc"
//Armored Personnel Carrier
#Include "ZScript/Vehicles/APC/APC.zsc"
#Include "ZScript/Vehicles/APC/APCProps.zsc" //The APC's OtherActors.zsc is already too long without the props.
#Include "ZScript/Vehicles/APC/OtherActors.zsc"
//Main Battle Tank
#Include "ZScript/Vehicles/MBT/MBT.zsc"
#Include "ZScript/Vehicles/MBT/MBTProps.zsc"
#Include "ZScript/Vehicles/MBT/OtherActors.zsc"
#Include "ZScript/Vehicles/MBT/SPAAG.zsc"
#Include "ZScript/Vehicles/MBT/Terminator.zsc"
//#Include "ZScript/Vehicles/MBT/MLRS.zsc"
//MISSION 01 START
#Include "ZScript/Vehicles/Di-Cokka/Di-Cokka.zsc"
#Include "ZScript/Vehicles/Di-Cokka/OtherActors.zsc"
//Check if the Smart Marines (https://github.com/inkoalawetrust/Smart-Marines/releases) are loaded along with the military vehicles.
Class MVP_Handler : EventHandler
{
Bool NoCustomMarines;
Override Void WorldThingSpawned (WorldEvent E)
{
//If there's 2000 or less monsters (For performance) on the map. Give newly spawned monsters +DOSHADOWBLOCK.
//Used to make tank smokescreens affect monster aiming in general, and in the future, for marine smoke grenades.
//Ignore this if the marines are loaded however, since they have their own code for this.
If (NoCustomMarines && !MVP_Disable_DoShadowBlock && Level.Total_Monsters <= 2000 && E.Thing && E.Thing.bIsMonster)
{
//Ignore if the thing has the flag on already. Or is a lost soul-alike.
If (!E.Thing.bDoShadowBlock && !(E.Thing.bFloat && (E.Thing.bSkullFly || E.Thing.bRetargetAfterSlam)))
E.Thing.bDoShadowBlock = True;
}
//Debug code used to make all monsters able to see friendly monsters, if they can't already.
//I say this is for debugging, but it's mostly for me to screw around and make NPC battles with
//my marines and vehicles VS other monsters.
If (MVP_Debug_SeeFriendlyMonsters)
{
If (E.Thing && E.Thing.bIsMonster && !E.Thing.bSeeFriendlyMonsters)
{
E.Thing.bSeeFriendlyMonsters = True;
If (MVP_Debug_SeeFriendlyMonsters_Range != -1)
E.Thing.FriendlySeeBlocks = MVP_Debug_SeeFriendlyMonsters_Range;
}
}
}
//Replaces the Smart Marines' own bullets with their better MVP equivalents.
Override Void CheckReplacement (ReplaceEvent E)
{
Name MarineBullet = "SmartMarineMGBullet";
If (!NoCustomMarines && E.Replacee Is MarineBullet)
E.Replacement = "MVP_50CalBullet";
}
//Just a test, returns the current date in 24 hour format.
Struct ScopeBypass ClearScope {String Time; String Date;}
ScopeBypass ScopeHack;
Override Void UITick()
{
Super.UITick();
ScopeHack.Time = SystemTime.Format ("%R",SystemTime.Now());
ScopeHack.Date = SystemTime.Format ("%B %e %G",SystemTime.Now());
}
//=============================================================================================
//HACK: Terms like "static clearscope" mean nothing in GZDoomland, where all classes MUST be in the same mod.
Static ClearScope Bool CheckActorExists (Name ActorClass)
{
Class<Actor> Act = ActorClass;
Return !!Act;
}
Bool SM_MarinesLoaded() //Look for smart marine marine-specific class.
{
Return CheckActorExists('SM_DogRageToken');
}
Override Void OnRegister()
{
If (!SM_MarinesLoaded())
{
Console.Printf ("\c[Red]WARNING: The Smart Marine NPC is not loaded alongside the Military Vehicles Pack, the mod will fall back to using the ZDoom marines. \n\c[Red]You should REALLY be using the latest version of the Smart Marine NPC instead, do not report any bugs unless they also occur with the Smart Marine NPC loaded. I am not responsible for any dumb behavior on the ZDoom marines' part.\n\c[Yellow]Download link for the Smart Marines: https://github.com/inkoalawetrust/Smart-Marines/releases");
NoCustomMarines = True;
}
}
}