Jump to content


Photo

Active Cost

effect

  • Please log in to reply
7 replies to this topic

#1 Tsukihime

Tsukihime

    Advanced Member

  • Member
  • 7120 posts
  • LocationToronto
  • RM Skill - Coder

Awards Bar:

Users Awards

Posted 21 October 2012 - 09:54 AM

Effect: Active Cost
-Tsukihime

This script adds "active cost" effect to states. In order for a state to be active, you must pay certain amount of costs at the end of each turn.

For example, a particular state may require 40 MP per turn. When you are out of MP the state will disappear.

Download

Script: Download here
Required: Effect Manager

Usage

Tag a state with


<eff: active_cost type amount>
Where type is one of hp or mp, and amount is an integer representing how much you lose.

Edited by Tsukihime, 09 March 2016 - 10:56 PM.

All of my work can be found on my website:

banner200x40.png

You can follow me on any of these platforms:

logo_facebook40x40.pnglogo_twitter40x40.pnglogo_youtube40x40.pnglogo_patreon40x40.pnglogo_instagram40x40.png

Go here for Bugs and Requests.
 
Want to become a beta tester for my plugins before they are released to the public?

#2 Quack

Quack

    Advanced Member

  • Member
  • 149 posts

Posted 17 November 2012 - 10:26 PM

I think I've found a minor problem.
The costs work properly, but even if the maintenace cost for the state is in hp, it will still remove the state if mp is 0.

#3 estriole

estriole

    Advanced Member

  • Member
  • 1999 posts
  • LocationIndonesia
  • RM Skill - Coder

Posted 18 November 2012 - 11:26 PM

just change this :
class Game_Battler < Game_BattlerBase
  
  def state_effect_active_cost_turn_end(state, effect)
	type, value = effect.value1
	if type == "hp"
	  self.hp -= value
	  @result.effect_results.push("%s takes away %d HP from %s!" %[state.name, value, self.name])
	elsif type == "mp"
	  self.mp -= value
	  @result.effect_results.push("%s takes away %d MP from %s!" %[state.name, value, self.name])
	end
	
	if type == "mp" && self.mp == 0  
	  remove_state(state.id)
	  @result.effect_results.push("%s's %s has expired" %[self.name, state.name])
	end
	if type == "hp" && self.hp == 0
	  remove_state(state.id)
	  @result.effect_results.push("%s's %s has expired" %[self.name, state.name])
	end
  end
end

or you could just insert if self.mp == 0 inside the above ifs

Edited by estriole, 18 November 2012 - 11:28 PM.


#4 Quack

Quack

    Advanced Member

  • Member
  • 149 posts

Posted 19 November 2012 - 06:15 AM

Yea I know. I only happened to see it in the code as I was looking at it to understand how to write effects for Tsuki's Effect Manager (was writing an effect for using a skill every turn while under the effect of a state).
Just thought I would mention it so he could fix it like with any other bug (unless that is how he intended for it to work though I doubt that).

#5 Zeireth

Zeireth

    Newbie

  • Member
  • 3 posts

Posted 13 March 2014 - 06:04 AM

The link to this script has a 404 error. Page does not load from drop box.



#6 Tsukihime

Tsukihime

    Advanced Member

  • Member
  • 7120 posts
  • LocationToronto
  • RM Skill - Coder

Awards Bar:

Users Awards

Posted 13 March 2014 - 11:06 AM

Sorry just noticed that I accidentally moved the entire folder somewhere else.
All of my work can be found on my website:

banner200x40.png

You can follow me on any of these platforms:

logo_facebook40x40.pnglogo_twitter40x40.pnglogo_youtube40x40.pnglogo_patreon40x40.pnglogo_instagram40x40.png

Go here for Bugs and Requests.
 
Want to become a beta tester for my plugins before they are released to the public?

#7 Zeireth

Zeireth

    Newbie

  • Member
  • 3 posts

Posted 13 March 2014 - 02:53 PM

Thank you Tsukihime.



#8 Polidoro

Polidoro

    Husband

  • Member
  • 477 posts
  • LocationJersey baby
  • RM Skill - Jack of All Trades

Posted 13 March 2014 - 03:19 PM

Wooooooooowwwwwwww....... I have a plot-point where, due to certain events, one party member is unable to be violent without it killing him slowly. I had to set the mechanics up in a really messy way that involved 'dummy skills' but caused a lot of problems when leveling up and what not. You just made that whole subsystem extremely polished and way more detailed. Thank you for always thinking outside the box and motivating me towards making progress on my project. I.... I love you... a lot.
Join my "Forum United Created Knowledge List" and take part in the development of a short game, one event idea at a time. Click the following link to be directed to the topic post and become the newest member of my 'F.U.C.K. List'!


Need A Custom Title Screen? Check Out My Title Screen Workshop Topic. Closed due to inactivity. Message me if you're interested.


Please excuse my poor english, I'm typing on a touchscreen. :P

The honeymoon's over... Now I have time to put some focus on this stuff again.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users