注册会员 登录
Project1 返回首页

0v0你们在看什么 https://rpg.blue/?65553 [收藏] [复制] [分享] [RSS] 坦克姬好讨厌><

日志

Scene_Cheat

热度 5已有 949 次阅读2011-1-26 14:49

[code]

# 本脚本仅供娱乐,游戏中按D键呼出

$cheatindex = 1
class Window_CheatLeft < Window_Selectable
TEXT = ["角色1","角色2","角色3","角色4",]

def initialize
super(0, 0, 192, 480)
self.index = 0
refresh
end

def refresh
if self.contents != nil
self.contents.dispose
self.contents = nil
end
@item_max = 4
self.contents = Bitmap.new(width - 32, @item_max * 32)
for i in 0...@item_max
text = sprintf(TEXT[i], i*10+1, i*10+10)
self.contents.draw_text(4, i * 32, 152, 32, text)
end
end
end

class Window_CheatRight < Window_Selectable
TEXT = ["体力","体力MAX","人品值","人品MAX","力量","人品","灵力","速度"]

def initialize
super(192, 0, 448, 352)
self.contents = Bitmap.new(width - 32, height - 32)
self.index = -1
self.active = false
@item_max = TEXT.size
@top_id = 1
refresh
end

def refresh
actor = $game_actors[$cheatindex]
str = [actor.hp, actor.maxhp, actor.sp, actor.maxsp, actor.str,actor.int,actor.dex,actor.agi]
self.contents.clear
for i in 0...@item_max
name = TEXT[i]
self.contents.draw_text(0, i * 32, 100, 32, name)
self.contents.draw_text(200, i * 32, 64, 32, str[i].to_s)
end
end
end

class Scene_Cheat

$str = ["$game_actors[$cheatindex].hp", "$game_actors[$cheatindex].maxhp", "$game_actors[$cheatindex].sp", "$game_actors[$cheatindex].maxsp", "$game_actors[$cheatindex].str","$game_actors[$cheatindex].int","$game_actors[$cheatindex].dex","$game_actors[$cheatindex].agi"]

def main
@left_window = Window_CheatLeft.new
@right_window = Window_CheatRight.new
@help_window = Window_Base.new(192, 352, 448, 128)
@help_window.contents = Bitmap.new(406, 96)
@left_window.top_row = 0
@left_window.index = 0
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
$game_map.refresh
$game_party.actors.each do |actor|
actor.recover_all
end
Graphics.freeze
@left_window.dispose
@right_window.dispose
@help_window.dispose
end

def update
@left_window.update
@right_window.update
$game_temp.debug_top_row = @left_window.top_row
$cheatindex = @left_window.index + 1
if @left_window.active
update_left
return
end
if @right_window.active
update_right
return
end
end

def update_left
if Input.trigger?(Input::UP)
@right_window.refresh
end
if Input.trigger?(Input::DOWN)
@right_window.refresh
end
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Map.new
return
end
if Input.trigger?(Input::C)
$game_system.se_play($data_system.decision_se)
text1 = "← : -1 → : +1"
text2 = "L (Pageup) : -10"
text3 = "R (Pagedown) : +10"
@help_window.contents.draw_text(4, 0, 406, 32, text1)
@help_window.contents.draw_text(4, 32, 406, 32, text2)
@help_window.contents.draw_text(4, 64, 406, 32, text3)
@left_window.active = false
@right_window.active = true
@right_window.index = 0
return
end
end

def update_right
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
@left_window.active = true
@right_window.active = false
@right_window.index = -1
@help_window.contents.clear
return
end
if Input.trigger?(Input::A)
$game_temp.player_transferring = true
$game_temp.player_new_map_id = 143
$game_temp.player_new_x = 2
$game_temp.player_new_y = 2
$game_temp.player_new_direction = 2
$scene = Scene_Map.new
end
current_id = @right_window.index
if Input.trigger?(Input::C)
$game_system.se_play($data_system.cursor_se)
eval("#{$str[current_id]} = #{$str[current_id]} + 100")
@right_window.refresh
return
end
if Input.repeat?(Input::RIGHT)
$game_system.se_play($data_system.cursor_se)
eval("#{$str[current_id]} = #{$str[current_id]} + 1")
@right_window.refresh
return
end
if Input.repeat?(Input::LEFT)
$game_system.se_play($data_system.cursor_se)
eval("#{$str[current_id]} = #{$str[current_id]} - 1")
@right_window.refresh
return
end
if Input.repeat?(Input::R)
$game_system.se_play($data_system.cursor_se)
eval("#{$str[current_id]} = #{$str[current_id]} + 10")
@right_window.refresh
return
end
if Input.repeat?(Input::L)
$game_system.se_play($data_system.cursor_se)
eval("#{$str[current_id]} = #{$str[current_id]} - 10")
@right_window.refresh
return
end
end
end

class Scene_Map

alias:oldupdate:update
def update
oldupdate
if Input.trigger?(Input::Z)
unless $game_system.map_interpreter.running? or
$game_system.menu_disabled
$scene = Scene_Cheat.new
end
end
end

end
[/code]

1

鸡蛋
1

鲜花

刚表态过的朋友 (2 人)

发表评论 评论 (1 个评论)

回复 Don.e 2011-7-22 22:54
这啥玩意,xp用的还是vx - -!(终于被你的签名骗进来了)

facelist doodle 涂鸦笔

您需要登录后才可以评论 登录 | 注册会员

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-4-20 05:15

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

返回顶部