设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 1203|回复: 1
打印 上一主题 下一主题

[Finish Script] Simple Energy system for Ace

[复制链接]

梦石
0
星屑
362
在线时间
1292 小时
注册时间
2013-1-12
帖子
3590

贵宾

跳转到指定楼层
1
发表于 2013-9-24 09:08:49 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有帐号?注册会员

x
本帖最后由 76213585 于 2013-9-23 21:43 编辑

Ok, it's my first complete script!!!!!!

Screen shot:
None Needed

Credits:
Panda King(76213585)

Usage:
Plug and play if you want to go with default setting....

This script does....................:
S.This script creates an energy system, you can set up variable that controls the energy amount.
1.restore energy every X frame (Costumable)
2.Set up energy amount require for to Run, Walk
3.Set up energy cost per step(walk, run)
4.Set up energy Max
5.Does NOT show variables on map.....

     =====Version Note=====
  1.22 | A really stupid bug fixed (covering my face)
  1.21 | Variable name improve(What?)
  1.20 | Big update, Able to restore per X frame and set a max amount for Energy
  1.05 | Fixed going under 0 Bug
  1.00 | Relese

               OverWrites:                   
class Game_Player
   def update_encounter      
class Game_Map      
    def disable_dash        
    def passable?
class Scene_Map
     def start
     def update


Free for commercial use if you like (but if you use my system.... it probably isn't a serious commercial game....)
  1. #=====================
  2. #   Simple Energy System For VXA   V1.05
  3. #=====================
  4. #             By PandaKing                  
  5. #=====================
  6. #               OverWrites:                  
  7. #           #class Game_Player#        
  8. #            def update_encounter      
  9. #            # class Game_Map #        
  10. #              def disable_dash        
  11. #                 def passable?
  12. #            #class Scene_Map#
  13. #                   def start
  14. #                def update
  15. #======================
  16. #      Put this script above Main         
  17. #     and below Scene_Gameover      
  18. #======================
  19. # This script is a simple simple script
  20. #======================
  21. # You can set up the Variable that   
  22. #      control Energy Amount            
  23. # Also you can set up the Energy use
  24. # per Walk/Dash. The Amount of      
  25. # energy require for to be able to run/walk
  26. # is also setable(is there such word?)
  27. #======================
  28. #             IMPORTANT!!!!!!!!         
  29. # If you want to show variable on
  30. # map, use Freya's Var Window!
  31. #=======================
  32. #     =====Version Note=====
  33. #  1.21 | Variable name improve(What?)
  34. #  1.20 | Big update, Able to restore per X frame
  35. #            and set a max amount for Energy
  36. #  1.05 | Fixed going under 0 Bug
  37. #  1.00 | Relese
  38. #=======================
  39.   module Panda
  40.     #Variable Used to Control Energy
  41.     Energy_Var = 1  #Default 1
  42.     #Amount of Energy Required ro Run
  43.     Dash_Disable = 50 #Default 50
  44.     #Amount of Energy Required ro Run
  45.     Walk_Disable = 0 #Default 1
  46.     #Energy Cost Per Step(When Walking)
  47.     Walk = 2 #Default 2
  48.     #Energy Cost Per Step(When Running)
  49.     Dash = 3 #Default 3
  50.     #Wait frame for each trun
  51.     Wait = 60
  52.     #Energy restore per trun (from 1 to this amount)
  53.     Restore = 3
  54.     #use variable to control the max energy
  55.     Var = 1 # 1= false 2=true
  56.     #if Variable = true, what's the variable used to control max amount?
  57.     Variable_Num = 2
  58.     #if Variable = false, what's the max amount?
  59.     Max = 100
  60.   end
  61. #=========================#
  62. #         NO EDIT PASS THIS LINE              #
  63. # (unless you know what you're doing)     #
  64. #=========================#
  65.   class Game_Player < Game_Character
  66.     def update_encounter
  67.       if dash?
  68.         $game_variables[Panda::Energy_Var] -= rand(Panda::Dash)+1# unless $game_variables[Panda::Energy_Var] <= Panda::Dash
  69.         if $game_variables[Panda::Energy_Var] <= Panda::Walk_Disable
  70.           $game_variables[Panda::Energy_Var] = Panda::Walk_Disable
  71.         end
  72.       else
  73.         $game_variables[Panda::Energy_Var] -= rand(Panda::Walk)+1 #unless $game_variables[Panda::Energy_Var] <= Panda::Walk
  74.         if $game_variables[Panda::Energy_Var] <= Panda::Walk_Disable
  75.           $game_variables[Panda::Energy_Var] = Panda::Walk_Disable
  76.         end
  77.       end
  78.       return if $TEST && Input.press?(:CTRL)
  79.       return if $game_party.encounter_none?
  80.       return if in_airship?
  81.       return if @move_route_forcing
  82.       @encounter_count -= encounter_progress_value
  83.     end
  84.   end


  85. class Game_Map
  86.     def disable_dash
  87.       if $game_variables[Panda::Energy_Var] <= Panda::Dash_Disable
  88.         return true
  89.       else
  90.         @map.disable_dashing
  91.       end
  92.     end
  93.     def passable?(x, y, d)
  94.       return false if $game_variables[Panda::Energy_Var] <= Panda::Walk_Disable
  95.       check_passage(x, y, (1 << (d / 2 - 1)) & 0x0f)
  96.     end
  97.   end
  98.   
  99.   class Scene_Map < Scene_Base
  100.   def start
  101.     super
  102.     SceneManager.clear
  103.     $game_player.straighten
  104.     $game_map.refresh
  105.     $game_message.visible = false
  106.     create_spriteset
  107.     create_all_windows
  108.     @menu_calling = false
  109.     @a = 0
  110.   end
  111.   
  112.   def update
  113.     super
  114.     $game_map.update(true)
  115.     $game_player.update
  116.     $game_timer.update
  117.     @spriteset.update
  118.     update_scene if scene_change_ok?
  119.     @a = @a+1
  120.     if @a >= Panda::Wait
  121.       b = rand(Panda::Restore)+1
  122.       if Panda::Var == 2
  123.         if $game_variables[Panda::Energy_Var] < $game_variables[Panda::Variable_Num]
  124.         $game_variables[Panda::Energy_Var] += b
  125.         end
  126.       else
  127.         if $game_variables[Panda::Energy_Var] < Panda::Max
  128.         $game_variables[Panda::Energy_Var] += b
  129.         end
  130.       end
  131.       @a = 0
  132.     end
  133.   end
  134. end
复制代码

梦石
0
星屑
362
在线时间
1292 小时
注册时间
2013-1-12
帖子
3590

贵宾

2
 楼主| 发表于 2013-9-24 09:14:33 | 只看该作者
本帖最后由 76213585 于 2013-9-23 18:16 编辑

@LBQ Thanks master for support! / 謝謝LBQ教我~

回复 支持 反对

使用道具 举报

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

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

GMT+8, 2024-11-15 12:56

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表