


版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領
文檔簡介
1、手動加點腳本#= =# 本腳本來自,轉載和使用請保留此信息#= =# 腳本使用設定:LEVEL_UP_POINT = 3 # 每升一級所增加的點數LEVEL_UP_VARIABLE=100 #儲存角色點數的變量編號與角色id 編號的差值#默認情況則是數據庫里100 ,1 號角色的加點數存于101 號變量# 3#號角色的加點數存于103 號變量。你可以直接操作變量贈與角色可分配點數# 每增加一次點數,各項能力值的變化: 357410 行# 使用方法介紹:# 本腳本不會取代原猩 豆 埽 皇且桓齦郊庸 堋?BR># 也就是說,默認的升級還在,但可以用這個功能手動追加點數。# 如果你想純粹使用手
2、動加點 ( 而升級不提升能力 ) ,只要把數據庫中角色升級能力,# 1 99 級全部等于一個相同數值就行了。# 呼喚加點場景的方法: $scene = Scene_Lvup.new(角色編號,返回菜單編號 ) 。# 默認都是 0 號# 加點場景中, page up,page down 換人 , 如果想加點完畢后返回地圖,# 464 行$scene = Scene_Menu.new(0) 改為 $scene = Scene_Map.new# 推薦腳本搭配:魔法商店腳本,兩者結合,制作自由型RPG#=# Window_Command#-# 一般的命令選擇行窗口。(追加定義)#=class Wind
3、ow_Command < Window_Selectable#-# 項目有效化# index :項目編號#-def able_item(index)draw_item(index, normal_color)endend#=# Game_Actor#-# 處理角色的類。(再定義)#=class Game_Actor < Game_Battler#-# 更改 EXP# exp :新的 EXP#-def exp=(exp)exp = exp, 9999999.min, 0.max# 升級while exp >= exp_listlevel+1 andexp_listlevel+1
4、 > 0level += 1# 增加 4 點可自由分配的點數$game_variablesself.id + LEVEL_UP_VARIABLE +=# 學會特技for j in $data_classesclass_id.learningsif j.level = levellearn_skill(j.skill_id)endendend# 降級while exp < exp_listlevellevel -= 1end# 修正當前的 HP 與 SP 超過最大值hp = hp, self.maxhp.minsp = sp, self.maxsp.minendend#=# Wind
5、ow_Base#-# 游戲中全部窗口的超級類(追加定義) #= =class Window_Base < Window#-# 描繪HP# actor :角色#x:描畫目標 X 坐標#y:描畫目標 Y 坐標#width :描畫目標的寬#-def draw_actor_hp_lvup(actor, x, y)最大if $temp_hp = 0else255)255)elseendendend#-# 描繪SP# actor :角色#x:描畫目標 X 坐標#y:描畫目標 Y 坐標#width :描畫目標的寬#-def draw_actor_sp_lvup(actor, x, y)x , y, 9
6、6, 32, "if $temp_hp = 0else最大" +r = Color.new(255, 128, 128,255)255)elseendsendend#-# 描繪能力值# actor :角色#x:描畫目標 X 坐標#y:描畫目標 Y 坐標#type :能力值種類 (0 4)#-def draw_actor_lvup(actor, x, y, type)# 定義數字顏色lvup = normal_colorupcolor = Color.new(255, 128, 128, 255)case typewhen 0parameter_value = actor.s
7、trparameter_value_temp = parameter_value + $temp_str if $temp_str != 0lvup = upcolorif $temp_str >= 0elseColor.new(255,255,0,255)endendwhen 1parameter_value = actor.dexparameter_value_temp = parameter_value + $temp_dexif $temp_dex != 0lvup = upcolorif $temp_dex >= 0elseColor.new(255,255,0,255)
8、endendwhen 2parameter_value = actor.agiparameter_value_temp = parameter_value + $temp_agiif $temp_agi != 0lvup = upcolorif $temp_agi >= 0elseColor.new(255,255,0,255)endendwhen 3parameter_value = parameter_value_temp = parameter_value + $temp_intif $temp_int != 0lvup = upcolorif $temp_int
9、 >= 0elseColor.new(255,255,0,255)endendwhen 4parameter_name = "剩余點數 "parameter_value = $pointif $point != 0lvup = upcolorendend,parameter_value.to_s)if type != 4")endparameter_value_temp.to_s)endend#=# Window_lvup#-#顯示升級狀態窗口。#=class Window_Lvup < Window_Base#-# 初始化對像# actor :角色#
10、-def initialize(actor)super(0, 0, 512, 320)self.contents = Bitmap.new(width - 32, height - 32)actor = actorrefreshend#-# 刷新#-def refreshdraw_actor_graphic(actor, 40, 112)draw_actor_name(actor, 4, 0)draw_actor_class(actor, 4 + 144, 0)draw_actor_level(actor, 96, 32)draw_actor_state(actor, 96, 64)draw_
11、actor_hp_lvup(actor, 96+128, 32)draw_actor_sp_lvup(actor, 96+128, 64)draw_actor_lvup(actor, 96, 128, 0)draw_actor_lvup(actor, 96, 160, 1)draw_actor_lvup(actor, 96, 192, 2)draw_actor_lvup(actor, 96, 224, 3)draw_actor_lvup(actor, 96, 256, 4)endend#=# Window_Help#-#特技及物品的說明、角色的狀態顯示的窗口。#=class Window_Lv
12、up_Help < Window_Base#-# 初始化對像#-def initializesuper(0, 320, 640, 160)self.contents = Bitmap.new(width - 32, height - 32)test = "" # 這個東西用來檢測,節約內存專用 end#-# 設置文本#-def lvup_text(text1, text2 = nil, text3 = nil, text4 = nil)if test != text1test = text1elsereturnendolor = normal_color0, self
13、.widthif text2 != nil- 40, 32, text1)endif text3 != nilendif text4 != nilendendend#=# Scene_lvup#-# 處理升級畫面的類。#=class Scene_Lvup#-# 初始化對像#actor_index :#menu_index :角色索引選項起始位置#-def initialize(actor_index = 0 , menu_index = 0) actor_index = actor_index menu_index = menu_indexend#-# 主處理#-def mains1 = &q
14、uot;增加體力 "s2 = "增加 "+s3 = "增加 s4 = "增加 s5 = "增加 s6 = "確認加點 "s7 = "點數重置 "command_window = Window_Command.new(128,s1, s2, s3, s4, s5, s6, s7)command_window.index = menu_index# 獲取角色actor = $game_party.actorsactor_index# 將角色的剩余點數帶入$point = $game_variable
15、sactor.id + LEVEL_UP_VARIABLE# 初始化臨時量$temp_str = 0$temp_dex = 0$temp_agi = 0$temp_int = 0$temp_hp = 0$temp_sp = 0#= =# 特別提示:這些設置也可以使用小數, 但是可能出現 0 值意外錯誤# ( 各種編程語言都有這種意外 ) ,建議還是使用整數,正負不限#= =# 每提升一次力量,提升多少附加能力#= str_hp = 2 # str_sp = 2 # str_dex = 1 # str_agi = 1 #每提升一次力量附加提升多少 HP 每提升一次力量附加提升多少 SP 每提升一
16、次力量附加提升多少靈巧每提升一次力量附加提升多少速度str_int = 0#每提升一次力量附加提升多少魔力str_str = 5#每提升一次力量附加提升多少力量#= =# 每提升一次靈巧,提升多少附加能力#=dex_hp = 3#dex_sp = 2#dex_str = 1#dex_agi = 1#dex_int = 0#dex_dex = 5#每提升一次靈巧附加提升多少 HP 每提升一次靈巧附加提升多少 SP 每提升一次靈巧附加提升多少力量每提升一次靈巧附加提升多少速度每提升一次靈巧附加提升多少魔力每提升一次靈巧附加提升多少靈巧#= =# 每提升一次速度,提升多少附加能力#=agi_hp =
17、 3#agi_sp = 2#agi_str = 1#agi_dex = 1#agi_int = 0#agi_agi = 5#每提升一次速度附加提升多少 HP 每提升一次速度附加提升多少 SP 每提升一次速度附加提升多少力量每提升一次速度附加提升多少靈巧每提升一次速度附加提升多少魔力每提升一次速度附加提升多少速度#= =# 每提升一次魔力,提升多少附加能力#=int_hp = 1#int_sp = 10#int_str = -1#int_dex = -1#每提升一次魔力附加提升多少 HP 每提升一次魔力附加提升多少 SP 每提升一次魔力附加提升多少力量每提升一次魔力附加提升多少靈巧int_agi
18、 = -1#每提升一次魔力附加提升多少速度int_int = 10#每提升一次魔力附加提升多少魔力#= =# 每提升一次體力,提升多少附加能力#=hp = 15#每提升一次體力提升多少 HPsp = 10#每提升一次體力提升多少 SPhp_str = -1#每提升一次體力提升多少力量hp_dex = -1 #每提升一次體力提升多少速度hp_agi = -1#每提升一次體力提升多少靈巧hp_int = -1#每提升一次體力提升多少魔力# 定義說明文字text_hp_sc = " 體力可以增加生存的能力,可以延長生存的時間! "可以增加物理攻擊和物理技能的威力!"可以
19、提高攻擊的命中率和必殺! "可以提高回避、命中、逃跑成功率! "可以提高魔法的效果,可以增加1 點魔法! "text_save = "text_reset= "text_2 = "text_hp = "text_sp = "保存分配情況并返回游戲"重新分配能力點數 "每增加一次此項能力值,可以提升能力值"最大值"最大值"text_str = " text_dex = " text_agi = " text_int = " s_
20、disable最大值"最大值"最大值"最大值"# 生成狀態窗口lvup_window = Window_Lvup.new(actor)lvup_window.x = 128lvup_window.y = 0# 生成幫助窗口并初始化幫助文本help_window = Window_Lvup_Help.new# 執行過渡Graphics.transition(40, "Graphics/Transitions/" + $data_system.battle_transition)# 主循環loop do# 刷新游戲畫面Graphics.u
21、pdate# 刷新輸入信息Input.update# 刷新畫面update# 如果切換畫面就中斷循環if $scene != selfbreakendend# 準備過渡Graphics.freeze# 釋放窗口command_window.disposelvup_window.disposehelp_window.disposeend#-# 刷新畫面#-def update# 刷新窗口command_window.update# 選項明暗判斷(因為太消耗資源,所以屏蔽掉了)s_disablelvup_window.update#= =# 按下 B 鍵的情況下#=if Input.trigger
22、?(Input:B)# 演奏取消 SE$game_system.se_play($data_system.cancel_se)# 切換到地圖畫面$scene = Scene_Map.newreturnend#= =# 按下 C 鍵的情況下#=if Input.trigger?(Input:C)if command_window.index = 5#演奏確定 SE$game_system.se_play($data_system.decision_se)# 將角色的剩余點數帶回$game_variablesactor.id + LEVEL_UP_VARIABLE = $point# 將角色點數實
23、際加上actor.str += $temp_stractor.dex += $temp_dexactor.agi += $temp_ += $temp_intactor.maxhp += $temp_hpactor.maxsp += $temp_sp# 切換到地圖畫面$scene = Scene_Map.newreturnendif command_window.index = 6#演奏確定 SE$game_system.se_play($data_system.cancel_se)#將角色的剩余點數帶入$point = $game_variablesactor.id
24、+LEVEL_UP_VARIABLE#初始化臨時量$temp_str = 0$temp_dex = 0$temp_agi = 0$temp_int = 0$temp_hp = 0$temp_sp = 0lvup_window.refreshreturnendif $point = 0# 演奏凍結 SE$game_system.se_play($data_system.buzzer_se)returnendcase command_window.indexwhen 0# 演奏確定 SE$game_system.se_play($data_system.decision_se)$temp_hp +
25、= hp$temp_sp += sp$temp_str += hp_str$temp_dex += hp_dex$temp_agi += hp_agi$temp_int += hp_int$point -= 1lvup_window.refreshs_disablereturnwhen 1# 演奏確定 SE$game_system.se_play($data_system.decision_se)$temp_str += str_str$temp_hp += str_hp$temp_sp += str_sp$temp_dex += str_dex$temp_agi += str_agi$tem
26、p_int += str_int$point -= 1lvup_window.refreshs_disablereturnwhen 2# 演奏確定 SE$game_system.se_play($data_system.decision_se)$temp_dex += dex_dex$temp_hp += dex_hp$temp_sp += dex_sp$temp_str += dex_str$temp_agi += dex_agi$temp_int += dex_int$point -= 1lvup_window.refreshs_disablereturnwhen 3# 演奏確定 SE$g
27、ame_system.se_play($data_system.decision_se)$temp_agi += agi_agi$temp_hp += agi_hp$temp_sp += agi_sp$temp_str += agi_str$temp_dex += agi_dex$temp_int += agi_int$point -= 1lvup_window.refreshs_disablereturnwhen 4# 演奏確定 SE$game_system.se_play($data_system.decision_se)$temp_int += int_int$temp_hp += in
28、t_hp$temp_sp += int_sp$temp_str += int_str$temp_dex += int_dex$temp_agi += int_agi$point -= 1lvup_window.refreshs_disablereturnendend#= =# 什么都沒有按下的情況#=case command_window.indexwhen 0 #增加體力temptext1 = text_hp + hp.to_s + "點 " + text_str +hp_str.to_s + "點 " + text_dex + hp_dex.to_s
29、 + "點"temptext2 = text_sp + sp.to_s + "點 " + text_agi +hp_agi.to_s + " 點 " + text_int + hp_int.to_s + "點"help_window.lvup_text(text_hp_sc , text_2 ,temptext1 , temptext2)when 1 #增加力量temptext1= text_hp + str_hp.to_s+"點 "+ text_str+ str_str.to_s + &quo
30、t;點 " + text_dex + str_dex.to_s + "點"temptext2= text_sp + str_sp.to_s+"點 "+ text_agi+ str_agi.to_s + "點 " + text_int + str_int.to_s + "點"help_window.lvup_text(text_str_sc , text_2 ,temptext1 , temptext2)when 2 #增加靈巧temptext1= text_hp + dex_hp.to_s + "
31、; 點 "+ text_str+ dex_agi.to_s + "點 " + text_dex + dex_dex.to_s + "點"temptext2= text_sp + dex_sp.to_s + " 點 "+ text_agi+ dex_agi.to_s + "點 " + text_int + dex_int.to_s + "點"help_window.lvup_text(text_dex_sc , text_2 ,temptext1 , temptext2)when 3 #
32、增加速度temptext1= text_hp + agi_hp.to_s+"點 "+ text_str+ agi_str.to_s + "點 " + text_dex + agi_dex.to_s + "點"temptext2= text_sp + agi_sp.to_s+"點 "+ text_agi+ agi_agi.to_s + "點 " + text_int + agi_int.to_s + "點"help_window.lvup_text(text_agi_sc , text_2 ,temptext1 , temptext2)when 4 #增加魔力temptext1= text_hp + int_hp.to_s+"點 "+ text_str+ int_str.to_s + "點 " +
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯系上傳者。文件的所有權益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網頁內容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經權益所有人同意不得將文件中的內容挪作商業或盈利用途。
- 5. 人人文庫網僅提供信息存儲空間,僅對用戶上傳內容的表現方式做保護處理,對用戶上傳分享的文檔內容本身不做任何修改或編輯,并不能對任何下載內容負責。
- 6. 下載文件中如有侵權或不適當內容,請與我們聯系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 集成修剪和深度森林集成學習方法研究及測井應用
- 一種新型下頜骨骨折快速外固定系統的研發及應用可行性研究
- 過去進行時的理解與運用:小學英語語法基礎訓練
- 我的好朋友小學話題作文(12篇)
- 集裝箱拖車貨運合同
- 傾斜方腔內混合納米流體強化傳熱問題的數值模擬研究
- 基于多源信息融合的糧堆特性研究及糧情評估模型構建
- 大自然的啟示寫景感悟文章(9篇)
- 2024年湖北恩施學院輔導員考試真題
- 主題式教學模式在高中英語閱讀教學中的應用研究
- 廈門大學2021年826物理化學考研真題
- 汽修企業安全生產雙重預防機制培訓資料
- 信息安全、網絡安全和隱私保護-信息安全控制風險清單(雷澤佳編制2024A0)
- 農村財會培訓課件
- 建筑施工企業特殊過程確認記錄
- 2024年A證(安全員)作業模擬考試題庫全套
- 簡單咨詢費合同范本英文版
- 2023慢性病管理實施方案
- 廣東省深圳市羅湖區螺嶺外國語實驗學校小學五年級下冊期末語文試題
- 2023年山東青島市初中學業水平考試地理試卷真題(答案詳解)
- 干部思想狀況調查問卷
評論
0/150
提交評論