Auteur : ASHKA
Nombre de script : 1 ( Démo disponible !! )
Voici le script ( copier-coller dans un nouveau script crée dans " Materials " ) :
=begin
Script de coffre amélioré
###################### Instruction #################################
Liste des insertions de script à placer dans votre event " coffre " :
$vision = true/false
( Pour determiner si ce coffre peut etre " lu " par le sort de vision )
$verrou = true/false
( Pour determnier si ce coffre est fermé à clé )
$level = x
( x entre 1 et 5 - determine la vitesse de defilement de la jauge )
$resistance = x
( x entre 0 et 100 - determine la resistance du coffre au passage en force -
plus elle est elevé, plus le risque que le passage en force detruise le contenu
du coffre est élévé )
L'un ( au choix ) des pieges suivant :
$piege = ["aucun"] - Pas de piege
$piege = ["poison"] - Gaz toxique
$piege = ["metal"] - Lame de metal
$piege = ["magic_drain"] - Absorption de MP
$piege = ["explosif"] - Explosion ( apres prise des objets )
$piege = ["monstre", x] - Combat ( x est l'ID du groupe de monstre à combattre )
L'insertion suivante sert à definir les objets contenu dans le coffre :
( Mon conseil : utilisez une insertion differente pour les infos ci-dessus.
Et une specialement pour celle ci-dessous )
$tresor = [x, [$data_items[y], quantité, probabilité],
[$data_weapons[y], quantité, probabilité],
[$data_armors[y], quantité, probabilité]]
x est le nombre d'objets max que peux recevoir le joueur pour ce coffre.
La suite est un bloc de trois informations entre crochets.
Chaque bloc representera un objet possible.
Vous pouvez ( pour plus de lisibilité ) revenir à la ligne apres la virgule
separant chaque bloc. La limite d'objet est celle des lignes d'insertions de
script ( mais ça fait déjà pas mal d'objet !! )
Les informations pour chaque blocs sont :
1 ) le type : objet / arme / armure
y est l'ID de l'objet / arme / armure
2 ) la quantité ( de 1 à 99 )
3 ) la probabilité d'obtention de l'objet ( en pourcentage )
La derniere insertion est celle appellant le script :
$scene = Scene_Coffre.new
Suite à ceci, l'event doit avoir quelques commandes d'event
1 ) un " attendre 5 frames "
2 ) Une condition cette insertion de script = $game_temp.ouvert == true
Cette condition determine si le coffre est ouvert, la suite est donc classique :
3 ) interrupteur local A activé
N'oubliez pas les differents reglages ci-dessous et
Bonne utilisation !!
=end
######################## Reglages ################################
module ASHKA
# true si vous autorisez la detection, false dans le cas contraire
DETECTION = true
# ID de la competence utilisé pour " voir " les pieges ( utilise animation et cout mp )
ID_SORT_DE_VISION = 84
# ID de l'objet utilisé pour déverrouiller les coffres
ID_PASSE = 22
# true si seul certain héros peuvent déverrouiller les coffres, false si tout les héros le peuvent
SPECIALISTE = true
# ID des héros pouvant déverrouiller les coffres ( seulement si SPECIALISTE est true )
VOLEUR = [5, 8]
# true si le passe est à usage unique ( perte apres usage ), false dans le cas contraire
USAGE_UNIQUE = true
# ID du status associé au piege " poison "
ETAT_POISON = 2
# ID de l'animation associé au piege " poison "
ANIM_POISON = 83
# ID de l'animation associé au piege " explosif "
ANIM_EXPLOSIF = 84
# degat occasionné par le piege " explosif " ( retire X % des HP max )
DEGAT_EXPLOSIF = 25 # l'equipe perdra 25 % de leur HP max
# determine si le piege " explosif " peut tuer un héros
MORT_EXPLOSIF = false # garde au moins 1 HP si false
# ID de l'animation associé au piege " metal "
ANIM_METAL = 85
# degat occasionné par le piege " metal " ( retire X % des HP max )
DEGAT_METAL = 10 # l'equipe perdra 10 % de leur HP max
# determine si le piege " metal " peut tuer un héros
MORT_METAL = false # garde au moins 1 HP si false
# ID de l'animation associé au piege " magic_drain "
ANIM_MAGIC = 86
# degat occasionné par le systeme " magic_drain " ( retire X % des MP max )
DEGAT_MAGIC = 15 # l'equipe perdra 15 % de leur MP max
end
################################################################################
class Scene_Coffre
def main
@spriteset = Spriteset_Map.new
$fiche_vision = false
@help_window = Window_Help.new
@phase1 = Window_Detection.new
@phase1.index = 0
@phase1.visible = false
@phase1.active = false
@phase1.help_window = @help_window
@phase1_bis = Perso_Detection.new
@phase1_bis.index = 0
@phase1_bis.visible = false
@phase1_bis.active = false
@phase1_bis.help_window = @help_window
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@spriteset.dispose
@help_window.dispose
@phase1.dispose
@phase1_bis.dispose
end # def main
def update
@spriteset.update
@help_window.update
@phase1.update
@phase1_bis.update
if @phase1.active
update_phase1
return
end
if @phase1_bis.active
update_phase1_bis
return
end
if ASHKA::DETECTION == true
if $vision == true
@magos = []
for actor in $game_party.members
unless actor.dead?
if actor.skills.include?($data_skills[ASHKA::ID_SORT_DE_VISION])
if actor.mp >= $data_skills[ASHKA::ID_SORT_DE_VISION].mp_cost
@magos.push(actor)
end
end
end
end
if @magos[0] != nil
@phase1.visible = true
@phase1.active = true
else
$scene = Scene_Coffre_bis.new
end
else
$scene = Scene_Coffre_bis.new
end
else
$scene = Scene_Coffre_bis.new
end
end # def update
def update_phase1
if Input.trigger?(Input::C)
Sound.play_decision
case @phase1.index
when 0
@phase1_bis.visible = true
@phase1_bis.active = true
@phase1.visible = false
@phase1.active = false
when 1
$scene = Scene_Coffre_bis.new
end
end
end # def update_phase1
def update_phase1_bis
@help_window.set_text("Qui va lancer le sort ? ( Cout : " + $data_skills[ASHKA::ID_SORT_DE_VISION].mp_cost.to_s + " " + Vocab::mp.to_s + " )", 1)
if Input.trigger?(Input::C)
Sound.play_decision
$scene = Scene_Map.new
$game_player.animation_id = $data_skills[ASHKA::ID_SORT_DE_VISION].animation_id
actor = @phase1_bis.actor
actor.mp -= $data_skills[ASHKA::ID_SORT_DE_VISION].mp_cost
$fiche_vision = true
$scene = Scene_Coffre_bis.new
end
end # def update_phase1_bis
end # scene_coffre
################################################################################
class Scene_Coffre_bis
def main
@spriteset = Spriteset_Map.new
$game_temp.ouvert = false
$jauge = 0
@tresor = []
@quantité = []
@press = false
@type = "haut"
@coord_x = 0
@coord_y = 0
$deverrouillage = false
$desactivation = false
@help_window = Window_Help.new
@info = Window_Info.new
@action = Window_Action.new
@action.help_window = @help_window
@action.visible = true
@action.active = true
@action.index = 0
@clé = Window_Clé.new(0, 0, 0)
@clé.visible = false
@perso_clé = Perso_Clé.new
@perso_clé.visible = false
@perso_clé.active = false
@fiche_tresor = Window_Tresor.new(@tresor, @quantité)
@fiche_tresor.visible = false
@desactive = Window_Desactive.new(@press, @type, @coord_x, @coord_y)
@desactive.visible = false
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@spriteset.dispose
@help_window.dispose
@info.dispose
@action.dispose
@clé.dispose
@perso_clé.dispose
@fiche_tresor.dispose
@desactive.dispose
end # def main
def update
@spriteset.update
@help_window.update
@info.update
@action.update
@clé.update
@perso_clé.update
@fiche_tresor.update
@desactive.update
if @perso_clé.active
update_perso_clé
return
end
if @clé.visible
update_clé
return
end
if @fiche_tresor.visible
update_tresor
return
end
if @desactive.visible
update_desactive
return
end
if Input.trigger?(Input::C)
case @action.index
when 0
if $verrou == true
if rand(101) < $resistance
Sound.play_decision
@help_window.opacity = 0
@fiche_tresor.dispose
@fiche_tresor = Window_Tresor.new(@tresor, @quantité)
@fiche_tresor.visible = true
@action.active = false
@action.visible = false
@info.visible = false
return
end
end
for item in 1...$tresor.size
if rand(101) < $tresor[item][2].to_i
unless @tresor.size == $tresor[0]
@tresor.push($tresor[item][0])
@quantité.push($tresor[item][1])
$game_party.gain_item($tresor[item][0], $tresor[item][1])
end
end
end
Sound.play_decision
@help_window.opacity = 0
@fiche_tresor.dispose
@fiche_tresor = Window_Tresor.new(@tresor, @quantité)
@fiche_tresor.visible = true
@action.active = false
@action.visible = false
@info.visible = false
return
when 1
if $deverrouillage == true
Sound.play_buzzer
elsif ASHKA::SPECIALISTE
groupe = []
test = false
for actor in $game_party.members
groupe.push(actor.id)
end
for x in groupe
if ASHKA::VOLEUR.include?(x)
test = true
end
end
if test and $game_party.has_item?($data_items[ASHKA::ID_PASSE])
Sound.play_decision
@perso_clé.visible = true
@perso_clé.active = true
@perso_clé.index = 0
@action.visible = false
@action.active = false
@action.index = -1
else
Sound.play_buzzer
end
elsif $game_party.has_item?($data_items[ASHKA::ID_PASSE])
Sound.play_decision
@perso_clé.visible = true
@perso_clé.active = true
@perso_clé.index = 0
@action.visible = false
@action.active = false
@action.index = -1
else
Sound.play_buzzer
end
when 2
if $desactivation == true
Sound.play_buzzer
else
Sound.play_decision
@time = rand(60) + 20
@press = true
@type = "haut"
@coord_x = 150
@coord_y = 150
@essai = 0
@succes = 0
@desactive.dispose
@desactive = Window_Desactive.new(@press, @type, @coord_x, @coord_y)
@desactive.visible = true
@action.visible = false
@action.active = false
@action.index = -1
end
when 3
$scene = Scene_Map.new
end
end
end # def update
def update_perso_clé
@help_window.set_text("Qui va forcer la serrure ?", 1)
if Input.trigger?(Input::C)
Sound.play_decision
@actor = @perso_clé.actor
@clé.dispose
@essai = 0
@reussite = []
$jauge = 0
@un = rand(50) + 24
@deux = rand(50) + @un + 24
@trois = rand(55) + @deux + 24
@clé = Window_Clé.new(@un, @deux, @trois)
@clé.visible = true
@perso_clé.visible = false
@perso_clé.active = false
@perso_clé.index = -1
end
end # def update_perso_clé
def update_clé
@help_window.set_text('Appuyez sur " Action " au bon moment !!', 1)
resultat = 2
case $level
when 1
resultat += 0.2
when 2
resultat += 0.4
when 3
resultat += 0.6
when 4
resultat += 0.8
when 5
resultat += 1
end
if @actor.agi.between?(0, 50)
resultat -= 0.2
elsif @actor.agi.between?(51, 150)
resultat -= 0.4
elsif @actor.agi.between?(151, 250)
resultat -= 0.6
elsif @actor.agi.between?(251, 350)
resultat -= 0.8
elsif @actor.agi.between?(351, 450)
resultat -= 1
elsif @actor.agi.between?(451, 550)
resultat -= 1.2
elsif @actor.agi.between?(551, 650)
resultat -= 1.4
elsif @actor.agi.between?(651, 750)
resultat -= 1.6
elsif @actor.agi.between?(751, 850)
resultat -= 1.8
elsif @actor.agi.between?(851, 999)
resultat -= 2
end
if resultat < 1
resultat = 1
end
if resultat > 3
resultat = 3
end
$jauge += resultat
if $jauge > 250
$jauge = 0
end
@clé.refresh
if Input.trigger?(Input::C)
@essai += 1
if $jauge.between?(@un + 10, @un + 20)
Sound.play_decision
@reussite.push("un")
elsif $jauge.between?(@deux + 10, @deux + 20)
Sound.play_decision
@reussite.push("deux")
elsif $jauge.between?(@trois + 10, @trois + 20)
Sound.play_decision
@reussite.push("trois")
else
Sound.play_buzzer
end
end
if @essai == 3
if @reussite[0] == "un" and @reussite[1] == "deux" and @reussite[2] == "trois"
$verrou = false
@info.refresh
$deverrouillage = true
end
if ASHKA::USAGE_UNIQUE == true
$game_party.lose_item($data_items[ASHKA::ID_PASSE], 1)
end
@action.visible = true
@action.active = true
@action.index = 1
@clé.visible = false
end
end # def update_clé
def update_tresor
if Input.trigger?(Input::C)
$game_temp.ouvert = true
if $piege[0] == "magic_drain"
$scene = Scene_Map.new
$game_player.animation_id = ASHKA::ANIM_MAGIC
for actor in $game_party.members
actor.mp -= ASHKA::DEGAT_MAGIC * actor.maxmp / 100
end
elsif $piege[0] == "poison"
$scene = Scene_Map.new
$game_player.animation_id = ASHKA::ANIM_POISON
for actor in $game_party.members
actor.add_state(ASHKA::ETAT_POISON)
end
elsif $piege[0] == "monstre"
$scene = Scene_Map.new
$game_troop.setup($piege[1])
$game_troop.preemptive = true
$game_temp.battle_proc = nil
$game_temp.next_scene = "battle"
elsif $piege[0] == "metal"
$scene = Scene_Map.new
$game_player.animation_id = ASHKA::ANIM_METAL
for actor in $game_party.members
actor.hp -= ASHKA::DEGAT_METAL * actor.maxhp / 100
if ASHKA::MORT_METAL == false and actor.hp <= 0
actor.hp = 1
end
end
mort = 0
for actor in $game_party.members
if actor.dead?
mort += 1
end
end
if mort == $game_party.members.size
$scene = Scene_Gameover.new
end
elsif $piege[0] == "explosif"
$scene = Scene_Map.new
$game_player.animation_id = ASHKA::ANIM_EXPLOSIF
for actor in $game_party.members
actor.hp -= ASHKA::DEGAT_EXPLOSIF * actor.maxhp / 100
if ASHKA::MORT_EXPLOSIF == false and actor.hp <= 0
actor.hp = 1
end
end
mort = 0
for actor in $game_party.members
if actor.dead?
mort += 1
end
end
if mort == $game_party.members.size
$scene = Scene_Gameover.new
end
elsif $piege[0] == "aucun"
$scene = Scene_Map.new
end
end
end # def update_tresor
def update_desactive
@help_window.set_text("Appuyez sur les touches apparaissant à l'ecran !!", 1)
@press = true
@time -= 1
if @time < 0
@time = 0
end
if @time == 0
catg = rand(4)
if catg == 0
@type = "bas"
elsif catg == 1
@type = "gauche"
elsif catg == 2
@type = "haut"
elsif catg == 3
@type = "droite"
end
@coord_x = rand(480)
@coord_y = rand(180)
@time = rand(60) + 30
end
##
if Input.trigger?(Input::DOWN) and @type == "bas"
Sound.play_decision
@essai += 1
@succes += 1
elsif Input.trigger?(Input::DOWN) and @type != "bas"
Sound.play_buzzer
@essai += 1
end
##
if Input.trigger?(Input::LEFT) and @type == "gauche"
Sound.play_decision
@essai += 1
@succes += 1
elsif Input.trigger?(Input::LEFT) and @type != "gauche"
Sound.play_buzzer
@essai += 1
end
##
if Input.trigger?(Input::UP) and @type == "haut"
Sound.play_decision
@essai += 1
@succes += 1
elsif Input.trigger?(Input::UP) and @type != "haut"
Sound.play_buzzer
@essai += 1
end
##
if Input.trigger?(Input::RIGHT) and @type == "droite"
Sound.play_decision
@essai += 1
@succes += 1
elsif Input.trigger?(Input::RIGHT) and @type != "droite"
Sound.play_buzzer
@essai += 1
end
##
@desactive.dispose
@desactive = Window_Desactive.new(@press, @type, @coord_x, @coord_y)
@desactive.visible = true
if @succes == $sequence[0].to_i
$piege[0] = "aucun"
$desactivation = true
@action.visible = true
@action.active = true
@action.index = 2
@desactive.visible = false
@info.refresh
end
if @essai == $sequence[1].to_i
@action.visible = true
@action.active = true
@action.index = 2
@desactive.visible = false
end
end # def update_desactive
end # def scene_coffre_bis
################################################################################
class Window_Detection < Window_Selectable
def initialize
super(116, 158, 312, 100)
@item_max = 2
@column_max = 2
@index = -1
refresh
end
def refresh
self.contents.clear
self.contents.draw_text(0, 0, 280, 32, "Utiliser un sort de vision sur le coffre ?", 1)
@data = ["Oui", "Non"]
for i in 0..@data.size
self.contents.draw_text(i * 140, 30, 140, 32, @data[i].to_s, 1)
end
end
def update_cursor
if @index < 0
self.cursor_rect.empty
else
row = @index / @column_max
if row < top_row
self.top_row = row
end
if row > bottom_row
self.bottom_row = row
end
rect = Rect.new(0, 0, 0, 0)
rect.width = 140
rect.height = WLH
rect.x = @index * 140
rect.y = 35
self.cursor_rect = rect
end
end
def update_help
text = ""
case @index
when 0, 1
text = "Permet de determiner si un coffre est piegé."
end
@help_window.set_text(text, 1)
end
end # class Window_Detection
################################################################################
class Perso_Detection < Window_Selectable
def initialize
super(111, 132, 322, 152)
@column_max = 1
@index = 0
refresh
end
def refresh
@data = []
for actor in $game_party.members
unless actor.dead?
if actor.skills.include?($data_skills[ASHKA::ID_SORT_DE_VISION])
if actor.mp >= $data_skills[ASHKA::ID_SORT_DE_VISION].mp_cost
@data.push(actor.id)
end
end
end
end
@item_max = @data.size
create_contents
for i in 0...@item_max
draw_actor(i)
end
end
def actor
return $game_actors[@data[index]]
end
def draw_actor(index)
actor = $game_actors[@data[index]]
self.contents.draw_text(0, index * 30, 300, 32, actor.name + " - " + Vocab::mp.to_s + " : " + actor.mp.to_s + " | " + Vocab::spi.to_s + " : " + actor.spi.to_s, 1)
end
def update_cursor
if @index < 0
self.cursor_rect.empty
else
row = @index / @column_max
if row < top_row
self.top_row = row
end
if row > bottom_row
self.bottom_row = row
end
rect = Rect.new(0, 0, 0, 0)
rect.width = 300
rect.height = WLH
rect.x = -5
rect.y = @index * 30 + 5
self.cursor_rect = rect
end
end
end # class Perso_Detection
################################################################################
class Window_Info < Window_Base
def initialize
super(0, WLH + 32, 544, 130)
refresh
end
def refresh
self.contents.clear
bitmap = Cache.system("Iconset")
if $fiche_vision == true
if $verrou == true
alpha = "Coffre fermé à clé : "
rect = Rect.new(0 * 24, 5 * 24, 24, 24)
else
alpha = "Estimation : "
rect = Rect.new(0 * 24, 0 * 24, 24, 24)
end
aa = alpha + "contient " + $tresor[0].to_s + " tresors !!"
self.contents.blt(0, 0, bitmap, rect, 255)
self.contents.draw_text(0, 0, 544, 32, aa, 1)
### fin ligne 1
if $piege[0] == "monstre"
bb = "Attention, un monstre est caché dans ce coffre !!"
rect = Rect.new(0 * 24, 7 * 24, 24, 24)
elsif $piege[0] == "poison"
bb = "Ce coffre est piegé avec du gaz empoisonné !!"
rect = Rect.new(1 * 24, 7 * 24, 24, 24)
elsif $piege[0] == "metal"
bb = "Ce coffre est piegé avec des lames de metal !!"
rect = Rect.new(9 * 24, 1 * 24, 24, 24)
elsif $piege[0] == "explosif"
bb = "Ce coffre est piegé avec un dispositif explosif !!"
rect = Rect.new(7 * 24, 8 * 24, 24, 24)
elsif $piege[0] == "magic_drain"
bb = "Une forte aura magique emane de ce coffre !!"
rect = Rect.new(8 * 24, 8 * 24, 24, 24)
elsif $piege[0] == "aucun"
bb = "Ce coffre ne semble pas etre piegé !!"
rect = Rect.new(0 * 24, 0 * 24, 24, 24)
end
self.contents.blt(0, 30, bitmap, rect, 255)
self.contents.draw_text(0, 30, 544, 32, bb, 1)
### fin ligne 2
else # if pas info
self.contents.draw_text(0, 30, 544, 32, "Aucune information disponible !!", 1)
end
end
end
################################################################################
class Window_Action < Window_Selectable
def initialize
super(186, 186, 172, 155)
@item_max = 4
@column_max = 1
@index = -1
refresh
end
def refresh
self.contents.clear
@data = ["Ouvrir", "Déverrouiller", "Désactiver", "Abandonner"]
for i in 0..@data.size
self.contents.draw_text(0, i * 30, 140, 32, @data[i].to_s, 1)
end
end
def update_cursor
if @index < 0
self.cursor_rect.empty
else
row = @index / @column_max
if row < top_row
self.top_row = row
end
if row > bottom_row
self.bottom_row = row
end
rect = Rect.new(0, 0, 0, 0)
rect.width = 140
rect.height = WLH
rect.x = 0
rect.y = @index * 30 + 5
self.cursor_rect = rect
end
end
def update_help
text = ""
case @index
when 0
text = "Ouvrir le coffre par la force sans tenir compte des consequences."
when 1
text = "Vous ne possedez aucun passe !!"
if $game_party.has_item?($data_items[ASHKA::ID_PASSE])
text = "Utiliser un passe pour déverrouiller le coffre."
end
if $deverrouillage == true
text = "Le coffre a déjà été déverrouillé !!"
end
when 2
text = "Essayer de désactiver le piege avant d'ouvrir le coffre."
if $desactivation == true
text = "Le piege a déjà été désactivé !!"
end
when 3
text = "Laisser le coffre et revenir plus tard."
end
@help_window.set_text(text, 1)
end
end # class Window_Action
################################################################################
class Window_Clé < Window_Base
def initialize(un, deux, trois)
super(136, 186, 272, 100)
@un = un
@deux = deux
@trois = trois
refresh
end
def refresh
self.contents.clear
bitmap = Cache.system("Iconset")
rect = Rect.new(0 * 24, 5 * 24, 24, 24)
self.contents.blt(@un, 0, bitmap, rect, 255)
self.contents.blt(@deux, 0, bitmap, rect, 255)
self.contents.blt(@trois, 0, bitmap, rect, 255)
self.contents.fill_rect(0, 35, 250, 32, Color.new(20, 20, 20, 255))
self.contents.fill_rect(@un + 7, 35, 10, 32, Color.new(255, 255, 255, 255))
self.contents.fill_rect(@deux + 7, 35, 10, 32, Color.new(255, 255, 255, 255))
self.contents.fill_rect(@trois + 7, 35, 10, 32, Color.new(255, 255, 255, 255))
self.contents.gradient_fill_rect(0, 36, $jauge, 30, Color.new(255, 0, 0, 255), Color.new(0, 255, 0, 255))
end
end
################################################################################
class Perso_Clé < Window_Selectable
def initialize
super(161, 186, 222, 152)
@column_max = 1
@index = 0
refresh
end
def refresh
@data = []
for actor in $game_party.members
unless actor.dead?
if ASHKA::SPECIALISTE
if ASHKA::VOLEUR.include?(actor.id)
@data.push(actor.id)
end
else
@data.push(actor.id)
end
end
end
@item_max = @data.size
create_contents
for i in 0...@item_max
draw_actor(i)
end
end
def actor
return $game_actors[@data[index]]
end
def draw_actor(index)
actor = $game_actors[@data[index]]
self.contents.draw_text(0, index * 30, 200, 32, actor.name + " - " + Vocab::agi.to_s + " : " + actor.agi.to_s, 1)
end
def update_cursor
if @index < 0
self.cursor_rect.empty
else
row = @index / @column_max
if row < top_row
self.top_row = row
end
if row > bottom_row
self.bottom_row = row
end
rect = Rect.new(0, 0, 0, 0)
rect.width = 200
rect.height = WLH
rect.x = -5
rect.y = @index * 30 + 5
self.cursor_rect = rect
end
end
end # class Perso_Clé
################################################################################
class Window_Tresor < Window_Base
def initialize(tresor, quantité)
super(0, 0, 544, 416)
@tresor = tresor
@quantité = quantité
refresh
end
def refresh
self.contents.clear
self.contents.draw_text(0, 0, 522, 32, "Dès l'ouverture du coffre, vous regardez ce qu'il contient.", 1)
y = 60
index = 0
for item in @tresor
icon_index = item.icon_index
bitmap = Cache.system("Iconset")
rect = Rect.new(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)
self.contents.blt(90, y, bitmap, rect, 255)
self.contents.draw_text(100, y, 300, WLH, item.name + " + " + @quantité[index].to_s, 1)
y += 30
index += 1
end
if @tresor.size == 0
self.contents.draw_text(0, y + 30, 522, 32, "Votre action a endommagé le contenue du coffre !!", 1)
end
if $piege[0] == "poison"
text = "Un gaz toxique s'echappe du coffre !!"
elsif $piege[0] == "monstre"
text = "Le monstre caché dans le coffre vous saute dessus !!"
elsif $piege[0] == "metal"
text = "L'ouverture a déclenché le piege !!"
elsif $piege[0] == "explosif"
text = "L'ouverture a déclenché le piege !!"
elsif $piege[0] == "aucun"
text = "L'ouverture ne declenche aucun piege !!"
end
self.contents.draw_text(0, y + 60, 522, 32, text, 1)
if $piege[0] == "magic_drain"
self.contents.draw_text(0, y + 60 , 522, 32, "Un malefice magique se declenche !!", 1)
self.contents.draw_text(0, y + 90, 522, 32, "Vos MP sont aspirés !!", 1)
end
end
end # class Window_Tresor
################################################################################
class Game_Temp
attr_accessor :ouvert
alias new_initialize initialize
def initialize
@ouvert = false
new_initialize
end
end
################################################################################
class Window_Desactive < Window_Base
def initialize(action, type, coord_x, coord_y)
super(0, 186, 544, 230)
@action = action
@type = type
@coord_x = coord_x
@coord_y = coord_y
refresh
end
def refresh
self.contents.clear
if @action == true
bitmap = Cache.system("Iconset")
case @type
when "bas"
rect = Rect.new(8 * 24, 13 * 24, 24, 24)
when "gauche"
rect = Rect.new(9 * 24, 13 * 24, 24, 24)
when "haut"
rect = Rect.new(10 * 24, 13 * 24, 24, 24)
when "droite"
rect = Rect.new(11 * 24, 13 * 24, 24, 24)
end
self.contents.blt(@coord_x, @coord_y, bitmap, rect, 255)
end
end
end
################################################################################Il vous faut cette planche d'icone :
( J'ai juste rajouter quatres icones venant du XP pour les fleches )
Alors, quelques screens maintenant :

Voila le menu " Action ", celui où on choisit les ... actions ( apres utilisation du sort de vision )

Voila le jeu de " deverrouillage " du coffre

Voici celui de " desactivation " des pieges
( Les fleches n'apparaissent jamais au même endroit pour rendre le chalenge plus interessant )

Et pour finir, la fiche de resultat ...
Surtout, n'hesitez pas poster vos remarques, commentaires, appreciations pour que je puisse améliorer ce qui est necessaire !!
ASHKA

Connexion
Inscription
Aide
Ajouter une réponse



Multi-citation
