Release 0.0.1.8.8.7

This commit is contained in:
WorldBosse committed 2026-10-29 21:59:06 +04:00
1 parent 3c8a17aa78
commit c7beab414c
16283 files changed
+768761 -2

No files matched your search

@@ -0,0 +1,224 @@
#===============================================================================
# Framerate Independence
# By Jet10985 (Jet)
#===============================================================================
# This snippet will change the inner movement and time-based operations of
# Ace to accomadate a lower fps than expected, meaning it will experience the
# same change despite not having been interated over as many times as expected.
# This script has: 0 customization options.
#===============================================================================
# Overwritten Methods:
# Spriteset_Weather: update_sprite_rain, update_sprite_snow, update_sprite_storm
# Game_Map: update_parallax
# Game_Picture: update_rotate
# Game_Screen: update_weather
#-------------------------------------------------------------------------------
# Aliased methods:
# Graphics: update
# Game_CharacterBase: distance_per_frame
# Game_Map: scroll_distance
# Game_Picture: update_move, update_tone_change
# Game_Screen: update_fadeout, update_fadein, update_shake, update_flash,
# update_tone
#===============================================================================
class << Graphics
def delta
@delta
end
def update_delta
@this_frame = Time.now
@delta = (@this_frame - @last_frame)
@last_frame = @this_frame
if @delta >= 1 || @delta == 0.0
@delta = 1 / Graphics.frame_rate.to_f
end
end
def fps_difference
((1 / Graphics.delta).round / Graphics.frame_rate.to_f)
end
alias jet2734_update update
def update(*args, &block)
jet2734_update(*args, &block)
@last_frame ||= Time.now
update_delta
end
end
class Game_CharacterBase
alias jet3845_distance_per_frame distance_per_frame
def distance_per_frame(*args, &block)
jet3845_distance_per_frame(*args, &block) / Graphics.fps_difference
end
end
class Spriteset_Weather
def update_sprite_rain(sprite)
sprite.bitmap = @rain_bitmap
sprite.x -= Graphics.frame_rate * Graphics.delta
sprite.y += Graphics.frame_rate * Graphics.delta * 6
sprite.opacity -= Graphics.frame_rate * Graphics.delta * 12
end
def update_sprite_storm(sprite)
sprite.bitmap = @storm_bitmap
sprite.x -= Graphics.frame_rate * Graphics.delta * 3
sprite.y += Graphics.frame_rate * Graphics.delta * 6
sprite.opacity -= Graphics.frame_rate * Graphics.delta * 12
end
def update_sprite_snow(sprite)
sprite.bitmap = @snow_bitmap
sprite.x -= Graphics.frame_rate * Graphics.delta
sprite.y += Graphics.frame_rate * Graphics.delta * 3
sprite.opacity -= Graphics.frame_rate * Graphics.delta * 12
end
end
class Game_Map
alias jet7345_scroll_distance scroll_distance
def scroll_distance(*args, &block)
jet7345_scroll_distance(*args, &block) / Graphics.fps_difference
end
def update_parallax
sx = @parallax_sx / 64.0
sx /= Graphics.fps_difference
sy = @parallax_sy / 64.0
sy /= Graphics.fps_difference
@parallax_x += sx if @parallax_loop_x
@parallax_y += sy if @parallax_loop_y
end
end
class Game_Picture
alias jet2938_update_move update_move
def update_move(*args, &block)
did = @duration != 0
jet2938_update_move(*args, &block)
return if !did || @duration == 0
@duration += 1
@duration -= Graphics.frame_rate * Graphics.delta
if @duration > 0 && @duration < 1
@duration = 1
else
@duration = [@duration, 0].max
end
end
alias jet2938_update_tone_change update_tone_change
def update_tone_change(*args, &block)
did = @tone_duration != 0
jet2938_update_tone_change(*args, &block)
return if !did || @tone_duration == 0
@tone_duration += 1
@tone_duration -= Graphics.frame_rate * Graphics.delta
if @tone_duration > 0 && @tone_duration < 1
@tone_duration = 1
else
@tone_duration = [@tone_duration, 0].max
end
end
def update_rotate
return if @rotate_speed == 0
to_add = @rotate_speed / 2.0
to_add /= Graphics.fps_difference
@angle += to_add
@angle += 360 while @angle < 0
@angle %= 360
end
end
class Game_Screen
alias jet2938_update_fadeout update_fadeout
def update_fadeout(*args, &block)
did = @fadeout_duration != 0
jet2938_update_fadeout(*args, &block)
return if !did || @fadeout_duration == 0
@fadeout_duration += 1
@fadeout_duration -= Graphics.frame_rate * Graphics.delta
if @fadeout_duration > 0 && @fadeout_duration < 1
@fadeout_duration = 1
else
@fadeout_duration = [@fadeout_duration, 0].max
end
end
alias jet2938_update_fadein update_fadein
def update_fadein(*args, &block)
did = @fadein_duration != 0
jet2938_update_fadein(*args, &block)
return if !did || @fadein_duration == 0
@fadein_duration += 1
@fadein_duration -= Graphics.frame_rate * Graphics.delta
if @fadein_duration > 0 && @fadein_duration < 1
@fadein_duration = 1
else
@fadein_duration = [@fadein_duration, 0].max
end
end
alias jet2938_update_tone update_tone
def update_tone(*args, &block)
did = @tone_duration != 0
jet2938_update_tone(*args, &block)
return if !did || @tone_duration == 0
@tone_duration += 1
@tone_duration -= Graphics.frame_rate * Graphics.delta
if @tone_duration > 0 && @tone_duration < 1
@tone_duration = 1
else
@tone_duration = [@tone_duration, 0].max
end
end
#bugged
alias jet2938_update_flash update_flash
def update_flash(*args, &block)
did = @flash_duration != 0
jet2938_update_flash(*args, &block)
return if !did || @flash_duration == 0
@flash_duration += 1
@flash_duration -= Graphics.frame_rate * Graphics.delta
if @flash_duration > 0 && @flash_duration < 1
@flash_duration = 1
else
@flash_duration = [@flash_duration, 0].max
end
end
alias jet2938_update_shake update_shake
def update_shake(*args, &block)
did = @shake_duration != 0
jet2938_update_shake(*args, &block)
return if !did || @shake_duration == 0
@shake_duration += 1
@shake_duration -= Graphics.frame_rate * Graphics.delta
if @shake_duration > 0 && @shake_duration < 1
@shake_duration = 1
else
@shake_duration = [@shake_duration, 0].max
end
end
def update_weather
if @weather_duration > 0
d = @weather_duration
@weather_power = (@weather_power * (d - 1) + @weather_power_target) / d
@weather_duration -= Graphics.frame_rate * Graphics.delta
if @weather_duration <= 0 && @weather_power_target == 0
@weather_type = :none
end
end
end
end
+59
View File
@@ -0,0 +1,59 @@
class Window_Command < Window_Selectable
#--------------------------------------------------------------------------
# * Get Window Width
#--------------------------------------------------------------------------
def window_width
return 200
end
end
class Window_MenuCommand < Window_Command
#--------------------------------------------------------------------------
# * Get Window Width
#--------------------------------------------------------------------------
def window_width
return 200
end
end
class Window_MenuStatus < Window_Selectable
#--------------------------------------------------------------------------
# * Get Window Width
#--------------------------------------------------------------------------
def window_width
Graphics.width - 200
end
end
class Window_SkillCommand < Window_Command
#--------------------------------------------------------------------------
# * Get Window Width
#--------------------------------------------------------------------------
def window_width
return 200
end
end
class Window_SkillStatus < Window_Base
#---------------------------------------------------------------
# * Get Window Width
#--------------------------------------------------------------------------
def window_width
Graphics.width - 200
end
end
+28
View File
@@ -0,0 +1,28 @@
class Game_Map
def width
if Graphics.width % 32 == 0
@map.width
else
@map.width - 1
end
end
def height
if Graphics.height % 32 == 0
@map.height
else
@map.height - 1
end
end
end
class Game_Player < Game_Character
def center_x
((Graphics.width / 32).floor - 1) / 2.0
end
def center_y
((Graphics.height / 32).floor - 1) / 2.0
end
end
+73
View File
@@ -0,0 +1,73 @@
#Optimization mod by Teravisor
#Changes CHS cache to store at least MAX_ENTRIES_TO_STORE of @parts_cache or @chs_material
#Separates parts data update logic from bitmap rebuild in order to not rebuild CHS when parts composition didn't change.
unless $CHSOptimization
$CHSOptimization = true
module Cache
MAX_ENTRIES_TO_STORE = 100 #maximum stored parts bitmaps < MAX_ENTRIES_TO_STORE and maximum stored chs bitmaps < MAX_ENTRIES_TO_STORE
class << self
# alias_method :create_chs_character_bitmap_optimized, :create_chs_character_bitmap
def create_chs_character_bitmap(character)
chs_data=$chs_data[character.chs_type]
chs_parts=chs_data.parts[character.charset_index]
arr = [character.sex_mode?]
chs_parts.each{|part|
begin
next if part.nil?
part.update(character)
next if part.bitmap.nil?
rescue => err
p "chs missing file err.message=>#{err.message}"
end
part_opacity = part.opacity
part_opacity = 255 if part.opacity>255
arr << [part.bitmap, part_opacity] if part.bitmap && part_opacity>0
}
@last_parts = {} if @last_parts.nil?
oldArr = @last_parts[character]
if arr != oldArr then
@last_parts[character] = arr
return apply_parts(arr, chs_data.cell_width, chs_data.cell_height, chs_data.sex_cell_width, chs_data.sex_cell_height)
end
return @chs_chars[character.chs_name]
end
def apply_parts(parts_arr, cell_width, cell_height, sex_cell_width, sex_cell_height)
sex_mode = parts_arr[0]
parts = parts_arr[1...parts_arr.length]
if sex_mode
chs_bitmap=Bitmap.new(sex_cell_width*3,sex_cell_height*8)
else
chs_bitmap=Bitmap.new(cell_width*12,cell_height*8)
end
parts.each{
|part|
part_bitmap=part[0]
chs_bitmap.blt(0,0,part_bitmap,part_bitmap.rect,part[1])
}
return chs_bitmap
end
alias_method :clear_chs_character_optimization, :clear_chs_character
def clear_chs_character(regenerate=false)
clear_chs_character_optimization(regenerate)
@last_parts = {}
end
#parts bmps should be cached for longer time
alias :clear_chs_material_optimized :clear_chs_material
def clear_chs_material(gc=false)
@chs_material ||={}
@parts_cache ||={}
clear_chs_material_optimized if @chs_material.length > MAX_ENTRIES_TO_STORE || @parts_cache.length > MAX_ENTRIES_TO_STORE
end
end
end
end
@@ -0,0 +1,385 @@
#Optimization mod by Teravisor
#Fixes a HUGE performance leak caused by all CGs being assembled at load and kept as viewport+sprite during whole gameplay.
#unless $portraits_optimized
#$portraits_optimized=true
#Rewrite of portrait system that makes it not store 200+ sprites and viewports.
class Portrait_System
def update_auto_hide(portrait)
return if $game_message.busy? || $game_map.interpreter.running?
@portrait_idle[portrait]=0 if @portrait_idle[portrait].nil?
@portrait_idle[portrait]+=1
if(getSec(@portrait_idle[portrait])>=System_Settings::PORTRAIT_AUTO_HIDE_SEC)
portrait.hide
portraitDownStage(portrait)
@portrait_idle.delete(portrait)
portrait.delete_sprite
end
end
def getPortrait(name)
p "Missing Portrait #{name}, using character:\"nil\" instead" if @portraits[name].nil? if $degug_portrait
return @portraits["nil"] if@portraits[name].nil?
return @portraits[name]
end
end
class Portrait
def initialize(base_char,parts,canvas=[300,400,0,0])
@portrait = FakeSprite.new
@base_char=base_char
@canvas=Array.new(canvas.length){|index|canvas[index].to_i}
@prts=sort_parts(parts)
#don't create portrait on init
end
def update
#don't reassemble portrait if it's not visible
return if !@portrait.visible
update_parts
assemble_portrait
end
def force_update
update_parts
assemble_portrait
end
def show
if @portrait.sprite.nil? then
create_portrait
end
@portrait.visible=true
update
end
def unshow
@portrait.visible=false
delete_sprite
end
def create_portrait()
create_sprite
reset_position
force_update
end
def create_sprite
return if !@portrait.sprite.nil?
@prt_vp=Viewport.new
@prt_vp.z=System_Settings::PORTRAIT_MAP_Z
@portrait.viewport = @prt_vp
@portrait.show
@portrait.visible=false
end
def delete_sprite
return if @portrait.sprite.nil?
@prt_vp.dispose
@portrait.bitmap.dispose
@portrait.dispose
@portrait.viewport = nil
end
end
class Lona_Portrait < Moveable_Portrait
def delete_sprite
end
#only call 102_Lona_Portrait_Rule.rb if viewport is set up
alias_method :updateExtra_optimization, :updateExtra
def updateExtra
return if @prt_vp.nil?
updateExtra_optimization
end
end
class FakeSprite
attr_accessor :x
attr_accessor :y
attr_accessor :z
attr_accessor :bitmap
attr_accessor :src_rect
attr_accessor :viewport
attr_accessor :visible
attr_accessor :ox
attr_accessor :oy
attr_accessor :zoom_x
attr_accessor :zoom_y
attr_accessor :angle
attr_accessor :wave_amp
attr_accessor :wave_length
attr_accessor :wave_speed
attr_accessor :wave_phase
attr_accessor :mirror
attr_accessor :bush_depth
attr_accessor :bush_opacity
attr_accessor :opacity
attr_accessor :blend_type
attr_accessor :color
attr_accessor :tone
attr_accessor :sprite
def initialize(viewport=nil)
if viewport.class == Sprite then
load_from_sprite(viewport)
else
@viewport = viewport
@color = ColorHook.new
@src_rect = Rect.new
@visible=false
@x=0
@y=0
@z=0
@ox=0
@oy=0
@angle=0
@mirror=false
@opacity=255
@blend_type=0
@zoom_x = 1
@zoom_y = 1
@tone=ToneHook.new
@color.update_method = method(:update_color)
@tone.update_method = method(:update_tone)
end
end
def load_from_sprite(sprite)
@x = sprite.x
@y = sprite.y
@z = sprite.z
@bitmap = sprite.bitmap
@src_rect = sprite.src_rect
@viewport = sprite.viewport
@visible = sprite.visible
@ox = sprite.ox
@oy = sprite.oy
@zoom_x = sprite.zoom_x
@zoom_y = sprite.zoom_y
@angle = sprite.angle
@wave_amp = sprite.wave_amp
@wave_length = sprite.wave_length
@wave_speed = sprite.wave_speed
@wave_phase = sprite.wave_phase
@mirror = sprite.mirror
@bush_depth = sprite.bush_depth
@bush_opacity = sprite.bush_opacity
@opacity = sprite.opacity
@blend_type = sprite.blend_type
@color = sprite.color
@tone = sprite.tone
@sprite = sprite
hide if !@visible
end
def dispose
@sprite.dispose if @sprite
@sprite = nil
end
def disposed?
return @sprite.nil? || @sprite.disposed?
end
def flash(color,duration)
@sprite.flash(color,duration) if @sprite
end
def update
@sprite.update if @sprite
end
def width
return @src_rect.width if @src_rect
return @sprite.width if @sprite
return 0
end
def height
return @src_rect.height if @src_rect
return @sprite.height if @sprite
return 0
end
def hide
dispose
@visible=false
end
def show
@sprite = Sprite.new(viewport)
@sprite.x = @x if @x
@sprite.y = @y if @y
@sprite.z = @z if @z
@sprite.bitmap = @bitmap if @bitmap
@sprite.src_rect = @src_rect if @src_rect
@sprite.visible = @visible if @visible
@sprite.ox = @ox if @ox
@sprite.oy = @oy if @oy
@sprite.zoom_x = @zoom_x if @zoom_x
@sprite.zoom_y = @zoom_y if @zoom_y
@sprite.angle = @angle if angle
@sprite.wave_amp = @wave_amp if @wave_amp
@sprite.wave_length = @wave_length if @wave_length
@sprite.wave_speed = @wave_speed if @wave_speed
@sprite.wave_phase = @wave_phase if @wave_phase
@sprite.mirror = @mirror if @mirror
@sprite.bush_depth = @bush_depth if @bush_depth
@sprite.bush_opacity = @bush_opacity if @bush_opacity
@sprite.opacity = @opacity if @opacity
@sprite.blend_type = @blend_type if @blend_type
@sprite.color = @color if @color
@sprite.tone = @tone if @tone
end
def x=(val)
@x = val
@sprite.x = val if @sprite
end
def y=(val)
@y = val
@sprite.y = val if @sprite
end
def z=(val)
@z = val
@sprite.z = val if @sprite
end
def bitmap=(val)
@bitmap = val
@src_rect = @bitmap.rect
@sprite.bitmap = val if @sprite
end
def src_rect=(val)
@src_rect = val
@sprite.src_rect = val if @sprite
end
def visible=(val)
show if val && !@sprite
hide if !val && @sprite
@visible = val
@sprite.visible = val if @sprite
end
def visible
return @visible && @sprite
end
def ox=(val)
@ox = val
@sprite.ox=val if @sprite
end
def oy=(val)
@oy = val
@sprite.oy=val if @sprite
end
def zoom_x=(val)
@zoom_x=val
@sprite.zoom_x=val if @sprite
end
def zoom_y=(val)
@zoom_y=val
@sprite.zoom_y=val if @sprite
end
def angle=(val)
@angle = val
@sprite.angle = val if @sprite
end
def wave_amp=(val)
@wave_amp=val
@sprite.wave_amp=val if @sprite
end
def wave_length=(val)
@wave_length=val
@sprite.wave_length=val if @sprite
end
def wave_speed=(val)
@wave_speed=val
@sprite.wave_speed=val if @sprite
end
def wave_phase=(val)
@wave_phase=val
@sprite.wave_speed=val if @sprite
end
def mirror=(val)
@mirror = val
@sprite.mirror=val if @sprite
end
def bush_depth=(val)
@bush_depth=val
@sprite.bush_depth=val if @sprite
end
def bush_opacity=(val)
@bush_opacity=val
@sprite.bush_opacity=val if @sprite
end
def opacity=(val)
@opacity = val
@sprite.opacity = val if @sprite
end
def blend_type=(val)
@blend_type=val
@sprite.blend_type = val if @sprite
end
def color=(val)
@color=ColorHook.new(val.red,val.green,val.blue,val.alpha)
@color.update_method = method(update_color)
@sprite.color = val if @sprite
end
def update_color(newcolor)
@sprite.color = newcolor if @sprite
end
def tone=(val)
@tone = ToneHook.new(val.red,val.green,val.blue,val.grey)
@tone.update_method = method(update_tone)
@sprite.color = val if @sprite
end
def update_tone(newtone)
@sprite.tone = newtone if @sprite
end
end
class ColorHook < Color
attr_accessor :update_method
def initialize(r=0,g=0,b=0,a=0)
super(r,g,b,a)
end
def red=(val)
super(val)
update_method.call(self)
end
def blue=(val)
super(val)
update_method.call(self)
end
def green=(val)
super(val)
update_method.call(self)
end
def alpha=(val)
super(val)
update_method.call(self)
end
end
class ToneHook < Tone
attr_accessor :update_method
def initialize(r=0,g=0,b=0,grey=0)
super(r,g,b,grey)
end
def red=(val)
super(val)
update_method.call(self)
end
def blue=(val)
super(val)
update_method.call(self)
end
def green=(val)
super(val)
update_method.call(self)
end
def grey=(val)
super(val)
update_method.call(self)
end
end
#end
+177
View File
@@ -0,0 +1,177 @@
#Optimization mod by Teravisor
#Hash for (x,y)=>event[]
#Adds a hashmap for (x,y) position as key into Array of events for fast lookup
#Adds hook to movement methods in order to update position in hashmap
unless Game_Map.instance_methods(false).include?(:add_event_to_pos_hash)
unless $Version
#5_DataManager is not available at this point so need to read game version from rvdata2
$Version = /([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)/.match(load_data("Data/System.rvdata2").game_title)
#$VersionNumber supports up to two numbers in each version through dot, so it can be 99.99.99.99 -> 99999999
#Common version numbers like 0.4.3.2 become 00040302
#0 is unidentified version. Fixes can decide if they should run or it's better to not run on unknown versions.
$VersionNumber = $Version.nil? ? 0 : $Version[4].to_i+ $Version[3].to_i*100+$Version[2].to_i*10000+$Version[1].to_i*1000000
end
#0.4.3.2 or later. There's a lot of traps and some random placed NPCs that first init themselves as npc then delete themselves if there's something in their tile. So they delete themselves.
if $VersionNumber==0 || $VersionNumber >= 40302 then
class Game_Map
attr_accessor :pos_to_event
def add_event_to_pos_hash(event)
if has_event?(event.x,event.y) then
@pos_to_event[hash_func(event.x,event.y)].push(event)
else
@pos_to_event[hash_func(event.x,event.y)]=[event]
end
return event
end
def has_event?(x,y)
!@pos_to_event[hash_func(x,y)].nil? && @pos_to_event[hash_func(x,y)].length>0
end
def eventarray_xy(x,y)
@pos_to_event[hash_func(x,y)] || []
end
def delete_event_from_pos_hash(event)
res=@pos_to_event[hash_func(event.x,event.y)].delete(event) if has_event?(event.x,event.y)
@pos_to_event.delete(hash_func(event.x,event.y)) if !@pos_to_event[hash_func(event.x,event.y)].nil? && @pos_to_event[hash_func(event.x,event.y)].empty?
return res
end
def TERFIX2_remove_pos_to_event(event)
elem = $game_map.delete_event_from_pos_hash(event)
if elem.nil? then #when characters spawn, moveto sees previous coordinates (0,0) and cannot properly remove previous hash.
success = $game_map.delete_event_from_pos_hash_erroneous(event)
end
end
#looks through whole array to delete specified event. Should be called as few times as possible.
def delete_event_from_pos_hash_erroneous(event)
@pos_to_event.each_value{|arr| arr.delete(event) if !arr.nil?}
end
def reload_events_into_pos_hash
@pos_to_event = {}
@events.each_value do |event|
add_event_to_pos_hash(event)
end
end
#All methods below are overrides
alias_method :initialize_fixTER2, :initialize
def initialize
initialize_fixTER2
@pos_to_event = Hash.new
end
alias_method :setup_fixTER2, :setup
def setup(map_id)
setup_fixTER2(map_id)
reload_events_into_pos_hash
end
def events_xy(x,y)
eventarray_xy(x,y).select{|event| !event.nil? && !event.deleted?}
end
def events_xy_nt(x, y)
eventarray_xy(x,y).select {|event| !event.deleted? && !event.through }
end
alias_method :add_event_TERFIX2, :add_event
def add_event(mapid, eventid, x, y)
#Copied from 31_Game_Map.rb, but this will make non-unique IDs if you try to delete key. Be extra careful and will need fixing if ever fixed in original.
# eventid=@events.keys.max
# eventid=new_event_id.nil? ? 1 : new_event_id+1
#var = add_event_TERFIX2(mapid, eventid, x, y)
#p var.class #DEBUG, maybe I can do less calls if this works
event_itself = add_event_TERFIX2(mapid, eventid, x, y)
# event_itself = @events[eventid]
add_event_to_pos_hash(event_itself)
end
alias_method :summon_event_TERFIX2, :summon_event
def summon_event(event_name,x=nil,y=nil,id= -1,data=nil)
event_itself = summon_event_TERFIX2(event_name,x,y,id,data)
add_event_to_pos_hash(event_itself)
end
#Simple hash function to check which hash to put object in. Result is integer for speed.
def hash_func(x,y)
(x << 16) + y
end
#events that are going to be deleted, code taken from 31_Game_Map.rb update_events
alias_method :update_events_terFIX2, :update_events
def update_events
@events.keys.each{
|key|
event=@events[key]
if !event.nil? && event.deleted?
if event.foreign_event || !event.nappable? || !event.reset_strong
delete_event_from_pos_hash(event)
end
end
}
update_events_terFIX2
end
alias_method :refresh_terFIX2, :refresh
def refresh
refresh_terFIX2
reload_events_into_pos_hash
end
end
#things that move character now need to change pos_to_event
#overrides Game_Character methods for Game_Event because Game_Player is not event and must not be placed into pos_to_event
class Game_Event < Game_Character
alias_method :move_straight_TERFIX2, :move_straight
def move_straight(d, turn_ok = true)
$game_map.TERFIX2_remove_pos_to_event(self)
#prevX = @x
#prevY = @y
move_straight_TERFIX2(d,turn_ok)
#newX = @x
#newY = @y
$game_map.add_event_to_pos_hash(self)
end
alias_method :moveto_TERFIX2, :moveto
def moveto(x, y)
$game_map.TERFIX2_remove_pos_to_event(self)
moveto_TERFIX2(x,y)
$game_map.add_event_to_pos_hash(self)
end
alias_method :move_diagonal_TERFIX2, :move_diagonal
def move_diagonal(horz, vert)
$game_map.TERFIX2_remove_pos_to_event(self)
move_diagonal_TERFIX2(horz, vert)
$game_map.add_event_to_pos_hash(self)
end
alias_method :jump_TERFIX2, :jump
def jump(x_plus, y_plus,tmpPeak=10)
$game_map.TERFIX2_remove_pos_to_event(self)
jump_TERFIX2(x_plus, y_plus, tmpPeak)
$game_map.add_event_to_pos_hash(self)
end
alias_method :jump_low_TERFIX2, :jump_low
def jump_low(x_plus, y_plus)
$game_map.TERFIX2_remove_pos_to_event(self)
jump_low_TERFIX2(x_plus, y_plus)
$game_map.add_event_to_pos_hash(self)
end
end
end
end
+162
View File
@@ -0,0 +1,162 @@
#Idea from Theo - Insane Anti Lag
#Adapted by Teravisor
unless Game_Event.instance_methods(false).include?(:theo_antilag_start)
unless $version
#5_DataManager is not available at this point so need to read game version from rvdata2
$Version = /([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)/.match(load_data("Data/System.rvdata2").game_title)
#$VersionNumber supports up to two numbers in each version through dot, so it can be 99.99.99.99 -> 99999999
#Common version numbers like 0.4.3.2 become 00040302
#0 is unidentified version. Fixes can decide if they should run or it's better to not run on unknown versions.
$VersionNumber = $Version.nil? ? 0 : $Version[4].to_i+ $Version[3].to_i*100+$Version[2].to_i*10000+$Version[1].to_i*1000000
end
if $VersionNumber >= 40304 then
class Game_Map
attr_accessor :starting_events # To store activated event
alias_method :initialize_theo, :initialize
def initialize
initialize_theo
@starting_events=[]
end
alias_method :setup_theo, :setup
def setup(mapID)
@starting_events=[] #remove starting events from previous map. Fixes crash when moving from sewers to OrkindCave1
setup_theo(mapID)
end
#copied from Theo's
def setup_starting_map_event
event = @starting_events[0]
event.clear_starting_flag if event
@interpreter.setup(event.list, event.id) if event
event
end
#copied from Theo's
def any_event_starting?
!@starting_events.empty?
end
end
#copied from Theo's
class Game_Event < Game_Character
alias theo_antilag_start start
def start
theo_antilag_start
$game_map.starting_events << self if @starting
end
alias theo_antilag_clear_start clear_starting_flag
def clear_starting_flag
theo_antilag_clear_start
$game_map.starting_events.delete(self)
end
end
#old saves have @starting_events = nil
module DataManager
class << self
alias_method :extract_save_contents_antilag, :extract_save_contents
def extract_save_contents(contents)
extract_save_contents_antilag(contents)
$game_map.starting_events = [] if $game_map.starting_events.nil?
end
end
end
end
#Theo - Insane Anti Lag as-is code for updating only sprites on screen.
#in pirate's bane it reduced time to update sprites 0.012->0.0095 sec per frame which is quite nice.
class Sprite_Character
#-----------------------------------------------------------------------------
# * Alias method : Initialize
#-----------------------------------------------------------------------------
alias theo_antilag_init initialize
def initialize(viewport, character = nil)
theo_antilag_init(viewport, character)
end
#-----------------------------------------------------------------------------
# * Alias method : Update
#-----------------------------------------------------------------------------
alias theo_antilag_update update
def update
return if @character.nil?
@sx = @character.screen_x
@sy = @character.screen_y
if !need_update?
self.visible = false
return
end
theo_antilag_update
end
#-----------------------------------------------------------------------------
# * New method : Determine if on screen
#-----------------------------------------------------------------------------
def need_update?
return true if graphic_changed?
return true if @character.animation_id > 0
return true if @balloon_sprite
return true if @character.balloon_id != 0
w = Graphics.width
h = Graphics.height
cw = @cw || 32
ch = @ch || 32
@sx.between?(-cw,w+cw) && @sy.between?(0,h+ch)
end
#-----------------------------------------------------------------------------
# * Overwrite update position.
# To limit screen_x and screen_y to be called many times
#-----------------------------------------------------------------------------
def update_position
move_animation(@sx - x, @sy - y)
self.x = @sx
self.y = @sy
self.z = @character.screen_z
#from Scripts/Frames/206_DB_Animation.rb
if @character.animation
self.x += @character.animation.frame_data[3] || 0
self.y += @character.animation.frame_data[4] || 0
end
end
#-----------------------------------------------------------------------------
# * Overwrite animation origin
# Since X and Y axis of sprite is not updated when off screen
#-----------------------------------------------------------------------------
def set_animation_origin
if @animation.position == 3
if viewport == nil
@ani_ox = Graphics.width / 2
@ani_oy = Graphics.height / 2
else
@ani_ox = viewport.rect.width / 2
@ani_oy = viewport.rect.height / 2
end
else
@ani_ox = @sx - ox + width / 2
@ani_oy = @sy - oy + height / 2
if @animation.position == 0
@ani_oy -= height / 2
elsif @animation.position == 2
@ani_oy += height / 2
end
end
end
alias_method :set_character_bitmap_Optimization, :set_character_bitmap
def set_character_bitmap
set_character_bitmap_Optimization
@using_chs = @character.use_chs?
end
end
end
+39
View File
@@ -0,0 +1,39 @@
#Optimization mod by Teravisor
#Adds "Optimized!" label on adult content warning.
#unless Scene_AdultContentWarning.instance_methods(false).include?(:start_)
#
#class Scene_AdultContentWarning < Scene_Base
# alias :start_ :start
# alias :terminate_ :terminate
#
# def start
# start_
# @label = Sprite.new(@viewport)
# @label.bitmap = Bitmap.new(128,32)
# @label.x = 16
# @label.y = 16
# @label.z = 201
# @label.bitmap.draw_text(0,0,200,32,"Optimized V21_1",0)
# end
# def terminate
# terminate_
# @label.bitmap.dispose
# @label.dispose
# end
#end
#
#module DataManager
# class << self
# alias_method :load_normal_database_OptimizationLabel, :load_normal_database
# def load_normal_database
# load_normal_database_OptimizationLabel
# $data_system.game_title = $data_system.game_title+" O"
# end
#
# end
#end
#
#
#end
@@ -0,0 +1,28 @@
#Optimization mod by Teravisor
#Removes CHS rebuild call after exiting menu. Might be obsolette because of other performance fixes.
#Quite expensive call, so remove it where I can.
class Game_Player
attr_accessor :cancel_refresh
@cancel_refresh = false
def refresh_chs
Cache.chs_character(self,true) if !@cancel_refresh
cancel_refresh = false
@chs_need_update=true
actor.stat_changed=false
end
end
#equipment menu already refreshes chs so no need to refresh it again after exiting menu
class Scene_Menu < Scene_MenuBase
alias_method :update_input_Optimization, :update_input
def update_input
update_input_Optimization
if SceneManager.scene.is_a?(Scene_Map) then
$game_player.cancel_refresh=true
end
end
end
@@ -0,0 +1,584 @@
#Optimization mod by Teravisor
#Removes no more check_stat loop each frame
#Problem: 25_Game_Actor.rb calls check_stat which loops through all stats two times per frame in update_lonastat
#What it does:
#Removes all previous calls to check_stat
#set_stat checks for min/max of specified stat instead
#Moves check_stat call to refresh call that only happens when status or equipment gets changed
#Deprecates update_lonaStat call in order to remove it from everywhere; calls it during refresh; fixes few cases where refresh wasn't called properly when changing states. For old method use update_lonaStat_
#Intercepts set calls to Game_Actor.stat to report portrait stat changes to 1_O_StatPortraitOptimization.rb
#NOTE: check_stat is used in following files:
#\Frames\25_Game_Actor.rb (was called in update_lonaStat that was moved to refresh call)
#\Frames\281_Game_NonPlayerCharacter.rb (used in update_npc_stat before applying effects)
#\Editables\4000_Npc_AbomHiveLink.rb (Redundant call: @stat gets replaced by @master.actor.stat after check_stat)
#\Frames\Modules\Mood.rb (Used to refresh stat after calling update_persona that does call set_stat so should be fine)
unless $statsOptimized
$statsOptimized=true
=begin Broke arrows: they are NPCs with min/max stats 0
class ActorStat
#saving old method in check_stat_old and removing check_stat method
alias_method :check_stat_old, :check_stat
def check_stat
end
def check_single_stat(key)
#return if @stat[key][MAX_TRUE].nil? || @stat[key][MIN_TRUE].nil? || @stat[key][MAX_STAT].nil? || @stat[key][MIN_STAT].nil?
check_min_def_within_range(key)
check_max_def_within_range(key)
check_max_within_range(key)
check_min_within_range(key)
remove_changed_mark(key)
end
def check_current_stat(key)
#return if @stat[key][MAX_STAT].nil? || @stat[key][MIN_STAT].nil?
check_max_within_range(key)
check_min_within_range(key)
end
#redefining set_stat to also check that value is in range
def set_stat(stat_name,value,type=CURRENT_STAT)
return p "stats not exist on target stat_name=>#{stat_name}" if @stat[stat_name].nil?
value=value.round(3) if value.is_a?(Float)
@stat[stat_name][type]=value
#when setting MAX_STAT or MIN_STAT we need to not check them in order to prevent situation when we first increase MAX_STAT, then round to MAX_TRUE, then apply reduction by decreasing MAX_STAT
#setting MAX_TRUE and MIN_TRUE will break whole chain of checks with how they're made anyway, so it'll be applied only on next refresh.
p "#{@npc_name} set_stat #{stat_name} #{value} #{type}"
check_current_stat(stat_name) if type == CURRENT_STAT
end
#should also check that value is in range.
def set_stat_m(stat_name,value,types=nil)
types=[CURRENT_STAT,MAX_STAT,MAX_TRUE] if types.nil?
raise "set_stat_m requires array of types" if !types.kind_of?(Array)
types.each{
|type|
@stat[stat_name][type]=value
}
check_single_stat(stat_name)
end
#this is called before check_stat each update_npc_stat so I do what check_stat did here
def reset_definition
@stat.keys.each{
|key|
@stat[key][MIN_STAT]=@stat[key][MIN_TRUE]
@stat[key][MAX_STAT]=@stat[key][MAX_TRUE]
check_single_stat(key)
}
end
end
=end
class LonaActorStat < ActorStat
#there are a lot of set_stat calls, and there should be a way to hook to them in place where you know who your actor is.
attr_accessor :actor
#saving old method in check_stat_old (with last underscore) and removing check_stat method
alias_method :check_stat_old, :check_stat
def check_stat
#If situation of Player getting hit and speed getting stuck at slowed is possible then uncomment next line.
#check_single_stat("move_speed")
end
def set_stat(stat_name, value, type=CURRENT_STAT)
return p "stats not exist on target stat_name=>#{stat_name}" if @stat[stat_name].nil?
value=value.round(3) if value.is_a?(Float)
@stat[stat_name][type]=value
#when setting MAX_STAT or MIN_STAT we need to not check them in order to prevent situation when we first increase MAX_STAT, then round to MAX_TRUE, then apply reduction by decreasing MAX_STAT
#setting MAX_TRUE and MIN_TRUE will break whole chain of checks with how they're made anyway, so it'll be applied only on next refresh.
check_current_stat(stat_name) if type == CURRENT_STAT
#those calls were in update_lonaStat each frame
if type == CURRENT_STAT && !@actor.nil? then
if stat_name == "health".freeze then
@actor.check_prev_health_to_mood
@actor.check_prev_health_to_BabyHealth
@actor.prev_health = @actor.health
elsif stat_name == "sta".freeze then
@actor.stat["sta".freeze]=value
@actor.check_prev_sta_to_arousal
@actor.check_prev_sta_to_exp
@actor.check_prev_sta_to_BabyHealth
@actor.prev_sta = @actor.sta
elsif stat_name == "mood".freeze
@actor.stat["mood".freeze]=value
@actor.check_mood_to_state
elsif stat_name == "dirt".freeze
@actor.stat["dirt".freeze]=value
@actor.check_dirt_to_state
if @dirt_opt.nil? || (@dirt_opt - value).abs > 25 then #Only update portrait and chs if dirt changed by more than 1% (25/255) opacity
@dirt_opt = value
$game_player.refresh_chs
if $statPortraitOptimize==true && @actor.portrait
@actor.portrait.set_stat("dirt".freeze, value)
@actor.portrait.assemble_portrait
end
end
end
end
if type == MAX_STAT && !@actor.nil?
if stat_name == "sta".freeze then
@actor.calculate_weight_carried
end
end
end
def check_single_stat(key)
return if unknown_behave_stats?(key) #|| !stat_changed?(key)
sync_max(key) if reality_stats?(key) || ground_stats?(key)
if reality_stats?(key) || regualr_stats?(key) then
check_max_def_within_range(key)
check_min_def_within_range(key)
check_def_cross_section(key)
check_max_within_range(key)
check_min_within_range(key)
else
if ground_stats?(key) then
check_min_def_within_range(key)
check_def_cross_section(key)
check_min_within_range(key)
end
end
remove_changed_mark(key)
end
def check_current_stat(key)
return if unknown_behave_stats?(key)
sync_max(key) if reality_stats?(key) || ground_stats?(key)
if reality_stats?(key) || regualr_stats?(key) then
check_def_cross_section(key)
check_max_within_range(key)
check_min_within_range(key)
else
if ground_stats?(key) then
check_def_cross_section(key)
check_min_within_range(key)
end
end
end
#should also check that value is in range.
def set_stat_m(stat_name,value,types=nil)
types=[CURRENT_STAT,MAX_STAT,MAX_TRUE] if types.nil?
raise "set_stat_m requires array of types" if !types.kind_of?(Array)
types.each{
|type|
@stat[stat_name][type]=value
}
check_single_stat(stat_name)
end
#this is called before check_stat each update_npc_stat so I do what check_stat did here
def reset_definition
@stat.keys.each{
|key|
next if reality_stats?(key)
@stat[key][MIN_STAT]=@stat[key][MIN_TRUE]
@stat[key][MAX_STAT]=@stat[key][MAX_TRUE]
check_single_stat(key)
}
@actor.calculate_weight_carried if !@actor.nil?
end
#does exactly what reset_definition does with a typo (MAX_STAT=MAX_TRUE twice) and only place it's called is right after it
def reset_stat_def
end
end
#there are a lot of set_stat calls, and there should be a way to hook to them in place where you know who your actor is.
class Game_Actor < Game_Battler
alias_method :setup_TERFIX1, :setup
def setup(actor_id)
setup_TERFIX1(actor_id)
@actStat.check_stat_old
@actStat.actor = self
end
alias_method :post_setup_TERFIX1, :post_setup
def post_setup
post_setup_TERFIX1
update_lonaStat_
end
#process_nap_change calls a lot of erase_state so we need to refresh stats after.
alias_method :process_nap_change_TERFIX1, :process_nap_change
def process_nap_change
process_nap_change_TERFIX1
refresh
end
#so many things refresh does, but it doesn't call check_stat for some reason even though it's being called on every remove_state and add_state and change_equip
alias_method :refresh_TERFIX1, :refresh
alias_method :update_lonaStat_TERFIX1, :update_lonaStat
def refresh
refresh_TERFIX1
@actStat.check_stat_old
#update_lonaStat_TERFIX1
recalculate_stats
end
#simulates behavior of old update_lonaStat to not call whole refresh where old update_lonaStat was used
def update_lonaStat_
update_lonaStat_TERFIX1
@actStat.check_stat_old
end
#removes all calls to old update_lonaStat
def update_lonaStat
#It was called in update_lonaStat so I guess it might be important for some states.
#But update_lonaStat is called from so many places that it's strange.
#for example, when loading. In other words, one can save/load until status that can be removed by walking is gone...
update_state_frames
end
def recalculate_stats
tmpSexAtk = (self.stat["Nymph"]+self.stat["Prostitute"])*25
tmpSexAtkMax = 100+self.stat["Lilith"]*50
self.constitution= self.constitution_trait+self.constitution_plus
self.survival= self.survival_trait+self.survival_plus
self.wisdom= self.wisdom_trait+self.wisdom_plus
self.combat= self.combat_trait+self.combat_plus
self.scoutcraft= self.scoutcraft_trait+self.scoutcraft_plus
self.atk= (self.combat*0.5) + self.atk_plus
self.def= self.def_plus
sex_Con = self.constitution/2
self.sex_vag_atk= ([sex_Con+(@exp_vag *(2+self.stat["Lilith"]))+tmpSexAtk,tmpSexAtkMax].min - self.vag_damage/100).round
self.sex_anal_atk= ([sex_Con+(@exp_anal *(2+self.stat["Lilith"]))+tmpSexAtk,tmpSexAtkMax].min - self.anal_damage/100).round
self.sex_mouth_atk= ([sex_Con+(@exp_mouth*(2+self.stat["Lilith"]))+tmpSexAtk,tmpSexAtkMax].min * [0.01*self.sta,1].min).round
self.sex_limbs_atk= ([sex_Con+(@exp_limbs*(2+self.stat["Lilith"]))+tmpSexAtk,tmpSexAtkMax].min * [0.01*self.sta,1].min).round
self.morality= self.morality_lona + (self.morality_plus-200)
self.hud_weight_count= 2*self.attr_dimensions["sta"][2] - self.weight_carried
end
#init_equip calls refresh before everything is setup for update_lonaStat.
def init_equips(equips)
@equips = Array.new(equip_slots.size) { Game_BaseItem.new }
equips.each_with_index do |item_id, i|
etype_id = index_to_etype_id(i)
slot_id = empty_slot(etype_id)
report_portrait_stat(@equips[slot_id].object.lonaStat.statName, nil) if !@equips[slot_id].object.nil?
@equips[slot_id].set_equip(etype_id == 0, item_id) if slot_id
report_portrait_stat(@equips[slot_id].object.lonaStat.statName, @equips[slot_id].object.lonaStat.affectValue) if !@equips[slot_id].object.nil?
end
#refresh # not everything is set up for update_lonaStat at this point. So refresh will come later.
#from 119_ACE_Equip.rb equip_extra_starting_equips
for equip_id in actor.extra_starting_equips
armour = $data_armors[equip_id]
next if armour.nil?
etype_id = armour.etype_id
next unless equip_slots.include?(etype_id)
slot_id = empty_slot(etype_id)
report_portrait_stat(@equips[slot_id].object.lonaStat.statName, nil) if !@equips[slot_id].object.nil?
@equips[slot_id].set_equip(etype_id == 0, armour.id)
report_portrait_stat(@equips[slot_id].object.lonaStat.statName, @equips[slot_id].object.lonaStat.affectValue) if !@equips[slot_id].object.nil?
end
#refresh # It also calls refresh. And later yet again.
refresh_equip_effects #update_lonaStat will be called soon and it needs carryWeight
end
alias_method :change_equip_StatOptimization, :change_equip
def change_equip(slot_id, item)
oldItem = @equips[slot_id].object
change_equip_StatOptimization(slot_id, item)
newItem = @equips[slot_id].object
if newItem!=oldItem then
report_portrait_stat(oldItem.lonaStat.statName, nil) if !oldItem.nil?
report_portrait_stat(newItem.lonaStat.statName, newItem.lonaStat.affectValue) if !newItem.nil?
end
end
alias_method :discard_equip_optimization, :discard_equip
def discard_equip(item)
report_portrait_stat(item.lonaStat.statName, nil) if item && item.lonaStat
discard_equip_optimization(item)
# report_portrait_stat("dirt",stat["dirt"])
end
def release_unequippable_items(item_gain = true)
loop do
last_equips = equips.dup
@equips.each_with_index do |item, i|
if !equippable?(item.object) || item.object.etype_id != equip_slots[i]
if !item.object.nil?
report_portrait_stat(item.object.lonaStat.statName, nil)
end
trade_item_with_party(nil, item.object) if item_gain
item.object = nil
end
end
return if equips == last_equips
end
end
alias_method :actor_ForceUpdate_TERFIX1, :actor_ForceUpdate
def actor_ForceUpdate
update_lonaStat_
actor_ForceUpdate_TERFIX1
end
end
#Because CG scripts call actor.stat[<name>]=<something> I have to intercept them.
class Portrait_Stat_Proxy
attr_accessor :actor
def initialize(actor)
@actor = actor
end
def [](key)
return @actor.portrait_stat_value[key]
end
def []=(key, value)
@actor.report_portrait_stat(key,value)
end
def each
@actor.portrait_stat_value.each{|k,v|
oldVal = v
yield(k,v)
@actor.report_portrait_stat(k,v) if oldVal != v
}
end
end
#Affects portrait stats. If left as it-is, mood gets infinitely updates so portrait gets perma shown
module Moods
def prtmood(moodName,update_first=true)
curMood=get_mood(moodName)
return p "mood not found for #{moodName}" if curMood.nil?
update_lonaStat if update_first
curMood.affectStat(self)
@stat_changed=true
portrait.reset_rotation
portrait.update
end
class Mood
def affectStat(actor)
randomValue=rand(@facesets.length)
randomSet=@facesets[randomValue]
randomKeys=randomSet.keys
randomKeys.each{
|rKey|
rKeyVal=rand(randomSet[rKey].length)
if(randomValue==1)
actor.report_portrait_stat(rKey, randomSet[rKey][0])
else
actor.report_portrait_stat(rKey, randomSet[rKey][rKeyVal])
end
}
end
end
class CHCGMood < Mood
def affectStat(actor)
statNames=@facesets.keys
for x in 0...statNames.length
statName=statNames[x]
randomRange=@facesets[statName].length-1
actor.report_portrait_stat(statName, @facesets[statName][rand(0,randomRange)])
end
end
end
end
#Player's check for Fatigue (stamina<0) happens using erase_state which doesn't call refresh
class Game_Player
alias_method :handle_on_move_step_TERFIX1, :handle_on_move_step
def handle_on_move_step(multiplier=1)
if actor.sta >0 && actor.stat["Fatigue".freeze] ==1
actor.remove_state(14)
end
handle_on_move_step_TERFIX1(multiplier)
end
end
#old update_lonaStat calls that are not frame-dependant and no refresh call near them
module DataManager
class << self
alias_method :setup_new_game_TERFIX1, :setup_new_game
def self.setup_new_game(tmp_tomap=true)
setup_new_game_TERFIX1(tmp_tomap)
$game_actors[1].refresh
end
alias_method :extract_save_contents_TERFIX1, :extract_save_contents
def extract_save_contents(contents)
extract_save_contents_TERFIX1(contents)
$game_player.actor.actStat.actor = $game_player.actor
end
end
end
class Game_Actor < Game_Battler
#Freezing strings to not allocate them each time getter and setter is used.
#getter
def health; @actStat.get_stat("health".freeze);end
def always; @actStat.get_stat("always".freeze);end
def mood; @actStat.get_stat("mood".freeze);end
def sta; @actStat.get_stat("sta".freeze);end
def sat; @actStat.get_stat("sat".freeze);end
def weak; @actStat.get_stat("weak".freeze);end
def will; @actStat.get_stat("will".freeze);end
def sexy; @actStat.get_stat("sexy".freeze);end
def baby_health; @actStat.get_stat("baby_health".freeze);end
def morality; @actStat.get_stat("morality".freeze);end
def morality_plus; @actStat.get_stat("morality_plus".freeze);end
def morality_lona; @actStat.get_stat("morality_lona".freeze);end
def dirt; @actStat.get_stat("dirt".freeze);end
def sex_vag_atk; @actStat.get_stat("sex_vag_atk".freeze);end
def sex_anal_atk; @actStat.get_stat("sex_anal_atk".freeze);end
def sex_mouth_atk; @actStat.get_stat("sex_mouth_atk".freeze);end
def sex_limbs_atk; @actStat.get_stat("sex_limbs_atk".freeze);end
def constitution; @actStat.get_stat("constitution".freeze);end
def survival; @actStat.get_stat("survival".freeze);end
def wisdom; @actStat.get_stat("wisdom".freeze);end
def combat; @actStat.get_stat("combat".freeze);end
def scoutcraft; @actStat.get_stat("scoutcraft".freeze);end
def constitution_trait; @actStat.get_stat("constitution_trait".freeze);end
def survival_trait; @actStat.get_stat("survival_trait".freeze);end
def wisdom_trait; @actStat.get_stat("wisdom_trait".freeze);end
def combat_trait; @actStat.get_stat("combat_trait".freeze);end
def scoutcraft_trait; @actStat.get_stat("scoutcraft_trait".freeze);end
def melaninNipple; @actStat.get_stat("melaninNipple".freeze);end
def melaninVag; @actStat.get_stat("melaninVag".freeze);end
def melaninAnal; @actStat.get_stat("melaninAnal".freeze);end
def arousal; @actStat.get_stat("arousal".freeze);end
def atk; @actStat.get_stat("atk".freeze);end
def def; @actStat.get_stat("def".freeze);end
def move_speed; @actStat.get_stat("move_speed".freeze);end
def atk_plus; @actStat.get_stat("atk_plus".freeze);end
def def_plus; @actStat.get_stat("def_plus".freeze);end
def constitution_plus; @actStat.get_stat("constitution_plus".freeze);end
def combat_plus; @actStat.get_stat("combat_plus".freeze);end
def survival_plus; @actStat.get_stat("survival_plus".freeze);end
def wisdom_plus; @actStat.get_stat("wisdom_plus".freeze);end
def scoutcraft_plus; @actStat.get_stat("scoutcraft_plus".freeze);end
def persona; @actStat.get_stat("persona".freeze);end
def race; @actStat.get_stat("race".freeze);end
def urinary_level; @actStat.get_stat("urinary_level".freeze);end
def lactation_level; @actStat.get_stat("lactation_level".freeze);end
def defecate_level; @actStat.get_stat("defecate_level".freeze);end
def vag_damage; @actStat.get_stat("vag_damage".freeze);end
def urinary_damage; @actStat.get_stat("urinary_damage".freeze);end
def anal_damage; @actStat.get_stat("anal_damage".freeze);end
def state_preg_rate; @actStat.get_stat("state_preg_rate".freeze);end
def puke_value_normal; @actStat.get_stat("puke_value_normal".freeze);end
def drug_addiction_level; @actStat.get_stat("drug_addiction_level".freeze);end
def ograsm_addiction_level; @actStat.get_stat("ograsm_addiction_level".freeze);end
def semen_addiction_level; @actStat.get_stat("semen_addiction_level".freeze);end
def drug_addiction_damage; @actStat.get_stat("drug_addiction_damage".freeze);end
def ograsm_addiction_damage; @actStat.get_stat("ograsm_addiction_damage".freeze);end
def semen_addiction_damage; @actStat.get_stat("semen_addiction_damage".freeze);end
def sex; @actStat.get_stat("sex".freeze);end
#setter
def health=(val);@actStat.set_stat("health".freeze,val);end
def always=(val);@actStat.set_stat("always".freeze,val);end
def mood=(val);@actStat.set_stat("mood".freeze,val);end
def sta=(val);@actStat.set_stat("sta".freeze,val);end
def sat=(val);@actStat.set_stat("sat".freeze,val);end
def weak=(val);@actStat.set_stat("weak".freeze,val);end
def will=(val);@actStat.set_stat("will".freeze,val);end
def baby_health=(val);@actStat.set_stat("baby_health".freeze,val);end
def morality=(val);@actStat.set_stat("morality".freeze,val);end
def morality_plus=(val);@actStat.set_stat("morality_plus".freeze,val);end
def morality_lona=(val);@actStat.set_stat("morality_lona".freeze,val);end
def dirt=(val); @actStat.set_stat("dirt".freeze,val);end
def sex_vag_atk=(val);@actStat.set_stat("sex_vag_atk".freeze,val);end
def sex_anal_atk=(val);@actStat.set_stat("sex_anal_atk".freeze,val);end
def sex_mouth_atk=(val);@actStat.set_stat("sex_mouth_atk".freeze,val);end
def sex_limbs_atk=(val);@actStat.set_stat("sex_limbs_atk".freeze,val);end
def constitution=(val);@actStat.set_stat("constitution".freeze,val);end
def survival=(val);@actStat.set_stat("survival".freeze,val);end
def wisdom=(val);@actStat.set_stat("wisdom".freeze,val);end
def combat=(val);@actStat.set_stat("combat".freeze,val);end
def scoutcraft=(val);@actStat.set_stat("scoutcraft".freeze,val);end
def constitution_trait=(val);@actStat.set_stat("constitution_trait".freeze,val);end
def survival_trait=(val);@actStat.set_stat("survival_trait".freeze,val);end
def wisdom_trait=(val);@actStat.set_stat("wisdom_trait".freeze,val);end
def combat_trait=(val);@actStat.set_stat("combat_trait".freeze,val);end
def scoutcraft_trait=(val);@actStat.set_stat("scoutcraft_trait".freeze,val);end
def melaninNipple=(val);@actStat.set_stat("melaninNipple".freeze,val);end
def melaninVag=(val);@actStat.set_stat("melaninVag".freeze,val);end
def melaninAnal=(val);@actStat.set_stat("melaninAnal".freeze,val);end
def arousal=(val);@actStat.set_stat("arousal".freeze,val);end
def move_speed=(val);@actStat.set_stat("move_speed".freeze,val);end
def atk_plus=(val);@actStat.set_stat("atk_plus".freeze,val);end
def def_plus=(val);@actStat.set_stat("def_plus".freeze,val);end
def atk=(val);@actStat.set_stat("atk".freeze,val);end
def def=(val);@actStat.set_stat("def".freeze,val);end
def scoutcraft_plus=(val);@actStat.set_stat("scoutcraft_plus".freeze,val);end
def constitution_plus=(val);@actStat.set_stat("constitution_plus".freeze,val);end
def combat_plus=(val);@actStat.set_stat("combat_plus".freeze,val);end
def survival_plus=(val);@actStat.set_stat("survival_plus".freeze,val);end
def wisdom_plus=(val);@actStat.set_stat("wisdom_plus".freeze,val);end
def persona=(val);@actStat.set_stat("persona".freeze,val);end
def race=(val);@actStat.set_stat("race".freeze,val);end
def urinary_level=(val);@actStat.set_stat("urinary_level".freeze,val);end
def lactation_level=(val);@actStat.set_stat("lactation_level".freeze,val);end
def defecate_level=(val);@actStat.set_stat("defecate_level".freeze,val);end
def vag_damage=(val);@actStat.set_stat("vag_damage".freeze,val);end
def urinary_damage=(val);@actStat.set_stat("urinary_damage".freeze,val);end
def anal_damage=(val);@actStat.set_stat("anal_damage".freeze,val);end
def state_preg_rate=(val);@actStat.set_stat("state_preg_rate".freeze,val);end
def puke_value_normal=(val);@actStat.set_stat("puke_value_normal".freeze,val);end
def drug_addiction_level=(val);@actStat.set_stat("drug_addiction_level".freeze,val);end
def ograsm_addiction_level=(val);@actStat.set_stat("ograsm_addiction_level".freeze,val);end
def semen_addiction_level=(val);@actStat.set_stat("semen_addiction_level".freeze,val);end
def drug_addiction_damage=(val);@actStat.set_stat("drug_addiction_damage".freeze,val);end
def ograsm_addiction_damage=(val);@actStat.set_stat("ograsm_addiction_damage".freeze,val);end
def semen_addiction_damage=(val);@actStat.set_stat("semen_addiction_damage".freeze,val);end
def sex=(val);@actStat.set_stat("sex".freeze,val);end
def fetishPeePee(tmpOnOff=true)
if tmpOnOff
self.battle_stat.set_stat_m("urinary_level".freeze,5000,[2,3])
else
self.battle_stat.set_stat_m("urinary_level".freeze,1,[2,3])
end
end
def fetishPooPoo(tmpOnOff=true)
if tmpOnOff
self.battle_stat.set_stat_m("defecate_level".freeze,5000,[2,3])
else
self.battle_stat.set_stat_m("defecate_level".freeze,1,[2,3])
end
end
def fetishHardcore(tmpOnOff=true)
if tmpOnOff
self.battle_stat.set_stat_m("puke_value_normal".freeze,10000,[2,3])
self.battle_stat.set_stat_m("drug_addiction_level".freeze,5000,[2,3])
self.battle_stat.set_stat_m("ograsm_addiction_level".freeze,5000,[2,3])
self.battle_stat.set_stat_m("semen_addiction_level".freeze,5000,[2,3])
self.battle_stat.set_stat_m("drug_addiction_damage".freeze,5000,[2,3])
self.battle_stat.set_stat_m("ograsm_addiction_damage".freeze,5000,[2,3])
self.battle_stat.set_stat_m("semen_addiction_damage".freeze,5000,[2,3])
else
self.battle_stat.set_stat_m("puke_value_normal".freeze,0,[2,3])
self.battle_stat.set_stat_m("drug_addiction_level".freeze,0,[2,3])
self.battle_stat.set_stat_m("ograsm_addiction_level".freeze,0,[2,3])
self.battle_stat.set_stat_m("semen_addiction_level".freeze,0,[2,3])
self.battle_stat.set_stat_m("drug_addiction_damage".freeze,0,[2,3])
self.battle_stat.set_stat_m("ograsm_addiction_damage".freeze,0,[2,3])
self.battle_stat.set_stat_m("semen_addiction_damage".freeze,0,[2,3])
end
end
end
end
+313
View File
@@ -0,0 +1,313 @@
#==============================================================================
# This script has been altered by Kslander for the need of LonaRPG
#==============================================================================
#==============================================================================
# ** Scene_Shop
#------------------------------------------------------------------------------
# This class performs shop screen processing.
#==============================================================================
class Scene_Shop < Scene_MenuBase
#--------------------------------------------------------------------------
# * Prepare
#--------------------------------------------------------------------------
def prepare(goods, purchase_only)
@goods = goods
@purchase_only = purchase_only
end
#--------------------------------------------------------------------------
# * Start Processing
#--------------------------------------------------------------------------
def start
super
create_help_window
create_gold_window
create_command_window
create_category_window
create_dummy_window
create_number_window
create_buy_window
create_sell_window
modify_help_window
end
def modify_help_window
@help_window.y = @category_window.height
@help_window.x = @buy_window.width
@help_window.width =Graphics.width - @buy_window.width
@help_window.height= @dummy_window.height
@help_window.create_contents
@help_window.hide
end
#--------------------------------------------------------------------------
# * Create Gold Window
#--------------------------------------------------------------------------
def create_gold_window
@gold_window = Window_Gold.new
@gold_window.viewport = @viewport
@gold_window.x = Graphics.width - @gold_window.width
@gold_window.y = 0 #@help_window.height
end
#--------------------------------------------------------------------------
# * Create Command Window
#--------------------------------------------------------------------------
def create_command_window
@command_window = Window_ShopCommand.new(@gold_window.x, @purchase_only)
@command_window.viewport = @viewport
@command_window.y = 0#@category_window.height #@help_window.height
@command_window.set_handler(:buy, method(:command_buy))
@command_window.set_handler(:sell, method(:command_sell))
@command_window.set_handler(:cancel, method(:return_map))
end
#--------------------------------------------------------------------------
# * Create Dummy Window
#--------------------------------------------------------------------------
def create_dummy_window
#wy = @category_window.y + @category_window.height
wy = @command_window.y + @command_window.height
wh = Graphics.height - wy
@dummy_window = Window_Base.new(0, wy, Graphics.width, wh)
@dummy_window.viewport = @viewport
end
#--------------------------------------------------------------------------
# * Create Quantity Input Window
#--------------------------------------------------------------------------
def create_number_window
wy = @dummy_window.y
wh = @dummy_window.height
@number_window = Window_ShopNumber.new(0, wy, wh)
@number_window.viewport = @viewport
@number_window.hide
@number_window.set_handler(:ok, method(:on_number_ok))
@number_window.set_handler(:cancel, method(:on_number_cancel))
end
#--------------------------------------------------------------------------
# * Create Purchase Window
#--------------------------------------------------------------------------
def create_buy_window
wy = @dummy_window.y
wh = @dummy_window.height
@buy_window = Window_ShopBuy.new(0, wy, wh, @goods)
@buy_window.viewport = @viewport
@buy_window.help_window = @help_window
@buy_window.hide
@buy_window.set_handler(:ok, method(:on_buy_ok))
@buy_window.set_handler(:cancel, method(:on_buy_cancel))
end
#--------------------------------------------------------------------------
# * Create Category Window
#--------------------------------------------------------------------------
def create_category_window
@category_window = Window_ItemCategory.new
@category_window.viewport = @viewport
@category_window.help_window = @help_window
@category_window.y = @command_window.height
@category_window.hide.deactivate
@category_window.set_handler(:ok, method(:on_category_ok))
@category_window.set_handler(:cancel, method(:on_category_cancel))
end
#--------------------------------------------------------------------------
# * Create Sell Window
#--------------------------------------------------------------------------
def create_sell_window
wy = @category_window.y + @category_window.height
wh = Graphics.height - wy
@sell_window = Window_ShopSell.new(0, wy, Graphics.width, wh)
@sell_window.viewport = @viewport
@sell_window.help_window = @help_window
@sell_window.hide
@sell_window.set_handler(:ok, method(:on_sell_ok))
@sell_window.set_handler(:cancel, method(:on_sell_cancel))
@category_window.item_window = @sell_window
end
#--------------------------------------------------------------------------
# * Activate Purchase Window
#--------------------------------------------------------------------------
def activate_buy_window
@buy_window.money = money
@buy_window.show.activate
@help_window.height = Graphics.height - @category_window.height
@help_window.y = @buy_window.y
@help_window.show
end
#--------------------------------------------------------------------------
# * Activate Sell Window
#--------------------------------------------------------------------------
def activate_sell_window
@category_window.show
@sell_window.refresh
@sell_window.show.activate
@help_window.hide
end
#--------------------------------------------------------------------------
# * [Buy] Command
#--------------------------------------------------------------------------
def command_buy
@dummy_window.hide
activate_buy_window
end
#--------------------------------------------------------------------------
# * [Sell] Command
#--------------------------------------------------------------------------
def command_sell
@dummy_window.hide
@category_window.show.activate
@sell_window.show
@sell_window.unselect
@sell_window.refresh
@help_window.hide
end
#--------------------------------------------------------------------------
# * Buy [OK]
#--------------------------------------------------------------------------
def on_buy_ok
@item = @buy_window.item
@buy_window.hide
@number_window.set(@item, max_buy, buying_price, currency_unit)
@number_window.show.activate
end
#--------------------------------------------------------------------------
# * Buy [Cancel]
#--------------------------------------------------------------------------
def on_buy_cancel
@command_window.activate
@dummy_window.show
@buy_window.hide
@help_window.hide
@help_window.clear
end
#--------------------------------------------------------------------------
# * Category [OK]
#--------------------------------------------------------------------------
def on_category_ok
activate_sell_window
@sell_window.select(0)
end
#--------------------------------------------------------------------------
# * Category [Cancel]
#--------------------------------------------------------------------------
def on_category_cancel
@command_window.activate
@dummy_window.show
@category_window.hide
@sell_window.hide
end
#--------------------------------------------------------------------------
# * Sell [OK]
#--------------------------------------------------------------------------
def on_sell_ok
@item = @sell_window.item
@category_window.hide
@sell_window.hide
@help_window.width= Graphics.width - @number_window.width
@help_window.height = @number_window.height
@help_window.y= @number_window.y
@help_window.x = @number_window.width
@help_window.show
@number_window.set(@item, max_sell, @item.get_sell_price, currency_unit)
@number_window.show.activate
end
#--------------------------------------------------------------------------
# * Sell [Cancel]
#--------------------------------------------------------------------------
def on_sell_cancel
@sell_window.unselect
@category_window.activate
@help_window.hide
@help_window.clear
end
#--------------------------------------------------------------------------
# * Quantity Input [OK]
#--------------------------------------------------------------------------
def on_number_ok
SndLib.sys_equip
case @command_window.current_symbol
when :buy
do_buy(@number_window.number)
when :sell
do_sell(@number_window.number)
end
end_number_input
@gold_window.refresh
end
#--------------------------------------------------------------------------
# * Quantity Input [Cancel]
#--------------------------------------------------------------------------
def on_number_cancel
SndLib.sys_cancel
end_number_input
end
#--------------------------------------------------------------------------
# * Execute Purchase
#--------------------------------------------------------------------------
def do_buy(number)
$game_party.lose_gold(number * buying_price)
$game_party.gain_item(@item, number)
end
#--------------------------------------------------------------------------
# * Execute Sale
#--------------------------------------------------------------------------
def do_sell(number)
$game_party.gain_gold(number * @item.get_sell_price)
$game_party.lose_item(@item, number)
end
#--------------------------------------------------------------------------
# * Exit Quantity Input
#--------------------------------------------------------------------------
def end_number_input
@number_window.hide
case @command_window.current_symbol
when :buy
activate_buy_window
when :sell
activate_sell_window
end
end
#--------------------------------------------------------------------------
# * Get Maximum Quantity Buyable
#--------------------------------------------------------------------------
def max_buy
max = $game_party.max_item_number(@item) - $game_party.item_number(@item)
buying_price == 0 ? max : [max, money / buying_price].min
end
#--------------------------------------------------------------------------
# * Get Maximum Quantity Sellable
#--------------------------------------------------------------------------
def max_sell
$game_party.item_number(@item)
end
#--------------------------------------------------------------------------
# * Get Party Gold
#--------------------------------------------------------------------------
def money
@gold_window.value
end
#--------------------------------------------------------------------------
# Get Currency Unit
#--------------------------------------------------------------------------
def currency_unit
@gold_window.currency_unit
end
#--------------------------------------------------------------------------
# * Get Purchase Price
#--------------------------------------------------------------------------
def buying_price
@buy_window.price(@item)
end
#--------------------------------------------------------------------------
# * Get Sale Price
#--------------------------------------------------------------------------
#def selling_price
#case @item.type_tag
# when "Money"
# temp_wisdom_fix = $game_player.actor.wisdom*0.001
# temp_final_price = (@item.price * [0.9+temp_wisdom_fix,0.95].min).round
# temp_final_price
# else
# temp_wisdom_fix = $game_player.actor.wisdom*0.005
# temp_final_price = (@item.price * [0.5+temp_wisdom_fix,0.95].min).round
# temp_final_price
# end
#end
end
+87
View File
@@ -0,0 +1,87 @@
#==============================================================================
# ** Scene_Debug
#------------------------------------------------------------------------------
# This class performs debug screen processing.
#==============================================================================
class Scene_Debug < Scene_MenuBase
#--------------------------------------------------------------------------
# * Start Processing
#--------------------------------------------------------------------------
def start
super
create_left_window
create_right_window
create_debug_help_window
end
#--------------------------------------------------------------------------
# * Termination Processing
#--------------------------------------------------------------------------
def terminate
super
#$game_map.refresh
end
#--------------------------------------------------------------------------
# * Create Left Window
#--------------------------------------------------------------------------
def create_left_window
@left_window = Window_DebugLeft.new(0, 0)
@left_window.set_handler(:ok, method(:on_left_ok))
@left_window.set_handler(:cancel, method(:return_scene))
end
#--------------------------------------------------------------------------
# * Create Right Window
#--------------------------------------------------------------------------
def create_right_window
wx = @left_window.width
ww = Graphics.width - wx
@right_window = Window_DebugRight.new(wx, 0, ww)
@right_window.set_handler(:cancel, method(:on_right_cancel))
@left_window.right_window = @right_window
end
#--------------------------------------------------------------------------
# * Create Help Window
#--------------------------------------------------------------------------
def create_debug_help_window
wx = @right_window.x
wy = @right_window.height
ww = @right_window.width
wh = Graphics.height - wy
@debug_help_window = Window_Base.new(wx, wy, ww, wh)
end
#--------------------------------------------------------------------------
# * Left [OK]
#--------------------------------------------------------------------------
def on_left_ok
refresh_help_window
@right_window.activate
@right_window.select(0)
end
#--------------------------------------------------------------------------
# * Right [Cancel]
#--------------------------------------------------------------------------
def on_right_cancel
@left_window.activate
@right_window.unselect
@debug_help_window.contents.clear
end
#--------------------------------------------------------------------------
# * Refresh Help Window
#--------------------------------------------------------------------------
def refresh_help_window
@debug_help_window.draw_text_ex(4, 0, help_text)
end
#--------------------------------------------------------------------------
# * Get Help Text
#--------------------------------------------------------------------------
def help_text
if @left_window.mode == :switch
"C (Enter) : ON / OFF"
else
"← (Left) : -1\n" +
"→ (Right) : +1\n" +
"L (Pageup) : -10\n" +
"R (Pagedown) : +10"
end
end
end
@@ -0,0 +1,26 @@
#Optimization mod by Teravisor
#MOG_Timer is being always kept as Sprite and possibly getting RPGMaker's update calls. Remove them when they're not used.
if !$sprites_optimized && $portraits_optimized
$sprites_optimized=true
#MOG_Timer keeps 4 Sprites up always even though it's shown only in like 3-4 minigames. Replacing them with FakeSprite (requires 0_O_PortraitOptimization.rb) that don't use resources when idle.
class Sprite_Timer < Sprite
alias_method :initialize_Optimization, :initialize
def initialize(viewport)
initialize_Optimization(viewport)
@layout = FakeSprite.new(@layout)
@meter_sprite = FakeSprite.new(@meter_sprite)
@number_sprite = FakeSprite.new(@number_sprite)
@fire_sprite = FakeSprite.new(@fire_sprite)
end
end
end
@@ -0,0 +1,175 @@
#Optimization mod by Teravisor
#Changes logic of portrait parts stats: when portrait stat changes instead of looping through all possible portrait parts, only loop through all parts that use that stat.
#Must load after 0_O_StatCheckOptimization.rb
unless $statPortraitOptimize || !$statsOptimized
$statPortraitOptimize=true
class Lona_Portrait < Moveable_Portrait
def optimized_check #for checking if this optimization is already installed
end
alias_method :initialize_optimization, :initialize
def initialize(base_char,parts,defPose,name_order,canvas=[300,400,0,0])
initialize_optimization(base_char, parts, defPose, name_order, canvas)
setup_parts_hashes
end
def refresh
base_char.stat.each{|k,v|
set_stat(k,v)
}
end
def setup_parts_hashes
if @stat_to_prts.nil? then#hash for fast search of which parts might be added or removed on that set_stat call
@stat_to_prts = {}
else
@stat_to_prts.clear
end
@allprts = @prts
@dirtPart = nil
@prts = []#parts currently in portrait. Array for iteration.
@parts_changed = false #do we need to reassemble portrait?
@allprts.each{|prt|
if prt.isDirt && prt.dirtKey != ""
if @stat_to_prts[prt.dirtKey].nil? then
@stat_to_prts[prt.dirtKey] = [prt]
else
@stat_to_prts[prt.dirtKey] << prt
end
end
prt.set_name_order(@name_order)
prt.nameOrder.each{|statName|
if @stat_to_prts[statName].nil? then
@stat_to_prts[statName] = [prt]
else
@stat_to_prts[statName] << prt
end
prt.set_value(statName, base_char.stat[statName])
if !prt.bitmap.nil?
@prts << prt
@parts_changed=true
end
}
}
end
def set_stat(statName, value)
if value.nil? then
value = 0
end
if statName == 'dirt'.freeze && @dirt_level != value then
@dirt_level = value
@parts_changed=true
end
arr = @stat_to_prts[statName]
if !arr.nil? then
arr.each{|prt|
prtOldBitmap = prt.bitmap
prt.set_value(statName,value)
prtNewBitmap = prt.bitmap
if prtNewBitmap.nil? && @prts.include?(prt)
@prts.delete(prt)
@parts_changed = true
elsif !prtNewBitmap.nil? && !@prts.include?(prt)
sorted_insert(@prts, prt)
@parts_changed = true
elsif !prtNewBitmap.nil?
if prtNewBitmap != prtOldBitmap
@parts_changed=true
end
end
}
end
end
def test
p "Current parts: "
@prts.each{|prt| p "#{prt.part_name}" }
p "All parts: "
@allprts.each{|prt| p "#{prt.part_name} #{prt.nameOrder} #{prt.prtArrKey} #{prt.bitmaps}"}
end
def sorted_insert(arr, elem)
for i in 0...arr.length
if arr[i].layer >= elem.layer
arr.insert(i, elem)
return
end
end
arr << elem
end
def update_parts
end
alias_method :updatePose_PortraitOptimize, :updatePose
def updatePose
return if pose.eql?(@pose)
updatePose_PortraitOptimize
setup_parts_hashes
set_stat('dirt', @dirt_level)
end
def assemble_portrait
return if !@parts_changed
super
@parts_changed = false
end
end
#debug
def porttst
$game_player.actor.portrait.test
end
class Lona_Part < Portrait_Part
attr_reader :nameOrder
attr_reader :bitmaps
attr_reader :prtArrKey
attr_reader :isDirt
attr_accessor :opacity
alias_method :initialize_optimization, :initialize
def initialize(bmps,psx,psy,layer=255,name="default",stat="default",isDirt=false)
initialize_optimization(bmps,psx,psy,layer,name,stat,isDirt)
end
def set_name_order(name_order)
@prtArrKey = Array.new(name_order[@part_name].length)
@nameOrder = name_order[@part_name]
end
def set_value(key, value)
if key == dirtKey && @isDirt then
value = 0 if value == false
value = 255 if value == true
dirtLevel = value.to_i
dirtLevel = 255 if dirtLevel>255
@opacity = dirtLevel
else
for i in 0...@nameOrder.length
if @nameOrder[i]==key then
@prtArrKey[i] = 0 if value.nil?
if value.instance_of?(String)
@prtArrKey[i]=value
else
@prtArrKey[i]=value.to_i
end
break
end
end
end
@bitmap = get_bitmap(@prtArrKey)
end
def update(ref,name_order)
end
end
end
+201
View File
@@ -0,0 +1,201 @@
# LonaRPG DONT use Game_Vehicle
#==============================================================================
# ** Game_Vehicle
#------------------------------------------------------------------------------
# This class handles vehicles. It's used within the Game_Map class. If there
# are no vehicles on the current map, the coordinates are set to (-1,-1).
#==============================================================================
=begin
class Game_Vehicle < Game_Character
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_reader :altitude # altitude (for airships)
attr_reader :driving # driving flag
#--------------------------------------------------------------------------
# * Object Initialization
# type: vehicle type (:boat, :ship, :airship)
#--------------------------------------------------------------------------
def initialize(type)
super()
@type = type
@altitude = 0
@driving = false
@direction = 4
@walk_anime = false
@step_anime = false
@walking_bgm = nil
init_move_speed
load_system_settings
end
#--------------------------------------------------------------------------
# * Initialize Move Speed
#--------------------------------------------------------------------------
def init_move_speed
@move_speed = 4 if @type == :boat
@move_speed = 5 if @type == :ship
@move_speed = 6 if @type == :airship
end
#--------------------------------------------------------------------------
# * Get System Settings
#--------------------------------------------------------------------------
def system_vehicle
return $data_system.boat if @type == :boat
return $data_system.ship if @type == :ship
return $data_system.airship if @type == :airship
return nil
end
#--------------------------------------------------------------------------
# * Load System Settings
#--------------------------------------------------------------------------
def load_system_settings
@map_id = system_vehicle.start_map_id
@x = system_vehicle.start_x
@y = system_vehicle.start_y
@character_name = system_vehicle.character_name
@character_index = system_vehicle.character_index
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
if @driving
@map_id = $game_map.map_id
sync_with_player
elsif @map_id == $game_map.map_id
moveto(@x, @y)
end
if @type == :airship
@priority_type = @driving ? 2 : 0
else
@priority_type = 1
end
@walk_anime = @step_anime = @driving
end
#--------------------------------------------------------------------------
# * Change Position
#--------------------------------------------------------------------------
def set_location(map_id, x, y)
@map_id = map_id
@x = x
@y = y
refresh
end
#--------------------------------------------------------------------------
# * Determine Coordinate Match
#--------------------------------------------------------------------------
def pos?(x, y)
@map_id == $game_map.map_id && super(x, y)
end
#--------------------------------------------------------------------------
# * Determine Transparency
#--------------------------------------------------------------------------
def transparent
@map_id != $game_map.map_id || super
end
#--------------------------------------------------------------------------
# * Board Vehicle
#--------------------------------------------------------------------------
def get_on
@driving = true
@walk_anime = true
@step_anime = true
@walking_bgm = RPG::BGM.last
system_vehicle.bgm.play
end
#--------------------------------------------------------------------------
# * Get Off Vehicle
#--------------------------------------------------------------------------
def get_off
@driving = false
@walk_anime = false
@step_anime = false
@direction = 4
@walking_bgm.play
end
#--------------------------------------------------------------------------
# * Synchronize With Player
#--------------------------------------------------------------------------
def sync_with_player
@x = $game_player.x
@y = $game_player.y
@real_x = $game_player.real_x
@real_y = $game_player.real_y
@direction = $game_player.direction
update_bush_depth
end
#--------------------------------------------------------------------------
# * Get Move Speed
#--------------------------------------------------------------------------
def speed
@move_speed
end
#--------------------------------------------------------------------------
# * Get Screen Y-Coordinates
#--------------------------------------------------------------------------
def screen_y
super - altitude
end
#--------------------------------------------------------------------------
# * Determine if Movement is Possible
#--------------------------------------------------------------------------
def movable?
!moving? && !(@type == :airship && @altitude < max_altitude)
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
super
update_airship_altitude if @type == :airship
end
#--------------------------------------------------------------------------
# * Update Airship Altitude
#--------------------------------------------------------------------------
def update_airship_altitude
if @driving
@altitude += 1 if @altitude < max_altitude && takeoff_ok?
elsif @altitude > 0
@altitude -= 1
@priority_type = 0 if @altitude == 0
end
@step_anime = (@altitude == max_altitude)
@priority_type = 2 if @altitude > 0
end
#--------------------------------------------------------------------------
# * Get Maximum Altitude of Airship
#--------------------------------------------------------------------------
def max_altitude
return 32
end
#--------------------------------------------------------------------------
# * Determine if Takeoff Is Possible
#--------------------------------------------------------------------------
def takeoff_ok?
$game_player.followers.gather?
end
#--------------------------------------------------------------------------
# * Determine if Docking/Landing Is Possible
# d: Direction (2,4,6,8)
#--------------------------------------------------------------------------
def land_ok?(x, y, d)
if @type == :airship
return false unless $game_map.airship_land_ok?(x, y)
return false unless $game_map.events_xy(x, y).empty?
else
x2 = $game_map.round_x_with_direction(x, d)
y2 = $game_map.round_y_with_direction(y, d)
return false unless $game_map.valid?(x2, y2)
return false unless $game_map.passable?(x2, y2, reverse_dir(d))
return false if collide_with_characters?(x2, y2)
end
return true
end
def get_char_name
@character_name
end
end
=end
+25
View File
@@ -0,0 +1,25 @@
#Made by Teravisor
#Allows 2_LonaBitmapChanger.rb to read palettes exported from GIMP Palette->right click->"Export as"->"Text file..."
module BitmapChanger
class << self
alias_method :read_palette_gimptxt, :read_palette #first name must be unique among all mods
def read_palette(file_path, file_extension)
return read_gimptxt(file_path) if file_extension == ".txt"
return read_palette_gimptxt(file_path, file_extension) #change this to same name used above in alias_method
end
def read_gimptxt(file_path)
#magic to convert file into [R,G,B,R,G,B,...] array and return it
#Input: file with lines #RRGGBB\n in hex
result = []
IO.read(file_path).lines.each{|line|
r = line[1..2].to_i(16)
g = line[3..4].to_i(16)
b = line[5..6].to_i(16)
result << r << g << b
}
return result
end
end
end
+77
View File
@@ -0,0 +1,77 @@
######## File containing examples on how to use BitmapChanger #######
#### How to load setting from custom directory ####
#.json files in ModScripts/PaletteChanger/*.json are loaded automatically.
#To choose what mod file to load use simple loader below.
#Set mod to -1 to disable; 0 and above will load palette from mod_files[mod] path.
mod = -1
mod_files=[]
mod_files[0] = "ModScripts/PaletteChanger/1/portrait_replace.json"
mod_files[1] = "ModScripts/PaletteChanger/SomeOtherFolder/SomeOtherFile.json"
if mod >= 0 && !mod_files[mod].nil?
BitmapChanger.load_setting(mod_files[mod])
end
=begin
#### How to apply palettes depending on parameters ####
#Moot lona palette swap
#Make sure you have .json that affects "names" = ["moot_portrait"]
class Lona_Part
def get_bitmap(target)
return if @bitmaps[target].nil?
settings_key = nil
#Checking if "moot" flag is set on this part
is_moot = read_stat("Race") == "Moot"
settings_key = "moot_portrait" if is_moot
Cache.load_part(@root_folder,"/"+@bitmaps[target], settings_key)
end
def read_stat(name)
for i in 0...@nameOrder.length
if @nameOrder[i]==name then
return @prtArrKey[i]
end
end
return nil
end
end
class Lona_CHS_Part <Lona_Part
def read_stat(name)
partNameOrder=@name_order[@part_name]
for i in 0...partNameOrder.length
if partNameOrder[i]==name then
return @prtArrKey[i]
end
end
return nil
end
def get_bitmap(target,h_mode=-1,position=-1)
if h_mode >=0
ptarget=@h_bitmaps[0][target]
else
ptarget=@bitmaps[target]
end
return nil if ptarget.nil? || ptarget.eql?("NA") || ptarget.eql?("nil")
settings_key = nil
#Checking if "moot" flag is set on this part
is_moot = read_stat("Race") == "Moot"
settings_key = "moot_CHS" if is_moot
Cache.chs_material("#{@root_folder}/#{h_mode>=0 ? "CHSF0/" : ""}#{ptarget}", settings_key)
end
end
=end
+38
View File
@@ -0,0 +1,38 @@
#by 417 added in 0730
tgtDir = "ModScripts/"
unless Dir.exist?(tgtDir)
Dir.mkdir(tgtDir)
puts "Directory created: #{tgtDir}"
else
puts "Directory already exists: #{tgtDir}"
end
tgtDir = "ModScripts/_Mods/"
unless Dir.exist?(tgtDir)
Dir.mkdir(tgtDir)
puts "Directory created: #{tgtDir}"
else
puts "Directory already exists: #{tgtDir}"
end
userDir = System_Settings::USER_DATA_PATH
unless Dir.exist?(userDir)
Dir.mkdir(userDir)
puts "Directory created: #{userDir}"
else
puts "Directory already exists: #{userDir}"
end
if !File.exist?(userDir + "GameMods.ini")
new_file = IniFile.new
# set properties
new_file["Mods"]={}
# pretty print object
p new_file
# set file path
new_file.filename = userDir + "GameMods.ini"
# save file
new_file.write()
end
$ModINI = IniFile.load(userDir + "GameMods.ini")
+15
View File
@@ -0,0 +1,15 @@
module DataManager
class << self
alias_method :update_Lang_UMM, :update_Lang
def update_Lang
update_Lang_UMM
$mod_manager.link_texts
end
alias_method :load_mod_game_objects_UMM, :load_mod_game_objects
def load_mod_game_objects
load_mod_game_objects_UMM
update_Lang
end
end
end
+12
View File
@@ -0,0 +1,12 @@
# frozen_string_literal: true
module SceneManager
def self.call(scene_class)
@stack.push(@scene)
@scene = scene_class.new
end
def self.return
@scene = @stack.pop
end
end
@@ -0,0 +1,26 @@
# frozen_string_literal: true
class Scene_MapTitle
@@mod_achievements_shown = false
alias_method :start_UMM, :start
def start
start_UMM
@new_mods = $mod_manager.new_mods.dup
end
alias_method :updateAchievement_UMM, :updateAchievement
def updateAchievement
unless @achNeedUpdate || @new_mods.empty? || @@mod_achievements_shown
mod = @new_mods.pop
achievementPopup($game_text["umm:umm:achievement/top_text"], mod.localized_name)
end
updateAchievement_UMM
end
alias_method :pre_terminate_UMM, :pre_terminate
def pre_terminate
@@mod_achievements_shown = true
@tmpSprite.dispose unless @tmpSprite.nil? || @tmpSprite.disposed?
end
end
@@ -0,0 +1,228 @@
#note
#key, all maunal_trade
#all item,state, id to name
module DataManager
def self.patch_old_save
gameCurrVer = translate_game_ver(DataManager.export_full_ver_info)
gameSaveVer = translate_game_ver($story_stats["VerInfo"])
lowestSuppotVer = 0.79
if gameSaveVer < lowestSuppotVer
return msgbox "ERROR > Lowest patchable ver = #{lowestSuppotVer}"
SceneManager.exit
end
patchedMsg = ""
patchedMsg += $game_player.patch_old_save(gameCurrVer,gameSaveVer)
patchedMsg += $game_player.actor.patch_old_save(gameCurrVer,gameSaveVer)
patchedMsg += $game_map.patch_old_save(gameCurrVer,gameSaveVer)
if patchedMsg != ""
#$story_stats["VerInfo"] = export_full_ver_info # move to $game_map.setup(map_id), only successed reset map can upgrade game ver
#$story_stats["VerInfo"] = export_full_ver_info
boardMsg = "\\board[SavePatched]"
$game_message.add(boardMsg)
$game_message.add("\\C[6]Please reset map ASAP\\C[0]\\n")
$game_message.add(patchedMsg)
$game_temp.loadEval("$game_map.interpreter.wait_for_message")
end
end
#def self.popup_patch_msg(data)
# $game_temp.loadMSG(patchedMsg)
# $game_temp.load_MSG = patchedMsg
# $game_temp.reserve_common_event(9)
#end
end
#class Game_Map
# alias_method :setup_patch_save, :setup
# def setup_patch_save(map_id)
# setup_patch_save(map_id)
# msgbox
# end
#end
class Scene_Load < Scene_File
alias_method :on_load_success_fix, :on_load_success
def on_load_success
on_load_success_fix
DataManager.patch_old_save
end
end
class Scene_CustomModeLoad < Scene_MenuBase
alias_method :on_load_success_fix, :on_load_success
def on_load_success
on_load_success_fix
DataManager.patch_old_save
end
end
#########################################
#map
class Game_Map
def patch_old_save(gameCurrVer,gameSaveVer)
patchedMsg = ""
if 0.9804 > gameSaveVer
patchedMsg += "0.9804 to #{gameCurrVer}, Reset HostageSaved Data\\n add weather BG_EFX_data\\n"
$story_stats["HostageSaved"] = Hash.new(0) if $story_stats["HostageSaved"].is_a?(Numeric)
$story_stats["current_weather"] = nil
$story_stats["current_shadow"] = nil
$story_stats["BG_EFX_data"] = []
end
if 0.9501 > gameSaveVer
$story_stats["CharacterItems"] = Hash.new
patchedMsg += "0.9501 to #{gameCurrVer}, Reset Store Data\\n"
end
if 0.95 > gameSaveVer
@parallax_name = nil if @parallax_name == ""
patchedMsg += "0.95 to #{gameCurrVer}, @parallax_name fix\\n"
end
if !$game_map.forced_block_dir
$game_map.forced_block_dir = []
patchedMsg += "save 0930 game_map.forced_block_dir added\\n"
end
tmp0920immune_tgt_states = $game_map.npcs.any?{|event|
!event.npc.immune_tgt_states
}
if tmp0920immune_tgt_states
$game_map.npcs.each{|event|
next if event.npc.immune_tgt_states
event.npc.immune_tgt_states = []
event.npc.immune_tgt_state_type = []
}
patchedMsg += "save 0920 NPC immune_tgt_states added\\n"
end
patchedMsg
end
end
#GP
class Game_Player < Game_Character
def patch_old_save(gameCurrVer,gameSaveVer)
patchedMsg = ""
if !@stepSndCount
@stepSndCount = 0
patchedMsg += "save patch, 0860 add stepSndCount to player class\\n"
end
patchedMsg
end
end
#GP.a
class Game_Actor < Game_Battler
def patch_old_save(gameCurrVer,gameSaveVer)
patchedMsg = ""
if 0.96 > gameSaveVer || !self.banned_receiver_holes
self.banned_receiver_holes = []
patchedMsg += "0.96 to #{gameCurrVer}, Missing actor.banned_receiver_holes\\n"
end
if 0.95 > gameSaveVer || !$game_switches.data_common_event
$game_switches.init_common_event
patchedMsg += "0.95 to #{gameCurrVer}, CommonEV to hash\\n"
end
if 0.95 > gameSaveVer
@ext_items = [nil,nil,nil,nil,nil]
patchedMsg += "0.95 to #{gameCurrVer}, empty EXT slots\\n"
end
if !$story_stats["sex_record_race_count"].is_a?(Hash)
$story_stats["sex_record_race_count"] = Hash.new(0)
patchedMsg += "save patch to 0950 sex_record_race_count\\n"
end
if !$story_stats["sex_record_first_vag"] || !$story_stats["sex_record_first_vag"].is_a?(Array)
$story_stats["sex_record_first_mouth"] = Array.new
$story_stats["sex_record_first_vag"] = Array.new
$story_stats["sex_record_first_anal"] = Array.new
$story_stats["sex_record_last_mouth"] = Array.new
$story_stats["sex_record_last_vag"] = Array.new
$story_stats["sex_record_last_anal"] = Array.new
$story_stats["sex_record_partner_count"] = Hash.new(0)
patchedMsg += "save patch to 0940 sex_record basic hole trans to Array\\n"
end
if !self.stat["RaceRecord"] || !self.stat["Dizzy"]
self.stat["RaceRecord"] = @record_lona_race
self.stat["Dizzy"] = 0
@hom_effects_data = []
patchedMsg += "save patch to 0930 record_lona_race renamed to stat.RaceRecord\\n"
end
if !@immune_tgt_states
@immune_tgt_states = []
@original_immune_tgt_states = []
@immune_tgt_state_type = []
patchedMsg += "save patch to 0920 missing stat immune_tgt_states\\n"
end
if !self.stat["FeelsHorniness"]
self.stat["FeelsHorniness"] = self.stat["FeelsHot"]
self.stat["FeelsHot"]=nil
patchedMsg += "save patch to 0910 missing stat FeelsHorniness\\n"
end
if !self.stat["PregState"]
if self.state_stack("PregState") >= 1
self.stat["PregState"] = self.state_stack("PregState")
else
self.stat["PregState"] = 0
end
patchedMsg += "save patch to 0900 missing stat + renamed fix2\\n"
end
if !self.stat["Lactation"] || self.stat["lactation"]
self.stat["Lactation"] =0
self.stat["lactation"] = nil
patchedMsg += "save patch to 0900 missing stat + renamed fix1\\n"
end
if self.dodge_frame == 0
self.actStat.patch_single_stat("dodge_frame",[28, 0, 28, 28, 0, false])
patchedMsg += "save patch, 0900 dodge_frame addon\\n"
end
if !@equip_part_covered
@equip_part_covered = []
tmpCur = self.battle_stat.get_stat("move_speed",0)
tmpTMin = self.battle_stat.get_stat("move_speed",2)
tmpTMax = self.battle_stat.get_stat("move_speed",3)
self.battle_stat.set_stat_m("move_speed",tmpCur +0.3,[0])
self.battle_stat.set_stat_m("move_speed",tmpTMin+0.3,[2])
self.battle_stat.set_stat_m("move_speed",tmpTMax+0.3,[3])
patchedMsg += "save patch, 0880 equip_part_covered addon\\n"
end
if !$game_player.actor.statMap["canvas"]["pose4"]
$game_player.actor.init_statMap
patchedMsg += "save patch, POSE4 canvas data not found, reinit actor pose data\\n"
end
if !$game_NPCLayerMain || !$game_NPCLayerSub
patchedMsg += "save patch to 0800 Create Layers actor temp\\n"
$game_NPCLayerMain = Game_NPC_Actor.new("NPCLayerMain")
$game_NPCLayerSub = Game_NPC_Actor.new("NPCLayerSub")
$game_player.actor.init_statMap
end
if !self.stat["STD_HerpesVag"] || !self.stat["STD_HerpesAnal"] || !self.stat["STD_WartVag"] || !self.stat["STD_WartAnal"]
self.stat["STD_HerpesVag"] =0
self.stat["STD_HerpesAnal"] =0
self.stat["STD_WartVag"] =0
self.stat["STD_WartAnal"] =0
patchedMsg += "save patch to 0850 Create STD stat\\n"
end
if !@PubicHair_Vag_GrowCount && !@pubicHair_Vag_GrowCount
patchedMsg += "save patch to 0783 Add PubicHair Basic Stats\\n"
self.stat["PubicHairVag"] = 0
self.stat["PubicHairAnal"] = 0
@PubicHair_Vag_GrowCount = 0 #pubicHair Grow Chk, reset to 0 if grow a lvl
@PubicHair_Vag_GrowRate = 3+rand(10) #howmany Nap to Grow a LVL
@PubicHair_Vag_GrowMAX = 2+rand(3) #max Lvl
@PubicHair_Anal_GrowCount = 0
@PubicHair_Anal_GrowRate = 3+rand(10)
@PubicHair_Anal_GrowMAX = 2+rand(3)
elsif @PubicHair_Vag_GrowCount && !@pubicHair_Vag_GrowCount
patchedMsg += "save patch to 0820 PubicHairFix\\n"
@pubicHair_Vag_GrowCount = @PubicHair_Vag_GrowCount
@pubicHair_Vag_GrowRate = @PubicHair_Vag_GrowRate
@pubicHair_Vag_GrowMAX = @PubicHair_Vag_GrowMAX
@pubicHair_Anal_GrowCount = @PubicHair_Anal_GrowCount
@pubicHair_Anal_GrowRate = @PubicHair_Anal_GrowRate
@pubicHair_Anal_GrowMAX = @PubicHair_Anal_GrowMAX
end
if @is_object.nil?
patchedMsg += "save patch to 0770 Lona is_object fix\\n"
@shieldEV = nil
@immune_damage = false
@immune_state_effect = false
@hit_LinkToMaster = false
@is_object = false
@master = nil
@is_a_ProtectShield = nil
end
patchedMsg
end
end
+28
View File
@@ -0,0 +1,28 @@
module TKG::ErrorLog::Extend_GameTroop
def conditions_met?(page)
result = super(page)
if result
@interpreter.troop_page = $game_troop.troop.pages.index(page) + 1
end
return result
end
end
class Game_Troop
unless private_method_defined?('_tkg_debuglog__initialize')
alias _tkg_debuglog__initialize initialize
end
def initialize(*args)
_tkg_debuglog__initialize(*args)
self.extend TKG::ErrorLog::Extend_GameTroop
end
end
module GIM_OVC
def check_lona_way_of_death(tmpForcedWay=nil)
end #check_lona_way_of_death
end
#$game_player.actor.last_attacker = $game_player ; $game_player.actor.last_attacker.actor.last_used_skill = "asdasdasd"; $game_player.actor.health = -100
+104
View File
@@ -0,0 +1,104 @@
#==============================================================================
# ** Window_DebugLeft
#------------------------------------------------------------------------------
# This window designates switch and variable blocks on the debug screen.
#==============================================================================
class Window_DebugLeft < Window_Selectable
#--------------------------------------------------------------------------
# * Class Variable
#--------------------------------------------------------------------------
@@last_top_row = 0 # For saving first line
@@last_index = 0 # For saving cursor position
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_reader :right_window # Right window
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize(x, y)
super(x, y, window_width, window_height)
refresh
self.top_row = @@last_top_row
select(@@last_index)
activate
end
#--------------------------------------------------------------------------
# * Get Window Width
#--------------------------------------------------------------------------
def window_width
return 164
end
#--------------------------------------------------------------------------
# * Get Window Height
#--------------------------------------------------------------------------
def window_height
Graphics.height
end
#--------------------------------------------------------------------------
# * Get Number of Items
#--------------------------------------------------------------------------
def item_max
@item_max || 0
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
super
return unless @right_window
@right_window.mode = mode
@right_window.top_id = top_id
end
#--------------------------------------------------------------------------
# * Get Mode
#--------------------------------------------------------------------------
def mode
index < @switch_max ? :switch : :variable
end
#--------------------------------------------------------------------------
# * Get ID Shown on Top
#--------------------------------------------------------------------------
def top_id
(index - (index < @switch_max ? 0 : @switch_max)) * 10 + 1
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
@switch_max = ($data_system.switches.size - 1 + 9) / 10
@variable_max = ($data_system.variables.size - 1 + 9) / 10
@item_max = @switch_max + @variable_max
create_contents
draw_all_items
end
#--------------------------------------------------------------------------
# * Draw Item
#--------------------------------------------------------------------------
def draw_item(index)
if index < @switch_max
n = index * 10
text = sprintf("S [%04d-%04d]", n+1, n+10)
else
n = (index - @switch_max) * 10
text = sprintf("V [%04d-%04d]", n+1, n+10)
end
draw_text(item_rect_for_text(index), text)
end
#--------------------------------------------------------------------------
# * Processing When Cancel Button Is Pressed
#--------------------------------------------------------------------------
def process_cancel
super
@@last_top_row = top_row
@@last_index = index
end
#--------------------------------------------------------------------------
# * Set Right Window
#--------------------------------------------------------------------------
def right_window=(right_window)
@right_window = right_window
update
end
end
+119
View File
@@ -0,0 +1,119 @@
#==============================================================================
# ** Window_DebugRight
#------------------------------------------------------------------------------
# This window displays switches and variables separately on the debug screen.
#==============================================================================
class Window_DebugRight < Window_Selectable
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_reader :mode # Mode (:switch / :variable)
attr_reader :top_id # ID shown on top
#--------------------------------------------------------------------------
# * Object Initialization
#-------------------------------------------------------------------------
def initialize(x, y, width)
super(x, y, width, fitting_height(10))
@mode = :switch
@top_id = 1
refresh
end
#--------------------------------------------------------------------------
# * Get Number of Items
#--------------------------------------------------------------------------
def item_max
return 10
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
contents.clear
draw_all_items
end
#--------------------------------------------------------------------------
# * Draw Item
#--------------------------------------------------------------------------
def draw_item(index)
data_id = @top_id + index
id_text = sprintf("%04d:", data_id)
id_width = text_size(id_text).width
if @mode == :switch
name = $data_system.switches[data_id]
status = $game_switches[data_id] ? "[ON]" : "[OFF]"
else
name = $data_system.variables[data_id]
status = $game_variables[data_id]
end
name = "" unless name
rect = item_rect_for_text(index)
change_color(normal_color)
draw_text(rect, id_text)
rect.x += id_width
rect.width -= id_width + 60
draw_text(rect, name)
rect.width += 60
draw_text(rect, status, 2)
end
#--------------------------------------------------------------------------
# * Set Mode
# mode : New mode
#--------------------------------------------------------------------------
def mode=(mode)
if @mode != mode
@mode = mode
refresh
end
end
#--------------------------------------------------------------------------
# * Set ID Shown on Top
# id : new ID
#--------------------------------------------------------------------------
def top_id=(id)
if @top_id != id
@top_id = id
refresh
end
end
#--------------------------------------------------------------------------
# * Get Currently Selected ID
#--------------------------------------------------------------------------
def current_id
top_id + index
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
super
update_switch_mode if active && mode == :switch
update_variable_mode if active && mode == :variable
end
#--------------------------------------------------------------------------
# * Update During Switch Mode
#--------------------------------------------------------------------------
def update_switch_mode
if Input.trigger?(:C)
SndLib.sys_ok
$game_switches[current_id] = !$game_switches[current_id]
redraw_current_item
end
end
#--------------------------------------------------------------------------
# * Update During Variable Mode
#--------------------------------------------------------------------------
def update_variable_mode
return unless $game_variables[current_id].is_a?(Numeric)
value = $game_variables[current_id]
value += 1 if Input.repeat?(:RIGHT)
value -= 1 if Input.repeat?(:LEFT)
value += 10 if Input.repeat?(:R)
value -= 10 if Input.repeat?(:L)
if $game_variables[current_id] != value
$game_variables[current_id] = value
SndLib.play_cursor
redraw_current_item
end
end
end
+175
View File
@@ -0,0 +1,175 @@
p "Playing HCGframe : Command_Pee.rb"
$game_portraits.lprt.hide
if !$game_map.threat
$game_temp.choice = -1 #還原OPTION
temp_vag_cums =$game_player.actor.cumsMeters["CumsCreamPie"]
temp_anal_cums =$game_player.actor.cumsMeters["CumsMoonPie"]
temp_groin_cums = $game_player.actor.cumsMeters["CumsCreamPie"] + $game_player.actor.cumsMeters["CumsMoonPie"]
total_wounds = $game_player.actor.get_total_wounds
slotList = data_system.equip_type_name
!equip_slot_removetable?("MH") ? equips_MH_id = -1 : equips_MH_id = $game_player.actor.equips[slotList["MH"]].item_name #0
!equip_slot_removetable?("SH") ? equips_SH_id = -1 : equips_SH_id = $game_player.actor.equips[slotList["SH"]].item_name #1
!equip_slot_removetable?("Top") ? equips_Top_id = -1 : equips_Top_id = $game_player.actor.equips[slotList["Top"]].item_name #2
!equip_slot_removetable?("Mid") ? equips_Mid_id = -1 : equips_Mid_id = $game_player.actor.equips[slotList["Mid"]].item_name #3
!equip_slot_removetable?("Bot") ? equips_Bot_id = -1 : equips_Bot_id = $game_player.actor.equips[slotList["Bot"]].item_name #4
!equip_slot_removetable?("TopExt") ? equips_TopExt_id = -1 : equips_TopExt_id = $game_player.actor.equips[slotList["TopExt"]].item_name #5
!equip_slot_removetable?("MidExt") ? equips_MidExt_id = -1 : equips_MidExt_id = $game_player.actor.equips[slotList["MidExt"]].item_name #6
!equip_slot_removetable?("Hair") ? equips_Hair_id = -1 : equips_Hair_id = $game_player.actor.equips[slotList["Hair"]].item_name #7
!equip_slot_removetable?("Head") ? equips_Head_id = -1 : equips_Head_id = $game_player.actor.equips[slotList["Head"]].item_name #8
!equip_slot_removetable?("Neck") ? equips_Neck_id = -1 : equips_Neck_id = $game_player.actor.equips[slotList["Neck"]].item_name #14
!equip_slot_removetable?("Vag") ? equips_Vag_id = -1 : equips_Vag_id = $game_player.actor.equips[slotList["Vag"]].item_name #15
!equip_slot_removetable?("Anal") ? equips_Anal_id = -1 : equips_Anal_id = $game_player.actor.equips[slotList["Anal"]].item_name #16
if temp_groin_cums ==0
call_msg("commonCommands:Lona/Bath_begin1")
else
call_msg("commonCommands:Lona/Bath_begin3_FuckerSight#{talk_style}")
end
if $game_temp.choice == 1
$story_stats["dialog_dress_out"] = 0
$game_player.actor.sta -=15 #扣除本行動STA
if !$game_player.innocent_spotted?
$game_message.add("\\t[commonCommands:Lona/Bath_begin3_NoFuckerSight]")
$game_map.interpreter.wait_for_message
else
$game_message.add("\\t[commonCommands:Lona/Bath_begin3_FuckerSight#{talk_style}]")
$game_map.interpreter.wait_for_message
case $game_player.actor.stat["persona"] #主角處於視線下 檢測PERSONA來決定屬性變化
when "typical"
$game_player.actor.mood -=rand(10)+5
when "gloomy"
$game_player.actor.mood -=rand(5)+3
when "tsundere"
$game_player.actor.mood -=rand(10)+20
when "slut"
$game_player.actor.mood +=rand(10)+5
end
end
chcg_background_color(0,0,0,0,7)
if equips_Head_id != -1#檢查裝備 並脫裝
$game_player.actor.change_equip("Head", nil)
SndLib.sound_equip_armor(100)
player_force_update
wait(30)
end
if equips_MidExt_id != -1#檢查裝備 並脫裝
$game_player.actor.change_equip("MidExt", nil)
SndLib.sound_equip_armor(100)
player_force_update
wait(30)
end
if equips_Top_id != -1#檢查裝備 並脫裝
$game_player.actor.change_equip("Top", nil)
SndLib.sound_equip_armor(100)
player_force_update
wait(30)
end
if equips_Bot_id != -1#檢查裝備 並脫裝
$game_player.actor.change_equip("Bot", nil)
SndLib.sound_equip_armor(100)
player_force_update
wait(30)
end
if equips_Mid_id != -1#檢查裝備 並脫裝
$game_player.actor.change_equip("Mid", nil)
SndLib.sound_equip_armor(100)
player_force_update
wait(30)
end
if equips_Vag_id != -1#檢查裝備 並脫裝
$game_player.actor.change_equip("Vag", nil)
SndLib.sound_equip_armor(100)
player_force_update
wait(30)
end
if equips_Anal_id != -1#檢查裝備 並脫裝
$game_player.actor.change_equip("Anal", nil)
SndLib.sound_equip_armor(100)
player_force_update
wait(30)
end
if $game_player.player_cuffed? #檢查手銬
$game_message.add("\\t[commonCommands:Lona/Bath_cuffed]")
$game_map.interpreter.wait_for_message
end
if total_wounds ==0 #正在洗 檢測是否負傷 並執行對應狀態
$game_message.add("\\t[commonCommands:Lona/Bath_washing]")
$game_map.interpreter.wait_for_message
elsif total_wounds !=0 && $game_player.actor.stat["Masochist"] !=1 #有受傷 不是M
$game_message.add("\\t[commonCommands:Lona/Bath_washing_IfWounds]")
$game_map.interpreter.wait_for_message
$game_player.actor.mood -= (total_wounds*0.5).round
elsif total_wounds !=0 && $game_player.actor.stat["Masochist"] ==1 #有受傷 是個M
$game_message.add("\\t[commonCommands:Lona/Bath_washing_IfWoundsM]")
$game_map.interpreter.wait_for_message
$game_player.actor.sta +=2
$game_player.actor.mood += (total_wounds*0.5).round
end
chcg_background_color(0,0,0,255,-7)
$game_message.add("\\t[commonCommands:Lona/Bath_end]")
$game_map.interpreter.wait_for_message
if !Input.press?(:SHIFT)
if equips_Anal_id != -1#檢查裝備 並穿裝
$game_player.actor.change_equip("Anal", $data_ItemName[equips_Anal_id])
SndLib.sound_equip_armor(100)
player_force_update
wait(30)
end
if equips_Vag_id != -1#檢查裝備 並穿裝
$game_player.actor.change_equip("Vag", $data_ItemName[equips_Vag_id])
SndLib.sound_equip_armor(100)
player_force_update
wait(30)
end
if equips_Mid_id != -1#檢查裝備 並穿裝
$game_player.actor.change_equip("Mid", $data_ItemName[equips_Mid_id])
SndLib.sound_equip_armor(100)
player_force_update
wait(30)
end
if equips_Mid_id != -1#檢查裝備 並穿裝
$game_player.actor.change_equip("Mid", $data_ItemName[equips_Mid_id])
SndLib.sound_equip_armor(100)
player_force_update
wait(30)
end
if equips_Bot_id != -1#檢查裝備 並穿裝
$game_player.actor.change_equip("Bot", $data_ItemName[equips_Bot_id])
SndLib.sound_equip_armor(100)
player_force_update
wait(30)
end
if equips_Top_id != -1#檢查裝備 並穿裝
$game_player.actor.change_equip("Top", $data_ItemName[equips_Top_id])
SndLib.sound_equip_armor(100)
player_force_update
wait(30)
end
if equips_MidExt_id != -1#檢查裝備 並穿裝
$game_player.actor.change_equip("MidExt", $data_ItemName[equips_MidExt_id])
SndLib.sound_equip_armor(100)
player_force_update
wait(30)
end
if equips_Head_id != -1#檢查裝備 並穿裝
$game_player.actor.change_equip("Head", $data_ItemName[equips_Head_id])
SndLib.sound_equip_armor(100)
player_force_update
wait(30)
end
end
end
if $game_temp.choice == 2 #轉去執行清理下半身
load_script("Data/HCGframes/Command_GroinClearn.rb")
end
else
SndLib.sys_buzzer
$game_map.popup(0,"QuickMsg:Lona/incombat#{rand(2)}",0,0)
end
+25
View File
@@ -0,0 +1,25 @@
#!/bin/bash
# Define the pattern to match
PATTERN="^gamescope"
# Find matching PIDs
PIDS=$(pgrep -f "$PATTERN")
# Check if any PIDs were found
if [[ -z "$PIDS" ]]; then
echo "No matching gamescope processes found."
exit 0
fi
# Kill each PID explicitly
echo "Killing the following gamescope-related processes:"
echo "$PIDS"
for PID in $PIDS; do
kill -9 "$PID" && echo "Killed PID $PID" || echo "Failed to kill PID $PID"
done
# Final message after cleanup
sleep 2
clear
echo "Gamescope Reaped."
@@ -0,0 +1,13 @@
if $game_map.threat
SndLib.sys_buzzer
$game_map.popup(0,"QuickMsg:Lona/incombat#{rand(2)}",0,0)
return
end
call_msg("TagMapSaintMonastery:MainNun/begin#{rand(3)}")
manual_barters("SaintMonasteryMainNun")
#SndLib.sound_QuickDialog
#call_msg_popup("TagMapSaintMonastery:healer/Qmsg#{rand(4)}",get_character(0).id)
eventPlayEnd