Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
DroneRespawn
Destroyed drones and turrets come back on their own after a while, like the Drone Operator's drones. Server-side.
| Last updated | a day ago |
| Total downloads | 138 |
| Total rating | 0 |
| Categories | Server-side |
| Dependency string | Def-DroneRespawn-1.0.1 |
| Dependants | 0 other packages depend on this package |
README
DroneRespawn
server-side mod - only the host needs it installed.
Destroyed drones and turrets come back on their own, like the Drone Operator's drones. No more broken drones to repair.
How it works
- When one of your drones or turrets is destroyed, it respawns after a while, with its items, upgrades and equipment.
- The more it costs to buy, the longer it takes: 1 second per gold of the base price, so a Gunner Drone takes 40 seconds, a TC-280 350 and a Gunner Turret 35. Each upgrade from the Drone Combiner Station adds 20%.
- An Equipment Drone takes 100 seconds, since its repair costs an equipment instead of gold.
- Drones lost over a pit come back too.
- While you're dead, your drones wait until you're alive again.
- Drones that revive, e.g. with Dio's Best Friend, and the Drone Operator's own drones work as usual.
Works in every game mode. The times can be changed in the config, or in the lobby with InLobbyConfig.
Drone Combiner Station
When the station merges two drones, the one it keeps also gets the items of the other: the higher count of each item, not both added up. It also takes the other's equipment if it has none. Normally the other drone's items are simply lost. This can be turned off in the config.
Drone Upgrade Station
The station doesn't offer items that do nothing on a drone:
- Rusted Key, Encrusted Key and Shipping Request Form. A drone holding one would spawn its own lockbox or delivery each stage, which nobody can use.
- Sale Star, Chance Doll, Squid Polyp, Longstanding Solitude, scrap and Regenerating Scrap. They only work when their holder opens or uses something.
- Roll of Pennies and War Bonds. They work with gold, which a drone can't spend.
This can be turned off in the config.
Drone Operator
If you're a Drone Operator and only turn into another survivor for a while, e.g. through a survivor swap, your drones that are destroyed meanwhile aren't lost. They come back as they were, items and all, once you're a Drone Operator again. Normally they would be gone, and your skills would make new ones without their items.
The other way around, a player who was a Drone Operator only for a while loses those drones once they're back to their own survivor.
Stages
Some stages normally keep your allies out, e.g. the Bazaar or Void Fields. With Drones enter every stage turned on, your drones come along there too. It's off by default.
For mod authors
DroneRespawnAPI lets your mod decide which drones come back and how long they take. Add a soft dependency on Def.DroneRespawn and only use it when the mod is loaded.
// keep a drone from coming back: it leaves a broken drone as usual
DroneRespawnAPI.AddExemption((droneMaster, droneBody) => droneMaster.GetComponent<MyLentDrone>() != null);
// keep a whole kind of drone from coming back
DroneRespawnAPI.AddExemption(RoR2Content.DroneDefs.EquipmentDrone);
// change how long a drone takes to come back, in seconds
DroneRespawnAPI.ModifyReturnTime += (CharacterMaster droneMaster, CharacterBody droneBody, ref float seconds) => seconds *= 0.5f;
If your mod removes a drone itself, you don't need the API: set spawnedRepairObject on its EntityStates.Drone.DeathState when it starts to fall. The game then leaves no broken drone, and DroneRespawn leaves the drone alone. For a turret, set deadFormToSpawnOnDeath on its EntityStates.Turret1.DeathState to null when it starts to break down.