diff --git a/README.md b/README.md index 7621826..60f653a 100644 --- a/README.md +++ b/README.md @@ -79,7 +79,6 @@ PLEASE NOTE: For the Legacy (Pre-GitHub Versions) Changelogs, please see LEGACY * Addressed the bug that would allow Vardison 2.0 to summon infinite minions * Addressed the bug with Vardison 2.0 that made his Shadow Rift invincible * Removed two un-used game objects that were never completed, the Medal Seal and the UAV Control Panel - * Note: This has inadvertently introduced a new bug causing the UAMS streak to no longer correctly function, this will be addressed before the official release of 3.91 * Removed a few erraneous exec calls to non-existent files in the mod load script * Depricated the F2 Inventory Screen (Nobody ever used this) * Fixed a few bugs in the F2 Menu diff --git a/scripts/TWM2/LoadMod.cs b/scripts/TWM2/LoadMod.cs index 932e0b1..0d0d252 100644 --- a/scripts/TWM2/LoadMod.cs +++ b/scripts/TWM2/LoadMod.cs @@ -1,10 +1,10 @@ // TWM 2, Mod Load Script, Place any Scripts To Be Executed In Here -Error("********************************************"); -Error("********************************************"); -Error("******** EXECUTING TWM2 MOD SCRIPTS ********"); -Error("********************************************"); -Error("********************************************"); +echo("********************************************"); +echo("********************************************"); +echo("******** EXECUTING TWM2 MOD SCRIPTS ********"); +echo("********************************************"); +echo("********************************************"); //Mod Systems exec("serverControl.cs"); //Server Settings @@ -35,6 +35,9 @@ exec("scripts/TWM2/Systems/weaponModes.cs"); //Global Defines for Weapon exec("scripts/TWM2/AI/DroneAI.cs"); //Drones exec("scripts/TWM2/Systems/HarbingersWrath.cs"); //Harbinger's Wrath + //Mod Objects +exec("scripts/TWM2/ModObjects/UAMS.cs"); //UAMS Missile Satellite + //Mod Dependancies exec("scripts/TWM2/loadmenu.cs"); //loadscreen @@ -134,7 +137,7 @@ BuildDeconList(); //build decon. list (con tool) exec("scripts/TWM2/Bosses/LordVardison.cs"); //load him last -error("Loading custom scripts"); +echo("Loading custom scripts"); exec("scripts/Customize/CustomScripts.cs"); schedule(5500, 0, "establishPGDConnection"); @@ -143,11 +146,11 @@ cleanChallenges(); $ChallengeIndex = 0; schedule(7000, 0, "downloadChallenges"); -Error("********************************************"); -Error("********************************************"); -Error("************* EXECUTE COMPLETE *************"); -Error("********************************************"); -Error("********************************************"); +echo("********************************************"); +echo("********************************************"); +echo("************* EXECUTE COMPLETE *************"); +echo("********************************************"); +echo("********************************************"); //POST LOAD TASKS..... //OrderStreaks(); diff --git a/scripts/TWM2/ModObjects/UAMS.cs b/scripts/TWM2/ModObjects/UAMS.cs new file mode 100644 index 0000000..c457940 --- /dev/null +++ b/scripts/TWM2/ModObjects/UAMS.cs @@ -0,0 +1,188 @@ +datablock StaticShapeData(MissileShape) : StaticShapeDamageProfile { + shapeFile = "weapon_missile_projectile.dts"; + mass = 1.0; + repairRate = 0; + dynamicType = $TypeMasks::StaticShapeObjectType; + heatSignature = 0; +}; + +function CruiseMissileVehicle::onAdd(%this, %obj) { + Parent::onAdd(%this, %obj); + setTargetSensorGroup(%obj.getTarget(), %obj.team); + + %body = new StaticShape() { + scale = "20 20 20"; + datablock = MissileShape; + }; + MissionCleanup.add(%body); + %obj.mountObject(%body, 1); + %body.vehicleMounted = %obj; + + %obj.startFade(0,100,1); +} + +function CruiseMissileVehicle::deleteAllMounted(%data, %obj) { + + %body = %obj.getMountNodeObject(1); + if(!%body) { + return; + } + %body.delete(); +} +// +function CreateMissileSat(%client, %unlim, %rem) { + if(%unlim $= "" || !%unlim) { + %unlim = 0; + %rem = 0; + } + + if($Killstreak::GunshipSpawnLocation[$CurrentMission] $= "") { + %spawn = "0 -1000 400"; + } + else { + %spawn = $Killstreak::GunshipSpawnLocation[$CurrentMission]; + } + %sat = new FlyingVehicle() { + dataBlock = UAVVehicle; + position = %spawn; + rotation = "0 0 0 1"; + team = %client.team; + }; + MissionCleanUp.add(%sat); + setTargetSensorGroup(%sat.getTarget(), %client.team); + + %sat.GoPoint = 1; + GunshipForwardImpulse(%sat); + %sat.ScanLoop = schedule(500, 0, "GetNextGunshipPoint", %sat); + %client.player.lastTransformStuff = %client.player.getTransform(); + + %sat.team = %client.Team; + %sat.setOwner(%client.player); + + %sat.canLaucnhStrike = 1; + %sat.isUnlimitedSat = %unlim; + + MessageClient(%client, 'msgSatcom', "\c3UAMS: Satellite Moving to Position, Standby...."); + + if(!%unlim) { + %client.player.setPosition(VectorAdd(%x SPC %y SPC 0,$Prison::JailPos)); + + %client.setControlObject(%sat.turretObject); + %client.schedule(499, setControlObject, %sat.turretObject); + MissileSatControlLoop(%client, %sat); + } + else { + %client.setControlObject(%sat.turretObject); + commandToClient(%client, 'ControlObjectResponse', true, getControlObjectType(%sat.turretObject,%client.player)); + } + + if(%rem) { + %sat.turretObject.setAutoFire(true); + } +} + +function FireSatHornet(%sat, %slot, %source) { + %muzzlePos = %sat.getMuzzlePoint(%slot); + %muzzleVec = %sat.getMuzzleVector(%slot); + //Fiah + spawnprojectileSourceMod(HornetStrikeMissile, SeekerProjectile, %muzzlePos, %muzzleVec, %source); + ServerPlay3d(EscapePodLaunchSound, %sat.getPosition()); + ServerPlay3d(EscapePodLaunchSound2, %sat.getPosition()); +} + +function MissileSatelliteBarrel::onFire(%data, %obj, %slot) { + //echo(%obj); + if(%obj.mountobj.canLaucnhStrike) { + %client = %obj.getControllingClient(); + %source = %client.player; //muhaha + + %obj.mountobj.canLaucnhStrike = 0; + + FireSatHornet(%obj, %slot, %source); + schedule(1500, 0, "FireSatHornet", %obj, %slot, %source); + schedule(3000, 0, "FireSatHornet", %obj, %slot, %source); + + if(!%obj.mountobj.isUnlimitedSat) { + schedule(4000, 0, "MakeCruiseMissile", %client, %obj); + schedule(4000, 0, "ServerPlay3d", EscapePodLaunchSound2, %obj.getPosition()); + } + else { + schedule(30000, 0, "ResetSat", %obj.mountobj); + // + } + } + else { + if(!%obj.mountobj.isUnlimitedSat) { + return; + } + %client = %obj.getControllingClient(); + bottomPrint(%client, "Missiles are still reloading... standby.", 2, 2); + if(isObject(%client.player) && %client.player.getState() !$= "dead") { + %client.setControlObject(%client.player); + } + } +} + +function ResetSat(%sat) { + if(isObject(%sat)) { + %sat.canLaucnhStrike = 1; + } +} + +function MakeCruiseMissile(%client, %sat) { + if(%client.getControlObject() != %sat) { + return; + } + %Missile = new FlyingVehicle() { + dataBlock = "CruiseMissileVehicle"; + scale = "1 1 1"; + team = %client.team; + mountable = "0"; //drive only + }; + + setTargetSensorGroup(%Missile.getTarget(), %Missile.team); + %Missile.setTransform(vectorAdd(%sat.getPosition(), "0 0 -5") SPC rotFromTransform(%sat.getTransform())); + + %Missile.controller = %client; + %sat.GuidedMissile = %Missile; + MissionCleanup.add(%Missile); + %client.setControlObject(%Missile); + + MissileSatGuidedLoop(%client, %Missile); +} + +//just a good function to delete the satelite if the client reliquishes control +function MissileSatControlLoop(%client, %sat) { + if(!isObject(%sat)) { + if(isObject(%client.player)) { + ReMoveClientSW(%client); + } + return; + } + if((%client.getControlObject() != %sat.turretObject) && !%sat.isUnlimitedSat) { + //lets check if they are in the missile now... + if(%client.getControlObject() == %sat.turretObject.GuidedMissile) { + //MissileSatGuidedLoop(%client, %sat.turretObject.GuidedMissile); + } + //No, they reliquished all control before the guided fired... + else { + if(isObject(%client.player)) { + ReMoveClientSW(%client); + } + } + %sat.schedule(1000, "Delete"); + return; + } + //%client.setControlObject(%sat.turretObject); + schedule(100, 0, "MissileSatControlLoop", %client, %sat); +} + +function MissileSatGuidedLoop(%client, %missile) { + if(%client.getControlObject() != %missile) { + if(isObject(%client.player)) { + ReMoveClientSW(%client); + } + return; + } + schedule(100, 0, "MissileSatGuidedLoop", %client, %missile); +} \ No newline at end of file diff --git a/scripts/TWM2/Systems/MainControl.cs b/scripts/TWM2/Systems/MainControl.cs index 9b084ca..fdcb131 100644 --- a/scripts/TWM2/Systems/MainControl.cs +++ b/scripts/TWM2/Systems/MainControl.cs @@ -228,6 +228,20 @@ function TWM2Lib_MainControl(%functionName, %arguments) { } } +function ReMoveClientSW(%client) { + if(!isObject(%client.player) || %client.player.getState() $= "dead") { + return; + } + else { + %sp = Game.pickPlayerSpawn(%client, false); + //2 sec Invincibility please? + %client.player.setInvinc(1); + %client.player.schedule(2000, "setInvinc", 0); + %client.player.setTransform(%client.player.lastTransformStuff); //%sp for new spawn + %client.setControlObject(%client.player); + } +} + function ListGUIDS() { for(%i = 0; %i < ClientGroup.getCount(); %i++) { %cl = ClientGroup.getObject(%i);