cortez - posté le 13/12/2021 à 17:40:26. (524 messages postés)
Je comprend mieux pourquoi j'y arrivait pas..
C'est la valeur HIT rate que je doit modifier et dans la version RPGmakerXP de Steam, les champs de valeur sont tous mélangés (d'ailleurs après ta 1ere intervention j'ai eu des doutes sur la valeur Hit Rate)
cortez - posté le 12/12/2021 à 21:23:27. (524 messages postés)
Bonsoir,
Merci Roi, pour les explications. (plein de calculs en perspective, moi qui suis pas doué avec les chiffres..)
Donc pour résumer, je doit d'abord calculer
atk_hit = agi ou dex (selon le choix paramétré en BDD sur le skill)
eva = (8 x self.agi)/(atk_hit) + self.eva
Puis reprendre la formule "inversée"
skill.eva_f = 100 * ((100 - hit) / eva)
Donc pour Aluxes lv1 vs Ghost et le skill "Fire" on trouve :
Ghost
AGI 41
EVA 0
Aluxes (lv1)
DEX 59
Skill "Fire"
skill_eva-F = ?
Le système de combat utlilise une valeur DAMAGE_ALGORITHM_TYPE=0 donc atk_hit = user.dex
def set_skill_hit_value(user, skill, effective)
atk_hit = DAMAGE_ALGORITHM_TYPE >1 ? user.agi : user.dex
eva =8*self.agi/ atk_hit +self.eva
hit =self.damage<0 ? 100 : 100- eva * skill.eva_f/100
hit =self.cant_evade? ? 100 : hit
hit_result =(rand(100)< hit)@evaded=trueunless hit_result
effective |= hit <100return effective
end
J'ai également compris que la valeur skill.eva est celle située dans l'onglet Skills dans le champ EVA ou EVA-F dans les parametres du skill en question.
Je sais également qu'une valeur EVA à 0 fait en sorte que le skill n'échoue jamais (sort de soin par exemple) et qu'une valeur de 100 fait en sorte que seul une cible avec 100 d'esquive peut esquiver le skill. (sans doute 5% du temps comme le calcul des critiques ?)
Voici là ou je bloque, je souhaiterais savoir comment faire pour donner une valeur EVA dans le skill afin que celui-ci touche 30% du temps.
Si possible expliquer la syntaxe rgss1 afin que j'y vois plus clair.
cortez - posté le 20/10/2021 à 17:22:19. (524 messages postés)
Les pièces dans les jeux vidéo ne sont pas juste de simples collectables, c'est un outil au même titre que la lumière ou les angles de caméra pour guider le joueur. Donc libre a vous de ne pas apprécier leur existence mais bien utilisé dans le jeu Muma Rope ça peu-être chouette.
C'est pas trop la rubrique pour partager des vidéos mais elle colle parfaitement au débat qui anime ce topic.
PS pour Modo : N'hésitez pas a éditer ce message si il ne convient pas.
cortez - posté le 19/10/2021 à 18:23:05. (524 messages postés)
J'ai voté C.
Je pensais que l'argent collectable pourrais servir a débloquer une galerie d'images sur le développement du jeu. Ou si c'est trop chiant pas fesable un costume alternatif pour le personnage (un simple recolor de la jupe pourrait faire l'affaire.)
N'hésitez pas a me foudroyer si mes idées ne plaisent pas.
cortez - posté le 04/09/2021 à 23:24:04. (524 messages postés)
Bonsoir,
Sinon vite fait sur le net j'ai trouvé cela. (c'est le sprite officiel du jeu Senran no Samurai Kingdom (titre japonais)
Au pire si tu te sens de créer un charset par toi même, essaye de prendre comme base le corps de ce genres de créatures. (Léviator est une créature très proche physiquement de ce que tu souhaite obtenir)
cortez - posté le 22/06/2021 à 18:50:41. (524 messages postés)
Duos de screenshot d'un système pour l'exploration des donjons.
Le sacro-saint donjon dans un volcan/zone de lave. J'adore rendre l'exploration aussi agréable et ingénieuse que dans un bon vieux zelda/Golden Sun. Cependant les personnages n'ont pas de pouvoirs a utiliser via un menu ou une touche, mais au moyen d'un objet qui active tous les mécanismes correspondants.
Ici les joueurs ne peuvent pas marcher sur le sol couleur lave (beaucoup trop chaud) Heureusement qu'ils peuvent utiliser un orbe gelé. Qui refroidit le sol (insérer référence a bomberman) pour se créer un passage. Évidement les joueurs sont libre de viser une case en particulier dans une zone prédéfinie.
PS: Map en work-in-progess pour valider l'architecture du donjon, je prendrais le temps d'améliorer le rendu après.
cortez - posté le 14/06/2021 à 17:30:08. (524 messages postés)
Avec les titres en couleurs ça en jette un max.
Merci pour les smiley (je les avais pas vu lors de la prévisualisation.)
Je vais laisser quelques jours avant de rajouter les "mini tuto" en éditant le message principal.
J'ai longtemps hésité a publier une démo en plus des consignes sur le forum, cependant je suis partisan de l'apprentissage par le "faire soi même". Si une démo existe, nombreux serons ceux qui l'utiliserons sans décortiquer le tuto. Sans démo, le tuto ne sera pas accessible pour tous, mais c'est un peu le but.
Attention pas d'élitisme, juste que l'on progresse chacun a son rythme et lorsque le niveau de chacun augmente, de nouvelles techniques et méthodes peuvent être acquise. C'est sans doute une façon old-school de voir les choses, mais j'y tiens.
Pensez un peu au phases de leveling de vos personnages de rpg favoris, le making c'est pareil.
cortez - posté le 30/05/2021 à 16:10:54. (524 messages postés)
Merci pour les suggestions.
Je ne voulais pas être restrictif envers un système générique (basiquement le tour par tour est presque partout) mais plus contre les systèmes basique qui découle de chaque archétype.
Donc je ne souhaitais pas avoir de recommendations type FFVII.
Pareil pour le A-RPG (si c'est pas au tour par tour c'est donc en temps réel). Le système de jeu de FFXV n'est pas ce que je recherche.
Afin que je trouve l'inspiration des système qui cumule 2 genre sont parfait.
Avec les recherche de mon coté j'ai trouvé un bon jeu de plateforme qui mélange plateforme et puzzle game: Henry hatsworth l'incroyable expédition
J'ai regardé vos lien et suggestions c'est super j'ai plein d'idées. (coup de coeur pour Radiant Historia et les deux lien de Mack.)
cortez - posté le 21/03/2021 à 21:55:02. (524 messages postés)
Bonjour à vous.
En parlant de RPG sans prétentions et d'auto flagellation.
Je bosse en ce moment sur un projet Vx Ace avec pour contrainte de n'utiliser que les ressources de base et les scripts/fonctionnalité de base du logiciel. Rien d'extérieur ne doit-être utilisé. En manipulant des appels script je suis parvenu a crée un système d'ennemis qui s'adaptent automatiquement au lvl des joueurs.
Donc en gros si je veux une ressource qui n'existe pas (genre un porte étendard) je m'oblige a utiliser des combinaisons possibles entre character et tileset, et seulement en dernier recours je crée une ressource custom (toujours a partir des RTP).
Voici un petit aperçu :
Une cloison qui s'ouvre dans un mur (charset custom obligatoire)
Les portes étendards sont constitué d'un drapeau, d'un tabouret de bar renversé et d'une corde (sur la couche évènement.)
Message de débug pour controler le lv des ennemis.
cortez - posté le 02/02/2016 à 18:20:16. (524 messages postés)
Invocation réussie... Je vois que l'on parle de mon jeu.
Tout d'abord merci de m'accorder autant de crédit (même si je sais pas trop
pourquoi.)
Ayant fait mes propres ressources, je ne peut que te conseiller de tout faire toi
même. Ensuite pour ce qui est de l'offre de recrutement, je vais refuser.
Je ne travaille pas en temps que graphiste. Le peu de chose que je crée sont
pour moi. (vu le temps que ça me prend...)
Après si tu souhaites avoir des conseils sur le scénario ou des mécanismes
pourquoi pas. Mais je ne connait pas média fusion...
Avant de retourner dans la 9e dimension je te remercie d'avoir pris contact
avec moi. Et merci verehn d'être autant à l'écoute des demandes des makeurs
débutants.
cortez - posté le 16/07/2015 à 11:10:17. (524 messages postés)
Domaine concerné: Script
Logiciel utilisé: RmVxAce
Bonjour,
Je recherche de l'aide afin d'obtenir un script qui ajoute le viewport des images dans la scene_battle.
Afin de pouvoir utiliser les commandes d’événement pour afficher et modifier des images.
Mon but afficher une roue des éléments durant les combats, j'ai déjà crée le système en évent, seul l'affichage de
cette roue ne marche pas dans les combats. Ajouter un viewport me semble logique puisqu'il semble ne pas être
disponible en dehors de la scene_map. Cependant tout moyen qui me permet d'afficher des images via commande
d'évent pendant un combat me convient.
Merci.
Dsl du dérangement j'ai fini par y arriver tout seul. (les images peuvent être affichée nativement)
cortez - posté le 08/07/2015 à 17:14:25. (524 messages postés)
J'ai rien contre Nemau mais j’accroche pas au style de perspective utilisé dans Polaris.
J'ai l'impression que le joueur est couché au sol. Et les caisses sont trop bizarres.
(Dans LoZ minish Cap les personnages sont vu de plus haut et les bloc aussi.)
cortez - posté le 25/06/2015 à 23:15:11. (524 messages postés)
@brikou
Normalement un :
@spriteset.dispose
que tu place après la ligne 41 devrait résoudre les problèmes. Ou 31 si la manipulation ne change rien.
Je connait bien XP mais VXace modifie tout avec ses def Start et def Terminate.
cortez - posté le 23/06/2015 à 23:11:16. (524 messages postés)
Question c'est normal que tous tes screens soit passés au filtre "lumière crue".
(la luminosité est aux max)
C'est pareil pour la vidéo. Il faut que tu saches que c'est gênant pour les yeux.
Hormis ce détail, les décors sont sympas (la salle d'examen est trop grande/vide)
Le moteur de T-rpg fonctionne bien. Je l'ai déjà utilisé avec 8 ennemis et l'IA
fonctionne correctement (même si certaines de ses décisions prennent plus de temps)
On te l'a déjà dit, mais pense à modifier l'interface des menus de combat pour qu'ils
s'intègrent dans l'univers de ton jeu.
cortez - posté le 18/06/2015 à 21:24:37. (524 messages postés)
Question pour les gens qui savent quels jeux peuvent être présentés aux Alex d'Or.
Je ne pourrais pas finir mon projet Fantasy Online à temps. Cependant je souhaite
participer. Pensez vous que je peux présenter Portal XP ? La règle des 45 minutes
semble m'en empêcher.
cortez - posté le 10/06/2015 à 21:01:39. (524 messages postés)
Ok vous avez raisons Nemau ne fait pas parti du staff. Cependant pour avoir une
"joulie" étiquette, il faut être dans les petit papier du staff. Bref ça sent le piston.
(sous le bureau le piston ?).
En tout cas je félicite les participants encore une fois, je n'ai plus le temps de
participer avec mon nouvel emploi du temps de ouf. (Il est possible que je ne
puisse pas non plus participer aux Alex d'or... -_- )
cortez - posté le 27/05/2015 à 16:04:30. (524 messages postés)
Un petit coucou pour vous signaler la remise sur steam de RPG maker XP. Profitez en vite l'offre n'est valable que jusqu'au 29 mai (vendredi de cette semaine donc).
cortez - posté le 18/05/2015 à 09:26:21. (524 messages postés)
Un peu de script sinon ? C'est plus complexe que les autres systèmes mais ça
fonctionne sans soucis :
Essaye une commande de script dans la condition (dernier onglet "si script")
Si script : Input.trigger?(:X ) # :X peut être remplacé par une autre touche dans le script ligne 138 à 157
Tu lance ton animation de tir et le reste de l'évent pour tirer.
fin
Et c'est tout, rien de plus à ajouter. Si le joueur tapote la touche ça tire à chaque fois mais si il laisse enfoncé ça fait rien.
$imported||={}$imported[:zf_keyboard_manager]="1.1.0"#+----------------------------------------------------------------------------+#| 1 - Basic Info#-============================================================================-#| Script: Keyboard Manager#| Version: 1.1.0#| Updated: April 9th 2015#| Author: Zalerinian (~ZF)#------------------------------------------------------------------------------#| 2 - Section Overview#-============================================================================-#| 1 - Basic Info#| 2 - Section Overview#| 3 - Script Summary#| 4 - Version History#| 5 - Script Support#| 6 - Attribution#| 7 - Method List#| 8 - Usage#| 9 - Known Issues#| 10 - Configuration#------------------------------------------------------------------------------#| 3 - Script Summary#-============================================================================-#| This script allows the developer to set the controls for the game, without#| needing to worry about the player's control setup.#------------------------------------------------------------------------------#| 4 - Version History#-============================================================================-#| v1.1.0 - April 9th, 2015#| - Fixed an issue that prevented the player from moving with the set#| keybinding.#|#| v1.0.1 - March 11th, 2014#| - Fixed a bug when using conditional branches in events#|#| v1.0.0 - March 9th 2014#| - Initial Release#------------------------------------------------------------------------------#| 5 - Script Support#-============================================================================-#| For support, bug reports, or feedback, please email scripts@razelon.tk,#| or send me (Zalerinian) a private message (PM) on the RPG maker forums.#------------------------------------------------------------------------------#| 6 - Attribution (Credit)#-============================================================================-#| I do not require credit to be given. You may use this script in a#| commercial or non-commercial game, so long as you do not claim that#| you wrote it. You may port this script to another engine, and are free#| to require credit for it. Do not claim that the original script was#| yours. The script also must remain free for both commercial and#| non-commercial use.#------------------------------------------------------------------------------#| 7 - Method List#| + = New Method#| * = Aliased Method#| ! = Overwritten Method#-============================================================================-#| Input#| + any_key?#| + released?(key)#| * press?(key)#| * trigger?(key)#| ! repeat?(key)#| ! dir4#| ! dir8#------------------------------------------------------------------------------#| 8 - Usage#-============================================================================-#| This script is plug-n-play, with configuration explained below.#------------------------------------------------------------------------------#| 9 - Known Issues#-============================================================================-#| Bound keys will not function with gamepads, only those that do not get#| rebound will function with gamepads, however RMs gamepad system is designed#| to work with a controller setup that is not similar to those found on the#| Xbox or Playstation.#|#| Rebinding keys is not currently possible in-game. A future update will#| provide this feature.#------------------------------------------------------------------------------#| 10 - Configuration#-============================================================================-module Zale
module Keyboard_Manager
# Editable Area below!# Don't touch this
Keys ={# backspace tab enter any shift any control any alt caps lock escape spacebar
_back: 0x08, _tab: 0x09, _enter: 0x0D, _shift: 0x10, _control: 0x11, _alt: 0x12, _capl: 0x14, _esc: 0x1B, _space: 0x20,# page up page down end home left arrow up arrow right arrow down arrow print screen key
_pgup: 0x21, _pgdn: 0x22, _end: 0x23, _home: 0x24, _left: 0x25, _up: 0x26, _right: 0x27, _down: 0x28, _print_screen: 0x2C,# insert delete help 0 1 2 3 4 5 6 7
_insert: 0x2D, _delete: 0x2E, _help: 0x2F, _0: 0x30, _1: 0x31, _2: 0x32, _3: 0x33, _4: 0x34, _5: 0x35, _6: 0x36, _7: 0x37,# 8 9 A B C D E F G H I J
_8: 0x38, _9: 0x39, _a: 0x41, _b: 0x42, _c: 0x43, _d: 0x44, _e: 0x45, _f: 0x46, _g: 0x47, _h: 0x48, _i: 0x49, _j: 0x4A,# K L M N O P Q R S T U V
_k: 0x4B, _l: 0x4C, _m: 0x4D, _n: 0x4E, _o: 0x4F, _p: 0x50, _q: 0x51, _r: 0x52, _s: 0x53, _t: 0x54, _u: 0x55, _v: 0x56,# W X Y Z left win right win numpad 0 numpad 1 numpad 2 numpad 3
_w: 0x57, _x: 0x58, _y: 0x59, _z: 0x5A, _lwin: 0x5B, _rwin: 0x5C, _num0: 0x60, _num1: 0x61, _num2: 0x62, _num3: 0x63,# numpad 4 numpad 5 numpad 6 numpad 7 numpad 8 numpad 9 numpad * numpad + numpad -
_num4: 0x64, _num5: 0x65, _num6: 0x66, _num7: 0x67, _num8: 0x68, _num9: 0x69, _multi: 0x6A, _add: 0x6B, _sub: 0x6D,# numpad . numpad / FN 1 FN 2 FN 3 FN 4 FN 5 FN 6 FN 7 FN 8
_dec: 0x6E, _div: 0x6F, _f1: 0x70, _f2: 0x71, _f3: 0x72, _f4: 0x73, _f5: 0x74, _f6: 0x75, _f7: 0x76, _f8: 0x77,# FN 9 FN 10 FN 11 FN 12 FN 13 FN 14 FN 15 FN 16 FN 17 FN 18
_f9: 0x78, _f10: 0x79, _f11: 0x7A, _f12: 0x7B, _f13: 0x7C, _f14: 0x7D, _f15: 0x7E, _f16: 0x7F, _f17: 0x80, _f18: 0x81,# FN 19 FN 20 FN 21 FN 22 FN 23 FN 24 left shift right shift left ctrl
_f19: 0x82, _f20: 0x83, _f21: 0x84, _f22: 0x85, _f23: 0x86, _f24: 0x87, _lshift: 0xA0, _rshift: 0xA1, _lcontrol: 0xA2,# right xtrl left alt right alt : = , - .
_rcontrol: 0xA3, _lalt: 0xA4, _ralt: 0xA5, _colon: 0xBA, _equals: 0xBB, _comma: 0xBC, _minus: 0xBD, _period: 0xBE,# / ` (~) [ \ ] ' (")
_slash: 0xBF, _tilde: 0xC0, _lbrace: 0xDB, _backslash: 0xDC, _rbrace: 0xDD, _quote: 0xDE
}# Edit here: # Each key binding is stored in the format:# internal_button: array of keyboard keys to check.# Using this, you can create your own key bindings for# special functions. These names are used internally to# check for input. Each key on the keyboard is stored# in the Keys hash above. Ex:# JUMP: [Keys[:_space] ]# Now if whenever we use Input.trigger?(:JUMP), Input.press?(:JUMP),# or similar, it will check to see if the spacebar has been# pressed down, or just released if you use Input.released?(:JUMP).# The default RM controls are setup by default. If # wish to allow the player to change some controls,# comment out (place a # before), or remove each# control you wish to leave up to the player. Currently,# this is the only way to change controls during the# game. A later update will change this.
Key_Bindings ={
A: [Keys[:_shift]],
B: [Keys[:_esc]],
C: [Keys[:_enter], Keys[:_space], Keys[:_z]],
X: [Keys[:_a]],
Y: [Keys[:_s]],
Z: [Keys[:_d]],
L: [Keys[:_q]],
R: [Keys[:_w]],
UP: [Keys[:_up], Keys[:_num8]],
DOWN: [Keys[:_down], Keys[:_num2]],
RIGHT: [Keys[:_right], Keys[:_num6]],
LEFT: [Keys[:_left], Keys[:_num4]],
SHIFT: [Keys[:_shift]],
CTRL: [Keys[:_control]],
ALT: [Keys[:_alt]],
F5: [Keys[:_f5]],
F6: [Keys[:_f6]],
F7: [Keys[:_f7]],
F8: [Keys[:_f8]],
F9: [Keys[:_f9]]}endendmodule Input
@released=Hash.new{}@triggers=Hash.new{}@pressed=Hash.new{}@timer=Hash.new{}@table={2=>:DOWN,4=>:LEFT,6=>:RIGHT,8=>:UP,11=>:A,12=>:B,13=>:C,14=>:X,15=>:Y,16=>:Z,17=>:L,18=>:R,}
KEY = Win32API.new("user32.dll","GetKeyState",["i"],"i")
AKEY = Win32API.new("user32.dll","GetAsyncKeyState",["i"],"i")class<<selfincludeZale::Keyboard_Manager#--------------------------------------------------------------------------# Input: Update ALIASED METHOD# * Update will update the status of each key for input check.#--------------------------------------------------------------------------alias zale_keyman_input_update_CIO223cjcivoa update
def update
zale_keyman_input_update_CIO223cjcivoa
Keys.each_value{|key|@pressed[key]==nil ? @pressed[key]=false : nil@triggers[key]==nil ? @triggers[key]=false : nil@released[key]==nil ? @released[key]=false : nil@timer[key]==nil ? @timer[key]=30 : nil(@pressed[key]==false&& AKEY.call(key) !=0) ? @triggers[key]=true : @triggers[key]=false(AKEY.call(key) !=0) ? @pressed[key]=true : @pressed[key]=false(@pressed[key]==true&& AKEY.call(key)==0) ? @released[key]=true : @released[key]=false}end#--------------------------------------------------------------------------# Input: Press? ALIASED METHOD# * Press will check if the given key is pressed down on the keyboard.# * This method does not take into account any delays, if the key is# * down, this will return true.#--------------------------------------------------------------------------alias zale_keyman_input_press_DIOjd2iovjs press?
def press?(key)if@table[key]
key =@table[key]endif Key_Bindings[key]
Key_Bindings[key].any?{|k|@pressed[k]}elsif !@pressed[Keys[key]].nil?
@pressed[Keys[key]]else
zale_keyman_input_press_DIOjd2iovjs(key)endend#--------------------------------------------------------------------------# Input: Trigger? ALIASED METHOD# * Trigger checks if the key was just immediately pressed. This returns# * true only for the first frame the key is pressed down. To check for# * the key being down at any time, use press?, described above.#--------------------------------------------------------------------------alias zale_keyman_input_trigger_389fHUKWquihc trigger?
def trigger?(key)if@table[key]
key =@table[key]endif Key_Bindings[key]
Key_Bindings[key].any?{|k|@triggers[k]}elsif !@triggers[Keys[key]].nil?
@triggers[Keys[key]]else
zale_keyman_input_trigger_389fHUKWquihc(key)endend#--------------------------------------------------------------------------# Input: Repeat? OVERWRITTEN METHOD# * Repeat will check if a key is pressed down, similar to press?, # * however, repeat? will take into account a delay. After initially# * pressing the button, the delay will 30 frames (one half of second).# * After, the delay will be 5 frames (one 12th of a second)#--------------------------------------------------------------------------def repeat?(key)if@table[key]
key =@table[key]endif !press?(key)||@timer[key].nil?
@timer[key]=30endif trigger?(key)returntrueelseif@timer[key]<=0@timer[key]=5trueelse@timer[key]-=1falseendendend#--------------------------------------------------------------------------# Input: Toggle? NEW METHOD# * Toggle checks the specified key to see if it is 'on or off'. This is# * useless for most keys, however capslock can by checked with this.#--------------------------------------------------------------------------def toggle?(key)if@table[key]
key =@table[key]end
key = Keys[key]
key ? nil : (returnfalse)if KEY.call(key)==1returntrueelsereturnfalseendend#--------------------------------------------------------------------------# Input: Released? NEW METHOD# * Similar to trigger?, release will check if a key has jut been# * released. Again, this only returns true for the first frame#--------------------------------------------------------------------------def released?(key)if@table[key]
key =@table[key]endif Key_Bindings[key]
Key_Bindings[key].all?{|bind|@released[bind]}else@released[key]endend#--------------------------------------------------------------------------# Input: Any_key? NEW METHOD# * Any_key? will check to see if any key on the entire keyboard has been# * pressed down. If any single key is down, this returns true, otherwise# * false.#--------------------------------------------------------------------------def any_key?
@pressed.any?{|i| i[1]==true}end#--------------------------------------------------------------------------# Input: dir4? OVERWRITTEN METHOD# * dir4 returns an integer based on the keys being pressed. This only# * checks for 4 directions, up, down, left, or right. If no keys are# * pressed, the method returns 0.#--------------------------------------------------------------------------def dir4
l = Key_Bindings[:LEFT].any? {|bind|@pressed[bind]}
r = Key_Bindings[:RIGHT].any? {|bind|@pressed[bind]}
u = Key_Bindings[:UP].any? {|bind|@pressed[bind]}
d = Key_Bindings[:DOWN].any? {|bind|@pressed[bind]}if u && !d
8elsif d && !u
2elsif l && !r
4elsif r && !l
6else0endend#--------------------------------------------------------------------------# Input: dir8? OVERWRITTEN METHOD# * Similar to dir4, this method will return an integer based on 8# * directions, meaning it works with diagonal movement. Again, if no keys# * are being pressed, the method returns 0.#--------------------------------------------------------------------------def dir8
l = Key_Bindings[:LEFT].any? {|bind|@pressed[bind]}
r = Key_Bindings[:RIGHT].any? {|bind|@pressed[bind]}
u = Key_Bindings[:UP].any? {|bind|@pressed[bind]}
d = Key_Bindings[:DOWN].any? {|bind|@pressed[bind]}if l && u && !r && !d
7elsif u && r && !l && !d
9elsif l && d && !r && !u
1elsif d && r && !l && !u
3elsif u && !d
8elsif d && !u
2elsif l && !r
4elsif r && !l
6else0endendendend
cortez - posté le 05/05/2015 à 23:11:06. (524 messages postés)
Les statuts dans VXAce ont une priorité. La mort possède la priorité la plus haute
elle écrase les autres statuts lorsque la cible meurt.
Essaye de voir si ton problème vient de là (il est dangereux d'immuniser un personnage au statut mort.)
cortez - posté le 30/04/2015 à 18:28:43. (524 messages postés)
Pourquoi ne pas utiliser des évents en dessous du héro. (au moins 4)
1/ Tu mets ton eau en traversable.
2/ Dans les tags terrain (1 à 64) tu peints l'eau avec le n°2 (ou un autre)
Dans un évent parallèle :
Etiquette 1
3/ Tu vérifie l'ID de la case ou se trouve le joueur, et aussi ses coordonnées X et Y. (variable H_X et H_Y)
Si c'est une case ID 2 c'est de l'eau. Sinon "Allez à l'étiquette 1"
4/ Tu téléporte un event nénuphar1 aux coordonnée du héro.
Etiquette 2
5/ Tu enregistres les Variables H_X et H_Y dans une variable OldX et OldY. Et tu
enregistre à nouveau la position du héro en X et Y et l'ID de la case. (H_X et H_Y)
6/ Toujours dans l'évent parallèle tu vérifie si les coordonnés de H_X ou H_Y sont
différentes de OldX ou OldY. Sinon "Aller à l'étiquette 2"
Si les valeurs sont différentes, le héro c'est déplacé. Donc on vérifie si l'ID de la nouvelle case est 2 (donc si c'est de l'eau ou pas.)
Si le héro à bougé et que la case est ID 2 :
7/ Téléporte l'évent nénuphar2 sur les coordonnées du héro.
Etiquette 3
...
Ensuite tu fait pareil avec pour les 2 autres nénuphars. (recopie les étapes 5,6,7
mais en changeant l'évent téléporté. Pense aussi a ajouter les étiquettes en
changeant le chiffre.)
Pour les évent nénuphars :
Traversables et apparence de nénuphar en dessous du héro.
Type de déplacement : Personnalisé Fréquence Max Vitesse Max
Attendre 1 frame
Tourner de 90° vers la gauche.
Attendre 1 frame
Tourner de 90° vers la gauche.
Attendre 1 frame
Tourner de 90° vers la gauche.
Attendre 1 frame
Opacité 0
Condition de déclenchement "au contact du héro"
Page 1
Opacité 255 (cet évenement)
Regarde vers le bas.
Utilise ce character !$Nenuphar
Note :
Il est possible que les évent en dessous du héro crée des bug de superposition, dans ce cas il te faut un
script pour gérer la priorité d'affichage des characters.
#--------------------------------------------------------------------------# overwrite method: draw_actor_mp#--------------------------------------------------------------------------def draw_actor_mp(actor, dx, dy, width = XXX)# Remplace XXX par le chiffre trouvé dans le script des Hp
dy -=20# Remplace 20 par le chiffre que tu as mis pour les HP
draw_gauge(dx, dy, width, actor.mp_rate, mp_gauge_color1, mp_gauge_color2)
change_color(system_color)
cy =(Font.default_size- contents.font.size)/2+1
draw_text(dx+2, dy+cy,30, line_height, Vocab::mp_a)
draw_current_and_max_values(dx, dy+cy, width, actor.mp, actor.mmp,
mp_color(actor), normal_color)end#--------------------------------------------------------------------------# overwrite method: draw_actor_tp#--------------------------------------------------------------------------def draw_actor_tp(actor, dx, dy, width = XXX)# Remplace XXX par le chiffre trouvé dans le script des Hp
draw_gauge(dx, dy, width, actor.tp_rate, tp_gauge_color1, tp_gauge_color2)
change_color(system_color)
cy =(Font.default_size- contents.font.size)/2+1
draw_text(dx+2, dy+cy,30, line_height, Vocab::tp_a)
change_color(tp_color(actor))
draw_text(dx + width -42, dy+cy,42, line_height, actor.tp.to_i,2)end
Petite explication sur la manipulation : dx et dy sont des variables qui donnent la position en x et y de l'affichage de la jauge et du reste.
J'ai utilisé l'opération += et -= en fait c'est un raccourci pour une formule plus longue.
"a+= 2" équivaut à "a = a+2" Pareil avec les autres signes d'opération ( - + / * )
cortez - posté le 22/04/2015 à 10:47:27. (524 messages postés)
J'ai encore un bug d'affichage pour des évent avec un $ (1 seul par planche) mais
pour les event en planche de 8 aucun souci ! Donc je te propose cette version,
elle fonctionne pour tes perso et les character uniquement en planche.
#==============================================================================# Extra Movement Frames# Version: 1.0.1# Author: modern algebra (rmrk.net)# Date: 26 September 2012#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++# Description:# # This script allows you to import character sprites with more than 3 frames # for movement animation. In other words, it allows you to animate sprites a # little more smoothly. One use for it is it allows RMXP format characters to # be imported directly into a VXA game without editing (although you will need # to rename the file).#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++# Instructions:# # Paste this script into its own slot in the Script Editor, above Main but# below Materials. If you are using my Composite Graphics script, then this# script must be placed in a slot below Composite Graphics.## To create a sprite with extra movement frames, all you need to do is # rename the character graphic to something of the form:## Regular_Name%(x)# where:# x is the number of frames in each character sprite# # EXAMPLES:## $001-Fighter01%(4)# This graphic is a single character with four frames of animation. [XP]# 022-Actors12%(6)# This graphic would be interpreted as a character sheet of 8 characters,# each having six frames of animation.#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# Additionally, this script also allows you to specify the "idle" frame (the# frame where the sprite is not moving), and also the pattern if wish to so# specify. In essence, all you need to do is add those integers after the# number of frames:## Regular_Name%(x y1 y2 y3 ... yx)# where:# x is the number of frames in each character sprite# y1 is the idle frame (the frame shown when sprite is not moving)# y2 ... yx are the pattern.## Keep in mind that the first frame in a sprite is index 0, the second frame# is index 1, etc.## Where y1 is excluded, it is assumed to be 0. Where y2 ... yx are excluded,# the pattern is assumed to simply cycle through the frames one by one until# it repeats.## EXAMPLES:## $003-Fighter03%(4 2)# This graphic is a single character with four frames of animation. The # idle frame is 2 (the third one over). The pattern when moving would be# 2 3 0 1, 2 3 0 1, etc.# 032-People05%(4 0 1 0 3 2 1)# This graphic would be interpreted as a character sheet of 8 characters,# each having four frames of animation. The idle frame is 0 (the first# in the sheet), and the pattern is 0 1 0 3 2 1, 0 1 0 3 2 1, etc.#==============================================================================$imported={}unless$imported$imported[:MA_ExtraMovementFrames]=true#==============================================================================# *** MA_ExtraMovementFrames#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++# This module holds a method for calculating width and height of an emf# character frame#==============================================================================module MA_ExtraMovementFrames
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# * Check if Character has extra movement frames#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~def ma_char_is_emf_sprite?(character_name)
character_name && !character_name[/\%[\(\[].+?[\)\]]/].nil?
end#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# * Derive Frames Array#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~def maemf_get_frames(character_name)
character_name =""unless character_name
frames = !character_name[/\%[\(\[](.+?)[\)\]]/] ? [] :
$1.scan(/\d+/).collect{|s| s.to_i}
frames[0]=3unless frames[0]# If empty, then set to default 3
frames.push(1,2,1,0)if frames[0]==3&& frames.size<2
frames[1]=0unless frames[1]# Set idle frameif frames.size<3# Create pattern (frames[0]-1).times{|i| frames.push((frames[1]+ i +1)% frames[0])}endreturn frames
end#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# * Calculate Frame Size#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~def maemf_calc_frame_size(character_name, bitmap, frames =[])
character_name =""unless character_name
frames = maemf_get_frames(character_name)if frames.empty?
$cw= bitmap.width/(frames[0] ? frames[0] : 3)$ch= bitmap.height/4
sign = character_name[/^[\!\$]./]if !sign || !sign.include?('$')$cw/=4$ch/=2endreturn$cw,$chendend# Compatibility with Composite Graphicsif$imported[:MA_CompositeGraphics]#============================================================================# *** Cache#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++# Summary of Changes:# aliased method - macgve_make_unique_name#============================================================================class<< Cache
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# * Make Unique Name#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~alias macgemf_uniqname_3tc8 macgve_make_unique_name
def macgve_make_unique_name(cg_array =[],*args)
result = macgemf_uniqname_3tc8(cg_array,*args)# Call Original Method# Add %(x) code to name if the first graphic in the array contains it.
result += $1 if cg_array[0]&& cg_array[0].filename[/(\%[\(\[].+?[\)\]])/]
result
endendend#==============================================================================# ** Game_CharacterBase#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++# Summary of Changes:# aliased method - straighten; update_anime_pattern; initialize;# set_graphic; character_name=# new methods - maemf_init_char_frames#==============================================================================class Game_CharacterBase
include MA_ExtraMovementFrames
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# * Straighten#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~alias maemf_straghtn_5sb3 straighten
def straighten(*args,&block)
maemf_straghtn_5sb3(*args,&block)# Run original method@pattern=@original_patternif@walk_anime||@step_animeend#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# * Update Anime Pattern#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~alias maemf_updanim_ptrn_2yv5 update_anime_pattern
def update_anime_pattern(*args)if@ma_char_is_emf_sprite# If an emf spriteif !@step_anime &&@stop_count>0# Reset to stationary@maemf_frame_index=0@pattern=@original_patternelse# Next Pattern@maemf_frame_index=(@maemf_frame_index +1)%@maemf_character_pattern.size@pattern=@maemf_character_pattern[@maemf_frame_index]endelse
maemf_updanim_ptrn_2yv5(*args)# Call original methodendend#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# * Initialize Character Frames#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~def maemf_init_char_frames
@maemf_frame_index=0# Initialize Index# Save this value for faster reference@ma_char_is_emf_sprite= ma_char_is_emf_sprite?(character_name)if@ma_char_is_emf_sprite# Get pattern@maemf_character_pattern= maemf_get_frames(character_name)@maemf_character_pattern.shift# Remove frame number@original_pattern=@maemf_character_pattern[0]else@maemf_character_pattern=[]endend#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# * Initialize Character Frames Proc#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~defself.maemf_init_char_frames_procProc.new{|method_name|
alias_method(:"maemf_#{method_name}_2ev9", method_name)# Alias
define_method(method_name)do|*args|# Define method
send(:"maemf_#{method_name}_2ev9",*args)# Call original method
maemf_init_char_frames
end}endproc= maemf_init_char_frames_proc
[:initialize,:set_graphic].each{|name|proc.call(name)}end#==============================================================================# ** Game_Player/Follower/Vehicle/Event#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++# This aliases methods in these classes that change @character_name in order# to call maemf_init_char_frames#==============================================================================class Game_Player
# Refresh
maemf_init_char_frames_proc.call(:refresh)endclass Game_Follower
# Refresh
maemf_init_char_frames_proc.call(:refresh)endclass Game_Vehicle
# Load System Settings
maemf_init_char_frames_proc.call(:load_system_settings)endclass Game_Event
proc= maemf_init_char_frames_proc
# Clear Page Settings & Setup Page Settings[:clear_page_settings,:setup_page_settings].each{|name|proc.call(name)}end#==============================================================================# ** Sprite_Character#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++# Summary of Changes:# aliased methods - set_character_bitmap; update_src_rect# new methods - ma_set_emf_character_bitmap; ma_update_emf_src_rect#==============================================================================class Sprite_Character
include MA_ExtraMovementFrames
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# * Set Character Bitmap#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~alias maemf_setcharbmp_4rm6 set_character_bitmap
def set_character_bitmap(*args)@emf_char= ma_char_is_emf_sprite?(@character_name)@emf_char ? ma_set_emf_character_bitmap : maemf_setcharbmp_4rm6(*args)end#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# * Update Transfer Origin Rectangle#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~alias maemf_updtsrcrect_2kq5 update_src_rect
def update_src_rect(*args)@emf_char ? ma_update_emf_src_rect : maemf_updtsrcrect_2kq5(*args)end#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# * Set Character Bitmap#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~def ma_set_emf_character_bitmap
self.bitmap= Cache.character(@character_name)@emf_char_frames= maemf_get_frames(@character_name)$emf_char_frames=@emf_char_frames@cw,@ch= maemf_calc_frame_size(@character_name, bitmap,@emf_char_frames)self.ox=@cw/2self.oy=@chend#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# * Update Transfer Origin Rectangle#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~def ma_update_emf_src_rect
if@tile_id==0
index =@character.character_index
pattern =@character.pattern<@emf_char_frames[0] ? @character.pattern : @emf_char_frames[1]
sx =(index %4*@emf_char_frames[0]+ pattern)*@cw
sy =(index / 4 * 4 + (@character.direction - 2) /2)*@chself.src_rect.set(sx, sy,@cw,@ch)endendend#==============================================================================# ** Window_Base#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++# Summary of Changes: # aliased method - draw_character# new method - ma_draw_emf_character#==============================================================================class Window_Base
include MA_ExtraMovementFrames
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# * Draw Character Graphic#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~alias maemf_drawcharct_3kq6 draw_character
def draw_character(character_name,*args)
character_name[/\%[\(\[].+?[\)\]]/] ? ma_draw_emf_character(character_name,*args) :
maemf_drawcharct_3kq6(character_name,*args)end#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# * Draw Extra Movement Frames Character Graphic#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~def ma_draw_emf_character(character_name, character_index, x, y)returnunless character_name
if !ma_char_is_emf_sprite?(character_name)# Draw regular if there is no frame specification in the name
maemf_drawcharct_3kq6(character_name,*args)else
bitmap = Cache.character(character_name)
frames = maemf_get_frames(character_name)
cw, ch = maemf_calc_frame_size(character_name, bitmap, frames)
n = character_index
src_rect = Rect.new((n%4*frames[0]+frames[1])*cw,(n/4*4)*ch, cw, ch)
contents.blt(x - cw /2, y - ch, bitmap, src_rect)endendend
#------------------------------------------------------------------------------## Galv's Character Effects#------------------------------------------------------------------------------## For: RPGMAKER VX ACE# Version 2.0#------------------------------------------------------------------------------## 2013-12-07 - Version 2.0 - Added comments to more easily add event effects# - Fixed shadow facing bug# 2013-02-24 - Version 1.9 - added z level option for reflection and shadows# 2013-02-23 - Version 1.8 - added multiple light sources for shadows# 2013-02-22 - Version 1.7 - bug fixes# 2013-02-22 - Version 1.6 - added icon effect# 2013-02-22 - Version 1.5 - fixed mirror bug on large maps# 2013-02-22 - Version 1.4 - added effects to vehicles# 2013-02-21 - Version 1.3 - fixed jump reflection and other minor tweaks# 2013-02-21 - Version 1.2 - bug with less than 4 actors (oops)# 2013-02-21 - Version 1.1 - updated flicker effect# 2013-02-21 - Version 1.0 - release#------------------------------------------------------------------------------## This script was made to provide some additional effects for characters such# as events, followers and the player on the map.# Currently it includes:## Shadows# Shadows that appear under player and events in a directions depending on# a light source that you choose.## Parallax Reflect# Reflections that appear on the parallax layer for events and actors to be# used for things like reflections in the water or glass floor etc. To get# effects like the demo, you need to edit the charset graphic to make the water# partially transparent.## Parallax Mirrors# Much like reflect but are instead actors and event are reflected in a mirror# on a wall designated by a region. Both mirror and reflect effects can be# changed so actors and events can use different charsets for their reflections##------------------------------------------------------------------------------##------------------------------------------------------------------------------## NEW - First event command as a COMMENT#------------------------------------------------------------------------------## You can add a comment as the first event command on an event page to set if# that event has an icon, shadow or reflection active. The tags to use are# below, all must be on the same line in the comment.## <icon:id,x,y> # set the event to display an icon (x,y position offset)# <shadow> # set the event to display a shadow# <reflect> # set the event to display reflections##------------------------------------------------------------------------------## EXAMPLE:# <icon:1,0,0><shadow><reflect> # to show reflect, shadow and icon 1 on event#------------------------------------------------------------------------------##------------------------------------------------------------------------------## SCRIPT CALLS:#------------------------------------------------------------------------------### char_effects(x,x,x,status)##------------------------------------------------------------------------------## # each effect can be true or false to enable/disable them during the game.# # you can change multiples of effects at once, x being the effect number# # 0 = reflect 1 = shadows 2 = mirror 3 = icons#------------------------------------------------------------------------------## EXAMPLES:# char_effects(0,true) # turn reflections on# char_effects(0,2,true) # turn reflections and mirror on# char_effects(1,3,false) # turn shadows and icons off#------------------------------------------------------------------------------### reflect_sprite(actor_id,filename,pos) # Change actor's reflect charset## reflect_esprite(event_id,filename,pos) # Change event's reflect charset## reflect_vsprite(vehicle_id,filename,pos) # Change vehicle's reflect charset##------------------------------------------------------------------------------## EXAMPLES:# reflect_sprite(1,"Actor2",2) # change actor 1's charset to use sprite# # in position 2 of "Actor2" charset.# reflect_esprite(3,"Actor4",5) # event 3 will use sprite in position 5 of# # "Actor4" charset.# reflect_vsprite(1,"Vehicle",5) # Ship will use sprite in position 5 of# # "Vehicle" charset.#------------------------------------------------------------------------------##------------------------------------------------------------------------------## SCRIPT CALLS to turn effects ON or OFF for chosen EVENTS#------------------------------------------------------------------------------### reflect(x,x,x,status) # status can be true or false to turn on or off# # use this to specify for mirror and reflect.# shadow(x,x,x,status) # where x is the event ids you want to change# # to change all events use :all# icon(x,x,x,icon_id) # set which icon id to appear above character. Make# # it 0 for no icon.##------------------------------------------------------------------------------## EXAMPLES:# reflect(14,17,3,1,true) # Turn events 14, 17, 3 and 1 reflections ON# shadow(1,false) # Turn event 1 shadow OFF# reflect(:all,true) # Turn all event reflections ON# icon(1,2,3,4,38) # Events 1,2,3 and 4 will have icon 38 appear## NOTE: All events will default to NO shadows and NO reflections when entering# a map. This is a design decision to try to keep lag to a minimum. You# should use these effects sparingly and only activate them on events# that require them.#------------------------------------------------------------------------------##------------------------------------------------------------------------------## SCRIPT CALLS to turn effects ON or OFF for ACTORS and VEHICLES#------------------------------------------------------------------------------### actor_reflect(actor_id,status) # reflections and shadows are ON by default # actor_shadow(actor_id,status) # for actors and vehicles. Turning them off # actor_icon(actor_id,icon_id) # or on will permanently change them.## v_reflect(x,x,x,status) # use these v_ calls for changing vehicle effects# v_shadow(x,x,x,status) # on and off for vehicles.# v_icon(x,x,x,icon_id)##------------------------------------------------------------------------------##------------------------------------------------------------------------------## SCRIPT CALLS for shadow options#------------------------------------------------------------------------------### shadow_source(x,y,id) # set the x,y location for the light. id is the # # light source number you wish to change (for# # more than one). These are reset on map change.# shadow_source(event_id,id) # use an event's x,y location for the light.# # This will need to be in parallel process if you# # want it to be a moving light.## shadow_options(intensity,fade,flicker) # descriptions below## # intensity = opacity when standing next to the light source (255 is black)# # fade = amount shadow becomes more transparent the further away you are.# # flicker = true or false. Shadows will flicker as if being cast by fire.##------------------------------------------------------------------------------## EXAMPLE:# shadow_options(80,10,false) # This is the default setting.#------------------------------------------------------------------------------##------------------------------------------------------------------------------## SCRIPT CALLS for reflect options#------------------------------------------------------------------------------### reflect_options(wave_pwr) ## # wave_pwr = how strong the wave movement is. 0 is off##------------------------------------------------------------------------------## EXAMPLE:# reflect_options(1) # Turn wave power to 1#------------------------------------------------------------------------------##------------------------------------------------------------------------------## NOTETAG for ACTORS#------------------------------------------------------------------------------### <no_reflect> # Actor will not have a reflection (for vampires of course!)## <reflect_sprite: FileName,pos> # Actor will use this charset for reflections# # and use the character in position 'pos'##------------------------------------------------------------------------------## EXAMPLES:# <reflect_sprite: Actor2,0> # The first character from Actor2 charset# <reflect_sprite: Actor3,7> # The last character from Actor2 charset#------------------------------------------------------------------------------#($imported ||={})["Galv_Character_Effects"]=truemodule Galv_CEffects
#------------------------------------------------------------------------------# # SETUP OPTIONS#------------------------------------------------------------------------------#
MIRROR_REGION =4# Region ID used to determine mirror walls. Paint the# region on the wall you want to make reflective (and# then use tiles/mapping that make the parallax visible)
ICON_OFFSET =-60# Y offset for icons that are displayed above characters
REFLECT_Z =-10# Z level of reflections
SHADOW_Z =0# Z level of shadows#------------------------------------------------------------------------------# # END SETUP OPTIONS#------------------------------------------------------------------------------#endclass Game_Map
def do_icons(refresh =true)@events.values.each{|e|nextif !e.listif e.list[0].code==108&& e.list[0].parameters[0]=~/<icon:(.*),(.*),(.*)>/
e.icon= $1.to_i
e.icon_offset=[$2.to_i,$3.to_i]else
e.icon=0
e.icon_offset=[0,0]end}
SceneManager.scene.spriteset.refresh_effectsif refresh
enddef do_shadows(refresh =true)@events.values.each{|e|nextif !e.listif e.list[0].code==108&& e.list[0].parameters[0]=~/<shadow>/
e.shadow=trueelse
e.shadow=falseend}
SceneManager.scene.spriteset.refresh_effectsif refresh
enddef do_reflects(refresh =true)@events.values.each{|e|nextif !e.listif e.list[0].code==108&& e.list[0].parameters[0]=~/<reflect>/
e.reflect=trueelse
e.reflect=falseend}
SceneManager.scene.spriteset.refresh_effectsif refresh
enddef do_all_chareffects
do_icons(false)
do_shadows(false)
do_reflects(false)endend# Game_Mapclass Game_Interpreter
def remove_icon
icon(@event_id,0)end#-----------------------------------## REFLECTIONS#-----------------------------------## Add/Remove Reflections from selected eventsdef reflect(*args,status)
char_ids =[*args]if char_ids ==[:all]$game_map.events.values.each{|e| e.reflect= status }else
char_ids.each{|c|$game_map.events[c].reflect= status }end
SceneManager.scene.spriteset.refresh_effectsend# Change forever actor's reflect statusdef actor_reflect(actor_id,status)$game_actors[actor_id].reflect= status
$game_player.refreshend# Change forever vehicle's reflect statusdef v_reflect(*args,status)
char_ids =[*args]if char_ids ==[:all]$game_map.vehicles.each{|v| v.reflect= status }else
char_ids.each{|v|$game_map.vehicles[v].reflect= status }end
SceneManager.scene.spriteset.refresh_effectsenddef reflect_options(*args)$game_map.reflect_options=[*args]
SceneManager.scene.spriteset.refresh_effectsend# Actor reflect sprite changedef reflect_sprite(actor_id,filename,pos)$game_actors[actor_id].reflect_sprite=[filename,pos]$game_player.refreshend# Event reflect sprite changedef reflect_esprite(event_id,filename,pos)$game_map.events[event_id].reflect_sprite=[filename,pos]$game_map.events[event_id].reflect=true
SceneManager.scene.spriteset.refresh_charactersend# Vehicle reflect sprite changedef reflect_vsprite(v_id,filename,pos)$game_map.vehicles[v_id].reflect_sprite=[filename,pos]
SceneManager.scene.spriteset.refresh_charactersend#-----------------------------------## SHADOWS#-----------------------------------## Add/Remove Shadows from selected charactersdef shadow(*args,status)
char_ids =[*args]if char_ids ==[:all]$game_map.events.values.each{|e| e.shadow= status }else
char_ids.each{|c|$game_map.events[c].shadow= status }end
SceneManager.scene.spriteset.refresh_effectsend# Change player and follower shadowsdef actor_shadows(status)$game_player.shadow= status
$game_player.followers.each{|f| f.shadow= status }
SceneManager.scene.spriteset.refresh_effectsend# Change vehicle's shadow statusdef v_shadow(*args,status)
char_ids =[*args]if char_ids ==[:all]$game_map.vehicles.each{|v| v.shadow= status }else
char_ids.each{|v|$game_map.vehicles[v].shadow= status }end
SceneManager.scene.spriteset.refresh_effectsenddef shadow_options(*args)$game_map.shadow_options=[*args]
SceneManager.scene.spriteset.refresh_effectsenddef shadow_source(*args,shad_id)
shadsource =[*args]if shadsource.count==1$game_map.light_source[shad_id]=[$game_map.events[shadsource[0]].real_x,$game_map.events[shadsource[0]].real_y]elsif shadsource.count>1$game_map.light_source[shad_id]= shadsource
else$game_map.light_source=[]endend#-----------------------------------## ICONS#-----------------------------------## Add/Remove Icons from selected eventsdef icon(*args,icon_id)
char_ids =[*args]if char_ids ==[:all]$game_map.events.values.each{|e|if e.icon<=0
e.icon=nilelse
e.icon= icon_id
end}else
char_ids.each{|c|$game_map.events[c].icon= icon_id }end
SceneManager.scene.spriteset.refresh_effectsend# Change forever actor's icondef actor_icon(actor_id,icon_id)$game_actors[actor_id].icon= icon_id
$game_player.refreshend# Change forever vehicle's icondef v_icon(*args,icon_id)
char_ids =[*args]if char_ids ==[:all]$game_map.vehicles.each{|v| v.icon= icon_id }else
char_ids.each{|v|$game_map.vehicles[v].icon= icon_id }end
SceneManager.scene.spriteset.refresh_effectsend#-----------------------------------## GENERAL#-----------------------------------## Turn on/off effects# 0 = reflect# 1 = shadow# 2 = mirror# 3 = icondef char_effects(*args,status)[*args].each{|e|$game_map.char_effects[e]= status }
SceneManager.scene.spriteset.refresh_effectsendend# Game_Interpreter#-------------------------------------------------------------------------------# Spriteset_Map#-------------------------------------------------------------------------------class Spriteset_Map
alias galv_reflect_sm_initialize initialize
def initialize
create_effects
galv_reflect_sm_initialize
refresh_characters
endalias galv_reflect_sm_refresh_characters refresh_characters
def refresh_characters
galv_reflect_sm_refresh_characters
create_effects
enddef refresh_effects
dispose_effects
create_effects
enddef create_effects
@shadow_sprites=[]@reflect_sprites=[]@mirror_sprites=[]@icon_sprites=[]# Do reflectionsif$game_map.char_effects[0]$game_map.events.values.each{|e|@reflect_sprites.push(Sprite_Reflect.new(@viewport1, e))if e.reflect}$game_player.followers.each{|f|@reflect_sprites.push(Sprite_Reflect.new(@viewport1, f))if f.reflect}if$game_player.reflect@reflect_sprites.push(Sprite_Reflect.new(@viewport1,$game_player))end$game_map.vehicles.each{|v|@reflect_sprites.push(Sprite_Reflect.new(@viewport1, v))if v.reflect}end# Do mirrorsif$game_map.char_effects[2]$game_map.events.values.each{|e|@mirror_sprites.push(Sprite_Mirror.new(@viewport1, e))if e.reflect}$game_player.followers.each{|f|@mirror_sprites.push(Sprite_Mirror.new(@viewport1, f))if f.reflect}if$game_player.reflect@mirror_sprites.push(Sprite_Mirror.new(@viewport1,$game_player))end$game_map.vehicles.each{|v|@mirror_sprites.push(Sprite_Mirror.new(@viewport1, v))if v.reflect}end# Do Shadowsif$game_map.char_effects[1]returnif$game_map.light_source.empty?
$game_map.light_source.count.times{|s|$game_map.events.values.each{|e|@shadow_sprites.push(Sprite_Shadow.new(@viewport1, e, s))if e.shadow}$game_player.followers.each{|f|@shadow_sprites.push(Sprite_Shadow.new(@viewport1, f, s))if f.shadow}if$game_player.shadow@shadow_sprites.push(Sprite_Shadow.new(@viewport1,$game_player, s))end$game_map.vehicles.each{|v|@shadow_sprites.push(Sprite_Shadow.new(@viewport1, v, s))if v.shadow}}end# Do iconsif$game_map.char_effects[3]$game_map.events.values.each{|e|@icon_sprites.push(Sprite_Icon.new(@viewport1, e))if e.icon}$game_player.followers.each{|f|@icon_sprites.push(Sprite_Icon.new(@viewport1, f))if f.icon}if$game_player.icon@icon_sprites.push(Sprite_Icon.new(@viewport1,$game_player))end$game_map.vehicles.each{|v|@icon_sprites.push(Sprite_Icon.new(@viewport1, v))if v.icon}endendalias galv_reflect_sm_update update
def update
galv_reflect_sm_update
@reflect_sprites.each{|s| s.update}if$game_map.char_effects[0]@mirror_sprites.each{|s| s.update}if$game_map.char_effects[2]@shadow_sprites.each{|s| s.update}if$game_map.char_effects[1]@icon_sprites.each{|s| s.update}if$game_map.char_effects[3]endalias galv_reflect_sm_dispose_characters dispose_characters
def dispose_characters
galv_reflect_sm_dispose_characters
dispose_effects
enddef dispose_effects
@reflect_sprites.each{|s| s.dispose}@shadow_sprites.each{|s| s.dispose}@mirror_sprites.each{|s| s.dispose}@icon_sprites.each{|s| s.dispose}endend# Spriteset_Map#-------------------------------------------------------------------------------# Sprite_Reflect #-------------------------------------------------------------------------------class Sprite_Reflect < Sprite_Character
def initialize(viewport, character =nil)super(viewport, character)enddef update
superenddef update_balloon;enddef setup_new_effect;enddef set_character_bitmap
if@character.reflect_spriteself.bitmap= Cache.character(@character.reflect_sprite[0])elseself.bitmap= Cache.character(@character_name)endself.mirror=trueself.angle=180self.opacity=220self.z=Galv_CEffects::REFLECT_Zself.wave_amp=$game_map.reflect_options[0]
sign =@character_name[/\%[\(\[](.+?)[\)\]]/]if sign && sign.include?('%')
sign =@character_name[/^[\!\$]./]if sign && sign.include?('$')@cw=$cw@ch= bitmap.height/4else@cw=$cw@ch= bitmap.height/8endelse
sign =@character_name[/^[\!\$]./]if sign && sign.include?('$')@cw= bitmap.width/3@ch= bitmap.height/4else@cw= bitmap.width/12@ch= bitmap.height/8endendself.ox=@cw/2self.oy=@chenddef update_position
self.x=@character.screen_x
jump =@character.jumping? ? @character.jump_height*2 : 0
alt =@character.altitude ? @character.altitude*2 : 0self.y=@character.screen_y-3+ jump + alt
enddef update_other
self.blend_type=@character.blend_typeself.visible= !@character.transparentenddef update_src_rect
if@character.reflect_sprite
index =@character.reflect_sprite[1]else
index =@character.character_indexend
sign =@character_name[/\%[\(\[](.+?)[\)\]]/]if sign && sign.include?('%')
pattern =@character.pattern<@cw ? @character.pattern : 1else
pattern =@character.pattern<3 ? @character.pattern : 1end
sx =(index %4*$emf_char_frames[0]+ pattern)*@cw#sx = (index % 4 * @cw + pattern) * @cw
sy =(index / 4 * 4 + (@character.direction - 2) /2)*@chself.src_rect.set(sx, sy,@cw,@ch)endend# Sprite_Reflect < Sprite_Character#-------------------------------------------------------------------------------# Sprite_Mirror#-------------------------------------------------------------------------------class Sprite_Mirror < Sprite_Character
def initialize(viewport, character =nil)@distance=0super(viewport, character)enddef update
superenddef update_balloon;enddef setup_new_effect;enddef set_character_bitmap
if@character.reflect_spriteself.bitmap= Cache.character(@character.reflect_sprite[0])elseself.bitmap= Cache.character(@character_name)endself.mirror=trueself.opacity=255self.z=Galv_CEffects::REFLECT_Z
sign =@character_name[/\%[\(\[](.+?)[\)\]]/]if sign && sign.include?('%')
sign =@character_name[/^[\!\$]./]if sign && sign.include?('$')@cw=$cw@ch= bitmap.height/4else@cw=$cw@ch= bitmap.height/8endelse
sign =@character_name[/^[\!\$]./]if sign && sign.include?('$')@cw=$cw#bitmap.width / 3@ch= bitmap.height/4else@cw=$cw#bitmap.width / 12@ch= bitmap.height/8endendself.ox=@cw/2self.oy=@chenddef update_src_rect
if@character.reflect_sprite
index =@character.reflect_sprite[1]else
index =@character.character_indexend
sign =@character_name[/\%[\(\[](.+?)[\)\]]/]if sign && sign.include?('%')
pattern =@character.pattern<@cw ? @character.pattern : 1else
pattern =@character.pattern<3 ? @character.pattern : 1end
sx =(index %4*$emf_char_frames[0]+ pattern)*@cw#sx = (index % 4 * 3 + pattern) * @cw
sy =(index / 4 * 4 + (10 - @character.direction - 2) /2)*@chself.src_rect.set(sx, sy,@cw,@ch)enddef get_mirror_y
20.times{|i|if$game_map.region_id(@character.x,@character.y- i)==Galv_CEffects::MIRROR_REGION@distance=(i -1)*0.05@display=@character.y- i -$game_map.display_y+$game_map.heightself.opacity=255return(@character.y- i +1-$game_map.display_y)*32- i *4end}self.opacity=0return@chenddef update_position
self.x=@character.screen_xself.y= get_mirror_y -6self.zoom_x=1-@distanceself.zoom_y=1-@distanceenddef update_other
self.blend_type=@character.blend_typeself.visible= !@character.transparentendend# Sprite_Mirror < Sprite_Character#-------------------------------------------------------------------------------# Sprite_Shadow#-------------------------------------------------------------------------------class Sprite_Shadow < Sprite_Character
def initialize(viewport, character =nil, source)@flicker=0@famount=0@aamount=0@source= source
super(viewport, character)enddef update
super
update_bitmap
update_src_rect
update_position
update_other
update_facing
enddef set_character_bitmap
self.bitmap= Cache.character(@character_name)self.color= Color.new(0,0,0,255)self.z=Galv_CEffects::SHADOW_Zself.wave_amp=1if$game_map.shadow_options[2]self.wave_speed=1000
sign =@character_name[/\%[\(\[](.+?)[\)\]]/]if sign && sign.include?('%')
sign =@character_name[/^[\!\$]./]if sign && sign.include?('$')@cw=$cw@ch= bitmap.height/4else@cw=$cw@ch= bitmap.height/8endelse
sign =@character_name[/^[\!\$]./]if sign && sign.include?('$')@cw= bitmap.width/3@ch= bitmap.height/4else@cw= bitmap.width/12@ch= bitmap.height/8endendself.ox=@cw/2self.oy=@chenddef update_position
self.x=@character.screen_xself.y=@character.screen_y-10
get_angle
enddef get_angle
x =$game_map.light_source[@source][0]-@character.real_x
y =$game_map.light_source[@source][1]-@character.real_yself.opacity=$game_map.shadow_options[0]-Math::sqrt(x * x + y * y)*$game_map.shadow_options[1]if x ==0&& y ==0||self.opacity<=0self.opacity=0elseself.angle=Math::atan2(x, y)*180/Math::PI +@aamountendenddef update_facing
if@character.y<$game_map.light_source[@source][1]self.mirror=falseelseself.mirror=trueendenddef update_other
self.blend_type=@character.blend_typeself.visible= !@character.transparentendend# Sprite_Shadow < Sprite_Character#-------------------------------------------------------------------------------# Sprite_Icon#-------------------------------------------------------------------------------class Sprite_Icon < Sprite_Character
def initialize(viewport, character =nil)@icon_sprite||= Sprite.new@icon_sprite.bitmap||= Cache.system("Iconset")@icon=nilsuper(viewport, character)enddef dispose
superif@icon_sprite@icon_sprite.dispose@icon_sprite=nilendenddef update
super
update_icon
enddef update_icon
returnif !@character.icon
draw_icon(@character.icon)enddef draw_icon(icon_index)returnif !@icon.nil?
rect = Rect.new(icon_index %16*24, icon_index /16*24,24,24)@icon_sprite.src_rect= rect
@icon= icon_index
enddef update_position
@icon_sprite.x=@character.screen_x-12@icon_sprite.y=@character.screen_y+Galv_CEffects::ICON_OFFSETenddef update_other
self.blend_type=@character.blend_type@icon_sprite.visible= !@character.transparentendend# Sprite_Icon < Sprite_Character#-------------------------------------------------------------------------------# Other Stuff#-------------------------------------------------------------------------------class Game_Character < Game_CharacterBase
attr_reader :altitude
attr_accessor :reflect
attr_accessor :reflect_sprite
attr_accessor :shadow
attr_accessor :icon
attr_accessor :icon_offsetendclass Game_Event < Game_Character
alias galv_reflect_ge_initialize initialize
def initialize(map_id, event)@reflect=false@shadow=false@icon_offset=[0,0]
galv_reflect_ge_initialize(map_id, event)endend# Game_Event < Game_Characterclass Game_Vehicle < Game_Character
attr_reader :map_idalias galv_reflect_gv_initialize initialize
def initialize(type)@reflect=true@shadow=true@icon_offset=[0,0]
galv_reflect_gv_initialize(type)endend# Game_Vehicle < Game_Characterclass Game_Follower < Game_Character
alias galv_reflect_gf_initialize initialize
def initialize(member_index, preceding_character)
galv_reflect_gf_initialize(member_index, preceding_character)@reflect=true@shadow=trueendalias galv_reflect_gf_refresh refresh
def refresh
galv_reflect_gf_refresh
returnif actor.nil?
@reflect= actor.reflect@reflect_sprite= actor.reflect_sprite@icon= actor.iconif SceneManager.scene_is?(Scene_Map)
SceneManager.scene.spriteset.refresh_effectsendendend# Game_Follower < Game_Characterclass Game_Player < Game_Character
alias galv_reflect_gp_initialize initialize
def initialize
galv_reflect_gp_initialize
@reflect=true@shadow=trueendalias galv_reflect_gp_refresh refresh
def refresh
galv_reflect_gp_refresh
@reflect= actor.reflect@reflect_sprite= actor.reflect_sprite@icon= actor.iconif SceneManager.scene_is?(Scene_Map)
SceneManager.scene.spriteset.refresh_effectsendendend# Game_Player < Game_Characterclass Scene_Map < Scene_Base
attr_accessor :spritesetend# Scene_Mapclass Game_Map
attr_accessor :char_effects
attr_accessor :light_source
attr_accessor :shadow_options
attr_accessor :reflect_optionsalias galv_reflect_game_map_initialize initialize
def initialize
@light_source=[]@shadow_options=[80,10,false]@reflect_options=[0]@char_effects=[false,false,false,false]#[reflect,shadow,mirror,icon]
galv_reflect_game_map_initialize
endalias galv_reflect_game_map_setup setup
def setup(map_id)
galv_reflect_game_map_setup(map_id)
reset_char_effects
do_all_chareffects
if SceneManager.scene_is?(Scene_Map)
SceneManager.scene.spriteset.refresh_effectsendenddef reset_char_effects
@light_source=[]@events.values.each{|e|
e.reflect=false
e.icon=nil}endend# Game_Mapclass Game_Actor < Game_Battler
attr_accessor :reflect
attr_accessor :reflect_sprite
attr_accessor :iconalias galv_reflect_game_actor_initialize initialize
def initialize(actor_id)
galv_reflect_game_actor_initialize(actor_id)@reflect=$data_actors[actor_id].reflect@reflect_sprite=$data_actors[actor_id].reflect_sprite@icon_offset=[0,0]endend# Game_Actor < Game_BattlerclassRPG::Actordef reflect_sprite
if@reflect_sprite.nil?
if@note=~/<reflect_sprite:[ ](.*),(.*)>/i@reflect_sprite=[$1.to_s,$2.to_i]else@reflect_sprite=nilendend@reflect_spriteenddef reflect
if@reflect.nil?
if@note=~/<no_reflect>/i@reflect=falseelse@reflect=trueendend@reflectendend# RPG::Actor
cortez - posté le 21/04/2015 à 17:19:52. (524 messages postés)
C'est possible mais je n'ai pas les compétences suffisante pour le faire.
Tout les niveaux de magie sont contenus dans la variable script :
$affinity_levels
#------------------------------------------------------------------------------## Galv's Character Effects#------------------------------------------------------------------------------## For: RPGMAKER VX ACE# Version 2.0#------------------------------------------------------------------------------## 2013-12-07 - Version 2.0 - Added comments to more easily add event effects# - Fixed shadow facing bug# 2013-02-24 - Version 1.9 - added z level option for reflection and shadows# 2013-02-23 - Version 1.8 - added multiple light sources for shadows# 2013-02-22 - Version 1.7 - bug fixes# 2013-02-22 - Version 1.6 - added icon effect# 2013-02-22 - Version 1.5 - fixed mirror bug on large maps# 2013-02-22 - Version 1.4 - added effects to vehicles# 2013-02-21 - Version 1.3 - fixed jump reflection and other minor tweaks# 2013-02-21 - Version 1.2 - bug with less than 4 actors (oops)# 2013-02-21 - Version 1.1 - updated flicker effect# 2013-02-21 - Version 1.0 - release#------------------------------------------------------------------------------## This script was made to provide some additional effects for characters such# as events, followers and the player on the map.# Currently it includes:## Shadows# Shadows that appear under player and events in a directions depending on# a light source that you choose.## Parallax Reflect# Reflections that appear on the parallax layer for events and actors to be# used for things like reflections in the water or glass floor etc. To get# effects like the demo, you need to edit the charset graphic to make the water# partially transparent.## Parallax Mirrors# Much like reflect but are instead actors and event are reflected in a mirror# on a wall designated by a region. Both mirror and reflect effects can be# changed so actors and events can use different charsets for their reflections##------------------------------------------------------------------------------##------------------------------------------------------------------------------## NEW - First event command as a COMMENT#------------------------------------------------------------------------------## You can add a comment as the first event command on an event page to set if# that event has an icon, shadow or reflection active. The tags to use are# below, all must be on the same line in the comment.## <icon:id,x,y> # set the event to display an icon (x,y position offset)# <shadow> # set the event to display a shadow# <reflect> # set the event to display reflections##------------------------------------------------------------------------------## EXAMPLE:# <icon:1,0,0><shadow><reflect> # to show reflect, shadow and icon 1 on event#------------------------------------------------------------------------------##------------------------------------------------------------------------------## SCRIPT CALLS:#------------------------------------------------------------------------------### char_effects(x,x,x,status)##------------------------------------------------------------------------------## # each effect can be true or false to enable/disable them during the game.# # you can change multiples of effects at once, x being the effect number# # 0 = reflect 1 = shadows 2 = mirror 3 = icons#------------------------------------------------------------------------------## EXAMPLES:# char_effects(0,true) # turn reflections on# char_effects(0,2,true) # turn reflections and mirror on# char_effects(1,3,false) # turn shadows and icons off#------------------------------------------------------------------------------### reflect_sprite(actor_id,filename,pos) # Change actor's reflect charset## reflect_esprite(event_id,filename,pos) # Change event's reflect charset## reflect_vsprite(vehicle_id,filename,pos) # Change vehicle's reflect charset##------------------------------------------------------------------------------## EXAMPLES:# reflect_sprite(1,"Actor2",2) # change actor 1's charset to use sprite# # in position 2 of "Actor2" charset.# reflect_esprite(3,"Actor4",5) # event 3 will use sprite in position 5 of# # "Actor4" charset.# reflect_vsprite(1,"Vehicle",5) # Ship will use sprite in position 5 of# # "Vehicle" charset.#------------------------------------------------------------------------------##------------------------------------------------------------------------------## SCRIPT CALLS to turn effects ON or OFF for chosen EVENTS#------------------------------------------------------------------------------### reflect(x,x,x,status) # status can be true or false to turn on or off# # use this to specify for mirror and reflect.# shadow(x,x,x,status) # where x is the event ids you want to change# # to change all events use :all# icon(x,x,x,icon_id) # set which icon id to appear above character. Make# # it 0 for no icon.##------------------------------------------------------------------------------## EXAMPLES:# reflect(14,17,3,1,true) # Turn events 14, 17, 3 and 1 reflections ON# shadow(1,false) # Turn event 1 shadow OFF# reflect(:all,true) # Turn all event reflections ON# icon(1,2,3,4,38) # Events 1,2,3 and 4 will have icon 38 appear## NOTE: All events will default to NO shadows and NO reflections when entering# a map. This is a design decision to try to keep lag to a minimum. You# should use these effects sparingly and only activate them on events# that require them.#------------------------------------------------------------------------------##------------------------------------------------------------------------------## SCRIPT CALLS to turn effects ON or OFF for ACTORS and VEHICLES#------------------------------------------------------------------------------### actor_reflect(actor_id,status) # reflections and shadows are ON by default # actor_shadow(actor_id,status) # for actors and vehicles. Turning them off # actor_icon(actor_id,icon_id) # or on will permanently change them.## v_reflect(x,x,x,status) # use these v_ calls for changing vehicle effects# v_shadow(x,x,x,status) # on and off for vehicles.# v_icon(x,x,x,icon_id)##------------------------------------------------------------------------------##------------------------------------------------------------------------------## SCRIPT CALLS for shadow options#------------------------------------------------------------------------------### shadow_source(x,y,id) # set the x,y location for the light. id is the # # light source number you wish to change (for# # more than one). These are reset on map change.# shadow_source(event_id,id) # use an event's x,y location for the light.# # This will need to be in parallel process if you# # want it to be a moving light.## shadow_options(intensity,fade,flicker) # descriptions below## # intensity = opacity when standing next to the light source (255 is black)# # fade = amount shadow becomes more transparent the further away you are.# # flicker = true or false. Shadows will flicker as if being cast by fire.##------------------------------------------------------------------------------## EXAMPLE:# shadow_options(80,10,false) # This is the default setting.#------------------------------------------------------------------------------##------------------------------------------------------------------------------## SCRIPT CALLS for reflect options#------------------------------------------------------------------------------### reflect_options(wave_pwr) ## # wave_pwr = how strong the wave movement is. 0 is off##------------------------------------------------------------------------------## EXAMPLE:# reflect_options(1) # Turn wave power to 1#------------------------------------------------------------------------------##------------------------------------------------------------------------------## NOTETAG for ACTORS#------------------------------------------------------------------------------### <no_reflect> # Actor will not have a reflection (for vampires of course!)## <reflect_sprite: FileName,pos> # Actor will use this charset for reflections# # and use the character in position 'pos'##------------------------------------------------------------------------------## EXAMPLES:# <reflect_sprite: Actor2,0> # The first character from Actor2 charset# <reflect_sprite: Actor3,7> # The last character from Actor2 charset#------------------------------------------------------------------------------#($imported ||={})["Galv_Character_Effects"]=truemodule Galv_CEffects
#------------------------------------------------------------------------------# # SETUP OPTIONS#------------------------------------------------------------------------------#
MIRROR_REGION =4# Region ID used to determine mirror walls. Paint the# region on the wall you want to make reflective (and# then use tiles/mapping that make the parallax visible)
ICON_OFFSET =-60# Y offset for icons that are displayed above characters
REFLECT_Z =-10# Z level of reflections
SHADOW_Z =0# Z level of shadows#------------------------------------------------------------------------------# # END SETUP OPTIONS#------------------------------------------------------------------------------#endclass Game_Map
def do_icons(refresh =true)@events.values.each{|e|nextif !e.listif e.list[0].code==108&& e.list[0].parameters[0]=~/<icon:(.*),(.*),(.*)>/
e.icon= $1.to_i
e.icon_offset=[$2.to_i,$3.to_i]else
e.icon=0
e.icon_offset=[0,0]end}
SceneManager.scene.spriteset.refresh_effectsif refresh
enddef do_shadows(refresh =true)@events.values.each{|e|nextif !e.listif e.list[0].code==108&& e.list[0].parameters[0]=~/<shadow>/
e.shadow=trueelse
e.shadow=falseend}
SceneManager.scene.spriteset.refresh_effectsif refresh
enddef do_reflects(refresh =true)@events.values.each{|e|nextif !e.listif e.list[0].code==108&& e.list[0].parameters[0]=~/<reflect>/
e.reflect=trueelse
e.reflect=falseend}
SceneManager.scene.spriteset.refresh_effectsif refresh
enddef do_all_chareffects
do_icons(false)
do_shadows(false)
do_reflects(false)endend# Game_Mapclass Game_Interpreter
def remove_icon
icon(@event_id,0)end#-----------------------------------## REFLECTIONS#-----------------------------------## Add/Remove Reflections from selected eventsdef reflect(*args,status)
char_ids =[*args]if char_ids ==[:all]$game_map.events.values.each{|e| e.reflect= status }else
char_ids.each{|c|$game_map.events[c].reflect= status }end
SceneManager.scene.spriteset.refresh_effectsend# Change forever actor's reflect statusdef actor_reflect(actor_id,status)$game_actors[actor_id].reflect= status
$game_player.refreshend# Change forever vehicle's reflect statusdef v_reflect(*args,status)
char_ids =[*args]if char_ids ==[:all]$game_map.vehicles.each{|v| v.reflect= status }else
char_ids.each{|v|$game_map.vehicles[v].reflect= status }end
SceneManager.scene.spriteset.refresh_effectsenddef reflect_options(*args)$game_map.reflect_options=[*args]
SceneManager.scene.spriteset.refresh_effectsend# Actor reflect sprite changedef reflect_sprite(actor_id,filename,pos)$game_actors[actor_id].reflect_sprite=[filename,pos]$game_player.refreshend# Event reflect sprite changedef reflect_esprite(event_id,filename,pos)$game_map.events[event_id].reflect_sprite=[filename,pos]$game_map.events[event_id].reflect=true
SceneManager.scene.spriteset.refresh_charactersend# Vehicle reflect sprite changedef reflect_vsprite(v_id,filename,pos)$game_map.vehicles[v_id].reflect_sprite=[filename,pos]
SceneManager.scene.spriteset.refresh_charactersend#-----------------------------------## SHADOWS#-----------------------------------## Add/Remove Shadows from selected charactersdef shadow(*args,status)
char_ids =[*args]if char_ids ==[:all]$game_map.events.values.each{|e| e.shadow= status }else
char_ids.each{|c|$game_map.events[c].shadow= status }end
SceneManager.scene.spriteset.refresh_effectsend# Change player and follower shadowsdef actor_shadows(status)$game_player.shadow= status
$game_player.followers.each{|f| f.shadow= status }
SceneManager.scene.spriteset.refresh_effectsend# Change vehicle's shadow statusdef v_shadow(*args,status)
char_ids =[*args]if char_ids ==[:all]$game_map.vehicles.each{|v| v.shadow= status }else
char_ids.each{|v|$game_map.vehicles[v].shadow= status }end
SceneManager.scene.spriteset.refresh_effectsenddef shadow_options(*args)$game_map.shadow_options=[*args]
SceneManager.scene.spriteset.refresh_effectsenddef shadow_source(*args,shad_id)
shadsource =[*args]if shadsource.count==1$game_map.light_source[shad_id]=[$game_map.events[shadsource[0]].real_x,$game_map.events[shadsource[0]].real_y]elsif shadsource.count>1$game_map.light_source[shad_id]= shadsource
else$game_map.light_source=[]endend#-----------------------------------## ICONS#-----------------------------------## Add/Remove Icons from selected eventsdef icon(*args,icon_id)
char_ids =[*args]if char_ids ==[:all]$game_map.events.values.each{|e|if e.icon<=0
e.icon=nilelse
e.icon= icon_id
end}else
char_ids.each{|c|$game_map.events[c].icon= icon_id }end
SceneManager.scene.spriteset.refresh_effectsend# Change forever actor's icondef actor_icon(actor_id,icon_id)$game_actors[actor_id].icon= icon_id
$game_player.refreshend# Change forever vehicle's icondef v_icon(*args,icon_id)
char_ids =[*args]if char_ids ==[:all]$game_map.vehicles.each{|v| v.icon= icon_id }else
char_ids.each{|v|$game_map.vehicles[v].icon= icon_id }end
SceneManager.scene.spriteset.refresh_effectsend#-----------------------------------## GENERAL#-----------------------------------## Turn on/off effects# 0 = reflect# 1 = shadow# 2 = mirror# 3 = icondef char_effects(*args,status)[*args].each{|e|$game_map.char_effects[e]= status }
SceneManager.scene.spriteset.refresh_effectsendend# Game_Interpreter#-------------------------------------------------------------------------------# Spriteset_Map#-------------------------------------------------------------------------------class Spriteset_Map
alias galv_reflect_sm_initialize initialize
def initialize
create_effects
galv_reflect_sm_initialize
refresh_characters
endalias galv_reflect_sm_refresh_characters refresh_characters
def refresh_characters
galv_reflect_sm_refresh_characters
create_effects
enddef refresh_effects
dispose_effects
create_effects
enddef create_effects
@shadow_sprites=[]@reflect_sprites=[]@mirror_sprites=[]@icon_sprites=[]# Do reflectionsif$game_map.char_effects[0]$game_map.events.values.each{|e|@reflect_sprites.push(Sprite_Reflect.new(@viewport1, e))if e.reflect}$game_player.followers.each{|f|@reflect_sprites.push(Sprite_Reflect.new(@viewport1, f))if f.reflect}if$game_player.reflect@reflect_sprites.push(Sprite_Reflect.new(@viewport1,$game_player))end$game_map.vehicles.each{|v|@reflect_sprites.push(Sprite_Reflect.new(@viewport1, v))if v.reflect}end# Do mirrorsif$game_map.char_effects[2]$game_map.events.values.each{|e|@mirror_sprites.push(Sprite_Mirror.new(@viewport1, e))if e.reflect}$game_player.followers.each{|f|@mirror_sprites.push(Sprite_Mirror.new(@viewport1, f))if f.reflect}if$game_player.reflect@mirror_sprites.push(Sprite_Mirror.new(@viewport1,$game_player))end$game_map.vehicles.each{|v|@mirror_sprites.push(Sprite_Mirror.new(@viewport1, v))if v.reflect}end# Do Shadowsif$game_map.char_effects[1]returnif$game_map.light_source.empty?
$game_map.light_source.count.times{|s|$game_map.events.values.each{|e|@shadow_sprites.push(Sprite_Shadow.new(@viewport1, e, s))if e.shadow}$game_player.followers.each{|f|@shadow_sprites.push(Sprite_Shadow.new(@viewport1, f, s))if f.shadow}if$game_player.shadow@shadow_sprites.push(Sprite_Shadow.new(@viewport1,$game_player, s))end$game_map.vehicles.each{|v|@shadow_sprites.push(Sprite_Shadow.new(@viewport1, v, s))if v.shadow}}end# Do iconsif$game_map.char_effects[3]$game_map.events.values.each{|e|@icon_sprites.push(Sprite_Icon.new(@viewport1, e))if e.icon}$game_player.followers.each{|f|@icon_sprites.push(Sprite_Icon.new(@viewport1, f))if f.icon}if$game_player.icon@icon_sprites.push(Sprite_Icon.new(@viewport1,$game_player))end$game_map.vehicles.each{|v|@icon_sprites.push(Sprite_Icon.new(@viewport1, v))if v.icon}endendalias galv_reflect_sm_update update
def update
galv_reflect_sm_update
@reflect_sprites.each{|s| s.update}if$game_map.char_effects[0]@mirror_sprites.each{|s| s.update}if$game_map.char_effects[2]@shadow_sprites.each{|s| s.update}if$game_map.char_effects[1]@icon_sprites.each{|s| s.update}if$game_map.char_effects[3]endalias galv_reflect_sm_dispose_characters dispose_characters
def dispose_characters
galv_reflect_sm_dispose_characters
dispose_effects
enddef dispose_effects
@reflect_sprites.each{|s| s.dispose}@shadow_sprites.each{|s| s.dispose}@mirror_sprites.each{|s| s.dispose}@icon_sprites.each{|s| s.dispose}endend# Spriteset_Map#-------------------------------------------------------------------------------# Sprite_Reflect #-------------------------------------------------------------------------------class Sprite_Reflect < Sprite_Character
def initialize(viewport, character =nil)super(viewport, character)enddef update
superenddef update_balloon;enddef setup_new_effect;enddef set_character_bitmap
if@character.reflect_spriteself.bitmap= Cache.character(@character.reflect_sprite[0])elseself.bitmap= Cache.character(@character_name)endself.mirror=trueself.angle=180self.opacity=220self.z=Galv_CEffects::REFLECT_Zself.wave_amp=$game_map.reflect_options[0]
sign =@character_name[/\%[\(\[](.+?)[\)\]]/]if sign && sign.include?('%')
sign =@character_name[/^[\!\$]./]if sign && sign.include?('$')@cw=$cw@ch= bitmap.height/4else@cw=$cw@ch= bitmap.height/8endelse
sign =@character_name[/^[\!\$]./]if sign && sign.include?('$')@cw= bitmap.width/3@ch= bitmap.height/4else@cw= bitmap.width/12@ch= bitmap.height/8endendself.ox=@cw/2self.oy=@chenddef update_position
self.x=@character.screen_x
jump =@character.jumping? ? @character.jump_height*2 : 0
alt =@character.altitude ? @character.altitude*2 : 0self.y=@character.screen_y-3+ jump + alt
enddef update_other
self.blend_type=@character.blend_typeself.visible= !@character.transparentenddef update_src_rect
if@character.reflect_sprite
index =@character.reflect_sprite[1]else
index =@character.character_indexend
sign =@character_name[/\%[\(\[](.+?)[\)\]]/]if sign && sign.include?('%')
pattern =@character.pattern<@cw ? @character.pattern : 1else
pattern =@character.pattern<3 ? @character.pattern : 1end
sx =(index %4*3+ pattern)*@cw
sy =(index / 4 * 4 + (@character.direction - 2) /2)*@chself.src_rect.set(sx, sy,@cw,@ch)endend# Sprite_Reflect < Sprite_Character#-------------------------------------------------------------------------------# Sprite_Mirror#-------------------------------------------------------------------------------class Sprite_Mirror < Sprite_Character
def initialize(viewport, character =nil)@distance=0super(viewport, character)enddef update
superenddef update_balloon;enddef setup_new_effect;enddef set_character_bitmap
if@character.reflect_spriteself.bitmap= Cache.character(@character.reflect_sprite[0])elseself.bitmap= Cache.character(@character_name)endself.mirror=trueself.opacity=255self.z=Galv_CEffects::REFLECT_Z
sign =@character_name[/\%[\(\[](.+?)[\)\]]/]if sign && sign.include?('%')
sign =@character_name[/^[\!\$]./]if sign && sign.include?('$')@cw=$cw@ch= bitmap.height/4else@cw=$cw@ch= bitmap.height/8endelse
sign =@character_name[/^[\!\$]./]if sign && sign.include?('$')@cw= bitmap.width/3@ch= bitmap.height/4else@cw= bitmap.width/12@ch= bitmap.height/8endendself.ox=@cw/2self.oy=@chenddef update_src_rect
if@character.reflect_sprite
index =@character.reflect_sprite[1]else
index =@character.character_indexend
sign =@character_name[/\%[\(\[](.+?)[\)\]]/]if sign && sign.include?('%')
pattern =@character.pattern<@cw ? @character.pattern : 1else
pattern =@character.pattern<3 ? @character.pattern : 1end
sx =(index %4*3+ pattern)*@cw
sy =(index / 4 * 4 + (10 - @character.direction - 2) /2)*@chself.src_rect.set(sx, sy,@cw,@ch)enddef get_mirror_y
20.times{|i|if$game_map.region_id(@character.x,@character.y- i)==Galv_CEffects::MIRROR_REGION@distance=(i -1)*0.05@display=@character.y- i -$game_map.display_y+$game_map.heightself.opacity=255return(@character.y- i +1-$game_map.display_y)*32- i *4end}self.opacity=0return@chenddef update_position
self.x=@character.screen_xself.y= get_mirror_y -6self.zoom_x=1-@distanceself.zoom_y=1-@distanceenddef update_other
self.blend_type=@character.blend_typeself.visible= !@character.transparentendend# Sprite_Mirror < Sprite_Character#-------------------------------------------------------------------------------# Sprite_Shadow#-------------------------------------------------------------------------------class Sprite_Shadow < Sprite_Character
def initialize(viewport, character =nil, source)@flicker=0@famount=0@aamount=0@source= source
super(viewport, character)enddef update
super
update_bitmap
update_src_rect
update_position
update_other
update_facing
enddef set_character_bitmap
self.bitmap= Cache.character(@character_name)self.color= Color.new(0,0,0,255)self.z=Galv_CEffects::SHADOW_Zself.wave_amp=1if$game_map.shadow_options[2]self.wave_speed=1000
sign =@character_name[/\%[\(\[](.+?)[\)\]]/]if sign && sign.include?('%')
sign =@character_name[/^[\!\$]./]if sign && sign.include?('$')@cw=$cw@ch= bitmap.height/4else@cw=$cw@ch= bitmap.height/8endelse
sign =@character_name[/^[\!\$]./]if sign && sign.include?('$')@cw= bitmap.width/3@ch= bitmap.height/4else@cw= bitmap.width/12@ch= bitmap.height/8endendself.ox=@cw/2self.oy=@chenddef update_position
self.x=@character.screen_xself.y=@character.screen_y-10
get_angle
enddef get_angle
x =$game_map.light_source[@source][0]-@character.real_x
y =$game_map.light_source[@source][1]-@character.real_yself.opacity=$game_map.shadow_options[0]-Math::sqrt(x * x + y * y)*$game_map.shadow_options[1]if x ==0&& y ==0||self.opacity<=0self.opacity=0elseself.angle=Math::atan2(x, y)*180/Math::PI +@aamountendenddef update_facing
if@character.y<$game_map.light_source[@source][1]self.mirror=falseelseself.mirror=trueendenddef update_other
self.blend_type=@character.blend_typeself.visible= !@character.transparentendend# Sprite_Shadow < Sprite_Character#-------------------------------------------------------------------------------# Sprite_Icon#-------------------------------------------------------------------------------class Sprite_Icon < Sprite_Character
def initialize(viewport, character =nil)@icon_sprite||= Sprite.new@icon_sprite.bitmap||= Cache.system("Iconset")@icon=nilsuper(viewport, character)enddef dispose
superif@icon_sprite@icon_sprite.dispose@icon_sprite=nilendenddef update
super
update_icon
enddef update_icon
returnif !@character.icon
draw_icon(@character.icon)enddef draw_icon(icon_index)returnif !@icon.nil?
rect = Rect.new(icon_index %16*24, icon_index /16*24,24,24)@icon_sprite.src_rect= rect
@icon= icon_index
enddef update_position
@icon_sprite.x=@character.screen_x-12@icon_sprite.y=@character.screen_y+Galv_CEffects::ICON_OFFSETenddef update_other
self.blend_type=@character.blend_type@icon_sprite.visible= !@character.transparentendend# Sprite_Icon < Sprite_Character#-------------------------------------------------------------------------------# Other Stuff#-------------------------------------------------------------------------------class Game_Character < Game_CharacterBase
attr_reader :altitude
attr_accessor :reflect
attr_accessor :reflect_sprite
attr_accessor :shadow
attr_accessor :icon
attr_accessor :icon_offsetendclass Game_Event < Game_Character
alias galv_reflect_ge_initialize initialize
def initialize(map_id, event)@reflect=false@shadow=false@icon_offset=[0,0]
galv_reflect_ge_initialize(map_id, event)endend# Game_Event < Game_Characterclass Game_Vehicle < Game_Character
attr_reader :map_idalias galv_reflect_gv_initialize initialize
def initialize(type)@reflect=true@shadow=true@icon_offset=[0,0]
galv_reflect_gv_initialize(type)endend# Game_Vehicle < Game_Characterclass Game_Follower < Game_Character
alias galv_reflect_gf_initialize initialize
def initialize(member_index, preceding_character)
galv_reflect_gf_initialize(member_index, preceding_character)@reflect=true@shadow=trueendalias galv_reflect_gf_refresh refresh
def refresh
galv_reflect_gf_refresh
returnif actor.nil?
@reflect= actor.reflect@reflect_sprite= actor.reflect_sprite@icon= actor.iconif SceneManager.scene_is?(Scene_Map)
SceneManager.scene.spriteset.refresh_effectsendendend# Game_Follower < Game_Characterclass Game_Player < Game_Character
alias galv_reflect_gp_initialize initialize
def initialize
galv_reflect_gp_initialize
@reflect=true@shadow=trueendalias galv_reflect_gp_refresh refresh
def refresh
galv_reflect_gp_refresh
@reflect= actor.reflect@reflect_sprite= actor.reflect_sprite@icon= actor.iconif SceneManager.scene_is?(Scene_Map)
SceneManager.scene.spriteset.refresh_effectsendendend# Game_Player < Game_Characterclass Scene_Map < Scene_Base
attr_accessor :spritesetend# Scene_Mapclass Game_Map
attr_accessor :char_effects
attr_accessor :light_source
attr_accessor :shadow_options
attr_accessor :reflect_optionsalias galv_reflect_game_map_initialize initialize
def initialize
@light_source=[]@shadow_options=[80,10,false]@reflect_options=[0]@char_effects=[false,false,false,false]#[reflect,shadow,mirror,icon]
galv_reflect_game_map_initialize
endalias galv_reflect_game_map_setup setup
def setup(map_id)
galv_reflect_game_map_setup(map_id)
reset_char_effects
do_all_chareffects
if SceneManager.scene_is?(Scene_Map)
SceneManager.scene.spriteset.refresh_effectsendenddef reset_char_effects
@light_source=[]@events.values.each{|e|
e.reflect=false
e.icon=nil}endend# Game_Mapclass Game_Actor < Game_Battler
attr_accessor :reflect
attr_accessor :reflect_sprite
attr_accessor :iconalias galv_reflect_game_actor_initialize initialize
def initialize(actor_id)
galv_reflect_game_actor_initialize(actor_id)@reflect=$data_actors[actor_id].reflect@reflect_sprite=$data_actors[actor_id].reflect_sprite@icon_offset=[0,0]endend# Game_Actor < Game_BattlerclassRPG::Actordef reflect_sprite
if@reflect_sprite.nil?
if@note=~/<reflect_sprite:[ ](.*),(.*)>/i@reflect_sprite=[$1.to_s,$2.to_i]else@reflect_sprite=nilendend@reflect_spriteenddef reflect
if@reflect.nil?
if@note=~/<no_reflect>/i@reflect=falseelse@reflect=trueendend@reflectendend# RPG::Actor
cortez - posté le 20/04/2015 à 23:20:18. (524 messages postés)
Reprends un script de reflet neuf et on vas le modifier.
Une fois la modification faite, teste juste l'affichage du
mirroir seul sans les autres effets, Et dis moi ce que tu
obtiens.
Je pense que mon erreur est corrigée, maintenant les
arguments de "frames" sont tous définis.
cortez - posté le 20/04/2015 à 21:08:21. (524 messages postés)
Eh bien tu as ta réponse, les différents scripts de combats que tu possède
bloquent l'utilisation de celui des magie.
Plus exactement les formules de dégats magiques des scripts de combats
réécrivent par dessus la modification que celui de Raizen fait. Du coup :
+1 - 1 = 0 il ne fonctionne pas.
Je ne vais pas chercher plus loin pour trouver une solution, car il me faudrait
chercher dans les scripts indiqués chaque formule de dégats et effectuer des
changements à chaque fois. Essaye donc de t'en passer ou de trouver une
version différente qui fonctionne.
Tu peux aussi le faire manuellement.
Dans chaque sort élémentaire, tu crée une formule de dégat dans la zone
de droite. [exemple Boule de feu : v[20] / 10 +1 * a.mat]
Ainsi la magie que j'ai crée dépend du niveau de magie du héro (a.mat) et
d'une variable la n°20.
Si un objet [cristal de feu] ajoute +1 à la variable 20, je gagne donc 1 lvl de
magie de feu et le sort "Boule de feu" gagne 10% de dégats en plus.
Il suffit de copier coller dans chaque magie en changeant la variable selon
l'élément. n°20 pour le feu, 21 pour l'eau ...
Et pour afficher le niveau des magies. On fait 1 Png ou un objet qui affiche
un texte ou des images avec le niveau de chaque magie (selon les variables.)
cortez - posté le 20/04/2015 à 10:33:57. (524 messages postés)
Pour que l'on comprennent tout sur ton problème, explique nous aussi quel système
de combat tu utilises. Celui par défaut ? As tu ajoutés un script de combat ?
Puisque sur un projet de base, son script fonctionne, le problème vient d'ailleurs.
Tu dis attaque, tu parle d'une attaque d'une arme ou d'une magie ?
Parce que le script précise une option pour les armes mais il faut l'activer.
#On récupère le nombres frames du personnage
character_name =""unless character_name
frames = !character_name[/\%[\(\[](.+?)[\)\]]/] ? [] :
$1.scan(/\d+/).collect{|s| s.to_i}
frames[0]=3unless frames[0]# If empty, then set to default 3
frames.push(1,2,1,0)if frames[0]==3&& frames.size<2
frames[1]=0unless frames[1]# Set idle frameif frames.size<3# Create pattern (frames[0]-1).times{|i| frames.push((frames[1]+ i +1)% frames[0])}endreturn frames
sign =@character_name[/^[\!\$]./]if sign && sign.include?('$')if frames ==3# Uniquement si le charset est de 3 frames.@cw= bitmap.width/3@ch= bitmap.height/4else# Pour les charset de plus de 3 frames.@cw= bitmap.width/(frames[0] ? frames[0] : 3)@ch= bitmap.height/4endelse@cw= bitmap.width/(frames[0] ? frames[0] : 3)@ch= bitmap.height/4@cw/=4@ch/=2endself.ox=@cw/2self.oy=@ch
Le problème venais du fait que tu as placé les chara en planche donc avec la
modification tout devrais marcher.
#On récupère le nombres frames du personnage
character_name =""unless character_name
frames = !character_name[/\%[\(\[](.+?)[\)\]]/] ? [] :
$1.scan(/\d+/).collect{|s| s.to_i}
frames[0]=3unless frames[0]# If empty, then set to default 3
frames.push(1,2,1,0)if frames[0]==3&& frames.size<2
frames[1]=0unless frames[1]# Set idle frameif frames.size<3# Create pattern (frames[0]-1).times{|i| frames.push((frames[1]+ i +1)% frames[0])}endreturn frames
sign =@character_name[/^[\!\$]./]if sign && sign.include?('$')if frames ==3# Uniquement si le charset est de 3 frames.@cw= bitmap.width/3@ch= bitmap.height/4else# Pour les charset de plus de 3 frames.@cw= bitmap.width/(frames[0] ? frames[0] : 3)@ch= bitmap.height/4endelse@cw= bitmap.width/12@ch= bitmap.height/8endself.ox=@cw/2self.oy=@ch
Cette manipulation devrait fonctionner. Si s'est le cas tu peux aussi faire le même remplacement dans la Classe Reflect (ligne 577) et la Classe Shadow (ligne 723)
Le principe est simple, c'est aux endroits que j'ai indiqué que je script reflect & Co
calcule la taille des frames du reflet/ombre/mirroir donc si j’introduis le calcul d'
extra frames dans ces méthodes, on obtient logiquement un bon découpage.