module DOS
#============================================================================
#-------------------------------任务设置-------------------------------------
#============================================================================
class Game_Party < Game_Unit
attr_reader :accepted_task
def initialize
super @gold = 100
@steps = 0
@last_item_id = 0
@last_actor_index = 0
@last_target_index = 0
@actors = [] # 隊員類型 (主角編號)
@items = {} # 所攜物品 HASH 表 (物品編號)
@weapons = {} # 所攜武器 HASH 表 (武器編號)
@armors = {} # 所攜護具 HASH 表 (護具編號)
@accepted_task = []
@task_status = []
end
def accept_task(id)
@accepted_task.push(Game_Task.new(id))
@task_status[id] = false
end
def delete_task(task)
@accepted_task.delete(task)
@task_status[id] = nil
end
def completed_task(id)
delete_task(Game_Task.new(id))
for item in 0...@accepted_task[id].reward_size(0)
gain_item(@accepted_task[id].reward(0, item),@accepted_task[id].reward_item_amount(0,item))
end
for item in 0...@accepted_task[id].reward_size(1)
gain_item(@accepted_task[id].reward(1, item),@accepted_task[id].reward_item_amount(1,item))
end
for item in 0...@accepted_task[id].reward_size(2)
gain_item(@accepted_task[id].reward(2, item),@accepted_task[id].reward_item_amount(2,item))
end
for index in 0...@accepted_task[id].reward_le_actor_size(0)
if @accepted_task[id].reward_le_actor(0, index) == nil
next
end
@accepted_task[id].reward_le_actor(0, index).change_level(@accepted_task[id].reward(5, index), true)
end
for index in 0...@accepted_task[id].reward_le_actor_size(1)
if @accepted_task[id].reward_le_actor(1, index) == nil
next
end
@accepted_task[id].reward_le_actor(1, index).change_exp(@accepted_task[id].reward(4, index), true)
end
gain_gold(@accepted_task[id].reward(3))
@task_status[id] = true
end
def task_status(id)
return @task_status[id]
end
def accepted_task?(id)
if @task_status[id] == true or @task_status[id] == false
return true
else return false
end
end
def completed_task?(id)
if @task_stutas[id] == true
return true
else return false
end
end
end
class Game_Interpreter
def accept_task(id, enforcement=false)
if $game_party.accepted_task?(id) == false or enforcement == true
$game_party.accept_task(id)
visible_ts(id, 0)
else
visible_ts(id, 5)
end
end
def complete_task(id)
if $game_party.accepted_task?(id) == false
$game_party.completed_task(id)
visible_ts(id, 1)
elsif $game_party.accepted_task?(id) == nil
visible_ts(id, 6) if DOS::Task_No_Accept == 0
end
end
def fail_task(id)
if $game_party.accepted_task?(id) == false
$game_party.delete_task(Game_Task.new(id))
visible_ts(id, 2)
elsif $game_party.accepted_task?(id) == nil
visible_ts(id, 6) if DOS::Task_No_Accept == 0
end
end
def abandonment_task(id)
if $game_party.accepted_task?(id) == false
$game_party.delete_task(Game_Task.new(id))
visible_ts(id, 3)
elsif $game_party.accepted_task?(id) == nil
visible_ts(id, 6) if DOS::Task_No_Accept == 0
end
end
def visible_ts(id, kind)
$game_map.task_id = id
$game_map.set_task_word(kind)
$game_map.visible_task_status
end
end
class Window_Base < Window
#--------------------------------------------------------------------------
# * 描绘直线 by 945127391
# begin_x : 直线开始的x坐标
# begin_y : 直线开始的y坐标
# end_x : 直线结束的x坐标
# end_y : 直线结束的y坐标
# color : 直线的颜色
# width : 直线的宽度(厚度)
#--------------------------------------------------------------------------
def draw_straight_filament(begin_x, begin_y, end_x, end_y, width, color)
if begin_x == end_x
bitmap = Bitmap.new(width, end_y-begin_y)
elsif begin_y == end_y
bitmap = Bitmap.new(end_x-begin_x, width)
else return
end
bitmap.fill_rect(0, 0, bitmap.width, bitmap.height, color)
rect = Rect.new(0, 0, bitmap.width, bitmap.height)
self.contents.blt(begin_x, begin_y, bitmap, rect)
bitmap.dispose
end
#--------------------------------------------------------------------------
# * 描绘自动换行文字 by 叶子
# 修改 945127391
#--------------------------------------------------------------------------
def chenge_special_character(text, x=0, y=0)
# 记录换行时y坐标最小加值
min_y = 0
while ((c = text.slice!(/./m)) != nil)
# 另起一行文字的情况下
if c == "\n"
y += [WLH, min_y].max
min_y = 0
x = 0
# 下面的文字
next
end
# 自动换行处理
if x + self.contents.text_size(c).width > self.contents.width
y += [WLH, min_y].max
min_y = 0
x = 0
end
# 描绘文字
self.contents.draw_text(4 + x, y, 40, WLH, c)
# x 为要描绘文字的加法运算
x += self.contents.text_size(c).width
end
end
end
这是另一个,第二个是任务脚本吧...第一个就不知道有没有什么关联,我想问下各路神仙知不知道这2个脚本怎样用,最好有截图教我下,谢谢。