You are viewing a potentially older version of this package. View all versions.
Def-DroneRespawn-1.0.0 icon

DroneRespawn

Destroyed drones and turrets come back on their own after a while, like the Drone Tech's drones. Server-side.

Date uploaded 2 weeks ago
Version 1.0.0
Download link Def-DroneRespawn-1.0.0.zip
Downloads 28
Dependency string Def-DroneRespawn-1.0.0

README

DroneRespawn

server-side mod - only the host needs it installed.

Destroyed drones and turrets come back on their own, like the Drone Tech's drones. No more broken drones to repair.

ko-fi

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 Tech'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 Tech

If you're a Drone Tech 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 Tech 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 Tech 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.

CHANGELOG

1.1.2

  • Strike Drones of The Back-up and other drones that only last a while no longer come back

1.1.1

  • The Drone Upgrade Station offers Happiest Mask and Defense Nucleus again. An existing config keeps its list, so remove GhostOnKill and MinorConstructOnKill from Drone Upgrade Station blacklist yourself

1.1.0

  • The Drone Upgrade Station doesn't offer items that spawn allies, e.g. Spare Drone Parts or Queen's Gland, so a drone holding one would add its own
  • The items the Drone Upgrade Station leaves out are a list in the config now, the new Drone Upgrade Station blacklist setting. It replaces No useless items for drones, so if you had turned that off, empty the list instead
  • Requires ItemStringParser

1.0.1

  • Call the survivor Drone Operator, not Drone Tech. Its setting moved to the new "Drone Operator" section, so set it again if you changed it

1.0.0

  • A player's destroyed drone or turret comes back on its own instead of leaving a broken one, like the Drone Operator's drones, also a drone lost over a pit. The dearer it is to buy, the longer it takes
  • Drones merged by the Drone Combiner Station keep the higher count of each item of both, instead of losing the other drone's items
  • The Drone Upgrade Station doesn't offer items that do nothing on a drone, e.g. Rusted Key, whose lockboxes nobody could use
  • A Drone Operator who is another survivor for a while keeps the drones destroyed meanwhile, and a player who was a Drone Operator only for a while loses those drones afterwards
  • A setting lets drones also enter the stages that normally keep allies out, e.g. the Bazaar or Void Fields
  • DroneRespawnAPI lets other mods keep drones, or whole kinds of drones, from coming back, or change how long they take