Rpg˛S Forum uses cookies. Read the Privacy Policy for more info. To remove this message, please click the button to the right:    I accept the use of cookies

Vai al contenuto

Rpg˛S Forum uses cookies. Read the Privacy Policy for more info. To remove this message, please click the button to the right:    I accept the use of cookies

Screen Contest #90

Kamikun






  • Si prega di effettuare il log in prima di rispondere
Modifica Script HP Barrier

    Grawel
  • Elfo di Babbo Natale

  • Utenti
  • Rens: 16
  • 2
  • StellettaStellettaStelletta
  • 451 messaggi
  • Sesso:Maschio
  • Provenienza:Lago maggiore
  • Abilitā:Esperto

#1 Inviato 21 December 2016 - 14:36 PM

CIao a tutti vorrei uno script simile a questo ma con qualche variante anche perchè questo ha dei punti deboli che non mi piacciono molto.

Spoiler

Ma vorrei Apportargli qualche modifica.

La prima e più importante deve funzionare anche con un vecchio salvataggio...credo serva un re_init ma non so bene come si faccia.
Vorrei che al termine di ogni battaglia lo scudo termini.

Vorrei che non si vedi la barra nel menu principale, mentre quella durante il combattimento deve comparire solo quando viene applicato lo scudo.

Il valore dello scudo va bene di colore verde ma vorrei che si vedesse solo quello e non la somma con la vita attuale.

Inoltre vorrei che lo scudo non fosse soggetto alle skill di recupero vita o di rigene o altro in generale...per caricare lo scudo andrebbe rilanciato(cosa che si deve poter fare (attualmente non funziona)).

La barra della vita deve rimanere al valore che era al momento del lancio dello scudo (invece con questo script quando si lancia lo scudo non so perchè la barra della vita viene riempita (sembrerebbe solo a livello grafico)).

Poi questo scudo ha un bug esempio scudo ha ancora 100 punti e ho 2000 di vita il nemico attacca con un attaccoo da 200

attualmente lo scudo scende a 0 e la vita va 2000 con il successivo attacco comincerà ascendere la vita, io invee vorrei che se ho 100 punti allo scudo e 2000 di vita con un attacco da 200 vado subito a 1900 di vita e perdo lo scudo.

Inoltre sarebbe fantastico se lo scudo potesse essere inserito all'inizio di ogni battaglia con un equip.

(ossia stesso tag su un equip e se ho equipaggiato quell' equip a inizio battaglia mi mette automaticamene lo scudo con il valore specificato nel tag, ovviamente lo scudo verrà applicato solo a inizio battaglia)

Spero di essere stato chiaro e spero che qualcuno abbia voglia di aiutarmi :)

Grazie :)


Modificato da Grawel, 21 December 2016 - 17:50 PM.


    Guardian of Irael
  • Coniglietto Rosso

  • Rpg˛S Admin
  • Rens: 195
  • 19
  • StellettaStellettaStellettaStellettaStellettaStelletta
  • 58413 messaggi
  • Sesso:Maschio
  • Provenienza:Bagnaia (Viterbo)
  • Abilitā:Apprendista


#2 Inviato 21 December 2016 - 14:40 PM

@Grawel: se devi cambiare sezione e titolo (la seconda puoi farla anche in un topic già creato) chiedi allo staff, non creare topic doppioni che creano solo confusione ed appesantiscono il forum. Elimino il topic dillà, ok? ^ ^

 

Non sono richieste semplici, abbastanza complesse, non sarà facile trovare uno scripter esperto disponibile a stravolgere il tutto così tanto! > <


(\_/)
(^ ^) <----coniglietto rosso, me!     
(> <)

 
Il mio Tumblr dove seguire i miei progetti, i progetti della Reverie : : Project ^ ^
 
KdUDtQt.png disponibile su Google Play, qui i dettagli! ^ ^
 
FwnGMI3.png completo! Giocabile online, qui i dettagli! ^ ^  
 
REVERIE : : RENDEZVOUS (In allenamento per apprendere le buone arti prima di cominciarlo per bene ^ ^) Trovate i dettagli qui insieme alla mia intervista (non utilizzerò più rpgmaker) ^ ^

Spoiler


    Grawel
  • Elfo di Babbo Natale

  • Utenti
  • Rens: 16
  • 2
  • StellettaStellettaStelletta
  • 451 messaggi
  • Sesso:Maschio
  • Provenienza:Lago maggiore
  • Abilitā:Esperto

#3 Inviato 21 December 2016 - 15:48 PM

Si scusami Guardian non sapevo come spostarlo credo che questa sezzione sia più adatta...cmq non mi sembra complessissima come modifica io purtroppo non me la cavo per niente con ruby, ho provato a fargli io qualche modifica ma non ho ottenuti i risultati che volevo, anche se in realta due punti non li ho messi perchè li ho risolti io.



    Guardian of Irael
  • Coniglietto Rosso

  • Rpg˛S Admin
  • Rens: 195
  • 19
  • StellettaStellettaStellettaStellettaStellettaStelletta
  • 58413 messaggi
  • Sesso:Maschio
  • Provenienza:Bagnaia (Viterbo)
  • Abilitā:Apprendista


#4 Inviato 21 December 2016 - 15:52 PM

Nessun problema, la prossima volta ricorda di chiedere! ^ ^

A sé ogni modifica non dovrebbe essere così complessa, ma son tante richieste che sconvolgono lo script se sommate, un po' di maneggiamento ci vuole. Magari trovi qualcuno in grado di fare anche solo qualche punto utile. Vediamo.

^ ^


(\_/)
(^ ^) <----coniglietto rosso, me!     
(> <)

 
Il mio Tumblr dove seguire i miei progetti, i progetti della Reverie : : Project ^ ^
 
KdUDtQt.png disponibile su Google Play, qui i dettagli! ^ ^
 
FwnGMI3.png completo! Giocabile online, qui i dettagli! ^ ^  
 
REVERIE : : RENDEZVOUS (In allenamento per apprendere le buone arti prima di cominciarlo per bene ^ ^) Trovate i dettagli qui insieme alla mia intervista (non utilizzerò più rpgmaker) ^ ^

Spoiler


    Grawel
  • Elfo di Babbo Natale

  • Utenti
  • Rens: 16
  • 2
  • StellettaStellettaStelletta
  • 451 messaggi
  • Sesso:Maschio
  • Provenienza:Lago maggiore
  • Abilitā:Esperto

#5 Inviato 29 December 2016 - 15:17 PM

Rianalizzando bene lo script penso che se fosse uno stato sarebbe decisamente più facile da sfruttare :)



    Holy87
  • Prode Guerriero

  • Rpg˛S Staff
  • Rens: 458
  • 6
  • StellettaStellettaStellettaStellettaStellettaStelletta
  • 7431 messaggi
  • Sesso:Maschio
  • Provenienza:San Giorgio a Cremano
  • Abilitā:Maestro

#6 Inviato 29 December 2016 - 22:51 PM

Ho modificato lo script, te l'ho mandato via PM.

"Io non volevo solo partecipare alle discussioni. Volevo avere il potere di farle fallire" [cit.]

BannerOverdrive35.png
Cap3.png

578.png
 

Miei script per RPG Maker VX Ace:

Spoiler

 
I miei tutorial:
Spoiler

    Holy87
  • Prode Guerriero

  • Rpg˛S Staff
  • Rens: 458
  • 6
  • StellettaStellettaStellettaStellettaStellettaStelletta
  • 7431 messaggi
  • Sesso:Maschio
  • Provenienza:San Giorgio a Cremano
  • Abilitā:Maestro

#7 Inviato 03 January 2017 - 21:21 PM

Script modificato:

=begin
==============================================================================
 ** HP Shield
 Author: Hime
 Version: 1.0
 Date: May 20, 2012
------------------------------------------------------------------------------
 ** Change log
 1.0 May 20
   -Initial release
------------------------------------------------------------------------------
 This script allows you to give an actor "hp shields", which increases the
 amount of damage that a user can take.
 When HP shields are enabled, the shield will take the damage while
 the user's HP is protected.
 To give an item or skill HP shield effect, tag them with
    <shp: n>
 Where n is an integer
==============================================================================
=end
$imported = {} if $imported.nil?
$imported['Tsuki_HPShield'] = true
#==============================================================================
# ** Configuration.
#==============================================================================
module Tsuki
  module HP_Shield
    # adds the shields to your HP display
    Show_Shield_Bonus = false
    EFFECT_ADD_SHIELDS = 50
    Shield_Regex = /<shp:?\s*(.*)\s*>/i
    Autoshield_Regex = /<autoshield:[ ]*(\d+)>/i
    def add_effect(effects, code, data_id, value1=0, value2=0)
      effects << RPG::UsableItem::Effect.new(code, data_id, value1, value2)
    end
  end
end
#==============================================================================
# ** Rest of the script.
#==============================================================================
module RPG
  class UsableItem < BaseItem
    include Tsuki::HP_Shield
    def load_notetags_hp_shield
      matches = Shield_Regex.match(self.note)
      if matches
        add_effect(@effects, EFFECT_ADD_SHIELDS, 0, $1, 0)
      end
    end
  end

  class EquippableItem < BaseItem
    include Tsuki::HP_Shield
    def load_notetags_hp_shield
      matches = Shield_Regex.match(self.note)
      if matches
        add_effect(@effects, EFFECT_ADD_SHIELDS, 0, $1, 0)
      end
    end
  end
end
module DataManager
  class << self
    alias hp_shield_load_database load_database
    alias hp_shield_init init
  end
  def self.init
    hp_shield_init
    load_notetags_hp_shield
  end
  def self.load_database
    hp_shield_load_database
    if $BTEST
      load_notetags_hp_shield
    end
  end
  def self.load_notetags_hp_shield
    groups = [$data_skills, $data_items, $data_weapons, $data_armors]
    for group in groups
      for obj in group
        next if obj.nil?
        obj.load_notetags_hp_shield
      end
    end
  end
end
class Game_BattlerBase
  include Tsuki::HP_Shield
  attr_accessor :shp
  alias th_hp_shield_initialize_bbase initialize
  def initialize
    th_hp_shield_initialize_bbase
    @shp = @mshp = 0
  end
  def hp
    return Show_Shield_Bonus ? [@hp + @shp, 0].max : [@hp, 0].max
  end
  def mshp
    @mshp
  end
  def shp_rate
    mshp > 0 ? @shp.to_f / mshp : 0
  end
end
class Game_Battler < Game_BattlerBase
  alias th_hp_shield_item_effect_apply item_effect_apply
  def item_effect_apply(user, item, effect)
    th_hp_shield_item_effect_apply(user, item, effect)
    item_effect_apply_ex(user, item, effect)
  end
  alias :hp_shield_get_method_table :get_method_table if self.method_defined? :get_method_table
  def get_method_table
    method_table = {
        EFFECT_ADD_SHIELDS => :item_effect_add_shields
    }
    method_table
  end
  def item_effect_apply_ex(user, item, effect)
    method_table = get_method_table
    method_name = method_table[effect.code]
    send(method_name, user, item, effect) if method_name
  end
  alias th_hp_shield_execute_damage execute_damage
  def execute_damage(user)
    if self.shp > 0 && @result.hp_damage > 0
      on_damage(@result.hp_damage) if @result.hp_damage > 0
      self.hp -= @result.hp_damage - self.shp if @result.hp_damage > self.shp
      self.shp -= @result.hp_damage
      self.mp -= @result.mp_damage
      user.hp += @result.hp_drain
      user.mp += @result.mp_drain
    else
      th_hp_shield_execute_damage(user)
    end
  end
  def eval_shield(formula, a, b, v=$game_variables, s=$game_switches)
    eval(formula) rescue 0
  end
  # add shields!
  def item_effect_add_shields(user, item, effect)
    #if self.shp <= 0
    value = eval_shield(effect.value1, user, self)
    value = value.to_i
    #@result.hp_damage -= value
    @result.success = true
    @mshp = value
    self.shp = value
    #end
  end
end
class Game_Actor < Game_Battler
  alias th_hp_shield_exec_floor_dmg execute_floor_damage
  def execute_floor_damage
    if self.shp > 0
      damage = (basic_floor_damage * fdr).to_i
      self.shp -= [damage, max_floor_damage].min if self.shp > 0
      perform_map_damage_effect if damage > 0
    else
      th_hp_shield_exec_floor_dmg
    end
  end
end
class Window_Base < Window
  alias th_hp_shield_simple_status draw_actor_simple_status
  def draw_actor_simple_status(actor, x, y)
    draw_actor_shp(actor, x + 120, y + line_height * 1 - 10)
    th_hp_shield_simple_status(actor, x, y)
  end
  def draw_actor_hp(actor, x, y, width = 124)
    draw_gauge(x, y, width, actor.hp_rate, hp_gauge_color1, hp_gauge_color2)
    change_color(system_color)
    draw_text(x, y, 30, line_height, Vocab::hp_a)
    if actor.shp > 0
      draw_current_and_max_values(x, y, width, actor.hp, actor.shp, shp_color(actor), normal_color)
    else
      draw_current_and_max_values(x, y, width, actor.hp, actor.mhp, hp_color(actor), normal_color)
    end
  end
  def draw_actor_shp(actor, x, y, width = 124)
    draw_gauge(x, y, width, actor.shp_rate, shp_gauge_color1, shp_gauge_color2)
  end
  def shp_color(actor)
    text_color(29)
  end
  def shp_gauge_color1
    text_color(8)
  end
  def shp_gauge_color2
    text_color(9)
  end
end
class Window_BattleStatus < Window_Selectable
  alias th_hp_shield_gauge_with_tp draw_gauge_area_with_tp
  def draw_gauge_area_with_tp(rect, actor)
    draw_actor_shp(actor, rect.x + 0, rect.y - 10, 72)
    th_hp_shield_gauge_with_tp(rect, actor)
  end
end
# modifiche richieste
module BattleManager
  class << self
    alias hps_battle_end battle_end
    alias hps_battle_start battle_start
  end
  def self.battle_end(result)
    hps_battle_end(result)
    for actor in $game_party.all_members
      next if actor.nil?
      actor.shp = 0
      actor.mshp = 0
    end
  end

  def self.battle_start
    hps_battle_start
    for member in $game_party.battle_members
      member.shp += member.autostart_shield_bonus
    end
    member.mshp = member.shp
  end
end
class Game_BattlerBase
  def shp; @shp ||= 0; end
  def shp=(value); @shp = value; end
  def mshp; @mshp ||= 0; end
  def mshp=(value); @mshp = value; end
end
class Window_Base < Window
  alias hps_draw_actor_shp draw_actor_shp unless $@
  def draw_actor_shp(actor, x, y, width = 124)
    return if actor.shp <= 0
    hps_draw_actor_shp(actor, x, y, width)
  end
end
module RPG
  class EquipItem < BaseItem
    attr_reader :autoshield_bonus
    include Tsuki::HP_Shield
    def load_notetags_hp_shield
      return if @autoshield_loaded
      @autoshield_loaded = true
      @autoshield_bonus = 0
      self.note.split(/[\r\n]+/).each { |riga|
        if riga =~ Autoshield_Regex
          @autoshield_bonus = $1.to_i
        end
      }
    end

    def autoshield_bonus
      unless @autoshield_bonus
        load_notetags_hp_shield
      end
      @autoshield_bonus
    end
  end
end
class Game_Actor < Game_Battler
  def autostart_shield_bonus
    shield = 0
    for equip in equips
      next if equip.nil?
      shield += equip.autoshield_bonus
    end
    shield
  end
end


"Io non volevo solo partecipare alle discussioni. Volevo avere il potere di farle fallire" [cit.]

BannerOverdrive35.png
Cap3.png

578.png
 

Miei script per RPG Maker VX Ace:

Spoiler

 
I miei tutorial:
Spoiler

    Grawel
  • Elfo di Babbo Natale

  • Utenti
  • Rens: 16
  • 2
  • StellettaStellettaStelletta
  • 451 messaggi
  • Sesso:Maschio
  • Provenienza:Lago maggiore
  • Abilitā:Esperto

#8 Inviato 09 January 2017 - 11:20 AM

È fantastico ho fatto solo alcune piccole modifiche visive!

Spoiler

 

Il colore l'ho messo bianco ma lo volevo grigio/argento inoltre vorrei che la barra non coprisse le scritte PV e il valore e il fondo della barra che è nero lo vorrei trasparente (in modo che si veda la barra sotto man mano) come posso fare??? Secondo voi esteticamente puo andare?


Modificato da Grawel, 09 January 2017 - 12:01 PM.


    Grawel
  • Elfo di Babbo Natale

  • Utenti
  • Rens: 16
  • 2
  • StellettaStellettaStelletta
  • 451 messaggi
  • Sesso:Maschio
  • Provenienza:Lago maggiore
  • Abilitā:Esperto

#9 Inviato 19 January 2017 - 09:54 AM

Sono riuscito a sistemare tutto ma quando viene messa la barra copre ancora la scritta pv ed il valore della vita non riesco a farglieli scrivere sopra qualcuno saprebbe aiutarmi?

Ho provato a cambiare l'ordine di alcune chiamae ma ancora niente :tears: :tears: :tears: :tears: :shame:



    Guardian of Irael
  • Coniglietto Rosso

  • Rpg˛S Admin
  • Rens: 195
  • 19
  • StellettaStellettaStellettaStellettaStellettaStelletta
  • 58413 messaggi
  • Sesso:Maschio
  • Provenienza:Bagnaia (Viterbo)
  • Abilitā:Apprendista


#10 Inviato 19 January 2017 - 11:10 AM

Siccome non sono molto pratico riusciresti a postare una demo di prova con l'ultima sistemazione che hai fatto? Magari riesco a beccare il punto per spostare vita o barra! ^ ^


(\_/)
(^ ^) <----coniglietto rosso, me!     
(> <)

 
Il mio Tumblr dove seguire i miei progetti, i progetti della Reverie : : Project ^ ^
 
KdUDtQt.png disponibile su Google Play, qui i dettagli! ^ ^
 
FwnGMI3.png completo! Giocabile online, qui i dettagli! ^ ^  
 
REVERIE : : RENDEZVOUS (In allenamento per apprendere le buone arti prima di cominciarlo per bene ^ ^) Trovate i dettagli qui insieme alla mia intervista (non utilizzerò più rpgmaker) ^ ^

Spoiler


    Grawel
  • Elfo di Babbo Natale

  • Utenti
  • Rens: 16
  • 2
  • StellettaStellettaStelletta
  • 451 messaggi
  • Sesso:Maschio
  • Provenienza:Lago maggiore
  • Abilitā:Esperto

#11 Inviato 19 January 2017 - 11:56 AM

Quello script è abbastanza semplice potresti copiarlo in un nuovo progetto e mettere il tag ad una skill che il personaggio lancia su stesso per provarlo :)

Cmq in serata ti carico una demo :)



    Guardian of Irael
  • Coniglietto Rosso

  • Rpg˛S Admin
  • Rens: 195
  • 19
  • StellettaStellettaStellettaStellettaStellettaStelletta
  • 58413 messaggi
  • Sesso:Maschio
  • Provenienza:Bagnaia (Viterbo)
  • Abilitā:Apprendista


#12 Inviato 19 January 2017 - 12:13 PM

Sì, quello lo avevo fatto per la precedente richiesta, ma sarei interessato a vedere come hai fatto te le modifiche per agire direttamente su quelle, vado a tentativi, non ho la sicurezza di dirti "modifica questa linea"

^ ^


(\_/)
(^ ^) <----coniglietto rosso, me!     
(> <)

 
Il mio Tumblr dove seguire i miei progetti, i progetti della Reverie : : Project ^ ^
 
KdUDtQt.png disponibile su Google Play, qui i dettagli! ^ ^
 
FwnGMI3.png completo! Giocabile online, qui i dettagli! ^ ^  
 
REVERIE : : RENDEZVOUS (In allenamento per apprendere le buone arti prima di cominciarlo per bene ^ ^) Trovate i dettagli qui insieme alla mia intervista (non utilizzerò più rpgmaker) ^ ^

Spoiler


    Grawel
  • Elfo di Babbo Natale

  • Utenti
  • Rens: 16
  • 2
  • StellettaStellettaStelletta
  • 451 messaggi
  • Sesso:Maschio
  • Provenienza:Lago maggiore
  • Abilitā:Esperto

#13 Inviato 19 January 2017 - 12:48 PM

si si anche io sono andato a tentavi per le varie modifiche che ho fatto purtroppo faccio parecchia fatica con il ruby.

Cmq stasera ti passo una demo :)



    Holy87
  • Prode Guerriero

  • Rpg˛S Staff
  • Rens: 458
  • 6
  • StellettaStellettaStellettaStellettaStellettaStelletta
  • 7431 messaggi
  • Sesso:Maschio
  • Provenienza:San Giorgio a Cremano
  • Abilitā:Maestro

#14 Inviato 19 January 2017 - 13:32 PM

Fai uno screenshot di come viene e come vorresti.


"Io non volevo solo partecipare alle discussioni. Volevo avere il potere di farle fallire" [cit.]

BannerOverdrive35.png
Cap3.png

578.png
 

Miei script per RPG Maker VX Ace:

Spoiler

 
I miei tutorial:
Spoiler

    Grawel
  • Elfo di Babbo Natale

  • Utenti
  • Rens: 16
  • 2
  • StellettaStellettaStelletta
  • 451 messaggi
  • Sesso:Maschio
  • Provenienza:Lago maggiore
  • Abilitā:Esperto

#15 Inviato 20 January 2017 - 02:47 AM

Ecco il link alla demo http://www.soulsfate...lTitan/BASE.zip

Come vedete quando lanciate la skill la barra dello scudo copre i valori vita e la scritta PV (è giusto che sia sopra la barra della vita).

Purtroppo oltre a questa piccola modifica vorrei un vostro parere, sarebbe meglio mostrare il valore dello scudo o quello della vita?

Attualmente è impostato per mostrare sempre la vita rimanente.

Scusate ho lasciato tutti gli script del mio progetto comunque lo script interessato è uno degli ultimi e si chiama "Shield".


Modificato da Grawel, 20 January 2017 - 12:03 PM.


    Grawel
  • Elfo di Babbo Natale

  • Utenti
  • Rens: 16
  • 2
  • StellettaStellettaStelletta
  • 451 messaggi
  • Sesso:Maschio
  • Provenienza:Lago maggiore
  • Abilitā:Esperto

#16 Inviato 02 February 2017 - 09:16 AM

Nessuno ha trovato il modo?



    Holy87
  • Prode Guerriero

  • Rpg˛S Staff
  • Rens: 458
  • 6
  • StellettaStellettaStellettaStellettaStellettaStelletta
  • 7431 messaggi
  • Sesso:Maschio
  • Provenienza:San Giorgio a Cremano
  • Abilitā:Maestro

#17 Inviato 02 February 2017 - 17:31 PM

=begin
==============================================================================
 ** HP Shield
 Author: Hime
 Version: 1.0
 Date: May 20, 2012
------------------------------------------------------------------------------
 ** Change log
 1.0 May 20
   -Initial release
------------------------------------------------------------------------------
 This script allows you to give an actor "hp shields", which increases the
 amount of damage that a user can take.
 When HP shields are enabled, the shield will take the damage while
 the user's HP is protected.
 To give an item or skill HP shield effect, tag them with
    <shp: n>
 Where n is an integer
==============================================================================
=end
$imported = {} if $imported.nil?
$imported['Tsuki_HPShield'] = true
#==============================================================================
# ** Configuration.
#==============================================================================
module Tsuki
  module HP_Shield
    # adds the shields to your HP display
    Show_Shield_Bonus = false
    EFFECT_ADD_SHIELDS = 50
    Shield_Regex = /<shp:?\s*(.*)\s*>/i
    Autoshield_Regex = /<autoshield:[ ]*(\d+)>/i
    def add_effect(effects, code, data_id, value1=0, value2=0)
      effects << RPG::UsableItem::Effect.new(code, data_id, value1, value2)
    end
  end
end
#==============================================================================
# ** Rest of the script.
#==============================================================================
module RPG
  class UsableItem < BaseItem
    include Tsuki::HP_Shield
    def load_notetags_hp_shield
      matches = Shield_Regex.match(self.note)
      if matches
        add_effect(@effects, EFFECT_ADD_SHIELDS, 0, $1, 0)
      end
    end
  end
 
  class EquippableItem < BaseItem
    include Tsuki::HP_Shield
    def load_notetags_hp_shield
      matches = Shield_Regex.match(self.note)
      if matches
        add_effect(@effects, EFFECT_ADD_SHIELDS, 0, $1, 0)
      end
    end
  end
end
module DataManager
  class << self
    alias hp_shield_load_database load_database
    alias hp_shield_init init
  end
  def self.init
    hp_shield_init
    load_notetags_hp_shield
  end
  def self.load_database
    hp_shield_load_database
    if $BTEST
      load_notetags_hp_shield
    end
  end
  def self.load_notetags_hp_shield
    groups = [$data_skills, $data_items, $data_weapons, $data_armors]
    for group in groups
      for obj in group
        next if obj.nil?
        obj.load_notetags_hp_shield
      end
    end
  end
end
class Game_BattlerBase
  include Tsuki::HP_Shield
  attr_accessor :shp
  alias th_hp_shield_initialize_bbase initialize
  def initialize
    th_hp_shield_initialize_bbase
    @shp = @mshp = 0
  end
  def hp
    return Show_Shield_Bonus ? [@hp + @shp, 0].max : [@hp, 0].max
  end
  def mshp
    @mshp
  end
  def shp_rate
    mshp > 0 ? @shp.to_f / mshp : 0
  end
end
class Game_Battler < Game_BattlerBase
  alias th_hp_shield_item_effect_apply item_effect_apply
  def item_effect_apply(user, item, effect)
    th_hp_shield_item_effect_apply(user, item, effect)
    item_effect_apply_ex(user, item, effect)
  end
  alias :hp_shield_get_method_table :get_method_table if self.method_defined? :get_method_table
  def get_method_table
    method_table = {
        EFFECT_ADD_SHIELDS => :item_effect_add_shields
    }
    method_table
  end
  def item_effect_apply_ex(user, item, effect)
    method_table = get_method_table
    method_name = method_table[effect.code]
    send(method_name, user, item, effect) if method_name
  end
  alias th_hp_shield_execute_damage execute_damage
  def execute_damage(user)
    if self.shp > 0 && @result.hp_damage > 0
      on_damage(@result.hp_damage) if @result.hp_damage > 0
      self.hp -= @result.hp_damage - self.shp if @result.hp_damage > self.shp
      self.shp -= @result.hp_damage
      self.mp -= @result.mp_damage
      user.hp += @result.hp_drain
      user.mp += @result.mp_drain
    else
      th_hp_shield_execute_damage(user)
    end
  end
  def eval_shield(formula, a, b, v=$game_variables, s=$game_switches)
    eval(formula) rescue 0
  end
  # add shields!
  def item_effect_add_shields(user, item, effect)
    #if self.shp <= 0
    value = eval_shield(effect.value1, user, self)
    value = value.to_i
    #@result.hp_damage -= value
    @result.success = true
    @mshp = value
    self.shp = value
    #end
  end
end
class Game_Actor < Game_Battler
  alias th_hp_shield_exec_floor_dmg execute_floor_damage
  def execute_floor_damage
    if self.shp > 0
      damage = (basic_floor_damage * fdr).to_i
      self.shp -= [damage, max_floor_damage].min if self.shp > 0
      perform_map_damage_effect if damage > 0
    else
      th_hp_shield_exec_floor_dmg
    end
  end
end
class Window_Base < Window
  alias th_hp_shield_simple_status draw_actor_simple_status
   def draw_gauge_Trasparent(x, y, width, rate, color1, color2)
    fill_w = (width * rate).to_i
    gauge_y = y + line_height - 8
    contents.gradient_fill_rect(x, gauge_y, fill_w, 6, color1, color2)
  end
  def draw_actor_simple_status(actor, x, y)
    draw_actor_shp(actor, x + 120, y + line_height * 1 - 10)
    th_hp_shield_simple_status(actor, x, y)
  end
  def draw_actor_hp(actor, x, y, width = 124)
    draw_gauge(x, y, width, actor.hp_rate, hp_gauge_color1, hp_gauge_color2)
    change_color(system_color)
    draw_text(x, y, 30, line_height, Vocab::hp_a)
    if actor.shp > 0
      draw_current_and_max_values(x, y, width, actor.hp, actor.shp, shp_color(actor), normal_color)
    else
      draw_current_and_max_values(x, y, width, actor.hp, actor.mhp, hp_color(actor), normal_color)
    end
  end
  def draw_actor_shp(actor, x, y, width = 124)
    draw_gauge_Trasparent(x, y, width, actor.shp_rate, shp_gauge_color1, shp_gauge_color2)
  end
  def shp_color(actor)
    text_color(29)
  end
  def shp_gauge_color1
    text_color(0)#-3
  end
  def shp_gauge_color2
    text_color(8)#-3
  end
end
class Window_BattleStatus < Window_Selectable
  alias th_hp_shield_gauge_with_tp draw_gauge_area_with_tp
  def draw_gauge_area_with_tp(rect, actor)
    #draw_actor_shp(actor, rect.x + 0, rect.y - 10, 72)
    th_hp_shield_gauge_with_tp(rect, actor)
    #draw_actor_shp(actor, rect.x - 82, rect.y - 0, 72)#draw_actor_shp(actor, rect.x + 0, rect.y - 10, 72)
  end
 
  #--------------------------------------------------------------------------
  # * Draw HP
  #--------------------------------------------------------------------------
  def draw_actor_hp(actor, x, y, width = 124)
    draw_gauge(x, y, width, actor.hp_rate, hp_gauge_color1, hp_gauge_color2)
    draw_actor_shp(actor, x, y, 72)
    change_color(system_color)
    draw_text(x, y, 30, line_height, Vocab::hp_a)
    if actor.shp > 0
      draw_current_and_max_values(x, y, width, actor.hp, actor.mhp,
        shp_color(actor), shp_color(actor))
    else
      draw_current_and_max_values(x, y, width, actor.hp, actor.mhp,
        hp_color(actor), normal_color)
    end
  end
end
# modifiche richieste
module BattleManager
  class << self
    alias hps_battle_end battle_end
    alias hps_battle_start battle_start
  end
  def self.battle_end(result)
    hps_battle_end(result)
    for actor in $game_party.all_members
      next if actor.nil?
      actor.shp = 0
      actor.mshp = 0
    end
  end
 
  def self.battle_start
    hps_battle_start
    for member in $game_party.battle_members
      member.shp += member.autostart_shield_bonus
    end
    member.mshp = member.shp
  end
end
class Game_BattlerBase
  def shp; @shp ||= 0; end
  def shp=(value); @shp = value; end
  def mshp; @mshp ||= 0; end
  def mshp=(value); @mshp = value; end
end
class Window_Base < Window
  alias hps_draw_actor_shp draw_actor_shp unless $@
  def draw_actor_shp(actor, x, y, width = 124)
    return if actor.shp <= 0
    hps_draw_actor_shp(actor, x, y, width)
  end
end
module RPG
  class EquipItem < BaseItem
    attr_reader :autoshield_bonus
    include Tsuki::HP_Shield
    def load_notetags_hp_shield
      return if @autoshield_loaded
      @autoshield_loaded = true
      @autoshield_bonus = 0
      self.note.split(/[\r\n]+/).each { |riga|
        if riga =~ Autoshield_Regex
          @autoshield_bonus = $1.to_i
        end
      }
    end
 
    def autoshield_bonus
      unless @autoshield_bonus
        load_notetags_hp_shield
      end
      @autoshield_bonus
    end
  end
end
class Game_Actor < Game_Battler
  def autostart_shield_bonus
    shield = 0
    for equip in equips
      next if equip.nil?
      shield += equip.autoshield_bonus
    end
    shield
  end
end

"Io non volevo solo partecipare alle discussioni. Volevo avere il potere di farle fallire" [cit.]

BannerOverdrive35.png
Cap3.png

578.png
 

Miei script per RPG Maker VX Ace:

Spoiler

 
I miei tutorial:
Spoiler

    Grawel
  • Elfo di Babbo Natale

  • Utenti
  • Rens: 16
  • 2
  • StellettaStellettaStelletta
  • 451 messaggi
  • Sesso:Maschio
  • Provenienza:Lago maggiore
  • Abilitā:Esperto

#18 Inviato 02 February 2017 - 22:11 PM

Top grazie mille =)



    Vai Jack 8
  • Utente avanzato

  • Utenti
  • Rens: 12
  • 0
  • StellettaStellettaStelletta
  • 263 messaggi
  • Sesso:Maschio
  • Abilitā:Esperto

#19 Inviato 20 September 2019 - 10:47 AM

Scusate se necroposto ma sto usando questo script e avrei bisogno di un'informazione: si potrebbe utilizzare una delle stat di colui che attacca come integer?

UPDATE: Ok ho scoperto che si possono usare le formule di danno classiche. Grazie lo stesso.


Modificato da Vai Jack 8, 20 September 2019 - 13:28 PM.

BIM_Banner4.png           post-6-0-39588100-1390575633.png  <----  Vincitore del Primo Music Contest di RPG2s

 

Risultati pochi ma decenti.





  • Feed RSS