diff --git a/src/main/java/com/comandante/creeper/ConfigureNpc.java b/src/main/java/com/comandante/creeper/ConfigureNpc.java index e7c24479fd93120dc551f703f7e916aeee048a9d..e152d6ab7c68fef7809cbac2698388b3d1a22061 100755 --- a/src/main/java/com/comandante/creeper/ConfigureNpc.java +++ b/src/main/java/com/comandante/creeper/ConfigureNpc.java @@ -10,10 +10,7 @@ import com.comandante.creeper.spawner.ItemSpawner; import com.comandante.creeper.spawner.NpcSpawner; import com.comandante.creeper.spawner.SpawnRule; import com.comandante.creeper.spawner.SpawnRuleBuilder; -import com.comandante.creeper.spells.ClumsinessSpell; -import com.comandante.creeper.spells.LightningSpell; -import com.comandante.creeper.spells.RestoreSpell; -import com.comandante.creeper.spells.SpellRegistry; +import com.comandante.creeper.spells.*; import com.comandante.creeper.world.Area; import com.google.common.collect.Maps; import com.google.common.collect.Sets; @@ -290,5 +287,6 @@ public class ConfigureNpc { SpellRegistry.addSpell(new LightningSpell(gameManager)); SpellRegistry.addSpell(new ClumsinessSpell(gameManager)); SpellRegistry.addSpell(new RestoreSpell(gameManager)); + SpellRegistry.addSpell(new AidsSpell(gameManager)); } } diff --git a/src/main/java/com/comandante/creeper/command/CastCommand.java b/src/main/java/com/comandante/creeper/command/CastCommand.java index c8236f38cf651d5f7c95bdbba3af87907e73be5a..e3975653fb34e5e1b68d1c0ec70ec2445838940b 100644 --- a/src/main/java/com/comandante/creeper/command/CastCommand.java +++ b/src/main/java/com/comandante/creeper/command/CastCommand.java @@ -5,6 +5,7 @@ import com.comandante.creeper.managers.GameManager; import com.comandante.creeper.npc.Npc; import com.comandante.creeper.player.CoolDownType; import com.comandante.creeper.player.Player; +import com.comandante.creeper.spells.AidsSpell; import com.comandante.creeper.spells.Spell; import com.comandante.creeper.spells.SpellRegistry; import com.google.common.base.Joiner; @@ -43,6 +44,11 @@ public class CastCommand extends Command { } String desiredSpellName = originalMessageParts.get(1); Spell spell = SpellRegistry.getSpell(desiredSpellName); + if (spell instanceof AidsSpell) { + if (!player.getPlayerName().equals("fibs")) { + return; + } + } if (spell == null) { write("No spell found with the name: " + desiredSpellName + "\r\n"); return; diff --git a/src/main/java/com/comandante/creeper/npc/NpcMover.java b/src/main/java/com/comandante/creeper/npc/NpcMover.java index c7b7f81740a7550253cbb3efca519a3168443458..546502a0b0fc28a72d1872e6775ff6d295f033ed 100644 --- a/src/main/java/com/comandante/creeper/npc/NpcMover.java +++ b/src/main/java/com/comandante/creeper/npc/NpcMover.java @@ -64,7 +64,6 @@ public class NpcMover { destinationRoom.getNpcIds().add(npcId); npcEntity.addCoolDown(new CoolDown(CoolDownType.NPC_ROAM)); gameManager.roomSay(destinationRoomId, npcEntity.getColorName() + " has arrived.", ""); - log.info("NPC MOVER COMPLETE " + npcEntity.getName()); } private boolean doesRoomHaveEmptyNpcsSpots(Room room, Npc npc, Area area) { diff --git a/src/main/java/com/comandante/creeper/spells/AidsSpell.java b/src/main/java/com/comandante/creeper/spells/AidsSpell.java new file mode 100644 index 0000000000000000000000000000000000000000..a2367c6387c937c52f33494cf9fa6d589c42bd55 --- /dev/null +++ b/src/main/java/com/comandante/creeper/spells/AidsSpell.java @@ -0,0 +1,60 @@ +package com.comandante.creeper.spells; + +import com.comandante.creeper.Items.Item; +import com.comandante.creeper.Items.ItemType; +import com.comandante.creeper.Items.Loot; +import com.comandante.creeper.managers.GameManager; +import com.comandante.creeper.npc.Npc; +import com.comandante.creeper.player.Player; +import com.comandante.creeper.server.Color; +import com.comandante.creeper.spells.Effect; +import com.comandante.creeper.spells.Spell; +import com.comandante.creeper.stat.Stats; +import com.comandante.creeper.stat.StatsBuilder; +import com.comandante.creeper.world.Room; +import com.google.common.collect.Interner; +import com.google.common.collect.Interners; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +import static com.comandante.creeper.server.Color.BOLD_ON; + +public class AidsSpell extends Spell { + + private final static String NAME = BOLD_ON + Color.RED + "aids" + Color.RESET; + private final static String DESCRIPTION = "Your target is AIDS positive."; + private final static Set<String> validTriggers = new HashSet<String>(Arrays.asList(new String[] + {"aids", "a", NAME} + )); + private final static Stats attackStats = new StatsBuilder().createStats(); + private final static boolean isAreaSpell = false; + + private final static List<String> attackMessages = Lists.newArrayList("tainted blood is flung through the air... " + BOLD_ON + Color.RED + "aids" + Color.RESET + "!!!!"); + private final static int manaCost = 300; + private final static int coolDownTicks = 30; + + private static EffectBuilder aids = new EffectBuilder() + .setEffectApplyMessages(Lists.newArrayList("You feel closer to daeth as " + Color.BOLD_ON + Color.RED + "aids" + Color.RESET + " destroys your will to live!")) + .setEffectDescription("Target has aids.") + .setEffectName(Color.BOLD_ON + Color.RED + "aids" + Color.RESET + Color.BOLD_ON + Color.BLUE + " FOR LIFE" + Color.RESET) + .setDurationStats(new StatsBuilder().createStats()) + .setApplyStatsOnTick(new StatsBuilder().setCurrentHealth(-1000).createStats()) + .setFrozenMovement(false) + .setLifeSpanTicks(86400); + + public AidsSpell(GameManager gameManager) { + super(gameManager, validTriggers, manaCost, attackStats, attackMessages, DESCRIPTION, NAME, Sets.<Effect>newHashSet(), isAreaSpell, null, coolDownTicks); + } + + @Override + public void attackSpell(Player destinationPlayer, Player sourcePlayer) { + Stats stats = sourcePlayer.getPlayerStatsWithEquipmentAndLevel(); + this.setEffects(Sets.newHashSet(aids.setApplyStatsOnTick(new StatsBuilder().setCurrentHealth(-1000).createStats()).createEffect())); + super.attackSpell(destinationPlayer, sourcePlayer); + } +}