RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
Element Imbuing States

0 Members and 1 Guest are viewing this topic.

*****
Rep:
Level 84
This text is way too personal.
Bronze - GIAW 11 (Hard)Silver - GIAW Halloween
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


Code: [Select]
#===============================================================================
#
# 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:

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Best Member2012 Best RPG Maker User (Scripting)2012 Favorite Staff Member2012 Most Mature MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
Very nice and efficient script. Good job.