Project1
标题: 一个正在开发的rmxp的东西 [打印本页]
作者: my.0lantulantu0 时间: 2012-8-22 12:56
标题: 一个正在开发的rmxp的东西
先抖搂一下代码:
再说说闲聊的内容:
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
作者: my.0lantulantu0 时间: 2012-8-22 13:03
作者也许想要的效果:打了马赛克哦
作者: fux4 时间: 2012-8-22 13:07
我也来一发
class Orzfly < Actor
def set_tec
@id = 6
@name = "Orzfly"
@skill = []
@equip = {}
@atk_pic = nil
@atk_cot = 4
@item_pic = nil
@item_cot = 4
@skill_pic = nil
@skill_cot = 4
end
def set_ele
@maxhp = 300000
@maxsp = 100
@maxap = 1
@atk = 0
@atk_area = [ [[0] ] ,true]
@atk_dis_min = 1
@atk_dis_max = 1
@def = -100
@int = 5
@mdef = -100
@hp_rec = 3
@sp_rec = 0
@per_step_cost_ap = 1
@atk_cost_ap = 100
@item_cost_ap = 100
@hatred_base = 50000
@miss_rate = 0
end
def set_ai
@ai = OrzAI.new(self)
end
def set_extra
@atk_buff = []
@maxhp_add = 0
@maxsp_add = 0
@maxap_add = 0
@atk_add = 0
@def_add = 0
@int_add = 0
@mdef_add = 0
@hp_rec_add = 0
@sp_rec_add = 0
@per_step_cost_ap_add = 0
@atk_cost_ap_add = 0
@item_cost_ap_add = 0
@bingo_rate = 0
@bingo_damage = 0
@damage_reduce_rate = 0
@damage_reduce = 0
@cost_reduce_rate = 0
@cost_reduce = 0
@hp_absorb_rate = 0
@hp_absorb = 0
@sp_absorb_rate = 0
@sp_absorb = 0
@invincible = false
@ignore_physical = false
@ignore_magic = false
@invisible = false
@deinvisible = false
@ignore_dmg_rate = 0
@dmg_rebound = 0
@dmg_rebound_rate = 10
end
end
class Orzfly < Actor
def set_tec
@id = 6
@name = "Orzfly"
@skill = []
@equip = {}
@atk_pic = nil
@atk_cot = 4
@item_pic = nil
@item_cot = 4
@skill_pic = nil
@skill_cot = 4
end
def set_ele
@maxhp = 300000
@maxsp = 100
@maxap = 1
@atk = 0
@atk_area = [ [[0] ] ,true]
@atk_dis_min = 1
@atk_dis_max = 1
@def = -100
@int = 5
@mdef = -100
@hp_rec = 3
@sp_rec = 0
@per_step_cost_ap = 1
@atk_cost_ap = 100
@item_cost_ap = 100
@hatred_base = 50000
@miss_rate = 0
end
def set_ai
@ai = OrzAI.new(self)
end
def set_extra
@atk_buff = []
@maxhp_add = 0
@maxsp_add = 0
@maxap_add = 0
@atk_add = 0
@def_add = 0
@int_add = 0
@mdef_add = 0
@hp_rec_add = 0
@sp_rec_add = 0
@per_step_cost_ap_add = 0
@atk_cost_ap_add = 0
@item_cost_ap_add = 0
@bingo_rate = 0
@bingo_damage = 0
@damage_reduce_rate = 0
@damage_reduce = 0
@cost_reduce_rate = 0
@cost_reduce = 0
@hp_absorb_rate = 0
@hp_absorb = 0
@sp_absorb_rate = 0
@sp_absorb = 0
@invincible = false
@ignore_physical = false
@ignore_magic = false
@invisible = false
@deinvisible = false
@ignore_dmg_rate = 0
@dmg_rebound = 0
@dmg_rebound_rate = 10
end
end
buff
class Weak < Buff
attr_accessor :temp_damage
def set_ele(user)
@id = 3
@user = user
@name = "撕裂"
@icon = "weak"
@animation = []
@keep_turn = 2
@keep_step = 0
@use_effect = "new_buff.temp_damage=self.damage(self.hp/4);
SceneManager.scene.spriteset.show_text(new_buff.temp_damage[1].to_s,self.event,Fuc::AP_ADD_COLOR) if new_buff.temp_damage[0]"
@per_turn_start_effect = ""
@per_step_effect = "a=@cur_actor.mag_damage(@cur_actor.get_ap_for_step*10);
@splink.show_text(a[1].to_s,@cur_actor.event,AP_ADD_COLOR) if a[0]"
@per_act_effect = ""
@per_turn_end_effect = ""
@end_effect = "a=self.god_damage(-buff.temp_damage[1]);
SceneManager.scene.spriteset.show_text(a[1].abs.to_s,self.event,Fuc::AP_COST_COLOR) if a[0]"
@atk_effect = ""
@b_damage_effect = ""
@a_damage_effect = ""
end
def set_extra
@end_req = "@turn-buff.lived_turn>=buff.keep_turn"
@descr = "被附加时损失25%的当前生命.\n每进行一次动作损失行走所需行动力十倍的生命值.\nbuff效果消失时,回复开始时损失的生命.\n开始和结束的回复与伤害效果无视魔法免疫.\n持续2回合"
@temp_damage = 0
end
end
class Weak < Buff
attr_accessor :temp_damage
def set_ele(user)
@id = 3
@user = user
@name = "撕裂"
@icon = "weak"
@animation = []
@keep_turn = 2
@keep_step = 0
@use_effect = "new_buff.temp_damage=self.damage(self.hp/4);
SceneManager.scene.spriteset.show_text(new_buff.temp_damage[1].to_s,self.event,Fuc::AP_ADD_COLOR) if new_buff.temp_damage[0]"
@per_turn_start_effect = ""
@per_step_effect = "a=@cur_actor.mag_damage(@cur_actor.get_ap_for_step*10);
@splink.show_text(a[1].to_s,@cur_actor.event,AP_ADD_COLOR) if a[0]"
@per_act_effect = ""
@per_turn_end_effect = ""
@end_effect = "a=self.god_damage(-buff.temp_damage[1]);
SceneManager.scene.spriteset.show_text(a[1].abs.to_s,self.event,Fuc::AP_COST_COLOR) if a[0]"
@atk_effect = ""
@b_damage_effect = ""
@a_damage_effect = ""
end
def set_extra
@end_req = "@turn-buff.lived_turn>=buff.keep_turn"
@descr = "被附加时损失25%的当前生命.\n每进行一次动作损失行走所需行动力十倍的生命值.\nbuff效果消失时,回复开始时损失的生命.\n开始和结束的回复与伤害效果无视魔法免疫.\n持续2回合"
@temp_damage = 0
end
end
skill
class Refraction < Skill
def set_ui
@icon = "f01"
@user_animation = 0
@target_partner_animation = 0
@target_enemy_animation = 0
@target_p_dead_animation = 0
@target_e_dead_animation = 0
end
def set_ele
@id = 16
@name = "奥术分散"
@init_skill = false
@uninit_buff = [RefractionBuff]
@use_req = "true"
@use_dis_min = 0
@use_dis_max = 0
@hotkey = nil
@hurt_enemy = true
@hurt_partner = true
@hurt_p_dead = false
@hurt_e_dead = false
@hurt_area = [ [[0]] ,true]
@hurt_maxnum = 0
@sp_cost = 0
@hp_cost = 0
@ap_cost = 0
@hp_damage = 0
@sp_damage = 0
@ap_damage = 0
@buff = []
@debuff = []
@descr = "自身强大的念力使敌人的进攻\n无法完全命中自己.\n每次自身受到任意伤害时.\n减少15%的伤害.\n并将这部分伤害转给周围的单位.\n不分敌我.\n并且受到伤害如果大于最大生命\n的一半,超过得部分将被阻止.\n无视魔法免疫.\n作用范围:周身4格"
end
def set_extra
@spec_effect = ""
@sp_cost_rate = 0
@hp_cost_rate = 0
@ap_cost_rate = 0
@level = 0
@hp_damage_add = "skill.level*100"
@sp_damage_add = "skill.level*50"
@ap_damage_add = "0"
@ignore_mag_det = true
end
end
class Refraction < Skill
def set_ui
@icon = "f01"
@user_animation = 0
@target_partner_animation = 0
@target_enemy_animation = 0
@target_p_dead_animation = 0
@target_e_dead_animation = 0
end
def set_ele
@id = 16
@name = "奥术分散"
@init_skill = false
@uninit_buff = [RefractionBuff]
@use_req = "true"
@use_dis_min = 0
@use_dis_max = 0
@hotkey = nil
@hurt_enemy = true
@hurt_partner = true
@hurt_p_dead = false
@hurt_e_dead = false
@hurt_area = [ [[0]] ,true]
@hurt_maxnum = 0
@sp_cost = 0
@hp_cost = 0
@ap_cost = 0
@hp_damage = 0
@sp_damage = 0
@ap_damage = 0
@buff = []
@debuff = []
@descr = "自身强大的念力使敌人的进攻\n无法完全命中自己.\n每次自身受到任意伤害时.\n减少15%的伤害.\n并将这部分伤害转给周围的单位.\n不分敌我.\n并且受到伤害如果大于最大生命\n的一半,超过得部分将被阻止.\n无视魔法免疫.\n作用范围:周身4格"
end
def set_extra
@spec_effect = ""
@sp_cost_rate = 0
@hp_cost_rate = 0
@ap_cost_rate = 0
@level = 0
@hp_damage_add = "skill.level*100"
@sp_damage_add = "skill.level*50"
@ap_damage_add = "0"
@ignore_mag_det = true
end
end
item
class YellowBook < Item
def set_ui
@icon = "book"
@user_animation = 0
@target_partner_animation = 0
@target_enemy_animation = 0
@target_p_dead_animation = 0
@target_e_dead_animation = 0
end
def set_ele
@id = 2
@use_cost_num = 0
@can_use = true
@name = "黄书"
@use_req = "true"
@use_dis_min = 1
@use_dis_max = 5
@hurt_enemy = false
@hurt_partner = false
@hurt_p_dead = false
@hurt_e_dead = false
@hurt_nothing = true
@hurt_cant_move = false
@hurt_area = [ [[0]] ,true]
@hurt_maxnum = 0
@sp_cost = 0
@hp_cost = 10
@hp_damage = 0
@sp_damage = 0
@ap_damage = 0
@buff = []
@debuff = []
@descr = "可以让你自由出入战场.\n瞬间移动到5格内任意位置.\n不消耗道具.\n每次使用消耗10HP.\n使用范围:1-5"
end
def set_extra
@spec_effect = "@cur_actor.event.x=@cur_actor.event.real_x=para[1][0];
@cur_actor.event.y=@cur_actor.event.real_y=para[1][1];
set_view_pos(@cur_actor.x,@cur_actor.y)"
@sp_cost_rate = 0
@hp_cost_rate = 0
@ap_cost_rate = 0
@level = 0
@hp_damage_add = "0"
@sp_damage_add = "0"
@ap_damage_add = "0"
@ignore_mag_det = false
end
end
class YellowBook < Item
def set_ui
@icon = "book"
@user_animation = 0
@target_partner_animation = 0
@target_enemy_animation = 0
@target_p_dead_animation = 0
@target_e_dead_animation = 0
end
def set_ele
@id = 2
@use_cost_num = 0
@can_use = true
@name = "黄书"
@use_req = "true"
@use_dis_min = 1
@use_dis_max = 5
@hurt_enemy = false
@hurt_partner = false
@hurt_p_dead = false
@hurt_e_dead = false
@hurt_nothing = true
@hurt_cant_move = false
@hurt_area = [ [[0]] ,true]
@hurt_maxnum = 0
@sp_cost = 0
@hp_cost = 10
@hp_damage = 0
@sp_damage = 0
@ap_damage = 0
@buff = []
@debuff = []
@descr = "可以让你自由出入战场.\n瞬间移动到5格内任意位置.\n不消耗道具.\n每次使用消耗10HP.\n使用范围:1-5"
end
def set_extra
@spec_effect = "@cur_actor.event.x=@cur_actor.event.real_x=para[1][0];
@cur_actor.event.y=@cur_actor.event.real_y=para[1][1];
set_view_pos(@cur_actor.x,@cur_actor.y)"
@sp_cost_rate = 0
@hp_cost_rate = 0
@ap_cost_rate = 0
@level = 0
@hp_damage_add = "0"
@sp_damage_add = "0"
@ap_damage_add = "0"
@ignore_mag_det = false
end
end
作者: 忧雪の伤 时间: 2012-8-22 14:18
UI> 我同样在做卡牌游戏~
作者: my.0lantulantu0 时间: 2012-8-22 14:31
无语。。。其实我的更像是NPC战
作者: fux4 时间: 2012-8-22 15:02
my.0lantulantu0 发表于 2012-8-22 14:31 
无语。。。其实我的更像是NPC战
素材未到位勿吐槽。
作者: bdhptx 时间: 2012-8-22 15:31
希望是DND……本本不行玩不了欧美大作的飘过
欢迎光临 Project1 (https://rpg.blue/) |
Powered by Discuz! X3.1 |