1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
| # Avoir des accessoires permettant d'apprendre les compétences de l'ennemi
# Auteur : ASHKA
module TE
# ID de l'accessoire ( ou des ... ) permettant d'apprendre les compétences ennemis
ID_OBJ = [32]
# Associe l'ID d'un monstre aux compétences pouvant être apprise
SKILL = {1 => [59, 60, 61, 62], 2 => [4], 3 => [],
4 => [12], 5 => []}
# id monstre => [ id skill, id skill, id skill]
# Pourcentage d'apprentissage de la compétence
PROBA = 40 # 40 % de chance d'apprendre la compétence
end
################################################################################
class Game_Battler
def make_obj_damage_value(user, obj)
damage = obj.base_damage # get base damage
if damage > 0 # a positive number?
damage += user.atk * 4 * obj.atk_f / 100 # Attack F of the user
damage += user.spi * 2 * obj.spi_f / 100 # Spirit F of the user
unless obj.ignore_defense # Except for ignore defense
damage -= self.def * 2 * obj.atk_f / 100 # Attack F of the target
damage -= self.spi * 1 * obj.spi_f / 100 # Spirit F of the target
end
damage = 0 if damage < 0 # If negative, make 0
elsif damage < 0 # a negative number?
damage -= user.atk * 4 * obj.atk_f / 100 # Attack F of the user
damage -= user.spi * 2 * obj.spi_f / 100 # Spirit F of the user
end
damage *= elements_max_rate(obj.element_set) # elemental adjustment
damage /= 100
damage = apply_variance(damage, obj.variance) # variance
damage = apply_guard(damage) # guard adjustment
if user.actor? == false and self.actor? and obj.is_a?(RPG::Skill)
if TE::ID_OBJ.include?(self.equips[4].id)
if TE::SKILL[user.enemy_id].include?(obj.id)
if rand(101) < TE::PROBA
unless $game_temp.learn.include?([self.id, obj.id])
unless self.skills.include?(obj)
$game_temp.learn.push([self.id, obj.id])
end
end
end
end
end
end
if obj.damage_to_mp
@mp_damage = damage # damage MP
else
@hp_damage = damage # damage HP
end
end
end
################################################################################
class Scene_Battle < Scene_Base
def start
super
$game_temp.learn = []
$game_temp.in_battle = true
@spriteset = Spriteset_Battle.new
@message_window = Window_BattleMessage.new
@action_battlers = []
create_info_viewport
end
def process_victory
@info_viewport.visible = false
@message_window.visible = true
RPG::BGM.stop
$game_system.battle_end_me.play
unless $BTEST
$game_temp.map_bgm.play
$game_temp.map_bgs.play
end
display_exp_and_gold
display_drop_items
display_level_up
display_learn
battle_end(0)
end
def display_learn
for x in 0..($game_temp.learn.size - 1)
actor_id = $game_temp.learn[x][0]
skill_id = $game_temp.learn[x][1]
unless $game_actors[actor_id].skills.include?($data_skills[skill_id])
$game_actors[actor_id].learn_skill(skill_id)
text = $game_actors[actor_id].name.to_s + ' apprends le Talent " ' + $data_skills[skill_id].name.to_s + ' " !!'
$game_message.texts.push(text)
end
end
wait_for_message
end
end
################################################################################
class Game_Temp
attr_accessor :learn
alias new initialize
def initialize
@learn = []
new
end
end
################################################################################ |