❤ 0 Auteur : FenixFyreX
Logiciel : RPG Maker VX
Nombre de scripts : 1
Source : https://forums.rpgmakerweb.com/index.php?threads/mp-regen-system.3379/
Fonctionnalités
- Les héros/ennemis commencent le combat avec 0 points de magie, ces derniers augmentant au fil des combats.
- Peut-être activé/désactivé temporairement par appels de script.
- Possibilité de modifier le nombre de points régénérés par tour.
Condtions d'utilisation
- Vous devez créditer l'auteur (FenixFyrex) et le demandeur (Rezna)
Installation
A placer au-dessus de Main.
Utilisation
Activer/désactiver le système de régénération de mana depuis un événement:
1
| mpreg_sys(true / false) |
Activer/désactiver la régénération du héros:
1
| mpreg_act(true / false) |
Activer/désactiver la régénération des ennemis:
1
| mpreg_eny(true / false) |
Pour changer la quantité de mana régénérée par tour:
type = 0 (héros) ou 1 (ennemi).
Et number = la quantité de mana régénéré par tour.
1
| mpreg_amt(type, number) |
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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
| =begin
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-= MP Regenerator System v1.4 -=
-= FenixFyreX -=
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
There are a couple commands to be aware of.
To turn the whole system off, use this script call:
mpreg_sys(true / false)
To turn the system off only for actors, use this:
mpreg_act(true / false)
To turn the system off only for enemies, use this:
mpreg_eny(true / false)
To change how much mp each turn regenerates, use this:
mpreg_amt(type, number)
Where type is 0(actors) or 1(enemies) and number is the amount to regen each
turn.
Other setup is below.
=end
module Mp_Reg_Setup
# If the below is 0, mp will be returned to 0 after battle. if 1, mp will
# be fully restored. any other number will result in mp staying the same.
Mp_Return_Action = 0
#--------------------------
# What each actor's mp will be set as at the beginning of battle.
Mp_Start_Value = 0
#--------------------------
# How much mp each actor and enemy gains per turn.
Regen_Amount_A = 1 # Actors
Regen_Amount_E = 1 # Enemies
#--------------------------
# Which options to start with
Start_System = true
Start_Actors = true
Start_Enemys = true
#--------------------------
# do you want the system to NOT effect those who are dead?
Stop_When_Dead = true
#--------------------------
# If true, intelligence will affect the mp gained.
Use_Int_Effect = true
#---------------------------
# You can use your own formula for the above switch via the global variable:
# To specify the active battler be it actor or enemy, use i. So, i is the
# active battler.
$mp_reg_form = "((i.spi / 100) * 4)"
end
class Scene_Battle < Scene_Base
alias mpregen_prog start unless $@
def start
mpregen_prog
start_mp_regen
end
def start_mp_regen
if $game_system.mp_regen_switch[0]
if $game_system.mp_regen_switch[1]
$game_party.members.each {|i| i.mp = Mp_Reg_Setup::Mp_Start_Value}
end
if $game_system.mp_regen_switch[2]
$game_troop.members.each {|i| i.mp = Mp_Reg_Setup::Mp_Start_Value}
end
$game_party.members.each {|i| do_add_mp_regen(i)}
end
end
alias mpreg_s_main process_action unless $@
def process_action
if !Mp_Reg_Setup::Stop_When_Dead
do_add_mp_regen(@active_battler) if $game_system.mp_regen_switch[0]
else
if !@active_battler.nil?
if !@active_battler.state?(1)
do_add_mp_regen(@active_battler) if $game_system.mp_regen_switch[0]
end
end
end
mpreg_s_main
end
def do_add_mp_regen(i)
if $game_system.mp_regen_switch[1] and @active_battler.is_a?(Game_Actor)
if Mp_Reg_Setup::Use_Int_Effect
number = ((i.spi / 100) * 4).to_i if $mp_reg_form == nil
number = eval($mp_reg_form) if $mp_reg_form != nil
i.mp += $game_system.mp_regen_amt[0] + number
if i.mp > i.maxmp
i.mp = i.maxmp
end
else
i.mp += $game_system.mp_regen_amt[0]
if i.mp > i.maxmp
i.mp = i.maxmp
end
end
end
if $game_system.mp_regen_switch[2] and @active_battler.is_a?(Game_Enemy)
if Mp_Reg_Setup::Use_Int_Effect
number = ((i.spi / 100) * 4).to_i if $mp_reg_form == nil
number = eval($mp_reg_form) if $mp_reg_form != nil
i.mp += $game_system.mp_regen_amt[0] + number
if i.mp > i.maxmp
i.mp = i.maxmp
end
else
i.mp += $game_system.mp_regen_amt[1]
if i.mp > i.maxmp
i.mp = i.maxmp
end
end
end
end
def do_regen_end
regener = Mp_Reg_Setup::Mp_Return_Action
if regener == 0
$game_party.members.each {|i| i.mp = 0}
elsif regener == 1
$game_party.members.each {|i| i.mp = i.maxmp}
end
end
alias mp_regen_batend battle_end unless $@
def battle_end(*args)
switch = $game_system.mp_regen_switch
do_regen_end if switch[0] and switch[1]
mp_regen_batend(*args)
end
end
class Game_System
include Mp_Reg_Setup
attr_accessor :mp_regen_switch
attr_accessor :mp_regen_amt
alias mp_regen_init initialize unless $@
def initialize
mp_regen_init
@mp_regen_switch = [Start_System, Start_Actors, Start_Enemys]
@mp_regen_amt = [Regen_Amount_A,Regen_Amount_E]
end
end
class Game_Interpreter
def mpreg_amt(item, number)
$game_system.mp_regen_amt[item] = number
end
def mpreg_sys(sys)
$game_system.mp_regen_switch[0] = sys
end
def mpreg_act(actr)
$game_system.mp_regen_switch[1] = actr
end
def mpreg_eny(eny)
$game_system.mp_regen_switch[2] = eny
end
end
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
# END
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=# |
Mis à jour le 19 novembre 2020.
|