Fractal Softworks Forum

Please login or register.

Login with username, password and session length

Author Topic: Specialized CR Timer  (Read 1687 times)

isaacssv552

  • Commander
  • ***
  • Posts: 215
    • View Profile
Specialized CR Timer
« on: December 09, 2014, 04:52:00 PM »

Would it be possible to make a CR timer that only goes down when it is told to go down by a hullmod's advanceincombat function?

For example, a hull mod that makes shield deal soft flux but has a 3 minute CR timer that ticks down 1 second for every 10 flux generated by the shield. After the CR timer runs out the CR would decay 1 second for every 10 flux generated by the shield.
Logged

LazyWizard

  • Global Moderator
  • Admiral
  • *****
  • Posts: 1365
    • View Profile
    • GitHub Profile
Re: Specialized CR Timer
« Reply #1 on: December 09, 2014, 06:08:04 PM »

I believe the timer is read-only at the moment so you can't just edit it directly.

There's a mod (the repair drones in Sundog's ICE, IIRC) that achieves the same effect by modifying the getPeakCRDuration() MutableStat. You could provide a flat bonus that increases at the same rate the game's advancing to stop the countdown, then decrease the bonus where necessary to manually count down.

For the CR loss afterwards you can just call setCurrentCR(), though you'll have to compensate for the normal CR loss here as well.
« Last Edit: December 09, 2014, 06:13:32 PM by LazyWizard »
Logged

isaacssv552

  • Commander
  • ***
  • Posts: 215
    • View Profile
Re: Specialized CR Timer
« Reply #2 on: December 10, 2014, 05:07:30 AM »

Ok, I think I understand. I'll try setting the timer/CR directly. Is there a way to find how much CR the ship has lost due to factors other than the ticking CR loss?

Edit:

Would setting CR loss per second stop the CR loss from the timer but keep the timer?
« Last Edit: December 10, 2014, 08:33:25 AM by isaacssv552 »
Logged