Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

 
Reply to this topicStart new topic
> Nazi Zombies, Anyone?, I have created RPG Zombies!
Dudemon
post Jul 24 2011, 01:11 PM
Post #1


Level 2
Group Icon

Group: Member
Posts: 17
Type: Developer
RM Skill: Skilled




ZOMBIES! ((( The other zombie post had a script error,This is the only one that needs approval. my apologies )))

I decided I wanted to make an unlimmited round mini game, increasing in difficulty, that players could use to increase their level, or win prizes. So, with a little scripting, I managed to make a very easy to manage game, that runs with all other scripts currently running in your game. The way it works is simple, When a switch is on, it changes how enemy stats are decided.

-GAMEPLAY-

Its simple really, You fight as far as you can, and claim the fabulous prizes. Best of all, The round your on saves, and you can continue from there.

There are many different Zombies programmed in, each with its own actions. You see them on different rounds. For instance, after round 100, you face Satan. His stats being chosen by round, if you were on round 100, his stats would be HP 50,000, MP 2500, ATK,DEF,SPI,AGI: 500.

There is no penalty for losing:)



-SCREENSHOTS-

Not really neccesary. Just picture Battleing Monsters that increase in strength with each round.



-USAGE-


CODE
#==============================================================================
# ** Game_Enemy [Modified]
#------------------------------------------------------------------------------
#  This class handles enemy characters. It's used within the Game_Troop class
# ($game_troop).
#
#  INSTRUCTIONS
#  Replace the "Game_Enemy" Script with this modded one
#
#  If you have moddified this script before, you must apply the  same
#  modifications as before. This wont apply to many.
#
#  This should work with any other scripts, unless they add stats other than
#  HP, MP, ATK, DEF, SPI, and AGI. However, I have the Yem Aggro and AI script,
#  and it still works, so you'll have to try. New Stats Will Not gain the
#  increase each round.
#
#  Set customization below.
#
#  This will only take effect if the ZOMBIE_SWITCH is on, and If the
#  ZOMBIE_VARIABLE is greater than 0. A simple looping battle event is then
#  all thats needed. it should look like this:

#  Label: Zombie
#    Battle Proccesing: "Zombie Battle"
#    if win:
#      Control Variables [ZOMBIE_SWITCH] + 1
#      jump to lable: Zombie
#    if lose:
#      jump to lable: end
#    end
#  label: end
#
#==============================================================================

module DUDE

  ZOMBIE_SWITCH = 1
  ZOMBIE_VARIABLE = 1
  HP_PER_LEVEL = 100
  MP_PER_LEVEL = 10
  ATK_PER_LEVEL = 5
  DEF_PER_LEVEL = 5
  SPI_PER_LEVEL = 5
  AGI_PER_LEVEL = 5
end



class Game_Enemy < Game_Battler
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_reader   :index                    # index in troop
  attr_reader   :enemy_id                 # enemy ID
  attr_reader   :original_name            # original name
  attr_accessor :letter                   # letters to be attached to the name
  attr_accessor :plural                   # multiple appearance flag
  attr_accessor :screen_x                 # battle screen X coordinate
  attr_accessor :screen_y                 # battle screen Y coordinate

  #--------------------------------------------------------------------------
  # * Object Initialization
  #     index    : index in troop
  #     enemy_id : enemy ID
  #--------------------------------------------------------------------------
  def initialize(index, enemy_id)
    super()
    @index = index
    @enemy_id = enemy_id
    enemy = $data_enemies[@enemy_id]
    @original_name = enemy.name
    @letter = ''
    @plural = false
    @screen_x = 0
    @screen_y = 0
    @battler_name = enemy.battler_name
    @battler_hue = enemy.battler_hue
    @hp = maxhp
    @mp = maxmp

  end
  #--------------------------------------------------------------------------
  # * Determine if Actor or Not
  #--------------------------------------------------------------------------
  def actor?
    return false
  end
  #--------------------------------------------------------------------------
  # * Get Enemy Object
  #--------------------------------------------------------------------------
  def enemy
    return $data_enemies[@enemy_id]
  end
  #--------------------------------------------------------------------------
  # * Get Display Name
  #--------------------------------------------------------------------------
  def name
    if @plural
      return @original_name + letter
    else
      return @original_name
    end
  end
  #--------------------------------------------------------------------------
  # * Get Basic Maximum HP
  #--------------------------------------------------------------------------
  def base_maxhp
     if $game_switches[DUDE::ZOMBIE_SWITCH]
       return DUDE::HP_PER_LEVEL * $game_variables[DUDE::ZOMBIE_VARIABLE]
       else
    return enemy.maxhp
    end
  end
  #--------------------------------------------------------------------------
  # * Get basic Maximum MP
  #--------------------------------------------------------------------------
  def base_maxmp
     if $game_switches[DUDE::ZOMBIE_SWITCH]
       return DUDE::MP_PER_LEVEL * $game_variables[DUDE::ZOMBIE_VARIABLE]
       else
    return enemy.maxmp
    end
  end
  #--------------------------------------------------------------------------
  # * Get Basic Attack
  #--------------------------------------------------------------------------
  def base_atk
     if $game_switches[DUDE::ZOMBIE_SWITCH]
       return DUDE::ATK_PER_LEVEL * $game_variables[DUDE::ZOMBIE_VARIABLE]
       else
    return enemy.atk
    end
  end
  #--------------------------------------------------------------------------
  # * Get Basic Defense
  #--------------------------------------------------------------------------
  def base_def
     if $game_switches[DUDE::ZOMBIE_SWITCH]
       return DUDE::DEF_PER_LEVEL * $game_variables[DUDE::ZOMBIE_VARIABLE]
       else
    return enemy.def
    end
  end
  #--------------------------------------------------------------------------
  # * Get Basic Spirit
  #--------------------------------------------------------------------------
  def base_spi
     if $game_switches[DUDE::ZOMBIE_SWITCH]
       return DUDE::SPI_PER_LEVEL * $game_variables[DUDE::ZOMBIE_VARIABLE]
       else
    return enemy.spi
    end
  end
  #--------------------------------------------------------------------------
  # * Get Basic Agility
  #--------------------------------------------------------------------------
  def base_agi
     if $game_switches[DUDE::ZOMBIE_SWITCH]
       return DUDE::AGI_PER_LEVEL * $game_variables[DUDE::ZOMBIE_VARIABLE]
       else
    return enemy.agi
    end
  end
  #--------------------------------------------------------------------------
  # * Get Hit Rate
  #--------------------------------------------------------------------------
  def hit
    return enemy.hit
  end
  #--------------------------------------------------------------------------
  # * Get Evasion Rate
  #--------------------------------------------------------------------------
  def eva
    return enemy.eva
  end
  #--------------------------------------------------------------------------
  # * Get Critical Ratio
  #--------------------------------------------------------------------------
  def cri
    return enemy.has_critical ? 10 : 0
  end
  #--------------------------------------------------------------------------
  # * Get Ease of Hitting
  #--------------------------------------------------------------------------
  def odds
    return 1
  end
  #--------------------------------------------------------------------------
  # * Get Element Change Value
  #     element_id : element ID
  #--------------------------------------------------------------------------
  def element_rate(element_id)
    rank = enemy.element_ranks[element_id]
    result = [0,200,150,100,50,0,-100][rank]
    for state in states
      result /= 2 if state.element_set.include?(element_id)
    end
    return result
  end
  #--------------------------------------------------------------------------
  # * Get Added State Success Rate
  #     state_id : state ID
  #--------------------------------------------------------------------------
  def state_probability(state_id)
    if $data_states[state_id].nonresistance
      return 100
    else
      rank = enemy.state_ranks[state_id]
      return [0,100,80,60,40,20,0][rank]
    end
  end
  #--------------------------------------------------------------------------
  # * Get Experience
  #--------------------------------------------------------------------------
  def exp
    return enemy.exp
  end
  #--------------------------------------------------------------------------
  # * Get Gold
  #--------------------------------------------------------------------------
  def gold
    return enemy.gold
  end
  #--------------------------------------------------------------------------
  # * Get Drop Item 1
  #--------------------------------------------------------------------------
  def drop_item1
    return enemy.drop_item1
  end
  #--------------------------------------------------------------------------
  # * Get Drop Item 2
  #--------------------------------------------------------------------------
  def drop_item2
    return enemy.drop_item2
  end
  #--------------------------------------------------------------------------
  # * Use Sprites?
  #--------------------------------------------------------------------------
  def use_sprite?
    return true
  end
  #--------------------------------------------------------------------------
  # * Get Battle Screen Z-Coordinate
  #--------------------------------------------------------------------------
  def screen_z
    return 100
  end
  #--------------------------------------------------------------------------
  # * Perform Collapse
  #--------------------------------------------------------------------------
  def perform_collapse
    if $game_temp.in_battle and dead?
      @collapse = true
      Sound.play_enemy_collapse
    end
  end
  #--------------------------------------------------------------------------
  # * Escape
  #--------------------------------------------------------------------------
  def escape
    @hidden = true
    @action.clear
  end
  #--------------------------------------------------------------------------
  # * Transform
  #     enemy_id : enemy ID to be transformed into
  #--------------------------------------------------------------------------
  def transform(enemy_id)
    @enemy_id = enemy_id
    if enemy.name != @original_name
      @original_name = enemy.name
      @letter = ''
      @plural = false
    end
    @battler_name = enemy.battler_name
    @battler_hue = enemy.battler_hue
    make_action
  end
  #--------------------------------------------------------------------------
  # * Determine if Action Conditions are Met
  #     action : battle action
  #--------------------------------------------------------------------------
  def conditions_met?(action)
    case action.condition_type
    when 1  # Number of turns
      n = $game_troop.turn_count
      a = action.condition_param1
      b = action.condition_param2
      return false if (b == 0 and n != a)
      return false if (b > 0 and (n < 1 or n < a or n % b != a % b))
    when 2  # HP
      hp_rate = hp * 100.0 / maxhp
      return false if hp_rate < action.condition_param1
      return false if hp_rate > action.condition_param2
    when 3  # MP
      mp_rate = mp * 100.0 / maxmp
      return false if mp_rate < action.condition_param1
      return false if mp_rate > action.condition_param2
    when 4  # State
      return false unless state?(action.condition_param1)
    when 5  # Party level
      return false if $game_party.max_level < action.condition_param1
    when 6  # Switch
      switch_id = action.condition_param1
      return false if $game_switches[switch_id] == false
    end
    return true
  end
  #--------------------------------------------------------------------------
  # * Create Battle Action
  #--------------------------------------------------------------------------
  def make_action
    @action.clear
    return unless movable?
    available_actions = []
    rating_max = 0
    for action in enemy.actions
      next unless conditions_met?(action)
      if action.kind == 1
        next unless skill_can_use?($data_skills[action.skill_id])
      end
      available_actions.push(action)
      rating_max = [rating_max, action.rating].max
    end
    ratings_total = 0
    rating_zero = rating_max - 3
    for action in available_actions
      next if action.rating <= rating_zero
      ratings_total += action.rating - rating_zero
    end
    return if ratings_total == 0
    value = rand(ratings_total)
    for action in available_actions
      next if action.rating <= rating_zero
      if value < action.rating - rating_zero
        @action.kind = action.kind
        @action.basic = action.basic
        @action.skill_id = action.skill_id
        @action.decide_random_target
        return
      else
        value -= action.rating - rating_zero
      end
    end
  end
end



INSTRUCTIONS
Replace the "Game_Enemy" Script with this modded one

If you have moddified this script before, you must apply the same
modifications as before. This wont apply to many.

This should work with any other scripts, unless they add stats other than
HP, MP, ATK, DEF, SPI, and AGI. However, I have the Yem Aggro and AI script,
and it still works, so you'll have to try. New Stats Will Not gain the
increase each round.

Set customization below.

This will only take effect if the ZOMBIE_SWITCH is on, and If the
ZOMBIE_VARIABLE is greater than 0. A simple looping battle event is then
all thats needed. it should look like this:
Label: Zombie
Battle Proccesing: "Zombie Battle"
if win:
Control Variables [ZOMBIE_SWITCH] + 1
jump to lable: Zombie
if lose:
jump to lable: end
end
label: end

-OTHER NOTES-

Thats really about it. Let me Know what you guys think or if you have any ideas.The event may look odd, but its very easy to make. Just make sure the ZOMBIE VARIABLE is atleast 1 when you start


__________________________
Think about it this way: WHO CARES?? Check out my game, REAWAKENING!!
Go to the top of the page
 
+Quote Post
   
Helios
post Jul 26 2011, 03:11 PM
Post #2


Level 4
Group Icon

Group: Member
Posts: 54
Type: None
RM Skill: Undisclosed




The description is a bit confusing, so I'll make a conclusion here:

When switch = on and variable >= 1, enemies will gain status after each battle, making the same battle progressively harder.

And not necessarily related to zombies.

This post has been edited by Helios: Jul 26 2011, 03:15 PM


__________________________
ERROR: NO ERROR DETECTED
Go to the top of the page
 
+Quote Post
   
Dudemon
post Jul 29 2011, 03:06 PM
Post #3


Level 2
Group Icon

Group: Member
Posts: 17
Type: Developer
RM Skill: Skilled




QUOTE (Helios @ Jul 26 2011, 04:11 PM) *
The description is a bit confusing, so I'll make a conclusion here:

When switch = on and variable >= 1, enemies will gain status after each battle, making the same battle progressively harder.

And not necessarily related to zombies.



Pretty much,Yeah. Seams pretty lame, and I was just liking the fact thatI made it. Adding Various different enmies into the rounds adds extra varience to it. For instance, in my game there are 15 differnt battles. Wimp zombies to Satan. The harder battles are less likely to occur.


__________________________
Think about it this way: WHO CARES?? Check out my game, REAWAKENING!!
Go to the top of the page
 
+Quote Post
   

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 19th June 2013 - 11:42 PM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker