Tsukihime

effect
Active Cost

8 posts in this topic

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
Polidoro and Wren like this

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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).

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.