01-02-2023, 06:59 AM
Even Kiwi Menu XP Has Its Own Safety Level Now!
Code:
# * Map Safety Level XP - Kiwi Menu Version * #
# Scripter : Kyonides Arkanthes
# 2023-01-01
# This scriptlet lets you set some texts as Safety Level Labels, and then you
# can call a method to set a new level at any given time.
# Valid Levels: 0 up to your safety maximum level.
# * Get or Set Current Map's Safety Level * #
# $game_map.safety_level
# $game_map.safety_level = NewLevel
# * Preset a given Map's Safety Level * #
# SAFETY_LEVELS = { MapIDa => Level, MapIDb => Level, etc. }
# * Define a given Map's Safety Level Color * #
# - Alpha is optional. Valid Values: 0 through 255
# SAFETY_LEVELS[0] = [Red, Green, Blue, Alpha]
module MapData
DEFAULT_SAFETY_LEVEL = 0
SAFETY_LEVELS = { 1 => 3 }
SAFETY_LABELS = [] # Just leave it alone.
SAFETY_COLORS = [] # Just leave it alone.
SAFETY_LABELS[0] = "A Nightmare"
SAFETY_LABELS[1] = "Dangerous"
SAFETY_LABELS[2] = "Unsafe"
SAFETY_LABELS[3] = "Normal Place"
SAFETY_LABELS[4] = "Great Place"
SAFETY_LABELS[5] = "The Utopia"
SAFETY_COLORS[0] = [255, 0, 0]
SAFETY_COLORS[1] = [255, 165, 0]
SAFETY_COLORS[2] = [255, 255, 0]
SAFETY_COLORS[3] = [255, 255, 255]
SAFETY_COLORS[4] = [90, 205, 90]
SAFETY_COLORS[5] = [0, 255, 0]
end
module KiwiMenu
MAP_SAFETY_TAB_X = 320
MAP_SAFETY_TAB_Y = 448
end
class Game_Map
alias :kyon_map_safety_lvl_gm_map_init :initialize
alias :kyon_map_safety_lvl_gm_map_setup :setup
def initialize
kyon_map_safety_lvl_gm_map_init
@safety_levels = MapData::SAFETY_LEVELS.dup
@safety_levels.default = MapData::DEFAULT_SAFETY_LEVEL
end
def get_mapinfos_name
load_data("Data/MapInfos.rxdata")[@map_id].name
end
def display_name
@display_name ||= get_mapinfos_name
end
def safety_level
@safety_levels[@map_id]
end
def safety_level=(new_level)
@safety_levels[@map_id] = new_level
end
def safety_level_text
MapData::SAFETY_LABELS[@safety_levels[@map_id]]
end
attr_reader :safety_levels
attr_writer :display_name
end
class KiwiMenuSpriteset
alias :kyon_map_safety_kwmn_set_init :initialize
alias :kyon_map_safety_kwmn_set_disp :dispose
def initialize(pos, options_max)
kyon_map_safety_kwmn_set_init(pos, options_max)
create_map_safety_sprites
end
def create_map_safety_sprites
@map_safety = [Sprite.new, Sprite.new]
@map_safety[0].x = MAP_SAFETY_TAB_X
@map_safety[0].y = MAP_SAFETY_TAB_Y
@map_safety[1].x = MAP_SAFETY_TAB_X
@map_safety[1].y = MAP_SAFETY_TAB_Y
@map_safety[0].bitmap = b = RPG::Cache.picture(GOLD_TAB)
@map_safety[1].bitmap = bm = Bitmap.new(b.width, b.height)
safety_color = MapData::SAFETY_COLORS[$game_map.safety_level]
bm.font.color.set(*safety_color)
text = $game_map.safety_level_text
bm.draw_text(4, 4, b.width - 8, 24, text, 1)
end
def dispose
@map_safety.each{|sprite| sprite.dispose }
@map_safety.clear
kyon_map_safety_kwmn_set_disp
end
end
So you can now include it in any of your game projects that are already using my Kiwi Menu script, guys.
"For God has not destined us for wrath, but for obtaining salvation through our Lord Jesus Christ," 1 Thessalonians 5:9
Maranatha!
The Internet might be either your friend or enemy. It just depends on whether or not she has a bad hair day.
My Original Stories (available in English and Spanish)
List of Compiled Binary Executables I have published...
HiddenChest & Roole
Give me a free copy of your completed game if you include at least 3 of my scripts!
Just some scripts I've already published on the board...
KyoGemBoost XP VX & ACE, RandomEnkounters XP, KSkillShop XP, Kolloseum States XP, KEvents XP, KScenario XP & Gosu, KyoPrizeShop XP Mangostan, Kuests XP, KyoDiscounts XP VX, ACE & MV, KChest XP VX & ACE 2016, KTelePort XP, KSkillMax XP & VX & ACE, Gem Roulette XP VX & VX Ace, KRespawnPoint XP, VX & VX Ace, GiveAway XP VX & ACE, Klearance XP VX & ACE, KUnits XP VX, ACE & Gosu 2017, KLevel XP, KRumors XP & ACE, KMonsterPals XP VX & ACE, KStatsRefill XP VX & ACE, KLotto XP VX & ACE, KItemDesc XP & VX, KPocket XP & VX, OpenChest XP VX & ACE
Maranatha!
The Internet might be either your friend or enemy. It just depends on whether or not she has a bad hair day.
My Original Stories (available in English and Spanish)
List of Compiled Binary Executables I have published...
HiddenChest & Roole
Give me a free copy of your completed game if you include at least 3 of my scripts!
Just some scripts I've already published on the board...
KyoGemBoost XP VX & ACE, RandomEnkounters XP, KSkillShop XP, Kolloseum States XP, KEvents XP, KScenario XP & Gosu, KyoPrizeShop XP Mangostan, Kuests XP, KyoDiscounts XP VX, ACE & MV, KChest XP VX & ACE 2016, KTelePort XP, KSkillMax XP & VX & ACE, Gem Roulette XP VX & VX Ace, KRespawnPoint XP, VX & VX Ace, GiveAway XP VX & ACE, Klearance XP VX & ACE, KUnits XP VX, ACE & Gosu 2017, KLevel XP, KRumors XP & ACE, KMonsterPals XP VX & ACE, KStatsRefill XP VX & ACE, KLotto XP VX & ACE, KItemDesc XP & VX, KPocket XP & VX, OpenChest XP VX & ACE