Ogłoszenie 

Uwaga! To forum jest w trybie offline.
Wszelką pomoc uzyskasz pod adresem
forum.ultimateam.pl


Administracja Forum


Poprzedni temat «» Następny temat
Zamknięty przez: SaE
Sro 21 Lis, 2012 09:54
Przemioty
Autor Wiadomość
kxkuba 



Dołączył: 19 Maj 2012
Posty: 17
Wysłany: Czw 15 Lis, 2012 16:20
Przemioty
Da się tak zrobić na Rpg marker xp że podczas walki przedmiot możemy użyć tylko 1 raz podczas. Wallka on nie jest zużywalny. Proszę o szybka odp.
 
 
Ziolus 



Pomógł: 6 razy
Dołączył: 20 Kwi 2011
Posty: 30
Wysłany: Czw 15 Lis, 2012 21:29
Może to?
Spoiler:

#==============================================================================
# by Ayene
#==============================================================================
module AYE
MAX_ITEM_USED = 1 # Maksymalna liczba użyć jednego przedmiotu
MAX_SKILL_USED = 100 # Maksymalna liczba użyć jednej umiejętności
end

#==============================================================================
# ** Game_Temp
#==============================================================================
class Game_Temp
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :battle_item_used
attr_accessor :battle_skill_used
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
alias aye_gamtemp_ini initialize
def initialize
aye_gamtemp_ini
@battle_item_used = {}
@battle_skill_used = {}
end
end

#==============================================================================
# ** Window_Skill
#==============================================================================
class Window_Skill < Window_Selectable
#--------------------------------------------------------------------------
# * Draw Item
# index : item number
#--------------------------------------------------------------------------
def draw_item(index)
skill = @data[index]
if @actor.skill_can_use?(skill.id)
self.contents.font.color = normal_color
else
self.contents.font.color = disabled_color
end
if $game_temp.battle_skill_used.include?(skill.id)
if $game_temp.battle_skill_used[skill.id] >= AYE::MAX_SKILL_USED
self.contents.font.color = disabled_color
end
end
x = 4 + index % 2 * (288 + 32)
y = index / 2 * 32
rect = Rect.new(x, y, self.width / @column_max - 32, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
bitmap = RPG::Cache.icon(skill.icon_name)
opacity = self.contents.font.color == normal_color ? 255 : 128
self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
self.contents.draw_text(x + 28, y, 204, 32, skill.name, 0)
self.contents.draw_text(x + 232, y, 48, 32, skill.sp_cost.to_s, 2)
end
end

#==============================================================================
# ** Window_Item
#==============================================================================
class Window_Item < Window_Selectable
#--------------------------------------------------------------------------
# * Draw Item
# index : item number
#--------------------------------------------------------------------------
def draw_item(index)
item = @data[index]
case item
when RPG::Item
number = $game_party.item_number(item.id)
when RPG::Weapon
number = $game_party.weapon_number(item.id)
when RPG::Armor
number = $game_party.armor_number(item.id)
end
if item.is_a?(RPG::Item) and
$game_party.item_can_use?(item.id)
self.contents.font.color = normal_color
else
self.contents.font.color = disabled_color
end
if $game_temp.battle_item_used.include?(item.id)
if $game_temp.battle_item_used[item.id] >= AYE::MAX_ITEM_USED
self.contents.font.color = disabled_color
end
end
x = 4 + index % 2 * (288 + 32)
y = index / 2 * 32
rect = Rect.new(x, y, self.width / @column_max - 32, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
bitmap = RPG::Cache.icon(item.icon_name)
opacity = self.contents.font.color == normal_color ? 255 : 128
self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
self.contents.draw_text(x + 240, y, 16, 32, ":", 1)
self.contents.draw_text(x + 256, y, 24, 32, number.to_s, 2)
end
end

#==============================================================================
# ** Scene_Battle
#==============================================================================
class Scene_Battle
#--------------------------------------------------------------------------
# * Frame Update (actor command phase : skill selection)
#--------------------------------------------------------------------------
alias aye_scbat_update_phase3_skill_select update_phase3_skill_select
def update_phase3_skill_select
if Input.trigger?(Input::C)
@skill = @skill_window.skill
if $game_temp.battle_skill_used.include?(@skill.id)
if $game_temp.battle_skill_used[@skill.id] >= AYE::MAX_SKILL_USED
$game_system.se_play($data_system.buzzer_se)
return
end
end
end
aye_scbat_update_phase3_skill_select
end
#--------------------------------------------------------------------------
# * Frame Update (actor command phase : item selection)
#--------------------------------------------------------------------------
alias aye_scbat_update_phase3_item_select update_phase3_item_select
def update_phase3_item_select
if Input.trigger?(Input::C)
@item = @item_window.item
if $game_temp.battle_item_used.include?(@item.id)
if $game_temp.battle_item_used[@item.id] >= AYE::MAX_ITEM_USED
$game_system.se_play($data_system.buzzer_se)
return
end
end
end
aye_scbat_update_phase3_item_select
end
#--------------------------------------------------------------------------
# * Make Skill Action Results
#--------------------------------------------------------------------------
alias aye_scbat_make_skill_action_result make_skill_action_result
def make_skill_action_result
@skill = $data_skills[@active_battler.current_action.skill_id]
skill_number = $game_temp.battle_skill_used.include?(@skill.id) ?
$game_temp.battle_skill_used[@skill.id] : 0
$game_temp.battle_skill_used[@skill.id] = skill_number + 1
aye_scbat_make_skill_action_result
end
#--------------------------------------------------------------------------
# * Make Item Action Results
#--------------------------------------------------------------------------
alias aye_scbat_make_item_action_result make_item_action_result
def make_item_action_result
@item = $data_items[@active_battler.current_action.item_id]
item_number = $game_temp.battle_item_used.include?(@iteml.id) ?
$game_temp.battle_item_used[@iteml.id] : 0
$game_temp.battle_item_used[@item.id] = item_number + 1
aye_scbat_make_item_action_result
end
#--------------------------------------------------------------------------
# * Battle Ends
# result : results (0:win 1:lose 2:escape)
#--------------------------------------------------------------------------
alias aye_scbat_battle_end battle_end
def battle_end(result)
$game_temp.battle_skill_used.clear
$game_temp.battle_item_used.clear
aye_scbat_battle_end(result)
end
end

 
 
kxkuba 



Dołączył: 19 Maj 2012
Posty: 17
Wysłany: Pią 16 Lis, 2012 06:18
DZIĘKI :mrgreen:
 
 
Wyświetl posty z ostatnich:   
Ten temat jest zablokowany bez możliwości zmiany postów lub pisania odpowiedzi
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
Dodaj temat do Ulubionych
Wersja do druku

Skocz do:  

Powered by phpBB modified by Przemo © 2003 phpBB Group | Template Klam by Ayene