赞 | 77 |
VIP | 0 |
好人卡 | 0 |
积分 | 146 |
经验 | 0 |
最后登录 | 2024-11-23 |
在线时间 | 2152 小时 |
Lv4.逐梦者
- 梦石
- 0
- 星屑
- 14629
- 在线时间
- 2152 小时
- 注册时间
- 2016-9-20
- 帖子
- 861
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
- #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
- # Simple Event Sensor
- # Version: 1.10
- # Author : LiTTleDRAgo
- #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
- #
- # Instruction :
- #
- # Set the event name to : <Sensor(RANGE)>
- # example :
- # <Sensor4>
- #
- # If player is in event sensor range, Self switch D (default) will turned ON
- #
- #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
- class Game_Event < Game_Character
- #-----------------------------------------------------------------------
- SENSOR_SELF_SWITCH = 'D'
- #-----------------------------------------------------------------------
- alias drago64c_update update
- def update
- sensor_updating unless @unsensor
- drago64c_update
- end
- def sensor_updating
- @event.name =~ /<Sensor(\d+)>/i
- s = [$1.to_i,[$game_map.map_id,@id,SENSOR_SELF_SWITCH],[]]
- s[2] = [(($game_player.x-self.x).abs + ($game_player.y-self.y).abs <=
- s[0]), $game_self_switches[s[1]]] if s[0] > 0
- return unless s[0] > 0 && s[2][0] != s[2][1]
- $game_self_switches[s[1]], $game_map.need_refresh = s[2][0], true
- end
- end
复制代码
@event.name =~ /<Sensor(\d+)>/i #这句/d+是任何數字, 那个前面=~什么意思, 还有,后面/后面的i什么意思
还有 s = [$1.to_i , ....... #$1 哪里來的變量,什么时候將/d+變成$1 |
|