~Site
Accueil
Forum
Admin

~Base de scripts
Scripts de base
Scripts Menu
Scripts Combat
Scripts Systθme
Scripts Modifiιs

Scripts de Base
Game_Temp
Game_System
Game_Switches
Game_Variables
Game_SelfSwitches
Game_Screen
Game_Picture
Game_Battler 1
Game_Battler 2
Game_Battler 3
Game_BattleAction
Game_Actor
Game_Enemy
Game_Actors
Game_Party
Game_Troop
Game_Map
Game_CommonEvent
Game_Character 1
Game_Character 2
Game_Character 3
Game_Event
Game_Player
Sprite_Character
Sprite_Battler
Sprite_Picture
Sprite_Timer
Spriteset_Map
Spriteset_Battle
Window_Base
Window_Selectable
Window_Command
Window_Help
Window_Gold
Window_PlayTime
Window_Steps
Window_MenuStatus
Window_Item
Window_Skill
Window_SkillStatus
Window_Target
Window_EquipLeft
Window_EquipRight
Window_EquipItem
Window_Status
Window_SaveFile
Window_ShopCommand
Window_ShopBuy
Window_ShopSell
Window_ShopNumber
Window_ShopStatus
Window_NameEdit
Window_NameInput
Window_InputNumber
Window_Message
Window_PartyCommand
Window_BattleStatus
Window_BattleResult
Window_DebugLeft
Window_DebugRight
Window_Dataset
Arrow_Base
Arrow_Enemy
Arrow_Actor
Interpreter 1
Interpreter 2
Interpreter 3
Interpreter 4
Interpreter 5
Interpreter 6
Interpreter 7
Scene_Title
Scene_Map
Scene_Menu
Scene_Item
Scene_Skill
Scene_Equip
Scene_Status
Scene_File
Scene_Save
Scene_Load
Scene_End
Scene_Battle 1
Scene_Battle 2
Scene_Battle 3
Scene_Battle 4
Scene_Shop
Scene_Name
Scene_Gameover
Scene_Debug
Main


Game_Troop ::: postι le 2006-02-16 @ 08:58:00
Auteur: Yukihiro matsumoto

#============================================
# ‘ Game_Troop
#--------------------------------------------
# @ƒgƒ‹[ƒv‚πˆ΅‚€ƒNƒ‰ƒX‚Ε‚·B‚±‚ΜƒNƒ‰ƒX‚ΜƒCƒ“ƒXƒ^ƒ“ƒX‚Ν $game_troop ‚ΕŽQΖ‚³
# ‚κ‚ά‚·B
#============================================

class Game_Troop
#------------------------------------------
# œ ƒIƒuƒWƒFƒNƒg‰Šϊ‰»
#------------------------------------------
def initialize
# ƒGƒlƒ~[‚Μ”z—ρ‚πμ¬
@enemies = []
end
#------------------------------------------
# œ ƒGƒlƒ~[‚ΜŽζ“Ύ
#------------------------------------------
def enemies
return @enemies
end
#------------------------------------------
# œ ƒZƒbƒgƒAƒbƒv
# troop_id : ƒgƒ‹[ƒv ID
#------------------------------------------
def setup(troop_id)
# ƒgƒ‹[ƒv‚ɐݒ肳‚κ‚Δ‚’‚ιƒGƒlƒ~[‚π”z—ρ‚ɐݒθ
@enemies = []
troop = $data_troops[troop_id]
for i in 0...troop.members.size
enemy = $data_enemies[troop.members[i].enemy_id]
if enemy != nil
@enemies.push(Game_Enemy.new(troop_id, i))
end
end
end
#------------------------------------------
# œ ‘ΏۃGƒlƒ~[‚Μƒ‰ƒ“ƒ_ƒ€‚ΘŒˆ’θ
# hp0 : HP 0 ‚ΜƒGƒlƒ~[‚ΙŒΐ‚ι
#------------------------------------------
def random_target_enemy(hp0 = false)
# ƒ‹[ƒŒƒbƒg‚π‰Šϊ‰»
roulette = []
# ƒ‹[ƒv
for enemy in @enemies
# πŒ‚ΙŠY“–‚·‚ικ‡
if (not hp0 and enemy.exist?) or (hp0 and enemy.hp0?)
# ƒ‹[ƒŒƒbƒg‚ΙƒGƒlƒ~[‚π’Η‰Α
roulette.push(enemy)
end
end
# ƒ‹[ƒŒƒbƒg‚ΜƒTƒCƒY‚ͺ 0 ‚̏ꍇ
if roulette.size == 0
return nil
end
# ƒ‹[ƒŒƒbƒg‚π‰ρ‚΅AƒGƒlƒ~[‚πŒˆ’θ
return roulette[rand(roulette.size)]
end
#------------------------------------------
# œ ‘ΏۃGƒlƒ~[‚Μƒ‰ƒ“ƒ_ƒ€‚ΘŒˆ’θ (HP 0)
#------------------------------------------
def random_target_enemy_hp0
return random_target_enemy(true)
end
#------------------------------------------
# œ ‘ΏۃGƒlƒ~[‚ΜƒXƒ€[ƒY‚ΘŒˆ’θ
# enemy_index : ƒGƒlƒ~[ƒCƒ“ƒfƒbƒNƒX
#------------------------------------------
def smooth_target_enemy(enemy_index)
# ƒGƒlƒ~[‚πŽζ“Ύ
enemy = @enemies[enemy_index]
# ƒGƒlƒ~[‚ͺ‘Άέ‚·‚ικ‡
if enemy != nil and enemy.exist?
return enemy
end
# ƒ‹[ƒv
for enemy in @enemies
# ƒGƒlƒ~[‚ͺ‘Άέ‚·‚ικ‡
if enemy.exist?
return enemy
end
end
end
end
Design By RaZ © Watery Build 2005