Main Menu
  • Welcome to The RPG Maker Resource Kit.

Element Imbuing States

Started by cozziekuns, May 23, 2010, 04:14:31 AM

0 Members and 1 Guest are viewing this topic.

cozziekuns

Element Imbuing States
Version: 1.0
Author: cozziekuns
Date: May 22, 2010

Version History




  • <Version 1.0> 05.22.2010 - Original Release

Planned Future Versions


  • None! Please suggest some features.

Description



States that imbue elements, akin to those in Summon Night: Swordcraft Story 2.

Features


  • Pretty much plug and play (You just have to put stuff in noteboxes)
  • Elements... Are... STACKABLE

Instructions

See header.

Script




#===============================================================================
#
# Cozziekuns Element Imbuing States
# Last Date Updated: 5/22/2010
#
# States that imbue elements, akin to those in Summon Night: Swordcraft Story 2.
#
#===============================================================================
# Updates
# -----------------------------------------------------------------------------
# o 05/22/10 - Created Script.
#===============================================================================
# What's to come?
# -----------------------------------------------------------------------------
# o Nothing! Suggest something.
#===============================================================================
# Instructions
# -----------------------------------------------------------------------------
# To install this script, open up your script editor and copy/paste this script
# to an open slot below ? Materials but above ? Main. Remember to save.
#
# If you want a state that imbues the element with an ID of 11, then in that
# state, you would have to put a \element[11] in the respective states notebox.
#
# Element ID's can be found in the system tab in the database. Look for where it
# says "Element Names". For example, the element with an ID of 1 would be Melee,
# while the element with an ID of 11 would be electricity.
#
# Check the demo for a more detailed example.
#===============================================================================

$imported = {} if $imported == nil
$imported["CozElemImbuStates"] = true

# No modules -.-

#==============================================================================
# ** RPG::State
#------------------------------------------------------------------------------
#  The superclass of all states.
#==============================================================================

class RPG::State
  #--------------------------------------------------------------------------
  # * Element to add
  #--------------------------------------------------------------------------
  def element_to_add
    @elements_to_add = []
    if self.note[/\\element\[(\d+)]/i] != nil
      @elements_to_add.push($1.to_i)
    end
  return @elements_to_add
  end
end

#==============================================================================
# ** Game_Actor
#------------------------------------------------------------------------------
#  This class handles actors. It's used within the Game_Actors class
# ($game_actors) and referenced by the Game_Party class ($game_party).
#==============================================================================

class Game_Actor < Game_Battler
  #--------------------------------------------------------------------------
  # * Get Normal Attack Element
  #--------------------------------------------------------------------------
  alias coz_eis_element_set element_set
  def element_set
    result = coz_eis_element_set
    for state in states
      result += state.element_to_add
    end
  return result
end
end


Credit




  • cozziekuns

Support



Just post below.

Known Compatibility Issues

None as of yet.

Demo



See attached.

Author's Notes



This is probably the smallest script I've ever come up with, yet it's the one I'm the most proud of. Weird, huh?

Restrictions

:ccby:

modern algebra

Very nice and efficient script. Good job.