赞 | 0 |
VIP | 0 |
好人卡 | 0 |
积分 | 1 |
经验 | 17616 |
最后登录 | 2021-1-5 |
在线时间 | 391 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 65
- 在线时间
- 391 小时
- 注册时间
- 2012-5-5
- 帖子
- 208
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
先抖搂一下代码:
再说说闲聊的内容:
Q:作者在搞什么{:2_272:}
A:看起来像是桌游{:2_253:}
Q:作者开完了吗{:2_269:}
A:没有{:2_251:}
Q:那放代码来做什么{:2_257:}
A:来胡扯{:2_254:}
Q:那楼下干嘛{:2_250:}
A:提提意见、建议、也可以把战斗开始后的内容补充上来{:2_260:}
A:总之随意闲聊 ,也许槽点不断(作者应该算是新手0.0){:2_265:}
作者写完的部分:
class A_Battle attr_accessor :actor_group attr_accessor :enemy_group def initialize @actor_group = [] @enemy_group = [] end def agp(v) @actor_group.push(v) end def egp(v) @enemy_group.push(v) end def find(x,y,ia) unless ia for loc in @enemy_group if loc.x == x and loc.y == y return loc end end else for loc in @actor_group if loc.x == x and loc.y == y return loc end end end end def case_magic(num,ia) case num when 0 magic0(ia) when 1 magic1(ia) end end def magic0(ia) if ia else end end def magic1(ia) if ia else end end def next_p #回合正式开始,尚未开发完毕。。。 #$battle = A_Battle.new #(Do.It.In.The.Map) # : # : # : end end class A_Battle_Actor attr_accessor :hp attr_accessor :atk attr_accessor :pdef attr_accessor :mdef attr_accessor :x attr_accessor :y attr_accessor :ia def initialize(hp,atk,pdef,mdef,x,y,ia=false,magic=nil) @hp = hp @atk = atk @pdef = pdef @mdef = mdef @ia = ia @x = x @y = y @magic = magic end def getit for event in $game_map.events.values if event.x == @x and event.y == @y return event.id end end end def s_check(a,b,c=0) ch = [] for event in $game_map.events.values if event.x == a and event.y == b ch.push event.id end end return ch[c] unless c == "all" end def do_magic(n) $battle.case_magic(n,@ia) end end class A_ba def initialize(hp,atk,pdef,mdef,x,y,ia=false,magic=nil) @hp = hp @atk = atk @pdef = pdef @mdef = mdef @ia = ia @x = x @y = y @magic = magic s_setup end def s_setup battler = A_Battle_Actor.new(@hp,@atk,@pdef,@mdef,@x,@y,@ia,@magic) $battle.agp(battler) unless @ia == false $battle.egp(battler) if @ia == false end end
class A_Battle
attr_accessor :actor_group
attr_accessor :enemy_group
def initialize
@actor_group = []
@enemy_group = []
end
def agp(v)
@actor_group.push(v)
end
def egp(v)
@enemy_group.push(v)
end
def find(x,y,ia)
unless ia
for loc in @enemy_group
if loc.x == x and loc.y == y
return loc
end
end
else
for loc in @actor_group
if loc.x == x and loc.y == y
return loc
end
end
end
end
def case_magic(num,ia)
case num
when 0
magic0(ia)
when 1
magic1(ia)
end
end
def magic0(ia)
if ia
else
end
end
def magic1(ia)
if ia
else
end
end
def next_p
#回合正式开始,尚未开发完毕。。。
#$battle = A_Battle.new #(Do.It.In.The.Map)
# :
# :
# :
end
end
class A_Battle_Actor
attr_accessor :hp
attr_accessor :atk
attr_accessor :pdef
attr_accessor :mdef
attr_accessor :x
attr_accessor :y
attr_accessor :ia
def initialize(hp,atk,pdef,mdef,x,y,ia=false,magic=nil)
@hp = hp
@atk = atk
@pdef = pdef
@mdef = mdef
@ia = ia
@x = x
@y = y
@magic = magic
end
def getit
for event in $game_map.events.values
if event.x == @x and event.y == @y
return event.id
end
end
end
def s_check(a,b,c=0)
ch = []
for event in $game_map.events.values
if event.x == a and event.y == b
ch.push event.id
end
end
return ch[c] unless c == "all"
end
def do_magic(n)
$battle.case_magic(n,@ia)
end
end
class A_ba
def initialize(hp,atk,pdef,mdef,x,y,ia=false,magic=nil)
@hp = hp
@atk = atk
@pdef = pdef
@mdef = mdef
@ia = ia
@x = x
@y = y
@magic = magic
s_setup
end
def s_setup
battler = A_Battle_Actor.new(@hp,@atk,@pdef,@mdef,@x,@y,@ia,@magic)
$battle.agp(battler) unless @ia == false
$battle.egp(battler) if @ia == false
end
end
|
|