clintbellanger / flare

Free Libre Action Roleplaying Engine
http://clintbellanger.net/rpg/
GNU General Public License v3.0
166 stars 41 forks source link

Traps #575

Open clintbellanger opened 12 years ago

clintbellanger commented 12 years ago

I want to start implementing traps in Flare. I'm looking for ideas for traps and how they might look using the current implementation of events + powers.

Example 1: Classic pressure plate arrow trap

In the dungeon tile set, use one of the offset looking flagstone tiles. Create an event on that square. When the player steps on that square play a click sound, change the tile to a flat one, and spawn an arrow that shoots at the hero. It can be a run_once event.

Example 2: Spiked floor trap

Perhaps use these over dungeon grates. Create an event on a specific square. When the player steps on that square, a new hazard with spikes animation occurs. Instead of run_once, put a delay on it so that it can occur again a few seconds later. As far as I know this can be done currently, if I create the art for it. If the spikes are only active at their topmost frame it could give players a tiny moment to trigger then dodge the trap.

Example 3: Pendulum blade trap

Imagine a swinging pendulum that is safe at the top of its swing but is dangerous at the bottom. Let's say this pendulum swings in a 4x1 tile area. There are several tricky parts here that I'm not sure our current system can handle:

Example 4: Saw blades that move long distances

Unlike the Pendulum which is basically not moving location, a saw blade in the floor might move all the way across a room and come back once it hits a wall. It is hazardous the entire time. Maybe this can be done in a simple way by allowing moving powers to reflect off walls? Then this could be a missile type that doesn't go away when it hits a target.

I'd like a Metal Elemental boss that casts these. Imagine if you had to kill the boss before the room was just too full of saw blades to survive.

Example 5: Flame Jets

These could go off at intervals automatically or trigger from a pressure plate.

Example 6: Caltrops

These could be a power with a long lifetime that sit on the floor, and cause damage + slow when stepped on. We might give this power to enemies or the player (either as a ranger type Power or a consumable item).

Example 7: Bear Trap

Similar to Caltrops, this one would would have an after effect power to show the closed trap for a few seconds. I think this would work anyway. This one would immobilize instead of slow. We could have the player or creatures drop these as well.

Example 8: Sphere of Annihilation

Touch it and you die.


What other classic trap types could we add, and how might they be implemented?

For some of these traps, it would be neat if they could be disabled by the player. What if you got close to an Arrow Pressure Plate and clicked on the tile, and the arrow would sail by harmlessly? What if on the other end of a Pendulum Hallway there's a switch you can throw to turn them off?

makrohn commented 12 years ago

So right now, I've got this working in a completely roundabout way by making an enemy, platetrap.txt or something similar with speed/dspeed=0, avoidance=100 which just unleashes a Quake power or something similar to damage the player when they get close. It's a little shoddy right now, as I can't seem to get the timing quite right. Not sure how one would go about disarming that.

pennomi commented 12 years ago

makrohn, It's also possible to use map events to spawn powers directly.

See: https://github.com/clintbellanger/flare/blob/master/mods/living_bones/maps/brothers_lair_fire_hall.txt#L306

makrohn commented 12 years ago

Ah! Clutch.

clintbellanger commented 12 years ago

As mentioned in commit f223038 I've added some new logic to map event powers:

I've created floor spike traps. Here's an example of how they look in plain text:

[event]
# floor spikes
location=24,81,1,1 
power=160
power_damage=10,15
power_cooldown=90
hotspot=-32,-16,64,32

Here they're on tile 24,81 (I was testing with Ancient Temple). Power damage must be specified (that's fine, makes the power reusable).

Note there's a hotspot. If the player clicks on the trap square he can trigger the trap, then safely move past it (well, power_cooldown gives him 3 seconds to do so).

You'd want one of these events per trapped tiled. Because location is based on Tiled's object position, it's easy to copy/paste these traps.

clintbellanger commented 12 years ago

Updates from 93f49c1ce2

I uploaded the ancient temple exported file (spike traps in the northwest room). I also updated the existing traps in the Averguard and Living Bones mods.

ghost commented 12 years ago

I noticed that an empty tooltip appears when you hover the spikes trap in Ancient Temple. Maybe it would be better to not render the tooltip at all? Or specify correct tooltip in frontier/maps/ancient_temple.txt?

clintbellanger commented 12 years ago

Looks like an oversight in some recent refactoring. If an event has a Hotspot but no Tooltip, the tooltip should not be displayed. This allows for "secret" clickable events like these traps.

igorko commented 10 years ago

@clintbellanger Do we support this fully? Or there is still some TODO?