Instrukcja: Wpisz w ten skrypt (ten fragment w skrypcie już jest jako przykład):
Kod:
when 1 # Umiejętność pierwsza w Bazie Danych
cost = 10 # Ilość wymaganych punktów życia
percent = 20 # Ilość procent punktów życia
Autor: modern algebra
Wersja: 1.1b Data: 27 Luty 2008
Skrypt:
Spoiler:
Kod:
#======================================================================
# Umiejętności za punkty życia
# Autor: modern algebra (rmrk.net)
# Wersja: 1.1b
#======================================================================
class RPG::Skill
def hp_cost
# Default value for skills with undefined HP cost
cost, percent = 0, 0
case @id
#======================================================================
# Tu wstawiaj co w instrukcji
#======================================================================
when 1 # Skill #1 in database
cost = 10 # The amount of HP to subtract from user
percent = 20 # The % of maxhp to subtract from user
when 5
cost = 100
when 33
percent = 10
end
percent = percent.to_f / 100
return cost, percent
end
end
#======================================================================
# Tu skończ konfigurację
#======================================================================
class Game_Battler
#======================================================================
# * Skill Can Use?
#======================================================================
# Added a requirement that a skill cannot be used if the user's HP is less than the HP Cost
#======================================================================
alias modalg_hp_cost_skills_can_use? skill_can_use?
def skill_can_use? (skill)
if !skill.nil?
basic, percent = skill.hp_cost
return false if (basic + (percent*maxhp).to_i) > hp
end
return modalg_hp_cost_skills_can_use? (skill)
end
#======================================================================
# * Skill Effect
#======================================================================
# Subtract the HP Cost from the user
#======================================================================
alias modalg_hp_cost_skills_effect skill_effect
def skill_effect(user, skill)
modalg_hp_cost_skills_effect (user, skill)
return if !skill
basic, percent = skill.hp_cost
user.hp -= ((percent*user.maxhp).to_i + basic)
end
end
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