Preserved forum archive. This topic stores the original first post and locally mirrored RPG Maker Web attachments when available. It is posted by the BMMPlay archive account, not by the original creator.
Original Source
- Original title: KPermaDamage XP
- Original author: kyonides
- Original date: February 4, 2023
- Source thread: https://forums.rpgmakerweb.com/threads/kpermadamage-xp.154681/
- Source forum path: Game Development Engines > Ruby Game System (RGSS) Scripts > RGSS Scripts (RMXP)
Summary
KPermaDamage XP by Kyonides Arkanthes Introduction Would Aluxes alias Alex love to lose n amount of HP or SP every time he moves in any direction?
Archived First Post
KPermaDamage XP
by Kyonides Arkanthes
by Kyonides Arkanthes
Introduction
Would Aluxes alias Alex love to lose n amount of HP or SP every time he moves in any direction?
Well, now he gotta live with it if he does and it happens to have the death sentence already configured in the KPermaDmg module.
Plus, he could also die if his SP goes kaboom. :S
And there is also the dreadful perma-death. :S
Read the notes on how to configure the CONSTANTS that will affect the target Actors.
FAQ
Question: Isn't that redundant or unnecessary?
Answer: Who cares?
Ruby:
# * KPermaDamage XP * #
# Scripter : Kyonides Arkanthes
# v1.0.1 - 2023-02-04
# Make certain Heroes permanently lose HP or SP or even collapse for having
# no more SP left!
# * CONSTANTS * #
# LOSE_HP or LOSE_SP or SP_DEATH or PERMA_DEATH
# The only way to cure the permanent HP or SP damage or the SP Death would be
# the following Script Calls:
# $game_actors[ActorID].perma_hp_dmg = 0
# $game_actors[ActorID].perma_sp_dmg = 0
# $game_actors[ActorID].sp_death = nil
# $game_actors[ActorID].perma_death = nil
module KPermaDmg
# ActorID => Points Lost, etc. separated by a commas
LOSE_HP = { 1 => 5 }
LOSE_SP = { 1 => 3 }
# Just Add as Many ActorIDs as deemed necessary
SP_DEATH = [1]
PERMA_DEATH = []
end
class Game_Battler
alias :kyon_gm_btlr_hp_set :hp=
alias :kyon_gm_btlr_sp_set :sp=
alias :kyon_gm_btlr_rec_all :recover_all
def hp=(new_hp)
return 0 if @perma_death
kyon_gm_btlr_hp_set(new_hp)
end
def sp=(new_sp)
return 0 if @perma_death
kyon_gm_btlr_sp_set(new_sp)
check_sp_death if @sp_death
end
def recover_all
return if @perma_death
kyon_gm_btlr_rec_all
end
end
class Game_Actor
alias :kyon_gm_act_setup :setup
def setup(actor_id)
kyon_gm_act_setup(actor_id)
setup_permanent_damage
end
def setup_permanent_damage
@perma_hp_dmg = KPermaDmg::LOSE_HP[@actor_id] || 0
@perma_sp_dmg = KPermaDmg::LOSE_SP[@actor_id] || 0
@sp_death = KPermaDmg::SP_DEATH.include?(@actor_id)
@perma_death = KPermaDmg::PERMA_DEATH.include?(@actor_id)
end
def permanent_damage
self.hp -= @perma_hp_dmg
self.sp -= @perma_sp_dmg
end
def check_sp_death
if @sp == 0 and !@immortal
@hp = 0
add_state(1)
else
@hp = 1 if @hp == 0
remove_state(1)
end
end
attr_accessor :perma_hp_dmg, :perma_sp_dmg, :sp_death, :perma_death
end
class Game_Party
def permanent_damage
@actors.each{|actor| actor.permanent_damage }
end
end
class Game_Player
alias :kyon_gm_plyr_incr_steps :increase_steps
def increase_steps
kyon_gm_plyr_incr_steps
$game_party.permanent_damage
end
end
Download Up-to-Date RGSS Scripts
Terms & Conditions
Free as in beer.
Include my nickname in your game credits.
Do not repost it!
Downloads / Referenced Files
Log in to download
Log in, then follow the RPG Maker Developers Group to see these download links.
Log in to downloadLicense / Terms Note
Include my nickname in your game credits. Do not repost it!
Creator Claims / Removal
If you are the original creator and want this listing reassigned, edited, or removed, join BMMPlay and contact the moderators with proof that matches the original RPG Maker Web profile, linked GitHub, itch.io page, or another public creator identity.
Replies (0)
No replies yet.
0
replies
1
view
Topic Summary
Loading summary...