The RPG Maker Resource Kit

RMRK RPG Maker Creation => XP => XP Scripts Database => Topic started by: tSwitch on October 05, 2007, 05:43:37 PM

Title: Death Watch Status v1.05
Post by: tSwitch on October 05, 2007, 05:43:37 PM
Death Watch Status
Version: 1.05
Author: NAMKCOR
Date: Oct. 6, 2007

Version History



Planned Future Versions



Description


Inflicts characters with the condition Death Watch, which gives them X number
turns to live before they are declared dead at the start of turn X

Features


Screenshots

N/A for this type of script

Instructions

Place the script above main, below any battle options
add a state called "Death Watch" or what have you
simply change turns_to_live to decide how long the character lasts
simply change DW_status_number to the number of the Death Watch skill in the database
make skills/items or whatnot that add the status Death Watch
you're all set

Script


Code: [Select]
#=====================================================================================================================
#   Death Watch Condition v1.05                                                 
#---------------------------------------------------------------------------------------------------------------------
#   Created By: NAMKCOR                                                                                                     
#   Created for the Websites: Chaos Project, RPG Maker Resource Kit
#                                                  (www.chaosproject.co.nr; www.rmrk.net)                     
#   If this script is hosted on any other website, then it is stolen, please contact           
#   me at the address given below       
#   Requested by: gameo (RMRK)
#--------------------------------------------------------------------------------------------------------------------
#   If you find any Bugs/Incompatability issues with this script, please contact me at   
#   the following e-mail address: Rockman922@aol.com, and please be descriptive   
#   with your e-mail subject, as I delete spam on sight.                                                                                                             
#--------------------------------------------------------------------------------------------------------------------
#   Function:                                                                                                                             
#    Inflicts characters with the condition Death Watch, which gives them X number
#    turns to live before they are declared dead at the start of the turn marked with
#    Death Watch 0
#                                                                         
#    Compatability:
#     most likely compatible with SDK (untested)
#     most likely compatible with battle modifications (untested)
#     no known issues at the moment       
#
#     Instructions to modify:                                                                                                                     
#      Comments and instructions for the individual customizations will be given           
#      right where they are located.  Only real skills needed are reading, typing,             
#      and copy&paste
#
#     Instructions for use:
#       All you need to do to give an enemy a death watch skill, is set the state
#       addition for any skill to + for the death watch state
#       
#--------------------------------------------------------------------------------------------------------------------
#     Version History:
#     1.0 - completed system
#     1.01 - fixed bug where the dw_turns would not be reset if status was removed
#     1.05 - death watch also affects enemies
#====================================================================================================================

#================================================================================
# START DONT TOUCH
#================================================================================
class Game_Battler
  attr_accessor :dw_turns
  alias old_init initialize
    def initialize
      old_init
      @dw_turns = 0
    end
  end
#================================================================================
# END DONT TOUCH
#================================================================================

#====================================================================================================================
# - DW_status_number - the number of the Death Watch status in the database
# - turns_to_live - the number of turns before Death Watch kills the character
#====================================================================================================================
class Scene_Battle
 
  alias oldstart start_phase2
  def start_phase2
    #modify turns to live
    @turns_to_live = 3
    #modify DW_status_number
    @DW_status_number = 17
    #===========================================================================
    # DO NOT EDIT BELOW THIS LINE UNLESS YOU KNOW WHAT YOU ARE DOING
    #===========================================================================   
    oldstart
    for i in 0...$game_party.actors.size
      for j in 0...$game_party.actors[i].states.size
        if $game_party.actors[i].hp > 0
          if $game_party.actors[i].states.include?(@DW_status_number)
            if $game_party.actors[i].dw_turns >= @turns_to_live
              $game_party.actors[i].hp = 0
              $game_party.actors[i].dw_turns = 0
              @status_window.refresh
            else
              $game_party.actors[i].dw_turns += 1
            end
          else
            $game_party.actors[i].dw_turns = 0         
          end
        end
      end
    end
    for i in 0...$game_troop.enemies.size
      for j in 0...$game_troop.enemies[i].states.size
        if $game_troop.enemies[i].hp > 0
          if $game_troop.enemies[i].states.include?(@DW_status_number)
            if $game_troop.enemies[i].dw_turns >= @turns_to_live
              $game_troop.enemies[i].hp = 0
              $game_troop.enemies[i].dw_turns = 0
              @status_window.refresh
            else
              $game_troop.enemies[i].dw_turns += 1
            end
          else
            $game_troop.enemies[i].dw_turns = 0         
          end
        end
      end
    end
  end
end

Credit



Thanks


Support


You may contact me at the email address below/found in the comments of the script
Rockman922@aol.com
or you may PM me here or on www.chaosproject.co.nr
please title your messages accordingly, I delete spam on sight

Known Compatibility Issues

No known compatibility issues at the moment

Demo


N/A at the moment

Author's Notes

Fun Fact - the comments are longer than the script itself :P

Restrictions

Created for the Websites: Chaos Project, RPG Maker Resource Kit
(www.chaosproject.co.nr; www.rmrk.net)                     
If this script is hosted on any other website, then it is stolen, please contact me at either of the locations given

If you use this script in your game, please link me to the topic
I love to see what my work is used for :P

do NOT use this script in a commercial game unless you get my permission first
Title: Re: Death Watch Status v1.01
Post by: modern algebra on October 06, 2007, 05:02:17 AM
Good job, it's a pretty cool script. It does have the limitation that it does not seem to apply to enemies, only to heroes. It might also be a nice feature to allow for the setting of multiple states, each with their own turns variable. It's a very nice, clean script and I like the skill you made here. Nice job.
Title: Re: Death Watch Status v1.01
Post by: tSwitch on October 06, 2007, 06:00:40 AM
I'll fix it up so you can use it against enemies, I completely overlooked that tbh
Title: Re: Death Watch Status v1.01
Post by: gameo on October 06, 2007, 01:28:17 PM
Nicely done. Looks fine to me.
Title: Re: Death Watch Status v1.05
Post by: tSwitch on October 06, 2007, 11:31:22 PM
it is now functional against enemies, upgraded to 1.05
(took me 5 min of copy paste work tbh)
Title: Re: Death Watch Status v1.05
Post by: Falcon on October 07, 2007, 03:33:41 AM
Well done, sorry for not moving this to the database sooner.
Title: Re: Death Watch Status v1.05
Post by: Demonic Blade on December 19, 2007, 05:20:49 PM
But what excactly does it DO? And couldn't any1 post some screenies please? :)
Title: Re: Death Watch Status v1.05
Post by: Mjustin on April 27, 2008, 08:14:58 PM
Nice script, but I found a bug. If you kill the last enemy on the screen with Death Watch, you don't win the battle until one of your characters tries to take an action. Not really a huge problem, but just a little strange.
Title: Re: Death Watch Status v1.05
Post by: tSwitch on April 28, 2008, 08:48:16 PM
hrm...I'll have to take a look into that, that's really strange
I need to probably call an update line after the hitpoints are dropped to zero, I'll fix it when this whole guild thing is over and done with
Title: Re: Death Watch Status v1.05
Post by: chipino on December 22, 2010, 03:54:07 PM
Sorry for the nooby question do I put state or skill in @DW_status_number = ?