diff -urN sourceold/scripts/HUDSurfaceClass.h source/scripts/HUDSurfaceClass.h --- sourceold/scripts/HUDSurfaceClass.h 2024-02-14 04:13:36.000000000 -0600 +++ source/scripts/HUDSurfaceClass.h 2024-03-08 20:25:22.832702500 -0600 @@ -52,8 +52,8 @@ int Get_Client_ID() const { return clientId; } bool Is_Dirty() const { return isDirty; } void Set_Dirty(bool dirty) { isDirty = dirty; } - const Vector2& Get_Boundary_Area() const { return boundary; } - float Get_Aspect_Ratio() const { return boundary.Y > WWMATH_EPSILON ? boundary.X / boundary.Y : 0; } + const RectClass& Get_Boundary_Area() const { return boundary; } + float Get_Aspect_Ratio() const { return boundary.Height() > WWMATH_EPSILON ? boundary.Width() / boundary.Height() : 0; } const StringClass& Get_Surface_Texture() const { return surfaceTexture; } void Set_Surface_Texture(const char* texture) { surfaceTexture = texture; Set_Dirty(true); } @@ -69,7 +69,7 @@ protected: int id; int clientId; - Vector2 boundary; + RectClass boundary; StringClass surfaceTexture; DynamicVectorClass elements; bool isDirty; @@ -185,8 +185,6 @@ void Set_Clipping_Area(const RectClass& newArea) { clipArea = newArea; Set_Dirty(true); } float Get_Clipping_Area_Size() const { const Vector2& a = clipArea.getSize(); return a.X * a.Y; } float Get_Clipping_Area_Diagonal_Length() const { return clipArea.Extent().Length() * 2; } - bool Is_Clipping_Enabled() const { return clipEnabled; } - void Set_Clipping_Enabled(bool enabled) { clipEnabled = enabled; Set_Dirty(true); } const Vector4& Get_Color() const { return color; } void Set_Color(const Vector4& newColor) { color = newColor; Set_Dirty(true); } void Set_Color(int a, int r, int g, int b) { color = Vector4(a / 255.f, r / 255.f, g / 255.f, b / 255.f); Set_Dirty(true); } @@ -195,6 +193,5 @@ WideStringClass text; HUDFontType font; RectClass clipArea; - bool clipEnabled; Vector4 color; }; \ No newline at end of file diff -urN sourceold/scripts/JMGRenetBuster.h source/scripts/JMGRenetBuster.h --- sourceold/scripts/JMGRenetBuster.h 2024-02-14 04:13:36.000000000 -0600 +++ source/scripts/JMGRenetBuster.h 2024-03-08 20:25:22.832702500 -0600 @@ -457,7 +457,7 @@ PerkTypeSystem.AddAPerkType(108,"Rapid Energy Regen Ability",25,false,false,false,PerkUnusable,0,"You have unlocked the Rapid Energy Regen ability."); PerkTypeSystem.AddAPerkType(109,"Weapons Upgrade Ability",25,false,false,false,PerkUnusable,0,"You have unlocked the Weapons Upgrade ability."); PerkTypeSystem.AddAPerkType(110,"Drone Ability",50,false,false,false,PerkUnusable,0,"You have unlocked the Drone ability."); - PerkTypeSystem.AddAPerkType(111,"High Explosive Warhead Ability",50,false,false,false,PerkUnusable,0,"You have unlocked the High Explosive Warhead ability."); + PerkTypeSystem.AddAPerkType(111,"High Yield Warhead Ability",50,false,false,false,PerkUnusable,0,"You have unlocked the High Yield Warhead ability."); PerkTypeSystem.AddAPerkType(112,"SOS Beacon Ability",25,false,false,false,PerkUnusable,0,"You have unlocked the SOS Beacon ability."); PerkTypeSystem.AddAPerkType(113,"Drone Swarm Ability",25,false,false,false,PerkUnusable,0,"You have unlocked the Drone Swarm ability."); for (int x = 114;x < PERKCOUNT;x++) @@ -1153,9 +1153,9 @@ case 13: sprintf(RetChar,"Server Record: %s has destroyed %lu comets total.",High->PlayerName,High->TotalComets);return RetChar; case 14: - sprintf(RetChar,"Server Record: %s has acquired %lu Highly Explosive Warhead powerups.",High->PlayerName,High->HEWPowerups);return RetChar; + sprintf(RetChar,"Server Record: %s has acquired %lu High Yield Warhead powerups.",High->PlayerName,High->HEWPowerups);return RetChar; case 15: - sprintf(RetChar,"Server Record: %s has used %lu Highly Explosive Warheads.",High->PlayerName,High->HEWUsed);return RetChar; + sprintf(RetChar,"Server Record: %s has used %lu High Yield Warheads.",High->PlayerName,High->HEWUsed);return RetChar; case 16: sprintf(RetChar,"Server Record: %s has fired a total of %lu rounds.",High->PlayerName,High->RoundsFired);return RetChar; case 17: @@ -1299,9 +1299,10 @@ enum ObjectType{NormalPlayerShip=0,UFO=1,Asteroid=2,Mine=3,TheMoon=4,PlayerShield=5,UFOBoss=6,PlayerCloak=7,PlayerSuper=8,CMTPowerup=9,CargoShip=10,MineBoss=11,PlayerDrone=12,PlayerDroneShield=13,PlayerShipJumpable=14,PlayerShipJumping=15,PlayerShipDisrupter=16}; struct TypeObject { - GameObject *obj; + ReferencerClass obj; float Size; float RealSize; + int parentId; ObjectType Type; TypeObject(GameObject *_obj,float _SquaredSize,float _RealSize,ObjectType _Type) { @@ -1309,19 +1310,29 @@ Size = _SquaredSize; RealSize = _RealSize; Type = _Type; + parentId = 0; + }; + TypeObject(GameObject *obj,float Size,float RealSize,ObjectType Type,int parentId) + { + this->obj = obj; + this->Size = Size; + this->RealSize = RealSize; + this->Type = Type; + this->parentId = parentId; }; }; struct AnObject { - GameObject *Object; + ReferencerClass Object; float Size; float RealSize; int ObjectID; ObjectType Type; + int parentId; int AllowReplaceTime; struct AnObject *next; - AnObject(GameObject *obj,float Size,float RealSize,ObjectType Type) + AnObject(GameObject *obj,float Size,float RealSize,ObjectType Type,int parentId) { this->AllowReplaceTime = -1; this->Object = obj; @@ -1330,6 +1341,7 @@ this->RealSize = RealSize; this->Type = Type; this->AllowReplaceTime = 0; + this->parentId = parentId; this->next = NULL; }; }; @@ -1338,9 +1350,9 @@ { bool isReady; int NumberOfLives; - GameObject *PlayerShip; - GameObject *ReplacementShip; - GameObject *SpectatorObject; + ReferencerClass PlayerShip; + ReferencerClass ReplacementShip; + ReferencerClass SpectatorObject; int GamePlayerID; int RespawnTime; char PlayerModel[32]; @@ -1451,7 +1463,7 @@ AnObject *Current = ObjectsList; if (!ObjectsList) { - ObjectsList = new AnObject(obj.obj,obj.Size,obj.RealSize,obj.Type); + ObjectsList = new AnObject(obj.obj,obj.Size,obj.RealSize,obj.Type,obj.parentId); return *this; } while (Current) @@ -1465,6 +1477,7 @@ Current->RealSize = obj.RealSize; Current->Type = obj.Type; Current->AllowReplaceTime = 0; + Current->parentId = obj.parentId; return *this; } if (!Current->AllowReplaceTime && Current->Object == obj.obj) @@ -1474,7 +1487,7 @@ } if (!Current->next) { - Current->next = new AnObject(obj.obj,obj.Size,obj.RealSize,obj.Type); + Current->next = new AnObject(obj.obj,obj.Size,obj.RealSize,obj.Type,obj.parentId); return *this; } Current = Current->next; @@ -1536,15 +1549,15 @@ { if (!Obj || !OtherObj || Obj->AllowReplaceTime || OtherObj->AllowReplaceTime) return false; - GameObject *Hitter = Obj->Object; - GameObject *Other = OtherObj->Object; + ReferencerClass Hitter = Obj->Object; + ReferencerClass Other = OtherObj->Object; if (Obj->Type == PlayerDroneShield && OtherObj->Type == PlayerDroneShield) return false; if (OtherObj->Type == PlayerShipJumping || Obj->Type == PlayerShipJumping) return false; if (Obj->Type == CargoShip && OtherObj->Type == TheMoon) { - if (JmgUtility::SimpleDistance(Commands->Get_Position(Hitter),Commands->Get_Position(Other)) <= Obj->Size+OtherObj->Size-225.0f) + if (JmgUtility::SimpleDistance(Commands->Get_Position(Hitter),Commands->Get_Position(Other)) <= Obj->Size+OtherObj->Size-200.0f) { Commands->Apply_Damage(Hitter,99999.9f,"BlamoKiller",Other); return true; @@ -1553,6 +1566,12 @@ } if (JmgUtility::SimpleDistance(Commands->Get_Position(Hitter),Commands->Get_Position(Other)) <= Obj->Size+OtherObj->Size) { + if (Obj->Type == CargoShip && OtherObj->Type == CargoShip && Obj->parentId != OtherObj->parentId) + { + Commands->Apply_Damage(Hitter,99999.9f,"BlamoKiller",Other); + Commands->Apply_Damage(Other,99999.9f,"BlamoKiller",Hitter); + return true; + } if (Obj->Type == TheMoon && OtherObj->Type == CargoShip) return false; if (OtherObj->Type == PlayerShipJumpable || Obj->Type == PlayerShipJumpable) @@ -1633,7 +1652,7 @@ if (OtherObj->Type == PlayerShield || OtherObj->Type == PlayerDroneShield) Commands->Send_Custom_Event(Other,Other,7043453,10,0.0f); } - if (OtherObj->Type != PlayerShield && OtherObj->Type != PlayerSuper && OtherObj->Type != PlayerDroneShield && OtherObj->Type != TheMoon) + if (OtherObj->Type != PlayerShield && OtherObj->Type != PlayerSuper && OtherObj->Type != PlayerDroneShield && OtherObj->Type != TheMoon && OtherObj->Type != CargoShip) SpecialApplyDamage(Other,99999.9f,"BlamoKiller",Hitter); else if (Obj->Type == NormalPlayerShip || Obj->Type == PlayerCloak || Obj->Type == PlayerShipJumpable || Obj->Type == PlayerShipDisrupter) @@ -1656,8 +1675,8 @@ { if (!Obj || !OtherObj || Obj->AllowReplaceTime || OtherObj->AllowReplaceTime) return true; - GameObject *Hitter = Obj->Object; - GameObject *Other = OtherObj->Object; + ReferencerClass Hitter = Obj->Object; + ReferencerClass Other = OtherObj->Object; if (JmgUtility::SimpleDistance(Commands->Get_Position(Hitter),Commands->Get_Position(Other)) <= Obj->Size+OtherObj->Size) { Commands->Apply_Damage(Hitter,99999.9f,"BlamoKiller",Other); @@ -1689,7 +1708,9 @@ AnObject *OtherObjs = ObjectsList; while (OtherObjs) { - if (Current->Type == CargoShip && OtherObjs->Type == TheMoon) + if (Current->Type == CargoShip && OtherObjs->Type == CargoShip && Current->parentId != OtherObjs->parentId) + DoesCollide(Current,OtherObjs); + else if (Current->Type == CargoShip && OtherObjs->Type == TheMoon) DoesCollide(Current,OtherObjs); else if (!OtherObjs->AllowReplaceTime && (OtherObjs->Type != PlayerDrone && OtherObjs->Type != PlayerDroneShield) || (Current->Type == CargoShip || Current->Type == TheMoon)) if (Current != OtherObjs && OtherObjs->Type != TheMoon && OtherObjs->Type != CargoShip && OtherObjs->Type != CMTPowerup) @@ -2077,7 +2098,7 @@ while (Current) { int TempID = Current->ObjectID; - GameObject *Target = Current->Object; + ReferencerClass Target = Current->Object; if (Target && !Current->AllowReplaceTime && (Obj != Target && Current->Type != PlayerDrone && Current->Type != PlayerDroneShield && Current->Type != CMTPowerup && Current->Type != NormalPlayerShip && Current->Type != PlayerShield && Current->Type != PlayerCloak && Current->Type != PlayerSuper && Current->Type != PlayerShipJumpable && Current->Type != PlayerShipDisrupter)) { float Dist = JmgUtility::SimpleDistance(*Position,Commands->Get_Position(Target))-Current->Size; @@ -2156,6 +2177,7 @@ void DisableGun(GameObject *obj); void FadeMusic(const char *music); public: + static int MoonID; static int MoonHolderID; static bool GameInProgress; static unsigned int CMTBLevel; @@ -2166,6 +2188,7 @@ static float DifficultyMultiplierMine; static float DifficultyMultiplierInv; }; +int JMG_CMTB_Main_Game_Control::MoonID = 0; int JMG_CMTB_Main_Game_Control::MoonHolderID = 0; bool JMG_CMTB_Main_Game_Control::GameInProgress = false; unsigned int JMG_CMTB_Main_Game_Control::CMTBLevel = 0; @@ -2268,7 +2291,6 @@ }; class JMG_CMTB_The_Moon_Script : public ScriptImpClass { - bool moonKilled; bool SpawnPoints[16]; float lastHealth; void Created(GameObject *obj); @@ -2302,6 +2324,7 @@ void Damaged(GameObject *obj,GameObject *damager,float damage); void Killed(GameObject *obj, GameObject *damager); void Destroyed(GameObject *obj); + void CreateShipCollision(GameObject *obj,int index,const char *boneName,float size); }; class JMG_CMTB_Cargo_Ship_Turret : public ScriptImpClass { @@ -2506,4 +2529,8 @@ int difficulty; void Created(GameObject *obj); void Poked(GameObject *obj,GameObject *poker); +}; + +class JMG_CMTB_Cargo_Ship_Child_Script : public ScriptImpClass { + void Killed(GameObject *obj, GameObject *damager); }; \ No newline at end of file diff -urN sourceold/scripts/JMGRenetBusters.cpp source/scripts/JMGRenetBusters.cpp --- sourceold/scripts/JMGRenetBusters.cpp 2024-02-14 04:13:36.000000000 -0600 +++ source/scripts/JMGRenetBusters.cpp 2024-03-08 20:25:22.832702500 -0600 @@ -26,6 +26,7 @@ #include "JMGRenetBuster.h" #include "RigidBodyClass.h" #include "ArmedGameObjDef.h" +#include "GameObjManager.h" // Did a major overhaul on all these scripts, even though the mod they belonged to is dead :( void JMG_Create_Ship_On_Poke::Created(GameObject *obj) { @@ -778,9 +779,9 @@ RenCometBustersScoreControl.Get_Current_Player_Score_Node(MiniGamePlayerControlSystem[x].PlayerID)->RoundsPlayed++; MaxPlayerCount++; } - GameObject *moonHolder = Commands->Find_Object(MoonHolderID); - if (moonHolder) - Commands->Destroy_Object(moonHolder); + GameObject *moon = Commands->Find_Object(JMG_CMTB_Main_Game_Control::MoonID); + if (moon) + Commands->Apply_Damage(moon,9999.9f,"None",0); RenCometBustersList.ClearAllObjects(); JMG_CMTB_Main_Game_Control::CMTBLevel = 0; NextLevelDelay = 0; @@ -1288,7 +1289,7 @@ MiniGamePlayerControlSystem[PlayerNumber].RespawnTime = 30; if (abs(MiniGamePlayerControlSystem[PlayerNumber].LastNewLifeScore-MiniGamePlayerControlSystem[PlayerNumber].Score) > 100000.0f) {// Give a new life - JmgUtility::DisplayChatMessage(Player,127,255,0,"You have aquired another life!"); + JmgUtility::DisplayChatMessage(Player,127,255,0,"You have acquired another life!"); Create_2D_Sound_Player(Player,"SFX.Comet_Busters_Pickup_Powerup"); MiniGamePlayerControlSystem[PlayerNumber].NumberOfLives++; MiniGamePlayerControlSystem[PlayerNumber].LastNewLifeScore = MiniGamePlayerControlSystem[PlayerNumber].Score; @@ -1545,7 +1546,7 @@ case 4: JmgUtility::DisplayChatMessage(sender,200,200,125,"Selected Special Ability: Energy Regen");break; case 5 :JmgUtility::DisplayChatMessage(sender,200,200,125,"Selected Special Ability: Weapons Upgrade");break; case 6: JmgUtility::DisplayChatMessage(sender,200,200,125,"Selected Special Ability: Drone");break; - case 7: JmgUtility::DisplayChatMessage(sender,200,200,125,"Selected Special Ability: High Explosive Warhead");break; + case 7: JmgUtility::DisplayChatMessage(sender,200,200,125,"Selected Special Ability: High Yield Warhead");break; case 8: JmgUtility::DisplayChatMessage(sender,200,200,125,"Selected Special Ability: SOS Beacon");break; case 9: JmgUtility::DisplayChatMessage(sender,200,200,125,"Selected Special Ability: Drone Swarm");break; default: JmgUtility::DisplayChatMessage(sender,200,200,125,"Selected Special Ability: None");break; @@ -1572,7 +1573,7 @@ JmgUtility::DisplayChatMessage(sender,200,200,125,"R - Toggle Rapid Fire"); JmgUtility::DisplayChatMessage(sender,200,200,125,"Q - Shield"); JmgUtility::DisplayChatMessage(sender,200,200,125,"Z - Cloak"); - sprintf(inventory,"G - Highly Explosive Warhead (x%d)",MiniGamePlayerControlSystem[x].SuperBombs); + sprintf(inventory,"G - Highly Yield Warhead (x%d)",MiniGamePlayerControlSystem[x].SuperBombs); JmgUtility::DisplayChatMessage(sender,200,200,125,inventory); sprintf(inventory,"T - SOS Beacon (x%d)",MiniGamePlayerControlSystem[x].HasSOSBeacon); JmgUtility::DisplayChatMessage(sender,200,200,125,inventory); @@ -1811,7 +1812,7 @@ PerkSystemIncreasePlayerPerkUnlockAmount(Get_Vehicle_Driver(obj),112,1); RenCometBustersScoreControl.Get_Current_Player_Score_Node(MiniGamePlayerControlSystem[x].PlayerID)->SOSBeacons++; MiniGamePlayerControlSystem[x].HasSOSBeacon = true; - JmgUtility::DisplayChatMessage(Get_Vehicle_Driver(obj),127,255,0,"You have aquired a SOS Beacon!"); + JmgUtility::DisplayChatMessage(Get_Vehicle_Driver(obj),127,255,0,"You have acquired a SOS Beacon!"); Create_2D_Sound_Player(Get_Vehicle_Driver(obj),"SFX.Comet_Busters_Pickup_Powerup"); break; case 4: @@ -1823,12 +1824,12 @@ PerkSystemIncreasePlayerPerkUnlockAmount(Get_Vehicle_Driver(obj),111,1); MiniGamePlayerControlSystem[x].SuperBombs++; RenCometBustersScoreControl.Get_Current_Player_Score_Node(MiniGamePlayerControlSystem[x].PlayerID)->HEWPowerups++; - JmgUtility::DisplayChatMessage(Get_Vehicle_Driver(obj),127,255,0,"You have aquired a high yield warhead!"); + JmgUtility::DisplayChatMessage(Get_Vehicle_Driver(obj),127,255,0,"You have acquired a high yield warhead!"); Create_2D_Sound_Player(Get_Vehicle_Driver(obj),"SFX.Comet_Busters_Pickup_Powerup"); break; case 5: PerkSystemIncreasePlayerPerkUnlockAmount(Get_Vehicle_Driver(obj),105,1); - JmgUtility::DisplayChatMessage(Get_Vehicle_Driver(obj),127,255,0,"You have aquired another life!"); + JmgUtility::DisplayChatMessage(Get_Vehicle_Driver(obj),127,255,0,"You have acquired another life!"); MiniGamePlayerControlSystem[x].NumberOfLives++; MiniGamePlayerControlSystem[x].LastNewLifeScore = MiniGamePlayerControlSystem[x].Score; RenCometBustersScoreControl.Get_Current_Player_Score_Node(MiniGamePlayerControlSystem[x].PlayerID)->ExtraLifePowerups++; @@ -1876,21 +1877,21 @@ PerkSystemIncreasePlayerPerkUnlockAmount(Get_Vehicle_Driver(obj),110,1); RenCometBustersScoreControl.Get_Current_Player_Score_Node(MiniGamePlayerControlSystem[x].PlayerID)->PickedUpDrone++; MiniGamePlayerControlSystem[x].DronePowerup = true; - JmgUtility::DisplayChatMessage(Get_Vehicle_Driver(obj),127,255,0,"You have aquired a Drone!"); + JmgUtility::DisplayChatMessage(Get_Vehicle_Driver(obj),127,255,0,"You have acquired a Drone!"); Create_2D_Sound_Player(Get_Vehicle_Driver(obj),"SFX.Comet_Busters_Pickup_Powerup"); break; case 12: PerkSystemIncreasePlayerPerkUnlockAmount(Get_Vehicle_Driver(obj),50,1); RenCometBustersScoreControl.Get_Current_Player_Score_Node(MiniGamePlayerControlSystem[x].PlayerID)->RegenPowerups++; RapidPowerRegen = 120; - JmgUtility::DisplayChatMessage(Get_Vehicle_Driver(obj),127,255,0,"You have aquired a rapid energy cell regen for 2 minutes!"); + JmgUtility::DisplayChatMessage(Get_Vehicle_Driver(obj),127,255,0,"You have acquired a rapid energy cell regen for 2 minutes!"); Create_2D_Sound_Player(Get_Vehicle_Driver(obj),"SFX.Comet_Busters_Pickup_Powerup_Health"); break; case 13: PerkSystemIncreasePlayerPerkUnlockAmount(Get_Vehicle_Driver(obj),107,1); RenCometBustersScoreControl.Get_Current_Player_Score_Node(MiniGamePlayerControlSystem[x].PlayerID)->DoublePointsPowerups++; MiniGamePlayerControlSystem[x].DoublePointsTime = 60; - JmgUtility::DisplayChatMessage(Get_Vehicle_Driver(obj),127,255,0,"You have aquired a double points powerup for 1 minute!"); + JmgUtility::DisplayChatMessage(Get_Vehicle_Driver(obj),127,255,0,"You have acquired a double points powerup for 1 minute!"); Create_2D_Sound_Player(Get_Vehicle_Driver(obj),"SFX.Comet_Busters_Pickup_Powerup_Points"); break; case 14: @@ -1925,14 +1926,14 @@ PerkSystemIncreasePlayerPerkUnlockAmount(Get_Vehicle_Driver(obj),113,1); RenCometBustersScoreControl.Get_Current_Player_Score_Node(MiniGamePlayerControlSystem[x].PlayerID)->PickedUpDroneSwarm++; MiniGamePlayerControlSystem[x].DroneSwarmPowerup = true; - JmgUtility::DisplayChatMessage(Get_Vehicle_Driver(obj),127,255,0,"You have aquired drone swarm calling codes!"); + JmgUtility::DisplayChatMessage(Get_Vehicle_Driver(obj),127,255,0,"You have acquired drone swarm calling codes!"); Create_2D_Sound_Player(Get_Vehicle_Driver(obj),"SFX.Comet_Busters_Pickup_Powerup"); break; case 16: PerkSystemIncreasePlayerPerkUnlockAmount(Get_Vehicle_Driver(obj),109,1); RenCometBustersScoreControl.Get_Current_Player_Score_Node(MiniGamePlayerControlSystem[x].PlayerID)->RegenPowerups++; ExtraShotActive = 120; - JmgUtility::DisplayChatMessage(Get_Vehicle_Driver(obj),127,255,0,"You have aquired a 2 minute weapon upgrade!"); + JmgUtility::DisplayChatMessage(Get_Vehicle_Driver(obj),127,255,0,"You have acquired a 2 minute weapon upgrade!"); Create_2D_Sound_Player(Get_Vehicle_Driver(obj),"SFX.Comet_Busters_Pickup_Powerup_Health"); Set_Current_Clip_Bullets(obj,Get_Current_Clip_Bullets(obj)+1); break; @@ -2852,7 +2853,7 @@ case 4: JmgUtility::DisplayChatMessage(sender,200,200,125,"Selected Special Ability: Energy Regen");break; case 5 :JmgUtility::DisplayChatMessage(sender,200,200,125,"Selected Special Ability: Weapons Upgrade");break; case 6: JmgUtility::DisplayChatMessage(sender,200,200,125,"Selected Special Ability: Drone");break; - case 7: JmgUtility::DisplayChatMessage(sender,200,200,125,"Selected Special Ability: High Explosive Warhead");break; + case 7: JmgUtility::DisplayChatMessage(sender,200,200,125,"Selected Special Ability: High Yield Warhead");break; case 8: JmgUtility::DisplayChatMessage(sender,200,200,125,"Selected Special Ability: SOS Beacon");break; case 9: JmgUtility::DisplayChatMessage(sender,200,200,125,"Selected Special Ability: Drone Swarm");break; default: JmgUtility::DisplayChatMessage(sender,200,200,125,"Selected Special Ability: None");break; @@ -2969,7 +2970,7 @@ case 4: JmgUtility::DisplayChatMessage(sender,200,200,125,"Selected Special Ability: Energy Regen");break; case 5 :JmgUtility::DisplayChatMessage(sender,200,200,125,"Selected Special Ability: Weapons Upgrade");break; case 6: JmgUtility::DisplayChatMessage(sender,200,200,125,"Selected Special Ability: Drone");break; - case 7: JmgUtility::DisplayChatMessage(sender,200,200,125,"Selected Special Ability: High Explosive Warhead");break; + case 7: JmgUtility::DisplayChatMessage(sender,200,200,125,"Selected Special Ability: High Yield Warhead");break; case 8: JmgUtility::DisplayChatMessage(sender,200,200,125,"Selected Special Ability: SOS Beacon");break; case 9: JmgUtility::DisplayChatMessage(sender,200,200,125,"Selected Special Ability: Drone Swarm");break; default: JmgUtility::DisplayChatMessage(sender,200,200,125,"Selected Special Ability: None");break; @@ -2991,7 +2992,7 @@ if (CheckIfPlayerHasPerkUnlocked(player,110)) JmgUtility::DisplayChatMessage(player,200,200,125,"6 - 20% chance of being granted a Drone on spawn."); if (CheckIfPlayerHasPerkUnlocked(player,111)) - JmgUtility::DisplayChatMessage(player,200,200,125,"7 - 5% chance of being granted a High Explosive Warhead on spawn."); + JmgUtility::DisplayChatMessage(player,200,200,125,"7 - 5% chance of being granted a High Yield Warhead on spawn."); if (CheckIfPlayerHasPerkUnlocked(player,112)) JmgUtility::DisplayChatMessage(player,200,200,125,"8 - 2.5% chance of being granted a SOS Beacon on spawn."); if (CheckIfPlayerHasPerkUnlocked(player,113)) @@ -3259,8 +3260,8 @@ } void JMG_CMTB_The_Moon_Script::Created(GameObject *obj) { + JMG_CMTB_Main_Game_Control::MoonID = Commands->Get_ID(obj); lastHealth = Commands->Get_Health(obj); - moonKilled = false; RenCometBustersList += TypeObject(obj,2626.5625f,51.25f,TheMoon); Commands->Start_Timer(obj,this,Commands->Get_Random(5.0f,8.75f),5437); } @@ -3273,7 +3274,7 @@ Commands->Start_Timer(obj,this,Commands->Get_Random(5.0f,8.75f),5437); return; } - if (RenCometBustersList.CountType(Mine) < 150) + if (RenCometBustersList.CountType(Mine) < 50) for (int x = 0;x < 2;x++) { int Random = Commands->Get_Random_Int(0,16); @@ -3304,17 +3305,16 @@ { if (!damager || damage <= 0 || obj == damager) return; - lastHealth = Commands->Get_Health(obj); int damagerId = Commands->Get_Preset_ID(damager); if (damagerId != 1000000077 && damagerId != 1000000091 && damagerId != 1000000250 && !Commands->Is_A_Star(damager)) - Commands->Apply_Damage(obj,-damage,"None",damager); + Commands->Set_Health(obj,lastHealth); + else + lastHealth = Commands->Get_Health(obj); } void JMG_CMTB_The_Moon_Script::Killed(GameObject *obj, GameObject *damager) { - if (damager || !JMG_CMTB_Main_Game_Control::GameInProgress)//TODO remove this to remove end game lage blast + if (damager || !JMG_CMTB_Main_Game_Control::GameInProgress) { - moonKilled = true; - Commands->Create_Explosion_At_Bone("Explosion_Moon",obj,"Scale",0); int Number = (int)(JMG_CMTB_Main_Game_Control::CMTBLevel*0.2f); char params[512]; sprintf(params,"%d,%.3f %.3f %.3f",3,Commands->Get_Position(obj).X,Commands->Get_Position(obj).Y,Commands->Get_Position(obj).Z); @@ -3326,32 +3326,17 @@ } GameObject *Powerup = Commands->Create_Object("CMTB_Powerup_Object",Commands->Get_Position(obj)); Commands->Attach_Script(Powerup,"JMG_CMTB_Powerup_Script","3,0"); - GameObject *moonHolder = Commands->Find_Object(JMG_CMTB_Main_Game_Control::MoonHolderID); - if (moonHolder) - Commands->Destroy_Object(moonHolder); - RenCometBustersList -= obj; RenCometBustersList.GrantScoreToKiller(damager,0.0,TheMoon); } + Commands->Create_Explosion_At_Bone("Explosion_Moon",obj,"Scale",0); } void JMG_CMTB_The_Moon_Script::Destroyed(GameObject *obj) { - if (!moonKilled && JMG_CMTB_Main_Game_Control::GameInProgress) - { - GameObject *moonHolder = Commands->Find_Object(JMG_CMTB_Main_Game_Control::MoonHolderID); - if (moonHolder) - { - GameObject *moon = Commands->Create_Object_At_Bone(moonHolder,"TheMoon!","moon"); - Commands->Attach_To_Object_Bone(moon,moonHolder,"moon"); - int MaxPlayerCount = 0; - for (int x = 0;x < MaxGamePlayerCount;x++) - if (MiniGamePlayerControlSystem[x].GamePlayerID) - MaxPlayerCount++; - Set_Max_Health(moon,200.0f*MaxPlayerCount); - Commands->Set_Health(moon,lastHealth ? lastHealth+10 : 10); - } - RenCometBustersList -= obj; - return; - } + GameObject *moonHolder = Commands->Find_Object(JMG_CMTB_Main_Game_Control::MoonHolderID); + if (moonHolder) + Commands->Destroy_Object(moonHolder); + RenCometBustersList -= obj; + JMG_CMTB_Main_Game_Control::MoonID = 0; } bool JMG_CMTB_The_Moon_Script::EnableSpawnPositions(GameObject *obj) { @@ -3375,7 +3360,7 @@ { LastDistance = 0.0f; Commands->Set_Model(obj,"CMTBChargeSpark"); - Commands->Start_Timer(obj,this,4.0f,5437); + Commands->Start_Timer(obj,this,3.75f,5436); GameObject *Player = Commands->Find_Object(Get_Int_Parameter("ControllerShipID")); Commands->Set_Facing(obj,Commands->Get_Facing(Player)); Commands->Attach_To_Object_Bone(Player,obj,"origin"); @@ -3384,6 +3369,17 @@ } void JMG_CMTB_Ship_Super_Weapon::Timer_Expired(GameObject *obj,int number) { + if (number == 5436) + { + Commands->Start_Timer(obj,this,0.25f,5437); + for (SLNode *current = GameObjManager::SmartGameObjList.Head();current;current = current->Next()) + { + SmartGameObj *o = current->Data(); + if (!o || !Is_Script_Attached(o,"JMG_CMTB_Player_Drone")) + continue; + Commands->Send_Custom_Event(obj,o,7043454,0,Commands->Get_Random(0.0f,0.25f)); + } + } if (number == 5437) { LastDistance = 0.0f; @@ -3391,13 +3387,6 @@ Commands->Set_Animation(obj,"CmtBSuperWeapon.CmtBSuperWeapon",0,0,0,89,0); Commands->Create_Sound("SFX.Comet_Busters_Super_Weapon_Fire",Commands->Get_Position(obj),obj); Commands->Start_Timer(obj,this,0.1f,5438); - for (int x = 0;x < MaxGamePlayerCount;x++) - for (int y = 0;y < 2;y++) - { - GameObject *Drone = Commands->Find_Object(MiniGamePlayerControlSystem[x].Drones[y]); - if (Drone) - Commands->Send_Custom_Event(obj,Drone,7043454,0,0.0f); - } } if (number == 5438) { @@ -3511,49 +3500,14 @@ void JMG_CMTB_Cargo_Ship_Script::Created(GameObject *obj) { Commands->Enable_Engine(obj,true); - RenCometBustersList += TypeObject(obj,0.0,0.0f,CargoShip); - GameObject *SPOT = Commands->Create_Object("Daves Arrow",Vector3(0.0f,0.0f,0.0f)); - Commands->Set_Model(SPOT,"w_invs"); - RenCometBustersList += TypeObject(SPOT,2.25f,1.5f,CargoShip); - Commands->Attach_To_Object_Bone(SPOT,obj,"Colliders003"); - Commands->Disable_Physical_Collisions(SPOT); - ShipCollideID[0] = Commands->Get_ID(SPOT); - SPOT = Commands->Create_Object("Daves Arrow",Vector3(0.0f,0.0f,0.0f)); - Commands->Set_Model(SPOT,"w_invs"); - RenCometBustersList += TypeObject(SPOT,2.25f,1.5f,CargoShip); - Commands->Attach_To_Object_Bone(SPOT,obj,"Colliders004"); - Commands->Disable_Physical_Collisions(SPOT); - ShipCollideID[1] = Commands->Get_ID(SPOT); - SPOT = Commands->Create_Object("Daves Arrow",Vector3(0.0f,0.0f,0.0f)); - Commands->Set_Model(SPOT,"w_invs"); - RenCometBustersList += TypeObject(SPOT,2.25f,1.5f,CargoShip); - Commands->Attach_To_Object_Bone(SPOT,obj,"Colliders005"); - Commands->Disable_Physical_Collisions(SPOT); - ShipCollideID[2] = Commands->Get_ID(SPOT); - SPOT = Commands->Create_Object("Daves Arrow",Vector3(0.0f,0.0f,0.0f)); - Commands->Set_Model(SPOT,"w_invs"); - RenCometBustersList += TypeObject(SPOT,20.25f,4.5f,CargoShip); - Commands->Attach_To_Object_Bone(SPOT,obj,"Colliders001"); - Commands->Disable_Physical_Collisions(SPOT); - ShipCollideID[3] = Commands->Get_ID(SPOT); - SPOT = Commands->Create_Object("Daves Arrow",Vector3(0.0f,0.0f,0.0f)); - Commands->Set_Model(SPOT,"w_invs"); - RenCometBustersList += TypeObject(SPOT,20.25f,4.5f,CargoShip); - Commands->Attach_To_Object_Bone(SPOT,obj,"Colliders000"); - Commands->Disable_Physical_Collisions(SPOT); - ShipCollideID[4] = Commands->Get_ID(SPOT); - SPOT = Commands->Create_Object("Daves Arrow",Vector3(0.0f,0.0f,0.0f)); - Commands->Set_Model(SPOT,"w_invs"); - RenCometBustersList += TypeObject(SPOT,20.25f,4.5f,CargoShip); - Commands->Attach_To_Object_Bone(SPOT,obj,"Colliders002"); - Commands->Disable_Physical_Collisions(SPOT); - ShipCollideID[5] = Commands->Get_ID(SPOT); - SPOT = Commands->Create_Object("Daves Arrow",Vector3(0.0f,0.0f,0.0f)); - Commands->Set_Model(SPOT,"w_invs"); - RenCometBustersList += TypeObject(SPOT,2.25f,1.5f,CargoShip); - Commands->Attach_To_Object_Bone(SPOT,obj,"Colliders006"); - Commands->Disable_Physical_Collisions(SPOT); - ShipCollideID[6] = Commands->Get_ID(SPOT); + RenCometBustersList += TypeObject(obj,0.0,0.0f,CargoShip,Commands->Get_ID(obj)); + CreateShipCollision(obj,0,"Colliders003",1.5f); + CreateShipCollision(obj,1,"Colliders004",1.5f); + CreateShipCollision(obj,2,"Colliders005",1.5f); + CreateShipCollision(obj,6,"Colliders006",1.5f); + CreateShipCollision(obj,3,"Colliders001",4.5f); + CreateShipCollision(obj,4,"Colliders000",4.5f); + CreateShipCollision(obj,5,"Colliders002",4.5f); GameObject *AAnimation = Commands->Create_Object("Daves Arrow",Commands->Get_Position(obj));//0.431f Commands->Set_Facing(AAnimation,Commands->Get_Random(-180.0f,180.0f)); @@ -3569,7 +3523,8 @@ { char TurretPosName[32]; sprintf(TurretPosName,"TrtSpots%03d",x); - SPOT = Commands->Create_Object("CMTB_Cargo_Ship_Turret",Vector3(0.0f,0.0f,0.0f));Commands->Attach_Script(SPOT,"JMG_CMTB_Cargo_Ship_Turret",""); + GameObject *SPOT = Commands->Create_Object("CMTB_Cargo_Ship_Turret",Vector3(0.0f,0.0f,0.0f)); + Commands->Attach_Script(SPOT,"JMG_CMTB_Cargo_Ship_Turret",""); Commands->Attach_To_Object_Bone(SPOT,AAnimation,TurretPosName); Commands->Disable_Physical_Collisions(SPOT); Turrets[x] = Commands->Get_ID(SPOT); @@ -3691,6 +3646,19 @@ for (int x = 0;x < 7;x++) MiniGamePlayerControlSystem[Get_Int_Parameter("PlayerNumber")].CargoShipIDs[x] = 0; } +void JMG_CMTB_Cargo_Ship_Script::CreateShipCollision(GameObject *obj,int index,const char *boneName,float size) +{ + GameObject *SPOT = Commands->Create_Object("Daves Arrow",Vector3(0.0f,0.0f,0.0f)); + RenCometBustersList += TypeObject(SPOT,size*size,size,CargoShip,Commands->Get_ID(obj)); + Commands->Set_Model(SPOT,"w_invs"); + Commands->Attach_To_Object_Bone(SPOT,obj,boneName); + Commands->Disable_Physical_Collisions(SPOT); + ShipCollideID[index] = Commands->Get_ID(SPOT); + char params[225]; + sprintf(params,"%d",Commands->Get_ID(obj)); + Commands->Attach_Script(SPOT,"JMG_CMTB_Cargo_Ship_Child_Script",params); + Commands->Disable_Physical_Collisions(SPOT); +} void JMG_CMTB_Cargo_Ship_Turret::Created(GameObject *obj) { MissAmount = 1.0f; @@ -3900,6 +3868,7 @@ Commands->Start_Timer(obj,this,1.0f,5436); Commands->Start_Timer(obj,this,0.25f,5437); Commands->Start_Timer(obj,this,0.1f,5438); + obj->As_PhysicalGameObj()->Peek_Physical_Object()->Set_Collision_Group(Collision_Group_Type::SOLDIER_GHOST_COLLISION_GROUP); } void JMG_CMTB_Player_Drone::Custom(GameObject *obj,int message,int param,GameObject *sender) { @@ -4431,6 +4400,12 @@ break; } } +void JMG_CMTB_Cargo_Ship_Child_Script::Killed(GameObject *obj, GameObject *damager) +{ + GameObject *parent = Commands->Find_Object(Get_Int_Parameter("ParentId")); + if (parent) + Commands->Apply_Damage(parent,99999.0,"None",0); +} ScriptRegistrant JMG_Create_Ship_On_Poke_Registrant("JMG_Create_Ship_On_Poke","CreateSpot:vector3,ShipPreset=Comet_Busters_Ship_Blue:string,SpawnSpotExplosion=Explosion_Clear_Spawn_Point:string,InvisibleObject=Invisible_Spectator_Box:string"); ScriptRegistrant JMG_Advanced_Bounce_Zone_Registrant("JMG_Advanced_Bounce_Zone","XAmount=0:float,YAmount=0:float,ZAmount=0:float"); ScriptRegistrant JMG_Ship_Random_Hyperspace_Registrant("JMG_Ship_Random_Hyperspace","HyperspacingModel=cometbshs:string,HyperSpaceSound=Ship_Teleport:string"); @@ -4468,4 +4443,5 @@ ScriptRegistrant JMG_CMTB_Vehicle_Face_Turret_Registrant("JMG_CMTB_Vehicle_Face_Turret",""); ScriptRegistrant JMG_CMTB_Poke_End_Map_Registrant("JMG_CMTB_Poke_End_Map",""); ScriptRegistrant JMG_CMTB_Poke_Change_Difficulty_Registrant("JMG_CMTB_Poke_Change_Difficulty",""); +ScriptRegistrant JMG_CMTB_Cargo_Ship_Child_Script_Registrant("JMG_CMTB_Cargo_Ship_Child_Script","ParentId:int"); diff -urN sourceold/shared/shared.vcxproj source/shared/shared.vcxproj --- sourceold/shared/shared.vcxproj 2024-02-14 04:13:36.000000000 -0600 +++ source/shared/shared.vcxproj 2024-03-08 20:25:22.942074200 -0600 @@ -217,6 +217,9 @@ false + + + diff -urN sourceold/shared/shared.vcxproj.filters source/shared/shared.vcxproj.filters --- sourceold/shared/shared.vcxproj.filters 2024-02-14 04:13:36.000000000 -0600 +++ source/shared/shared.vcxproj.filters 2024-03-08 20:25:22.942074200 -0600 @@ -56,4 +56,7 @@ 01. Sources + + + \ No newline at end of file diff -urN sourceold/shared/w3d_types.natvis source/shared/w3d_types.natvis --- sourceold/shared/w3d_types.natvis 1969-12-31 18:00:00.000000000 -0600 +++ source/shared/w3d_types.natvis 2024-03-08 20:25:22.942074200 -0600 @@ -0,0 +1,192 @@ + + + + + + + [{size()}] {{}} + [{size()}] {{ {*Vector} }} + [{size()}] {{ {*Vector}, {*(Vector+1)} }} + [{size()}] {{ {*Vector}, {*(Vector+1)}, {*(Vector+2)} }} + [{size()}] {{ {*Vector}, {*(Vector+1)}, {*(Vector+2)}, {*(Vector+3)} }} + [{size()}] {{ {*Vector}, {*(Vector+1)}, {*(Vector+2)}, {*(Vector+3)}, {*(Vector+4)} }} + [{size()}] {{ {*Vector}, {*(Vector+1)}, {*(Vector+2)}, {*(Vector+3)}, {*(Vector+4)}, {*(Vector+5)} }} + [{size()}] {{ {*Vector}, {*(Vector+1)}, {*(Vector+2)}, {*(Vector+3)}, {*(Vector+4)}, {*(Vector+5)}, {*(Vector+6)} }} + [{size()}] {{ {*Vector}, {*(Vector+1)}, {*(Vector+2)}, {*(Vector+3)}, {*(Vector+4)}, {*(Vector+5)}, {*(Vector+6)}, {*(Vector+7)} }} + [{size()}] {{ {*Vector}, {*(Vector+1)}, {*(Vector+2)}, {*(Vector+3)}, {*(Vector+4)}, {*(Vector+5)}, {*(Vector+6)}, {*(Vector+7)}, ... }} + + size() + Vector + + size() + Vector + + + + + + + + + [{size()}] {{}} + [{size()}] {{ {*Vector} }} + [{size()}] {{ {*Vector}, {*(Vector+1)} }} + [{size()}] {{ {*Vector}, {*(Vector+1)}, {*(Vector+2)} }} + [{size()}] {{ {*Vector}, {*(Vector+1)}, {*(Vector+2)}, {*(Vector+3)} }} + [{size()}] {{ {*Vector}, {*(Vector+1)}, {*(Vector+2)}, {*(Vector+3)}, {*(Vector+4)} }} + [{size()}] {{ {*Vector}, {*(Vector+1)}, {*(Vector+2)}, {*(Vector+3)}, {*(Vector+4)}, {*(Vector+5)} }} + [{size()}] {{ {*Vector}, {*(Vector+1)}, {*(Vector+2)}, {*(Vector+3)}, {*(Vector+4)}, {*(Vector+5)}, {*(Vector+6)} }} + [{size()}] {{ {*Vector}, {*(Vector+1)}, {*(Vector+2)}, {*(Vector+3)}, {*(Vector+4)}, {*(Vector+5)}, {*(Vector+6)}, {*(Vector+7)} }} + [{size()}] {{ {*Vector}, {*(Vector+1)}, {*(Vector+2)}, {*(Vector+3)}, {*(Vector+4)}, {*(Vector+5)}, {*(Vector+6)}, {*(Vector+7)}, ... }} + + size() + capacity() + Vector + + size() + Vector + + + + + + + [{get_header()->length}] {m_Buffer,s} + m_Buffer,s + + get_header()->length + get_header()->allocated_length + m_Buffer,s + + get_header()->length + m_Buffer + + + + + + + [{get_header()->length}] {m_Buffer,su} + m_Buffer,su + + get_header()->length + get_header()->allocated_length + m_Buffer,su + + get_header()->length + m_Buffer + + + + + + + + + + + {{ empty }} + {{ {Head.Next->Object, na}, {Head.Next->Next->Object, na}, {Head.Next->Next->Next->Object, na}, ... }} + {{ {Head.Next->Object, na}, {Head.Next->Next->Object, na}, {Head.Next->Next->Next->Object, na} }} + {{ {Head.Next->Object, na}, {Head.Next->Next->Object, na} }} + {{ {Head.Next->Object, na} }} + + + + + + it = Head.Next + + + size++ + it = it->Next + + size + + it = Head.Next + + + it->Object + it = it->Next + + + + + + + + + + + + + {{ empty }} + {{ {get_data(HeadNode), na}, {get_data(get_next(HeadNode)), na}, {get_data(get_next(get_next(HeadNode))), na}, ... }} + {{ {get_data(HeadNode), na}, {get_data(get_next(HeadNode)), na}, {get_data(get_next(get_next(HeadNode))), na} }} + {{ {get_data(HeadNode), na}, {get_data(get_next(HeadNode)), na} }} + {{ {get_data(HeadNode), na} }} + + + + + + it = HeadNode + + + size++ + it = get_next(it) + + size + + it = HeadNode + + + get_data(it) + it = get_next(it) + + + + + + + + + {{ {get_data(), na} }} + + get_data(), na + get_next(), na + + + + + {{ null }} + {{ {ReferenceTarget->ReferenceData} }} + + ReferenceTarget->ReferenceData + + + + + it = ReferenceTarget->ReferencerListHead + + + size++ + it = it->TargetReferencerListNext + + size + + + + + + it = ReferenceTarget->ReferencerListHead + + + it + it = it->TargetReferencerListNext + + + + + + \ No newline at end of file