Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- =begin
- ======================================
- Needs System v1.02
- Created by: Apellonyx
- Released: 2 April 2013
- Last Update: 3 April 2013
- ======================================
- Terms of Use:
- You are free to use this system however you wish, in commercial and non-
- commercial games alike. If you edit the script extensively, it is not
- necessary to credit me (since you clearly only used my code as a framework),
- but I would appreciate credit if it is used in its current form, or if only
- minor changes were made to the script.
- ======================================
- Support:
- While I am not wildly active, I usually log onto "rpgmakervxace.com" daily,
- so if you have any questions pertaining to the script, you can ask any
- questions there, in the topic in which this script was released. Just as a
- warning, though, I will not edit the script to make it compatible with any
- special menu systems, but I will try to fix bugs as they come up. If you
- find one, let me know, and I'll do my best to squash the thing.
- ======================================
- Changelog:
- v1.0: 2 April 2013 - First Version
- v1.01: 3 April 2013 - Added configurable maximum values for food,
- water, and rest, and made the maximum for life a configurable value. The
- failsafe mentioned in v1.0's Instructions is no longer needed.
- v1.02: 3 April 2013 - Added support for a "reverse logic" stat, as suggested
- by esrann. It is fully configurable in the "Apellonyx" module.
- ======================================
- Requirements:
- The requirements for this script depend on how easy you want handling it to
- be. It actually doesn't require any other scripts, and will operate just
- fine as is, but using Tsukihime's "Effect Manager" script along with his
- "Effect: Set Variable" plugin will make the process of handling the needs
- much easier. Alternatively, you could use Neon Black's "Item Variable and
- Switch" script, which does the same thing as the previously mentioned ones,
- only without the extended functionality. Using either of these scripts is
- highly recommended for those who don't like common events or who want to
- save their common events for more important things than just handling one
- item each.
- ======================================
- Description:
- This sets up a needs system, which includes food, water, and rest, all of
- which affect the main need, life. The 1.02 update also added a reverse logic
- stat for toxin or radiation handling. All five stats are all handled by
- variables, and those variables can be changed at any time with a simple
- "control variables" event call (or script call; your choice).
- ======================================
- Instructions:
- First, you're going to want to set up how you want the script to run. All of
- the options are in the first module of the script, named "Apellonyx." I
- don't recommend changing anything after that module unless you know what you
- are doing.
- Second, once you have all of your options set up, you can go about setting
- up the nourishment items. This can be done in one of three ways, depending
- on whether you chose to use any of the recommended "required" scripts or
- not. If you did, then setting up the items is simple. Just tag it
- appropriately, as the script describes (<eff: set_var id op val> for
- Tsukihime's scripts, or variable[id op val] for Neon Black's script).
- If you don't use any of these scripts, it's still easy to make the items.
- All you have to do is set it up in the database as you normally would, and
- then attach an effect that calls a common event. Inside the common event,
- use the "Control Variables" call to change the appropriate variable. It's
- as simple as that.
- Remember to manually set up the initial values for each variable, and to
- turn on the needs and menu switches (and the toxin switch if you're using
- it). Otherwise, this script will do absolutely nothing.
- ======================================
- Toxin Instructions:
- The toxin stat is quite a bit more complicated than the rest. If you want to
- activate the toxin portion in your game, you must first decide how you want
- to use it. I have set up the script to handle a lot of different setups, but
- to get what you want out of it, there is a bit you need to know first.
- First and foremost, if you set the TOXINSWITCH option to 0, it won't even
- parse any other toxin related information. Your toxin stat won't change,
- unless you change it manually through scripts or items. It doesn't disable
- the system completely, but just keeps it out of the menu and keeps it from
- changing on its own. I wouldn't recommend using the system without the
- switch, since it can still kill you, and there's no way to know it's coming.
- If you set the TOXINSWITCH to something other than 0, but you set TOXINVAR
- to 0, the game will somehow still manage to hold the value and change it
- through the script if that option is enabled. Of course, you can't change it
- ingame, even with script calls ($game_variables[0] += 20 will crash the
- game, since $game_variables[0] can't exist), so you should set it to an
- actual existing variable if you're going to use the TOXINSWITCH.
- PS: I have no idea how the script manages to change a nonexistent variable,
- but it does, and I think that's cool.
- Moving on, the TOXINRATEVAR is the variable that will designate the speed
- at which the Toxin stat is changed. It works the same way as the rates for
- the other stats (where a lower number will change the stat faster than a
- higher number), but I made it a game variable so that you can change how
- fast it goes depending on where you are or what you're doing. For example,
- if you want to gain Toxin faster when you're walking through a swamp, or
- when you're fighting some sort of toxic creature, you can do that by just
- altering this variable. If you set the variable to 0, your Toxin stat won't
- change over time, but can still be changed manually.
- TOXINMOD is the option that will decide how the stat is changed. If you set
- it to a positive number, you will gain Toxin over time. If you set it to a
- negative number, you'll lose toxin over time, and if you set it to zero, you
- will have to change Toxin values manually.
- HIDETOXINZERO is a display option. If you want your Toxin bar to show at all
- times, set it to false. However, if you want it only to show when you are
- affected by Toxin, set it to true. So if it's set to true, and your toxin
- stat is zero, the Toxin bar won't appear in the menu, but as soon as your
- Toxin stat goes up, you'll know, because the Toxin bar will show up.
- And of course, TOXINDEATH is one of those options that allows you to kill
- people off. If you set it to true, you'll get a gameover as soon as you
- reach the Toxin maximum. If you set it to false, then your characters will
- get to keep on living, even though they've been poisoned to death. Because
- they're all zombie mutants.
- As for setting up medicines and whatnot, just create them in the same way
- you make the food and water, but instead of having them increase a variable,
- make them decrease the variable. Additionally, you could do like the Fallout
- games and have certain foods increase your Toxin level in addition to sating
- hunger. You know, just a suggestion.
- ======================================
- =end
- module Apellonyx
- NEEDSXPOS = 0 # X position of the needs window
- NEEDSYPOS = 248 # Y position of the needs window
- NEEDSWIDTH = 160 # Width of the needs window
- NEEDSSIZE = 20 # Text size in the needs window (looks best at 20)
- LIFEVOCAB = "Life" # Term used in the menu for the Life stat
- FOODVOCAB = "Food" # Term used in the menu for the Food stat
- WATERVOCAB = "Water" # Term used in the menu for the Water stat
- RESTVOCAB = "Rest" # Term used in the menu for the Rest stat
- TOXINVOCAB = "Toxin" # Term used in the menu for the Toxin stat
- HIDETOXINZERO = true # true: Will hide Toxin stat in menu when it is at zero.
- # false: If the TOXINSWITCH config option has been set,
- # it will show the Toxin stat in the menu, even if it is
- # at zero.
- NEEDSSWITCH = 1 # Switch ID that turns the system on
- MENUSWITCH = 2 # Switch ID that turns the system off while in the menu
- TOXINSWITCH = 5 # Switch ID that activates Toxin; set to 0 to disable
- LIFEVAR = 1 # Variable ID for the Life stat
- LIFERATE = 900 # Number of frames before the Life stat updates
- LIFEMAX = 100 # Maximum value for the Life stat
- FOODVAR = 2 # Variable ID for the Food stat
- FOODRATE = 480 # Number of frames before the Food stat updates
- FOODMAX = 110 # Maximum value for the Food stat
- WATERVAR = 3 # Variable ID for the Water stat
- WATERRATE = 360 # Number of frames before the Water stat updates
- WATERMAX = 110 # Maximum value for the Water stat
- RESTVAR = 4 # Variable ID for the Rest stat
- RESTRATE = 600 # Number of frames before the Rest stat updates
- RESTMAX = 110 # Maximum value for the Rest stat
- TOXINVAR = 5 # Variable ID for the Toxin stat; set to 0 to disable
- TOXINMAX = 1000 # Maximum value for the Toxin stat
- TOXINRATEVAR = 6 # Variable ID for the Toxin rate; 0 to disable
- TOXINMOD = 0 # Value Toxin stat changes during each update
- TIMESCALE = 7 # Variable ID for the timescale. A timescale of 0 or 1
- # will have no effect on the needs rates. Setting it
- # higher, though, will make needs deplete faster, which
- # is useful for making depletion occur more quickly on
- # certain maps (especially world maps). Setting it to 2
- # will make needs drain twice as quickly, while 3 drains
- # them three times as fast, and so on.
- LIFEGCOLOR1 = 17 # Color to the left on Life stat's gauge
- LIFEGCOLOR2 = 6 # Color to the right on Life stat's gauge
- FOODGCOLOR1 = 3 # Color to the left on Food stat's gauge
- FOODGCOLOR2 = 24 # Color to the right on Food stat's gauge
- WATERGCOLOR1 = 16 # Color to the left on Water stat's gauge
- WATERGCOLOR2 = 4 # Color to the right on Water stat's gauge
- RESTGCOLOR1 = 31 # Color to the left on Rest stat's gauge
- RESTGCOLOR2 = 13 # Color to the right on Rest stat's gauge
- TOXINGCOLOR1 = 10 # Color to the left on Toxin stat's gauge
- TOXINGCOLOR2 = 2 # Color to the right on Toxin stat's gauge
- EXCCOLOR = 11 # Color of gauge numbers when stat is above 100
- SATCOLOR = 24 # Color of gauge numbers when stat is 75-100
- AVECOLOR = 14 # Color of gauge numbers when stat is 25-74
- DANCOLOR = 20 # Color of gauge numbers when stat is 1-24
- DEPCOLOR = 18 # Color of gauge numbers when stat is 0
- DEATHATZERO = true # Setting this to true will cause a gameover when your
- # life reaches zero. If false, nothing will happen when
- # you reach zero life.
- TOXINDEATH = true # Setting this to true will cause a gameover if your
- # Toxin stat reaches its maximum value. If false, it
- # will simply continue to alter the life value.
- end # module Apellonyx
- #===========================
- # Don't edit past this point unless you know what you're doing
- #===========================
- class Scene_Base
- alias needs_time_update update
- def update
- if $game_switches[Apellonyx::NEEDSSWITCH] == true
- if $game_switches[Apellonyx::MENUSWITCH] == true
- if $game_variables[Apellonyx::TIMESCALE] == 0
- if Graphics.frame_count % Apellonyx::LIFERATE == 0
- life_update
- end # if Graphics.frame_count % Apellonyx::LIFERATE == 0
- else
- timed_liferate = Apellonyx::LIFERATE / $game_variables[Apellonyx::TIMESCALE]
- if Graphics.frame_count % timed_liferate == 0
- life_update
- end # if Graphics.frame_count % timed_liferate == 0
- end # if $game_variables[Apellonyx::TIMESCALE] == 0
- if $game_variables[Apellonyx::TIMESCALE] == 0
- if Graphics.frame_count % Apellonyx::FOODRATE == 0
- if $game_variables[Apellonyx::FOODVAR] >= 1
- $game_variables[Apellonyx::FOODVAR] -= 1
- puts "FOODVAR == " + $game_variables[Apellonyx::FOODVAR].to_s
- end #if $game_variables[Apellonyx::FOODVAR] >= 1
- end # if Graphics.frame_count % Apellonyx::FOODRATE == 0
- else
- timed_foodrate = Apellonyx::FOODRATE / $game_variables[Apellonyx::TIMESCALE]
- if Graphics.frame_count % timed_foodrate == 0
- if $game_variables[Apellonyx::FOODVAR] >= 1
- $game_variables[Apellonyx::FOODVAR] -= 1
- puts "FOODVAR == " + $game_variables[Apellonyx::FOODVAR].to_s
- end # if $game_variables[Apellonyx::FOODVAR] >= 1
- end #if Graphics.frame_count % timed_foodrate == 0
- end # if $game_variables[Apellonyx::TIMESCALE] == 0
- if $game_variables[Apellonyx::TIMESCALE] == 0
- if Graphics.frame_count % Apellonyx::WATERRATE == 0
- if $game_variables[Apellonyx::WATERVAR] >= 1
- $game_variables[Apellonyx::WATERVAR] -= 1
- puts "WATERVAR == " + $game_variables[Apellonyx::WATERVAR].to_s
- end # if $game_variables[Apellonyx::WATERVAR] >= 1
- end # if Graphics.frame_count % Apellonyx::WATERRATE == 0
- else
- timed_waterrate = Apellonyx::WATERRATE / $game_variables[Apellonyx::TIMESCALE]
- if Graphics.frame_count % timed_waterrate == 0
- if $game_variables[Apellonyx::WATERVAR] >= 1
- $game_variables[Apellonyx::WATERVAR] -= 1
- puts "WATERVAR == " + $game_variables[Apellonyx::WATERVAR].to_s
- end # if $game_variables[Apellonyx::WATERVAR] >= 1
- end # if Graphics.frame_count % timed_waterrate == 0
- end # if $game_variables[Apellonyx::TIMESCALE] == 0
- if $game_variables[Apellonyx::TIMESCALE] == 0
- if Graphics.frame_count % Apellonyx::RESTRATE == 0
- if $game_variables[Apellonyx::RESTVAR] >= 1
- $game_variables[Apellonyx::RESTVAR] -= 1
- puts "RESTVAR == " + $game_variables[Apellonyx::RESTVAR].to_s
- end # if $game_variables[Apellonyx::RESTVAR] >= 1
- end # if Graphics.frame_count % Apellonyx::RESTRATE == 0
- else
- timed_restrate = Apellonyx::RESTRATE / $game_variables[Apellonyx::TIMESCALE]
- if Graphics.frame_count % timed_restrate == 0
- if $game_variables[Apellonyx::RESTVAR] >= 1
- $game_variables[Apellonyx::RESTVAR] -= 1
- puts "RESTVAR == " + $game_variables[Apellonyx::RESTVAR].to_s
- end # if $game_variables[Apellonyx::RESTVAR] >= 1
- end # if Graphics.frame_count % timed_restrate == 0
- end # if $game_variables[Apellonyx::TIMESCALE] == 0
- if Apellonyx::TOXINSWITCH != 0
- if $game_switches[Apellonyx::TOXINSWITCH] == true
- if Apellonyx::TOXINRATEVAR != 0
- if $game_variables[Apellonyx::TOXINRATEVAR] != 0
- if $game_variables[Apellonyx::TIMESCALE] == 0
- if Graphics.frame_count % $game_variables[Apellonyx::TOXINRATEVAR] == 0
- if $game_variables[Apellonyx::TOXINVAR] < Apellonyx::TOXINMAX
- $game_variables[Apellonyx::TOXINVAR] += Apellonyx::TOXINMOD
- puts "TOXINVAR == " + $game_variables[Apellonyx::TOXINVAR].to_s
- end # if $game_variables[Apellonyx::TOXINVAR] < Apellonyx::TOXINMAX
- end # if Graphics.frame_count % $game_variables[Apellonyx::TOXINRATEVAR] == 0
- else
- timed_toxinrate = $game_variables[Apellonyx::TOXINRATEVAR] / $game_variables[Apellonyx::TIMESCALE]
- if Graphics.frame_count % timed_toxinrate == 0
- if $game_variables[Apellonyx::TOXINVAR] < Apellonyx::TOXINMAX
- $game_variables[Apellonyx::TOXINVAR] += Apellonyx::TOXINMOD
- puts "TOXINVAR == " + $game_variables[Apellonyx::TOXINVAR].to_s
- end # if $game_variables[Apellonyx::TOXINVAR] < Apellonyx::TOXINMAX
- end # if Graphics.frame_count % timed_toxinrate == 0
- end # if $game_variables[Apellonyx::TIMESCALE] == 0
- end # if $game_variables[Apellonyx::TOXINRATEVAR] != 0
- end # if Apellonyx::TOXINRATEVAR != 0
- end # if $game_switches[Apellonyx::TOXINSWITCH] == true
- end # if Apellonyx::TOXINSWITCH != 0
- end # if $game_switches[Apellonyx::MENUSWITCH] == true
- if $game_variables[Apellonyx::LIFEVAR] > Apellonyx::LIFEMAX
- $game_variables[Apellonyx::LIFEVAR] = Apellonyx::LIFEMAX
- end
- if $game_variables[Apellonyx::FOODVAR] > Apellonyx::FOODMAX
- $game_variables[Apellonyx::FOODVAR] = Apellonyx::FOODMAX
- end
- if $game_variables[Apellonyx::WATERVAR] > Apellonyx::WATERMAX
- $game_variables[Apellonyx::WATERVAR] = Apellonyx::WATERMAX
- end
- if $game_variables[Apellonyx::RESTVAR] > Apellonyx::RESTMAX
- $game_variables[Apellonyx::RESTVAR] = Apellonyx::RESTMAX
- end
- if Apellonyx::TOXINVAR != 0
- if Apellonyx::TOXINDEATH == true
- if $game_variables[Apellonyx::TOXINVAR] >= Apellonyx::TOXINMAX
- SceneManager.call(Scene_Gameover)
- end # if $game_variables[Apellonyx::TOXINVAR] >= Apellonyx::TOXINMAX
- else
- if $game_variables[Apellonyx::TOXINVAR] > Apellonyx::TOXINMAX
- $game_variables[Apellonyx::TOXINVAR] = Apellonyx::TOXINMAX
- end
- end # if Apellonyx::TOXINDEATH == true
- if $game_variables[Apellonyx::TOXINVAR] < 0
- $game_variables[Apellonyx::TOXINVAR] = 0
- end
- end # if Apellonyx::TOXINVAR != 0
- end # if $game_switches[Apellonyx::NEEDSSWITCH] == true
- needs_time_update
- end # def update
- def life_update
- food_mod = -2 if 0 >= $game_variables[Apellonyx::FOODVAR]
- food_mod = -1 if (1..25) === $game_variables[Apellonyx::FOODVAR]
- food_mod = 0 if (26..75) === $game_variables[Apellonyx::FOODVAR]
- food_mod = 1 if (76..100) === $game_variables[Apellonyx::FOODVAR]
- food_mod = 2 if 100 < $game_variables[Apellonyx::FOODVAR]
- water_mod = -2 if 0 >= $game_variables[Apellonyx::WATERVAR]
- water_mod = -1 if (1..25) === $game_variables[Apellonyx::WATERVAR]
- water_mod = 0 if (26..75) === $game_variables[Apellonyx::WATERVAR]
- water_mod = 1 if (76..100) === $game_variables[Apellonyx::WATERVAR]
- water_mod = 2 if 100 < $game_variables[Apellonyx::WATERVAR]
- rest_mod = -2 if 0 >= $game_variables[Apellonyx::FOODVAR]
- rest_mod = -1 if (1..25) === $game_variables[Apellonyx::RESTVAR]
- rest_mod = 0 if (26..75) === $game_variables[Apellonyx::RESTVAR]
- rest_mod = 1 if (76..100) === $game_variables[Apellonyx::RESTVAR]
- rest_mod = 2 if 100 < $game_variables[Apellonyx::RESTVAR]
- if Apellonyx::TOXINSWITCH == 0
- toxin_mod = 0
- else
- toxin_25 = Apellonyx::TOXINMAX / 4
- toxin_26 = toxin_25 + 1
- toxin_50 = toxin_25 * 2
- toxin_51 = toxin_50 + 1
- toxin_75 = toxin_25 * 3
- toxin_76 = toxin_75 + 1
- toxin_99 = Apellonyx::TOXINMAX - 1
- toxin_mod = 1 if 0 >= $game_variables[Apellonyx::TOXINVAR]
- toxin_mod = 0 if (1..toxin_25) === $game_variables[Apellonyx::TOXINVAR]
- toxin_mod = -2 if (toxin_26..toxin_50) === $game_variables[Apellonyx::TOXINVAR]
- toxin_mod = -4 if (toxin_51..toxin_75) === $game_variables[Apellonyx::TOXINVAR]
- toxin_mod = -6 if (toxin_76..toxin_99) === $game_variables[Apellonyx::TOXINVAR]
- toxin_mod = -8 if Apellonyx::TOXINMAX == $game_variables[Apellonyx::TOXINVAR]
- end # if Apellonyx::TOXINVAR == 0
- life_mod = food_mod + water_mod + rest_mod + toxin_mod
- $game_variables[Apellonyx::LIFEVAR] += life_mod
- puts "LIFEVAR == " + $game_variables[Apellonyx::LIFEVAR].to_s
- if $game_variables[Apellonyx::LIFEVAR] > Apellonyx::LIFEMAX
- $game_variables[Apellonyx::LIFEVAR] = Apellonyx::LIFEMAX
- puts "LIFEVAR OVER 100 - SET TO " + $game_variables[Apellonyx::LIFEVAR].to_s
- end # if $game_variables[Apellonyx::LIFEVAR] > 100
- if $game_variables[Apellonyx::LIFEVAR] <= 0
- $game_variables[Apellonyx::LIFEVAR] = 0
- puts "LIFEVAR BELOW 0 - SET TO " + $game_variables[Apellonyx::LIFEVAR].to_s
- if Apellonyx::DEATHATZERO == true
- SceneManager.call(Scene_Gameover)
- end
- end # if $game_variables[Apellonyx::LIFEVAR] <= 0
- end # def l_update
- end # class Scene_Base
- class Scene_MenuBase < Scene_Base
- alias needs_off_in_menu start
- def start
- $game_switches[Apellonyx::MENUSWITCH] = false
- puts "MENUSWITCH == " + $game_switches[Apellonyx::MENUSWITCH].to_s
- needs_off_in_menu
- end # def start
- alias needs_on_out_of_menu terminate
- def terminate
- $game_switches[Apellonyx::MENUSWITCH] = true
- puts "MENUSWITCH == " + $game_switches[Apellonyx::MENUSWITCH].to_s
- needs_on_out_of_menu
- end # def terminate
- end # class Scene_MenuBase < Scene_Base
- class Scene_Gameover < Scene_Base
- alias needs_off_at_gameover start
- def start
- $game_switches[Apellonyx::NEEDSSWITCH] = false
- $game_switches[Apellonyx::MENUSWITCH] = false
- $game_switches[Apellonyx::TOXINSWITCH] = false
- puts "NEEDSSWITCH == " + $game_switches[Apellonyx::MENUSWITCH].to_s
- puts "MENUSWITCH == " + $game_switches[Apellonyx::MENUSWITCH].to_s
- puts "TOXINSWITCH == " + $game_switches[Apellonyx::MENUSWITCH].to_s
- needs_off_at_gameover
- end # def start
- end # class Scene_Gameover < Scene_Base
- class Scene_Menu < Scene_MenuBase
- alias start_with_needs start
- def start
- create_needs_window
- start_with_needs
- end # def start
- def create_needs_window
- @needs_window = Window_Needs.new
- @needs_window.x = (Apellonyx::NEEDSXPOS)
- if Apellonyx::TOXINSWITCH == 0
- @needs_window.y = (Apellonyx::NEEDSYPOS)
- else
- if Apellonyx::HIDETOXINZERO == false
- @needs_window.y = (Apellonyx::NEEDSYPOS - 24)
- else
- if $game_variables[Apellonyx::TOXINVAR] == 0
- @needs_window.y = (Apellonyx::NEEDSYPOS)
- else
- @needs_window.y = (Apellonyx::NEEDSYPOS - 24)
- end # if $game_variables[Apellonyx::TOXINVAR] == 0
- end # Apellonyx::HIDETOXINZERO == false
- end # Apellonyx::TOXINSWITCH == 0
- end # def create_needs_window
- end # class Scene_Menu < Scene_MenuBase
- class Window_Needs < Window_Base
- def initialize
- if Apellonyx::TOXINSWITCH == 0
- super(0, 0, Apellonyx::NEEDSWIDTH, fitting_height(4))
- else
- if Apellonyx::HIDETOXINZERO == false
- super(0, 0, Apellonyx::NEEDSWIDTH, fitting_height(5))
- else
- if $game_variables[Apellonyx::TOXINVAR] == 0
- super(0, 0, Apellonyx::NEEDSWIDTH, fitting_height(4))
- else
- super(0, 0, Apellonyx::NEEDSWIDTH, fitting_height(5))
- end # if $game_variables[Apellonyx::TOXINVAR] == 0
- end # Apellonyx::HIDETOXINZERO == false
- end # Apellonyx::TOXINSWITCH == 0
- refresh
- end # def initialize
- def exc_color
- text_color(Apellonyx::EXCCOLOR)
- end # def exc_color
- def sat_color
- text_color(Apellonyx::SATCOLOR)
- end # def sat_color
- def ave_color
- text_color(Apellonyx::AVECOLOR)
- end # def ave_color
- def dan_color
- text_color(Apellonyx::DANCOLOR)
- end # def dan_color
- def dep_color
- text_color(Apellonyx::DEPCOLOR)
- end # def dep_color
- def refresh
- contents.clear
- contents.font.size = Apellonyx::NEEDSSIZE
- draw_life(0, 0, 0)
- draw_food(0, 0, 24)
- draw_water(0, 0, 48)
- draw_rest(0, 0, 72)
- if Apellonyx::HIDETOXINZERO == true
- if $game_variables[Apellonyx::TOXINVAR] != 0
- draw_toxin(0, 0, 96)
- end # if $game_variables[Apellonyx::TOXINVAR] != 0
- else
- if Apellonyx::TOXINSWITCH != 0
- draw_toxin(0, 0, 96)
- end # if Apellonyx::TOXINSWITCH != 0
- end # if Apellonyx::HIDETOXINZERO == true
- end # def refresh
- def draw_life(actor, x, y, width = Apellonyx::NEEDSWIDTH - 22)
- life_color = exc_color if $game_variables[Apellonyx::LIFEVAR] > 100
- life_color = sat_color if $game_variables[Apellonyx::LIFEVAR] <= 100
- life_color = ave_color if $game_variables[Apellonyx::LIFEVAR] < 75
- life_color = dan_color if $game_variables[Apellonyx::LIFEVAR] < 25
- life_color = dep_color if $game_variables[Apellonyx::LIFEVAR] <= 0
- life_rate = $game_variables[Apellonyx::LIFEVAR] / 100.0
- draw_gauge(x, y, width, life_rate, text_color(Apellonyx::LIFEGCOLOR1),
- text_color(Apellonyx::LIFEGCOLOR2))
- change_color(system_color)
- draw_text(x, y, 100, line_height, Apellonyx::LIFEVOCAB)
- draw_current_and_max_values(x, y, width, $game_variables[Apellonyx::LIFEVAR],
- "100%", life_color, life_color)
- end # def draw_life
- def draw_food(actor, x, y, width = Apellonyx::NEEDSWIDTH - 22)
- food_color = exc_color if $game_variables[Apellonyx::FOODVAR] > 100
- food_color = sat_color if $game_variables[Apellonyx::FOODVAR] <= 100
- food_color = ave_color if $game_variables[Apellonyx::FOODVAR] < 75
- food_color = dan_color if $game_variables[Apellonyx::FOODVAR] < 25
- food_color = dep_color if $game_variables[Apellonyx::FOODVAR] <= 0
- food_rate = $game_variables[Apellonyx::FOODVAR] / 100.0
- draw_gauge(x, y, width, food_rate, text_color(Apellonyx::FOODGCOLOR1),
- text_color(Apellonyx::FOODGCOLOR2))
- change_color(system_color)
- draw_text(x, y, 100, line_height, Apellonyx::FOODVOCAB)
- draw_current_and_max_values(x, y, width, $game_variables[Apellonyx::FOODVAR],
- "100%", food_color, food_color)
- end # def draw_food
- def draw_water(actor, x, y, width = Apellonyx::NEEDSWIDTH - 22)
- water_color = exc_color if $game_variables[Apellonyx::WATERVAR] > 100
- water_color = sat_color if $game_variables[Apellonyx::WATERVAR] <= 100
- water_color = ave_color if $game_variables[Apellonyx::WATERVAR] < 75
- water_color = dan_color if $game_variables[Apellonyx::WATERVAR] < 25
- water_color = dep_color if $game_variables[Apellonyx::WATERVAR] <= 0
- water_rate = $game_variables[Apellonyx::WATERVAR] / 100.0
- draw_gauge(x, y, width, water_rate, text_color(Apellonyx::WATERGCOLOR1),
- text_color(Apellonyx::WATERGCOLOR2))
- change_color(system_color)
- draw_text(x, y, 100, line_height, Apellonyx::WATERVOCAB)
- draw_current_and_max_values(x, y, width, $game_variables[Apellonyx::WATERVAR],
- "100%", water_color, water_color)
- end # def draw_water
- def draw_rest(actor, x, y, width = Apellonyx::NEEDSWIDTH - 22)
- rest_color = exc_color if $game_variables[Apellonyx::RESTVAR] > 100
- rest_color = sat_color if $game_variables[Apellonyx::RESTVAR] <= 100
- rest_color = ave_color if $game_variables[Apellonyx::RESTVAR] < 75
- rest_color = dan_color if $game_variables[Apellonyx::RESTVAR] < 25
- rest_color = dep_color if $game_variables[Apellonyx::RESTVAR] <= 0
- rest_rate = $game_variables[Apellonyx::RESTVAR] / 100.0
- draw_gauge(x, y, width, rest_rate, text_color(Apellonyx::RESTGCOLOR1),
- text_color(Apellonyx::RESTGCOLOR2))
- change_color(system_color)
- draw_text(x, y, 100, line_height, Apellonyx::RESTVOCAB)
- draw_current_and_max_values(x, y, width, $game_variables[Apellonyx::RESTVAR],
- "100%", rest_color, rest_color)
- end # def draw_rest
- def draw_toxin(actor, x, y, width = Apellonyx::NEEDSWIDTH - 22)
- toxin_25 = Apellonyx::TOXINMAX / 4
- toxin_75 = toxin_25 * 3
- toxin_color = dep_color if $game_variables[Apellonyx::TOXINVAR] > Apellonyx::TOXINMAX
- toxin_color = dan_color if $game_variables[Apellonyx::TOXINVAR] <= Apellonyx::TOXINMAX
- toxin_color = ave_color if $game_variables[Apellonyx::TOXINVAR] < toxin_75
- toxin_color = sat_color if $game_variables[Apellonyx::TOXINVAR] < toxin_25
- toxin_color = exc_color if $game_variables[Apellonyx::TOXINVAR] <= 0
- toxin_rate = $game_variables[Apellonyx::TOXINVAR] / Apellonyx::TOXINMAX.to_f
- draw_gauge(x, y, width, toxin_rate, text_color(Apellonyx::TOXINGCOLOR1),
- text_color(Apellonyx::TOXINGCOLOR2))
- change_color(system_color)
- draw_text(x, y, 100, line_height, Apellonyx::TOXINVOCAB)
- draw_current_and_max_values(x, y, width, $game_variables[Apellonyx::TOXINVAR],
- Apellonyx::TOXINMAX.to_s, toxin_color, toxin_color)
- end # def draw_toxin
- end # class Window_Needs < Window_Base
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement