[XP]Request - Reflect Physical Attack State

Started by Aqua, July 13, 2009, 05:40:41 pm

Previous topic - Next topic

Aqua

Rawr!

Anyone be willing to make a script that allows for states to reflect a certain % of physical attacks (including physical skills) back at the attacker?

So if Giant Blob attacks Arshes who has state with reflection of 1%...
Giant Blob deals 10,000 damage to Arshes.
Arshes's state reflects 100 damage back to the Giant Blob.

(Then Arshes dies because I said so.)

Compatible with DBS pu-lease =X

Thaaaaaaaaaaank youuuuuuuuuuuu! :D


(Lolz I hate making request topics... I sound so weird D:)

Punn

July 14, 2009, 03:02:56 pm #1 Last Edit: July 15, 2009, 05:10:22 am by Blizzard
Already made, SD-fails, so you know the drill.

Spoiler: ShowHide

#==========================================================================
# ** SG Counter Attack
#==========================================================================
# sandgolem
# Version 2
# 2.07.06
#==========================================================================

Scene_Battle::SG_Counter_States = { 74 => [100,100] }
Scene_Battle::SG_Counter_Messages = ['Counter!']

#==========================================================================
#
# To check for updates or find more scripts, visit:
# http://www.gamebaker.com/rmxp/scripts/
#
# To use this script, copy it and insert it in a new section above "Main",
# under the default scripts, and the SDK if you're using it.
#
# Have problems? Official topic:
#   http://forums.gamebaker.com/showthread.php?t=129
#
#==========================================================================

begin
 SDK.log('SG Counter Attack', 'sandgolem', 2, '2.07.06')
 if SDK.state('SG Counter Attack') != true
   @sg_counterattack_disabled = true
 end
 rescue
end

if !@sg_counterattack_disabled
#--------------------------------------------------------------------------
 
class Game_Battler
 alias sandgolem_counter_battler_atkeff attack_effect
 def attack_effect(attacker)
   sandgolem_counter_battler_atkeff(attacker)
   if $scene.active_battler == attacker
     $scene.sg_atkcounter_test(self)
   end
 end
end

class Scene_Battle
 attr_accessor :active_battler
 
 def sg_atkcounter_test(battler)
   sg_temp = SG_Counter_States.keys
   for i in 0...sg_temp.size
     if battler.state?(sg_temp[i])
       if SG_Counter_States[sg_temp[i]][0] > rand(99)
         @sg_counter = SG_Counter_States[sg_temp[i]][1]
         @sg_countertarget = battler
         return
       end
     end
   end
 end
 
 alias sandgolem_counter_battle_up4s5 update_phase4_step5
 def update_phase4_step5
   sandgolem_counter_battle_up4s5
   if @sg_countertarget != nil
     @phase4_step = 1337
     @sg_atkcounter = 28
   end
 end
 
 def sg_counter_update
   if @sg_countertarget.dead? or @sg_atkcounter == 0
     @sg_atkcounter = nil
     @sg_counter = nil
     @sg_countertarget = nil
     @phase4_step = 6
     return
   end
   @sg_atkcounter -= 1
   if @sg_atkcounter == 10
     @sg_countertarget.animation_id = @sg_countertarget.animation1_id
     @active_battler.animation_id = @sg_countertarget.animation2_id
     sg_temp = rand(SG_Counter_Messages.size)
     sg_temp = SG_Counter_Messages[sg_temp].clone
     sg_temp.gsub!(/\\[Mm]/) { @sg_countertarget.name }
     @help_window.set_text(sg_temp, 1)
     @active_battler.attack_effect(@sg_countertarget)
     if !@active_battler.damage.is_a?(String)
       @active_battler.hp += @active_battler.damage
       @active_battler.damage = @active_battler.damage * @sg_counter / 100
       @active_battler.hp -= @active_battler.damage
       @status_window.refresh
     end
     @active_battler.damage_pop = true
   end
 end
 
 alias sandgolem_counter_battle_update update
 def update
   if @sg_atkcounter != nil
     sg_counter_update
   end
   sandgolem_counter_battle_update
 end
end

#--------------------------------------------------------------------------
end

Aqua

That script /requires/ the SDK rewrites; it doesn't work even with taking out the SDK checker

Blizzard

Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Punn