[XP] Poison/Regen Overtime

Started by G_G, March 31, 2010, 12:28:22 am

Previous topic - Next topic

G_G

March 31, 2010, 12:28:22 am Last Edit: April 03, 2010, 08:56:14 am by Hellfire's G_G
Poison/Regen Overtime
Authors: game_guy
Version: 1.0
Type: Damage Control
Key Term: Environment Add-on



Introduction

Instead of taking poison damage or getting healed by regen every few steps, you now take it over a certain amount of time.


Features


  • Heal over time
  • Take damage over time
  • Customizable time limit (can be changed in game)



Screenshots

N/A


Demo

N/A


Script

Spoiler: ShowHide

#===============================================================================
# Poison/Regen Overtime
# Author game_guy
# Version 1.0
#-------------------------------------------------------------------------------
# Intro;
# Instead of taking poison damage or getting healed by regen every few steps,
# you now take it over a certain amount of time.
#
# Features:
# Heal over time
# Take damage over time
# Customizable time limit (can be changed in game)
#
# Instructions:
# TimeWait = # of seconds it waits until healing/taking damage
# PosionStates = Array of state id's for poison
# RegenStates = Array of state id's for regen
#
# To change the time you have to wait in game use this script call.
# $game_system.time_wait = # of seconds to wait
#
# Credits:
# game_guy ~ For making it
# Fantasist ~ Suggesting it
#
# Notes:
# This does not add Regen to the default battle system or any custom battle
# system for that matter. However this does work for Blizz-Abs.
# Also the timed damage will not work in the default battle system.
#===============================================================================
module PROver
 TimeWait = 5
 PoisonStates = []
 RegenStates = [17]
end
class Game_System
 attr_accessor :time_wait
 alias gg_system_init_lat_pro initialize
 def initialize
   @time_wait = PROver::TimeWait
   gg_system_init_lat_pro
 end
end
class Game_Party
 alias gg_check_pro_dmg_lat check_map_slip_damage
 def check_map_slip_damage
   gg_check_pro_dmg_lat
   @actors.each {|actor|
   if actor.hp > 0
     if PROver::RegenStates.any? {|i| actor.states.include?(i)}
       actor.hp += [actor.maxhp / 100, 1].max
     end
     if PROver::PoisonStates.any? {|i| actor.states.include?(i)}
       actor.hp -= [actor.maxhp / 100, 0].max
     end
   end}
 end
end
class Game_Player
 attr_accessor :check_dmg
 alias gg_init_player_lat_pro initialize
 def initialize
   @check_dmg = false
   @time = $game_system.time_wait * 40
   gg_init_player_lat_pro
 end
 alias gg_upd_player_lat_pro update
 def update
   if @check_dmg
     $game_party.check_map_slip_damage
     @check_dmg = false
   end
   if @time > 0
     @time -= 1
   elsif @time <= 0
     @time = $game_system.time_wait * 40
     @check_dmg = true
   end
   gg_upd_player_lat_pro
 end
 alias gg_inc_steps_lat_pro increase_steps
 def increase_steps
   super
   unless @move_route_forcing
     if defined?(PROver)
       $game_party.increase_steps
     else
       return gg_inc_steps_lat_pro
     end
   end
 end
end



Instructions

In the script. Place under Scene_Debug and Above Blizzard's scripts.


Compatibility

Not tested with SDK.
Tested and works with Blizz-Abs. (In case people are wondering)

This does not add Regen to the default battle system or any custom battle system for that matter. However this does work for Blizz-Abs. Also the timed damage will not work in the default battle system. This is meant to be for on the map.


Credits and Thanks


  • game_guy ~ For making it
  • Fantasist ~ For suggesting it



Author's Notes

Enjoy! :D
In case anyone's wondering, shdwlink did making something called Hot/Dot (Healing over Time/Damage over Time) However I looked through the script and I think his is different from where mine it heals/damages you over x amount of seconds.

Jek


G_G


Kett Shee

Damn, Jek beat me to it. :V
I love my games with a freshly baked Regen effect.
You're all daft cunts. I love you. <3

Spaceman McConaughey


Jragyn

hey erhm, "initialize" is spelled wrong in Game_system...
maybe yu wants to fix it?
A bright light can either illuminate or blind, but how will you know which until you open your eyes?

G_G

Quote from: jragyn00 on April 03, 2010, 12:57:42 am
hey erhm, "initialize" is spelled wrong in Game_system...
maybe yu wants to fix it?


No its not.

Jragyn

April 03, 2010, 04:56:48 am #7 Last Edit: April 03, 2010, 04:58:12 am by jragyn00
Quoteclass Game_System
 attr_accessor :time_wait
 alias gg_system_init_lat_pro initialize
 def intitialize  <------- I think this isn't quite right.
   @time_wait = PROver::TimeWait
   gg_system_init_lat_pro
 end
end


...?
This can't be right, cuz it popped an error when I threw it in my script editor :P
Once fixed, though, it worked as was expected.
A bright light can either illuminate or blind, but how will you know which until you open your eyes?

G_G

Quote from: jragyn00 on April 03, 2010, 04:56:48 am
Quoteclass Game_System
  attr_accessor :time_wait
  alias gg_system_init_lat_pro initialize
  def intitialize  <------- I think this isn't quite right.
    @time_wait = PROver::TimeWait
    gg_system_init_lat_pro
  end
end


...?
This can't be right, cuz it popped an error when I threw it in my script editor :P
Once fixed, though, it worked as was expected.


Well I dont know how a typo got in there. I tested the script before I released it. Oh well. Thanks for noticing. At the first few glances I didn't see the first t there.

Ralphness

this is a very nice scipt in my opinion i have been looking for one of these in a while now,
Thanks game_guy