Save-Point
DeceptivelyFriendlyKO XP - Printable Version

+- Save-Point (https://www.save-point.org)
+-- Forum: Material Development (https://www.save-point.org/forum-8.html)
+--- Forum: Scripts Database (https://www.save-point.org/forum-39.html)
+---- Forum: RPGMaker XP (RGSS) Engine (https://www.save-point.org/forum-116.html)
+---- Thread: DeceptivelyFriendlyKO XP (/thread-7429.html)



DeceptivelyFriendlyKO XP - kyonides - 02-26-2019

DeceptivelyFriendlyKO XP

by Kyonides Arkanthes


Introduction

This might be considered the stand alone version of Kolloseum States XP Deceptively Friendly Knockout Version. What it offers is to let you configure via script how some weapons will either ignore or instantly kill specific monsters. It also sports armors that heroes can equip in order to redistribute damage inflicted by monsters. Who will be affected here? Well, it will be all of your doomed heroes for sure! Laughing That happens because each hero will be inflicted the same amount of damage. Sadly, that might not save your weak mages and clerics after all. Confused

Script

Code:
# * DeceptivelyFriendlyKO XP
#   Scripter : Kyonides-Arkanthes
#   2019-02-26

module KDecKout
 UNHARMED = 'Unharmed'
 KNOCKOUT = 'Knockout'
 # WeaponID => [EnemyID1, etc.]
 IGNORE_TARGET_WEAPONS = {}
 # WeaponID => [EnemyID1, etc.]
 INSTANT_KILL_WEAPONS  = {}
 # [ArmorID1, etc.] - Include Shields and Body Armors Only
 DISTRIBUTE_DMG_ARMORS = []
end

class Game_Actor
 def attack_effect(attacker)
   effective = super(attacker)
   armors = [@armor1_id, @armor3_id]
   if effective and (KDecKout::DISTRIBUTE_DMG_ARMORS & armors).empty?
     heroes = $game_party.actors
     partial = @damage / heroes.size
     heroes.each {|h| h.damage = partial }
   end
   return effective
 end
end

class Game_Enemy
 def attack_effect(attacker)
   wid = attacker.weapon_id
   if (this_weapon = KDecKout::IGNORE_TARGET_WEAPONS[wid])
     if this_weapon.include?(@enemy_id)
       @damage = KDecKout::UNHARMED
       return false
     end
   elsif (this_weapon = KDecKout::INSTANT_KILL_WEAPONS[wid])
     if this_weapon.include?(@enemy_id)
       @damage = KDecKout::KNOCKOUT
       @hp = 0
       return true
     end
   end
   return super(attacker)
 end
end

Terms of Use

Well, I know it is a scriptlet so I guess I will not ask for more than US$10 for it in case you go commercial. Do not forget to include me in your game credits!