Pomógł: 26 razy Dołączył: 25 Wrz 2011 Posty: 236 Skąd: ty się tu wziąłeś?
Wysłany: Sro 12 Paź, 2011 14:11
Scene Reward
Scene Reward
Opis:
Skrypt pokazuje okienko z nazwą i ikoną zdobytego przedmiotu.
Screen:
Spoiler:
Kod:
Spoiler:
Kod:
#==============================================================================
# Okno zdobytego przedmiotu
# Skrypt wyświetlający okienko z ikoną i nazwą zdobytego przedmiotu.
# Autor:???
# Znaleziony i wrzucony na ultimateam.pl przez:Vrona
# Nie edytuj ciągu literek ponizej,jeżeli:
# Nie masz pojęcia,co to jest
# Nie wiesz co robisz
# Nie jesteś dobry w skryptach.
# Edycja grozi syntax error.
#==============================================================================
class Window_Reward < Window_Base
def initialize(item, type)
super(0, 416 - (WLH + 32), 224, WLH + 32)
@item = item
@type = type
refresh
end
def refresh
self.contents.clear
case @type
when "item"
draw_item_name(@item, 0, 0)
when "weapon"
draw_item_name(@item, 0, 0)
when "armor"
draw_item_name(@item, 0, 0)
when "skill"
draw_item_name(@item, 0, 0)
when "gold"
draw_currency_value(@item, 0, 0, 172)
end
end
end
#------------------------------------------------------------------------------
class Game_Party < Game_Unit
alias vlad_gain_item gain_item
alias vlad_gain_gold gain_gold
def gain_item(item, n, include_equip = false)
vlad_gain_item(item, n, include_equip = false)
number = item_number(item)
case item
when RPG::Item
Sound.play_decision
$item_name = item; $item_type = "item"; $wait_count = 120
when RPG::Weapon
Sound.play_decision
$item_name = item; $item_type = "weapon"; $wait_count = 120
when RPG::Armor
Sound.play_decision
$item_name = item; $item_type = "armor"; $wait_count = 120
end
n += number
end
def gain_gold(n)
vlad_gain_gold(n)
Sound.play_decision
$item_name = n; $item_type = "gold"; $wait_count = 120
end
def lose_item(item, n, include_equip = false)
lose_item2(item, -n, include_equip)
end
def lose_item2(item, n, include_equip = false)
number = item_number(item)
case item
when RPG::Item
@items[item.id] = [[number + n, 0].max, 99].min
when RPG::Weapon
@weapons[item.id] = [[number + n, 0].max, 99].min
when RPG::Armor
@armors[item.id] = [[number + n, 0].max, 99].min
end
n += number
if include_equip and n < 0
for actor in members
while n < 0 and actor.equips.include?(item)
actor.discard_equip(item)
n += 1
end
end
end
end
end
#------------------------------------------------------------------------------
class Game_Actor < Game_Battler
alias vlad_learn_skill learn_skill
def learn_skill(skill_id)
vlad_learn_skill(skill_id)
Sound.play_decision
$item_name = $data_skills[skill_id]; $item_type = "skill"; $wait_count = 120
end
end
#------------------------------------------------------------------------------
class Scene_Map < Scene_Base
alias scene_map_start start
alias scene_map_update update
alias scene_map_terminate terminate
def start
scene_map_start
$item_name = 0
$item_type = nil
$wait_count = 0
@item_name = Window_Reward.new($item_name, $item_type)
@item_name.active = false
@item_name.visible = false
end
def update
scene_map_update
if $item_name != 0 and $item_type != nil and $wait_count > 0
$wait_count -= 1
@item_name.dispose
@item_name = Window_Reward.new($item_name, $item_type)
@item_name.active = true
@item_name.visible = true
else
$item_name = 0
$item_type = nil
@item_name.active = false
@item_name.visible = false
end
end
def terminate
scene_map_terminate
@item_name.dispose
end
end
Autor:
Vlad
Przetłumaczony przeze mnie
________________________
Ostatnio zmieniony przez Angius Sro 12 Paź, 2011 15:17, w całości zmieniany 1 raz
Nie możesz pisać nowych tematów Nie możesz odpowiadać w tematach Nie możesz zmieniać swoich postów Nie możesz usuwać swoich postów Nie możesz głosować w ankietach Nie możesz załączać plików na tym forum Możesz ściągać załączniki na tym forum