Save-Point
What's up, RMers? - Printable Version

+- Save-Point (https://www.save-point.org)
+-- Forum: Games Development (https://www.save-point.org/forum-4.html)
+--- Forum: Development Discussion (https://www.save-point.org/forum-17.html)
+--- Thread: What's up, RMers? (/thread-395.html)



RE: What's up, RMers? - DerVVulfman - 09-14-2016

I hope this helps. Right now, this script has the first map set to just put damage on two areas of tiles. Yep, map coordinates CAN overlap without accidentally causing double damage.

Code:
#==============================================================================
# ** Map Coordinate Slip Damage
#------------------------------------------------------------------------------
#  by your Friendly Neighborhood Werewolf (aka DerVVulfman)
#------------------------------------------------------------------------------
#
#  This lets you create a set of coordinates within a map that performs slip
#  damage separate from the normal 'status ailment' created damage.
#
#  NOTE:  Slip Damage is based on the character's Max HP, subtracting 1% of
#         their max HP every step.... set on line 58.
#         If you want to have actor HP reduced by a flat 10HP each step, just
#         set line 58 to:   actor.hp -= 10
#
#==============================================================================

module MapCoordSlip

  # -------------------------------------------------------------------------
  MAP = {}  # Do Not Touch
  # -------------------------------------------------------------------------
  
  # MAP ARRAY
  #
    MAP[1]      = [
                    [3,3,16,11],  # Sets an area from (3,3) to (16,20)
                    [2,5,2,15]    # Sets an area from (2,5) to (2,15)
                  ]
end

#==============================================================================
# ** Game_Party
#------------------------------------------------------------------------------
#  This class handles the party. It includes information on amount of gold
#  and items. Refer to "$game_party" for the instance of this class.
#==============================================================================

class Game_Party
  #--------------------------------------------------------------------------
  # * Slip Damage Check (for map)
  #--------------------------------------------------------------------------
  def extra_slip_damage
    # Get the map coord list for that map
    return unless MapCoordSlip::MAP.has_key?($game_map.map_id)
    # Create list of array coordinates
    coord_list = []
    coord_list = MapCoordSlip::MAP[$game_map.map_id]
    # Cycle through map coordinates for map
    for coord in coord_list
      # If the player is in matching coordinates
      if ($game_player.x).between?(coord[0],coord[2]) &&
        ($game_player.y).between?(coord[1],coord[3])
        # Cycle through actors
        for actor in @actors
          # As long as actor has HP
          if actor.hp > 0
            # Apply Slip Damage
            actor.hp -= [actor.maxhp / 100, 1].max
            # If Actor HP reaches 0
            if actor.hp == 0
              # Perform Collapse
              $game_system.se_play($data_system.actor_collapse_se)
            end
            # Flash
            $game_screen.start_flash(Color.new(255,0,0,128), 4)
            # Got to game over if all dead
            $game_temp.gameover = $game_party.all_dead?
          end
        end
        # Exit as player was in area and damage was applied
        return
      end
    end
  end
end



#==============================================================================
# ** Game_Player
#------------------------------------------------------------------------------
#  This class handles the player. Its functions include event starting
#  determinants and map scrolling. Refer to "$game_player" for the one
#  instance of this class.
#==============================================================================

class Game_Player < Game_Character
  #--------------------------------------------------------------------------
  # * Increaase Steps
  #--------------------------------------------------------------------------
  alias waahaa increase_steps
  def increase_steps
    waahaa
    # If move route is not forcing
    $game_party.extra_slip_damage unless @move_route_forcing
  end
end



RE: What's up, RMers? - Ahzoh - 09-14-2016

Thanks, but where am I supposed to put that? I figured out where to put it.

Also two things: 1) I planned on the character having a red glow animation [as opposed to the whole screen being red] every second or so to show that the player is taking damage [It would do the same kind of thing for other kinds of environment damage like cold and desert heat] and 2) the titles should also deal damage even as the player just stands on it.


RE: What's up, RMers? - DerVVulfman - 09-14-2016

That script can just go between Scene_Debug and Main, and it was designed to apply extra slip damage when you take a step within set coordinates. In there, you set one or more rectangle areas [ x1, y1, x2, y2 ] for each map you wanted to have slip damage.

But it appears you want something different. Your damage is based on applying damage to the player/party in timed increments. That is a little different, but not impossible.

No time right now... Tomorrow mebby?


RE: What's up, RMers? - Ahzoh - 09-14-2016

Well, have you played or watched Metroid Prime Echoes?


RE: What's up, RMers? - DerVVulfman - 09-14-2016

Nope. But I understand the premise of standing around while your character's life drains away. I do have a script that does that, but it covers a whole map, not a tile area from (X,Y) to (X,Y).


RE: What's up, RMers? - Ahzoh - 09-14-2016

(09-14-2016, 04:57 AM)DerVVulfman Wrote: Nope.  But I understand the premise of standing around while your character's life drains away.  I do have a script that does that, but it covers a whole map, not a tile area from (X,Y) to (X,Y).

In Metroid Prime Echoes, while all of Dark Aether will drain your hp over time, there are little "safespots" where your hp is not drained.


RE: What's up, RMers? - Melana - 09-14-2016

I've made a little event system for that. You only need 1 switch and 1 event for each savezone.
Try it out: http://www.file-upload.net/download-11935432/HPDrainingZones.rar.html

It will only work with rectangular zones right now.


RE: What's up, RMers? - Ahzoh - 09-14-2016

Thanks, this is what I am looking for, although it seems to stop when players reach 1 health. Also, quadratic zones?


RE: What's up, RMers? - Melana - 09-14-2016

I edited it to rectangular. The savezone couldn't look like this:

[Image: sample3elhpdnw6s.png]

Would need a more complicated configuration.

Edit:That event command can't turn on the game over sequence. But you can allow it to drop to 0 health, i think.
For a game over you would need an additional parallel process event.


RE: What's up, RMers? - Ahzoh - 09-14-2016

It also seems to stop at 1 hp.