Skip to content

Commit

Permalink
Add smoke effect
Browse files Browse the repository at this point in the history
Partially addresses #14
  • Loading branch information
RoboMWM committed Feb 18, 2017
1 parent d7582df commit ff74bd5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
# DeathSpectating
When a player dies, they will "watch" ("spectate") their killer the moment they die for a brief period of time before respawning. This is similar to most FPS games.

//TODO: video
Video: https://www.youtube.com/watch?v=NLXQV4Ff1jY

[Documentation](https://github.com/MLG-Fortress/DeathSpectating/wiki)

Players in death spectating mode will not be able to move or do anything other than spectate at their death location (duh), chat, and use a set of commands that you allow (such as /me, /msg, etc.)

Unlike some other plugins, this one attempts to **maintain compatiblity with existing plugins,** particularly those that handle death and respawning (PlayerDeathEvent and PlayerRespawnEvent). There are some minor [caveats](https://github.com/MLG-Fortress/DeathSpectating/wiki/Caveats) due to manually performing this sort of compatibility, primarily because the player does not "actually" die or respawn. But the difference in experience is far better when a player does not "actually" die. More info here on that (and a small story of how this plugin came to be) if you're interested: //TODO: add sway.com presentation here

### Addons
DeathSpectating supports addons, such as sending a Title message to the death spectating player along with the time remaining until respawn. Here's a [list of publicly available DeathSpectating addons!](https://github.com/MLG-Fortress/DeathSpectating/wiki/Addons)
8 changes: 7 additions & 1 deletion src/main/java/to/us/tf/DeathSpectating/DeathSpectating.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
package to.us.tf.DeathSpectating;

import org.bukkit.Effect;
import org.bukkit.GameMode;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.Particle;
import org.bukkit.Statistic;
import org.bukkit.World;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.entity.Creature;
import org.bukkit.entity.Entity;
Expand All @@ -21,6 +24,7 @@
import org.bukkit.metadata.FixedMetadataValue;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.potion.PotionEffect;
import org.bukkit.scheduler.BukkitRunnable;
import to.us.tf.DeathSpectating.events.DeathSpectatingEvent;
import to.us.tf.DeathSpectating.listeners.DamageListener;
import to.us.tf.DeathSpectating.listeners.MiscListeners;
Expand Down Expand Up @@ -199,7 +203,9 @@ public boolean startDeathSpectating(Player player)
player.setStatistic(Statistic.TIME_SINCE_DEATH, 0);

//TODO: Non-vanilla behavior: Player death animation (red and falling over) (Issue #13)
//TODO: Non-vanilla behavior: Smoke effect after 20 ticks (Issue #14)
//Smoke effect //TODO: after 20 ticks (Issue #14) (Will implement 20 tick delay after issue #13 is resolved
if (isSpectating(player)) //TODO: does smoke effect/death animation occur if player#spigot()#respawn() is called on death? My guess is no.
player.getWorld().spawnParticle(Particle.CLOUD, player.getLocation(), 25);

//Clear potion effects
for (PotionEffect potionEffect : player.getActivePotionEffects())
Expand Down

0 comments on commit ff74bd5

Please sign in to comment.