Skip to content

Instantly share code, notes, and snippets.

@HimeWorks
HimeWorks / HimeATB_v2.js
Last active January 27, 2016 03:48
Hime ATB: Fill Rate Modifiers
// Version 2 of Hime ATB, with support for fill rate modifiers.
// Code example for tutorial: http://himeworks.com/2016/01/tutorial-series-hime-atb-customizing-atb-fill-rates/
var Imported = Imported || {} ;
var TH = TH || {};
Imported.TH_ActiveTimeBattle = 1;
TH.ActiveTimeBattle = TH.ActiveTimeBattle || {};
(function ($) {
@HimeWorks
HimeWorks / HimeATB_v1.js
Last active January 27, 2016 03:48
Hime ATB: Super Simple Version
// A super simple implementation of an ATB. Used for tutorial purposes.
// Read the tutorial here: http://himeworks.com/2016/01/tutorial-designing-a-simple-active-battle-system/
var Imported = Imported || {} ;
var TH = TH || {};
Imported.TH_ActiveTimeBattle = 1;
TH.ActiveTimeBattle = TH.ActiveTimeBattle || {};
(function ($) {
// doesn't work
var TH_SpritesetMap_createLowerLayer = Spriteset_Map.prototype.createLowerLayer;
Spriteset_Map.prototype.createLowerLayer = function() {
TH_SpritesetMap_createLowerLayer.call(this);
this.createEmitter();
}
Spriteset_Map.prototype.createEmitter = function() {
var conf = {
@HimeWorks
HimeWorks / change_class_keep_exp.rb
Created September 23, 2015 20:21
Change your actor's class while keeping EXP/level
#
# To change class while keeping exp/level, you don't need any additional scripts.
# Just make the script call
#
# $game_actors[actor_id].change_class(class_id, true)
#
# Where `actor_id` is the ID of the actor you want to change classes and `class_id` is the ID of the class to change to.
#
# For example
#
@HimeWorks
HimeWorks / vlue_class_skill_trees.rb
Last active September 23, 2015 17:44
This script is an add-on to Vlue's Skill Trees that allows you to keep track of existing skill trees for each class.
#-------------------------------------------------------------------------------
# Preserves information about a particular class' skill tree
# When you change classes, your skill trees are not reset.
#
# Skill points are separate for each class, rather than pooled together.
#-------------------------------------------------------------------------------
class Data_ClassSkillTree
attr_accessor :class_id
attr_accessor :skill_points
@HimeWorks
HimeWorks / Custom_Actor_Description.rb
Last active September 23, 2015 01:16
Allows you to change your actor's description
#-------------------------------------------------------------------------------
# Usage: use the script call
#
# change_description(actor_id, new_description)
#
# Where the actor_id is the ID of the actor you want to change and the
# new_description is the description you want the actor to show
#
# For example
#
@HimeWorks
HimeWorks / Load_Special_Map.rb
Last active September 23, 2015 01:04
Adds a new command to the title menu that will allow you to go to a specific map
module TH
module Special_Map_Command
# The map that the player will be sent to upon choosing the special command.
Map_ID = 2
# Name of the command that will be shown in the title screen
Name = "Boss Rush"
# A formula that determines whether the command will be displayed
@HimeWorks
HimeWorks / Remove_States_On_Death.rb
Created September 12, 2015 23:38
Remove States on Death
# By default, when a battler dies, the game simply clears out the states.
# However, sometimes we might want them to be actually "removed" through the
# appropriate remove_state method
class Game_Battler < Game_BattlerBase
alias :th_remove_states_on_death_die :die
def die
@states.each {|id| remove_state(id)}
th_remove_states_on_death_die
end
@HimeWorks
HimeWorks / Class Param Plus
Created July 17, 2015 03:33
Class Param Plus
# Quick demonstration of how one would hold class-specific bonus parameters.
# Usage: make the following script call
#
# $game_actors[id].add_class_param_plus(class_id, param_id, value)
#
class Game_Actor < Game_Battler
alias :th_class_plus_params_initialize :initialize
def initialize(actor_id)
@class_plus_params = {}
@HimeWorks
HimeWorks / gist:70ab754eb35f2c0bd541
Created June 1, 2015 20:08
Remove Buffs on Turn End, not Action End
class Game_Battler
def on_action_end
@result.clear
remove_states_auto(1)
#remove_buffs_auto
end
def on_turn_end
@result.clear
regenerate_all