From 7f2aea1dd968081a66503c63811f1a2341915d27 Mon Sep 17 00:00:00 2001 From: hmdzl001 <295754791@qq.com> Date: Tue, 22 Sep 2020 11:53:17 +0800 Subject: [PATCH] 0.9.5 0.9.5 --- assets/bamboo.png | Bin 0 -> 3025 bytes assets/blackmeow.png | Bin 0 -> 4023 bytes assets/catsheep.png | Bin 0 -> 694 bytes assets/consumable_icons.png | Bin 4371 -> 4425 bytes assets/follower.png | Bin 10895 -> 11559 bytes assets/greatmoss.png | Bin 0 -> 4620 bytes assets/icerabbit.png | Bin 0 -> 6824 bytes assets/items.png | Bin 84357 -> 86519 bytes assets/mage.png | Bin 11825 -> 11960 bytes assets/performer.png | Bin 12338 -> 11712 bytes assets/ranger.png | Bin 11922 -> 11720 bytes assets/rogue.png | Bin 11360 -> 11172 bytes assets/soldier.png | Bin 11661 -> 11800 bytes assets/statue.png | Bin 1331 -> 4563 bytes assets/warrior.png | Bin 12211 -> 11542 bytes java/com/hmdzl/spspd/Assets.java | 7 + java/com/hmdzl/spspd/Dungeon.java | 16 +- java/com/hmdzl/spspd/Rankings.java | 2 +- java/com/hmdzl/spspd/Skins.java | 6 +- java/com/hmdzl/spspd/actors/Char.java | 21 + .../ToxicGas.java => actors/blobs/NmGas.java} | 32 +- .../blobs/PoisonGas.java} | 36 +- .../actors/blobs/WaterOfTransmutation.java | 4 - .../hmdzl/spspd/actors/buffs/DBurning.java | 144 + .../Hot.java => actors/buffs/MagicWeak.java} | 10 +- .../hmdzl/spspd/actors/buffs/NewCombo.java | 8 +- .../spspd/actors/buffs/actbuff/NmImbue.java | 132 + .../buffs/actbuff/Nmstop.java} | 15 +- .../buffs/mindbuff/AmokMind.java} | 25 +- .../buffs/mindbuff/CrazyMind.java} | 37 +- .../buffs/mindbuff/HopeMind.java} | 26 +- .../buffs/mindbuff/KeepMind.java} | 61 +- .../buffs/mindbuff/LoseMind.java} | 17 +- .../actors/buffs/mindbuff/TerrorMind.java | 48 + .../spspd/actors/buffs/mindbuff/WeakMind.java | 48 + java/com/hmdzl/spspd/actors/hero/Hero.java | 132 +- .../hmdzl/spspd/actors/hero/HeroClass.java | 110 +- .../hmdzl/spspd/actors/mobs/BambooMob.java | 135 + java/com/hmdzl/spspd/actors/mobs/Bat.java | 3 +- .../com/hmdzl/spspd/actors/mobs/Bestiary.java | 16 +- .../com/hmdzl/spspd/actors/mobs/BrownBat.java | 2 +- .../hmdzl/spspd/actors/mobs/Greatmoss.java | 157 ++ .../com/hmdzl/spspd/actors/mobs/LiveMoss.java | 2 +- .../com/hmdzl/spspd/actors/mobs/MagicEye.java | 5 +- java/com/hmdzl/spspd/actors/mobs/Mob.java | 9 +- .../hmdzl/spspd/actors/mobs/SewerHeart.java | 2 +- java/com/hmdzl/spspd/actors/mobs/Swarm.java | 5 +- .../hmdzl/spspd/actors/mobs/UIcecorps.java | 23 +- .../mobs/UIcecorps2.java} | 167 +- .../hmdzl/spspd/actors/mobs/YearBeast.java | 3 +- java/com/hmdzl/spspd/actors/mobs/Zot.java | 2 +- .../com/hmdzl/spspd/actors/mobs/ZotPhase.java | 2 +- .../mobs/npcs/BlackMeow.java} | 21 +- .../mobs/npcs/CatSheep.java} | 23 +- .../com/hmdzl/spspd/actors/mobs/npcs/HBB.java | 11 +- .../hmdzl/spspd/actors/mobs/npcs/Mtree.java | 5 +- .../com/hmdzl/spspd/actors/mobs/npcs/NPC.java | 3 + .../spspd/actors/mobs/npcs/Ravenwolf.java | 2 +- .../com/hmdzl/spspd/actors/mobs/pets/PET.java | 2 + java/com/hmdzl/spspd/change/Assets.java | 347 --- java/com/hmdzl/spspd/change/Badges.java | 1082 -------- java/com/hmdzl/spspd/change/Challenges.java | 46 - java/com/hmdzl/spspd/change/Chrome.java | 55 - java/com/hmdzl/spspd/change/Dungeon.java | 1545 ----------- .../hmdzl/spspd/change/DungeonTilemap.java | 99 - java/com/hmdzl/spspd/change/FogOfWar.java | 117 - .../hmdzl/spspd/change/GamesInProgress.java | 79 - java/com/hmdzl/spspd/change/Journal.java | 123 - java/com/hmdzl/spspd/change/Preferences.java | 75 - java/com/hmdzl/spspd/change/QuickSlot.java | 134 - java/com/hmdzl/spspd/change/Rankings.java | 255 -- .../spspd/change/ResultDescriptions.java | 49 - java/com/hmdzl/spspd/change/SPSSettings.java | 263 -- .../spspd/change/ShatteredPixelDungeon.java | 337 --- java/com/hmdzl/spspd/change/Skins.java | 37 - java/com/hmdzl/spspd/change/Statistics.java | 197 -- java/com/hmdzl/spspd/change/actors/Actor.java | 288 -- java/com/hmdzl/spspd/change/actors/Char.java | 751 ------ .../change/actors/animate/WeaponAnimate.java | 35 - .../spspd/change/actors/blobs/Alchemy.java | 76 - .../spspd/change/actors/blobs/Alter.java | 73 - .../hmdzl/spspd/change/actors/blobs/Blob.java | 213 -- .../change/actors/blobs/ConfusionGas.java | 56 - .../spspd/change/actors/blobs/CorruptGas.java | 86 - .../spspd/change/actors/blobs/DarkGas.java | 54 - .../change/actors/blobs/ElectriShock.java | 106 - .../hmdzl/spspd/change/actors/blobs/Fire.java | 154 -- .../spspd/change/actors/blobs/Foliage.java | 87 - .../spspd/change/actors/blobs/Freezing.java | 63 - .../spspd/change/actors/blobs/FrostGas.java | 113 - .../spspd/change/actors/blobs/GooWarn.java | 53 - .../spspd/change/actors/blobs/HealLight.java | 73 - .../spspd/change/actors/blobs/MemoryFire.java | 139 - .../change/actors/blobs/ParalyticGas.java | 54 - .../spspd/change/actors/blobs/Portal.java | 63 - .../spspd/change/actors/blobs/Regrowth.java | 78 - .../spspd/change/actors/blobs/ShockWeb.java | 82 - .../spspd/change/actors/blobs/SlowWeb.java | 71 - .../spspd/change/actors/blobs/StenchGas.java | 40 - .../spspd/change/actors/blobs/VenomGas.java | 83 - .../spspd/change/actors/blobs/Water.java | 70 - .../change/actors/blobs/WaterOfAwareness.java | 105 - .../change/actors/blobs/WaterOfHealth.java | 80 - .../actors/blobs/WaterOfTransmutation.java | 229 -- .../actors/blobs/WaterOfUpgradeEating.java | 103 - .../hmdzl/spspd/change/actors/blobs/Web.java | 70 - .../spspd/change/actors/blobs/WellWater.java | 166 -- .../actors/blobs/weather/WeatherOfDead.java | 59 - .../actors/blobs/weather/WeatherOfQuite.java | 59 - .../actors/blobs/weather/WeatherOfRain.java | 57 - .../actors/blobs/weather/WeatherOfSand.java | 56 - .../actors/blobs/weather/WeatherOfSnow.java | 57 - .../actors/blobs/weather/WeatherOfSun.java | 56 - .../spspd/change/actors/buffs/AflyBless.java | 49 - .../hmdzl/spspd/change/actors/buffs/Amok.java | 52 - .../spspd/change/actors/buffs/Arcane.java | 44 - .../spspd/change/actors/buffs/ArmorBreak.java | 92 - .../spspd/change/actors/buffs/AttackDown.java | 88 - .../spspd/change/actors/buffs/AttackUp.java | 88 - .../spspd/change/actors/buffs/Awareness.java | 52 - .../spspd/change/actors/buffs/Barkskin.java | 85 - .../actors/buffs/BerryRegeneration.java | 92 - .../spspd/change/actors/buffs/Bleeding.java | 108 - .../spspd/change/actors/buffs/Bless.java | 85 - .../spspd/change/actors/buffs/Blindness.java | 55 - .../spspd/change/actors/buffs/BloodAngry.java | 102 - .../spspd/change/actors/buffs/BloodImbue.java | 82 - .../spspd/change/actors/buffs/BoxStar.java | 60 - .../hmdzl/spspd/change/actors/buffs/Buff.java | 137 - .../spspd/change/actors/buffs/Burning.java | 189 -- .../spspd/change/actors/buffs/Charm.java | 72 - .../spspd/change/actors/buffs/Chill.java | 117 - .../spspd/change/actors/buffs/Combo.java | 76 - .../spspd/change/actors/buffs/Corruption.java | 72 - .../spspd/change/actors/buffs/CountDown.java | 89 - .../spspd/change/actors/buffs/Cripple.java | 50 - .../spspd/change/actors/buffs/DamageUp.java | 76 - .../spspd/change/actors/buffs/DeadRaise.java | 48 - .../spspd/change/actors/buffs/DefenceUp.java | 90 - .../spspd/change/actors/buffs/Disarm.java | 52 - .../spspd/change/actors/buffs/Drowsy.java | 65 - .../hmdzl/spspd/change/actors/buffs/Dry.java | 48 - .../spspd/change/actors/buffs/EarthImbue.java | 59 - .../spspd/change/actors/buffs/ExitFind.java | 43 - .../hmdzl/spspd/change/actors/buffs/Feed.java | 61 - .../spspd/change/actors/buffs/FireImbue.java | 100 - .../change/actors/buffs/FlavourBuff.java | 36 - .../change/actors/buffs/ForeverShadow.java | 93 - .../spspd/change/actors/buffs/Frost.java | 135 - .../spspd/change/actors/buffs/FrostImbue.java | 62 - .../change/actors/buffs/FullMoonStrength.java | 70 - .../change/actors/buffs/GasesImmunity.java | 66 - .../change/actors/buffs/GlassShield.java | 81 - .../spspd/change/actors/buffs/GoldTouch.java | 62 - .../spspd/change/actors/buffs/GrowSeed.java | 131 - .../spspd/change/actors/buffs/Haste.java | 43 - .../spspd/change/actors/buffs/HighAttack.java | 128 - .../spspd/change/actors/buffs/HighLight.java | 65 - .../spspd/change/actors/buffs/HighVoice.java | 94 - .../spspd/change/actors/buffs/Hunger.java | 221 -- .../change/actors/buffs/Invisibility.java | 93 - .../spspd/change/actors/buffs/Levitation.java | 68 - .../spspd/change/actors/buffs/Light.java | 72 - .../spspd/change/actors/buffs/Locked.java | 52 - .../change/actors/buffs/LokisPoison.java | 122 - .../change/actors/buffs/MagicImmunity.java | 74 - .../change/actors/buffs/MagicalSleep.java | 93 - .../spspd/change/actors/buffs/MechArmor.java | 88 - .../spspd/change/actors/buffs/MindVision.java | 50 - .../change/actors/buffs/MirrorShield.java | 64 - .../spspd/change/actors/buffs/Muscle.java | 49 - .../spspd/change/actors/buffs/Needling.java | 80 - .../spspd/change/actors/buffs/NewCombo.java | 310 --- .../spspd/change/actors/buffs/Notice.java | 63 - .../spspd/change/actors/buffs/Paralysis.java | 81 - .../spspd/change/actors/buffs/ParyAttack.java | 110 - .../spspd/change/actors/buffs/PinCushion.java | 45 - .../spspd/change/actors/buffs/Poison.java | 117 - .../spspd/change/actors/buffs/Recharging.java | 53 - .../change/actors/buffs/Regeneration.java | 62 - .../spspd/change/actors/buffs/Rhythm.java | 43 - .../spspd/change/actors/buffs/Rhythm2.java | 43 - .../spspd/change/actors/buffs/Roots.java | 65 - .../spspd/change/actors/buffs/Shadows.java | 106 - .../spspd/change/actors/buffs/Shield.java | 59 - .../change/actors/buffs/ShieldArmor.java | 65 - .../change/actors/buffs/Shieldblock.java | 73 - .../spspd/change/actors/buffs/Shocked.java | 124 - .../spspd/change/actors/buffs/Silent.java | 52 - .../spspd/change/actors/buffs/Sleep.java | 24 - .../hmdzl/spspd/change/actors/buffs/Slow.java | 52 - .../change/actors/buffs/SnipersMark.java | 57 - .../spspd/change/actors/buffs/SoulBless.java | 62 - .../spspd/change/actors/buffs/SoulMark.java | 54 - .../spspd/change/actors/buffs/SpAttack.java | 44 - .../spspd/change/actors/buffs/Speed.java | 24 - .../spspd/change/actors/buffs/Strength.java | 55 - .../hmdzl/spspd/change/actors/buffs/Tar.java | 71 - .../change/actors/buffs/TargetShoot.java | 44 - .../spspd/change/actors/buffs/Taunt.java | 41 - .../spspd/change/actors/buffs/Terror.java | 66 - .../spspd/change/actors/buffs/ToxicImbue.java | 87 - .../spspd/change/actors/buffs/Venom.java | 91 - .../spspd/change/actors/buffs/Vertigo.java | 51 - .../spspd/change/actors/buffs/Weakness.java | 80 - .../hmdzl/spspd/change/actors/buffs/Wet.java | 48 - .../actors/buffs/armorbuff/GlyphDark.java | 27 - .../actors/buffs/armorbuff/GlyphEarth.java | 22 - .../buffs/armorbuff/GlyphElectricity.java | 29 - .../actors/buffs/armorbuff/GlyphFire.java | 29 - .../actors/buffs/armorbuff/GlyphIce.java | 24 - .../actors/buffs/armorbuff/GlyphLight.java | 23 - .../actors/buffs/faithbuff/BalanceFaith.java | 53 - .../actors/buffs/faithbuff/DemonFaith.java | 53 - .../actors/buffs/faithbuff/HumanFaith.java | 53 - .../actors/buffs/faithbuff/MechFaith.java | 53 - .../spspd/change/actors/hero/Belongings.java | 356 --- .../hmdzl/spspd/change/actors/hero/Hero.java | 2388 ----------------- .../spspd/change/actors/hero/HeroAction.java | 99 - .../spspd/change/actors/hero/HeroClass.java | 831 ------ .../change/actors/hero/HeroSubClass.java | 72 - .../spspd/change/actors/mobs/Acidic.java | 71 - .../change/actors/mobs/AdultDragonViolet.java | 168 -- .../spspd/change/actors/mobs/Albino.java | 72 - .../change/actors/mobs/AlbinoPiranha.java | 206 -- .../spspd/change/actors/mobs/Assassin.java | 131 - .../spspd/change/actors/mobs/Bandit.java | 63 - .../spspd/change/actors/mobs/BanditKing.java | 89 - .../hmdzl/spspd/change/actors/mobs/Bat.java | 104 - .../spspd/change/actors/mobs/Bestiary.java | 339 --- .../spspd/change/actors/mobs/BlueCat.java | 172 -- .../spspd/change/actors/mobs/BlueWraith.java | 107 - .../spspd/change/actors/mobs/BrokenRobot.java | 273 -- .../spspd/change/actors/mobs/BrownBat.java | 83 - .../hmdzl/spspd/change/actors/mobs/Brute.java | 118 - .../hmdzl/spspd/change/actors/mobs/Crab.java | 58 - .../spspd/change/actors/mobs/CrabKing.java | 174 -- .../hmdzl/spspd/change/actors/mobs/DM300.java | 445 --- .../spspd/change/actors/mobs/DemonFlower.java | 170 -- .../spspd/change/actors/mobs/DemonGoo.java | 216 -- .../spspd/change/actors/mobs/Dragonking.java | 101 - .../spspd/change/actors/mobs/DustElement.java | 73 - .../spspd/change/actors/mobs/DwarfLich.java | 123 - .../spspd/change/actors/mobs/ElderAvatar.java | 784 ------ .../hmdzl/spspd/change/actors/mobs/Eye.java | 200 -- .../spspd/change/actors/mobs/FetidRat.java | 93 - .../hmdzl/spspd/change/actors/mobs/Fiend.java | 167 -- .../change/actors/mobs/FireElemental.java | 115 - .../spspd/change/actors/mobs/FireRabbit.java | 103 - .../change/actors/mobs/FishProtector.java | 147 - .../change/actors/mobs/FlyingProtector.java | 153 -- .../change/actors/mobs/ForestProtector.java | 145 - .../hmdzl/spspd/change/actors/mobs/Gnoll.java | 73 - .../spspd/change/actors/mobs/GnollArcher.java | 131 - .../spspd/change/actors/mobs/GnollKing.java | 339 --- .../spspd/change/actors/mobs/GnollShaman.java | 145 - .../change/actors/mobs/GnollTrickster.java | 127 - .../change/actors/mobs/GoldCollector.java | 76 - .../spspd/change/actors/mobs/GoldOrc.java | 98 - .../spspd/change/actors/mobs/GoldThief.java | 183 -- .../hmdzl/spspd/change/actors/mobs/Golem.java | 126 - .../hmdzl/spspd/change/actors/mobs/Goo.java | 573 ---- .../change/actors/mobs/GraveProtector.java | 144 - .../spspd/change/actors/mobs/GreatCrab.java | 90 - .../spspd/change/actors/mobs/GreyRat.java | 140 - .../hmdzl/spspd/change/actors/mobs/Guard.java | 232 -- .../spspd/change/actors/mobs/HermitCrab.java | 173 -- .../spspd/change/actors/mobs/Hybrid.java | 355 --- .../hmdzl/spspd/change/actors/mobs/King.java | 476 ---- .../change/actors/mobs/LevelChecker.java | 87 - .../spspd/change/actors/mobs/LichDancer.java | 393 --- .../spspd/change/actors/mobs/LitTower.java | 207 -- .../spspd/change/actors/mobs/LiveMoss.java | 86 - .../spspd/change/actors/mobs/MagicEye.java | 193 -- .../change/actors/mobs/ManySkeleton.java | 150 -- .../hmdzl/spspd/change/actors/mobs/Mimic.java | 171 -- .../change/actors/mobs/MineSentinel.java | 264 -- .../hmdzl/spspd/change/actors/mobs/Mob.java | 1061 -------- .../hmdzl/spspd/change/actors/mobs/Monk.java | 119 - .../spspd/change/actors/mobs/MonsterBox.java | 183 -- .../change/actors/mobs/MossySkeleton.java | 136 - .../spspd/change/actors/mobs/Musketeer.java | 149 - .../spspd/change/actors/mobs/NormalCell.java | 51 - .../spspd/change/actors/mobs/OrbOfZotMob.java | 221 -- .../hmdzl/spspd/change/actors/mobs/Orc.java | 97 - .../spspd/change/actors/mobs/Otiluke.java | 210 -- .../spspd/change/actors/mobs/PatrolUAV.java | 111 - .../spspd/change/actors/mobs/Piranha.java | 164 -- .../change/actors/mobs/PlagueDoctor.java | 474 ---- .../change/actors/mobs/PrisonWander.java | 395 --- .../hmdzl/spspd/change/actors/mobs/Rat.java | 89 - .../spspd/change/actors/mobs/RatBoss.java | 75 - .../spspd/change/actors/mobs/RedWraith.java | 200 -- .../spspd/change/actors/mobs/SandMob.java | 171 -- .../spspd/change/actors/mobs/Scorpio.java | 121 - .../spspd/change/actors/mobs/Senior.java | 68 - .../spspd/change/actors/mobs/Sentinel.java | 184 -- .../spspd/change/actors/mobs/SewerHeart.java | 539 ---- .../spspd/change/actors/mobs/ShadowYog.java | 221 -- .../hmdzl/spspd/change/actors/mobs/Shell.java | 330 --- .../spspd/change/actors/mobs/Shielded.java | 58 - .../spspd/change/actors/mobs/Skeleton.java | 169 -- .../change/actors/mobs/SkeletonHand1.java | 108 - .../change/actors/mobs/SkeletonHand2.java | 111 - .../change/actors/mobs/SkeletonKing.java | 134 - .../change/actors/mobs/SokobanSentinel.java | 205 -- .../change/actors/mobs/SommonSkeleton.java | 134 - .../spspd/change/actors/mobs/SpiderBot.java | 133 - .../spspd/change/actors/mobs/SpiderQueen.java | 665 ----- .../spspd/change/actors/mobs/Spinner.java | 130 - .../spspd/change/actors/mobs/Statue.java | 174 -- .../spspd/change/actors/mobs/Succubus.java | 169 -- .../spspd/change/actors/mobs/Sufferer.java | 106 - .../hmdzl/spspd/change/actors/mobs/Swarm.java | 147 - .../hmdzl/spspd/change/actors/mobs/Tank.java | 279 -- .../hmdzl/spspd/change/actors/mobs/Tengu.java | 225 -- .../spspd/change/actors/mobs/TenguDen.java | 210 -- .../spspd/change/actors/mobs/TestMob.java | 152 -- .../spspd/change/actors/mobs/TestMob2.java | 154 -- .../hmdzl/spspd/change/actors/mobs/Thief.java | 130 - .../spspd/change/actors/mobs/ThiefImp.java | 173 -- .../spspd/change/actors/mobs/ThiefKing.java | 116 - .../change/actors/mobs/TrollWarrior.java | 122 - .../spspd/change/actors/mobs/UAmulet.java | 238 -- .../spspd/change/actors/mobs/UDM300.java | 345 --- .../hmdzl/spspd/change/actors/mobs/UGoo.java | 630 ----- .../hmdzl/spspd/change/actors/mobs/UKing.java | 231 -- .../spspd/change/actors/mobs/UTengu.java | 281 -- .../hmdzl/spspd/change/actors/mobs/UYog.java | 192 -- .../change/actors/mobs/VaultProtector.java | 143 - .../hmdzl/spspd/change/actors/mobs/Virus.java | 139 - .../spspd/change/actors/mobs/Warlock.java | 153 -- .../spspd/change/actors/mobs/Wraith.java | 191 -- .../spspd/change/actors/mobs/YearBeast.java | 261 -- .../spspd/change/actors/mobs/YearBeast2.java | 239 -- .../hmdzl/spspd/change/actors/mobs/Yog.java | 747 ------ .../spspd/change/actors/mobs/Zombie.java | 106 - .../hmdzl/spspd/change/actors/mobs/Zot.java | 319 --- .../spspd/change/actors/mobs/ZotPhase.java | 98 - .../spspd/change/actors/mobs/npcs/AFly.java | 87 - .../change/actors/mobs/npcs/ARealMan.java | 64 - .../change/actors/mobs/npcs/Apostle.java | 85 - .../change/actors/mobs/npcs/Bilboldev.java | 85 - .../change/actors/mobs/npcs/Blacksmith.java | 370 --- .../change/actors/mobs/npcs/Blacksmith2.java | 201 -- .../change/actors/mobs/npcs/Coconut.java | 86 - .../change/actors/mobs/npcs/Coconut2.java | 86 - .../actors/mobs/npcs/ConsideredHamster.java | 82 - .../change/actors/mobs/npcs/Dachhack.java | 85 - .../change/actors/mobs/npcs/DreamPlayer.java | 84 - .../spspd/change/actors/mobs/npcs/Evan.java | 82 - .../change/actors/mobs/npcs/FruitCat.java | 83 - .../change/actors/mobs/npcs/G2159687.java | 88 - .../spspd/change/actors/mobs/npcs/Ghost.java | 355 --- .../change/actors/mobs/npcs/GoblinPlayer.java | 84 - .../spspd/change/actors/mobs/npcs/HBB.java | 91 - .../change/actors/mobs/npcs/HateSokoban.java | 80 - .../spspd/change/actors/mobs/npcs/HeXA.java | 82 - .../change/actors/mobs/npcs/Hmdzl001.java | 87 - .../change/actors/mobs/npcs/HoneyPoooot.java | 84 - .../spspd/change/actors/mobs/npcs/Ice13.java | 96 - .../spspd/change/actors/mobs/npcs/Imp.java | 227 -- .../actors/mobs/npcs/ImpShopkeeper.java | 64 - .../change/actors/mobs/npcs/Jinkeloid.java | 84 - .../change/actors/mobs/npcs/Juh9870.java | 82 - .../change/actors/mobs/npcs/Kostis12345.java | 84 - .../spspd/change/actors/mobs/npcs/LaJi.java | 81 - .../change/actors/mobs/npcs/Locastan.java | 85 - .../spspd/change/actors/mobs/npcs/Lyn.java | 83 - .../spspd/change/actors/mobs/npcs/Lynn.java | 82 - .../change/actors/mobs/npcs/MemoryOfSand.java | 82 - .../change/actors/mobs/npcs/Millilitre.java | 84 - .../change/actors/mobs/npcs/MirrorImage.java | 165 -- .../spspd/change/actors/mobs/npcs/Mtree.java | 111 - .../spspd/change/actors/mobs/npcs/NPC.java | 54 - .../spspd/change/actors/mobs/npcs/NYRDS.java | 80 - .../change/actors/mobs/npcs/NewPlayer.java | 78 - .../change/actors/mobs/npcs/NutPainter.java | 84 - .../change/actors/mobs/npcs/OldNewStwist.java | 100 - .../change/actors/mobs/npcs/Omicronrg9.java | 96 - .../change/actors/mobs/npcs/OtilukeNPC.java | 91 - .../spspd/change/actors/mobs/npcs/RENnpc.java | 100 - .../change/actors/mobs/npcs/RainTrainer.java | 83 - .../change/actors/mobs/npcs/RatKing.java | 119 - .../change/actors/mobs/npcs/RatKingDen.java | 89 - .../change/actors/mobs/npcs/Ravenwolf.java | 84 - .../change/actors/mobs/npcs/Rustyblade.java | 83 - .../spspd/change/actors/mobs/npcs/SFB.java | 86 - .../spspd/change/actors/mobs/npcs/SP931.java | 84 - .../change/actors/mobs/npcs/SadSaltan.java | 69 - .../change/actors/mobs/npcs/SaidbySun.java | 84 - .../spspd/change/actors/mobs/npcs/Sheep.java | 64 - .../change/actors/mobs/npcs/SheepSokoban.java | 100 - .../actors/mobs/npcs/SheepSokobanBlack.java | 111 - .../actors/mobs/npcs/SheepSokobanCorner.java | 112 - .../actors/mobs/npcs/SheepSokobanStop.java | 68 - .../actors/mobs/npcs/SheepSokobanSwitch.java | 68 - .../change/actors/mobs/npcs/Shopkeeper.java | 91 - .../spspd/change/actors/mobs/npcs/Shower.java | 87 - .../change/actors/mobs/npcs/StormAndRain.java | 82 - .../change/actors/mobs/npcs/Tempest102.java | 82 - .../change/actors/mobs/npcs/ThankList.java | 202 -- .../change/actors/mobs/npcs/Tinkerer1.java | 95 - .../change/actors/mobs/npcs/Tinkerer2.java | 92 - .../change/actors/mobs/npcs/Tinkerer3.java | 94 - .../change/actors/mobs/npcs/Tinkerer4.java | 107 - .../change/actors/mobs/npcs/Tinkerer5.java | 114 - .../change/actors/mobs/npcs/TypedScroll.java | 83 - .../spspd/change/actors/mobs/npcs/Udawos.java | 81 - .../spspd/change/actors/mobs/npcs/UncleS.java | 77 - .../change/actors/mobs/npcs/Wandmaker.java | 327 --- .../change/actors/mobs/npcs/Watabou.java | 82 - .../change/actors/mobs/npcs/WhiteGhost.java | 76 - .../change/actors/mobs/npcs/XixiZero.java | 87 - .../change/actors/mobs/pets/BlueDragon.java | 150 -- .../change/actors/mobs/pets/BugDragon.java | 147 - .../spspd/change/actors/mobs/pets/Bunny.java | 88 - .../change/actors/mobs/pets/CocoCat.java | 154 -- .../spspd/change/actors/mobs/pets/Fairy.java | 163 -- .../spspd/change/actors/mobs/pets/Fly.java | 89 - .../change/actors/mobs/pets/GentleCrab.java | 88 - .../change/actors/mobs/pets/GoldDragon.java | 146 - .../change/actors/mobs/pets/GreenDragon.java | 159 -- .../change/actors/mobs/pets/LeryFire.java | 212 -- .../change/actors/mobs/pets/LightDragon.java | 111 - .../spspd/change/actors/mobs/pets/Monkey.java | 89 - .../spspd/change/actors/mobs/pets/PET.java | 388 --- .../change/actors/mobs/pets/RedDragon.java | 144 - .../change/actors/mobs/pets/RibbonRat.java | 108 - .../change/actors/mobs/pets/Scorpion.java | 100 - .../change/actors/mobs/pets/ShadowDragon.java | 150 -- .../spspd/change/actors/mobs/pets/Snake.java | 110 - .../spspd/change/actors/mobs/pets/Spider.java | 93 - .../spspd/change/actors/mobs/pets/Stone.java | 88 - .../actors/mobs/pets/SugarplumFairy.java | 171 -- .../actors/mobs/pets/Velocirooster.java | 80 - .../change/actors/mobs/pets/VioletDragon.java | 149 - .../change/actors/mobs/pets/YearPet.java | 86 - .../spspd/change/effects/BadgeBanner.java | 287 -- .../spspd/change/effects/BannerSprites.java | 53 - java/com/hmdzl/spspd/change/effects/Beam.java | 102 - .../spspd/change/effects/BlobEmitter.java | 59 - .../spspd/change/effects/CellEmitter.java | 57 - .../hmdzl/spspd/change/effects/Chains.java | 101 - .../spspd/change/effects/CheckedCell.java | 49 - .../hmdzl/spspd/change/effects/CircleArc.java | 191 -- .../hmdzl/spspd/change/effects/DarkBlock.java | 69 - .../hmdzl/spspd/change/effects/DeathRay.java | 75 - .../spspd/change/effects/Degradation.java | 119 - .../hmdzl/spspd/change/effects/Effects.java | 70 - .../hmdzl/spspd/change/effects/EmoIcon.java | 116 - .../hmdzl/spspd/change/effects/Fireball.java | 161 -- .../com/hmdzl/spspd/change/effects/Flare.java | 162 -- .../spspd/change/effects/FloatingText.java | 138 - java/com/hmdzl/spspd/change/effects/Halo.java | 75 - .../hmdzl/spspd/change/effects/IceBlock.java | 68 - .../spspd/change/effects/Identification.java | 94 - .../hmdzl/spspd/change/effects/Lightning.java | 144 - .../spspd/change/effects/MagicMissile.java | 449 ---- .../hmdzl/spspd/change/effects/Pushing.java | 115 - .../hmdzl/spspd/change/effects/Ripple.java | 59 - .../hmdzl/spspd/change/effects/ShadowBox.java | 46 - .../spspd/change/effects/ShieldHalo.java | 80 - .../com/hmdzl/spspd/change/effects/Speck.java | 521 ---- .../spspd/change/effects/SpellSprite.java | 135 - .../hmdzl/spspd/change/effects/Splash.java | 83 - .../hmdzl/spspd/change/effects/Surprise.java | 86 - .../hmdzl/spspd/change/effects/TorchHalo.java | 71 - .../com/hmdzl/spspd/change/effects/Wound.java | 87 - .../effects/particles/BlastParticle.java | 63 - .../effects/particles/BloodParticle.java | 60 - .../effects/particles/DeadParticle.java | 69 - .../effects/particles/EarthParticle.java | 60 - .../effects/particles/ElmoParticle.java | 65 - .../effects/particles/EnergyParticle.java | 67 - .../effects/particles/FlameParticle.java | 65 - .../effects/particles/FlowParticle.java | 109 - .../effects/particles/LeafParticle.java | 71 - .../effects/particles/MemoryParticle.java | 65 - .../effects/particles/PoisonParticle.java | 92 - .../effects/particles/PurpleParticle.java | 86 - .../effects/particles/RainParticle.java | 69 - .../effects/particles/RainbowParticle.java | 77 - .../effects/particles/SandParticle.java | 56 - .../effects/particles/ShadowParticle.java | 96 - .../effects/particles/ShaftParticle.java | 67 - .../effects/particles/ShockWebParticle.java | 53 - .../effects/particles/SmokeParticle.java | 60 - .../effects/particles/SnowParticle.java | 55 - .../effects/particles/SparkParticle.java | 63 - .../change/effects/particles/WebParticle.java | 69 - .../effects/particles/WindParticle.java | 112 - .../effects/particles/WoolParticle.java | 54 - .../spspd/change/items/AdamantArmor.java | 48 - .../hmdzl/spspd/change/items/AdamantRing.java | 48 - .../hmdzl/spspd/change/items/AdamantWand.java | 48 - .../spspd/change/items/AdamantWeapon.java | 47 - java/com/hmdzl/spspd/change/items/Amulet.java | 93 - .../hmdzl/spspd/change/items/AncientCoin.java | 154 -- java/com/hmdzl/spspd/change/items/Ankh.java | 131 - .../hmdzl/spspd/change/items/ArmorKit.java | 134 - java/com/hmdzl/spspd/change/items/Bone.java | 152 -- .../hmdzl/spspd/change/items/BossRush.java | 141 - .../spspd/change/items/ChallengeBook.java | 205 -- .../hmdzl/spspd/change/items/ConchShell.java | 151 -- .../com/hmdzl/spspd/change/items/DewVial.java | 622 ----- .../com/hmdzl/spspd/change/items/Dewdrop.java | 71 - .../hmdzl/spspd/change/items/DolyaSlate.java | 244 -- .../hmdzl/spspd/change/items/DwarfHammer.java | 106 - .../hmdzl/spspd/change/items/Elevator.java | 80 - .../spspd/change/items/EquipableItem.java | 112 - java/com/hmdzl/spspd/change/items/ExpOre.java | 82 - java/com/hmdzl/spspd/change/items/Flag.java | 63 - .../hmdzl/spspd/change/items/Generator.java | 738 ----- java/com/hmdzl/spspd/change/items/Gold.java | 117 - .../spspd/change/items/GreaterStylus.java | 118 - java/com/hmdzl/spspd/change/items/Heap.java | 677 ----- java/com/hmdzl/spspd/change/items/Item.java | 602 ----- .../spspd/change/items/ItemStatusHandler.java | 176 -- .../hmdzl/spspd/change/items/KindOfArmor.java | 134 - .../spspd/change/items/KindOfWeapon.java | 119 - .../hmdzl/spspd/change/items/KindofMisc.java | 11 - .../spspd/change/items/LloydsBeacon.java | 183 -- .../hmdzl/spspd/change/items/OrbOfZot.java | 162 -- .../hmdzl/spspd/change/items/Palantir.java | 152 -- .../hmdzl/spspd/change/items/Playericon.java | 52 - .../spspd/change/items/PocketBallFull.java | 328 --- .../hmdzl/spspd/change/items/PowerHand.java | 209 -- .../hmdzl/spspd/change/items/PuddingCup.java | 107 - .../hmdzl/spspd/change/items/RedDewdrop.java | 71 - .../spspd/change/items/ReturnBeacon.java | 100 - .../spspd/change/items/SaveYourLife.java | 84 - .../hmdzl/spspd/change/items/ShoesKit.java | 128 - .../hmdzl/spspd/change/items/SoulCollect.java | 88 - .../hmdzl/spspd/change/items/StoneOre.java | 61 - java/com/hmdzl/spspd/change/items/Stylus.java | 112 - .../hmdzl/spspd/change/items/TenguKey.java | 152 -- .../spspd/change/items/TomeOfMastery.java | 149 - java/com/hmdzl/spspd/change/items/Torch.java | 89 - java/com/hmdzl/spspd/change/items/Towel.java | 154 -- .../spspd/change/items/TownReturnBeacon.java | 169 -- .../spspd/change/items/TransmutationBall.java | 249 -- .../hmdzl/spspd/change/items/TreasureMap.java | 172 -- .../hmdzl/spspd/change/items/TriForce.java | 154 -- .../spspd/change/items/TriforceOfCourage.java | 62 - .../spspd/change/items/TriforceOfPower.java | 63 - .../spspd/change/items/TriforceOfWisdom.java | 73 - .../spspd/change/items/UpgradeBlobRed.java | 122 - .../spspd/change/items/UpgradeBlobViolet.java | 118 - .../spspd/change/items/UpgradeBlobYellow.java | 120 - .../spspd/change/items/UpgradeEatBall.java | 176 -- .../spspd/change/items/VioletDewdrop.java | 72 - .../hmdzl/spspd/change/items/WaterItem2.java | 91 - .../hmdzl/spspd/change/items/Weightstone.java | 186 -- .../com/hmdzl/spspd/change/items/Whistle.java | 137 - .../spspd/change/items/YellowDewdrop.java | 71 - .../hmdzl/spspd/change/items/armor/Armor.java | 343 --- .../change/items/armor/glyphs/AdaptGlyph.java | 114 - .../items/armor/glyphs/Changeglyph.java | 118 - .../items/armor/glyphs/Crystalglyph.java | 79 - .../change/items/armor/glyphs/Darkglyph.java | 93 - .../change/items/armor/glyphs/Earthglyph.java | 101 - .../items/armor/glyphs/Electricityglyph.java | 103 - .../change/items/armor/glyphs/Fireglyph.java | 96 - .../change/items/armor/glyphs/Iceglyph.java | 210 -- .../change/items/armor/glyphs/Lightglyph.java | 95 - .../items/armor/glyphs/RecoilGlyph.java | 95 - .../items/armor/glyphs/Revivalglyph.java | 85 - .../change/items/armor/glyphs/Testglyph.java | 106 - .../items/armor/normalarmor/BaseArmor.java | 63 - .../items/armor/normalarmor/BulletArmor.java | 54 - .../items/armor/normalarmor/CDArmor.java | 54 - .../armor/normalarmor/CeramicsArmor.java | 54 - .../items/armor/normalarmor/ClothArmor.java | 51 - .../items/armor/normalarmor/DiscArmor.java | 34 - .../items/armor/normalarmor/ErrorArmor.java | 118 - .../items/armor/normalarmor/LeatherArmor.java | 33 - .../items/armor/normalarmor/MachineArmor.java | 54 - .../items/armor/normalarmor/MailArmor.java | 34 - .../armor/normalarmor/MultiplelayerArmor.java | 54 - .../items/armor/normalarmor/NormalArmor.java | 171 -- .../items/armor/normalarmor/PhantomArmor.java | 53 - .../items/armor/normalarmor/PlateArmor.java | 34 - .../normalarmor/ProtectiveclothingArmor.java | 53 - .../items/armor/normalarmor/RubberArmor.java | 54 - .../items/armor/normalarmor/ScaleArmor.java | 33 - .../items/armor/normalarmor/StoneArmor.java | 55 - .../armor/normalarmor/StyrofoamArmor.java | 55 - .../items/armor/normalarmor/VestArmor.java | 55 - .../items/armor/normalarmor/WoodenArmor.java | 55 - .../items/artifacts/AlchemistsToolkit.java | 287 -- .../change/items/artifacts/AlienBag.java | 181 -- .../change/items/artifacts/Artifact.java | 306 --- .../change/items/artifacts/CapeOfThorns.java | 160 -- .../items/artifacts/ChaliceOfBlood.java | 166 -- .../items/artifacts/CloakOfShadows.java | 284 -- .../change/items/artifacts/DriedRose.java | 856 ------ .../items/artifacts/EtherealChains.java | 300 --- .../change/items/artifacts/EyeOfSkadi.java | 280 -- .../change/items/artifacts/GlassTotem.java | 129 - .../change/items/artifacts/HornOfPlenty.java | 231 -- .../items/artifacts/MasterThievesArmband.java | 139 - .../spspd/change/items/artifacts/Pylon.java | 324 --- .../change/items/artifacts/RobotDMT.java | 227 -- .../items/artifacts/SandalsOfNature.java | 204 -- .../items/artifacts/TalismanOfForesight.java | 222 -- .../items/artifacts/TimekeepersHourglass.java | 392 --- .../items/artifacts/UnstableSpellbook.java | 268 -- .../hmdzl/spspd/change/items/bags/Bag.java | 200 -- .../change/items/bags/HeartOfScarecrow.java | 65 - .../spspd/change/items/bags/KeyRing.java | 75 - .../change/items/bags/PotionBandolier.java | 46 - .../spspd/change/items/bags/ScrollHolder.java | 75 - .../spspd/change/items/bags/SeedPouch.java | 65 - .../spspd/change/items/bags/ShoppingCart.java | 54 - .../spspd/change/items/bags/WandHolster.java | 93 - .../hmdzl/spspd/change/items/bombs/Bomb.java | 262 -- .../spspd/change/items/bombs/BuildBomb.java | 98 - .../change/items/bombs/DangerousBomb.java | 115 - .../spspd/change/items/bombs/DarkBomb.java | 104 - .../spspd/change/items/bombs/DungeonBomb.java | 153 -- .../spspd/change/items/bombs/EarthBomb.java | 101 - .../spspd/change/items/bombs/FireBomb.java | 133 - .../spspd/change/items/bombs/FishingBomb.java | 107 - .../spspd/change/items/bombs/HugeBomb.java | 107 - .../spspd/change/items/bombs/IceBomb.java | 92 - .../spspd/change/items/bombs/LightBomb.java | 109 - .../spspd/change/items/bombs/MiniBomb.java | 95 - .../spspd/change/items/bombs/StormBomb.java | 65 - .../items/challengelists/CaveChallenge.java | 33 - .../items/challengelists/ChallengeList.java | 48 - .../items/challengelists/CityChallenge.java | 33 - .../challengelists/CourageChallenge.java | 40 - .../items/challengelists/PowerChallenge.java | 40 - .../items/challengelists/PrisonChallenge.java | 33 - .../items/challengelists/SewerChallenge.java | 33 - .../items/challengelists/WisdomChallenge.java | 41 - .../change/items/eggs/BlueDragonEgg.java | 141 - .../spspd/change/items/eggs/CocoCatEgg.java | 150 -- .../spspd/change/items/eggs/EasterEgg.java | 152 -- .../hmdzl/spspd/change/items/eggs/Egg.java | 403 --- .../change/items/eggs/GoldDragonEgg.java | 142 - .../change/items/eggs/GreenDragonEgg.java | 257 -- .../spspd/change/items/eggs/LeryFireEgg.java | 137 - .../change/items/eggs/LightDragonEgg.java | 140 - .../spspd/change/items/eggs/RandomEgg.java | 175 -- .../spspd/change/items/eggs/RedDragonEgg.java | 138 - .../spspd/change/items/eggs/ScorpionEgg.java | 132 - .../change/items/eggs/ShadowDragonEgg.java | 116 - .../spspd/change/items/eggs/SpiderEgg.java | 150 -- .../change/items/eggs/VelociroosterEgg.java | 137 - .../change/items/eggs/VioletDragonEgg.java | 142 - .../spspd/change/items/eggs/YearPetEgg.java | 135 - .../hmdzl/spspd/change/items/food/Food.java | 150 -- .../hmdzl/spspd/change/items/food/Honey.java | 64 - .../hmdzl/spspd/change/items/food/Nut.java | 59 - .../spspd/change/items/food/ToastedNut.java | 64 - .../spspd/change/items/food/Vegetable.java | 72 - .../spspd/change/items/food/WaterItem.java | 62 - .../items/food/completefood/AflyFood.java | 54 - .../food/completefood/Chickennugget.java | 37 - .../items/food/completefood/CompleteFood.java | 52 - .../food/completefood/Crystalnucleus.java | 38 - .../food/completefood/Foamedbeverage.java | 59 - .../items/food/completefood/FoodFans.java | 53 - .../items/food/completefood/Frenchfries.java | 53 - .../items/food/completefood/Fruitsalad.java | 50 - .../items/food/completefood/Garbage.java | 50 - .../change/items/food/completefood/Gel.java | 52 - .../items/food/completefood/GoldenNut.java | 64 - .../items/food/completefood/Hamburger.java | 51 - .../items/food/completefood/Herbmeat.java | 55 - .../change/items/food/completefood/Honey.java | 62 - .../items/food/completefood/HoneyGel.java | 71 - .../items/food/completefood/HoneyWater.java | 62 - .../items/food/completefood/Honeymeat.java | 57 - .../items/food/completefood/Honeyrice.java | 66 - .../items/food/completefood/Icecream.java | 62 - .../change/items/food/completefood/Kebab.java | 44 - .../items/food/completefood/Meatroll.java | 53 - .../items/food/completefood/PerfectFood.java | 66 - .../items/food/completefood/PetFood.java | 38 - .../items/food/completefood/Porksoup.java | 60 - .../items/food/completefood/Ricefood.java | 38 - .../food/completefood/Vegetablekebab.java | 59 - .../food/completefood/Vegetableroll.java | 61 - .../food/completefood/Vegetablesoup.java | 53 - .../change/items/food/fruit/Blackberry.java | 75 - .../change/items/food/fruit/Blandfruit.java | 255 -- .../change/items/food/fruit/Blueberry.java | 159 -- .../change/items/food/fruit/Cloudberry.java | 81 - .../spspd/change/items/food/fruit/Fruit.java | 52 - .../items/food/fruit/FullMoonberry.java | 76 - .../change/items/food/fruit/Moonberry.java | 69 - .../items/food/meatfood/ChargrilledMeat.java | 49 - .../items/food/meatfood/FrozenCarpaccio.java | 102 - .../change/items/food/meatfood/Meat.java | 61 - .../change/items/food/meatfood/MeatFood.java | 52 - .../items/food/meatfood/MysteryMeat.java | 75 - .../items/food/staplefood/NormalRation.java | 37 - .../food/staplefood/OverpricedRation.java | 37 - .../change/items/food/staplefood/Pasty.java | 236 -- .../items/food/staplefood/StapleFood.java | 52 - .../items/food/vegetable/BattleFlower.java | 76 - .../items/food/vegetable/DreamLeaf.java | 76 - .../items/food/vegetable/HealGrass.java | 71 - .../items/food/vegetable/NutVegetable.java | 70 - .../items/food/vegetable/Vegetable.java | 54 - .../change/items/journalpages/EnergyCore.java | 34 - .../items/journalpages/JournalPage.java | 53 - .../items/journalpages/SafeSpotPage.java | 33 - .../change/items/journalpages/Sokoban1.java | 33 - .../change/items/journalpages/Sokoban2.java | 33 - .../change/items/journalpages/Sokoban3.java | 34 - .../change/items/journalpages/Sokoban4.java | 34 - .../spspd/change/items/journalpages/Town.java | 34 - .../change/items/journalpages/Vault.java | 35 - .../spspd/change/items/keys/GoldenKey.java | 36 - .../change/items/keys/GoldenSkeletonKey.java | 45 - .../spspd/change/items/keys/IronKey.java | 59 - .../hmdzl/spspd/change/items/keys/Key.java | 63 - .../spspd/change/items/keys/SkeletonKey.java | 44 - .../spspd/change/items/medicine/BlueMilk.java | 90 - .../spspd/change/items/medicine/DeathCap.java | 87 - .../change/items/medicine/Earthstar.java | 96 - .../change/items/medicine/GoldenJelly.java | 85 - .../change/items/medicine/GreenSpore.java | 54 - .../spspd/change/items/medicine/Hardpill.java | 49 - .../change/items/medicine/JackOLantern.java | 84 - .../change/items/medicine/Magicpill.java | 49 - .../change/items/medicine/Musicpill.java | 58 - .../spspd/change/items/medicine/Pill.java | 141 - .../change/items/medicine/PixieParasol.java | 93 - .../change/items/medicine/Powerpill.java | 48 - .../change/items/medicine/Shootpill.java | 49 - .../spspd/change/items/misc/Ankhshield.java | 131 - .../spspd/change/items/misc/AttackShield.java | 234 -- .../spspd/change/items/misc/AttackShoes.java | 136 - .../spspd/change/items/misc/AutoPotion.java | 67 - .../spspd/change/items/misc/BShovel.java | 183 -- .../spspd/change/items/misc/CopyBall.java | 221 -- .../spspd/change/items/misc/DanceLion.java | 177 -- .../spspd/change/items/misc/DemoScroll.java | 132 - .../spspd/change/items/misc/FaithSign.java | 141 - .../spspd/change/items/misc/FourClover.java | 66 - .../spspd/change/items/misc/GnollMark.java | 205 -- .../spspd/change/items/misc/GunOfSoldier.java | 191 -- .../spspd/change/items/misc/HealBag.java | 168 -- .../spspd/change/items/misc/HorseTotem.java | 72 - .../hmdzl/spspd/change/items/misc/JumpF.java | 185 -- .../hmdzl/spspd/change/items/misc/JumpH.java | 198 -- .../hmdzl/spspd/change/items/misc/JumpM.java | 178 -- .../hmdzl/spspd/change/items/misc/JumpP.java | 180 -- .../hmdzl/spspd/change/items/misc/JumpR.java | 173 -- .../hmdzl/spspd/change/items/misc/JumpS.java | 180 -- .../hmdzl/spspd/change/items/misc/JumpW.java | 176 -- .../spspd/change/items/misc/Jumpshoes.java | 170 -- .../spspd/change/items/misc/LuckyBadge.java | 65 - .../hmdzl/spspd/change/items/misc/MKbox.java | 121 - .../spspd/change/items/misc/MechPocket.java | 97 - .../change/items/misc/MiscEquippable.java | 216 -- .../change/items/misc/MissileShield.java | 216 -- .../spspd/change/items/misc/PotionOfMage.java | 295 -- .../spspd/change/items/misc/RangeBag.java | 99 - .../spspd/change/items/misc/SavageHelmet.java | 80 - .../hmdzl/spspd/change/items/misc/Shovel.java | 183 -- .../spspd/change/items/misc/SkillOfAtk.java | 88 - .../spspd/change/items/misc/SkillOfDef.java | 88 - .../spspd/change/items/misc/SkillOfMig.java | 88 - .../spspd/change/items/misc/Spectacles.java | 63 - .../spspd/change/items/misc/UndeadBook.java | 114 - .../change/items/nornstone/BlueNornStone.java | 59 - .../items/nornstone/GreenNornStone.java | 60 - .../change/items/nornstone/NornStone.java | 61 - .../items/nornstone/OrangeNornStone.java | 60 - .../items/nornstone/PurpleNornStone.java | 59 - .../items/nornstone/YellowNornStone.java | 59 - .../spspd/change/items/potions/Potion.java | 313 --- .../items/potions/PotionOfExperience.java | 51 - .../change/items/potions/PotionOfFrost.java | 65 - .../change/items/potions/PotionOfHaste.java | 63 - .../change/items/potions/PotionOfHealing.java | 65 - .../items/potions/PotionOfInvisibility.java | 68 - .../items/potions/PotionOfLevitation.java | 65 - .../items/potions/PotionOfLiquidFlame.java | 67 - .../change/items/potions/PotionOfMending.java | 78 - .../change/items/potions/PotionOfMight.java | 50 - .../items/potions/PotionOfMindVision.java | 60 - .../items/potions/PotionOfOverHealing.java | 59 - .../items/potions/PotionOfParalyticGas.java | 51 - .../change/items/potions/PotionOfPurity.java | 128 - .../items/potions/PotionOfStrength.java | 54 - .../items/potions/PotionOfToxicGas.java | 51 - .../spspd/change/items/quest/CorpseDust.java | 50 - .../spspd/change/items/quest/DarkGold.java | 53 - .../spspd/change/items/quest/DwarfToken.java | 53 - .../change/items/quest/GnollClothes.java | 49 - .../spspd/change/items/quest/Mushroom.java | 66 - .../spspd/change/items/quest/Pickaxe.java | 232 -- .../spspd/change/items/quest/RatSkull.java | 53 - .../spspd/change/items/reward/CaveReward.java | 108 - .../spspd/change/items/reward/CityReward.java | 103 - .../change/items/reward/PrisonReward.java | 99 - .../change/items/reward/SewerReward.java | 98 - .../hmdzl/spspd/change/items/rings/Ring.java | 357 --- .../change/items/rings/RingOfAccuracy.java | 47 - .../change/items/rings/RingOfElements.java | 132 - .../change/items/rings/RingOfEnergy.java | 33 - .../change/items/rings/RingOfEvasion.java | 48 - .../spspd/change/items/rings/RingOfForce.java | 34 - .../spspd/change/items/rings/RingOfFuror.java | 34 - .../spspd/change/items/rings/RingOfHaste.java | 60 - .../spspd/change/items/rings/RingOfMagic.java | 45 - .../spspd/change/items/rings/RingOfMight.java | 33 - .../items/rings/RingOfSharpshooting.java | 34 - .../change/items/rings/RingOfTenacity.java | 32 - .../change/items/scrolls/InventoryScroll.java | 96 - .../spspd/change/items/scrolls/Scroll.java | 224 -- .../items/scrolls/ScrollOfIdentify.java | 79 - .../change/items/scrolls/ScrollOfLullaby.java | 86 - .../items/scrolls/ScrollOfMagicMapping.java | 147 - .../scrolls/ScrollOfMagicalInfusion.java | 68 - .../items/scrolls/ScrollOfMirrorImage.java | 209 -- .../items/scrolls/ScrollOfMultiUpgrade.java | 76 - .../items/scrolls/ScrollOfPsionicBlast.java | 104 - .../change/items/scrolls/ScrollOfRage.java | 98 - .../items/scrolls/ScrollOfRecharging.java | 83 - .../items/scrolls/ScrollOfRegrowth.java | 71 - .../items/scrolls/ScrollOfRemoveCurse.java | 112 - .../items/scrolls/ScrollOfSacrifice.java | 62 - .../items/scrolls/ScrollOfTeleportation.java | 205 -- .../change/items/scrolls/ScrollOfTerror.java | 96 - .../change/items/scrolls/ScrollOfUpgrade.java | 66 - .../spspd/change/items/skills/ClassSkill.java | 242 -- .../change/items/skills/FollowerSkill.java | 157 -- .../change/items/skills/HuntressSkill.java | 197 -- .../spspd/change/items/skills/MageSkill.java | 158 -- .../change/items/skills/PerformerSkill.java | 268 -- .../spspd/change/items/skills/RogueSkill.java | 168 -- .../change/items/skills/SoldierSkill.java | 339 --- .../change/items/skills/WarriorSkill.java | 187 -- .../items/summon/ActiveMrDestructo.java | 464 ---- .../change/items/summon/CallCoconut.java | 309 --- .../spspd/change/items/summon/FairyCard.java | 293 -- .../spspd/change/items/summon/Honeypot.java | 483 ---- .../spspd/change/items/summon/Mobile.java | 313 --- .../change/items/wands/CannonOfMage.java | 135 - .../spspd/change/items/wands/DamageWand.java | 76 - .../hmdzl/spspd/change/items/wands/Wand.java | 453 ---- .../spspd/change/items/wands/WandOfAcid.java | 82 - .../spspd/change/items/wands/WandOfBlood.java | 88 - .../spspd/change/items/wands/WandOfCharm.java | 80 - .../items/wands/WandOfDisintegration.java | 112 - .../spspd/change/items/wands/WandOfError.java | 194 -- .../change/items/wands/WandOfFirebolt.java | 149 - .../spspd/change/items/wands/WandOfFlock.java | 247 -- .../spspd/change/items/wands/WandOfFlow.java | 238 -- .../change/items/wands/WandOfFreeze.java | 102 - .../spspd/change/items/wands/WandOfLight.java | 111 - .../change/items/wands/WandOfLightning.java | 141 - .../items/wands/WandOfMagicMissile.java | 190 -- .../change/items/wands/WandOfMeteorite.java | 140 - .../change/items/wands/WandOfPoison.java | 71 - .../change/items/wands/WandOfTCloud.java | 515 ---- .../spspd/change/items/weapon/Weapon.java | 505 ---- .../items/weapon/enchantments/AresLeech.java | 163 -- .../items/weapon/enchantments/BuzzSaw.java | 87 - .../items/weapon/enchantments/CromLuck.java | 56 - .../weapon/enchantments/EnchantmentDark.java | 70 - .../weapon/enchantments/EnchantmentDark2.java | 64 - .../weapon/enchantments/EnchantmentEarth.java | 72 - .../enchantments/EnchantmentEarth2.java | 66 - .../enchantments/EnchantmentEnergy.java | 71 - .../enchantments/EnchantmentEnergy2.java | 72 - .../weapon/enchantments/EnchantmentFire.java | 69 - .../weapon/enchantments/EnchantmentFire2.java | 69 - .../weapon/enchantments/EnchantmentIce.java | 69 - .../weapon/enchantments/EnchantmentIce2.java | 68 - .../weapon/enchantments/EnchantmentLight.java | 78 - .../enchantments/EnchantmentLight2.java | 66 - .../weapon/enchantments/EnchantmentShock.java | 115 - .../enchantments/EnchantmentShock2.java | 67 - .../weapon/enchantments/JupitersHorror.java | 104 - .../weapon/enchantments/LokisPoison.java | 65 - .../weapon/enchantments/NeptuneShock.java | 118 - .../spspd/change/items/weapon/guns/GunA.java | 43 - .../spspd/change/items/weapon/guns/GunB.java | 43 - .../spspd/change/items/weapon/guns/GunC.java | 43 - .../spspd/change/items/weapon/guns/GunD.java | 43 - .../spspd/change/items/weapon/guns/GunE.java | 43 - .../change/items/weapon/guns/GunWeapon.java | 380 --- .../spspd/change/items/weapon/guns/Sling.java | 65 - .../change/items/weapon/guns/ToyGun.java | 301 --- .../items/weapon/melee/AssassinsBlade.java | 69 - .../change/items/weapon/melee/BattleAxe.java | 81 - .../spspd/change/items/weapon/melee/Club.java | 78 - .../change/items/weapon/melee/Dagger.java | 76 - .../items/weapon/melee/FightGloves.java | 83 - .../change/items/weapon/melee/Flute.java | 125 - .../change/items/weapon/melee/Glaive.java | 75 - .../change/items/weapon/melee/Gsword.java | 74 - .../change/items/weapon/melee/Halberd.java | 76 - .../change/items/weapon/melee/Handaxe.java | 81 - .../spspd/change/items/weapon/melee/Harp.java | 108 - .../change/items/weapon/melee/HolyWater.java | 127 - .../change/items/weapon/melee/Knuckles.java | 79 - .../change/items/weapon/melee/Lance.java | 71 - .../spspd/change/items/weapon/melee/Mace.java | 129 - .../change/items/weapon/melee/MageBook.java | 100 - .../items/weapon/melee/MeleeWeapon.java | 181 -- .../change/items/weapon/melee/Nunchakus.java | 79 - .../items/weapon/melee/PrayerWheel.java | 127 - .../change/items/weapon/melee/Rapier.java | 92 - .../change/items/weapon/melee/Scimitar.java | 82 - .../change/items/weapon/melee/ShortSword.java | 87 - .../change/items/weapon/melee/Spear.java | 80 - .../change/items/weapon/melee/StoneCross.java | 125 - .../change/items/weapon/melee/Triangolo.java | 112 - .../change/items/weapon/melee/Trumpet.java | 109 - .../change/items/weapon/melee/WarHammer.java | 74 - .../change/items/weapon/melee/Wardurm.java | 116 - .../spspd/change/items/weapon/melee/Whip.java | 79 - .../items/weapon/melee/WoodenStaff.java | 127 - .../items/weapon/melee/relic/AresSword.java | 145 - .../weapon/melee/relic/CromCruachAxe.java | 143 - .../weapon/melee/relic/JupitersWraith.java | 184 -- .../items/weapon/melee/relic/LokisFlail.java | 149 - .../weapon/melee/relic/NeptunusTrident.java | 208 -- .../weapon/melee/relic/RelicMeleeWeapon.java | 283 -- .../items/weapon/melee/special/Brick.java | 91 - .../weapon/melee/special/DiamondPickaxe.java | 295 -- .../items/weapon/melee/special/ErrorW.java | 121 - .../weapon/melee/special/FireCracker.java | 133 - .../items/weapon/melee/special/Goei.java | 104 - .../weapon/melee/special/Handcannon.java | 106 - .../items/weapon/melee/special/HookHam.java | 101 - .../items/weapon/melee/special/LinkSword.java | 330 --- .../items/weapon/melee/special/Lollipop.java | 97 - .../items/weapon/melee/special/Pumpkin.java | 94 - .../weapon/melee/special/RunicBlade.java | 141 - .../items/weapon/melee/special/SJRBMusic.java | 127 - .../items/weapon/melee/special/Spork.java | 57 - .../items/weapon/melee/special/TekkoKagi.java | 60 - .../weapon/melee/special/TestWeapon.java | 87 - .../items/weapon/melee/special/Tree.java | 111 - .../weapon/melee/special/WraithBreath.java | 59 - .../items/weapon/melee/zero/Bamboo.java | 57 - .../items/weapon/melee/zero/EmptyPotion.java | 107 - .../items/weapon/melee/zero/GlassBlade.java | 77 - .../change/items/weapon/melee/zero/Punch.java | 57 - .../items/weapon/melee/zero/WoodenHammer.java | 89 - .../items/weapon/missiles/Boomerang.java | 219 -- .../change/items/weapon/missiles/EmpBola.java | 71 - .../items/weapon/missiles/ErrorAmmo.java | 56 - .../items/weapon/missiles/ForestDart.java | 96 - .../items/weapon/missiles/HugeShuriken.java | 69 - .../items/weapon/missiles/IncendiaryDart.java | 80 - .../items/weapon/missiles/ManyKnive.java | 308 --- .../items/weapon/missiles/MiniMoai.java | 108 - .../items/weapon/missiles/MissileWeapon.java | 151 -- .../items/weapon/missiles/MoneyPack.java | 72 - .../items/weapon/missiles/NormalBomb.java | 75 - .../items/weapon/missiles/PocketBall.java | 81 - .../items/weapon/missiles/PoisonDart.java | 68 - .../items/weapon/missiles/RiceBall.java | 131 - .../items/weapon/missiles/ShatteredAmmo.java | 65 - .../change/items/weapon/missiles/Skull.java | 64 - .../change/items/weapon/missiles/Smoke.java | 80 - .../items/weapon/missiles/Tamahawk.java | 64 - .../items/weapon/missiles/TaurcenBow.java | 330 --- .../change/items/weapon/missiles/Wave.java | 68 - .../weapon/missiles/buildblock/BookBlock.java | 78 - .../weapon/missiles/buildblock/DoorBlock.java | 78 - .../missiles/buildblock/StoneBlock.java | 78 - .../weapon/missiles/buildblock/WallBlock.java | 78 - .../missiles/buildblock/WoodenBlock.java | 78 - .../items/weapon/spammo/BattleAmmo.java | 62 - .../change/items/weapon/spammo/BlindAmmo.java | 63 - .../change/items/weapon/spammo/DewAmmo.java | 59 - .../change/items/weapon/spammo/DreamAmmo.java | 49 - .../change/items/weapon/spammo/EmptyAmmo.java | 53 - .../items/weapon/spammo/EvolveAmmo.java | 94 - .../change/items/weapon/spammo/FireAmmo.java | 60 - .../change/items/weapon/spammo/GoldAmmo.java | 53 - .../change/items/weapon/spammo/HeavyAmmo.java | 39 - .../change/items/weapon/spammo/IceAmmo.java | 74 - .../change/items/weapon/spammo/MossAmmo.java | 63 - .../change/items/weapon/spammo/RotAmmo.java | 63 - .../change/items/weapon/spammo/SandAmmo.java | 64 - .../change/items/weapon/spammo/SpAmmo.java | 46 - .../change/items/weapon/spammo/StarAmmo.java | 74 - .../change/items/weapon/spammo/StormAmmo.java | 57 - .../change/items/weapon/spammo/SunAmmo.java | 55 - .../change/items/weapon/spammo/ThornAmmo.java | 62 - .../items/weapon/spammo/WoodenAmmo.java | 53 - .../spspd/change/levels/BattleLevel.java | 236 -- .../spspd/change/levels/BossRushLevel.java | 250 -- .../spspd/change/levels/CatacombLevel.java | 247 -- .../spspd/change/levels/CavesBossLevel.java | 320 --- .../hmdzl/spspd/change/levels/CavesLevel.java | 360 --- .../hmdzl/spspd/change/levels/ChaosLevel.java | 217 -- .../hmdzl/spspd/change/levels/ChasmLevel.java | 327 --- .../spspd/change/levels/CityBossLevel.java | 282 -- .../hmdzl/spspd/change/levels/CityLevel.java | 251 -- .../spspd/change/levels/CrabBossLevel.java | 271 -- .../spspd/change/levels/DeadEndLevel.java | 139 - .../spspd/change/levels/DragonCaveLevel.java | 553 ---- .../spspd/change/levels/FieldBossLevel.java | 262 -- .../hmdzl/spspd/change/levels/FieldLevel.java | 234 -- .../spspd/change/levels/FishingBossLevel.java | 272 -- .../spspd/change/levels/FishingLevel.java | 262 -- .../spspd/change/levels/FortressLevel.java | 238 -- .../spspd/change/levels/HallsBossLevel.java | 486 ---- .../hmdzl/spspd/change/levels/HallsLevel.java | 274 -- .../spspd/change/levels/InfestBossLevel.java | 393 --- .../hmdzl/spspd/change/levels/LastLevel.java | 179 -- .../spspd/change/levels/LastShopLevel.java | 227 -- java/com/hmdzl/spspd/change/levels/Level.java | 2046 -------------- .../hmdzl/spspd/change/levels/MazeLayout.java | 219 -- .../spspd/change/levels/MineBossLayouts.java | 107 - .../spspd/change/levels/MinesBossLevel.java | 317 --- java/com/hmdzl/spspd/change/levels/Patch.java | 85 - .../spspd/change/levels/PrisonBossLevel.java | 256 -- .../spspd/change/levels/PrisonBossLevel2.java | 380 --- .../spspd/change/levels/PrisonLevel.java | 243 -- .../spspd/change/levels/RegularLevel.java | 779 ------ java/com/hmdzl/spspd/change/levels/Room.java | 291 -- .../spspd/change/levels/RoomOfZotLevel.java | 405 --- .../hmdzl/spspd/change/levels/SafeLevel.java | 406 --- .../spspd/change/levels/SaveRoomLayouts.java | 149 - .../spspd/change/levels/SewerBossLevel.java | 310 --- .../hmdzl/spspd/change/levels/SewerLevel.java | 310 --- .../change/levels/SkeletonBossLevel.java | 279 -- .../spspd/change/levels/SokobanCastle.java | 685 ----- .../change/levels/SokobanIntroLevel.java | 677 ----- .../spspd/change/levels/SokobanLayouts.java | 261 -- .../spspd/change/levels/SokobanLayouts2.java | 159 -- .../change/levels/SokobanPuzzlesLevel.java | 701 ----- .../spspd/change/levels/SokobanSPLevel.java | 481 ---- .../change/levels/SokobanTeleportLevel.java | 743 ----- .../change/levels/SokobanVaultLevel.java | 531 ---- .../spspd/change/levels/TenguDenLevel.java | 312 --- .../hmdzl/spspd/change/levels/Terrain.java | 228 -- .../spspd/change/levels/ThiefBossLevel.java | 269 -- .../spspd/change/levels/ThiefCatchLevel.java | 305 --- .../spspd/change/levels/TownLayouts.java | 106 - .../hmdzl/spspd/change/levels/TownLevel.java | 1111 -------- .../hmdzl/spspd/change/levels/VaultLevel.java | 249 -- .../spspd/change/levels/ZotBossLevel.java | 276 -- .../change/levels/features/AlchemyPot.java | 86 - .../spspd/change/levels/features/Chasm.java | 126 - .../spspd/change/levels/features/Door.java | 46 - .../change/levels/features/HighGrass.java | 116 - .../spspd/change/levels/features/Sign.java | 128 - .../change/levels/painters/ArmoryPainter.java | 76 - .../levels/painters/BarricadedPainter.java | 79 - .../levels/painters/BlacksmithPainter.java | 75 - .../levels/painters/BossExitPainter.java | 39 - .../change/levels/painters/CryptPainter.java | 101 - .../levels/painters/EntrancePainter.java | 50 - .../change/levels/painters/ExitPainter.java | 54 - .../change/levels/painters/GardenPainter.java | 108 - .../levels/painters/LaboratoryPainter.java | 85 - .../levels/painters/LibraryPainter.java | 106 - .../levels/painters/MagicWellPainter.java | 75 - .../change/levels/painters/MemoryPainter.java | 60 - .../spspd/change/levels/painters/Painter.java | 93 - .../levels/painters/PassagePainter.java | 118 - .../change/levels/painters/PitPainter.java | 101 - .../change/levels/painters/PoolPainter.java | 108 - .../levels/painters/RatKingPainter.java | 108 - .../levels/painters/RatKingPainter2.java | 106 - .../change/levels/painters/ShopPainter.java | 409 --- .../levels/painters/StandardPainter.java | 453 ---- .../change/levels/painters/StatuePainter.java | 76 - .../levels/painters/StoragePainter.java | 88 - .../change/levels/painters/TrapsPainter.java | 154 -- .../levels/painters/TreasuryPainter.java | 67 - .../change/levels/painters/TunnelPainter.java | 121 - .../change/levels/painters/VaultPainter.java | 84 - .../levels/painters/WeakFloorPainter.java | 98 - .../levels/traps/ActivatePortalTrap.java | 39 - .../spspd/change/levels/traps/AirTrap.java | 69 - .../spspd/change/levels/traps/AlarmTrap.java | 56 - .../change/levels/traps/BlazingTrap.java | 56 - .../change/levels/traps/ChangeSheepTrap.java | 65 - .../change/levels/traps/ChillingTrap.java | 61 - .../change/levels/traps/ConfusionTrap.java | 44 - .../change/levels/traps/CursingTrap.java | 75 - .../change/levels/traps/DisarmingTrap.java | 94 - .../levels/traps/DisintegrationTrap.java | 94 - .../change/levels/traps/DistortionTrap.java | 51 - .../change/levels/traps/ExplosiveTrap.java | 42 - .../spspd/change/levels/traps/FireTrap.java | 55 - .../change/levels/traps/FlashingTrap.java | 73 - .../change/levels/traps/FleecingTrap.java | 109 - .../spspd/change/levels/traps/FlockTrap.java | 73 - .../spspd/change/levels/traps/FrostTrap.java | 62 - .../spspd/change/levels/traps/GrimTrap.java | 75 - .../change/levels/traps/GrippingTrap.java | 60 - .../change/levels/traps/GuardianTrap.java | 114 - .../change/levels/traps/HeapGenTrap.java | 38 - .../change/levels/traps/LightningTrap.java | 92 - .../spspd/change/levels/traps/OozeTrap.java | 51 - .../change/levels/traps/ParalyticTrap.java | 44 - .../change/levels/traps/PitfallTrap.java | 87 - .../spspd/change/levels/traps/PoisonTrap.java | 55 - .../change/levels/traps/RockfallTrap.java | 84 - .../spspd/change/levels/traps/ShockTrap.java | 54 - .../levels/traps/SokobanPortalTrap.java | 39 - .../spspd/change/levels/traps/SpearTrap.java | 72 - .../spspd/change/levels/traps/StormTrap.java | 54 - .../change/levels/traps/SummoningTrap.java | 99 - .../levels/traps/TeleportationTrap.java | 93 - .../spspd/change/levels/traps/ToxicTrap.java | 46 - .../hmdzl/spspd/change/levels/traps/Trap.java | 112 - .../spspd/change/levels/traps/VenomTrap.java | 50 - .../change/levels/traps/WarpingTrap.java | 113 - .../change/levels/traps/WeakeningTrap.java | 57 - .../spspd/change/levels/traps/WornTrap.java | 49 - .../spspd/change/mechanics/Ballistica.java | 140 - .../spspd/change/mechanics/ShadowCaster.java | 162 -- .../spspd/change/messages/Languages.java | 88 - .../hmdzl/spspd/change/messages/Messages.java | 185 -- .../spspd/change/plants/BlandfruitBush.java | 50 - .../hmdzl/spspd/change/plants/Blindweed.java | 65 - .../hmdzl/spspd/change/plants/Dewcatcher.java | 69 - .../hmdzl/spspd/change/plants/Dreamfoil.java | 73 - .../hmdzl/spspd/change/plants/Earthroot.java | 135 - .../hmdzl/spspd/change/plants/Fadeleaf.java | 80 - .../hmdzl/spspd/change/plants/Firebloom.java | 55 - .../hmdzl/spspd/change/plants/Flytrap.java | 69 - .../com/hmdzl/spspd/change/plants/Icecap.java | 60 - .../hmdzl/spspd/change/plants/NutPlant.java | 41 - .../hmdzl/spspd/change/plants/Phaseshift.java | 71 - java/com/hmdzl/spspd/change/plants/Plant.java | 199 -- .../hmdzl/spspd/change/plants/Rotberry.java | 57 - .../hmdzl/spspd/change/plants/Seedpod.java | 67 - .../hmdzl/spspd/change/plants/Sorrowmoss.java | 57 - .../hmdzl/spspd/change/plants/Starflower.java | 55 - .../hmdzl/spspd/change/plants/Stormvine.java | 36 - .../hmdzl/spspd/change/plants/Sungrass.java | 157 -- .../hmdzl/spspd/change/scenes/AboutScene.java | 160 -- .../spspd/change/scenes/AmuletScene.java | 120 - .../spspd/change/scenes/BadgesScene.java | 113 - .../spspd/change/scenes/CellSelector.java | 179 -- .../hmdzl/spspd/change/scenes/GameScene.java | 866 ------ .../spspd/change/scenes/InterlevelScene.java | 584 ---- .../hmdzl/spspd/change/scenes/IntroScene.java | 40 - .../spspd/change/scenes/LoadSaveScene.java | 337 --- .../hmdzl/spspd/change/scenes/PixelScene.java | 381 --- .../spspd/change/scenes/PowerHandScene.java | 123 - .../spspd/change/scenes/Pudding_CupScene.java | 104 - .../spspd/change/scenes/RankingsScene.java | 300 --- .../hmdzl/spspd/change/scenes/StartScene.java | 536 ---- .../spspd/change/scenes/SurfaceScene.java | 380 --- .../hmdzl/spspd/change/scenes/TitleScene.java | 235 -- .../spspd/change/scenes/WelcomeScene.java | 101 - .../spspd/change/sprites/AFlySprite.java | 55 - .../spspd/change/sprites/ARealManSprite.java | 54 - .../spspd/change/sprites/AcidicSprite.java | 54 - .../sprites/AdultDragonVioletSprite.java | 75 - .../change/sprites/AlbinoPiranhaSprite.java | 56 - .../spspd/change/sprites/AlbinoSprite.java | 46 - .../spspd/change/sprites/ApostleSprite.java | 54 - .../spspd/change/sprites/AssassinSprite.java | 98 - .../spspd/change/sprites/BaBaSprite.java | 47 - .../change/sprites/BanditKingSprite.java | 58 - .../spspd/change/sprites/BanditSprite.java | 45 - .../hmdzl/spspd/change/sprites/BatSprite.java | 46 - .../change/sprites/BatteryTombSprite.java | 65 - .../spspd/change/sprites/BeastYearSprite.java | 54 - .../hmdzl/spspd/change/sprites/BeeSprite.java | 51 - .../spspd/change/sprites/BilboldevSprite.java | 54 - .../change/sprites/BlacksmithSprite.java | 82 - .../change/sprites/BlueDragonSprite.java | 74 - .../change/sprites/BlueWraithSprite.java | 51 - .../change/sprites/BrokenRobotSprite.java | 70 - .../spspd/change/sprites/BrownBatSprite.java | 46 - .../spspd/change/sprites/BruteSprite.java | 75 - .../spspd/change/sprites/BugDragonSprite.java | 81 - .../spspd/change/sprites/BunnySprite.java | 58 - .../change/sprites/BurningFistSprite.java | 76 - .../spspd/change/sprites/CellmobSprite.java | 53 - .../spspd/change/sprites/CharSprite.java | 603 ----- .../spspd/change/sprites/CoconutSprite.java | 78 - .../sprites/ConsideredHamsterSprite.java | 54 - .../spspd/change/sprites/CrabKingSprite.java | 105 - .../spspd/change/sprites/CrabSprite.java | 51 - .../spspd/change/sprites/DM300Sprite.java | 64 - .../spspd/change/sprites/DachhackSprite.java | 54 - .../spspd/change/sprites/DemonGooSprite.java | 127 - .../change/sprites/DemonflowerSprite.java | 49 - .../change/sprites/DewProtectorSprite.java | 66 - .../change/sprites/DiscardedItemSprite.java | 48 - .../change/sprites/DragonkingSprite.java | 46 - .../change/sprites/DreamPlayerSprite.java | 65 - .../change/sprites/DustElementSprite.java | 56 - .../change/sprites/DwarfKingTombSprite.java | 42 - .../spspd/change/sprites/DwarfLichSprite.java | 120 - .../change/sprites/ElderAvatarSprite.java | 83 - .../change/sprites/ElectricwelderSprite.java | 83 - .../spspd/change/sprites/ErrorSprite.java | 54 - .../spspd/change/sprites/ExMobileSprite.java | 80 - .../hmdzl/spspd/change/sprites/EyeSprite.java | 69 - .../spspd/change/sprites/FairySprite.java | 59 - .../spspd/change/sprites/FetidRatSprite.java | 80 - .../spspd/change/sprites/FiendSprite.java | 75 - .../change/sprites/FireElementalSprite.java | 67 - .../change/sprites/FishProtectorSprite.java | 66 - .../hmdzl/spspd/change/sprites/FlySprite.java | 57 - .../change/sprites/FlyingProtectorSprite.java | 66 - .../change/sprites/ForestProtectorSprite.java | 66 - .../spspd/change/sprites/FruitCatSprite.java | 54 - .../change/sprites/GentleCrabSprite.java | 51 - .../spspd/change/sprites/GhostSprite.java | 94 - .../change/sprites/GnollArcherSprite.java | 61 - .../change/sprites/GnollKeeperSprite.java | 74 - .../spspd/change/sprites/GnollKingSprite.java | 75 - .../spspd/change/sprites/GnollSprite.java | 75 - .../change/sprites/GnollTricksterSprite.java | 62 - .../change/sprites/GoblinPlayerSprite.java | 54 - .../change/sprites/GoldDragonSprite.java | 80 - .../spspd/change/sprites/GoldOrcSprite.java | 49 - .../spspd/change/sprites/GoldThiefSprite.java | 45 - .../spspd/change/sprites/GolemSprite.java | 60 - .../hmdzl/spspd/change/sprites/GooSprite.java | 127 - .../change/sprites/GraveProtectorSprite.java | 65 - .../spspd/change/sprites/GreatCrabSprite.java | 38 - .../change/sprites/GreenDragonSprite.java | 68 - .../spspd/change/sprites/GreyRatSprite.java | 46 - .../spspd/change/sprites/GuardSprite.java | 61 - .../hmdzl/spspd/change/sprites/HBBSprite.java | 54 - .../change/sprites/HateSokobanSprite.java | 54 - .../spspd/change/sprites/HeXASprite.java | 54 - .../change/sprites/HermitCrabSprite.java | 61 - .../spspd/change/sprites/HeroSprite.java | 149 - .../change/sprites/HoneyPooootSprite.java | 54 - .../spspd/change/sprites/HybridSprite.java | 74 - .../spspd/change/sprites/Ice13Sprite.java | 55 - .../hmdzl/spspd/change/sprites/ImpSprite.java | 69 - .../change/sprites/InfectingFistSprite.java | 69 - .../spspd/change/sprites/ItemSprite.java | 233 -- .../spspd/change/sprites/ItemSpriteSheet.java | 575 ---- .../spspd/change/sprites/JinkeloidSprite.java | 54 - .../spspd/change/sprites/Juh9870Sprite.java | 54 - .../spspd/change/sprites/KeKeSprite.java | 59 - .../spspd/change/sprites/KingSprite.java | 46 - .../change/sprites/Kostis12345Sprite.java | 54 - .../spspd/change/sprites/LaJiSprite.java | 54 - .../spspd/change/sprites/LarvaSprite.java | 58 - .../spspd/change/sprites/LerySprite.java | 89 - .../change/sprites/LichDancerSprite.java | 41 - .../change/sprites/LightDragonSprite.java | 85 - .../spspd/change/sprites/LiveMossSprite.java | 49 - .../spspd/change/sprites/LocastanSprite.java | 54 - .../hmdzl/spspd/change/sprites/LynSprite.java | 54 - .../spspd/change/sprites/LynnSprite.java | 54 - .../spspd/change/sprites/MagicEyeSprite.java | 69 - .../change/sprites/ManySkeletonSprite.java | 55 - .../change/sprites/MemoryOfSandSprite.java | 54 - .../change/sprites/MillilitreSprite.java | 54 - .../spspd/change/sprites/MimicSprite.java | 51 - .../spspd/change/sprites/MirrorSprite.java | 62 - .../spspd/change/sprites/MissileSprite.java | 91 - .../hmdzl/spspd/change/sprites/MobSprite.java | 73 - .../spspd/change/sprites/MobileSprite.java | 78 - .../spspd/change/sprites/MonkSprite.java | 65 - .../spspd/change/sprites/MonkeySprite.java | 59 - .../change/sprites/MonsterBoxSprite.java | 51 - .../change/sprites/MossySkeletonSprite.java | 61 - .../sprites/MrDestructo2dot0Sprite.java | 70 - .../change/sprites/MrDestructoSprite.java | 70 - .../spspd/change/sprites/MusketeerSprite.java | 77 - .../spspd/change/sprites/NYRDSSprite.java | 54 - .../spspd/change/sprites/NewPlayerSprite.java | 54 - .../change/sprites/NoodlemireSprite.java | 54 - .../spspd/change/sprites/ObeliskSprite.java | 54 - .../change/sprites/OldNewStwistSprite.java | 57 - .../change/sprites/Omicronrg9Sprite.java | 55 - .../spspd/change/sprites/OrbOfZotSprite.java | 70 - .../hmdzl/spspd/change/sprites/OrcSprite.java | 49 - .../change/sprites/OtiluckStoneSprite.java | 61 - .../change/sprites/OtilukeNPCSprite.java | 55 - .../spspd/change/sprites/OtilukeSprite.java | 75 - .../spspd/change/sprites/PainterSprite.java | 55 - .../spspd/change/sprites/PatrolUAVSprite.java | 49 - .../change/sprites/PinningFistSprite.java | 76 - .../spspd/change/sprites/PiranhaSprite.java | 56 - .../change/sprites/PlagueDoctorSprite.java | 49 - .../spspd/change/sprites/PlantKingSprite.java | 55 - .../spspd/change/sprites/PlantSprite.java | 109 - .../spspd/change/sprites/PoisonGooSprite.java | 127 - .../change/sprites/PrisonWanderSprite.java | 49 - .../hmdzl/spspd/change/sprites/RENSprite.java | 54 - .../spspd/change/sprites/RainSprite.java | 54 - .../spspd/change/sprites/RatBossSprite.java | 46 - .../spspd/change/sprites/RatKingSprite.java | 57 - .../hmdzl/spspd/change/sprites/RatSprite.java | 46 - .../spspd/change/sprites/RavenwolfSprite.java | 54 - .../spspd/change/sprites/RedDragonSprite.java | 74 - .../spspd/change/sprites/RedWraithSprite.java | 82 - .../change/sprites/RottingFistSprite.java | 69 - .../change/sprites/RustybladeSprite.java | 55 - .../hmdzl/spspd/change/sprites/SFBSprite.java | 54 - .../spspd/change/sprites/SP931Sprite.java | 54 - .../spspd/change/sprites/SadSaltanSprite.java | 58 - .../spspd/change/sprites/SaidbySunSprite.java | 54 - .../spspd/change/sprites/SandmobSprite.java | 88 - .../spspd/change/sprites/ScarecrowSprite.java | 82 - .../spspd/change/sprites/ScorpioSprite.java | 90 - .../spspd/change/sprites/ScorpionSprite.java | 53 - .../change/sprites/SeekingBombSprite.java | 51 - .../sprites/SeekingClusterBombSprite.java | 51 - .../spspd/change/sprites/SeniorSprite.java | 65 - .../spspd/change/sprites/SentinelSprite.java | 51 - .../change/sprites/SewerHeartSprite.java | 141 - .../change/sprites/SewerLasherSprite.java | 49 - .../change/sprites/ShadowDragonSprite.java | 78 - .../spspd/change/sprites/ShadowRatSprite.java | 46 - .../spspd/change/sprites/ShadowYogSprite.java | 58 - .../spspd/change/sprites/ShamanSprite.java | 61 - .../spspd/change/sprites/SheepSprite.java | 45 - .../spspd/change/sprites/ShellSprite.java | 56 - .../spspd/change/sprites/ShieldedSprite.java | 74 - .../change/sprites/ShopkeeperSprite.java | 58 - .../spspd/change/sprites/ShowerSprite.java | 54 - .../change/sprites/SkeletonHand1Sprite.java | 60 - .../change/sprites/SkeletonHand2Sprite.java | 47 - .../change/sprites/SkeletonKingSprite.java | 47 - .../spspd/change/sprites/SkeletonSprite.java | 61 - .../spspd/change/sprites/SnakeSprite.java | 46 - .../sprites/SokobanBlackSheepSprite.java | 45 - .../sprites/SokobanCornerSheepSprite.java | 45 - .../change/sprites/SokobanSheepSprite.java | 45 - .../sprites/SokobanSheepSwitchSprite.java | 45 - .../spspd/change/sprites/SpiderBotSprite.java | 50 - .../spspd/change/sprites/SpiderEggSprite.java | 34 - .../change/sprites/SpiderGoldSprite.java | 34 - .../change/sprites/SpiderJumpSprite.java | 34 - .../change/sprites/SpiderMindSprite.java | 34 - .../change/sprites/SpiderNormalSprite.java | 34 - .../change/sprites/SpiderQueenSprite.java | 34 - .../spspd/change/sprites/SpiderSprite.java | 51 - .../spspd/change/sprites/SpinnerSprite.java | 51 - .../spspd/change/sprites/SteelBeeSprite.java | 52 - .../spspd/change/sprites/StoneSprite.java | 59 - .../change/sprites/StormAndRainSprite.java | 54 - .../spspd/change/sprites/SuccubusSprite.java | 56 - .../spspd/change/sprites/SuffererSprite.java | 56 - .../change/sprites/SugarplumFairySprite.java | 57 - .../spspd/change/sprites/SwarmSprite.java | 51 - .../spspd/change/sprites/TCloudSprite.java | 61 - .../spspd/change/sprites/TankSprite.java | 49 - .../change/sprites/Tempest102Sprite.java | 54 - .../spspd/change/sprites/TenguSprite.java | 111 - .../spspd/change/sprites/ThankListSprite.java | 54 - .../spspd/change/sprites/ThiefImpSprite.java | 36 - .../spspd/change/sprites/ThiefKingSprite.java | 137 - .../spspd/change/sprites/ThiefSprite.java | 45 - .../spspd/change/sprites/TinkererSprite.java | 121 - .../spspd/change/sprites/TowerSprite.java | 42 - .../spspd/change/sprites/TrapSprite.java | 90 - .../change/sprites/TrollWarriorSprite.java | 49 - .../change/sprites/TypedScrollSprite.java | 54 - .../spspd/change/sprites/UDM300Sprite.java | 64 - .../spspd/change/sprites/UGooSprite.java | 150 -- .../spspd/change/sprites/UTenguSprite.java | 125 - .../spspd/change/sprites/UdawosSprite.java | 54 - .../spspd/change/sprites/UncleSSprite.java | 54 - .../spspd/change/sprites/UndeadSprite.java | 61 - .../change/sprites/VaultProtectorSprite.java | 66 - .../change/sprites/VelociroosterSprite.java | 51 - .../spspd/change/sprites/VillagerSprite.java | 56 - .../change/sprites/VioletDragonSprite.java | 74 - .../spspd/change/sprites/WandmakerSprite.java | 121 - .../spspd/change/sprites/WarlockSprite.java | 75 - .../spspd/change/sprites/WatabouSprite.java | 54 - .../change/sprites/WhiteGhostSprite.java | 54 - .../spspd/change/sprites/WraithSprite.java | 82 - .../change/sprites/Xavier251998Sprite.java | 54 - .../spspd/change/sprites/XixiZeroSprite.java | 55 - .../hmdzl/spspd/change/sprites/YogSprite.java | 54 - .../spspd/change/sprites/ZombieSprite.java | 51 - .../spspd/change/sprites/ZotPhaseSprite.java | 53 - .../hmdzl/spspd/change/sprites/ZotSprite.java | 162 -- .../spspd/change/ui/ActionIndicator.java | 119 - java/com/hmdzl/spspd/change/ui/Archs.java | 75 - .../spspd/change/ui/AttackIndicator.java | 182 -- .../com/hmdzl/spspd/change/ui/BadgesList.java | 123 - java/com/hmdzl/spspd/change/ui/Banner.java | 102 - .../hmdzl/spspd/change/ui/BuffIndicator.java | 302 --- .../hmdzl/spspd/change/ui/BusyIndicator.java | 38 - .../hmdzl/spspd/change/ui/ChangesButton.java | 72 - .../spspd/change/ui/CharHealthIndicator.java | 73 - java/com/hmdzl/spspd/change/ui/CheckBox.java | 64 - java/com/hmdzl/spspd/change/ui/Compass.java | 66 - .../spspd/change/ui/CustomTileVisual.java | 123 - .../spspd/change/ui/DangerIndicator.java | 107 - .../com/hmdzl/spspd/change/ui/ExitButton.java | 74 - java/com/hmdzl/spspd/change/ui/GameLog.java | 157 -- .../hmdzl/spspd/change/ui/GoldIndicator.java | 79 - java/com/hmdzl/spspd/change/ui/HealthBar.java | 122 - .../spspd/change/ui/HealthIndicator.java | 82 - .../com/hmdzl/spspd/change/ui/IconButton.java | 84 - java/com/hmdzl/spspd/change/ui/Icons.java | 178 -- java/com/hmdzl/spspd/change/ui/ItemSlot.java | 297 -- .../hmdzl/spspd/change/ui/LanguageButton.java | 87 - .../hmdzl/spspd/change/ui/LootIndicator.java | 96 - .../hmdzl/spspd/change/ui/MemoryButton.java | 82 - .../hmdzl/spspd/change/ui/PrefsButton.java | 68 - .../spspd/change/ui/QuickSlotButton.java | 251 -- java/com/hmdzl/spspd/change/ui/RedButton.java | 121 - .../change/ui/RenderedTextMultiline.java | 197 -- .../hmdzl/spspd/change/ui/ResumeButton.java | 67 - .../spspd/change/ui/ResumeIndicator.java | 57 - .../com/hmdzl/spspd/change/ui/ScrollPane.java | 148 - .../hmdzl/spspd/change/ui/SimpleButton.java | 68 - .../hmdzl/spspd/change/ui/SpellButton.java | 136 - .../com/hmdzl/spspd/change/ui/StatusPane.java | 262 -- java/com/hmdzl/spspd/change/ui/Tag.java | 80 - .../change/ui/TargetHealthIndicator.java | 66 - java/com/hmdzl/spspd/change/ui/Toast.java | 88 - java/com/hmdzl/spspd/change/ui/Toolbar.java | 400 --- java/com/hmdzl/spspd/change/ui/Window.java | 219 -- java/com/hmdzl/spspd/change/utils/BArray.java | 163 -- java/com/hmdzl/spspd/change/utils/GLog.java | 61 - java/com/hmdzl/spspd/change/utils/Utils.java | 47 - .../hmdzl/spspd/change/windows/IconTitle.java | 115 - .../spspd/change/windows/WndAflyInfo.java | 246 -- .../spspd/change/windows/WndAlchemy.java | 567 ---- .../hmdzl/spspd/change/windows/WndAscend.java | 74 - .../hmdzl/spspd/change/windows/WndBadge.java | 58 - .../hmdzl/spspd/change/windows/WndBag.java | 565 ---- .../spspd/change/windows/WndBlacksmith.java | 173 -- .../spspd/change/windows/WndBlacksmith2.java | 186 -- .../spspd/change/windows/WndCatalogus.java | 203 -- .../change/windows/WndChallengeBook.java | 137 - .../spspd/change/windows/WndChallenges.java | 110 - .../spspd/change/windows/WndChooseWay.java | 87 - .../hmdzl/spspd/change/windows/WndClass.java | 182 -- .../spspd/change/windows/WndDescend.java | 75 - .../spspd/change/windows/WndDewDrawInfo.java | 103 - .../spspd/change/windows/WndEgoalInfo.java | 65 - .../hmdzl/spspd/change/windows/WndError.java | 31 - .../hmdzl/spspd/change/windows/WndGame.java | 153 -- .../hmdzl/spspd/change/windows/WndHero.java | 781 ------ .../hmdzl/spspd/change/windows/WndHotel.java | 86 - .../hmdzl/spspd/change/windows/WndImp.java | 84 - .../spspd/change/windows/WndInfoBuff.java | 66 - .../spspd/change/windows/WndInfoCell.java | 83 - .../spspd/change/windows/WndInfoItem.java | 142 - .../spspd/change/windows/WndInfoMob.java | 97 - .../spspd/change/windows/WndInfoPlant.java | 30 - .../spspd/change/windows/WndInfoTrap.java | 38 - .../hmdzl/spspd/change/windows/WndItem.java | 164 -- .../spspd/change/windows/WndJournal.java | 129 - .../hmdzl/spspd/change/windows/WndLangs.java | 205 -- .../hmdzl/spspd/change/windows/WndList.java | 71 - .../spspd/change/windows/WndMessage.java | 44 - .../hmdzl/spspd/change/windows/WndMix.java | 290 -- .../hmdzl/spspd/change/windows/WndONS.java | 73 - .../spspd/change/windows/WndOptions.java | 71 - .../spspd/change/windows/WndOtiluke.java | 140 - .../change/windows/WndOtilukeMessage.java | 72 - .../hmdzl/spspd/change/windows/WndQuest.java | 29 - .../spspd/change/windows/WndRanking.java | 424 --- .../spspd/change/windows/WndResurrect.java | 99 - .../spspd/change/windows/WndSadGhost.java | 108 - .../spspd/change/windows/WndSettings.java | 246 -- .../hmdzl/spspd/change/windows/WndStory.java | 138 - .../hmdzl/spspd/change/windows/WndTabbed.java | 225 -- .../spspd/change/windows/WndTinkerer.java | 152 -- .../spspd/change/windows/WndTinkerer2.java | 166 -- .../spspd/change/windows/WndTinkerer3.java | 93 - .../change/windows/WndTitledMessage.java | 55 - .../spspd/change/windows/WndTradeItem.java | 285 -- .../spspd/change/windows/WndWandmaker.java | 104 - java/com/hmdzl/spspd/items/Generator.java | 33 +- .../hmdzl/spspd/items/ItemStatusHandler.java | 35 + .../com/hmdzl/spspd/items/UpgradeEatBall.java | 2 +- .../hmdzl/spspd/items/artifacts/AlienBag.java | 4 +- .../spspd/items/artifacts/CapeOfThorns.java | 5 +- .../items/artifacts/UnstableSpellbook.java | 21 +- java/com/hmdzl/spspd/items/bombs/Bomb.java | 2 +- java/com/hmdzl/spspd/items/food/Food.java | 42 +- .../food/completefood/ZongZi.java} | 25 +- .../spspd/items/food/fruit/Blandfruit.java | 27 +- .../medicine/RealgarWine.java} | 23 +- .../hmdzl/spspd/items/misc/AttackShoes.java | 7 + java/com/hmdzl/spspd/items/misc/BShovel.java | 8 +- java/com/hmdzl/spspd/items/misc/CopyBall.java | 2 + .../hmdzl/spspd/items/misc/DemoScroll.java | 24 +- .../com/hmdzl/spspd/items/misc/DiceTower.java | 147 + java/com/hmdzl/spspd/items/misc/JumpF.java | 6 +- .../com/hmdzl/spspd/items/misc/NeedPaper.java | 131 + .../com/hmdzl/spspd/items/misc/NmHealBag.java | 136 + java/com/hmdzl/spspd/items/misc/PPC.java | 169 ++ .../hmdzl/spspd/items/misc/UndeadBook.java | 2 +- .../com/hmdzl/spspd/items/potions/Potion.java | 13 +- .../spspd/items/potions/PotionOfMending.java | 2 +- .../spspd/items/potions/PotionOfMight.java | 4 +- .../spspd/items/potions/PotionOfMixing.java | 66 + .../items/potions/PotionOfOverHealing.java | 2 + ...PotionOfHaste.java => PotionOfShield.java} | 27 +- .../hmdzl/spspd/items/rings/RingOfMight.java | 2 +- .../spspd/items/scrolls/InventoryScroll.java | 2 +- .../com/hmdzl/spspd/items/scrolls/Scroll.java | 3 +- .../spspd/items/skills/FollowerSkill.java | 5 +- .../hmdzl/spspd/items/wands/CannonOfMage.java | 2 +- java/com/hmdzl/spspd/items/wands/Wand.java | 10 +- .../hmdzl/spspd/items/wands/WandOfLight.java | 2 +- .../spspd/items/wands/WandOfMagicMissile.java | 9 +- .../hmdzl/spspd/items/wands/WandOfPoison.java | 19 +- java/com/hmdzl/spspd/items/weapon/Weapon.java | 16 +- .../spspd/items/weapon/guns/GunWeapon.java | 1 + .../spspd/items/weapon/melee/HolyWater.java | 6 +- .../spspd/items/weapon/melee/Knuckles.java | 4 +- .../hmdzl/spspd/items/weapon/melee/Mace.java | 4 +- .../spspd/items/weapon/melee/PrayerWheel.java | 4 +- .../spspd/items/weapon/melee/StoneCross.java | 4 +- .../spspd/items/weapon/melee/WoodenStaff.java | 2 - .../weapon/melee/relic/JupitersWraith.java | 2 +- .../weapon/melee/relic/RelicMeleeWeapon.java | 4 +- .../weapon/melee/special/DemonBlade.java} | 52 +- .../weapon/melee/special/DiamondPickaxe.java | 29 +- .../weapon/melee/special/DragonBoat.java | 68 + .../items/weapon/melee/special/LinkSword.java | 2 +- .../spspd/items/weapon/missiles/ElfBow.java | 249 ++ .../items/weapon/missiles/HugeShuriken.java | 2 +- .../weapon/missiles/MindArrow.java} | 31 +- .../weapon/missiles/buildblock/BookBlock.java | 4 +- .../weapon/missiles/buildblock/DoorBlock.java | 4 +- .../missiles/buildblock/StoneBlock.java | 4 +- .../weapon/missiles/buildblock/WallBlock.java | 6 +- .../missiles/buildblock/WoodenBlock.java | 6 +- java/com/hmdzl/spspd/levels/Level.java | 17 +- java/com/hmdzl/spspd/levels/RegularLevel.java | 12 +- java/com/hmdzl/spspd/levels/SewerLevel.java | 2 +- java/com/hmdzl/spspd/levels/TownLevel.java | 24 +- .../spspd/levels/features/HighGrass.java | 2 +- .../spspd/levels/painters/ArmoryPainter.java | 18 +- .../spspd/levels/painters/CryptPainter.java | 26 + .../spspd/levels/painters/ExitPainter.java | 1 + .../levels/painters/LaboratoryPainter.java | 46 +- .../spspd/levels/painters/LibraryPainter.java | 82 +- .../spspd/levels/painters/ShopPainter.java | 4 +- .../spspd/levels/painters/StatuePainter.java | 18 + .../levels/painters/TreasuryPainter.java | 59 +- .../spspd/levels/painters/VaultPainter.java | 13 +- .../spspd/levels/traps/DistortionTrap.java | 2 + java/com/hmdzl/spspd/plants/NutPlant.java | 3 +- java/com/hmdzl/spspd/plants/Seedpod.java | 3 +- java/com/hmdzl/spspd/scenes/GameScene.java | 9 - java/com/hmdzl/spspd/scenes/StartScene.java | 2 +- .../BlackMeowSprite.java} | 18 +- .../CatSheepSprite.java} | 16 +- .../GreatMossSprite.java} | 10 +- .../IceRabbit2Sprite.java} | 34 +- .../hmdzl/spspd/sprites/IceRabbitSprite.java | 10 +- .../hmdzl/spspd/sprites/ItemSpriteSheet.java | 23 +- .../MobBambooSprite.java} | 16 +- java/com/hmdzl/spspd/ui/BuffIndicator.java | 4 +- java/com/hmdzl/spspd/ui/StatusPane.java | 12 +- java/com/hmdzl/spspd/windows/WndAlchemy.java | 37 +- java/com/hmdzl/spspd/windows/WndIssic.java | 2 +- java/com/hmdzl/spspd/windows/WndMix.java | 2 +- java/com/hmdzl/spspd/windows/WndTinkerer.java | 4 + java/com/hmdzl/spspd/windows/Wndice13.java | 2 +- .../messages/actors/actors_zh.properties | 96 +- .../spspd/messages/items/items_zh.properties | 105 +- .../spspd/messages/misc/misc_zh.properties | 4 + .../messages/scenes/scenes_zh.properties | 2 +- 1573 files changed, 3073 insertions(+), 182115 deletions(-) create mode 100644 assets/bamboo.png create mode 100644 assets/blackmeow.png create mode 100644 assets/catsheep.png create mode 100644 assets/greatmoss.png create mode 100644 assets/icerabbit.png rename java/com/hmdzl/spspd/{change/actors/blobs/ToxicGas.java => actors/blobs/NmGas.java} (62%) rename java/com/hmdzl/spspd/{change/actors/blobs/TarGas.java => actors/blobs/PoisonGas.java} (69%) create mode 100644 java/com/hmdzl/spspd/actors/buffs/DBurning.java rename java/com/hmdzl/spspd/{change/actors/buffs/Hot.java => actors/buffs/MagicWeak.java} (83%) create mode 100644 java/com/hmdzl/spspd/actors/buffs/actbuff/NmImbue.java rename java/com/hmdzl/spspd/{change/actors/buffs/Cold.java => actors/buffs/actbuff/Nmstop.java} (78%) rename java/com/hmdzl/spspd/{change/actors/buffs/WarGroove.java => actors/buffs/mindbuff/AmokMind.java} (73%) rename java/com/hmdzl/spspd/{change/actors/buffs/Fury.java => actors/buffs/mindbuff/CrazyMind.java} (70%) rename java/com/hmdzl/spspd/{change/actors/buffs/Dewcharge.java => actors/buffs/mindbuff/HopeMind.java} (69%) rename java/com/hmdzl/spspd/{change/actors/buffs/Ooze.java => actors/buffs/mindbuff/KeepMind.java} (50%) rename java/com/hmdzl/spspd/{change/actors/buffs/faithbuff/LifeFaith.java => actors/buffs/mindbuff/LoseMind.java} (67%) create mode 100644 java/com/hmdzl/spspd/actors/buffs/mindbuff/TerrorMind.java create mode 100644 java/com/hmdzl/spspd/actors/buffs/mindbuff/WeakMind.java create mode 100644 java/com/hmdzl/spspd/actors/mobs/BambooMob.java create mode 100644 java/com/hmdzl/spspd/actors/mobs/Greatmoss.java rename java/com/hmdzl/spspd/{change/actors/mobs/UIcecorps.java => actors/mobs/UIcecorps2.java} (56%) rename java/com/hmdzl/spspd/{change/actors/mobs/npcs/AliveFish.java => actors/mobs/npcs/BlackMeow.java} (77%) rename java/com/hmdzl/spspd/{change/actors/mobs/npcs/Lery.java => actors/mobs/npcs/CatSheep.java} (77%) delete mode 100644 java/com/hmdzl/spspd/change/Assets.java delete mode 100644 java/com/hmdzl/spspd/change/Badges.java delete mode 100644 java/com/hmdzl/spspd/change/Challenges.java delete mode 100644 java/com/hmdzl/spspd/change/Chrome.java delete mode 100644 java/com/hmdzl/spspd/change/Dungeon.java delete mode 100644 java/com/hmdzl/spspd/change/DungeonTilemap.java delete mode 100644 java/com/hmdzl/spspd/change/FogOfWar.java delete mode 100644 java/com/hmdzl/spspd/change/GamesInProgress.java delete mode 100644 java/com/hmdzl/spspd/change/Journal.java delete mode 100644 java/com/hmdzl/spspd/change/Preferences.java delete mode 100644 java/com/hmdzl/spspd/change/QuickSlot.java delete mode 100644 java/com/hmdzl/spspd/change/Rankings.java delete mode 100644 java/com/hmdzl/spspd/change/ResultDescriptions.java delete mode 100644 java/com/hmdzl/spspd/change/SPSSettings.java delete mode 100644 java/com/hmdzl/spspd/change/ShatteredPixelDungeon.java delete mode 100644 java/com/hmdzl/spspd/change/Skins.java delete mode 100644 java/com/hmdzl/spspd/change/Statistics.java delete mode 100644 java/com/hmdzl/spspd/change/actors/Actor.java delete mode 100644 java/com/hmdzl/spspd/change/actors/Char.java delete mode 100644 java/com/hmdzl/spspd/change/actors/animate/WeaponAnimate.java delete mode 100644 java/com/hmdzl/spspd/change/actors/blobs/Alchemy.java delete mode 100644 java/com/hmdzl/spspd/change/actors/blobs/Alter.java delete mode 100644 java/com/hmdzl/spspd/change/actors/blobs/Blob.java delete mode 100644 java/com/hmdzl/spspd/change/actors/blobs/ConfusionGas.java delete mode 100644 java/com/hmdzl/spspd/change/actors/blobs/CorruptGas.java delete mode 100644 java/com/hmdzl/spspd/change/actors/blobs/DarkGas.java delete mode 100644 java/com/hmdzl/spspd/change/actors/blobs/ElectriShock.java delete mode 100644 java/com/hmdzl/spspd/change/actors/blobs/Fire.java delete mode 100644 java/com/hmdzl/spspd/change/actors/blobs/Foliage.java delete mode 100644 java/com/hmdzl/spspd/change/actors/blobs/Freezing.java delete mode 100644 java/com/hmdzl/spspd/change/actors/blobs/FrostGas.java delete mode 100644 java/com/hmdzl/spspd/change/actors/blobs/GooWarn.java delete mode 100644 java/com/hmdzl/spspd/change/actors/blobs/HealLight.java delete mode 100644 java/com/hmdzl/spspd/change/actors/blobs/MemoryFire.java delete mode 100644 java/com/hmdzl/spspd/change/actors/blobs/ParalyticGas.java delete mode 100644 java/com/hmdzl/spspd/change/actors/blobs/Portal.java delete mode 100644 java/com/hmdzl/spspd/change/actors/blobs/Regrowth.java delete mode 100644 java/com/hmdzl/spspd/change/actors/blobs/ShockWeb.java delete mode 100644 java/com/hmdzl/spspd/change/actors/blobs/SlowWeb.java delete mode 100644 java/com/hmdzl/spspd/change/actors/blobs/StenchGas.java delete mode 100644 java/com/hmdzl/spspd/change/actors/blobs/VenomGas.java delete mode 100644 java/com/hmdzl/spspd/change/actors/blobs/Water.java delete mode 100644 java/com/hmdzl/spspd/change/actors/blobs/WaterOfAwareness.java delete mode 100644 java/com/hmdzl/spspd/change/actors/blobs/WaterOfHealth.java delete mode 100644 java/com/hmdzl/spspd/change/actors/blobs/WaterOfTransmutation.java delete mode 100644 java/com/hmdzl/spspd/change/actors/blobs/WaterOfUpgradeEating.java delete mode 100644 java/com/hmdzl/spspd/change/actors/blobs/Web.java delete mode 100644 java/com/hmdzl/spspd/change/actors/blobs/WellWater.java delete mode 100644 java/com/hmdzl/spspd/change/actors/blobs/weather/WeatherOfDead.java delete mode 100644 java/com/hmdzl/spspd/change/actors/blobs/weather/WeatherOfQuite.java delete mode 100644 java/com/hmdzl/spspd/change/actors/blobs/weather/WeatherOfRain.java delete mode 100644 java/com/hmdzl/spspd/change/actors/blobs/weather/WeatherOfSand.java delete mode 100644 java/com/hmdzl/spspd/change/actors/blobs/weather/WeatherOfSnow.java delete mode 100644 java/com/hmdzl/spspd/change/actors/blobs/weather/WeatherOfSun.java delete mode 100644 java/com/hmdzl/spspd/change/actors/buffs/AflyBless.java delete mode 100644 java/com/hmdzl/spspd/change/actors/buffs/Amok.java delete mode 100644 java/com/hmdzl/spspd/change/actors/buffs/Arcane.java delete mode 100644 java/com/hmdzl/spspd/change/actors/buffs/ArmorBreak.java delete mode 100644 java/com/hmdzl/spspd/change/actors/buffs/AttackDown.java delete mode 100644 java/com/hmdzl/spspd/change/actors/buffs/AttackUp.java delete mode 100644 java/com/hmdzl/spspd/change/actors/buffs/Awareness.java delete mode 100644 java/com/hmdzl/spspd/change/actors/buffs/Barkskin.java delete mode 100644 java/com/hmdzl/spspd/change/actors/buffs/BerryRegeneration.java delete mode 100644 java/com/hmdzl/spspd/change/actors/buffs/Bleeding.java delete mode 100644 java/com/hmdzl/spspd/change/actors/buffs/Bless.java delete mode 100644 java/com/hmdzl/spspd/change/actors/buffs/Blindness.java delete mode 100644 java/com/hmdzl/spspd/change/actors/buffs/BloodAngry.java delete mode 100644 java/com/hmdzl/spspd/change/actors/buffs/BloodImbue.java delete mode 100644 java/com/hmdzl/spspd/change/actors/buffs/BoxStar.java delete mode 100644 java/com/hmdzl/spspd/change/actors/buffs/Buff.java delete mode 100644 java/com/hmdzl/spspd/change/actors/buffs/Burning.java delete mode 100644 java/com/hmdzl/spspd/change/actors/buffs/Charm.java delete mode 100644 java/com/hmdzl/spspd/change/actors/buffs/Chill.java delete mode 100644 java/com/hmdzl/spspd/change/actors/buffs/Combo.java delete mode 100644 java/com/hmdzl/spspd/change/actors/buffs/Corruption.java delete mode 100644 java/com/hmdzl/spspd/change/actors/buffs/CountDown.java delete mode 100644 java/com/hmdzl/spspd/change/actors/buffs/Cripple.java delete mode 100644 java/com/hmdzl/spspd/change/actors/buffs/DamageUp.java delete mode 100644 java/com/hmdzl/spspd/change/actors/buffs/DeadRaise.java delete mode 100644 java/com/hmdzl/spspd/change/actors/buffs/DefenceUp.java delete mode 100644 java/com/hmdzl/spspd/change/actors/buffs/Disarm.java delete mode 100644 java/com/hmdzl/spspd/change/actors/buffs/Drowsy.java delete mode 100644 java/com/hmdzl/spspd/change/actors/buffs/Dry.java delete mode 100644 java/com/hmdzl/spspd/change/actors/buffs/EarthImbue.java delete mode 100644 java/com/hmdzl/spspd/change/actors/buffs/ExitFind.java delete mode 100644 java/com/hmdzl/spspd/change/actors/buffs/Feed.java delete mode 100644 java/com/hmdzl/spspd/change/actors/buffs/FireImbue.java delete mode 100644 java/com/hmdzl/spspd/change/actors/buffs/FlavourBuff.java delete mode 100644 java/com/hmdzl/spspd/change/actors/buffs/ForeverShadow.java delete mode 100644 java/com/hmdzl/spspd/change/actors/buffs/Frost.java delete mode 100644 java/com/hmdzl/spspd/change/actors/buffs/FrostImbue.java delete mode 100644 java/com/hmdzl/spspd/change/actors/buffs/FullMoonStrength.java delete mode 100644 java/com/hmdzl/spspd/change/actors/buffs/GasesImmunity.java delete mode 100644 java/com/hmdzl/spspd/change/actors/buffs/GlassShield.java delete mode 100644 java/com/hmdzl/spspd/change/actors/buffs/GoldTouch.java delete mode 100644 java/com/hmdzl/spspd/change/actors/buffs/GrowSeed.java delete mode 100644 java/com/hmdzl/spspd/change/actors/buffs/Haste.java delete mode 100644 java/com/hmdzl/spspd/change/actors/buffs/HighAttack.java delete mode 100644 java/com/hmdzl/spspd/change/actors/buffs/HighLight.java delete mode 100644 java/com/hmdzl/spspd/change/actors/buffs/HighVoice.java delete mode 100644 java/com/hmdzl/spspd/change/actors/buffs/Hunger.java delete mode 100644 java/com/hmdzl/spspd/change/actors/buffs/Invisibility.java delete mode 100644 java/com/hmdzl/spspd/change/actors/buffs/Levitation.java delete mode 100644 java/com/hmdzl/spspd/change/actors/buffs/Light.java delete mode 100644 java/com/hmdzl/spspd/change/actors/buffs/Locked.java delete mode 100644 java/com/hmdzl/spspd/change/actors/buffs/LokisPoison.java delete mode 100644 java/com/hmdzl/spspd/change/actors/buffs/MagicImmunity.java delete mode 100644 java/com/hmdzl/spspd/change/actors/buffs/MagicalSleep.java delete mode 100644 java/com/hmdzl/spspd/change/actors/buffs/MechArmor.java delete mode 100644 java/com/hmdzl/spspd/change/actors/buffs/MindVision.java delete mode 100644 java/com/hmdzl/spspd/change/actors/buffs/MirrorShield.java delete mode 100644 java/com/hmdzl/spspd/change/actors/buffs/Muscle.java delete mode 100644 java/com/hmdzl/spspd/change/actors/buffs/Needling.java delete mode 100644 java/com/hmdzl/spspd/change/actors/buffs/NewCombo.java delete mode 100644 java/com/hmdzl/spspd/change/actors/buffs/Notice.java delete mode 100644 java/com/hmdzl/spspd/change/actors/buffs/Paralysis.java delete mode 100644 java/com/hmdzl/spspd/change/actors/buffs/ParyAttack.java delete mode 100644 java/com/hmdzl/spspd/change/actors/buffs/PinCushion.java delete mode 100644 java/com/hmdzl/spspd/change/actors/buffs/Poison.java delete mode 100644 java/com/hmdzl/spspd/change/actors/buffs/Recharging.java delete mode 100644 java/com/hmdzl/spspd/change/actors/buffs/Regeneration.java delete mode 100644 java/com/hmdzl/spspd/change/actors/buffs/Rhythm.java delete mode 100644 java/com/hmdzl/spspd/change/actors/buffs/Rhythm2.java delete mode 100644 java/com/hmdzl/spspd/change/actors/buffs/Roots.java delete mode 100644 java/com/hmdzl/spspd/change/actors/buffs/Shadows.java delete mode 100644 java/com/hmdzl/spspd/change/actors/buffs/Shield.java delete mode 100644 java/com/hmdzl/spspd/change/actors/buffs/ShieldArmor.java delete mode 100644 java/com/hmdzl/spspd/change/actors/buffs/Shieldblock.java delete mode 100644 java/com/hmdzl/spspd/change/actors/buffs/Shocked.java delete mode 100644 java/com/hmdzl/spspd/change/actors/buffs/Silent.java delete mode 100644 java/com/hmdzl/spspd/change/actors/buffs/Sleep.java delete mode 100644 java/com/hmdzl/spspd/change/actors/buffs/Slow.java delete mode 100644 java/com/hmdzl/spspd/change/actors/buffs/SnipersMark.java delete mode 100644 java/com/hmdzl/spspd/change/actors/buffs/SoulBless.java delete mode 100644 java/com/hmdzl/spspd/change/actors/buffs/SoulMark.java delete mode 100644 java/com/hmdzl/spspd/change/actors/buffs/SpAttack.java delete mode 100644 java/com/hmdzl/spspd/change/actors/buffs/Speed.java delete mode 100644 java/com/hmdzl/spspd/change/actors/buffs/Strength.java delete mode 100644 java/com/hmdzl/spspd/change/actors/buffs/Tar.java delete mode 100644 java/com/hmdzl/spspd/change/actors/buffs/TargetShoot.java delete mode 100644 java/com/hmdzl/spspd/change/actors/buffs/Taunt.java delete mode 100644 java/com/hmdzl/spspd/change/actors/buffs/Terror.java delete mode 100644 java/com/hmdzl/spspd/change/actors/buffs/ToxicImbue.java delete mode 100644 java/com/hmdzl/spspd/change/actors/buffs/Venom.java delete mode 100644 java/com/hmdzl/spspd/change/actors/buffs/Vertigo.java delete mode 100644 java/com/hmdzl/spspd/change/actors/buffs/Weakness.java delete mode 100644 java/com/hmdzl/spspd/change/actors/buffs/Wet.java delete mode 100644 java/com/hmdzl/spspd/change/actors/buffs/armorbuff/GlyphDark.java delete mode 100644 java/com/hmdzl/spspd/change/actors/buffs/armorbuff/GlyphEarth.java delete mode 100644 java/com/hmdzl/spspd/change/actors/buffs/armorbuff/GlyphElectricity.java delete mode 100644 java/com/hmdzl/spspd/change/actors/buffs/armorbuff/GlyphFire.java delete mode 100644 java/com/hmdzl/spspd/change/actors/buffs/armorbuff/GlyphIce.java delete mode 100644 java/com/hmdzl/spspd/change/actors/buffs/armorbuff/GlyphLight.java delete mode 100644 java/com/hmdzl/spspd/change/actors/buffs/faithbuff/BalanceFaith.java delete mode 100644 java/com/hmdzl/spspd/change/actors/buffs/faithbuff/DemonFaith.java delete mode 100644 java/com/hmdzl/spspd/change/actors/buffs/faithbuff/HumanFaith.java delete mode 100644 java/com/hmdzl/spspd/change/actors/buffs/faithbuff/MechFaith.java delete mode 100644 java/com/hmdzl/spspd/change/actors/hero/Belongings.java delete mode 100644 java/com/hmdzl/spspd/change/actors/hero/Hero.java delete mode 100644 java/com/hmdzl/spspd/change/actors/hero/HeroAction.java delete mode 100644 java/com/hmdzl/spspd/change/actors/hero/HeroClass.java delete mode 100644 java/com/hmdzl/spspd/change/actors/hero/HeroSubClass.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/Acidic.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/AdultDragonViolet.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/Albino.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/AlbinoPiranha.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/Assassin.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/Bandit.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/BanditKing.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/Bat.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/Bestiary.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/BlueCat.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/BlueWraith.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/BrokenRobot.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/BrownBat.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/Brute.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/Crab.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/CrabKing.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/DM300.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/DemonFlower.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/DemonGoo.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/Dragonking.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/DustElement.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/DwarfLich.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/ElderAvatar.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/Eye.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/FetidRat.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/Fiend.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/FireElemental.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/FireRabbit.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/FishProtector.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/FlyingProtector.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/ForestProtector.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/Gnoll.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/GnollArcher.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/GnollKing.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/GnollShaman.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/GnollTrickster.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/GoldCollector.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/GoldOrc.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/GoldThief.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/Golem.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/Goo.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/GraveProtector.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/GreatCrab.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/GreyRat.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/Guard.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/HermitCrab.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/Hybrid.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/King.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/LevelChecker.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/LichDancer.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/LitTower.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/LiveMoss.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/MagicEye.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/ManySkeleton.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/Mimic.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/MineSentinel.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/Mob.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/Monk.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/MonsterBox.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/MossySkeleton.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/Musketeer.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/NormalCell.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/OrbOfZotMob.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/Orc.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/Otiluke.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/PatrolUAV.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/Piranha.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/PlagueDoctor.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/PrisonWander.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/Rat.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/RatBoss.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/RedWraith.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/SandMob.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/Scorpio.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/Senior.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/Sentinel.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/SewerHeart.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/ShadowYog.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/Shell.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/Shielded.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/Skeleton.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/SkeletonHand1.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/SkeletonHand2.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/SkeletonKing.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/SokobanSentinel.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/SommonSkeleton.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/SpiderBot.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/SpiderQueen.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/Spinner.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/Statue.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/Succubus.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/Sufferer.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/Swarm.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/Tank.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/Tengu.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/TenguDen.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/TestMob.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/TestMob2.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/Thief.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/ThiefImp.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/ThiefKing.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/TrollWarrior.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/UAmulet.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/UDM300.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/UGoo.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/UKing.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/UTengu.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/UYog.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/VaultProtector.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/Virus.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/Warlock.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/Wraith.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/YearBeast.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/YearBeast2.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/Yog.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/Zombie.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/Zot.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/ZotPhase.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/npcs/AFly.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/npcs/ARealMan.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/npcs/Apostle.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/npcs/Bilboldev.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/npcs/Blacksmith.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/npcs/Blacksmith2.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/npcs/Coconut.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/npcs/Coconut2.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/npcs/ConsideredHamster.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/npcs/Dachhack.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/npcs/DreamPlayer.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/npcs/Evan.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/npcs/FruitCat.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/npcs/G2159687.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/npcs/Ghost.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/npcs/GoblinPlayer.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/npcs/HBB.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/npcs/HateSokoban.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/npcs/HeXA.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/npcs/Hmdzl001.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/npcs/HoneyPoooot.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/npcs/Ice13.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/npcs/Imp.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/npcs/ImpShopkeeper.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/npcs/Jinkeloid.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/npcs/Juh9870.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/npcs/Kostis12345.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/npcs/LaJi.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/npcs/Locastan.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/npcs/Lyn.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/npcs/Lynn.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/npcs/MemoryOfSand.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/npcs/Millilitre.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/npcs/MirrorImage.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/npcs/Mtree.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/npcs/NPC.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/npcs/NYRDS.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/npcs/NewPlayer.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/npcs/NutPainter.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/npcs/OldNewStwist.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/npcs/Omicronrg9.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/npcs/OtilukeNPC.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/npcs/RENnpc.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/npcs/RainTrainer.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/npcs/RatKing.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/npcs/RatKingDen.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/npcs/Ravenwolf.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/npcs/Rustyblade.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/npcs/SFB.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/npcs/SP931.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/npcs/SadSaltan.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/npcs/SaidbySun.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/npcs/Sheep.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/npcs/SheepSokoban.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/npcs/SheepSokobanBlack.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/npcs/SheepSokobanCorner.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/npcs/SheepSokobanStop.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/npcs/SheepSokobanSwitch.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/npcs/Shopkeeper.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/npcs/Shower.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/npcs/StormAndRain.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/npcs/Tempest102.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/npcs/ThankList.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/npcs/Tinkerer1.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/npcs/Tinkerer2.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/npcs/Tinkerer3.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/npcs/Tinkerer4.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/npcs/Tinkerer5.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/npcs/TypedScroll.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/npcs/Udawos.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/npcs/UncleS.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/npcs/Wandmaker.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/npcs/Watabou.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/npcs/WhiteGhost.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/npcs/XixiZero.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/pets/BlueDragon.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/pets/BugDragon.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/pets/Bunny.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/pets/CocoCat.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/pets/Fairy.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/pets/Fly.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/pets/GentleCrab.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/pets/GoldDragon.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/pets/GreenDragon.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/pets/LeryFire.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/pets/LightDragon.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/pets/Monkey.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/pets/PET.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/pets/RedDragon.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/pets/RibbonRat.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/pets/Scorpion.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/pets/ShadowDragon.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/pets/Snake.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/pets/Spider.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/pets/Stone.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/pets/SugarplumFairy.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/pets/Velocirooster.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/pets/VioletDragon.java delete mode 100644 java/com/hmdzl/spspd/change/actors/mobs/pets/YearPet.java delete mode 100644 java/com/hmdzl/spspd/change/effects/BadgeBanner.java delete mode 100644 java/com/hmdzl/spspd/change/effects/BannerSprites.java delete mode 100644 java/com/hmdzl/spspd/change/effects/Beam.java delete mode 100644 java/com/hmdzl/spspd/change/effects/BlobEmitter.java delete mode 100644 java/com/hmdzl/spspd/change/effects/CellEmitter.java delete mode 100644 java/com/hmdzl/spspd/change/effects/Chains.java delete mode 100644 java/com/hmdzl/spspd/change/effects/CheckedCell.java delete mode 100644 java/com/hmdzl/spspd/change/effects/CircleArc.java delete mode 100644 java/com/hmdzl/spspd/change/effects/DarkBlock.java delete mode 100644 java/com/hmdzl/spspd/change/effects/DeathRay.java delete mode 100644 java/com/hmdzl/spspd/change/effects/Degradation.java delete mode 100644 java/com/hmdzl/spspd/change/effects/Effects.java delete mode 100644 java/com/hmdzl/spspd/change/effects/EmoIcon.java delete mode 100644 java/com/hmdzl/spspd/change/effects/Fireball.java delete mode 100644 java/com/hmdzl/spspd/change/effects/Flare.java delete mode 100644 java/com/hmdzl/spspd/change/effects/FloatingText.java delete mode 100644 java/com/hmdzl/spspd/change/effects/Halo.java delete mode 100644 java/com/hmdzl/spspd/change/effects/IceBlock.java delete mode 100644 java/com/hmdzl/spspd/change/effects/Identification.java delete mode 100644 java/com/hmdzl/spspd/change/effects/Lightning.java delete mode 100644 java/com/hmdzl/spspd/change/effects/MagicMissile.java delete mode 100644 java/com/hmdzl/spspd/change/effects/Pushing.java delete mode 100644 java/com/hmdzl/spspd/change/effects/Ripple.java delete mode 100644 java/com/hmdzl/spspd/change/effects/ShadowBox.java delete mode 100644 java/com/hmdzl/spspd/change/effects/ShieldHalo.java delete mode 100644 java/com/hmdzl/spspd/change/effects/Speck.java delete mode 100644 java/com/hmdzl/spspd/change/effects/SpellSprite.java delete mode 100644 java/com/hmdzl/spspd/change/effects/Splash.java delete mode 100644 java/com/hmdzl/spspd/change/effects/Surprise.java delete mode 100644 java/com/hmdzl/spspd/change/effects/TorchHalo.java delete mode 100644 java/com/hmdzl/spspd/change/effects/Wound.java delete mode 100644 java/com/hmdzl/spspd/change/effects/particles/BlastParticle.java delete mode 100644 java/com/hmdzl/spspd/change/effects/particles/BloodParticle.java delete mode 100644 java/com/hmdzl/spspd/change/effects/particles/DeadParticle.java delete mode 100644 java/com/hmdzl/spspd/change/effects/particles/EarthParticle.java delete mode 100644 java/com/hmdzl/spspd/change/effects/particles/ElmoParticle.java delete mode 100644 java/com/hmdzl/spspd/change/effects/particles/EnergyParticle.java delete mode 100644 java/com/hmdzl/spspd/change/effects/particles/FlameParticle.java delete mode 100644 java/com/hmdzl/spspd/change/effects/particles/FlowParticle.java delete mode 100644 java/com/hmdzl/spspd/change/effects/particles/LeafParticle.java delete mode 100644 java/com/hmdzl/spspd/change/effects/particles/MemoryParticle.java delete mode 100644 java/com/hmdzl/spspd/change/effects/particles/PoisonParticle.java delete mode 100644 java/com/hmdzl/spspd/change/effects/particles/PurpleParticle.java delete mode 100644 java/com/hmdzl/spspd/change/effects/particles/RainParticle.java delete mode 100644 java/com/hmdzl/spspd/change/effects/particles/RainbowParticle.java delete mode 100644 java/com/hmdzl/spspd/change/effects/particles/SandParticle.java delete mode 100644 java/com/hmdzl/spspd/change/effects/particles/ShadowParticle.java delete mode 100644 java/com/hmdzl/spspd/change/effects/particles/ShaftParticle.java delete mode 100644 java/com/hmdzl/spspd/change/effects/particles/ShockWebParticle.java delete mode 100644 java/com/hmdzl/spspd/change/effects/particles/SmokeParticle.java delete mode 100644 java/com/hmdzl/spspd/change/effects/particles/SnowParticle.java delete mode 100644 java/com/hmdzl/spspd/change/effects/particles/SparkParticle.java delete mode 100644 java/com/hmdzl/spspd/change/effects/particles/WebParticle.java delete mode 100644 java/com/hmdzl/spspd/change/effects/particles/WindParticle.java delete mode 100644 java/com/hmdzl/spspd/change/effects/particles/WoolParticle.java delete mode 100644 java/com/hmdzl/spspd/change/items/AdamantArmor.java delete mode 100644 java/com/hmdzl/spspd/change/items/AdamantRing.java delete mode 100644 java/com/hmdzl/spspd/change/items/AdamantWand.java delete mode 100644 java/com/hmdzl/spspd/change/items/AdamantWeapon.java delete mode 100644 java/com/hmdzl/spspd/change/items/Amulet.java delete mode 100644 java/com/hmdzl/spspd/change/items/AncientCoin.java delete mode 100644 java/com/hmdzl/spspd/change/items/Ankh.java delete mode 100644 java/com/hmdzl/spspd/change/items/ArmorKit.java delete mode 100644 java/com/hmdzl/spspd/change/items/Bone.java delete mode 100644 java/com/hmdzl/spspd/change/items/BossRush.java delete mode 100644 java/com/hmdzl/spspd/change/items/ChallengeBook.java delete mode 100644 java/com/hmdzl/spspd/change/items/ConchShell.java delete mode 100644 java/com/hmdzl/spspd/change/items/DewVial.java delete mode 100644 java/com/hmdzl/spspd/change/items/Dewdrop.java delete mode 100644 java/com/hmdzl/spspd/change/items/DolyaSlate.java delete mode 100644 java/com/hmdzl/spspd/change/items/DwarfHammer.java delete mode 100644 java/com/hmdzl/spspd/change/items/Elevator.java delete mode 100644 java/com/hmdzl/spspd/change/items/EquipableItem.java delete mode 100644 java/com/hmdzl/spspd/change/items/ExpOre.java delete mode 100644 java/com/hmdzl/spspd/change/items/Flag.java delete mode 100644 java/com/hmdzl/spspd/change/items/Generator.java delete mode 100644 java/com/hmdzl/spspd/change/items/Gold.java delete mode 100644 java/com/hmdzl/spspd/change/items/GreaterStylus.java delete mode 100644 java/com/hmdzl/spspd/change/items/Heap.java delete mode 100644 java/com/hmdzl/spspd/change/items/Item.java delete mode 100644 java/com/hmdzl/spspd/change/items/ItemStatusHandler.java delete mode 100644 java/com/hmdzl/spspd/change/items/KindOfArmor.java delete mode 100644 java/com/hmdzl/spspd/change/items/KindOfWeapon.java delete mode 100644 java/com/hmdzl/spspd/change/items/KindofMisc.java delete mode 100644 java/com/hmdzl/spspd/change/items/LloydsBeacon.java delete mode 100644 java/com/hmdzl/spspd/change/items/OrbOfZot.java delete mode 100644 java/com/hmdzl/spspd/change/items/Palantir.java delete mode 100644 java/com/hmdzl/spspd/change/items/Playericon.java delete mode 100644 java/com/hmdzl/spspd/change/items/PocketBallFull.java delete mode 100644 java/com/hmdzl/spspd/change/items/PowerHand.java delete mode 100644 java/com/hmdzl/spspd/change/items/PuddingCup.java delete mode 100644 java/com/hmdzl/spspd/change/items/RedDewdrop.java delete mode 100644 java/com/hmdzl/spspd/change/items/ReturnBeacon.java delete mode 100644 java/com/hmdzl/spspd/change/items/SaveYourLife.java delete mode 100644 java/com/hmdzl/spspd/change/items/ShoesKit.java delete mode 100644 java/com/hmdzl/spspd/change/items/SoulCollect.java delete mode 100644 java/com/hmdzl/spspd/change/items/StoneOre.java delete mode 100644 java/com/hmdzl/spspd/change/items/Stylus.java delete mode 100644 java/com/hmdzl/spspd/change/items/TenguKey.java delete mode 100644 java/com/hmdzl/spspd/change/items/TomeOfMastery.java delete mode 100644 java/com/hmdzl/spspd/change/items/Torch.java delete mode 100644 java/com/hmdzl/spspd/change/items/Towel.java delete mode 100644 java/com/hmdzl/spspd/change/items/TownReturnBeacon.java delete mode 100644 java/com/hmdzl/spspd/change/items/TransmutationBall.java delete mode 100644 java/com/hmdzl/spspd/change/items/TreasureMap.java delete mode 100644 java/com/hmdzl/spspd/change/items/TriForce.java delete mode 100644 java/com/hmdzl/spspd/change/items/TriforceOfCourage.java delete mode 100644 java/com/hmdzl/spspd/change/items/TriforceOfPower.java delete mode 100644 java/com/hmdzl/spspd/change/items/TriforceOfWisdom.java delete mode 100644 java/com/hmdzl/spspd/change/items/UpgradeBlobRed.java delete mode 100644 java/com/hmdzl/spspd/change/items/UpgradeBlobViolet.java delete mode 100644 java/com/hmdzl/spspd/change/items/UpgradeBlobYellow.java delete mode 100644 java/com/hmdzl/spspd/change/items/UpgradeEatBall.java delete mode 100644 java/com/hmdzl/spspd/change/items/VioletDewdrop.java delete mode 100644 java/com/hmdzl/spspd/change/items/WaterItem2.java delete mode 100644 java/com/hmdzl/spspd/change/items/Weightstone.java delete mode 100644 java/com/hmdzl/spspd/change/items/Whistle.java delete mode 100644 java/com/hmdzl/spspd/change/items/YellowDewdrop.java delete mode 100644 java/com/hmdzl/spspd/change/items/armor/Armor.java delete mode 100644 java/com/hmdzl/spspd/change/items/armor/glyphs/AdaptGlyph.java delete mode 100644 java/com/hmdzl/spspd/change/items/armor/glyphs/Changeglyph.java delete mode 100644 java/com/hmdzl/spspd/change/items/armor/glyphs/Crystalglyph.java delete mode 100644 java/com/hmdzl/spspd/change/items/armor/glyphs/Darkglyph.java delete mode 100644 java/com/hmdzl/spspd/change/items/armor/glyphs/Earthglyph.java delete mode 100644 java/com/hmdzl/spspd/change/items/armor/glyphs/Electricityglyph.java delete mode 100644 java/com/hmdzl/spspd/change/items/armor/glyphs/Fireglyph.java delete mode 100644 java/com/hmdzl/spspd/change/items/armor/glyphs/Iceglyph.java delete mode 100644 java/com/hmdzl/spspd/change/items/armor/glyphs/Lightglyph.java delete mode 100644 java/com/hmdzl/spspd/change/items/armor/glyphs/RecoilGlyph.java delete mode 100644 java/com/hmdzl/spspd/change/items/armor/glyphs/Revivalglyph.java delete mode 100644 java/com/hmdzl/spspd/change/items/armor/glyphs/Testglyph.java delete mode 100644 java/com/hmdzl/spspd/change/items/armor/normalarmor/BaseArmor.java delete mode 100644 java/com/hmdzl/spspd/change/items/armor/normalarmor/BulletArmor.java delete mode 100644 java/com/hmdzl/spspd/change/items/armor/normalarmor/CDArmor.java delete mode 100644 java/com/hmdzl/spspd/change/items/armor/normalarmor/CeramicsArmor.java delete mode 100644 java/com/hmdzl/spspd/change/items/armor/normalarmor/ClothArmor.java delete mode 100644 java/com/hmdzl/spspd/change/items/armor/normalarmor/DiscArmor.java delete mode 100644 java/com/hmdzl/spspd/change/items/armor/normalarmor/ErrorArmor.java delete mode 100644 java/com/hmdzl/spspd/change/items/armor/normalarmor/LeatherArmor.java delete mode 100644 java/com/hmdzl/spspd/change/items/armor/normalarmor/MachineArmor.java delete mode 100644 java/com/hmdzl/spspd/change/items/armor/normalarmor/MailArmor.java delete mode 100644 java/com/hmdzl/spspd/change/items/armor/normalarmor/MultiplelayerArmor.java delete mode 100644 java/com/hmdzl/spspd/change/items/armor/normalarmor/NormalArmor.java delete mode 100644 java/com/hmdzl/spspd/change/items/armor/normalarmor/PhantomArmor.java delete mode 100644 java/com/hmdzl/spspd/change/items/armor/normalarmor/PlateArmor.java delete mode 100644 java/com/hmdzl/spspd/change/items/armor/normalarmor/ProtectiveclothingArmor.java delete mode 100644 java/com/hmdzl/spspd/change/items/armor/normalarmor/RubberArmor.java delete mode 100644 java/com/hmdzl/spspd/change/items/armor/normalarmor/ScaleArmor.java delete mode 100644 java/com/hmdzl/spspd/change/items/armor/normalarmor/StoneArmor.java delete mode 100644 java/com/hmdzl/spspd/change/items/armor/normalarmor/StyrofoamArmor.java delete mode 100644 java/com/hmdzl/spspd/change/items/armor/normalarmor/VestArmor.java delete mode 100644 java/com/hmdzl/spspd/change/items/armor/normalarmor/WoodenArmor.java delete mode 100644 java/com/hmdzl/spspd/change/items/artifacts/AlchemistsToolkit.java delete mode 100644 java/com/hmdzl/spspd/change/items/artifacts/AlienBag.java delete mode 100644 java/com/hmdzl/spspd/change/items/artifacts/Artifact.java delete mode 100644 java/com/hmdzl/spspd/change/items/artifacts/CapeOfThorns.java delete mode 100644 java/com/hmdzl/spspd/change/items/artifacts/ChaliceOfBlood.java delete mode 100644 java/com/hmdzl/spspd/change/items/artifacts/CloakOfShadows.java delete mode 100644 java/com/hmdzl/spspd/change/items/artifacts/DriedRose.java delete mode 100644 java/com/hmdzl/spspd/change/items/artifacts/EtherealChains.java delete mode 100644 java/com/hmdzl/spspd/change/items/artifacts/EyeOfSkadi.java delete mode 100644 java/com/hmdzl/spspd/change/items/artifacts/GlassTotem.java delete mode 100644 java/com/hmdzl/spspd/change/items/artifacts/HornOfPlenty.java delete mode 100644 java/com/hmdzl/spspd/change/items/artifacts/MasterThievesArmband.java delete mode 100644 java/com/hmdzl/spspd/change/items/artifacts/Pylon.java delete mode 100644 java/com/hmdzl/spspd/change/items/artifacts/RobotDMT.java delete mode 100644 java/com/hmdzl/spspd/change/items/artifacts/SandalsOfNature.java delete mode 100644 java/com/hmdzl/spspd/change/items/artifacts/TalismanOfForesight.java delete mode 100644 java/com/hmdzl/spspd/change/items/artifacts/TimekeepersHourglass.java delete mode 100644 java/com/hmdzl/spspd/change/items/artifacts/UnstableSpellbook.java delete mode 100644 java/com/hmdzl/spspd/change/items/bags/Bag.java delete mode 100644 java/com/hmdzl/spspd/change/items/bags/HeartOfScarecrow.java delete mode 100644 java/com/hmdzl/spspd/change/items/bags/KeyRing.java delete mode 100644 java/com/hmdzl/spspd/change/items/bags/PotionBandolier.java delete mode 100644 java/com/hmdzl/spspd/change/items/bags/ScrollHolder.java delete mode 100644 java/com/hmdzl/spspd/change/items/bags/SeedPouch.java delete mode 100644 java/com/hmdzl/spspd/change/items/bags/ShoppingCart.java delete mode 100644 java/com/hmdzl/spspd/change/items/bags/WandHolster.java delete mode 100644 java/com/hmdzl/spspd/change/items/bombs/Bomb.java delete mode 100644 java/com/hmdzl/spspd/change/items/bombs/BuildBomb.java delete mode 100644 java/com/hmdzl/spspd/change/items/bombs/DangerousBomb.java delete mode 100644 java/com/hmdzl/spspd/change/items/bombs/DarkBomb.java delete mode 100644 java/com/hmdzl/spspd/change/items/bombs/DungeonBomb.java delete mode 100644 java/com/hmdzl/spspd/change/items/bombs/EarthBomb.java delete mode 100644 java/com/hmdzl/spspd/change/items/bombs/FireBomb.java delete mode 100644 java/com/hmdzl/spspd/change/items/bombs/FishingBomb.java delete mode 100644 java/com/hmdzl/spspd/change/items/bombs/HugeBomb.java delete mode 100644 java/com/hmdzl/spspd/change/items/bombs/IceBomb.java delete mode 100644 java/com/hmdzl/spspd/change/items/bombs/LightBomb.java delete mode 100644 java/com/hmdzl/spspd/change/items/bombs/MiniBomb.java delete mode 100644 java/com/hmdzl/spspd/change/items/bombs/StormBomb.java delete mode 100644 java/com/hmdzl/spspd/change/items/challengelists/CaveChallenge.java delete mode 100644 java/com/hmdzl/spspd/change/items/challengelists/ChallengeList.java delete mode 100644 java/com/hmdzl/spspd/change/items/challengelists/CityChallenge.java delete mode 100644 java/com/hmdzl/spspd/change/items/challengelists/CourageChallenge.java delete mode 100644 java/com/hmdzl/spspd/change/items/challengelists/PowerChallenge.java delete mode 100644 java/com/hmdzl/spspd/change/items/challengelists/PrisonChallenge.java delete mode 100644 java/com/hmdzl/spspd/change/items/challengelists/SewerChallenge.java delete mode 100644 java/com/hmdzl/spspd/change/items/challengelists/WisdomChallenge.java delete mode 100644 java/com/hmdzl/spspd/change/items/eggs/BlueDragonEgg.java delete mode 100644 java/com/hmdzl/spspd/change/items/eggs/CocoCatEgg.java delete mode 100644 java/com/hmdzl/spspd/change/items/eggs/EasterEgg.java delete mode 100644 java/com/hmdzl/spspd/change/items/eggs/Egg.java delete mode 100644 java/com/hmdzl/spspd/change/items/eggs/GoldDragonEgg.java delete mode 100644 java/com/hmdzl/spspd/change/items/eggs/GreenDragonEgg.java delete mode 100644 java/com/hmdzl/spspd/change/items/eggs/LeryFireEgg.java delete mode 100644 java/com/hmdzl/spspd/change/items/eggs/LightDragonEgg.java delete mode 100644 java/com/hmdzl/spspd/change/items/eggs/RandomEgg.java delete mode 100644 java/com/hmdzl/spspd/change/items/eggs/RedDragonEgg.java delete mode 100644 java/com/hmdzl/spspd/change/items/eggs/ScorpionEgg.java delete mode 100644 java/com/hmdzl/spspd/change/items/eggs/ShadowDragonEgg.java delete mode 100644 java/com/hmdzl/spspd/change/items/eggs/SpiderEgg.java delete mode 100644 java/com/hmdzl/spspd/change/items/eggs/VelociroosterEgg.java delete mode 100644 java/com/hmdzl/spspd/change/items/eggs/VioletDragonEgg.java delete mode 100644 java/com/hmdzl/spspd/change/items/eggs/YearPetEgg.java delete mode 100644 java/com/hmdzl/spspd/change/items/food/Food.java delete mode 100644 java/com/hmdzl/spspd/change/items/food/Honey.java delete mode 100644 java/com/hmdzl/spspd/change/items/food/Nut.java delete mode 100644 java/com/hmdzl/spspd/change/items/food/ToastedNut.java delete mode 100644 java/com/hmdzl/spspd/change/items/food/Vegetable.java delete mode 100644 java/com/hmdzl/spspd/change/items/food/WaterItem.java delete mode 100644 java/com/hmdzl/spspd/change/items/food/completefood/AflyFood.java delete mode 100644 java/com/hmdzl/spspd/change/items/food/completefood/Chickennugget.java delete mode 100644 java/com/hmdzl/spspd/change/items/food/completefood/CompleteFood.java delete mode 100644 java/com/hmdzl/spspd/change/items/food/completefood/Crystalnucleus.java delete mode 100644 java/com/hmdzl/spspd/change/items/food/completefood/Foamedbeverage.java delete mode 100644 java/com/hmdzl/spspd/change/items/food/completefood/FoodFans.java delete mode 100644 java/com/hmdzl/spspd/change/items/food/completefood/Frenchfries.java delete mode 100644 java/com/hmdzl/spspd/change/items/food/completefood/Fruitsalad.java delete mode 100644 java/com/hmdzl/spspd/change/items/food/completefood/Garbage.java delete mode 100644 java/com/hmdzl/spspd/change/items/food/completefood/Gel.java delete mode 100644 java/com/hmdzl/spspd/change/items/food/completefood/GoldenNut.java delete mode 100644 java/com/hmdzl/spspd/change/items/food/completefood/Hamburger.java delete mode 100644 java/com/hmdzl/spspd/change/items/food/completefood/Herbmeat.java delete mode 100644 java/com/hmdzl/spspd/change/items/food/completefood/Honey.java delete mode 100644 java/com/hmdzl/spspd/change/items/food/completefood/HoneyGel.java delete mode 100644 java/com/hmdzl/spspd/change/items/food/completefood/HoneyWater.java delete mode 100644 java/com/hmdzl/spspd/change/items/food/completefood/Honeymeat.java delete mode 100644 java/com/hmdzl/spspd/change/items/food/completefood/Honeyrice.java delete mode 100644 java/com/hmdzl/spspd/change/items/food/completefood/Icecream.java delete mode 100644 java/com/hmdzl/spspd/change/items/food/completefood/Kebab.java delete mode 100644 java/com/hmdzl/spspd/change/items/food/completefood/Meatroll.java delete mode 100644 java/com/hmdzl/spspd/change/items/food/completefood/PerfectFood.java delete mode 100644 java/com/hmdzl/spspd/change/items/food/completefood/PetFood.java delete mode 100644 java/com/hmdzl/spspd/change/items/food/completefood/Porksoup.java delete mode 100644 java/com/hmdzl/spspd/change/items/food/completefood/Ricefood.java delete mode 100644 java/com/hmdzl/spspd/change/items/food/completefood/Vegetablekebab.java delete mode 100644 java/com/hmdzl/spspd/change/items/food/completefood/Vegetableroll.java delete mode 100644 java/com/hmdzl/spspd/change/items/food/completefood/Vegetablesoup.java delete mode 100644 java/com/hmdzl/spspd/change/items/food/fruit/Blackberry.java delete mode 100644 java/com/hmdzl/spspd/change/items/food/fruit/Blandfruit.java delete mode 100644 java/com/hmdzl/spspd/change/items/food/fruit/Blueberry.java delete mode 100644 java/com/hmdzl/spspd/change/items/food/fruit/Cloudberry.java delete mode 100644 java/com/hmdzl/spspd/change/items/food/fruit/Fruit.java delete mode 100644 java/com/hmdzl/spspd/change/items/food/fruit/FullMoonberry.java delete mode 100644 java/com/hmdzl/spspd/change/items/food/fruit/Moonberry.java delete mode 100644 java/com/hmdzl/spspd/change/items/food/meatfood/ChargrilledMeat.java delete mode 100644 java/com/hmdzl/spspd/change/items/food/meatfood/FrozenCarpaccio.java delete mode 100644 java/com/hmdzl/spspd/change/items/food/meatfood/Meat.java delete mode 100644 java/com/hmdzl/spspd/change/items/food/meatfood/MeatFood.java delete mode 100644 java/com/hmdzl/spspd/change/items/food/meatfood/MysteryMeat.java delete mode 100644 java/com/hmdzl/spspd/change/items/food/staplefood/NormalRation.java delete mode 100644 java/com/hmdzl/spspd/change/items/food/staplefood/OverpricedRation.java delete mode 100644 java/com/hmdzl/spspd/change/items/food/staplefood/Pasty.java delete mode 100644 java/com/hmdzl/spspd/change/items/food/staplefood/StapleFood.java delete mode 100644 java/com/hmdzl/spspd/change/items/food/vegetable/BattleFlower.java delete mode 100644 java/com/hmdzl/spspd/change/items/food/vegetable/DreamLeaf.java delete mode 100644 java/com/hmdzl/spspd/change/items/food/vegetable/HealGrass.java delete mode 100644 java/com/hmdzl/spspd/change/items/food/vegetable/NutVegetable.java delete mode 100644 java/com/hmdzl/spspd/change/items/food/vegetable/Vegetable.java delete mode 100644 java/com/hmdzl/spspd/change/items/journalpages/EnergyCore.java delete mode 100644 java/com/hmdzl/spspd/change/items/journalpages/JournalPage.java delete mode 100644 java/com/hmdzl/spspd/change/items/journalpages/SafeSpotPage.java delete mode 100644 java/com/hmdzl/spspd/change/items/journalpages/Sokoban1.java delete mode 100644 java/com/hmdzl/spspd/change/items/journalpages/Sokoban2.java delete mode 100644 java/com/hmdzl/spspd/change/items/journalpages/Sokoban3.java delete mode 100644 java/com/hmdzl/spspd/change/items/journalpages/Sokoban4.java delete mode 100644 java/com/hmdzl/spspd/change/items/journalpages/Town.java delete mode 100644 java/com/hmdzl/spspd/change/items/journalpages/Vault.java delete mode 100644 java/com/hmdzl/spspd/change/items/keys/GoldenKey.java delete mode 100644 java/com/hmdzl/spspd/change/items/keys/GoldenSkeletonKey.java delete mode 100644 java/com/hmdzl/spspd/change/items/keys/IronKey.java delete mode 100644 java/com/hmdzl/spspd/change/items/keys/Key.java delete mode 100644 java/com/hmdzl/spspd/change/items/keys/SkeletonKey.java delete mode 100644 java/com/hmdzl/spspd/change/items/medicine/BlueMilk.java delete mode 100644 java/com/hmdzl/spspd/change/items/medicine/DeathCap.java delete mode 100644 java/com/hmdzl/spspd/change/items/medicine/Earthstar.java delete mode 100644 java/com/hmdzl/spspd/change/items/medicine/GoldenJelly.java delete mode 100644 java/com/hmdzl/spspd/change/items/medicine/GreenSpore.java delete mode 100644 java/com/hmdzl/spspd/change/items/medicine/Hardpill.java delete mode 100644 java/com/hmdzl/spspd/change/items/medicine/JackOLantern.java delete mode 100644 java/com/hmdzl/spspd/change/items/medicine/Magicpill.java delete mode 100644 java/com/hmdzl/spspd/change/items/medicine/Musicpill.java delete mode 100644 java/com/hmdzl/spspd/change/items/medicine/Pill.java delete mode 100644 java/com/hmdzl/spspd/change/items/medicine/PixieParasol.java delete mode 100644 java/com/hmdzl/spspd/change/items/medicine/Powerpill.java delete mode 100644 java/com/hmdzl/spspd/change/items/medicine/Shootpill.java delete mode 100644 java/com/hmdzl/spspd/change/items/misc/Ankhshield.java delete mode 100644 java/com/hmdzl/spspd/change/items/misc/AttackShield.java delete mode 100644 java/com/hmdzl/spspd/change/items/misc/AttackShoes.java delete mode 100644 java/com/hmdzl/spspd/change/items/misc/AutoPotion.java delete mode 100644 java/com/hmdzl/spspd/change/items/misc/BShovel.java delete mode 100644 java/com/hmdzl/spspd/change/items/misc/CopyBall.java delete mode 100644 java/com/hmdzl/spspd/change/items/misc/DanceLion.java delete mode 100644 java/com/hmdzl/spspd/change/items/misc/DemoScroll.java delete mode 100644 java/com/hmdzl/spspd/change/items/misc/FaithSign.java delete mode 100644 java/com/hmdzl/spspd/change/items/misc/FourClover.java delete mode 100644 java/com/hmdzl/spspd/change/items/misc/GnollMark.java delete mode 100644 java/com/hmdzl/spspd/change/items/misc/GunOfSoldier.java delete mode 100644 java/com/hmdzl/spspd/change/items/misc/HealBag.java delete mode 100644 java/com/hmdzl/spspd/change/items/misc/HorseTotem.java delete mode 100644 java/com/hmdzl/spspd/change/items/misc/JumpF.java delete mode 100644 java/com/hmdzl/spspd/change/items/misc/JumpH.java delete mode 100644 java/com/hmdzl/spspd/change/items/misc/JumpM.java delete mode 100644 java/com/hmdzl/spspd/change/items/misc/JumpP.java delete mode 100644 java/com/hmdzl/spspd/change/items/misc/JumpR.java delete mode 100644 java/com/hmdzl/spspd/change/items/misc/JumpS.java delete mode 100644 java/com/hmdzl/spspd/change/items/misc/JumpW.java delete mode 100644 java/com/hmdzl/spspd/change/items/misc/Jumpshoes.java delete mode 100644 java/com/hmdzl/spspd/change/items/misc/LuckyBadge.java delete mode 100644 java/com/hmdzl/spspd/change/items/misc/MKbox.java delete mode 100644 java/com/hmdzl/spspd/change/items/misc/MechPocket.java delete mode 100644 java/com/hmdzl/spspd/change/items/misc/MiscEquippable.java delete mode 100644 java/com/hmdzl/spspd/change/items/misc/MissileShield.java delete mode 100644 java/com/hmdzl/spspd/change/items/misc/PotionOfMage.java delete mode 100644 java/com/hmdzl/spspd/change/items/misc/RangeBag.java delete mode 100644 java/com/hmdzl/spspd/change/items/misc/SavageHelmet.java delete mode 100644 java/com/hmdzl/spspd/change/items/misc/Shovel.java delete mode 100644 java/com/hmdzl/spspd/change/items/misc/SkillOfAtk.java delete mode 100644 java/com/hmdzl/spspd/change/items/misc/SkillOfDef.java delete mode 100644 java/com/hmdzl/spspd/change/items/misc/SkillOfMig.java delete mode 100644 java/com/hmdzl/spspd/change/items/misc/Spectacles.java delete mode 100644 java/com/hmdzl/spspd/change/items/misc/UndeadBook.java delete mode 100644 java/com/hmdzl/spspd/change/items/nornstone/BlueNornStone.java delete mode 100644 java/com/hmdzl/spspd/change/items/nornstone/GreenNornStone.java delete mode 100644 java/com/hmdzl/spspd/change/items/nornstone/NornStone.java delete mode 100644 java/com/hmdzl/spspd/change/items/nornstone/OrangeNornStone.java delete mode 100644 java/com/hmdzl/spspd/change/items/nornstone/PurpleNornStone.java delete mode 100644 java/com/hmdzl/spspd/change/items/nornstone/YellowNornStone.java delete mode 100644 java/com/hmdzl/spspd/change/items/potions/Potion.java delete mode 100644 java/com/hmdzl/spspd/change/items/potions/PotionOfExperience.java delete mode 100644 java/com/hmdzl/spspd/change/items/potions/PotionOfFrost.java delete mode 100644 java/com/hmdzl/spspd/change/items/potions/PotionOfHaste.java delete mode 100644 java/com/hmdzl/spspd/change/items/potions/PotionOfHealing.java delete mode 100644 java/com/hmdzl/spspd/change/items/potions/PotionOfInvisibility.java delete mode 100644 java/com/hmdzl/spspd/change/items/potions/PotionOfLevitation.java delete mode 100644 java/com/hmdzl/spspd/change/items/potions/PotionOfLiquidFlame.java delete mode 100644 java/com/hmdzl/spspd/change/items/potions/PotionOfMending.java delete mode 100644 java/com/hmdzl/spspd/change/items/potions/PotionOfMight.java delete mode 100644 java/com/hmdzl/spspd/change/items/potions/PotionOfMindVision.java delete mode 100644 java/com/hmdzl/spspd/change/items/potions/PotionOfOverHealing.java delete mode 100644 java/com/hmdzl/spspd/change/items/potions/PotionOfParalyticGas.java delete mode 100644 java/com/hmdzl/spspd/change/items/potions/PotionOfPurity.java delete mode 100644 java/com/hmdzl/spspd/change/items/potions/PotionOfStrength.java delete mode 100644 java/com/hmdzl/spspd/change/items/potions/PotionOfToxicGas.java delete mode 100644 java/com/hmdzl/spspd/change/items/quest/CorpseDust.java delete mode 100644 java/com/hmdzl/spspd/change/items/quest/DarkGold.java delete mode 100644 java/com/hmdzl/spspd/change/items/quest/DwarfToken.java delete mode 100644 java/com/hmdzl/spspd/change/items/quest/GnollClothes.java delete mode 100644 java/com/hmdzl/spspd/change/items/quest/Mushroom.java delete mode 100644 java/com/hmdzl/spspd/change/items/quest/Pickaxe.java delete mode 100644 java/com/hmdzl/spspd/change/items/quest/RatSkull.java delete mode 100644 java/com/hmdzl/spspd/change/items/reward/CaveReward.java delete mode 100644 java/com/hmdzl/spspd/change/items/reward/CityReward.java delete mode 100644 java/com/hmdzl/spspd/change/items/reward/PrisonReward.java delete mode 100644 java/com/hmdzl/spspd/change/items/reward/SewerReward.java delete mode 100644 java/com/hmdzl/spspd/change/items/rings/Ring.java delete mode 100644 java/com/hmdzl/spspd/change/items/rings/RingOfAccuracy.java delete mode 100644 java/com/hmdzl/spspd/change/items/rings/RingOfElements.java delete mode 100644 java/com/hmdzl/spspd/change/items/rings/RingOfEnergy.java delete mode 100644 java/com/hmdzl/spspd/change/items/rings/RingOfEvasion.java delete mode 100644 java/com/hmdzl/spspd/change/items/rings/RingOfForce.java delete mode 100644 java/com/hmdzl/spspd/change/items/rings/RingOfFuror.java delete mode 100644 java/com/hmdzl/spspd/change/items/rings/RingOfHaste.java delete mode 100644 java/com/hmdzl/spspd/change/items/rings/RingOfMagic.java delete mode 100644 java/com/hmdzl/spspd/change/items/rings/RingOfMight.java delete mode 100644 java/com/hmdzl/spspd/change/items/rings/RingOfSharpshooting.java delete mode 100644 java/com/hmdzl/spspd/change/items/rings/RingOfTenacity.java delete mode 100644 java/com/hmdzl/spspd/change/items/scrolls/InventoryScroll.java delete mode 100644 java/com/hmdzl/spspd/change/items/scrolls/Scroll.java delete mode 100644 java/com/hmdzl/spspd/change/items/scrolls/ScrollOfIdentify.java delete mode 100644 java/com/hmdzl/spspd/change/items/scrolls/ScrollOfLullaby.java delete mode 100644 java/com/hmdzl/spspd/change/items/scrolls/ScrollOfMagicMapping.java delete mode 100644 java/com/hmdzl/spspd/change/items/scrolls/ScrollOfMagicalInfusion.java delete mode 100644 java/com/hmdzl/spspd/change/items/scrolls/ScrollOfMirrorImage.java delete mode 100644 java/com/hmdzl/spspd/change/items/scrolls/ScrollOfMultiUpgrade.java delete mode 100644 java/com/hmdzl/spspd/change/items/scrolls/ScrollOfPsionicBlast.java delete mode 100644 java/com/hmdzl/spspd/change/items/scrolls/ScrollOfRage.java delete mode 100644 java/com/hmdzl/spspd/change/items/scrolls/ScrollOfRecharging.java delete mode 100644 java/com/hmdzl/spspd/change/items/scrolls/ScrollOfRegrowth.java delete mode 100644 java/com/hmdzl/spspd/change/items/scrolls/ScrollOfRemoveCurse.java delete mode 100644 java/com/hmdzl/spspd/change/items/scrolls/ScrollOfSacrifice.java delete mode 100644 java/com/hmdzl/spspd/change/items/scrolls/ScrollOfTeleportation.java delete mode 100644 java/com/hmdzl/spspd/change/items/scrolls/ScrollOfTerror.java delete mode 100644 java/com/hmdzl/spspd/change/items/scrolls/ScrollOfUpgrade.java delete mode 100644 java/com/hmdzl/spspd/change/items/skills/ClassSkill.java delete mode 100644 java/com/hmdzl/spspd/change/items/skills/FollowerSkill.java delete mode 100644 java/com/hmdzl/spspd/change/items/skills/HuntressSkill.java delete mode 100644 java/com/hmdzl/spspd/change/items/skills/MageSkill.java delete mode 100644 java/com/hmdzl/spspd/change/items/skills/PerformerSkill.java delete mode 100644 java/com/hmdzl/spspd/change/items/skills/RogueSkill.java delete mode 100644 java/com/hmdzl/spspd/change/items/skills/SoldierSkill.java delete mode 100644 java/com/hmdzl/spspd/change/items/skills/WarriorSkill.java delete mode 100644 java/com/hmdzl/spspd/change/items/summon/ActiveMrDestructo.java delete mode 100644 java/com/hmdzl/spspd/change/items/summon/CallCoconut.java delete mode 100644 java/com/hmdzl/spspd/change/items/summon/FairyCard.java delete mode 100644 java/com/hmdzl/spspd/change/items/summon/Honeypot.java delete mode 100644 java/com/hmdzl/spspd/change/items/summon/Mobile.java delete mode 100644 java/com/hmdzl/spspd/change/items/wands/CannonOfMage.java delete mode 100644 java/com/hmdzl/spspd/change/items/wands/DamageWand.java delete mode 100644 java/com/hmdzl/spspd/change/items/wands/Wand.java delete mode 100644 java/com/hmdzl/spspd/change/items/wands/WandOfAcid.java delete mode 100644 java/com/hmdzl/spspd/change/items/wands/WandOfBlood.java delete mode 100644 java/com/hmdzl/spspd/change/items/wands/WandOfCharm.java delete mode 100644 java/com/hmdzl/spspd/change/items/wands/WandOfDisintegration.java delete mode 100644 java/com/hmdzl/spspd/change/items/wands/WandOfError.java delete mode 100644 java/com/hmdzl/spspd/change/items/wands/WandOfFirebolt.java delete mode 100644 java/com/hmdzl/spspd/change/items/wands/WandOfFlock.java delete mode 100644 java/com/hmdzl/spspd/change/items/wands/WandOfFlow.java delete mode 100644 java/com/hmdzl/spspd/change/items/wands/WandOfFreeze.java delete mode 100644 java/com/hmdzl/spspd/change/items/wands/WandOfLight.java delete mode 100644 java/com/hmdzl/spspd/change/items/wands/WandOfLightning.java delete mode 100644 java/com/hmdzl/spspd/change/items/wands/WandOfMagicMissile.java delete mode 100644 java/com/hmdzl/spspd/change/items/wands/WandOfMeteorite.java delete mode 100644 java/com/hmdzl/spspd/change/items/wands/WandOfPoison.java delete mode 100644 java/com/hmdzl/spspd/change/items/wands/WandOfTCloud.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/Weapon.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/enchantments/AresLeech.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/enchantments/BuzzSaw.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/enchantments/CromLuck.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/enchantments/EnchantmentDark.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/enchantments/EnchantmentDark2.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/enchantments/EnchantmentEarth.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/enchantments/EnchantmentEarth2.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/enchantments/EnchantmentEnergy.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/enchantments/EnchantmentEnergy2.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/enchantments/EnchantmentFire.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/enchantments/EnchantmentFire2.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/enchantments/EnchantmentIce.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/enchantments/EnchantmentIce2.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/enchantments/EnchantmentLight.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/enchantments/EnchantmentLight2.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/enchantments/EnchantmentShock.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/enchantments/EnchantmentShock2.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/enchantments/JupitersHorror.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/enchantments/LokisPoison.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/enchantments/NeptuneShock.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/guns/GunA.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/guns/GunB.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/guns/GunC.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/guns/GunD.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/guns/GunE.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/guns/GunWeapon.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/guns/Sling.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/guns/ToyGun.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/melee/AssassinsBlade.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/melee/BattleAxe.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/melee/Club.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/melee/Dagger.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/melee/FightGloves.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/melee/Flute.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/melee/Glaive.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/melee/Gsword.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/melee/Halberd.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/melee/Handaxe.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/melee/Harp.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/melee/HolyWater.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/melee/Knuckles.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/melee/Lance.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/melee/Mace.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/melee/MageBook.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/melee/MeleeWeapon.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/melee/Nunchakus.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/melee/PrayerWheel.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/melee/Rapier.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/melee/Scimitar.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/melee/ShortSword.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/melee/Spear.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/melee/StoneCross.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/melee/Triangolo.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/melee/Trumpet.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/melee/WarHammer.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/melee/Wardurm.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/melee/Whip.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/melee/WoodenStaff.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/melee/relic/AresSword.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/melee/relic/CromCruachAxe.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/melee/relic/JupitersWraith.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/melee/relic/LokisFlail.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/melee/relic/NeptunusTrident.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/melee/relic/RelicMeleeWeapon.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/melee/special/Brick.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/melee/special/DiamondPickaxe.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/melee/special/ErrorW.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/melee/special/FireCracker.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/melee/special/Goei.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/melee/special/Handcannon.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/melee/special/HookHam.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/melee/special/LinkSword.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/melee/special/Lollipop.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/melee/special/Pumpkin.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/melee/special/RunicBlade.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/melee/special/SJRBMusic.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/melee/special/Spork.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/melee/special/TekkoKagi.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/melee/special/TestWeapon.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/melee/special/Tree.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/melee/special/WraithBreath.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/melee/zero/Bamboo.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/melee/zero/EmptyPotion.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/melee/zero/GlassBlade.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/melee/zero/Punch.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/melee/zero/WoodenHammer.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/missiles/Boomerang.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/missiles/EmpBola.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/missiles/ErrorAmmo.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/missiles/ForestDart.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/missiles/HugeShuriken.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/missiles/IncendiaryDart.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/missiles/ManyKnive.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/missiles/MiniMoai.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/missiles/MissileWeapon.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/missiles/MoneyPack.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/missiles/NormalBomb.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/missiles/PocketBall.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/missiles/PoisonDart.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/missiles/RiceBall.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/missiles/ShatteredAmmo.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/missiles/Skull.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/missiles/Smoke.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/missiles/Tamahawk.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/missiles/TaurcenBow.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/missiles/Wave.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/missiles/buildblock/BookBlock.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/missiles/buildblock/DoorBlock.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/missiles/buildblock/StoneBlock.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/missiles/buildblock/WallBlock.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/missiles/buildblock/WoodenBlock.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/spammo/BattleAmmo.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/spammo/BlindAmmo.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/spammo/DewAmmo.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/spammo/DreamAmmo.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/spammo/EmptyAmmo.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/spammo/EvolveAmmo.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/spammo/FireAmmo.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/spammo/GoldAmmo.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/spammo/HeavyAmmo.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/spammo/IceAmmo.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/spammo/MossAmmo.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/spammo/RotAmmo.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/spammo/SandAmmo.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/spammo/SpAmmo.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/spammo/StarAmmo.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/spammo/StormAmmo.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/spammo/SunAmmo.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/spammo/ThornAmmo.java delete mode 100644 java/com/hmdzl/spspd/change/items/weapon/spammo/WoodenAmmo.java delete mode 100644 java/com/hmdzl/spspd/change/levels/BattleLevel.java delete mode 100644 java/com/hmdzl/spspd/change/levels/BossRushLevel.java delete mode 100644 java/com/hmdzl/spspd/change/levels/CatacombLevel.java delete mode 100644 java/com/hmdzl/spspd/change/levels/CavesBossLevel.java delete mode 100644 java/com/hmdzl/spspd/change/levels/CavesLevel.java delete mode 100644 java/com/hmdzl/spspd/change/levels/ChaosLevel.java delete mode 100644 java/com/hmdzl/spspd/change/levels/ChasmLevel.java delete mode 100644 java/com/hmdzl/spspd/change/levels/CityBossLevel.java delete mode 100644 java/com/hmdzl/spspd/change/levels/CityLevel.java delete mode 100644 java/com/hmdzl/spspd/change/levels/CrabBossLevel.java delete mode 100644 java/com/hmdzl/spspd/change/levels/DeadEndLevel.java delete mode 100644 java/com/hmdzl/spspd/change/levels/DragonCaveLevel.java delete mode 100644 java/com/hmdzl/spspd/change/levels/FieldBossLevel.java delete mode 100644 java/com/hmdzl/spspd/change/levels/FieldLevel.java delete mode 100644 java/com/hmdzl/spspd/change/levels/FishingBossLevel.java delete mode 100644 java/com/hmdzl/spspd/change/levels/FishingLevel.java delete mode 100644 java/com/hmdzl/spspd/change/levels/FortressLevel.java delete mode 100644 java/com/hmdzl/spspd/change/levels/HallsBossLevel.java delete mode 100644 java/com/hmdzl/spspd/change/levels/HallsLevel.java delete mode 100644 java/com/hmdzl/spspd/change/levels/InfestBossLevel.java delete mode 100644 java/com/hmdzl/spspd/change/levels/LastLevel.java delete mode 100644 java/com/hmdzl/spspd/change/levels/LastShopLevel.java delete mode 100644 java/com/hmdzl/spspd/change/levels/Level.java delete mode 100644 java/com/hmdzl/spspd/change/levels/MazeLayout.java delete mode 100644 java/com/hmdzl/spspd/change/levels/MineBossLayouts.java delete mode 100644 java/com/hmdzl/spspd/change/levels/MinesBossLevel.java delete mode 100644 java/com/hmdzl/spspd/change/levels/Patch.java delete mode 100644 java/com/hmdzl/spspd/change/levels/PrisonBossLevel.java delete mode 100644 java/com/hmdzl/spspd/change/levels/PrisonBossLevel2.java delete mode 100644 java/com/hmdzl/spspd/change/levels/PrisonLevel.java delete mode 100644 java/com/hmdzl/spspd/change/levels/RegularLevel.java delete mode 100644 java/com/hmdzl/spspd/change/levels/Room.java delete mode 100644 java/com/hmdzl/spspd/change/levels/RoomOfZotLevel.java delete mode 100644 java/com/hmdzl/spspd/change/levels/SafeLevel.java delete mode 100644 java/com/hmdzl/spspd/change/levels/SaveRoomLayouts.java delete mode 100644 java/com/hmdzl/spspd/change/levels/SewerBossLevel.java delete mode 100644 java/com/hmdzl/spspd/change/levels/SewerLevel.java delete mode 100644 java/com/hmdzl/spspd/change/levels/SkeletonBossLevel.java delete mode 100644 java/com/hmdzl/spspd/change/levels/SokobanCastle.java delete mode 100644 java/com/hmdzl/spspd/change/levels/SokobanIntroLevel.java delete mode 100644 java/com/hmdzl/spspd/change/levels/SokobanLayouts.java delete mode 100644 java/com/hmdzl/spspd/change/levels/SokobanLayouts2.java delete mode 100644 java/com/hmdzl/spspd/change/levels/SokobanPuzzlesLevel.java delete mode 100644 java/com/hmdzl/spspd/change/levels/SokobanSPLevel.java delete mode 100644 java/com/hmdzl/spspd/change/levels/SokobanTeleportLevel.java delete mode 100644 java/com/hmdzl/spspd/change/levels/SokobanVaultLevel.java delete mode 100644 java/com/hmdzl/spspd/change/levels/TenguDenLevel.java delete mode 100644 java/com/hmdzl/spspd/change/levels/Terrain.java delete mode 100644 java/com/hmdzl/spspd/change/levels/ThiefBossLevel.java delete mode 100644 java/com/hmdzl/spspd/change/levels/ThiefCatchLevel.java delete mode 100644 java/com/hmdzl/spspd/change/levels/TownLayouts.java delete mode 100644 java/com/hmdzl/spspd/change/levels/TownLevel.java delete mode 100644 java/com/hmdzl/spspd/change/levels/VaultLevel.java delete mode 100644 java/com/hmdzl/spspd/change/levels/ZotBossLevel.java delete mode 100644 java/com/hmdzl/spspd/change/levels/features/AlchemyPot.java delete mode 100644 java/com/hmdzl/spspd/change/levels/features/Chasm.java delete mode 100644 java/com/hmdzl/spspd/change/levels/features/Door.java delete mode 100644 java/com/hmdzl/spspd/change/levels/features/HighGrass.java delete mode 100644 java/com/hmdzl/spspd/change/levels/features/Sign.java delete mode 100644 java/com/hmdzl/spspd/change/levels/painters/ArmoryPainter.java delete mode 100644 java/com/hmdzl/spspd/change/levels/painters/BarricadedPainter.java delete mode 100644 java/com/hmdzl/spspd/change/levels/painters/BlacksmithPainter.java delete mode 100644 java/com/hmdzl/spspd/change/levels/painters/BossExitPainter.java delete mode 100644 java/com/hmdzl/spspd/change/levels/painters/CryptPainter.java delete mode 100644 java/com/hmdzl/spspd/change/levels/painters/EntrancePainter.java delete mode 100644 java/com/hmdzl/spspd/change/levels/painters/ExitPainter.java delete mode 100644 java/com/hmdzl/spspd/change/levels/painters/GardenPainter.java delete mode 100644 java/com/hmdzl/spspd/change/levels/painters/LaboratoryPainter.java delete mode 100644 java/com/hmdzl/spspd/change/levels/painters/LibraryPainter.java delete mode 100644 java/com/hmdzl/spspd/change/levels/painters/MagicWellPainter.java delete mode 100644 java/com/hmdzl/spspd/change/levels/painters/MemoryPainter.java delete mode 100644 java/com/hmdzl/spspd/change/levels/painters/Painter.java delete mode 100644 java/com/hmdzl/spspd/change/levels/painters/PassagePainter.java delete mode 100644 java/com/hmdzl/spspd/change/levels/painters/PitPainter.java delete mode 100644 java/com/hmdzl/spspd/change/levels/painters/PoolPainter.java delete mode 100644 java/com/hmdzl/spspd/change/levels/painters/RatKingPainter.java delete mode 100644 java/com/hmdzl/spspd/change/levels/painters/RatKingPainter2.java delete mode 100644 java/com/hmdzl/spspd/change/levels/painters/ShopPainter.java delete mode 100644 java/com/hmdzl/spspd/change/levels/painters/StandardPainter.java delete mode 100644 java/com/hmdzl/spspd/change/levels/painters/StatuePainter.java delete mode 100644 java/com/hmdzl/spspd/change/levels/painters/StoragePainter.java delete mode 100644 java/com/hmdzl/spspd/change/levels/painters/TrapsPainter.java delete mode 100644 java/com/hmdzl/spspd/change/levels/painters/TreasuryPainter.java delete mode 100644 java/com/hmdzl/spspd/change/levels/painters/TunnelPainter.java delete mode 100644 java/com/hmdzl/spspd/change/levels/painters/VaultPainter.java delete mode 100644 java/com/hmdzl/spspd/change/levels/painters/WeakFloorPainter.java delete mode 100644 java/com/hmdzl/spspd/change/levels/traps/ActivatePortalTrap.java delete mode 100644 java/com/hmdzl/spspd/change/levels/traps/AirTrap.java delete mode 100644 java/com/hmdzl/spspd/change/levels/traps/AlarmTrap.java delete mode 100644 java/com/hmdzl/spspd/change/levels/traps/BlazingTrap.java delete mode 100644 java/com/hmdzl/spspd/change/levels/traps/ChangeSheepTrap.java delete mode 100644 java/com/hmdzl/spspd/change/levels/traps/ChillingTrap.java delete mode 100644 java/com/hmdzl/spspd/change/levels/traps/ConfusionTrap.java delete mode 100644 java/com/hmdzl/spspd/change/levels/traps/CursingTrap.java delete mode 100644 java/com/hmdzl/spspd/change/levels/traps/DisarmingTrap.java delete mode 100644 java/com/hmdzl/spspd/change/levels/traps/DisintegrationTrap.java delete mode 100644 java/com/hmdzl/spspd/change/levels/traps/DistortionTrap.java delete mode 100644 java/com/hmdzl/spspd/change/levels/traps/ExplosiveTrap.java delete mode 100644 java/com/hmdzl/spspd/change/levels/traps/FireTrap.java delete mode 100644 java/com/hmdzl/spspd/change/levels/traps/FlashingTrap.java delete mode 100644 java/com/hmdzl/spspd/change/levels/traps/FleecingTrap.java delete mode 100644 java/com/hmdzl/spspd/change/levels/traps/FlockTrap.java delete mode 100644 java/com/hmdzl/spspd/change/levels/traps/FrostTrap.java delete mode 100644 java/com/hmdzl/spspd/change/levels/traps/GrimTrap.java delete mode 100644 java/com/hmdzl/spspd/change/levels/traps/GrippingTrap.java delete mode 100644 java/com/hmdzl/spspd/change/levels/traps/GuardianTrap.java delete mode 100644 java/com/hmdzl/spspd/change/levels/traps/HeapGenTrap.java delete mode 100644 java/com/hmdzl/spspd/change/levels/traps/LightningTrap.java delete mode 100644 java/com/hmdzl/spspd/change/levels/traps/OozeTrap.java delete mode 100644 java/com/hmdzl/spspd/change/levels/traps/ParalyticTrap.java delete mode 100644 java/com/hmdzl/spspd/change/levels/traps/PitfallTrap.java delete mode 100644 java/com/hmdzl/spspd/change/levels/traps/PoisonTrap.java delete mode 100644 java/com/hmdzl/spspd/change/levels/traps/RockfallTrap.java delete mode 100644 java/com/hmdzl/spspd/change/levels/traps/ShockTrap.java delete mode 100644 java/com/hmdzl/spspd/change/levels/traps/SokobanPortalTrap.java delete mode 100644 java/com/hmdzl/spspd/change/levels/traps/SpearTrap.java delete mode 100644 java/com/hmdzl/spspd/change/levels/traps/StormTrap.java delete mode 100644 java/com/hmdzl/spspd/change/levels/traps/SummoningTrap.java delete mode 100644 java/com/hmdzl/spspd/change/levels/traps/TeleportationTrap.java delete mode 100644 java/com/hmdzl/spspd/change/levels/traps/ToxicTrap.java delete mode 100644 java/com/hmdzl/spspd/change/levels/traps/Trap.java delete mode 100644 java/com/hmdzl/spspd/change/levels/traps/VenomTrap.java delete mode 100644 java/com/hmdzl/spspd/change/levels/traps/WarpingTrap.java delete mode 100644 java/com/hmdzl/spspd/change/levels/traps/WeakeningTrap.java delete mode 100644 java/com/hmdzl/spspd/change/levels/traps/WornTrap.java delete mode 100644 java/com/hmdzl/spspd/change/mechanics/Ballistica.java delete mode 100644 java/com/hmdzl/spspd/change/mechanics/ShadowCaster.java delete mode 100644 java/com/hmdzl/spspd/change/messages/Languages.java delete mode 100644 java/com/hmdzl/spspd/change/messages/Messages.java delete mode 100644 java/com/hmdzl/spspd/change/plants/BlandfruitBush.java delete mode 100644 java/com/hmdzl/spspd/change/plants/Blindweed.java delete mode 100644 java/com/hmdzl/spspd/change/plants/Dewcatcher.java delete mode 100644 java/com/hmdzl/spspd/change/plants/Dreamfoil.java delete mode 100644 java/com/hmdzl/spspd/change/plants/Earthroot.java delete mode 100644 java/com/hmdzl/spspd/change/plants/Fadeleaf.java delete mode 100644 java/com/hmdzl/spspd/change/plants/Firebloom.java delete mode 100644 java/com/hmdzl/spspd/change/plants/Flytrap.java delete mode 100644 java/com/hmdzl/spspd/change/plants/Icecap.java delete mode 100644 java/com/hmdzl/spspd/change/plants/NutPlant.java delete mode 100644 java/com/hmdzl/spspd/change/plants/Phaseshift.java delete mode 100644 java/com/hmdzl/spspd/change/plants/Plant.java delete mode 100644 java/com/hmdzl/spspd/change/plants/Rotberry.java delete mode 100644 java/com/hmdzl/spspd/change/plants/Seedpod.java delete mode 100644 java/com/hmdzl/spspd/change/plants/Sorrowmoss.java delete mode 100644 java/com/hmdzl/spspd/change/plants/Starflower.java delete mode 100644 java/com/hmdzl/spspd/change/plants/Stormvine.java delete mode 100644 java/com/hmdzl/spspd/change/plants/Sungrass.java delete mode 100644 java/com/hmdzl/spspd/change/scenes/AboutScene.java delete mode 100644 java/com/hmdzl/spspd/change/scenes/AmuletScene.java delete mode 100644 java/com/hmdzl/spspd/change/scenes/BadgesScene.java delete mode 100644 java/com/hmdzl/spspd/change/scenes/CellSelector.java delete mode 100644 java/com/hmdzl/spspd/change/scenes/GameScene.java delete mode 100644 java/com/hmdzl/spspd/change/scenes/InterlevelScene.java delete mode 100644 java/com/hmdzl/spspd/change/scenes/IntroScene.java delete mode 100644 java/com/hmdzl/spspd/change/scenes/LoadSaveScene.java delete mode 100644 java/com/hmdzl/spspd/change/scenes/PixelScene.java delete mode 100644 java/com/hmdzl/spspd/change/scenes/PowerHandScene.java delete mode 100644 java/com/hmdzl/spspd/change/scenes/Pudding_CupScene.java delete mode 100644 java/com/hmdzl/spspd/change/scenes/RankingsScene.java delete mode 100644 java/com/hmdzl/spspd/change/scenes/StartScene.java delete mode 100644 java/com/hmdzl/spspd/change/scenes/SurfaceScene.java delete mode 100644 java/com/hmdzl/spspd/change/scenes/TitleScene.java delete mode 100644 java/com/hmdzl/spspd/change/scenes/WelcomeScene.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/AFlySprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/ARealManSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/AcidicSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/AdultDragonVioletSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/AlbinoPiranhaSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/AlbinoSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/ApostleSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/AssassinSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/BaBaSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/BanditKingSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/BanditSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/BatSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/BatteryTombSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/BeastYearSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/BeeSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/BilboldevSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/BlacksmithSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/BlueDragonSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/BlueWraithSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/BrokenRobotSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/BrownBatSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/BruteSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/BugDragonSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/BunnySprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/BurningFistSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/CellmobSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/CharSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/CoconutSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/ConsideredHamsterSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/CrabKingSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/CrabSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/DM300Sprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/DachhackSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/DemonGooSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/DemonflowerSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/DewProtectorSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/DiscardedItemSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/DragonkingSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/DreamPlayerSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/DustElementSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/DwarfKingTombSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/DwarfLichSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/ElderAvatarSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/ElectricwelderSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/ErrorSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/ExMobileSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/EyeSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/FairySprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/FetidRatSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/FiendSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/FireElementalSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/FishProtectorSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/FlySprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/FlyingProtectorSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/ForestProtectorSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/FruitCatSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/GentleCrabSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/GhostSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/GnollArcherSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/GnollKeeperSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/GnollKingSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/GnollSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/GnollTricksterSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/GoblinPlayerSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/GoldDragonSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/GoldOrcSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/GoldThiefSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/GolemSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/GooSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/GraveProtectorSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/GreatCrabSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/GreenDragonSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/GreyRatSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/GuardSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/HBBSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/HateSokobanSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/HeXASprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/HermitCrabSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/HeroSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/HoneyPooootSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/HybridSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/Ice13Sprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/ImpSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/InfectingFistSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/ItemSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/ItemSpriteSheet.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/JinkeloidSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/Juh9870Sprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/KeKeSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/KingSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/Kostis12345Sprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/LaJiSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/LarvaSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/LerySprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/LichDancerSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/LightDragonSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/LiveMossSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/LocastanSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/LynSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/LynnSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/MagicEyeSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/ManySkeletonSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/MemoryOfSandSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/MillilitreSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/MimicSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/MirrorSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/MissileSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/MobSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/MobileSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/MonkSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/MonkeySprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/MonsterBoxSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/MossySkeletonSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/MrDestructo2dot0Sprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/MrDestructoSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/MusketeerSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/NYRDSSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/NewPlayerSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/NoodlemireSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/ObeliskSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/OldNewStwistSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/Omicronrg9Sprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/OrbOfZotSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/OrcSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/OtiluckStoneSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/OtilukeNPCSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/OtilukeSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/PainterSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/PatrolUAVSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/PinningFistSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/PiranhaSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/PlagueDoctorSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/PlantKingSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/PlantSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/PoisonGooSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/PrisonWanderSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/RENSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/RainSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/RatBossSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/RatKingSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/RatSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/RavenwolfSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/RedDragonSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/RedWraithSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/RottingFistSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/RustybladeSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/SFBSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/SP931Sprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/SadSaltanSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/SaidbySunSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/SandmobSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/ScarecrowSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/ScorpioSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/ScorpionSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/SeekingBombSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/SeekingClusterBombSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/SeniorSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/SentinelSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/SewerHeartSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/SewerLasherSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/ShadowDragonSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/ShadowRatSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/ShadowYogSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/ShamanSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/SheepSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/ShellSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/ShieldedSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/ShopkeeperSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/ShowerSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/SkeletonHand1Sprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/SkeletonHand2Sprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/SkeletonKingSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/SkeletonSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/SnakeSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/SokobanBlackSheepSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/SokobanCornerSheepSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/SokobanSheepSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/SokobanSheepSwitchSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/SpiderBotSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/SpiderEggSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/SpiderGoldSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/SpiderJumpSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/SpiderMindSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/SpiderNormalSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/SpiderQueenSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/SpiderSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/SpinnerSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/SteelBeeSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/StoneSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/StormAndRainSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/SuccubusSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/SuffererSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/SugarplumFairySprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/SwarmSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/TCloudSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/TankSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/Tempest102Sprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/TenguSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/ThankListSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/ThiefImpSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/ThiefKingSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/ThiefSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/TinkererSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/TowerSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/TrapSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/TrollWarriorSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/TypedScrollSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/UDM300Sprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/UGooSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/UTenguSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/UdawosSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/UncleSSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/UndeadSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/VaultProtectorSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/VelociroosterSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/VillagerSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/VioletDragonSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/WandmakerSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/WarlockSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/WatabouSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/WhiteGhostSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/WraithSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/Xavier251998Sprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/XixiZeroSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/YogSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/ZombieSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/ZotPhaseSprite.java delete mode 100644 java/com/hmdzl/spspd/change/sprites/ZotSprite.java delete mode 100644 java/com/hmdzl/spspd/change/ui/ActionIndicator.java delete mode 100644 java/com/hmdzl/spspd/change/ui/Archs.java delete mode 100644 java/com/hmdzl/spspd/change/ui/AttackIndicator.java delete mode 100644 java/com/hmdzl/spspd/change/ui/BadgesList.java delete mode 100644 java/com/hmdzl/spspd/change/ui/Banner.java delete mode 100644 java/com/hmdzl/spspd/change/ui/BuffIndicator.java delete mode 100644 java/com/hmdzl/spspd/change/ui/BusyIndicator.java delete mode 100644 java/com/hmdzl/spspd/change/ui/ChangesButton.java delete mode 100644 java/com/hmdzl/spspd/change/ui/CharHealthIndicator.java delete mode 100644 java/com/hmdzl/spspd/change/ui/CheckBox.java delete mode 100644 java/com/hmdzl/spspd/change/ui/Compass.java delete mode 100644 java/com/hmdzl/spspd/change/ui/CustomTileVisual.java delete mode 100644 java/com/hmdzl/spspd/change/ui/DangerIndicator.java delete mode 100644 java/com/hmdzl/spspd/change/ui/ExitButton.java delete mode 100644 java/com/hmdzl/spspd/change/ui/GameLog.java delete mode 100644 java/com/hmdzl/spspd/change/ui/GoldIndicator.java delete mode 100644 java/com/hmdzl/spspd/change/ui/HealthBar.java delete mode 100644 java/com/hmdzl/spspd/change/ui/HealthIndicator.java delete mode 100644 java/com/hmdzl/spspd/change/ui/IconButton.java delete mode 100644 java/com/hmdzl/spspd/change/ui/Icons.java delete mode 100644 java/com/hmdzl/spspd/change/ui/ItemSlot.java delete mode 100644 java/com/hmdzl/spspd/change/ui/LanguageButton.java delete mode 100644 java/com/hmdzl/spspd/change/ui/LootIndicator.java delete mode 100644 java/com/hmdzl/spspd/change/ui/MemoryButton.java delete mode 100644 java/com/hmdzl/spspd/change/ui/PrefsButton.java delete mode 100644 java/com/hmdzl/spspd/change/ui/QuickSlotButton.java delete mode 100644 java/com/hmdzl/spspd/change/ui/RedButton.java delete mode 100644 java/com/hmdzl/spspd/change/ui/RenderedTextMultiline.java delete mode 100644 java/com/hmdzl/spspd/change/ui/ResumeButton.java delete mode 100644 java/com/hmdzl/spspd/change/ui/ResumeIndicator.java delete mode 100644 java/com/hmdzl/spspd/change/ui/ScrollPane.java delete mode 100644 java/com/hmdzl/spspd/change/ui/SimpleButton.java delete mode 100644 java/com/hmdzl/spspd/change/ui/SpellButton.java delete mode 100644 java/com/hmdzl/spspd/change/ui/StatusPane.java delete mode 100644 java/com/hmdzl/spspd/change/ui/Tag.java delete mode 100644 java/com/hmdzl/spspd/change/ui/TargetHealthIndicator.java delete mode 100644 java/com/hmdzl/spspd/change/ui/Toast.java delete mode 100644 java/com/hmdzl/spspd/change/ui/Toolbar.java delete mode 100644 java/com/hmdzl/spspd/change/ui/Window.java delete mode 100644 java/com/hmdzl/spspd/change/utils/BArray.java delete mode 100644 java/com/hmdzl/spspd/change/utils/GLog.java delete mode 100644 java/com/hmdzl/spspd/change/utils/Utils.java delete mode 100644 java/com/hmdzl/spspd/change/windows/IconTitle.java delete mode 100644 java/com/hmdzl/spspd/change/windows/WndAflyInfo.java delete mode 100644 java/com/hmdzl/spspd/change/windows/WndAlchemy.java delete mode 100644 java/com/hmdzl/spspd/change/windows/WndAscend.java delete mode 100644 java/com/hmdzl/spspd/change/windows/WndBadge.java delete mode 100644 java/com/hmdzl/spspd/change/windows/WndBag.java delete mode 100644 java/com/hmdzl/spspd/change/windows/WndBlacksmith.java delete mode 100644 java/com/hmdzl/spspd/change/windows/WndBlacksmith2.java delete mode 100644 java/com/hmdzl/spspd/change/windows/WndCatalogus.java delete mode 100644 java/com/hmdzl/spspd/change/windows/WndChallengeBook.java delete mode 100644 java/com/hmdzl/spspd/change/windows/WndChallenges.java delete mode 100644 java/com/hmdzl/spspd/change/windows/WndChooseWay.java delete mode 100644 java/com/hmdzl/spspd/change/windows/WndClass.java delete mode 100644 java/com/hmdzl/spspd/change/windows/WndDescend.java delete mode 100644 java/com/hmdzl/spspd/change/windows/WndDewDrawInfo.java delete mode 100644 java/com/hmdzl/spspd/change/windows/WndEgoalInfo.java delete mode 100644 java/com/hmdzl/spspd/change/windows/WndError.java delete mode 100644 java/com/hmdzl/spspd/change/windows/WndGame.java delete mode 100644 java/com/hmdzl/spspd/change/windows/WndHero.java delete mode 100644 java/com/hmdzl/spspd/change/windows/WndHotel.java delete mode 100644 java/com/hmdzl/spspd/change/windows/WndImp.java delete mode 100644 java/com/hmdzl/spspd/change/windows/WndInfoBuff.java delete mode 100644 java/com/hmdzl/spspd/change/windows/WndInfoCell.java delete mode 100644 java/com/hmdzl/spspd/change/windows/WndInfoItem.java delete mode 100644 java/com/hmdzl/spspd/change/windows/WndInfoMob.java delete mode 100644 java/com/hmdzl/spspd/change/windows/WndInfoPlant.java delete mode 100644 java/com/hmdzl/spspd/change/windows/WndInfoTrap.java delete mode 100644 java/com/hmdzl/spspd/change/windows/WndItem.java delete mode 100644 java/com/hmdzl/spspd/change/windows/WndJournal.java delete mode 100644 java/com/hmdzl/spspd/change/windows/WndLangs.java delete mode 100644 java/com/hmdzl/spspd/change/windows/WndList.java delete mode 100644 java/com/hmdzl/spspd/change/windows/WndMessage.java delete mode 100644 java/com/hmdzl/spspd/change/windows/WndMix.java delete mode 100644 java/com/hmdzl/spspd/change/windows/WndONS.java delete mode 100644 java/com/hmdzl/spspd/change/windows/WndOptions.java delete mode 100644 java/com/hmdzl/spspd/change/windows/WndOtiluke.java delete mode 100644 java/com/hmdzl/spspd/change/windows/WndOtilukeMessage.java delete mode 100644 java/com/hmdzl/spspd/change/windows/WndQuest.java delete mode 100644 java/com/hmdzl/spspd/change/windows/WndRanking.java delete mode 100644 java/com/hmdzl/spspd/change/windows/WndResurrect.java delete mode 100644 java/com/hmdzl/spspd/change/windows/WndSadGhost.java delete mode 100644 java/com/hmdzl/spspd/change/windows/WndSettings.java delete mode 100644 java/com/hmdzl/spspd/change/windows/WndStory.java delete mode 100644 java/com/hmdzl/spspd/change/windows/WndTabbed.java delete mode 100644 java/com/hmdzl/spspd/change/windows/WndTinkerer.java delete mode 100644 java/com/hmdzl/spspd/change/windows/WndTinkerer2.java delete mode 100644 java/com/hmdzl/spspd/change/windows/WndTinkerer3.java delete mode 100644 java/com/hmdzl/spspd/change/windows/WndTitledMessage.java delete mode 100644 java/com/hmdzl/spspd/change/windows/WndTradeItem.java delete mode 100644 java/com/hmdzl/spspd/change/windows/WndWandmaker.java rename java/com/hmdzl/spspd/{change/items/food/completefood/Chocolate.java => items/food/completefood/ZongZi.java} (62%) rename java/com/hmdzl/spspd/{change/items/medicine/Smashpill.java => items/medicine/RealgarWine.java} (63%) create mode 100644 java/com/hmdzl/spspd/items/misc/DiceTower.java create mode 100644 java/com/hmdzl/spspd/items/misc/NeedPaper.java create mode 100644 java/com/hmdzl/spspd/items/misc/NmHealBag.java create mode 100644 java/com/hmdzl/spspd/items/misc/PPC.java create mode 100644 java/com/hmdzl/spspd/items/potions/PotionOfMixing.java rename java/com/hmdzl/spspd/items/potions/{PotionOfHaste.java => PotionOfShield.java} (70%) rename java/com/hmdzl/spspd/{change/items/weapon/melee/Dualknive.java => items/weapon/melee/special/DemonBlade.java} (59%) create mode 100644 java/com/hmdzl/spspd/items/weapon/melee/special/DragonBoat.java create mode 100644 java/com/hmdzl/spspd/items/weapon/missiles/ElfBow.java rename java/com/hmdzl/spspd/{change/items/weapon/missiles/EscapeKnive.java => items/weapon/missiles/MindArrow.java} (65%) rename java/com/hmdzl/spspd/{change/sprites/EvanSprite.java => sprites/BlackMeowSprite.java} (70%) rename java/com/hmdzl/spspd/{change/sprites/Hmdzl001Sprite.java => sprites/CatSheepSprite.java} (73%) rename java/com/hmdzl/spspd/{change/sprites/StatueSprite.java => sprites/GreatMossSprite.java} (87%) rename java/com/hmdzl/spspd/{change/sprites/FireRabbitSprite.java => sprites/IceRabbit2Sprite.java} (70%) rename java/com/hmdzl/spspd/{change/sprites/G2159687Sprite.java => sprites/MobBambooSprite.java} (73%) diff --git a/assets/bamboo.png b/assets/bamboo.png new file mode 100644 index 0000000000000000000000000000000000000000..ff89f173f3042505e8d5da9bb98c60ea2056752c GIT binary patch literal 3025 zcmV;?3oi7DP)KLZ*U+5Lu!Sk^o_Z5E4Meg@_7P6crJiNL9pw)e1;Xm069{HJUZAPk55R%$-RIA z6-eL&AQ0xu!e<4=008gy@A0LT~suv4>S3ILP<0Bm`DLLvaF4FK%)Nj?Pt*r}7;7Xa9z9H|HZjR63e zC`Tj$K)V27Re@400>HumpsYY5E(E}?0f1SyGDiY{y#)Yvj#!WnKwtoXnL;eg03bL5 z07D)V%>y7z1E4U{zu>7~aD})?0RX_umCct+(lZpemCzb@^6=o|A>zVpu|i=NDG+7} zl4`aK{0#b-!z=TL9Wt0BGO&T{GJWpjryhdijfaIQ&2!o}p04JRKYg3k&Tf zVxhe-O!X z{f;To;xw^bEES6JSc$k$B2CA6xl)ltA<32E66t?3@gJ7`36pmX0IY^jz)rRYwaaY4 ze(nJRiw;=Qb^t(r^DT@T3y}a2XEZW-_W%Hszxj_qD**t_m!#tW0KDiJT&R>6OvVTR z07RgHDzHHZ48atvzz&?j9lXF70$~P3Knx_nJP<+#`N z#-MZ2bTkiLfR>_b(HgWKJ%F~Nr_oF3b#wrIijHG|(J>BYjM-sajE6;FiC7vY#};Gd zST$CUHDeuEH+B^pz@B062qXfFfD`NpUW5?BY=V%GM_5c)L#QR}BeW8_2v-S%gfYS= zB9o|3v?Y2H`NVi)In3rTB8+ej^> zQ=~r95NVuDChL%G$=>7$vVg20myx%S50Foi`^m%Pw-h?Xh~i8Mq9jtJloCocWk2Nv zrJpiFnV_ms&8eQ$2&#xWpIS+6pmtC%Q-`S&GF4Q#^mhymh7E(qNMa}%YZ-ePrx>>xFPTiH1=E+A$W$=bG8>s^ zm=Bn5Rah$aDtr}@$`X}2l~$F0mFKEdRdZE8)p@E5RI61Ft6o-prbbn>P~)iy)E2AN zsU20jsWz_8Qg>31P|s0cqrPALg8E|(vWA65poU1JRAaZs8I2(p#xiB`SVGovRs-uS zYnV-9TeA7=Om+qP8+I>yOjAR1s%ETak!GFdam@h^# z)@rS0t$wXH+Irf)+G6c;?H29p+V6F6oj{!|o%K3xI`?%6x;DB|x`n#ibhIR?(H}Q3Gzd138Ei2)WAMz7W9Vy`X}HnwgyEn!VS)>mv$8&{hQn>w4zwy3R}t;BYlZQm5)6pty=DfLrs+A-|>>;~;Q z_F?uV_HFjh9n2gO9o9Q^JA86v({H5aB!kjoO6 zc9$1ZZKsN-Zl8L~mE{`ly3)1N^`o1+o7}D0ZPeY&J;i;i`%NyJ8_8Y6J?}yE@b_5a zam?eLr<8@mESk|3$_SkmS{wQ>%qC18))9_|&j{ZT zes8AvOzF(F2#DZEY>2oYX&IRp`F#{ADl)1r>QS^)ba8a|EY_^#S^HO&t^Rgqwv=MZThqqEWH8 zxJo>d=ABlR_Bh=;eM9Tw|Ih34~oTE|= zX_mAr*D$vzw@+p(E0Yc6dFE}(8oqt`+R{gE3x4zjX+Sb3_cYE^= zgB=w+-tUy`ytONMS8KgRef4hA?t0j zufM;t32jm~jUGrkaOInTZ`zyfns>EuS}G30LFK_G-==(f<51|K&cocp&EJ`SxAh3? zNO>#LI=^+SEu(FqJ)ynt=!~PC9bO$rzPJB=?=j6w@a-(u02P7 zaQ)#(uUl{HW%tYNS3ItC^iAtK(eKlL`f9+{bJzISE?u8_z3;~C8@FyI-5j_jy7l;W z_U#vU3hqqYU3!mrul&B+{ptt$59)uk{;_4iZQ%G|z+lhASr6|H35TBkl>gI*;nGLU zN7W-nBaM%pA0HbH8olyl&XeJ%vZoWz%6?Y=dFykl=imL}`%BMQ{Mhgd`HRoLu6e2R za__6DuR6yg#~-}Tc|Gx_{H@O0eebyMy5GmWADJlpK>kqk(fVV@r_fLLKIeS?{4e)} z^ZO;zpECde03c&XQcVB=dL;k=fP(-4`Tqa_faw4Lbua(`>RI+y?e7jKeZ#YO-C z0RBltK~#9!V*LOAKf_1{ObjC&u;7y5ToHkuG#I}}tRULpp`xFONX-lk3=ID{S45C& z`JmO$M5Jb-9Wm7OqXdBIDG#{j9E$@C*w{KsAO4%3^1y03vHEejZXonCp=;Jr`oN&0 z^nnqH4Ksuh#%5q(_>aqS9iFF=>HzE05l7~{nl`up@yB%Xf0!q~0wf~Zn>DCx&q z4gO#FilWBFP|}aHA@ua~6^a}&RP>MdrtoM0j0OOD3ChSwk%2=^KL7v#|NjF3H?G-D T`X2Ii00000NkvXXu0mjfk{7`V literal 0 HcmV?d00001 diff --git a/assets/blackmeow.png b/assets/blackmeow.png new file mode 100644 index 0000000000000000000000000000000000000000..8a87f7369765d24851a5108320f6a931e162befd GIT binary patch literal 4023 zcmV;o4@mHdP)KLZ*U+5Lu!Sk^o_Z5E4Meg@_7P6crJiNL9pw)e1;Xm069{HJUZAPk55R%$-RIA z6-eL&AQ0xu!e<4=008gy@A0LT~suv4>S3ILP<0Bm`DLLvaF4FK%)Nj?Pt*r}7;7Xa9z9H|HZjR63e zC`Tj$K)V27Re@400>HumpsYY5E(E}?0f1SyGDiY{y#)Yvj#!WnKwtoXnL;eg03bL5 z07D)V%>y7z1E4U{zu>7~aD})?0RX_umCct+(lZpemCzb@^6=o|A>zVpu|i=NDG+7} zl4`aK{0#b-!z=TL9Wt0BGO&T{GJWpjryhdijfaIQ&2!o}p04JRKYg3k&Tf zVxhe-O!X z{f;To;xw^bEES6JSc$k$B2CA6xl)ltA<32E66t?3@gJ7`36pmX0IY^jz)rRYwaaY4 ze(nJRiw;=Qb^t(r^DT@T3y}a2XEZW-_W%Hszxj_qD**t_m!#tW0KDiJT&R>6OvVTR z07RgHDzHHZ48atvzz&?j9lXF70$~P3Knx_nJP<+#`N z#-MZ2bTkiLfR>_b(HgWKJ%F~Nr_oF3b#wrIijHG|(J>BYjM-sajE6;FiC7vY#};Gd zST$CUHDeuEH+B^pz@B062qXfFfD`NpUW5?BY=V%GM_5c)L#QR}BeW8_2v-S%gfYS= zB9o|3v?Y2H`NVi)In3rTB8+ej^> zQ=~r95NVuDChL%G$=>7$vVg20myx%S50Foi`^m%Pw-h?Xh~i8Mq9jtJloCocWk2Nv zrJpiFnV_ms&8eQ$2&#xWpIS+6pmtC%Q-`S&GF4Q#^mhymh7E(qNMa}%YZ-ePrx>>xFPTiH1=E+A$W$=bG8>s^ zm=Bn5Rah$aDtr}@$`X}2l~$F0mFKEdRdZE8)p@E5RI61Ft6o-prbbn>P~)iy)E2AN zsU20jsWz_8Qg>31P|s0cqrPALg8E|(vWA65poU1JRAaZs8I2(p#xiB`SVGovRs-uS zYnV-9TeA7=Om+qP8+I>yOjAR1s%ETak!GFdam@h^# z)@rS0t$wXH+Irf)+G6c;?H29p+V6F6oj{!|o%K3xI`?%6x;DB|x`n#ibhIR?(H}Q3Gzd138Ei2)WAMz7W9Vy`X}HnwgyEn!VS)>mv$8&{hQn>w4zwy3R}t;BYlZQm5)6pty=DfLrs+A-|>>;~;Q z_F?uV_HFjh9n2gO9o9Q^JA86v({H5aB!kjoO6 zc9$1ZZKsN-Zl8L~mE{`ly3)1N^`o1+o7}D0ZPeY&J;i;i`%NyJ8_8Y6J?}yE@b_5a zam?eLr<8@mESk|3$_SkmS{wQ>%qC18))9_|&j{ZT zes8AvOzF(F2#DZEY>2oYX&IRp`F#{ADl)1r>QS^)ba8a|EY_^#S^HO&t^Rgqwv=MZThqqEWH8 zxJo>d=ABlR_Bh=;eM9Tw|Ih34~oTE|= zX_mAr*D$vzw@+p(E0Yc6dFE}(8oqt`+R{gE3x4zjX+Sb3_cYE^= zgB=w+-tUy`ytONMS8KgRef4hA?t0j zufM;t32jm~jUGrkaOInTZ`zyfns>EuS}G30LFK_G-==(f<51|K&cocp&EJ`SxAh3? zNO>#LI=^+SEu(FqJ)ynt=!~PC9bO$rzPJB=?=j6w@a-(u02P7 zaQ)#(uUl{HW%tYNS3ItC^iAtK(eKlL`f9+{bJzISE?u8_z3;~C8@FyI-5j_jy7l;W z_U#vU3hqqYU3!mrul&B+{ptt$59)uk{;_4iZQ%G|z+lhASr6|H35TBkl>gI*;nGLU zN7W-nBaM%pA0HbH8olyl&XeJ%vZoWz%6?Y=dFykl=imL}`%BMQ{Mhgd`HRoLu6e2R za__6DuR6yg#~-}Tc|Gx_{H@O0eebyMy5GmWADJlpK>kqk(fVV@r_fLLKIeS?{4e)} z^ZO;zpECde03c&XQcVB=dL;k=fP(-4`Tqa_faw4Lbua(`>RI+y?e7jKeZ#YO-C z1msCXK~#9!#FOrA^XNjcJg;p z^B|D<^Z9*$@BM!7z28d^5yIM)Lxex*qeZb1Re#j{^BOx5iS!|u09y3QA!KzC(bubs zy$^jFr-C8BdyHrZG`hM1Y|TvYv0 z^1y3Ta6kLPZmuvvuef2Z|N-42zJJ!jVQcA#P%{tA6bB%io z_Z0xw_uD-=6h(iOybd1w1Ht=F#QiGPS3sir&j7R4|Gtz*lv3i&&x>IgVi<;)rYVMD zh&MmqH4`_;WN6WQYip>TR{fbA0@w(M;7iYemQ)Y9cRxrv3HLj zCownIb?lUCtd{-gN8KTUH9%A6lMC1V2f^(OaDk zey}Cx=6W8#sN>&n3$6fS7>55~Vq$`1G6}#J#%sLq{7j`%Ve94dJkHMmuckcK$9mna&N7a8Gyi$r=w{EraqLgY1o;$mbTrP+E@df@k`U*g- zR4Q%yY|4B(O#dI}XJW%z0Yb$AKcKy|;Je9Wl8K3lzMYDq|9|s;eLhF0nG29zJj&$c zB-w11i$9)YdV1PlVV;No1DyhjX_LJlWO*^R40z-Z?Bd|bn_N7#iyJpB04fz?Z_S>N zZ3_)1ki8VsChtr=@(oY!GC6qiCZA4uFqPwxWSKcx>BvXb@5b-kS=xMi_QccwgYPAH zXU?4Yw{R&#D_=~T0t}`vGtswzPcoBIu30Fhh{xlNEY4>6az};tet!dit5>g5DwQ_h zzV!7|fNy_$5FEV7{P*c603+keH4D=;$!4?u;Pk`q{YVE7@&{hu5WM{#{uC>fN}IxX zy*ikt$&)9IevFTg_oN@S2-G!zD5V%5A7^=anM5Mdl*NtNSD~;wL-oNLzy9sT!YbIY zu`xW)>zmir_n`Vwc|c6lB#}t;?SC+N{4F3P`G8nqcSgGDudJ*vHa6C?{?HOY7a+M@ zZo>fRVs8B?5_TMk#4Dvl@1djMd+~ogh+(|wnHv^3fP44uVcT{)-cKUKFi53R8|-w_ zAIdSXm^R^|0}q|1&bzLQ>$?8Sh25FZvuITQ?OGhiad4c`@Wr&*mS0|8#`C<6e6?Do zUa#YMp0B61UDx#s#CCk}loXH0{gYF#{tu-HJhI)ST(d~6tTY|nQmGWSZBtB}+~uFP zhNAMtbc0_RG4FX^>umF%x8ohhK`Di0S*<@T5s$}%KjKI?eQl#ssi5lu%d)!qKeYb> z>VMiC+5T)lE8EXHReiA5)nHU!2WwQk9_(N%*DT64i#=NsZ3EY;+p673zg)966oh)F zTb3pIojqF;!~bI_WDk*$Ocg-(yxfxmqvG3g`XYjUTfUe!W&Ic@favSsr_cVk^(l;x d`d`3*0|2pT&g#d^*b)E$002ovPDHLkV1l1D%$EQF literal 0 HcmV?d00001 diff --git a/assets/catsheep.png b/assets/catsheep.png new file mode 100644 index 0000000000000000000000000000000000000000..9be02161dc1f931dcf0e9ad5c256314aac2ac727 GIT binary patch literal 694 zcmV;n0!jUeP)ix3=GfDpJI?SGy}6?1Sl0)tLQM0s~?mK4CGV>R6o272v^f#Sh?r~ z#BU&vTUs%!Jbn!3R}9ZTJ$n-_2Vx9W{qO)dAjiufE@uh%)BzCdIGhV+fIKa23@I1D z^eTirS^75&ynZH7@)dWnWN>tIVX&}-1OSK)0^;HB;H&`3`^cUL$-&A4Wc?s7i0#AO%MIxLQweLONQ4^fYloifGq$1`6~lR3k3C zgLxbl5MV(dfv*3FS2oxTkUYp-V)cXUgV_zDNzo5-Crm%7_Jhj+kR$g_ngg~JRPw`s zjhF>I=3yR(1q4hDh(^(`Cd$B2-v^c^OFy0M2RDRLm94?e-}23Zd>d#LDV`2Fh_+;hlmWDg*VBeOwjkom~$p`stz cog<1303el`9?Pnjb^rhX07*qoM6N<$f}m71y#N3J literal 0 HcmV?d00001 diff --git a/assets/consumable_icons.png b/assets/consumable_icons.png index 28225d85fa873a0cda737c0df742dc73c211261d..b1e0cec942bc473cd0d1672f893dbb078746a39f 100644 GIT binary patch delta 1696 zcmV;R24DG;BFQ4Kz6yVKNklKox8{#y@v!pfcEf+OZ@)2#vOe}H@00%mE|*8tc4^dXZEq==(>=g2;{|d zfF(!QWnqPlxtY>w0m$4;5e4&;40JweJ@2&$IsJ3L4WK;OzETio_Mb z5P&uS5D|&b*Asu}66YI*@zFqR^Q#x9a5SNKBhs6s#sgJL@%J4a0`1IQ}0FVX%B}dog#dLrGpx^;O zZl-iDtdPpSg%vhhK-$jVA3HbOANT_AkDZ%!GY`&adNO~}XZOilnW&(35>k zvfX&Um_UC+?0R)E+#o7=28e(=ZI1Q;qdj0ZZ14a;S*RfT$=Z>87>qOH0hr!En+Y@mUtUSO`Gu3V66j%#^8VOX?vTQ>%aA#9M0W1OQIF<;K)1){f+3?MS`@ zIMX)b0RT-F3p+GjYRWYK>w6vX>w{GEIp%DiRff-`0GesjOs7^26iu1AnbMh?DPlA< zvgg&qf{L8|vwL1WEYJXchh_N=%Z`P5%_$50KogNrQUL#oItW^eWz=#>YPn?AMPCUt zpRj*H+yy^=+A!Eow28T6q_PC?`d>3#QzWWW?%wVf#{*LRLgH-W@?>-XhI(sl%QNO1Ym_umIq3*#v(cmrXc8 zwE`)ow&#_7o0}rhs4y#w03fxWCe=yO>zH{~1<*#4A~L4wQo(blP?7j1xB3t90&DQm zE(|`}g~~rpG6B4QyXgS%)KC4%!7~BB?qZ{+&ZqH?@KQv?ta|{^IiDk)^Eu*`O6~tf z>U8VM0}-h_5D{e`0O*_%9A1CPy9#l2pc0Kbfr~~RYwP;_q(i4z`^4y&!xk{*ZqVF- z`qkJ5nH00`0l?7N=Q4Emxz6$T$YSi@NA)(CY4*n!eDDR2BzO(NYaX56( z^t1isO5Rlfz|Hv^4qF)*N>8UmqoOs?4&1Zn@Utr}kD%i62+aByOQ(M_rfE};JC^Ne zWHgPsSr`t79Xgdg0|4I#bL@%k*~b7t(Tnc1ldxM_$prQp9a5~drsJ90L2`O`#Ae|C z(Sk}CK{5Jqg9{o;mBY*+`00005Nbn8l)qr)$+~3l+sqaW)!?`rNW9C|GA&JSE9Xz~$MMzKt z@_4$4hxf0@{1V$LN~G5X$chpX1M{6?^a4Qg=_@l40l?Vaog&U{(BQcbQxE|=Y(D4*9`u7rc<=zgsL((RE3fxeK`BnJ3&@r>GyU4d1z#Hk z@7}mmN1MUHkTEv`S>VPPnVcyCAefvff{0I58k&ZQ_y z4<>SMzxPWKq(T7VWxzfCqC=($TM~n;PA!8IFKB;4CjfBb1y`q*@p@ksUhk{&fzy4p z9stnps<6j|OA|8nv3ai^pnd>SKj1s(joGNi%n4A3O&w0%94IDaR+LC@MTv+Bsj>`IxmKnqK-oz#O()*J$OYO zhh%@p!mR9AnDxz9pHnI{o4QBjy4ZOzC?AHE!GJLb)tI4fE1weNLi_&wi@LR4+D|B_ zsX;DOw|Tp_+fjNo<3K}QC{^BL5>DN~ack%IcX<^})%PkBv+2SlINIz~%XKoRBMx(+ zy4>&lk^pe@^Iw1?|2Vtt2g`i4h~zujYY~6)Oe%B#0GC2Pyje;lpN%&1GQx&kDN!zT zBUiNPMV351kz}2SjF~p*p0VzA)^!v}fJsBJNdx*AWvfg|-Yzr<-ur>H|P~Rf@y46KJnW(KbitD=*MgeN9AwvNEEqjER43 z+o;# zMArV%#8b2l&F&jD=2E0xMqWk;0LRB`aD2SR>o;)$0`SV*Wtb`eL86I{3zT$P5^HPd zDlGJk`RNx20$TtWy?P9zSC2siVvK*C^VzHuk+^~8!iJmPEf%zdI9bHW8vXG61r zhUM5+nG~J(0AS?ABN;jI$ee%UkE!R*(OWSOW`Xyy@4X3yM-sdU;l+S|QXZzE;cd2r zsW7Y`R?byk003N>yX@;51;z^tDe1Jt3k!YU(E95mg!Svs-b4M_d(ipM38zlZGe2`o zIJJ$838S_Obq>texB|dek=@>jf0I>{{cDTn0zKS*KUGuI;I^wyN8 z!2iRAYV*?bEaJQWeAPGn{@Hh8+FWjuq!%i+@;rbypGuxe40NGE?$gSHjK|}F4s_`5 n7Egi3_#~4_#A30masC?sQhDgJ9l8-m00000NkvXXu0mjf`?MdA diff --git a/assets/follower.png b/assets/follower.png index a3907441c70668d2ff85c2f51ea594d2063d0157..8143f6746b1727fcf971e2892db7b23b5313fa91 100644 GIT binary patch delta 8772 zcmaiac{tSX_xCUuvTs9Krn2vpJsF{-vK3KwQVN-@BQxG(4@KEh_9RO_wnUc3*vnqX z8iVX)hEEvA%=6aw`+J_}dj5Ily5@ad@43%8_v=3Qc3$U9l1FcJ(7p&0} z>yFOeX*RVp-2CFYh7Zo&|9qH|o}YeB>4_y_LO@_K2se1iO*P+2*mF~|Fk;1l^Ozsb zII$$Pl!JFLEMam#Vjz1R4(p9`K8#rb0L0*$nOS)03ZGYgtt?RWYExf&YWUfG*Muc4 zq=@re#{5AHzMkwS9pUi1(q2E(0bj zgjv78iP4Z17}@0$iC~k$sUAcV8sVPF)C-KC0@vWIrx<76ADc*1O|Ef6Jp)yV4t+U& zU+Q0<&wRm@SN%`h8Y^Lh{)X3}p-ybDW&Fc&3Nj2Jqg6o57r8utFF{!7$i449&wu-H zuSa^XFGbdIqOKpd1g(!%5wbCUe%GhJ>HIJj76p87tD&eEjZr%{d`om)*4(C_SiDW& z2sqdcVe7qO_rz#O6wi0lfc5&{GH)XX0+IQWki?djUe233WY?YT78BFbw-h5&;{Knt zYVEGBE~BdQsC;`hfdt5#&YbChYuM)wj^##dnFE3{5Ptpc40n456ytJ;+p~Z~U5djl z!0)FT01H89u2b_bV%Nvigb|2XGWn7FqY1v4wfIw4hJ4hvo-M2@d8n#d zx&Msi$C>2@_?}zT88|Tby%fp4E%if*0Jc`n8!K^K8zvBpIjwWOAfFWS_8p+$4+hwt z(___M{*a2c(>cEteAaJt1?6Ha-2gN6%eUQKxvH3v=?;Uc_jRe^eNjShmK|8zJUWQi z2bJwPvh1JABpvmv)8qQuw^YB!+~x~rep^q~3fgF)&+4_K5|hvsIy*;pD)zm_^x@vw zi2b+QOQV1j*HJUNAfRIiGxR5)awCAz?gO9(!osckbCM=$k9iC)12Qn_2gKT9Rvt*l z`^t0X!z`>2ax-mv%krQ}n+))aLySS>dp-cx^Tp{OBZzi-ZL?ECSK7eq!vxn6`k~3m z790HA&`JNC6oL2S<-!iR$H%2uo6=vIrZJ{pjZmr&2JJ!4hn{GO+PR1EuQu7_i!e92& zFEYU2qHm-AC?$YyjhwQ0MXDKCALju3PrGnwz50eAU(q(~&}0TUTw2Jdxx1YT8!tH) z$DK*~#7el^LEP^p+)W54mrOJY@5ytxo6ege0oSh0H>G?2jFzrd87o2IaE(RHiL!}C zJ2*0Iq)st;yJraxcGW(lHu=kaFZ|MB$7%c_rfa6SoJy@Z;Myy()N+!6b3#-4k+T@3)` zO^0d1#2v)fh<&3))ymfk&QtnQ9KRFHXk9c@gV&WceH-_fm6m1E6R~HOK{sAmG*UdH zIY;@4m`rv)JWY&^yYu|dH~lc*dHRu)bCo|WZxW2n2tu?Mvyxh)_gLO3u^b-jK?pKr zkeZgg*Kg#a%&Si2@If}(HijJL06dBMc9cL(N`ovDtHz2Wn@&2AYh)`u)2XXMos6y0 zQL1y~-6mJ7wS5<)2%R@6rR2l=)8SIh`^?40r`f}qyl2wYeblTw-gP6KI5g4wJcBF) zGah+bklRy~Ih%T;ZRLK8JM!6WF5gF6kF~H29E@vsZ8Vlvdt(iol+u%c8Tk7faY{^# zs1W<_!;2C#pZtbcEHc>!*a(7~e3^Evgr4xvqGSK(@t)y-Uion^p`kjJ|NjRGD+PP^ z9%5hr#+0k9A>+O18Tn~Vg6TFaa}^8hR+?J##vHqMTTS3}et`W`jQcJ9AkLePd)>Fp z*Zi_oLn``f74)n8h+9=&gL)zSxBGua*$Cky(*3paUENs3yUmTZf0@blIIujTnRDS? z-R?S({uC8S^|NfAAQscch?)Jp28S!56+-Ti9nUQ;OzNc?I}E)#?x_V)*&Jl%8IXX`FQY7ox=%Gk#&{Tk=PmHVE$XC)R0rIZoM5C~w^!oq&`8#1x( zYu#8aL|a%?HIR?4f@qY72?$z5o`~skDT#R3I*0b5bPb=|i74E&+qPvDHKQG=Ec1%9sY>5h+bj*<)T3k_iY#nq6po2%Z=ouX+fk znQ+rY(LJh|=~k*kAUf-wq)1baJbaC- z?q^7NBBP*t8Jf&K2%FifCJx$dL|zkZGJ^ z+U@vNETKHr6F5_vUS|5hD(84ct+2X&1NEEIQo-E)Dl5G{*zMtEiMj!iUD&~+Y68{Q zTbC(2^OCD$7i)k|2rOqx?-=-+@AK2N*jF^sg7b-ax%bt!hD6@wWzq23K$-jkf2Jd$ zzJE$WxvFvFb8-nZdn?0}=@hi7yPE zmmDts5YYRc&b7CF*C_xQM*RpBejC3%j!QXvN}x3e;-!HR8U@t~_JcD-kX0Q3Xwp{lyN z%tQZMK3CR|aK*WUAWoLbQnyP7Uav0^$tE*gPXqILa6M*;74$GZEFDOfZtIV|Bg=4sPx?BGJWs5|0hN zz$y{PEcCWm`h?)G-yBpTgVy9Rg_f@}G?tGn+GG$5AMHXTRvRQs1PSs(%7QAinOo z@W}Vba^{T(Gb8k3emwSI2Mq8~D9ccjV5z5X%Y@(bZcI52mn8KB@_2=wRh?y5TYQ6L zdTU;Kg40kq5fEzr=MY1(V$4zpWZ6XZF?R4J(8jM1iH1BeJ@NU%k}mwA42(Oz>jA6t zkHu^!qj#cHu6;u=?)>A-7%B4JrQ>_2=+Y0GwB4{5@WCPO_>>(pcI_n-OXN)BSW-k? z_Bv$;w$Ui9qqMp)S=R=dcA3FrJLith{G|rBC%|{_I^puFndT~f7Ok5)e;$1{pV^nn z>+#CoP}NiMOi|HIR_Q*AI}|y$sWe-sIqlWkg8y^Xg+#u1rUiCR-Y?~`mqb%#JaAGV*j>JYefLPffAb+4{G!M*xr>Iv$_gyt-CS!A zaNJNlva=XO?=*kKt>Rr?wQ6+0wv)t9$_x#rXVH6i*fYI|eV-e*TPJ_ndo$r8+13|I zQtU-s?bo&pB6?bQdY5O7s;w9e^nRyY+flRILt<-jrUqnm-NL{r6eW9glHV>31xS7q z?i3-M1z3Ut+G>9+;J%)Jyl0uX2@Ds3`m(HSK1-(aPDKJCy~eNv}2O8WetZhQWveXaU=M1xqK-v1J#Y z=A*Sy@F7WiO5uj0qbn))v3#{9Z%jAh0Yb(dbRJ(q#UsTIUoS_1OI=gc!dCr}*{7cP zmOrn;``}PSx?5T0Sctf*o=vco4MI%3D&U;vrz-h>SqztwH1R)wJzI)briaj$sVb{* z7yC88zx&iV!Ee2pfTM-FO8*f+AwUj;!{tSsGxmDk~K_~y3ay~;Lw*u$jJc8*~x z7oN0pdybi|F80~z`=$-L^_@qO(!+;R=Bk-~#AYBE`lKT&ota zog(PLQ22ReZnYLfu8?DYzit=7SkQFzR|s;r}y$YNY-Q8%+sYd|%(m zH-BGOOgncCl;H`QsOYX$m|lE4r_Gj^R|G(3;DQmnxRgUy^k{^6DzY#@x6(_I9241b zcd~0i_sPfe8(Q-Ey)W%%SlYLHhzS60Gy*+R6gs#4fU)A!SJ7tc?Q{fa7j8$R0p>HU`3;za2P zX~SIv2Uj}Zo3?bq>0q);lK^0md| z4#XloI5vre1d`h;n4?A7gLsqJOYAE00V;Qh#DM@Hak@nZD z^NnpLvju|OSDWDzvw6|_Vrcxf(tY&n+)_+u@I1KhUylu6*gt`I%AT`ZaIs7wPqnO^ zh-TmZ%G`5c+!8}^dQb!%2*yisR`giB=C0!Ve@GKhX$yV)UlJt)iO+0M+gKntajh>9 z3guzS>I{mPbx2*WY@3cK*wyP?y$N)DGIX+Zv`G|AqmunxRA7l4r}B6V368GT6^|HM zQ=n~*3@BTw-YNJFlz;h2u<~FOrOg!AyeS?ND8=zJKHrXsc;f2QB2%tjHo}4~fU=G1 z4%Gq4sa2=wCY)Fu<i44nLDA;HY*7SmDHy&gPEo4<&>k#uBgb~^eB zM8Ma*nf9+bD4F&VSybMZp4ZrAnjHpxhI0lCl} zBN?^j1$SEyoKB8g8%bC)1hIya=Cd^_ek;rQ%Dlz z_iWXk4Y`PBeXmGry!W5W9`g#2+rtiA4*EeLJsYJ=-KZX1Kz=^n9%A&o#ca103g^9N z7r?{*WL_sSlSEB)0`{kqljh!k7&=M~{*eKGPKw(x41Ue)QBZUOgM+cVP3mmc=qt)- z?BlLC{E1(`*s2yv!{AGstd2CD3X^+A9*<4IajA51h!QTGh;Bx~;*6p~-4`d|5J7W`^ zpPWt1hn6AzjxT_txJ(4(?{V>2bnl){C3UQJA%kZ#<(q&k0N(ybC&rE+@lFocQ*-zg zuCm8MC*zp{^cU((w~MTQ5v<%dytuyq#?O(R;t7|uni+IR4j0@N1JQyEgEK>vIc^TXtO&}!<>9ZZy6=`rugc|m z8q7iqJlqfTXt~(oj-VVy*ZHv|@*8YOI8_IH`C2aBYB^psY6)I%Csal|hvJ5%w4Ln# zC>tc-PW_u!RFZb2Jxxl2r4KlyzHOTq+9{x1+D@D>skRjS*smY<2(Z3$fvq!@UIp-> zFc{Htz`2d8LmGkBO~)sGO{e`;?q6Vk0PJj)@Z6M zyNHy_(H3VIj6?3aOt=lI*wCVQaclz#iStW~Hdi68lxsfj2z$Lgt%gD%grVqKvV(g%73SmzNd@8B4rQJtKg|*3KFfSVRYAaSKk~2r2 zsix)qv`1d>rr~VJZ;~JkKp&rk8`z>s+XFi$;g77#*yY-zM@rh^j0~Tel*8d^b>9;>9aeIh_6VLI!&zSq!aKLqLnEPo+${~ha&YUd? zIM6wQ1zIojF??$G)88k(dAF+nz&840i%={54Ie~bZB#C+vXZw)?Whb^0UU%9Pd#}L z()V%(^Vi67AZGHv^`ZsLzq1$nkjSmk=0h>seqA%{;e&=cAlnA)-Pu}4^|1Jj>8yY> z>?XFmZv?N9v-^!%yX3!Kv05P1j4F09rD5$w(7&Zl8s)2RkUrn z!MA%izNXXxGsGW~cR2T`A1n+H<%R)RI2@dKfu5>wqyE2R+zTpt9P)Hz=ADBLr8| z4(#UC2v&P{U>C`5_{5-mHp@wGn%(Ul+=()C_B$8fE3k4Q4}+(j_v0D9aBT|oq9iJI zX!icx4M2}&i$c2xy?9|`C?XV3zr}OzgCDYkoaN$)5MYlMtSLTs^3ky71VH~BTu48| zws<*eo_=6)k9fE{-S;92oHm_#8#8oCclbpQZW3c51q8TlBj1Ne6BXWY4~y#-*KtmT zEOSP|Yie$dOC%tg!Ku1A(fjHk`&L|$I~UMHH~tb{64_Mp>vMD~9er@=_w0*6*q!i+ ze`ix%Pjh6sWIa`--{&JSwcojp{hcd)QtB%>RZ=af)uMJUxxx8Tn7QD_pIYN4j<>-)oDV%nX|#7481F#jE)yYg`*vS{Nl?o z<|jMWsI!y&PE_4>iy7dbj+dbEG^DV?e+o3(;%v7}z@x1UjI!tMhb2D4bAkQBFs+z` zBMxyT#W8J48GSoo40h`qi&tdV%=U({oz>8}+PLSR-tzaEpF^R|GOAtfqjQI zXQj-Agk6XJIY~=t5kRIi3%~&fK0jhk`js!@*b|R$%YPO{>*p~1TVvh&#X#szl0N5n zfkj)wKuwS4nL%c+HF4H;3m)W|!L&$?S)X;pa@h+!7_c*njvz#+;r%DH2X8?oppH&l zWn*q6yDjuijrHOb=Zn8Vv&GfI>s(I{QRbFhO|`$n3BoA+ClyaRU~tcjxUHm&p2Q?P zgP>G}?QWyT&=Dpr^Efj!2V6!i~M#$%~_C@yz8jQoLv7_ zl;-Dhg;7_}2I{Bx?3@(jc9vZei27y-lBPT|1O>agmn ze!31r6`BKFIq+h3acDh=$sjKf-98(3OvWO%2y40Mby~Rn74^alSwk%6s$uADc`1GG z)~hy0@EHh<3*@)arKfSKP4N&C3obgr-_$m`rnp{I_~3gIdCm*;)t6VHP2w-1NA<$n z5XV+G9L4?wn2w4)qa0jTRCpaO+gwn(50JisuGdXfMMc!pJ#&E=(G7pSIy0H;FDox| z6)MAiEO09?QIf}^mX7Jg7u6eW+z96zIF-2Mj9D;XGm?U7E&%JfOzjM=Cs8Y{2{Q6d zBQU6UO(dSoqa(nW`@7y}*=m2v=DZH%~LWFVpkybS-n zeLs9DVX3~&Ry58Mx*Bg{8&Hm(Je?RHcq;l+r4yIvl)uoK|5Wru4znNRf<-;%=99k& zc*>%&{fY*HX$G^+M9lQXhcJ@*v}W`e_7*dJb0FZKEwn5kpirg^1eDmod(n{)!bh0X U9WJ?#5b$Gq(cHM)&?Vx30l%j@>i_@% delta 8103 zcmb_>c|4SD7x2tj#vsdB%QBWw$WjQ&P>He(Ax(ojKRp?!wDyj^)j~0IL4n8B+(` z$daq8uVZ^vUP2OFLa0Km|A32$JpD)f8}3swSM&So-2?y5zi&}NuVd9^3UDjjjivK( zziPYha54XfALhH7fuOm8bw<4rgt5kP=*+3}G3vvShj|hcL{&0XGjbd{Ps{#@B>L2E zjvNcWzR4IK%?;E^GGJX_)&+ciY;S%U-#Os|iH1M|SH=ti>AwQ?BmU@H*;s!XbYt^1 z(Wg*UvIIN&T{BB!Z?Z0Uo>NbT+fUl~F4ng3ZKM+*v^w%_4x?M8U-7pC;gfk9A4KT> z2N{v6dqPT5!Ab{E5wBuJeNID|?i!n}YkE+d1~f!YSw+QkAS4mcb#loa%4kSK95>KC z;=9J2xiM{t3}y}q5vQXGxw&z0LD@q&sho4F9$$1}*}2a`6(B~4S|Jl8Eq|Z**hhJp zxQ62yocS$7$mou!3fv&fIu^}{kd-yUL7d94h^k{Zdg77{1w39og7|t~N;J+q2ytPn z*+5q3ZHPN{B7j_+?XE_JaJB{P{(CpxMj!l}4%ESDkZQD$0=1ze-xZ-~t;Rj*e6c{V zXW(P0fq~Oj+1x>Bk?$ha5Eih}tiTxn3Qc>gU*H!7TxI~w-R)sn96Icjz|GAGC_jr$ z{W`5R)-O8*A0E==_LrhmZpSWvd3p?gjFGA41kCJz?qwZET6-hL(VkUW*M_9+Q`Rsf zPt59zmOd-(D898U=|I=_vdMt-oeS~xzn&Zt05*>y`rPniC!A+n&4)F)Q7XmX<^+}S zqc#3rQ(xw3kDQ%a`rb;ann41+Fc`x(#(!F`k0v1X2;jMuBgV7~V<7c4e`ogCscZq) zt1Z-JAmkyT=$@!zY8lsaap0yM!62A>onbUXyW1x0`r9*)-YB$%GDs)oV6IRjZi5 z42{HH^XUlgX&WyLjXzleJjo2I=bey3hR-*rALhuXW~?sexfsYz(i*g|dGTlUIE%Zltbhi)E(q@zQQ3MCWFCIbmc6)$i<<5bKbdZ7CFaO=779|%`J@RRw? zpe?4&d4Z}5%LfW+09jM=8@7${()uBab=+_(L!F-eaviM=BSI)o@$9jtNS8|>ts!%k zaiF$NKrX}^wf6Y+)5sC4xEJp+X(YtC<5$$VQ(t#oT;Y>-xh)}QeWXX1qhCB$JY54= zXGFL&9(2dGqn6BRDRVMaX;)vUdOwe3PO^$V#~>dZW{Us-Qj5_0X?e5;+AH+ypf%N# zT4EegEOF1QG4=4RNkvv?rrPDlra#&h&PEs$2DdT2)JFPkmKU;^dP_N4e~{nGg@5~H zC*crGYx2(5K;}}TH$qO8Q0%wlm0ZX;>*RW)C->3dL8J-<+q3v&yW~^=skGPFV1>r3hoTn?kvV*vlpvRH-#Z`qW9x3k&e!}3;X1!X3#9%r zpPxAHKf%^fv?{>NUZII!?SrGY^~C4Lk@N9C9iU6x+!E ztkPMnW}M0v6XSSMk1*R;SzDZbFRbl#(Y@&qPIoWxp7=!f&!zotYUtX6f4R5H5s-4N zc!vrY9BMo!OK-Tv)Q1*aj63(N%!8D?gfui0(zLq}Oy4Z+MRA3PL04S6 z@$^|9Y3U)6A%YxhS`huvxi*}mRny%45TJ(i_hRQfJ^VWvfl?s`?tYy#b3Jambo`h- zbu9sPW*e|Cf#c_%Ne_v3ReYtr_%J#2>&{a?o%yRwDZ#_D#GzGi?@-3>%ZNXl6k;Ax zGN8$U#Xsv$0ukWnU9eO=hVnvvx(n2|lO^1`0=xf{3r9;Ce4U=<&k_U2*e1rHiD?m4 zbZ6O#P`cJEUGYARG-cX92{i%vRrD(bkOwd19CGDyvT5B_ZLx+ic|5*r#iHLIXq4X zkNsruF{&C4lFy|Ry1oe@pIWn2RN>;ce+CJCH?Y4%H9azUI))*VrRQk zNf8iOf>t!hZP`orBH}kqD{LK1liN-s&HY~P9-qLuZfmByKRKh%YK{uuKOQl?@$jI7 zjx2AAlkVieKgfxE8FOjp1->{H>i{5|m1zv6h5FeDJ6OJo(B-~w*IjGWqnHNz<>n*& z-McF>t^L~OvjCtvL;P+!?yx?7VY2z@Q{H`89offR-u(%f_(ZLMn82e2%))a-5ux;R z8)Il|lk<awMaKn-3K_z!&m+)j&1oppWpDhrwiW|xDV_IoPGb?R)1Go)CLXLJUO8;YEdon z<9LtY5=IF9c$weB8Yi`rV0hq_rgB6sqL_59>~_57UVkr$HiI(+SHeAmI}mmr zQmJ2o<0~YjFBs?UY^2akd4xN4jr5TFqEgSyJw_)AnS@zBm*$j_9P{R^9XJHX0DRxM z((u>`eYDU`8QH*ELQ4mzpr{PSGal|hWuPyNX_YYlxNqf&VPe`dDrjTg`R58c=Nsi! z+B$Ly-E$I#;_!0Ymeh=@ZVHULxw3}C3izg@6TP7!h-Bzojn33m zh2S;piZjT9x^2{1$BoH!J3xOId(eZz8O;7_48%(>2OHH`t6az`w-6Z6fd7~k)R<>H z9*UdiHA*V1JH2d=NA}96&Z8q{O%SJ*{;g(H(ON>aA(LbgiFXUJ&}x#xl^X=^?4wPo zSLyqq?6lRRQkhoWz;O>(Y9q$ME*S9Ltsw;=Z5dbI2D#h+SE-`1@GG=ic!}hHykxO0 z$3l|1Q%D(ZR3SC_w*0+UgNQr+^`Rg7SD&6iKd%Zk62O6;%rWMRV+(E!5$(S^ zwM~$O5`O|x-%K4U0%5iuzKDN0J^UNef1KViL~Yx9WTfgjNHt4kJrZKLae%y_RTR`O z9Q}5;b}!~nN59!wY5d<{ePGKz#Zt8H%%meHWdSgoB|0>hUC{qXIN_lLzlc!qU6P2c z*%x52`(o2|7j*nUx#d#wBaTto1W(6cT?5^>GO@g<8($KU#0N!OC4Y_N3@gZtlVMr|(MQ24ie8(Tzon z$gQGtl}h}B{?bYPzD-HsW4P7xWJiR0X7NU+^JH0be+ zT|NkaKaD@W=-pF7tt?t$4&{UH;;X*4xU~1Z&B1;5RYv?}3^H3#YRp!%=)`2o6h^!I zo)-2Ze;ME=e|=ZxUc7V3=QS{YNqo6mu+6#M-Gk`FJJPy#UoiMZB;Hcl%-_mNygn&Thh`8u*65oa0C@1hx!k9wkA!y zCf8keAMxy?|5~5C?xdU{DB3&U6<1RQ^alU>@u9bi;h3_qT)ht&yf{415m^_R!^AMp z5p!Jk(_L2IQNR^y=qNXi{_Wjtvm-Q^++nr%BpMk;k8@7WrO_KYRM8N$$5A#hmUpLscjgDI!t4O`&+up z_{YF45vKs862$RT|J8YpAhH*9l6d3HTU^*i`XjD06{?L%kn&zI+YMaxwmBoFI}!md zL^nNUnj1ad=V=|cHrvrpU0G0h?H2sIE;4KMaka~Xpm~=Ost($bkz0G6rQ5o5G8{hj>c?HU05|h#=CsabUS!Q{i(6_Akqk%6~T1GhZ<%v&1U`OaC+j(f{co zh+X)P(nJ4W8sPs4jRABf$ly`O)z%+9HbW!Bh{7vT`!!taIo~yHyWlnkCR$!wW>LO( zX`WV27aj_ctgNW|U=Nl|cCi}sGlEmDE+fq1H{vQ!G8aAo;0lNfuRp3Se}%{Hd$!0& zZucPS#Bekt!y8WfP3_=zOU)+uVP=Sq#Z_> z-17i9=LrYLJ^uBMAAbg z83^=bEq5qtj1RDrL`*`RxZgJ%l{1NpDwMgMy;Sxfh%Y+bV=uy2A}a5|I5S33cli%S z^GRq#LxkzBj(ufukKTyI`lvsGV7F^!;lR9i5zw4l`hvCFCKk=Nht!qhm$zShR#OAV zmF*P)$%P5QVb}fOLlZ!k*C|pc_-+~bFShKcTQ5ti45Di)Fv+9=)L=|#)#?H;hM1@e zzCp1v*4HmO`LY3d_VPvkz`4*(^@Z=CMZRBka(_1UwPY|^6LvwxF@;;67idqO_z|T| z*N58Vpffma@{A5Ae|Yx}b7k=mmq+d2lB%XKy$T6A3UN-L(73EUu*%ijO~1o|so>6z zzo%7OCwo!TO+4tY-Lx39k1X@<^Is@)cYjTkYiUU`f0Co58<($UjiM@7pUqSjg{_Ps zA|oUF1_y7b+lYA-1(d19>jT}P$&&|mIC4(72Lyk#M-5K@@ptB_Z~QTw+Cq!bV-zSd zlCT{5<#p3vkx}jM%~K49nmy$CjgMiJ>6EsSfD5b6+?s#+M1%5s;RqQ40$pOi8bj_6 z-rXYo>hQYAqC!TkJh6Z;_1(rwEI5l#Mw4|US_1xM4S#w9*`5Zq6?!@~aJ{h45jb$W zBWeUw&en%E|7cj9VD$Pn*S>{bS^ViF3fh09B1GECT@&+stb)J(at;SV1AbZyRHcry z2*_G3=IC&{`y~5!6_*t(sr|!|W&wQHD##e#5wT^COz~)h8qri5)Hqz-6Njx5VAt6zz$n2of;9fXQ`^czWmdcZ!JGx#Ss z*DcRyC?NbO$Tsz<9$S}@&I9d>dCBn-QL1Kp<>t^YccF=a5ozMDC9p=*DQf8?$t=iA zQg?`Zv7Ru}-XR%rJ+F1@hP34x$cG8w^=U1{Ed6_21L&RJ?H}^hrg|Q3<4t}(FWhE- zTikKu>!h${jaO{Wq9R5vgmrUz)Os9O_G_ImpVq@p`U?t5!NcADr1W@&bgJW*4Fy}NVTQk`GUnpf8SE`Mg^UH%31$iLp?pi9dRIMQI{j<2zO7FDp0^%?;H_2ic~W0 zL^&EaOjTfWOWFGggLxtrFosl=|LQ#3o=qD<% z4T6^KtHdq7{=MmwIQ5wQe(% zl9{z?(p9yCkJyOxLjZyGDG(Yi^gnu|!HL>H&i*=AmZ&rmYCKmRP4G?wHSQ`5F16k-!`cN-4@ zMXpk8M;w;n9;A5b*W;4Q6MLDX?mIfbs&-o&{{%n~+0(Zjr^?)Nt zn}=yU6ydzbr2=WR2Ula;?Pmowy;-3Y5V3`kUZqp|&LN$x@5bHoIm~l&3Y2g`ascLp zyYSjoGx#lH63L$XRhLqd8#X(BGH>%?WaKNE@~{uNV4&*jt^_Qu5=4 zxxoAA;i<#P@4RIm$F{M2e(ZA@ZU?|o3>Y|@B1{^$Z2xvX%IO0*rCRJroj6PRouY`B zv)?JboIq(`jOSo6aX$k-qecp^G5je{2~2^@PuSds)u}D-Gutb@%zzU$Z0N-*0aCw| zIgDN@Vq!2MAf1Vp1jbb~qPpunoCgd=TWAc&N$rUOY6;U}wlzuVba}~bo*#cpJ;5=< z3OFH<0uZ%3u-qx^Tru;AX5FR1`S>|}NDPxKy7Q-5i)UApzmsL>oC>D+tX=dDH|6sq z#e!SITzIp$>xrY-imMijXmRza9XCmScSrJr&A~Eh{Eevf2BPykFEnFunK;{XTts%> z{9b!=rXl-I6Ae&NXx-eH9R~&W?K`==FlvyyCVcb1jkn2vhMbgiQ&km!>D+-gfd2aK1Lk)# z?p8sRL$JPKO|kL4Qm5b%@2H8BCE31+Pq)cJg}4r09O86L}~SP zog2S#RS>0mS+{&~4EZ_rxJhUuRNT#lmkPl49>Z(gH@%<2N8N_RiHqg;3wO>-?R>9@ zd}kzIq1m-D3xhx(Sny3psjX9CEBc&jf&ozH3=AtT|``xzC{Fy?sXhj)Ijy2C=ec7li;)kp=1hcy;2t$;ubKO(S#D+GM{o4m?87IFxGSK4} z+9-c;)o=8QV)CT{_?mObDITR;?qi3ceN(Th?Z^qiX$IE8);#iQ)-)7N0%-T`tT{7F z-1x{hBZm|AP_T~&GZ?v?%X3`L52tRCbiuQc2cLBAW*{&-`CpvGt{(2Jbx;d51p0tK zyWnY4{}3!sIblmO=|u=k62uowj|cgEt0g4~+v8kBCl5)>1DNeN8FX^VR4*7ilRe*z za$Ww86~In3n24iUfKJtybXwPZ)LPYRB&L0@^fbcG@!6y##%fKUq&NNgTz-rF(E^eEndKH*=Y*pDl7qX6mE`<;C0zti zCGfMyo_qa__&W8<%ap>kPmWN_{q|;ByxH5u*j-;RFSL2nQL+0$H-HTb*E_>9V$mNdpxv$->|#q9y`D5n>)Sf>UgQzSbki*tKC0&ptyAo z2CW@?qEi(#Bjxnh2<6tXNdsu@l&h6zI(RRRPehcK&Bao3{PQ3YwC>{=NE2f&M+Gtg r4n(5;!2x0qhQ`%r0PBuTpfqJ-rq73)bVZF*!V40XibR`S zG!hdYCYe|%{^FS_e;*#QyR&ot{k&y8fBj-8c$gMN&mf$>R^kqB8O5q7P4c7~z`MTS zP(;k|1rlDmHGGE)X*U3S#KA!kel_YBkaymI2>6WO5M=0G{1@Gf5H0p7MVVw$+ zW(4|fJm_NreQcn{xc(6($OOPMI82ityrBl$zxC8e!DMB|3@ex{xmrm9k|7{hR9BD) z_6gXTJT($0YVQC=SQ!5elJ;r{%Ho5JE)fbx3IbBh(`aFK0F|pLJ^*+XiGUV2;~+7w zK5>!MSldFStxs$d90J<$S%W!u$7GqBvPL)p5B3(8_?9|6Yc=gzuhBU}SNQXD&;pF` zbz=RYD*$kuj()yWR8L!9TUlIlUiaMn-Cc6&vFFXN#4ntzw|P`rf+{I}I&*NI4R6niQ;f0prFLBl=Xhu2ND_?Fcy(~c`#{vK> z;!xr_2UR+tbCHt?J^>)3?KBm39Rdb(%9a6W*qO^5Bpfb!;#oi2f`Cm98sgvG|ta|*jqi1*RgwM&LP~(;<#!qZ<;Fa$Yp*rfSI!$ zW4}uwNR)(P+@`RJq3iIBN=wr<*EiRy5ZV@KU}&Z=gGR?lcZl$3R2Vb}g)p3U1vx0y zrkUTy3jgBc=EDfth|nekX3@fzNtBL{c1xanv>i2KWUVa)0M z3|UH9rdbhL>u(;I_?oDX2fv|u@YaO(t&M5;>)R&vh~-M?H*8W>7sbI#A2>GluqX4e^vF2vn`=%yF(uv-_jq~F!LsgjTR(vG zoHIZ&RNq+3_l+~wIo-Kn?eQRlrl)pc@79m}J41X!)I*^X#1iTfwG-}D&Q%drH>X0T zTBjU#p6syfY)$R@`xL+m#0!p;kV+^1&}M~Z!{*rLY5(D$YF{036K&gw>Y#7IMPO z6TxYQzJgXl<3ChXp{u$A(8zhFC8pGCW7m$1y{4qMFSaSS^R~%$ZXMen3mqemhq(r> zGH^{O`zeP#@$(-D@bqcfDqEE6tn8}n+%$9HbSd^NIFx67eK!rykQ0!@YK$yTEcYr5 z!Dp><{AwP1|MjR8{Rur&^#l2Bc0jc|{O$R@8)(ii)}5-m8o&2W%$FVyEEklc%R3I! z)+KEMY%FZfaoh&=`NEh9DP-Stm*oNuA8Mzhrs{Myv`MViqefI1QW)R*x|M%kwN)Tu zA|f|}`~q{Xe1`v<`loF%_<&{qKB*n#Gh`Kld&=>&p4fw!ha{Ke6}dcVGU+EW$t!Bi znpdFI7CcWfyxUn1I8PmAXI#YdMw$C53YZ^qo=FV|>vK=gr^F3Y%+p19zdqI99QZ(y zu%PRi(8S}$p38a~&U8&o=FN?th7HDkkNr->C$K9P=PtOE{nX0mAC;%wKRgL=!Mb}I zc{*;Rn@~+}nw|#5|IyjcVen%Vgzh|B>6+|PeYWgNwCbT_7@)o4)2+2Pt0M5e?0ynaVs-FGr!b`+AX```gf^D z(MAL3>(?`=SAy4&{hS%`{U<8|r@n{N%$~9OqooZ-)d(6EeaVXJL6&TmK}~QR{NXp* zdFRWYrvg+_EMd5`8bnh~{bW;+#r^_+o6aW|fh1$rz#G!mM$M0c-1f%8@viu~?7xU5 zb0d=j_u!d>6r<>|SFg0LN14fGRc3y{dsY8__|cKsKI@Umu6xe7rD>!XYnCn62U}77 zr{;Fk+LGCQ+wriYVC2-)+?~e$oh|rQ*_Idf#G>up9h|$y_(-|yvBY-&8BiVa5lHCMa(wo1{!o@QbS*bk{|2rZn^t;d(OOTYpa7I zjTDl(;YvQMXq5L9dM7XNz0X52nhuTC&m!}$!$Ox48^uGNGo6F;xsi=W6kG7%>tjl7 z{#c1pWRYqyZg=B(X#tlFmu_q0zldGwWk>&B`BXDZQGuxH{^?3o#&Y?ia!kQ}b=7aV zGr=eN7r7qRhSoS2tznEhtKTpEM%$AwhjZ(x)_W~JzxhubriB{sR;gC2>PGndU4*~0 z^xkqh!S9%IkNyN4@300^ z{?ebZ4oMAqchNfa_b2%o?a#=D%UY*)8XguaJ^WWF_#WCFh-Eo22 z0?DZbJUpD#9Jqr=Lm7+Zb>)o1{Sl`Bg13C%uFwBnI=?$?elfX6b(%EXRvlb<_+`ns9^uBmA2H_)7us(+&WomjJMOzp(AT4FLHqJ#CE#K~vjk zOZWpzw%!v*!aA!E3eqTGJB;hC?cy}2y0arE^ARN1R(0-@0WyBgIP4UpLYmC)eN;=oPl5xlCv<3 zY1xRAITBdZs~JRgb@vBdGCpnkV6JF;Gk!O|<($1DPokq>@NH9lFtbU$PT!}(VoM&> z3-#>i{#=Hch_BD4y_F1a8An~zUgfh@wAbnOyXMu}8i#)OuGpcODVEW+|8RNnFnCT> zJEI_B{FAK}Croq8@Zz9XXo}5q@19rOx;G2b#)G|BB9V~ zeRi0_V&~P|J&i5At^AV6_fyAPd|_)avg+0+9$g02R3ccqXW17U`~2B^D^spL>+BQH zX<{KN!RiSHg|==TeL%Yf4jWx_BITl5mOk9paY!+xkw#U{MqJdlRY21rE2*n?e&w{+ zLm}90QmK~NxGWrM1W<}#*(QH#ocA#6w}ry~jmv_LX;$}`7MpNPsvoD1>y`Gm3Z%vPY^#hUql^(bXV z8636Oy2cwEjr`BpL3#Xu7EV1qfJs~7?-xU2mIuGlx_}F@g%NhxkrkxHT^7^A)0J@& zz4vCYk6Q_9DBH~;$>1uUDq@9fb^8=Wv(5AT?rPs$JR5A>lfLB*r}3x1FQ<0m&HOnz zV5|Djus7tT%HeFYo6!bGY#cDcc*5Mt$v%Wg)r=DtPT7lYNUjd%p~8!A*E=abZ~^1K zqz$+FTE|`0+3&VsVUG4Hi|&Wi9*34A%zp6y(x?&>2vI@?qajKj0%9(ADj;dmuu@r6 z;-=9R&!hHMgcdDPoBS}@Fb@YY+*LL4=SQNi)Z8Bb#d0FV+NuI-;SsUbMV)>r+u<*& zd348)mI)DMkf1Wq7;($kVG78Q%OIq!?~p3hj5~^M?0)I3BJj64ie?rk=0=B}F9`FY5y7L0bMf1@9Zg)wvi)8i2N^YBYcR2I%A8FIzD z(e3!0Fe?s5wmGk_Y%l`-l4~ZtAql{OIBn5s3%~c+17H`1$ofZ`rcgcOWF+cpxA&GE z^QkkTq+*@Z7cBi8`wDHbl-1Wa+Bfbu@(r)0oxhZ3lU?Q$r*EP+I9}bxiZLiu_NK;$ znSO{^c8|VY)&-vEj@>&vjt!xXR6x9jW((CvZsC&%bk)JW+ zG>|!0&Kc^gb=92?VVs&kOC5T#aYf1#==_}x-$AI>E949LVqcuOx zxe*#l{GWOrr~HV@E<2}6va|O+BrOhUg@l!eK%QYp6m#4+JaCUJY$W65irBOFO3tvK z=`dKtZ~eFnOv1|+mgIOY<6rRR>e`K3?aUCB^UlaQpQseF;ly9RJM{^0(zfqv)=5Hh zFlM9QFA6t^5JM{cT7({sg&3zzprg)QvVOnkwpDS{A)vB|&L!Y0bHEdX$~ksmukOg{ zPm=<`kvXBQ-+gonGW8RT$IvVj4Q$Z);E339mi_Ng`EzWdC1$ zLYDwTfw;G6S9+by>ph(LXe1Fo-j|^aa(ZH}p_@Tolx9&la2&E*tCD;4#q-?>H$KB6 wyTF>@C6>bDCvp~-BdGQSBDzu)t@d|8{Kh4UlJ1Q%Vc`Njo%`C=ns!nD2hfPs?f?J) literal 0 HcmV?d00001 diff --git a/assets/icerabbit.png b/assets/icerabbit.png new file mode 100644 index 0000000000000000000000000000000000000000..3c8dbae58cd48e4165d2febf472477a46490949f GIT binary patch literal 6824 zcmX9@2RIzx*B)I&FChq$5GhLZwz5R88&b3=5rT-`cC}R_h#o6?5Cl;}kccHjXO)N` zx(yq3S6_Dbo8SMNXXf5{=DE+Ed*+_=zVA5`f6r8pg^8aD000&PeQk39po#$RMHuP9 zR^VeT7VK#K?ixH`1dmWgr&j>LZ*QQj`2e1`m5=o2#UD0kN<~QrK%_cH(4> z(*gL@0wuI4QfO17&9WzPJFqz=ReNje%S6(hHqv2%z&N>m`8?AfN54-n8IuxXISi?> zxxF0)$@gzWOLrGYke+1dQ*4j+uH46Z#Y$iIPAt*$+dbibP^;jZG) zU)*O{u)!VD+Y>%adFMPj87oo29Zd>Y{{SzsGXFUr4j?Bt>@{kSVQ8vQlOU~M%fTA= z!&_ORXT=AnX8ltT7#?-&pVp6I02rfE_a_)@%NJgev_I|!AI?fbx#WU!B@bcFi|Dn%l%_tEO zDAb;tR6ZdnPozibl4`}uQtPd%|Lz?C7I^6T%dFl=^v6O7xr=>fPc`r^=;03 zq{4~Czz}V*(|+bBr+x@y(eFl=62^#H&1lVfOJ-n{ol%3GwttCQ0|sNemb|G6b~CfH z50kF3tdmc7V2-aw-8ixDsmF+FYH9%pb&~F8R*J*WuJvJg$=T3Mp(%-nhX+myu&-UE z;CpXzq?|_)gqdQwH&TTtM`+5W+`_QC&uIbkU$CZ4i)A-~kLyagNU`}o#=NtiIX}{@ z?s@Imd8r?6PSaPlJx0%)zp^cOJzxIU8QcVk$F06}6J<`FH!(?tue`!0Vo5v43Mb|uIT7x15YuOkmMX=z{V<#sk z(N4gd&~5hdajON<4nqa@yy7rH6T|2WIdp(E6tJ~}p$ka9GK22Zg~nt zt*?4x8~-A^US2vTAFVldGyd`=Xa0*45>EWlkt`U0DRUzO9=!K(FkC?h=#x$7Apz!u z9kYHkKTO->oPh_ozN*wonCQ4LWR8Om>t?_JQ}m4AYxl)6sj5k>3}oJFxoMZFN~KQz zgt^P7G;#y~=Qy5`p3B21sXSJh0*A2HHVYjb*odC?Z@vpOdSc$Hq;$$R&M}nROdIi$ z4B3s?Z*C*8P;(|lI9tKL&5Od}Ep#glUY$ePQU=)tG=(Y?u|Cty4)7MS8j?n zV&DFDH2=Ow&j}ZHX?(|;)qz4L8BA5G_>`Kk7u%;yZD{OoTJX1yvTBT+LR+ICdJJK$ zm876~METbL%-%;I&4;*pcucM){iXb_e+mFQ@qX;IRGkh$99sy_RC3e6fV3t&{KG79x-yWx_?RKFE+k$nBOVNf`aE-3?2RU8TGNUw^ zz3|%eYO|9JLq2R{0{CR%jEC)Z(N)V2jZdtt4DBZ2vIJr9;f&qvIUoTN@y0AnVxZ)! zQOB<@1#iqCR(I0n{0nfzE)SAVLbdjL)`&I4-;$I&hSz_Sxo4n|^!*~8!N@_Cg~M`l z*{YxC2@s5+if=c2ZK*vbyot$J5J>g5+Y%N^%gcgLo`V314%u$)Z6M)Bp$LK#W7NCB zDs15z;+mS8K>HS~=*t)WBdF}fI5viRwzi2D_FP6FN0?^Pjbl^2I*-|~-2&w- zM`*pKC(_6$@rfOo8GVstI0!u2gGpZw2n;k_*ciUDkGir+2szsRUSpffjZkp&Jd|;& z)o|xNFN(5V4PgvCp$<~{E2XczUQ^R8vHS;WE#uTDvda3@7_ZG(xX^Wlk9pB%!QTKv z%6Q{)a-Nq85C~6=F1K(h`f8-XYf<0?CB3@-1jKb^7gHI)eM=Z%Ptw&f55Mx>_~(EZ z$T-}m2I?aDX_<%8!$9%ahrR|0egT2Bj0~Eknaadb8YgFGF=x~Z<%DEuT1&;S+TLH zX=(XKqH9j))0Lhib8GFN`!rKi4brw>Xf@gI!Be#!K744-Z@p3H;o&iUwK__qW6Asa zjBrYv2mZMnM@idbaA|KdGo35Q14p+3k`=9$?!6hUxEJS{eGfIa4Q5Glf#!*a{#s6%7kD0YS zp1uZSg1v8@?j3a}4x*~{PUH0M;YdtiEJQuD59iS!7&)%aMgDyz?6*F8r%ocVxLBub zhQeN4_u&I$l!(LnD2YABx^BTuW7zRRTNjmh1b(Hr3p9Y=E7lA2(|!GS(g$2~p3Qoq zJSuW>8S%O$S5jLldR_LsEi9hS?`soRdQ)JnPrf~&%zB}dO7v2`hiyf2AI`wc#~kbV zs3RYoZv7Ka&(D{{1t<%qhkrX|0GPXOkGVb=>g(&+UFzZ}9>4e8wQ(0B?JL*|Xz1z1 zz0JsocDT(L*A+Q1Q2S&!hhIK4j>ifW+qKj&D2=Ad8k8iG&glt)p6SbGh0<|7M%mD{6U;&*S;Y=k7h+>$)9-LT zidajz3QCnt94>MY%efG|A!!rpgXh=20%^zB!!om=)HkLmoeU<75>DpFooeTKx0LW4z?Wls~y@K)OuRQX(m3oNtw^B9JgDU&1-kWHwYtxgL|h(3LM& zdE1}wJV6MsMOrGdRgn?QO-((s=$}-_r0|z3%Jpq$FmK_^uuw%8hq(<5cvX(xYGL*8rT%#rIh)H+Q2c)I~NZltHrhLGcUvu=RfTG5I zm~yCc1l{>R;~`8SFGz%hi5kp4>ke<_QtX;Yo?@z%4-q-4E&lFSK~~K-WsHhwXoy&% z`rYKq+xz+=jlD?3DPd1?uRsGp4`LWFYsJNm7tUT(T#-(3;Y$2*``HlRDjl_QMq$e9 zgAKD=j5mloU#b{O^wy|$#j&U4SUdSG1Uq6%=xG_^F)~@>KlosOYGya1AqGifL)xZL z4&DGG8~L`gP&&cWiM^?Paa71^=-4*|obp}-Pq$!~gfV6M0^yJaT98E+!GAuLmFW&3 zMHZvGmh=;DX$MhD@}b?E;pU@fh9yptB&S0_^x0*p&ooUx>&$n+-?z{YYS6WJ! zot@2WyYp&KJcT~PSwwCN>dYomm)eO8%Y*Y5)zq*8_k75#F({X7NhA7Vja?J6_YO{H zr5t`#2o9c&7jEfpVR0`vr6nbG94^zKoa+~}Zw?*?d8wWU-hPicZ9J2emDLzO9)l7@ zg)|2406;2MAV++pa5Y+BB_ff;eQ+?ldu!x8dZAbF&Zdc*#BhtE%osvz~QmG`O1 zs)RbIkMDm`w7hfjX0)TFuGW5Jv46&GuDkXYGsV#nW8rkh%x{ zuu~!nDEyD5yW9JOPntsJG*EB6N5d|`K!--C+W)514q|NYQ%_m!bdP&Uk76eRDD?bZ z4_<4pomud_G_bu`ADsV4T!vjWRWoqKVDN{lsAj`US8&0slgzc(lyXQUA4;Qky!eUS zvj6`6;FKv&{%Jj5O!6SRs?^am>C=GCFgj;6aDDj7Yi+J?X)c=kMj87%&!_keFntGx zl!i^6y;T!vRum5Jss~RciplSQ}6fIZ4#> z^NpLIU87nzK<+g@o%Czir(jJ{XVsZP!*6}oeaHNE1IK@*Yc|p}aKfzbL`|+3IE(R& z)`X|i8^m>YjV@2}*P%$y@w=z9;a`bi?Jq^!!F-Ind(agUV!giMI=@k!H7_D2EC(T} zd-(Z%N^$dIyUe*{W^+p4h7L86q3CWeOu*3T=HY1ak85By{m%C!<+A@{)A}j>6Zd=< zhtH%wgt<_omXc~>lb=uoYF|lOm~=kM!If4rs6jWcW=7#T@n^e*VYxKw6+PAAvcaGL zz@cDwBd6#RsWH|2gLT{E*E2AuchiNeq?mxdjgkZ{_pxgxxY0xs6r<6hY11@OKq!Z zjKZM3)XRT`JqTdmxcFU1wOV44OR{0WXrF|3^~&u5_jua^WfN6FJ&6m^W2PPYGrHQ< zPjAbmPvv-gICm*AA#`ePPBJ~^jQF0nlU4BdRUTz;_4N72N$~NG1D8s$V6)tYFscjM zk$Pz7{?F|p`f($?iTSl@l?T!bCyw7FF_1;-gPq^~;N@=7x$5=-uf3ieJtX?* zqh)7mDiCtCV=;_I&F8BX8r(z=WA0D^Z;$lP@gs@1Dwuzc|Na*8)$_!r0!e6_fb>HZ zN;os0alk06E|vIWY>Mb}e6X`?%oLXjx+M7gqs(f#p@}DYpy=V}=U>Fbnd=G8!e-n$ zFQ4$qW{f@!aj$s!*#NfQ8D*C(Cib5smVH>ZQct6?_PgJ_?zV!=KnA^pJ$+qeq0nS% zPf3rvdRO)P1xi0pi|3`#t{E>q^ij9U(AQI=FKs#DU`7UCFNzxt_=|aY>?(iLt_?oc z5KfQ?wXwKvgvZj5Qgd zl&AaaW0g2&sv4zNDt-y|;1(QzhQ`(|q-FUp)lFxVE==;XbEp@zZHmA!3E{!&`yG+$ zu3lbKs|UK$8pZep9%!tVg>OfL#Ef(v|L9@45v54$)EmF7^WQW}u|N7|8tCQ&Hg5ZQ z-;ST+`mUtdp4ih9l%aY-uFZ@zm}L=P4lC>!%HHzVrD~J z-OAjjzT-1LL2@&t<0M0`ej^1P8#FG83tkK+i6fzhmST!tcFteP+1Sj2^)$>~*D-fA zSP3xTMQ$$UF6K4A{TsjM<>3)Kfs-GOyL&mF!Qlprg1BdQtNWJZdp}g#GGK|)xy{!- zdeB_7D-yTz3E}UhnwXa-*nb_NAs$S70?NiOkbL^3&2{m+^JP_4RXXr&rMzel823QlpYSrtXGoPIX|Lip5#*Nc^LO0`?%#TT)*dE(MQDv9W$y-75Bj5| z-2PU<9Yl`n(f0E)FnKY~k&n0f{Nh{19<%<**1YZTYkmbL9i2qud>0M4tgL;VgCwxB zc5(DzCz>tCxR5~uI;`cD&Y!dfOEj}H8SfVkt-g@vAc89q-|um8cfX~orj~Ihth0RO zhx9GjRjbVRd%(x;jB7moV5L@+1wf6^)D;&p#+RfuIiG(Xu+KHOKZ8@?0Kd7_9X63m zhYZo0gKJd3$94ikx=;3mGs&KBM}boKVPu4TzqT1^%74bE9R`$k>riQw6H<@B0_R(S<%=)g2A`C5-Sx zTkGN_A7D_HMRPxsL#F4GaGe00<12snq>u1|e_3MHS3NRknz;6k5@% z_+2WYw7!FlpD5%|&z`v3*x+?1rx#dA^zyPo%gNu>06V$0i*SfLNTmk(%qo~gbGIAR zUMEZ8PC}uzaFC^R*T?BZ+^<9&0l&SVq6H9MCS0IMcX(CXxNf5r$=B`03u8zFLR99y z!}+Y@%2%0+PnA6XeCW4tgL8zVg~7AxQFYV=?hR@sI5@b@XGM1?N1+M>4{nrZr2gzV zSJ{7*rJvj3bguh31d*=m=2n3Nov=u_ju&R@iOz-}|G#;-acR5}=TaVq%`YdpoJ|A^ zi5)+Oj9kegUaHH66Zfx{{)Z?am;G$;yX}v3I>y^OXZP-!=xJa&y5P z{ipI7O>B9rzmU__JP1!|6RNfcEQV93>1#h&$%yK-O6rB(lvYU?eh%@g0#yaQ8_S=B zaLLo80)}_b&}n-UV zamAV2nh{xP6cNm(xqU_@!WsXnJG(p)hT{N(tjyjtZBIc#VOc=!7Q+KbklbNzW@NBX z#F#w&41zgqcyMApagVw2pS^uPg9EC$%09E!D*7LdOGlExdGe=j;H7}l1+fX;PMldG z-RMq4YSSrL3;@!vj*N^5)wTWc;W7(JGrE)0JU|gv<3hU_mNNH&zn%aC9aHU^yADzR E2U7lycmMzZ literal 0 HcmV?d00001 diff --git a/assets/items.png b/assets/items.png index 77507b8542650e731bd1a992eee3442ea28b8666..0acec05ce3d37719c7a71a7faa7de64d0e61e010 100644 GIT binary patch delta 43564 zcmb4qWmpwo^zNLX8w8|V5hO%OfkPuD-7P2`(mjVpP#O`D5|Iw2I|QW!q(k7)9nyKu z|NQ>gnSyhkkCRACID(H00Kjwg8kKKsp9rDKoYn1w zX4zm^>@>NS&98;eFI37@v{KAXpD1aJce_6M)@}dLIGI~zmzwA-?8O_x7!n8t+J=ph^-NvWD{a}W+Iqke13vNn$wagoKE*5)f62l5J zan#Dnl0nyx@_$Of4@Z+1#Jb$*nz^Ftys9sW_=G_T1Z^rG7^M$_+24n{Iu z+zGAVta;kz65_piy)%$D}RpYJc#7$yA@wV`sI zh@+j9nAli3y%@MeMU;Y=j=ZhKV@i=HJU{jLum^nLt8RU=$YG+tg zWGs^LV|IZb&ylh=GD!nNu)**S^sN^uI|qlnl%!T50ZtLL_Lz9)TYRDkkkkumebE}X zFHL@N@18oRN(q^ytf2bWI?XO>H~(hS&Mt)rJb^epQXdBgn5RwBq$D(b_t#7_H#e{K zvs_d!mtLB|i@ko9DxYJ*V$qIOm?OqZ!uIerDT$xYU&PYrltDBuMyo56ikt!&8j3GG zQOnIMplo14q5c+0<9eo*NSF#5PF9r?o@zm|BK*L258F#id8rO^#66>!2UCNy2`SWD z@Cllg`deLu`(33bPDHpiBD#n4G&+*cN$*I`z6n2X1~O>1tzM87>jlWTm;qTRS`6cx zq9X3y%ND#Ee{^epfLb~4fZ+a%I}@-Y5+vs48Qzw+F$p@zfYZ3vF%29a9@d2206x$U zW24ogNc`!VA1!aWoh!?e^6L5_g3d&Dec=6?;qDh9{D6^o0xo%;1y0d2xkEvx#nk)r z5d)%;(_RWk)2+S6Azf=$HbR-aq9ul0t+^i)&A$PrYhUe<2owDW!VJDP_kA1M7R?n2 z{sRrOq*XTG0=-NCA9HT^b<85NYE;o`mZlC*MXsu?E%GX>Km@V_Ni z?0xW1KDiA4fw7{IM4!OPTtd_FBrx(F9OevEM|`MEB12X0F=T6IG5b03s3iZ+Dfq%F zBt*IEZWVwkFP;;X%qdv|ZL$@011WBBjZlMq9-qXG`<0}jJp_NJ^FOMVB57FjV^?05qmUkY%9I@~ee@^kZ zVHNzM_Yjo2K2_jkB$XZ4Bx22)HRUmaxc6L}=s~U}siEYbf%PE`iqZSV%PQnL!kWXi znm=@i`os&;2=&Gj)$anp`cHO+){5+coh~OsG_vfInZmwQ3H!Cfp=PFZDAf%K8$=#P z@eG*3dHGCLpd)VT^3dHIu5uS;9Yo*XUy8DI0^^NSqET@P(J$uG^SzRRr~8G+kS6Da z(YkA)Y9T?JL6>O;hLzo!>OL>A|L$yGy|ltUZ2CI&Gxl~dx40FbHk$!84MSObbE%iL zQ!d~lNzhd_eY>-v;do?nGtx3W7WeOK(;e1K;iLcNP~9}|8#rj(1i!v)`+`L>5L7;W z)qw~+b5;qK0xOD1(CVQEGnKCpyed`}8%rOY<|STad)f`^a+g59-;HocXq+tPSbu=< zH13zB61!&SJQ0#L_`wYz5Qv7Rrml&JwCkbT3F!F5W#y`bW+V_X4s|wjB4Nt7uzEk0 zjz3*!Q5UsArelB2VPj(xz9w)Cayf}scFcO;A-I#8#`^yK?M}!DLC83{iAru=?1(B< z)ACjB*RS+SQMg4F`bgGiUM>fr)YZ_Xm3gRuj?kapKg{dv>)ho;UQ2#s#fO4xq2v;IAO&nz1gQRf?f zFZ6=N@Wt8g%+-+6@2yK?$NNUV&Tq+1`%dW;2_6$Oj-Q)_E$PfJzb_Zi-O zQ?Ek=#3;x)LfT9$-l9-Y&|F^cwbYY5GRoq})v|39N-nH!O(hpqa8aB#1$?c*qh?@W z_=FLY|L*gHa2LTCTQaJOd*dWphQe$2p+u5Wic$Y-VLepUBOI;vuyS*WXKM{Q{MQhA z=rBjDyKq3DYXke+aDFF`_5iiss{AYNtY)HYKB7ia2UyB8NNg?7^CE~LKebQu!KOr0)TqL+Bs zY5@hN8^y;d$;m!X=cZYki}0J?|NbZ(n0dR)@TB!aeSQ6OTYjn60W*(f;n*>ZssSJa za9K9gZ6Ovtsc&Q@9*E6ODBZb|l`#zxY!Us$upj_Y{ zOw$wf&oxKwzc35P7?v*S7#t<+&^=F9Ex;orBs^U1A$l$_Y-3a4c^hA?g0#q)pTB6J zzi4b}zqkO&5nCzW>C0mMx{=|y?H)NpKkam|u>^w-_Ni-^MS&qqb6KC7Iy+qitwtFm zdc2w-Bf|l0=bend!fNlq(o_)0WVAhQks;alrzGD>P81%Kki1iPYPBIaB+}^^z z3=w`H066 zbopsTsabGE`Pr?+z|=}|*nZ?neWC=Y_kE~x>Nx0)2|h=}9kIoCTeqKjw^)pqe*G4@ zxH4w7kK*Owb%Y?jJSuv~qK^q&p#ZQYGpVUHIN?9{xU#tA#5#OdaHqJO?`(@l+R3g) z_1@LvKAKmzQ`)kKtrj$Xw7_(x;_>ec?;ZV@645p6ySYN01#g9s-=JTHj`q1htp^Cd zLzD!cq(k!1BEn_1rnsqNnBMPm=L*B9K&yzBC({O$u+@@vFUK~% zAG!)i_04K-zD|gcZZ8gRWXn#SsKNvuW3A8SWfGL(a2@FH_4<}-&se6-F;Y|fz>Fd3 znJRZzY-OAbc}D^w(B@WYe;-^eaY>2{*j(MJUptmmKolNdesB+tuHz900FSdEKH6|i{O_Kj^#k(FK#jp_{7T?8P4D3EQ37MH;+=7Zkl*Y&Y51*V|rQY8>DJs1Kurtgn zS6YN8oewhOfH;>QTnX;}eb-e92* zJ6BXoC16xFnUf7E@T51Ib-On|!~q_5z?$<-Uqea~JfCBhG9?BOB-=c-j~;if+&lkM ze-LdyKTA6?0jNOf=#c5@yrdsqL1;e%GWlxj!y9qm2>JDKleOhAAb0x z)Bu-PH1Lqxszpprk)+5CL&byIk85wsMPQ-`t2mlnzaTJ)gyb-pnVy`HKT{bg_ziN9 z zJ7@sjfdpr_@Ks)NB_>hC1z*>(ad5Cqiu{~z@)m3Ib_&BIQ?-YVRQ+d4!?evW%;X?H zx$ao$co5Xxztb@t-%-yZktiSZ@EMw12GoEUmA5tjSTN0C+}S2(e7Bf%B%9eNmnu_F z*Zvy1v~ZBKPxTRRb74C_XTR-YhiLBAZ+C&ULt0?uw@sHO_PuuCKK01gjrWgt2sGC$ zw{)OBwo~r}m@O1ahvW~JmlSK*qn#hJ?t?I<$2FsbGD4b?6GcB|RxaYroBcry_~ziN zDkS%%uA$`RsS~xL%v@yevn{Pt$b)B;rua}(Bj)Ve(J>3dOgv5??9Som>It~vCCfxb z!QRyu8Li@Q%K;StDFE>x`YiyL{X;2>9NFuq zdu}dW?Po^eTwF}wd=Jd;& zEXWf@9dg~l6se(NB(f*Zj0nyic@6-(qKk{xvy+et7X~NhJ2KGuS2rTH+WAT*3ICEh z=4rv;KdlqW2uQAsoAcWj8N@!!%(>@V?4co$=L~@XPf@+UpWOW0(@FzvG?$Y{nu5EO zvaK)Q?eoKpB`4@G*6fbE)vm-mdHQ*svh-g zI7hR#sCcIE_jL|&fyDeL6tJK0kDU|F^o*(91xR#u}bi`#=wp+2?5{m3NXz$7Win}>K#~>`M zSX5rC5KUTs=yYft5#{JpC@OMKOS`1w1|bC4qBYq~ zp!sE1sRi+xbsq)j(-1db7r(Xzw$94h$;-N z#6?@xf#>-@fY}f@K4BQ=@#pFS!6}Kr#RTRZ*`f{D;KV3lvUqEkm^gFn!u9_P-;(VX=;ik`z-sg<~+hiSGjj=!22G2 z4Ro7VPH^~;olOd0HRsjjuV2aObl4Sb?eQb!ARJUwcg-G-(nCkS zwN6`bHmLXRXr|D<+WFjk4@;f>(*4n=@-|5dCX4`?f23#4!v|!9xltTT%TVVW;M=nq;beN`^Wj~_ew z%_B-$OuY82aTNIoz$Dpu7bdB+Xiw4ADz9N$CBUEV(%rpQ*(BESao4n_*~ap|XVyg6 ze>k*uT9j01(|SJq+j!?uHDc*4gjTImReF0glr6NKSu$z-9H+8!(4{E0i0pzO3@E*8yf|&i zuvA=cvDzTorrtiX-YVxr(15S_(rO-kdkq7W;u(#nmhVre(rq>PAFnrf@6hPVWQ=gM zf7pmodJZa8)r%^)x{}~iKzs^%vwrCxy1BfOnmVXXO)T&G?l~%Hh3p6i?qzP4 z9p7tp46dwdGf0uP7_(4(?z%Go^lLdq0wuF(p&z;8#uO!fM2MvC-n+ zPsof$2r)7K_;|A4p;r865zo8q(1RuzX6~%wDJXcKU~_;??#^&~8b`6FoEFjLju&}O zh~OtZ?h-B2)QIKJjJ;~qMcP=ZMF~I9?3w$w#EW^S^PzA5lTZ?6T$YAn8dUSNOfSubl)9@{;N7)Z;43+<2a%IrC*spvZ zN{{3pOBbm5fs4`1%>baR^J+&`AtsIZH0D{K%h$RWw#Q?+++ zF$|G;3RMWZJIgdP3qa$$8*`p1qG;eRz8vyLDkD*1+WP@uZZ%Z^c!ilqL%|UoA9F$( z+W#vJHBX0Pg%Cm+*sj@}ie~oB=E};Chn7--b&2m~e*1(u%E}m84f!;Vi?G zHdEE7)2D;?ad=qPLQW6WPVOOx3*k}zfd?(g@1uAf9C*ZmJk{JbPMPo!Rm13f;)_!@ z2r%%uSS-h4yA*_XVRtS=*crS_C|{&1{fZ~_P^$06nT{ow`^HdK+V0EXRGDCv+_tZz zAzN;S>56EBhKEP>T`xx$^;SaoDRVmow#V$UfBK&9J=I|0O8n3c(ghY*QZ`WNR!6kn zfug^j&1yP2YG(c5=NM(fApUUOUhW1t?=pUbPtP@}gPfFnhKm(tWp{|#={F0ZOx=KB z&!VhkPmT$#9P|ll>e{5jh=$MdShm~mVch#l{|1*LR`y&7i=flw?BRTKdd@-<^-{C1 z0Oq^5lWcn^?hQU|dx3R^HpBBMMmeKb<58OJmJeg_?K|+)-Iy8M?i;sY&hzmXQy!wr zHk4!)Kp9w@asqSd!QaMekNv-m4W1iAs+N|P7VOi7^Cv$(IZoc%+fX?3k%DK2k9pvc{DhV014tkmVp3kcRlDtQP*9r ztFtTv|C|1r{uRTo6v5ZeIo$qE^KQ1KAA{y5J#-toEB6cYKVQ?^U zdpj1wZf6;WzcIze9*cPe2JE?=mS`JVu}Cjj-N2%tPjXGUwqIK%2=GZE(tncStFOdV6ymye=X_iu?2Dx>8is`r6tWX&|jY zn*x=*x3~9P?DFy}k$3dsjAo4U<4eS%fVo4n@r5XYQwKhT!h_w7UW$rIlSj3Wl`il2nWzlns)bkBB$jG`sma$ahSh4atQHt4_Ov_katCmAq=+~?JZt+lNcbMo zKT;6v>T!Dj_<^RPogH=N8OQv;7FPHL*t<0(rUezq1zY_E0Y4v4q-M4BAl#lT#nnEr zjdwoPhW2lxr`^j0W+?-hOdJg#YFS5AIzs*47`M~j@(bMLh|o}oqmyG|@~6K`-K~L( z-mZV3wG$Ki&0SsVFf3<-2XY9BOkO|=&khzPUiRPV2D`hRPyhXc0Nvf)Pq-i5rw(oy z93D;xsf&60HsUVjGeH?G|CB$sWWWc>HWyPp$>8$io2|H6zGja|$6w&yEc#{kneHU4 zqazfiZE6}9a$6+2nNa@PWSRC4C0V)z`{s_#g%t3_Q&`E{20C~s=}>EOz;=HVGX4Xo z7GMDYQ0ExJ>jIZaUS-)}2#Foyn;_la$OzX-H_U9!Ed9fE7|%?v{E4VSy~yZz-y^w4-nxKk}MY*mBw z%*!3w^~ILQ=lQU|pjO>NQJiM6IKP8->pI?jnPN^b01=V$PV`FDe z4^Bo#23BN}5*`Kg5A*|oii!%;dltzHb1G%!AVzYexwZANXI$LB*D^pztJhZZ40zCv zP;9-~e4tCSyVwpop;DXVpHQsoacgBKg?=L3d+e&{b7^g?r+0@lmSd;jGg<6& z92`ruYh)J?&I5CZmN?Sh~67{`{V{>j<6@tiez{stR`tzbgQ(*DZ>N5k2e7Bb`?Q@ zsw*zbIID_d>6{|}d`-V2h=dJhtu5rx+bhCy;Qe4>csLBVso8TK+CMNrN7*|#81e1f zqqoMeFxywJ!k7s0zl|imBfi+$>)WaEg+6J}k%yScR@|LVUG5Lvf6rSHedjY+*B-im zqv5)5QXZ0$-;9W{SuTYK%G&YRoOo(COJ}D{6&x5w^?U7Vy0IiAxP)G9vHu`!#%?k$;WYilKP+O3a(Y_)M@y?OsaN3>KYeR9At9l}q@>W6BahXz zbk6}ks+3x+gT;mhef`Li5}qh{HUf+v98?#Rkk~GOzn9LJ1g%C4jjq%a!c^VbADXni z`d@eDk`NX=FbU!dJomr;FOd3f|D|j5@tGd~mX8W7Yz@Z7PF%O0d-g(&_i3VTA2x^} z&(4+tlY6q~8AoPb;=d;o=l@?B7GC3-&x%B1PoL%+R$7>(AXzFcq=Y#h^q~}At^0EM z`+pF90k_y#U-ow8Cst&C6+9StpdvkA=TcR7@C^jWn?MBC8x1?x>+nD{S#of)rKO2J znVYK#zX+y5ZMm4B$F6TtczuPiNvc>#OZJC*5IN3|A{82$tz*)8U#=Gr6*gv>B7rKA za&|(AXJ>CNuhajq$&94CL{8yyx8A<{@R94c*}J3y_b%S^Y?Bp?&w$`lVV1Wyg)b3v z*Pv)^VHXlB%6yF10Yf7qkYH}})3;^izR=wF{{Egv{R5BwZ5tDNxGDNK*3kNGj%6jl z-;c$13=R_O>+7f9cb=ocqTj0@U@V>gB8Z2qDvt>$AQVehVi|jH%Q|VM!q+L|%X6){ z0fQS#lXo8}ld*gbPZ%~aLGS2CDw2Z?FXAlo%hRrP{u5Xz#84fqXyVEm@%&v~C?90UqUYzxLplZ1T!eYMoSdk7F>pfWZW^2O}63Bvr zg2<_;swc*NMOS}JGysUFC+;9~vWMPg{j*%osH&gPyR7-=G8d-D?X?O56|BNPy@Ow% z(J#H)L!{6hT$Ms4BZHCs=sTS4fYqz!O*2gV!`khvNJ5e2a!st6&DkN62pZOfY z!ij_Y`9qEq>h_6#{chrSJT8uHPR**T#(Md-R4B4IL;U7mS;`X>gipQkTfpNfNJ1Mg zZ7Uxoxdd(wQrltD3#+7D#utZ6KWa}|L!;W9F{=YSdXc#8-~&_&XX9JenA1~M;1RI8 z_EnXMF;n%#J4WC~z1qv~#3$J;vPWb|9n&-O?-F1g70vplz+dfs1muv6u;i$4mF7L$ zZBU|~3RGgF^uCHtzo%J0a;jBpaf#xy-N$ZJ)KJIv&B~KIBrS> zDZ?x;Ez2tpTEBOY1$XA$Jtr>U@)%^9S8CeRYx$B5+7_KZ)(T@0nr6WR@*OVSXNkHJ z4{%+7d#3QOOQ9Tdd<~k+2OIlfsP=!-MVCalF1K8ICNZ#=yYbP<@)7OXPNyx;1>zmq6 z{?9YD^*Czy7Il0KNJ2sTm(;gca#+raCtWg(>F@)&E;2@@9YBGf#nHfE4o!2-n;KQw&qZdTA5AE~M!^R) z6j@a|ay`iaWPZ801~lx&)nlX{uFU6*M%$tJsUlLG3h_iSVRpF63^CE1~4>XnOjaZII^9 z9nJ`NH!zZK!{Bgj@#FAh(jNd?LpENwRM6Jvtz{e-FYmD7AP2S-WBPekQ~FKQ^7RZ08;C(JR1-)_%KuDImI<@Yoi1xXox-oYn{# zR97e}(aNnV!(}G@S!4i29+?<@c%u~{3Z0w}TLB4xi@n;4k1X4@St&O^FPAs2RS9>=kEfXoVJZR6o<(j z8!33t^0U7#ZIvHi>^qgH{1QcIA&QlMiRjS8EUNmiucaBj4h^M!;?*3UDeB64b7IZO z#TDwBWTaUsz^>v!uy+cIcVH_0LP!sFV*|(Vbm&)~Y!W?wd3T`;zdp7YeIEX#p>JGz}p2HxUs(1d9PsT@PuuvIOS8tW6NM43*2NT2K=cbo?9yGJ1r2 z`6^_Ud?<8A2@iSl@qrPCQHnQ-crs8uewlmut?dS-LW1FMvOp=w ziXg_Y0`Me?>_YkzGZU*Uxlz$4^hZ|wunfY?k0;A4nQ^YWF_4C1F^lD?1*ZF570U|K z`WLmnc4w`7M_`SMg;~_^xPdCpM1?`Feazcq#k9V|(`2rOpe1$%cJ0OD80&qPH?xb1GcjAYgtubs@P=b&y?P@UL>k1OC2r`Wwi|!gPk!Yyse=c+ z&5Bo^BJKQBOG22O!+Lz9T0BrS!K2#otMIX$uP!HQS-xio@*&|cB~SfXA{|xO$UNSk zvSwO$?)b4|W!9+kzOyK@4e^tcal}zyNa&Bz(m=4_hSvGfn~de>d<>0{M2I^KX)?TL z_p|N+*fWe*LCCZCqy%qQI*8!QJK4^xUqz>X@6i}p5Chd`bud6uQ>9aFi(O@~;I~dr zXIxE5J@J}7;&-N~vWW*&VO`07WfwV`tlq-k7lET4&u`&MmE}D6v}N!icZ_D=Qz)uf zR3M&~vn6Q7s`|f!g|3T&Qr8x)3 zOt$3)EVUp#vF`n=h|lWr)4lios54_9v8ZY3>5z~UxO+LgGc%UX2!5SE?%!+3bN&eQ zoO3i2^Qs!s6x|`NG|oz*lZWtloy)?9K1O`_5N*==+peis*6>JE%bwy+&HF4ot$y@c zz&$8NKhXOu@nrIy``>3)QHRM_#0G2->g%OwmXSIa)3@}(ghye{51Ic`z7i(XGnkOG zwI|`Qp-_lYV#U`+=-Ozv7YbCX88SA4;Vq*_g|i)+qOj*`YVsZ)LeD>m{gX;Kr-gK6 zTc)cOf^`O?z+v1rQ3(Bo+4VuHcpkaXf@cj91IO`FIyy&w*8sBMPvG20!%1jF40{+o zj+VTRMZ1ZtMimdGwrnZsfu-B9rm2Imu(b<>`z>E$4u|q{W@?XAngO;zzA(^GpZya` zg>#+SDfRc;xE~{LQrwpkOS(bt^rN#N6gXCwNJ>I)&&I|Uzza~1;#HlfMx?djsI36a zHID$~)G+am_dmYSLcz-^W{Kha(pxOu{(ySo{g2c;Y&^99DgR{A1MYA|4e^ifEa9H% z>sqO6of5&Nkp+3*f|>g#^g$X}$n4Jj`}a8>JxV$|nf-z(1O#uZYm=qg`P0vKr3kmS z`bMa32G2QvO3B|;7y4y<9KZ!BkUyZMXWgeo&~X5P{5BD|#|GQ{vPdJrXmuZAJyDv2 zLU>=a2=>h#-T+nTpfKB+s>#vVSe_4e>ADsc?y_^hK1p6Y)_Ke;15PGZ^+NkgSUUTR zh4b!G9g|B-W0imwk0obl5Pf-E{3rjb29X~JDnW)gtZIqMhYygNcoNvZ#R6GYju#9) zt@9YN#PrZwJ~U*(Ux^cFGeVDPA_&++sjLnE9jCtR#9EylDc5~a`#{B2BMFQwEXr2QMqXK;1ZNT0JoY5Ar8Ts^N!R`JJ^cPE9ajT2 z7I6)Fc92MthD)A#t^9&Yl zZz@UA_0~N-J^xikKeG8r3?Q-RJk)n>&9TGFRmf;qV4xs81`nu#5U0)r2lwZbq^Vs3 z1tD_az~e{3&q;mOy-EYu7eVfX9ssI@a^*tc)^ zwO{D)<8M%t<)-Oe0!C3a-+tIv4&$~@mSHM8cM5Xeq^kf{vmdf`ObDu4nsV!?Xu+gs z0)HFBYt%&FTB)aJhvyN8fcCrp4I#*zZg{IOF~;pzP@Qh{rnYqX{%E4Ou_{fyvnxF=Gn9 zwkga`TZ_G3?!Jm=ddg1)4XF!0RROntA}Um-mykmDJEjbf5D;rFML}ud`F50?4^MOL z6CZ26LKE4}1f=QKowKNgo8w-u^n;was!x%kk4#HGoZZ;{{fqT8@9-pMrc@MN4IU6% zxqL>Jr{UjYrzpdxcyF$5BT8(H4}?nBWnTL?YGs57M+)Zj-v~gpaI-H*7oxr~U=D@h zSIcn%?`dgE*G0?9%kzjK2Kd1tfWF%>2Vpw4*lMBG&(QJeEUJyq%8~=Bl&@EF5ZK`81pW1r{bfyUek6u(XOwdeKgCz zKl#c9bfTc#-%`fi5*R4YSSl?JxGdy^)c^brsZ@tAXj68H{Sf`*GvWMlV@onQ(U31j2giE*8wlzB!Og_uM`69X+Ri=k(+ zI7I9Gb4}jSZ6rZ=1HEj&){I5B7qvHcj?AlS!2w_U8F2k9a~q`#=G39Rma#bvt7u5g zn)(m9!d7CsPuRLW6v@ry)pyp#TAHIzm`bE2*_iO^bhB&c$1^wYz2Lcnb}fd1*aPu| zv4w2!p;thh$JbC!v^;1VjC+q@^0+w+gTU!?pS)`H{qzr9j3qqo`?;?%3`Lspv#1ZSiZ+C4OI_SXR~qgDErR-vxXM|yJj(pbRSBYO`a#a$RY^MoZXm6J z$-nnq)%TlBC&-f-%j<%-Edx33l@t8vq~=Jqb>AmRaz6yiZZhlY`qz%ZO-uUnUyVEm zqj3>p-}RjY!f=~v-!ZAGsxGuEk=rSonq;eJss%63{v-uCRV+C1UsQ`g?+V%WCK6?5 zXHPeJZfF5GCj1o^dCg)xJdPZ|9U2%4!KdK{X2RMkP%7hJrzN9oapZ(R1PL?^6r?49bEhu_1l5iR z{h&KM22+rC0ZM+R#5(%%%yS}3vv`@E&J-@QH32ThL{i5dOY~73KCx?g!A$}8R<3OJ z&6>dd7l&4eK2zvZl8d@}*ZEi+q(y6h|Je2TP_aNLt`iJ=_Uu_vMVG9sZ0Pp2q-m`+ ztAnoCp}?qZZ7cV&6^L8?S>+= zp8EP^&YOGFq?`MeHaWoBb8;390dg9exezk+ z?oSzJtM3%Ty@27VNEp6VmcU=qin~kyF6*jNb2dDaJ5CR}byhxleffm=a>|>`(k9dH z7AD?#K8Evc{JRK~?@CR2d(IKml6XP~-HiD1UKpn#5FL7UL^k%XM>J>CIo5)uHZd`g z9BT|tZh*_m@-pe_>S{O8@o(i9*;@us)Kv(;W>46CcBj8B%vLlzPVf}}IDIPkSXf`b zoSM3Kd!Bk{vV3foMGpTWMIs)Ly!*0k?0XIbRO!3!QN*#|T{tQ8$dYWfreqIS&Q0>R zd5+`$51aUxZ}!;>kX3=6_ikF!p-NLAbE&9BIDl0l86%^+8^nzJYF9FbIpBAD58nIJ zwR;;vrLV7NG9Qi1KlFuufsrLG4?I&*vGxh@^V0$i$*6W)bP1s0q+4pxci7Z%>7X%d zoX;3%E@V6H{@B$wS&igX?=aS@Vu6W{%7hmHNl5$4_9(@2jCwe{e@#D;*1$ehEm%%N z@K24rTI!Vd@q}M!+(2ofE@%*{T>STV#M^O}vS&?lZEd3WLD`Pd%_hMFx>XlXG|kfw z;KN0ho7SuTNJ~k)Lru*lDQR}dN>4yQ@QpB%9Tx~V-@kp644}nAZZ05UtU(vg>?TU| zb%3hsYDHPuynX^7pSoV1>}o8q<>x8muO&?+rGGY>&Cfu2S>8K>t-c}`V`Dmt{~6|% zQD=YucA3}n;q&8a7S!`H4$_4{p}QR~`HjuoG3Z;@8cNn6#1AY7G%qJ7xBsBEz3FDL z8yA7>*+vZy42?GQ9(R}3)2Y2tjn{C@Gl%j+&+!dGcz+|(UetHC2W)UfE1Tf zmx&dSFQ&X_4_<#ywv>V1)ffN)`}HoyDkQ=F63n^Ux_xkj3wIkj$o|);6b5 z{()d$`%L9z=-MSkExMW_WFUlu>WJ0haK|a@W1ZgRrc*+8??`btgM_!cO^nPl$_!l4 zDcsQgVO;dPcO+0K6z;9;I^R@VFP9hd@95~Ndte|AbhsJ8PoJ75628og!V(5Oe;=pnESO&>4?pDN8?NefbFnG(_(Xz! zJZx(RF*7g(%+uaf2G)$deR!DnBQ#L;jfVg?cT5U=+|9l_hT_SChhJ54Yhqs)0+k@#E*n{@ z&aZUXwSQ6N%KfePA}E=Yg#!LZCD`2b#?9V72K@MuzSmaB4_d@si7ck0#vMTo4-G|C zS06KA=A937k_W6^Y@$Ek#8#jD8?1~jLL&IM@b;OX+pT(BK9lD^oa(te|AVcF3iN8; z<~MITOag$1Z2_m-KVxHKMbB1Fl5XXmg-*r71Ph}Hd~i-X`CVj0>524mMi_1~1d4+B z!Sb5qP$jI2okH3R$~oTe-Uh-CMXwplCqkc0&x~Rg1w*sj_aQt|pfpgwAo~oTELw`2 zOADS}A5eMXm)_agnJgX3BE+1H3%-2G6&4=OHQUlIV!Gl)02op5(ZWN3+=6zA3*VeT zFCS6Bm+bxsCo6Qs+sAh$&=J+H2?K+${VVD(vL!AmM$+tfP8zDFqFTXyofXGkJ~>xCkO&||c23tB(>F;x;eii4l7<%~25%e__b$^8?>zzkkbG26acw<@D1Fn5makq89V$2d{iZ z7h;+MFdFgc18pS-3HCAPEDiT4VN(i(?8q55(SLjMO?dpKHynxSWUFiPBCW1MCTC3n z!lbkp8p<&0E=LT`%QJ^Gu!90aMhk?gl$B-c=j9PxOW^o$^o!!o zojad%b7gLCtfW!Zot3|@VR{@av)2iAHLGw;;W_1ylK2O0l?#ajknA2DRWxg(ZoZF) z^XJr>hpl7TGF{{Ehnu&mEYlLAKX>=H7<}i;!$i1H!IkQXszrAA9TR@h^@~3$a;2w* zMS$-;h%Sw7qIwNW9ZsObWh@=&V#`GH{XHui!`37k7?4(VE;?&7(Q(ToMQ2#;#o|8v zNc~R!#yT@H%yN(xJRo9)K4Kxj*H~yJAR;46hr{8|tjBQA{1jiFI%O_(7VC~sU`kgZ zshsYt?Ci^A5V zht0K1GL?mNsLbmS{_KSjwDa8g+8LGQjY`_EKwrJ22&DUniA+ ze!4RkZwQ9M$j3Mj0iT+OR^bREZh}L`u~%{%86*A+^p9|D|2uTzfZAV?gh5vYHI4O zOBXVylm^>qh^6J@M>do-Q?t`q|32f^9({Cw&9J9NPSfkNhUpo(!CTTc_t0REdH( zxxB<$7`}BclV=^R2^JK5WD^wh>INa{{ns^^9X4BYqV|YRfZvqI6IugBK{1(}K=7Lv zV+^Xe|Ge=;aE0#&76{$X?Z7zG>1E~T;3JT*bjivoqD8KRdQnqU4NWonVN0#=!t%51;0cbg5ri=o=O5x` zGv@qqm31@@02juA_P!#9wJoWtwWeYG&s}NRw1G(QuukUC$1Iq zfZYm)nf{n`f9v!g@6g*NRtPStu$|28@)r!o_|%6OOSAmCZ|?ZWQDw9JIkdIigOfvK zof0z@+IW(lw;Gi}i*J6ta2Mi^rHHGUY3ay#O?5B4ygDv+d5()J*O;U({rWSoI}`pEj*8 z3B&4Y-Rr;me;21V7qztke|PZeR#?z+N5HQFrl0JLwakS0nhyB*>Qs~7Qe=tgTB0zw z17A`cW=iPRK0Y1Rq(8GCxEHGb--1+FSZX=FgaL3wo|YN$JgKW)5gI<(lsNOoV-psl z!^R=oK$u;7*$xjmJryMhqJ|nh?aw~h-zu3lneKlQYk72{GPl-+0-SpmUQK}gOUzvc-V}8z-|e>dD`Zob z^->W+5Gr1Vel62Pym^+@1o_CZypk&G8K(j=!F%?AM2cp;9Nw$y%Hw+1YPOLSw#;C{ zvuPs<^k0tVJ3QC2Avib?M61j52eMKxuNuayD9T)#y~rBM{doE#vZM)v-cTpson#qW zGK2w;h3!0*9)hi}L-NV-5E7S`s@Ww>fK-CV=MU#rKHI72>&3CFlBLB?vJ7Z`j&^g1 ztrY|l@q?aNr9Ws5u^?Z&g}VAQ=qNkS98NZ1(56poGp5(iO3HTGjAOPVdw0@d%30Vf zPSzgJ{vpLmo&x1lfFc466v?oP3&4A+jHcky$|eVY`v^1O9Ca*`#5P0ROcpWxJ?JF8fLmP0GCGt5K@&H!L1!0+89ny5Cv>DOh32cq z$;CLWC)pzt-Zhtwfu4Mo(ZsAQsBAXT$;J0<7|b&WwV?g*F(*N4=gWM`=f~aE`x2AS+>Kd@ z%1`CxFXkU5wkg$m3qQiRMWgQzVaB*PqZyuz%%G~^*fQHqJY}0{w%TI;l(qDgrHCC4 zdtu8%S_JK~4lF~60cFT{(~%E4ll96c$)}P%eI`hP%5gpoBgJ1V-ttdy^5|&g0dr<0 zW4#STf`Wlp=bxWGHH_X9*?)F+A2KuhgpZ{YJZ@P8VCeNjsr12C;6VlOlk7M4 ziYqMhE(t+P+34GNCkKr*##F9lXN%Y`+ULUCvVH`~w?f~|&H2cKVU#vD{`%S=EF z=Dt;QV<~ETXR$i4{KyHUV~yl&2+un?lfdZ4#Si!SFme4N$_|FPpJe!Z->Rjvv@3L@ zV(VlEo;C!n-Tl}#X%5?K~0 ziGO_Y1fX2gG?dTgia1AzQv4mb$g=Zd@4$qa!j1{T~|?bjvY8@(U1Vu!9-C?nI61t+2& zsh<{AMCo_rVwMdzLr#vL`8Bj3ET(&S(9xNE6Kh_C%jr^^2;22`mfs_}^TvuO)ej^eqoy>c zr}gd0P$cge`2)4`|7VjW#Q)4t+I$(B`fG(r;;mUiLcDsBM!b)9C=2#Us*hTJz^diT zU6ybP&WVB3^*v_|xN`4!U1T%OviH z(qTA-egrbJU#o#sS7q#mn2(s`R%V9jKL>Z$sFOQ>%}jZO_jQsDrCsV~hrHgJDEt}; zaj##yv7!|5qgEEkFVC*@{oT{r^`h6LRU`3KhMaSpfnia%6sc}MT+!IrNDIXD`ktmc zG$EK%rAe&8C)~V=#agu0UHDuqc$$!oOEF$AKnz-I!L_bOK5`jftX+IJO9J{33*Cdv z!6k7q#R;soM&dN5a-6b!V_3E(+zbWleFu65do@}as_V)$d;6Gdh&KSWf+d>yQ+?Vp z@fgI#YE+-7!!=qTN|Kyz43nC2sF$0AlToq)^WXv81U&8f)-H`Xj|x6J_moau>B-z% z3g}{D!~O)4U*?*&DBArzekbNgm6t+;H?!sMJj<}=slr1~jO2L#Jyy8+&|~E=MbtzP z%EJ}6Apq=c=Vi|1m^6^qmBIQpjT*P9vV>E>tWJ zQ8kEPi{1zrDp&YFX77PY#CAW)jGxqX!@jf=y*9Ji_~I#YuWakzl^iG2@Oh|t=+hG5 za{?zZUGk%h>DHJv)CVRk$GztwF{fbeFXla{o<|5?5(JhCZjvtW`SQ07rbRw*bK2^Q zjj3J2xyQSHl$Ck9=V9Y9zTu}WbqA^W@bvRz#~u5~vFt*#_mMK(A5QE85bUscgh8Ms()pXL zYwD+a@dsIT_~-7=F z{GNDLOGke&xX;E@YpvF7ofy%T;?Pv%n;Dsb%LF)-oBfEco{JjbiyB* zmo%0n=Aw~j|>Qu0ON6p1+Q`ffvMD$ zbxh~92fGflxg}~EUu*yVjSRiR_i)QGkuKr*M*%`isKwuwwhsKh7DVowMcFgKr>w|- zCL2$vl!fo}?5X*F9Kqj56v8PrN`J5VIY49YM?lP<=6}rQ_+n*x_nM_W3h)~f*A_UP z`m|(1>mJwCEUqt(&;ytebZ)O`r9DFLxu5&ZwPU3z9}12P#K9GU=!az5O+eN9%`Hk^ zHMW^Yx8B5LrSv{=|#M@a@*zx@Qs$z7kQa&@-;aAvz~#CMNTCbWIEF2Hq&M|%*D;O0RoQ!e*}pGo1> z`Vt5@+r_#M-kK7+qfyQ{*YK>Kl#Ar*p~NB&%&mtpS2O)9r#t`gakZKcDQ4y~K5{58 zf_e5wcoINC`*aL!H?h9==J#^Crw2H1xYgMI3+ePAqa>^0cq>vCgOkIfYJU}@3OlQ@ z2LoT+K6ooM{IXwV@He6ashtfuDO-(I>b z`~QQ%-ZzsNGKfs8Trv~*eM*<-@wQ?|%5p!IjNFXffmqq`>7q_@fi|HAln%RwbNMA9 zljOOlQCl6=a980hB64#O%T%@>4Dgzn)5K~Q2CAdX!m`3kKaw{y!z;`(lr63uUcBh| z+{%QI1a|eggoVphc=JCgTD5MQhudFyYFhl(vS-Y+>u$VKUI7(R+Nt<}wa$Z<;#~p} ze$RVvx(0aTHb+$(qk4GQ+*4@Z~4Wv1bnGx z9aO;X`~ahb+d}O?UhsQf2fh~)qNQc=+P$}BFGWnJ)SxqsoxxUzvMUK>jGF#1UvwR+ z%BFs8vT*=9zC0bMg!P8`fUEyf`H((aGq6#-``lHe`mce@T0=IOD_kw{KDK}GSuFih4+-pJ*E{)Iu}2|)?5&JdC~Yq)Bf)`(4B2QLj0&7@@loIhD4<<#_3J#AgBSs~G~ zDSdn8K|yhWD+2+%u;$IV(}yM$RzK=bezjM4#dU5;_l`jZ(JEJ8N{2(`vTJHOIv-w4&|~2q!fp$z^z}Se*B>A6Cp@U zQVGYX6uyL46ihli@*+qSIs}e-4J6J2zkM8KzWU#t$7IIck1BO{GN}*YAM(Mm(-KIjwa*An`?q;SY1{XV%CgIhg>>r~;aBl)CTf zW4PvkP$eciz?0f4GEY>IS?!zL?9NrtXzs>^P>GjKl*aP)r8Jigu^#W;?+mAtoPyL7+m*$W(3GG4{q7=7YKyKnXF*}uQIV~BQ( zblw(Rr9?&_1`c5Uf`_03?xAa$SIeG~r|97Ne*se1YA~`I-}Q&h$3t=c-zs?(UTtt-JV_ ziasZZoYSRg8QLYPL~ZeWMd+cF8_yF+tV*uj`Vy)GY;cJl9Nx9iIu3RDOdxhypUSWH zvS!HOd=6w?{8WL(K)C3GpYLw)2DjLB67I)Puy$=;rZ&)bj#nz!&1Vp1kdQTQW=>9= zfTH3x%_Qz~!>io{m3Gt_-YfttQMq2;?KS1!`kJYs+c`Iuv-$MkJfrf@P>)aQDt+4B z%XRNDcMWo&;otn9%ZF8VO~Lm!=D_ZeM;6y}-6MZmG*SpO_~3k@Z8MIxis1(-2_Vr?7#A-W?_lBV<`tRx6FS`3Hkdv+^&ukEwKo3K5YaRpkleeGdV@ew#DtDREs z;T(ysGj^#!*Nr$Xj1fY#+0NF$1>4!ihRq>masaZN;l_2V{ZrwMB%6xj^H07c7Oyy| zDu%#cX}AA0H_L<^^zr|Jq!q*$8eT1FY$V=PE8gGVe_Ct*X5yem??iKBEjuYGVv0Yw zm}W7n_^1)0U2*@Ae)V|#3Y6HqS!aGe?m>JX^X}*{*X~o@{o@ZY>}TrVoH`j=wF_r* zhjki#k1!hB=RRK+y;OdU$4sd$rWPgOA9%ltORFZoX=A8hyz> z*~0C10Co_U;SuPbLyEkZ%|>5EgQ=A)8L!CxysJ!>T$(vGgj>K}zDelG9kV*lUx zy+;sn^hT@&^TNMZprugnu=<}Lf&-rt4h>(`uiDwuH$<|Kh-pO5jg8T(tE*Sn)Qo(~ zNl!1?=b8yPRyGCiN9BG?C{UBb1Lp33&&TzQp_tWTeKgj;T&{0=5S?~Ywz~5yPwoE% z(6&yH_5xXIsM)}P)l9*qGCAjCl4O4WC#>=EEy2;UCtDq!AZp$SZyWHmC-n7r_)-Sl zOHQ=S`7-=)>B|T>n9!u=^yK#E*0sugY@_Qm_ds8tN=S(O!QtWl_VhhA8BgVJ?tkSr z>Kuj=lanKBYsE`H0CrS7{yIj6hSp9_Zy*j=b91xu?8$kZuw;KihP=_AD~0=P3T)9o zb-vtazq-uL0C_%Tul)Oj_v*-#{u|OEmL}Pu_Qg^A`+-&^I85uYlcJaQq0O2H0KEQ= zqvs66z!b4)JekJI?z-j&^6!eeUwXPu=&-Ky3$7f7kJDkPu(z(*1#7-cIbX3sM!(0K z|I5#^^v59C6P8&pxAkZ0SQaYn3aH*ZC;RF=OIn@_B7tD!K`V)wF@p5Vof&V_!W5j@ z(1w&ZrpJq972e6vb2cLQU4lp0)VQp^A?Yj`UmhE9zA7w4gKHW8H77Skc@iR66!$tE(bmjL26wiUbN}qpj zH9k(x9l&+>a`WjKy&Hy%`as>n&;YiRWvFmjSa_#E?KC{#V}nM z(QY|c4q6A=E}neG9qhnpv%45Vbbb(IZrFS40iS7iRJIn%lI7AzG_#X+3Zb<^;x_I2?YDYP6r z@+s#H5o|;KoFQ2VIFtQbmkZ0cik?bs2KKMj>K~Ues)gr(ioUM zyo8>XkKZflhX_jPzyTMq)l8di^l)){Dp&UA-Ce%x)=RU(+cXa%aaudPeQgDnf2>4T zxh}f60n`Nq@m7ELDmmn)$_|ww>w!yr@jSFrX6*T~${LnYhW#0)pS%;JB|{rtHa(DY zgZG?yL34C;X@A+7oPOog`cask%+zz6i?3}-p~3tcAI+lz=+E&%V7M=DQxz+4Kw?{% z3!f>sh=jeq`7TAiqV#ZEZ`Tqw(){i%i$0#x6?r65NiUEz8w_XcnNQw@f)uhS(~#A3 zV~XhmhomdBTqOv`;xMS0Ci0B?>T(ZRV@n|U>e|(&}y0+#$j~gRd z(Bjb8P4f!30&Q&LHR%7=CUjG$Nt)y|dNlGB))`BWfD!-09+S&;b0hU(7p zVt7>c#WpG6V$^IOcNN%-b6pGU*#_EK%3 zq^pfE;FJ4j zXX*q>Ui##rT_Q^x}O>e}eL4DrZd7gZr;ZNb&>FJw-f?7+h>+6mrLsxo6L?BdC|0wAa zlXc2jpf~xr{&ZG&IlLZRpliF(MaP}Dlz}j4>yql{x_UeF=zQ&urNTF{2ZuLlCB5x-HAdV{`XtXdVVhg3hBpN*IK{%kqum&{z<$fsA`V2DXP6PrKIVg z?-d-5B!R7mmgge#U#l=vI^NBq+&c9L8CfA*77QI0@R2BX5E-d_CG%3Ko3xB@%o&s? zMT|NUDEHyu9m^vfBTVb7(K$DkAdN`%3TpM2#1#=sDL6krzlgp25)xk@x3q?o`txCq zfAvV=J?*N|V`5f?JQpEdnCsetJ6M?d&Y}Z40;j68YUlLUNIaUSD&nXe2pmLl?#7=K_ zVhlAxAM;S)zSY+c0uHjNX8&GjhY#N{kl#Og$;Q$^d`NoRz(hERQWXl;d{W880aDvLR$Bgsn=tPlzVXR@RI<#2nYm936TRG(p2+sKPrqV9R}FS z3e{@GDc)$Iu949S;7l-x3^}KT__vVIl^V3|+CSU3%NasWRFJv4xk2F2*BLV({%55- zkr~;qm=)>1dps;@mx-WO&N{`FFEw}yE&5^foc4Bo@2Qrwroj+L=piK?IjO_z*Y5Z7 zP4bl9+zO9qRkiQ^1-RrlzdblPYLD1d1vsX>4o2+Tr2x(Za3k6v=Sfcj6Y?Jwkm!{J z=o}br`9`5!g(uIq_fYRyb^H}OIE}LMjTVi}cMk|Y7FXfPzQF(UUH6RC`(MdK77%5& zN2&YaW7?a)!KE-Y^Z2sGO{dsmHk(oQ8)@k_|278J5n70F5?XTbVaSVC^wte}deroE z=FR_?y(2>qprC-Uyhw)F%xZ`eNx$aG9{=I|l5vD$zsoN;)gz0K@ILLgN3_WZJESA$ z&&;iJ7@|$#6Ixzg9<$s>r}DzW+&nQOgIG^b?-qG8?LM%p`;qIQkE|`X2t{pO_9qKG z`rm`tVbr1()E#e!jI2sJZz4&)Ur@1cw-&@h`4_PB%;!pg2dh}#eA)Nq=5qh_kLBBA zY-DDvFoxEkcqP60KlkwSlR*6NH~56kx6XM@Z|AnmhSu)SbTfT^ zsD!#O7!;fKBUaqsHySU;BcMYligE$QG~JjZFPpOKvgJ=dVCEHU^kbV`q`!V`HWGZy z0dv?5?|J>dSsIIDo0^*9;*V9L^qBJzxCiwuxBNw7Os?ok9^aSATSJzVEuVay#|9#Y zGN@5BsG&*l@7E!Z{En(U?~)ftAIX&~GVSu?J9_-*5Pw=DYb`H3I z0`eKG!W93#<5)L?eI!n?c1Uwx+h2v@&p>D5sqv7_eI(;Fn4!}qC`7*K*TcDExypTB zE^$;|8E%tJ5JD+`B^1Utx*KlrYV+AfU{EW+Sr#7EiF+3_PQZo4M=L;x3bgjrzbN)g z!UtGrlr-yltN2v^El{vZVWb|8^OH;g5+a1}`|D6t zn05XUp(?(sVlwqz{*@o-_fnehk2Zko!XtJ^`D3dd?Ol1yd|$&MUFaMcP?Qv7_P9mq za~yJu5)0K1z(o9jAJNjzswB#qdeuz^C%P%Ps=qzBw_p69PM=d|;Z7g%9{oi6@8uc~ zF~!O@$+&oj_KW-d>v}_&TJo!=y~J{b_2T|@ItmK=1NLnyBJgHw9gd0^0mJ=D7p?JH z(RK<|Hac-ss@&nYSs{w)j$3I7%tN_t!oYrE3wao zL}^K{&&~qATDF-Pa$*aQ3-gBt-TvT;ZLqXqVsilU}!!c6Q zGL@e!-m_Q(McPA1rA708=+;s{hap6|OoH+dHzNKf;V{kgW)y>?lzq{X7-(}q* ziTL?)p>f9X#H~Ci-Q&;pWxVdkP^-NI@hOj#j`sN#@6R@NgA!xkv3|)7tW8;8S8o6R zW&M{#QQgRFv{kCvEhpl$)7`(q)3q<&EmI(rp5`5ZlYCM_=u>w=wQU_~3UxYKS}%EC z-sNUSRcr9Qu##PanAA*s;!ZKP3qPlog1o)Jc4WVMFdh2{i(ysbDw*Y>^cRXV5SU$16>S}8r>|)&*y>w zhFn}+Xc@p~;}3z8Q|mxN0;ha{CmVv!74yp)ITEDCye#(j^;2cS!}*Dt7l|FM(h7wP zS6(eQInnFP=@{|otNRf!>w|A}Nl%hNY;ifI#uxcmExItSIW62``q2ui5V$ zmyIW#v)gh~y=fqkpoN0D`BxasV1cwMgNCIE2 zzplf|YDo0RUaj&54%KA$1hueVG_HBI;bK`mY?9sZEJ)-x$AFL^MoCCOO$|g@Sz#C* z+|mZER8y%^`*>CRt9QP2X|P~)Zkhx?Ek)qgs(yIZ;=8J{kf8&Vl@Z$Kx>-^iS3@;c z*_>&AqMnD_0E2aDav}la9RdO!gYA09iHN{l^L$ex#TzuG!Pj;?_pfNs?nA-ei%#cq z3dlYTU8%e&f8wKu*;s8YAJA2_QH%BL*TgMUNTAD0hx2bYtinskYUIw0l93vtt4d<` zt&nEi&8_4otQLLp_SC+S-OV?xJkPV8rq-KdAM75VrUeL4q*{d_nzxN(>$L4C?8mB?=^YLjL+W3r@p?l6eO0Re{E-T;yB+b z>mH&So=3pgfg1R>{mzAq%s~H{AbzVEgJ#E15x+o7xJ@}D_bMYiOt7mjng4^hH6$1% z6PHKU56Bx6DFKjA0E>%@OOAV-92|F+EvM%>0V&AlP;`XEk&@3U@5t*Nd%bLQdQMg$ z8qEXr{pDPT`|nJa3&KARHO57 z3y^`&?KI?cLZS+gqBx$CZlcvb#Q>6ueZ?Ub5Y%_{ytGjMP(gPE5N3t0bk{1A13)iPwk`kdW$ zn~~Vi8pr3pynGxL8+*^1l9aTN#G38)@v|-0rR-}*>4Up2Ulja!@(5+C=~*Y8+mApq zD^kfsva$;6@XS*-ma`){PhEmJ3e2@oH(Y59CE7cM=A8asq%nPuCIR_Rc!(g(Wc@g` za;rQtFYWko@Hy`O%v1DG^h-LI9NjN1C@UH%4QIK3#r>D%j{%lWv69s%2!gQ3T;~@T z+Lb!4#f8XKJmJSY+}v<}9j?sJpY*_bLfVv?py{Hksrs*sPTE7F_42G|65)<8;i{3l zIA+VP9YTJGaF0KmU6`-2m#i;Nonk@nqh#=I|5Zu zuWR0;7)WGfeSZ3HL7)BSYR47+(N0y%6*>%FI@0i@>GC9@Bi?1KbT;&|2SiiM+#03f zH=vR7Z#5MYSw49N|W2OCc#tusa3%RZr8oKheGLipU1Ae!>uwQ>L)Dp8y?XXe6T#d zK}NES)3ryhv)*a6Shf6bH~5}icv>E?^uMV6mo#}$h9!U#Ix!Za$r1)A(-;Fyn-WLP|J`&~uUZN}m8h;Jg2 zRdAvk2_HWH?EaVewNm)7Je&Kqs|7ITt5flFx@EF*{KZ-DN%6!6ALzEd<1#rh_$lo| zDFss>5~p;yPIsFGrQ4rw^jF7y3>L;fJNzlp=L5nlFjO9Q>xHe!r;tGjS7W%@WT>0h zOnD*ZbB#*XV?r}6L&~~-G1ITgLm4qK91%9a; zdx25QIfeMH$$W_dpc++ywyj8lICXZL1*K~?f%Y|((R~4WEZ~X0c6rk~p+57wPlEt! z7U%x&z5}FB6cmv+ z`n%n&Ar`EF2mAoy{liJiWf%}qda(85gVSV2t+$iPX3#c7Il3%}_4d`4H`ONoAL^A6 zYP)bNg-$9DDwjdN*yR%Wu!V0#UlLAD`C;L>J+_(e;Q31W{V?o)PYZxqNw?YsfD@^< zN|Cy{+$F#%JcRYHJqi$i(;wbzSK*W$1Tx4h{j%@$)H@tTnX|KK#iU*C) z5`AmYf~{{|!IZNhlcf}ezqg#U8Xq$+GjaPu6&^Q!6L)!-(iQ_QtPWe3z=q~mXG(Y@ z{1xzV{*S&=UQ25O6e&X#f>nE6IUY;bxXFt4oy!Fp6po1mjVpqwtOuSAmR8`bpq>nT zu;mJQV5jMjPi@y)J|?cMHzh53eMux-fq@5+>KlXJE{fmoH}(16>gQM}C0@r=Q$Huu_w zut7C^di%Eh;Dokr`oxR2*2nL{$EFN&h=A^`v6t0it4Lx5Q~0jTDEEC+8MAP9ptmCVe($&1Y`EgSv1 z@dWz9k)Z-@oei(c4En3TxD;%}V3i9<5p-B+7zXugt5R7Tp+`^POZzKxE6;nfH=5DQ zy*=jq)hc^RjhqeMph-r5SOiy>8Ap`dnUe=-=9bg87oV(bD`i9$p8o6;#z$&oik}_} zUTg79vP!#uoz$^1G*pcw)*eRiYEk2N#GT{x0>a$TdF`iVkEg3B!(iH6$_c?_H%PBJ z9ZnX`RzxR(#cAv;%d7Et6oWq&EVr?Bej}UhJfjm*B6b|En(?%F_DS=_+Vth6$WBQCsZT(_v2PA( zxCmTp%CU^c?Q$AzN+dI>c+(QMIbPn?!wEk6bBQkiNFkJ|@ih`S2Da~qe%o~*^DHbH zZ`2!4S0jL6dh}AU(({vqVHVof5U*)#Td-x^ZBXBC8{+EfaYC#OYFhon>yLZg9X}m6 zmPu^$A5fpc00K^!A87DEAM+u-nh{11@?W-mLcYa{2G?`mgIIGmdheG)VqayPKWBZK zc}I1kZSeos4F64{-=s_52ALa}@`U&OHB31WBJe%}Kj_0(H(U$3&o`)*Lpk;H8L$$= ztc3t^1gg}a$a8Z{u=_HBMN&H&g7EBDSw+JU#}2G`R5VThR~s z__zjo;lV>bS`z3IH_@~66bN(@B0Kw0b1=e+2x`3;Lr0C(n3M z&Hp!X=o%Sx>(;G#Awj_o9bUtq-!&1s{9UL(W-~IQFppD?;y4T8A zY&YMqCtVZEf(Jx~yf00~IcE+>XFK`#I$A|fyy1C-O2JpUPOl=kJTH!%G?<4AV6l^& z11Hxa7(4ZPc^~MPqQ;Ifvs!u(Vs93o@?DVp?Dj>56Sw;r_>>la*lWHqup_B2E3wtE zp%UT%*U@yO`K8eQ$nD=7HW4}gLQc^g(&AJk%ED(AU%#R^Hl}rS{^@;%hp=FrFV_>5 zbqYO2(n-;W*K!O1h2OCl3UWl{6~K7sSIe(dt{WnknduU%jQwW)*4Jw6%B1qCL#ncL z-V=zyei|?^z+sy`aBseCbSTg0u;u?z`#|hw{GQA0Sap5_3C_ZoS*H=K(wfGmc0aSJ z0TjQmA^?!*wGuUskC7{=U7q|bV3pSQTq1OuY!dBQIbM*!XeD*6j})m;<3G-k6Lse0S8rrq z9kSeHeCHcs^_tc(-)+XXiL~xJt4FbxwIeGJxszM-zO8C}Vz%-SL@|csFvg>=Af=Mu z8v2R!+4Bp#q5~d=vnA>TKB*noF72$gd_Xh}s$iWUqx2D$q>>jIu}V<0L@X{J%~x~M($4K(;(zR=5m>B6R%o{vQW65_Tf zE5`@AcNJou*P>Id2ng;gOW7sDR34P&`iO5K2!9tKZ&7(Ax!D?|ym% z!4s_XjgLw2m7dy7i~xIe^_*+p^ozowq&^`f zN&*S>wmB;jlILs2s}mRSzA0eKHN9~*{zh4Vq`FNJ49?*v%7+IqGRIjixo8dB014PN zJmkd1H5zSQsHlz3gDbI95~p5mXFye?5Z?SJ*L4dWapa#hxQZg`9K3FGp0)e{I;Dxj z#xwHRDThf_Vk@+7ClB{2bFZdphvg?2!Z60L_bDCM^|Lpw#_F&<&vNsgky5}mjjotA zsfocSc+c_~r*|Nv^!v?G`0l`S+j?Zl;NFS9B##3qPVCet`s(5(E%&{Cl1l3Ti_((H z{IJ076f;%opU5x3-vs<;(d1DP9b#=l> zAcS9oyGvbC5-lX&P!Ts313_8(h>}#l8k}9Me!Nn`|1OeAn)_Iao_-5+@N4}7UjC z-e8r3-+VItTS-aVkrG959z}k_J3CuWv5(crD%5zHLf4%6;NMGHjbo<*FOl02Ebn9^ zOUw7g)^=lhx@i?uIa@FUhhU{TAZ!3}?0hz=kJ&1~_X%&}1Qn2vCH42(FE`O8IJ%Gc z5xJQ+i!E9R&o(gWT*Pm*6_ta-9;MP)fd?Q{RAxm9{AWtLC-;vTf$GFI-=X?`1dLY zP0ilhlo%JRYe9roFHiR0zfa3}H7YW0>QBykT!Lto_C6xa;5D<+-j4ryd@Hf--9Ac+ zYpSPu*t);f1jnU(^KD2Ws!jG9tcMvcD5b?jZ|x9yR_Vwt@vw+R?9QF{9}23hj5;4W zynHF%qja&(Q&0@vjcmBS1easIubujoD$=EJwwd_H+pz<7dvy~-?VTI5_nsZOS6Gn$ z4RN5b=JY?zkwk1MoR1+tjCKErIF(cX^y%!j_&Z_PLpbKf$BU7FAqz2ZMm$t1yIRI@ z5PI(2qgZY=Urcad;65B%g}mnWO+=9cQx{*irGt7R{8qu^n-KtePiHg$9vW+{wQ(W&4Y zw0{RWFYsCp5MfdqPq=LKDKUOsk~w%Mrze3k4=SW=$5}f&N1P={{e~f=+-4l(?4&X1 z$0U@ALJDkEk3RCO=o59QqVyuKFP>zRte1ZS2e>0~Y$PHYa~rxCmQTEq_i*KCX#z2c zAn7}2gQ}%_BKR76*CluMkQb`vyxq+Y|EaP`qyZ*|_yw?Q2fGW+L!EwKODm)LzJ9(Ht4CjH7hPm7jwS(`TG7q0WnLNhz2RPodm9w zEuKgCT^5nmUT0lt4AgTAd@#*_FsKB6KUh^V%%ECOd~6hSKJ+-viS6G^55e_8KMTbk z6)-qBC{Xnk1}vwiEKO%98s6OF*}1YRURFzc4!iH-O;4X5Zh|j#Q#os*f+jB!XlFx> z2^v*=C<= z|NaocaK7Xa)lh?s&qg=X^oOoZ^*r-?44jQj|55neHUW1c{1hOdXM}sq5FDDLyhe4e zMq%xIBXDw7%9un9X{3FTmj+UQC_*X8Y~g1QDMdAFUV9uL5XDU6p=^%Xfae$f?JW#c zmt(p`PYW;q1{a-7_laZWy3OgZNy01#O331Dn1AgY{ov}{LZ*ncy7$Tv=3L;04`=-t z#J(|LnHowqfcqqvFc2hK=_8~np5Mz0$0M{xBVZYFFGvpqsr$}}z=5;vvh600+&hjo zhLNk3zDO?FDsrvV81l0~V+7$DjO$vR<`#upY~+nx5*U&RMY}=-v50q=7#O0V+kVZP zJqwBs*e;r%l93E+BVZTU<&q@hXYcRu<#XdYJpfoJ?DZgmA}kFaV0A^7-DPRBGxOl4 zB9j0AS7%GM$DnOhHFp2rk9z8eZ<7xlbWW>(pTB>N{X?F4$PP_oPSf_SfcX9ar>I6s zJ{gQnKxitkwDYML=LAe;8W5aFiJrA#&y`+%K%HaNW>QcDd?dqYB#N8hX5%^?)oN!` z!jL1{d$-6N<}4-iuYmWNd;iAOv=G-b_qQE15ieV5K|F*{U+|wj2mh3lV{bc@=&uUY zo{bYN1pzv7mN>B2wsB*B>ELkd0_m?CN(C-b4GPa|{l-rr&2Nd6ErPGV@Fwzh6H?|s zo2{?ymBY&F8b^&*O5mf!;l08-3ZQ@w?GHY zU&k?PUUl4_t%jp|{x1k9&7E1VOgo4ErIvm%i@eMx|iAmo$FNKue|l&7FP!m&P4h+o12oEBf)fF}L7uXnrJ9@nr*t9C4Rkx*#oD zAI<;-&Ck7^4Q0$<8>ncWap+K5JK;0M-tAUMBE-I>?zgE3zh4EfZW6ZxuJ_r?{JiQM zf@8>Q>*{I*_5}g-5XaS%{&hH*(?ew6LVq&2@aqL3(+hg&V!s9^2u<^2fj&Tf5h$TWm*34-P_ogyUBE<= z=m7hvS$%pK1uN|<$fc>k2OWz#M7#cwYwwRP#MZ2LaA1#4ZO(8{-{)N`#{K`3z^hoI zyQV}19(;fVm6^SoznlFie8rFpas(@rU~6}-aycQtgtXqTau46%*1)@}nO!oFHY?a2#p3&J{#-y{;`QqbR~C2=Z-z@;;z4CZr0tZG~U91dCi>ZvoOFeoszV zXAeiWT*aRb4`PknBw@yl3(0g?lgE`$>DXXc@wg^J1aBX^fdRcfBp}>qca1&w-Z&0C zEY(PmcAuMqf#{k+d3Y=>S{5gQIGvUSgvgml&a!k9z5$EaKe8Prd&P(-A)5(KVEn^`CrWZ03AGvTf}Ck?p_0FYb703RG4?#I~P(^AbslXn9?e_kGNZ0Qr#2{51zV zn*zAsv71F>P~81G`>HKN5@<=B+Mc%jd05w`bYBE2(@k;#a^(8;Uu+D@Yn??nzb)hT zkd&U6DZ2Ror}3NXnCnHL+E-J!`}^o!s6$Bv_)ZVWw+>{jQF1D>fe_H72NF|W+w2Ht zc@h<(5ewtwIQj8`#Q5)C`1Rf2VT$Kf9Hhhq@|-l-E1K{?o@-kK&LKoh^sMPLIE?F| zaSUW#?a}y=6NkON$oIZE^5>c;dqzy43*l7$nih6L7yb=Z^@UWRa4*PRK~6~NA|R}? zEAK*bAFC3DHtgQbL>`xtfhtpwob-#KX9E?|9m@XU6-k?=(X>j}@nXY+TsoqA4{fAOKGY5w9V zBu8-w`x1hzeVdp{Og>@4isn6$OQvI!Hq`mCCt@|8;|nS^i6xs%3^Q_9r@&2p=bwfn z*P?=UJ@5W|?0+qmth2iHoI!vqtA`nmF(q&&0zu$4vgO!WHIKlt;@0J!umVyL@qTTh z6FjSh>F{mf*k%mZc3(y1G68;h*U z!N;Rc;8e;Dt2uxkim@+^9UL6K-ArsVV-8IL)Zw#I)wp`=_nWQvT-EdOj$H2(SqJR< zP7|A_lgOG9R}(x>4&&wEcokkNX&s6fA_CoS`Z0BGZ#XOJF70DoG5kl*0MoRly?!&( z2&?i2C$`c^p#H?91Xaa1TGcqjX}kbqfbKq0nj9v*@2o90nb`kncxz$hvrW@bupuK! z{!R26w7VmfQf)vop`!&D`D2v(K~p%kO9NW%pX7f==GX+CE5o15QI4gKF;X6(7p0su1<{ z^$8^<-yhF9@fx<%{s&p-;pt6PPdjGY6PLR9^Q8=p%qAo-kSy)m;>lK@EKU`PJ}cj} z)G_B;Hjyl9Z@{4_N#zvA8g&}W*G?$o{E*b1TB0uD?Yf%T42doyIPlBKtI0S+~+e9zMYfK}*tXkPTP|ne@OmhF-yLZ|; zMtF*tm=MS$zp9E}MJ1g1F==XQs-TciP*fBiIooAFp5^t=v8?!MI*5_;4@s~-dIGg* zI4(A9g-B=sjWEk~bP#P$V2$ZV;ZoQOW*pQYIH+b187XX}QC+$Y;Rg=a;o}V7#ZQE& z@GfT0{`SKkmP()^?<%p7-cOe(7RAPY+D4@;@Lsu&D zAZW~}?0x+FSh;^Po4+Jy5o0G~xPIF+w!(0GtG~lYLo-CIh})g(L+VMVsG^1R=>Z`- zN!f^kd!%xzt%TL>Wy(7VF$tBRNG0Dl*u0KomJ44gv3J8bhxo!iR@01DX(ad-0J0{- z27xmtOC>v7PLUlf(e$K^a6@C`{QNpNL|vku8^bcfPW8#Pj}`xgqo$Us$Y0u3)Y9U7 zpn)0E{-i6r|7Tfsb(p&C14W-|D0}UjjDi^_d9+j0By(tmS61?fyR7=BC}aGPfJRX$ zJ5NJHlTWw5Q#TLnSfp?k|A+kX{>fw*UvYd@HeAw>)*p9H4L=a&4#Xm&61jGh@{H>e zpe4A4tmAj|lDcnyj?zF6^a0H7RDBE@GA7p3SG8-`^6@ij@0??geL&9N=1GhO8`~c< za>9c0I`D`CZmHDP#T?}+Q>v8iCqGXtDfv7uNhBsFc42ERu^b(x+))LHg#Ue6{nv7S zscrH5=#7WR@jf01g3!7Q%W-Fn%j<>#gA)eTZ~1t5Yyd?%O^n;yTe#LkxP#xlho6={ zPksd&icQlq>3+0|fmZ45cEt4Gq-?CuXdb3qOXE-9g8`b-Vk!!6?^g_$8x=YCXBFs? zy|iIRFwjs^BMVKc#`Pa0r6aPPMR}SpZj|#I$;J ztx2MwNw8T`0;iX!SP;llaNr<;R?he33Lk%{{D^7;I_lsoX;xtj`wyiVpq!U_@zV#;I-qMeRO*{jvmt10Und#GTUze zYK$HIt7rEAy3(vOze3yj>x}R&RH8H3^#N_6i^B{bY@>@1sWiD2ciU2jT4^Vxu}xTI zn7I(a;H)^7g@?vxt$5kJ7>)-QFr+^jeEu;8R3N62PR77sMqnwhe=NEssWSY-<-uPo z*-v}%(`FyC2Y79t=li6caO_!P?S)Hw*EK7=e8mWXV&_-*sLDg-r*XZu?Zxf{$aSSp(P??D8{nVa`wY>X5 zC=`HRV>;30>gnw*kkQJzb_uw?IFbEr$p{cjc-~l;o0|`p>ot>p<_8+*wr=Y-RHZEh zjPdN#n45fjDc+Pn-*L4{BR*Cy(FM8at{-*C`z{`}zT?s1yo7O*V4hm$zYx}T12}0e zNvC}^!DL6Rtx?>`b=-UfjK}fZ*dd^@2Nz`8t^ZgTy3j+I|Mxs%-^=j8q%Cmj;>wkt z_3dr({or@{Br9L*1480e`(yurfIgQHtS8jZZPVolQJ_d}!O6!T8tpa$ZdR z>3V_OFKS-9+uxnM_zPftKc_D2IBP)`ga_j}beCbFXV^u~{f z;C3Rb7y|&?`FWE!_>6b?^}^xMo)TO#wLP-K_fypy+;V%^mdRRM2Pdq_9GhS;9kX(B z!o)S9V;@q%{03cv`@t=Y0Yc7Sc^^y$ZF5Nw->@ZroNu#gob1q%rZ_FJC5<4+cU&z#!|1=3o51c2F`=z)+a{!RP?J5uf}B-KE?eRJ&OM>F?{br zhVa1;fF73(HJ^#9Ci%A2MSPsBY)KnOMo;!4GNkOsv=d+zat`E{tApR(v)rRQptD-B z2uS?f&V?Bm!H=y5T8)&2w-#WS#+-tQRyMU5Z{I>1eD2L*8E-fYjaN|)S-Q+&=NDMY zaGIBPOqOBqE{p-BxfRI_)r+o8I;G`H2HXCeV|oc@EzIQKbP|q~HPoiokFcb;?3|qm zCA__5q6&wPq&g8l-?MWjS8_M5&4&u@Gx<#v_i_(^-hSWHvr6A@tK#bFf%F6o#7G;X zzb{6H7O{GJd!OG%)X#DnL3%9^30)!3S%_S-LffDO&_SXEITV7C2A%}3U%$4rwh0P- zU14L<_{})Kg*N=>2SH)6=@lBa+Q&k34L8Z`nveDqS>LE|D?>v)RK&{Z0P8=auno!M z?YZ}MWn{!5dNLD$Qn>32pv2EtA>jAgi9Zwn1bSU)+?Wk%Ba-I$bab&baO7f5Bi2G! z;Y(Lcart%uyUX0w>)n4h{U(|CN5+q$ck^@yQeR9xUAZb{vWx4$^+MqJo0txv|J<%g z{p8Ubp{v%{rvny#Be+=g?%3kZ>9=1=YL=Uy-J;R zOB@zzJ})e!!9bOb02Pv1{dqwvRHG4z4BgxxF|KuOtkp4%L<3}^2A8Ad)^ujl4OY-8 zp_i**tdd{6Pm=>^AMsvg-tN#UtcB0<{=_?#axK1pMi~XQVR#kyY^Hj-FrOW9Rnmu{ zEVM|eC*m%9Qyb(>xv^8eqn?t&@A<)!ise$SwO1&2E_-cGMbRz?c6aliE!@6sOBm@1 zTr}eZ=WWa+@>m2$|J3A~_{|5;An%Zk!RO5t+K*tZa(&nX;*-5i6Wr&M$|$4qRr#79 z&`PN8Zv?erC!J75SdSnmS750c{iFiInQ{XAiEw_~SmzAQ#@&UzlCD zw}x3K#~eSDql&lK{QlTlj3QRLgV;%ckp_yFU37kb_c9|J1-?Npv=ZL>7-4U^VXNGJ9=ut5u%w4) z{BOjq3G=_Y0<%thZFLsyFs$3IKbZ3uy7@PHj?vvN&BTa6z)-y+X|(^U|8A(FmnV&1 z;r)9YGBPr9^3DJ5n)CDGh@I+cCv9zHIo^VJ3gQ_jIiha&w5jz~NL~(8eo|noL7Y4o z)lNW%dr#E)S7cJ5+cixG#mhd5!MY(d3Tb(T zWj`??pO<=_dKa#=a%YzGSh*{w!z?ICiJU48ebm_{NE{{Th-6AhOa08cLOCXU0D}OX zYFMm_io^gyiKXH@(PN0vh?7c@+72qB{-NYUSeLYtksbQn5F@*d0;k7VvZz`N&oCJ( zQ2zAQAoM&r?Tr||b;FGd{xvLybk^pE2CyA0X1?j(az?#;{w>ZO4{#nFAdWaopSz=7 zleJ3#nmbC#u5nNC=(V%{dPpj~TG_Q5lEeG>53M#Y|VmX=o(^C z_&8Xe@q!PA%EHRqOS(OHkcIU~QIUk2x@_M(mqgr7i;~ax?a|O*1m1Cwyp)twCEp&Y zGocxN3ODLoE8z#=psj+CZYru;g740Ly|MMc)%hB9L0Gc+nU?kZ!=)*&Q1 zTBhmG&OH|wmt`=naF~c*h8l9T|8ok*=$dU>c0-vNXa(mAhflxb;c}4<@?g_qE-t2w zTC{9Rv*SWNiLn)#82T@^dlnZ-*eUx3#YKV(@UXk1hhML5PYuTD+F*W?5_ZB&uj($O z>}O}^q>4fkv&>Te4p&P76j>Fye^}^YDk>^^9E!nk-PS{yToF(#Q|_Z#HP z(aD^9nI67mBCMOQ(vStrLH(%4M%L(<=#wAwbEDo-2tW_h#&Aj7MrL-NQ`^9Nj1Bg~ z;%CK+tIn*s#5Xz_kFbC5E<#FC<%*biAnWY>EV96nxLBKWvg{3wnr@IN)C|>_kZu`r ztX`@;l=@doG8;Ph*zI}6Y z@;6ls#$6CYI8i$T1r?O4eQV7POlaJY&oHX~Df&^YsUdgrIl0#-o)nlTJ-Ffo`fU2eG*{di@kjCGGQx5+mUZ!k=#&#G+oqwT8CkM;U%6U zsVk(tkFGWW01l2)?gtlQ|FFuM4;NYoEChi!P<#`p{I!SG`gBrYCkLFq#~dss`j_*B3tJW)WGY43#Gg>t%z_8VAIXlj1SLV={MAMBWM1FlqnNS;wC?QB4tK}@G^qBC9b;^iSnDcVd)>mmZ_9xH! zT!soZR`vO|u(h_+52^zRX3m(ns;q`a#y!Io7+9!GTFlwm`JUNXpno`{?HvL}Vjpdc z9W{UBbe}XzTVEe>Z)Dt6To7sOf1Pzi5GgV9skWIv$>-G*JWkiDN8@$T%xxQQb8e>B z*kL;kdIQ~B7|4yY7oBf0pAgXlfa6MC60D`Oh)a&PRlDR0bkSp?5_NA@{++A=`NmVT z17T5jFw5thV($#0xX>t{CKN{F9Oh9@el|Y%lm}%c@qcbv$T;JGZNt;AhWsgQ{7hQMS+S&?=iYjS(iYc*> zs3l=NPD)4v-}m(Q_yl84V?tZg%_i@Tvf&Ib=2jp$?)9j1 zBWw4W2AHvIdl(&t_YGZ2P=}?Urk0d)3iJLR9yZOV-l_&fK2AdXgmt8QcCLf)ucIQb z)}(Kks!`?c6S44K2WL$wsZNS*)n91H)B$?rKMMPF)dHwG>3 zqEakL=mqf?869(Sv6J#BIDbZ3hmtiV{g)^j`#x#{%Z*3mh#0cTZQ*`>n_x~>=P8@t zv7Zt+AM0z_MsD=8n0!KUMn;ORh=Cp}U_(XO9`+vu6i;>E^MEMn&3I*9 z$4)idmKDt}wx16pR@6yp5!sA~HEePhWB$WI=$0F|r<%@CI9>C0@mV@NJ;|PWjQccO zOG)og0YOW7^CR!a`Z#fVt=7$_l&~{=W~G(#T-Zg>1?wQ&uq7P{!c& z)i}K}WMEqv4>L9Iui3?228;Z$Q&u`+UsoBdv%-tUg_n0OYnFWx`9-?Wv| zwAA|6Izj3$bLII=LBzqA*wE{F`hhf|6{E%06MBET3A~n}oB9AbjKi5t7G`-swEN$V z`L7Uf^j>*a$)JD)$3$@C`Y}i%5I!p0?rTbzcP%dvklFOF_KcDv$EC}Q+$Mgm=c5-{ z&DO-OB$ul6_n-5z}^q7IKrV!j5Sog1s<++F?R zbRSU5-RNc0I{ALOy~!nqFya{bF>hY=xmJ3EdUd)yGrq=0KyibOBzU|S!0;)$|BM~` ztHLy5i@F}GUB$(RErjs5?FU*gV`Z~mz(x1599cl( z;v?@He^jLnEl%K+d>QC{7rf=bQN|=r^!lUk`_~UYG0N)CLDCSgkYC5M7Ra&qyaK-? zKJ}Xrl|w9TYyQ(S*1*^0jBZa+R@8jTIzn%z-ek_1JexV$J@HUf#0*E!1h?%xj7`55 zp2}l2R8hgXIW8!_vbVM_WS5oA`M^1&$p#4>^tA5Tn#~e@+&u=*&wGw{Qf+61fMbAS z29Cq%m~Tv$TM9#2Ie;HH4jD9=a&_&d@Jz>7G-_1Im32P)lUP!-@AZ6k`53@!r5t+H z{b2a6oi*;#`Rb{EYe4BbhpjTY;`rzkSCIAVXPc7!zbwpN_#7D49F_|i$uDM5lD71K z$4sz8H*D0BU0L7mncWA*ocZzI+Q7etd_JZUavmB5gZ=^0Fr2c;p&i(=3%R`8=-WBE!W=I>ArUTZEtfnzD)v+VG-z z*Z+OyFt)YHH#jt8^>wTMzz@RhDBccK%~%!>3WOcC9DR}Z>K_Te8?5i726n_r5Hp0? zG<_hQ-1x}*0fNBU(p)R*Mhrm?D%P&wYx`kj#{+m5y>tZiQok>fJYjTO2LZ!nw$Ar& z+B#|J5`-%jGev_~+h?u$qnG)}@nMf~Bbg&3Yn#Kb8+|t=D3~7b-)4uhdY*58zc|4D zEt)$Z!iZBg=PW3A4)o!NUPjW#Doe zB+jM>Cn92(idqnKVUCJ ztik$LR~aq9n`T=`S}pVZ+-u~y5GnHEOM=TpNq6#2KA~V7*ST!CVHt==Oj5?oBKS*y zPRGCv4_ZaqRs@&O?3{ja3NSQGA0vzCxLv?^t`F@<{zLu-@ES)YO8h;XEJ;ik|2*p^ zds-ts?%}er2P0R0JP$}EfHK3#!3jBxXXm(IUCRjEIi#(73&gVoOvS`Zk%5x9=x^NB zNB;O?`x+oZ;U4lk7!X*E9Dy1!PNELMmj5X)(gQWMjuq~vTzQ+jm?7W%>gnju?SB)o^hBcBP3btJ*Du%` zL>g=WW~-MN!c;FYjsUg|veTHD$HfAYMt9d|6ZS<@@SLX+;Owk^duL}()_r`zKc%ga zQ~4=sksBmpV&Y%3 zc%~b*1t}n!@ZrHoVB&iwId(v%sdmU! znfVAM#ljH2+q`4C;VL>QZ*+Qq14N+h7Maci6>nBnok><=hFyABzY-xI{A-*4Jhq5p zbSAPA1j5fFEU7Vn6A`$25%v(6Id$p(&O`Y3HU0y$4_lQ2b1{j@uhoQ3JQnT$Dc@0H zYld#Hmq6HECyh5w?Wi{_h%)5+3H8Y zbG~0ZI)byO_#xTwbm{)YzwxSOvL+#4*9z;QO{bq~ih-uUx#^;B=yO5CnKVWT8x3)p zH$kdeoA4LA;iM(F8mHt;*OQ{e0-r42t25*pMqpdt{FPkj9jEarQt(kNAle?qsV))v zovfyCW;w#8O{lxc6fc~OlJ767Qk+}U{jGI9M8Q>*iM>hH?R*b@Sxo_x+m$BAmbhmY z5($|8?!IR!Nq6GOz<0;qfJXGau71Al_jjRPb?b0-Bb5 z3r&vFzVGbeJ}>>T^K*$o`3^L78%LMGxX1Sf=sW(Uo{vT?`d{6RtaSxtY!tj`Udx6P zPl{G&NO^KQxwsHP(bN|&UwW#g+CoVri#AsnP6$le`&U!?6CDC0%b$uq?r%h}6+xhl zw9~DoOmL72R)se)Q*02bHqXRv8?nXz*PQatRs!D+*+JwMRVBA;J^mU-;2P-0)Ji)n zDB-74)BJ_Qu%$F}7?Ste>Qbt70Axb*pwV6QD2! zJ>IZ6I^(dt&r|hx-(341i?cIn1Nv=f)wKPBu?;gl_jn`ei;M|f@V9Poc z>jR9AM`e`A(O)Z{#DL@TC6^f`1jHbiTwNs$w{qPcXGjRB;w}!v=WTLpPcB4Cg!=ny z4fELbX@-)19rgyGIdQGDq()(e0ota5qePsFM~t@*g?D|(_kk8;6U2*ZY2`xkZUI19 z$FQpvXGqU~a7c)9PzyW>6nR{4MDl$k^6^^fQKME#Oi{?g1&-qQo<+m1n{5hU%qpVQ z(>-eB99Cxg-q3R+S)Lbn7=M%!%lGi+=eHZ|&F;gU$R#JIM&N}4%i6*d!`7Is?w!?~ zlhs0dF#764O9{?lt5#8tTd2w8qx|hJ>K{#7Ypy@q4FvuCfLjed7l^gkoL}SFURhvs z_sJ~e%-6r80O*6u37MC}RhN_!Siql!8ZY>VXB%>Yu~-1BPf`+#n>A*ic$K{?-|BQ3 z;rlBb_8K4>+K$@yF9)NlVf-WFB$*VjN4L_k-U(GEiJzAJGV*)18l07#qi-_HDqm?{ z4VS>K{qywihFU2oGTFSCqHwmWX|w>#?mQAsQz<2aN9jF}&)jnIb?uPDd;#%0D3 zjL>q`anGyvL@~ryKCuxTitZFQb|fH{$Cx~oraCzbbQp9wSKoG=$dwDo9LN%xuX3yu z@Hp+rjp+C49Sd#SxvS~&IwZ_jUQ?L(&D(u$@^-i88zm?bCX)%F5Z^Dc<9>WCzst*Z zA0vmQRqP`2A0zw;ioVimIgKocz_8CnVG;wl4_f~THhttHcL`&zf2-h(ufbxej*rX) zp4ZhzWgThcgyYC1I4F4ST^yUh?Vv z;Di?T1t|aZA}U!`PTv1?TH@0Y)1vE<0@N<`(81HQPr6cI&Oq(vYy7?PAnj|fz^Ko{ zLNYp2>$~sJF)$QF78}DxLCjr8W|l8^tJjI|HUh@7pN|IHBzm~q5%Zp?PuBI=I?01E zSBsD2PG!Fa=b>RT<1P-i+Uc6g3K-I_&^}al;AK})0I5s*nPI_SyeJf(4=Dz7~PX-#5)#y86C2et==ATs5qett);!wz>s%DD-kzS8rGNcUu&8?g3_Qwp-K&6fNBS)V4fYnm zDx+RJMTn`TXKGr7`1UM6zY-1r2R9b`(t8@0H8uiuKY!Z7E(Odx;E;n>rqAtv{2BM1 zadkhWrBIMy5fseN3HVpZdyocAz%AN!7vg-A2Zk9Vj{pP?rfMMCI$ z!9)LRK|&^Z1h*i$yjdbs=0m8tD!LdJdhoWBkvkP1`iW(yOapF;G+IvW{QP^8s6X;+ zpQXV}A^?7Th-=J%eM7JJrF2e*n%FME1HgLQnHzIjq#CaRb@8^2iE=5hwlb06VdIl~ zkl+d)J2LR_YA}_;j zmt;kU%45Rkwf-*c&9jo{zHk%Vhoz?O(D~K?$3vjYVP&wYyLRPVWK@)budk$xtZWcS z@!{}Kc{zZ>eEe9DHnuG{rML-$Q+qO150Lv+9WXb|Z(mSQ03{2woSdEe#l7a|k`tj~ z^Rot*;gJ!Oip@J{GKFBwp;TmR!NkR3;o;x@E!yXFUIt-cH<| dYc#iF0RBTJyZ#KqJ^*?>R(`64RrAO)_+*off-Udlx_(@T2k^14N4=D64H&dq|L6CA z?(^JF_rv{gX2&^mp1t4muC?}FYwe31jF1G3SV~+ZHYNZ7s;PCOKN!<-p^{bAZMa4m zAdk5WJc`ao_gRDxiO}CD7U~>UTXT_AJ#)dY&lJfX`TPlN$*TGvF0E|Is7 zkNWxfc}71IMD5TAtigzji;Fcj#-dw-fmhM(>H}Ok`xRmch%*o_g!iA1}n|tNmMo^xGCj8Ww_LBn{@R z_C~ZnszNdpp~Xee@{`BV=^q_3Ow17M{W>(#$=AKm7Og$e3Q~<;U-6IH-H5jDVCuH| z>5_JK?~6vuHaeCoZ3U#etjOMv3~p8zKfQv(c=#i0F0Bc6;-o|B4@VV;eVNw$)&rS^ z#ifV}>!-;n*n2oi0pD~WlsOC7$M?3(v9bvWy=U?(32b_`w%VlX$1#wH4}W>%eTnF1_UN!$TA_?SlgjW{%HBQ(rB`--&t>UFH43$62Fq ziR_KXEj7M+I_YS_cm_@Og%4z^g%L>h*a?{DQkvR(qq+K#zZBe;wZeVN4G1cOvF@F z5fY|uVZuXgo?5&`?s6QR#-DP%;ge{Wype9P3$fa(LmMIS+9f)QexRS95R%A@4e?^Y z@Dxf+m{ymZ^dw?WXyW;}mKYG~0CW(-|56bX!ul})u8k4k*F*`RP0Lg!IK4A-{A9)! z(nu?z#_k$yD=8Qh|DqEK28lwb3y={h$v|?X=CxRK05?K z@>JeAAafbq(OGu=yyCO>(e24Bcd2)~#up4384P$YM3eASwR#SF>s0jjOOuz_vvMa5 zYhbX}Gl>g=0omX5IPz;lcnsfWloPVc9)T32Z2F^t47s)$8FrbWd1SG!N}Ocu6|5w`s{EEDZCwCgu&Ax&$b z&hM8#MfSUiH;hvN`#{6V(rZIY%lwYK04_aTxSeux;I4G3=ppxvR4~!AC^Pdrp(iXb z3Z5IGb}-!dWtIuSB`e55lJhkI1`&U&t#@A1 z2o-Et7ky)(TRi!ET%GXsJTXxl(XG1kA^ZG}T~}6K-uz-iqVneC$w#(Y0HMH~OR==G zE{BcVJ0&DbJ|*+$nj!8re6YBfQPU_Ju1ye8Oidc+R4h4lmSql_n+G0eII;^ zlGf0F-HrhFLdkEJrqrOrQqY19(={xkC>42wcfz}61N;pIB9c@hz=A`nS#S6gJ|SV` zz|9b`%NCF0JQ(?Vs;9emaPq2aObC$HLY@=w=F2Y*$vKwOZXEa(F0T(Q-Z+D(*2slx zHVeMlGZFP@5CxH?i0S8~$W*Ld*pU#6#C=H@Go)-*Jh zHQZ>A zT9Odo%|%Rl!W|52EE=-JFHZ%yXkNwyFG~kMGxHUxC+2dsAp4@VGQRk{oKuQ_o-DZx zIt}jh<|DV;RxAF~W&i&5eh~BR_FurnYvECIcdq=M5u0(-K1Tbod6sf?waSzk82)3M z{3Y>r)jKpH_w`o$?X7RK?^XO*-^sMzmeJxPd(x~aYfk~mY)pTi171n~Y2E9Z8tRf? z^a4v+?GoQaYj4-wz?K(52K1~6bxP0e_DNf?{&J?<}a%z0pwQeyFjA=*O9 zAR(YPmmaPN3PQ$9u>O7v)zkL=K14teC7TI8X?vr<1AkWMQ;+7*oHxP@z{58(4=Iw& zr*I=N5j@;`(!Pd2k%PTtS8^=Vev*;^oDJB$ZXWX{&g5Yt8yz&wJUL}qQUoSIbUpP$ zfm*;GS*?n734!-RJpA$lDW{%ZLY6*{V@>lsx5dFb!L0N+g!DHD*pl|@AYLx6`=}=X z)EX}I8g?{U?_}vr;o}`a*RK?S(&ARIdk%0D7Lg7Qz%JAT^0f5`%*gMZW@pa<+CJCa z+$Sa{4viO+T`%u2KC&A5O@Zj}1cY~Z)}9fxj@9*W;a-BPaQf<=@fLJAQ-TXzi@lHh z-LfHHHyHrpC-N>wiy040TJGN*pJ|v}eAeW}4P{nLObRlqC0uz~USeciK5!zDOW|(d z)Y(cI?Ze<+X!*^wV&jUmmRKH}!?~3P^};v-$+}~A6aZ|k83obD ztdY#21HdSxG&3u?8WYnZI)D!ZS7&Mq8Rvax;0j?4Tae) zMbtl8jP>8D4M+udL@6~k@2+DJ*PeDy(S;6U58~0W0~yBm1J(eEA~wb?WfNwgMnvTI z*r@F}=+s)Q+g0}LwHew1Eu15T^(!eskf1F(wTN(t9U5uGQHb7=DkC=Za*L9;bg_H> zn^7%y74gzZGU`fU_&+78j@b@H@M@99Gjo6~TC*3%EeR8b0jAv_qzBxJpxKC3j#s#I zx)q$^9kY+bX9N9*KE=7Qm{4*m9EcnZ9hptk7 zL_O-2EYz3-|E@>VmgO%0&Hl5Q{6%|CD6d!lLnxZQTiS}T=Mj{zo@eGrn5h1PZx1+L z&++g#Wr=q&-*<%bB+BWH3HnM|FTI$XjjcpW?x=EH+~buEHcd9@q=wenw%^&&ChbCX zIb!uVeS7EZJGxu9zvP7G0dsE1v)^`(u((_C%Fko~6SX*eC?hELX70(=l~?jxoX2yY ze>(wuvcIUP^^$c~+OutQ#ksnsV~jyY-tx}GRg90mKcK?$p<-mf-rY_i)aJlcmmKc% z&{z!2+)Qa>3@@~mb0W^~&$6LBa`G$4(k+9CtidYNqNPOkVVXi_iT5mu@x(|<>NOeS z+O=%`jHSay?+_~AP8}il!?^?RQ+s~kzoCtH_M@v)OTaTF>9e)D=(Vs2J@0a`{z zxu{Jlj!`5!5XF7$KEH*l3sGB@&-?EJG~@%lA?UDrm(bTrbF{zYt1 z3%9~OFP`ZNCoFyqp&m2^*~o|U*T3-Z91X3R?!1P2SSCgB(i=$J+J@Lh(6Q~)*g+EsppD3JxuU zhXSb~Hq;Q*dy;WCI%cAqhQ$m7k{y1poTaWCL7DAWCm1Avq2T$(M{MsyN$}Pst-=bzfnvSdjHtR-POJE$Wmw zr)Qos(;a<~S5A56i=HxC(GpRrvLzlzG+v?WB2`bDd>>F?eM%|F18jnpO--bgT@Ejl zK+@s&@)MXgv&AgJ4?ie*9JRt?@l){CO`4N!HH}+L(=K4-((a8^kA_Kr;r6Z+$V1n+ zS>=M=g%Ss&w)&`!Mg4fyp`9rlOJ8)>%1LQm>_fH8ZQ5fdVVm@~90=bB2L>rsNUl1MMUbza|3si|1)`y7bBg{v!BeqOtJzv&~7QytDpb*C_}-A`=wcW=hyxdH+4 zdF~W<_ z{VF*X_O7L=^$a{nN6+Whyi(_6@^gW?xjR*u4BAW$KDoOQ32kfR_4S)S+|;B!-+LL> z8KvDfPKv01haH^vqzU_%*VyQu`(k~4ELHiq+y{~qZ_uQlG^`~o?g4niriUq8- z2|9kDB$VQ998}V1NW(x|J0vTM!SdZ;XcU2&In;jfp0dsf#8y^D{=qmroeSwnU{i)X zu2e+!_Y>#mV}{?AaL;+uAZI233JOe{>EXw!smZ^3da%zuI{El1+6MKqIO?Wc*SDon#}56YSqD+8x0s91=< zeT){kq5tN(uk4g@a9LRYQgZ%SB-$xwU-x$Y0NdcAXb?O?5d|M<&8v?vcB=dSA>kZA zu$t%=`N8Zbb_O1gl&}qkEMfw4pTdy|lygH4yY)9LY0P&i_dE6nL=bLZqP@$q72H|c z+kX9zyZs?1fm|J1dXoR1Z5vLpi!%9vjq=YZl>PiJGyx%697;;Fn{$_U=`w%@J6RJU zy<~qdv?76PX=EB*XP-&y-(;4uCl|Y|LO8yy)6VpkQF$lH7yly&pjVK5nNT23|qgm>nkNGDOH+-otYrI}YU#65pwP2Wt1lpC%o;Jt7 z!tSfVlKYQgAZ4^uS{d~I=){xpKIPW#EFVdI6*;BO@3R4Y=W{-Yq2P5#mWj>^S)$Jw z@>%FF;%)gxtYI4f^}>-q-R_~qbLEjb-F=_Vzhu58)Pqu@0{=@BFut*M$vyF>6W$E? z=ynEMz2%IltL4b*IwX`y+771yTh7XC-v90z0?0?x>d&sQb$_ASYIr}E-{5y6{05#f z{Io57BOFsrzOr6KR!vO^n*`#K*FDdccxY!8AtCal@=I)4Px{3-ulqm8#VwE>K_3S{ zx5*;)ifbq1%!5WK7_sFLkGLi+uR9>il&abMC4l3Pe zm$&nc*Z`3Kfp)PVZ%**cVv1E|`tQNv@{1`pHOsH3KMHemU!+)BJ>Fjbv%3SXg)40? z9~`uucSh0l-JI|BJ-hPv($kxEIj=j2NGE#QDMowpG6mJ!`zqR1JfDe?O}`x3z9N)t zuidnkkN}3Q*-g&|5IrfKpZ$4qyhTL+T)FkQ-MF!E?!mSKM_E@K*8Em=Hljbi;_D@xVkRbuNj1sLlzLFZb)b5U%U+JSc!Iy_rUGPxwKYawx}!SVu4}D!Rj-yiX1Q5a zlCc1mSJC!ZKp=Bj4S9XC;CnHjn;6xh$sxUQkG~lMLn$na>()Gu1ulNaU;hwovX}-s z_sy^@-b^)F;v5{@bX!mYOE$;$#u3;*;sf&ELmmX5yf%9r$%URa*ZjhlmX6{Z zHOMsx^XZI5!~-AuPU8MQiyejl{l?zD0E|zm)J#WPW0|S7P7m5EV+Amw_p=_^*>Q2w zioosE##6{AK&y8QS)a`J)}$xy=`02@aBy~|09ORS+XH$c9CjRpli7m4Ei>}UbTc*G zITh(==Hm3pz&jS3UoIU+nXo(Y z`gQ-aLuD;`<=RMPg zzHRd4wf?V?O%+Eot?ZWwpUz|~t4DF< z)Bb$xp!frf5@&dc5)fEiB zO(NNfeHe371SOk@9|?r9LeA@W9!1FZP1JL7a-s)?V_t6oSp0y>kt?zKQO;yYEI@F1 zCi#`?t6a~N?_K=gbkXogbRSB*TbSS`o<}Q>MtNI_ z#m!$!yPfI)phiREui06ecfBkvriF5W)bI|<)?s-lx}w1k*xEpvPlTjjzHWMhSj)=q zi7nYo$+4a^kqg{LCzd6{X?6X~SWmORff#tP|CQbE2Lr)Y-lZF2sJ2;QU26k?fjFS2vTnDs01mN$zM+I?>qBJLB0ReG!+o(yOZbDz|Gd|>QNf?0mB92s|fy6TZ zRQKy)3h=uQh1%sX@#oaC`O+4ZhiNJ*x&rVP34|~y`?F{0G;2IOJbh<=5Gb@Lu1z{n zq}cxH5)C+bVs}kthScsOCnm8&m_Pd*U$M2JvM17Dg2t|}ux5sWpS`(d>Jzs4l?4lq zsM}8H6GFmc8kSdvtlyCrN|+e(UikG2sZOT>2%v*oHcloo+D8 zzQ~Ean1TFL3){*{e%r1n4R=r=UxxLwPpPTYxw1{=nLi5mo~NQy=g`~Q+M1b}WeL2{ zn}~%!8a>1!{>}nt`A^dvIcJ~K~!+4zn~=u4YQ%i75oS7?d^R`+TGoa`0;~3QXehQ($W$^hl~9qb}0(~ za%-<=r^XX1*kGUvF_J2OJe<7J3)%n5<%mw1m7f`~f2*oCXizNrv(BPG4M3bPEZBJ( zw#c4#caJ!6;b{^|%~a?>ZXmwxNMfT2crth{)fJQe zoeV*k&|_HwfoE%!I-;Zl$U?dQOHlf~3Cex96Q!%r9jOWHE}VaSuAP2>k(0MhF|EQmR7k z9uImSlAQeFKVwelTp;+-N(wSMHWrtW5j|J+eC=!Ehd%B{31F?2l~q=|slI+hZ?94) zx=HiLfXGOEQ8BUYJoK-U1>zulX-epQpw*ZArCu-m)7No-y)F6yFKY!~J|C_r}EGwbU>>0hU zw6g=Sw}(O(Y^u_)e&_7rAwQHMQOgQ}>9=^>dYgZ5?~9B)`0VP+?{w+h+|$#ZmQMTl zlWhNWGLdAgZ==I3gTtZ)gkcQ{p%ryT{BlF5+=R1}z!(_8uJ*KFg6o zAS-6DD+n~aZ_-94lv5k1pT1cRp4ykF>3ncVdh4O|qVMdT2K^jsST+Yu@+)1 z10GkFZ~&$f->6=$w&lv*E_{8nKGs$L9_@AZa2#60r!O{BXE~ zA5n7N95DLo4bB7aYK=qxqE?xdPCQ7H&qa&()6|-X*)b5IGC?d*r*!In zk7KK_Sf1LlsK;La^bBl^hk}Trlo!5ir3uY{&z0iY`=A#5+51z#QlvP>d5375=)pLu?x2 zkko6rwJGEkv_{Vq@T0nkDic5$UvSm~4JC6R=@LDe*1CER2fN%17y>VfM|T_4Rgcd- zrImuq6CXx}!^MCU6;^jw*RjXHm(&h*N5_+n_=E(0cQnO`-VS7)Jp!AXRl409kn~kI z#2f8vX(b{)r~3K_O7Km1@~Ld1_{Mt#Js{@3U2}^X^))+$A0SKossusK%%$HC1>R>L zd!zMEP3dm``v->7gSR9mCMKjnctk{;|H*&|YDEwp8R!K{yCtef*Q0S@orMmwtc0Pw17jykHI%`Oiv)8S8?4&I$Q|XRx7KeF z=^pc0`It5Lj9Xh<&Qak=1sDwH_Ld=`C)bF(+os7M+#$gv+6;8xSXA(65KP*C7=N?9 z0mILD1IA-BLoshNoeT+*{ej^AuHdq_rQ==Mp7K!X&a|9YW$TOqxx+ z{M?I*GQ7(~uyrWQbpfoBpcK;9CoG+KnG1_f=uV3XlNm^h{r&qrwzBmlq-A2 zd@BHCO&v%^jGe8tI(Yr_`Fih7EY2 zuDiv7!=PY#IA#J97pFxn7xXI4+Px_t;Q;&n`@@G1FCtvW7n=;(_=TW~nj`&`LT5*z z-y5l!WMte-ofWzzD)Syhf%(LngHcW-f!8YjU!YmIOWW4U5fFGp!r4d8&R!N87Q|mn z1`lY)qLK1$P;__-&=vT+M$y8AF zUxU9U{$T#NX^S_Q6$+j`3^AZOl()xpw8!owNdGH0j%Np;F-Mk3+pSXd>yc!Y!|?%!hy0?nk?=!J>~IH_+CH zP}|X?y_j+J?S<^xFBmJHuQR;7))S4)mM{qB_m?II(y(8;qDMqTWEnC~j_iC^h&Ph< z@gqEZ;L6BEyZy4VaGL!E^98|mAU;*7kif4!rs9VP6h<3uTTkiES5;faWAV@N=40zI z;GQCDQ8_076VM>qC+B?ua*4dxPlP(TaK@z@;>bWN`32zennEt0isLf0!`H@ro7H&H z0k?EFEv7X{ERcv7+hcQ3F~LdDZ)R>CW4J-M8bs8X6=X_zN_+C+`Bi|&JR-^))H+ULO1}+dTtEz7%*bRIM%!(~WGU_l+bqy-N_t>EF@@p3nwsoZ_x==# z$Cbw;qg%obaXL`L{;L{?_$)&H^2S2)ms$uPqm;ZGpR@-^FP-3+fn3&88={Z4Szw#R zTS(s+9((ifo9zaJP`P6NF7ep3QjX0s{H3td5+)oINdVXy*u!4dx#Rf1_^7IJ)fqSc z_F{yK!5#njKvGKevx9lS`X7ML&dCr!eqOU|j^~M&HC=di_M}Fk#9LW6`h2YB{hM6Y zKQfk%!IOg^Av?z)GHnH4kJxH+cT0Grr?dI4B=YvQVQnr4$as$io81{hE>>CL>8_}^ zOR2S?U7lv5!)Pu${F^zlWdfS=)He4q)749VRnj{t4T58@iis|@$tdyw3JCn%Emnn8 zLkcR-l=YpOI08UJ+jh_a_=q8x=o)2NM#eWEo`P;(AoL;d*_y*c9=ea zLp4H{CG9~kjZ#(N(f+yQbH4eXY28>J&_gH!0_^^J0eQQo<gML~$tSpV6IdD_*J5U2SzhZ&fE|7WNr2reho5ep)^;pT5PwbMc6GE& zyNCJLY-I3GpJX>(xjYWCyq}e7v$k*F+t_D* ze(s+52a$Pxt*EG|prDW?(IUL{zyb7M+Lu`lIrZg9ct=Sa7?7T#!%ie{ehiUZ+)|n3 ztyQ+0VlRawizPnL6$Afeg4%-g`>r$Ogm{;qVM;r!}wh{B{ z3)dvpG&hs7%7>zS{Gr|5Kmp-h;Fn03*a_xm&jUt_yPREgRN3WU!2;_&*(`r|{+exi zR1Mzy+MX6}jos~F+%AX9GYG3#OhJd=s8$!G-{Ua&uV6pYbK=^#Jp)bsuhw180{B{Q zkNehP54Y6}q@q;b1Z^t%6lC9GKb$+izO@9{aX~ldsnjbe%!C`|Gj`s=n=%pYhtL;s z(tT*CgbBK}V&g)3If>yEK4F1+xQ-@ECn!WdFk6ohZ+ToF6sSQ0;$fz!BT{j_DTZtb z^J@KfCd>M4Du@6a5C`Yu@mi0!@u#!;th3Q+$`4AUh#JM}^Id1SbJgMW4~x+TL)Z?U z{{VAw6=v3ut`xRD8KS>t&ijLkV>e9~D@2Aai=tQBY3~Yhi@78Kpv+p(4}}0~3=K`~ zpm&WkGIRd^*7GXGat54?LxXh1mZkI=>rC z#{nwq>L`qakM%iQljlrRL68U&?E`?ALzP|NdLo#)~z7Xs~l|x4d@f zHY_H0EQyxDxfp%1 zVjk>!XW-wZsnoLvZkv`DHen&$!g(P>X_t;Wllj zLo~#zFb|Z<{*?o33qn;ZUHhQr)>|BR94SMC*J#uI3&Ou=>-W9whD_5`3bf!CIy_DN znpPSH*>I}&0A7c!9(62(tdMh+fSkJ{hFLCXK=9(hdG|YFI&xsFK&Awm)lN@pT&aLp z88ZD6<6$S=(%8-HSOOyy(7B|8t&(2< zC6J+j!V&d*|5`J6wDL_=8T$*KKYRv(FM-yrHJ)#GJ7K;A0skuna&pC21a@|I>@o;) z=}da~#H=eIvPqXTMbUxVSRVFyzA&%D4=XEoCRaX1q)aE4k1xxpH9H(pnpJ9fG0+9G zO8Qck)ea+i*H@Plsk{wxtu>ZN(lZ&K?Z}-san*FhT>eMvQ$yI(b9YeKVmrd>0jSj1*uR$U(hD~CE9WQ@#oms*u>7&;=e8|2r+$R?^jgxS5GVGn3LgY1ty$; zP~NJ&#u8K23UUykOyljCdr@W22l z40gBO4BQ{aq?bP1D+cY@H+mci8JJ{I+I(P$m&=0rPauYClEZwX%p#^_q=e-4&zjX& zZN+U(Qp58~8t8!M`@i71nxFe&k+LBucJ#^ztn2`0stPQ!$4o-;)h0hf3&UWhrW9*U zlhPR{sA259Z49OLS>)CmyDuwmIk>)~w6)MblGyk#Gh00f{>3-bMA^yT;ATu|ACg(h z+h2G1p@4y^(*X96A#i_S_*Ux4-{F>{7eH*^`qM2x;kt9q6vZ)F#xm~{u8V%sS>NEACik2#?`O-$qK_^;?0bX(8JQnQMJ&s1Ip|uX|&DL80 zS)lb$hRLa9t?RZ@medTAo|cyOdxerQkLchA=`Ra4b2PUSsv7ylJp`lmO($IhXDXt$j2EQ3wd%pSh$7-sjw|oY9u(NX` z1O$hMI^q)$%oj34D%&%!JGjZn$Pm8^qrh!uWF7l!*J}}a>C5IgbSYvK2vj>)q$&tE zKi`D#9^EmiDj(c4?62btS` zC&|=&dGOC1uM(rb;1M4;x!0s_z4b^P%-?j^#5+1V;x99(J%$dm3Jaf`d3bmT0_mb3 zR+bt*tg@mZQ8^hFozZkVd3%i|I%V- zWHM7J7nkSNV;!iZ+@{7fvyFLN;>RELOi69bPVh{u`=R;`X{-wPHA0QMJJw-mQKX( zsEfGTazf=e=V6k>dE?{PD{rUD5n)qmU*FLUD z+Wb=G*@m+1}oMk+@)LeD7o)M2`f`-48e3S=kz`$w~if zip-P!!;H{k81q%k17}- zk@@Q|K=8wIneQR&LNjfmq6iii1e%v5E6ZdRKPS`&11bxVMS{&6x7kGjh0 zYK$U{y7z_Up?duiG92skwY*pTqoc>qXl^HkJvh7mE`hKcBM(9(xjV+NT*_sm`pbcE zUneozhKeuj7ief`FBIW-p`k?dY6-v0Q_+<;InH@FL{{$jw@oq#u}-leWcK7){g6#U znn27zGShb2yn1Ug#HhzY89?$I*7OktP?_W_facbqx%CtDaV@iKArt|};8VE*LuZ-< zJD**FjI5QyMqbyd~U?yk{6TN=Urn9GY&hh2?iUH@pw zjH3ZF^1}jF>yG)3tx_W%`uE)!_cNjokVZFf%O%rMcmAiVwInHk_%l^*JgbND#yP>% z=>PHtlYK1frgue&kgl22?kJ{P&JXy6VoQ7GQT)ut=xZ)2n_!5M4&|ZYjF@@PLR%Ob zSUogiK&KG&jr;C_;L+xl9evj5$p*xEhdlhUl5aZbH8jN8tKdQ@#*>PSjCqUhkOW*^ zet)Q|rNzL`uJC=}#;#gO@+*KK*L0Cu!U7DgOM<|QtF8?XH0KLvs4A2RFn;GL&{~0c zk0ppiY3>1L%tYkW`)3Ca6*Cj${`LnI)pq;433iosySSnFW`cF+GC`TV2S~{MR2oVA z5h)`NH_6f{DMX3s@f{&pM{y_sX2FOc4v^Owt;GU|FNGb;etG$0lZy-th8WswgQ6$`sJ~*L^sa(V~oU z2>JmZQ9?JRoWw)$){5(3tT4N@jF+MG%#n~Pd#!C|%s+Xm%KGP0O>ckM;Y&zJuyu8I?thMo zvg!=gVuf6c2tkbIz#)@=8Hd82dli>yia?#}I6DctL=0iJ2_Fz?METkr zz-C6{AKhjy#K0)G%;Z^??OI^T#E2Z*7=HJk^p6#$!is`{&;L!)V$_w>&unLoxVkCN zVa~mRbmj|U>h84^XLd9rpu0-9;7`;9^|6@J1G_06&_%!^qB&tdxi|o*S2cxT2ibRe zI?q^J=0^GL81?x_RjV_*)TQOEv0;*jk~PQ|W@kQeabJ46rfTGn_Cp&BJ3DsPbxwH9 zvvfQ_6m&^2cpf$ODOfE#OqT;JEk@?cmv>3IPIYL|PG4|-ge?=_tN97kSQZ(x7X zfgqVhMU&ThF{VZALz-(Y#qI*Ex<_o*Ixy~^uVH_>2w{ByXam+b8UDPb-mOJe2%)B> zxs+t|4ST>AITlO+ReH`&en=Exig77;sj8v^o*v(Zu{_NMG`=JSS&P)dWM*qF=XX=HuDt}H!b#%6bliB;OGKnfQ1Pys zlwmJcw~YGEuGb;x!O18&-`Zbx)1kWsmeLG6as0oT#Iamp7_Q{dRJuDBw)!NjCcXyO z@C6r>wR7ih+8V~xhK1?|7C!OPA8fpolMMsBi6Jsj0I-XuO><8cJ``X!Tb7PPB$6+^ z#yZ4PgdST4y)`#yVjn4Rj50W`AN+XoocwEDK40~kqv87B*fw8#1J3k*)wd4$dA`c` zMZ*@R?|$`6KA!w4AE*HD<7b?d@8SpB2Lhd9sA~bhJL5&QHa-4`iD~$S^cI5X566(oFbgJT=-A~E3e&QJ7DWAq*CP2^CK$UrWip`~hzW$LBts|440b^k3EhyCJ~=5If7{9C*+LH~A5lSaMcp0Gv5 zG#}CTyiQh;rWc{hLl!%3idXgf^u&~u^#*?Ux*m4Ohb#i|!-1tfT5Ufdi~M%Re7$kn zJi|f-EgN0)!!1E%(*~L(P?VN zdW7wti<7byFj!FXBHQw|LX$!A0-~=$NE;0~g57SM=gM?|t1Fn8#RRdow#46ax;X=G z7G@tRsfvTZrRhOXL0Lh*gF@@kbWN}&8ReIb614dyjws(GW;ohIg5>$f%V$KHH;CKZ z7>VaD%8)M!$OmSU)8@m~a92NHBZmw}wg1$t_uU&=Bt7cFLWrEjC*#b;VU&b%fxQ0LMfJme39b%V`4N4s2o9!r|0ZD|= zkBJHoN-X1Oekp3^tHa_YUKe;FKN)@g6p|GJ5kju#CL9G5AC4iNwx+0%GE4eTo=En| zY%V%8HcT5S5Di)g}i;n`(^J$8p(2^MB3wRH^|tqxPx|-T&Z12n^oYvGm@%Z!cydM;iKFa0+) zqD$)j$6#8JWpQb_sx4 zl?T|K;+R10yB?AyaXg!>QA7Jg(z%j}ab&yz4Bb8p=k0iW?1Z!eLjbcMJsODvFb(y0 zL?^it=6&Di*lDQ~NE`CkMe2Vzy6UhfzAikwEZrd8Ez(GLDJ7wFNUC&+NHdEdsDQK} zjnYU9h{P_UB1m_$G}7I$-~7Hm=9$_3WA~YR?mg$;bKdtocaV5Wm!V$- zT8|Wzt(nf)Pyxup=>q~O%Jp*iAGkZ0yO`~C0}*VQ)|lhqAq~(CUJmCuS^22SK0myT zd5vNZWTIGJHjGnMQaHW;G_ybF1r^fxgNgk4oX(AB^BLIL*Y;S0**%BL2LV|-d zzRXd}Dy9dd;=Mj4p4+~-s>j?cj9eEl41SJDm-r`tw2=zfDe@;Ef=p)LrnSX--Wz5iv*$Z2e7ka;w#Oa?!`a;58#c6oN=p? zt@*w4d-|LMxFL*NQw=5r=$UQ?T#G6oU@_WbkYL^3G!xNNe%!DiqIKk|j_wtu7O%qt zzFi&_cgGEumd16H2c{VRx#Zf~+7dlU8xN@K#Rv9yTbUy+8q~sGk_peh(S+6tfb4T~ zus{6;(!FX?vN$%!y+ZY6MJ5eBa%Y{_DC36xE_&(Dt4kE~aa(`eb*)fDM5F^9KAf1G z9K|9(*1;~TJ&^m*Pn{|!DK&a*yJRk92NV?TeUxn!IZVMm4#2+tWWso_Nb6l%et`iJ2dD= zJRHtE5Fz`Ib&^6hj=2RtAv)XjG>j3kP_XGA@8Zi} zK_n3)@v5E{7qUeckXs1E>RAzThO@-1CI@;|E_BE1Q8YW!Dy;38T7>PdGTmxvKpTLk zyN8s9VB5SFMdaAO)I;BQV)li^lRcwM?vvQFUpT3Tb`v4N2UiUWeZhwN7f@?8%=?z1m{_dbAlEJCnJ7 zVkEr$Tz1jH0Ro4$3mi+wdvQJvSeG#LV>4_)Xb8c6>4w~Na$L#zQXTjj7t=5ekHre| z3*O(WpCU7&IT)Yty}HAzcR?mA>jG7K71Y#s7se|#DJMY0@2`-rRutg^1JDM%-R}m< z^x#t9QtTWj+DY3Z`a?>OgOC_1Syz{D&G+SMQQP3ZbAsT+S929ipR!{f|E?$?ap7W$ z$o(3gdvYeRrxzPHF!oNUl>Pj!~()wW6 z1F}43^x)@Y>5_!A{Hp35u#Qy#b-CT=DkOrEq4vIwV}kESuyHJa&)k<>5J0br*oWCN z)@D!AwTAG14}y)o_tX+dTKLE;S|)b?lSufpwZEc8*|>ol7KDda${QT4 zWPeyuuQCt*WV^mYl<=^Z_dR>>6F&b?iJIH~?VYU1n#9_={6DlvYGxt*{UntLJW>ie z>Ikt*SEta_zbo`I??B7=n769X_b+rp8Lv`lUa05EtlB8eOENPlm1XY^_K(IQkQlc$ zLk_TaYaA~ONXVIkb*(q;`ATwe4M}R{IgOHP2YmWMfD5j|nDP)Hb!xKft&CSCHRNIq=ti1d5H?%wgILYHa0;nPmmuzO3W zB7sQI`GwWONg$&LLnj3!&5XZeH@;ZAXtGQKx{&j~`xt_YW1|WhnH-YtQe5(qPyQOY zV)nn8B4v^Xoo=l2Gaa!onR*a$9ey757KB-K~<=Wy-$;ki!C!2R4XAB-Gqv%>maERK&*L1ipXXrYXuxwev zT&xdB@cUg_$rpz>oJW3a6!kxchV9Lt8BhPZ)MFh$4HH-g8PP+&$#S??k+t3$=AcN-9*B!V6bNxiz#4`V*gf>=1%@cQUK#{Z2I5o zHDeQuy1gp4K81`o&Bm(cmo$;1Gp`?y4VPM*4$gU}`eoNR*`I$UVj8|r2Gqiq@1SHT zN6g*zRk&h)9Jp8qrb#y;qK-4-4;Q8l({o?f$cL#*A!%Rsd3T#-Q&)*96L$plMhAh^ zw7$f;0p^C;PP|7&b9E@;`S6;zG%UH5=7i<$*M_HY60Va*Tbvb${p`yW;B&Gv8e;*+Gw2rT1(1z|S`C zxk;Y~b(QEnYewMVHQeDyu=iA@c@LVANUO86h{=SIB%H(d1MjQkQ`)iPA2_Inq>)X2 z54qLQpbi<%orW&|>D`?vK}+0($Q!PVy+mY#Be6k|_856xGPJ+vxWf?OXcViwYS7-} zVXsny!Xp&ikhT@5{;2V6NZ^|^=uzoswX!lVq44!}X8m!d`sCgvFAF)!FG>w|R{I3B zxJUY&`0rp)H%DI&m}@gTt{5A)3o7$}_S1E;N~dSU=-CWvIexlYJzt)2XmgSpY>?-C zGF>gZB@V~=%^|alXuGfzW5p0^h?`(=0Mf9hOn{f)p0Cj8c5DYntb+&0rik@VGZng@ zUxib6cuVJe7cY+yJ$gjMtO(kMQZQ%~{3V`_Sf&UZz-Q z|4a~R!xgV=NNu#H&zO2c-pEcp}ioYwB&HKgI&gFdL&0VfEKJ`?RSVJQtB!{BD zOQcGa^86j%wk?l)b7#%;igIvmw%_cnjNW$zpFKfk+Kbg+39}@Q{`0nweCYiC<1`sS175-eOrY$i(8ANC zDZ1)dbcF_0Bb8X0|J~84*aEYx>91>Mzp;wf^4~3#r`046N`qoM|LY^SBl!6-Y)W<2)I{fK_LD#4q2x3rUV$^lqYDpCzGk@f+D`567}`6jDI zYHC(ox--S%m|N_|Y$VKn+t;a#v0;7BBuZ-2?+GS_DaBq}F2q6dJRjsI!JOQOWr_&K7ZiZ^-VafF zdU|^dzGi)t$^$tAMvY#AhM*IkIc7B6hkAK6b;%}W6-~N5RnL{97<`{oS|tLZ1&AFy zbsn!|S&Ilh+v6B4GZ7G1$^k_aO)D%HR{o|%N1QpZ(($ zrw%UG-+HufHA-&xgexesl>Cu**1DrcEwZana{Up!1M}OI?80s}g==b0rEvpM1cHKs zi9a6!UH@(ou<<(c4$Pfg#A;W33VB&G|aRwn$glnOqG(c2e{p6B+#Q9OFiGb+DqFl>N(T6!miqop%;4e%Gnl#jy&Gd4P8hrNGN5=#BHwncNp2D2{$LZbli8@iu2 zydwW^&4KX-$auA(VQBv7*Z{Ci1Ox*3=EJ6fLbzf=zEFTcqb$D-0JU6c2)L%mc` zso?Zv?#9H?K+J!cC9B^pY8TAK245;W7^VKb#)b#mOY4y@PT~XXT`SSy^@b;@itwF4 zzIY&AB}s-v5MT96c1fqAvvqPjuu6CqK8vKN2NC}Ei{AjIxNrQL%p+$|55iEt z>)O<>-BouYp9oaWj^PozVK3#z*|>Ydem>k}o)pdg6Zq*?beWt>cEpXMAAW5--}vmi za-D%ypm+f7C39*&c)gG_)lIHzV8CbF7NT972E7J_*F?4Imo{4qU9kt-Q+L;T8Ptjj zt+@|}P&}twC#L6rsEU*K`x_GvS4lWvJtO;O8@;;@(G2PyV~h?zH_@RKQ*moL}v7J;AK^|5*dsI4tJHj=MJL z51@+*nQpVAaKv}WawHd;bC6XEZ&!9%iFv)eK^V5Y$}sz<_wM(^*$BCWBeD15zCe#Q z#FSbCOAx6BoTDaz?+-q6Zfa9;YYX$0@@Q${mk3UFw%@%g3GBb6=3~u;s^0q%n@)fD z{6!Lde0<`U78hB4ue~gp)^2XCX{@Mj7=z{4uIP%wL zns6V)EQ|K_Xsq=KdG8N#6%?(MWtIQB4`;`}1d*5}K3ZHh(GC~sC40_%OFXZH>asfc$#0P%Y)KOkr zUVidZVU~-Oe44wkk%gI=g0_yrPNvofHY>Pk85)k^oTX zklu|C@u$xn7TN_C%?#BvlDMK%q4S2g@@f73@6nDlTCeN~* zS%Kb-2)({vUY<5`a*T>MM64)Af=3dE(8XBs>BklV{f5<^q`BOrjBt_PF9zugKHs0w zWla1KSAObPBXBLR0CwrY7;3dFMGH%hv^|O5n}Dy5el!?z!G1d@WM*W1f+~7aQc{+U zzP`SatQv0pJL`*1(Fw!kqEEc}0Aw&9-O*(vqm1Jpj6Q+vHSqXq3o|zmKJI~l3{4MM z3kqQzT=HuT%A3x$r~R3b_8qtF4~}wNKPMKSR*H9q$=?F;CK?9-d4M@vdv<#8Bbkic zFbqG+67wU#^(dEkY1{CTMFcgp)z=%QO%6coT4X2{Gbl~#@V7mygu z6DOz7U%%dhSnLy@-^>m{);71agfvxgAmZadL+HYcPTWBUA1M6qB%I|v%iEueg(JlC zo*KkpPvWD#=ler2nU~yDvr5$+dtJG8PmgZM^jehgVA?OWS!;C<{}2Q7q_#z>-4;VEB(PbpZ-{y{^4 zk}|E~_@#EG3GB;Lue2u`8rD<4k0U_YW0j<&59GIuwq_<~aS2@lW7oU}2UrPfsuGeu z#M|mC4!ntQ-ec=iM#yvBb>BcClpLi$@8)xVEw_jr^Q((8;~~Huo<*arOk282;!E$f^E@EPA#cZ*AOF z(!iu1zqa%vKz`(wsY|N@>CMK5>%{al*a0a4LzS}jo9j!CspdXZL^cno^E+O#ZXD6PUDlBWyVE=}e6Z0Hg?#;* zlJ=I50X143ZUPx8PFB5yAz_t7%+vx5y_N!uOL<|b7;;7+>8JgpFFH2`XLq!yqFs1Y za{F<&sQL7JWPKKYX8A1r-gb99SgE{uCQx|UeEA|EY$04iSlIKu9HI9Z{Op3v!5El6 zyoByH`tOwuLu7f4-~i~Rkf}>ObTIHKU(r`hZA;)Pa5qlFit`N~b~r;j=~7*x5cRnG z{z%t70C}A2iAO}YM0@_|RR&w3)Uq_Ab}K29l<54n)bj#kmaBq%{z_Y-RBvv$NnNJA zh|a+fDz&Ka*TTPg=iA*n13nt$G80zzzrVC5T?h01%dn0NVBQCB0Rw~a8){cFi~OIs za$!^Dk0XFL95D$B0#(Ob2D^`O2dnGeF&g41Uz0?HeNzb}vJQCrtW!CGmEJWxzw?lx z-`2<+ck*B@3CA)AO2|NpzB(TSEjX_)cTqJCxRNFpHIAJS<%xoZh6jRkB|>VFK6BU+ z!g*cRds`o#hl95E4sm6R%z`%6n$rrQssJr0(@wV?BEMj<%w;_j$RK&ZOoDwTo*_}! zvH3Fuk$cmNr;yxzk~PJ+a9YB@5af5*G3eL{0L4E#YF;b|V&r)lN|F%PGDS=6$!sZh zTl2I!NF#Pz!x22=f3_wQTYhzZJJaIOx`BiY(LUYC;>`I+tDiQ5fli>kcNzZYYxD@Y0?10r zNdG+CcIljaqEc@0;ckR+{3jfRe(Xr8(H)z~zCJRDsKdB+@7_J_fF1C=+}T}m@qq$u z>Y1QD`qt(b1+DWo9OMPFZ)n#i{ozhM{h$fy*|J~kS9NNUt^$#^gp;kgj~uU3q+JZh zD6~@6LcYXeO|;nMt_bnWE;#;3ss`5zwBqU*{tE8f+-w{yur(lU%Ee{`(@Wi%29HH4 zHNvytiV!$st`Tx@@90w&khFC!s2lX}v}`Z6oEaukwfpKpV^khYQ47Am%vDE`pktMdGPk%2oIx=$XPMTT#Q6-|y zXXWe}5F>L!$OS{bJ#}##KpXDuI$3EyjZ+$Z?f_KR*WZJ1?vxDLq^kmHe@BCTTwB}1 zw>WB_jvDF&vh-HeuIGPSwRYc3+eCiV^TJS2F!-ul#Jtv(QV0th*vE2)bE6~e*7|chtL;0|3kTLv-U6u|7I&k| z))T%wxTnVHjq$SY&jnBBs%%=-EG!s$dU^&*jrbG-4>Z;et9&*|tgNgcpeXzIXWZiA z;&xL#w?4{_InRFKdeLjn%Z?aWy~b{ME5_=4W4SPzD!1B>9q96U0QEU}Kl>tcn|HkrT6)76za}07Y<{RDT`du}F4?NPR zveOQ8ZT&!z?y(}5d(ARn@7UE>JRx0ADMzc&k=keb>EV=If>9J##b#uc7@wzWHla$% zvFkiNe<{O6Yc!+i&(RX1N};WUbRqZeORs7lJ%EO9TZ~XtRJCP+?M?X`>X2&)Vk9Fk z4{1PgF4TiIL>LcsB%TE~7xo`T-s5@}&-Hy4iFFsry!eBuS~QMP8n1e75@&0q2Ij14 zO4DaGC=9UkGT@hiu!#zx7siGbbaZsw+}wHhVrU=GdrMw%%rHr+{TxmUQq&CRKpPiI zW6!!a(@}B&yNv}$7ENw(i*|&%4cE(KwyEhrRgj4g0Dfca!h~^8u4dppNk-~_Qg2>& zS(V7rewBiEgV%UaM5=HiP~pK6z^MsI1|A$}SLz#A@ngzv~uOB_9-swb86b@Z0U23c~~10gxsoU)|px}Zb4 zP-RCoKodaCoO#qKp~CS{ZT;CFu7^fbPWwelhnf|#mk&=)?uUgb$s~nY3T@ouY{~e} z1>Klgm?@7rDJwlI1CBRnGNipK>%bOE8aAic@`hFvxXzr0ud*%5vO6>JDV#Nd2X&D#>)J0CcNBukl@Xv?BC(zs|}1Y*7)p@P4;=g z5v1--1?)jltu_e^St%wCQ3{@Kzw5+z{L?SM^Z2RPFmv!Loz%QX7sIu-DqQShfc0#X zm8~Vy(Gjl6oX>?ztu0?&qiuO#BL}s$poJW(h6JO4rSWgoozNdkiry$#Q21< zCYO8Q$4XyXTiG}(GyNr63uFbLLTe|`YJetg-_h)EG!Q+*@=%#uv&ubl3|vo-^Fy>d z)a_b&N?cYx&HgLxdeHIvzFt^~Zy>{#bhn-D+QH;-jaabUhILqT*HqlJ-q^thIzn9V zS44!`lCAz;l@5Pu3+WjIpcj~g4vqz^Xg09G;GBtyiDoZYGL2(3H8biHAsLwxB{Oq~ z8Zk$;GG9t=jU_#khvxJtqYR@{)m)?q@|T&{4}Xkv);6uUrnZ{9Dh{JvB(!BLYP>(;xk@n~Px`d>7U< zlYsAi6dMDk_S~?j0-}Ml+F)0icH59iG^a^UM**R7(#Oe>!zSM~GDaEF`_E2zB)rQ! zB>Nx<^0r7w2yffab64iYGSf@W^W-Hi`5o#5WM^(D2>@=u!N-c&=@h33RAmmiRW3h=y30gEE2!g2xnNl7@m${B88D-%@ z!bWCwn6;gdpZP$UdLrZ?LUT7bV227#Dph15!kmVuSDl(KXV!K-`-6S$O9SN;QC-!^ zB{H@G2@j%kFF;G}7w#er+DvD<=t zKcoBMF?N_|Hv8?zuW|oWl~BNKDu}qTk9eCEM8d00h$%yvZcwxsXjy6PD8m}1nA=6p z3jx;B2sQw-yBl9!UG4Mr6hfs^Kd*wc9)V2A=FsX;Qk9MJ%zJ5*7bJUk`fJ7Ou{1Rj zU$b@4AIrjV1^8?&3;2r*0Jq=lyCS_zPJVvE zc!&flA0}7rUnRWvc2xD7{v+hbJE93vR>1;=HUALS+ss#h-KPNkPEoMgssUr~DF$*1AY`QOH-8f4hh`N<3zT}F>ldZnRG!DA99a-8E zNhT1NRoI1pJY{A)JCgH$j637CaBUKc8&(o-n^4oPTx*6OSL@V~8`5i*LwxmRVAJjK zxEa2(&}R0@0oMO(4LTR6mv>Aq^O0{jO5sK9$cr=n)Kjx;KqAUsze@<8_$o`~0E!bc z2@_iPz+QaQEY*Mj8GRacaqzKjt}`k3ZO3ECHJKl`4 z(#8foELR#idCUikB_$?Sha7-8+9~)VOy_Hfh^)st9?=;va4GSlOUWAt_(4k?d6To( zILk!#;@+mD7O9I(*uIQakIeVb;I zGKys)?wtmmkRp4b8dyFHQFsIsT4VwEogGCm+Myeof8cX*^X02C47`XjCHS}GMSP-!VyT&(<&Qm~xV9azO?o0ROf z$-{u*$viVYoC@x|AeN~^-H{IfML{ayd|qXA;X7fo{k%zdKHvWwnz%=qGjv9&B_O%PpcXK;{e+r}1Qy(_`_;XLy*< zed+z|x|iEiO%RQy#RSU6hWn0o|Kr&YME5hK3AAJDSvin$XsK*c@Dml@?G-F9$M{-F z-|*Un`<_?X(zWm8iyTqpW1C-x@Jf~bs62J!l9vgyU>;uaaV(xHuVDUPQ zO{a)#;|rzQHtNc7^X?#S*ab5!VF`}ao9ogw-=`5yMl4v}D8vh-ZAawK%Mfiv#rA%e zXY*kFOa}xHwMYJLR(WlbMWphh7&r<#ztkb-x#z|%6dD5LshPCKeYo*!!uNv*GOg@O z{f480qS$O$$Fg+Ex(ouZl;Oz zy?vA61LK!CNSUSQeEga?EUlHOvYIC2im69zaE5aAo6{x!U>0m!Z+^QzPEKoYy@57j zH<;jNH{G1&>R1Qx;?JEgYH6ePZ;QFa+BSY~*aZy$tRpuP8;^&`Ut5qbZ@2-$*&qU$ zwLWZjJVz;^q$&ksU-_hGmp}p4b`w(rxFT}gR0NDUMv>M_2v0DEiKX9C`R2XCf!4@- zl(de=HCCMR=uKSQs4Qb)aj{cBn1H}LU~c|Id@uV*w+O>~W9JSx zwctzpqt<1g4vJaaMhR3_G>5OTozSWsT;iw>?|1qI~p@1jO{e@P4i;$ZRmJq z#FguvjmEpi2iZdM;z)j4vPR0Cxp;y1J+fP?=Cs*4VoG15%X_H4dP@yX@ZGusZ?t*F zq0&^zxUQ|W^@9ikodG1bHU*+R_8e;v5axl&tvSumpR6JagXy4c^_NC-<#Ukr^OipWSF5JsQk0|R*|g&+4bAT;EcM#t^6{)xYZL}v;u7vJ??tI)pU zc9$4UY`AvcE62%l%cZCSx2Gf*lMR$O{)NJC0Zc0F1n|$A@y|}OWsNTDaAgJuU8jpT zyFs`$#-Av=gK5_d2PMoS+MKyhdXh4;A?5T&?B#6vRyjG;n1q0^BoOTNUm9?b@OOnd zAT=QJEO5?-^Adchk$|m%q%rr;+^G!t5UL0?UhD4$Zyr;D%cer*!==+nBOw-D#k=7V z=tgyE9Aetf4&;7^EGO3pm2!Ofa@r-(m*=K$qZ=pTHG2~p;!{pr%4C*kg~=fd=Zm+c ztHW=kh>+|Av5b;L#Rj?0TCk8phOw4P8qM{I9|2$vHi)Uj-9jX*ep;lV!UyX>*YR&~o2%^g{i%C)o`EesEJa5MwY(B*Mgb-~XgBxx{z3xhB^GMK*`;B7 zBrUFJ&hcQvwF1U0@!ZSB$z^XI1!8-kiQixSM&+8B<1I_l4S_6p5dDbziHRuN)Zy@S z2k&lsiwL}+H`a-(BubJlS z4-C`CXavLnF*P-H9{hCAK(E{@%@C4tl3dF8`JT*=(a z|6cgN9i4Yef0+3Ts(XhVt_^|xsK8_m6B^SVLOkGs)jo&cX7VYz;ax_)lUA;hOvoYc zf!7?!y?t@S@vS8+6epKkJC;?E5uu8Kb_TCn+P+`eQt}k5QA#_qLu2u~Q(PsQiasFk zpz1F_k?WIB(E&J+b|%VC-Hmk5=|h?tYbG+ev69-M#+>i$_3iM+uX@cpCjTeANf45_ zcto~WkVxCStD;S!UjOfS2N7VVs+DCxne<5ll9X4&m($mU=X$P}UrUg};uBzpzxo$M zo+z%jj4LepjM|!5CEVuCmRZf$uM#xg;Pvr%!1aZs4Js_I3U%{c>1H7DOT4}>k8h%< zV}HoHs8;6W@jvxj^b8A!FdP859AoZiAmt!ABaSWMFXB7-*Rl24@%rNA!o3sxb8@qF z1*BO(QyF<(>UI#1hwUsfG51%G!a>on^KqoXu#>OzACN-528+$mv~t;!(~EXRTrfKZYiK65_4Iifq} zkWq%@$U^R5!l^KpdKRF%VTUR4)Gf5aKkIpqB$mWOo^?Hx_Q<2)6Rb?wlqw}M2ZN9N zul6>jiK}f3){r;9+*VsT%sdP1)1y&KR}7YV7q+nND}Hd&FWqN6D{wE<(*po>cH@6| zsP|9wppekr{x0^1d@0O)sF=KtRn!i6_}em0uGHjCL~Ctdr=T(chgnLGNTHS3%hBwla)I?SRWcfHDzv%uGH!J_yh#hG zcPlCc18TA`U5T26!rRHm(*5qC9;iQcmu;IVy{Hb$xeL38nxP9Jm)IL^@1I)bfgLME z+eorqUmA(W-y`7Qe#^m}V@7v2`c~yOVV10K6ig{Nn-4z^9ze?wYqR92Jzx*SU#;Pw z#x8F1^4MQJgcI`L(aAF`MHD>ZH?6cjuR`XMf%uW#VJ~~2z@bDna0ffN%U%H-DBll~ zb?RScRNC`>4U0M^2pdgDN%0w$Q@k+8#5r_9y!XQ2%`aVkUi|jBLZLbGWh-4{$bLTlfBX*qYhi>f#%F;+B8-|1Tzo@jy<= ze>8nFIvN^53{Vmo%2ik3O+bE4zTyLg#-NvN^gux#LTQ8gYJ=C9kl?yaRz3EZ2PV9C zR~8nEp8s?&CI{M#Ha^XK7H+8jPxFgBe6q;m8}pS>_N`}7hp!T1%!?s$1OP=6V{%fN zX;_Qo*{A~OA!C?HKT-;Z)(;p5dD<-#ri6}}nJhgbYrj0F*@Vu2qZT=+K5q7(;wgWh zBZsFqYbS?Yt$K@iTVDkauUaYLJkt4h_311y$-DPzA=FS9r%T;-}v= z7NpiwH zJzY+^Z(XJLkZb5K!Hf>Kj{xQ8AZa7n4;e@Ad@p+{eoocazw8_yu3LjLYo6t6z(^qq z`3xN-c@=22x0#OsUxYV`fQl%6NyD|a%MDC1mO29g&&}lc=J65l%%xM4B2t5gEl&}} z^&&3^&vHysJna}BHZq1~17mh6s$AXsE`gNf*pb5K9W54({i@8|at8i%iGY?wWK~JO z5`ZI}Qq`OlBGP1o?r$M*5VPoe1V8i2tegu~d=(MlK{a`9a{f?GKz4?RI#I)D!dN&LF;VAVj;i1rz18?05n9 zP@4<+R!3E3vg964Rb=cEf;TVI}w3J4I}kd3bU9p|_0a#ilo3x=jzmehh3 z+~JnEDiOKHw*#mjMrvv7C7>Tbr~l8V{BJSj?HKIU4^qHfG^&j4)MZD%G=cV+T=R<@ z86T)Ir$p`DSEZ$di%N5%5M8~|vqJ3sEK*&bM@Fmc$h$?(<$a1e3xW`)OnSjI?mdQz z-;jzSx$)($rmu05YWGb^BI&!SdIiqkLMN2Wep|mw%%N0AK~aC1`@Lm;Bc_Iueu*_a zre?q#ZmvxkiFcM8|4*n_KzKMXd=Hjgcw+j@Ie6m(1rJ*0$JM7tP{T-dUGm@-ou^tV z^&)`P%^^SFkptdKxjMZf!aWeURb4M}FYGncUdhd+oA=d6wRV)+4DszQ6BvjxgoG4k z^nq{nAWlwpah5#YSt_|00RmRd*i9ny)kqvOpx^b;1K+1i)3(&`Z4p@zV91A)v)D1B zrIc z(5{|nFScU-)+?uC9Z52uZEy(=VVvuupzXDjlT(U`F%EF>?(bg61FzDA)5Mb-k>o@6 zzx>hJ^|A*sI;sNjREj*ma?>|4@%Xl6b{i@D6Cegy`!#eJGtl~)IO(}=Vv1Ea67^AA zlFI%ays59W!US!bmHi&qsF`!;DTg}nuajAH-E4z+zj zs3<7^`}l-uO55OgU4X@RElQsUjr%f4ev8*H3;)X>Cgr#td!;Qu0nnt}E!_0=B2 z(ee5pcJg;5X|*J8w{r!SUHF$xWHKS-LQ}%GCq?>tng>@sQh`JH!h(4QLP{~BtB5*% z^y`+6H*pxOse!T`SfU6pKkSE97lOrBR{JIX+Y;}7eV=a)s_)lNU2GIv&438xqY2o+ zUr$NCB`+6wORe4XaX0a2+$oOkSO1uInOAr-Q2Blc*(OBKqjKtO@(>6-KX;xjqd8<4 zKq=!L?Z%fH6^Z6XQ)Yn!J^htkVY_obaC;w=4UXiW&~dMTA2@4%B*2v8i3R{=;AgAg z&jJn)pY=sw4h$WR`KK$pt%(|z|Mx~_cpF0}^3pIzosG_o17=Ams*;;~^dO1z?^q$i zcp03~L!-!nL5u44{zm}U2nwye#W2<2$GvzE^xtFI>aPXv6OvwN42_97N`fJn+zayF z^j+}Ho2s4!v3bgD!P&sSp0CzQvbOM?mkeVg*j|sC5Q@&(=v-vOklFuI?Ys_O%@4<8 zshMEbf8@XD5n3B30i-uEf{!R1{__KDZJ{CeadLgxvWX4rR2Sm8wVxa5@AjL*pgRc> zoy1ZqJy4*llyD>39Pu^2iU}voLSOaBVjcwKK#y=yz zl&K1k=D;z$gDfIjjU~!U(_`tWF9otOUb91ZR;Tm$g3JNn9)!rlhXbk<@1Ya_Hz;#| zX!Rd10h!^+P+`@m^yyb-T`JQ2G2z|{!r8#UR6tc&j+lZgg^6^m|u#7bt!1KplYEw(Q52_-QCk}g( zwaOex^bk{MgD_dcQ#ZvY?BJW+Dno8`KB60T^sS!8KS)F+-pb0S;`9~Rx2;=wVILce zAU&gLPwBA4@wdUX^LqLlxJqs|-ds;{Qy1RnN+nuwppT z?5!NlV3+a`$jQmk5IiR#lO;_zsG}7c;6zD&|D&9z#LtGQsts*10mC=)io?l~(g<@( z9uy34Yl!lG#RixP5)6DiV^R*g>Vj}R$4v4s-SL%`QB6<=1JYaSgp_htA+_+Dj$bi! zm-U{r7X?WqXlgR=JFqrJoT)?Vs1d4ni9jHkVJsq8*?=Co;l9BzsDqSZyiyY!g=B-V zp@>r@v$AVrDh06H<$AWGMX;_q7%bUMT^YN zo&IWv=4JNe+$rwvgoDID?l(n-RK+1!C732Uy-NjNdp*2c@_4fqSn1{oR;D3JX>Dd2 zSe*6Cq8>RJ5qc|LRAs`VgD$VaK_7~>7J3-WCV>RFShoDqBxN-t9=e@1tqIJyA#lf3 zL+!}$=^n-H-vZvq=FUYn)Ukhu)A$oqouYDUA8!P%N3ZgzDYeSeODpeJ^W9xEZm)iX z+eROZ0Z>B%F7YIIcZ0|D%br|iP`Fjei*h`!3k$@_s! z1oJvzlKuS_#D@Dx84@X`@UP3o?Y7yE`?5aw&bSFyH{F$to1v3_=`h%#Sdx&okk;ml zAtP28vN<9L?&7oVip#D z;S#)h@nh|H$U5C)iyo!?_iz|9j(_%=2jt0`{ys%8&~RW}_Ponb9I!j4_t(eG_bWv}G11*~ zQ2*CqU8}OZU`tqe+>f>^q_se!M33J;o@;-BDBe+<}Y--v=zNBg%G8?NH9o zlyk4l$Z;d#Iq?KHH|gk>1yBr)y(|2N?rQq7O(tFF&OO)f%sei?oeyKim%}@oALN9L zfa1hwEs{9y1Bcu|M`2x-SBU}fWiq&a|Nfnn^UK5SDY(Y?rZOgy0=T^Q1Dfs+BG_rg)?E?Hs@4S%mLzebi@r>fIF*S`Np3 zawww?+?1(oV|MWYpT-88nB7*OV&n-Hr*KUgcVOWv=#12AjIAsb_H#*oLTeo2R0IzH zi@!VQ^^>;}J4a_sZL3TQF;yu`mYTM=P(@)&Z1HELVkk$3}&nYt9f{@MQ0KRSWkpKqyso$vd- zd|AW68C!ijY(3Z#V>^Xl4^gJ4rt#_`U|LswFpc7Y85G z-L}FR!#xYZ&^l;}j^tFX4ok51_v3*fySU!q)4)sNFMd2{^_H7aFgXGhH!nY;D@*Zf z*UKxFV-`aW7~_>MX+`zt@AST;rPf5PH=+7>UIv5gPZI%1d?!9^7{0D9bI))R81SdODsz_Qo@oFN_Q?PAT5YW zr!;~{%Pt)f3y73RDzzZe%@PXIf*>Uz9n#(3eZO<|oH=LznwdNE%rnpY!moCF={V?m zO0LJ}`Vlrq(_;TRo1Xrh_olVt=k2`*A|lCRl10v$T8|!4Qd8q1pE>h=RG;ez{ZwY{ z?w&9@YG~FP#GuEqo7?I^9!CVjW}qojUu`~bn{A|ze=bwNlc+^TxB4F2`bo5uuhhW8 zFhp4eJ3B!_gdcOj&R1e;pj-?3WR@w9zcMVT618@-$LHYSh*mXnpTmv-#;L|Ue0<6& z+(se?$6I!j)6<k2}MOkwxF*e>x3v|0E&X(LLI#? z8Uv0uKh(o0R~!< zzqQ_yYdSa=E}EkoHg?({3{t2U6dG+QhdjMxf5IW$BtE;8G!m#8WENt%>flWU4L+bl9NkzV;USWh*Q)we zRQTE!YVR|NWY^4$OiY$$V$3~dWuTr_K?BSaQMGf~&pfsrqN>S9N9O7YKqvW^+?;qm zLyc0NA(`Raf)8sqYinxWK}g)h2+z*X+3w#^V74DD{BtKzvBmABdS&J89yk9x+-5UB z-(M_~3A`{}@#m5h*(fQ9G&(KZgpie+u%i4 z{y`P=RSJ34KNsyE#9Hp96SAr<;|xJDVP5Br@u_g9bT}_-oIOOU3UMOBEO*ujGK@xG zz2y?a>vU_Y>N*i({(pW<0E@3_oBmtCkd(Z9fa>1K!^Q3!v|LbF>m9@6H-g{9zN)FK zi-=akAPPWlTOQWZj0jGl(SGM`by?P}g4YT^Db>>veg@Mnc{ndD{Fem1rH{tyyGjr-3^}Ta13JcPr&H6?8snqnB`&>Jq}BVDb~#V2<(s`Me+WDtvZbr;H>m0N z%aoxHnf^O;*VPT}#2g_yB&~5;9I^$+#gNaC6Og~6?gD2)ks|732ZfQMcK=99uZ-}-8LcW-5J-IG1u3Ij|IJ z%i8m9G_IR{;}`4I5xl}snVubHs+SMQi=tTI)fh+S?Tu)}o|JXg~!^{f|XD zH}x_g+@2*sh#ZK{Zn_cF)6-k|Rq{N>>JDmZ(+lbNb1B<{t~|Wv6+E-GDRS~%nRi3w zBiPv|!;*KT!EAFmEsK|d7vmZgRwdFj zr&%*7D5!fk6i>@1qtnJmx>^^v-N!V~OM!GYvq$_XYc;Fw0IwpgoJnnC&HR~RD)Q^s z95DQkX@K--gssP&6$To@hQ{Us%z?1Gc`nvt*RhW|kdbh*<}1SAi7QT%+Fsg6?l>z*ARp4JY(TX4G!t~Pul1Q_#M@`>~;>AD7|r~ouH zH?LY)TPJR$FKmwvt3XO>P6%|1xyso}s@}vM1 zYw_KIFqRPxP`OnQvO6LmQ5ogqIlb}MCUR5lS9b}+A~3`pB7xlNxe-^NZaU%toiIF4 z{yifkzPfsVfvN|`>fYtqGvVv7gwQ17alY6uu?y@gGFzcL()u21QJZ^v9z(!=l)su$ zkR~_rTr(V^nR?+F@%pJC(o7O1k?VWf-05GR}ueDEBZkNWZ zf(LG?3^##lU!+(>YXL8)GsA2)m}IICBQP0UT_dYl1!c%X!pccg>YKhn_&V|_{vS&|0~`z!u8cJ z!2J@{Tm6F4XD`=kFOf-7K!2sTDFs9a$Wt&eJ>n1XGyj3jGymXo;ak-+M_dxE!ccqPQ2XqvV@)e zP!=NXAxt0?=??kjxgh}xB+CNBT1@9 zR7Ch|)PFSrIYxSaG8?8l2O2o;Kk(>8*1jf0YX=5}vWFiT)*RL=2bhrp@cLZz2C<0c z!Gq4-8;Iyqf?r4$x+qlhBA!Wx*o0I-lnp1FModyNDyv!cqq^aWZ}v0jt4GxD`ixVj zc3qS+j`dm;in{pvI@aD{JLj0e@9^@aH^SJSmP+L9NIrz{;lrJsoqyMfHpK?WDpxl* zF!Ks+`M}P@Xq;bV2w~3wtaU^2Li$Rb!IQA7`#a9Qu~APOx41Y$hn8ee$J)-huvrvs zkz!M7e|b+QGyDn1!$piyEZEq9*Bku_oVYdq0jT1$=(MAzqM|jLJaI_PT2aRrj{(pK zy>s4TJ?Gdma(-+Dffl1fek;o=XrM|b31a+8)=u0?S$C>PrTg<@v@!L02l94Zy1hZQHN%_>%HHDfPl+jNQVYp%#h9OtS^r}4+4~-4Au}?Bh2_lWzUNA( z9KDT>wko}zTsS>AuyH0?KlpS&^sbNJ%2`QA<>tzLyHM*lXjGk;NRE4R6iyJwUR+V^ z&pZU$1qeAH?F0AIDpeDjq8It;lU+aV#uWx#$qeBd5TW)cruJLXr)3buq zDB5YU>IgXwBCa{{b)<`ZqyimxF<-QjZ;|)YH@O%u8k}HxO)ELsRr1GuH$o*e`jNOY znsBirE{)_1{R5TPrnzh6Z->T#_OAukvINL|hTVDlc=^9GM6iHJy@wS+$Gn*mpXJ7U z;dX|5C-?j6{f02Cg!P?CFZs3CjR!E2TaNh_%hJ|iKISumf03^>8!;XfP7uAJu8wBnv_KO zI1G_i6#s_|JNoCnCall!vFGuDeI)bx0T`lr1n#ReR=MAPa^ho&%r->oYQ$eM2@bqU zrvP%N2}TY+B5weMPB8Q1x+bmEJ?aDI1v^9RhsVa|@h=F^qc!=uQyQ4%{4?Gb5&HWv zXT{&qjPSbmRoXmbnMNqk&^b z38{)6dHSVb?S&W4_Z#y$>9Zxf6?8u>ePd$MB~qgfSwvBDlxFWjpgRK7Rj%7`bAyG=2UG7+?lyf046&CLxK!&Kar*f8a8 z^dqLGGjPQmL+XlhUIvUl553jcij&7MR8dwD!F9b;%#398Cy*ecbDaD|`7Of!Ow^HI z>un!0$vq`uFiWzGYMg+(vQk`ScB%QlBwSO8p~`ZNje~=FinflY*z*_PEosd3ZL?HZ zY>;d~BhEKM@Fo+vOYp`DPG#+QJIBNSAmU->gUrGiTuwsVB$#?+BpjdzFFswY$*MX! z;(UGl-cbN(2Q2fjE{8irs>Dd&n9&pDpN7|Zshhe`RdR1_p8I|+gKggvTym!Aw!7RS zzPfq4IBt8L0XXy(!mrzw+)?%>qwil40`9$CR#C+1il^q!wdeQ;NR7l2=sMw zVa?Cahl}upyfEM=@nJ<(ya~+9FQkf8hk}zBmXyZ^^%hadIZ=09ca4i2`o6xt65DBr z|KH(Xo1(HxH(+w#ZC)drJ?(M3!m4X64?t?Bs-HwvY@i?ayFB1{&8jD zDJv^eP*CJRAnv68v*}(q1@=S$>aQQtz8iKj6wJKtfN}*69@(tXJwil4LOrvhc3+Uy?=0Ne4hnNeAiMn%>3?I4T#LphCv+B zD2k~ZSH0I+3R7iJ%i_BQDWL$`bQDHl4mAA2zUgmg#Thw1_)hp;$XEQKyO$dbK!`J= zA1{<3F_>_0ZUzPiGY(88F{#$wTN_0S*oYWWkB^wN6t@Oa|paRcxL<8li%n znxa&TP&;$la$ap#g`!GAgfVW#!Yt0Ev|!=ECK=`V#mlJb+Cs_fS1i=R&PrqkqMAs`#u8b91>Daj1+J;JylGaM#5sfV= zO6k@gRZ~3~Mw*$BVnG>%(4LIU6YTjRJaSy?cCw*?pf3|h9Z`!~`|U&(qnba_V)CW5 z+*=yX4}G#dX7Npuib94bmgr10r6kSnN3fRgcAG%M5|av!vQ4m_<-?2mQ)N!%=Th7p ziBq8L`YbAw_Rv3gT7jjWf|8Qb&s&;^_}}+MA1@MW9I44^xbDewHPU6eXfQX%`uR4s zV3gcgQ118|fk6R^&6`OA9#-(s>=arsMc-d&6B4%@(GOo_F5UQ2u0#fIuwO)H2eEv! z2_=zXt@0lRdBjspHQ3ow5J={w|}R6@XzJY!+VJf=;f;p2`iw) z+<#zgZ%l@RcwLKxl)5-uIXeTkE81r2k*H`fwfIogvfw(-IHBUcdMFKt%`d!hfX-_)ASPNFsI%lcG zoHybyzk=u`@{Ejhy;w^5ORZOmpJ!+KK2FHoWCS^p*p8nNA874gL~uOEtGFGU4@pUc zchaDh)t`F%eqboZ`{rF79H1&HDn=&8|5dCwHNn)uUz5<))m7izI3hpa1}wc{M@A^{ z%#r-?k#*iDb5q)HRU%1#`s(AEwfODl1T#!&w#?t+(o>X`Fm!Zd)qvgYTR~A8q9BHU zz7V6=G~|@pDAdpAjY9<;?dLX;zZju1?YS`Vr()e|oxxLt&R4-oRXLnLnt+AJpXAOT zu$;w_yH-!Q3%3P|*yS2ac4?{|iZ%@;oFUuPrppQ^TukoA{e~jka=Bp2%E^UBOn!IV zpYr^v@_vhlO6U9mXTiRG_B%i^`DftR6q(h;rtnU)UFH0Wk!l18JlZu(4!J0Fp|-31 zE%PD^efY%UT?wk4lA)uK48(9Lwa@Mx!apf)C+PQ+<2*=zQ}Y|cfA$UQF|F%3Rf&v9 zGohALT)6$}d#q&e;l))wGxI!aC|jr@Q|^S8H>0AEZcVn~(n2B9+t7`wc3R4dnErW} z6K3L` zt`B6cJLgyq7L~29Kb`wp-?QrKxfVMy+&W|@bCD_JVSUnL z8jEbUO%}<%<`MnJ(I(&h*;VB~!4aX4%*rAJ6IE<1Zl)1|}6z}$& zx^m!dXVk_Vxmv+dlHaxb$Qte~d#XQ4obSKhfa1+=n#Nx}m-nx0ZLnHN{`3}kAoq1Y z=gYvGzf+PYELV>WHs-cC>a)HsUMr}c-0j*v#Md0Y^*hh{lDab|8$+LCYW?@{njvH{ z{u^c#HnJ_;>jASOUSy)d=|vL-=BdL*5M8)TRC-0F7!BHlcI_TL)!<0$!UL9YioztH zBat>=^Urf{?2dU}5=J}4es66+8f38LURDR=4?QRLsahTmy|}JebNIf_zyC*atU7s2 z@SpTiQ1@hS3xQ>w@JU^l2FX^0f&wERVfuGp?8Ux2Cuh!NYEmtR5>cc$ESP#tOUDvQ zi8_*E>+Tkc%k#4p4&3Wj8hUEK{Le>rbvP&Szm6wgDHktDrsGSI?EW=*H0<#u3`ro zH2f%VaS%OwXTy8GNObZ6hggmtdA9gkhR&aCleu)ni3-D|OEKP0SWDBAaYC|XCI>os z{;9o@8^2nN$JeI|`+nd75z^VIT+!Uj#Ky+WTqxL0G0L+98rFe zZ=7CZ9EQc1YMusmeu#gNc#rkXzE;P{Db)LS9kbWkYe$LjZUPk#93^-QH2wq?gl{f7%p|i6rehIxOT0FGIM0&1-r7-e3t?c~dbQ z!-L=NeigUXx3{w%A0OZE@vPe7c!2o1;Vl(>C1q-2($i#C0T2A_2wPCOVfHqdvRv1@ zDf?UgO4oI8e5w4^kY)}uDL4hSG$;y|^wHo!?DMVEYC~GYr*<^I5Md-D<;>{hRvR9S zEMGXMUB2T2*eos?vQ9%g{QQJSLhMHZEgLtIe1*-C#0+Cml%0UP9*^A4OA2mi;@M@e zEHbmAZu!y5ZGF`%;PPQ`7izG5D(+%402gpoth_7EC5|12Z0_@(kAG%zdLaD=#DpuZ z?fY3(Pw5*NbTpa?d{v=YC@&(n*=uk4)t_%RPNybbPwO5 zn*=T~8s9xB-0%lABMw!bUFeyOjvG*JFW+s+JRQbQ&?;=>xx7xY%m?fU6_J@5uHX`R z?{MFqA(CQzrTUg+8CkguX#HB#54y1?V-od(e}mQ^|Hu&nUTZR>^AhkuDOB8!(<5v+$a zHl2zHqvtr&x91_w!&vhS>-=AmVt?eEo2HWmQ*U$HE+xd23C3O96*=JepoKxExC_|V zsD=iq^g)LleO^Jq#I5yp)XcUzScGOO9R5WDvHPfqB|;$5p*3vCeebCi`q>zQz8Xc7 z>i#lZ_h(7uT&>AhWDVlOS;-dC*OCSU?G!?ZfFm8l0F)l@Yx360Vc=<+Q(llJ~w^58|7@#(AjBg z;*g%UuFQf6z;t#Z3ABUR{=U!`#fjxCCPe)ODdqP8jCu3>g6}AYTSB&mz*B+sbbz`< zDJYu+I6jl$WSK(MDVJP4S*qW# zwX&$_zF=vgMJnvKX|7D*<-A5Z2Re=Qb8Q7byYiXGklOU_3=^N7re&C#>oDsh)fNRM!m>;v%M3z z;T5d8Wgn5@%M;3)s;sm;1u%<&KN5JUa-rbiJhJPA5$UUlIclO%)^IW5 zSE|exg!Q&&xc*FhqJjG2D88^H0KHJeKxYj>du>|$3x$uCgibtgF1w-9*?*01U-@2( z{oS29xg=-3`m0>{L*ixm*VFIV2ecbEik6aWY1U{Si04O3C%bhiC8bIwJ(lnTMIj1u z#qsyJF8=4XmQk$erK8*{PD2QO*UYm&6-93TU zm)OmgkwhWEyHqF}^ttHN3HSi%a=%noZ)hP79z`158e9xT>aqMu#o%YhWWxKQk-#euyF z6^m5po`~2N*2ez${izcp8KAjYss(oB!=A|thkzbpsNxz@Al{{9-qsQJAd|oX>`+*I z67r=vV;+%sE?_{+@T)kp34*m26j-S2htwOy|M60 zRlw~*uo=Bl%iG{oU8c*Mhi@nR--bZOu0<;YW7PQFqp30cgHHNfBu#j)npflgo+n)z zfxrla@RRIop!1XG!m}&iU4%b83UyadRznDnz4Ys80uFpq-l&#BcEovtnc9GSG8b?R8{-*JK{guZhk3OZ zbt$t}c#>@cGt&5yfd$->uEx<)(p55<+E&XE{;>TLD;?8Ke{+q%e(DN6sAs52ySBL0 zk)mE3R?cP30g^TGE4F1Mv6lF6ubrMaIA9_f2Fe`AHw1|&sH>|JN$%8ccOPgR2&Cg? zDUt25YQ^i68uHCo=5wYrFU=K2udzMOaktP6%X^ZFdyuME=~@FxU$s|+>O8G_HkHL; zb((WhB0nU)3MCOh&EyxF-nXW^)X+IYHr6`b?DEb$V# ztNT9`6_%4nByZJUrXvL&$bkKaPF4e-z%j6b_0=*5LFLks*T@Kg+?T~cn5wFtcAw2^ zM-M`s*RO$VIG!<$!C_DE0EALStIFgpj@&i zEHtzwi|7g1Dp3e9q<4JV3ygOapZWIt*T?PCwXV(|T6OlFGxFUuYZYx(6?pWp#zEV< z2+2%X!eb(XPVxsJ7>j6bT3ol|=7o0ExQcP8NNHSDtXJY^w^`OXDK5Ij@x;W?Y?F&; zQqMk@6Ji~)S-7nmO@t2Fqy_GJ-9mVn_#;!$CZirF z-|fc_jj=C28q-N9?<4*6j1ht#Ftp#)D>!J-yU*OMN8V)9Ht%+YC#@A0pBXBaS~72l zviK-3_mHg*?y*y-_?ya?<+sRwJik6@rX(_OGJ=OIh5Z@xBp5AhoM=D}JZ}_JnOP!m zcJv#P#q6_@s^QZ1Ol{02p~yc?S7&O6Tk(sH4D(rov1nINKuthhF^F$$ebXTxl z8!WC)8UGAlU;~RYLH#yk;76>x<_M&&t13e>**#*&b5(7lHcqY18_b#mjpuO~WTGh!P z8)cS4#<4zAgUlk!Pa|y*T&Z$Nw|E9UFRo@m0N@>wO75W5uT91j7amt#mECo}vb4?ZkyP0k} zg25l+VooN;oLoQqv#=NBRyfq>oaf~{=pr!W_1QFa%FrU~nluDbk=ok1i{zy-Xshr=+;1f#Bs@dyaV7t$CJqFo?_nQ70 z{)F=DdyeJ&x?}UIoE5QcJq|k%HD|G>^y5_6MUWUyXwF)K`l-YDBx3zR^L}Rs`Gmw7 z42~yxO6zsE^7Z&sa>h=F6*suV6DzI#r|^uv33TFRnpDK3jmo?%#)wCq3jfE# z=3}?kTfsd0~S-@8$@j35#?IdejRHGotwq;-#bmdARVsW&<+zk7iHCffQNXC?9uA z523>w@HOx;`m%X7*Rxs4^$+yQ%BD|vg{&9|8Ge5aS0>W)_}ar}BelS2_(4E57aia4~D2r{c%p84U-oN=A1&#o85PIqi*SBTU9 z(eF2l`~7l(OuP7BPk}}$49;SWT=hl4IeBaxr18^#9rsHu`-DBN@AU&b8AptwXA z+QNu-WvREA>I%6xSLq0#V`6+UU3J4qCq{9ozy~ort1kxPE5oBG;P{1S%@9T0OT#_xom z9SHi-ep(t0W*OwE^{#-s4gkR!|^n0nY_<}jm#4PJ#-?nVVvWa0qWrkMe z$?1pid8_8agm@5b&qiCwW~Xlpl;`m`(Iv?w=HyuMn01m3aIZVWqQo7sAHW+e7GBQ7?@itpoMO+yWR^8A@K9@> z2hlu}?HeBGox@eTB_GNL1mb<)lx>&u<{O9Cf;uHnIF8z4D(_Ww$2Q%mA#Jm`x$Li`qFic^NZUj;wii~x1nBa2@cIy>0M1UgQ-aFr_kH_exZ`M%mgg#Fgb_iAI z`&|d$nSGSGH+YwS-b!!wfGHkT9Zj2&AsLmbs|yTvrMw zTXd-QH?Y=jJ)2*6l(PATrpVG}hcCP6mo8m)RAEen zqp37pES<9R#>71-;g(34bhJojfGHi~&f-qKA|6=C_mseoWEo^cj>8+1H>OMdh*p;o zPUT2)KPUq}ncMrmL=)SclDy`REc<;0nbEgAdqK&(g1OCwcTkAkimlzwSuew2wq%go zdEQ5Jec`I+8hci4Y@?6jer(?R@&pA!yVOmU!{Z=R;aXrkLMG{w zQhocls8yL^ey@>VThZPCv&d1Y6+87$%#>Ke_0WZ>--mB!@4@-yyK;xiFty|m*vhs| zh~3AL>5%r`mUv=$`w{xQ5)dXrVxjmTYZp)H-ee*|NdMbUKaiNoUCejSwtl4g)#oPV zvm#GKz{1cp>9ftTtZ#QeMX^Wi8;8e{P-CrbMzI66XmBaLPzKkX}{8ilztvM@okov>};ZfX== z{0+CHj^j6rKIG(~6*6H0120m3d9P0%h+=jR&iJ+V|BTq~$4hKp0GYelk~XpjZ_os0 zM2}IB&YRr7Uub^-QuyOeu$cZ_GSr#RYG!8K|$hxK}SpA&0 z&<8#=&l2tTHQhJ^_N81lc5155?-`t7{r+_R5@#0dT@|@U?H00m448SAd+leokSaCLOS>rp#21zjnAchFVIsX!gP&H^t66tnXbh-z zcMk7`G#T{KQpRnz#5w!d7AgGAUbC)g2@Vf#UDgmx;|!9UG)(;r;5tjlmKbQP-zjv~ ziBs$3-oW=IlI~4~4;G}Fg%>(^(wWFU&UnFp7^g3rv$rf5pp?yvwOp|!X1Z$^o2Jjr zUjFZVb1mjyw#i?=vP3GGTSY@L0Sn=fox|s#=kP3;W4%mN!(dzUPaC}@rH{C&(YFS; zvtt9O&h~%lE@c+`vz=c;Ic@oZLeR{y0^$ldVWL-q0&%r5M+EfZSrCM3W$UrH`O6dMrr|$JL!!P&PU>9{toGK|gM~<*y6xC?sRXNf%Q`dl zgbYC|w?Gk~xq2l;jX)nKQxni)EFfVtKr=_SK*Xd^-WJ!E6KZo<1PNK}=_8WS6xj%) z-CX$41^RRe#!;fT{+r0@dkD`EE!ptuXs$t=4ESxv8 zLm$0!L=I*#26rKC)P2PpKV&PWTSxWf1zgq=ym}f{D4|n9Q4N=rlDgm*$SnlD?dA1d zpSO@)AakgHB!L%ZyNXQtR-EHb{m6DUKQ6$BZq^rOZ=Y(z$2$}h2+Lh}-<--Y{T!H_ zoZPGgQdv3(Dd0gvN_^^1G`X-$fBB&_SslP()l0H_uBu~Saox>M z@imzW(~-9%nqz5%^NqRJ0dn}uH3v2O?PcIqOFFrgBs_JA6r*JQ4@J~hcc<96Mo(ot zDMQFWu5)Xvt~HBe-+J9O-+PG>9iILR#ZRsdAO>qLhG8A#;f)IFNWmRlz31AKJ4+;W z?5H``5>$dcJ!X>$vMJp~^MD+Htm%2|z@Ea%i7UWrup)OKmgnmjV1CL3xsJfFz3Oem@JoRqy(FM_?n%xU&KcGy2VV8 z43mC>=G;FRghVTAFwxvj&B>!8k&0jrHJk?c3mLzl!!+|(sp(z2=E&w)k-P71AZoU# zb@8%7Yw&6jAbxZd#nR+e08PP1twHyv_aP6ljD8;u=xD!F@xK{5QTW{|QI^9PFP_de z`v$p5wfr}EY&h0p_{MmrRGn0XpU*!X8@~ewrA_$oO)uIKk(EO;SJ&j$h*nfdyi;=; zI1(5%gKgq@Zg9Tmt?XIASL}zR^=P)l>}TJN4Cqwty#+Nf@8oV&f8mu?ruTd=v32Hw z7R!fpOYJ}9pI~jHJB3{JCaK2kAlU+cbL!zTJ%P0Z`26$J?o1?fLzi<2Aj`oV;I>w5 z#qbbEBbb+x^T$5zh@iLIB%&Mmu^p#{pJ%78a=h}KNl9}ttuU{ z)`3soLzzw=vLwQTJ?h(ySwIYiagm5MNzDv;dWB*|eY9jpEaI&vHh3tX< z)zlq)sy-_q`smKjb2&&G;x6%UOe;TR*(FrTxfDFUJ8&(_>bfF6Z04+s=ft@(r<8aEdKNE63H@?H_w3Cxw&!G_cVUap%6JuS~`@kBhjZW8X8wfcs+{S_?Y zy|st--~QU)%*N$o5S5M}T|M3>=G!!U-(n2#*zgI~C<$a_{xo#s-I8*wnqYWiVyL$A zCTWeE1p(|}zu@;{#^_NXxRiFPS9a%r*Q=pZZ{eJ5y&$z5h zOdyC>T|r_WZ}l+px(K3)j|=s~r<$p#IRWVQ>Ew#%c3TYS^r2g8jy2_>@(-Wk2e)4I zDeehxt;L+4QPMjGgtdMCf?H8y9P0~|GA7cUe`Ut(N4`s@ur;Ds>zt(_I`V_94lNK2M7=Ubu`^ee#@~HC z2pBYh92&3OC*y~ymnQlx3Ugmk+kf4!hdNmD(m5S)8CSD*rdnRbhU)$Pp>evWE)@vn zh$E$v>Jfu?8DZv#p(glqyyhhR%IiOl-e^GsUiOqDrBHhw=$`V4(@R}#hUy=<-LOAv zP;BWT?+>25x<%LbHX`dV(&#<4#VVaN*eeuW7g&%W;hxHy5?_@+V@oZHUg%>AVyu)M zKHz9#EH%~W?>_M$x$K5ZoBo~`PX5e*5;+!V=oBc;y}U#krYH^1V#>Lj9j0Qtyzs}x zm1~1~EAw^BoIcZ+`-v~Eu{&HTVneMCsmoaGD&Tr$x#apr%ue zGmyN{w)Bryf6V3a$G}PBzgAJEMR+{-qotZO!6f6XR^gs-koksLTb-oO^UZ>{{lQM| z_ECV+{|#7l-G4dEcE85wT0+`ee`LZk01wZtXZ)t&9^37{opxdsP{Ymk2md*i2nYk% zAMi@xY3Ol_@d13b8|t`da}rGHx9s-SDqB;v<=@qX4f&{eN^D*}5owZjOkKEmmmAmUn%3RGFew9iv2S{-U)UkseZkOC!>+v`-(iUnre)2e2)E z@koMmt-tEK{Ec`8z?3(;yGtv<;|;SS!S@L;H~dB^^CUVIV78Qa%kx{)Tij>LX!%N7 z^!W?~kF$F-p}ZRT$SXU~kU`IoWtyuG+-Irm&t^h4y)B{U=tN=$#h%rS7H*U!QiTU+^kRV|;1^gHuJ)8gjq z9v%6>pAkf<)>$XR(~A{>TFRr*N#Jd~5=t|YsQ(usEK>>0AlElwfKa6&tOoVIKh!S1t*u@oHR2*-2VUkXuaI~MW3 z+&Y`sO$M#A=jX1yd=Dsj5$Hd(vdAG735$SMHdfYqCXDv*WL|1*zuWGwj`hE^2jQW{ zPw~7xCw%^1YZlG8QGpE3&A)T!b_^QtLrF@60=Hi-F+{4NtJB29gcn-WhmN#V|FE#s zl;L#!GVI=~Eed|!om$VPDB<>xuy@|hwsr`Zq9f2x;mBcMoQZ1mN z2#N0wp7WaiFPHfLe*5pc)z7`A^OreO={v}zN1C3FFoFNL{4L3+HIwp1jh!_Ucq*|4 zviuat)Ls$@n)>>++0XmK2^WvA%>xurB<4?Z{KD9U70%WKrvsgvGh5v3jmuB%&JG1o z)$tpRgfpqNX%t-+0UNmB^<0PGo4}oj@*;REnG`J%-uZ%f9cANl9`R>Sod=hnQMBL%(PCwpZ@u1InK-)eGASir924=h6?#9Z=)qj$CB1 zJ-fpP%9caN+obitO(^gmyPbnZKwsmVt$zW&-lvs5DW1wRnj^p&LH5874c}_IDbg6m!x5r-o{9wa}D)e%G zoJIeQJdx>|HecV@fp0982&KNCRFxFV1QY;T?4_xGwhdg|kza0xcX!F(G%|xTtc5yLy z=1KKQJu#2~3*QS#A$6f?U5bV?r%+s*iAe+m^lkjox`?oKNbRCaXva%72}M-I(0xs1 zi@;2e5BpWp$7QTV%16G$xq=B9aNm6E{MWT9(W3pn?XRqVgaM&VtzMmjH8B3-PY%>; zb{(M32Md9*l&FCmA0&nnq01pg`gouo;?GjtA_g0>UPK5IwwlgjIGcofa@m&Svz93J z;vXwi6sUo)(!swARU`)TR&G?GCO3>k1e)Xy{m> zdO4@>Kr483PM6(vJ~S2swv9{eTPUjMt;Nu z!^fuIL>8Y+G-o}Ktb)k7$ct*(ihuc-EJRmX%w}IbZNl?DP%)ol#yz)3+e2sk}d0k delta 9152 zcmb7p2T+qiv~EI>CQXngCG;Xv1OY(^Rge-u0YQp@U;#l81fnGTAiX19x{5?VDM~LP zp(83yq?6F3Dxr6HKi)fY@0<5#?t7WpfBv$2&dJ%`v*&zYja|8I8J-TX)z{H9M~$x7 z0TJdyTTNdk&Y2CNi<2B^49%~ExSb4#J^6a?)*ZTEx+;Rv?5Qal5fc4wsrLj6T0e3} zD^lJs)Ukv;p-74eiVgdzpunQgr8S)F=uquz^F2}B;8#t)z9R$D@c1fG-M43}L4F5! z;1tk+-Qcs$%HA8__@Sl_AXX=LCfDd7%n<(lg9F%~(Mm3SDjY$p6@g#XqJct0YOpyY z7B4LnveA|p=GD>Z0uwa_xXrI3CdF3Atjr8r_|UGzo}fCKrNk~XXnClK_KJBTQ^vih z8CFxCT$%(8<#jtUjw&t_(RS~g`Jdau6qaK{Z<+RKF8{Q5jPwAaclw$hP?CSj*XLbD zK!-{Jn3+)Uy1b~8g&Zi8^!57d>3x2>0F`$&P_X2@};OXk=m{nHfj<|}%%6Ur2Je4rjQ$l4aGq-1xzgX&CM$`0u;Fxw0{gZpJrUH8U1_# zgSxf4>>6J9N^``x!G{iP7d>yzd~PA9^frl7_7aHz-1Ld7v*~ekuFT3JMO{H-8Mc@* z_#}rH%?_%jCYP++tu@4V;Rk#5*!V>;yPW&``xKVz16Y%8NtKQan&26vJk>z#n1KSE zcz1Z2fjTERmZ^O0%GGGI3! z{n6c9)0+^!$TFe^X?Q!p?e97FmVOw(*!>CGqRoby!+JdA!lp3vE5-3_$Kw!uEmU^# z-3!}=0b81u`|YH}UTH)6Bq<9^ZDGh{{5C;^bDK?Td_ie72~T6wKf&Hl&RxK01fQf4jX zFYn}&Sp>gC09@)fnIXul6Ui27dD5tWA@gwTW66m|DmEx(z!!ebY{XBlh_=;ca*grz zG1G=0Q#a2Aevct++Px`$KACntx&yJkQ5%#P^bYm`-D;TnVBJOjT$lkujap220<|Zk zv~~{tE(e;`JLcd z1KEPz_(LS#R+>6g3reO7GFZxysGqjL?3&BaN27Sn`djr57YDGF!oeTo^<#EzrLlv# zcc)r%s?ClrN0{$kWex06gAK3*^A+vV3PD(N#CSV;4lE2Ij%!Buo!~aAu}Uh-OUuhi zJHmoukgOle1^Y!ho&=z{B%#2C>12Yv=YVvpSr=||L^#$(duSjlHKnH7RT9>m!7&zeE%p+bmhUhDM-eSy3hKbGLf&X^@Ki*dBD0|v&>3T>|p6#OSBQY`1V-w47n?O zRb&nyB@)(^svW+aX3G%H_$RGg!^wEGsaEd}W6Tk*QH4=`;y4PuwcXWG4|CE03OAo4 zb}pm+eN@Q-(Pt+`Cv`-*C+JDoF?(paGSfY8zDWSJ^}&4oPy8|6>C^E-X;6sil*D%Z zh|JI3TzFYxeEYQSz!X$Nbq`gY{E03>79(3`G=rHLd}pot107Iz#D+rbl+&AMw=7rk zaQ+ceoQHAn@TnJhIT%nh#24|T&$Rt+sJJEqx$y9xC;WYQPPKflW5S%w&P?zFAvCQQ z_BWezq?t1}$Sd6*hRQdb71!V{%4MC-bNnA(a@K(3?vm)REdzKg>dNe?-x6Pb#nSGa z4p*F?dl5CGOz1^eT{@rI`?gkZ`h#2YNqe#0`(rtp-})gl)s35q4Qoq%iHW9t<7RSq zQ%()Fa{i2GO>PJ61JZkLxg37@8gvuUp4RF7zDXR~dzJ?INJ2g-r7OMz)Mofv1V_wD zL#g~O+l{}jENhXVWbxeNJ(+lySB9(R(cf3Jt^?uMT68!U9G>Z>A77zCLGH;GP99*P zH}t(0dIR)jw`>_dMu)%AK1hjwRd{59x*PORD3@J)jkB2x4wwW)>CrdRL>S$^!{`=u z(n+M$3A^sw;=^ddXWvl7q|!hTXCjnz>fSvoALHO+Qk^paQ*xUSRP9M@Ws2vjB>6r-fVALn~$-`J|gn^>zw z0N{@KA9uWT!5WF=g69u@O^rwi_7&`78x+DbuLP?$&UT zW*#V`GQb1minEQk8NOFVb=p%c^vA%I3;fcC!a4eBqy4`84NH$x4{_i>ba2l>Xnpmlzl(Ng$)6pH|J}uU74Y9+& z4cZf8uvguF6VuHGbXPe$zg(9rDq`}}4e)y??wA)`dn}&Yq#d`eoYP$p_w&r9MD4~j z*zzE%n=b7Sqp|Rq+%jq#u z?PjQZ7qUQn#Ts}~!=rIY$ZW+~aomca%S?t*4~?h9DBZ1f3C6}A z7g*1GQvjZX4jhk_&xfKRH_zR#`HN*KtI>XHr&%s9qUxhB+%5HjV|ZLl+i%Jd=uUS!36Q1~hj1_}&RkGUGWH_xEv7tWq0 zsYa~+emgw|vR5Pahz5)tdkEAJBr+3GF#mTvrzGSYmMgees<=;&jVWys10WUAP4<2_ zHwc-V@iCAOUf??y9}oQ6)^6l>m?kM=5eS6$S_;!-zM)$x1T^D2YA7QW7H)ThnLC)a zV^xvf@6G?+GtrXRl`3odkRB2KhoxmOm6f_0ir$8Pyi?Iv7r*@cL(`+@rQgqdKLal? zbf$y=_Dr%z)alucG@gr^DDTF=j=zh+D|RM$tc(;z&8C9`U>Xs=sD5L`X=jrFzLT4F zpX>Q?x8j!`jR0=Aws&*{w?9mpFDr$hG3^qa7$%Np&)5HQM7w*QHqAp1^QDNkGLT~& zPUkq|I`>q$|2_nVfaT&U#2rpvZ*-(!7HaF#5Y%LXKsx9pQN|~dYpW|Ol5)o`s!g?b zzX8CB!5!2XDmnym+HIshr)DbfIkwYxQM1OwF_R}j1~(IDEO`jZ7VsZpEqlyjng zz^sLTPwlwf-2o{$F=gRb)wJ6xC-{x`(Sp9r^I!Bfkel5fuP$Q@}GK>IsYt9;28y1x611;Md`?fdZoxi@tm7aZ+nOq6l=NX%O0}P%j zPd&LCYVUU9+qQqdI7f5a{?K$ajO8Pp`pOaQ;-y}F}S zzYshOerT3ylF?eLG0s*7cz#_P6<>2?jE{o2J)keyp?6E={JC8;JheSb`zI>Av`1sR zL~M4|qlAMDs^N#k6p(6a*5RZ6TCfJMUWIzf41#M zaDublWz$w%zbXBvIMJQ;?g4uh0h}+9u`tJ>OQSS9 zQf|TED}7OmscO|{>Y$JLtPl${uxz>Q{kzIQqc(M6SPdW>FR{@{-|hif2K~na4?GH=Wv$FKQ5}n_Gq=Gg41bV?yf_K~N1_ zHp8hRE4m@TkK6WS!rjy2lEq{eiIdlOutyiH5G&h|xi4J70D2vcc7A+~k)y#l&1!`a zZE>mbW}{*$KYJ-|UXd6A#!toSNajM9Z{XTf*?6E@yI?fy?kN@+8T^=%Z(;np(I-25b?2lDJY_55k* zJdHZo9AE0~*f*{_Pm#v<4UZ>V@A)~zSvWQ;UiEwhtOoljc#d!C`%?cJ`|LM24zRAe z0-#);<-{xm%JS%Oos7nNKk9;$!SZM{yx~(2X3o+q_r)mhu-LD+lf0*r_F}_)dod~jXhlfuDDMM?f-JeA=K+W&@kz^^#CME_s zRsk@!_x>|5vU2=36w7A^sr@9FI1%JS=@4DrC(``o@jJ(e2Xf+Y@X562uN=c-z8mO}xPBxY}3ax@$Ro3L2JSjF^3OQoLo>{RLnf;4* zJf8c!ab!sHv`!9HYEzHR&0xisSWwV){I*{GYNVgQ5f>RqFh@o4T2)#__Uy>q{5l^J z)ZQ;r80BEiZPr^a=X71RWS<}BcV9QU<8@Dog*UMeV!6mV_#oj11-jkT7|^O8Pu4kb z$ok->T&MCWi`|TcgmGJY~cr7buLrL1ZZ)Z5X-FhlLVZL2Q_g{6uzW5if#w(#r zlcAIRR6@IUx-a2VtR{OtYANAY`}y;6w6!_YyP&^Bpn38jiV`mR?8!1imVxi;*O;Gh zA3ZJ=Ric1mwM8X9_|8UeY}y6xY|6d2K-s#?^Z8@Bri+6u zEKE5epsEirQxQ2p8XHHIL0a>f&KA@t4*63_8^*YHWHRwNK^|5)uC>n%Sjn}CsZlSn zN44U(pH`q|fz4&w8(hD-Nj83K>oHuY3hfE{ZL@qVTAZz4nz=@T0yWzTP%&_WnNV9!H zs?zBFdqQw0-|dKZ01n%pMDhkWhrWUst#`N8i$2TRl*k%k{9@1U=v86j&&ca|sUD+A z@*da652g+-X@mIW{oqQ1rPfIX3x0$bd8+7cz0)}w0S%ge+GZabt?Xq!5NT@i?GO~t zA)a~YcSV90uN$C@vV?UY;lhCn3p6tiGB4Kvqo1uYk8b5o^ikT!`rdK;XTB(9 zU}O~C5=Cl>i;sL@cgr77Up-c`PgybA^6)i*Q4-c+0e8bPm4vokWjEnQe8Jg}CN ziVuw2slcB;?M6?q9LzT|-JrNy|4x5_rCApziOZt&NwJs0h|>;_($H$_$z5!=@;#tP z=lK)d)rZ*I+nlO=#T;mO$%yyPUuR%wgTyv*UCgpUKh5ggsXVy^->L~N&fXtY*XBHK zP?S(Ii#D;KEW>p^fhmR2JfP9g9iv%oOJiugFZ?p#_LRAa+}FyvpReX1Cp>{#)>d16 z=QONxtviD0;3H~*i-yZ2`&^&qCd6_`VR@z8)zdk?Hug6}5n)o%MVJ{JfB;6`NuPF-oDhMsN+4F2 zM+C}kv+gXOe+JLQ?cnMrbzaXp1>+eThY4j~w@qM&IAvCB>j22uPZmp8FfMkaBX*7k z_lE0w5Ep1JaSU?W9^QQtHhrU*hqDR|t1X<0lqtD!XX@<6u9mgN)BM3pM1?o65w=zO z02{7G5K!=2bwZfFqW6I&dN70YY}QsVAuUgpIY-g-(BWE3@02H)HtroxQoXk?#{_u5 zKsWP!p!&8$e9-FDFL1o!KaYljo+{O?_w=PZYTD2F*{Cu795mdPbH7QsRxh>1@|_)d z@Day(%Y1&Kte=o9kw33SPy{$|tvFi{2V6?S+`KIyHJgrHlbI2tqre9l^WKqWn~l9V zAFU29g2*|Pt&JVulW_EjyRIrE0^O4JYE9LV*1doJTle={h5a3IOhPdRCB^O!>8s=+`^kiDzF@|1d5EjO(W7jjF#htJz8n=*F^DkrVs1H5>G^x^ zHw5Z%Xv_D6N%+dPGN@Bjo$m&zqR&cG74B_ysHY1_f0nLO)Sgl-%y&NJ#R4Q7J^2su z5#7s5c(y;2666HcSm=}_0-5Xj`kylXcoDWFv^i_}p}jhTZQ24-$?>m{DAh-|GG~SE z&#;$V0tjQGVl4ektdJ!^yD3#VVPc?Jgx6@%&KdFWsW8ykJOVNH}AFg ze2>GHx1SV%V5|@%C!t7qkl`zP>Hb85Dpb3#K>r7RwE?I_jdoB)%SmiM80F%mh3MmT zE=bSbibh4V<^b&(rmbF=il9)9n8R`o5axN#`phX71WgE+g@BbacAx4$fyC33>u8X5 z8Z+-dF1UcsJqZ_d{wNl;8yO&>Vcm|6`fS;H%h%~taUCH7R#2!`+ajMvETKw&R#_44j zKL_qH@auiBs4}CFeHAKM`++RIW@<*EG3RO8nisSh%G?}6=t+jS%?(MOs@N_^R<6WT znlgCZoU&`@sh0Z3|zO{%c%o{ZSdr3C{^ukE}z_-ee)fy|b8oJl88 zFv_54yf0i2TXqKzk-e#;^_LHlveNT#T`TVZBu(I|uXQ1q4b~TqcJ7SW4zz(xP3c$bOJn zbMfc%KpDl-8^G`JOa~n|TWL3_?x5kS`3UJX)-zC$AfR!~&O2Y+0y1&ci6%q0>%2eE zK(d48FQ1Ev1rQO}sTaxUaH}7?PoLIwgT#zP@OLwM*Ml;Y**WL;YpMYYUa@}}KPG+$ z-r?qPm66q89h2qWg&(jPox*SXfEc4nV0`A(qSPPqW~%Rdg7|3)*kA&Jc%(MkXMv2M zs|;ob9thGWp^MbN(ht~!S*8SJ83Qgd|Nh&6zG}RZ1%2(;p;w{E!;ZHXWXBSNU}Hm$ zpEY_~{05o~>3>IAZYh^xc)zyY*ma%mb3A?v; zr<~T_qaK9SsNH=er^hlfXX`13!*Nhf3FrrkWUBhOBe%7mG{fNmijH>V1}3Cy5(22& zA9GNq{qXEG4@Uk6?0cG=nPp4lELqWlL`&;HlRI5fkpZM`wofEma#Ar8Q!bs)%%(WP zyQ`~Zt}?m%7q5sKUGPxVT)SqkN-WPvWD_d^Pke4l_?;;y$tMu=j2W_zqZ#wU|0RzD z2E6_ya@HR%pLq3vq(eX(sv2Ov-`Fy7lIL5^jnrz)8J{k zS;_@f-TEdCZX!H54F9t;?=YqdnevS(m;QXUX;vJ>Z8q&cYP&+Lmjm49b{*4>X27m9 z$uFtNXxCuD-kUkVZ*)u%dyL3_f$5!;25-;o=d}r^NP_Ik?5Z{x?&?2VTUodSt%@TOx*c z!)p3t1IVB_^K0wiu%tQB^689Y-ER##Z&E&c6QxrQ%Y?nQ8lU9^cSF-|jz4rPXd z^(1q=KDOoE1X%FQ@>o@JGGgZsW4moP)!MJb0+r2|1$ts5W4sbN-KM4by+}E6$vl)u z!LK#RZ*12db^dDSKYL3RS@Zu`Sjy0TcV`nprL@c(x|S}h!7@dtMzL5S3oY^$K9mKo zXay}u^2U^cN`#*pKsG4=E!GS7x1Z%x7+MQMle;kXS4D+$;y}jN=_cdHTg)f72es3J z=VNTvBOVtg{1?;oGrJqRKfq6#X>+)h0^5*0yFHR@tp767o8doMSkWTs0LAxaUw3X8 zpYreGS0Q+IAS&nE zaH@i$_!dEdzr&2WzejQ3!vJfLXfFcqDQzLrhiXXg&>I=jzX)kNO``u3zh4k?i%eStgC%i;Rx!s&3aV1}GY%8Jui6kxXBzMjv5vRLV@iC&L2dhhkf zXy49CaG3O5oqMhZJ%qgA?xWQpl^RcE2XTJljR=Dd?$Ys!|0pv5)tDe`m6TeMKd5II zlTeW_LV0?T61W-&UR`LR!cs2!hBW-(#aasjUiw)mZdmsx`gT{Iz#-Lhm-BHk$N~uX O)4y)4Q=;YY@_zv(1>$-D diff --git a/assets/performer.png b/assets/performer.png index f6f288c1506e1410305eb333bbf5ae0ff8be1d3a..3155208137b291b6930bcc62baf1be0d1ad104ab 100644 GIT binary patch delta 9039 zcmcI}c|4Tg`}aLe7-V0wjIxsk$@pYQkgyq^89$Ln>QIp>~po%dO;bG@(ksd6INRkYEAXO=Ht)V9Qqt=#bP zv>Z-tV~Z1dc(|hTrl6N2+#rKs8FfnAo8WV|l#Uofd5*D4cp78Ja?QXq-0vbk`}r4~ z#Y16QhP87tRkj#9nv_%q#gDHpXgh`I37wWO8B)B>b-fw$^h<3=tObysmA&JwMMUBA7lZiYo#`g8pKTIbfYqJ zgegA<5zq5L3DL>wM>Xnhv&)}82hx@CeLEP zXT1bD@cwD6?Fp97!w_rWmcK(#wFU}s`9KLUtD4XT{F8s4W7Pcn7Qp|3puEhzQW?oc zfb7Y3@ehD*h`WY7SBiN;cJE7dSNu4=uJ_Rd$i`ZoaKeD?bV8|yl^VVG?+t#tTE1~a z+1YW_Sd}I3muEk8CLckaG@R?PY?GWCYQIuVo8QthS(%Jfdl*-~P!Q(aM3k@`e6h<0 zjC`v;0FDCN-Q#*6Z?#&&=AS5aG){da@c61v?|~NKM)i`KJr}s20Yy*Uc{q7tJ>FG6 zxU+I!PjetUA-j>ugm4CK?EQz29{FQT5V}@!9P(u2K=cF%lx43fopO1S-GZ_rCl9m;T84kYg@F19>o}x`>(KXQ4Vqt+fM#*HMXhb)qsij4rsku21Y;GP` zQh9*rsKKOvcqI3GQ#2OMfO^#CrEp1op!e>k_ogS>USphDy#AZC^#kLZ9HTLUaIYsH zPqfe`8HnT-7b6nV%7W(drDq5o({sN+z3&zhOjL`zxUa^5^mRTUtM2yq^*Jqne>b)T z0CpeN!e3Xy`Qt@r>Q~g5c-^W;K-ZDip(ttT(5fnV_d9pK)QKbIPBW&&w2S1K)bT7B zS>an$>@*#Dn5)u_MA$4c*rMV5s2i}OEdpBG)|OWs7~Svt#kHB1n))+bDZW004WRM3 zdX=3YyX`;GtE|#(WZgiONzyB&ceJ)H%tvOW8i*)=VqgZ&3MT5_xFH}83bny6RO-_n z{mlO=3r(qPgB-z%T@(5ivBw-Hzu3eXx~M^&B|~F^GX!3tkG6=S4NvNjuD$&5M3=hZ zwD()P7Ps-vD|nSXHE+D%iQ~Bf_egB`YO-8WNy(f`r%i{i@aN;AU|Ru&ogOB_hQP7< zaYo9~$ac*Tz>aBOl@IX5gt+cG{^jt*?zzFCA-JQ1>PhQ?tv%9WdRw3m0)n#5#z=g; zs6Q?TSYnOcJH^=$35j3AGAtPj{xbU2@hEU5&FFz|>Ex079*+VU9GaKyGQ->`p_Or! z@vfAy8`H_8E1iwp-27SF%pTe^W=~LA5d!*&Iu#R>1EFh4GwsOuhW^2XyGy((3%#H{ ze9xVh`}fQ3w1c9Yv1$KBgVFVN*#1?0Xt=AKy;?MD@R2}~4xh8vBMUzqVRCK7_U1OrhdJ)ItIR2LIzaoYWnI~<%b6eN0R zQ<^UGbCj6SpT@X#-{Yh*7xiO#5rci*dsR+0H@r|MF&Yt5euB8+$}ae)b`U{`;gqfu zNVl@GY9AIjyZ88T0v)iroPfa7r|eBv2U=WsC{NbDZt>c6VD&qb=Td*MV29d1UD?~W zef0u1o&L4dW^VgG^Z=31jZeY%9!yl`PR~SU3ek=MNxccl8udnM-mR^fZ{-{x$tt&w z#;diyxO}h}p2n)hvd1val*ur7w9_yw3Z1G6Z>CbtrjbTE(Y?L+&G}g7gE5S4d)GMm3jfUTggCuY92h_MCTQmerDJAVJ=*N9Y!dgIuS~`Qxv$Ykd_w4JPqU=IlLvIVoqJY{;ZLmF zhti5IW3nc$F?(YQpB|Zfnj4;y9&?Eqt`)`KBk*|yHV-eH*r}zCRnjru%pk?HD`2+Z zfzujv&P7rYI;=s(sHE>hSfs0ZUNL4NBMb;S-PR zsEx=4yP+f#c2)YV9~-UB=bY28F=}6|CH8bf2>RLtZ2q)q0V7Pt;R(Tf9vb8RP*jN- zZu~X42DALGsC8?=s}lwLh!gmdQvM#V*Dv7ztZ$4)^jf&mXK;FKj9yn)_xiS_6wv{< z<5t(w$}xtB86zbp-`D)GDdhwc%)9<~q|#uXW?9vSVOipe*!;FWV~= zd@M{|j{gk8vNYO)zkk2x6t_d#+ugOtPGTA20W!wn@#|2>KZApVo!kOq%-U9~7YF;u z9OJ{o;>4?kPZsrW%^u;ffRk12X2tA|Vt#1LO8ezM%?_yj<`>+~{(+KC-pnUYx*fc# zpjG?$YX7stSAQB+JH|iES;MWZn%4UPQ#n2?qAqcuc=d;)sO~o@vyM=Qdo6G4vcW*5 z`18h7d3mRm8{Y|Pt`CrvbL!nyWV=R=r|w74{MzzzXxDSa!za*S&8x^UU|fzlU2bLm z-S@LDqxD7PGd90j+OYf=DbNO{MVQ|@Ehu1XRZ`gYwoVWl74_6de9ypaI4z*)_4z)i z$veJmbVFOT8uSk=F4u71iWy)X)Mp zlO5>LNwfyl1LmW+^0QK&E=GJg8L{-lT$03B%+wov4%GZ%EVxj;VpYEs7D&@iV zX1CZxUcHO&n~5}|RX_|_=M(^qMGI=$JvW_KPd%)$f8O9+AK|qgd#_&TjpuY?*d;i> zZqA;w2^rJacD&b2UTHLKEjvj{t{yJ37O!3r4=TPxyA_L+~1Rz{~DozUbvP;)(8E+fB~N60Mtsj5>+6dwjvMxYvlU-i&wMeJ?UON5SJY?IV9FxUGiXh=nS z=@Rz-y(a8ub`L|Iw_r?OZt$(8z31my&~%qvj0b#otB*oI(pE>~cZA6E(}5;s;~eX^ zjEdmoxm#i(T-48EJS(DR?Eq#f+0RJ0*GnkkMT$N6NdP>Xu&jzV@CzB4O<~U0<>0K} zxP-kNw*-S#lpyMl&ED27>|uK;c0R^ak2&OT(=Q}C}D$mNMT!zM>FbyT`QPs+k0z>3hiSfDkeR%FWDpzR} zx5ok4oaF-N=3n}pZw}Wwno}t3rK52WPO>Uxaoq~Pn;eCJUQZVO1wpu#9 zk(fBnSyTc?e#4c$DcDQ$PbAdOhoYtw^7Q;KPU5zVD52uPwVA=ZN?EQ3azld8jj15S zDcXQGoo*>lh)7M;-*L>FueT!(wb4BRwzer6rl9rh@BU$x%~QXLE?g1c5T+mF3wMN zm8>CFa|gG`@1pY>ZH0XbB=M86ZYK9y>7cX!?4qBTf_Uun^XfZSk_g4h7|}@X@=@tS zU10z^XU`NzA(W!Gd6j-X3bgI#%?EKlamu{7u-QUK5t00Z##HT2D&T7J@C`2?V;*>} zH10Ui6Yic8dn=E7lBnEw>*)_GEXT_s-0st}n96kN2+Lgo5ur}T7R^YRQJCtDdy3$zr7+AQ^J{dH7Z;5tF~Q}&lhvF&GfGL@ar0?fxNvl8q~&^ zOd;ND*AM7=%d5aoAMN#o+Vx)m5IrZ4VFq1eiI^|j+K!hI1ln~&)l+B{)=f1!Ey7o9 zLDS>#yy!wo@7-P^y5%&l6s(i^mm#-aG0F(ej`s_MF#Z$T7=7Pb~*@65T*5VwDX z=^hp+p*lvXk_cN*WF#D(d$)G+Iz3=h^ekN&d8Y$3t;=JhT?RCIDVI{jvrIi^iw9j2 z;Gz&^{<_Cwx!{q<4geL)@r*@rRkpHyH)p5MJijb!?<#)&GYI*x)RpS_hsi>%XFGXL ze6nt1(u|>Wv^@(tMGcr+SiC;LNGMqS#O8g)wq>L_kqk)pFlX z1hD;L9vPJaLJM!K%qb{Ppf;+#xlD39l&jUB@78RS40B%U7upa_pa`GLL|NI-`G^2j zJ(o9QVsjH@^4Nk(!jQf(Hs4ER-`)*Mz;W^|j|kJyWnDzq<=pZ2lM>8A?kOCoQ0(&e z|8BS??Z^wv)vKmhO|hG~B(en^8vrJ37`$C%Kqb?CIU^o+F}>i%sUF~g3Pf~IQo3Ml z7yK1)0waIsJB97!(sx?{m;GNcmUWk~>~?3a!isPol9?@(twSG8Apw1k*tfBkM7{oF1<8-{9=M}13@!ii> zb;wxU1u^?wH4MWH)LORgwv4@GTlefy+xG)traILk10>ti-nvGWxhrZvRVjFG-DW*= zn$Lqb3zZliPodXh_hR$PVv_WwM;lF0nI z0L>wESQ8$aKWvR2VK^{qgM^whep5IpKLA|_=$w;sB4(c zX<|XwJ_#)oWnqQYX03 z#uS%72raTbwCx_Gj%!n1dvYPGJ$CIEqGV<~m-E|%>wx3YAEPstGToNQATp`5M0$i~ zC9Hi#IBX(Pa|f>XuA*X>KO3}*I8&U zHkjji&}SUt=7q4JYQepofCS=pw?A7RJK?9mvNJU7$|ql(xCK083R8gu6|xpTv@m(X zby}x{NO#VWh`uvEsx&F~ZeN3GN!~NT%H6x8iC7W7&RtfT{l#Yi3TlOEL1F2hNO3taKgLpyoCJ!nq{< z{iYtJJte#|;L#4Sjgm`NdC5}XaMlfq>mglc&TSkDkLe033-MttE#8>l%S!{aNCmA| zu8GroYZw-q({U0{gQC|VA>6NZ;Y@crx{(E6N<{~W$I`%9<)xhU%g@#5oFE-KynWt* zGbrs?(`HwY+FHP`pQFi>1f4JDW9T4>hQA{@63=}>35F$EaRx;noDdFz6oD;~{zmP$ zYqhsmByrkrA36n`3Rz?^!4~&d?9p#Vl7H3oIn3m`c@X zxFshyRsxIPfBs^WvkrZ_B}zIBKOdw6?v?($6qDs)ZPv1OpA15ZwhYnvcSn5fC$=7Q zNXu3zdUZ3=fQq!Y=3sO6y*VVboB{r0Rl~7S3^}<$h_CfrH{$Huau~gkPI}-O4Tm`e zSv(c3iOMT!&kWxJ_iaXlWN05b(ksKchU#Gf}vaaWBp!4ixsif8S2SvmEsx`Ac+GHicRIA(hJq?txX|VSGr!m)WC0%IP-a zforjw;$>~AP7uAyQK=X`b&~hbKOJA?_S0$Fi&pYdf^7mmG9>O<{y9l35mP@)HCW7J zyw1DeDOa>EciVEqXr7V%6tv>~bU}iJ8+s)=a>YJ}MY6wH5(9k^34BX*J#BO+6&Db-)zcHg7U#Gh zImIwIIeC)%oIPNFdeER86(`%?-xZag&CLZ;qzc|dCvLlRCrDnVu|=lvP#h-j`Gx=8 zlQ*eBh8jd9%ERD|w`S^zxy-ivSk@q zg!>LwOZ{x^aFpHYgFZn@!#M~3P&=iiv9FIIvAgU%h_PgRNTS z8kg^d=+Q3^o%kbtLk=DJ+rIjoRCatNQ*<<1wI_gFlWSk@vV(57xI+{2qa)AIU|G~1 zDv*L%qRGkh%z&rQz9}tiN3^lekdiOY7`S4PZVdeuJsw8xkv&Oudl`NJ=6Z4~2FA~ha4 z&uzv&1YOzKL#SrmIR$+h?vs8Lll>SK8FpA1N&73>|J#%-j!;Q^9 z=O|opgU>)(I&cn1Z%|IF0j1ttmZ_tjv)Pq%2)GNu9-f%n>3ryvwT-Cd*5a&KaH3R? zYEzUWHTH!u|w6?hud7yBGA8U%Zgo7fDKxwER z-Vpsj)-8auH%gl7@LiSuM0QV{Ax-H!-$S z_!|Gy1sY4yM5#sNf8B(5=+HYmL(bwmpz(qtR!6-&10{4-fvpCB7#4CQVod5n9rf4y z{r~nXep5AX_rCy-%fFp%CTToaR}}cS%Xv4f5}p%Cg}A$;obrZ_oAMw*|r%W_G}-;Zp&QVwf9 z6*LPT+~$E;EX1DG!c0iImv|g(tcXG#{*&jEoDc39_5~muPkK9UmAV2s@B9`Wui@!W z&DT%|TmZm*y~>WGVH&l3mxabtH)~-~3h}p1xovK)?H9#tuJM*=f6L)A{#eDKhberx z6Z&#b(b!n)o<&1I6u8mEU6{;$5?BB4CHgNrAV#uqtspE+Qp5W_MZq7 zdIoO5&WIHiYp8C=_*?5jEE_VEa-2X2pXY{(n{U{H5zbMZx|#?R@OuAxfyjT7i0>2i z?Rw8FruSw%*2a@W6VO>95Lq3B2=K`qX*ZQA`i1(8sh{el~=Z##v6ngbai6;EiJg{IL|& z6gz!90HvVJ9eZEU1(yV^us;~|J^nVF9XPfnqV(aoh z&ZAOzA$qUBtO+?L6qU}xY$`ECw&T$GfB7m}w0{I-(7sGMzcyY9K!2C@OfQz{IEDN- Dp*l{S delta 9670 zcmZvC2Ut_f*7m0NA{anAQl%pxEz%TGigZDwgCb2(6r+?)Zvmoo1OY*+(nM(j30;bS zB2uMblFhU6p>X=@YArJL&@%4N zapujb-*0R8)B^KrRv7<){O>yv%k^V#Yj=H*24~#we5M6h2XoZ2vz7z%i;JmC;~r|g zcV!5q1gfhLNU8qwmd^;;zxb2b#X-&XiO?{$OUkUqZ50Z6;C znGW(#U-Dry5pZ`MW?@e-B}L5%)7o6?is;f(S1(t3No$7+KP8$0c5xME7G7gNNGYNp zq7sw@y&c1%3qix_cWRPteqXL!w2$MHt>rz;C_%Bsu*k%%G&M^f=`R|f!z}819^njT`JZ^ zG;7c|a+x$lDUbjrC51z;I9d(Yg_}uAMVB__3@V)cArNG~&7dvlP)}YRhrUbxtk-v?TkoU5ig6azJAP# zQOMf3!jmg2MrFs{MbYOh>d`fTZ592hy2i7V3L1Z>9%y#xt%$gtQkJrB``rUJqB2JaL zFCHQ7!DB?hoUzL}Ix_8Wa|@VK&u}gH49Gm0W|^Pnu`!&F^z~_Wc6PK)Oib?He?cF; z9xoKXTE`W&2x*{wKFz2RIQU{Ej}DX7Dn7SZDTex@U^Dza^NXeXjszmbHEEq2(`#>x z!<%xK4crtE`Ea|BTiS;~JQ)_%f z7ocMGRB!d=3dKIlCY(h#*0ebRHD|ofkq0cYEJMnh(}K;PIOWWl;cOV45k~2`32s?78cP`Z}cbwjJeeEBT*Qc?Qu zKoN5l8*l)BDc2;qsF%2{Z~Tl0Od7lhV+a}0A)<@{c{0SExq2k0oFs#+B!ADR!%g_6 zhF=cwO8{?Plm&V^hrik~ag1O{-ayoFsiw=`dLm7jwD>@kDT{pYSL9Q6v!J7)46zYjh5@4$9GT zf5NL{$Igk$1a%5%1Q$rA`u_n)e z$oVHZX4*ufl$;6(U{aOB|u+ViY+-;gXwExKub4M%M3y9G(=e;L7@>IIE z6&ljy<9d`r*rm}8hCFklY@okyDP4DnOp z(S-deHU>1v*}1pZKA2k@hF~W-CfcXhM9vqAsCvTHnp ze&4HF5^iEd)CWGB)Un=(e6q9mLHu_8MR!%cT(&%{!t;}%#fKl1P}O_bD?)v?6p6e; zRMAOocV6X(bM$^@(+@5r%|zIr54jfJ9P39s$ZIBp#uy|6zB=1D@wmC1F0X7IQ_#$e z2s1w}oebNTOxw~QWllJL?pV-#eUK9dJSBfcB@>)J){E_#Dt`3&Yl-g$53?cs;!4=BIevv55y8ISsp}YLBC3Ut3&t_Z zw5QgLD8O2|`so@$akpO*9)_@cReCx4x?tCD?EDnF15tg=QA~3L>;6EaI$kSND(&xR zgVVpe4ulildeU6zvIq%4H_$XWPA|mK?Q?){fKpn6-paG}Ot~Cqp%&OG_Ux9FOvg(?;gvhO`$hU@!9;2k$c)n zB~MDowUO+|J;?mO7C6+CRhQ5ZU6rUC0ip_@P2j{i$e=OyN95B`yQcu|DO+k7%ey$Oi-&#jMD@dQ|oxj^)Kklr<|o5q1jO3i_&R zMW@Z`APOMJG3{NAuixm}erx9A>iLSoV_hM62h049sCtTQocMPKfX^9JXd~86nBi5U zC1qLO%38@Xq~@7fxf0xXXKKVu<^95+5P#-@(Y#0g@I7O3bA6lBFi(SN4-t z8HY4*61fjz4oa8|axU=>`35a%Q(YQm=IthpPle$_PcoTpjr@%| zCR|KjDjD%k)=COvY|Iw{L+^efGoizzPZwW&EG{;qoTN`Hq-i)5HnvBkXl`8*m|L$q zytsVGdZiO#gi~9S0vwq;_N_JMiEm!w=4*dn6f4FRvn2?=z1NlBPGhfV>f9k~Q2v0< z5oGSS+pXXL1S)p-(e-Q2ce7^6a7*&UdGXu1L@)#!`hYRGV)@BBu-PK9J+$)J1q<&yomIRPzwDLIO%dUNKEm7mTiJhnT-Ux^re)*}V*&UrMm5uT*HCy|pXs0rL|TOgRrydGes>LPjgR@&gTJAW7EoLa3EWHN#hdhU=;H zVTn#S*d-yVM3od|a;AW~T&~^n_RYsr)On_o{sQ4uAAK%eS3O?3NFa8S{hTpp_;Jf~ z{#9dpk4l1v3%35m2{A*JF+(Q2p(ht)(DR%IuR(L0N58rEr&q+87s1O*{mz-0go>R< zz7riz{dqQ&0LxB?``D#fPoX&E_j+5zCvMnmOVRfjtND-h-`b&07|5|?nznrLJ=fZ5 zb@tM2eUoqMOm#+#Z&wAhU-H)zYz;K55c%A4o5e6_II>3+5R;-#3BNHPF#{nx>-#Y) zDV*(IyNUB4je!sV6V`velPu^^k-_{KF}g)AzqISNn9C=bYTx=$+KsHM0}I|V-*ED zMOeQS;<1*dhqFIWX6jhjCaxuN&OdbJww5Mu`a>HpfS0)7%(){kj+5K8=X5{PrJuZm zRQM4jrQ95kmelMK15(E&-_gLr=^U*5oK<+IE{spn+w#>{J(EqKe)9W&a0SL^TZmvkPg)8Y& zDe0CEgTbDmd&8hFen!5CRte2dTF3TgX0N&^w4LB}bj3rjw0>zx=T;Lhzx4ZYxB(h> z35aGmyAp!RmQ@q{$^1oEyp0BG+ow9&eshFU4^ecY8-ddJXt79>E194J=%)@B8+iDx z@Ia;O&6X<<>e}O3N2C*Ufa?pwD>xT~Z5J&lYof@tuRkzA6GiT_8A7?|Ry!&%QSSF6 zt{)dLo#^X{#@KnvS1DY@yCZz4-uRx^ABT1iDJnCTKpWY@fsFOc>RLs$ej4n#y;2~v zlkKq_fEoR8UUjC0dchksSIU&LrOcOOnfZ1Gu+4~*2Jl+>6_gdRfi2r^5-VYzNR=%Y*^OD%6yePS9mg+C_kww79(=5!H1kXFG{* zdO@YVeSz<)jcg3w(QGVTQ%^x7h?r6PNI?(51gTg@{8$Lshy zDtlXeb;0uHM;haTGNwR%N8D2g?8~r)HZTCgkDo4c1gP;-HtbT^a15x<&)FIH?MWH#s zpDDrDmLadQxhsV<#7*LuD;(|1#C=E_DBFDxQUosV{j$|rk(%oiTcpRZ`gYWhQ_g+L z@l>^}3wl7lm2!6di*H*i567n?6HDT8)eoP@O#|uZOSk)9N!6TWR0xU?p*J{D!JOSH zmAj`XgD)rcP@+j*k1s)aMD=`$?YU@pZm^1UY|&x=oi3-q&lopk*#4_+Z0~K&JTRs& zeZ|&W+#1l$3S{C3I-@j}+h4s~Qk%CSm6q@kOkFBbzFZ@mT0xB6Diwd;Q*4qZeruMFy;fkPNd zo`!6mWnwsSHn^{zD^eR?7Z+29;5Qgx>KsWQuIzM)lPjXDzo{_ppeR4#GCcjJp=0~n z%njHD#OYAHvDZA*QT5~ElwUw^{rt(yLDxm{P(8kH%*~t8R9g|+u`Hf6#R!X&#mIYI$P3HpTPvQa>*rflOLxfB0xKWU*3xy5uiF56sHC&L> z`|EW4?<_imk|kY0@OJE9SxI^jdsx!FP~xigJ(5(jM?Po%6Phj$$dQNXQ)YNbA8##W z#c-O9^yr08Cre=Mqca(Fg;|lhn+CPy>cAn z-RD2U7sln`GO{C?5;Gzpo%(GKs4jsepKI*d_gd4q9eNxO9Ve zg?}fL*>{Uu?-W!~Oy(^u4Hih3J)Hd}lB+q`lP@5~_3D_RO`o+oIi3bdDy$({zPL_V zsoxfx-0zZLHt<}@N;3jy2NZ0TluCuhPwvfs2~-a^a*6QUkFdHPG~A$zGou5|4e)FH z#M7GGhbEtn^M-=zj=|%;|Eev%kW;sYXE-B9=>-jldX8k%8DtG|6wj`T!1wgF#c}nC zDTpt`IF^XLh#P>;i9s^M=5aJYXEBRrsH3qFrbOeNW{6M{jF~piSyYYP65w_;)GZ|}h#k9Jb-BqrWu zh%P6T`Fctc-#;Hbp8*Ia>jMsiiXU9rW2cM@!RiO%n7)^d`>*!&MoMSvWo87^2L}fU zl=%g_!9p*zo|8SWpbMpcyl*j_Jk^bs(WEakkl~jkZz(K%r>YW+(-HiBL;j&ubOGDY zg*~4Vp(m7YyT@Ax%TUJx-WQXl7Ay3%XGpt>p0jm?Y8w|=C>r!met*@}v%HO0xE>%Q z2b~tQ=x6Hk4bSo0ejDxRs9ud=aT=i!h~y~wE14H$-b0%C$$2iVLFg`+ zUQlnY0NLRiwU?(nYytqM2{MwKFj)KyaXjX%NMyMH8s1cR8k zQ{sn4A2s%X)j})K*iwCK=rC(Rf-VmkJEy^Px?-`f9@lW62<+mCIF~u_F0+>3>DC%r zU1%r!yfEL|fwjh(5HPyI=uB17@w<-e<;$13)2^V-@8yg^1rDWUiicnV=6$+ zXb4X^MeeVJzfRNw@66c%thV^3)e<)L7$DQuMrZ1tf?sxYRQb{n#%yRS3)#$!x`I?6 z0JY-v&OXQ8zq&FjOrD^)Lx9(C;RNdCYl2y6GjwaK!ju%$mv7zE?+Q%cTUCk;D>V0^ zsG-pJCp@&3EMr3x+NQTvqovm^&qj$5Cx3pRM6$3-d9`BEBNs&{vrk>>RhCtrVhd=^U|q%#`dK*w zs*1|g$sglf<|#cA(p zn^FHUB#_zK&+3+YaqskYB8Q2)d&#L>?%+X-{KcA5#8bWq?tj-sIh2)^aVxT9(3jvA z30I@_*ckgLlSrE6WZcq%A#O>1KsnNdVpp#(^cXsUfe2q&_ z-oSm;BLmtHgxvk|${w7Fw5HQeB_LbL^R=9=ZN331LtSwpt<|ZXyo+elpj2|1B1C&@ zbau+{4S55PE~jj$CuIDW!8A!N9mEfM%!T6uT5YkEQxM&ATf0f1Hb;~{ndbH3Bd49V z6eld2wfS1Op&EpVtLB&g7wfbC8*^d5{>jS-lZq{3yIc#1D+8@s5#IRXnocnQ;&m94 zNzaxbj_H6cXnsjQRaH79M5yyST4tt6+fbTcmYnF-Z~~QI-BLJh2zdKv^|~!qQSb~| zAFGgz9HA|zt>lIWxNiOEN_{&|w>cYmC}k0~_1FP(tn1GS$Ef;00x;iO!$qtta-PS^ z(>heQCAq*lsc4DfDVNj9{YGNKmmerXg=#Rn(Tp zE6FU!R64?1^TH5*sGd7&=akeK;y10kgY4C6xWSk0@vNj=VD>&}~iCF(M*D{``4z9)8~#65fs@ zH>8q*dFP0+&Ucm>qJW5VbNMX3eGse$Se92;nih2+F`-xYR>+O_E`i2JA|6(Vcs^cU zORR@^1kv>!jwBBUVqYAHjpGm>FSP04=R~6Ud|8hndaC+k8QZgIVPWCM=DXO5AC`0< zvn7#rYf1kiZZO2*Cy=Ba{K~?sxB3!MtnV_d_VwW$FX>4;{`TiLmH!wEemy!1F=u^> z(lgJWpHc-O(n^!R&mi|?IFYO_^T{y&`*1AW zL_loFNWy8KZ)DJ*A|#H7?AwLOm2SrNT>kzod%vp8H@qb8cX<6flfE(9c8XA&2Dhl3 z1jzZC=4IH~AC_mhS-M;2@w*tpbDP+zN?&Ra&J4FG6@$x?$^Q#(JB2`VDdZp5CI0p3 z-BtNKOTcK$get$N!an|UyQtJ+&?lEc24IWkNy2ooOIR05WvAY+mwtBIq9(t`n+^27 z6$$NoCQt%&6P{bS5_3o3i|!Z6|je5Nvy2DrTNQY$>; zJ6}|{1}HKlt?q4j>thb?*TM3&nolWzWAu}p+pr=_jw-}qF@G+bbbh!?cN^K*V=W@GMVTeJ# z&Jpx}SAPKmAQ~|2YKAY?pQb|_CElf z*_$T!`tfDbmHZ%~lu)tRx)<-S!Gm)Wb+nA+b&oj1QG!mQupuK)nxwx0`IpypN4@4z zd%?*HXTkU>=A4a~n;`a;V9K~4uUv=)^dAC+Y_C(XS!U~)^v1jmg}(g)aW$d#uBf@R zb<8QO+yT8{X<#C~_FawYJ5)}S%pORTZGI8kUm9NYuks3iJ!%tIMgx@CM^d4`oA@%B zl{}zR;4M-eVu~`u7JgS}^Wzl6U~?4OysrH$3dBmeM}xrepMp^c3)6XRF17mL&5{}$ zeuRo#wcq3B49yRi%a2om3LU8AIf!YG2f*2jv|dtNO|VM}aqiiN+m~AWmIj`Ua!rlV zd2U+m*L6+t`+Jk;ds|yFLe60}3t=ajom40!@x%XJp|DTT^*=Mo>|G5`LbVRM%A7Od zkTLMYE5x^zo|~g|p-eNonaHP1f@uaiUS3kXRm}oP)-x_(mu6SQA!@_=HufNHKTzRPDx1dZ{7+KXgind`iRioeMOj*`PNcW^u7)PVC{8d z~ihg=rAcqRO|7?Efymm}~COuYTo*qX6!jM1o$>ph_izy%$zqB7?C zvV=@w{-@zdZP9$N*=HJZsU)ToFPwNv>j=-*9I|(Dczj%<$FFkUt8n*? zJi`{MMwsj&Li%oJiTSzzsz8{^=3};leo?+-B`T@}^W`?K{x*-aBI?Kr*PBV7v<%?f zd4VDA3iF_yIOP-fxv%FCyPs8rMn@>Dd|Ov*EKOM8&web^RkA_@I#k&lpTD*Bd8XkM zwJi8DJOX|AvPX{Z626w3+v&z73P#90ij3=R3?D#ocH+PhOWWIMYL;WHfLt4<$fA|- zMJo}66ljxp^MY1IGe?I77kb8eTnRm-W7=lZ!^gRZJHFFDktL^PAmj;UCebFzJje>V zT9td2_nyIXyKtMXp5z$pvvZmt0@8+%M#%Svbpz6tSAOW@15Fb#y4c zw;@dHaZ1078>yS{H=s3oq=B=9!0b@@yt6P|`G8l>G)P)<<~^V4jei(^%>an#XFsV` ksQq>4|NJ@e$d?2HA+H3KsT0fi&s8UO$Q diff --git a/assets/ranger.png b/assets/ranger.png index 3be4b6368938245a2daf49f393b53915eae24289..c04fa50ed8d53ea8b214d13dd2e0105526cd836f 100644 GIT binary patch delta 9047 zcmbt(c{o(z`}bkSAZsIxB}>+lElZY+P{LqTDmzhGr$J&WIz%KiAyl%JEZHebwy`S- z$u7p0ow1Lxy+_~Q`~AKDzjIyBnR7kY^W67+p68s;^SM8FjBTrRVeJv{#G2s+9dp9q zf^ERFYkglvujrac8YTbb@Iqje#y-+so^p9(ie&0Yn7*pHI?h-VQDu=G8gf)j`AI_K z%6nt3!PY9tkHIl~6Nw71x21l$KYP>2w}XAts$eMoan=QfMMXRdGREi`v^@lWys5_}Y}`*URH-F+e*00T12PrZ2{kW4>9dDQsINJ8%b0XS;E zV2QS8vl}YT=&*4!^swweqxuB#kw+EL=k_sc5;-eenDLA9Nuh^rCpmz7>Cxsji}hcw zT_`n!UG|->{k7{jMpGpJwpCRx$+DYqsId`luxNS$$djG_!wAN{nwZWTWQPXv1_(UK zgulFS5XuFd3jJO;DNUM`-sLumj>(#-V#8h>ZJ3lkEeR_*8i;-Tg@Ds_HWW7A&(1zs zG+;pX6=yv(7bbbKsoNr>Ncj0QJhexgo1T>V@f%z02Lf*UsY+?4_Ol(7MdPs;fm5OiX8=-E8N(6J@-9N|;5WfmzL4Ou(* z2sb+wx4z0X^TFGju*rfkfhi?ot|xo{hE`*fV zOC|JGilAru(Hcz;ZS0RBin*C^6lZ620*lhl#?i~!)Uf3z&qwuUU6QXx z9JU)B8@kRFj9*!BioWlafEV@y8z~g~17GRTOWVlgHv4ja0g@-yqkW-XO0f_Fx>jXj zIUkoZI+RQ4)5oCmciP@&h_bdviYljl!LZ)Ne0FxOka{kh%xVDi6Tu;H(jaZTbfkW2 zNM!EpJlETF#d_3I__vEm?@@e9;rInhN`KfmSCh3EbD-pO{qZoT#2ZOdLeLvN`yA*a zU*6vy(bFL)_qImsdhq^{sIBbesT`ysk8O-qmgld$-$(BIFQ>ghhm`xXPwVt&@n|@8 zF7bt&R&-g#XwJA`!FBBoMPwBV(U2GOc%0+2<`*sdpY@&`g4OF*9&aM{Rhm&k?t~@i z<9e~dr+x)6;>o8H$E8f@J@bk@nE9Vv+WzxY^=RA5vj!RGXa1)uA@>&)R0FbxnL!Y$bSj>14cAX3#+C4vgpLfu4)rrIUC0aT~RrsdC z>a4n&sNqEQ^1zLoV=o#M@B<&XErbGh-GWxTMFKnHZ*`E$8dEomnmDS7LWy*06qW=$ z%wLzAIS_2NUbuPsiF}+yV_KED{uk9WQdGY`(xPb^#L z!lO&VLd*Rdf7P5wMxj>Jrp7~ps82Q7!4C%u2RK@%rsN@z6vgac=4?+686L=QDgUlL##GCxMV~29#;_KHL0^Q$t>-y+_c#V??WwoJ5o&V&?^0 z+4Ct9db@`l`zrm8VM@hy_S`SGwRSq;f&zCLJVd8R$m9{Z$^P6X?D|cQa_)SSr6)yW z*HQfZPrACgo`bHJW_QxkL{mX;X*(JFh<~W{g_O_Et%&piw+?b=XThfWHfba z(_f#JFTD^Kyj#KMD#-7T+!H{<&P(99O?Qtt%P^L*>5JJ%WFl0D5ZCCg-~*J|{r-S{ z1@Q{S%1)hw=ybt;U!fc73VoL_a{QyT=67?pz^s?SPq%fsz#PH;%~#f0yKXCTFlWn@ z3Nv<_DA|B1(yvA3_6Igo)uoCqD`?v*5`de6UA5#N#H;T?58{&BnW_rp&2%Y)so&qD z@1+Tk$5)m5Kh>Q?;+?PZ{#7o1#=$u`iU|K9JGQ8OA=C za=w0UKMDV9Y_v9cU&;T$o)ckxHa2=s6D(Fz4V5ndJ>ozD*^e@{L39Gkwv?&jE4>!< zB2(3XLP_WyXv--B#dryr^pwyOeWMQ>Em=(`?- z5?tYX!Pf_&=MB^q5(;D)}U&GEN!HYq1o#&@bg?Lu%>~TKFj(;oi zaX=L{bd06W$vfUig6ov^rP_Ot0#r&~q&n);x=j+5!wibEF(ifq_eaJeym zKHp!Vp~v~oTmt*ZnLLjW^t~cMHR;E2de4C?CjvRQUjhDvuZ*d6j6_irdQ$e0q?*Fn z+~}qDP;z@|T~?Qj_{q^G6+70B%!|kHrEJ&9uIiMk+r;Y&0ETvf+qPs{3?pzE91MFA zHz&X63!X53@%(C4g#~+L(9(0^lYIV!k(RJ&KeoB2EvWG#*NB7POd|4(Kih)Vyvc)P z9Cy$gSw;kKZ*C*$Z+AEY<>$A`v7}hPh7Ank80}*)0$|-U7HDx8#Y*u!qa&{B-MU(p zLCkQSy0>?*HGc5hIH969hI+lYHlyQoZ$t}^2Kd6PN_Ahr2uLwK9hi7^kuuvzPo>G{ zdG7tvIsET(7N9fx(FeLRoXX_iHe82T9b14d)5KiL2t)QC*Ka9}@f%CQY9lriOiepJ zhW9xF5%cZYzUAsY?0u4cP5fAweXUZ+?)d5RGTO`|w;gUB$$h-Z*2QG((O*1g;&7L8=0-GzIZq<;bUR8H_f4MZEqZWG{28$R~ZxSUqME3YKX%>T1Sp?pal(^7TD2p-exxzRq8xC>5j+J}~;08kYhuFzL*l z(X+M(MSUfNcgTIcGG8HNI^)FjMWPAxag!xA)}*3mVC#yK*&WWWJ7;A4cjUL?5C!2W zR|}Snp8}DJh#KltsDX}oq^ddRxA6~G-7g9vNt#m2s>cfA?Af5T52yV4eaS6gkD=Uq zDoI*>^wGgv&enzyl;w*OHaKi@D>H!UM;C!n3pNy_f? zdn^CALNsIYQf6;6zuzQp?XX!;-DHAb%7q%9f6Lg z;PQ&+N>rp;G0*y%yR9 z8oW_^RMTCWt}`SyBR3yDMeqp)Lxk0aPn(8S_&1Klb%$jJBtwy~%}TuH4B(7lFCJ6O z%EHlTEN{HaeVbFO+c=9)8sdn|r<#ZtUX}((tyhFhhs)#4F@{kk@Nfmr4gn&!N!3R$ z9R>gMLm*X_u*S<#Z!o&$wAgNcPMTljq|gp|dO|zdUXcPzTzV4J&<-kYKTDu_9E_DY z>~Pd_^To`qxq1B^KBrdh|B(HY_MBW)LR<5icG;tk>V>m%sM(#zPa8NqzUJtroK{`5 z4SgwrVDquw73}v(kREyp-rX{iN^X9EK}U%S?~^hr9leWECWl^9@$21zy>vItgb!By z4`Z?lz7~-Qk%etmFw&xNX!0sdY`@2`B<>dF(Qn}ce0SKKk3+ZZi6R3F)+@}T&yu#> z-u{)-Yt0bXDhJi+C?<+RctIlLX6$%uTc*Y~MOxDw-NP`k2zh+Z0_=fva8C#yLlLt| zn(>bff^Dz-d|H-tjPa*-WnssH1uYGMRjf(>OQWuXcfgik9D1#o6Lf}KxmyO(lxW0v&8pK)%SeD<=S2lA>h1peUT|{^g8W^-sR%_s8z? z(svHWud7(=Qaz^XuU1e8xI1D@Yp7*oAF0y>k3*j~pW*oTL|&fcgH^o=6#JZV{qdCm zU1IJmsFd(Rywu}Diko9C&)4(~=|X6TbIlq|Z7oTd!*zVcBXt=b15dzAK+3e;Qa%Y?(SN2)` zWSPV;a88I2P*Fr5Z^~_VN-v5 z;^a$?v4VjYNJGp{sl!zoq1Y4J$5OfVB_*|%_7$TLkce!}ZC8UVA z#tQM*cm7Mg(lC)REt{DPLn5a2AVogs!lQlgZ!+VF(N~c{KX2==^G3P8;)wlleqz{H zXM*r<`-;CoO}Y_auC9^Qr=dZRmils_b6&2<#ywy9?YYHr=>&5}T7eKus5 zSI%4$xjYl8Q|ZiE+{je4=NeNuemZch4SL>8hDWRA(#naiYt!K$%XQZx+0E@wrg?!N z{gnQV9ZMurdxGvgBTS%_bqyc>>?6*u>W?vUOY z;zJ*~93PRE55|o(8;kKMIy3+2;_m=n{J&XdB;+K;ru0IhA+zjQ*Ya?(RO>xns@CR7 z^*e-_OCAz!INT|LDX^R6sp^PE!pCw(Qru3mA_a7EqErvmdQJ55%jXqjUA85BdjM_L z(PS?DXXy3&ox4WlUyL0cDGX#rq)|DO=OMGWpxu zM9IDU=lOFQ%Xt}$@6kyp@q_h_>j9i$0qHr61wN=1+$o`NwGw~d z->r-e%XDPm$vI}Bf)M5K zUpReWa41F;#6;>hTJx-++_B6n?`R)L&8Xlbmz@nk%yW)y^vTle-mj)FoXO&rD}kq0 z$XZ6(yYb;I8yFeP-@+AChmY(v@yy7Vit_`T#|7?k@3>Fh$ie1K^;xG>_=p$X7NbS7 zmC=`4P3ZX;Mgh&C)?%e}BPr-%JS* zY28~%4B46M)$oiGI|iY}r^D=T`|qFoxrB>GE-!+OS5lHeT&}77C%b)*6b+XZ=wf8H{xno5;Uj&B zUd}+4c%G;3M~TwLWoc8ReNcS$3)PKYT!w~nGA^=+wEfnRtmR()-kn(tqlCy?louX_ zd9H9@6F$cw&lpcL3;0~bH8=F~P*C&earaTk_jX93)1AB#+$ZUCeLYQ_^Wmr#^G%mK ztQ(SnX4ad_qf80J<;xpg$zcgwp)nDN7 zZy9}zp#yTjppzN=0lJhOA+2xQf0wCGMtu%?c8^_T8fII+iSY7vkh6%xH=jQq==938v$x4<PA7R+b(FoPP~z(+{UD>5fu}9$v6SCSuK*Ws$JN7rT93@SRsK|l@pV~|hKXo*aMgAyY z2Pk-TCHP!7h~;-mjA4j!7N_$V-XfrXONj4p69j7Dq#z@@2t>wlJ&F(W`IY{#Gjca_ zotnm_b+);$%{3$`QtLq;shg?675maDFA@-RE%yd~N0$a(^v>!*rrODh9}1Rlvr4IT zv*+v)RLbQQHbXZdcb|$tjkR?Bo!Ms*DyFs`^IXDqgZ(5( zL(#Z?+V^{=$NaA_{?}(}qHa;S=?=-2JXYK>x)7C)M7P1g|L9{ckxaN{F+d29rhoZA zr0O&FnLirwZiCDaxUYSmp7ez?sixZ@;nlq{96S&$zhiZ z$u+}e=&Dz{R(k@bAduGMep&Hlrr_)Um9sb`Yv-XEx~P9MOkC_A;H5`=H~MBq&FDML z3kH}16JQt&JOK*D3g&Dg3{Xb=3K(wQavaS543V7^+@CI2BZq!65+*1%O*_%wjSS(i|2;xHQtM62AM5{hR4kd*sKf&oz{n zCa!9s*I`D9BGB{rKMN|!CvMhMZt5Ig{7}8&VKqb)JPELF!MD=H$^M#!sYF#@-2j0z ze~mcR+^g zs`o>xn^gX%KLItND9+~zlMS9kLV^w?%zIu5ctUB=0vfcsMjtv&Ur8Qj=NI8_+QzE8F%G(mPmpP)Ho9#^khKXIe{S5?pC!0x)fG1z&&9s9k7)@-aL1 z1xUnc3sQ90Rz#!aByFyo+YCo{DC9?fzn|?7Hgd(QRUVKq;50LFvk>^<4-B zfJ{t!g$=t$gz&DRQVlC*>;Z#N)LDK%bF{44xZ_q1bw zR|aW=|5pS1|G&la*WAvAP`FBv>iYoHEM&7UD1*7PzNZJ;U-xwoK>ug(?jq?Pd66WF-)$dd|BnsIahfmrW!cK#f3u-J zDtmyYr`YK4#Q$0dfd?`c*mVni1_do>b~3eA0dBIjBeWkM#SR$@#1(pxhete|^GdZO zTkAFUAO87EN=3-9Kg~Y?eMsBd5mI&5|1eyE3@#}Sy zWq{!I~ zMI+NcqW>{-(%eHxnXG&A~_OO^lB zu-qT0nEv9U0lMFVV#oFF8{S8VTq{V6L0XUd9g~u%#h~+2KOyW*0&iUuc8UZ~@d(DaIfVW9e>)bBD;r=M`T{!e}BqdsMEuu4|W z6VTxR)gIn+NYFhV{qwX38G5JL3{TJW<@UjTl;<{8=$i22p)@b&-9--gdYDETLee~2 z>veX)aY#~!3Kv<$Ssb9`eTelfRqn(ny;AtB6e=EeCp@ia>M#OyCDWow;?^>>n z%&*~@&=(Snp_eqXTz91z1p_TO6gI|47OJ4Eguv;7VRDM)vSVvyV%Eu)cwoP< zM)&cf?mPX}xh&+hva#h@Pb6yt}cWt;VLKBos*h<|EtH=i#tB@RltkELz92WnJ0 zeY11H4}yYxEly5`F$C47~ z*E)AqpiZY#nj2|Kh{eN$9=52rhb)=O)zXY#cnZbV_)~OnBzW1P*e_HKTEeq(>pIYe z99r6)5xRO5pVhs-zD$P(1>_)VeHN5kuZv;{p!Dxqzkf||+2sPvaY) zv0|3cHs}awzkwaQm*DVmH{ckC%j;kg!1O>Xl>E>lVG^1KvbOgN<2UGt!@312t*JKqYR%L zM+A>n%slYwD+3SokB%1I!e10#VimqgoxG>(J&R2;fpzf~LZ0ORCsz&LoGh)Ak<#|q z>?4CkM1nQ;SsLfIbi!ubt*}Ngqb;Z+CXG-NKM%c6LT_sk5cj|2F<)PL78e@!w;%{= z;jhi>@gPBcxV)3s8r{zXOFFaJ+~x8xj6J6CT|1Pra3%75UC(Tzv!>kMfK*YJc$7;@ zQbaOwaOt*fZwTf&9zQ6k!X}itqzVeVuM7#>3EfoO_rjjIPtSCcF~i7>f^2)QV{=3I zX9oJ*tI@+LX7@J4btcr$< z2iARC)~Ipg>fKX^%FRk?$lCEkviBQio#T~m2)rGN>7h2=&KWu`jP*|c3U9R@Sye5w zx*Jk8B`XyOUGVC3ld|{+ZOkIj#o82rE+gLbhr{Bz&O?_n&HTLsK+9}5wt`W}7Jz<+ M7fmnZ>pDF7Kj$TWxc~qF delta 9251 zcmb_>cTiJbyY8lg(gYL)Bp_Y7(!qeB^kzUnx?rJ75hO}rha!k5k*cnfu3?lbP(<$*lFZwbr|y_kF(FCpwn5oB)MC8(zI) zg&bRT^l^8*Qxn!LXlW`l`32S=#p*VvzIIJd=$v|A#4o2cpU;xR%DKDjrDh%}Mmndz z=tL@Cw(38HPt*u{HR5WvdYM;!&+@fp#fzH0Js}UZtKFN2F<;0&7i$!0$g5coOhiQjKqaNIGEb@0F2nN|E>ynx`LP^c^W*P92cZG#lJXJWT$YbEApP_!A68)we zZi?^!j803OvN>wt)Xr@=4R0ZsH-$tyyQ$p#DI;2cFJykUEjFk^WPOPryfsRZ-8Zpg`IqpQ( zXj&x)wt%zUZ>ghPbr!7uT1LC>MW|Y$0p8n6w|)D@oNQEJz{kUb_GH()koqR8=3@{n zy;n9V`(zfUHvgX$BOtO~$u9uOmdQU!lkJS+Pe!yJr6A;A*>eg3@vYhBtn1;eztVfr z4s$jUyGnjzTe-CImoCv575DZabSNBpcGk?z$3jiqMZ7b?ujQmpwhX2oCc*f_AYq_% zZh;#Xlhhs(LG^}zlJo4~;8lCt$RpN&exd^zXN0G?*Ifx!D@i>ILs+b~yO>;xQS0*` z70PV{+qG}anNJ@G z0o;2jgiuaUU1r~cLn5vFO2C=8Yr;R%VGKbv)28 z87NAG{?;+&Wyilt)QU$rH~Cr=T!)z~hlf*1oQboLK2y@UWW>`f6|HJoiz^yD77|gC zWDN6=a#_*+bIo6tGyUY`oo}&ks0hzXHAZGbK&}RA0#Y$T$|;eJQ+LLao(YD>`fvNU znKM(FFw?aRFS$K#UL8O&w%@}MGI~qxnKNVxM%kIryR($QhC&;o&~e{Z@dlA=;L;3> zShNmiH;}BY6@fYJ8zhQ;((0hDz+8Y}>YBeujAKCZA9PM%HbW}@d>yI=x%_ai4FUF~ z=2*d&HgF6K*->@gthFVnoIJf>MiP<9pYi2$@ zwUzP;v;eTRyXahyT=&VoS7}gO@L~)(jrGTh9-ufKXl(5mu}@%l;B{3RFU)$+j4x|P zDElUpULji$y(=kLO!K#8pYkhrF)&8_8Xzl0KXr*FO@_YuvRKiNmce_kdJT%yo2~*| z50)~G(zX3kv@_0gA3fjCN~D8TN*;0w1Bw8>bW7L#r&oUdq!DrQqbz@6<7Q~vy+n0z zrm}Vxe%IqkL_KCRGiV@f=-(eqXaEZB^PzRE#;IK@_fc@axHMB}D;=E*_KbKVo62D? zRCt4};E7L?2i5nG{-GkDa%kP+jzlKut@`0_XoGG`S~F$+7*su3|5aalCdkB)6GkdP z7>Y1=?H3(EJF$GZcgg%78Bu(@<4hdRqSvrzVZa3N|H15S&;0oM5q)>aM*r(TRy0X$ z`cXfLEPW>K)Si{NAshtR(51W%Bvb%)Xd05^CzhZ}ML;}}b#^Z|?s`oWqsG$K$b^s= zN|BTJH>_i@xzDIWtWT zE61{HTeD`S(A=BH-c%*=UATL;VMHRwX{Pf?KZKy{NchW;mK=bv>pEfIm7$F;k(p9%nlrO5C*eCru`WuBzE{hN)OjH@zXJhbnB zOuw*WeZF(u(JhxL29L2~H8Di*CUk|XIR(9-dss-TJ-fOJG87UZ<5UmFr|5=47b%c^ zImst*y!%_pMpco zB_xYb>3*NbL$o2$m&EZ8B635^ZNDb>zORI`-&Kq@b?s1_uM7`nU_lQ;U6;slhLgH1%`h`Lt0;3H6{Ap0WQCtMQ)s* zXU*z5^^spyis46Bcx3?LfA$Lg|K{C)8bJ7Q#O& z`QBY@01_H;Q?0xlN2rWg(ap~JGY*ORfXK+dW6rlVNz* zS+==0vYCMka517**DRr*LwW`q0g7r0kMLPj{8qcU>yRE0jkv(!h4dBSJ-E#A+WbI7 z2YB-#J@QI#cxy}v0IQ*oEM!`a)Yq+nbey$|(dYk>xu|(AYp3<1GheIVk9Ta#@ht<> zj|?SBBLc5XF3w}uN{j){W<8oY2|{TK&x__67OX6cb4N@RUuO))>2jAZuLY$11rb3|LQddD4gbcg$E z^9OHn%V3bZQHC#({PXSp!S?>no()}QRzRlwAN^v?} zU{J;t<|oMn_0PhDQq`J|`Y@+Sd();k+1OKP zYCt$Y?cpz+O14|1a)Ey6=psq`$Sz$z{(HPs)+U)snkyu_< zEk$A`CLgbq7_6+X$3Q66PS$yRI1gj2<|m5ecH|HSvIAWBn@ad!9hE4;_L`B-_XL5W|!^L6bd7Nz#*?d`I-QiB&xr_*L1OJ zQP&Wy6|8bAlnDZF7GBhT)pu?U>(%-B#n`~6D6hIgOy_36$l9eu2`UTGN5>I#R4b30 zb)2KjghpO?vG0P|-Q8vAneh1!rcCQO(~eK&X8jG2Hz~b+Rh`|=@Lh$J-LZp}h~Pd^ z1!}a`M}}8>XTNylO$Ty4uTUa{y{fVNAuf(H1@u|0+9WA@HVay z?8?r_2>hupS$>|G z?YK2FfZA4uq+5PHOf$zk4PE^FIQ23E@lXhIlfgl?PIzXjzFzps!2l9o<0Nx%XmAZV zj5Lk{jz_%-)+B)?G-on7s?4q1C*sBvb9ANQ<-Z&^`gHw0Za8GVu=7&|{8 z?68WV0H1bz>>v5n^xI=T!zJRPaNd2PgT9`FUD2&1cAAe*3Zr zEbgKA=M!{Z4k*YPM(Z~2hdxo=h59bbFa7|atuHRm(oY%E$fJDG*c}!MvTJOA2_s|d zlTTqNgV4B~JP%8>ikhY*wckwza@N^8Z-t_@f|2Q+Ii|I^7|1lpd`7rdjZ)z-`25WW%=lzp)C`!m>`;qGFQrWxH zKgv%w+vz;7-{j+7FxwN3&3tv_3D2JfJ8Wc;OAD|YOYNR8tlCd`+~UI`_k=og#80)MeNZ_oDG1=LQ~W49LT z!rv4do!viD;rB0_><_?YZL63L_WrE6{w&+7$nQCm_mh;Wtch`!%;FRU(wW~);c#Fh zN`Tv5My(oa?Zt1%f$nkZG&(?hM;h}@&Ko5I8%9*VvPO+Nn<+3G*sv5-_4l8~r*1D= z8m`*trgbn1mT~b@CNYGO-7s4HloRR3I+mJUgizGH&09>IWj~Y!8?@R(|D6Qc@RTnW zO2=g+^1R!0m$Q(Z*cRw41arv`_irkLipjFdfqXWxmZcuQDT%0QukOd&(?~~Yd~4%! zB6N-Q8Vz|B-F7P8YZ?6^pUEOhQ+HgtudG6O2G+QA$Q-Q1C~Qhg@ccV%!c&=b@)u`!8*CHh< zaKt;77X8P8(m{Gn8V{qR_QO#Y6GzT!7th00KXN5EPq7xHQrmE-|p(Y5VHSBmGG z+2Qdh8&qbFQ3hPIcrSZeSu{oJ7P*vX#sR8XVfFzT`#YrVik}nf+?GxVVHFBaHEVlqJ!~8Iga{L9uU>T>`=oaTcc&f zVeLRCk6NOv`B{~VW8xg*PV5;QSv>2m{52FLc<)wcp$=$#Pl~wLuietf4mav+0j_HGgdBN8P!}&26PlX&bmIzVj zkS9;~0cGM;bsztuzdrSm)@$!rv`$K#7!faT{@&0kL-T0)=I}c>LfT4 zJd_27#f#^5>;IEr)W>1I4VIK&jxk5yL76@{zGYn9oLvXzv5n*8B{lG{%z-WE!gAVf zw{H7?PwQ}|y-@v&LF>keEC+XT6SNxGJ?YyB9HN!KS8}6LRPXPBfw5Ep#L3+ofwqp&?_S0I$8HJx&Tr+AU zoA4CGiPLX?B!+QwuWvkZ@UEUiPI7kU*wqdGUui@#CvpEVv2QqJuyCNZO+){Fba4DH z=E{YK?W^?@CqRJf&uiuQ*5+)psS5&kb5Pu)TKD?MV~l-6Q$W;*C9mJ z^kDApHKcBo1#+lUz1aWH$%YC)=BsZ%}xWuj<0RDBiB5YBtj@XLF)TaOB( z?(X+W$--4Bwv6|gX_MNM0vf7ZizISGSw*>5BWn`8nShyFV~y*d!JIYW>Bu?pL+wV( z@y)eWosH<4`Ymr`yHS~68iV4!c%j3+(VLD;XtB(y+e)Gm_`FLZD1YC$I{tq)PQ_d* zWHF~4hd?nu#l>OkinO{x3_j;=%~{Dg#DZV;>Bx0U`ZQfb&kz#}$uNbPr9XdSX1>@NhjzD|HekClO8Y3}GcnPloEWsvnL72G1`8?psqo)0P+VSQXd&frFJzNI*jTz;bXe4==p@UxezaN>GI$B| zi}s#g7>_?0dgJO7fAM`+GP3(jBz=QySQaGgdJPkJJn%V^S3_)1G1{AaPoQ2>gqvd6 z929$W)r)EoEnmcTcw6DvD38b?2<-JneLBli@pQPekY4XV>W_?FVr$QJ@Sw#E_I?0T zBEk_Dg%eC6ZmT{j%iq(ybdddRWHK3rODEn*9b`Oal)!Hg6(kRbvqJ9m z`kXR>(hh}J)n^|-Z}<4wM9L#7R=2ADa!Nl-yzzMaHEQ{3Nve*%mQq@X@!4GC=70Di z))~pOEa5_2fM}cZNN1?x=B75TgeL=mV00s*&7k|4P`u1aUt#YQFDgOeh*!mfA5K=? z9}cBM8-dHs#FssO{E8$ z`C+`uLlnx3ukttg^Y6a^bAt=JwT5*En%M$UoFyl36BJh>P4_ST68ji0ullpbwRa-# zj7+@Do=tzoKKYB{WINu*pQwD?i13s@1n;EwyJ^QySGIIACdhSH(LOslsZ!Km#3rV6 zbm`Z-+X14?X}EpNu8XX+wei>1Yb%ud6;hf;y)dXP)8BSgqpH0 zx5KvYuQRQuF=jc>2aG-qP5^^;G#xT1ZD%p2F@-TI)jt=Yc5j_}h`^69zY`{`pvqs9#Rf@{Nwo<%1vI z!DY!V+m{r$9$#=x^i7xa1V{Iqgbg%h+umQSG~JHHjDt=+losSELP~JE5JX&Io-035${VY7_CeA zxJVFBXtn`SKsppji2iA%)Ge;RWpj-L6MnEk3{Dw#6l5bKEQ|AqE*?>Dl>y&KL;Xi3vwTtEw9EoH+>X6Hy2K!p^QNcxqBi) z^Ti!VT=W7h;R6V@TdqjmD7!_F9V3bu%wua#qajwF)Xene%zrCwPf9Lx_o2;cH>M@z zffJ1A3o$q;#1l?&z)?+JoC>z*Pdw)0LHG+RR)=C4uRexaucr$^e5mbi8>G7CWpUzA zOEayXZ}8PC#ci>?-4J`jB$(Yp>Bi(@(kdBiBe`7TAk1Uy7~19v^@xe<;TS$EXpJBqDbxoeSKNv- zw5^&pEQG68?0u;!ZA#-rpN3ruJb$&c6?3zg(1im<%R9jiKdLKc_OlU7RO~wG0Y@YE#USw}e0HRA^ z>ptc!)W)^HSw2g}+X|pjHSSvh1SpbKB;D-17;Aw3pg+Y?yCo%NW{<+dg`qP-FfYvs zXRYW`5PPyD3>oZT1k!93i%9-wl(a>Wo{G}xFP(U2Hat>bht3_GG{ORD4w>@oErBbO zzT3`Z2xskg-0u54ao)OLi}CFfip97hM3XH#e`*@$0A8p>b2Fjw3p%iKRDOF1%_LXB zdzvp)28FjO*>xc>#C%^d6>))URTDc)c=RMYcjII}=&8+_m0}aUPrQ0<&*5F{%lu_H zQ#VP7gFVoLz(wKPGG1q?pvTQ_MnULdrw2ffpBJgW+Wq{LdP*C5R6hrx2j9mDzqKO< YfM?44VO(9QDgb>9ubEvf)p3dVFaLT*YybcN diff --git a/assets/rogue.png b/assets/rogue.png index 3b6017bbebfee3ede6d05f8c92219c70125e73c9..a78abaae05f1627fe9b7497e458d9d154aee9068 100644 GIT binary patch delta 8495 zcmbVx2UJtb_ii9SKq&&!q)HW~DqSF=B2ok{0-}T>s7RCQB}niD5EKxQ-U(8rNKvX% zLKhIDf`GIXIw&Ocn!JPef8Tq*_10UjWF?bx=A7BHXV0EJ-~NVRQ*f)Q^%x+AGrX#2 zi5&Z7XZH|ckfLBfXU5N&b>_5KfVoijok5MeGs*V_BuN7m62}Xkv#}RYKD|P+(eK`E zOWWkqU*b!DnBUbYSJMrxOO9AjLqXlV;x5%2fauX^OQ z3MAbTR&&ji>>*c|@4jznU{3f^N|U>-v({73){{Nidb-YwyTwNCTDkr1`?K^&zaD4v zKo=N-`oq|&J3DK^i`OSP;BRc^MGObX8N6Tt*}VAY$EqovXk0 z(S>h#Ij3pqOWgM2Xh~}EWr(q#6dDJQ9Sx^kmSpDZK5ms(*qFdgm$p~QGgY7ao@CaD zh?t$dpO&5d_FZ*#b!nRP>6hi4Xm`2gZ%ow_9^5aU#YsR!Y0GAi!hCaCVa7tsneE8S z0sf3+f)}T#F+}-rgkjYd$Q4+Fu{Z_>3M5&?;|oK#q+ZIs#P2?Fw8DLkW5I0?=pTay_;s$LGH&Kgr;18Xho#WF{fB$WbTM%-WV2!PR%P$EGwAiA<69*eOEVM5X4}}b zJ_8dI-H5h2HF|I0H(d6QIXUE)s;iaHr1qODq`vK1G~#bL7a{pz%&A;0WfvuK&A{L^ z26wTR$UykstzzH8J?6FsuXTrjk0PEwzw7UR5`2SLJ7PbmrmfA|h){TEpm#tfd-DuO z1T3}|7aQz5b;z)ITL1{Mj*iaP!9i$8M@Kc)91q-b)_q2N??je;h>>TClZtcEblpMaaEi$MG+Vs17K)Z`PNS{vFSoIJg3`X+=RhSwI|r$JL*}gPoQ5{9aF4U#%ZpNwJ6UM~pjgn9M-Hj8)reqEvao85 z=((2n`q2EHcQ3}0Sqy_)PRy10d$y0K!FM)FH}FobE|T@0LTWU_*fRq}q5nzHGs=-; z4_qr4xWgZvYcoe6XbTsqxMw|`z-5#!W@M*<&MX>&ux4!;VMWyOtMDO-cePz#`_fkt zHR--{GFqQN_C{xOrfc;S$X>8&bef*sCB_&yj;0ItUOPhT+CLc~rN1egJ%OGIYJ$ z<=p61Ps4HEFkV{(mF(o*HW-aoKt4?kSy^`tspQ4^J+IW*>FT#+##(9@<*j#pZ0;D=;{=8#54=fyr5HszQ!!ve3@=E}C>0SB5Ltci0L%WrH;C09R=gvZFv;g4FE zEQ@(8X)(uXYvs;jH30i0xw=hZ<*n8=dxq5nju!zGxGMc6gQE_LD#FN_>4V<;^UY*D z9M7&!BZ?9OS`Qyfw#nMJZ#7fZw6hhlMwH4@fUn6bq#_)SoP;Kh&za@-g#4|0M}q>AEZmG&nZ@Wpo!-O^th<0Wpp#Y} z7=}Yc0{t&xI`@l7wKEmHQA0d&(24(?2psVg}Dg~F`z>xh8}-y1Zo4W z^@n&O?-ZO_k2&{n1IYX8xd{s{W;sV}lpK1D6|`b6zr#cvigd2t?Kn<4931SXkN{st zL2A4K>J~aJJp=NDuz!6l1c&eF&RT>a8@LF;~3C8 z^34*}NK?oSw@dTIU}&Gk;vToqWqx4SWqz>oxX`z9nHyEH&Su^?Ql^mCMZ5vK%3HvA z91^w70sg$&;Ya<@kq<92A=c)9%4}n!x^fhy1XMbW8LAS{R?j$RuxJ0G+N>v*EFsp? zr<8MdJb_??m%EC@>7{V{(V(qfo$B4JCC^J4qZ}!O%3Fsxa}Dt+|4S&KFwLJxrpl&l zD3U0^jxJN$zAO281_i~4DsW(FeaH6VmB}k8ANOn=8*Ub>u={J8Bi73T^$H3*&MUX? zOQ2GpjwiLWF_JLTBltE5KK~E+mTbiMXrh6$y0^FY z`UzGScRokz(DaG+K*p}*Yz(BCm_x%kqF5OrN>Y(x>or#%Q$Hs=r znL_ba4mLLZ(5kii7jY8k2C93=w)|JQ-NEa=j(D5l{2RA!@mZctK0BR=IX-n2(n1~i z{S$rV%9Scqvv5jfeaB>L(;I-a>VOCqA&j>&5~Is-x9*bX*EY9Gxz|8wwkk*{-woph z0`QZmN~n7NO`{Kz)md3t&vthME7f#+1Wuh=J5?r$%v3Ca3vKkZU*PO{W5^&zJd&Lp z?o!GGg*5GLcgYx*mhWCMMB@Y0*&MmrmEQ6%r6XIaMNgdy?d>(JRBP#Jd`EscVk6bo zvzwqrXKuYuT3Y7}^Gc4&8mc$)VFl`hPo3g|5`F;msDy&P1bEGx-Qev8J%1@yJkJ&R zRS|hsE zOI7fyXgm3~^3KT`952*4va!Qi)=pH99xLSMdS(2Za(Y(Q$sWFS8a4ZoX8>(Y-100> z8U_>4j&B{5C)usZtI}f=ODxYS>FCJY*N|9p7~;BIJDjT?ekGA>b~Ht3vFp#bJ=Y!D zr~6=unIf5ZSv}x8@PR!2!HL}bfbgy>_v+c0b1~eCZi`4PMI_c0( z#H+D1auYdFIaB%sLhAan5ac86Tc~w#TflO+r-!ui^73{BWsTG6UsCy?!q+pVBjuxp3{^8U& z>LRdyEIgENzlU%8dEIPF!wj%w22)7wud1qoXk5un^ttei!`@9oe$vFIGczrLSC{1C z;u0enRvxGSa;Kqe#Xq9nPRD?z94U#CfD7C7VKhL<82HWSps(Q+iVGu zAX{3^hZgJJ)ZVP-Mdn;Yb;Yx&=9VB$^yi}kq%NXzD-Wz3k#`;Ki3xdnfDEP>{qFE#xP%dEK(6Bi#0aG|VeccorFnK6s;8>?T< z*b!yU4I#H|Preslab=(<|NdxA9XVXY9=NvpaEv5@ddUjM1Z!2f(+tUfvd$LF4>R$V z-oB_d^_0zr)90=IA8Z5ibCT4N8?4Vb-gg$KlFSb5o@goc5X=@|^R*oAlcKxwRI#_W zivP-C&r(U*@pl|i+n{@^;CW{Fez^yTKYMnoy=r}Q`HQ+Kf9DC5T;SRtaM_D#ITd16F||)Qx{mX52xt~V}M1I zm!3-(=2`-DzuVXCP|N0*Yj_(f`e@~grNkx6V}dCOiU${0)nJ~!2C}kfpUC7cO(K;K$&UGka5b6vFF2!Lfk@7S5#qjS5{77ldBan6}9g@ zQsK`GF=K-E!|qoX*PdVDC3=xYS|C?;>xSzv?=Xdg`6I^vz z&wFYr$v+(&RoJR&pQJ1mLvL~sJP~9SV8x>4^?>$N0ZR~=9o_8s2r7QNz73IiYKjfK zTTF}$8D>gIFryY+hTL2pSxn5;zj`|c_A*CBS~bgqUgM`_c+Vw~M^Q{;LvWHeTt7@| z(`;OBAUXH@u!j_X=g$K@JOz-}4!-V=sM}tvb_r53N);$=t{5UL1m>H zEQ}Jb48zM4XEH)OqxGf%=RWm8->0fbEhcbyk@&TKzfbpr^w!h4B5HJMXMrVONA1(B z3<`E8y-U%lV+{;x?>rG;y7i*xlJQZ#)m&riwGDv2;v*ejrE>cg>d8ahishgItV{Ii zS)7wunV+t<2NJPK_^&kUSy8V-b`wX=dpX)<#Ae$%pys1LaOks%XY4n;w078G_wl@^ zw5B&g&^0<_mDvAJ7#N)c>$Av1E>Xq0!}K^m7-hq2H&o0*X?hpLKHi$}!iw zh1(*$^h&)Ui5rc)yVs)U|7o=l)O3jg7*Z;H36?BkAj3pl#JYjR(w7zdiE1E{`oIUj z6n0}wx>vbLH$FufIJLNl-TWkqR}%{On-($JasxRy7&4*-SSvC;`9CsCF&q8_$!f&1 z8u#IVxY{Fn6`~aVbrNuvp-SZz{m#Mki?z)mlhYHzZQAsCO3FmTMrK~Yp? z)`P(>FPbMd>6<1tLmOP8jw|)#!4(6V9e=^!t=dw0SOBU9c6Yk!eXztYB+S%w-7!bPzsWHT418uK6SPjg?RH+ILq z7lU<=u6p44PwVTpXzN}aS9kLb=#u!mzgq@y1Pk%$`+Hl`LU1GA?{-Qc*g#UJDR#K} z6<-2Qcb|1-s@ZmP-?Jl!oE z4Y1Iz)zHSBb^r=~F#gWmyW+?82!H(++nXc{kg%%tn>SrpUJiR}Ti-tX*7mjenT6J$ z0d!BMRnNUw3sdxbo?2fQNw>1FfS#JNf9T~k65;V>-^!?DIePs`xBkJ_@A235_3D@T zcgEgPSVk%BILH01-<&7|gXcb%0Po29_rdv(T#l`zIy@CH)H3Cbk%L(qS;eeku@F{P z)`gw%wKhKdw{OHrIQ4gQs;>)Zu-yE7sFs$Ne+Ifhmg`E7>D8u7IE2s#G-`d&1*XmE`1(Y9>75ZwYmORiXc039`;G=Q#(zgjHW!ittZ7d`*mWbOJ*Y(eVg3~Pa7f{U+5mQA+9w={#* zRi8S{Qc*40N!(bCHcPO)y>F8YOU3q_|GZ`t!Y(Q|qT$K~Qa`x9_3sQJwVQ%9C&Db%|Sxqr9r3;HL6S$@*ka z5vn6DVVpb$4-FWoH~9pF#DCi{OrL4iMShTs?HG)+G}0?ua4h>!m#HCZOdFo^OD}K30G}`{jN+vuM-MwLNJ*ZeEIXQ9*dz z&d;B>C3?k{ojE0RO@Ci=K@Rdcd;iG;{^eZ5S_%##B_M)1e8N4IFU#T~q_y;|7*7O6 z1;0@0?%`qLka#^C0(h)lbI>fH`2D;WQ6nF;vtNOnVyfp-pf>EShR*WclES|?g|yU5 zdD^m~cKclI$Q$Ch$L;qJ$FrN=!{-}2ZV9EELo=deRs>B^k@ z7HQPC{bPKBx`yb)J?Hka6usQh{d$ECkkSnmvKe(6bqZYStSsq&9#lmWqP`A4Db3ryiL7;RZJi&0)$uigwz3=|mG` z#?HyO5FyPfMT?U)z#VVUcp+mK^Ic41=NYby6S(9ma;;Wgb$@HArfr*QC7jb z1jw{w=Pr1nAtNRYB2FL!og`_Ntx?2M6hDhCLV=Eu_J*l|l1fH|%zuaToS_J{^N1=w zjWS@(X0YtfJp-!);WfyA-m|%`H)-WNBPa*#n{}0>3|90nKI}H>0T#x;{P^OgT#o|k-1sa&ZtB?}nq|$}Gv!7qK z9DDAtJglbLB&g;0E!z48=G2s3crDRx4?Z+l8eIKPz*pG0qVv}KO)(FcLc%nws=5f( zGZdlE^_Bw>*CC^^J%AEkyf36$IF_Zm^#WhB`SaBe8}@tq zm1*FJCX(?0X(A2TbTTAY%WvS{{1J3_b5fKb`C2k`kfa{-8&o<^C@lfaV)g?qWHxQe zg65UsT?K3JOg?wUrw4hfqvubF2u3o|;;zmm!b?tI9b5D<3_8j?DloFEDMni!+zOc9 zT^JE!sbPuJ$kOy7n;?NPrc_6@P`#`H(G6jmOS_-p0@!ML`j6XYH$K49&r%A)&vIT8 zvKNPBL8`ocQIH_{kpM4oqcdTNrkleIn1VPh$*0jd zY?s$A7j-Qe%nH*4f>l$LywQ!cQ8J(Z@e+cE7(uoFtVprlx#o9K=$3L#hly<%)^4`u%G>~~f z9OsU-k(84zdG?Q={;x-FYH42IxFLrZAJf0$N|OGV1Wf26b#JcYJ#9p_y|`};P5hyO zvKS=s;BkRRzo4%?cYn8|EM1ActnFk YHYPJaN94s*AmGPP-}Gw5WyjF}2He-pUjP6A delta 8684 zcmbt(2T+sUx^5@}K{_Hx5m1WK5d@JyAgD-3X(}yX!2*I52~s|gDhN?JQUXd5P>M>& z5K7=jRH}lMkWi!vB(y+)NmYELa5uz8NwvNV|f#ptE1}ARd_N%PMD^iN<3Yv9n5tPspDn?O z+aYY<*R(#_XhPZ4Y4+QXD!)ymFHFB^l}A?}5SthLcGhlZ=H}YPC$X+Lv~d8{vxvH5 zix023TL|X!RGtXu+t-i|&-O58qVGLIsEDsvh>+Sygd@Ly|GFa2+_&kf*zAp%yNG%A z3<^q#*6{dVc+1B}?e-vF+h1Z#^`jq-d-3()wIbe<<(SF+Ep%2jnyBq1R~G3DQ`7>& z*=`}+=aw|oNhT3mC6u6T=m!+?3gG_yQR0vmXek#M%}`tW;|HL zfIizz*>+0~w5aOKyj?5im5s>CI+m3qC@6U8ovPcsJ=f-maO<&kldhqd3fs_--_zxM z%@!F>d=Q?e@%IhH-(>F_?egMx<@{YX3QY9Qo#Oyks;R5HSy(!>k)73};vObkd9O^# z6YR`-&ke{!GPKSEJC=8UbO3j#5T8p96C>@0{W1QBs`yab^SP-i=R@Kmj5Z&&0UJCx z<5iiYlZ>-(oh3HM~kjOKv(!cfd#aF;3^kvrVsV&r96g zYX=t{UtJ(yg+C2Utoy@(3{&&hX=lf?z*wy^fDSpBsF}wnTSk0Qp0Z)7zJfe$>d~yx zv!35R6Xw-@Q;qKA&mP1N`26llGpW5C!YK=xk4$Kjk~W(ro3Zs}rNzsW#tcsBR1LUu zL1EliY5MKGTZRx#lE0a~^HUn}QSYtx!Ov+cE|KvN0gMjcb4$rZu8yf-IoOI#zt)jT zzz=25O8oFoCAD3J{W}>nEgnrb_3SCQ2D1SR z@hi?%Lqp?B)M5Nhv7KGx)k3x;p8WljE*~_PF!70Mw)=w*d=LYP!YL6q7e3h4FpSNQ zvJw@fsa&3pT(8Up*;0dc< zg?Wm-U%x`W^SzbfCf_HQX@!(}w4HG2O4X$B1HZo>Q|^{px+!on%-tPP4$mb8tu1YI zNnItan?wFqMZ1beKZAIp^8Cf&s}9OcnNwL?iC#_=O~QQH10TT0nvn8W4#Y>N(s8j| zpq0Jym9$sSae9MdUR~?^s095AS`%{Tn_b#UkUV6vE4fyg4eLp1PiZ}5<;~nkw3~cT z@Gbf-Qi6jt-oe$0uG)O&l#a+ioi9Kl+S1o=nou$i{c#TKAC*tP+crrkV{b+P3 znbzSU#kuRQLq?3Vh`=ASsyOF7UHy%X0SDIOk8+C7`kzyAl4t-&a2^u~KGNaZcuuyO zJcl;iL$SJGw!g*&E-+S>6|V}5>384?X!GRPHLOR1sarzz{*M&WSrltUv>cNpb(3Fl zccCR-RvX;39Brwxy3X@_d4+&wUZSDRc2_5Al-1cbGE6bU^7@fYb(LTm>=2!&EIy@w zaAbP71m|(@0c7HoQ^>8|>ZLQW7&?DPy2&{R zgpP}6R_fytR)gt31NhVR!MmIx+Y6Gn10-o-z-on;RMh1TQQAfu$%W5Rj#R_gw%&@o z@LPb9mClmzGg+L~j*o>pfG_RfDrq0Ym7p|d4nk&PxLX3P0}TS#%zo{rz5%SOL%%KKC`I;kkt;>-mCb3>Ggq*8X0MuTNx4gNDg@>n@ zG$sCwSbB_P|f4 z-*K-FFtFdXN)xyx-HFzrPUPM5V@OvIF>skcPlS*o*F&?1y;rNxo)tU6gw%b=xLR#@ zkRW~XcNtrVwM!DTgeBnV{_2va8H}*r+SKWIhc!IXuzjGzh{SaKX&2KN`L2?s>3J9= zZVO@dG~5%q_y&C#-0`XP<~-g*zQ|X5=O-rBLtPXTe5g|#G1^uy=AWVKH` z=yN$b{XyqpUXf;MVy#l&i+LB5z^kiS=98^w8Y-n-tVX>4b02eN{&=3|6+2dBTR8_r z9%AmaA?qwOQ22WmHmFJ3C!T`oOH{NY@m<889X{$y_9C}#mmmP6FQntbgERsd~|vn>3;-}oe#P*_Kf^^h)IJhIsg#X^GnpOYUtfdjBr6Al`{p&hbF9Qj^ehhCx!vA6YCtIWXC>l>Rq~mQ57q=$ zN^49lv>~Qf(VLcuEoX!V|2P>IGUhYBfXUq5!jJiPr$QcMrHE9xcO)Y$ILNfVHOA$r z>G&!@VAFNA7HchG@HJO{TrWnO1x!+-)exQyeO@sx_BSoCo2^ar$%mP@r#>6j?=M_H z6o+lS>Buhzz_%m66R2#t9JnIJeKHoBD;(-nwp%9qyqQ0|TzRRVt=h>Gx}2cBkgUVB zxAm9h_VUYIsS9gV*Hn8swzG^n0q+x#VY(3o3whvX|T>3fey-0}Hb+neQD<2sj z9C=#(Wr8Z9*z67~Ibp!Gv`=`I`wM2f>HZ;{`Zlm$XZ%ZeihK_iK}jCmXKf`eSpEe4eae}6G1DXrL&%kMk4x( zY?Hxk6$dBB_EyfP*-{lIpU;Xv7^A-}4m5>(_qKv!1-DxK=uscIKmV*PiiPOw$SwEo z>uLu&b;1+pY@FTc`_pzL=V@g@=8@VBzSQ*PomiINxhH0OgxzM7AM4~>@6n94bxFfo z-cJXB4|-L#K`EL^P}L|t@@#?{70?Ae%;MzB%g2JY4#OLdbyB^fyv%q{cfVNr=xd_; ze04IjJNL=3P~@r}ONKJrXe>?EttTirJ$>1Pzi43VXvn=^dBGizmIUkl=&azcIi`2D z5xu+@6bRNO4GnN6(D#bt6WoE{G2yzvoD~kVrYG}SL!rb^c;of3$8&qnf(zG{buzPe zQ~o^gT9+dyV$3-p>`yl5AD;UmdyDuQjQcYrHy#Zd(pE+WrMKm-%M;hBlaPACZTuS> zA1#r|7WI3#();vjQd{7Bc%CH3$>Y@01C=%3vSkP}-5{XFM`=X_*la`nli@b zVM!nOHOYM^E>8-=~K`q6MPwn6aNcOTA z0gXq3{~;JG=QE|8Et^Gir0+X|&z2*T)cQ_iS{N}-gn~%hYd;oaRSsLw2A9KCw%2HD zU;*(FZ;kIwl4q}h3dg&SHJilq63)_{DUN{a6Bl=N`i@?~SB`^yNZ#4?zMDZSyFhL& zzw_67RXy(qo55yomWL`WG~%z# zqk6<#gj&i_-=9P7BFmpnq;jaB?Am_0=wHi-`X;KlGMKS?v)j65=nP>kCNOmNH6Xt2 z>mkNhEqOOfqnR3!qcd3YQl=w)^L|Q+`fws7)A!QF(5eEj`##)~9=9sdzZ-&CWEf97 ztd!kH1G#FB`%Q4*@}2G@^+)=&&SEdoH>+WR41NAfdQ&Bx>dRw+78_{RJ_FR4AN2;` zC7JN5%&p}nd)nNhKa%c^jVAdMfg3q1iwV@TK7@^Gy}-)!gZlTc=>?n$_O(Wn_nEH2 z2=EKVpU9>oG2-tz5&GzS72gTzJ=pHf%}fD=6}!FjSMca+PKa2q;Ei8wXo8lXe17Ad z$Wc>-rnBIP-s?R$$qIwtv@aCSj>02983L{WIWYkz8RP|N_hnyTsr;W z@lz*a7#!TC98;-md{p&mPp;RRKQcoLJ8Y;#O;gSbr6@R`flHunQBIt5^-K%S9Hi3g zbU37mA=N@Wn##;8FV?9%1`ui19FP!>ar!Q(qK_X^JH6#lQvkx1d6qQ54vWvs3#l(v zXf|ukb!^cWW5%`SyEWLT1lATYi&KsmU5qwPuG&O*P8AlmvxJ}P`*h0Cpq6#Bzv~bK zj*^p>R!M39c%Ey(15eydZ3S~K#dU71Cl~M{e+zlNcsac8QL9Z;`4soPtS>0*HeiQ-u#w{a@+3t>lTso?n9GP!&;d-Lja~{!1(Ijmqac@)7EVRkO#Au0T zEWT3mwi>KFwX}Pa5VwO8(vW-}gX{raRDaYH#2@Y0U^mdUXT2%yq4r!@Dwk6&AaWPO zVvzt5OdSdJl^SAo(*$;JGx$|g9(7st-HTL)QbG z!J9&HpFn zx%R_@dYEb6lAUM4PkJg*uD4-xDVJxkvXd)u|7`sJ}YvE84f9f#N@A-EmCfw3{W_<4Vh zOP4NPZA<&JvSL5QBXOQpLPFyIV%nzHyz5(3qxju>q8|=UOuX-SC1)VvauFg;^FTn- zOb^M*ws&D3;zX71@Q ze|RN5K#^^6X({rTSZ^EfC((nH-Lhv*@0e_9q;ugW8E#RP74VccVlVi-m~CdPMU^m& z3mPnWwWvR=x;Qf{85cF;i$aMMmy~=S-F7OetnBS^kVa*zWI3?7WCy_tM1+Kx-uish z&WnDafiB5mg1GGOP8mH_@TO^A)v2mn-lfryDAY)K;%Yzz@C~*y3leB18DF8{A4VO9 zF(w>)&T$?2bQRVvl%WrYJ$WJuI^zcVG&(w(|NgylQ7>r7y%AsJC)rM(x}rrohXABA(@bnMiFONx zy0+l@oY4e0o}2{($ET3SX>MhuOIoFSB?_$m<7Vb5zFLYK8OdBL7UCuI!Q@J~(Ved^ zX^`%%`N8O31F=-ELD%T6G+s9C&wv(i^(pOEz_fgiFVeJ7q2;PBrO;k4XzlOQ=ukl6 zYERnx6FW22*2uSsAlD^(-MoBa(T(5SI&d~Sr@)AH_^M3(F@7jL)b`lLcQSF3zC!QAo;{TfcX*68L!++6H z!q8pm?dUuiMhQBzB**6@`<8=+;)Hs)-3fqoAxm3UM9ZB!cT(9nK)!7+S2d&WF1Yue z(fKQHxIgkB8*7viiT_2pWyrGx$Z#9zJ4zM1Fyb^WgfJG~_Q20x-0jm~-#OfSe8$XO z?6~VlQm0rVpgRgQIHfNifmZ&(V6x&=N7I+4KYo59fX-*EY?)g|ofn#CR~1_f_$qxF_Aox7w$>g7z{wa4~ZxU6l2(9|Ga0 z^X^TKbP8EbCss7Fv9r(W0nffdAsLLuBCG;`2)XRoKXXe`NooSI%`>BF z{lXVQ_M5-<5s=0xo|n;a+OJ^#XQE zGqjblQrRp%M8a9;z8XLbYtQyJO}|6sJT0)Gv)#Jf3Dq@zgZ349@!U&O)!d8N4~;tO0@iDC~jeNgAC%(DA3f9}K!hVv4P zGrn?!D>)aEv+e!Kd#54Z!3$Hi?uUp2@E`b?;bp25M|%-K7atau6qqUK1ty%KCuhn( zV_%QCM~z}APlAkJ@TtF5dek{mmk`_#^v zozxHz{EwlXB2TJz_hq}-404{my|PSBjpyv_7!@ejHuA!x1K1-Ub{`g22=y^n$w+=2O|Buj-wiH^1{eSG)zKd|6;eh-LRn-V;v()R-uHWg!eU0 zLTqOa6fPv`k+Zu~$iu=vTlw=;{IP5CK`s$On65z$?3(K2vog%RjD!HT-c`lwwBDfno#Z{Qc>I zyvtnWjXY2J5U{$3s!~j_iE3k)?5ZL+hEqtGQ z{qlHVQUUo5m3lcePId2*36q=8bl&KVg1owbHn8uInp3h!dxH{syx&6C{qW9@VOuKK zfAWHxB-dueBVd3X3W>b)HZbv}+QHA+n>Nsf2Jqnp^e|8s8jAwQPtxm}p%=3_nd?!f z!{*l-Og1{v#p68XbX??w)TLHZ)%?g%l25<#NYmXWIV+XRu?b9-*P_nl~! z$wnNgka`*|w7UF~zTir?peI`T;Mb!b3g`h-;J^9We&1#f#uO)?{?JEGZIbfZ$PNYJ zvr?LPfg22!94_haiI{_qh{97Lp7beJ;*{%9DJT;Rbs|az(gCk~SjpcD%{STjYkO!R z<(>}NW?7dAilsikjbt7Aun_a`|- zSZ$QI^?I`i$O!gC06m73o9*kq$PCn0Kl{E|{C`nXfDYL@@Nf=+ei;EaL{le)sDCq4 z=oyQD9ayCL!7)kot@rIqSf++PicNsJHQ4X;nH^RwiBi-Vnt0t|2ew0X9pHuHFWxim zQ?P8`v-J~gdBhJ8na08MS8~9=AsGnSnfG?4qlg(we8D6iZ%)7UKW_z@=4q8e1nq+L z*H$OfSa$z=gA?~9IJ751@l9nG6xRn>900JBp`!1_N4nBC?|uZEuVAO+?%&u;AiRVg zpex2#K3wHQaWD(x^tb@PbNKhk<+5A zYCC+9!&;wC3>IIr5PRF~e2jF7(5Vb}aq>fL4_2uVG`}lxXx~{ISAetINuArnJVXF# zSXfFSC8(qyq(`_~djGZ5RC6#}q7l;ntoP7Vy;F~}#0hU_ahf}&+zon^JEHqXCFGfe zj)U!iYVOfo0f>d=^Cr-N>%c@TR`m!c*n+`}x`;iC*)r;GlMOo~9qwLzirtX?@$%@| z`p3(!{>f5XpOWEv-+q#(C&CLg%GML&#cK4Zn0_TN#42`9wgB&bWy<1!87CqNATUZF z$WiMsjgY~jC;o__aHxqxv}P&D7uOcKPUESZ(TFcp6reYRm!)ecvv=wiYa;Ewb~D&r zPvyxSQpu=y2V;`<*AS|iJ1{0ut*_My_=Cw{xycak-7QY)$coYx?=ApaAL`F+DUm%v zSeaT9C|e$RUZb3c-44%(Ul*2_F%@wV&e-nV^GAyFi85!Xz=9BzGOfEvVWp{neH#{= zPGI;Y7lxngeb7;Ped4Il(Ma29@0mfcp>p#CL@ZA}*NkB+pFzJT<^W5q17ji&p#}bC z&F8ch{ZmHVYF*EI#dz3GBL<1tT=ffe+6-*<6|i0)ye(lFn~If>Je)^h^>1A-;qu2= z2{zyO2TuCy;@NzaAb*p&gg}ca>s#-5Pv448EMbwSj@LZbcH#N+v;+aSSzgy++9ra{ yN3c#?LHiO+7w z$&JTW&W2-2%~I4uoibY8iI*~^U`$aJKS+rl8efN9lGRUSpXx$*FEI*u8a^bV%BX;r z25Qt+F}d7-)717Rw;hE@%?=|?x(kKLdenw-$ts6^;JTey&1lx|I+EBsPgXo|*1GCB zljb}7<)9xu3ETmx55{ffsZgy&EzF zOd3l&`!R8-Ggd?HP(t@53swsq?+oJK%!3LCnd*^DC?9&rt+h&{9iwsu6Y4wnh?S3a zx>hB|Jt|fg<4|EvV`Tzr>ck02V%vMms@3yY6D_A_B{)H1a%iwc6Ev&W1 zX-tWH-ltU4-VA7eJrddWGo{PEgW;&x?ASq{336g;eQ}~`1{CGycSWbstFmrD+xqje&KF`DD5nY&ysIbZ4p+~ z((CHy&?F8C2@#k5H1SdNXR?^LP}mcCC6igufo_-fPRS=m)_DyTtKqaGt0r_1@rM?O zO?snn8PcgE`oNeoG4xb+WP*ZZ(TlAa>IrA&stIRH&vaPWX5_W#wOZE0qbkt^Qr3XM zdhOKIJHQRjl5BKs*Sd2=BBYn)Cz0k(+D?U~8A~IO4`X&-5AJ%Wp6zGF9=+&^qpW?_ z_AyLq4OPd={DR{xx^r@kHVVs|m6fnF>=sgBV&J%J=H z#DWv6m)Q<{d$F;8$Cxcuc|W+#2Hg0IB(@VV@;x&k)|)3&JPbNPmAvo24Po8jjc`n3 zG(;^7^LNh62IH!!{r2Um3!IP|#oVl&mnK4L7wzPbqz^0*)VPUtu_lkG&UJF0V*jk) zk!{!CyEJz}AVC^N@rA?~^e*Zsfv;MagQ4a6{Y$C!l4)+(!Oh%mo6cnU{ z^+fO7Qe}?H{|W>Q?N=ZzA?h-4rIkD`Lf!5u69(Z;hk@z;hzeH-ZL6$%vL;28tqpDk zcPDP{DdM>q4ie@N_LOEYH1@h<qe(kzY%%3QwXa=vd^eHJE>ENf$0fag7+?7$bmzeTzPlO1(cz z3NCu;b0Ei$*1bf-26|yz3w{!f;MXNLLuxlT^rZ(5Ov)|t|70AzDOq$nsYgsvm6h-+ zE95N{2qQ|Y#lC|$w`sLGLiTg@JCKH@VcvJbGm;S-m1vKVZp=I8|2c*WCt8;{L|^Ntb0&jP!2zNJk-*xjMb1v zYp=o6@}Ecj&JmdqXTh*{3_(cXJ~3h_lRV^+9p$ zCrQ%RSeu)_n86@Vj0iKT?RQZ$VXk_f8$>v&yOt_!~oekIlUCVG3l`+3EO_D|c4DzCGpz$2(7cP;cyC(@0h73b^u+*Nl>$^V6P zVSLt~{Hf^~Rbr{6#6UU~XF-9W8C7mOHSFeKY(liriK;TBI@6b=(L&Bu zoJ=AK*&)Yb_%XKgoG}hdCM1ZAumA%ZcVc!==VWNv&jKMl1tzIRhISbYM}hVE{u%rG z1z~aG*4!MLmG&4RNes{*Op@JUhdQA%Y#|K=V5+RjN3z$_CUwcaccTpQ;Hk&z%Na+1 zUGrQs2+G7m^F~KLRB7WKSi_W_!ofkz-4Y@qrBT;e(wLT>)?zzMn9(4T`uvFVTx7QV zaCs)PyB0n9)W`P9jq)2I3Z*q~Og{wh6JxmpeDaR$uy~m#$;QdbkDu~Mo^g|8aC|!j zX8gg<$WLXYn1{wBeL{VfKO}T-KYm*9lLJCm#H-=p1>U<^&`*8w63$J&zU+e-*=(pq zU3209jK>hvsm4U9jaPV$Pfa@&1}~Pv5Ljr0BGhlr6VIbx_sX2#cU3 zV*CJ4MX0`Cj6n=~4Jz3E*V)$wkI(7Vp$G=PzrS0*PB?)Q5BOg+-U}T+Qo%z+GD$do zS+!2!jccXVsS}65gOepS$Y}P~fYbe^eal;{!W7WogDhEtme@AT#ZNj?nhhgkp$H+X zrS-lD`;NHE)SrJI%o{=Jy3anqT0hD=dBJ?va!~hpTI9>sp3sM59qgX|dRVfd^#(Ze z!`ITpW+-f?9as^*r{J~$+LfNg^{W4a#Ix`wPJQr_FEM!_R0~03`{LI>ElrCwfA(gd z_1v!f(`8G|dv@*B-{t)&S}(M#iwgEDX8+r8UMBYVul3c6_%J(-iK9+7%}3z4CZ9jt z{(MqB%t^|*H0QUcTdhDiAT->_^jkMb%LD_hFzb~8BgKY4yr~5whT{D}-%V;N6$U|L zdZuy)u}nJ7FJ{t){?v9IPrxXN$ML%q7tP*(fjX{GuJh*j&p3$lZg|@isZr*}dngXH zU2QiL4hFgR6ku&9H@(TYkRJ4#nMdm*wg0YNiB#>X@_*^fXb42fP;`<;6gf+K4D4fG z&B8xJkHKqs8DdT}YnJ-rfmZ@*kBWPtr6E0#&Ei{-zwcnXfw21g@T7k;p};iu>TiqL zAs!C|fs4$`*~C{1H|VNBw9fW&?$zpX%;r~h!_fC|=RV=E&08cR!rh=f|( zDT7;K7sC`K=iqwMQxX?}R{_}Pqvt=OYK2_dpI=y*D6PXP-)ffgHAgpd{*>NjogY?= zm5!+EA&1EC81~&4Xp!}#=)NOl<7q%N&4o^Q4FGy-O{?DtYK2K23N+6CLxQ z=b&Em`&-CC3kBxrF_W9*gqxqo`c>t@zEzuV+z#Kg&kO_h+jma4r>%3CF5F*QMbjh@ zu!M+E2*<;n_zmc-_;_MlEi5Xqh(`?2hPe7AUvk{VIMdEl{Z%KagYv76S?};3_3V#gC#I2*Zbn8yJKcUGvM~ z=T~mm?pw7D1)99Qo{0!>V77^KcmSZ|b07Bw-qZDP6f`;nE+y3^Zcq*GDx4TPI9WCp+q zkCS=uAGN95^QQ~KT7D0}jd?NG1-$^cBTLDN@4KhByuVAAE@(f3owYgZ&Df+MAVe;$A}fvdgfZ>1fqV?|S)2QP&4g-~!zIh&lP(_<#J z@T1)-b3PkfnC60mMO77uWCd`lNEs!qy-;D25E^r}L{91sfy++mUi<$8?0XF4)A)=6q?6_=+0FTTiX5>eh~T*z=(w*ZrRnhXoOm=_dNmYcK#XNI$?9WdmlMyieIMkZZa<5 zWG*Yh4VNKor&hRHBAB$VGY}?EW!0(X?Ef%YsyKoQHNsm>9q=8+P5|+M0?KRSz23eCu16N}M;4DX4>f)8lYx^BQP8LmcO9|($x8>QFHK`+)fB!RB1%yrQzc^m3 zdP2U~S3-iF<1{AyI60olx8~3i(BOj4-)BhzQ;MG)frcsoXGS>Y6kU2$eKb1@%su=W z-Ez<~dyXa|MG=I-9a3T;K}Fq2ryNISE}f#kd8MDUG2fuBzK@|3?+6(~#YwP*bWPVMMu zw}N7X`!PD#&YaIRB2J&o(<&hw$)4Nl9xrI`&az(Fmfy5l1%N6o=X! z>oVK6x{!D5YoMfN#lblQ`}tG|)$y-b8i(()$H@LZ@731KsQ4B0_8PiykEveHovMrm zZV+2OfO$MI;%;rjFY2e)I7|Qp= zZ#UTJU(azo>F|x-&G}S6;*EyTv6-dkxf%r$CPIRkMrUs;kW~{gUbPMzNDo#_If!q8&ngC>oQP#}N+KapCUI=2C&(LC`t}Y|cdnlh6&` za;3k_n>E6Rd0N|$E1u5iUwD2dck&+Y>wMcmWrmX!hJ7X*5LjDeRmT^_DL1 zZoUm)VUTorTzl6cs`1DDc0IWh@Gdb(7r)kX5!>ACqu+tf&JLu*qm+Qmfe5(L$sw!I z+f%^FGs11H8!jqQz1lGKXE|r!WO7f%$-6Z|7sHzkE``6O>1mB8^lHnV8d0MSp>#h+ zg7ScPfjJ7zMRm0|eo5dZT-_fGi1Kv<&qi+sa&7xjfp`I4j%O>;{s!e_Zm{!0o+@ET z6}PR5;PhuHLdKZ7Ki=J7e^+`R+U8158GT;(q|N%e z_>C&Izh3r%;cX*r^Db-p8Z|(UN#{CgD2#N$<5fEa3CSB8@#a+`wPTe!K1mrv04-;I zIA8F6B9A&~L4A)3%-poED9LmR!5)lz zG(-+vQLjXxk+D$Khv~Epj@|j8x!huMA=f6>c0Jqcef%Y>c!A2Yi#o=B`?xDka3b>6 zD%6Pl)SJoj>Y&;zG0s2n&nKV)Ju_fKy3`PiD_&HVx-YM_QP=k82ziB~b;U`8A#DvE z#b(Zw-Sa>>U7%$d*<3WbZ-UNLsV>@=! z{Iuu}uzMvGh7LS)aETg%|%NhH`D_;~fp zO)#z5hHLc(6_IG|u7*f^xMyxEJFFyrt>(^;TZRmTmn~YJA_M>Le z1SwYrL_U4V)e=roZO3CvxmxAg&S1!!uSenz|A?|`xXJ3jiCCG5&(~gm2ec6XHBrpj zn954EuB&G(#Xn6FEF1qNh=(SZx;}x)9JrSY1>qHq9*D!jK~6GvDv@-7|1Pi;$k#04 zDIpdWrIb%^RV$x=?y9KYdELqL^A2Ew6gfP}%!~_QLw2Q4N+f{+04_+GEu{X16W?xD zQK)a-b3yF$JN_A+51P>9A>}Xe6;;#@3tsKla#8^nhLPo3Am0oJO^o{ z#i{)$2%|vH$mhRvoQ$ehRgdJfm5Hu!=4V(l@J}rA`_jF7wlD9^w)N37(JKK*|P& z!dTn+ly_A;3vyJYYT0? zawHCMW@U|+;A3Gr6Az^4V2B&|CWzEt<3jT07PHX$l80Ekbq%=?D`kK?2AKb;s#<%g zwMl{W2C2M=|2^1`Axs&)v}j0K+z5S=aQTiC+K;?R$`ErUhIfAUVvT~<>Q2MM6h zDKY*6Ny{7(CQ&XA6XHz_$5$j)tw8Qe%RzR+*Hj+$#N5A*DZ}kbu!yFVEiL7>&<%M6 z9fHG^_UUL{5S@yoEiE9#pc9ToITy6^v~kh6z*L|MK5Pa^-qb65E@C;&)S57(3*>gF zxLrV^>o(2JK!(bp=w)bU)=hAotU_desvVGtyw&AJrR~@vm8cZFv1&8FYI!}#3X-?! z!3UWt=RIxin)~{E>!;43vn*&yc5&NAtj#(jf5VCgiI4!WIb|yI0z_J0TJA5rl_~u7 zmOfC#$6LehUs1@W|N8PjqVOUcz8eb7_O<`fY+8pLn|Ig-y=VJx>ac)BT@!Ng{^sR} z#+HZw+sm6GJ(|ooQN9N4AaBYaF&bU3vl__*jrRo10Vm39o{{FnnR$*GqKa8dIuU2C>?BvE0i1Zxw4y19y?FaO5`VYNk*uygHOb^5s7$9N*Z; zzvKr9!^pGZL4j^oHhkP^fkNL})d_A;GjWm{- z9n8KRlh&cA8kV_HbFrdxk^LCC+PeL8M0GziPftqm1RX_SU5*P*jSz&dQkE9HC9hNwm zb5#{ELzemRdt9Qfcg=s@SK4$@|I~st*)xhztV2yMUz$HI)msp`C%>mKJMbZ9*9&fO zE!1-b>oqJD-$S)v(XGn}RbtSo$(^TQWRA0atBmfP|8^y`z-8$sN$~K*Z8DNdLK-K> zLD3pp8WK^S9UWtcQ{6r9gxtn-_4^b=Z3t@jAd!DylZ_08+W-WCWSM{ zTK8-4!G!1;NK?Hb15_t&?(TYN?pFBmJI#tU#t#)IFlG2P^+p?qu5zN`pnV>yq=1(+ zI(Hk+wkOeYZyF$2FBV5ivHP%3%CxL?>44Aas(Q8%T2Ju5^@Lqj}3XP-MuduM#k$mJw}?yWU_xwU3G;WaAYq(0f^ z&ECxj`mF=pJ-Lqc0M?MHIOW`S-7uAGl_Zi88wM5rMQj`-7>E2V6X5r#20F(wXeeEK zvugyMQ&RTp%M0HC4iSCg*5yXPwWwSZ%GT%@MrFE>Tg*q#bZ^r)x#As7A3HJ$l!d0yB>O3 zw-Qvo#dzASoBx3yh?GF7o7`YTv|vX|`aln$-GdJ;cr5SetqWBM`I?dzyS5fM%8DJS zOYXfyz&TLGo|c-#jWIwmJatjcpnO-J7jo6^A_y1N!%hfgRRb+H!1|s9`88x^nDu0e zMu`2NSL~uq0()F<(>j6NF(sG zV0GcSvV_(VtELudJAs)Ry2i^Cv+Z&Ik>%P?$Oi1sx2eZvJox>ODH`ljTlW>)~Vz_a=Ym7alyZG8wkIiTJ(tK zW7LK0?R8Z812AEX=hD^+E@@tG%?q;r5!xTPugC>5mVXL&(*+@Z1-L$rc!SSy6DHJ}5EBt}-sigqD6?ZBCkqda zXq+Pp@IDnKBqTJ?pC!b?t`aRK6v5bexU(rPkU=KhcGnIe_eTg}=D$)cxT_fWbRH#8 zG9WH?F4(96nR6!yNUX<4Oeve>$5gfkYH%Q77VtH7vhvA$VG&0Fak%U_S7XGPHtj%4 zEp)y^M&_def&hLBzi8m&GPp@)*Ie_`nU=7|%C|7kT7*&8BS#H=P;YFyYYm-)fE?-H zieISBzA$nyJ#8H#9rF(w3jt#DBEs8AkW?J<@KAL-5B=}+L`ooq-=Wjf3!WUe4#pCg89`NB2iSEq+{GWFaoV<%i&2ePWFM9cJKf+b~Q|ghB3gcfL`(0lZhE00F|MP89Kr|DdIZ1MAegJs4<1M1 zrWh8Knfb$HiG8%9IgK+6_4X(68Zk5bx2=AfD6CYX$7d@rCTZDzcZ_Q0Lx#Z_h=RqN z*YSN+OE>`E^Foeklj*Zm+@&#Sf}60Q>N8jGEpQ>rTXWD?#4z-d>9zV0KIIw5pWKrDOV;MB;le z{VG}-j6^W_{;+8O5PZpo1FN5lya|>+;3XE4DdVv~evwH<|J(h4yG?j}20&(>9v}mw S&Y~dTpN5)_YMF{<@c#gUmq&X5 delta 8834 zcmZvB2|SeD+y7WHlr3BKv5qYvl4Teq`N%kyZtl7pAp2rBu zmSvDF%*ejJx1Q(szW?|Cd3`=J_c-U=*SW6iT<1F9>w8k|Vr?s0&I1B$;xn?$H;Gy4$K> z_)AMH>bbpixcm<60@aoVMo)lTm$pAJNY_XpAx9JLF?h=}zIpHq>jHy$<}Oq*YdbU80Ef&R|=8e8cS6k%WEo zV5ez!DlmtMzvKIrz4kqyya^Yb+RL&LZLN)&GCS@!=aRFBy~!M`+z02!%)6qZhijbQ2cc)@?3Tk z_Kxa?(QqrMXAix<$o*T=!(@M7Ti_K*T{4Dx5oYYL&<{mLJ+cWf1lpv3iJME4of}r| zWHKhpW0?x{PNWY|B*!rE z@4wy&4NOc(B*>;295|t9Zqzz`VIvFQe)c%GtBx*v)U(Urnq@IY1sOD|s%-@M;_@Sk zGp#|l^$~%nEx)!co$rNFET`-DhA#Jqvr*|1p95bc`~xCGUNEJcDO)wT*e_F>R+s-wnxDStF8*}$q_(_ScltSdKCJPfgSO=&0b zGCKR1fV@hs2A%n<754e_=icxO(cSW!`|%@*ujU{o$1hSY|Gi~KBS4!J{FK2+r{Tou zs`uqP*y5ej7oche!hfZy53ph23BZ-$H$8c7`!P)6-B9d%lGfa-741(Z!Zk)n)jAdN zPdSv#ET^VHUV;n03sX~fTRF&M^T@L3?|zGr+CHjy@m)sPFsS1!;PkJ4IY{kzVGK{W zeYi}EPq24GQpKOo?xSS<`4^viv^uPKk0cnvhcH%p1>?1nB-`th{T7Qd07!CEOT{Hc zMY>tKnnsYijPH`$7EulutG{2X_wfe*V8Kt!ShjcYnjIQe9C=%~29`00taZOpx1|lD z>|`*eVn(P?%C-GA=2#lce5g3s`FnI$f<73{F~+8r;$7TY)0qx`WL-)prup3B4wodQ z!|zI$*D;z+U+3T1(jgJ2FIbFHa{Q1mDr3CN5~lf*A{m&2Iuc|=xf2W|1QMi0F90p7 z3#~jTN$-Y5X*(Xy@RA#t3YjP5n*Nu9!2Qa&>ls?(Uz4SBo?yJooou~?JWt4y1P8QV z^2$B!Rm-jxriOL3Ij()3y?L3QCD1j8!DyE|V4?M;q}FRGmG9J0A-e0EN5af%0(U)}&BXd`h4v5l(_Tk(MkWkH2kDn*KPK z+i)S^@%n46=7WAHUvcBix5uhPq44v@l~$2d-}VBr?91A2j|!HF5WbO-Z+bt9A*3oO zg+yUXqw-^SQr%{KNwA2gLDuWgVlHCkZTgs#i{I{K(L{E~6?3P)fq1QtvM^ycL& z%Ib6-ttvl!M`dx#L^+}uFHb$TY$Soj9BEhwx((EK{;wWVhJ!noUD&>GwW!Byg<`Jl zjrB?XwG?$}0|D;S8Nj!^eZ8MYO!!@H9{-1yVlr6CLaP89G%H6g*nFWiC`oTl+k!sk zK&Dyq@|EsrCP=25yM}&dWt~BAQ0d2#Bqg)1<_3L&$Ju@n=?yIkwKHG%oYrp7v82CT z2Tn+He=veUi_vigGUu>2W{e4e@=+zM1fI%4#B>9yYjl7xj=qJ~2K18q15-~+Rlcao8>eqC`%NcC%2d5XkYl5SRnxgBdv^kG=WUi0LVDuPzy4m#SUAkeUDfesBu(8RDQDSO+Gj; zDnVLbz1Z@hS>PO3`1P;T-iwz#^chuSFt~B&Ft0jaHn~Z~3*dWoJ`SC1n8P=RvZ^A< zSGl?tJA^D*eMyQku8PuFoQ(QuN)pS{gOIsSl=?B<nG&p;V42xCB(KEO-#bZN1emElNf}rwES6JxqW}NSK zDP|pHGC>TD45rHH`ds~Cub$cH@>BEQa-!Ra)x>NF#*cLv3sEv=Gbd!`@L-sQAtHJ% ziymR)GhgFfg`e|kuM%J2fHY>Paby9?n}$tO`o)D$P*nG>ANnp6C-@fnpLxNtAvC?m zy37_gA;DnYouLegigwnudM;P=1hnvj{aoj6uikmHF5ZpqzEDGg$lz_roz`5;{^Kef zp_0zk?xA&%kpWyZ+tdQJ=irC3Ue{+=Xq^lm#<$#f1so`5t>#k{U9c94th`HK8V$4S z|1JE8G0SSk6cNi)oXsXmVke+aW+b3`?8QDaIeT$U-0aHXuUbD`FwUw#TX6YR{0XMv zwnUP@5YCM<=wnr+m$7+AZoAX#Vxn_Bw>2v=_)j3Y8eUAJsz>()v_Lxtt~`h=#nX|4FC*3$0TskKuE%DHQ25MFS6tpQ(yKxSGI_BXsDlCsPb9B>x+J z3U7U8zVrhSViy>SNfeDfGfTapf+7$r`d?>J>g~7Cs(2IfpT1wo6xw?K{hxbZsG#tF zkE{kqs{c=4Z|Hj!iamFl*5~%PfdSJHhDF?zF!{*jBqfQ1p{;)LJVZ5PV;@dIm~Af? z1_J*6+t7QxK1{8t=;YnI_gy>G{2en=BCRLM*|@XMtoFu^PH&2|1{m}$5kF|Wm;DuL z9>`{l*KqVBPII(1sbJ#mMBIuct$5RPTIhK$KhdI1VY{by4tzG4$cSIxupD1FFYXA= z0!g_W>5FGY9|5GblqA&B=lcb!bbxoM;X!uX#=w9P$EjS_?v;zUjSYhfXZwRuZEd)K zUv=(XIh6z2Briw-_At`~uFS&LQi!g<7_6=?+~J0x1ciU_JtAsQlfn8U-?fyH)e%<{ zA+t31AH>lFo05E%-0jZSm}OhO;jdjBp>ZAfS||5j)8PhtQ0HqSjX4}JZ^CqZqq}pi z&k^WyLnLY>>P;a9EAo9ym3?(Ot_*I5``m6r3fT)AyxLW3nS(~vo6;}NHPzwQXQ z%;bXKh&E2P>92Kw+_{qW$8uMmpUEl+KvC_v>+5!nVT z&3jyFLx%;c|f5rJ(u)5NTG7ITaGzz$h9A5uH6KtrN_lr}=wH z7raueV}M{d3kO-olM{6?Hmd@P%JnF@n(jx~)e{4z(_UA3F!GlF9^+z|^+Q=+Y2sNL z!Qq2D1ji_OmfiuzGjZKoou%1EXOLM-Y08JL{H47G0<=S}!lG?Gg&K~wXg{aoSplcv zx@H+O82NVr?Q)Dhd`|K^F+c80UuZc!U6`JEEULnBBD_8_cK)r3v+k#h$a?vE^=wG7 zuH%KtMm-MsVfK>MCd2fK-3tB+yHDL4jR*GK^RVSTpc3Wl?@sikTleKW^qBd$h8HI@ z!B8QeNG&L?CDPweO7xNCI(8(=Qzl>78BL}DGO2MRDPv&4X4;hf(6*^RIpfsdVZ12E z$03R0pAti-Y>auUJ`hgrT%AbaCJ^j7Q3$^pWSlY}kKSE9JNN!1o3Dqftw*OT05pl> z_w>1nuU^r${@!I{7{YFSqom{f%1izjDLf1bIX#%Kv*1cUq)gg9SjKjyk7rwuLm(uN zjr4)Te%K5QIN@6uSSg1!&)JO7w(NXCo*a>FHUEb0Rqqw(np<=S#GV=JiWx~{wSUU1wF26F+ZaB35D4WhZMZ*(Z+*OFzZ3L7b z>j)x`cMwZy2&gLfjKi6uU!I|$uIZ{y9i&pUvSB0?Qi(0IT(La&B3p&sTK)LPkNO+Y zr$dKcZHGF`p~!y^im#BMo;%t zC!}^3ZNzC62~eqL|){0{-f2EkOItk2l;lzGZUkrv^G1v@;C( z`IIdK8O(PMPZNRN2SpoPMrlO9p^AFnU<#aqD0VQIgAymyPI@*i{`^O#vWtUmknRmV zz=DF8l`OTC-4jo1fMp*^ru-Sy>0uROLf>)Z!Vy{T7h$hU&a9 z?auRx*1b4!HiVYIKLD2sgmOIGQxR8^%nz@>yxH_nP1KQ(*Ge=)S{ky~)sc;Uw$5`D-j6R3p8W8qtKnuAHq2H4-=(CLI!2)aG>j!_AfrscugkQQhPPah%ryBYrtEE{7=ICUOuvJUywc|kX>g6Tu=Dtl zw9p=~oNci`Dtsepi#9Sz8!)ya%O_=QOG2i#i>59_1B+`0_teTHsLLC8U6^Zd9l>0s zW%&2;5Kq-)x%l{3wRX4?g6t(iTha%mM^{Gxo>V>0UY`N#ZjZ{~>vG>fm4Vr zjx8Vv&=pf+V*eN(UnZrUOV`rnbi2g%xz$BA_QNVYNCMn4PsnGw@zRI*>-f?H>yBCf z@ibj#iNs7AP|nmyTm3y_UjjQQhUV@;`4r0&2iL2@ML0&SvKJqvs=jJni!XATrYsi- zk=}93gmf(!haVl$yw(xQsc;ZyVKaEHDL@9ym8Z|kcpv#E+>+kkXLhhV(X=O*KC>%* zpx)(7xPUo$-=h8ow9Fkv#F7%Ok*h`Y;_Sxe-xyEY0f=fF9>RJKQ<2ps|+!9yuq62zm% zD#6rQPmdUf%b#=#7SlhX#cm5i&Wd{&f29_ zcFgd60w;aHZ+b68dz^J6>}p}_C8Iy1fx3q+@h292O2Yk=uz819bRa%F>FEaO+lpN? z&tC4@$rBWBH=)Nau;IYe=@(6!caC(hUG*?-I$rzDH3JGIdjANndrXS%C26!cE3cf^ z*Opq1hp$;mu7-=i4)1fD&y`dyj=4Q``1Z+25Ha3Of|J-d$Q;~w%O<22b`Mn}`Y@eW z>x(dAXBrY0_Hz?m0E^j;lF@s4u*}ZPe4I0v5UgWJeX9z(Mh~8;yjH60lR9h-Ik!O{ zv-NvL&Ch7pIO&MILt)wF_C2oJ?K^SW@m@|Yf0UFbNVX0zBeomGr`$i;?-Ry3)WIO^ zOT9Um%6nK8v;k^0|5=KG4fi?PK5=7C#ee{t6Ja8+13+^=F%RqLollfOk(P7}2KkOA zZAWl8|HFm9IKsQt+uE!ZT7-oQ&3B|SrkUIs#)IuUYF0MxCVb9*TJn=IiDP=yaI*Y~!XI_ipOSqmeCpZ4cNd5-*#hgRlvEL=h`U+?;2J@D>cZ^j7M1>WW985%od_N`=;kncrX?s1246R zlJ=B*$WyHv$iS$hk}Wu79QzKBsgOrEPqvghrH{ZL#uXjItpPo~xFbTy zV8BUir5($Uv`|=Na&u>TX2 zbI~m>!BhkUr(IO{iUC=96pK6rVqHV?N$mTto}}#c-fu2n0{(hFENPCUV}l2O(u1f| z6<548a=9EDMAiR2zvAFMR%8jJLpHsRKcpWyevunO4SxNb1gCUR`l_V`QKB&PPOf@4 zNQOn0r9BMOLdC7cJ&WLvF_k`ikl>g%5hF(yb6^jJ^DrFwI{-!Apn>tTM7<4l)PH-*^{~a|>i0&Nh4;N8!G{zLBf`n?r$N*zo$`;{<>LAb!yqaSPXGSMcLZ@vUzfzU(+NVyd^PE;tzk_f$)W^oti2tU;mzX!y-_* z@J;qg{={Tiu7LZOJ_`PD@EcQ>o14hWQ;SqIxN1paJ_mqxaU=7!ioNR}O}qVZ6IV;N=g`oBjRfy+SI) z3K&Bql`e+exTsSx-tt|xOMy%+#h-cBkK-B=_ulpGgIanH*_o|pGDeWLlz0xo+ap$S zU`jv`VxY9*aAmU2U~a$rvI0aYXmhxT<=8xoT2KcmB4l>BtTw*qR(hl)y&Kni9n?GnS+z)%eJ9S8^v{-r+g{ILC}-sXiyK7H|4)XG``=WU8JBG6Vr2ySKxu(^b%HWS zpZCt2ae}|@nuz=;9}oPg)<2o4^`~-3I8n*SbTD zG87)Q&>OVW_J_|^Teon%U15l>O|q+UyPQN3Nm|gU?Rouhp;(0LA3W)P@xqh;A5M1N zQuJlFVtH)AK6N}FQr@1yv60y9^M#{3Mjn6}qY_Q*+!qK+SMX*!{ zintXFJbvlani{$kk6v#BB>O^(n8SKQha~?7893)gZiScfh<6_TB{XCvM}^{0dCAN? z;rRbl(SQA+<*?r#s4ujp6_5Cy@yh7ZM2ba9ve9JsmEKTU3!~LDI*({A27Q$Xf#b_4 z6UP(WX1e@Q-oIRECV{##x`z`D3}8pNquu!vuwB~2MsTYM;F`qxXLksWXaUxU<14j2 zr*iDNfubWjz~va1N5-k;J1b1LBey4<3XiG|(69`OkaXUO^C}|xGx^#Hp5GJn4w#A5+Hs48bd{scujq?NJ_rZ3 z!X&`(+eaTLbJ}62OM#mkd9Ja%|fIe!tWsV@`qp zwj%wuxaEA6;KMuNgE-FPIyq_}2Ibr>0}hqkF7zy_7eP{j?TPn=gNA-2G~|{DrSwjk^}M(RP|mwz7yW zj3UvT8XVYuDJV zl*G&(TrAh;H5lOfUehCAr(qgz0IKvPICKweXp`RG8%M6cx-VQ=SaD_psQgo+!p!MZ z&Gp3#p`IttQ>Wj#`1`~$YJ6#SCU+#v?#zJk$*A#S1(@e`ZC@ttwFZbIm}m(DaDGj` ztXi2)v#|Q+;)`YF_s^WnzKdbq^q*g7owGuSGef7})ATa8vl%BmoaFhY=7!3A#PZ&LzqR3xc@Z#pFdrO`%W1k=VoFqV&1*V{Rjd7bZ;7ImT5SI{TD0% B{_+3- diff --git a/assets/statue.png b/assets/statue.png index c276a19503cc89f0e7a97ef5528eee9325f418b9..337904327e93365151c37344328673a1eccc4ffb 100644 GIT binary patch literal 4563 zcmXX|2{aU5)PFN%-?C)QGAM;Yw8*{=DYA}a&k`fDkL900>0|Y;-h~^I)t% zk0R*3;FdlBFmn92As{Q82LOh#_4ERda8%{8V7pE8gU049o|>tVAjWP1bbpR=*6bwzzmU9E=mu^XM=L2#2_+iB zJ9?YLp;gI_Rq z93v#j81!5*?coGHJfO;?<`Dx(1ptW()_{RBX0W-Zr*Z~Nm8Q&bgQ-G+QabPo0x~6Z z#h_|mft^`|u@toJJIKeV!LCrZRYJlo>*REy;mv1&|7%1NtC}4M&(x6W2f{a@KvR%o zfJ)eaDqm)_^;fB_S9Aj$0@|=?0~vQluW>e{4f6%;5PmI*EPY3Q(y-^g#O6%D0?W=o zi*mqmR0e}g0Pr1*d^^3VnuJ?hSzL3*A@O^ig{STWPne3x_QGk?ODHv9yElZNv0YuA zpz`X5RQa{Kms)`tbKtsgV0~?tKK}v3aL_>l>gKVUU~Yj?kJ5Po21dp$afgCtndJnP zf7cd0e6d(r$$-s8UJgYDAf@#nQB4v81~Q750ciTo^YB9|w?P*j09yGGm#frinZ9vi z+E}u`oo{O6hT79;sWFMQDY0qLtb_|N6!4_0^P09PPEmiZqTE;qq_7i-p(YIPb$cd%TOG zr5bL@)^O1sX>ZP3uO6x$Ce8K;%f%nZH|ffzMpWOY`T_M*`|?4EFTN|^XT(>Y)jB-A z(0zojR!}*-uCQd}&Tl_o5EB2|F?>Xp#rfs5{lk~B+IBAxd>6XUIj$lU%o7zH&m(U5 zbMd$3+T-cOpb6m|n{+nM*}fwqlah211_;d$;+vwi?2U95^ij`czh8uINRXD zMv_PG{0d!lI7T=lxjux>MHfSJUNZb{IdH4 zrMW-o%HkCB9_V@G`x{*~i7n-j_sbF=K%djZ7E2e64`)4gc}#Y_y6)RZ|1(NZJ7YLw z)crT@I&M8`FMx?ThB>Mm?jXVI&ijnFgr}bOYNo;aGh-QLa?{&;-jFwC3f1E2HFFkMewe))B zpmBh4qS4TO+oBfRlgL9y=IWSeo%|Shk*Q;S7w;>Pb6s*y+X#&bZ*!^*DfhQ`9jvMk zHVypG9P#^KeP&>y=~L#6aZYy5S$jGFVd?txi*Rc?TYpewka_T#G?lcf^rs283g?Q@ ziW@UQGc7X?Ti#pewl-$)eqK3hIZ`=9MGr-?AARHX#`}%YjkA73e^kaCH&E;J#6BX+ z`p*$vqQ_nlk^2vR0zV>jLq?wNdJ->E_NF7DKgsd8``gD2BZTLRAI@T38o4H}P;o zYQtl~0%^o=fo4K0qOo-!D$o@j{%DT{&Lz&oOQV;FCQoK$H;*?NHnTQqwr-K^N#Z0A z($M*S0rv9~w|#F1d;9wJ`y;)YHi{SJ+eIX^!BFsG)MF5~9ween+ct=GB?6 zG*_8axHOpPnJtC9Q#{+aclZw+ug$qgWsPw4(dBSG;6IesOS3w zgZ2J8y0~Au$hZcf$Gn-`2O*r7F3Xi&`E$S4#P_K$S!x2aVtM4!{CYdF^yQb^vu<_X z{w^3dq%qQQ6WtKrP}UF;7`v~%ox$$QAx6LTVx?oML;1zB4-|*Yx|Y3?Wt#5mSh+e^ z_=S6IeGr=)pk%3FnG}38`Yn4#wd!h=u!hl99>dj=CwI?t>^w(D8)~-{zAC)`slGv9 z>CIY>c^c{F&)XrIhpsV(I(}W(=nah}QOUe-zKHJLHP@P$#|%wBotD0pnw^?mWX$|H zy;gEkre31n&{7N5p#>jKQ%}G^84OKN$4S|;1zhJG}U(bmqm~aPNk+n8%d=&VYFdBk& z#a5@E7%d@;&34>Sb33n%qekDo)0B*~kWVX3?ZrN++@s(n zEyfG;p>n@Ur(tc$;-2kzFcIZ3Gc&JW-?y~^-zeUAf+1VBe$;PvQy(9WAuw0)Z@*gQ zxAoAU_bmu=BfcJ}9q1dNQm|Lpvg)tH%9b^@g?qDh2=U42-^ibdd=C7Lt!tq_8*~En2jC7GlzH&h`{`bqGobxv4bzAEHh2mwG9sRl$5-oD`b0n0v4^|>mmP;O$ zw+avg~utT@Dai7Wk$t%`*sAhcECV%~t3qJ)K#2bnG z{-iDL0EWK?bJjtLfgg`sW={Ul9%JWsNIqk&q5!Ydz$)hEOv2J zw_kT$R7dnxVvdjyKQmwR&ZEJU#ggh0j-kF#^M9xfpK{#7$B5(et%psI2(d*z&9>*Hw$G-9IKrg?T#Eec9#qrl2vfQr^i>x z&v%c+NAs>xrcGf-xba;8g2Vv`kD|<=|0r@D06!T3{@4Ma_!a$K>sCat3*X!mFZ!l^BLqRby(Xw5-JOhV(cOUg6U5K5jwE5kwavj_`=$YlJQC0KaJjp z-cX{i`%=*m$~zPWW1Bq3h{LTBPGpp~)Rk0XqoU3W2y6-q=C$wDcGs!^C+Dt21XA$m z2w&CukLA;plC$%%h6*PGjL*7le*W3!R#Eg zP;cdH%bv^1f~Lxt22$-zNwpD4|*JT@T49R&;{fx!f``+nqv%mGkyOVc=BJ9)1&62^hmbx zf0j)cwIh3_oZNS5Z=a=UGO3Nl!!KkMJk}2K_zWE;%8jlo{0_>rv8n*RA>3acvNX0N zz*l&^zhn;s#clsT0dgRe%L~UOoJ^-a#?a7s7*}4NI9v-2Zs}%IFlpU}MUZv_701`m zbq@ye$KBwoJ@c_VYDy}!cO{pOk2!I;lHuCIcaRQ;T?*D8BFB%7i^Ig~cMz>2#$lrM z4>#Qp-k-0eFE+jtBi){(NCg+usJ+$GGVZ22ZTSBMxa~5RmqAR+c}oSR zkE&e2_P&4u@Md%MqhU)JFrgBrjWBlsBfp_;pG7HQ_Jj!*yGX)uj%;{Afe59;W|`+b z|BK|Ll;ei308czy3m*(j4JJ1yj;%i*Th~%jahU~O-Q8ys24=5=#O^3p-w1|U^V`*& zd-xUF|2lQtt;_eLKA)BuRSfO0^bjs?-@JUp+^Pdhx2N0f80-0&&-F9kZ+SsE(!I~+ z<1dH7zEZh>N+Mz0ji!t*A8QTzNTkck$L`k?*B6CkA!aAGY9JL!5?4MJr41WcJEIT* z7o%RDe0qmM2@@@fa@ovSUy4l%oIaF0ZsSucAD59b9C$u(Bk+dOG*!UTi<{c8RTPLX zqhZ2s-h(=IJ37l(H@)Y|FN0KdjrZCiZ1!&HQ3#9rz@`0|qb9S;lEd!6yj(rnFp@{D z28Eo$?=C>)(cLsuH*Y_4pTbXWT%_UnPn8MRUrkd-Y}Nyb&Yge2G`@dsVQ|2N4Q0B>L0<@dT7v*^VniVjh?MT=v1oNpCFwyK_UkGn9( z5FSN4ILob&wK`TlyDDwIJwCl;;wbC*LSi706#K6!hx#XDE|;}1fjav8g@={*8y*%R zYz>DekMn**jhtQb3QcDsXO$uK&!FYyPY-8avc^VzFpVb!HB*);(&l5v&Sp*Z{}DC= z`uS2l{A<%nR4L9RrU25%bjjU4!v?N`~`naca};O*T7P$Gt0Z z6wE#jO*-n_T6$N1(k05H((scb^>%(3QIUpm{$!}=$lPvT4NzV9BN}0r7q$f!bn_`)s rV@>f={Xcb~jD(A)9eE8_+jtOIloio6m-UkJZvs8-ds>wmc9H)Bx%bPH delta 1323 zcmV+`1=RY}BeM#S8Gi!+007PnQF{OY02y>eSaefwW^{L9a%BKPWN%_+AW3auXJt}l zVPtu6$z?nM008+=OjJbx004l1fdBvhDk>^0EGsZDFElhXH#asqIygW;Kte)6MMXnR zO-)WtPEb%rP*6}*R7q7;O;}h@TU%6JT~=RTTw!5cXJ=<g|adBUEc6E4oZGL`mfPi#@f`NsFag2;}jEs4VjDC%cjgOCpl9Gs%lZ=*@ zj+mH!n3$59nv|TJnVp@Bot>GUo`|EPmZPJYq@8{N9|H>KFh300VSVPE!B?0Qz>s-T(jt!AV3xR9M61mU~;;Fcij$7BWT6{V}ISNQ%PX6NM621kX}KX)FV`a375F@Nt%5+sabEG`nNf-El5D2)09 zn=wbvL^&y0T8ir{D>1LHn{$51?B9cc0c@>yeO+54B9|-&jrs&L2J2??_E1%p3!RqW z8aAp|SJe$EW2xxmX@^TA#^#|y`xF|@qgb0>M%0ziV5Xff?2*(i00LfBN5}TrD z_C(W5&C`?2N$?6G4cPLZpYNZg0foWY!`Xu{V71VYOf|nd1L+NLcU*Tz8Q{LT?wb-J z>wmK;bY_p9QfZ!^WKMeZUazipK)>1VH`NX}Z-1TdwWI->qq;T#x4@?isJUV2uE{mc z!&2y+J-Upm^+rZwj$}@%y&&i*11f#r?<)h!=Yzp{VLHbSG{kX8e+SgUu%;G151T?~ z_UJOMkb6dAj=&vI4T7q^11i2>(RV<3&?px^VhH3<7_d-_7d{W0LTC5rve*G*uVxq! zkAGw`)!2aLN^HPtxjYys(K9)f0n8JpH4Hg>&tb%)aa1>izVC^6G}1kc>ar&dz)U5W zjYE$U!cK$Nr`OjY*aZ>CKHPxMzW)WdF@Rg|0roolt(a*dr!imzJ5|WWg-@^>u@_3E z$c(#TsD(n$*ytDR@(~V8Gl1or8II0pls;P~UWz!Mm7569mJ2kyau zGmr(}0uN_kfWb6@Nh$+CT*+}>UP@A^!Q9czL)RNBh9u;XF;R~fx|%sm!=-GOW6Kch z4k)F>j+p|NAOKH;(|Wu8_*e%6j{W0ir}O(~6AWk!8m(^e*Von_e$Wxq1WsoFh8o+GFvW^@}575iBgR{aesv9fM^H(B@0ck@!m^dwpq^-vf1855!=liA={m8W)17fC$oXP;HN2)V9Ry>J@3m>ES1v}jWq4=PQ%(B@m6A$2AF2}?JI3%CXGx4Cz hV4BG3j=+B%e*h4dIy{aNBPsv@002ovPDHLkV1gIVa=8Ei diff --git a/assets/warrior.png b/assets/warrior.png index 37ca03640f264d499fada67d4cac1604919d149f..075f0cef4d8636b41e8639e30dec10f944725f05 100644 GIT binary patch delta 8839 zcmcI}cQ{;M+wNc(BYKHm5)2_q5G}fd=+Py5k3t4^Z_FDIIuWI|0dljuzz-4uvo9brB z9~-tlo@Nutt-16$6cX3Ed@B4+vFk%oa*370 zYb4j@q8}W&-YWV<4=(?5$QAQ`h3>0~(h>FHxZH2-Q6dr>`A$Y{IOX=PNv!Ux!7zMQ zf6(&J{n_RxO4~fUp(8AvU$=m)Cx052kN;%L_3%T~An29N&13`0OImVbq@Gh_PV^cF zlHe^z{-yd)1ksC7Am*|6wZLt$->DaO#Kk(6Dy&p;m%(kH~ zTf-KS^*(Qo!so`MP8AH&)zt+p`k~4RPb0RlNwJM`aTeU5G7{3{1diggAhtB`B|n8o zzi6J>koK+$;Rg#>>n5& zzq96_QWj?2R2-QExY0qLg@=>W2k(kxDTjQY2o4TbOFk}$dKKli*00g$kTpUusi}Yq zP#al>7wq*^k+Kc`iJ9LBqt`&%@#@MMgvdNuIxX*t`3QNpGri!&By(l&4(Yiy%1cV+ z=5Q}vHl4fI(uh@TQal|hsk_$=Nk1c7NF^&Dr$qtU_nGB_P@moa{lTRx7lbb$8W0p|4XczVL1aqOhf~$=OD_g1jicHL#-bF-%1`eXv}|l{ zvPjmm;OHdo_e0R%LWM1^SAKIDWaV|!^MtBJ2L83N;Q8Gf`XK@$?*^6!PfNn(zWF?_ zgO}t3Q<^#sD3lFixvfo2`1>2l2n%ZLWeDe7r?em>(z?d=KtxTupfr~`y80-$G}p{& zC8R_pZ6VK72TFn)N#63f?~aE=$%^pGt|$_>+cOaXCL6grKSxK&z>lP)Bz=0;=P1X| zP8A;N)-O<@cWql~T1e4rM6Y{NS&#si&j5#RvOLOu9A=7oBSuiB;F_V5{C2^&nKx`F zZm!MQXd{An-Fm)KD6l$#w(7ryBjAAn=Q|I#ZbJLP-|L$3-hRBEAP?H;2Oq1QoNbUhp-m@DBayj&?;xe283 zNOH%@j6cuYcfP8*$AzEfwg9;;Z%(sT-WrxhyXz_$S};&AT;A-Rdbvdo%wMaZw+A0w=%i2* zCmjaoDu#W<^V47uB%CjybAG{f6-}GG8K<2LZeJ4jG;_6i4R8BZ>0%~&vx(4Wz^&x9BR#H?&4h+y zFwVnqEvz?4>irxnX*c@9Z51j+VS!6+Wn7cVWR3r>bhlN&C;KF~r(Q^DAIF;G$6G(( zKeb-9p#>N7dPLt%aD6_l@@=5=2Od9SK{YtA+Z(eXpGy3eNLs{BgZ&>a^e}Jz8)of?H(UexBw8;&|8JatvjRRhfa!(X$iMO9rmSdR z01@6YN#K~C%9F7TR208f6iyzo*B}4f!v^1PNY0zFipqu4v8|+fU$TqfC`A~+%G0HL0g8C4{exFxY z3pn^&+JCkM!L2nDHgzDz<`ZtQ8 z@Ar_m5&5l-2lE@J9_co|&gjwzmQ7>emDRP32iQbQjZ7}x-^YuYN><0XgKYthGu*yz zI-in}{!XLFtWqz=+H2U0vkz~TwC^T0fMv}ZBk?< zdvcZoy@kS7{k?sh8<2FYL=6c46yVr{GJn`{n=&e zPlL(Hjdu(f)ZA%wAcnqNV%wnZ`LR;hKHANVlA9!hEcAz8z%R9tBYlHd zh9@3DwJ&AHOI#3>uJt8u_hS78|NJiaapz~jfuyw)Ac)RA+{XEJiX15ICicjC(hasQ zR)A1&?T2Cdn-M|yptVc&GZj?PzeCMTpX6jk|F$>;9texaNV?-DgdhqNwTgz zkd%{VKSv;OXs|nt^CA<_*?aM1r+uu;9dEopVVOSsgZyA?DcW4p#&o$ob4?CAO>gyjqdm}V)E|?6ocAZY z^Lz+kEao;G{!IlLAziz*+z{1G+1J+^06J_5Le}v6AuiH0_Jp23a?cI1XkAr8iFWpO zlj@tA(`vmkizs^SMkh$3|GhYN$e}4ug888?8$vW%qntD#6z~Y8Dy!R+e0{BXX!tk? z|A=^ZsO5BfO!K_tsy~hE^wgmyvGKMNG}^8#PTAp#tTKk?oX;^24IwNKkTK>is|;J@ z4wan!1_O(%pXJ5`sYh8N4Mu-Dr4j!IPt&63PN`_0(fp8-z4r0>LzMmdX=adFHbH&E zxZAq+aeFnF(9+lOjt%J3hRtEQLh@7M+XjgHgC_32dB=qi#%a|$?(?cwNZXUTa+=j? zGQQKTxt905W+{93f%&2G$mt1MQX2(F=3lh~QIh%=)CKMoKdh;L>(%>d5dU`ik@$wa z9ZDf{BHJ1Ag4O$xo*Uyin_Ii_;Z5#-@H%FhBQ4x*WcsKfRz4+lgUxU4`-2`4dh4d=W<+}vr$@yf;6{jMSIN~si&BhAlf4zA zAofU$kEJRAdjlTnhGy^VSC1%BV22(H2b<+Mi#f;oPb%c8-wSa<8V3tBUY|oZ8QYSX ze47C;*v#4u>N+B==2jMhooUl4xQS409U4=(6}kkSX$jO>Q{fw z`duPposL=RaLy7t9U;Dfw_nAWIkFbAe z4`S(aku!y}U|+Bp8CvcybgphxXXlRDM}Y$*-SuZz zVKa_mc%RK=l6DeMv8tv;?m5!>(cRyTz6P6fst)+g;lB1-C!QJLh4X-pQm5P6s%!77 zM1C3*c-Ps{^b4joRLzfvwySmrJO~nXVtAVZ+p+WL4F1&#FSHI1yrvx2&u$kERDUA% z-sRr&*&Ht zri(+57|}W5@yR+R`yDD5I{jZ5V&A}Jbz@#)G@Q49?+=vCHI_@OhY2Y%O@CO1vdQhI z=)bJ&NTWUmOX$n;o+u(0?F$Xkl&jZL!^Kc{h1s7g*lgLqeZChaSFcWl8-(7y&;ES*Y?cU^N`&7#_c zY9&EPV4i)-42f5*aAMg}Zek$v%*wx=G56^|GgXf*4(2o|HPrhW&Qglnc#t;-_2J~x zsdAS+QLHH5iWAiAq3L;Ubfd~?+4$IOuE_b(|3%J$A5hTRkJ+9poX%lq@7bIE%_=H zPRVqdmXMOnbZ|plW-`;M=-DZ3)Q9uyh*Fr^V>~5d+HF}X%1aEbyLVJV=>VUoq=AHk z?lqTf{yu^fHgm6G1&Tj$9ryd5u`#>iAwqh`5%g=@eyX|X4d?UyZw;3}fe_$V2hECdCYI_W0u-gYdb@uN0p<7wbrtKe{DoXAT z0WBqpOOx+Ziviy(eLPa)MIjg-$@22mxf!#(W4W zH9xL10>MVtssEIq$NoB_E06ANa-4%4jz2r^4>UngqL{HX7rGIyHG;#2zw3=g8bY|^ zQi%9~vx_CFa!7e!WP)&ru!rQG#tzEgJD3OZQ+DDyh})_^PC;8b%p%7i(5cfSRo=u% zu3K!67}RW9Y4uN-ekUFBTmovv+Q6XqhJ7&{n~H1{Q5w9}!)HArxI5d&A#v)X!Pjty zy@dDCSi5{)$p)N*KEQ?95yYAZrT;P43V&49%ymAcI7=sjB6^)w+nxA$tSWT}17o*qRqyq`^sx5<|DnI8EU12?(=oPio6ed8Q-xzl_FkaCTrYe2oUg0UVQ4p zX2`DJJ3;s-{gzJ*hN$&x*$N2KNeAiA+)b6j3SR4osUn<|q50J;kY}J(jKeZ*9#S9j zoQ@yT1Oo!?V5N~gLk;?A2F$!qm-e4^yvwfl*{XH>Yi05zF88mF)$zu(I_ z6Ap@aA%mR`2u5(_JDXNkJb6fxuaFoEWqtfK4cuP8&Op6aD0z zcFYy|wzuG-W@2@~4oD(lH+1&CM*BHf&#`J!IA=I_258T(y4(lpC}qyMq6KP;m8qGb z-3Ea^QDEWytEsVtJ2S(7{!s|w_iRsUk)|-A0nC&Mt>=2b#+M>WwWseZhkE1yssyNm zGf;UZT(t5)_^mA7<{~aB4kMeP6GG_#%8ibQAy>zZB{%TLT?IYMR)U=1B_g95v4=KB@cw0mU^(`9|I-ddx)3hykY6Kjo;Ek+&9HGJN9d42JV3 zr8E1^7j9~HI>+pOBETU;Vyk3Nk~V4I)C!-R7XAMh5j!xA{+`T^zNoS1>aIqYGKwXx z%{u%ls-=do{fu!kXW}&YjUqVKc4!)qNyOs z>5MWp$V1gdqn#Mg@mqB7Gr^&MPnj=;aHoTk?YT?}-ePmNiir--6RHFmplChImcrb( z?PT;nicpg|>nlSrpNwIUjw7xEe|S>#|5GT8bvFc4?-XjGe_0cxowM9+XXbU)^K^&g z0bo*I{=E7-nBTf*KSPR3n(=WV*T#azj`3A1=E zt-hsh7n!8!Z~8y#$Rl6nZ zUj|?Vc(-b&P8q{>H;rlDT?vzK1nx!CTaKY&Z^@WHua=!NE09>p97Zxys`3uxD;qhQ z8DZpkk_?{~h84CHK8o&*E2ZIBM&9XhHu%x!BJj$itMx^;JS7^zwUs6k?nwZrf$r5F ze%k#$W26Yb>L_0tU&x9B-^IBLV7?BpglZDh$#_^vR{kMz|8Tf88TCcI9%?3zQ1&QG z2FOX)OIB6M{K^-L+MEDYH)jINr(1HT&is%7$RPDG2QRNBB1??N_1F5Vyq1@XkUJ;O zQm+o|j9$FOCUUaFla&}j?B{Lx7EVp&+qAFmMM5?HFO^ItJz~KfaBxsNH0TvpvJ=)` zjPK?iPjJcAUE@1JJ_<2&QHLW$PMuE>d@7bayu7fiOT%9(RM{LOEPL_q?bt37)b(|k zc+c~78Uc2fP<^Ma81u$&>?&&s9`8=rZi=8l;p_KTz6WvY66VKI=klWvch7S7^+ZU= zLi(B(yRA~Z9PoKCFLGmEA(q@|9>fN|4$k2f2b1p?}Fd|P*4Ba5ss}t z+19Cv+%rDFVUb1+9tjxfkT$+&%mNcf4DJi z541IS8niSDKh-zSn97it5y}r4-2Wdx0245u69$o&rHFuJ9=> z_?EwjWQ{76vbxHAOY&J<70jz=KLXz*@CkHKR}9U8rx?upgB>(2XC_<5*c?h94ZfO& zkhFUFlz>LHq>NOuysM#9(OcIoB>u)L&nBdjt#=uHsDY@H#L@nq8>q$RQM-bbFDcnGYR?Ce^I%6O zbBP||j0u-sF0eTY{>c@!lXQB7H;A zC{k~LM-}`o&#OQn#hFsZW_WCm9#>>R&HgQ!&G+U+7RI1K{p(HmpKXtb<+$a_PD`%X zA_{6xzQnjVgG$T#(GY8C)hO6INs7M zs9a3t+fv)um-MSJ3!0{vKp1C}7h0f~2elFS`zyQs`ky}-hK}2e@U(-LJ5nVCD$%VP ztkAjH`-uK4yd#-oDY6{3N#_-@v*XQDFWkeycPf6Feu3jfdcd zrb)_9=?e%%ZYbe>Ap+OHCAqU%m*{8o> z%OV|b(Sa@JM|o3`$H1aSt4Z|i`f8OWWcEa&9+l56&g-!szcn^CHkc&`=EJufzGtqJ?rm&xf9yyoNNK6yM?GlJM> z$AE3;yPt;DKg#6=YE!n}T&oOL=l2wwyQ13oC>O{uYf+&yH3eRO&d~eOCKKj#39_-W z#J}nLpfNE#ZgVVf9&TZMOc=b#Yw=VS1SluI(|NST1wGi_yRAe^HAvBO!@9}P4esSc z=QIZ_^P%>qFEb|`jd8LP&tv+3pAG`oinh!vJ5PFL;CAnoil&Pwik3&I9RU!g5-yJ<$<= z;RLg(N$-fuX*wHJZ)oZyF>y36<^6n>x;on%77-y)oC;2@-iw+nsuCYo;QI2`VCXYF z5y+nh6Ij*Vm3y%O_Mk^Pb`p*Q-$LZs+sJUeQ1i=aICJS=rU_*dm5|o6 z!FIJwOmKjh68Kn-b%Nv(LxKxa^m~adms!N+xMPhZyM&zloUpD#~RqA6-c zCOa9`Vdc8@Mg7pyq>4w*Sli%qm6T81sp&7khL6jwbk8m)J}hgHZOrhGcvz-D>N{|K zf{Ud7cgDk)5F7u2>)MdAhTj?dkO}Y$0~&0(XEbpNK%za>*82+9TOr^_=a%8kG7X1_ F{{_}fG@$?h delta 9513 zcmb_>2T)U8*X{{m0!T-CRS=L~lqL|GA{_*zN)Zr{j`VgSMWm~Mh;)^%AR;|L=pqWC zNrwO;T@s~4>OH*Q_xRq@a*+fxx{BKbrStRM2?3z;O_vw=@MqXQ6}zB_P#RG8eJCs=02^!X|4Ns`nN=~UpG5G5S+!G zOvws5h9_2*IAXL&K2#&C$arJutjo`9Q7L7?h&$*vyTv9nB&+%*HZR-L*dWtfX9g8? z&7tXxwj0-g2tYF^NY17?klG+ee&K^JI&0B^9bB zhZ>f!oB@yMkt|Q%7$5X}MmZP3buZ(%jbXctKHQ(-j9z z=WhG;{_xN8ey4iO_X7_RrN6zdU zF;d{>c%j8u*Uhw$Pr*oQbv}UoQ?#JWZ%M;nj!a}2Dd^sB&zu?^A8CTtH@fkSTZiQM z7(A9%Xl`zfs4k9KsJ-`@1vWv9G%sfk9l7Gk)=G(eHhKFld5O$46r{o~?4W6cWH(}x zfr126Br-pO9l*iJJx%Alu>m`&aPL=GVg+MIX&D{nNK#kQ8i%&?>}P3xvLJlioeB3>fNCdpz!?IP5!&+f$ZD30n?N(SZnWK z8ouR^j>FjoYTk;=Q&H`c%B=)imwkDfT{M1JC2Bmm9#76Y&DLbPoVy6~itYs?Zqsq+ zE-zorJlTv)6|aeANS}Jcu4!_#_O*_lP2EO~^j84Q(~aWhdy>jB*vWg?ANxAIN3C+X zelxMgvmuMYdWuYW2e}7%J!}FJm9nlmOKM!H*W5(Xo@o}-pGrq|@B*)V(2nI~AG^18 z#)PXmQ{`tw5DR5VM+VXM=*>bf`jN%aSK8D=(;e#WFzR3nvVxj_4`np(I2@cT!6l>T zx>Lkrdjr@BQ?xz8JnfNA;qg2YXZ2RPgJqs2(k25~n7j<$90c2>7d!|;eDnFUOY8D9 zz*uT<->@FiQ!S=&*s!XdqOYRu=miJYttz0`J#~zk*ZkYhuOP2$qFP#?NMuuUbB3V~ ze1Q<_cXiHn#`yRabNSo7;ZzB))C5tXcCv1;)R1H`V)^7G62nH4ywgJ#Ibkvgl{u&CK^X^KRI6n?7u9y+#j7vclSFmw>Z^e#VBcq5D`=EpdjE@L<)zVF>?15HQ@e7^@RP=!MfIm5R3EN9~! zPlpczp#0gzp5g}O#Cx8!9*0$qw`m!&436TgXhah@oCHfBu{K1o49MS?mr$Y(Ptek8 zg>dj)DUE#PBk|r20gW~z@=!^TRXDm^J(5C*7D9%7l^8y-U$D#EuRT6hQKTgD(-?%NL=&$>IV~n{{I+k4#oW0;qS; zP4LKF)At^^-;lAdx~}%B&=a8B0EcM2;(?r4nCcWmOug@i_sWVy{eEuL*)i}lzh@Z( zCWyiJFYmi(m{p6gJq3(X4%-ULEi7r0{Nx2JXl&A6{#+$ZVW~g2>ut4%S~40WtK#r3 zqz3}wT)K?39JD?hN`dm^sRN5|f5ajHW2ifCK>^vdYAr{ktRWN0z3jFe@o=QpC7JkqBk}?WNnlhU zmH1^q{Ib)EThuGu(6ejtZZuk93-obe&YVgTN*V3a^Sn`NHcypZuSfojUAbHcd4*wH z4!2ax*&rZAEveRsbbDP+j-jo(1mpmczP_SsfsX{PNg!@ohO$s0!3u4?hsnyeshOl3 zU52H#fGsSM=I7x3=|$tm(&BROAP53N`Nn3_;gX@Ycb9Zo!LQ!R*&fkzz)RQeA|jZgZM+NoXIb5qLrsBm>F09_g~= zDb)pMP$^m<5`#gBVL*{4ia7|FReK*_1p9XXY7Zz=$+9R z9YAr+{lbPh&E~S`-DBC{?DmxB%If4p^YgS2`_&EQu={BxP>MD$n!do(=Vvc!!?xiE z+E0ZrLVZWtQ(h^*JhI)NZMlW>;-`Z8s^7e3tG3)yN4%9uYQoq1k<;QDw3t2dbufm@ zVfeaf!cyDceQN$euJ@d9JbFyl0?$KTb z#v+2u)Uz3Gn%<$RYyDc3q^*E=#e>g85j`<9<+cwu-L8Fkq~P#!RjzxQ&LVxY-Q3;1 z!chPjdDO6y&$872H+&xirHKYRS4IL6`Qz0bSCs^j~2#ddw1gVLTQtp$7l(=)xM zA?h#KA7<914|!2D3P|y?`6+B?Cbp&kcaA1k)jD;>7gKOCg}L6YudDlV_)D#?OqaD- z1fHGwi@9?&(>zcPW)s1(PRU;D>~YVEX`I-oQ-4L}^9w9FaMDDHo2qgMCMscib#b|7 zBzgI>aB61>jEnaLAROH_1YYdwthLkK{8KZHtC6E5Av7Jt#SOYo^Tp6{XusqP;HfdYgHnyF)J?hu<(bJDq(Lh z3#S|_G(yg+wcnXqNbtXG8$LEuK(6yk-p1ptrBB?H+G=#1kRa%88ax|(J{CCZ1_7I4 zLv0p(-Xk!)L>Ao){LI|;+9{d2wX%So{fjNCDeC4LClXDk4o$|M2<9Ui_T0@;c(QA? zS_r5kwSVnsXVYu*bf?c-S;!)IlhwM0LfQCTsh4?ds~%EVq`wVk>(_&t!p(CKnm%9Z zqHR(T4-J|`*E<%p(9=kY9lK2nMF;%|OjgLXXL?rkLmPcj+GTfp^D=O9LOjm~FG_uhc;0{I>5aC6<3 z^A#OI5WwVz2;6af5Xn)1880^iJm(T!`69F=%~CykB6?zfevSfpT8-~sQrU&@7@1>* z2$7`R%&^sedA*KxbiaIJ;p7K}XF{B}fttqT`QL|71cF^MeCU9l!9(wDfBvgqAV)L{ zaPs?1xxSm|vUVjyX~${D=soEvB>h|X)nZ|sspa*|pMcuYuyt?+%4|{Oe7BH-{K&&K z`w>+t%863sdzXLF)e|+)Zyxux&(8KluKi6CWmUpOuH(|oFXjFlU0`V(s^Nl_`A&id zu6&!Kh&eJ>)z2)mgXuM zw0{`Ur+Ws2MXkd0diZj--(|hb2LmxV`q6lza(>G^7*U^Hmlx`B5&J$a|M-d4 zM?&ZAe9TzTc7i4Nss3_6J!@kMSYNteMyN#{pP8B`7HrdSEs5};+glMFv zWyTQYQN+p^p1!2TKBZF6j>Ua*X8O?hjs*YkfSY=&RHx(TN6Lb2xlA(cLR+2f#$Xhv!cm?QGyYHwO>%$uySg2lEiQv`9+mP<%eKj95M`E9gq+ ziGge})I{tlu{2MCt8(qr@LTDdY=&(#9_xqUeOTYl>czAyvALcT^r@Ns)k^oidvxlz zI`PVaK+2lcM~mmE^?L#b`UF`TC}l4#k3aGZH;gC~aSY9cCYk3LJ3T#ghCl>nB$y8s z3pxW*F$+yvIRE?EB4rSwl@2V^KNdXkZz#$^p$Sr;6?`1_DTcm?DY{I8RxU$z@bT>l zE88+L$mBpAPb_4ip=aG^mhTHex;uMMVVex!pGBeIPFTOj1S^%y?ia>o$}oNzcnMWp zvK8h3x0GuJ6*3@$@*l6jtoudIQe@K~hkZNm-&SL<7WKhHPGJ~+{aQwiDeGORhJmy~ zyQyonbH5rr8uU4&el70svXa%~)jx?Adb}{gtCk<&VjI~YE}-iGf#4C9l?*^O(@a%& z=$J1qbn^Rc|F$KWxsZfeD_aWaf#uUi((v8EDcU~ELoVX@ip1~wxCMPKbS--LR$IJs z6*y=|Rs|h@*?ky0B%!|;C{=kusY<}H8CouZUoCO*`_qA!d_BafVl)Q7q0SDjhs+H< z;}UxzM{O$Lv!v-C?~W@ienvbcZ1XX)!_ZJ0T6qk@fi5x3orbQCK$(f#;u|z&RYm^C z78-76|7glBw|r}{-F_92xD(Wya}Eo2s~NOB;<3Kpxlqi2Yic2{3W#9j^b&>VEyF=u;wJHUqY%@WS(&J<^_EDGKLtyMGf^E2QnX3Nt{u&S zND$yyRDfMI6bW2dJNae~2I75icy_ftqv3+Uzw}?9=~Kwhm|oKE(M3+RIu4L%Ul2Zm zFi)NwB6*%hb850W(4z(t+IPOHx+JO{FRi5A;=Txe5<6Q}eUYCHMkkdybhrj?^zvE{ zU*3iGq2LLRI&Y&9TRD&KXuJHI@=XFeoxc;E!;Xhg1{rR89whf|C?kVnjM@0Zq7c>R zfNa0V>y@u;IN(2%2QB&A0_FP~o&!`-P;y4vwx*}S{-la=`>qBl*d{!Ln^6%a3dz8l z#&;bVUE<-gCtQEK>i~!Ds0}GIn{uP#2l>|2eZQl>^jfvxZCNx0-{>9AJeW`k%e#&2 zg)jW|(9N_G&K9yQX$vOC%Rc43Agpw+=75vfygYPwM20j??6KQX(&b3e#mNh)^JPwu zgAH*9`V-o~9; zwIL^pc-&4rYHM*+TL;@+mWEo?ThIHa6!zcfA#SA!;x!;d4@2QTzU%y$w|O$o3^O*0 z2ruzm(uc)K;RDs2(YXs291shfYKY#3hXJbLV-Ym1>naG^0b#^}N)qm~a}B|{(plVq z>u;pbfo6Pjqkl@3mkBywtdIdS)R%_S*;OK5`uns~-h7CMX}-pCn>hxLSxNbMgCvO0VS*^lA{`(0%a^#eIQopZ+#vCs zHpGCuDVXE%Pb-PMqQZ2cKl@J=Be>6=5N7g?+U2VAbDcF>F`(+kfRVcVfk8IQJ9@{IiP zI%fJzF`+7<+NEdI&2DZT0K(sSpDtzJ zE+GHmn%w22(s!&L5m~xyudojj5^(nwsUbiwO-#w4Z#Fexlh_Vl9q7@mAI3i26peRoH0qi7E0`H#QY*Z)wN35=Ta>LXTeMxl}U*>K8qW4 z_vK|>`{5)58%e`$Wy8Fmjwb&HTFhg2APPBK9egOrX?O5$d(J3RQqP=9RzE1wVZFbw zXAA&YQrZKnHLZIDip_kJ^DF+v+A{$IF%nkdxtZ3;3%KBO;TD&0m@a|U93xurbW#(w z^lnBvG47Gwt<6XA`uP2PeX6dF^|pxP(pF_)@$_U#>p;!f4XVwKUTTPl5X6jW+*I?L z)+6t9>b4KPU(nKR-x^a9_f`TaN)Lb~%#HbIM%^>}sERn;HZpq^fBJrariiNLduv!8 zDeqU9b*0Ymx)zmD4KBtN#$oRi54kBfI;@lM02A{KoN-5IM%@GOlYqS?Z8#7@LGe zB&K2Ohj}8HiDKEfwHA zprO|MrFC5y!{`o|d+rn8)3pZAl+3MfqPFhEcWJp{^zTp=yTBE#sn)~HHhsX~F|ysA zV;We6LfgnwhjF8QD5Bv3biieGRnE@zhE0Rr&#(6j znqB6aq`Vsc%+h86PkEFbTjWzw(^(yXhe~AW5^}Qr%Um>1DJ!gwvCf70$NtxGOyS0! z&?K9zsj7$ylGWN-K5yE+S#+Ib+BbUIXts`_#p;Hf+g?xK9+s4tA+%u|9 z*C9oUwzOE!`l|k9P#(-aSXkQ+-#hVhtSQm=W`5BDjjmeHZ5yLWxFu_Av0h@G%LTBc z%re!SxO(fZdr0|lK}mjOf{?gk1aiHE%ia+vQ~7f^KszX<$Ydfg!ONu>>X+PNU9oFQ zp=_1gm;&)=zT*uHz&kZP?aZkDWUgoguoh6@ilGzN6HoxTgi;(iLFF4JknTh@f53Nt zu;C!q{=D5!T{v<@zN(dMp^Vx%iO1YUvh44CbqQDJj}_KU=s_-YPSKlrxcBu5bsEH1GXNI%bRX${sn>Y}%32!uD&(b#7@8*Jp zwK`K4MKJ2le-tkl^qCcjhZo;m0+?R(sPN45DlwpvkN>uw=dC;`C2xHt%~+`~5m$BU zS@-7Hb6xZ^e@SP6F~4-*8os`)#^$B_NdH2`6`6(g)C63Ukl$UX#y~wMtE#s-)SfC} z-`oEWhtHHQCmLTv`VF;DPv!43fta)Gkz;haC^YHJ;&$~fTX-*9BMSDL;j^@dV;)e=rG?IeD7`!@Wh4WxSV)j-i0n7G0dUF$OY^yaW0>r- zvIv>k=w=~5=9H?Q=X<&&`VQ6KO900_r0b}AD;9}$y4Z4MiH*hjDArIzKG&f-)*C~Z zgg+H~#)|@>_AkoRTU6XA?9Jt4_}%|j)cAw!+{)Bzig9SV_rcB9I%(+Oqg*ZtaYt#V z*u+XY2k>`-tO@%P8_Q{niM-b8*GVBc(;n{xKR^;?F#D$@#1lLG@fJuD9?IR?c5K+F zwL+v7zl-Ke>xM4`>~u~l1NmTH(1b?SLWet5;8W$+gPJ|pg~4Ai`DVnF@cB<$XYW3o zKl-bxj#71z463IHkUO43UE2Pj)+?SD%sL)B#BH!$s?|fVl=HlWDWtL(YLlQMbc5`IkoQ zkpF0GSsp%)sER12E#qesw8!I+Qc&3!-A$W{v(CTwV$yBWdsNtwzry1!PnL}{M#aPOC`X73N=KYR{Q;6K2XHti6_ zt@)O>scLjwntGUf&1(}xb1g}3+}OXeq!zmpKbSV@PSS1`l^{ts$dSr4awfuk(D=6q zHw>!_PJgyN_{(>eq#agpKwo8b4lg^y*%js zm;P4Y7(n17bhFjtzHvSab|Hv0}cz6hNA-_88{TPzOoJ@7)B%s>=^SDY9 zI&iUzA}-DBU8;6ca2rqCTN(8Hao__a{268bU|LZ2eZNe#6{F{^peaFv@zr)bR2@)P zNEuA2&_LGqN#vDzr4MzF1iz`MtgDj^5ujIu;UXfc{#8@RasGSA`;H>7ALl8@73RM+ z-VPNHN>(!Jv~mGGZ(aCoH^$uPsPs;ZTJXV93ytlr&3Tol(XuJ$@_K0&*G`9i8Px-} z6f3oFrP?I;ATBHvH*y0!)tB2II3nw+yAUkp&2e9Yr02zw?ft=1S|iq zx?6Y#=@O%RxnK@{5^UUYp|!*v-wD6){Q7@s`YuWtXJv#;Y1R_OvzC5ir4 zs*QrAGUoFQg%4lan}Vmwk`t7niZAHqQR&PXqo0TG?9oHqqta{>`)Cj2hYLrR zIv%)Id8uc6NHs{b!F`B~p?4adUo@`0eQ&&#_-gu8S;WS0l;Yx#S``vhDgcDuN%~ZB zJ}2fGmjtUKZ-8zXdSC-Wvy$?gG1Q>re9wQOky-OvEkccTQh78W~+YI;)$Kf*k=r&{=<{$8A?_C7p8c`^*_icA|J{Z1DMW_Cx zZ+`$)eoo|N0~Yv>HkDo@-;-tvazlk=Yh-OuEXUW|J9>jy<$ht$F8JpaapwZO$|W$y^`p?H-9 z0lgz=Oh6B`;nZ!qTc9o07x(m>0J0Td12y|Vx`$yUaCI?%U+&Zz<)LK;tFU26C28C1 z9_RlB`AO#ERmaDd%kO+4E7COSjQu`H|xHEq~0gw8q^Y)Cge~DO@3NW8zj<$;B z8C=Gc6ALNcDvDOF3R8cq<$x!=NR?;)#5YNsLk=q=hlb)P7R9PWOVfn-C_bL=;S2@>k@;yQ1C)0 jYdruu%|!Zaogx6f)J`t$u#md|^wGXypjoMIAN9WgNs)qK diff --git a/java/com/hmdzl/spspd/Assets.java b/java/com/hmdzl/spspd/Assets.java index b3fe49a2..def92d75 100644 --- a/java/com/hmdzl/spspd/Assets.java +++ b/java/com/hmdzl/spspd/Assets.java @@ -340,8 +340,15 @@ public class Assets { public static final String ICE13 = "ice13.png"; public static final String FIRERABBIT = "firerabbit.png"; + public static final String ICERABBIT = "icerabbit.png"; public static final String MANY_SKELETON = "manyskeleton.png"; public static final String BEAST_YEAR = "beastyear.png"; + public static final String CATSHEEP = "catsheep.png"; + public static final String BLACKMEOW = "blackmeow.png"; + public static final String MOB_BAMBOO = "bamboo.png"; + + + public static final String GREATMOSS = "greatmoss.png"; } diff --git a/java/com/hmdzl/spspd/Dungeon.java b/java/com/hmdzl/spspd/Dungeon.java index 2d1317bd..85c0787f 100644 --- a/java/com/hmdzl/spspd/Dungeon.java +++ b/java/com/hmdzl/spspd/Dungeon.java @@ -25,6 +25,7 @@ import java.util.Calendar; import java.util.HashSet; +import com.hmdzl.spspd.actors.buffs.actbuff.NmImbue; import com.hmdzl.spspd.items.artifacts.DriedRose; import com.hmdzl.spspd.levels.ChaosLevel; import com.hmdzl.spspd.levels.PotLevel; @@ -108,7 +109,7 @@ public class Dungeon { // nicer for bundling/initializing. public static enum limitedDrops { // limited world drops - strengthPotions, upgradeScrolls, + strengthPotions, //Norn Stones nornstones, @@ -903,6 +904,12 @@ public static Level newLevel() { Buff.prolong(Dungeon.hero, Dewcharge.class, Dewcharge.DURATION+(Math.max(Statistics.prevfloormoves,1))); //GLog.p("You feel the dungeon charge with dew!"); } + NmImbue nm = Dungeon.hero.buff(NmImbue.class); + if (Dungeon.hero.heroClass == HeroClass.SOLDIER && Dungeon.skins == 4 && nm == null ){ + + Buff.affect(Dungeon.hero,NmImbue.class); + } + /*if(Dungeon.hero.heroClass == HeroClass.PERFORMER){ //Buff.prolong(Dungeon.hero,Rhythm.class,50); Buff.affect(Dungeon.hero,GlassShield.class).turns(3); @@ -1026,15 +1033,10 @@ public static void dropToChasm(Item item) { } public static boolean posNeeded() { - int[] quota = { 4, 2, 9, 4, 14, 6, 19, 8, 24, 10 }; + int[] quota = { 2,1, 4,2, 7,3, 9,4, 12,5, 14,6, 17,7, 19,8, 22,9, 24,10 }; return chance(quota, limitedDrops.strengthPotions.count); } - public static boolean souNeeded() { - int[] quota = { 5, 4, 10, 8, 15, 12, 20, 16, 25, 20 }; - return chance(quota, limitedDrops.upgradeScrolls.count); - } - private static boolean chance(int[] quota, int number) { for (int i = 0; i < quota.length; i += 2) { diff --git a/java/com/hmdzl/spspd/Rankings.java b/java/com/hmdzl/spspd/Rankings.java index dffe00d1..c6e82ae3 100644 --- a/java/com/hmdzl/spspd/Rankings.java +++ b/java/com/hmdzl/spspd/Rankings.java @@ -54,7 +54,7 @@ public void submit(boolean win) { rec.info = Dungeon.resultDescription; rec.win = win; rec.heroClass = Dungeon.hero.heroClass; - rec.skin = 7-Dungeon.skins; + rec.skin = Dungeon.skins; rec.herolevel = Dungeon.hero.lvl; rec.depth = Dungeon.depth; rec.score = score(win); diff --git a/java/com/hmdzl/spspd/Skins.java b/java/com/hmdzl/spspd/Skins.java index 2e8fa409..2de5daff 100644 --- a/java/com/hmdzl/spspd/Skins.java +++ b/java/com/hmdzl/spspd/Skins.java @@ -23,15 +23,19 @@ public class Skins { public static final int FIRST = 1; public static final int SECOND = 2; public static final int THIRD = 3; + public static final int FOURTH = 4; + public static final int FIFTH = 5; public static final String[] NAME_IDS = { "normal", "first", "second", "third", + "fourth", + "fifth" }; public static final int[] MASKS = { - NORMAL, FIRST,SECOND,THIRD}; + NORMAL, FIRST,SECOND,THIRD,FOURTH,FIFTH }; } \ No newline at end of file diff --git a/java/com/hmdzl/spspd/actors/Char.java b/java/com/hmdzl/spspd/actors/Char.java index 22616d20..8bbd836d 100644 --- a/java/com/hmdzl/spspd/actors/Char.java +++ b/java/com/hmdzl/spspd/actors/Char.java @@ -51,6 +51,7 @@ import com.hmdzl.spspd.actors.buffs.HighVoice; import com.hmdzl.spspd.actors.buffs.Hot; import com.hmdzl.spspd.actors.buffs.Hunger; +import com.hmdzl.spspd.actors.buffs.MagicWeak; import com.hmdzl.spspd.actors.buffs.MechArmor; import com.hmdzl.spspd.actors.buffs.Needling; import com.hmdzl.spspd.actors.buffs.ParyAttack; @@ -58,6 +59,7 @@ import com.hmdzl.spspd.actors.buffs.Rhythm2; import com.hmdzl.spspd.actors.buffs.ShieldArmor; import com.hmdzl.spspd.actors.buffs.Shocked; +import com.hmdzl.spspd.actors.buffs.SoulMark; import com.hmdzl.spspd.actors.buffs.StoneIce; import com.hmdzl.spspd.actors.buffs.Tar; import com.hmdzl.spspd.actors.buffs.MagicalSleep; @@ -65,14 +67,18 @@ import com.hmdzl.spspd.actors.buffs.Poison; import com.hmdzl.spspd.actors.buffs.Slow; import com.hmdzl.spspd.actors.buffs.Speed; +import com.hmdzl.spspd.actors.buffs.Terror; import com.hmdzl.spspd.actors.buffs.Vertigo; import com.hmdzl.spspd.actors.buffs.BloodImbue; import com.hmdzl.spspd.actors.buffs.Wet; +import com.hmdzl.spspd.actors.buffs.mindbuff.AmokMind; +import com.hmdzl.spspd.actors.buffs.mindbuff.TerrorMind; import com.hmdzl.spspd.actors.hero.Hero; import com.hmdzl.spspd.actors.hero.HeroClass; import com.hmdzl.spspd.actors.hero.HeroSubClass; import com.hmdzl.spspd.actors.mobs.Bestiary; import com.hmdzl.spspd.effects.Lightning; +import com.hmdzl.spspd.items.wands.Wand; import com.hmdzl.spspd.items.wands.WandOfFirebolt; import com.hmdzl.spspd.items.weapon.enchantments.EnchantmentFire; import com.hmdzl.spspd.items.weapon.enchantments.EnchantmentFire2; @@ -278,6 +284,8 @@ public static boolean hit(Char attacker, Char defender, boolean magic) { if (defender.buff(Bless.class) != null) defRoll *= 1.20f; if (attacker.buff(Wet.class) != null) acuRoll *= 0.90f; if (defender.buff(Wet.class) != null) defRoll *= 0.90f; + if (attacker.buff(AmokMind.class) != null) acuRoll *= 0.70f; + if (defender.buff(TerrorMind.class) != null) defRoll *= 0.70f; if (attacker.buff(Rhythm.class) != null) acuRoll *= 3.00f; if (defender.buff(Rhythm.class) != null) defRoll *= 1.50f; if (defender.buff(HighAttack.class) != null) defRoll *= 1.20f; @@ -367,6 +375,10 @@ public void damage(int dmg, Object src) { dmg = (int) Math.ceil(dmg * 1.2); } + if (src instanceof Wand && Dungeon.hero.heroClass == HeroClass.MAGE && Dungeon.skins == 4) { + dmg = (int) Math.ceil(dmg * 1.5); + } + DefenceUp drup = buff(DefenceUp.class); if (buff(DefenceUp.class) != null) { dmg = (int) Math.ceil(dmg *(-drup.level()*0.01+1)); @@ -376,6 +388,15 @@ public void damage(int dmg, Object src) { dmg = (int) Math.ceil(dmg *0.8); } + if (buff(MagicWeak.class) != null && src instanceof Wand) { + dmg = (int) Math.ceil(dmg *1.5); + } + + + if (buff(SoulMark.class) != null) { + dmg = (int) Math.ceil(dmg *1.5); + } + ShieldArmor sarmor = buff(ShieldArmor.class); if (sarmor != null && !(src instanceof Hunger)) { dmg = sarmor.absorb(dmg); diff --git a/java/com/hmdzl/spspd/change/actors/blobs/ToxicGas.java b/java/com/hmdzl/spspd/actors/blobs/NmGas.java similarity index 62% rename from java/com/hmdzl/spspd/change/actors/blobs/ToxicGas.java rename to java/com/hmdzl/spspd/actors/blobs/NmGas.java index 669725f8..efced4f3 100644 --- a/java/com/hmdzl/spspd/change/actors/blobs/ToxicGas.java +++ b/java/com/hmdzl/spspd/actors/blobs/NmGas.java @@ -15,36 +15,32 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see */ -package com.hmdzl.spspd.change.actors.blobs; +package com.hmdzl.spspd.actors.blobs; -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.ResultDescriptions; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.BlobEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.utils.GLog; +import com.hmdzl.spspd.Badges; +import com.hmdzl.spspd.Dungeon; +import com.hmdzl.spspd.ResultDescriptions; +import com.hmdzl.spspd.actors.Actor; +import com.hmdzl.spspd.actors.Char; +import com.hmdzl.spspd.actors.hero.Hero; +import com.hmdzl.spspd.effects.BlobEmitter; +import com.hmdzl.spspd.effects.Speck; +import com.hmdzl.spspd.messages.Messages; import com.watabou.utils.Random; -public class ToxicGas extends Blob implements Hero.Doom { +public class NmGas extends Blob implements Hero.Doom { @Override protected void evolve() { super.evolve(); - int levelDamage = 5 + Dungeon.depth * 5; + int levelDamage = Dungeon.hero.spp; Char ch; for (int i = 0; i < LENGTH; i++) { if (cur[i] > 0 && (ch = Actor.findChar(i)) != null) { - int damage = (ch.HT + levelDamage) / 40; - if (Random.Int(40) < (ch.HT + levelDamage) % 40) { - damage++; - } + int damage = levelDamage ; ch.damage(damage, this); } @@ -55,7 +51,7 @@ protected void evolve() { public void use(BlobEmitter emitter) { super.use(emitter); - emitter.pour(Speck.factory(Speck.TOXIC), 0.6f); + emitter.pour(Speck.factory(Speck.CONFUSION), 0.6f); } @Override diff --git a/java/com/hmdzl/spspd/change/actors/blobs/TarGas.java b/java/com/hmdzl/spspd/actors/blobs/PoisonGas.java similarity index 69% rename from java/com/hmdzl/spspd/change/actors/blobs/TarGas.java rename to java/com/hmdzl/spspd/actors/blobs/PoisonGas.java index f3b197dd..0b1afbee 100644 --- a/java/com/hmdzl/spspd/change/actors/blobs/TarGas.java +++ b/java/com/hmdzl/spspd/actors/blobs/PoisonGas.java @@ -15,23 +15,26 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see */ -package com.hmdzl.spspd.change.actors.blobs; +package com.hmdzl.spspd.actors.blobs; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Burning; -import com.hmdzl.spspd.change.effects.BlobEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.buffs.Tar; -import com.hmdzl.spspd.change.messages.Messages; +import com.hmdzl.spspd.actors.Actor; +import com.hmdzl.spspd.actors.Char; +import com.hmdzl.spspd.actors.buffs.ArmorBreak; +import com.hmdzl.spspd.actors.buffs.Buff; +import com.hmdzl.spspd.actors.buffs.Burning; +import com.hmdzl.spspd.actors.buffs.Roots; +import com.hmdzl.spspd.actors.buffs.Slow; +import com.hmdzl.spspd.effects.BlobEmitter; +import com.hmdzl.spspd.effects.Speck; +import com.hmdzl.spspd.Dungeon; +import com.hmdzl.spspd.actors.buffs.Tar; +import com.hmdzl.spspd.messages.Messages; import com.watabou.utils.Random; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.scenes.GameScene; +import com.hmdzl.spspd.levels.Level; +import com.hmdzl.spspd.scenes.GameScene; -public class TarGas extends Blob { +public class PoisonGas extends Blob { @Override protected void evolve() { @@ -40,9 +43,10 @@ protected void evolve() { Char ch; for (int i = 0; i < LENGTH; i++) { if (cur[i] > 0 && (ch = Actor.findChar(i)) != null) { - if (!ch.immunities().contains(this.getClass())) - Buff.affect(ch,Tar.class); - if ( ch.buff( Burning.class ) != null ) {GameScene.add(Blob.seed(ch.pos, 2, Fire.class)); + if (!ch.immunities().contains(this.getClass())){ + Buff.affect(ch,Slow.class,3f); + Buff.affect(ch,Roots.class,3f); + Buff.affect(ch,ArmorBreak.class,3f).level(20); } } } diff --git a/java/com/hmdzl/spspd/actors/blobs/WaterOfTransmutation.java b/java/com/hmdzl/spspd/actors/blobs/WaterOfTransmutation.java index b43d69f2..f44e1618 100644 --- a/java/com/hmdzl/spspd/actors/blobs/WaterOfTransmutation.java +++ b/java/com/hmdzl/spspd/actors/blobs/WaterOfTransmutation.java @@ -206,10 +206,6 @@ private Potion changePotion(Potion p) { if (p instanceof PotionOfStrength) { return new PotionOfMight(); - - } else if (p instanceof PotionOfMending){ - - return new PotionOfHealing(); } else { diff --git a/java/com/hmdzl/spspd/actors/buffs/DBurning.java b/java/com/hmdzl/spspd/actors/buffs/DBurning.java new file mode 100644 index 00000000..d3001ff0 --- /dev/null +++ b/java/com/hmdzl/spspd/actors/buffs/DBurning.java @@ -0,0 +1,144 @@ +/* + * Pixel Dungeon + * Copyright (C) 2012-2014 Oleg Dolya + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + */ +package com.hmdzl.spspd.actors.buffs; + +import com.hmdzl.spspd.Badges; +import com.hmdzl.spspd.Dungeon; +import com.hmdzl.spspd.ResultDescriptions; +import com.hmdzl.spspd.actors.Char; +import com.hmdzl.spspd.actors.blobs.Blob; +import com.hmdzl.spspd.actors.blobs.Fire; +import com.hmdzl.spspd.actors.hero.Hero; +import com.hmdzl.spspd.actors.mobs.Thief; +import com.hmdzl.spspd.effects.particles.ElmoParticle; +import com.hmdzl.spspd.items.Heap; +import com.hmdzl.spspd.items.Item; +import com.hmdzl.spspd.items.food.meatfood.ChargrilledMeat; +import com.hmdzl.spspd.items.food.meatfood.MysteryMeat; +import com.hmdzl.spspd.items.rings.RingOfElements.Resistance; +import com.hmdzl.spspd.items.scrolls.Scroll; +import com.hmdzl.spspd.items.scrolls.ScrollOfMagicalInfusion; +import com.hmdzl.spspd.items.scrolls.ScrollOfUpgrade; +import com.hmdzl.spspd.levels.Level; +import com.hmdzl.spspd.messages.Messages; +import com.hmdzl.spspd.scenes.GameScene; +import com.hmdzl.spspd.sprites.CharSprite; +import com.hmdzl.spspd.ui.BuffIndicator; +import com.hmdzl.spspd.utils.GLog; +import com.watabou.utils.Bundle; +import com.watabou.utils.Random; + +public class DBurning extends Buff implements Hero.Doom { + + private static final String TXT_BURNS_UP = "%s burns up!"; + private static final String TXT_BURNED_TO_DEATH = "You burned to death..."; + + private static final float DURATION = 3f; + + private float left; + + private static final String LEFT = "left"; + + { + type = buffType.NEGATIVE; + } + + @Override + public void storeInBundle(Bundle bundle) { + super.storeInBundle(bundle); + bundle.put(LEFT, left); + } + + @Override + public void restoreFromBundle(Bundle bundle) { + super.restoreFromBundle(bundle); + left = bundle.getFloat(LEFT); + } + + @Override + public boolean act() { + + if (target.isAlive()) { + + if (target instanceof Hero) { + Buff.prolong(target, Light.class, TICK * 1.01f); + } + + target.damage(Random.Int(1, Math.min(1000,target.HT/10)), this); + Buff.detach( target, Chill.class); + + } else { + detach(); + } + + spend(TICK); + left -= TICK; + + if (left <= 0 ) { + + detach(); + } + + return true; + } + + public void reignite(Char ch) { + left = duration(ch); + } + + @Override + public int icon() { + return BuffIndicator.FIRE; + } + + @Override + public void fx(boolean on) { + if (on) target.sprite.add(CharSprite.State.BURNING); + else target.sprite.remove(CharSprite.State.BURNING); + } + + + @Override + public String heroMessage() { + return Messages.get(this, "heromsg"); + } + + @Override + public String toString() { + return Messages.get(this, "name"); + } + + public static float duration(Char ch) { + Resistance r = ch.buff(Resistance.class); + return r != null ? r.durationFactor() * DURATION : DURATION; + } + + @Override + public String desc() { + return Messages.get(this, "desc", dispTurns(left)); + } + + @Override + public void onDeath() { + + Badges.validateDeathFromFire(); + + Dungeon.fail(Messages.format(ResultDescriptions.BURNING)); + //GLog.n(TXT_BURNED_TO_DEATH); + } +} diff --git a/java/com/hmdzl/spspd/change/actors/buffs/Hot.java b/java/com/hmdzl/spspd/actors/buffs/MagicWeak.java similarity index 83% rename from java/com/hmdzl/spspd/change/actors/buffs/Hot.java rename to java/com/hmdzl/spspd/actors/buffs/MagicWeak.java index 10421c46..c7bf5c8d 100644 --- a/java/com/hmdzl/spspd/change/actors/buffs/Hot.java +++ b/java/com/hmdzl/spspd/actors/buffs/MagicWeak.java @@ -18,12 +18,12 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see */ -package com.hmdzl.spspd.change.actors.buffs; +package com.hmdzl.spspd.actors.buffs; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.ui.BuffIndicator; +import com.hmdzl.spspd.messages.Messages; +import com.hmdzl.spspd.ui.BuffIndicator; -public class Hot extends FlavourBuff { +public class MagicWeak extends FlavourBuff { public static final float DURATION = 10f; @@ -33,7 +33,7 @@ public class Hot extends FlavourBuff { @Override public int icon() { - return BuffIndicator.HOT; + return BuffIndicator.MAGICWEAK; } @Override diff --git a/java/com/hmdzl/spspd/actors/buffs/NewCombo.java b/java/com/hmdzl/spspd/actors/buffs/NewCombo.java index d56df304..808d8216 100644 --- a/java/com/hmdzl/spspd/actors/buffs/NewCombo.java +++ b/java/com/hmdzl/spspd/actors/buffs/NewCombo.java @@ -189,16 +189,16 @@ private void doAttack(final Char enemy){ //variance in damage dealt switch(type){ case CLOBBER: - dmg = Math.round(dmg*0.6f); + dmg = Math.round(dmg*1.6f); break; case CLEAVE: - dmg = Math.round(dmg*1.5f); + dmg = Math.round(dmg*2.5f); break; case SLAM: //rolls 2 times, takes the highest roll int dmgReroll = target.damageRoll(); if (dmgReroll > dmg) dmg = dmgReroll; - dmg = Math.round(dmg*1.6f); + dmg = Math.round(dmg*2.6f); break; case CRUSH: //rolls 4 times, takes the highest roll @@ -206,7 +206,7 @@ private void doAttack(final Char enemy){ dmgReroll = target.damageRoll(); if (dmgReroll > dmg) dmg = dmgReroll; } - dmg = Math.round(dmg*2.5f); + dmg = Math.round(dmg*3.5f); break; } diff --git a/java/com/hmdzl/spspd/actors/buffs/actbuff/NmImbue.java b/java/com/hmdzl/spspd/actors/buffs/actbuff/NmImbue.java new file mode 100644 index 00000000..93a5e297 --- /dev/null +++ b/java/com/hmdzl/spspd/actors/buffs/actbuff/NmImbue.java @@ -0,0 +1,132 @@ +/* + * Pixel Dungeon + * Copyright (C) 2012-2014 Oleg Dolya + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + */ + +package com.hmdzl.spspd.actors.buffs.actbuff; + +import com.hmdzl.spspd.Badges; +import com.hmdzl.spspd.Dungeon; +import com.hmdzl.spspd.ResultDescriptions; +import com.hmdzl.spspd.Statistics; +import com.hmdzl.spspd.actors.blobs.Blob; +import com.hmdzl.spspd.actors.blobs.NmGas; +import com.hmdzl.spspd.actors.blobs.ToxicGas; +import com.hmdzl.spspd.actors.buffs.Buff; +import com.hmdzl.spspd.actors.hero.Hero; +import com.hmdzl.spspd.items.Heap; +import com.hmdzl.spspd.items.Item; +import com.hmdzl.spspd.items.armor.Armor; +import com.hmdzl.spspd.items.artifacts.Artifact; +import com.hmdzl.spspd.items.bags.Bag; +import com.hmdzl.spspd.items.food.Food; +import com.hmdzl.spspd.items.potions.Potion; +import com.hmdzl.spspd.items.rings.Ring; +import com.hmdzl.spspd.items.scrolls.Scroll; +import com.hmdzl.spspd.items.wands.Wand; +import com.hmdzl.spspd.items.weapon.Weapon; +import com.hmdzl.spspd.messages.Messages; +import com.hmdzl.spspd.plants.Earthroot; +import com.hmdzl.spspd.plants.NutPlant; +import com.hmdzl.spspd.plants.Plant; +import com.hmdzl.spspd.scenes.GameScene; +import com.hmdzl.spspd.ui.BuffIndicator; +import com.hmdzl.spspd.utils.GLog; +import com.watabou.utils.Bundle; +import com.watabou.utils.Random; + +/** + * Created by debenhame on 19/11/2014. + */ +public class NmImbue extends Buff implements Hero.Doom { + + @Override + public boolean act() { + GameScene.add(Blob.seed(target.pos, 30, NmGas.class)); + + if (target.isAlive()) { + + Hero hero = (Hero) target; + Nmstop nmstop = target.buff(Nmstop.class); + + if ((((Random.Int(250) < Dungeon.hero.spp) && + (Dungeon.hero.spp < Statistics.deepestFloor * 10+20) ) && + ( nmstop == null )) + || Dungeon.hero.spp == 0) { + Item item = hero.belongings.randomUnequipped(); + Bag bag = hero.belongings.backpack; + if (item instanceof Bag) { + bag = (Bag) item; + item = Random.element(bag.items); + } + if ((item instanceof Scroll + || item instanceof Potion + || item instanceof Food + || item instanceof Wand + || item instanceof Plant.Seed + || item instanceof Weapon + || item instanceof Armor + || item instanceof Ring + || item instanceof Artifact) && !item.unique + ) { + + item = item.detach(hero.belongings.backpack); + GLog.w(Messages.get(this, "burnsup", item.toString())); + Dungeon.hero.spp++; + Heap.burnFX(hero.pos); + + } + } else if ((Dungeon.hero.spp > Statistics.deepestFloor * 10) && (Random.Int(20) == 0) && nmstop == null){ + Buff.affect( target, Nmstop.class,720f); + } else if ( nmstop != null && (Dungeon.hero.spp > Statistics.deepestFloor * 10)){ + Dungeon.hero.spp--; + } + } + + + spend(TICK); + + return true; + } + + @Override + public int icon() { + return BuffIndicator.PTOXIC; + } + + @Override + public String toString() { + return Messages.get(this, "name"); + } + + @Override + public String desc() { + return Messages.get(this, "desc"); + } + + @Override + public void onDeath() { + + Badges.validateDeathFromFire(); + + Dungeon.fail(Messages.format(ResultDescriptions.BURNING)); + //GLog.n(TXT_BURNED_TO_DEATH); + } + + { + immunities.add(NmGas.class); + } +} diff --git a/java/com/hmdzl/spspd/change/actors/buffs/Cold.java b/java/com/hmdzl/spspd/actors/buffs/actbuff/Nmstop.java similarity index 78% rename from java/com/hmdzl/spspd/change/actors/buffs/Cold.java rename to java/com/hmdzl/spspd/actors/buffs/actbuff/Nmstop.java index 81299828..02baf691 100644 --- a/java/com/hmdzl/spspd/change/actors/buffs/Cold.java +++ b/java/com/hmdzl/spspd/actors/buffs/actbuff/Nmstop.java @@ -18,19 +18,18 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see */ -package com.hmdzl.spspd.change.actors.buffs; +package com.hmdzl.spspd.actors.buffs.actbuff; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.ui.BuffIndicator; +import com.hmdzl.spspd.Dungeon; +import com.hmdzl.spspd.Statistics; +import com.hmdzl.spspd.actors.buffs.FlavourBuff; +import com.hmdzl.spspd.messages.Messages; +import com.hmdzl.spspd.ui.BuffIndicator; -public class Cold extends FlavourBuff { +public class Nmstop extends FlavourBuff { public static final float DURATION = 10f; - { - type = buffType.NEGATIVE; - } - @Override public int icon() { return BuffIndicator.COLD; diff --git a/java/com/hmdzl/spspd/change/actors/buffs/WarGroove.java b/java/com/hmdzl/spspd/actors/buffs/mindbuff/AmokMind.java similarity index 73% rename from java/com/hmdzl/spspd/change/actors/buffs/WarGroove.java rename to java/com/hmdzl/spspd/actors/buffs/mindbuff/AmokMind.java index dda27be9..711e343d 100644 --- a/java/com/hmdzl/spspd/change/actors/buffs/WarGroove.java +++ b/java/com/hmdzl/spspd/actors/buffs/mindbuff/AmokMind.java @@ -15,31 +15,34 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see */ -package com.hmdzl.spspd.change.actors.buffs; +package com.hmdzl.spspd.actors.buffs.mindbuff; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.ui.BuffIndicator; +import com.hmdzl.spspd.actors.buffs.Buff; +import com.hmdzl.spspd.messages.Messages; +import com.hmdzl.spspd.ui.BuffIndicator; -public class WarGroove extends Buff { +public class AmokMind extends Buff { @Override public int icon() { - return BuffIndicator.WARGROOVE; + return BuffIndicator.MIND_BUFF; } @Override public String toString() { return Messages.get(this, "name"); } - + @Override public String desc() { return Messages.get(this, "desc"); - } - + } + @Override - public void detach() { - super.detach(); + public boolean act() { + if (target.isAlive()) { + spend(TICK); + } + return true; } } \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/actors/buffs/Fury.java b/java/com/hmdzl/spspd/actors/buffs/mindbuff/CrazyMind.java similarity index 70% rename from java/com/hmdzl/spspd/change/actors/buffs/Fury.java rename to java/com/hmdzl/spspd/actors/buffs/mindbuff/CrazyMind.java index 3c0be46b..f1fa4df1 100644 --- a/java/com/hmdzl/spspd/change/actors/buffs/Fury.java +++ b/java/com/hmdzl/spspd/actors/buffs/mindbuff/CrazyMind.java @@ -15,29 +15,17 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see */ -package com.hmdzl.spspd.change.actors.buffs; +package com.hmdzl.spspd.actors.buffs.mindbuff; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.ui.BuffIndicator; +import com.hmdzl.spspd.actors.buffs.Buff; +import com.hmdzl.spspd.messages.Messages; +import com.hmdzl.spspd.ui.BuffIndicator; -public class Fury extends Buff { - - public static float LEVEL = 0.5f; - - @Override - public boolean act() { - if (target.HP > target.HT * LEVEL) { - detach(); - } - - spend(TICK); - - return true; - } +public class CrazyMind extends Buff { @Override public int icon() { - return BuffIndicator.FURY; + return BuffIndicator.MIND_BUFF; } @Override @@ -46,12 +34,15 @@ public String toString() { } @Override - public String heroMessage() { - return Messages.get(this, "heromsg"); + public String desc() { + return Messages.get(this, "desc"); } @Override - public String desc() { - return Messages.get(this, "desc"); + public boolean act() { + if (target.isAlive()) { + spend(TICK); + } + return true; } -} +} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/actors/buffs/Dewcharge.java b/java/com/hmdzl/spspd/actors/buffs/mindbuff/HopeMind.java similarity index 69% rename from java/com/hmdzl/spspd/change/actors/buffs/Dewcharge.java rename to java/com/hmdzl/spspd/actors/buffs/mindbuff/HopeMind.java index f799f12a..cc071fb3 100644 --- a/java/com/hmdzl/spspd/change/actors/buffs/Dewcharge.java +++ b/java/com/hmdzl/spspd/actors/buffs/mindbuff/HopeMind.java @@ -15,18 +15,17 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see */ -package com.hmdzl.spspd.change.actors.buffs; +package com.hmdzl.spspd.actors.buffs.mindbuff; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.ui.BuffIndicator; +import com.hmdzl.spspd.actors.buffs.Buff; +import com.hmdzl.spspd.messages.Messages; +import com.hmdzl.spspd.ui.BuffIndicator; -public class Dewcharge extends FlavourBuff { - - public static final float DURATION = 300f; +public class HopeMind extends Buff { @Override public int icon() { - return BuffIndicator.DEWCHARGE; + return BuffIndicator.MIND_BUFF; } @Override @@ -36,7 +35,14 @@ public String toString() { @Override public String desc() { - return Messages.get(this, "desc", dispTurns(cooldown()+1)); + return Messages.get(this, "desc"); + } + + @Override + public boolean act() { + if (target.isAlive()) { + spend(TICK); + } + return true; } - -} +} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/actors/buffs/Ooze.java b/java/com/hmdzl/spspd/actors/buffs/mindbuff/KeepMind.java similarity index 50% rename from java/com/hmdzl/spspd/change/actors/buffs/Ooze.java rename to java/com/hmdzl/spspd/actors/buffs/mindbuff/KeepMind.java index 80c3bd8c..366c8a15 100644 --- a/java/com/hmdzl/spspd/change/actors/buffs/Ooze.java +++ b/java/com/hmdzl/spspd/actors/buffs/mindbuff/KeepMind.java @@ -15,25 +15,26 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see */ -package com.hmdzl.spspd.change.actors.buffs; +package com.hmdzl.spspd.actors.buffs.mindbuff; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.ResultDescriptions; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.ui.BuffIndicator; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.utils.Random; +import com.hmdzl.spspd.actors.blobs.Web; +import com.hmdzl.spspd.actors.blobs.weather.WeatherOfRain; +import com.hmdzl.spspd.actors.blobs.weather.WeatherOfSand; +import com.hmdzl.spspd.actors.blobs.weather.WeatherOfSnow; +import com.hmdzl.spspd.actors.blobs.weather.WeatherOfSun; +import com.hmdzl.spspd.actors.buffs.Buff; +import com.hmdzl.spspd.actors.buffs.Cold; +import com.hmdzl.spspd.actors.buffs.Dry; +import com.hmdzl.spspd.actors.buffs.Hot; +import com.hmdzl.spspd.actors.buffs.Wet; +import com.hmdzl.spspd.messages.Messages; +import com.hmdzl.spspd.ui.BuffIndicator; -public class Ooze extends Buff { +public class KeepMind extends Buff { - { - type = buffType.NEGATIVE; - } - @Override public int icon() { - return BuffIndicator.OOZE; + return BuffIndicator.MIND_BUFF; } @Override @@ -41,11 +42,6 @@ public String toString() { return Messages.get(this, "name"); } - @Override - public String heroMessage() { - return Messages.get(this, "heromsg"); - } - @Override public String desc() { return Messages.get(this, "desc"); @@ -54,19 +50,22 @@ public String desc() { @Override public boolean act() { if (target.isAlive()) { - if (Dungeon.depth > 4) - target.damage(Dungeon.depth / 5, this); - else if (Random.Int(2) == 0) - target.damage(1, this); - if (!target.isAlive() && target == Dungeon.hero) { - Dungeon.fail(Messages.format(ResultDescriptions.OOZE)); - //GLog.n(TXT_HERO_KILLED, toString()); - } spend(TICK); } - if (Level.water[target.pos]) { - detach(); - } return true; } -} + + { + immunities.add( Web.class ); + immunities.add( Hot.class ); + immunities.add( Cold.class ); + immunities.add( Wet.class ); + immunities.add( Dry.class ); + + immunities.add(WeatherOfRain.class); + immunities.add(WeatherOfSand.class); + immunities.add(WeatherOfSnow.class); + immunities.add(WeatherOfSun.class); + } + +} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/actors/buffs/faithbuff/LifeFaith.java b/java/com/hmdzl/spspd/actors/buffs/mindbuff/LoseMind.java similarity index 67% rename from java/com/hmdzl/spspd/change/actors/buffs/faithbuff/LifeFaith.java rename to java/com/hmdzl/spspd/actors/buffs/mindbuff/LoseMind.java index ad7589ba..bdd66a80 100644 --- a/java/com/hmdzl/spspd/change/actors/buffs/faithbuff/LifeFaith.java +++ b/java/com/hmdzl/spspd/actors/buffs/mindbuff/LoseMind.java @@ -15,22 +15,17 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see */ -package com.hmdzl.spspd.change.actors.buffs.faithbuff; +package com.hmdzl.spspd.actors.buffs.mindbuff; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.ResultDescriptions; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.ui.BuffIndicator; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.utils.Random; +import com.hmdzl.spspd.actors.buffs.Buff; +import com.hmdzl.spspd.messages.Messages; +import com.hmdzl.spspd.ui.BuffIndicator; -public class LifeFaith extends Buff { +public class LoseMind extends Buff { @Override public int icon() { - return BuffIndicator.LIFE_FAITH; + return BuffIndicator.MIND_BUFF; } @Override diff --git a/java/com/hmdzl/spspd/actors/buffs/mindbuff/TerrorMind.java b/java/com/hmdzl/spspd/actors/buffs/mindbuff/TerrorMind.java new file mode 100644 index 00000000..3b027c47 --- /dev/null +++ b/java/com/hmdzl/spspd/actors/buffs/mindbuff/TerrorMind.java @@ -0,0 +1,48 @@ +/* + * Pixel Dungeon + * Copyright (C) 2012-2014 Oleg Dolya + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + */ +package com.hmdzl.spspd.actors.buffs.mindbuff; + +import com.hmdzl.spspd.actors.buffs.Buff; +import com.hmdzl.spspd.messages.Messages; +import com.hmdzl.spspd.ui.BuffIndicator; + +public class TerrorMind extends Buff { + + @Override + public int icon() { + return BuffIndicator.MIND_BUFF; + } + + @Override + public String toString() { + return Messages.get(this, "name"); + } + + @Override + public String desc() { + return Messages.get(this, "desc"); + } + + @Override + public boolean act() { + if (target.isAlive()) { + spend(TICK); + } + return true; + } +} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/actors/buffs/mindbuff/WeakMind.java b/java/com/hmdzl/spspd/actors/buffs/mindbuff/WeakMind.java new file mode 100644 index 00000000..6bc23438 --- /dev/null +++ b/java/com/hmdzl/spspd/actors/buffs/mindbuff/WeakMind.java @@ -0,0 +1,48 @@ +/* + * Pixel Dungeon + * Copyright (C) 2012-2014 Oleg Dolya + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + */ +package com.hmdzl.spspd.actors.buffs.mindbuff; + +import com.hmdzl.spspd.actors.buffs.Buff; +import com.hmdzl.spspd.messages.Messages; +import com.hmdzl.spspd.ui.BuffIndicator; + +public class WeakMind extends Buff { + + @Override + public int icon() { + return BuffIndicator.MIND_BUFF; + } + + @Override + public String toString() { + return Messages.get(this, "name"); + } + + @Override + public String desc() { + return Messages.get(this, "desc"); + } + + @Override + public boolean act() { + if (target.isAlive()) { + spend(TICK); + } + return true; + } +} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/actors/hero/Hero.java b/java/com/hmdzl/spspd/actors/hero/Hero.java index 3e58c032..a064945d 100644 --- a/java/com/hmdzl/spspd/actors/hero/Hero.java +++ b/java/com/hmdzl/spspd/actors/hero/Hero.java @@ -26,10 +26,12 @@ import com.hmdzl.spspd.actors.buffs.Arcane; import com.hmdzl.spspd.actors.buffs.ArmorBreak; import com.hmdzl.spspd.actors.buffs.AttackUp; +import com.hmdzl.spspd.actors.buffs.Bless; import com.hmdzl.spspd.actors.buffs.BloodAngry; import com.hmdzl.spspd.actors.buffs.BoxStar; import com.hmdzl.spspd.actors.buffs.Burning; import com.hmdzl.spspd.actors.buffs.Charm; +import com.hmdzl.spspd.actors.buffs.DBurning; import com.hmdzl.spspd.actors.buffs.DamageUp; import com.hmdzl.spspd.actors.buffs.DeadRaise; import com.hmdzl.spspd.actors.buffs.Disarm; @@ -52,11 +54,19 @@ import com.hmdzl.spspd.actors.buffs.Silent; import com.hmdzl.spspd.actors.buffs.Terror; import com.hmdzl.spspd.actors.buffs.WarGroove; +import com.hmdzl.spspd.actors.buffs.actbuff.NmImbue; +import com.hmdzl.spspd.actors.buffs.mindbuff.AmokMind; import com.hmdzl.spspd.actors.buffs.faithbuff.BalanceFaith; +import com.hmdzl.spspd.actors.buffs.mindbuff.CrazyMind; import com.hmdzl.spspd.actors.buffs.faithbuff.DemonFaith; +import com.hmdzl.spspd.actors.buffs.mindbuff.HopeMind; import com.hmdzl.spspd.actors.buffs.faithbuff.HumanFaith; +import com.hmdzl.spspd.actors.buffs.mindbuff.KeepMind; import com.hmdzl.spspd.actors.buffs.faithbuff.LifeFaith; +import com.hmdzl.spspd.actors.buffs.mindbuff.LoseMind; import com.hmdzl.spspd.actors.buffs.faithbuff.MechFaith; +import com.hmdzl.spspd.actors.buffs.mindbuff.TerrorMind; +import com.hmdzl.spspd.actors.buffs.mindbuff.WeakMind; import com.hmdzl.spspd.actors.mobs.SommonSkeleton; import com.hmdzl.spspd.effects.Lightning; import com.hmdzl.spspd.items.DolyaSlate; @@ -66,10 +76,12 @@ import com.hmdzl.spspd.items.artifacts.AlienBag; import com.hmdzl.spspd.items.artifacts.EtherealChains; import com.hmdzl.spspd.items.artifacts.Pylon; +import com.hmdzl.spspd.items.bombs.DungeonBomb; import com.hmdzl.spspd.items.misc.AttackShield; import com.hmdzl.spspd.items.misc.BShovel; import com.hmdzl.spspd.items.misc.CopyBall; import com.hmdzl.spspd.items.misc.DanceLion; +import com.hmdzl.spspd.items.misc.DiceTower; import com.hmdzl.spspd.items.misc.FourClover; import com.hmdzl.spspd.items.misc.GunOfSoldier; import com.hmdzl.spspd.items.misc.HealBag; @@ -204,6 +216,7 @@ public class Hero extends Char { public int hitSkill = 10; public int evadeSkill = 5; public int magicSkill = 0; + public int spp = 0; public boolean ready = false; @@ -282,6 +295,8 @@ public int magicSkill() { magicSkill += 4; if (buff(Arcane.class)!= null) magicSkill += 10; + if (buff(LoseMind.class)!= null) + magicSkill -= 5; return magicSkill; } @@ -289,6 +304,7 @@ public int magicSkill() { private static final String ATTACK = "hitSkill"; private static final String DEFENSE = "evadeSkill"; private static final String MAGIC = "magicSkill"; + private static final String SPP = "spp"; private static final String STRENGTH = "STR"; private static final String LEVEL = "lvl"; private static final String EXPERIENCE = "exp"; @@ -311,6 +327,7 @@ public void storeInBundle(Bundle bundle) { bundle.put(ATTACK, hitSkill); bundle.put(DEFENSE, evadeSkill); bundle.put(MAGIC, magicSkill); + bundle.put(SPP, spp); bundle.put(STRENGTH, STR); @@ -337,6 +354,7 @@ public void restoreFromBundle(Bundle bundle) { hitSkill = bundle.getInt(ATTACK); evadeSkill = bundle.getInt(DEFENSE); magicSkill = bundle.getInt(MAGIC); + spp = bundle.getInt(SPP); STR = bundle.getInt(STRENGTH); updateAwareness(); @@ -370,10 +388,16 @@ public String givenName() { public void live() { Buff.affect(this, Regeneration.class); Buff.affect(this, Hunger.class); + + // if (Dungeon.skins == 4 ) { + //if (heroClass == HeroClass.SOLDIER) { + // Buff.affect(this, NmImbue.class); + //} + //} } - + public int useskin() { - return belongings.armor == null ? 0 : 7 - Dungeon.skins; + return Dungeon.skins; } public boolean shoot(Char enemy, MissileWeapon wep) { @@ -469,8 +493,20 @@ public int damageRoll() { if (dmg < 0) dmg = 0; - + if (buff(Fury.class) != null){ dmg *= 1.30f; } + + if (Dungeon.skins == 4 && Dungeon.hero.heroClass == HeroClass.FOLLOWER){ + if (Dungeon.hero.spp < 40){ + dmg *= 0.5f; + } else if (Dungeon.hero.spp < 70){ + dmg *= 1f * (3+ Dungeon.hero.spp)/100; + } else if (Dungeon.hero.spp < 95){ + dmg *= 1f *( 1 + ((Dungeon.hero.spp-70)*4/100)); + } else { + dmg *= 1f * ( 2 + (Dungeon.hero.spp-95)); + } + } if (buff(Strength.class) != null){ dmg *= 3f; Buff.detach(this, Strength.class);} @@ -493,6 +529,13 @@ public int damageRoll() { if (buff(BloodAngry.class) != null){ dmg *= 1.50f; } if (buff(Rhythm2.class) != null){ dmg *= 1.20f; } + + if (buff(CrazyMind.class) != null){ dmg *= 0.80f; } + if (buff(LoseMind.class) != null){ dmg *= 1.20f; } + if (buff(AmokMind.class) != null){ dmg *= 1.20f; } + if (buff(WeakMind.class) != null){ dmg *= 1.20f; } + if (buff(TerrorMind.class) != null){ dmg *= 1.20f; } + /*AttackUp atkup = buff(AttackUp.class); if (atkup != null) { dmg *=(1f+atkup.level()*0.01f); @@ -1391,12 +1434,27 @@ public int attackProc(Char enemy, int damage) { CopyBall copyball = belongings.getItem(CopyBall.class); if (copyball!=null && copyball.charge 95) { + Dungeon.level.drop(Generator.random(), enemy.pos).sprite.drop(); + } + } + break; } switch (subClass) { case GLADIATOR: @@ -1577,6 +1635,15 @@ public int defenseProc(Char enemy, int damage) { arm.proc(enemy, this, damage); } + switch (heroClass) { + case ROGUE: + if (Dungeon.skins == 4){ + int x = (int)(Dungeon.gold*0.3); + Dungeon.gold -= x; + Dungeon.hero.spp +=x; + if ( x > 0); + damage = (int)(damage*0.3);} + } switch (subClass) { case LEADER: switch (Random.Int (10)){ @@ -1680,9 +1747,15 @@ public void damage(int dmg, Object src) { if (buff(Fury.class) != null){dmg = (int) Math.ceil(dmg * 0.75);} if (buff(BloodAngry.class) != null){dmg = (int) Math.ceil(dmg * 0.80);} if (buff(Rhythm2.class) != null){dmg = (int) Math.ceil(dmg * 0.90);} + if (buff(WeakMind.class) != null){dmg = (int) Math.ceil(dmg * 1.30);} if (subClass == HeroSubClass.LEADER){dmg = (int) Math.ceil(dmg * 0.80);} + if (heroClass == HeroClass.WARRIOR) { + if ((dmg > HP) && ( 3*HP > 2*HT )) { + dmg = Math.max(1,HT / 2); + } + } //if (buff(Hot.class) != null){dmg = (int) Math.ceil(dmg * 1.20);} /*DefenceUp drup = buff(DefenceUp.class); @@ -1704,6 +1777,49 @@ public void damage(int dmg, Object src) { && HP <= HT * Fury.LEVEL) { Buff.affect(this, Fury.class); } + + if (heroClass == HeroClass.HUNTRESS && Dungeon.skins == 4) { + Dungeon.hero.spp++; + if(Dungeon.hero.spp>100 && Random.Int(4)==0){ + GLog.i(Messages.get(this, "test")); + switch (Random.Int(8)){ + case 0: + if (buff(HopeMind.class) != null); + else {Buff.affect(this,HopeMind.class); + break;} + case 1: + if (buff(KeepMind.class) != null); + else {Buff.affect(this,KeepMind.class); + break;} + case 2: + if (buff(AmokMind.class) != null); + else {Buff.affect(this,AmokMind.class); + break;} + + case 3: + if (buff(CrazyMind.class) != null); + else {Buff.affect(this,CrazyMind.class); + break;} + case 4: + if (buff(WeakMind.class) != null); + else {Buff.affect(this,WeakMind.class); + break;} + + case 5: + if (buff(LoseMind.class) != null); + else {Buff.affect(this,LoseMind.class); + break;} + case 6: + if (buff(TerrorMind.class) != null); + else {Buff.affect(this,TerrorMind.class); + break;} + case 7: + Buff.affect(this,Bless.class,20f); + break; + } + Dungeon.hero.spp = 0; + } + } if (this.buff(AutoHealPotion.class) != null && ((float) HP / HT)<.1) { PotionOfHealing pot = hero.belongings.getItem(PotionOfHealing.class); @@ -1925,6 +2041,9 @@ public void earnExp(int exp) { if (heroClass == HeroClass.SOLDIER){ HT+=3; } + if (buff(HopeMind.class) != null){ + HT+=1; + } if (lvl < 10) { updateAwareness(); } @@ -1997,7 +2116,7 @@ public void add(Buff buff) { if (buff instanceof RingOfMight.Might) { if (((RingOfMight.Might) buff).level > 0) { - HT += ((RingOfMight.Might) buff).level * 10; + HT += ((RingOfMight.Might) buff).level * 8; } } else if (buff instanceof Paralysis || buff instanceof Vertigo) { interrupt(); @@ -2012,7 +2131,7 @@ public void remove(Buff buff) { super.remove(buff); if (buff instanceof RingOfMight.Might) { if (((RingOfMight.Might) buff).level > 0) { - HT -= ((RingOfMight.Might) buff).level * 10; + HT -= ((RingOfMight.Might) buff).level * 8; hero.damage(1, this); if (!hero.isAlive()) { Dungeon.fail(Messages.format(ResultDescriptions.ITEM)); @@ -2365,6 +2484,7 @@ public void resurrect(int resetLevel) { belongings.resurrect(resetLevel); live(); + } @Override diff --git a/java/com/hmdzl/spspd/actors/hero/HeroClass.java b/java/com/hmdzl/spspd/actors/hero/HeroClass.java index 5af1cc16..5118c005 100644 --- a/java/com/hmdzl/spspd/actors/hero/HeroClass.java +++ b/java/com/hmdzl/spspd/actors/hero/HeroClass.java @@ -26,6 +26,8 @@ import com.hmdzl.spspd.items.DolyaSlate; import com.hmdzl.spspd.items.Elevator; import com.hmdzl.spspd.items.ExpOre; +import com.hmdzl.spspd.items.Generator; +import com.hmdzl.spspd.items.Item; import com.hmdzl.spspd.items.Palantir; import com.hmdzl.spspd.items.PowerHand; import com.hmdzl.spspd.items.SaveYourLife; @@ -33,12 +35,14 @@ import com.hmdzl.spspd.items.Stylus; import com.hmdzl.spspd.items.TriForce; import com.hmdzl.spspd.items.Weightstone; +import com.hmdzl.spspd.items.armor.Armor; import com.hmdzl.spspd.items.armor.normalarmor.BaseArmor; import com.hmdzl.spspd.items.armor.normalarmor.DiscArmor; import com.hmdzl.spspd.items.armor.normalarmor.LeatherArmor; import com.hmdzl.spspd.items.armor.normalarmor.LifeArmor; import com.hmdzl.spspd.items.armor.normalarmor.RubberArmor; import com.hmdzl.spspd.items.artifacts.AlienBag; +import com.hmdzl.spspd.items.artifacts.Artifact; import com.hmdzl.spspd.items.artifacts.EtherealChains; import com.hmdzl.spspd.items.artifacts.Pylon; import com.hmdzl.spspd.items.artifacts.TimekeepersHourglass; @@ -65,6 +69,7 @@ import com.hmdzl.spspd.items.misc.CopyBall; import com.hmdzl.spspd.items.misc.DanceLion; import com.hmdzl.spspd.items.misc.DemoScroll; +import com.hmdzl.spspd.items.misc.DiceTower; import com.hmdzl.spspd.items.misc.FaithSign; import com.hmdzl.spspd.items.misc.GnollMark; import com.hmdzl.spspd.items.misc.HealBag; @@ -72,6 +77,9 @@ import com.hmdzl.spspd.items.misc.JumpF; import com.hmdzl.spspd.items.misc.MKbox; import com.hmdzl.spspd.items.misc.MechPocket; +import com.hmdzl.spspd.items.misc.NeedPaper; +import com.hmdzl.spspd.items.misc.NmHealBag; +import com.hmdzl.spspd.items.misc.PPC; import com.hmdzl.spspd.items.misc.RangeBag; import com.hmdzl.spspd.items.misc.SavageHelmet; import com.hmdzl.spspd.items.misc.UndeadBook; @@ -81,6 +89,8 @@ import com.hmdzl.spspd.items.nornstone.PurpleNornStone; import com.hmdzl.spspd.items.nornstone.YellowNornStone; import com.hmdzl.spspd.items.potions.PotionOfHealing; +import com.hmdzl.spspd.items.potions.PotionOfShield; +import com.hmdzl.spspd.items.rings.Ring; import com.hmdzl.spspd.items.rings.RingOfForce; import com.hmdzl.spspd.items.rings.RingOfMight; import com.hmdzl.spspd.items.scrolls.ScrollOfRegrowth; @@ -132,6 +142,8 @@ import com.hmdzl.spspd.items.wands.WandOfFreeze; import com.hmdzl.spspd.items.wands.WandOfLightning; import com.hmdzl.spspd.items.wands.WandOfMagicMissile; +import com.hmdzl.spspd.items.wands.WandOfPoison; +import com.hmdzl.spspd.items.weapon.Weapon; import com.hmdzl.spspd.items.weapon.guns.GunA; import com.hmdzl.spspd.items.weapon.guns.GunC; import com.hmdzl.spspd.items.weapon.guns.Sling; @@ -149,8 +161,10 @@ import com.hmdzl.spspd.items.weapon.melee.special.FireCracker; import com.hmdzl.spspd.items.weapon.melee.special.LinkSword; import com.hmdzl.spspd.items.weapon.melee.special.ShadowEater; +import com.hmdzl.spspd.items.weapon.melee.special.TestWeapon; import com.hmdzl.spspd.items.weapon.melee.zero.EmptyPotion; import com.hmdzl.spspd.items.weapon.missiles.Boomerang; +import com.hmdzl.spspd.items.weapon.missiles.ElfBow; import com.hmdzl.spspd.items.weapon.missiles.EmpBola; import com.hmdzl.spspd.items.weapon.missiles.ErrorAmmo; import com.hmdzl.spspd.items.misc.JumpW; @@ -255,6 +269,7 @@ private static void initCommon(Hero hero) { new Weightstone().collect(); new Stylus().collect(); new PotionOfHealing().identify().collect(); + new ScrollOfMagicMapping().identify().collect(); } if (Dungeon.skins == 0) { @@ -262,6 +277,27 @@ private static void initCommon(Hero hero) { new PetFood().collect(); new PocketBall().collect(); } + + if (Dungeon.skins == 5) { + + Weapon weapon = (Weapon) Generator.random(Generator.Category.WEAPON); + Armor armor = (Armor) Generator.random(Generator.Category.ARMOR); + Ring ring = (Ring) Generator.random(Generator.Category.RING); + Artifact artifact = (Artifact) Generator.random(Generator.Category.ARTIFACT); + + (hero.belongings.weapon = weapon).identify(); + (hero.belongings.armor = armor).identify(); + (hero.belongings.misc1 = artifact).identify(); + hero.belongings.misc1.activate(hero); + (hero.belongings.misc3 = ring).identify(); + hero.belongings.misc3.activate(hero); + + hero.STR += 10; + Dungeon.limitedDrops.strengthPotions.count+=10; + Item shoes = Generator.random(Generator.Category.SHOES); + shoes.identify().collect(); + + } if (Dungeon.isChallenged(Challenges.ITEM_PHOBIA)){ Dungeon.gold += 1000; @@ -322,6 +358,8 @@ private static void initCommon(Hero hero) { new PowerHand().collect(); new TomeOfMastery().collect(); new ShadowEater().collect(); + new TestWeapon().upgrade(90).collect(); + for(int i=0; i<199; i++){ new ScrollOfMagicalInfusion().identify().collect(); new ScrollOfUpgrade().identify().collect(); @@ -331,6 +369,7 @@ private static void initCommon(Hero hero) { new Pasty().collect(); new PotionOfMindVision().identify().collect(); new PotionOfStrength().identify().collect(); + new PotionOfShield().identify().collect(); new YellowNornStone().collect(); new BlueNornStone().collect(); new OrangeNornStone().collect(); @@ -342,6 +381,7 @@ private static void initCommon(Hero hero) { new ScrollOfRegrowth().collect(); } new WandOfFlock().upgrade(10).identify().collect(); + new WandOfPoison().upgrade(10).identify().collect(); new SewerReward().collect(); new SaveYourLife().collect(); new FireCracker().collect(); @@ -418,6 +458,10 @@ private static void initWarrior(Hero hero) { hero.STR += 2; Dungeon.limitedDrops.strengthPotions.count+=2; + } else if (Dungeon.skins == 4) { + + } else if (Dungeon.skins == 5) { + } else { (hero.belongings.weapon = new ShortSword()).identify(); (hero.belongings.armor = new WoodenArmor()).identify(); @@ -466,6 +510,18 @@ private static void initMage(Hero hero) { new GnollMark().collect(); new PotionOfMage().identify().collect(); + } else if (Dungeon.skins == 4) { + + (hero.belongings.weapon = new ElfBow()).identify(); + (hero.belongings.armor = new VestArmor()).identify(); + + new JumpM().collect(); + new ScrollOfRegrowth().identify().collect(); + + } else if (Dungeon.skins == 5) { + + + } else { (hero.belongings.weapon = new MageBook()).identify(); (hero.belongings.armor = new ClothArmor()).identify(); @@ -515,6 +571,15 @@ private static void initRogue(Hero hero) { hero.STR += 4; Dungeon.limitedDrops.strengthPotions.count+=4; + } else if (Dungeon.skins == 4) { + (hero.belongings.weapon = new Dagger()).identify(); + (hero.belongings.armor = new ClothArmor()).identify(); + + new JumpR().collect(); + new NeedPaper().identify().collect(); + + } else if (Dungeon.skins == 5) { + } else { (hero.belongings.weapon = new Dagger()).identify(); @@ -539,7 +604,7 @@ private static void initHuntress(Hero hero) { (hero.belongings.armor = new RubberArmor()).identify().upgrade(1); Dungeon.limitedDrops.strengthPotions.count++; TimekeepersHourglass th = new TimekeepersHourglass(); - (hero.belongings.misc1 = th).identify(); + (hero.belongings.misc1 = th).identify().upgrade(5); hero.belongings.misc1.activate(hero); new ManyKnive().upgrade(1).identify().collect(); @@ -563,6 +628,16 @@ private static void initHuntress(Hero hero) { new TaurcenBow().identify().collect(); new RangeBag().identify().collect(); + } else if (Dungeon.skins == 4) { + + (hero.belongings.weapon = new WoodenStaff()).identify(); + (hero.belongings.armor = new ClothArmor()).identify(); + + new PPC().identify().collect(); + new JumpH().collect(); + + } else if (Dungeon.skins == 5) { + } else { (hero.belongings.weapon = new Knuckles()).identify(); (hero.belongings.armor = new ClothArmor()).identify(); @@ -608,6 +683,12 @@ private static void initPerformer(Hero hero) { new Shovel().identify().collect(); new DanceLion().identify().collect(); + } else if (Dungeon.skins == 4) { + + + + } else if (Dungeon.skins == 5) { + } else { (hero.belongings.weapon = new Triangolo()).identify(); @@ -658,6 +739,19 @@ private static void initSoldier(Hero hero) { new GunOfSoldier().identify().collect(); new HealBag().identify().collect(); + } else if (Dungeon.skins == 4) { + + (hero.belongings.weapon = new GunA()).identify(); + (hero.belongings.armor = new VestArmor()).identify(); + + new JumpS().collect(); + new NmHealBag().identify().collect(); + new EscapeKnive(10).collect(); + + } else if (Dungeon.skins == 5) { + + + } else { (hero.belongings.weapon = new Sling()).identify(); @@ -705,7 +799,19 @@ private static void initFollower(Hero hero) { hero.STR += 4; Dungeon.limitedDrops.strengthPotions.count+=4; - } else { + } else if (Dungeon.skins == 4) { + + (hero.belongings.weapon = new Knuckles()).identify(); + (hero.belongings.armor = new VestArmor()).identify(); + new DiceTower().identify().collect(); + new JumpF().collect(); + Dungeon.gold += 1000; + + } else if (Dungeon.skins == 5) { + + + + } else { (hero.belongings.weapon = new WoodenStaff()).identify(); (hero.belongings.armor = new ClothArmor()).identify(); diff --git a/java/com/hmdzl/spspd/actors/mobs/BambooMob.java b/java/com/hmdzl/spspd/actors/mobs/BambooMob.java new file mode 100644 index 00000000..efb1de08 --- /dev/null +++ b/java/com/hmdzl/spspd/actors/mobs/BambooMob.java @@ -0,0 +1,135 @@ +/* + * Pixel Dungeon + * Copyright (C) 2012-2014 Oleg Dolya + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + */ +package com.hmdzl.spspd.actors.mobs; + +import com.hmdzl.spspd.Badges; +import com.hmdzl.spspd.actors.Char; +import com.hmdzl.spspd.actors.blobs.PoisonGas; +import com.hmdzl.spspd.actors.blobs.ToxicGas; +import com.hmdzl.spspd.actors.buffs.Buff; +import com.hmdzl.spspd.actors.buffs.Burning; +import com.hmdzl.spspd.actors.buffs.DefenceUp; +import com.hmdzl.spspd.actors.buffs.Ooze; +import com.hmdzl.spspd.actors.buffs.Paralysis; +import com.hmdzl.spspd.actors.buffs.Poison; +import com.hmdzl.spspd.actors.buffs.Roots; +import com.hmdzl.spspd.items.food.vegetable.NutVegetable; +import com.hmdzl.spspd.items.wands.Wand; +import com.hmdzl.spspd.items.wands.WandOfFirebolt; +import com.hmdzl.spspd.items.weapon.enchantments.EnchantmentDark; +import com.hmdzl.spspd.items.weapon.enchantments.EnchantmentFire; +import com.hmdzl.spspd.sprites.ErrorSprite; +import com.hmdzl.spspd.sprites.MobBambooSprite; +import com.hmdzl.spspd.sprites.SeniorSprite; +import com.watabou.utils.Random; + +import java.util.HashSet; + +public class BambooMob extends Mob { + + { + + HP = HT = 40; + evadeSkill = 0; + + EXP = 1; + + loot = new NutVegetable(); + lootChance = 0.4f; + + spriteClass = MobBambooSprite.class; + + properties.add(Property.PLANT); + } + + @Override + public int damageRoll() { + return Random.NormalIntRange(4, 12); + } + + @Override + public int hitSkill( Char target ) { + return 15; + } + + @Override + public int drRoll() { + return Random.NormalIntRange(1, 3); + } + + @Override + public int attackProc(Char enemy, int damage) { + if (Random.Int(3) == 0) { + Buff.affect(this,DefenceUp.class,3f).level(20); + } + return super.attackProc(enemy, damage); + } + + @Override + public int defenseProc(Char enemy, int damage) { + + int dmg = Random.IntRange(0, damage); + if (dmg > 0) { + enemy.damage(dmg, this); + } + + return super.defenseProc(enemy, damage); + } + + @Override + protected boolean getCloser(int target) { + return true; + } + + @Override + protected boolean getFurther(int target) { + return true; + } + + private static final HashSet> IMMUNITIES = new HashSet<>(); + + + private static final HashSet> RESISTANCES = new HashSet>(); + private static final HashSet> WEAKNESS = new HashSet>(); + static { + WEAKNESS.add(ToxicGas.class); + WEAKNESS.add(Ooze.class); + WEAKNESS.add(PoisonGas.class); + + IMMUNITIES.add(Roots.class); + + WEAKNESS.add(Burning.class); + WEAKNESS.add(Wand.class); + WEAKNESS.add(EnchantmentFire.class); + WEAKNESS.add(Poison.class); + + } + @Override + public HashSet> immunities() { + return IMMUNITIES; + } + @Override + public HashSet> resistances() { + return RESISTANCES; + } + + @Override + public HashSet> weakness() { + return WEAKNESS; + } +} diff --git a/java/com/hmdzl/spspd/actors/mobs/Bat.java b/java/com/hmdzl/spspd/actors/mobs/Bat.java index 30801655..27c72d6d 100644 --- a/java/com/hmdzl/spspd/actors/mobs/Bat.java +++ b/java/com/hmdzl/spspd/actors/mobs/Bat.java @@ -21,6 +21,7 @@ import com.hmdzl.spspd.actors.Char; import com.hmdzl.spspd.effects.Speck; +import com.hmdzl.spspd.items.Generator; import com.hmdzl.spspd.items.Item; import com.hmdzl.spspd.items.food.meatfood.Meat; import com.hmdzl.spspd.items.potions.PotionOfMending; @@ -42,7 +43,7 @@ public class Bat extends Mob { flying = true; - loot = new PotionOfMending(); + loot = Generator.Category.SEED; lootChance = 0.1667f; // by default, see die() lootOther = new Meat(); diff --git a/java/com/hmdzl/spspd/actors/mobs/Bestiary.java b/java/com/hmdzl/spspd/actors/mobs/Bestiary.java index 01aed40c..04fcb18a 100644 --- a/java/com/hmdzl/spspd/actors/mobs/Bestiary.java +++ b/java/com/hmdzl/spspd/actors/mobs/Bestiary.java @@ -108,25 +108,25 @@ private static Class mobClass(int depth) { Thief.class, Gnoll.class,PatrolUAV.class}; break; case 7: - chances = new float[]{0.6f, 1, 1, 0.4f,0.2f}; + chances = new float[]{0.6f, 1, 1, 0.4f,0.2f,0.2f}; classes = new Class[]{Crab.class, Thief.class, Gnoll.class, - Guard.class, Zombie.class}; + Guard.class, Zombie.class,BambooMob.class}; break; case 8: - chances = new float[]{1, 1, 0.5f, 0.4f, 0.3f,0.7f,0.5f}; + chances = new float[]{1, 1, 0.5f, 0.4f, 0.3f,0.7f,0.5f,1f}; classes = new Class[]{Thief.class, Gnoll.class, - Guard.class, Assassin.class, TrollWarrior.class, Zombie.class,FireRabbit.class}; + Guard.class, Assassin.class, TrollWarrior.class, Zombie.class,FireRabbit.class,BambooMob.class}; break; case 9: if (Dungeon.sporkAvail) { - chances = new float[]{1, 1, 0.1f,1}; - classes = new Class[]{Assassin.class, TrollWarrior.class, BanditKing.class, Zombie.class}; + chances = new float[]{1, 1, 0.1f,1,0.5f}; + classes = new Class[]{Assassin.class, TrollWarrior.class, BanditKing.class, Zombie.class,BambooMob.class}; } else { - chances = new float[]{1, 1, 0.8f, 0.6f, 0.5f, 0.02f, 0.01f,1f,0.8f}; + chances = new float[]{1, 1, 0.8f, 0.6f, 0.5f, 0.02f, 0.01f,1f,0.8f ,1}; classes = new Class[]{Thief.class, Gnoll.class, Guard.class, Assassin.class, TrollWarrior.class, - Bat.class, Brute.class, Zombie.class,FireRabbit.class}; + Bat.class, Brute.class, Zombie.class,FireRabbit.class,BambooMob.class}; } break; diff --git a/java/com/hmdzl/spspd/actors/mobs/BrownBat.java b/java/com/hmdzl/spspd/actors/mobs/BrownBat.java index 4cbd94e5..070c10d2 100644 --- a/java/com/hmdzl/spspd/actors/mobs/BrownBat.java +++ b/java/com/hmdzl/spspd/actors/mobs/BrownBat.java @@ -43,7 +43,7 @@ public class BrownBat extends Mob { loot = new Meat(); lootChance = 0.5f; // by default, see die() - lootOther = Generator.Category.BERRY; + lootOther = Generator.Category.SEED; lootChanceOther = 0.05f; // by default, see die() properties.add(Property.BEAST); diff --git a/java/com/hmdzl/spspd/actors/mobs/Greatmoss.java b/java/com/hmdzl/spspd/actors/mobs/Greatmoss.java new file mode 100644 index 00000000..73327325 --- /dev/null +++ b/java/com/hmdzl/spspd/actors/mobs/Greatmoss.java @@ -0,0 +1,157 @@ +/* + * Pixel Dungeon + * Copyright (C) 2012-2014 Oleg Dolya + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + */ +package com.hmdzl.spspd.actors.mobs; + +import java.util.HashSet; + +import com.hmdzl.spspd.actors.blobs.Blob; +import com.hmdzl.spspd.actors.blobs.ConfusionGas; +import com.hmdzl.spspd.actors.blobs.DarkGas; +import com.hmdzl.spspd.actors.blobs.ParalyticGas; +import com.hmdzl.spspd.actors.blobs.TarGas; +import com.hmdzl.spspd.actors.blobs.ToxicGas; +import com.hmdzl.spspd.actors.buffs.Amok; +import com.hmdzl.spspd.actors.buffs.Silent; +import com.hmdzl.spspd.actors.buffs.Sleep; +import com.hmdzl.spspd.actors.buffs.Tar; +import com.hmdzl.spspd.actors.buffs.Terror; +import com.hmdzl.spspd.items.scrolls.ScrollOfRage; +import com.hmdzl.spspd.messages.Messages; +import com.hmdzl.spspd.Dungeon; +import com.hmdzl.spspd.ResultDescriptions; +import com.hmdzl.spspd.actors.Char; +import com.hmdzl.spspd.actors.buffs.Buff; +import com.hmdzl.spspd.actors.buffs.Weakness; +import com.hmdzl.spspd.items.Generator; +import com.hmdzl.spspd.items.Item; +import com.hmdzl.spspd.items.weapon.enchantments.EnchantmentDark; +import com.hmdzl.spspd.levels.Level; +import com.hmdzl.spspd.mechanics.Ballistica; +import com.hmdzl.spspd.scenes.GameScene; +import com.hmdzl.spspd.sprites.CharSprite; +import com.hmdzl.spspd.sprites.ErrorSprite; +import com.hmdzl.spspd.sprites.GreatMossSprite; +import com.hmdzl.spspd.sprites.WarlockSprite; + +import com.watabou.utils.Callback; +import com.watabou.utils.Random; + +public class Greatmoss extends Mob { + + { + spriteClass = GreatMossSprite.class; + + HP = HT = 120+(adj(0)*Random.NormalIntRange(5, 7)); + evadeSkill = adj(0); + + EXP = 11; + maxLvl = 30; + + loot = Generator.Category.SEED; + lootChance = 0.3f; + + state = PASSIVE; + properties.add(Property.PLANT); + } + + @Override + public boolean act() { + //GameScene.add(Blob.seed(pos, 30, TarGas.class)); + return super.act(); + } + + @Override + public int damageRoll() { + return Random.NormalIntRange(20+adj(0), 60+adj(1)); + } + + @Override + public int hitSkill(Char target) { + return 28+adj(1); + } + + @Override + protected float attackDelay() { + return 2f; + } + + @Override + public int drRoll() { + return Random.NormalIntRange(20, 25); + } + + + @Override + public int defenseProc(Char enemy, int damage) { + + switch (Random.Int (4)) { + case 0: + GameScene.add(Blob.seed(pos, 25, ToxicGas.class)); + break; + case 1: + GameScene.add(Blob.seed(pos, 25, ConfusionGas.class)); + break; + case 2: + GameScene.add(Blob.seed(pos, 25, ParalyticGas.class)); + break; + case 3: + GameScene.add(Blob.seed(pos, 25, DarkGas.class)); + break; + default: + break; + } + + return super.defenseProc(enemy, damage); + } + + @Override + public void beckon(int cell) { + // Do nothing + } + + + @Override + public void die(Object cause) { + + super.die(cause); + } + + private static final HashSet> RESISTANCES = new HashSet>(); + static { + } + + @Override + public HashSet> resistances() { + return RESISTANCES; + } + + private static final HashSet> IMMUNITIES = new HashSet>(); + static { + IMMUNITIES.add(Amok.class); + IMMUNITIES.add(Terror.class); + IMMUNITIES.add(Sleep.class); + IMMUNITIES.add(TarGas.class); + IMMUNITIES.add(Tar.class); + + } + + @Override + public HashSet> immunities() { + return IMMUNITIES; + } +} diff --git a/java/com/hmdzl/spspd/actors/mobs/LiveMoss.java b/java/com/hmdzl/spspd/actors/mobs/LiveMoss.java index 3b9b29b7..33b44118 100644 --- a/java/com/hmdzl/spspd/actors/mobs/LiveMoss.java +++ b/java/com/hmdzl/spspd/actors/mobs/LiveMoss.java @@ -39,7 +39,7 @@ public class LiveMoss extends Mob { maxLvl = 9; loot = Generator.random(Generator.Category.MUSHROOM); - lootChance = 0.2f; + lootChance = 0.1f; properties.add(Property.PLANT); } diff --git a/java/com/hmdzl/spspd/actors/mobs/MagicEye.java b/java/com/hmdzl/spspd/actors/mobs/MagicEye.java index b2e526ff..b99a9476 100644 --- a/java/com/hmdzl/spspd/actors/mobs/MagicEye.java +++ b/java/com/hmdzl/spspd/actors/mobs/MagicEye.java @@ -19,6 +19,7 @@ import java.util.HashSet; +import com.hmdzl.spspd.items.Generator; import com.hmdzl.spspd.messages.Messages; import com.hmdzl.spspd.Dungeon; import com.hmdzl.spspd.ResultDescriptions; @@ -57,8 +58,8 @@ public class MagicEye extends Mob { flying = true; - loot = new PotionOfMending(); - lootChance = 0.05f; + loot = Generator.Category.SEED; + lootChance = 0.1f; properties.add(Property.DEMONIC); properties.add(Property.ELEMENT); diff --git a/java/com/hmdzl/spspd/actors/mobs/Mob.java b/java/com/hmdzl/spspd/actors/mobs/Mob.java index d04da17a..951efbcf 100644 --- a/java/com/hmdzl/spspd/actors/mobs/Mob.java +++ b/java/com/hmdzl/spspd/actors/mobs/Mob.java @@ -56,6 +56,7 @@ import com.hmdzl.spspd.items.YellowDewdrop; import com.hmdzl.spspd.items.artifacts.TimekeepersHourglass; import com.hmdzl.spspd.items.misc.LuckyBadge; +import com.hmdzl.spspd.items.misc.PPC; import com.hmdzl.spspd.items.misc.Shovel; import com.hmdzl.spspd.items.rings.RingOfAccuracy; import com.hmdzl.spspd.levels.Level; @@ -685,8 +686,11 @@ public void die(Object cause) { } if (Dungeon.hero.heroClass == HeroClass.SOLDIER) bonus += 5; + if (Dungeon.hero.subClass == HeroSubClass.SUPERSTAR) { + bonus += 3; + } if (Dungeon.hero.buff(AflyBless.class)!=null) { - bonus += 5; + bonus += 3; } lootChance += 0.02*bonus; @@ -708,6 +712,9 @@ public void die(Object cause) { GLog.i(Messages.get(this, "died")); } + PPC ppc = Dungeon.hero.belongings.getItem(PPC.class); + if (ppc!=null) {ppc.charge++;} + if (Dungeon.isChallenged(Challenges.NIGHTMARE_VIRUS) && !(this instanceof Virus)) { ArrayList candidates = new ArrayList(); boolean[] passable = Level.passable; diff --git a/java/com/hmdzl/spspd/actors/mobs/SewerHeart.java b/java/com/hmdzl/spspd/actors/mobs/SewerHeart.java index 16c616b4..16f52ea4 100644 --- a/java/com/hmdzl/spspd/actors/mobs/SewerHeart.java +++ b/java/com/hmdzl/spspd/actors/mobs/SewerHeart.java @@ -72,7 +72,7 @@ public class SewerHeart extends Mob { loot = new Rotberry.Seed(); lootChance = 0.2f; - lootOther = Generator.Category.SEED; + lootOther = Generator.Category.BERRY; lootChanceOther = 1f; properties.add(Property.PLANT); diff --git a/java/com/hmdzl/spspd/actors/mobs/Swarm.java b/java/com/hmdzl/spspd/actors/mobs/Swarm.java index d3adb0d3..86331838 100644 --- a/java/com/hmdzl/spspd/actors/mobs/Swarm.java +++ b/java/com/hmdzl/spspd/actors/mobs/Swarm.java @@ -26,6 +26,7 @@ import com.hmdzl.spspd.actors.buffs.Burning; import com.hmdzl.spspd.actors.buffs.Poison; import com.hmdzl.spspd.effects.Pushing; +import com.hmdzl.spspd.items.Generator; import com.hmdzl.spspd.items.Item; import com.hmdzl.spspd.items.potions.PotionOfMending; import com.hmdzl.spspd.levels.Level; @@ -48,8 +49,8 @@ public class Swarm extends Mob { flying = true; - loot = new PotionOfMending(); - //loot = new PotionOfMending(); potential nerf + loot = Generator.Category.SEED; + lootChance = 0.1f; // by default, see die() properties.add(Property.BEAST); diff --git a/java/com/hmdzl/spspd/actors/mobs/UIcecorps.java b/java/com/hmdzl/spspd/actors/mobs/UIcecorps.java index f38e9fc8..ade54132 100644 --- a/java/com/hmdzl/spspd/actors/mobs/UIcecorps.java +++ b/java/com/hmdzl/spspd/actors/mobs/UIcecorps.java @@ -70,12 +70,9 @@ public class UIcecorps extends Mob { baseSpeed = 0.75f; HP = HT = 1500; - EXP = 20; + EXP = 0; evadeSkill = 5; - loot = new EasterEgg(); - lootChance = 1f; - properties.add(Property.ORC); properties.add(Property.BOSS); } @@ -111,7 +108,7 @@ public int drRoll() { @Override protected boolean canAttack(Char enemy) { return Dungeon.level.distance( pos, enemy.pos ) <= 2 ; - } + } @Override @@ -139,17 +136,7 @@ public void restoreFromBundle( Bundle bundle ) { @Override public boolean act() { - - if( HP < 100 ) { - if (breaks == 0) { - breaks++; - HP = HT; - - return false; - } - } - timeToIce++; if (timeToIce > 20){ spawnfires(); @@ -167,10 +154,6 @@ public void damage(int dmg, Object src) { dmg = 10; if (dmg > 40) dmg = Random.Int(10, 40); - if(HP-dmg<100 && breaks ==0){ - Buff.affect(this,BoxStar.class,10f); - Buff.affect(this,StoneIce.class).level(100); - } super.damage(dmg, src); } @@ -212,7 +195,7 @@ public void die(Object cause) { GameScene.bossSlain(); super.die(cause); - UYog.spawnAt(pos); + UIcecorps2.spawnAt(pos); } public static UIcecorps spawnAt(int pos) { diff --git a/java/com/hmdzl/spspd/change/actors/mobs/UIcecorps.java b/java/com/hmdzl/spspd/actors/mobs/UIcecorps2.java similarity index 56% rename from java/com/hmdzl/spspd/change/actors/mobs/UIcecorps.java rename to java/com/hmdzl/spspd/actors/mobs/UIcecorps2.java index 059d85db..4d4f52f5 100644 --- a/java/com/hmdzl/spspd/change/actors/mobs/UIcecorps.java +++ b/java/com/hmdzl/spspd/actors/mobs/UIcecorps2.java @@ -16,69 +16,82 @@ * along with this program. If not, see */ -package com.hmdzl.spspd.change.actors.mobs; +package com.hmdzl.spspd.actors.mobs; -import java.util.ArrayList; import java.util.HashSet; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.ResultDescriptions; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.Blob; -import com.hmdzl.spspd.change.actors.blobs.Fire; -import com.hmdzl.spspd.change.actors.blobs.ToxicGas; -import com.hmdzl.spspd.change.actors.buffs.Amok; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Burning; -import com.hmdzl.spspd.change.actors.buffs.Charm; -import com.hmdzl.spspd.change.actors.buffs.Ooze; -import com.hmdzl.spspd.change.actors.buffs.Poison; -import com.hmdzl.spspd.change.actors.buffs.Roots; -import com.hmdzl.spspd.change.actors.buffs.Sleep; -import com.hmdzl.spspd.change.actors.buffs.Terror; -import com.hmdzl.spspd.change.actors.buffs.Vertigo; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfPsionicBlast; -import com.hmdzl.spspd.change.items.weapon.enchantments.EnchantmentDark; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ErrorSprite; +import com.hmdzl.spspd.Dungeon; +import com.hmdzl.spspd.actors.Actor; +import com.hmdzl.spspd.actors.Char; +import com.hmdzl.spspd.actors.blobs.Blob; +import com.hmdzl.spspd.actors.blobs.ToxicGas; +import com.hmdzl.spspd.actors.buffs.Amok; +import com.hmdzl.spspd.actors.buffs.BoxStar; +import com.hmdzl.spspd.actors.buffs.Buff; +import com.hmdzl.spspd.actors.buffs.Burning; +import com.hmdzl.spspd.actors.buffs.Charm; +import com.hmdzl.spspd.actors.buffs.Chill; +import com.hmdzl.spspd.actors.buffs.Frost; +import com.hmdzl.spspd.actors.buffs.Poison; +import com.hmdzl.spspd.actors.buffs.Sleep; +import com.hmdzl.spspd.actors.buffs.StoneIce; +import com.hmdzl.spspd.actors.buffs.Terror; +import com.hmdzl.spspd.actors.buffs.Vertigo; +import com.hmdzl.spspd.effects.CellEmitter; +import com.hmdzl.spspd.effects.Speck; +import com.hmdzl.spspd.items.eggs.EasterEgg; +import com.hmdzl.spspd.items.scrolls.ScrollOfMagicMapping; +import com.hmdzl.spspd.items.scrolls.ScrollOfPsionicBlast; +import com.hmdzl.spspd.items.weapon.enchantments.EnchantmentDark; +import com.hmdzl.spspd.items.weapon.melee.special.Handcannon; +import com.hmdzl.spspd.levels.Level; +import com.hmdzl.spspd.levels.traps.SpearTrap; +import com.hmdzl.spspd.scenes.GameScene; +import com.hmdzl.spspd.sprites.ErrorSprite; +import com.hmdzl.spspd.sprites.IceRabbit2Sprite; +import com.hmdzl.spspd.sprites.IceRabbitSprite; import com.watabou.utils.Bundle; import com.watabou.utils.Random; -import com.hmdzl.spspd.change.actors.blobs.CorruptGas; -import com.hmdzl.spspd.change.actors.buffs.Bleeding; -import com.hmdzl.spspd.change.actors.buffs.Slow; -import com.hmdzl.spspd.change.actors.buffs.Paralysis; -import com.hmdzl.spspd.change.messages.Messages; +import com.hmdzl.spspd.actors.blobs.CorruptGas; +import com.hmdzl.spspd.actors.buffs.Bleeding; +import com.hmdzl.spspd.actors.buffs.Slow; +import com.hmdzl.spspd.actors.buffs.Paralysis; import com.watabou.noosa.Camera; import com.watabou.noosa.audio.Sample; -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.levels.Terrain; +import com.hmdzl.spspd.Assets; +import com.hmdzl.spspd.levels.Terrain; -public class UIcecorps extends Mob { +public class UIcecorps2 extends Mob { protected static final float SPAWN_DELAY = 2f; - private static final String TXT_UNKNOW = "??? I know nothing about it ???"; - { - spriteClass = ErrorSprite.class; - baseSpeed = 0.75f; + spriteClass = IceRabbit2Sprite.class; + baseSpeed = 1.5f; - HP = HT = 1000; + HP = HT = 1500; EXP = 20; evadeSkill = 5; - properties.add(Property.UNKNOW); + loot = new EasterEgg(); + lootChance = 1f; + + properties.add(Property.ORC); properties.add(Property.BOSS); } - private int breaks=0; - private static final int ICE_DELAY = 10; - private int timeToIce = ICE_DELAY; + private int breaks = 30; + private int timeToIce = 0; + + public void spawnfires() { + FireRabbit fr1 = new FireRabbit(); + + fr1.pos = Dungeon.level.randomRespawnCellMob(); + + GameScene.add(fr1); + + } @Override public int damageRoll() { @@ -96,13 +109,22 @@ public int drRoll() { } @Override - public float speed() { - if (breaks == 3) return 2*super.speed(); - else return super.speed(); - } + protected boolean canAttack(Char enemy) { + return Dungeon.level.distance( pos, enemy.pos ) <= 2 ; + } + - private static final String BREAKS = "breaks"; + @Override + public int attackProc(Char enemy, int damage) { + if (Random.Int(2) == 0) { + Buff.affect(enemy, StoneIce.class).level(3); + } + return damage; + } + + private static final String BREAKS = "breaks"; + @Override public void storeInBundle( Bundle bundle ) { super.storeInBundle(bundle); @@ -117,35 +139,30 @@ public void restoreFromBundle( Bundle bundle ) { @Override public boolean act() { - - if( 3 - breaks > 4 * HP / HT ) { - - breaks++; - timeToIce = 10 ; - return true; - } - if (breaks == 1){ - + if (breaks >1) { + Buff.prolong(this,BoxStar.class, 3f); + breaks--; } - if (breaks == 2){ - + timeToIce++; + if (timeToIce > 20){ + spawnfires(); + timeToIce=0; } - if (breaks > 0){ - - } return super.act(); } @Override public void damage(int dmg, Object src) { - if (timeToIce >0 ){dmg = Random.Int(0,1);} - dmg = Random.Int(10,20); - if (dmg > 15){ - GameScene.add(Blob.seed(pos, 30, CorruptGas.class)); - } + if (buff(BoxStar.class) != null && !(src instanceof StoneIce) ) + dmg = 0; + if (src instanceof StoneIce) + dmg = 10; + if (dmg > 40) + dmg = Random.Int(10, 40); + super.damage(dmg, src); } @@ -165,17 +182,19 @@ public void move(int step) { Sample.INSTANCE.play(Assets.SND_ROCKS); if (Level.water[cell]) { - GameScene.ripple(cell); + Dungeon.level.setTrap( new SpearTrap().reveal(), cell ); + Level.set(cell, Terrain.TRAP); + GameScene.updateMap(cell); + ScrollOfMagicMapping.discover(cell); } else if (Dungeon.level.map[cell] == Terrain.EMPTY) { - Level.set(cell, Terrain.EMPTY_DECO); + Level.set(cell, Terrain.WATER); GameScene.updateMap(cell); } } - timeToIce -- ; Char ch = Actor.findChar(cell); if (ch != null && ch != this) { Buff.prolong(ch, Slow.class, 5); - } + } } } @@ -187,10 +206,10 @@ public void die(Object cause) { UYog.spawnAt(pos); } - public static UIcecorps spawnAt(int pos) { + public static UIcecorps2 spawnAt(int pos) { if (Level.passable[pos] && Actor.findChar(pos) == null) { - UIcecorps w = new UIcecorps(); + UIcecorps2 w = new UIcecorps2(); w.pos = pos; w.state = w.HUNTING; GameScene.add(w, SPAWN_DELAY); @@ -215,6 +234,8 @@ public static UIcecorps spawnAt(int pos) { IMMUNITIES.add(Sleep.class); IMMUNITIES.add(Burning.class); IMMUNITIES.add(ToxicGas.class); + IMMUNITIES.add(Chill.class); + IMMUNITIES.add(Frost.class); IMMUNITIES.add(ScrollOfPsionicBlast.class); IMMUNITIES.add(Vertigo.class); IMMUNITIES.add(Paralysis.class); diff --git a/java/com/hmdzl/spspd/actors/mobs/YearBeast.java b/java/com/hmdzl/spspd/actors/mobs/YearBeast.java index 9c61b976..415330c7 100644 --- a/java/com/hmdzl/spspd/actors/mobs/YearBeast.java +++ b/java/com/hmdzl/spspd/actors/mobs/YearBeast.java @@ -50,6 +50,7 @@ import com.hmdzl.spspd.items.weapon.melee.FightGloves; import com.hmdzl.spspd.items.weapon.melee.Knuckles; import com.hmdzl.spspd.items.weapon.melee.special.FireCracker; +import com.hmdzl.spspd.items.weapon.missiles.MoneyPack; import com.hmdzl.spspd.levels.Level; import com.hmdzl.spspd.mechanics.Ballistica; import com.hmdzl.spspd.messages.Messages; @@ -177,7 +178,7 @@ public int defenseProc(Char enemy, int damage) { @Override public void damage(int dmg, Object src) { - if ( src instanceof FireCracker) { + if ( src instanceof FireCracker || src instanceof MoneyPack) { times=0; } diff --git a/java/com/hmdzl/spspd/actors/mobs/Zot.java b/java/com/hmdzl/spspd/actors/mobs/Zot.java index eb48b8b1..24b24681 100644 --- a/java/com/hmdzl/spspd/actors/mobs/Zot.java +++ b/java/com/hmdzl/spspd/actors/mobs/Zot.java @@ -83,7 +83,7 @@ public int damageRoll() { @Override public int hitSkill(Char target) { - return 200; + return 90; } @Override diff --git a/java/com/hmdzl/spspd/actors/mobs/ZotPhase.java b/java/com/hmdzl/spspd/actors/mobs/ZotPhase.java index 7d2a331f..74ba515e 100644 --- a/java/com/hmdzl/spspd/actors/mobs/ZotPhase.java +++ b/java/com/hmdzl/spspd/actors/mobs/ZotPhase.java @@ -58,7 +58,7 @@ public int damageRoll() { @Override public int hitSkill(Char target) { - return 100+adj(0); + return 50+adj(0); } @Override diff --git a/java/com/hmdzl/spspd/change/actors/mobs/npcs/AliveFish.java b/java/com/hmdzl/spspd/actors/mobs/npcs/BlackMeow.java similarity index 77% rename from java/com/hmdzl/spspd/change/actors/mobs/npcs/AliveFish.java rename to java/com/hmdzl/spspd/actors/mobs/npcs/BlackMeow.java index f7d4a2c6..c993332c 100644 --- a/java/com/hmdzl/spspd/change/actors/mobs/npcs/AliveFish.java +++ b/java/com/hmdzl/spspd/actors/mobs/npcs/BlackMeow.java @@ -15,22 +15,23 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see */ -package com.hmdzl.spspd.change.actors.mobs.npcs; +package com.hmdzl.spspd.actors.mobs.npcs; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.sprites.PiranhaSprite; -import com.hmdzl.spspd.change.messages.Messages; +import com.hmdzl.spspd.Dungeon; +import com.hmdzl.spspd.actors.Char; +import com.hmdzl.spspd.actors.buffs.Buff; +import com.hmdzl.spspd.sprites.BlackMeowSprite; +import com.hmdzl.spspd.sprites.CoconutSprite; +import com.hmdzl.spspd.messages.Messages; import com.watabou.utils.Random; -public class AliveFish extends NPC { +public class BlackMeow extends NPC { { - //name = Messages.get(this,"name"); - spriteClass = PiranhaSprite.class; + spriteClass = BlackMeowSprite.class; properties.add(Property.BEAST); + } @Override @@ -75,7 +76,7 @@ public boolean interact() { break; case 1: yell(Messages.get(this, "yell2")); - break; + break; } return true; } diff --git a/java/com/hmdzl/spspd/change/actors/mobs/npcs/Lery.java b/java/com/hmdzl/spspd/actors/mobs/npcs/CatSheep.java similarity index 77% rename from java/com/hmdzl/spspd/change/actors/mobs/npcs/Lery.java rename to java/com/hmdzl/spspd/actors/mobs/npcs/CatSheep.java index 27db51b9..6d57e3d3 100644 --- a/java/com/hmdzl/spspd/change/actors/mobs/npcs/Lery.java +++ b/java/com/hmdzl/spspd/actors/mobs/npcs/CatSheep.java @@ -15,22 +15,23 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see */ -package com.hmdzl.spspd.change.actors.mobs.npcs; +package com.hmdzl.spspd.actors.mobs.npcs; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.sprites.LerySprite; -import com.hmdzl.spspd.change.messages.Messages; +import com.hmdzl.spspd.Dungeon; +import com.hmdzl.spspd.actors.Char; +import com.hmdzl.spspd.actors.buffs.Buff; +import com.hmdzl.spspd.sprites.CatSheepSprite; +import com.hmdzl.spspd.sprites.CoconutSprite; +import com.hmdzl.spspd.messages.Messages; import com.watabou.utils.Random; -public class Lery extends NPC { +public class CatSheep extends NPC { { - //name = "Lery"; - spriteClass = LerySprite.class; - properties.add(Property.ELEMENT); + spriteClass = CatSheepSprite.class; + properties.add(Property.BEAST); + } @Override @@ -75,7 +76,7 @@ public boolean interact() { break; case 1: yell(Messages.get(this, "yell2")); - break; + break; } return true; } diff --git a/java/com/hmdzl/spspd/actors/mobs/npcs/HBB.java b/java/com/hmdzl/spspd/actors/mobs/npcs/HBB.java index b85f8fb1..e8611e3f 100644 --- a/java/com/hmdzl/spspd/actors/mobs/npcs/HBB.java +++ b/java/com/hmdzl/spspd/actors/mobs/npcs/HBB.java @@ -18,9 +18,11 @@ package com.hmdzl.spspd.actors.mobs.npcs; +import com.hmdzl.spspd.Badges; import com.hmdzl.spspd.Dungeon; import com.hmdzl.spspd.actors.Char; import com.hmdzl.spspd.actors.buffs.Buff; +import com.hmdzl.spspd.items.Flag; import com.hmdzl.spspd.sprites.HBBSprite; import com.hmdzl.spspd.messages.Messages; import com.watabou.utils.Random; @@ -70,7 +72,7 @@ public boolean reset() { public boolean interact() { sprite.turnTo(pos, Dungeon.hero.pos); - switch (Random.Int (3)) { + switch (Random.Int (4)) { case 0: yell(Messages.get(this, "yell1")); break; @@ -80,9 +82,10 @@ public boolean interact() { case 2: yell(Messages.get(this, "yell3")); break; - //case 3: - //Dungeon.level.drop(new Flag(), Dungeon.hero.pos).sprite.drop(); - //break; + case 3: + if (Badges.checkOtilukeRescued()) + Dungeon.level.drop(new Flag(), Dungeon.hero.pos).sprite.drop(); + break; } return false; } diff --git a/java/com/hmdzl/spspd/actors/mobs/npcs/Mtree.java b/java/com/hmdzl/spspd/actors/mobs/npcs/Mtree.java index 36836051..efd24f98 100644 --- a/java/com/hmdzl/spspd/actors/mobs/npcs/Mtree.java +++ b/java/com/hmdzl/spspd/actors/mobs/npcs/Mtree.java @@ -8,7 +8,8 @@ import com.hmdzl.spspd.actors.buffs.Poison; import com.hmdzl.spspd.actors.mobs.Mob; import com.hmdzl.spspd.levels.Level; - import com.hmdzl.spspd.sprites.PlantKingSprite; + import com.hmdzl.spspd.sprites.GreatMossSprite; + import com.hmdzl.spspd.sprites.PlantKingSprite; import com.watabou.utils.Random; import java.util.HashSet; @@ -17,7 +18,7 @@ public class Mtree extends NPC { { //name = "Mtree"; - spriteClass = PlantKingSprite.class; + spriteClass = GreatMossSprite.class; HP = 10; HT = 10; diff --git a/java/com/hmdzl/spspd/actors/mobs/npcs/NPC.java b/java/com/hmdzl/spspd/actors/mobs/npcs/NPC.java index 21c998fc..e8775443 100644 --- a/java/com/hmdzl/spspd/actors/mobs/npcs/NPC.java +++ b/java/com/hmdzl/spspd/actors/mobs/npcs/NPC.java @@ -50,4 +50,7 @@ public void beckon(int cell) { } abstract public boolean interact(); + + + } \ No newline at end of file diff --git a/java/com/hmdzl/spspd/actors/mobs/npcs/Ravenwolf.java b/java/com/hmdzl/spspd/actors/mobs/npcs/Ravenwolf.java index 24667e41..c2ea670d 100644 --- a/java/com/hmdzl/spspd/actors/mobs/npcs/Ravenwolf.java +++ b/java/com/hmdzl/spspd/actors/mobs/npcs/Ravenwolf.java @@ -31,7 +31,7 @@ public class Ravenwolf extends NPC { //name = "ravenwolf"; spriteClass = RavenwolfSprite.class; //state = WANDERING; - properties.add(Property.UNKNOW); + properties.add(Property.HUMAN); } /*@Override diff --git a/java/com/hmdzl/spspd/actors/mobs/pets/PET.java b/java/com/hmdzl/spspd/actors/mobs/pets/PET.java index b802337d..7fb49ede 100644 --- a/java/com/hmdzl/spspd/actors/mobs/pets/PET.java +++ b/java/com/hmdzl/spspd/actors/mobs/pets/PET.java @@ -25,6 +25,7 @@ import com.hmdzl.spspd.actors.Actor; import com.hmdzl.spspd.actors.Char; import com.hmdzl.spspd.actors.blobs.CorruptGas; +import com.hmdzl.spspd.actors.blobs.NmGas; import com.hmdzl.spspd.actors.blobs.ToxicGas; import com.hmdzl.spspd.actors.blobs.VenomGas; import com.hmdzl.spspd.actors.buffs.Buff; @@ -303,6 +304,7 @@ public boolean interact() { IMMUNITIES.add( Burning.class ); IMMUNITIES.add( ScrollOfPsionicBlast.class ); IMMUNITIES.add( CorruptGas.class ); + IMMUNITIES.add( NmGas.class ); } @Override diff --git a/java/com/hmdzl/spspd/change/Assets.java b/java/com/hmdzl/spspd/change/Assets.java deleted file mode 100644 index 082a61d9..00000000 --- a/java/com/hmdzl/spspd/change/Assets.java +++ /dev/null @@ -1,347 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change; - -public class Assets { - - public static final String ARCS_BG = "arcs1.png"; - public static final String ARCS_FG = "arcs2.png"; - public static final String DASHBOARD = "dashboard.png"; - - public static final String BANNERS = "banners.png"; - public static final String BADGES = "badges.png"; - public static final String AMULET = "amulet.png"; - public static final String PUDDING_CUP = "pudding_cup.png"; - - public static final String CHROME = "chrome.png"; - public static final String ICONS = "icons.png"; - public static final String STATUS = "status_pane.png"; - public static final String HP_BAR = "hp_bar.png"; - public static final String XP_BAR = "exp_bar.png"; - public static final String TOOLBAR = "toolbar.png"; - public static final String SHADOW = "shadow.png"; - - public static final String PIXELFONT = "pixel_font.png"; - public static final String FONT1X = "font1x(2).png"; - public static final String FONT2X = "font2x(2).png"; - - public static final String WARRIOR = "warrior.png"; - public static final String MAGE = "mage.png"; - public static final String ROGUE = "rogue.png"; - public static final String HUNTRESS = "ranger.png"; - public static final String PERFORMER = "performer.png"; - public static final String SOLDIER = "soldier.png"; - public static final String FOLLOWER = "follower.png"; - public static final String AVATARS = "avatars.png"; - public static final String PET = "pet.png"; - - public static final String SURFACE = "surface.png"; - - public static final String FIREBALL = "fireball.png"; - public static final String SPECKS = "specks.png"; - public static final String EFFECTS = "effects.png"; - - public static final String RAT = "rat.png"; - public static final String GNOLL = "gnoll.png"; - public static final String GNOLLARCHER = "gnollarcher.png"; - public static final String CRAB = "crab.png"; - public static final String GOO = "goo.png"; - public static final String POISONGOO = "poisongoo.png"; - public static final String SWARM = "swarm.png"; - public static final String SKELETON = "skeleton.png"; - public static final String MOSSYSKELETON = "mossyskeleton.png"; - public static final String SHAMAN = "shaman.png"; - public static final String THIEF = "thief.png"; - public static final String TENGU = "tengu.png"; - public static final String SHEEP = "sheep.png"; - public static final String SOKOBANSHEEP = "sokobansheep.png"; - public static final String KEEPER = "shopkeeper.png"; - public static final String BAT = "bat.png"; - public static final String BRUTE = "brute.png"; - public static final String SPINNER = "spinner.png"; - public static final String DM300 = "dm300.png"; - public static final String WRAITH = "wraith.png"; - public static final String BLUEWRAITH = "bluewraith.png"; - public static final String ELEMENTAL = "elemental.png"; - public static final String MONK = "monk.png"; - public static final String WARLOCK = "warlock.png"; - public static final String GOLEM = "golem.png"; - public static final String UNDEAD = "undead.png"; - public static final String KING = "king.png"; - public static final String STATUE = "statue.png"; - public static final String PIRANHA = "piranha.png"; - public static final String ALBINOPIRANHA = "albinopiranha.png"; - public static final String EYE = "eye.png"; - public static final String SUCCUBUS = "succubus.png"; - public static final String SCORPIO = "scorpio.png"; - public static final String ROTTING = "rotting_fist.png"; - public static final String BURNING = "burning_fist.png"; - public static final String PINNING = "pinning_fist.png"; - public static final String INFECTING = "infecting_fist.png"; - public static final String YOG = "yog.png"; - public static final String LARVA = "larva.png"; - public static final String GHOST = "ghost.png"; - public static final String MAKER = "wandmaker.png"; - public static final String TROLL = "blacksmith.png"; - public static final String IMP = "demon.png"; - public static final String RATKING = "ratking.png"; - public static final String BEE = "bee.png"; - public static final String MIMIC = "mimic.png"; - public static final String RATBOSS = "ratboss.png"; - public static final String ASSASSIN = "assassin.png"; - public static final String MONSTERBOX = "monsterbox.png"; - public static final String BROKENROBOT = "robot.png"; - public static final String TOWER = "tower.png"; - public static final String DWARFLICH = "dwarflich.png"; - public static final String DEMONGOO = "demongoo.png"; - public static final String BANDITKING = "banditking.png"; - public static final String DWARFKINGTOMB = "dwarfkingtomb.png"; - public static final String FLYINGPROTECTOR = "flyingprotector.png"; - public static final String SENTINEL = "sentinel.png"; - public static final String ONI = "oni.png"; - public static final String SHADOWYOG = "shadowyog.png"; - public static final String SPECTRALRAT = "shadowghost.png"; - public static final String REDWRAITH = "redwraith.png"; - public static final String GOLDTHIEF = "goldthief.png"; - public static final String MRDESTRUCTO = "mrdestructo.png"; - public static final String MRDESTRUCTO2 = "mrdestructo2.png"; - public static final String GREYONI = "greyoni.png"; - public static final String TINKERER1 = "tinkerer.png"; - public static final String DEWPROTECTOR = "dewprotector.png"; - public static final String ORBOFZOT = "orbofzot.png"; - public static final String SEEKINGBOMB = "seekingbomb.png"; - public static final String CRABKING = "crabking.png"; - public static final String HERMITCRAB = "hermitcrab.png"; - public static final String SHELL = "shell.png"; - public static final String GUARD = "guard.png"; - public static final String THIEFKING = "thiefking.png"; - public static final String SKELETONKING = "skeletonkingskull.png"; - public static final String SKELETONHAND1 = "skeletonhand1.png"; - public static final String SKELETONHAND2 = "skeletonhand2.png"; - public static final String PETDRAGON = "petreddragon.png"; - public static final String VELOCIROOSTER = "velocirooster.png"; - public static final String FAIRY = "fairy.png"; - public static final String BUNNY = "rabbit.png"; - public static final String OTILUKESTONE = "otilukestone.png"; - public static final String OTILUKE = "otiluke.png"; - public static final String ZOT = "zot.png"; - public static final String ZOTPHASE = "zotphase.png"; - public static final String MAGICEYE = "magiceye.png"; - public static final String DRAGON = "adultdragon.png"; - - public static final String ITEMS = "items.png"; - public static final String PLANTS = "plants.png"; - public static final String TRAPS = "traps.png"; - - public static final String TILES_SEWERS = "tiles0.png"; - public static final String TILES_PRISON = "tiles1.png"; - public static final String TILES_CAVES = "tiles2.png"; - public static final String TILES_CITY = "tiles3.png"; - public static final String TILES_HALLS = "tiles4.png"; - public static final String TILES_PUZZLE = "tiles5.png"; - public static final String TILES_SEAL = "tiles_magic_cave.png"; - public static final String TILES_BEACH = "tiles_beach.png"; - public static final String TILES_SKELETON = "tiles_skeleton.png"; - public static final String TILES_VAULT = "tiles_vault.png"; - public static final String TILES_FOREST = "tiles_forest.png"; - public static final String TILES_TOWN = "tiles_town.png"; - public static final String TILES_SP = "tiles_sp.png"; - - public static final String WATER_SEWERS = "water0.png"; - public static final String WATER_PRISON = "water1.png"; - public static final String WATER_CAVES = "water2.png"; - public static final String WATER_CITY = "water3.png"; - public static final String WATER_HALLS = "water4.png"; - - public static final String WEAK_FLOOR = "custom_tiles/weak_floor.png"; - - public static final String BUFFS_SMALL = "buffs.png"; - public static final String BUFFS_LARGE = "large_buffs.png"; - public static final String SPELL_ICONS = "spell_icons.png"; - public static final String CONS_ICONS = "consumable_icons.png"; - public static final String CONS_ICONS2 = "consumable_icons2.png"; - - public static final String FONTS1X = "font1x.png"; - public static final String FONTS15X = "font15x.png"; - public static final String FONTS2X = "font2x.png"; - public static final String FONTS25X = "font25x.png"; - public static final String FONTS3X = "font3x.png"; - - public static final String THEME = "theme.mp3"; - public static final String TUNE = "game.mp3"; - public static final String HAPPY = "surface.mp3"; - - public static final String SND_CLICK = "snd_click.mp3"; - public static final String SND_BADGE = "snd_badge.mp3"; - public static final String SND_GOLD = "snd_gold.mp3"; - - public static final String SND_OPEN = "snd_door_open.mp3"; - public static final String SND_UNLOCK = "snd_unlock.mp3"; - public static final String SND_ITEM = "snd_item.mp3"; - public static final String SND_DEWDROP = "snd_dewdrop.mp3"; - public static final String SND_HIT = "snd_hit.mp3"; - public static final String SND_MISS = "snd_miss.mp3"; - public static final String SND_STEP = "snd_step.mp3"; - public static final String SND_WATER = "snd_water.mp3"; - public static final String SND_DESCEND = "snd_descend.mp3"; - public static final String SND_EAT = "snd_eat.mp3"; - public static final String SND_READ = "snd_read.mp3"; - public static final String SND_LULLABY = "snd_lullaby.mp3"; - public static final String SND_DRINK = "snd_drink.mp3"; - public static final String SND_SHATTER = "snd_shatter.mp3"; - public static final String SND_ZAP = "snd_zap.mp3"; - public static final String SND_LIGHTNING = "snd_lightning.mp3"; - public static final String SND_LEVELUP = "snd_levelup.mp3"; - public static final String SND_DEATH = "snd_death.mp3"; - public static final String SND_CHALLENGE = "snd_challenge.mp3"; - public static final String SND_CURSED = "snd_cursed.mp3"; - public static final String SND_TRAP = "snd_trap.mp3"; - public static final String SND_EVOKE = "snd_evoke.mp3"; - public static final String SND_TOMB = "snd_tomb.mp3"; - public static final String SND_ALERT = "snd_alert.mp3"; - public static final String SND_MELD = "snd_meld.mp3"; - public static final String SND_BOSS = "snd_boss.mp3"; - public static final String SND_BLAST = "snd_blast.mp3"; - public static final String SND_PLANT = "snd_plant.mp3"; - public static final String SND_RAY = "snd_ray.mp3"; - public static final String SND_BEACON = "snd_beacon.mp3"; - public static final String SND_TELEPORT = "snd_teleport.mp3"; - public static final String SND_CHARMS = "snd_charms.mp3"; - public static final String SND_MASTERY = "snd_mastery.mp3"; - public static final String SND_PUFF = "snd_puff.mp3"; - public static final String SND_ROCKS = "snd_rocks.mp3"; - public static final String SND_BURNING = "snd_burning.mp3"; - public static final String SND_FALLING = "snd_falling.mp3"; - public static final String SND_GHOST = "snd_ghost.mp3"; - public static final String SND_SECRET = "snd_secret.mp3"; - public static final String SND_BONES = "snd_bones.mp3"; - public static final String SND_BEE = "snd_bee.mp3"; - public static final String SND_DEGRADE = "snd_degrade.mp3"; - public static final String SND_MIMIC = "snd_mimic.mp3"; - - public static final String GNOLLKING = "gnollking.png"; - public static final String DRAGONKING = "dragonking.png"; - public static final String UDAWOS = "udawos.png"; - public static final String TYPEDSCROLL = "typedscroll.png"; - public static final String G2159687 = "g2159687.png"; - public static final String CONSIDEREDHAMSTER = "consideredhamster.png"; - public static final String EVAN = "evan.png"; - public static final String NYRDS = "NYRDS.png"; - public static final String BILBOLDEV = "bilboldev.png"; - public static final String WATABOU = "watabou.png"; - public static final String HBB = "HBB.png"; - public static final String SFB = "SFB.png"; - public static final String HEXA = "HeXA.png"; - public static final String RUSTYBLADE = "rustyblade.png"; - public static final String JINKELOID = "jinkeloid.png"; - public static final String SP931 = "SP931.png"; - public static final String LYN = "Lyn.png"; - public static final String COCONUT = "coconut.png"; - public static final String LOCASTAN = "locastan.png"; - public static final String DACHHACK = "dachhack.png"; - public static final String TEMPEST102 = "tempest102.png"; - public static final String ERROR = "error.png"; - public static final String SAR = "stormandrain.png"; - public static final String MOS = "memoryofsand.png"; - public static final String HS = "hatesokoban.png"; - public static final String FRUITCAT = "fruitcat.png"; - public static final String LAJI = "laji.png"; - public static final String RAIN = "rain.png"; - public static final String LYNN = "lynn.png"; - public static final String JUH9870 = "juh9870.png"; - public static final String SADSALTAN ="sadsaltan.png"; - public static final String OLDNEWSTWIST = "oldnewstwist.png"; - - public static final String KLIKS = "kliks.png"; - public static final String SNAKE = "snakes.png"; - public static final String MUSKETEER ="musketeer.png"; - public static final String THIEFIMP = "thiefimp.png"; - public static final String LIVEMOSS = "livemoss.png"; - public static final String TROLLWARRIOR = "trollwarrior.png"; - - public static final String SCARECROW = "scarecrow.png"; - - public static final String UGOO = "ugoo.png"; - public static final String GENTLECRAB = "gentlecrab.png"; - - public static final String XAVIER = "xavier251998.png"; - public static final String REN = "ren.png"; - - public static final String SEWER_HEART = "sewer_heart.png"; - public static final String SEWER_LASHER = "sewer_lasher.png"; - - public static final String T_CLOUD = "tcloud.png"; - - public static final String PLAGUEDOCTOR = "plaguedoctor.png"; - - public static final String PRISONWANDER = "prisonwander.png"; - - public static final String SANDMOB = "sandmob.png"; - public static final String SPIDERBOT = "spiderbot.png"; - public static final String ZOMBIE = "zombie.png"; - public static final String TANK = "tank.png"; - public static final String SUFFERER = "sufferer.png"; - public static final String DEMONFLOWER = "demonflower.png"; - public static final String SPIDERQUEEN = "spider_queen.png"; - public static final String SPIDERWORKER = "spider_worker.png"; - public static final String SPIDERMIND = "spider_mind.png"; - public static final String SPIDEREGG = "spider_egg.png"; - - public static final String KOSTIS = "kostis12345.png"; - public static final String NOODLEMIRE = "noodlemire.png"; - public static final String RAVEBWOLF = "ravenwolf.png"; - public static final String HMDZL = "hmdzl001.png"; - public static final String NEW_PLAYER = "newplayer.png"; - public static final String THANK_LIST = "thanklist.png"; - - public static final String CELL_MOB = "cellmob.png"; - public static final String MOBILE = "mobile.png"; - public static final String HYBRID = "hybrid.png"; - - public static final String OBELISK = "obelisk.png"; - public static final String ELDER_AVATAR = "elderavatar.png"; - - public static final String M_AMD_W = "mandw.png"; - public static final String UNCLE_S = "sibaoluodeti.png"; - - public static final String GOBLIN_PLAYER = "goblinplayer.png"; - public static final String SAID_BY_SUN = "saidbysun.png"; - public static final String MILLILITRE = "millilitre.png"; - public static final String APOSTLE = "apostle.png"; - public static final String SHOWER = "shower.png"; - public static final String HONEY_POOOOT = "honeypoooot.png"; - public static final String XIXIZERO = "cat_lix.png"; - public static final String A_FLY = "npcalfred.png"; - public static final String PAINTER= "painter.png"; - public static final String DREAMPLAYER = "dreamplayer.png"; - public static final String PLANT_KING = "plantking.png"; - public static final String OMICRONRG9 = "omicronrg9.png"; - - - public static final String LICH_DANCER = "boss_lich.png"; - public static final String BATTERYTOMB = "batterytomb.png"; - - public static final String PATROLUAV = "patroluav.png"; - public static final String ICE13 = "ice13.png"; - - public static final String FIRERABBIT = "firerabbit.png"; - public static final String MANY_SKELETON = "manyskeleton.png"; - public static final String BEAST_YEAR = "beastyear.png"; - -} - diff --git a/java/com/hmdzl/spspd/change/Badges.java b/java/com/hmdzl/spspd/change/Badges.java deleted file mode 100644 index 662dc58e..00000000 --- a/java/com/hmdzl/spspd/change/Badges.java +++ /dev/null @@ -1,1082 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change; - -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; - -import android.content.Context; - -import com.hmdzl.spspd.change.actors.mobs.Acidic; -import com.hmdzl.spspd.change.actors.mobs.Albino; -import com.hmdzl.spspd.change.actors.mobs.Bandit; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.actors.mobs.Senior; -import com.hmdzl.spspd.change.actors.mobs.Shielded; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.artifacts.Artifact; -import com.hmdzl.spspd.change.items.bags.PotionBandolier; -import com.hmdzl.spspd.change.items.bags.ScrollHolder; -import com.hmdzl.spspd.change.items.bags.SeedPouch; -import com.hmdzl.spspd.change.items.bags.WandHolster; -import com.hmdzl.spspd.change.items.potions.Potion; -import com.hmdzl.spspd.change.items.rings.Ring; -import com.hmdzl.spspd.change.items.scrolls.Scroll; -import com.hmdzl.spspd.change.items.wands.Wand; -import com.hmdzl.spspd.change.scenes.PixelScene; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.Game; -import com.watabou.utils.Bundle; -import com.watabou.utils.Callback; -import com.hmdzl.spspd.change.messages.Messages; - -public class Badges { - - public /*static*/ enum Badge { - MONSTERS_SLAIN_1(0), - MONSTERS_SLAIN_2(1), - MONSTERS_SLAIN_3(2), - MONSTERS_SLAIN_4(3), - GOLD_COLLECTED_1(4), - GOLD_COLLECTED_2(5), - GOLD_COLLECTED_3(6), - GOLD_COLLECTED_4(7), - LEVEL_REACHED_1(8), - LEVEL_REACHED_2(9), - LEVEL_REACHED_3(10), - LEVEL_REACHED_4(11), - ALL_POTIONS_IDENTIFIED(16), - ALL_SCROLLS_IDENTIFIED(17), - ALL_RINGS_IDENTIFIED(18), - ALL_WANDS_IDENTIFIED(19), - ALL_ITEMS_IDENTIFIED(35, true), - BAG_BOUGHT_SEED_POUCH, BAG_BOUGHT_SCROLL_HOLDER, BAG_BOUGHT_POTION_BANDOLIER, BAG_BOUGHT_WAND_HOLSTER, ALL_BAGS_BOUGHT(23), - DEATH_FROM_FIRE(24), - DEATH_FROM_POISON(25), - DEATH_FROM_GAS(26), - DEATH_FROM_HUNGER(27), - DEATH_FROM_GLYPH(57), - DEATH_FROM_FALLING(59), - YASD(34, true), - BOSS_SLAIN_1_WARRIOR, BOSS_SLAIN_1_MAGE, BOSS_SLAIN_1_ROGUE, BOSS_SLAIN_1_HUNTRESS, BOSS_SLAIN_1_PERFORMER,BOSS_SLAIN_1_SOLDIER,BOSS_SLAIN_1_FOLLOWER, BOSS_SLAIN_1(12), - BOSS_SLAIN_2(13), - BOSS_SLAIN_3(14), - BOSS_SLAIN_4(15), - BOSS_SLAIN_1_ALL_CLASSES(32, true), - BOSS_SLAIN_3_GLADIATOR, BOSS_SLAIN_3_BERSERKER, BOSS_SLAIN_3_WARLOCK, BOSS_SLAIN_3_BATTLEMAGE, BOSS_SLAIN_3_FREERUNNER, BOSS_SLAIN_3_ASSASSIN, BOSS_SLAIN_3_SNIPER, BOSS_SLAIN_3_WARDEN,BOSS_SLAIN_3_SUPERSTAR,BOSS_SLAIN_3_JOKER, BOSS_SLAIN_3_ALL_SUBCLASSES(33, true), - RING_OF_HAGGLER(20), - RING_OF_THORNS(21), - STRENGTH_ATTAINED_1(40), - STRENGTH_ATTAINED_2(41), - STRENGTH_ATTAINED_3(42), - STRENGTH_ATTAINED_4(43), - FOOD_EATEN_1(44), - FOOD_EATEN_2(45), - FOOD_EATEN_3(46), - FOOD_EATEN_4(47), - MASTERY_WARRIOR, MASTERY_MAGE, MASTERY_ROGUE, MASTERY_HUNTRESS, MASTERY_PERFORMER, MASTERY_SOLDIER,MASTERY_FOLLOWER, - ITEM_LEVEL_1(48), - ITEM_LEVEL_2(49), - ITEM_LEVEL_3(50), - ITEM_LEVEL_4(51), - RARE_ALBINO, RARE_BANDIT, RARE_SHIELDED, RARE_SENIOR, RARE_ACIDIC, RARE(37, true), - VICTORY_WARRIOR, VICTORY_MAGE, VICTORY_ROGUE, VICTORY_HUNTRESS, VICTORY_PERFORMER, VICTORY_SOLDIER,VICTORY_FOLLOWER,VICTORY(22), - VICTORY_ALL_CLASSES(36, true), - MASTERY_COMBO(56), - POTIONS_COOKED_1(52), - POTIONS_COOKED_2(53), - POTIONS_COOKED_3(54), - POTIONS_COOKED_4(55), - NO_MONSTERS_SLAIN(28), - GRIM_WEAPON(29), - PIRANHAS(30), - NIGHT_HUNTER(58), - GAMES_PLAYED_1(60, true), - GAMES_PLAYED_2(61, true), - GAMES_PLAYED_3(62, true), - GAMES_PLAYED_4(63, true), - HAPPY_END(38), - CHAMPION(39, true), - SUPPORTER(31, true), - ORB(68), - OTILUKE(65), - TRI(66), - EGG_BREAK_1(69), - EGG_BREAK_2(70), - EGG_BREAK_3(71); - - public boolean meta; - - public int image; - - private Badge(int image) { - this(image, false); - } - - Badge( int image, boolean meta ) { - this.image = image; - this.meta = meta; - } - - public String desc(){ - return Messages.get(this, name()); - } - - Badge() { - this( -1 ); - } - - } - - private static HashSet global; - private static HashSet local = new HashSet(); - - private static boolean saveNeeded = false; - - public static Callback loadingListener = null; - - public static void reset() { - local.clear(); - loadGlobal(); - } - - private static final String BADGES_FILE = "badges.dat"; - private static final String BADGES = "badges"; - - private static HashSet restore(Bundle bundle) { - HashSet badges = new HashSet(); - - String[] names = bundle.getStringArray(BADGES); - for (int i = 0; i < names.length; i++) { - try { - badges.add(Badge.valueOf(names[i])); - } catch (Exception e) { - } - } - - return badges; - } - - private static void store(Bundle bundle, HashSet badges) { - int count = 0; - String names[] = new String[badges.size()]; - - for (Badge badge : badges) { - names[count++] = badge.toString(); - } - bundle.put(BADGES, names); - } - - public static void loadLocal(Bundle bundle) { - local = restore(bundle); - } - - public static void saveLocal(Bundle bundle) { - store(bundle, local); - } - - public static void loadGlobal() { - if (global == null) { - try { - InputStream input = Game.instance.openFileInput(BADGES_FILE); - Bundle bundle = Bundle.read(input); - input.close(); - - global = restore(bundle); - - } catch (Exception e) { - global = new HashSet(); - } - } - } - - public static void saveGlobal() { - if (saveNeeded) { - - Bundle bundle = new Bundle(); - store(bundle, global); - - try { - OutputStream output = Game.instance.openFileOutput(BADGES_FILE, - Game.MODE_PRIVATE); - Bundle.write(bundle, output); - output.close(); - saveNeeded = false; - } catch (IOException e) { - - } - } - } - - public static void validateMonstersSlain() { - Badge badge = null; - - if (!local.contains(Badge.MONSTERS_SLAIN_1) - && Statistics.enemiesSlain >= 10) { - badge = Badge.MONSTERS_SLAIN_1; - local.add(badge); - } - if (!local.contains(Badge.MONSTERS_SLAIN_2) - && Statistics.enemiesSlain >= 50) { - badge = Badge.MONSTERS_SLAIN_2; - local.add(badge); - } - if (!local.contains(Badge.MONSTERS_SLAIN_3) - && Statistics.enemiesSlain >= 150) { - badge = Badge.MONSTERS_SLAIN_3; - local.add(badge); - } - if (!local.contains(Badge.MONSTERS_SLAIN_4) - && Statistics.enemiesSlain >= 250) { - badge = Badge.MONSTERS_SLAIN_4; - local.add(badge); - } - - displayBadge(badge); - } - - public static void validateGoldCollected() { - Badge badge = null; - - if (!local.contains(Badge.GOLD_COLLECTED_1) - && Statistics.goldCollected >= 100) { - badge = Badge.GOLD_COLLECTED_1; - local.add(badge); - } - if (!local.contains(Badge.GOLD_COLLECTED_2) - && Statistics.goldCollected >= 500) { - badge = Badge.GOLD_COLLECTED_2; - local.add(badge); - } - if (!local.contains(Badge.GOLD_COLLECTED_3) - && Statistics.goldCollected >= 2500) { - badge = Badge.GOLD_COLLECTED_3; - local.add(badge); - } - if (!local.contains(Badge.GOLD_COLLECTED_4) - && Statistics.goldCollected >= 7500) { - badge = Badge.GOLD_COLLECTED_4; - local.add(badge); - } - - displayBadge(badge); - } - - public static void validateLevelReached() { - Badge badge = null; - - if (!local.contains(Badge.LEVEL_REACHED_1) && Dungeon.hero.lvl >= 10) { - badge = Badge.LEVEL_REACHED_1; - local.add(badge); - } - if (!local.contains(Badge.LEVEL_REACHED_2) && Dungeon.hero.lvl >= 20) { - badge = Badge.LEVEL_REACHED_2; - local.add(badge); - } - if (!local.contains(Badge.LEVEL_REACHED_3) && Dungeon.hero.lvl >= 30) { - badge = Badge.LEVEL_REACHED_3; - local.add(badge); - } - if (!local.contains(Badge.LEVEL_REACHED_4) && Dungeon.hero.lvl >= 40) { - badge = Badge.LEVEL_REACHED_4; - local.add(badge); - } - - displayBadge(badge); - } - - public static void validateStrengthAttained() { - Badge badge = null; - - if (!local.contains(Badge.STRENGTH_ATTAINED_1) - && Dungeon.hero.STR >= 13) { - badge = Badge.STRENGTH_ATTAINED_1; - local.add(badge); - } - if (!local.contains(Badge.STRENGTH_ATTAINED_2) - && Dungeon.hero.STR >= 15) { - badge = Badge.STRENGTH_ATTAINED_2; - local.add(badge); - } - if (!local.contains(Badge.STRENGTH_ATTAINED_3) - && Dungeon.hero.STR >= 17) { - badge = Badge.STRENGTH_ATTAINED_3; - local.add(badge); - } - if (!local.contains(Badge.STRENGTH_ATTAINED_4) - && Dungeon.hero.STR >= 19) { - badge = Badge.STRENGTH_ATTAINED_4; - local.add(badge); - } - - displayBadge(badge); - } - - public static void validateFoodEaten() { - Badge badge = null; - - if (!local.contains(Badge.FOOD_EATEN_1) && Statistics.foodEaten >= 10) { - badge = Badge.FOOD_EATEN_1; - local.add(badge); - } - if (!local.contains(Badge.FOOD_EATEN_2) && Statistics.foodEaten >= 20) { - badge = Badge.FOOD_EATEN_2; - local.add(badge); - } - if (!local.contains(Badge.FOOD_EATEN_3) && Statistics.foodEaten >= 30) { - badge = Badge.FOOD_EATEN_3; - local.add(badge); - } - if (!local.contains(Badge.FOOD_EATEN_4) && Statistics.foodEaten >= 40) { - badge = Badge.FOOD_EATEN_4; - local.add(badge); - } - - displayBadge(badge); - } - - public static void validateEggBreak() { - Badge badge = null; - - if (!local.contains(Badge.EGG_BREAK_1) && Statistics.eggBreak >= 1) { - badge = Badge.EGG_BREAK_1; - local.add(badge); - } - if (!local.contains(Badge.EGG_BREAK_2) && Statistics.eggBreak >= 2) { - badge = Badge.EGG_BREAK_2; - local.add(badge); - } - if (!local.contains(Badge.EGG_BREAK_3) && Statistics.eggBreak >= 5) { - badge = Badge.EGG_BREAK_3; - local.add(badge); - } - - displayBadge(badge); - - } - - public static void validatePotionsCooked() { - Badge badge = null; - - if (!local.contains(Badge.POTIONS_COOKED_1) - && Statistics.potionsCooked >= 3) { - badge = Badge.POTIONS_COOKED_1; - local.add(badge); - } - if (!local.contains(Badge.POTIONS_COOKED_2) - && Statistics.potionsCooked >= 6) { - badge = Badge.POTIONS_COOKED_2; - local.add(badge); - } - if (!local.contains(Badge.POTIONS_COOKED_3) - && Statistics.potionsCooked >= 9) { - badge = Badge.POTIONS_COOKED_3; - local.add(badge); - } - if (!local.contains(Badge.POTIONS_COOKED_4) - && Statistics.potionsCooked >= 12) { - badge = Badge.POTIONS_COOKED_4; - local.add(badge); - } - - displayBadge(badge); - } - - public static void validatePiranhasKilled() { - Badge badge = null; - - if (!local.contains(Badge.PIRANHAS) && Statistics.piranhasKilled >= 6) { - badge = Badge.PIRANHAS; - local.add(badge); - } - - displayBadge(badge); - } - - public static void validateItemLevelAquired(Item item) { - - // This method should be called: - // 1) When an item is obtained (Item.collect) - // 2) When an item is upgraded (ScrollOfUpgrade, ScrollOfWeaponUpgrade, - // ShortSword, WandOfMagicMissile) - // 3) When an item is identified - - // Note that artifacts should never trigger this badge as they are - // alternatively upgraded - if (!item.levelKnown || item instanceof Artifact) { - return; - } - - Badge badge = null; - if (!local.contains(Badge.ITEM_LEVEL_1) && item.level >= 3) { - badge = Badge.ITEM_LEVEL_1; - local.add(badge); - } - if (!local.contains(Badge.ITEM_LEVEL_2) && item.level >= 6) { - badge = Badge.ITEM_LEVEL_2; - local.add(badge); - } - if (!local.contains(Badge.ITEM_LEVEL_3) && item.level >= 9) { - badge = Badge.ITEM_LEVEL_3; - local.add(badge); - } - if (!local.contains(Badge.ITEM_LEVEL_4) && item.level >= 12) { - badge = Badge.ITEM_LEVEL_4; - local.add(badge); - } - - displayBadge(badge); - } - - public static void validateAllPotionsIdentified() { - if (Dungeon.hero != null && Dungeon.hero.isAlive() - && !local.contains(Badge.ALL_POTIONS_IDENTIFIED) - && Potion.allKnown()) { - - Badge badge = Badge.ALL_POTIONS_IDENTIFIED; - local.add(badge); - displayBadge(badge); - - validateAllItemsIdentified(); - } - } - - public static void validateAllScrollsIdentified() { - if (Dungeon.hero != null && Dungeon.hero.isAlive() - && !local.contains(Badge.ALL_SCROLLS_IDENTIFIED) - && Scroll.allKnown()) { - - Badge badge = Badge.ALL_SCROLLS_IDENTIFIED; - local.add(badge); - displayBadge(badge); - - validateAllItemsIdentified(); - } - } - - public static void validateAllRingsIdentified() { - if (Dungeon.hero != null && Dungeon.hero.isAlive() - && !local.contains(Badge.ALL_RINGS_IDENTIFIED) - && Ring.allKnown()) { - - Badge badge = Badge.ALL_RINGS_IDENTIFIED; - local.add(badge); - displayBadge(badge); - - validateAllItemsIdentified(); - } - } - - public static void validateAllWandsIdentified() { - if (Dungeon.hero != null && Dungeon.hero.isAlive() - && !local.contains(Badge.ALL_WANDS_IDENTIFIED) - ) { - - Badge badge = Badge.ALL_WANDS_IDENTIFIED; - local.add(badge); - displayBadge(badge); - - validateAllItemsIdentified(); - } - } - - public static void validateAllBagsBought(Item bag) { - - Badge badge = null; - if (bag instanceof SeedPouch) { - badge = Badge.BAG_BOUGHT_SEED_POUCH; - } else if (bag instanceof ScrollHolder) { - badge = Badge.BAG_BOUGHT_SCROLL_HOLDER; - } else if (bag instanceof PotionBandolier) { - badge = Badge.BAG_BOUGHT_POTION_BANDOLIER; - } else if (bag instanceof WandHolster) { - badge = Badge.BAG_BOUGHT_WAND_HOLSTER; - } - - if (badge != null) { - - local.add(badge); - - if (!local.contains(Badge.ALL_BAGS_BOUGHT) - && local.contains(Badge.BAG_BOUGHT_SEED_POUCH) - && local.contains(Badge.BAG_BOUGHT_SCROLL_HOLDER) - && local.contains(Badge.BAG_BOUGHT_POTION_BANDOLIER) - && local.contains(Badge.BAG_BOUGHT_WAND_HOLSTER)) { - - badge = Badge.ALL_BAGS_BOUGHT; - local.add(badge); - displayBadge(badge); - } - } - } - - public static void validateAllItemsIdentified() { - if (!global.contains(Badge.ALL_ITEMS_IDENTIFIED) - && global.contains(Badge.ALL_POTIONS_IDENTIFIED) - && global.contains(Badge.ALL_SCROLLS_IDENTIFIED) - && global.contains(Badge.ALL_RINGS_IDENTIFIED) - && global.contains(Badge.ALL_WANDS_IDENTIFIED)) { - - Badge badge = Badge.ALL_ITEMS_IDENTIFIED; - displayBadge(badge); - } - } - - public static void validateDeathFromFire() { - Badge badge = Badge.DEATH_FROM_FIRE; - local.add(badge); - displayBadge(badge); - - validateYASD(); - } - - public static void validateDeathFromPoison() { - Badge badge = Badge.DEATH_FROM_POISON; - local.add(badge); - displayBadge(badge); - - validateYASD(); - } - - public static void validateDeathFromGas() { - Badge badge = Badge.DEATH_FROM_GAS; - local.add(badge); - displayBadge(badge); - - validateYASD(); - } - - public static void validateDeathFromHunger() { - Badge badge = Badge.DEATH_FROM_HUNGER; - local.add(badge); - displayBadge(badge); - - validateYASD(); - } - - public static void validateDeathFromGlyph() { - Badge badge = Badge.DEATH_FROM_GLYPH; - local.add(badge); - displayBadge(badge); - } - - public static void validateDeathFromFalling() { - Badge badge = Badge.DEATH_FROM_FALLING; - local.add(badge); - displayBadge(badge); - } - - private static void validateYASD() { - if (global.contains(Badge.DEATH_FROM_FIRE) - && global.contains(Badge.DEATH_FROM_POISON) - && global.contains(Badge.DEATH_FROM_GAS) - && global.contains(Badge.DEATH_FROM_HUNGER)) { - - Badge badge = Badge.YASD; - local.add(badge); - displayBadge(badge); - } - } - - public static void validateBossSlain() { - Badge badge = null; - switch (Dungeon.depth) { - case 5: - badge = Badge.BOSS_SLAIN_1; - break; - case 10: - badge = Badge.BOSS_SLAIN_2; - break; - case 15: - badge = Badge.BOSS_SLAIN_3; - break; - case 20: - badge = Badge.BOSS_SLAIN_4; - break; - } - - if (badge != null) { - local.add(badge); - displayBadge(badge); - - if (badge == Badge.BOSS_SLAIN_1) { - switch (Dungeon.hero.heroClass) { - case WARRIOR: - badge = Badge.BOSS_SLAIN_1_WARRIOR; - break; - case MAGE: - badge = Badge.BOSS_SLAIN_1_MAGE; - break; - case ROGUE: - badge = Badge.BOSS_SLAIN_1_ROGUE; - break; - case HUNTRESS: - badge = Badge.BOSS_SLAIN_1_HUNTRESS; - break; - case PERFORMER: - badge = Badge.BOSS_SLAIN_1_PERFORMER; - break; - case SOLDIER: - badge = Badge.BOSS_SLAIN_1_SOLDIER; - break; - case FOLLOWER: - badge = Badge.BOSS_SLAIN_1_FOLLOWER; - break; - } - local.add(badge); - if (!global.contains(badge)) { - global.add(badge); - saveNeeded = true; - } - - if (global.contains(Badge.BOSS_SLAIN_1_WARRIOR) - && global.contains(Badge.BOSS_SLAIN_1_MAGE) - && global.contains(Badge.BOSS_SLAIN_1_ROGUE) - && global.contains(Badge.BOSS_SLAIN_1_HUNTRESS)) { - - badge = Badge.BOSS_SLAIN_1_ALL_CLASSES; - if (!global.contains(badge)) { - displayBadge(badge); - global.add(badge); - saveNeeded = true; - } - } - } else if (badge == Badge.BOSS_SLAIN_3) { - switch (Dungeon.hero.subClass) { - case GLADIATOR: - badge = Badge.BOSS_SLAIN_3_GLADIATOR; - break; - case BERSERKER: - badge = Badge.BOSS_SLAIN_3_BERSERKER; - break; - case WARLOCK: - badge = Badge.BOSS_SLAIN_3_WARLOCK; - break; - case BATTLEMAGE: - badge = Badge.BOSS_SLAIN_3_BATTLEMAGE; - break; - case FREERUNNER: - badge = Badge.BOSS_SLAIN_3_FREERUNNER; - break; - case ASSASSIN: - badge = Badge.BOSS_SLAIN_3_ASSASSIN; - break; - case SNIPER: - badge = Badge.BOSS_SLAIN_3_SNIPER; - break; - case WARDEN: - badge = Badge.BOSS_SLAIN_3_WARDEN; - break; - case SUPERSTAR: - badge = Badge.BOSS_SLAIN_3_SUPERSTAR; - break; - case JOKER: - badge = Badge.BOSS_SLAIN_3_JOKER; - break; - default: - return; - } - local.add(badge); - if (!global.contains(badge)) { - global.add(badge); - saveNeeded = true; - } - - if (global.contains(Badge.BOSS_SLAIN_3_GLADIATOR) - && global.contains(Badge.BOSS_SLAIN_3_BERSERKER) - && global.contains(Badge.BOSS_SLAIN_3_WARLOCK) - && global.contains(Badge.BOSS_SLAIN_3_BATTLEMAGE) - && global.contains(Badge.BOSS_SLAIN_3_FREERUNNER) - && global.contains(Badge.BOSS_SLAIN_3_ASSASSIN) - && global.contains(Badge.BOSS_SLAIN_3_SNIPER) - && global.contains(Badge.BOSS_SLAIN_3_WARDEN) - && global.contains(Badge.BOSS_SLAIN_3_SUPERSTAR) - && global.contains(Badge.BOSS_SLAIN_3_JOKER)) { - - badge = Badge.BOSS_SLAIN_3_ALL_SUBCLASSES; - if (!global.contains(badge)) { - displayBadge(badge); - global.add(badge); - saveNeeded = true; - } - } - } - } - } - - public static void validateOrbObtained() { - Badge badge = Badge.ORB; - local.add(badge); - displayBadge(badge); - if (!global.contains(Badge.ORB)) { - global.add(badge); - } - } - - public static boolean checkOrbObtained() { - return global.contains(Badge.ORB); - } - - - - public static boolean checkOtilukeRescued() { - return local.contains(Badge.OTILUKE); - } - - public static boolean checkCoconutRescued() { - return local.contains(Badge.MONSTERS_SLAIN_4); - } - - public static boolean checkSARRescued() { - return local.contains(Badge.ALL_RINGS_IDENTIFIED); - } - - public static boolean checkMOSRescued() { - return local.contains(Badge.FOOD_EATEN_4); - } - - public static boolean checkItemRescued() { - return local.contains(Badge.ITEM_LEVEL_4); - } - - public static boolean checkFishRescued() { - return local.contains(Badge.BOSS_SLAIN_3); - } - - public static boolean checkEggRescued() { - return local.contains(Badge.EGG_BREAK_3); - } - - public static boolean checkTombRescued() { - return local.contains(Badge.BOSS_SLAIN_4); - } - - public static boolean checkRainRescued() { - return local.contains(Badge.LEVEL_REACHED_4); - } - - public static boolean checkUncleRescued() { - return local.contains(Badge.POTIONS_COOKED_1); - } - - public static void validateMastery() { - - Badge badge = null; - switch (Dungeon.hero.heroClass) { - case WARRIOR: - badge = Badge.MASTERY_WARRIOR; - break; - case MAGE: - badge = Badge.MASTERY_MAGE; - break; - case ROGUE: - badge = Badge.MASTERY_ROGUE; - break; - case HUNTRESS: - badge = Badge.MASTERY_HUNTRESS; - break; - case PERFORMER: - badge = Badge.MASTERY_PERFORMER; - break; - case SOLDIER: - badge = Badge.MASTERY_SOLDIER; - break; - case FOLLOWER: - badge = Badge.MASTERY_FOLLOWER; - break; - } - - if (!global.contains(badge)) { - global.add(badge); - saveNeeded = true; - } - } - - public static void validateMasteryCombo(int n) { - if (!local.contains(Badge.MASTERY_COMBO) && n == 7) { - Badge badge = Badge.MASTERY_COMBO; - local.add(badge); - displayBadge(badge); - } - } - - // TODO: Replace this badge, delayed until an eventual badge rework - public static void validateRingOfHaggler() { - if (!local.contains(Badge.RING_OF_HAGGLER)/* - * && new - * RingOfThorns().isKnown() - */) { - Badge badge = Badge.RING_OF_HAGGLER; - local.add(badge); - displayBadge(badge); - } - } - - // TODO: Replace this badge, delayed until an eventual badge rework - public static void validateRingOfThorns() { - if (!local.contains(Badge.RING_OF_THORNS)/* - * && new - * RingOfThorns().isKnown() - */) { - Badge badge = Badge.RING_OF_THORNS; - local.add(badge); - displayBadge(badge); - } - } - - public static void validateRare(Mob mob) { - - Badge badge = null; - if (mob instanceof Albino) { - badge = Badge.RARE_ALBINO; - } else if (mob instanceof Bandit) { - badge = Badge.RARE_BANDIT; - } else if (mob instanceof Shielded) { - badge = Badge.RARE_SHIELDED; - } else if (mob instanceof Senior) { - badge = Badge.RARE_SENIOR; - } else if (mob instanceof Acidic) { - badge = Badge.RARE_ACIDIC; - } - if (!global.contains(badge)) { - global.add(badge); - saveNeeded = true; - } - - if (global.contains(Badge.RARE_ALBINO) - && global.contains(Badge.RARE_BANDIT) - && global.contains(Badge.RARE_SHIELDED) - && global.contains(Badge.RARE_SENIOR) - && global.contains(Badge.RARE_ACIDIC)) { - - badge = Badge.RARE; - displayBadge(badge); - } - } - - public static void validateVictory() { - - Badge badge = Badge.VICTORY; - displayBadge(badge); - - switch (Dungeon.hero.heroClass) { - case WARRIOR: - badge = Badge.VICTORY_WARRIOR; - break; - case MAGE: - badge = Badge.VICTORY_MAGE; - break; - case ROGUE: - badge = Badge.VICTORY_ROGUE; - break; - case HUNTRESS: - badge = Badge.VICTORY_HUNTRESS; - break; - case PERFORMER: - badge = Badge.VICTORY_PERFORMER; - break; - } - local.add(badge); - if (!global.contains(badge)) { - global.add(badge); - saveNeeded = true; - } - - if (global.contains(Badge.VICTORY_WARRIOR) - && global.contains(Badge.VICTORY_MAGE) - && global.contains(Badge.VICTORY_ROGUE) - && global.contains(Badge.VICTORY_HUNTRESS) - && global.contains(Badge.VICTORY_PERFORMER) - && global.contains(Badge.VICTORY_SOLDIER) - && global.contains(Badge.VICTORY_FOLLOWER)) { - - badge = Badge.VICTORY_ALL_CLASSES; - displayBadge(badge); - } - } - - public static void validateNoKilling() { - if (!local.contains(Badge.NO_MONSTERS_SLAIN) - && Statistics.completedWithNoKilling) { - Badge badge = Badge.NO_MONSTERS_SLAIN; - local.add(badge); - displayBadge(badge); - } - } - - public static void validateGrimWeapon() { - if (!local.contains(Badge.GRIM_WEAPON)) { - Badge badge = Badge.GRIM_WEAPON; - local.add(badge); - displayBadge(badge); - } - } - - public static void validateOtilukeRescued() { - if (!local.contains(Badge.OTILUKE)) { - Badge badge = Badge.OTILUKE; - local.add(badge); - displayBadge(badge); - } - } - - public static void validateNightHunter() { - if (!local.contains(Badge.NIGHT_HUNTER) && Statistics.nightHunt >= 15) { - Badge badge = Badge.NIGHT_HUNTER; - local.add(badge); - displayBadge(badge); - } - } - - public static void validateSupporter() { - - global.add(Badge.SUPPORTER); - saveNeeded = true; - - PixelScene.showBadge(Badge.SUPPORTER); - } - - public static void validateGamesPlayed() { - Badge badge = null; - if (Rankings.INSTANCE.totalNumber >= 10) { - badge = Badge.GAMES_PLAYED_1; - } - if (Rankings.INSTANCE.totalNumber >= 100) { - badge = Badge.GAMES_PLAYED_2; - } - if (Rankings.INSTANCE.totalNumber >= 500) { - badge = Badge.GAMES_PLAYED_3; - } - if (Rankings.INSTANCE.totalNumber >= 2000) { - badge = Badge.GAMES_PLAYED_4; - } - - displayBadge(badge); - } - - public static void validateHappyEnd() { - displayBadge(Badge.HAPPY_END); - } - - public static void validateChampion() { - displayBadge(Badge.CHAMPION); - } - - private static void displayBadge(Badge badge) { - - if (badge == null) { - return; - } - - if (global.contains(badge)) { - - if (!badge.meta) { - GLog.h(Messages.get(Badges.class, "endorsed", badge.desc())); - } - - } else { - - global.add(badge); - saveNeeded = true; - - if (badge.meta) { - GLog.h( Messages.get(Badges.class, "new_super", badge.desc()) ); - } else { - GLog.h( Messages.get(Badges.class, "new", badge.desc()) ); - } - PixelScene.showBadge( badge ); - } - } - - public static boolean isUnlocked(Badge badge) { - return global.contains(badge); - } - - public static void disown(Badge badge) { - loadGlobal(); - global.remove(badge); - saveNeeded = true; - } - - public static List filtered(boolean global) { - - HashSet filtered = new HashSet(global ? Badges.global - : Badges.local); - - if (!global) { - Iterator iterator = filtered.iterator(); - while (iterator.hasNext()) { - Badge badge = iterator.next(); - if (badge.meta) { - iterator.remove(); - } - } - } - - leaveBest(filtered, Badge.MONSTERS_SLAIN_1, Badge.MONSTERS_SLAIN_2, - Badge.MONSTERS_SLAIN_3, Badge.MONSTERS_SLAIN_4); - leaveBest(filtered, Badge.GOLD_COLLECTED_1, Badge.GOLD_COLLECTED_2, - Badge.GOLD_COLLECTED_3, Badge.GOLD_COLLECTED_4); - leaveBest(filtered, Badge.BOSS_SLAIN_1, Badge.BOSS_SLAIN_2, - Badge.BOSS_SLAIN_3, Badge.BOSS_SLAIN_4); - leaveBest(filtered, Badge.LEVEL_REACHED_1, Badge.LEVEL_REACHED_2, - Badge.LEVEL_REACHED_3, Badge.LEVEL_REACHED_4); - leaveBest(filtered, Badge.STRENGTH_ATTAINED_1, - Badge.STRENGTH_ATTAINED_2, Badge.STRENGTH_ATTAINED_3, - Badge.STRENGTH_ATTAINED_4); - leaveBest(filtered, Badge.FOOD_EATEN_1, Badge.FOOD_EATEN_2, - Badge.FOOD_EATEN_3, Badge.FOOD_EATEN_4); - leaveBest(filtered, Badge.EGG_BREAK_1, Badge.EGG_BREAK_2, - Badge.EGG_BREAK_3); - leaveBest(filtered, Badge.ITEM_LEVEL_1, Badge.ITEM_LEVEL_2, - Badge.ITEM_LEVEL_3, Badge.ITEM_LEVEL_4); - leaveBest(filtered, Badge.POTIONS_COOKED_1, Badge.POTIONS_COOKED_2, - Badge.POTIONS_COOKED_3, Badge.POTIONS_COOKED_4); - leaveBest(filtered, Badge.BOSS_SLAIN_1_ALL_CLASSES, - Badge.BOSS_SLAIN_3_ALL_SUBCLASSES); - leaveBest(filtered, Badge.DEATH_FROM_FIRE, Badge.YASD); - leaveBest(filtered, Badge.DEATH_FROM_GAS, Badge.YASD); - leaveBest(filtered, Badge.DEATH_FROM_HUNGER, Badge.YASD); - leaveBest(filtered, Badge.DEATH_FROM_POISON, Badge.YASD); - leaveBest(filtered, Badge.VICTORY, Badge.VICTORY_ALL_CLASSES); - leaveBest(filtered, Badge.GAMES_PLAYED_1, Badge.GAMES_PLAYED_2, - Badge.GAMES_PLAYED_3, Badge.GAMES_PLAYED_4); - - ArrayList list = new ArrayList(filtered); - Collections.sort(list); - - return list; - } - - private static void leaveBest(HashSet list, Badge... badges) { - for (int i = badges.length - 1; i > 0; i--) { - if (list.contains(badges[i])) { - for (int j = 0; j < i; j++) { - list.remove(badges[j]); - } - break; - } - } - } -} diff --git a/java/com/hmdzl/spspd/change/Challenges.java b/java/com/hmdzl/spspd/change/Challenges.java deleted file mode 100644 index 8e5a57ad..00000000 --- a/java/com/hmdzl/spspd/change/Challenges.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change; - -public class Challenges { - - public static final int ITEM_PHOBIA = 1; - public static final int LISTLESS = 2; - public static final int NIGHTMARE_VIRUS = 4; - public static final int ENERGY_LOST = 8; - public static final int DEW_REJECTION = 16; - public static final int DARKNESS = 32; - public static final int ABRASION = 64; - public static final int TEST_TIME = 128; - - public static final String[] NAME_IDS = { - "item_phobia", - "listless", - "nightmare_virus", - "energy_lost", - "dew_rejection", - "darkness", - "abrasion", - "test_time" - }; - - public static final int[] MASKS = { - ITEM_PHOBIA, LISTLESS, NIGHTMARE_VIRUS, - ENERGY_LOST, DEW_REJECTION, DARKNESS, ABRASION, TEST_TIME}; - -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/Chrome.java b/java/com/hmdzl/spspd/change/Chrome.java deleted file mode 100644 index 45f8bc72..00000000 --- a/java/com/hmdzl/spspd/change/Chrome.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change; - -import com.watabou.noosa.NinePatch; - -public class Chrome { - - public enum Type { - TOAST, TOAST_TR, WINDOW, BUTTON, TAG, GEM, SCROLL, TAB_SET, TAB_SELECTED, TAB_UNSELECTED - }; - - public static NinePatch get(Type type) { - String Asset = Assets.CHROME; - switch (type) { - case WINDOW: - return new NinePatch(Asset, 0, 0, 20, 20, 6); - case TOAST: - return new NinePatch(Asset, 22, 0, 18, 18, 5); - case TOAST_TR: - return new NinePatch(Asset, 40, 0, 18, 18, 5); - case BUTTON: - return new NinePatch(Asset, 58, 0, 4, 4, 1); - case TAG: - return new NinePatch(Asset, 22, 18, 16, 14, 3); - case GEM: - return new NinePatch(Asset, 0, 32, 32, 32, 13); - case SCROLL: - return new NinePatch(Asset, 32, 32, 32, 32, 5, 11, 5, 11); - case TAB_SET: - return new NinePatch(Asset, 64, 0, 20, 20, 6); - case TAB_SELECTED: - return new NinePatch(Asset, 65, 22, 8, 13, 3, 7, 3, 5); - case TAB_UNSELECTED: - return new NinePatch(Asset, 75, 22, 8, 13, 3, 7, 3, 5); - default: - return null; - } - } -} diff --git a/java/com/hmdzl/spspd/change/Dungeon.java b/java/com/hmdzl/spspd/change/Dungeon.java deleted file mode 100644 index 10359630..00000000 --- a/java/com/hmdzl/spspd/change/Dungeon.java +++ /dev/null @@ -1,1545 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change; - -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Calendar; -import java.util.HashSet; - -import com.hmdzl.spspd.change.actors.buffs.Awareness; -import com.hmdzl.spspd.change.actors.buffs.GlassShield; -import com.hmdzl.spspd.change.actors.buffs.MindVision; -import com.hmdzl.spspd.change.actors.buffs.Rhythm; -import com.hmdzl.spspd.change.actors.buffs.Rhythm2; -import com.hmdzl.spspd.change.actors.hero.HeroSubClass; -import com.hmdzl.spspd.change.items.artifacts.DriedRose; -import com.hmdzl.spspd.change.levels.ChaosLevel; -import com.hmdzl.spspd.change.levels.SokobanSPLevel; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Amok; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Dewcharge; -import com.hmdzl.spspd.change.actors.buffs.Light; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.hero.HeroClass; -import com.hmdzl.spspd.change.actors.mobs.npcs.Blacksmith; -import com.hmdzl.spspd.change.actors.mobs.npcs.Ghost; -import com.hmdzl.spspd.change.actors.mobs.npcs.Imp; -import com.hmdzl.spspd.change.actors.mobs.npcs.Wandmaker; -import com.hmdzl.spspd.change.actors.mobs.npcs.Tinkerer5; -import com.hmdzl.spspd.change.items.Ankh; -import com.hmdzl.spspd.change.items.Generator; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.potions.Potion; -import com.hmdzl.spspd.change.items.rings.Ring; -import com.hmdzl.spspd.change.items.scrolls.Scroll; -import com.hmdzl.spspd.change.items.wands.Wand; -import com.hmdzl.spspd.change.levels.BattleLevel; -import com.hmdzl.spspd.change.levels.CatacombLevel; -import com.hmdzl.spspd.change.levels.CavesBossLevel; -import com.hmdzl.spspd.change.levels.CavesLevel; -import com.hmdzl.spspd.change.levels.ChasmLevel; -import com.hmdzl.spspd.change.levels.CityBossLevel; -import com.hmdzl.spspd.change.levels.CityLevel; -import com.hmdzl.spspd.change.levels.CrabBossLevel; -import com.hmdzl.spspd.change.levels.DeadEndLevel; -import com.hmdzl.spspd.change.levels.DragonCaveLevel; -import com.hmdzl.spspd.change.levels.FieldLevel; -import com.hmdzl.spspd.change.levels.FieldBossLevel; -import com.hmdzl.spspd.change.levels.FishingLevel; -import com.hmdzl.spspd.change.levels.FortressLevel; -import com.hmdzl.spspd.change.levels.HallsBossLevel; -import com.hmdzl.spspd.change.levels.HallsLevel; -import com.hmdzl.spspd.change.levels.InfestBossLevel; -import com.hmdzl.spspd.change.levels.LastLevel; -import com.hmdzl.spspd.change.levels.LastShopLevel; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.MinesBossLevel; -import com.hmdzl.spspd.change.levels.PrisonBossLevel; -import com.hmdzl.spspd.change.levels.PrisonLevel; -import com.hmdzl.spspd.change.levels.Room; -import com.hmdzl.spspd.change.levels.SafeLevel; -import com.hmdzl.spspd.change.levels.SewerBossLevel; -import com.hmdzl.spspd.change.levels.SewerLevel; -import com.hmdzl.spspd.change.levels.SkeletonBossLevel; -import com.hmdzl.spspd.change.levels.SokobanCastle; -import com.hmdzl.spspd.change.levels.SokobanIntroLevel; -import com.hmdzl.spspd.change.levels.SokobanPuzzlesLevel; -import com.hmdzl.spspd.change.levels.SokobanTeleportLevel; -import com.hmdzl.spspd.change.levels.SokobanVaultLevel; -import com.hmdzl.spspd.change.levels.TenguDenLevel; -import com.hmdzl.spspd.change.levels.ThiefBossLevel; -import com.hmdzl.spspd.change.levels.ThiefCatchLevel; -import com.hmdzl.spspd.change.levels.BossRushLevel; -import com.hmdzl.spspd.change.levels.TownLevel; -import com.hmdzl.spspd.change.levels.VaultLevel; -import com.hmdzl.spspd.change.levels.ZotBossLevel; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.scenes.StartScene; -import com.hmdzl.spspd.change.ui.QuickSlotButton; -import com.hmdzl.spspd.change.utils.BArray; -import com.hmdzl.spspd.change.utils.GLog; - -import com.hmdzl.spspd.change.windows.WndAlchemy; -import com.hmdzl.spspd.change.windows.WndResurrect; -import com.watabou.noosa.Game; -import com.watabou.utils.Bundlable; -import com.watabou.utils.Bundle; -import com.watabou.utils.PathFinder; -import com.watabou.utils.Random; -import com.watabou.utils.SparseArray; - -public class Dungeon { - - // enum of items which have limited spawns, records how many have spawned - // could all be their own separate numbers, but this allows iterating, much - // nicer for bundling/initializing. - public static enum limitedDrops { - // limited world drops - strengthPotions, upgradeScrolls, - - //Norn Stones - nornstones, - - // doesn't use Generator, so we have to enforce one armband drop here - spork, sewerkey, prisonkey, caveskey, citykey, hallskey, ringofwealth, vaultpage, town, - conchshell, ancientcoin, tengukey, bone, journal, safespotpage, dragoncave, treasuremap, goei, - - // containers - dewVial, seedBag, scrollBag, potionBag, wandBag, shopcart, heartScarecrow, challengebook; - - public int count = 0; - - // for items which can only be dropped once, should directly access - // count otherwise. - public boolean dropped() { - return count != 0; - } - - public void drop() { - count = 1; - } - } - - public static int[] pars; - - public static boolean earlygrass = false; - public static boolean gnollspawned = false; - public static boolean skeletonspawned = false; - public static boolean goldthiefspawned = false; - public static boolean triforce = false; - public static boolean triforceofcourage = false; - public static boolean triforceofpower = false; - public static boolean triforceofwisdom = false; - public static boolean shadowyogkilled = false; - public static boolean crabkingkilled = false; - public static boolean banditkingkilled = false; - public static boolean skeletonkingkilled = false; - public static boolean gnollkingkilled = false; - public static boolean tengudenkilled = false; - public static boolean zotkilled = false; - public static boolean dewDraw = false; - public static boolean dewWater = false; - public static boolean wings = false; - public static boolean dewNorn = false; - public static boolean canSave = false; - public static boolean gnollmission = false; - public static boolean oneDay = false; - public static boolean error = false; - //public static boolean secondQuest = false; - - public static int challenges; - public static int skins; - - public static int ratChests = 0; - public static int sacrifice = 0; - public static boolean sporkAvail = false; - public static boolean challengebookdrop = false; - public static boolean goeidrop = false; - - public static Hero hero; - public static Level level; - - public static QuickSlot quickslot = new QuickSlot(); - - public static int depth = 1; - public static int gold = 0; - - public static String resultDescription; - - public static HashSet chapters; - - // Hero's field of view - public static boolean[] visible = new boolean[Level.getLength()]; - - public static SparseArray> droppedItems; - - public static int version; - - public static void init() { - - version = Game.versionCode; - challenges = ShatteredPixelDungeon.challenges(); - - //Generator.initArtifacts(); - - Actor.clear(); - Actor.resetNextID(); - - PathFinder.setMapSize(Level.getWidth(), Level.HEIGHT); - - Scroll.initLabels(); - Potion.initColors(); - Ring.initGems(); - - Statistics.reset(); - Journal.reset(); - - quickslot.reset(); - QuickSlotButton.reset(); - - depth = 0; - gold = 0; - - droppedItems = new SparseArray>(); - - for (limitedDrops a : limitedDrops.values()) - a.count = 0; - - chapters = new HashSet(); - - Ghost.Quest.reset(); - Wandmaker.Quest.reset(); - Blacksmith.Quest.reset(); - Imp.Quest.reset(); - - Room.shuffleTypes(); - - //Generator.initArtifacts(); - hero = new Hero(); - hero.live(); - - Badges.reset(); - - StartScene.curClass.initHero(hero); - - earlygrass = false; - gnollspawned = false; - skeletonspawned = false; - goldthiefspawned = false; - triforce = false; - triforceofcourage = false; - triforceofpower = false; - triforceofwisdom = false; - shadowyogkilled = false; - crabkingkilled = false; - banditkingkilled = false; - gnollkingkilled = false; - tengudenkilled = false; - skeletonkingkilled = false; - zotkilled = false; - ratChests = 0; - sacrifice = 0 ; - sporkAvail = false; - challengebookdrop = false; - goeidrop = false; - dewDraw = false; - dewWater = false; - wings = false; - dewNorn = false; - canSave = false; - gnollmission = false; - oneDay =false; - error = false; - - pars = new int[100]; - - } - - public static boolean isChallenged(int mask) { - return (challenges & mask) != 0; - } - - public static Level newFieldLevel(){ - - Dungeon.level = null; - Actor.clear(); - depth = 27; - if (depth > Statistics.realdeepestFloor) { - Statistics.realdeepestFloor = depth;} - - Arrays.fill(visible, false); - - Level level; - level = new FieldLevel(); - - level.create(); - - Statistics.qualifiedForNoKilling = !bossLevel(); - - return level; - } - public static Level newBattleLevel(){ - - Dungeon.level = null; - Actor.clear(); - depth = 28; - if (depth > Statistics.realdeepestFloor) { - Statistics.realdeepestFloor = depth;} - - Arrays.fill(visible, false); - - Level level; - level = new BattleLevel(); - - level.create(); - - Statistics.qualifiedForNoKilling = !bossLevel(); - - return level; - } - public static Level newFishLevel(){ - - Dungeon.level = null; - Actor.clear(); - depth = 29; - if (depth > Statistics.realdeepestFloor) { - Statistics.realdeepestFloor = depth;} - - Arrays.fill(visible, false); - - Level level; - level = new FishingLevel(); - - level.create(); - - Statistics.qualifiedForNoKilling = !bossLevel(); - - return level; - } - public static Level newVaultLevel(){ - - Dungeon.level = null; - Actor.clear(); - depth = 30; - if (depth > Statistics.realdeepestFloor) { - Statistics.realdeepestFloor = depth;} - - Arrays.fill(visible, false); - - Level level; - level = new VaultLevel(); - - level.create(); - - Statistics.qualifiedForNoKilling = !bossLevel(); - - return level; - } - - public static Level newCatacombLevel(){ - - - Dungeon.level = null; - Actor.clear(); - depth = 31; - if (depth > Statistics.realdeepestFloor) { - Statistics.realdeepestFloor = depth;} - - Arrays.fill(visible, false); - - Level level; - level = new CatacombLevel(); - - level.create(); - - Statistics.qualifiedForNoKilling = !bossLevel(); - - return level; - } - -public static Level newFortressLevel(){ - - Dungeon.level = null; - Actor.clear(); - depth = 32; - if (depth > Statistics.realdeepestFloor) { - Statistics.realdeepestFloor = depth;} - - Arrays.fill(visible, false); - - Level level; - level = new FortressLevel(); - - level.create(); - - Statistics.qualifiedForNoKilling = !bossLevel(); - - return level; - } - -public static Level newChasmLevel(){ - - Dungeon.level = null; - Actor.clear(); - depth = 33; - if (depth > Statistics.realdeepestFloor) { - Statistics.realdeepestFloor = depth;} - - Arrays.fill(visible, false); - - Level level; - level = new ChasmLevel(); - - level.create(); - - Statistics.qualifiedForNoKilling = !bossLevel(); - - return level; -} - -public static Level newInfestLevel(){ - - Dungeon.level = null; - Actor.clear(); - depth = 35; - if (depth > Statistics.realdeepestFloor) { - Statistics.realdeepestFloor = depth;} - - Arrays.fill(visible, false); - - Level level; - level = new InfestBossLevel(); - - level.create(); - - Statistics.qualifiedForNoKilling = !bossLevel(); - if (Statistics.deepestFloor>24){Statistics.deepestFloor = depth;} - - return level; -} - - - -public static Level newTenguHideoutLevel(){ - - Dungeon.level = null; - Actor.clear(); - depth = 36; - if (depth > Statistics.realdeepestFloor) { - Statistics.realdeepestFloor = depth;} - - Arrays.fill(visible, false); - - Level level; - level = new TenguDenLevel(); - - level.create(); - - Statistics.qualifiedForNoKilling = !bossLevel(); - - return level; -} - -public static Level newSkeletonBossLevel(){ - - Dungeon.level = null; - Actor.clear(); - depth = 37; - if (depth > Statistics.realdeepestFloor) { - Statistics.realdeepestFloor = depth;} - - Arrays.fill(visible, false); - - Level level; - level = new SkeletonBossLevel(); - - level.create(); - - Statistics.qualifiedForNoKilling = !bossLevel(); - - return level; -} - -public static Level newCrabBossLevel(){ - - Dungeon.level = null; - Actor.clear(); - depth = 38; - if (depth > Statistics.realdeepestFloor) { - Statistics.realdeepestFloor = depth;} - - Arrays.fill(visible, false); - - Level level; - level = new CrabBossLevel(); - - level.create(); - - Statistics.qualifiedForNoKilling = !bossLevel(); - - return level; -} - -public static Level newThiefBossLevel(){ - - Dungeon.level = null; - Actor.clear(); - depth = 40; - if (depth > Statistics.realdeepestFloor) { - Statistics.realdeepestFloor = depth;} - - Arrays.fill(visible, false); - - Level level; - level = new ThiefBossLevel(); - - level.create(); - - Statistics.qualifiedForNoKilling = !bossLevel(); - - return level; -} - -public static Level newFieldBossLevel(){ - - Dungeon.level = null; - Actor.clear(); - depth = 43; - if (depth > Statistics.realdeepestFloor) { - Statistics.realdeepestFloor = depth;} - - Arrays.fill(visible, false); - - Level level; - level = new FieldBossLevel(); - - level.create(); - - Statistics.qualifiedForNoKilling = !bossLevel(); - - return level; -} - -public static Level newMineBossLevel(){ - - Dungeon.level = null; - Actor.clear(); - //depth = 67; - depth++; - if (depth > Statistics.realdeepestFloor) { - Statistics.realdeepestFloor = depth;} - - Arrays.fill(visible, false); - - Level level; - level = new MinesBossLevel(); - - level.create(); - - Statistics.qualifiedForNoKilling = !bossLevel(); - - return level; -} - -public static Level newBossRushLevel(){ - - - Dungeon.level = null; - Actor.clear(); - depth = 71; - if (depth > Statistics.realdeepestFloor) { - Statistics.realdeepestFloor = depth;} - - Arrays.fill(visible, false); - - Level level; - level = new BossRushLevel(); - - level.create(); - - Statistics.qualifiedForNoKilling = !bossLevel(); - - return level; - } - - public static Level newChaosLevel(){ - - Dungeon.level = null; - Actor.clear(); - depth = 85; - if (depth > Statistics.realdeepestFloor) { - Statistics.realdeepestFloor = depth;} - - Arrays.fill(visible, false); - - Level level; - level = new ChaosLevel(); - - level.create(); - - Statistics.qualifiedForNoKilling = !bossLevel(); - - return level; - } - -public static Level newZotBossLevel(){ - - Dungeon.level = null; - Actor.clear(); - depth = 99; - if (depth > Statistics.realdeepestFloor) { - Statistics.realdeepestFloor = depth;} - - Arrays.fill(visible, false); - - Level level; - level = new ZotBossLevel(); - - level.create(); - - Statistics.qualifiedForNoKilling = !bossLevel(); - - return level; -} - -public static Level newJournalLevel(int page, Boolean first){ - - Dungeon.level = null; - Actor.clear(); - - depth = 50+page; - - if (page==6){ - depth = 66; - } - - if (page==7){ - depth = 67; - } - - if (depth > Statistics.realdeepestFloor && depth < 68) { - Statistics.realdeepestFloor = depth;} - - Arrays.fill(visible, false); - - Level level; - switch(page){ - case 0: - level = new SafeLevel(); - break; - case 1: - level = new SokobanIntroLevel(); - break; - case 2: - level = new SokobanCastle(); - break; - case 3: - level = new SokobanTeleportLevel(); - break; - case 4: - level = new SokobanPuzzlesLevel(); - break; - case 5: - level = new TownLevel(); - break; - case 6: - level = new SokobanSPLevel(); - break; - case 7: - level = new MinesBossLevel(); - break; - default: - level = Dungeon.newLevel(); - } - - level.first = first; - level.create(); - - Statistics.qualifiedForNoKilling = !bossLevel(); - - return level; -} - -public static Level newChallengeLevel(int list, Boolean first){ - - Dungeon.level = null; - Actor.clear(); - - depth = 26+list; - if (list==0){ - depth = 26; - } - if (list==1 ){ - depth = 27; - } - if (list==2){ - depth = 28; - } - if (list==3){ - depth = 29; - } - if (list==4){ - depth = 30; - } - if (list==5){ - depth = 31; - } - if (list==6){ - depth = 32; - } - if (list==7){ - depth = 33; - } - - if (depth > Statistics.realdeepestFloor && depth < 34) { - Statistics.realdeepestFloor = depth;} - - Arrays.fill(visible, false); - - Level level; - switch(list){ - case 0: - level = Dungeon.newLevel(); - break; - case 1: - level = new FieldLevel(); - break; - case 2: - level = new BattleLevel(); - break; - case 3: - level = new FishingLevel(); - break; - case 4: - level = new VaultLevel(); - break; - case 5: - level = new CatacombLevel(); - break; - case 6: - level = new FortressLevel(); - break; - case 7: - level = new ChasmLevel(); - break; - default: - level = Dungeon.newLevel(); - } - - level.first = first; - level.create(); - - Statistics.qualifiedForNoKilling = !bossLevel(); - - return level; -} - - - public static Level newLevel() { - - Dungeon.level = null; - Actor.clear(); - - depth++; - if (depth > Statistics.realdeepestFloor) { - Statistics.realdeepestFloor = depth;} - - if (depth > Statistics.deepestFloor && depth < 27) { - Statistics.deepestFloor = depth; - - if (Statistics.qualifiedForNoKilling) { - Statistics.completedWithNoKilling = true; - } else { - Statistics.completedWithNoKilling = false; - } - } - - if (depth==6){ - Statistics.sewerKills=Statistics.enemiesSlain; - } - if (depth==10){ - Statistics.prisonKills=Statistics.enemiesSlain-Statistics.sewerKills; - } - - Arrays.fill(visible, false); - - Level level; - switch (depth) { - case 1: - //level = new PrisonBossLevel(); - //level = new SewerLevel(); - //hero.HT=999; - //hero.HP=hero.HT; - //break; - case 2: - //level = new HallsLevel(); - //hero.HT=999; - //hero.HP=hero.HT; - //break; - case 3: - case 4: - //level = new CavesLevel(); - level = new SewerLevel(); - //hero.HT=999; - //hero.HP=hero.HT; - break; - case 5: - level = new SewerBossLevel(); - break; - case 6: - //level = new HallsLevel(); - //hero.HT=999; - //hero.HP=hero.HT; - //break; - case 7: - case 8: - case 9: - level = new PrisonLevel(); - break; - case 10: - level = new PrisonBossLevel(); - break; - case 11: - case 12: - case 13: - case 14: - level = new CavesLevel(); - break; - case 15: - level = new CavesBossLevel(); - break; - case 16: - case 17: - case 18: - case 19: - level = new CityLevel(); - break; - case 20: - level = new CityBossLevel(); - break; - case 21: - level = new LastShopLevel(); - break; - case 22: - case 23: - case 24: - level = new HallsLevel(); - break; - case 25: - level = new HallsBossLevel(); - break; - case 26: - level = new LastLevel(); - break; - case 41: - level = new ThiefCatchLevel(); - break; - case 67: - level = new MinesBossLevel(); - break; - case 71: - level = new BossRushLevel(); - break; - case 85: - level = new ChaosLevel(); - default: - level = new DeadEndLevel(); - if (depth<27){Statistics.deepestFloor--;} - } - - level.create(); - - Statistics.qualifiedForNoKilling = !bossLevel(); - if (depth<26 && depth!=21 && !Dungeon.bossLevel(depth) && (Dungeon.dewDraw || Dungeon.dewWater)){ - Buff.prolong(Dungeon.hero, Dewcharge.class, Dewcharge.DURATION+(Math.max(Statistics.prevfloormoves,1))); - //GLog.p("You feel the dungeon charge with dew!"); - } - /*if(Dungeon.hero.heroClass == HeroClass.PERFORMER){ - //Buff.prolong(Dungeon.hero,Rhythm.class,50); - Buff.affect(Dungeon.hero,GlassShield.class).turns(3); - } - if(Dungeon.hero.heroClass == HeroClass.PERFORMER && Dungeon.hero.subClass == HeroSubClass.SUPERSTAR){ - Buff.affect(Dungeon.hero,Rhythm.class,50); - Buff.prolong(Dungeon.hero,Rhythm2.class,50); - }*/ - - return level; - } - - public static void resetLevel() { - - Actor.clear(); - - Arrays.fill(visible, false); - - level.reset(); - switchLevel(level, level.entrance); - } - - public static boolean shopOnLevel() { - return depth==1 || depth == 6 || depth == 11 || depth == 16; - } - - public static boolean bossLevel() { - return bossLevel(depth); - } - - public static boolean bossLevel(int depth) { - return depth == 5 || depth == 10 || depth == 15 || depth == 20 - || depth == 25 || depth == 36 || depth == 41 || depth == 71 ; - } - - public static boolean notClearableLevel(int depth) { - return depth == 1 || depth ==2 ||depth == 5 || depth == 10 || depth == 15 || depth == 20 || depth == 21 - || depth == 25 || depth>25; - } - - public static boolean townCheck(int depth) { - return depth > 54 && depth < 66; - } - - public static boolean growLevel(int depth) { - return depth == 27 || depth == 28 || depth == 32 || depth == 30 || depth == 55; - } - - public static boolean waterLevel(int depth) { - return depth == 29; - } - - public static boolean sokobanLevel(int depth) { - return depth == 51 || depth == 52 || depth == 53 || depth == 54; - } - - //public static boolean dropLevel(int depth) { - //return depth == 40; - //} - - - @SuppressWarnings("deprecation") - public static void switchLevel(final Level level, int pos) { - - Dungeon.level = level; - DriedRose.restoreGhostHero( level, pos ); - Actor.init(); - - Actor respawner = level.respawner(); - if (respawner != null) { - Actor.add(level.respawner()); - } - - Actor regrower = level.regrower(); - if (regrower != null && growLevel(depth)) { - Actor.add(level.regrower()); - } - - Actor waterer = level.waterer(); - if (waterer != null && waterLevel(depth)) { - Actor.add(level.waterer()); - } - - /*Actor floordropper = level.floordropper(); - if (floordropper != null && dropLevel(depth)) { - Actor.add(level.floordropper()); - }*/ - - hero.pos = pos != -1 ? pos : level.exit; - - Light light = hero.buff(Light.class); - hero.viewDistance = light == null ? level.viewDistance : Math.max( - Light.DISTANCE, level.viewDistance); - - Actor respawnerPet = level.respawnerPet(); - if (respawnerPet != null) { - Actor.add(level.respawnerPet()); - } - - observe(); - try { - saveAll(); - } catch (IOException e) { - /* - * This only catches IO errors. Yes, this means things can go wrong, - * and they can go wrong catastrophically. But when they do the user - * will get a nice 'report this issue' dialogue, and I can fix the - * bug. - */ - } - } - - public static void dropToChasm(Item item) { - int depth = Dungeon.depth + 1; - ArrayList dropped = Dungeon.droppedItems - .get(depth); - if (dropped == null) { - Dungeon.droppedItems.put(depth, dropped = new ArrayList()); - } - dropped.add(item); - } - - public static boolean posNeeded() { - int[] quota = { 4, 2, 9, 4, 14, 6, 19, 8, 24, 10 }; - return chance(quota, limitedDrops.strengthPotions.count); - } - - public static boolean souNeeded() { - int[] quota = { 5, 4, 10, 8, 15, 12, 20, 16, 25, 20 }; - return chance(quota, limitedDrops.upgradeScrolls.count); - } - - private static boolean chance(int[] quota, int number) { - - for (int i = 0; i < quota.length; i += 2) { - int qDepth = quota[i]; - if (depth <= qDepth) { - int qNumber = quota[i + 1]; - return Random.Float() < (float) (qNumber - number) - / (qDepth - depth + 1); - } - } - - return false; - } - - private static final String RG_GAME_FILE = "rogue.dat"; - private static final String RG_DEPTH_FILE = "rogue%d.dat"; - - private static final String WR_GAME_FILE = "warrior.dat"; - private static final String WR_DEPTH_FILE = "warrior%d.dat"; - - private static final String MG_GAME_FILE = "mage.dat"; - private static final String MG_DEPTH_FILE = "mage%d.dat"; - - private static final String RN_GAME_FILE = "huntress.dat"; - private static final String RN_DEPTH_FILE = "huntress%d.dat"; - - private static final String PE_GAME_FILE = "performer.dat"; - private static final String PE_DEPTH_FILE = "performer%d.dat"; - - private static final String SO_GAME_FILE = "soldier.dat"; - private static final String SO_DEPTH_FILE = "soldier%d.dat"; - - private static final String FO_GAME_FILE = "follower.dat"; - private static final String FO_DEPTH_FILE = "follower%d.dat"; - - private static final String VERSION = "version"; - private static final String SKINS = "skins"; - private static final String CHALLENGES = "challenges"; - private static final String HERO = "hero"; - private static final String GOLD = "gold"; - private static final String DEPTH = "depth"; - private static final String DROPPED = "dropped%d"; - private static final String LEVEL = "level"; - private static final String LIMDROPS = "limiteddrops"; - private static final String DV = "dewVial"; - private static final String CHAPTERS = "chapters"; - private static final String QUESTS = "quests"; - private static final String BADGES = "badges"; - - private static final String SACRIFICE = "sacrifice"; - private static final String RATCHESTS = "ratChests"; - private static final String EARLYGRASS = "earlygrass"; - private static final String GNOLLSPAWN = "gnollspawned"; - private static final String SKELETONSPAWN = "skeletonspawned"; - private static final String THIEFSPAWN = "goldthiefspawned"; - private static final String STRI = "triforce"; - private static final String STRID = "triforceofcourage"; - private static final String STRIL = "triforceofpower"; - private static final String STRIT = "triforceofwisdom"; - private static final String SYOGKILL = "shadowyogkilled"; - private static final String CRABKILL = "crabkingkilled"; - private static final String TENGUDENKILL = "tengudenkilled"; - private static final String SKELETONKILL = "skeletonkingkilled"; - private static final String GNOLLKILL = "gnollkingkilled"; - private static final String BANDITKILL = "banditkingkilled"; - private static final String ZOTKILL = "zotkilled"; - private static final String SPORK = "sporkAvail"; - private static final String CBDROP = "challengebookdrop"; - private static final String GOEIDROP = "goeidrop"; - private static final String DEWDRAW = "dewDraw"; - private static final String DEWWATER = "dewWater"; - private static final String DEWNORN = "dewNorn"; - private static final String CANSAVE = "canSave"; - private static final String GNOLLMISSION = "gnollmission"; - private static final String ONEDAY = "oneDay"; - private static final String ERROR = "error"; - private static final String WINGS = "wings"; - private static final String PARS = "pars"; - - //private static final String SECONDQUEST = "secondQuest"; - - public static String gameFile(HeroClass cl) { - switch (cl) { - case WARRIOR: - return WR_GAME_FILE; - case MAGE: - return MG_GAME_FILE; - case ROGUE: - return RG_GAME_FILE; - case HUNTRESS: - return RN_GAME_FILE; - case PERFORMER: - return PE_GAME_FILE; - case SOLDIER: - return SO_GAME_FILE; - case FOLLOWER: - return FO_GAME_FILE; - default: - return RG_GAME_FILE; - } - } - - private static String depthFile(HeroClass cl) { - switch (cl) { - case WARRIOR: - return WR_DEPTH_FILE; - case MAGE: - return MG_DEPTH_FILE; - case ROGUE: - return RG_DEPTH_FILE; - case HUNTRESS: - return RN_DEPTH_FILE; - case PERFORMER: - return PE_DEPTH_FILE; - case SOLDIER: - return SO_DEPTH_FILE; - case FOLLOWER: - return FO_DEPTH_FILE; - default: - return RG_DEPTH_FILE; - } - } - - public static void saveGame(String fileName) throws IOException { - try { - Bundle bundle = new Bundle(); - - version = Game.versionCode; - bundle.put(VERSION, Game.versionCode); - bundle.put( SKINS, skins ); - bundle.put(CHALLENGES, challenges); - bundle.put(HERO, hero); - bundle.put(GOLD, gold); - bundle.put(DEPTH, depth); - - //bundle.put(SECONDQUEST, secondQuest); - bundle.put(SACRIFICE, sacrifice); - bundle.put(RATCHESTS, ratChests); - bundle.put(EARLYGRASS, earlygrass); - bundle.put(GNOLLSPAWN, gnollspawned); - bundle.put(SKELETONSPAWN, skeletonspawned); - bundle.put(THIEFSPAWN, goldthiefspawned); - bundle.put(STRI, triforce); - bundle.put(STRID, triforceofcourage); - bundle.put(STRIL, triforceofpower); - bundle.put(STRIT, triforceofwisdom); - bundle.put(SYOGKILL, shadowyogkilled); - bundle.put(CRABKILL, crabkingkilled); - bundle.put(TENGUDENKILL, tengudenkilled); - bundle.put(BANDITKILL, banditkingkilled); - bundle.put(SKELETONKILL, skeletonkingkilled); - bundle.put(GNOLLKILL, gnollkingkilled); - bundle.put(ZOTKILL, zotkilled); - bundle.put(SPORK, sporkAvail); - bundle.put(CBDROP, challengebookdrop); - bundle.put(GOEIDROP, goeidrop); - bundle.put(DEWDRAW, dewDraw); - bundle.put(DEWWATER, dewWater); - bundle.put(WINGS, wings); - bundle.put(DEWNORN, dewNorn); - bundle.put(CANSAVE, canSave); - bundle.put(GNOLLMISSION, gnollmission); - bundle.put(ONEDAY, oneDay); - bundle.put(ERROR, error); - bundle.put(PARS, pars); - - for (int d : droppedItems.keyArray()) { - bundle.put(String.format(DROPPED, d), droppedItems.get(d)); - } - - quickslot.storePlaceholders(bundle); - - int[] dropValues = new int[limitedDrops.values().length]; - for (limitedDrops value : limitedDrops.values()) - dropValues[value.ordinal()] = value.count; - bundle.put(LIMDROPS, dropValues); - - int count = 0; - int ids[] = new int[chapters.size()]; - for (Integer id : chapters) { - ids[count++] = id; - } - bundle.put(CHAPTERS, ids); - - Bundle quests = new Bundle(); - Ghost.Quest.storeInBundle(quests); - Wandmaker.Quest.storeInBundle(quests); - Blacksmith.Quest.storeInBundle(quests); - Imp.Quest.storeInBundle(quests); - bundle.put(QUESTS, quests); - - Room.storeRoomsInBundle(bundle); - - Statistics.storeInBundle(bundle); - Journal.storeInBundle(bundle); - //Generator.storeInBundle(bundle); - - Scroll.save(bundle); - Potion.save(bundle); - Ring.save(bundle); - - Actor.storeNextID(bundle); - - Bundle badges = new Bundle(); - Badges.saveLocal(badges); - bundle.put(BADGES, badges); - - OutputStream output = Game.instance.openFileOutput(fileName, - Game.MODE_PRIVATE); - Bundle.write(bundle, output); - output.close(); - - } catch (IOException e) { - - GamesInProgress.setUnknown(hero.heroClass); - } - } - - public static void saveLevel() throws IOException { - Bundle bundle = new Bundle(); - bundle.put(LEVEL, level); - - OutputStream output = Game.instance.openFileOutput( - Messages.format(depthFile(hero.heroClass), depth), - Game.MODE_PRIVATE); - Bundle.write(bundle, output); - output.close(); - } - - public static void saveAll() throws IOException { - if (hero.isAlive()) { - - Actor.fixTime(); - saveGame(gameFile(hero.heroClass)); - saveLevel(); - - GamesInProgress.set(hero.heroClass, depth, hero.lvl,skins, - challenges != 0); - - } else if (WndResurrect.instance != null) { - - WndResurrect.instance.hide(); - Hero.reallyDie(WndResurrect.causeOfDeath); - - } - } - - public static void loadGame(HeroClass cl) throws IOException { - loadGame(gameFile(cl), true); - } - - public static void loadGame(String fileName) throws IOException { - loadGame(fileName, false); - } - - public static void loadGame(String fileName, boolean fullLoad) - throws IOException { - try{ - Bundle bundle = gameBundle(fileName); - - version = bundle.getInt(VERSION); - - Generator.reset(); - - Actor.restoreNextID(bundle); - - quickslot.reset(); - QuickSlotButton.reset(); - - Dungeon.challenges = bundle.getInt(CHALLENGES); - Dungeon.skins = bundle.getInt(SKINS); - - Dungeon.level = null; - Dungeon.depth = -1; - - if (fullLoad) { - PathFinder.setMapSize(Level.getWidth(), Level.HEIGHT); - } - - Scroll.restore(bundle); - Potion.restore(bundle); - Ring.restore(bundle); - - quickslot.restorePlaceholders(bundle); - // TODO: adjust this when dropping support for pre-0.2.3 saves - if (bundle.contains(LIMDROPS)) { - int[] dropValues = bundle.getIntArray(LIMDROPS); - for (limitedDrops value : limitedDrops.values()) - value.count = value.ordinal() < dropValues.length ? dropValues[value - .ordinal()] : 0; - - // for pre-0.2.4 saves - if (bundle.getBoolean(DV)) - limitedDrops.dewVial.drop(); - - chapters = new HashSet(); - int ids[] = bundle.getIntArray(CHAPTERS); - if (ids != null) { - for (int id : ids) { - chapters.add(id); - } - } - - Bundle quests = bundle.getBundle(QUESTS); - if (!quests.isNull()) { - Ghost.Quest.restoreFromBundle(quests); - Wandmaker.Quest.restoreFromBundle(quests); - Blacksmith.Quest.restoreFromBundle(quests); - Imp.Quest.restoreFromBundle(quests); - } else { - Ghost.Quest.reset(); - Wandmaker.Quest.reset(); - Blacksmith.Quest.reset(); - Imp.Quest.reset(); - } - - Room.restoreRoomsFromBundle(bundle); - } - - Bundle badges = bundle.getBundle(BADGES); - if (!badges.isNull()) { - Badges.loadLocal(badges); - } else { - Badges.reset(); - } - - hero = null; - hero = (Hero) bundle.get(HERO); - - gold = bundle.getInt(GOLD); - depth = bundle.getInt(DEPTH); - - sacrifice = bundle.getInt(SACRIFICE); - ratChests = bundle.getInt(RATCHESTS); - earlygrass = bundle.getBoolean(EARLYGRASS); - gnollspawned = bundle.getBoolean(GNOLLSPAWN); - skeletonspawned = bundle.getBoolean(SKELETONSPAWN); - goldthiefspawned = bundle.getBoolean(THIEFSPAWN); - triforce = bundle.getBoolean(STRI); - triforceofcourage = bundle.getBoolean(STRID); - triforceofpower = bundle.getBoolean(STRIL); - triforceofwisdom = bundle.getBoolean(STRIT); - shadowyogkilled = bundle.getBoolean(SYOGKILL); - crabkingkilled = bundle.getBoolean(CRABKILL); - tengudenkilled = bundle.getBoolean(TENGUDENKILL); - banditkingkilled = bundle.getBoolean(BANDITKILL); - skeletonkingkilled = bundle.getBoolean(SKELETONKILL); - gnollkingkilled = bundle.getBoolean(GNOLLKILL); - zotkilled = bundle.getBoolean(ZOTKILL); - sporkAvail = bundle.getBoolean(SPORK); - challengebookdrop = bundle.getBoolean(CBDROP); - goeidrop = bundle.getBoolean(GOEIDROP); - dewDraw = bundle.getBoolean(DEWDRAW); - dewWater = bundle.getBoolean(DEWWATER); - wings = bundle.getBoolean(WINGS); - dewNorn = bundle.getBoolean(DEWNORN); - canSave = bundle.getBoolean(CANSAVE); - gnollmission = bundle.getBoolean(GNOLLMISSION); - oneDay = bundle.getBoolean(ONEDAY); - error = bundle.getBoolean(ERROR); - pars = bundle.getIntArray(PARS); - - Statistics.restoreFromBundle(bundle); - Journal.restoreFromBundle(bundle); - //Generator.restoreFromBundle(bundle); - - droppedItems = new SparseArray>(); - for (int i = 2; i <= Statistics.realdeepestFloor + 1; i++) { - ArrayList dropped = new ArrayList(); - for (Bundlable b : bundle.getCollection(String.format(DROPPED, i))) { - dropped.add((Item) b); - } - if (!dropped.isEmpty()) { - droppedItems.put(i, dropped); - } - } - } - catch (IOException ex) { - GLog.i("Save File corrupt...\n\nthe gremlins have won this round!"); - } - } - - public static Level loadLevel(HeroClass cl) throws IOException { - - Dungeon.level = null; - Actor.clear(); - - InputStream input = Game.instance.openFileInput(Messages.format( - depthFile(cl), depth)); - Bundle bundle = Bundle.read(input); - input.close(); - - return (Level) bundle.get("level"); - } - - public static void deleteGame(HeroClass cl, boolean deleteLevels) { - - Game.instance.deleteFile(gameFile(cl)); - - if (deleteLevels) { - int depth = 1; - while (Game.instance.deleteFile(Messages.format(depthFile(cl), depth))) { - depth++; - } - for(int i=1; i<200; i++){ - Game.instance.deleteFile(Messages.format(depthFile(cl), i)); - } - } - - GamesInProgress.delete(cl); - } - - public static Bundle gameBundle(String fileName) throws IOException { - - InputStream input = Game.instance.openFileInput(fileName); - Bundle bundle = Bundle.read(input); - input.close(); - - return bundle; - } - - public static void preview(GamesInProgress.Info info, Bundle bundle) { - info.depth = bundle.getInt(DEPTH); - info.challenges = (bundle.getInt(CHALLENGES) != 0); - if (info.depth == -1) { - info.depth = bundle.getInt("maxDepth"); // FIXME - } - Hero.preview(info, bundle.getBundle(HERO)); - } - - public static void fail( String desc ) { - resultDescription = desc; - if (hero.belongings.getItem(Ankh.class) == null) { - Rankings.INSTANCE.submit(false); - } - } - - public static void win( String desc) { - - hero.belongings.identify(); - - if (challenges != 0) { - Badges.validateChampion(); - } - - resultDescription = desc; - Rankings.INSTANCE.submit( true ); - } - - public static void observe() { - - if (level == null) { - return; - } - - if (level.darkness()){ - level.visited = visible; - level.updateFieldOfView(hero); - System.arraycopy(Level.fieldOfView, 0, visible, 0, visible.length); - BArray.or(level.visited, visible, level.visited); - } else { - - level.updateFieldOfView(hero); - System.arraycopy(Level.fieldOfView, 0, visible, 0, visible.length); - - BArray.or(level.visited, visible, level.visited); - } - - GameScene.afterObserve(); - } - - private static boolean[] passable = new boolean[Level.getLength()]; - - - public static int findPath(Char ch, int from, int to, boolean pass[], - boolean[] visible) { - - if (Level.adjacent(from, to)) { - return Actor.findChar(to) == null && (pass[to] || Level.avoid[to]) ? to - : -1; - } - - if (ch.flying || ch.buff(Amok.class) != null) { - BArray.or(pass, Level.avoid, passable); - } else { - System.arraycopy(pass, 0, passable, 0, Level.getLength()); - } - - for (Actor actor : Actor.all()) { - if (actor instanceof Char) { - int pos = ((Char) actor).pos; - if (visible[pos]) { - passable[pos] = false; - } - } - } - - return PathFinder.getStep(from, to, passable); - - } - - public static int flee(Char ch, int cur, int from, boolean pass[], - boolean[] visible) { - - if (ch.flying) { - BArray.or(pass, Level.avoid, passable); - } else { - System.arraycopy(pass, 0, passable, 0, Level.getLength()); - } - - for (Actor actor : Actor.all()) { - if (actor instanceof Char) { - int pos = ((Char) actor).pos; - if (visible[pos]) { - passable[pos] = false; - } - } - } - passable[cur] = true; - - return PathFinder.getStepBack(cur, from, passable); - - } - - public static boolean checkNight(){ - int hour=Calendar.getInstance().get(Calendar.HOUR_OF_DAY); - return (hour > 19 || hour < 7); - } - - public static int getMonth(){ - int month=Calendar.getInstance().get(Calendar.MONTH); - return month; - } - -} diff --git a/java/com/hmdzl/spspd/change/DungeonTilemap.java b/java/com/hmdzl/spspd/change/DungeonTilemap.java deleted file mode 100644 index b374ae8e..00000000 --- a/java/com/hmdzl/spspd/change/DungeonTilemap.java +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change; - -import com.hmdzl.spspd.change.levels.Level; -import com.watabou.noosa.Image; -import com.watabou.noosa.TextureFilm; -import com.watabou.noosa.Tilemap; -import com.watabou.noosa.tweeners.AlphaTweener; -import com.watabou.utils.Point; -import com.watabou.utils.PointF; - -public class DungeonTilemap extends Tilemap { - - public static final int SIZE = 16; - - private static DungeonTilemap instance; - - public DungeonTilemap() { - super(Dungeon.level.tilesTex(), new TextureFilm( - Dungeon.level.tilesTex(), SIZE, SIZE)); - map(Dungeon.level.map, Level.getWidth()); - - instance = this; - } - - public int screenToTile(int x, int y) { - Point p = camera().screenToCamera(x, y).offset(this.point().negate()) - .invScale(SIZE).floor(); - return p.x >= 0 && p.x < Level.getWidth() && p.y >= 0 && p.y < Level.HEIGHT ? p.x - + p.y * Level.getWidth() - : -1; - } - - @Override - public boolean overlapsPoint(float x, float y) { - return true; - } - - public void discover(int pos, int oldValue) { - - final Image tile = tile(oldValue); - tile.point(tileToWorld(pos)); - - // For bright mode - tile.rm = tile.gm = tile.bm = rm; - tile.ra = tile.ga = tile.ba = ra; - parent.add(tile); - - parent.add(new AlphaTweener(tile, 0, 0.6f) { - @Override - protected void onComplete() { - tile.killAndErase(); - killAndErase(); - }; - }); - } - - public static PointF tileToWorld(int pos) { - return new PointF(pos % Level.getWidth(), pos / Level.getWidth()).scale(SIZE); - } - - public static PointF tileCenterToWorld(int pos) { - return new PointF((pos % Level.getWidth() + 0.5f) * SIZE, - (pos / Level.getWidth() + 0.5f) * SIZE); - } - - public static Image tile(int index) { - Image img = new Image(instance.texture); - img.frame(instance.tileset.get(index)); - return img; - } - - public static PointF raisedTileCenterToWorld( int pos ) { - return new PointF( - (pos % Dungeon.level.WIDTH + 0.5f) * SIZE, - (pos / Dungeon.level.WIDTH + 0.1f) * SIZE ); - } - - @Override - public boolean overlapsScreenPoint(int x, int y) { - return true; - } -} diff --git a/java/com/hmdzl/spspd/change/FogOfWar.java b/java/com/hmdzl/spspd/change/FogOfWar.java deleted file mode 100644 index c0890d29..00000000 --- a/java/com/hmdzl/spspd/change/FogOfWar.java +++ /dev/null @@ -1,117 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change; - -import java.util.Arrays; - -import android.graphics.Bitmap; - -import com.hmdzl.spspd.change.scenes.GameScene; -import com.watabou.gltextures.SmartTexture; -import com.watabou.gltextures.TextureCache; -import com.watabou.glwrap.Texture; -import com.watabou.noosa.Image; - -public class FogOfWar extends Image { - - private static final int VISIBLE = 0x00000000; - private static final int VISITED = 0xcc111111; - private static final int MAPPED = 0xcc442211; - private static final int INVISIBLE = 0xFF000000; - - private int[] pixels; - - private int pWidth; - private int pHeight; - - private int width2; - private int height2; - - public FogOfWar(int mapWidth, int mapHeight) { - - super(); - - pWidth = mapWidth + 1; - pHeight = mapHeight + 1; - - width2 = 1; - while (width2 < pWidth) { - width2 <<= 1; - } - - height2 = 1; - while (height2 < pHeight) { - height2 <<= 1; - } - - float size = DungeonTilemap.SIZE; - width = width2 * size; - height = height2 * size; - - texture(new FogTexture()); - - scale.set(DungeonTilemap.SIZE, DungeonTilemap.SIZE); - - x = y = -size / 2; - } - - public void updateVisibility(boolean[] visible, boolean[] visited, - boolean[] mapped) { - - if (pixels == null) { - pixels = new int[width2 * height2]; - Arrays.fill(pixels, INVISIBLE); - } - - for (int i = 1; i < pHeight - 1; i++) { - int pos = (pWidth - 1) * i; - for (int j = 1; j < pWidth - 1; j++) { - pos++; - int c = INVISIBLE; - if (visible[pos] && visible[pos - (pWidth - 1)] - && visible[pos - 1] && visible[pos - (pWidth - 1) - 1]) { - c = VISIBLE; - } else if (visited[pos] && visited[pos - (pWidth - 1)] - && visited[pos - 1] && visited[pos - (pWidth - 1) - 1]) { - c = VISITED; - } else if (mapped[pos] && mapped[pos - (pWidth - 1)] - && mapped[pos - 1] && mapped[pos - (pWidth - 1) - 1]) { - c = MAPPED; - } - pixels[i * width2 + j] = c; - } - } - - texture.pixels(width2, height2, pixels); - } - - private class FogTexture extends SmartTexture { - - public FogTexture() { - super(Bitmap.createBitmap(width2, height2, Bitmap.Config.ARGB_8888)); - filter(Texture.LINEAR, Texture.LINEAR); - TextureCache.add(FogOfWar.class, this); - } - - @Override - public void reload() { - super.reload(); - GameScene.afterObserve(); - } - } -} diff --git a/java/com/hmdzl/spspd/change/GamesInProgress.java b/java/com/hmdzl/spspd/change/GamesInProgress.java deleted file mode 100644 index 0819c943..00000000 --- a/java/com/hmdzl/spspd/change/GamesInProgress.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change; - -import java.util.HashMap; - -import com.hmdzl.spspd.change.actors.hero.HeroClass; -import com.watabou.utils.Bundle; - -public class GamesInProgress { - - //private static HashMap state = new HashMap(); - private static HashMap state = new HashMap<>(); - - public static Info check(HeroClass cl) { - - if (state.containsKey(cl)) { - - return state.get(cl); - - } else { - - Info info; - try { - - Bundle bundle = Dungeon.gameBundle(Dungeon.gameFile(cl)); - info = new Info(); - Dungeon.preview(info, bundle); - - } catch (Exception e) { - info = null; - } - - state.put(cl, info); - return info; - - } - } - - public static void set(HeroClass cl, int depth, int level, int skins, - boolean challenges) { - Info info = new Info(); - info.depth = depth; - info.level = level; - info.skins = skins; - info.challenges = challenges; - state.put(cl, info); - } - - public static void setUnknown(HeroClass cl) { - state.remove(cl); - } - - public static void delete(HeroClass cl) { - state.put(cl, null); - } - - public static class Info { - public int depth; - public int level; - public int skins; - public boolean challenges; - } -} diff --git a/java/com/hmdzl/spspd/change/Journal.java b/java/com/hmdzl/spspd/change/Journal.java deleted file mode 100644 index 87166e32..00000000 --- a/java/com/hmdzl/spspd/change/Journal.java +++ /dev/null @@ -1,123 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.utils.Bundlable; -import com.watabou.utils.Bundle; - -public class Journal { - - public enum Feature { - WELL_OF_HEALTH, - WELL_OF_AWARENESS, - WELL_OF_TRANSMUTATION, - ALCHEMY, - GARDEN, - STATUE, - - GHOST, - WANDMAKER, - TROLL, - IMP, - - MEMORY_FIRE; - - public String desc() { - return Messages.get(this, name()); - } - }; - - public static class Record implements Comparable, Bundlable { - - private static final String FEATURE = "feature"; - private static final String DEPTH = "depth"; - - public Feature feature; - public int depth; - - public Record() { - } - - public Record(Feature feature, int depth) { - this.feature = feature; - this.depth = depth; - } - - @Override - public int compareTo(Record another) { - return another.depth - depth; - } - - @Override - public void restoreFromBundle(Bundle bundle) { - feature = Feature.valueOf(bundle.getString(FEATURE)); - depth = bundle.getInt(DEPTH); - } - - @Override - public void storeInBundle(Bundle bundle) { - bundle.put(FEATURE, feature.toString()); - bundle.put(DEPTH, depth); - } - } - - public static ArrayList records; - - public static void reset() { - records = new ArrayList(); - } - - private static final String JOURNAL = "journal"; - - public static void storeInBundle(Bundle bundle) { - bundle.put(JOURNAL, records); - } - - public static void restoreFromBundle(Bundle bundle) { - records = new ArrayList(); - for (Bundlable rec : bundle.getCollection(JOURNAL)) { - records.add((Record) rec); - } - } - - public static void add(Feature feature) { - int size = records.size(); - for (int i = 0; i < size; i++) { - Record rec = records.get(i); - if (rec.feature == feature && rec.depth == Dungeon.depth) { - return; - } - } - - records.add(new Record(feature, Dungeon.depth)); - } - - public static void remove(Feature feature) { - int size = records.size(); - for (int i = 0; i < size; i++) { - Record rec = records.get(i); - if (rec.feature == feature && rec.depth == Dungeon.depth) { - records.remove(i); - return; - } - } - } -} diff --git a/java/com/hmdzl/spspd/change/Preferences.java b/java/com/hmdzl/spspd/change/Preferences.java deleted file mode 100644 index 0a3252b0..00000000 --- a/java/com/hmdzl/spspd/change/Preferences.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change; - -import android.content.SharedPreferences; - -import com.watabou.noosa.Game; - -enum Preferences { - - INSTANCE; - - public static final String KEY_LANDSCAPE = "landscape"; - public static final String KEY_IMMERSIVE = "immersive"; - public static final String KEY_SCALE_UP = "scaleup"; - public static final String KEY_MUSIC = "music"; - public static final String KEY_SOUND_FX = "soundfx"; - public static final String KEY_ZOOM = "zoom"; - public static final String KEY_LAST_CLASS = "last_class"; - public static final String KEY_CHALLENGES = "challenges"; - public static final String KEY_QUICKSLOTS = "quickslots"; - public static final String KEY_LANG = "language"; - public static final String KEY_CLASSICFONT = "classic_font"; - public static final String KEY_INTRO = "intro"; - public static final String KEY_BRIGHTNESS = "brightness"; - public static final String KEY_VERSION = "version"; - - private SharedPreferences prefs; - - private SharedPreferences get() { - if (prefs == null) { - prefs = Game.instance.getPreferences(Game.MODE_PRIVATE); - } - return prefs; - } - - int getInt(String key, int defValue) { - return get().getInt(key, defValue); - } - - boolean getBoolean(String key, boolean defValue) { - return get().getBoolean(key, defValue); - } - - String getString(String key, String defValue) { - return get().getString(key, defValue); - } - - void put(String key, int value) { - get().edit().putInt(key, value).commit(); - } - - void put(String key, boolean value) { - get().edit().putBoolean(key, value).commit(); - } - - void put(String key, String value) { - get().edit().putString(key, value).commit(); - } -} diff --git a/java/com/hmdzl/spspd/change/QuickSlot.java b/java/com/hmdzl/spspd/change/QuickSlot.java deleted file mode 100644 index fe6d8b7f..00000000 --- a/java/com/hmdzl/spspd/change/QuickSlot.java +++ /dev/null @@ -1,134 +0,0 @@ -package com.hmdzl.spspd.change; - -import java.util.ArrayList; -import java.util.Collection; - -import com.hmdzl.spspd.change.items.Item; -import com.watabou.utils.Bundlable; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -/** - * Created by debenhame on 16/01/2015. - */ -public class QuickSlot { - - /** - * Slots contain objects which are also in a player's inventory. The one - * exception to this is when quantity is 0, which can happen for a stackable - * item that has been 'used up', these are refered to a placeholders. - */ - - // note that the current max size is coded at 4, due to UI constraints, but - // it could be much much bigger with no issue. - public static int SIZE = 6; - private Item[] slots = new Item[SIZE]; - - // direct array interaction methods, everything should build from these - // methods. - public void setSlot(int slot, Item item) { - clearItem(item); // we don't want to allow the same item in multiple - // slots. - slots[slot] = item; - } - - public void clearSlot(int slot) { - slots[slot] = null; - } - - public void reset() { - slots = new Item[SIZE]; - } - - public Item getItem(int slot) { - return slots[slot]; - } - - // utility methods, for easier use of the internal array. - public int getSlot(Item item) { - for (int i = 0; i < SIZE; i++) - if (getItem(i) == item) - return i; - return -1; - } - - public Boolean isPlaceholder(int slot) { - return getItem(slot) != null && getItem(slot).quantity() == 0; - } - - public Boolean isNonePlaceholder(int slot) { - return getItem(slot) != null && getItem(slot).quantity() > 0; - } - - public void clearItem(Item item) { - if (contains(item)) - clearSlot(getSlot(item)); - } - - public boolean contains(Item item) { - return getSlot(item) != -1; - } - - public void replaceSimilar(Item item) { - for (int i = 0; i < SIZE; i++) - if (getItem(i) != null && item.isSimilar(getItem(i))) - setSlot(i, item); - } - - public void convertToPlaceholder(Item item) { - Item placeholder = Item.virtual(item.getClass()); - - if (placeholder != null && contains(item)) - for (int i = 0; i < SIZE; i++) - if (getItem(i) == item) - setSlot(i, placeholder); - } - - public Item randomNonePlaceholder() { - - ArrayList result = new ArrayList(); - for (int i = 0; i < SIZE; i++) - if (getItem(i) != null && !isPlaceholder(i)) - result.add(getItem(i)); - - return Random.element(result); - } - - private final String PLACEHOLDERS = "placeholders"; - private final String PLACEMENTS = "placements"; - - /** - * Placements array is used as order is preserved while bundling, but exact - * index is not, so if we bundle both the placeholders (which preserves - * their order) and an array telling us where the placeholders are, we can - * reconstruct them perfectly. - */ - - public void storePlaceholders(Bundle bundle) { - ArrayList placeholders = new ArrayList(SIZE); - boolean[] placements = new boolean[SIZE]; - - for (int i = 0; i < SIZE; i++) - if (isPlaceholder(i)) { - placeholders.add(getItem(i)); - placements[i] = true; - } - bundle.put(PLACEHOLDERS, placeholders); - bundle.put(PLACEMENTS, placements); - } - - public void restorePlaceholders(Bundle bundle) { - Collection placeholders = bundle.getCollection(PLACEHOLDERS); - boolean[] placements = bundle.getBooleanArray(PLACEMENTS); - - int i = 0; - for (Bundlable item : placeholders) { - while (!placements[i]) - i++; - setSlot(i, (Item) item); - i++; - } - - } - -} diff --git a/java/com/hmdzl/spspd/change/Rankings.java b/java/com/hmdzl/spspd/change/Rankings.java deleted file mode 100644 index db6ba1f7..00000000 --- a/java/com/hmdzl/spspd/change/Rankings.java +++ /dev/null @@ -1,255 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change; - -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Comparator; - -import android.content.Context; - -import com.hmdzl.spspd.change.actors.blobs.ToxicGas; -import com.hmdzl.spspd.change.actors.buffs.Bleeding; -import com.hmdzl.spspd.change.actors.buffs.Burning; -import com.hmdzl.spspd.change.actors.buffs.Hunger; -import com.hmdzl.spspd.change.actors.buffs.Ooze; -import com.hmdzl.spspd.change.actors.buffs.Poison; -import com.hmdzl.spspd.change.actors.hero.HeroClass; -import com.hmdzl.spspd.change.actors.mobs.DM300; -import com.hmdzl.spspd.change.actors.mobs.Goo; -import com.hmdzl.spspd.change.actors.mobs.King; -import com.hmdzl.spspd.change.actors.mobs.Tengu; -import com.hmdzl.spspd.change.actors.mobs.Yog; -import com.hmdzl.spspd.change.items.Amulet; -import com.hmdzl.spspd.change.levels.features.Chasm; -import com.hmdzl.spspd.change.messages.Languages; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.noosa.Game; -import com.watabou.utils.Bundlable; -import com.watabou.utils.Bundle; -import com.watabou.utils.SystemTime; - -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Comparator; -import java.util.Locale; - -import com.hmdzl.spspd.change.actors.hero.HeroClass; -import com.watabou.noosa.Game; -import com.watabou.utils.Bundlable; -import com.watabou.utils.Bundle; -import com.watabou.utils.SystemTime; - -public enum Rankings { - - INSTANCE; - - public static final int TABLE_SIZE = 11; - - public static final String RANKINGS_FILE = "rankings.dat"; - public static final String DETAILS_FILE = "game_%d.dat"; - - public ArrayList records; - public int lastRecord; - public int totalNumber; - public int wonNumber; - - public void submit(boolean win) { - - load(); - - Record rec = new Record(); - - rec.info = Dungeon.resultDescription; - rec.win = win; - rec.heroClass = Dungeon.hero.heroClass; - rec.skin = 7-Dungeon.skins; - rec.herolevel = Dungeon.hero.lvl; - rec.depth = Dungeon.depth; - rec.score = score(win); - - String gameFile = Messages.format( DETAILS_FILE, SystemTime.now ); - try { - Dungeon.saveGame(gameFile); - rec.gameFile = gameFile; - } catch (IOException e) { - rec.gameFile = ""; - } - - records.add(rec); - - Collections.sort(records, scoreComparator); - - lastRecord = records.indexOf(rec); - int size = records.size(); - while (size > TABLE_SIZE) { - - Record removedGame; - if (lastRecord == size - 1) { - removedGame = records.remove(size - 2); - lastRecord--; - } else { - removedGame = records.remove(size - 1); - } - - if (removedGame.gameFile.length() > 0) { - Game.instance.deleteFile(removedGame.gameFile); - } - - size = records.size(); - } - - totalNumber++; - if (win) { - wonNumber++; - } - - Badges.validateGamesPlayed(); - - save(); - } - - private int score(boolean win) { - return (Statistics.goldCollected + Dungeon.hero.lvl - * (win ? 26 : Dungeon.depth) * 100) - * (win ? 2 : 1); - } - - private static final String RECORDS = "records"; - private static final String LATEST = "latest"; - private static final String TOTAL = "total"; - private static final String WON = "won"; - - public void save() { - Bundle bundle = new Bundle(); - bundle.put(RECORDS, records); - bundle.put(LATEST, lastRecord); - bundle.put(TOTAL, totalNumber); - bundle.put(WON, wonNumber); - - try { - OutputStream output = Game.instance.openFileOutput(RANKINGS_FILE, - Game.MODE_PRIVATE); - Bundle.write(bundle, output); - output.close(); - } catch (IOException e) { - } - } - - public void load() { - - if (records != null) { - return; - } - - records = new ArrayList(); - - try { - InputStream input = Game.instance.openFileInput(RANKINGS_FILE); - Bundle bundle = Bundle.read(input); - input.close(); - - for (Bundlable record : bundle.getCollection(RECORDS)) { - records.add((Record) record); - } - lastRecord = bundle.getInt(LATEST); - - totalNumber = bundle.getInt(TOTAL); - if (totalNumber == 0) { - totalNumber = records.size(); - } - - wonNumber = bundle.getInt(WON); - if (wonNumber == 0) { - for (Record rec : records) { - if (rec.win) { - wonNumber++; - } - } - } - - } catch (IOException e) { - - } - } - - public static class Record implements Bundlable { - - private static final String REASON = "reason"; - private static final String WIN = "win"; - private static final String SCORE = "score"; - private static final String SKIN = "skin"; - private static final String LEVEL = "level"; - private static final String DEPTH = "depth"; - private static final String GAME = "gameFile"; - - public String info; - public boolean win; - - public HeroClass heroClass; - public int skin; - public int herolevel; - public int depth; - - public int score; - - public String gameFile; - - @Override - public void restoreFromBundle(Bundle bundle) { - - info = bundle.getString(REASON); - win = bundle.getBoolean(WIN); - score = bundle.getInt(SCORE); - heroClass = HeroClass.restoreInBundle(bundle); - skin = bundle.getInt(SKIN); - gameFile = bundle.getString(GAME); - depth = bundle.getInt(DEPTH); - herolevel = bundle.getInt(LEVEL); - - } - - @Override - public void storeInBundle(Bundle bundle) { - - bundle.put(REASON, info); - bundle.put(WIN, win); - bundle.put(SCORE, score); - - heroClass.storeInBundle(bundle); - bundle.put(SKIN, skin); - bundle.put(LEVEL, herolevel); - bundle.put(DEPTH, depth); - - bundle.put(GAME, gameFile); - } - } - - private static final Comparator scoreComparator = new Comparator() { - @Override - public int compare(Record lhs, Record rhs) { - return (int) Math.signum(rhs.score - lhs.score); - } - }; -} diff --git a/java/com/hmdzl/spspd/change/ResultDescriptions.java b/java/com/hmdzl/spspd/change/ResultDescriptions.java deleted file mode 100644 index 054414cb..00000000 --- a/java/com/hmdzl/spspd/change/ResultDescriptions.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change; - -import com.hmdzl.spspd.change.messages.Messages; - -public class ResultDescriptions { - - // Mobs - public static final String MOB = "MOB"; - public static final String UNIQUE = "UNIQUE"; - public static final String NAMED = "NAMED"; - - // Items - public static final String ITEM = "ITEM"; - public static final String GLYPH = "GLYPH"; - - // Dungeon features - public static final String TRAP = "TRAP"; - - // Debuffs & blobs - public static final String BURNING = "BURNING"; - public static final String HUNGER = "HUNGER"; - public static final String POISON = "POISON"; - public static final String GAS = "GAS"; - public static final String BLEEDING = "BLEEDING"; - public static final String OOZE = "OOZE"; - public static final String FALL = "FALL"; - public static final String COUNTDOWN = "COUNTDOWN"; - public static final String CHEAT = "CHEAT"; - - public static final String WIN = "WIN"; - public static final String WIN2 = "WIN2"; -} diff --git a/java/com/hmdzl/spspd/change/SPSSettings.java b/java/com/hmdzl/spspd/change/SPSSettings.java deleted file mode 100644 index 3665d03c..00000000 --- a/java/com/hmdzl/spspd/change/SPSSettings.java +++ /dev/null @@ -1,263 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * Shattered Pixel Dungeon - * Copyright (C) 2014-2017 Evan Debenham - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ - -package com.hmdzl.spspd.change; - -import com.hmdzl.spspd.change.messages.Languages; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.watabou.noosa.Game; -import com.watabou.noosa.RenderedText; -import com.watabou.noosa.audio.Music; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.GameSettings; - -import java.util.Locale; - -import static java.lang.reflect.Array.getInt; - -public class SPSSettings extends GameSettings { - - //Version info - - public static final String KEY_VERSION = "version"; - - public static void version( int value) { - put( KEY_VERSION, value ); - } - - public static int version() { - return getInt( KEY_VERSION, 0 ); - } - - //Graphics - - public static final String KEY_FULLSCREEN = "fullscreen"; - public static final String KEY_LANDSCAPE = "landscape"; - public static final String KEY_POWER_SAVER = "power_saver"; - public static final String KEY_SCALE = "scale"; - public static final String KEY_ZOOM = "zoom"; - public static final String KEY_BRIGHTNESS = "brightness"; - public static final String KEY_GRID = "visual_grid"; - - /*public static void fullscreen( boolean value ) { - put( KEY_FULLSCREEN, value ); - - ShatteredPixelDungeon.instance.runOnUiThread( new Runnable() { - @Override - public void run() { - ShatteredPixelDungeon.updateSystemUI(); - } - } ); - }*/ - - public static boolean fullscreen() { - return getBoolean( KEY_FULLSCREEN, false ); - } - - /*public static void landscape( boolean value ){ - put( KEY_LANDSCAPE, value ); - ((ShatteredPixelDungeon)ShatteredPixelDungeon.instance).updateDisplaySize(); - }*/ - - public static boolean landscape() { - return getBoolean(KEY_LANDSCAPE, Game.dispWidth > Game.dispHeight); - } - - /*public static void powerSaver( boolean value ){ - put( KEY_POWER_SAVER, value ); - ((ShatteredPixelDungeon)ShatteredPixelDungeon.instance).updateDisplaySize(); - }*/ - - public static boolean powerSaver(){ - return getBoolean( KEY_POWER_SAVER, false ); - } - - public static void scale( int value ) { - put( KEY_SCALE, value ); - } - - public static int scale() { - return getInt( KEY_SCALE, 0 ); - } - - public static void zoom( int value ) { - put( KEY_ZOOM, value ); - } - - public static int zoom() { - return getInt( KEY_ZOOM, 0 ); - } - - /*public static void brightness( int value ) { - put( KEY_BRIGHTNESS, value ); - GameScene.updateFog(); - }*/ - - /*public static int brightness() { - return getInt( KEY_BRIGHTNESS, 0, -2, 2 ); - }*/ - - public static void visualGrid( int value ){ - put( KEY_GRID, value ); - GameScene.updateMap(); - } - - public static int visualGrid() { - return getInt( KEY_GRID, 0, -1, 3 ); - } - - //Interface - - public static final String KEY_QUICKSLOTS = "quickslots"; - public static final String KEY_FLIPTOOLBAR = "flipped_ui"; - public static final String KEY_FLIPTAGS = "flip_tags"; - public static final String KEY_BARMODE = "toolbar_mode"; - - public static void quickSlots( int value ){ put( KEY_QUICKSLOTS, value ); } - - public static int quickSlots(){ return getInt( KEY_QUICKSLOTS, 4, 0, 4); } - - public static void flipToolbar( boolean value) { - put(KEY_FLIPTOOLBAR, value ); - } - - public static boolean flipToolbar(){ return getBoolean(KEY_FLIPTOOLBAR, false); } - - public static void flipTags( boolean value) { - put(KEY_FLIPTAGS, value ); - } - - public static boolean flipTags(){ return getBoolean(KEY_FLIPTAGS, false); } - - public static void toolbarMode( String value ) { - put( KEY_BARMODE, value ); - } - - /*public static String toolbarMode() { - return getString(KEY_BARMODE, !SPDSettings.landscape() ? "SPLIT" : "GROUP"); - }*/ - - //Game State - - public static final String KEY_LAST_CLASS = "last_class"; - public static final String KEY_CHALLENGES = "challenges"; - public static final String KEY_INTRO = "intro"; - - public static void intro( boolean value ) { - put( KEY_INTRO, value ); - } - - public static boolean intro() { - return getBoolean( KEY_INTRO, true ); - } - - public static void lastClass( int value ) { - put( KEY_LAST_CLASS, value ); - } - - public static int lastClass() { - return getInt( KEY_LAST_CLASS, 0, 0, 3 ); - } - - public static void challenges( int value ) { - put( KEY_CHALLENGES, value ); - } - - /*public static int challenges() { - return getInt( KEY_CHALLENGES, 0, 0, Challenges.MAX_VALUE ); - }*/ - - //Audio - - public static final String KEY_MUSIC = "music"; - public static final String KEY_MUSIC_VOL = "music_vol"; - public static final String KEY_SOUND_FX = "soundfx"; - public static final String KEY_SFX_VOL = "sfx_vol"; - - public static void music( boolean value ) { - Music.INSTANCE.enable( value ); - put( KEY_MUSIC, value ); - } - - public static boolean music() { - return getBoolean( KEY_MUSIC, true ); - } - - public static void musicVol( int value ){ - Music.INSTANCE.volume(value/10f); - put( KEY_MUSIC_VOL, value ); - } - - public static int musicVol(){ - return getInt( KEY_MUSIC_VOL, 10, 0, 10 ); - } - - public static void soundFx( boolean value ) { - Sample.INSTANCE.enable( value ); - put( KEY_SOUND_FX, value ); - } - - public static boolean soundFx() { - return getBoolean( KEY_SOUND_FX, true ); - } - - /*public static void SFXVol( int value ) { - Sample.INSTANCE.volume(value/10f); - put( KEY_SFX_VOL, value ); - }*/ - - public static int SFXVol() { - return getInt( KEY_SFX_VOL, 10, 0, 10 ); - } - - //Languages and Font - - public static final String KEY_LANG = "language"; - public static final String KEY_SYSTEMFONT = "system_font"; - - public static void language(Languages lang) { - put( KEY_LANG, lang.code()); - } - - public static Languages language() { - String code = getString(KEY_LANG, null); - if (code == null){ - return Languages.matchLocale(Locale.getDefault()); - } else { - return Languages.matchCode(code); - } - } - - public static void systemFont(boolean value){ - put(KEY_SYSTEMFONT, value); - if (!value) { - RenderedText.setFont("pixelfont.ttf"); - } else { - RenderedText.setFont( null ); - } - } - - public static boolean systemFont(){ - return getBoolean(KEY_SYSTEMFONT, - (/*language() == Languages.KOREAN ||*/ language() == Languages.CHINESE)); - } - -} diff --git a/java/com/hmdzl/spspd/change/ShatteredPixelDungeon.java b/java/com/hmdzl/spspd/change/ShatteredPixelDungeon.java deleted file mode 100644 index 1eba786c..00000000 --- a/java/com/hmdzl/spspd/change/ShatteredPixelDungeon.java +++ /dev/null @@ -1,337 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change; - -import javax.microedition.khronos.opengles.GL10; - -import android.annotation.SuppressLint; -import android.content.pm.ActivityInfo; -import android.os.Build; -import android.os.Bundle; -import android.util.DisplayMetrics; -import android.util.Log; -import android.view.View; - -import com.hmdzl.spspd.change.messages.Languages; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.scenes.PixelScene; -import com.hmdzl.spspd.change.scenes.TitleScene; -import com.hmdzl.spspd.change.scenes.WelcomeScene; -import com.watabou.noosa.Game; -import com.watabou.noosa.audio.Music; -import com.watabou.noosa.audio.Sample; -import com.watabou.noosa.RenderedText; - -import java.util.Locale; - -public class ShatteredPixelDungeon extends Game { - - public ShatteredPixelDungeon() { - super(WelcomeScene.class); - } - - @SuppressWarnings("deprecation") - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - - updateImmersiveMode(); - - DisplayMetrics metrics = new DisplayMetrics(); - instance.getWindowManager().getDefaultDisplay().getMetrics(metrics); - boolean landscape = metrics.widthPixels > metrics.heightPixels; - - if (Preferences.INSTANCE.getBoolean(Preferences.KEY_LANDSCAPE, false) != landscape) { - landscape(!landscape); - } - - Music.INSTANCE.enable(music()); - Sample.INSTANCE.enable(soundFx()); - - Sample.INSTANCE.load(Assets.SND_CLICK, Assets.SND_BADGE, - Assets.SND_GOLD, - - Assets.SND_STEP, Assets.SND_WATER, Assets.SND_OPEN, - Assets.SND_UNLOCK, Assets.SND_ITEM, Assets.SND_DEWDROP, - Assets.SND_HIT, Assets.SND_MISS, - - Assets.SND_DESCEND, Assets.SND_EAT, Assets.SND_READ, - Assets.SND_LULLABY, Assets.SND_DRINK, Assets.SND_SHATTER, - Assets.SND_ZAP, Assets.SND_LIGHTNING, Assets.SND_LEVELUP, - Assets.SND_DEATH, Assets.SND_CHALLENGE, Assets.SND_CURSED, - Assets.SND_EVOKE, Assets.SND_TRAP, Assets.SND_TOMB, - Assets.SND_ALERT, Assets.SND_MELD, Assets.SND_BOSS, - Assets.SND_BLAST, Assets.SND_PLANT, Assets.SND_RAY, - Assets.SND_BEACON, Assets.SND_TELEPORT, Assets.SND_CHARMS, - Assets.SND_MASTERY, Assets.SND_PUFF, Assets.SND_ROCKS, - Assets.SND_BURNING, Assets.SND_FALLING, Assets.SND_GHOST, - Assets.SND_SECRET, Assets.SND_BONES, Assets.SND_BEE, - Assets.SND_DEGRADE, Assets.SND_MIMIC); - - if (!SPSSettings.systemFont()) { - RenderedText.setFont("pixelfont.ttf"); - } else { - RenderedText.setFont( null ); - } - } - - @Override - public void onWindowFocusChanged(boolean hasFocus) { - - super.onWindowFocusChanged(hasFocus); - - if (hasFocus) { - updateImmersiveMode(); - } - } - - public static void switchNoFade(Class c){ - switchNoFade(c, null); - } - - public static void switchNoFade(Class c, SceneChangeCallback callback) { - PixelScene.noFade = true; - switchScene( c, callback ); - } - - /* - * ---> Prefernces - */ - - public static void landscape(boolean value) { - Game.instance - .setRequestedOrientation(value ? - ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE - : ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); - Preferences.INSTANCE.put(Preferences.KEY_LANDSCAPE, value); - } - - public static boolean landscape() { - return width > height; - } - - public static void scaleUp(boolean value) { - Preferences.INSTANCE.put(Preferences.KEY_SCALE_UP, value); - switchScene(TitleScene.class); - } - - // *** IMMERSIVE MODE **** - - private static boolean immersiveModeChanged = false; - - @SuppressLint("NewApi") - public static void immerse(boolean value) { - Preferences.INSTANCE.put(Preferences.KEY_IMMERSIVE, value); - - instance.runOnUiThread(new Runnable() { - @Override - public void run() { - updateImmersiveMode(); - immersiveModeChanged = true; - } - }); - } - - @Override - public void onSurfaceChanged(GL10 gl, int width, int height) { - super.onSurfaceChanged(gl, width, height); - - if (immersiveModeChanged) { - requestedReset = true; - immersiveModeChanged = false; - } - } - - private void updateDisplaySize(){ - DisplayMetrics m = new DisplayMetrics(); - if (immersed() && Build.VERSION.SDK_INT >= 19) - getWindowManager().getDefaultDisplay().getRealMetrics( m ); - else - getWindowManager().getDefaultDisplay().getMetrics( m ); - dispHeight = m.heightPixels; - dispWidth = m.widthPixels; - - float dispRatio = dispWidth / (float)dispHeight; - - float renderWidth = dispRatio > 1 ? PixelScene.MIN_WIDTH_L : PixelScene.MIN_WIDTH_P; - float renderHeight = dispRatio > 1 ? PixelScene.MIN_HEIGHT_L : PixelScene.MIN_HEIGHT_P; - - runOnUiThread(new Runnable() { - @Override - public void run() { - view.getHolder().setSizeFromLayout(); - } - }); - - } - - @SuppressLint("NewApi") - public static void updateImmersiveMode() { - if (android.os.Build.VERSION.SDK_INT >= 19) { - try { - // Sometime NullPointerException happens here - instance.getWindow() - .getDecorView() - .setSystemUiVisibility( - immersed() ? View.SYSTEM_UI_FLAG_LAYOUT_STABLE - | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION - | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN - | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION - | View.SYSTEM_UI_FLAG_FULLSCREEN - | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY - : 0); - } catch (Exception e) { - reportException(e); - } - } - } - - public static boolean immersed() { - return Preferences.INSTANCE - .getBoolean(Preferences.KEY_IMMERSIVE, false); - } - - // ***************************** - - public static boolean scaleUp() { - return Preferences.INSTANCE.getBoolean(Preferences.KEY_SCALE_UP, true); - } - - public static void zoom(int value) { - Preferences.INSTANCE.put(Preferences.KEY_ZOOM, value); - } - - public static int zoom() { - return Preferences.INSTANCE.getInt(Preferences.KEY_ZOOM, 0); - } - - public static void music(boolean value) { - Music.INSTANCE.enable(value); - Preferences.INSTANCE.put(Preferences.KEY_MUSIC, value); - } - - public static boolean music() { - return Preferences.INSTANCE.getBoolean(Preferences.KEY_MUSIC, true); - } - - public static void soundFx(boolean value) { - Sample.INSTANCE.enable(value); - Preferences.INSTANCE.put(Preferences.KEY_SOUND_FX, value); - } - - public static boolean soundFx() { - return Preferences.INSTANCE.getBoolean(Preferences.KEY_SOUND_FX, true); - } - - public static void brightness(boolean value) { - Preferences.INSTANCE.put(Preferences.KEY_BRIGHTNESS, value); - if (scene() instanceof GameScene) { - ((GameScene) scene()).brightness(value); - } - } - - public static boolean brightness() { - return Preferences.INSTANCE.getBoolean(Preferences.KEY_BRIGHTNESS, - false); - } - - /*public static void language(Languages lang) { - Preferences.INSTANCE.put( Preferences.KEY_LANG, lang.code()); - if (lang == Languages.RUSSIAN || lang == Languages.CHINESE || lang == Languages.KOREAN) - RenderedText.setFont(null); - else if (classicFont()) - RenderedText.setFont("pixelfont.ttf"); - }*/ - - /*public static Languages language() { - String code = Preferences.INSTANCE.getString(Preferences.KEY_LANG, null); - if (code == null){ - Languages lang = Languages.matchLocale(Locale.getDefault()); - if (lang.status() == Languages.Status.REVIEWED) - return lang; - else - return Languages.ENGLISH; - } - else return Languages.matchCode(code); - }*/ - - /*public static void classicFont(boolean classic){ - Preferences.INSTANCE.put(Preferences.KEY_CLASSICFONT, classic); - if (classic) { - RenderedText.setFont("pixelfont.ttf"); - } else { - RenderedText.setFont( null ); - } - }*/ - - /*public static boolean classicFont(){ - Languages lang = ShatteredPixelDungeon.language(); - if (lang == Languages.RUSSIAN ||lang == Languages.CHINESE || lang == Languages.KOREAN ) - return false; - else - return Preferences.INSTANCE.getBoolean(Preferences.KEY_CLASSICFONT, true); - } */ - - public static void lastClass(int value) { - Preferences.INSTANCE.put(Preferences.KEY_LAST_CLASS, value); - } - - public static int lastClass() { - return Preferences.INSTANCE.getInt(Preferences.KEY_LAST_CLASS, 0); - } - - public static void challenges(int value) { - Preferences.INSTANCE.put(Preferences.KEY_CHALLENGES, value); - } - - public static int challenges() { - return Preferences.INSTANCE.getInt(Preferences.KEY_CHALLENGES, 0); - } - - public static void quickSlots(int value) { - Preferences.INSTANCE.put(Preferences.KEY_QUICKSLOTS, value); - } - - public static int quickSlots() { - return Preferences.INSTANCE.getInt(Preferences.KEY_QUICKSLOTS, 1); - } - - public static void intro(boolean value) { - Preferences.INSTANCE.put(Preferences.KEY_INTRO, value); - } - - public static boolean intro() { - return Preferences.INSTANCE.getBoolean(Preferences.KEY_INTRO, true); - } - - public static void version(int value) { - Preferences.INSTANCE.put(Preferences.KEY_VERSION, value); - } - - public static int version() { - return Preferences.INSTANCE.getInt(Preferences.KEY_VERSION, 0); - } - - /* - * <--- Preferences - */ - - public static void reportException(Throwable tr) { - Log.e("PD", Log.getStackTraceString(tr)); - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/Skins.java b/java/com/hmdzl/spspd/change/Skins.java deleted file mode 100644 index 83edda83..00000000 --- a/java/com/hmdzl/spspd/change/Skins.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change; - -public class Skins { - - public static final int NORMAL = 0; - public static final int FIRST = 1; - public static final int SECOND = 2; - public static final int THIRD = 3; - - public static final String[] NAME_IDS = { - "normal", - "first", - "second", - "third", - }; - - public static final int[] MASKS = { - NORMAL, FIRST,SECOND,THIRD}; - -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/Statistics.java b/java/com/hmdzl/spspd/change/Statistics.java deleted file mode 100644 index ed23efc2..00000000 --- a/java/com/hmdzl/spspd/change/Statistics.java +++ /dev/null @@ -1,197 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change; - -import com.watabou.utils.Bundle; - -//move target 300 + d3*lvl - -public class Statistics { - - public static int goldCollected; - public static int deepestFloor; - public static int realdeepestFloor; - public static int enemiesSlain; - public static int foodEaten; - public static int eggBreak; - public static int potionsCooked; - public static int piranhasKilled; - public static int archersKilled; - public static int skeletonsKilled; - public static int assassinsKilled; - public static int albinoPiranhasKilled; - public static int goldThievesKilled; - public static int shadowYogsKilled; - public static int nightHunt; - public static int ankhsUsed; - public static int ballsCooked; - public static int waters; - public static int sewerKills; - public static int prisonKills; - public static int petDies; - - public static float duration; - public static int floormoves; - public static int prevfloormoves; - public static int moves; - public static float time; - - - public static boolean qualifiedForNoKilling = false; - public static boolean completedWithNoKilling = false; - - - public static boolean amuletObtained = false; - public static boolean orbObtained = false; - - - public static void reset() { - - goldCollected = 0; - deepestFloor = 0; - realdeepestFloor = 0; - enemiesSlain = 0; - foodEaten = 0; - eggBreak = 0; - potionsCooked = 0; - - piranhasKilled = 0; - archersKilled = 0; - assassinsKilled = 0; - skeletonsKilled = 0; - albinoPiranhasKilled = 0; - goldThievesKilled = 0; - shadowYogsKilled = 0; - nightHunt = 0; - ankhsUsed = 0; - ballsCooked = 0; - waters = 0; - sewerKills = 0; - prisonKills = 0; - petDies = 0; - - duration = 0; - moves = 0; - floormoves = 0; - prevfloormoves = 0; - time = 360; - - qualifiedForNoKilling = false; - - amuletObtained = false; - orbObtained = false; - - } - - private static final String GOLD = "score"; - private static final String DEEPEST = "maxDepth"; - private static final String REALDEEPEST = "maxDepthReal"; - private static final String SLAIN = "enemiesSlain"; - private static final String FOOD = "foodEaten"; - private static final String EGG = "eggBreak"; - private static final String ALCHEMY = "potionsCooked"; - private static final String PIRANHAS = "priranhas"; - private static final String WATERS = "waters"; - - private static final String ARCHERS = "archers"; - private static final String SKELETONS = "skeletons"; - private static final String ASSASSINS = "assassins"; - private static final String APIRANHAS = "apiranhas"; - private static final String THIEVES = "thieves"; - private static final String SYOGS = "syogs"; - private static final String BALLS = "balls"; - private static final String PRISONKILLS = "prisonKills"; - private static final String SEWERKILLS = "sewerKills"; - private static final String PETDIES = "petDies"; - - private static final String NIGHT = "nightHunt"; - private static final String ANKHS = "ankhsUsed"; - private static final String DURATION = "duration"; - private static final String FLOORMOVES = "floormoves"; - private static final String PREVFLOORMOVES = "prevfloormoves"; - private static final String MOVES = "moves"; - private static final String TIME = "time"; - private static final String AMULET = "amuletObtained"; - private static final String ORB = "orbObtained"; - - public static void storeInBundle(Bundle bundle) { - bundle.put(GOLD, goldCollected); - bundle.put(DEEPEST, deepestFloor); - bundle.put(REALDEEPEST, realdeepestFloor); - bundle.put(SLAIN, enemiesSlain); - bundle.put(FOOD, foodEaten); - bundle.put(EGG, eggBreak); - bundle.put(ALCHEMY, potionsCooked); - bundle.put(PIRANHAS, piranhasKilled); - bundle.put(ARCHERS, archersKilled); - bundle.put(SKELETONS, skeletonsKilled); - bundle.put(ASSASSINS, assassinsKilled); - bundle.put(APIRANHAS, albinoPiranhasKilled); - bundle.put(THIEVES, goldThievesKilled); - bundle.put(SYOGS, shadowYogsKilled); - bundle.put(BALLS, ballsCooked); - bundle.put(NIGHT, nightHunt); - bundle.put(ANKHS, ankhsUsed); - bundle.put(DURATION, duration); - bundle.put(FLOORMOVES, floormoves); - bundle.put(PREVFLOORMOVES, prevfloormoves); - bundle.put(MOVES, moves); - bundle.put(TIME, time); - bundle.put(AMULET, amuletObtained); - bundle.put(ORB, orbObtained); - bundle.put(WATERS, waters); - bundle.put(SEWERKILLS, sewerKills); - bundle.put(PRISONKILLS, prisonKills); - bundle.put(PETDIES, petDies); - } - - public static void restoreFromBundle(Bundle bundle) { - goldCollected = bundle.getInt(GOLD); - deepestFloor = bundle.getInt(DEEPEST); - realdeepestFloor = bundle.getInt(REALDEEPEST); - enemiesSlain = bundle.getInt(SLAIN); - foodEaten = bundle.getInt(FOOD); - eggBreak = bundle.getInt(EGG); - potionsCooked = bundle.getInt(ALCHEMY); - piranhasKilled = bundle.getInt(PIRANHAS); - waters = bundle.getInt(WATERS); - sewerKills = bundle.getInt(SEWERKILLS); - prisonKills = bundle.getInt(PRISONKILLS); - petDies = bundle.getInt(PETDIES); - - archersKilled = bundle.getInt(ARCHERS); - skeletonsKilled = bundle.getInt(SKELETONS); - assassinsKilled = bundle.getInt(ASSASSINS); - albinoPiranhasKilled = bundle.getInt(APIRANHAS); - goldThievesKilled = bundle.getInt(THIEVES); - shadowYogsKilled = bundle.getInt(SYOGS); - ballsCooked = bundle.getInt(BALLS); - - nightHunt = bundle.getInt(NIGHT); - ankhsUsed = bundle.getInt(ANKHS); - duration = bundle.getFloat(DURATION); - floormoves = bundle.getInt(FLOORMOVES); - prevfloormoves = bundle.getInt(PREVFLOORMOVES); - moves = bundle.getInt(MOVES); - time = bundle.getInt(TIME); - amuletObtained = bundle.getBoolean(AMULET); - orbObtained = bundle.getBoolean(ORB); - - } - -} diff --git a/java/com/hmdzl/spspd/change/actors/Actor.java b/java/com/hmdzl/spspd/change/actors/Actor.java deleted file mode 100644 index 468a1bcd..00000000 --- a/java/com/hmdzl/spspd/change/actors/Actor.java +++ /dev/null @@ -1,288 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors; - -import java.util.Arrays; -import java.util.HashSet; - -import android.util.SparseArray; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.Statistics; -import com.hmdzl.spspd.change.actors.blobs.Blob; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.levels.Level; -import com.watabou.utils.Bundlable; -import com.watabou.utils.Bundle; - -public abstract class Actor implements Bundlable { - - public static final float TICK = 1f; - - private float time; - - private int id = 0; - - protected abstract boolean act(); - - protected void spend(float time) { - this.time += time; - } - - protected void postpone(float time) { - if (this.time < now + time) { - this.time = now + time; - } - } - - public float cooldown() { - return time - now; - } - - protected void diactivate() { - time = Float.MAX_VALUE; - } - - protected void onAdd() { - } - - protected void onRemove() { - } - - private static final String TIME = "time"; - private static final String ID = "id"; - - @Override - public void storeInBundle(Bundle bundle) { - bundle.put(TIME, time); - bundle.put(ID, id); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - time = bundle.getFloat(TIME); - id = bundle.getInt(ID); - } - - private static int nextID = 1; - - public int id() { - if (id > 0) { - return id; - } else { - return (id = nextID++); - } - } - - // ********************** - // *** Static members *** - - private static HashSet all = new HashSet(); - private static Actor current; - - private static SparseArray ids = new SparseArray(); - - private static float now = 0; - - private static Char[] chars = new Char[Level.getLength()]; - - public static float now(){ - return now; - } - - public static void clear() { - - now = 0; - - Arrays.fill(chars, null); - all.clear(); - - ids.clear(); - } - - public static void fixTime() { - - if (Dungeon.hero != null && all.contains(Dungeon.hero)) { - Statistics.duration += now; - } - - float min = Float.MAX_VALUE; - for (Actor a : all) { - if (a.time < min) { - min = a.time; - } - } - for (Actor a : all) { - a.time -= min; - } - now = 0; - } - - public static void init() { - - addDelayed(Dungeon.hero, -Float.MIN_VALUE); - - for (Mob mob : Dungeon.level.mobs) { - add(mob); - } - - for (Blob blob : Dungeon.level.blobs.values()) { - add(blob); - } - - current = null; - } - - private static final String NEXTID = "nextid"; - - public static void storeNextID(Bundle bundle) { - bundle.put(NEXTID, nextID); - } - - public static void restoreNextID(Bundle bundle) { - nextID = bundle.getInt(NEXTID); - } - - public static void resetNextID() { - nextID = 1; - } - - public static void occupyCell(Char ch) { - chars[ch.pos] = ch; - } - - public static void freeCell(int pos) { - chars[pos] = null; - } - - /* protected */public void next() { - if (current == this) { - current = null; - } - } - - public static void process() { - - if (current != null) { - return; - } - - boolean doNext; - - do { - now = Float.MAX_VALUE; - current = null; - - Arrays.fill(chars, null); - - for (Actor actor : all) { - // Order of actions when time is equal: - // 1. Hero - // 2. Other Chars - // 3. Other Actors (e.g. blobs) - if (actor.time < now - || (actor instanceof Hero && actor.time == now) - || (actor instanceof Char && actor.time == now && !(current instanceof Hero))) { - now = actor.time; - current = actor; - } - - if (actor instanceof Char) { - Char ch = (Char) actor; - chars[ch.pos] = ch; - } - } - - if (current != null) { - - if (current instanceof Char && ((Char) current).sprite.isMoving) { - // If it's character's turn to act, but its sprite - // is moving, wait till the movement is over - current = null; - break; - } - - doNext = current.act(); - if (doNext && !Dungeon.hero.isAlive()) { - doNext = false; - current = null; - } - } else { - doNext = false; - } - - } while (doNext); - } - - public static void add(Actor actor) { - add(actor, now); - } - - public static void addDelayed(Actor actor, float delay) { - add(actor, now + delay); - } - - private static void add(Actor actor, float time) { - - if (all.contains(actor)) { - return; - } - - ids.put(actor.id(), actor); - - all.add(actor); - actor.time += time; - actor.onAdd(); - - if (actor instanceof Char) { - Char ch = (Char) actor; - chars[ch.pos] = ch; - for (Buff buff : ch.buffs()) { - all.add(buff); - buff.onAdd(); - } - } - } - - public static void remove(Actor actor) { - - if (actor != null) { - all.remove(actor); - //chars.remove( actor ); - actor.onRemove(); - - if (actor.id > 0) { - ids.remove(actor.id); - } - } - } - - public static Char findChar(int pos) { - return chars[pos]; - } - - public static Actor findById(int id) { - return ids.get(id); - } - - public static HashSet all() { - return all; - } -} diff --git a/java/com/hmdzl/spspd/change/actors/Char.java b/java/com/hmdzl/spspd/change/actors/Char.java deleted file mode 100644 index 132c86fa..00000000 --- a/java/com/hmdzl/spspd/change/actors/Char.java +++ /dev/null @@ -1,751 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashSet; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.ResultDescriptions; -import com.hmdzl.spspd.change.actors.blobs.ToxicGas; -import com.hmdzl.spspd.change.actors.buffs.Amok; -import com.hmdzl.spspd.change.actors.buffs.ArmorBreak; -import com.hmdzl.spspd.change.actors.buffs.AttackDown; -import com.hmdzl.spspd.change.actors.buffs.AttackUp; -import com.hmdzl.spspd.change.actors.buffs.Bleeding; -import com.hmdzl.spspd.change.actors.buffs.Bless; -import com.hmdzl.spspd.change.actors.buffs.BloodAngry; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Burning; -import com.hmdzl.spspd.change.actors.buffs.Charm; -import com.hmdzl.spspd.change.actors.buffs.Cold; -import com.hmdzl.spspd.change.actors.buffs.Corruption; -import com.hmdzl.spspd.change.actors.buffs.Cripple; -import com.hmdzl.spspd.change.actors.buffs.Chill; -import com.hmdzl.spspd.change.actors.buffs.DamageUp; -import com.hmdzl.spspd.change.actors.buffs.DefenceUp; -import com.hmdzl.spspd.change.actors.buffs.Disarm; -import com.hmdzl.spspd.change.actors.buffs.EarthImbue; -import com.hmdzl.spspd.change.actors.buffs.FireImbue; -import com.hmdzl.spspd.change.actors.buffs.Frost; -import com.hmdzl.spspd.change.actors.buffs.FrostImbue; -import com.hmdzl.spspd.change.actors.buffs.GlassShield; -import com.hmdzl.spspd.change.actors.buffs.Haste; -import com.hmdzl.spspd.change.actors.buffs.HighAttack; -import com.hmdzl.spspd.change.actors.buffs.HighVoice; -import com.hmdzl.spspd.change.actors.buffs.Hot; -import com.hmdzl.spspd.change.actors.buffs.MechArmor; -import com.hmdzl.spspd.change.actors.buffs.Needling; -import com.hmdzl.spspd.change.actors.buffs.ParyAttack; -import com.hmdzl.spspd.change.actors.buffs.Rhythm; -import com.hmdzl.spspd.change.actors.buffs.Rhythm2; -import com.hmdzl.spspd.change.actors.buffs.Shield; -import com.hmdzl.spspd.change.actors.buffs.ShieldArmor; -import com.hmdzl.spspd.change.actors.buffs.Shocked; -import com.hmdzl.spspd.change.actors.buffs.Tar; -import com.hmdzl.spspd.change.actors.buffs.Invisibility; -import com.hmdzl.spspd.change.actors.buffs.Levitation; -import com.hmdzl.spspd.change.actors.buffs.Light; -import com.hmdzl.spspd.change.actors.buffs.MagicalSleep; -import com.hmdzl.spspd.change.actors.buffs.MindVision; -import com.hmdzl.spspd.change.actors.buffs.Paralysis; -import com.hmdzl.spspd.change.actors.buffs.Poison; -import com.hmdzl.spspd.change.actors.buffs.Roots; -import com.hmdzl.spspd.change.actors.buffs.Shadows; -import com.hmdzl.spspd.change.actors.buffs.Sleep; -import com.hmdzl.spspd.change.actors.buffs.Slow; -import com.hmdzl.spspd.change.actors.buffs.Speed; -import com.hmdzl.spspd.change.actors.buffs.Taunt; -import com.hmdzl.spspd.change.actors.buffs.Terror; -import com.hmdzl.spspd.change.actors.buffs.Vertigo; -import com.hmdzl.spspd.change.actors.buffs.BloodImbue; -import com.hmdzl.spspd.change.actors.buffs.Shieldblock; -import com.hmdzl.spspd.change.actors.buffs.Wet; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.hero.HeroAction; -import com.hmdzl.spspd.change.actors.hero.HeroClass; -import com.hmdzl.spspd.change.actors.hero.HeroSubClass; -import com.hmdzl.spspd.change.actors.mobs.Bestiary; -import com.hmdzl.spspd.change.actors.mobs.Yog; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Lightning; -import com.hmdzl.spspd.change.effects.Pushing; -import com.hmdzl.spspd.change.effects.particles.PoisonParticle; -import com.hmdzl.spspd.change.items.artifacts.CloakOfShadows; -import com.hmdzl.spspd.change.items.rings.RingOfElements; -import com.hmdzl.spspd.change.items.wands.WandOfFirebolt; -import com.hmdzl.spspd.change.items.weapon.enchantments.EnchantmentFire; -import com.hmdzl.spspd.change.items.weapon.enchantments.EnchantmentFire2; -import com.hmdzl.spspd.change.items.weapon.missiles.MissileWeapon; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.Terrain; -import com.hmdzl.spspd.change.levels.features.Door; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.hmdzl.spspd.change.utils.GLog; - -import com.watabou.noosa.Camera; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundlable; -import com.watabou.utils.Bundle; -import com.watabou.utils.GameMath; -import com.watabou.utils.Random; - -public abstract class Char extends Actor { - - protected static final String TXT_HIT = "%s hit %s"; - protected static final String TXT_KILL = "%s killed you..."; - protected static final String TXT_DEFEAT = "%s defeated %s"; - - private static final String TXT_YOU_MISSED = "%s %s your attack"; - private static final String TXT_SMB_MISSED = "%s %s %s's attack"; - - private static final String TXT_OUT_OF_PARALYSIS = "The pain snapped %s out of paralysis"; - - public int pos = 0; - - public CharSprite sprite; - - public String name = "mob"; - - public int HT; - public int HP; - - protected float baseSpeed = 1; - - public int paralysed = 0; - public boolean rooted = false; - public boolean flying = false; - public int invisible = 0; - - public int viewDistance = 8; - - private HashSet buffs = new HashSet(); - - @Override - protected boolean act() { - Dungeon.level.updateFieldOfView(this); - return false; - } - - private static final String POS = "pos"; - private static final String TAG_HP = "HP"; - private static final String TAG_HT = "HT"; - private static final String BUFFS = "buffs"; - - @Override - public void storeInBundle(Bundle bundle) { - - super.storeInBundle(bundle); - - bundle.put(POS, pos); - bundle.put(TAG_HP, HP); - bundle.put(TAG_HT, HT); - bundle.put(BUFFS, buffs); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - - super.restoreFromBundle(bundle); - - pos = bundle.getInt(POS); - HP = bundle.getInt(TAG_HP); - HT = bundle.getInt(TAG_HT); - - for (Bundlable b : bundle.getCollection(BUFFS)) { - if (b != null) { - ((Buff) b).attachTo(this); - } - } - } - - public boolean attack(Char enemy) { - - boolean visibleFight = Dungeon.visible[pos] - || Dungeon.visible[enemy.pos]; - - if (hit(this, enemy, false)) { - - /*if (visibleFight) { - GLog.i(TXT_HIT, name, enemy.name); - }*/ - - // FIXME - int dr = enemy.drRoll(); - - if (this instanceof Hero){ - Hero h = (Hero)this; - if ((h.belongings.weapon instanceof MissileWeapon - && h.subClass == HeroSubClass.SNIPER )|| - ( h.heroClass == HeroClass.FOLLOWER && Dungeon.skins == 2) ){ - dr = 0; - } - } - - int dmg = damageRoll(); - - AttackUp atkup = buff(AttackUp.class); - if (atkup != null) { - dmg *=(1f+atkup.level()*0.01f); - } - - AttackDown atkdown = buff(AttackDown.class); - if (atkdown != null) { - dmg *=(1f-atkdown.level()*0.01f); - } - - MechArmor marmor = buff(MechArmor.class); - if (marmor != null) { - dmg *=1.3f; - } - - DamageUp dmgup = buff(DamageUp.class); - if (dmgup != null) { - dmg +=dmgup.level(); - Buff.detach(this,DamageUp.class); - } - - - int effectiveDamage = Math.max(dmg - dr, 1); - - effectiveDamage = attackProc(enemy, effectiveDamage); - effectiveDamage = enemy.defenseProc(this, effectiveDamage); - - if (visibleFight) { - Sample.INSTANCE.play(Assets.SND_HIT, 1, 1, - Random.Float(0.8f, 1.25f)); - } - - // If the enemy is already dead, interrupt the attack. - // This matters as defence procs can sometimes inflict self-damage, - // such as armor glyphs. - if (!enemy.isAlive()) { - return true; - } - - // TODO: consider revisiting this and shaking in more cases. - float shake = 0f; - if (enemy == Dungeon.hero) - shake = effectiveDamage / (enemy.HT / 4); - - if (shake > 1f) - Camera.main.shake(GameMath.gate(1, shake, 5), 0.3f); - - enemy.damage(effectiveDamage, this); - - if (buff(FireImbue.class) != null) - buff(FireImbue.class).proc(enemy); - if (buff(EarthImbue.class) != null) - buff(EarthImbue.class).proc(enemy); - if (buff(BloodImbue.class) != null) - buff(BloodImbue.class).proc(enemy); - if (buff(FrostImbue.class) != null) - buff(FrostImbue.class).proc(enemy); - if (buff(Needling.class) != null) - buff(Needling.class).proc(enemy); - - enemy.sprite.bloodBurstA(sprite.center(), effectiveDamage); - enemy.sprite.flash(); - - if (!enemy.isAlive() && visibleFight) { - if (enemy == Dungeon.hero) { - if (Bestiary.isUnique(this)) { - Dungeon.fail(Messages.format(ResultDescriptions.UNIQUE)); - } else { - Dungeon.fail(Messages.format(ResultDescriptions.MOB)); - } - - } - } - return true; - - } else { - - if (visibleFight) { - String defense = enemy.defenseVerb(); - enemy.sprite.showStatus(CharSprite.NEUTRAL, defense); - Sample.INSTANCE.play(Assets.SND_MISS); - } - - return false; - - } - } - - public static boolean hit(Char attacker, Char defender, boolean magic) { - float acuRoll = Random.Float(attacker.hitSkill(defender)); - float defRoll = Random.Float(defender.evadeSkill(attacker)); - if (attacker.buff(Bless.class) != null) acuRoll *= 1.20f; - if (defender.buff(Bless.class) != null) defRoll *= 1.20f; - if (attacker.buff(Wet.class) != null) acuRoll *= 0.90f; - if (defender.buff(Wet.class) != null) defRoll *= 0.90f; - if (attacker.buff(Rhythm.class) != null) acuRoll *= 3.00f; - if (defender.buff(Rhythm.class) != null) defRoll *= 1.50f; - if (defender.buff(HighAttack.class) != null) defRoll *= 1.20f; - return (magic ? acuRoll * 2 : acuRoll) >= defRoll; - } - - public int hitSkill(Char target) { - return 0; - } - - public int evadeSkill(Char enemy) { - return 0; - } - - public String defenseVerb() { - return Messages.get(this,"def_verb"); - } - - public int drRoll() { - return 0; - } - - public int damageRoll() { - return 1; - } - - public int attackProc(Char enemy, int damage) { - if (buff(Shocked.class)!=null){ - Buff.detach(this,Shocked.class); - Buff.affect(this, Disarm.class,5f); - damage(this.HP/10,this); - ArrayList arcs = new ArrayList<>(); - arcs.add(new Lightning.Arc(pos - Level.WIDTH, pos + Level.WIDTH)); - arcs.add(new Lightning.Arc(pos - 1, pos + 1)); - sprite.parent.add( new Lightning( arcs, null ) ); - } - if (buff(HighVoice.class)!=null && Random.Int(5) == 0){ - Buff.affect(this, AttackUp.class,8f).level(30); - GLog.p(Messages.get(HighVoice.class,"atkup",Dungeon.hero.givenName())); - } - return damage; - } - - public int defenseProc(Char enemy, int damage) { - return damage; - } - - public float speed() { - if (buff(Cripple.class) != null){ - return baseSpeed * 0.5f; - } else if (buff(Haste.class) != null){ - return baseSpeed * 2.5f; - } else if (buff(Poison.class) != null) { - return baseSpeed * 0.9f; - } else if (buff(BloodAngry.class) != null) { - return baseSpeed * 1.2f; - } else if (buff(MechArmor.class) != null) { - return baseSpeed * 1.5f; - } else { - return baseSpeed; - } - - - } - - public void damage(int dmg, Object src) { - - if (this.buff(Frost.class) != null) { - Buff.detach(this, Frost.class); - dmg = (int) Math.ceil(dmg *1.5); - } - if (this.buff(MagicalSleep.class) != null) { - Buff.detach(this, MagicalSleep.class); - dmg = (int) Math.ceil(dmg *1.5); - } - - ArmorBreak ab = buff(ArmorBreak.class); - if (buff(ArmorBreak.class) != null){ - dmg= (int) Math.ceil(dmg *(ab.level()*0.01+1)); - } - - ParyAttack paryatk = buff(ParyAttack.class); - if (buff(ParyAttack.class) != null){ - dmg= (int) Math.ceil(dmg *Math.max((1-paryatk.level()*0.02),0.5)); - } - - if (buff(Hot.class) != null){ - dmg = (int) Math.ceil(dmg * 1.2); - } - - DefenceUp drup = buff(DefenceUp.class); - if (buff(DefenceUp.class) != null) { - dmg = (int) Math.ceil(dmg *(-drup.level()*0.01+1)); - } - - ShieldArmor sarmor = buff(ShieldArmor.class); - if (sarmor != null) { - dmg = sarmor.absorb(dmg); - } - - MechArmor marmor = buff(MechArmor.class); - if (marmor != null) { - dmg = marmor.absorb(dmg); - } - - if (HP <= 0 || dmg < 0) { - return; - } - - Class srcClass = src.getClass(); - if (immunities().contains(srcClass)) { - dmg = 0; - } else if (resistances().contains(srcClass)) { - dmg = Random.IntRange(0, dmg); - } else if (weakness().contains(srcClass)) { - dmg = Random.IntRange(dmg+1, 2*dmg); - } - - if (buff(Paralysis.class) != null) { - if (Random.Int(dmg) >= Random.Int(HP)) { - Buff.detach(this, Paralysis.class); - if (Dungeon.visible[pos]) { - GLog.i(Messages.get(this,"out_of_paralysis",name)); - } - } - } - - //GlassShield glass = buff(GlassShield.class); - if (buff(GlassShield.class) != null) { - if (dmg >= 10) { - dmg = 10; - Buff.detach(this, GlassShield.class); - } - } - //if (dmg > HP){ - //Buff.detach(this,Corruption.class);} - HP -= dmg; - - - if (dmg > 0 || src instanceof Char) { - sprite.showStatus(HP > HT / 2 ? CharSprite.WARNING - : CharSprite.NEGATIVE, Integer.toString(dmg)); - } - - if (HP <= 0 || HT <= 0) { - die(src); - } - } - - public void destroy() { - HP = 0; - Actor.remove(this); - Actor.freeCell(pos); - } - - public void die(Object src) { - destroy(); - sprite.die(); - } - - public boolean isAlive() { - return HP > 0 && HT > 0; - } - - @Override - protected void spend(float time) { - - float timeScale = 1f; - if (buff(Slow.class) != null) { - timeScale *= 0.67f; - } else if (buff( Chill.class ) != null) { - timeScale *= buff( Chill.class ).speedFactor(); - } - if (buff(Speed.class) != null) { - timeScale *= 1.5f; - } - /*if (buff(Haste.class) != null) { - timeScale *= 1.5f; - }*/ - if (buff(Cold.class) != null) { - timeScale *= 0.9f; - } - - if (buff(Tar.class) != null) { - timeScale *= 0.8f; - } - if (buff(Burning.class) != null) { - timeScale *= 1.25f; - } - - if (buff(Rhythm2.class) != null) { - timeScale *= 1.2f; - } - - super.spend(time / timeScale); - } - - public HashSet buffs() { - return buffs; - } - - @SuppressWarnings("unchecked") - public HashSet buffs(Class c) { - HashSet filtered = new HashSet(); - for (Buff b : buffs) { - if (c.isInstance(b)) { - filtered.add((T) b); - } - } - return filtered; - } - - @SuppressWarnings("unchecked") - public T buff(Class c) { - for (Buff b : buffs) { - if (c.isInstance(b)) { - return (T) b; - } - } - return null; - } - - public boolean isCharmedBy(Char ch) { - int chID = ch.id(); - for (Buff b : buffs) { - if (b instanceof Charm && ((Charm) b).object == chID) { - return true; - } - } - return false; - } - - public void add(Buff buff) { - - buffs.add(buff); - Actor.add(buff); - - if (sprite != null) - switch(buff.type){ - case POSITIVE: - sprite.showStatus(CharSprite.POSITIVE, buff.toString()); break; - case NEGATIVE: - sprite.showStatus(CharSprite.NEGATIVE, buff.toString());break; - case NEUTRAL: - sprite.showStatus(CharSprite.NEUTRAL, buff.toString()); break; - case SILENT: default: - break; //show nothing - } - - } - - public void remove(Buff buff) { - - buffs.remove(buff); - Actor.remove(buff); - - - } - - public void remove(Class buffClass) { - for (Buff buff : buffs(buffClass)) { - remove(buff); - } - } - - @Override - protected void onRemove() { - for (Buff buff : buffs.toArray(new Buff[buffs.size()])) { - buff.detach(); - } - } - - public void updateSpriteState() { - for (Buff buff : buffs) { - /*if (buff instanceof Burning) { - sprite.add(CharSprite.State.BURNING); - } else if (buff instanceof Levitation) { - sprite.add(CharSprite.State.LEVITATING); - } else if (buff instanceof Invisibility - || buff instanceof CloakOfShadows.cloakStealth) { - sprite.add(CharSprite.State.INVISIBLE); - } else if (buff instanceof Stun || buff instanceof Shieldblock) { - sprite.add(CharSprite.State.PARALYSED); - } else if (buff instanceof Frost) { - sprite.add(CharSprite.State.FROZEN); - } else if (buff instanceof Light) { - sprite.add(CharSprite.State.ILLUMINATED); - }*/ - buff.fx( true ); - } - } - - public int stealth() { - return 0; - } - - public int energybase() { - return 0; - } - - public void move(int step) { - - if (Level.adjacent(step, pos) && buff(Vertigo.class) != null) { - step = pos + Level.NEIGHBOURS8[Random.Int(8)]; - if (!(Level.passable[step] || Level.avoid[step]) - || Actor.findChar(step) != null) - return; - } - - if (Dungeon.level.map[pos] == Terrain.OPEN_DOOR) { - Door.leave(pos); - } - - pos = step; - - if (flying && Dungeon.level.map[pos] == Terrain.DOOR) { - Door.enter(pos); - } - - if (this != Dungeon.hero) { - sprite.visible = Dungeon.visible[pos]; - } - } - - public int distance(Char other) { - return Level.distance(pos, other.pos); - } - - public void onMotionComplete() { - next(); - } - - public void onAttackComplete() { - next(); - } - - public void onOperateComplete() { - next(); - } - - private static final HashSet> EMPTY = new HashSet>(); - - public HashSet> resistances() { - return EMPTY; - } - - public HashSet> immunities() { - return EMPTY; - } - - public HashSet> weakness() { - return EMPTY; - } - - //protected final HashSet resistances = new HashSet<>(); - - //returns percent effectiveness after resistances - //TODO currently resistances reduce effectiveness by a static 50%, and do not stack. - //public float resist( Class effect ){ - //HashSet resists = new HashSet<>(resistances); - // for (Property p : properties()){ - // resists.addAll(p.resistances()); - // } - // for (Buff b : buffs()){ - // resists.addAll(b.resistances()); - // } - - // float result = 1f; - // for (Class c : resists){ - // if (c.isAssignableFrom(effect)){ - // result *= 0.5f; - // } - // } - // return result * RingOfElements.restore(this, effect); - //} - - //protected final HashSet immunities = new HashSet<>(); - - //public boolean isImmune(Class effect ){ - //HashSet immunes = new HashSet<>(immunities); - //for (Property p : properties()){ - //immunes.addAll(p.immunities()); - //} - //for (Buff b : buffs()){ - //immunes.addAll(b.immunities()); - //} - - //for (Class c : immunes){ - //if (c.isAssignableFrom(effect)){ - // return true; - //} - // } - //return false; - //} - - protected HashSet properties = new HashSet<>(); - - public HashSet properties() { return properties; } - - public enum Property{ - BOSS, - MINIBOSS, - IMMOVABLE, - - HUMAN, - ORC, - ELF, - GNOLL, - DWARF, - TROLL, - DEMONIC, - GOBLIN, - - BEAST, - DRAGON, - PLANT( new HashSet(), - new HashSet( Arrays.asList(Bleeding.class, ToxicGas.class, Poison.class)), - new HashSet( Arrays.asList(Burning.class, WandOfFirebolt.class,EnchantmentFire.class,EnchantmentFire2.class)) - ), - ELEMENT, - - MECH, - UNDEAD, - ALIEN, - UNKNOW; - - private HashSet resistances; - private HashSet immunities; - private HashSet weakness; - - Property(){ - this(new HashSet(), new HashSet(),new HashSet()); - } - - Property( HashSet resistances, HashSet immunities,HashSet weakness){ - this.resistances = resistances; - this.immunities = immunities; - this.weakness = weakness; - } - - public HashSet resistances(){ - return new HashSet<>(resistances); - } - - public HashSet immunities(){ - return new HashSet<>(immunities); - } - public HashSet weakness(){ - return new HashSet<>(weakness); - } - } -} diff --git a/java/com/hmdzl/spspd/change/actors/animate/WeaponAnimate.java b/java/com/hmdzl/spspd/change/actors/animate/WeaponAnimate.java deleted file mode 100644 index 15b7ab9e..00000000 --- a/java/com/hmdzl/spspd/change/actors/animate/WeaponAnimate.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.animate; - -import java.text.DecimalFormat; -import java.util.HashSet; - -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.ui.BuffIndicator; - -public class WeaponAnimate extends Actor { - - @Override - public boolean act() { - return true; - } - - -} diff --git a/java/com/hmdzl/spspd/change/actors/blobs/Alchemy.java b/java/com/hmdzl/spspd/change/actors/blobs/Alchemy.java deleted file mode 100644 index 1f2c4461..00000000 --- a/java/com/hmdzl/spspd/change/actors/blobs/Alchemy.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.blobs; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.Journal; -import com.hmdzl.spspd.change.effects.BlobEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.Heap; -import com.hmdzl.spspd.change.items.Item; -import com.watabou.utils.Bundle; - -public class Alchemy extends Blob { - - protected int pos; - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - - for (int i = 0; i < LENGTH; i++) { - if (cur[i] > 0) { - pos = i; - break; - } - } - } - - @Override - protected void evolve() { - volume = off[pos] = cur[pos]; - - if (Dungeon.visible[pos]) { - Journal.add(Journal.Feature.ALCHEMY); - } - } - - /*@Override - public void seed(int cell, int amount) { - cur[pos] = 0; - pos = cell; - volume = cur[pos] = amount; - }*/ - - /*public static void transmute(int cell) { - Heap heap = Dungeon.level.heaps.get(cell); - if (heap != null) { - - Item result = heap.transmute(); - if (result != null) { - Dungeon.level.drop(result, cell).sprite.drop(cell); - } - } - }*/ - - @Override - public void use(BlobEmitter emitter) { - super.use(emitter); - emitter.start(Speck.factory(Speck.BUBBLE), 0.4f, 0); - } -} diff --git a/java/com/hmdzl/spspd/change/actors/blobs/Alter.java b/java/com/hmdzl/spspd/change/actors/blobs/Alter.java deleted file mode 100644 index bc1ca080..00000000 --- a/java/com/hmdzl/spspd/change/actors/blobs/Alter.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.blobs; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.Journal; -import com.hmdzl.spspd.change.effects.BlobEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.Heap; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.weapon.Weapon; -import com.watabou.utils.Bundle; - -public class Alter extends Blob { - - protected int pos; - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - - for (int i = 0; i < LENGTH; i++) { - if (cur[i] > 0) { - pos = i; - break; - } - } - } - - @Override - protected void evolve() { - volume = off[pos] = cur[pos]; - } - - @Override - public void seed(int cell, int amount) { - cur[pos] = 0; - pos = cell; - volume = cur[pos] = amount; - } - - public static void transmute(int cell) { - Heap heap = Dungeon.level.heaps.get(cell); - if (heap != null) { - - Weapon result = heap.consecrate(); - if (result != null) { - Dungeon.level.drop(result, cell).sprite.drop(cell); - } - } - } - - @Override - public void use(BlobEmitter emitter) { - super.use(emitter); - emitter.start(Speck.factory(Speck.LIGHT), 0.4f, 0); - } -} diff --git a/java/com/hmdzl/spspd/change/actors/blobs/Blob.java b/java/com/hmdzl/spspd/change/actors/blobs/Blob.java deleted file mode 100644 index 9aa9b97a..00000000 --- a/java/com/hmdzl/spspd/change/actors/blobs/Blob.java +++ /dev/null @@ -1,213 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.blobs; - -import java.util.Arrays; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.ShatteredPixelDungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.effects.BlobEmitter; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.utils.BArray; -import com.watabou.utils.Bundle; - -public class Blob extends Actor { - - public static final int WIDTH = Level.getWidth(); - public static final int HEIGHT = Level.HEIGHT; - public static final int LENGTH = Level.getLength(); - - public int volume = 0; - - public int[] cur; - protected int[] off; - - public BlobEmitter emitter; - - protected Blob() { - - cur = new int[LENGTH]; - off = new int[LENGTH]; - - volume = 0; - } - - private static final String CUR = "cur"; - private static final String START = "start"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - - if (volume > 0) { - - int start; - for (start = 0; start < LENGTH; start++) { - if (cur[start] > 0) { - break; - } - } - int end; - for (end = LENGTH - 1; end > start; end--) { - if (cur[end] > 0) { - break; - } - } - - bundle.put(START, start); - bundle.put(CUR, trim(start, end + 1)); - - } - } - - private int[] trim(int start, int end) { - int len = end - start; - int[] copy = new int[len]; - System.arraycopy(cur, start, copy, 0, len); - return copy; - } - - @Override - public void restoreFromBundle(Bundle bundle) { - - super.restoreFromBundle(bundle); - - int[] data = bundle.getIntArray(CUR); - if (data != null) { - int start = bundle.getInt(START); - for (int i = 0; i < data.length; i++) { - cur[i + start] = data[i]; - volume += data[i]; - } - } - - if (Level.resizingNeeded) { - int[] cur = new int[Level.getLength()]; - Arrays.fill(cur, 0); - - int loadedMapSize = Level.loadedMapSize; - for (int i = 0; i < loadedMapSize; i++) { - System.arraycopy(this.cur, i * loadedMapSize, cur, i - * Level.getWidth(), loadedMapSize); - } - - this.cur = cur; - } - } - - @Override - public boolean act() { - - spend(TICK); - - if (volume > 0) { - - volume = 0; - evolve(); - - int[] tmp = off; - off = cur; - cur = tmp; - - } - - return true; - } - - public void use(BlobEmitter emitter) { - this.emitter = emitter; - } - - protected void evolve() { - - boolean[] notBlocking = BArray.not(Level.solid, null); - - for (int i = 1; i < HEIGHT - 1; i++) { - - int from = i * WIDTH + 1; - int to = from + WIDTH - 2; - - for (int pos = from; pos < to; pos++) { - if (notBlocking[pos]) { - - int count = 1; - int sum = cur[pos]; - - if (notBlocking[pos - 1]) { - sum += cur[pos - 1]; - count++; - } - if (notBlocking[pos + 1]) { - sum += cur[pos + 1]; - count++; - } - if (notBlocking[pos - WIDTH]) { - sum += cur[pos - WIDTH]; - count++; - } - if (notBlocking[pos + WIDTH]) { - sum += cur[pos + WIDTH]; - count++; - } - - int value = sum >= count ? (sum / count) - 1 : 0; - off[pos] = value; - - volume += value; - } else { - off[pos] = 0; - } - } - } - } - - public void seed(int cell, int amount) { - cur[cell] += amount; - volume += amount; - } - - public void clear(int cell) { - volume -= cur[cell]; - cur[cell] = 0; - } - - public String tileDesc() { - return null; - } - - @SuppressWarnings("unchecked") - public static T seed(int cell, int amount, Class type) { - try { - - T gas = (T) Dungeon.level.blobs.get(type); - if (gas == null) { - gas = type.newInstance(); - Dungeon.level.blobs.put(type, gas); - } - - gas.seed(cell, amount); - - return gas; - - } catch (Exception e) { - ShatteredPixelDungeon.reportException(e); - return null; - } - } -} diff --git a/java/com/hmdzl/spspd/change/actors/blobs/ConfusionGas.java b/java/com/hmdzl/spspd/change/actors/blobs/ConfusionGas.java deleted file mode 100644 index 22152561..00000000 --- a/java/com/hmdzl/spspd/change/actors/blobs/ConfusionGas.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.blobs; - -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Locked; -import com.hmdzl.spspd.change.actors.buffs.Vertigo; -import com.hmdzl.spspd.change.effects.BlobEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.messages.Messages; - -public class ConfusionGas extends Blob { - - @Override - protected void evolve() { - super.evolve(); - - Char ch; - for (int i = 0; i < LENGTH; i++) { - if (cur[i] > 0 && (ch = Actor.findChar(i)) != null) { - if (!ch.immunities().contains(this.getClass())) - Buff.prolong(ch, Vertigo.class, 2); - Buff.prolong(ch, Locked.class,2f); - } - } - } - - @Override - public void use(BlobEmitter emitter) { - super.use(emitter); - - emitter.pour(Speck.factory(Speck.CONFUSION), 0.6f); - } - - @Override - public String tileDesc() { - return Messages.get(this, "desc"); - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/actors/blobs/CorruptGas.java b/java/com/hmdzl/spspd/change/actors/blobs/CorruptGas.java deleted file mode 100644 index ba62a648..00000000 --- a/java/com/hmdzl/spspd/change/actors/blobs/CorruptGas.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.blobs; - -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.ResultDescriptions; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Bleeding; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Cripple; -import com.hmdzl.spspd.change.actors.buffs.Vertigo; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.BlobEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.utils.Random; - -public class CorruptGas extends Blob implements Hero.Doom { - - @Override - protected void evolve() { - super.evolve(); - - int levelDamage = 5 + Dungeon.depth/2; - int bleedDamage = 5 + Dungeon.depth/2; - - Char ch; - for (int i = 0; i < LENGTH; i++) { - if (cur[i] > 0 && (ch = Actor.findChar(i)) != null) { - - if (!ch.immunities().contains(ConfusionGas.class)){ - Buff.prolong(ch, Vertigo.class, 2); - } - - if (!ch.immunities().contains(this.getClass())){ - Buff.affect(ch, Bleeding.class).set(bleedDamage); - Buff.prolong(ch, Cripple.class, Cripple.DURATION); - - int damage = (ch.HT/2 + levelDamage) / 40; - if (Random.Int(40) < (ch.HT/2 + levelDamage) % 40) { - damage++; - } - - ch.damage(damage, this); - } - } - } - } - - @Override - public void use(BlobEmitter emitter) { - super.use(emitter); - - emitter.pour(Speck.factory(Speck.CORRUPT), 0.6f); - } - - @Override - public String tileDesc() { - return Messages.get(this, "desc"); - } - - @Override - public void onDeath() { - - Badges.validateDeathFromGas(); - - } -} diff --git a/java/com/hmdzl/spspd/change/actors/blobs/DarkGas.java b/java/com/hmdzl/spspd/change/actors/blobs/DarkGas.java deleted file mode 100644 index d991584f..00000000 --- a/java/com/hmdzl/spspd/change/actors/blobs/DarkGas.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.blobs; - -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Blindness; -import com.hmdzl.spspd.change.effects.BlobEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.messages.Messages; - -public class DarkGas extends Blob { - - @Override - protected void evolve() { - super.evolve(); - - Char ch; - for (int i = 0; i < LENGTH; i++) { - if (cur[i] > 0 && (ch = Actor.findChar(i)) != null) { - if (!ch.immunities().contains(this.getClass())) - Buff.prolong(ch, Blindness.class, 2); - } - } - } - - @Override - public void use(BlobEmitter emitter) { - super.use(emitter); - - emitter.pour(Speck.factory(Speck.DARKNESS), 0.6f); - } - - @Override - public String tileDesc() { - return Messages.get(this, "desc"); - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/actors/blobs/ElectriShock.java b/java/com/hmdzl/spspd/change/actors/blobs/ElectriShock.java deleted file mode 100644 index c1e08ada..00000000 --- a/java/com/hmdzl/spspd/change/actors/blobs/ElectriShock.java +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.blobs; - -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.ResultDescriptions; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Corruption; -import com.hmdzl.spspd.change.actors.buffs.Paralysis; -import com.hmdzl.spspd.change.effects.BlobEmitter; -import com.hmdzl.spspd.change.effects.particles.EnergyParticle; -import com.hmdzl.spspd.change.items.Heap; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.utils.Random; - -public class ElectriShock extends Blob { - - @Override - protected void evolve() { - - //boolean[] shockable = Level.shockable; - - int from = WIDTH + 1; - int to = Level.getLength() - WIDTH - 1; - - - for (int pos = from; pos < to; pos++) { - - int shock; - boolean shelf = false; - - if (cur[pos] > 0) { - - shocking(pos); - - shock = cur[pos] - 1; - - if (shock <= 0){ } - } else { - shock = 0; - } - - volume += (off[pos] = shock); - } - - } - - private void shocking(int pos) { - Char ch = Actor.findChar(pos); - if (ch != null ) { - //Buff.detach(ch,Corruption.class); - ch.damage( Math.max( 1, Random.Int( ch.HP / 100, ch.HP / 50 ) ), this ); - Buff.prolong(ch, Paralysis.class,1f); - - } - Heap heap = Dungeon.level.heaps.get(pos); - if (heap != null) { - heap.lit(); - } - - } - - @Override - public void seed(int cell, int amount) { - if (cur[cell] == 0) { - volume += amount; - cur[cell] = amount; - /*} else { - volume += amount - cur[cell]; - cur[cell] = amount;*/ - } - } - - @Override - public void use(BlobEmitter emitter) { - super.use(emitter); - emitter.start(EnergyParticle.FACTORY, 0.03f, 0); - } - @Override - public String tileDesc() { - return Messages.get(this, "desc"); - } - - public void onDeath() { - Dungeon.fail(Messages.format(ResultDescriptions.GAS)); - } -} diff --git a/java/com/hmdzl/spspd/change/actors/blobs/Fire.java b/java/com/hmdzl/spspd/change/actors/blobs/Fire.java deleted file mode 100644 index 74ed47d2..00000000 --- a/java/com/hmdzl/spspd/change/actors/blobs/Fire.java +++ /dev/null @@ -1,154 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.blobs; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Burning; -import com.hmdzl.spspd.change.effects.BlobEmitter; -import com.hmdzl.spspd.change.effects.particles.FlameParticle; -import com.hmdzl.spspd.change.items.Heap; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.Terrain; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.items.Generator; -import com.watabou.utils.Random; - -public class Fire extends Blob { - - @Override - protected void evolve() { - - boolean[] flamable = Level.flamable; - - int from = WIDTH + 1; - int to = Level.getLength() - WIDTH - 1; - - boolean observe = false; - - for (int pos = from; pos < to; pos++) { - - int fire; - boolean shelf = false; - - Blob blob = Dungeon.level.blobs.get( TarGas.class ); - - if (blob != null) { - - int par[] = blob.cur; - - for (int i=0; i < LENGTH; i++) { - - if (cur[i] > 0) { - blob.volume -= par[i]; - par[i] = 0; - } - } - } - - if (cur[pos] > 0) { - - burn(pos); - - fire = cur[pos] - 1; - if (fire <= 0 && flamable[pos]) { - - if(Dungeon.level.map[pos]==Terrain.BOOKSHELF){ - shelf=true; - } - - int oldTile = Dungeon.level.map[pos]; - Level.set(pos, Terrain.EMBERS); - - if (shelf && Random.Float()<.10){ - Dungeon.level.drop(Generator.random(Generator.Category.SCROLL), pos); - } - - observe = true; - GameScene.updateMap(pos); - if (Dungeon.visible[pos]) { - GameScene.discoverTile(pos, oldTile); - } - } - - } else { - - if (flamable[pos] - && (cur[pos - 1] > 0 || cur[pos + 1] > 0 - || cur[pos - WIDTH] > 0 || cur[pos + WIDTH] > 0)) { - fire = 4; - burn(pos); - } else { - fire = 0; - } - - } - - volume += (off[pos] = fire); - - } - - if (observe) { - Dungeon.observe(); - } - } - - private void burn(int pos) { - Char ch = Actor.findChar(pos); - if (ch != null ) { - Buff.affect(ch, Burning.class).reignite(ch); - } - Heap heap = Dungeon.level.heaps.get(pos); - if (heap != null) { - heap.burn(); - } - - if( Dungeon.level.map[pos] == Terrain.SECRET_DOOR) { - - GameScene.discoverTile( pos, Dungeon.level.map[pos] ); - - Level.set( pos, Terrain.DOOR); - - GameScene.updateMap( pos ); - } - } - - @Override - public void seed(int cell, int amount) { - if (cur[cell] == 0) { - volume += amount; - cur[cell] = amount; - /*} else { - volume += amount - cur[cell]; - cur[cell] = amount;*/ - } - } - - @Override - public void use(BlobEmitter emitter) { - super.use(emitter); - emitter.start(FlameParticle.FACTORY, 0.1f, 0); - } - @Override - public String tileDesc() { - return Messages.get(this, "desc"); - } -} diff --git a/java/com/hmdzl/spspd/change/actors/blobs/Foliage.java b/java/com/hmdzl/spspd/change/actors/blobs/Foliage.java deleted file mode 100644 index a1a1a29c..00000000 --- a/java/com/hmdzl/spspd/change/actors/blobs/Foliage.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.blobs; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.Journal; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Shadows; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.BlobEmitter; -import com.hmdzl.spspd.change.effects.particles.ShaftParticle; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.Terrain; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.GameScene; - -public class Foliage extends Blob { - - @Override - protected void evolve() { - - int from = WIDTH + 1; - int to = Level.getLength() - WIDTH - 1; - - int[] map = Dungeon.level.map; - boolean regrowth = false; - - boolean visible = false; - - for (int pos = from; pos < to; pos++) { - if (cur[pos] > 0) { - - off[pos] = cur[pos]; - volume += off[pos]; - - if (map[pos] == Terrain.EMBERS) { - map[pos] = Terrain.GRASS; - regrowth = true; - } - - visible = visible || Dungeon.visible[pos]; - - } else { - off[pos] = 0; - } - } - - Hero hero = Dungeon.hero; - if (hero.isAlive() && hero.visibleEnemies() == 0 && cur[hero.pos] > 0) { - Buff.affect(hero, Shadows.class).prolong(); - } - - if (regrowth) { - GameScene.updateMap(); - } - - if (visible) { - Journal.add(Journal.Feature.GARDEN); - } - } - - @Override - public void use(BlobEmitter emitter) { - super.use(emitter); - emitter.start(ShaftParticle.FACTORY, 0.9f, 0); - } - - @Override - public String tileDesc() { - return Messages.get(this, "desc"); - } -} diff --git a/java/com/hmdzl/spspd/change/actors/blobs/Freezing.java b/java/com/hmdzl/spspd/change/actors/blobs/Freezing.java deleted file mode 100644 index d6c200c7..00000000 --- a/java/com/hmdzl/spspd/change/actors/blobs/Freezing.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.blobs; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Frost; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.particles.SnowParticle; -import com.hmdzl.spspd.change.items.Heap; -import com.hmdzl.spspd.change.levels.Level; -import com.watabou.utils.Random; - -public class Freezing { - - // Returns true, if this cell is visible - public static boolean affect(int cell, Fire fire) { - - Char ch = Actor.findChar(cell); - if (ch != null) { - if (Level.water[ch.pos]) { - Buff.prolong(ch, Frost.class, - Frost.duration(ch) * Random.Float(5f, 7.5f)); - } else { - Buff.prolong(ch, Frost.class, - Frost.duration(ch) * Random.Float(1.0f, 1.5f)); - } - } - - if (fire != null) { - fire.clear(cell); - } - - Heap heap = Dungeon.level.heaps.get(cell); - if (heap != null) { - heap.freeze(); - } - - if (Dungeon.visible[cell]) { - CellEmitter.get(cell).start(SnowParticle.FACTORY, 0.2f, 6); - return true; - } else { - return false; - } - } -} diff --git a/java/com/hmdzl/spspd/change/actors/blobs/FrostGas.java b/java/com/hmdzl/spspd/change/actors/blobs/FrostGas.java deleted file mode 100644 index 67f812a1..00000000 --- a/java/com/hmdzl/spspd/change/actors/blobs/FrostGas.java +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.blobs; - -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Chill; -import com.hmdzl.spspd.change.actors.buffs.Frost; -import com.hmdzl.spspd.change.effects.BlobEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.ResultDescriptions; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Bleeding; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Cripple; -import com.hmdzl.spspd.change.actors.buffs.Vertigo; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.BlobEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.effects.particles.SnowParticle; -import com.hmdzl.spspd.change.items.Heap; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.utils.Random; - -public class FrostGas extends Blob { - - @Override - protected void evolve() { - - int from = WIDTH + 1; - int to = Level.getLength() - WIDTH - 1; - - for (int pos = from; pos < to; pos++) { - - int ice; - - - if (cur[pos] > 0) { - - ice(pos); - - ice = cur[pos] - 1; - if (ice <= 0){ } - } else { - ice = 0; - } - - volume += (off[pos] = ice); - - } - - } - - private void ice(int pos) { - Char ch = Actor.findChar( pos ); - if (ch != null && !ch.immunities().contains(this.getClass())) { - if (ch.buff(Frost.class) != null){ - Buff.affect(ch, Frost.class, 2f); - } else { - Buff.affect(ch, Chill.class, 3f); - Chill chill = ch.buff(Chill.class); - if (chill != null && chill.cooldown() >= 10f){ - Buff.affect(ch, Frost.class, 5f); - } - } - } - - Heap heap = Dungeon.level.heaps.get( pos ); - if (heap != null) heap.freeze(); - } - - @Override - public void seed(int cell, int amount) { - if (cur[cell] == 0) { - volume += amount; - cur[cell] = amount; - /*} else { - volume += amount - cur[cell]; - cur[cell] = amount;*/ - } - } - - @Override - public void use(BlobEmitter emitter) { - super.use(emitter); - emitter.start(SnowParticle.FACTORY, 0.05f, 0); - } - @Override - public String tileDesc() { - return Messages.get(this, "desc"); - } -} diff --git a/java/com/hmdzl/spspd/change/actors/blobs/GooWarn.java b/java/com/hmdzl/spspd/change/actors/blobs/GooWarn.java deleted file mode 100644 index ea7bd533..00000000 --- a/java/com/hmdzl/spspd/change/actors/blobs/GooWarn.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.hmdzl.spspd.change.actors.blobs; - -import com.hmdzl.spspd.change.effects.BlobEmitter; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.GooSprite; - -/** - * Created by Evan on 29/09/2014. - */ -public class GooWarn extends Blob { - - // cosmetic blob, used to warn noobs that goo's pump up should, infact, be - // avoided. - - // Thanks to Watabou for the much better particle effect, I was lazy and - // just re-colored flames initially - - protected int pos; - - @Override - protected void evolve() { - for (int i = 0; i < LENGTH; i++) { - - int offv = cur[i] > 0 ? cur[i] - 1 : 0; - off[i] = offv; - - if (offv > 0) { - volume += offv; - } - } - - } - - @Override - public void seed(int cell, int amount) { - int diff = amount - cur[cell]; - if (diff > 0) { - cur[cell] = amount; - volume += diff; - } - } - - @Override - public void use(BlobEmitter emitter) { - super.use(emitter); - emitter.pour(GooSprite.GooParticle.FACTORY, 0.03f); - } - - @Override - public String tileDesc() { - return Messages.get(this, "desc"); - } -} diff --git a/java/com/hmdzl/spspd/change/actors/blobs/HealLight.java b/java/com/hmdzl/spspd/change/actors/blobs/HealLight.java deleted file mode 100644 index be75df64..00000000 --- a/java/com/hmdzl/spspd/change/actors/blobs/HealLight.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ - -package com.hmdzl.spspd.change.actors.blobs; - -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.utils.Random; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.mobs.Bestiary; -import com.hmdzl.spspd.change.effects.BlobEmitter; -import com.hmdzl.spspd.change.effects.particles.ShaftParticle; -import com.hmdzl.spspd.change.items.Generator; -import com.hmdzl.spspd.change.items.Heap; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.Terrain; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.CharSprite; - -public class HealLight extends Blob implements Hero.Doom{ - - @Override - protected void evolve() { - - super.evolve(); - - Char ch; - for (int i = 0; i < LENGTH; i++) { - if (cur[i] > 0 && (ch = Actor.findChar(i)) != null) { - if (ch.HP - */ -package com.hmdzl.spspd.change.actors.blobs; - -import com.hmdzl.spspd.change.effects.particles.MemoryParticle; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.LoadSaveScene; -import com.watabou.noosa.Game; -import com.watabou.noosa.audio.Sample; -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.Journal; -import com.hmdzl.spspd.change.Journal.Feature; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.effects.BlobEmitter; -import com.watabou.utils.Bundle; - -import java.io.IOException; - -public class MemoryFire extends Blob { - - protected int pos; - - @Override - public void restoreFromBundle( Bundle bundle ) { - super.restoreFromBundle( bundle ); - - for (int i=0; i < LENGTH; i++) { - if (cur[i] > 0) { - pos = i; - break; - } - } - } - - @Override - protected void evolve() { - volume = off[pos] = cur[pos]; - Char ch = Actor.findChar( pos ); - MemoryFire fire = (MemoryFire)Dungeon.level.blobs.get( MemoryFire.class ); - if (ch != null && ch == Dungeon.hero) { - if (Dungeon.visible[pos]) { - Sample.INSTANCE.play( Assets.SND_BURNING ); - fire.seed( fire.pos, 0 ); - Journal.remove( Feature.MEMORY_FIRE ); - try { - Dungeon.saveAll(); - } catch (IOException e) { - // - } - Dungeon.canSave=true; - Game.switchScene(LoadSaveScene.class); - //GameScene.show(new WndMemory()); - } - } - if (Dungeon.visible[pos]) { - Journal.add( Feature.MEMORY_FIRE ); - } - } - - @Override - public void seed( int cell, int amount ) { - cur[pos] = 0; - pos = cell; - volume = cur[pos] = amount; - } - - @Override - public void use( BlobEmitter emitter ) { - super.use( emitter ); - - emitter.pour( MemoryParticle.FACTORY, 0.04f ); - } - - @Override - public String tileDesc() { - return Messages.get(this, "desc"); - } - - - /*public class WndMemory extends Window { - - private static final int WIDTH = 120; - private static final int MARGIN = 2; - private static final int BUTTON_WIDTH = WIDTH - MARGIN * 2; - private static final int BUTTON_HEIGHT = 20; - - public WndMemory() { - super(); - - IconTitle titlebar = new IconTitle(); - titlebar.setRect(0, 0, WIDTH, 0); - add(titlebar); - - RenderedTextMultiline tfMesage = PixelScene.renderMultiline( Messages.get(this, "SorN"), 8 ); - tfMesage.maxWidth(WIDTH - MARGIN * 2); - tfMesage.setPos(MARGIN, titlebar.bottom() + MARGIN); - add( tfMesage ); - - RedButton btnSave = new RedButton(Messages.get(MemoryFire.class,"save")) { - @Override - protected void onClick() { - Game.switchScene(LoadSaveScene.class); - } - }; - btnSave.setRect(MARGIN, pos + MARGIN, BUTTON_WIDTH, - BUTTON_HEIGHT); - add( btnSave ); - - RedButton btnNosave = new RedButton(Messages.get(MemoryFire.class,"no_save")) { - @Override - protected void onClick() { - hide(); - } - }; - btnNosave.setRect(MARGIN, pos + MARGIN, BUTTON_WIDTH, BUTTON_HEIGHT); - add(btnNosave); - - resize(WIDTH, (int) btnNosave.bottom()); - } - }*/ - -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/actors/blobs/ParalyticGas.java b/java/com/hmdzl/spspd/change/actors/blobs/ParalyticGas.java deleted file mode 100644 index b45b4b57..00000000 --- a/java/com/hmdzl/spspd/change/actors/blobs/ParalyticGas.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.blobs; - -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Paralysis; -import com.hmdzl.spspd.change.effects.BlobEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.messages.Messages; - -public class ParalyticGas extends Blob { - - @Override - protected void evolve() { - super.evolve(); - - Char ch; - for (int i = 0; i < LENGTH; i++) { - if (cur[i] > 0 && (ch = Actor.findChar(i)) != null) { - if (!ch.immunities().contains(this.getClass())) - Buff.prolong(ch, Paralysis.class, Paralysis.duration(ch)); - } - } - } - - @Override - public void use(BlobEmitter emitter) { - super.use(emitter); - - emitter.pour(Speck.factory(Speck.PARALYSIS), 0.6f); - } - - @Override - public String tileDesc() { - return Messages.get(this, "desc"); - } -} diff --git a/java/com/hmdzl/spspd/change/actors/blobs/Portal.java b/java/com/hmdzl/spspd/change/actors/blobs/Portal.java deleted file mode 100644 index 318f74d7..00000000 --- a/java/com/hmdzl/spspd/change/actors/blobs/Portal.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.blobs; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.Journal; -import com.hmdzl.spspd.change.effects.BlobEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.effects.particles.ShaftParticle; -import com.hmdzl.spspd.change.items.Heap; -import com.hmdzl.spspd.change.items.Item; -import com.watabou.utils.Bundle; - -public class Portal extends Blob { - - protected int pos; - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - - for (int i = 0; i < LENGTH; i++) { - if (cur[i] > 0) { - pos = i; - break; - } - } - } - - @Override - protected void evolve() { - volume = off[pos] = cur[pos]; - } - - @Override - public void seed(int cell, int amount) { - cur[pos] = 0; - pos = cell; - volume = cur[pos] = amount; - } - - - @Override - public void use(BlobEmitter emitter) { - super.use(emitter); - emitter.start(ShaftParticle.FACTORY, 0.9f, 0); - } -} diff --git a/java/com/hmdzl/spspd/change/actors/blobs/Regrowth.java b/java/com/hmdzl/spspd/change/actors/blobs/Regrowth.java deleted file mode 100644 index b4c0091e..00000000 --- a/java/com/hmdzl/spspd/change/actors/blobs/Regrowth.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.blobs; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Roots; -import com.hmdzl.spspd.change.effects.BlobEmitter; -import com.hmdzl.spspd.change.effects.particles.LeafParticle; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.Terrain; -import com.hmdzl.spspd.change.scenes.GameScene; - -public class Regrowth extends Blob { - - @Override - protected void evolve() { - super.evolve(); - - if (volume > 0) { - - boolean mapUpdated = false; - - for (int i = 0; i < LENGTH; i++) { - if (off[i] > 0) { - int c = Dungeon.level.map[i]; - if (c == Terrain.EMPTY || c == Terrain.EMBERS - || c == Terrain.EMPTY_DECO) { - - Level.set(i, cur[i] > 9 ? Terrain.HIGH_GRASS - : Terrain.GRASS); - mapUpdated = true; - - } else if (c == Terrain.GRASS && cur[i] > 9) { - - Level.set(i, Terrain.HIGH_GRASS); - mapUpdated = true; - - } - - Char ch = Actor.findChar(i); - if (ch != null) { - Buff.prolong(ch, Roots.class, TICK); - } - } - } - - if (mapUpdated) { - GameScene.updateMap(); - Dungeon.observe(); - } - } - } - - @Override - public void use(BlobEmitter emitter) { - super.use(emitter); - - emitter.start(LeafParticle.LEVEL_SPECIFIC, 0.2f, 0); - } -} diff --git a/java/com/hmdzl/spspd/change/actors/blobs/ShockWeb.java b/java/com/hmdzl/spspd/change/actors/blobs/ShockWeb.java deleted file mode 100644 index 8cde883c..00000000 --- a/java/com/hmdzl/spspd/change/actors/blobs/ShockWeb.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.blobs; - -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Roots; -import com.hmdzl.spspd.change.effects.BlobEmitter; -import com.hmdzl.spspd.change.effects.particles.ShockWebParticle; -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.ResultDescriptions; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.BlobEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.utils.Random; - -public class ShockWeb extends Blob { - - @Override - protected void evolve() { - - for (int i = 0; i < LENGTH; i++) { - - int offv = cur[i] > 0 ? cur[i] - 1 : 0; - off[i] = offv; - - if (offv > 0) { - - volume += offv; - - Char ch = Actor.findChar(i); - if (ch != null) { - int damage = 5; - ch.damage(damage, this); - Buff.prolong(ch, Roots.class, TICK); - } - } - } - } - - @Override - public void use(BlobEmitter emitter) { - super.use(emitter); - - emitter.pour(ShockWebParticle.FACTORY, 0.4f); - } - - @Override - public void seed(int cell, int amount) { - int diff = amount - cur[cell]; - if (diff > 0) { - cur[cell] = amount; - volume += diff; - } - } - - @Override - public String tileDesc() { - return Messages.get(this, "desc"); - } -} diff --git a/java/com/hmdzl/spspd/change/actors/blobs/SlowWeb.java b/java/com/hmdzl/spspd/change/actors/blobs/SlowWeb.java deleted file mode 100644 index cdfe2f02..00000000 --- a/java/com/hmdzl/spspd/change/actors/blobs/SlowWeb.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.blobs; - -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Roots; -import com.hmdzl.spspd.change.actors.buffs.Slow; -import com.hmdzl.spspd.change.effects.BlobEmitter; -import com.hmdzl.spspd.change.effects.particles.WebParticle; -import com.hmdzl.spspd.change.messages.Messages; - -public class SlowWeb extends Blob { - - @Override - protected void evolve() { - - for (int i = 0; i < LENGTH; i++) { - - int offv = cur[i] > 0 ? cur[i] - 1 : 0; - off[i] = offv; - - if (offv > 0) { - - volume += offv; - - Char ch = Actor.findChar(i); - if (ch != null) { - Buff.prolong(ch, Slow.class, TICK); - } - } - } - } - - @Override - public void use(BlobEmitter emitter) { - super.use(emitter); - - emitter.pour(WebParticle.FACTORY, 0.4f); - } - - @Override - public void seed(int cell, int amount) { - int diff = amount - cur[cell]; - if (diff > 0) { - cur[cell] = amount; - volume += diff; - } - } - - @Override - public String tileDesc() { - return Messages.get(this, "desc"); - } -} diff --git a/java/com/hmdzl/spspd/change/actors/blobs/StenchGas.java b/java/com/hmdzl/spspd/change/actors/blobs/StenchGas.java deleted file mode 100644 index 8cb77626..00000000 --- a/java/com/hmdzl/spspd/change/actors/blobs/StenchGas.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.hmdzl.spspd.change.actors.blobs; - -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Ooze; -import com.hmdzl.spspd.change.effects.BlobEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.messages.Messages; - -/** - * Created by debenhame on 08/10/2014. - */ -public class StenchGas extends Blob { - - @Override - protected void evolve() { - super.evolve(); - - Char ch; - for (int i = 0; i < LENGTH; i++) { - if (cur[i] > 0 && (ch = Actor.findChar(i)) != null) { - if (!ch.immunities().contains(this.getClass())) - Buff.affect(ch, Ooze.class); - } - } - } - - @Override - public void use(BlobEmitter emitter) { - super.use(emitter); - - emitter.pour(Speck.factory(Speck.STENCH), 0.6f); - } - - @Override - public String tileDesc() { - return Messages.get(this, "desc"); - } -} diff --git a/java/com/hmdzl/spspd/change/actors/blobs/VenomGas.java b/java/com/hmdzl/spspd/change/actors/blobs/VenomGas.java deleted file mode 100644 index 9eb34cf4..00000000 --- a/java/com/hmdzl/spspd/change/actors/blobs/VenomGas.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * Shattered Pixel Dungeon - * Copyright (C) 2014-2015 Evan Debenham - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.blobs; - -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Venom; -import com.hmdzl.spspd.change.effects.BlobEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.utils.Bundle; - -public class VenomGas extends Blob { - - private int strength = 0; - - @Override - protected void evolve() { - super.evolve(); - - if (volume == 0){ - strength = 0; - } else { - Char ch; - for (int i = 0; i < LENGTH; i++) { - if (cur[i] > 0 && (ch = Actor.findChar(i)) != null) { - if (!ch.immunities().contains(this.getClass())) - Buff.affect(ch, Venom.class).set(2f, strength); - } - } - } - } - - public void setStrength(int str){ - if (str > strength) - strength = str; - } - - private static final String STRENGTH = "strength"; - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - strength = bundle.getInt( STRENGTH ); - } - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put( STRENGTH, strength ); - } - - @Override - public void use( BlobEmitter emitter ) { - super.use( emitter ); - - emitter.pour( Speck.factory(Speck.VENOM), 0.6f ); - } - - @Override - public String tileDesc() { - return Messages.get(this, "desc"); - } -} diff --git a/java/com/hmdzl/spspd/change/actors/blobs/Water.java b/java/com/hmdzl/spspd/change/actors/blobs/Water.java deleted file mode 100644 index 55bc171c..00000000 --- a/java/com/hmdzl/spspd/change/actors/blobs/Water.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.blobs; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.effects.BlobEmitter; -import com.hmdzl.spspd.change.effects.particles.LeafParticle; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.Terrain; -import com.hmdzl.spspd.change.scenes.GameScene; - -public class Water extends Blob { - - @Override - protected void evolve() { - super.evolve(); - - if (volume > 0) { - - boolean mapUpdated = false; - - for (int i = 0; i < LENGTH; i++) { - if (off[i] > 0) { - int c = Dungeon.level.map[i]; - if (c == Terrain.EMPTY || c == Terrain.EMBERS - || c == Terrain.EMPTY_DECO) { - - Level.set(i, cur[i] > 9 ? Terrain.HIGH_GRASS - : Terrain.GRASS); - mapUpdated = true; - - } else if (c == Terrain.GRASS && cur[i] > 9) { - - Level.set(i, Terrain.HIGH_GRASS); - mapUpdated = true; - - } - - } - } - - if (mapUpdated) { - GameScene.updateMap(); - Dungeon.observe(); - } - } - } - - @Override - public void use(BlobEmitter emitter) { - super.use(emitter); - - emitter.start(LeafParticle.LEVEL_SPECIFIC, 0.2f, 0); - } -} diff --git a/java/com/hmdzl/spspd/change/actors/blobs/WaterOfAwareness.java b/java/com/hmdzl/spspd/change/actors/blobs/WaterOfAwareness.java deleted file mode 100644 index a8f14502..00000000 --- a/java/com/hmdzl/spspd/change/actors/blobs/WaterOfAwareness.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.blobs; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.DungeonTilemap; -import com.hmdzl.spspd.change.Journal; -import com.hmdzl.spspd.change.Journal.Feature; -import com.hmdzl.spspd.change.actors.buffs.Awareness; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.BlobEmitter; -import com.hmdzl.spspd.change.effects.Identification; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.Terrain; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.audio.Sample; - -public class WaterOfAwareness extends WellWater { - - @Override - protected boolean affectHero(Hero hero) { - - Sample.INSTANCE.play(Assets.SND_DRINK); - emitter.parent.add(new Identification(DungeonTilemap - .tileCenterToWorld(pos))); - - hero.belongings.observe(); - - for (int i = 0; i < Level.getLength(); i++) { - - int terr = Dungeon.level.map[i]; - if ((Terrain.flags[terr] & Terrain.SECRET) != 0) { - - //Level.set(i, Terrain.discover(terr)); - //GameScene.updateMap(i); - Dungeon.level.discover( i ); - - if (Dungeon.visible[i]) { - GameScene.discoverTile(i, terr); - } - } - } - - Buff.affect(hero, Awareness.class, Awareness.DURATION); - Dungeon.observe(); - - Dungeon.hero.interrupt(); - - GLog.p( Messages.get(this, "procced")); - - Journal.remove(Feature.WELL_OF_AWARENESS); - - return true; - } - - @Override - protected Item affectItem(Item item) { - if (item.isIdentified()) { - return null; - } else { - item.identify(); - Badges.validateItemLevelAquired(item); - - emitter.parent.add(new Identification(DungeonTilemap - .tileCenterToWorld(pos))); - - Journal.remove(Feature.WELL_OF_AWARENESS); - - return item; - } - } - - @Override - public void use(BlobEmitter emitter) { - super.use(emitter); - emitter.pour(Speck.factory(Speck.QUESTION), 0.3f); - } - - @Override - public String tileDesc() { - return Messages.get(this, "desc"); - } -} diff --git a/java/com/hmdzl/spspd/change/actors/blobs/WaterOfHealth.java b/java/com/hmdzl/spspd/change/actors/blobs/WaterOfHealth.java deleted file mode 100644 index 46a3604b..00000000 --- a/java/com/hmdzl/spspd/change/actors/blobs/WaterOfHealth.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.blobs; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.Journal; -import com.hmdzl.spspd.change.Journal.Feature; -import com.hmdzl.spspd.change.actors.buffs.Hunger; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.BlobEmitter; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.effects.particles.ShaftParticle; -import com.hmdzl.spspd.change.items.DewVial; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.potions.PotionOfHealing; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.audio.Sample; - -public class WaterOfHealth extends WellWater { - - @Override - protected boolean affectHero(Hero hero) { - - Sample.INSTANCE.play(Assets.SND_DRINK); - - PotionOfHealing.heal(hero); - hero.belongings.uncurseEquipped(); - hero.buff(Hunger.class).satisfy(Hunger.STARVING); - - CellEmitter.get(pos).start(ShaftParticle.FACTORY, 0.2f, 3); - - Dungeon.hero.interrupt(); - - GLog.p( Messages.get(this, "procced")); - - Journal.remove(Feature.WELL_OF_HEALTH); - - return true; - } - - @Override - protected Item affectItem(Item item) { - if (item instanceof DewVial && !((DewVial) item).isFull()) { - ((DewVial) item).fill(); - Journal.remove(Feature.WELL_OF_HEALTH); - return item; - } - Journal.remove(Feature.WELL_OF_HEALTH); - return null; - } - - @Override - public void use(BlobEmitter emitter) { - super.use(emitter); - emitter.start(Speck.factory(Speck.HEALING), 0.5f, 0); - } - - @Override - public String tileDesc() { - return Messages.get(this, "desc"); - } -} diff --git a/java/com/hmdzl/spspd/change/actors/blobs/WaterOfTransmutation.java b/java/com/hmdzl/spspd/change/actors/blobs/WaterOfTransmutation.java deleted file mode 100644 index fac9b8ef..00000000 --- a/java/com/hmdzl/spspd/change/actors/blobs/WaterOfTransmutation.java +++ /dev/null @@ -1,229 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.blobs; - -import com.hmdzl.spspd.change.Journal; -import com.hmdzl.spspd.change.Journal.Feature; -import com.hmdzl.spspd.change.effects.BlobEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.Generator; -import com.hmdzl.spspd.change.items.Generator.Category; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.artifacts.Artifact; -import com.hmdzl.spspd.change.items.potions.Potion; -import com.hmdzl.spspd.change.items.potions.PotionOfHealing; -import com.hmdzl.spspd.change.items.potions.PotionOfMending; -import com.hmdzl.spspd.change.items.potions.PotionOfMight; -import com.hmdzl.spspd.change.items.potions.PotionOfStrength; -import com.hmdzl.spspd.change.items.rings.Ring; -import com.hmdzl.spspd.change.items.scrolls.Scroll; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfMagicalInfusion; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfUpgrade; -import com.hmdzl.spspd.change.items.wands.Wand; -import com.hmdzl.spspd.change.items.armor.Armor; -import com.hmdzl.spspd.change.items.weapon.melee.MeleeWeapon; -import com.hmdzl.spspd.change.messages.Messages; - -public class WaterOfTransmutation extends WellWater { - - @Override - protected Item affectItem(Item item) { - - if (item instanceof MeleeWeapon) { - item = changeWeapon((MeleeWeapon) item); - } else if (item instanceof Armor) { - item = changeArmor((Armor) item); - } else if (item instanceof Scroll) { - item = changeScroll((Scroll) item); - } else if (item instanceof Potion) { - item = changePotion((Potion) item); - } else if (item instanceof Ring) { - item = changeRing((Ring) item); - } else if (item instanceof Wand) { - item = changeWand((Wand) item); - } else if (item instanceof Artifact) { - item = changeArtifact((Artifact) item); - } else { - item = null; - } - - if (item != null) { - Journal.remove(Feature.WELL_OF_TRANSMUTATION); - } - - return item; - - } - - @Override - public void use(BlobEmitter emitter) { - super.use(emitter); - emitter.start(Speck.factory(Speck.CHANGE), 0.2f, 0); - } - - private MeleeWeapon changeWeapon(MeleeWeapon w) { - - MeleeWeapon n; - do { - n = (MeleeWeapon) Generator.random(Category.MELEEWEAPON); - } while (n.getClass() == w.getClass()); - - n.level = 0; - - int level = w.level; - if (level > 0) { - n.upgrade(level); - } else if (level < 0) { - n.degrade(-level); - } - - n.enchantment = w.enchantment; - n.reinforced = w.reinforced; - n.levelKnown = w.levelKnown; - n.cursedKnown = w.cursedKnown; - n.cursed = w.cursed; - - return n; - - } - - private Armor changeArmor(Armor r) { - Armor n; - do { - n = (Armor) Generator.random(Category.ARMOR); - } while (n.getClass() == r.getClass()); - - n.level = 0; - - int level = r.level; - if (level > 0) { - n.upgrade(level); - } else if (level < 0) { - n.degrade(-level); - } - n.glyph = r.glyph; - n.reinforced = r.reinforced; - n.levelKnown = r.levelKnown; - n.cursedKnown = r.cursedKnown; - n.cursed = r.cursed; - - return n; - } - - - private Ring changeRing(Ring r) { - Ring n; - do { - n = (Ring) Generator.random(Category.RING); - } while (n.getClass() == r.getClass()); - - n.level = 0; - - int level = r.level; - if (level > 0) { - n.upgrade(level); - } else if (level < 0) { - n.degrade(-level); - } - n.reinforced = r.reinforced; - n.levelKnown = r.levelKnown; - n.cursedKnown = r.cursedKnown; - n.cursed = r.cursed; - - return n; - } - - private Artifact changeArtifact(Artifact a) { - Artifact n ; - do { - n = (Artifact) Generator.random(Category.ARTIFACT); - } while (n.getClass() == a.getClass()); - - if (n != null) { - n.cursedKnown = a.cursedKnown; - n.cursed = a.cursed; - n.levelKnown = a.levelKnown; - n.transferUpgrade(a.visiblyUpgraded()); - } - - return n; - } - - private Wand changeWand(Wand w) { - - Wand n; - do { - n = (Wand) Generator.random(Category.WAND); - } while (n.getClass() == w.getClass()); - - n.level = 0; - n.updateLevel(); - n.upgrade(w.level); - - n.reinforced = w.reinforced; - n.levelKnown = w.levelKnown; - n.cursedKnown = w.cursedKnown; - n.cursed = w.cursed; - - return n; - } - - private Scroll changeScroll(Scroll s) { - if (s instanceof ScrollOfUpgrade) { - - return new ScrollOfMagicalInfusion(); - - } else if (s instanceof ScrollOfMagicalInfusion) { - - return new ScrollOfUpgrade(); - - } else { - - Scroll n; - do { - n = (Scroll) Generator.random(Category.SCROLL); - } while (n.getClass() == s.getClass()); - return n; - } - } - - private Potion changePotion(Potion p) { - if (p instanceof PotionOfStrength) { - - return new PotionOfMight(); - - } else if (p instanceof PotionOfMending){ - - return new PotionOfHealing(); - - } else { - - Potion n; - do { - n = (Potion) Generator.random(Category.POTION); - } while (n.getClass() == p.getClass()); - return n; - } - } - - - @Override - public String tileDesc() { - return Messages.get(this, "desc"); - } -} diff --git a/java/com/hmdzl/spspd/change/actors/blobs/WaterOfUpgradeEating.java b/java/com/hmdzl/spspd/change/actors/blobs/WaterOfUpgradeEating.java deleted file mode 100644 index e30e0e61..00000000 --- a/java/com/hmdzl/spspd/change/actors/blobs/WaterOfUpgradeEating.java +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.blobs; - -import com.hmdzl.spspd.change.effects.BlobEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.Generator; -import com.hmdzl.spspd.change.items.Generator.Category; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.Stylus; -import com.hmdzl.spspd.change.items.UpgradeBlobRed; -import com.hmdzl.spspd.change.items.UpgradeBlobViolet; -import com.hmdzl.spspd.change.items.UpgradeBlobYellow; -import com.hmdzl.spspd.change.items.potions.Potion; -import com.hmdzl.spspd.change.items.scrolls.Scroll; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.plants.Plant; -import com.hmdzl.spspd.change.plants.Seedpod; -import com.watabou.utils.Random; - -public class WaterOfUpgradeEating extends WellWater { - - @Override - protected Item affectItem(Item item) { - - if (item.isUpgradable()) { - item = eatUpgradable((Item) item); - } else if (item instanceof Scroll - || item instanceof Potion - || item instanceof Stylus) { - item = eatStandard((Item) item); - } else { - item = null; - } - - return item; - } - - @Override - public void use(BlobEmitter emitter) { - super.use(emitter); - emitter.start(Speck.factory(Speck.CHANGE), 0.2f, 0); - } - - private Item eatUpgradable(Item w) { - - int ups = w.level; - - Item n = null; - - if (Random.Float()<(ups/10)){ - - n = new UpgradeBlobViolet(); - - } else if (Random.Float()<(ups/5)) { - - n = new UpgradeBlobRed(); - - } else if (Random.Float()<(ups/3)) { - - n = new UpgradeBlobYellow(); - - } else { - - n =new Seedpod.Seed() ; - } - - return n; - } - - private Item eatStandard(Item w) { - - Item n = null; - - if (Random.Float()<0.1f){ - n = new UpgradeBlobYellow(); - } else { - n = new Seedpod.Seed() ; - } - - return n; - } - - @Override - public String tileDesc() { - return Messages.get(this, "desc"); - } -} diff --git a/java/com/hmdzl/spspd/change/actors/blobs/Web.java b/java/com/hmdzl/spspd/change/actors/blobs/Web.java deleted file mode 100644 index 82ef37db..00000000 --- a/java/com/hmdzl/spspd/change/actors/blobs/Web.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.blobs; - -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Roots; -import com.hmdzl.spspd.change.effects.BlobEmitter; -import com.hmdzl.spspd.change.effects.particles.WebParticle; -import com.hmdzl.spspd.change.messages.Messages; - -public class Web extends Blob { - - @Override - protected void evolve() { - - for (int i = 0; i < LENGTH; i++) { - - int offv = cur[i] > 0 ? cur[i] - 1 : 0; - off[i] = offv; - - if (offv > 0) { - - volume += offv; - - Char ch = Actor.findChar(i); - if (ch != null) { - Buff.prolong(ch, Roots.class, TICK); - } - } - } - } - - @Override - public void use(BlobEmitter emitter) { - super.use(emitter); - - emitter.pour(WebParticle.FACTORY, 0.4f); - } - - @Override - public void seed(int cell, int amount) { - int diff = amount - cur[cell]; - if (diff > 0) { - cur[cell] = amount; - volume += diff; - } - } - - @Override - public String tileDesc() { - return Messages.get(this, "desc"); - } -} diff --git a/java/com/hmdzl/spspd/change/actors/blobs/WellWater.java b/java/com/hmdzl/spspd/change/actors/blobs/WellWater.java deleted file mode 100644 index d0a7ed47..00000000 --- a/java/com/hmdzl/spspd/change/actors/blobs/WellWater.java +++ /dev/null @@ -1,166 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.blobs; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.Journal; -import com.hmdzl.spspd.change.Journal.Feature; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.items.Heap; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.Terrain; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -public class WellWater extends Blob { - - public int pos; - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - - for (int i = 0; i < LENGTH; i++) { - if (cur[i] > 0) { - pos = i; - break; - } - } - } - - @Override - protected void evolve() { - volume = off[pos] = cur[pos]; - - if (Dungeon.visible[pos]) { - if (this instanceof WaterOfAwareness) { - Journal.add(Feature.WELL_OF_AWARENESS); - } else if (this instanceof WaterOfHealth) { - Journal.add(Feature.WELL_OF_HEALTH); - } else if (this instanceof WaterOfTransmutation) { - Journal.add(Feature.WELL_OF_TRANSMUTATION); - } - } - } - - - protected boolean affect() { - - Heap heap; - - if (pos == Dungeon.hero.pos && affectHero(Dungeon.hero)) { - - volume = off[pos] = cur[pos] = 0; - return true; - - } else if ((heap = Dungeon.level.heaps.get(pos)) != null) { - - Item oldItem = heap.peek(); - Item newItem = affectItem(oldItem); - - if (newItem != null) { - - if (newItem == oldItem) { - - } else if (oldItem.quantity() > 1) { - - oldItem.quantity(oldItem.quantity() - 1); - heap.drop(newItem); - - } else { - heap.replace(oldItem, newItem); - } - - heap.sprite.link(); - volume = off[pos] = cur[pos] = 0; - - return true; - - } else { - - int newPlace; - do { - newPlace = pos + Level.NEIGHBOURS8[Random.Int(8)]; - } while (!Level.passable[newPlace] && !Level.avoid[newPlace]); - Dungeon.level.drop(heap.pickUp(), newPlace).sprite.drop(pos); - - return false; - - } - - } else { - - return false; - - } - } - - protected boolean affectHero(Hero hero) { - return false; - } - - protected Item affectItem(Item item) { - return null; - } - - @Override - public void seed(int cell, int amount) { - cur[pos] = 0; - pos = cell; - volume = cur[pos] = amount; - } - - public static void affectCell(int cell) { - - Class[] waters = { WaterOfHealth.class, WaterOfAwareness.class, - WaterOfTransmutation.class}; - - for (Class waterClass : waters) { - WellWater water = (WellWater) Dungeon.level.blobs.get(waterClass); - if (water != null && water.volume > 0 && water.pos == cell - && water.affect()) { - - Level.set(cell, Terrain.EMPTY_WELL); - GameScene.updateMap(cell); - - return; - } - } - } - - public static boolean affectCellPlant(int cell) { - - boolean transmuted = false; - - Class[] waters = { WaterOfHealth.class, WaterOfAwareness.class, - WaterOfTransmutation.class}; - - for (Class waterClass : waters) { - WellWater water = (WellWater) Dungeon.level.blobs.get(waterClass); - if (water != null && water.volume > 0 && water.pos == cell - && water.affect()) { - - GameScene.updateMap(cell); - transmuted = true; - } - } - return transmuted; - } -} diff --git a/java/com/hmdzl/spspd/change/actors/blobs/weather/WeatherOfDead.java b/java/com/hmdzl/spspd/change/actors/blobs/weather/WeatherOfDead.java deleted file mode 100644 index 6078c68c..00000000 --- a/java/com/hmdzl/spspd/change/actors/blobs/weather/WeatherOfDead.java +++ /dev/null @@ -1,59 +0,0 @@ -package com.hmdzl.spspd.change.actors.blobs.weather; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.Blob; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Cold; -import com.hmdzl.spspd.change.actors.buffs.DeadRaise; -import com.hmdzl.spspd.change.actors.buffs.Hot; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.BlobEmitter; -import com.hmdzl.spspd.change.effects.particles.DeadParticle; -import com.hmdzl.spspd.change.effects.particles.SnowParticle; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.messages.Messages; - -public class WeatherOfDead extends Blob { - - protected int pos; - - @Override - protected void evolve() { - int from = WIDTH + 1; - int to = Level.LENGTH - WIDTH - 1; - - int[] map = Dungeon.level.map; - - for (int pos=from; pos < to; pos++) { - if (cur[pos] > 0) { - - off[pos] = cur[pos]; - volume += off[pos]; - - } else { - off[pos] = 0; - } - } - - Hero hero = Dungeon.hero; - if (hero.isAlive() && cur[hero.pos] > 0) { - Buff.prolong( hero, DeadRaise.class, 2f ); - Buff.detach(hero,Hot.class); - } - - } - - @Override - public void use(BlobEmitter emitter) { - super.use(emitter); - emitter.start(DeadParticle.FACTORY, 0.3f, 0); - } - - @Override - public String tileDesc() { - return Messages.get(this, "desc"); - } - -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/actors/blobs/weather/WeatherOfQuite.java b/java/com/hmdzl/spspd/change/actors/blobs/weather/WeatherOfQuite.java deleted file mode 100644 index 7f95898d..00000000 --- a/java/com/hmdzl/spspd/change/actors/blobs/weather/WeatherOfQuite.java +++ /dev/null @@ -1,59 +0,0 @@ -package com.hmdzl.spspd.change.actors.blobs.weather; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.Blob; -import com.hmdzl.spspd.change.actors.buffs.Bless; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Cold; -import com.hmdzl.spspd.change.actors.buffs.Hot; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.BlobEmitter; -import com.hmdzl.spspd.change.effects.particles.RainParticle; -import com.hmdzl.spspd.change.effects.particles.ShaftParticle; -import com.hmdzl.spspd.change.effects.particles.SnowParticle; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.messages.Messages; - -public class WeatherOfQuite extends Blob { - - protected int pos; - - @Override - protected void evolve() { - int from = WIDTH + 1; - int to = Level.LENGTH - WIDTH - 1; - - int[] map = Dungeon.level.map; - - for (int pos=from; pos < to; pos++) { - if (cur[pos] > 0) { - - off[pos] = cur[pos]; - volume += off[pos]; - - } else { - off[pos] = 0; - } - } - - Hero hero = Dungeon.hero; - if (hero.isAlive() && cur[hero.pos] > 0) { - Buff.prolong( hero, Bless.class, 5f ); - } - - } - - @Override - public void use(BlobEmitter emitter) { - super.use(emitter); - emitter.start( ShaftParticle.FACTORY, 0.8f, 0); - } - - @Override - public String tileDesc() { - return Messages.get(this, "desc"); - } - -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/actors/blobs/weather/WeatherOfRain.java b/java/com/hmdzl/spspd/change/actors/blobs/weather/WeatherOfRain.java deleted file mode 100644 index 7f06c5cb..00000000 --- a/java/com/hmdzl/spspd/change/actors/blobs/weather/WeatherOfRain.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.hmdzl.spspd.change.actors.blobs.weather; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.Blob; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Dry; -import com.hmdzl.spspd.change.actors.buffs.Wet; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.BlobEmitter; -import com.hmdzl.spspd.change.effects.particles.RainParticle; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.messages.Messages; - -public class WeatherOfRain extends Blob { - - protected int pos; - - @Override - protected void evolve() { - - int from = WIDTH + 1; - int to = Level.LENGTH - WIDTH - 1; - - int[] map = Dungeon.level.map; - - for (int pos=from; pos < to; pos++) { - if (cur[pos] > 0) { - - off[pos] = cur[pos]; - volume += off[pos]; - - } else { - off[pos] = 0; - } - } - - Hero hero = Dungeon.hero; - if (hero.isAlive() && cur[hero.pos] > 0) { - Buff.prolong( hero, Wet.class, Wet.DURATION ); - Buff.detach(hero,Dry.class); - } - } - - @Override - public void use(BlobEmitter emitter) { - super.use(emitter); - emitter.start(RainParticle.FACTORY, 0.8f, 0); - } - - @Override - public String tileDesc() { - return Messages.get(this, "desc"); - } - -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/actors/blobs/weather/WeatherOfSand.java b/java/com/hmdzl/spspd/change/actors/blobs/weather/WeatherOfSand.java deleted file mode 100644 index bed506c6..00000000 --- a/java/com/hmdzl/spspd/change/actors/blobs/weather/WeatherOfSand.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.hmdzl.spspd.change.actors.blobs.weather; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.Blob; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Dry; -import com.hmdzl.spspd.change.actors.buffs.Wet; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.BlobEmitter; -import com.hmdzl.spspd.change.effects.particles.SandParticle; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.messages.Messages; - -public class WeatherOfSand extends Blob { - - protected int pos; - - @Override - protected void evolve() { - int from = WIDTH + 1; - int to = Level.LENGTH - WIDTH - 1; - - int[] map = Dungeon.level.map; - - for (int pos=from; pos < to; pos++) { - if (cur[pos] > 0) { - - off[pos] = cur[pos]; - volume += off[pos]; - - } else { - off[pos] = 0; - } - } - - Hero hero = Dungeon.hero; - if (hero.isAlive() && cur[hero.pos] > 0) { - Buff.prolong( hero, Dry.class, Dry.DURATION ); - Buff.detach(hero,Wet.class); - } - } - - @Override - public void use(BlobEmitter emitter) { - super.use(emitter); - emitter.start(SandParticle.FACTORY, 0.5f, 0); - } - - @Override - public String tileDesc() { - return Messages.get(this, "desc"); - } - -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/actors/blobs/weather/WeatherOfSnow.java b/java/com/hmdzl/spspd/change/actors/blobs/weather/WeatherOfSnow.java deleted file mode 100644 index 886214c5..00000000 --- a/java/com/hmdzl/spspd/change/actors/blobs/weather/WeatherOfSnow.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.hmdzl.spspd.change.actors.blobs.weather; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.Blob; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Cold; -import com.hmdzl.spspd.change.actors.buffs.Hot; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.BlobEmitter; -import com.hmdzl.spspd.change.effects.particles.SnowParticle; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.messages.Messages; - -public class WeatherOfSnow extends Blob { - - protected int pos; - - @Override - protected void evolve() { - int from = WIDTH + 1; - int to = Level.LENGTH - WIDTH - 1; - - int[] map = Dungeon.level.map; - - for (int pos=from; pos < to; pos++) { - if (cur[pos] > 0) { - - off[pos] = cur[pos]; - volume += off[pos]; - - } else { - off[pos] = 0; - } - } - - Hero hero = Dungeon.hero; - if (hero.isAlive() && cur[hero.pos] > 0) { - Buff.prolong( hero, Cold.class, Cold.DURATION ); - Buff.detach(hero,Hot.class); - } - - } - - @Override - public void use(BlobEmitter emitter) { - super.use(emitter); - emitter.start(SnowParticle.FACTORY, 0.5f, 0); - } - - @Override - public String tileDesc() { - return Messages.get(this, "desc"); - } - -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/actors/blobs/weather/WeatherOfSun.java b/java/com/hmdzl/spspd/change/actors/blobs/weather/WeatherOfSun.java deleted file mode 100644 index ceb8ab7c..00000000 --- a/java/com/hmdzl/spspd/change/actors/blobs/weather/WeatherOfSun.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.hmdzl.spspd.change.actors.blobs.weather; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.Blob; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Cold; -import com.hmdzl.spspd.change.actors.buffs.Hot; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.BlobEmitter; -import com.hmdzl.spspd.change.effects.particles.ShaftParticle; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.messages.Messages; - -public class WeatherOfSun extends Blob { - - protected int pos; - - @Override - protected void evolve() { - int from = WIDTH + 1; - int to = Level.LENGTH - WIDTH - 1; - - int[] map = Dungeon.level.map; - - for (int pos=from; pos < to; pos++) { - if (cur[pos] > 0) { - - off[pos] = cur[pos]; - volume += off[pos]; - - } else { - off[pos] = 0; - } - } - - Hero hero = Dungeon.hero; - if (hero.isAlive() && cur[hero.pos] > 0) { - Buff.prolong( hero, Hot.class, Hot.DURATION ); - Buff.detach(hero,Cold.class); - } - } - - @Override - public void use(BlobEmitter emitter) { - super.use(emitter); - emitter.start(ShaftParticle.FACTORY, 0.9f, 0); - } - - @Override - public String tileDesc() { - return Messages.get(this, "desc"); - } - -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/actors/buffs/AflyBless.java b/java/com/hmdzl/spspd/change/actors/buffs/AflyBless.java deleted file mode 100644 index a8992a47..00000000 --- a/java/com/hmdzl/spspd/change/actors/buffs/AflyBless.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * Shattered Pixel Dungeon - * Copyright (C) 2014-2015 Evan Debenham - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.buffs; - -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.ui.BuffIndicator; - -public class AflyBless extends FlavourBuff { - - public static final float DURATION = 200f; - - { - type = buffType.POSITIVE; - } - - - @Override - public int icon() { - return BuffIndicator.NO_FUSHIGI; - } - - @Override - public String toString() { - return Messages.get(this, "name"); - } - - @Override - public String desc() { - return Messages.get(this, "desc", dispTurns()); - } -} diff --git a/java/com/hmdzl/spspd/change/actors/buffs/Amok.java b/java/com/hmdzl/spspd/change/actors/buffs/Amok.java deleted file mode 100644 index b8115e6b..00000000 --- a/java/com/hmdzl/spspd/change/actors/buffs/Amok.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.buffs; - -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.ui.BuffIndicator; - -public class Amok extends FlavourBuff { - - { - type = buffType.NEGATIVE; - } - - @Override - public int icon() { - return BuffIndicator.AMOK; - } - - @Override - public void detach() { - super.detach(); - if (target instanceof Mob) - ((Mob)target).aggro( null ); - } - - @Override - public String toString() { - return Messages.get(this, "name"); - } - - @Override - public String desc() { - return Messages.get(this, "desc", dispTurns()); - } - -} diff --git a/java/com/hmdzl/spspd/change/actors/buffs/Arcane.java b/java/com/hmdzl/spspd/change/actors/buffs/Arcane.java deleted file mode 100644 index d2100553..00000000 --- a/java/com/hmdzl/spspd/change/actors/buffs/Arcane.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.buffs; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.hmdzl.spspd.change.ui.BuffIndicator; - -public class Arcane extends FlavourBuff { - - public static final float DURATION = 30f; - - @Override - public int icon() { - return BuffIndicator.ARCANE; - } - - @Override - public String toString() { - return Messages.get(this, "name"); - } - - @Override - public String desc() { - return Messages.get(this, "desc", dispTurns()); - } -} diff --git a/java/com/hmdzl/spspd/change/actors/buffs/ArmorBreak.java b/java/com/hmdzl/spspd/change/actors/buffs/ArmorBreak.java deleted file mode 100644 index 53fed96c..00000000 --- a/java/com/hmdzl/spspd/change/actors/buffs/ArmorBreak.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * Shattered Pixel Dungeon - * Copyright (C) 2014-2015 Evan Debenham - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.buffs; - -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.ui.BuffIndicator; -import com.watabou.utils.Bundle; - -public class ArmorBreak extends FlavourBuff { - - private int level = 0; - private static final String LEVEL = "level"; - protected float left; - private static final String LEFT = "left"; - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(LEVEL, level); - bundle.put(LEFT, left); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - level = bundle.getInt(LEVEL); - left = bundle.getFloat(LEFT); - } - - public void set(float duration) { - this.left = duration; - }; - public static final float DURATION = 10f; - - { - type = buffType.NEGATIVE; - } - - public boolean act() { - - spend(TICK); - left -= TICK; - if (left <= 0) - detach(); - return true; - - } - - public int level() { - return level; - } - - public void level(int value) { - if (level < value) { - level = value; - } - } - - @Override - public int icon() { - return BuffIndicator.ARMOR_BREAK; - } - - - - @Override - public String toString() { - return Messages.get(this, "name"); - } - - @Override - public String desc() { - return Messages.get(this, "desc", dispTurns(),level()); - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/actors/buffs/AttackDown.java b/java/com/hmdzl/spspd/change/actors/buffs/AttackDown.java deleted file mode 100644 index 0bdb10eb..00000000 --- a/java/com/hmdzl/spspd/change/actors/buffs/AttackDown.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.buffs; - -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.items.rings.RingOfElements.Resistance; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.ui.BuffIndicator; -import com.watabou.utils.Bundle; - -public class AttackDown extends FlavourBuff { - - private int level = 0; - private static final String LEVEL = "level"; - protected float left; - private static final String LEFT = "left"; - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(LEVEL, level); - bundle.put(LEFT, left); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - level = bundle.getInt(LEVEL); - left = bundle.getFloat(LEFT); - } - - public void set(float duration) { - this.left = duration; - }; - - { - type = buffType.NEGATIVE; - } - - public boolean act() { - - spend(TICK); - left -= TICK; - if (left <= 0) - detach(); - return true; - - } - @Override - public int icon() { - return BuffIndicator.WEAKNESS; - } - - public int level() { - return level; - } - - public void level(int value) { - if (level < value) { - level = value; - } - } - - @Override - public String toString() { - return Messages.get(this, "name"); - } - - @Override - public String desc() { - return Messages.get(this, "desc", dispTurns(),level()); - } - -} diff --git a/java/com/hmdzl/spspd/change/actors/buffs/AttackUp.java b/java/com/hmdzl/spspd/change/actors/buffs/AttackUp.java deleted file mode 100644 index 12ab6f25..00000000 --- a/java/com/hmdzl/spspd/change/actors/buffs/AttackUp.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.buffs; - -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.items.rings.RingOfElements.Resistance; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.ui.BuffIndicator; -import com.watabou.utils.Bundle; - -public class AttackUp extends FlavourBuff { - - private int level = 0; - private static final String LEVEL = "level"; - protected float left; - private static final String LEFT = "left"; - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(LEVEL, level); - bundle.put(LEFT, left); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - level = bundle.getInt(LEVEL); - left = bundle.getFloat(LEFT); - } - - public void set(float duration) { - this.left = duration; - }; - - { - type = buffType.POSITIVE; - } - - public boolean act() { - - spend(TICK); - left -= TICK; - if (left <= 0) - detach(); - return true; - - } - @Override - public int icon() { - return BuffIndicator.ATTACK_UP; - } - - public int level() { - return level; - } - - public void level(int value) { - if (level < value) { - level = value; - } - } - - @Override - public String toString() { - return Messages.get(this, "name"); - } - - @Override - public String desc() { - return Messages.get(this, "desc", dispTurns(),level()); - } - -} diff --git a/java/com/hmdzl/spspd/change/actors/buffs/Awareness.java b/java/com/hmdzl/spspd/change/actors/buffs/Awareness.java deleted file mode 100644 index 4e9f71bb..00000000 --- a/java/com/hmdzl/spspd/change/actors/buffs/Awareness.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.buffs; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.ui.BuffIndicator; - -public class Awareness extends FlavourBuff { - - public static final float DURATION = 2f; - - { - type = buffType.POSITIVE; - } - - @Override - public int icon() { - return BuffIndicator.MIND_VISION; - } - - @Override - public String toString() { - return Messages.get(this, "name"); - } - - @Override - public void detach() { - super.detach(); - Dungeon.observe(); - } - - @Override - public String desc() { - return Messages.get(this, "desc", dispTurns()); - } -} diff --git a/java/com/hmdzl/spspd/change/actors/buffs/Barkskin.java b/java/com/hmdzl/spspd/change/actors/buffs/Barkskin.java deleted file mode 100644 index bfce8bac..00000000 --- a/java/com/hmdzl/spspd/change/actors/buffs/Barkskin.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.buffs; - -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.ui.BuffIndicator; -import com.watabou.utils.Bundle; - -public class Barkskin extends Buff { - - private int barkleft = 0; - - private static final String BARKLEFT = "barkleft"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(BARKLEFT, barkleft); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - barkleft = bundle.getInt(BARKLEFT); - } - - @Override - public boolean act() { - if (target.isAlive()) { - - spend(TICK); - barkleft = (int)barkleft/2; - if (barkleft <= 1) { - detach(); - } - - } else { - - detach(); - - } - - return true; - } - - public int level() { - return barkleft; - } - - public void level(int value) { - if (barkleft < value) { - barkleft = value; - } - } - - @Override - public int icon() { - return BuffIndicator.BARKSKIN; - } - - @Override - public String toString() { - return Messages.get(this, "name"); - } - - @Override - public String desc() { - return Messages.get(this, "desc", barkleft); - } -} diff --git a/java/com/hmdzl/spspd/change/actors/buffs/BerryRegeneration.java b/java/com/hmdzl/spspd/change/actors/buffs/BerryRegeneration.java deleted file mode 100644 index 3b6e029f..00000000 --- a/java/com/hmdzl/spspd/change/actors/buffs/BerryRegeneration.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.buffs; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.hero.HeroSubClass; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.ui.BuffIndicator; -import com.watabou.utils.Bundle; - -public class BerryRegeneration extends Buff { - - private int regenleft = 0; - - private static final String REGENLEFT = "regenleft"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(REGENLEFT, regenleft); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - regenleft = bundle.getInt(REGENLEFT); - } - - public int level() { - return regenleft; - } - - public void level(int value) { - if (regenleft < value) { - regenleft = value; - } - } - - @Override - public int icon() { - return BuffIndicator.REGEN; - } - - @Override - public String toString() { - return Messages.get(this, "name"); - } - - @Override - public String desc() { - return Messages.get(this, "desc", regenleft); - } - - @Override - public boolean act() { - if (target.isAlive()) { - if (Dungeon.hero.subClass == HeroSubClass.PASTOR && target.HP < target.HT*1.5){ - target.HP += 2 * (5+Math.round(regenleft/25)); - } else if (target.HP < target.HT) { - target.HP += Math.min(5+Math.round(regenleft/25),(target.HT-target.HP)); - } - - spend(TICK); - if (--regenleft <= 0) { - detach(); - } - - } else { - - detach(); - - } - - return true; - } - -} diff --git a/java/com/hmdzl/spspd/change/actors/buffs/Bleeding.java b/java/com/hmdzl/spspd/change/actors/buffs/Bleeding.java deleted file mode 100644 index f4ff76ea..00000000 --- a/java/com/hmdzl/spspd/change/actors/buffs/Bleeding.java +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.buffs; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.ResultDescriptions; -import com.hmdzl.spspd.change.effects.Splash; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.ui.BuffIndicator; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.utils.Bundle; -import com.watabou.utils.PointF; -import com.watabou.utils.Random; - -public class Bleeding extends Buff { - - { - type = buffType.NEGATIVE; - } - - protected int level; - - private static final String LEVEL = "level"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(LEVEL, level); - - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - level = bundle.getInt(LEVEL); - } - - public void set(int level) { - this.level = level; - }; - - @Override - public int icon() { - return BuffIndicator.BLEEDING; - } - - @Override - public String toString() { - return Messages.get(this, "name"); - } - - @Override - public boolean act() { - if (target.isAlive()) { - - if ((level = Random.Int(level / 3, level/2)) > 0) { - - target.damage(level, this); - if (target.sprite.visible) { - Splash.at(target.sprite.center(), -PointF.PI / 2, - PointF.PI / 6, target.sprite.blood(), - Math.min(10 * level / target.HT, 10)); - } - - if (target == Dungeon.hero && !target.isAlive()) { - Dungeon.fail(Messages.format(ResultDescriptions.BLEEDING)); - //GLog.n("You bled to death..."); - } - - spend(TICK); - } else { - detach(); - } - - } else { - - detach(); - - } - - return true; - } - - @Override - public String heroMessage() { - return Messages.get(this, "heromsg"); - } - - @Override - public String desc() { - return Messages.get(this, "desc", level); - } -} diff --git a/java/com/hmdzl/spspd/change/actors/buffs/Bless.java b/java/com/hmdzl/spspd/change/actors/buffs/Bless.java deleted file mode 100644 index aec5e063..00000000 --- a/java/com/hmdzl/spspd/change/actors/buffs/Bless.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * Shattered Pixel Dungeon - * Copyright (C) 2014-2015 Evan Debenham - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.buffs; - -import com.hmdzl.spspd.change.actors.blobs.ConfusionGas; -import com.hmdzl.spspd.change.actors.blobs.CorruptGas; -import com.hmdzl.spspd.change.actors.blobs.ElectriShock; -import com.hmdzl.spspd.change.actors.blobs.Fire; -import com.hmdzl.spspd.change.actors.blobs.Freezing; -import com.hmdzl.spspd.change.actors.blobs.ParalyticGas; -import com.hmdzl.spspd.change.actors.blobs.Regrowth; -import com.hmdzl.spspd.change.actors.blobs.ShockWeb; -import com.hmdzl.spspd.change.actors.blobs.StenchGas; -import com.hmdzl.spspd.change.actors.blobs.ToxicGas; -import com.hmdzl.spspd.change.actors.blobs.VenomGas; -import com.hmdzl.spspd.change.actors.blobs.weather.WeatherOfRain; -import com.hmdzl.spspd.change.actors.blobs.weather.WeatherOfSand; -import com.hmdzl.spspd.change.actors.blobs.weather.WeatherOfSnow; -import com.hmdzl.spspd.change.actors.blobs.weather.WeatherOfSun; -import com.hmdzl.spspd.change.actors.blobs.Web; -import com.hmdzl.spspd.change.levels.traps.LightningTrap; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.ui.BuffIndicator; - -public class Bless extends FlavourBuff { - - public static final float DURATION = 30f; - - @Override - public int icon() { - return BuffIndicator.BLESS; - } - - @Override - public String toString() { - return Messages.get(this, "name"); - } - - { - immunities.add( ParalyticGas.class ); - immunities.add( ToxicGas.class ); - immunities.add( ConfusionGas.class ); - immunities.add( StenchGas.class ); - immunities.add( VenomGas.class ); - immunities.add( CorruptGas.class ); - immunities.add( Fire.class ); - immunities.add( Freezing.class ); - immunities.add( ElectriShock.class ); - immunities.add( LightningTrap.Electricity.class ); - immunities.add( Regrowth.class ); - immunities.add( Web.class ); - immunities.add( ShockWeb.class ); - immunities.add( Hot.class ); - immunities.add( Cold.class ); - immunities.add( Wet.class ); - immunities.add( Dry.class ); - immunities.add(WeatherOfRain.class); - immunities.add(WeatherOfSand.class); - immunities.add(WeatherOfSnow.class); - immunities.add(WeatherOfSun.class); - } - - @Override - public String desc() { - return Messages.get(this, "desc", dispTurns()); - } -} diff --git a/java/com/hmdzl/spspd/change/actors/buffs/Blindness.java b/java/com/hmdzl/spspd/change/actors/buffs/Blindness.java deleted file mode 100644 index 04182068..00000000 --- a/java/com/hmdzl/spspd/change/actors/buffs/Blindness.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.buffs; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.ui.BuffIndicator; - -public class Blindness extends FlavourBuff { - - { - type = buffType.NEGATIVE; - } - - @Override - public void detach() { - super.detach(); - Dungeon.observe(); - } - - @Override - public int icon() { - return BuffIndicator.BLINDNESS; - } - - @Override - public String toString() { - return Messages.get(this, "name"); - } - - @Override - public String heroMessage() { - return Messages.get(this, "heromsg"); - } - - @Override - public String desc() { - return Messages.get(this, "desc", dispTurns()); - } -} diff --git a/java/com/hmdzl/spspd/change/actors/buffs/BloodAngry.java b/java/com/hmdzl/spspd/change/actors/buffs/BloodAngry.java deleted file mode 100644 index baf072db..00000000 --- a/java/com/hmdzl/spspd/change/actors/buffs/BloodAngry.java +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * Shattered Pixel Dungeon - * Copyright (C) 2014-2015 Evan Debenham - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.buffs; - -import com.hmdzl.spspd.change.actors.blobs.ConfusionGas; -import com.hmdzl.spspd.change.actors.blobs.CorruptGas; -import com.hmdzl.spspd.change.actors.blobs.ElectriShock; -import com.hmdzl.spspd.change.actors.blobs.Fire; -import com.hmdzl.spspd.change.actors.blobs.Freezing; -import com.hmdzl.spspd.change.actors.blobs.ParalyticGas; -import com.hmdzl.spspd.change.actors.blobs.Regrowth; -import com.hmdzl.spspd.change.actors.blobs.ShockWeb; -import com.hmdzl.spspd.change.actors.blobs.StenchGas; -import com.hmdzl.spspd.change.actors.blobs.ToxicGas; -import com.hmdzl.spspd.change.actors.blobs.VenomGas; -import com.hmdzl.spspd.change.actors.blobs.weather.WeatherOfRain; -import com.hmdzl.spspd.change.actors.blobs.weather.WeatherOfSand; -import com.hmdzl.spspd.change.actors.blobs.weather.WeatherOfSnow; -import com.hmdzl.spspd.change.actors.blobs.weather.WeatherOfSun; -import com.hmdzl.spspd.change.actors.blobs.Web; -import com.hmdzl.spspd.change.levels.traps.LightningTrap; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.ui.BuffIndicator; -import com.watabou.utils.Bundle; - -public class BloodAngry extends Buff { - - public static final float DURATION = 30f; - - private float left; - private static final String LEFT = "left"; - - @Override - public int icon() { - return BuffIndicator.BLOODANGRY; - } - - @Override - public boolean act() { - - if (target.HP > target.HT/3){ - target.HP = Math.max(target.HT/3, target.HP - 1); - } - spend(TICK); - left -= TICK; - if (left <= 0){ - detach(); - } else - if (target.HP < target.HT/3){ - target.HP = Math.max(target.HT/3, target.HP + 1); - } - spend(TICK); - left -= TICK; - if (left <= 0){ - detach(); - } - return true; - } - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(LEFT, left); - - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - left = bundle.getInt(LEFT); - } - public void set(float left){ - this.left = left; - } - - @Override - public String toString() { - return Messages.get(this, "name"); - } - - @Override - public String desc() { - return Messages.get(this, "desc", left); - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/actors/buffs/BloodImbue.java b/java/com/hmdzl/spspd/change/actors/buffs/BloodImbue.java deleted file mode 100644 index 662f12e6..00000000 --- a/java/com/hmdzl/spspd/change/actors/buffs/BloodImbue.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.buffs; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.effects.particles.FlameParticle; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.Terrain; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.ui.BuffIndicator; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -/** - * Created by debenhame on 19/11/2014. - */ -public class BloodImbue extends FlavourBuff { - - public static final float DURATION = 10f; - - { - type = buffType.POSITIVE; - } - - - public void proc(Char enemy) { - switch (Random.Int(4)){ - case 0: - Buff.affect(enemy, Cripple.class,3); - break; - case 1: - Buff.affect(enemy, Roots.class,3); - break; - case 2: - Buff.affect(enemy, Paralysis.class,3); - break; - case 3: - break; - } - } - - @Override - public int icon() { - return BuffIndicator.PBLOOD; - } - - @Override - public String toString() { - return Messages.get(this, "name"); - } - - @Override - public String desc() { - return Messages.get(this, "desc", dispTurns()); - } - - { - immunities.add(Paralysis.class); - immunities.add(Roots.class); - immunities.add(Slow.class); - immunities.add(Bleeding.class); - immunities.add(Weakness.class); - } - -} diff --git a/java/com/hmdzl/spspd/change/actors/buffs/BoxStar.java b/java/com/hmdzl/spspd/change/actors/buffs/BoxStar.java deleted file mode 100644 index df161bb2..00000000 --- a/java/com/hmdzl/spspd/change/actors/buffs/BoxStar.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.buffs; - -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.items.rings.RingOfElements.Resistance; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.hmdzl.spspd.change.ui.BuffIndicator; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -public class BoxStar extends FlavourBuff { - - { - type = buffType.POSITIVE; - } - - public int proc(int damage, Char attacker) { - - damage = 0; - return damage; - } - - public int icon() { - return BuffIndicator.UNKNOW_BOX; - } - - @Override - public void fx(boolean on) { - if (on) target.sprite.add(CharSprite.State.ILLUMINATED); - else target.sprite.remove(CharSprite.State.ILLUMINATED); - } - - @Override - public String toString() { - return Messages.get(this, "name"); - } - - @Override - public String desc() { - return Messages.get(this, "desc", dispTurns()); - } - -} diff --git a/java/com/hmdzl/spspd/change/actors/buffs/Buff.java b/java/com/hmdzl/spspd/change/actors/buffs/Buff.java deleted file mode 100644 index e6429287..00000000 --- a/java/com/hmdzl/spspd/change/actors/buffs/Buff.java +++ /dev/null @@ -1,137 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.buffs; - -import java.text.DecimalFormat; -import java.util.HashSet; - -import com.hmdzl.spspd.change.ShatteredPixelDungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.ui.BuffIndicator; - -public class Buff extends Actor { - - public Char target; - - public enum buffType {POSITIVE, NEGATIVE, NEUTRAL, SILENT}; - public buffType type = buffType.SILENT; - - public HashSet> resistances = new HashSet>(); - - public HashSet> immunities = new HashSet>(); - - public boolean attachTo(Char target) { - - if (target.immunities().contains(getClass())) { - return false; - } - - this.target = target; - target.add(this); - - if (target.buffs().contains(this)){ - if (target.sprite != null) fx( true ); - return true; - } else - return false; - } - - public void detach() { - fx( false ); - target.remove(this); - } - - @Override - public boolean act() { - diactivate(); - return true; - } - - public int icon() { - return BuffIndicator.NONE; - } - - public void fx(boolean on) { - //do nothing by default - }; - - public String heroMessage(){ - return null; - } - - public String desc(){ - return ""; - } - - //to handle the common case of showing how many turns are remaining in a buff description. - protected String dispTurns(float input){ - return new DecimalFormat("#.##").format(input); - } - - public static T append(Char target, Class buffClass) { - try { - T buff = buffClass.newInstance(); - buff.attachTo(target); - return buff; - } catch (Exception e) { - //ShatteredPixelDungeon.reportException(e); - return null; - } - } - - public static T append(Char target, - Class buffClass, float duration) { - T buff = append(target, buffClass); - buff.spend(duration); - return buff; - } - - public static T affect(Char target, Class buffClass) { - T buff = target.buff(buffClass); - if (buff != null) { - return buff; - } else { - return append(target, buffClass); - } - } - - public static T affect(Char target, - Class buffClass, float duration) { - T buff = affect(target, buffClass); - buff.spend(duration); - return buff; - } - - public static T prolong(Char target, - Class buffClass, float duration) { - T buff = affect(target, buffClass); - buff.postpone(duration); - return buff; - } - - public static void detach(Buff buff) { - if (buff != null) { - buff.detach(); - } - } - - public static void detach(Char target, Class cl) { - detach(target.buff(cl)); - } -} diff --git a/java/com/hmdzl/spspd/change/actors/buffs/Burning.java b/java/com/hmdzl/spspd/change/actors/buffs/Burning.java deleted file mode 100644 index 4c1ceb72..00000000 --- a/java/com/hmdzl/spspd/change/actors/buffs/Burning.java +++ /dev/null @@ -1,189 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.buffs; - -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.ResultDescriptions; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.Blob; -import com.hmdzl.spspd.change.actors.blobs.Fire; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.mobs.Thief; -import com.hmdzl.spspd.change.effects.particles.ElmoParticle; -import com.hmdzl.spspd.change.items.Heap; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.food.meatfood.ChargrilledMeat; -import com.hmdzl.spspd.change.items.food.meatfood.MysteryMeat; -import com.hmdzl.spspd.change.items.rings.RingOfElements.Resistance; -import com.hmdzl.spspd.change.items.scrolls.Scroll; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfMagicalInfusion; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfUpgrade; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.hmdzl.spspd.change.ui.BuffIndicator; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -public class Burning extends Buff implements Hero.Doom { - - private static final String TXT_BURNS_UP = "%s burns up!"; - private static final String TXT_BURNED_TO_DEATH = "You burned to death..."; - - private static final float DURATION = 8f; - - private float left; - - private static final String LEFT = "left"; - - { - type = buffType.NEGATIVE; - } - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(LEFT, left); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - left = bundle.getFloat(LEFT); - } - - @Override - public boolean act() { - - if (target.isAlive()) { - - if (target instanceof Hero) { - Buff.prolong(target, Light.class, TICK * 1.01f); - } - - target.damage(Random.Int(1, Math.min(1000,target.HT/20)), this); - Buff.detach( target, Chill.class); - - if (target instanceof Hero) { - - Hero hero = (Hero) target; - Item item = hero.belongings.randomUnequipped(); - if (item instanceof Scroll - && !(item instanceof ScrollOfUpgrade || item instanceof ScrollOfMagicalInfusion)){ - - item = item.detach(hero.belongings.backpack); - GLog.w(Messages.get(this, "burnsup", item.toString())); - - Heap.burnFX(hero.pos); - - } else if (item instanceof MysteryMeat) { - - item = item.detach(hero.belongings.backpack); - ChargrilledMeat steak = new ChargrilledMeat(); - if (!steak.collect(hero.belongings.backpack)) { - Dungeon.level.drop(steak, hero.pos).sprite.drop(); - } - GLog.w(Messages.get(this, "burnsup", item.toString())); - - Heap.burnFX(hero.pos); - - } - - } else if (target instanceof Thief) { - - Item item = ((Thief) target).item; - - if (item instanceof Scroll && - !(item instanceof ScrollOfUpgrade || item instanceof ScrollOfMagicalInfusion)) { - target.sprite.emitter().burst( ElmoParticle.FACTORY, 6 ); - ((Thief)target).item = null; - } - - } - - } else { - detach(); - } - - if (Level.flamable[target.pos]) { - GameScene.add(Blob.seed(target.pos, 4, Fire.class)); - } - - spend(TICK); - left -= TICK; - - if (left <= 0 || (Level.water[target.pos] && !target.flying)) { - - detach(); - } - - return true; - } - - public void reignite(Char ch) { - left = duration(ch); - } - - @Override - public int icon() { - return BuffIndicator.FIRE; - } - - @Override - public void fx(boolean on) { - if (on) target.sprite.add(CharSprite.State.BURNING); - else target.sprite.remove(CharSprite.State.BURNING); - } - - - @Override - public String heroMessage() { - return Messages.get(this, "heromsg"); - } - - @Override - public String toString() { - return Messages.get(this, "name"); - } - - public static float duration(Char ch) { - Resistance r = ch.buff(Resistance.class); - Tar tar = ch.buff(Tar.class); - if (ch.isAlive() && tar!=null){ - return DURATION; - } else return r != null ? r.durationFactor() * DURATION : DURATION; - - } - - @Override - public String desc() { - return Messages.get(this, "desc", dispTurns(left)); - } - - @Override - public void onDeath() { - - Badges.validateDeathFromFire(); - - Dungeon.fail(Messages.format(ResultDescriptions.BURNING)); - //GLog.n(TXT_BURNED_TO_DEATH); - } -} diff --git a/java/com/hmdzl/spspd/change/actors/buffs/Charm.java b/java/com/hmdzl/spspd/change/actors/buffs/Charm.java deleted file mode 100644 index 6fdfd466..00000000 --- a/java/com/hmdzl/spspd/change/actors/buffs/Charm.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.buffs; - -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.items.rings.RingOfElements.Resistance; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.ui.BuffIndicator; -import com.watabou.utils.Bundle; - -public class Charm extends FlavourBuff { - - public int object = 0; - - private static final String OBJECT = "object"; - - { - type = buffType.NEGATIVE; - } - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(OBJECT, object); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - object = bundle.getInt(OBJECT); - } - - @Override - public int icon() { - return BuffIndicator.HEART; - } - - @Override - public String toString() { - return Messages.get(this, "name"); - } - - public static float durationFactor(Char ch) { - Resistance r = ch.buff(Resistance.class); - return r != null ? r.durationFactor() : 1; - } - - @Override - public String heroMessage() { - return Messages.get(this, "heromsg"); - } - - @Override - public String desc() { - return Messages.get(this, "desc", dispTurns()); - } -} diff --git a/java/com/hmdzl/spspd/change/actors/buffs/Chill.java b/java/com/hmdzl/spspd/change/actors/buffs/Chill.java deleted file mode 100644 index a2e70dac..00000000 --- a/java/com/hmdzl/spspd/change/actors/buffs/Chill.java +++ /dev/null @@ -1,117 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ - -package com.hmdzl.spspd.change.actors.buffs; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.mobs.Thief; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.food.meatfood.FrozenCarpaccio; -import com.hmdzl.spspd.change.items.food.meatfood.MysteryMeat; -import com.hmdzl.spspd.change.items.potions.Potion; -import com.hmdzl.spspd.change.items.potions.PotionOfMight; -import com.hmdzl.spspd.change.items.potions.PotionOfStrength; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.hmdzl.spspd.change.ui.BuffIndicator; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.utils.Random; - -import java.text.DecimalFormat; - -public class Chill extends FlavourBuff { - - { - type = buffType.NEGATIVE; - } - - @Override - public boolean attachTo(Char target) { - //can't chill what's frozen! - if (target.buff(Frost.class) != null) return false; - - if (super.attachTo(target)){ - Burning.detach( target, Burning.class ); - - //chance of potion breaking is the same as speed factor. - if (Random.Float(1f) > speedFactor() && target instanceof Hero) { - - Hero hero = (Hero)target; - Item item = hero.belongings.randomUnequipped(); - if (item instanceof Potion - && !(item instanceof PotionOfStrength || item instanceof PotionOfMight)) { - - item = item.detach( hero.belongings.backpack ); - GLog.w(Messages.get(this, "freezes", item.toString())); - ((Potion) item).shatter(hero.pos); - - } else if (item instanceof MysteryMeat) { - - item = item.detach( hero.belongings.backpack ); - FrozenCarpaccio carpaccio = new FrozenCarpaccio(); - if (!carpaccio.collect( hero.belongings.backpack )) { - Dungeon.level.drop( carpaccio, target.pos ).sprite.drop(); - } - GLog.w(Messages.get(this, "freezes", item.toString())); - - } - } else if (target instanceof Thief) { - - Item item = ((Thief) target).item; - - if (item instanceof Potion && !(item instanceof PotionOfStrength || item instanceof PotionOfMight)) { - ((Potion) ((Thief) target).item).shatter(target.pos); - ((Thief) target).item = null; - } - - } - return true; - } else { - return false; - } - } - - //reduces speed by 10% for every turn remaining, capping at 50% - public float speedFactor(){ - return Math.max(0.5f, 1 - cooldown()*0.1f); - } - - @Override - public int icon() { - return BuffIndicator.FROST; - } - - //@Override - public void fx(boolean on) { - if (on) target.sprite.add(CharSprite.State.CHILLED); - else target.sprite.remove(CharSprite.State.CHILLED); - } - - @Override - public String toString() { - return Messages.get(this, "name"); - } - - @Override - public String desc() { - return Messages.get(this, "desc", dispTurns(), new DecimalFormat("#.##").format((1f-speedFactor())*100f)); - } - -} diff --git a/java/com/hmdzl/spspd/change/actors/buffs/Combo.java b/java/com/hmdzl/spspd/change/actors/buffs/Combo.java deleted file mode 100644 index 97027f34..00000000 --- a/java/com/hmdzl/spspd/change/actors/buffs/Combo.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.buffs; - -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.ui.BuffIndicator; -import com.hmdzl.spspd.change.utils.GLog; - -public class Combo extends Buff { - - private static String TXT_COMBO = "%d hit combo!"; - - public int count = 0; - - @Override - public int icon() { - return BuffIndicator.COMBO; - } - - @Override - public String toString() { - return Messages.get(this, "name"); - } - - public int hit(Char enemy, int damage) { - - count++; - - if (count >= 3) { - - Badges.validateMasteryCombo(count); - - GLog.p( Messages.get(this, "combo", count)); - postpone(1.41f - Math.min(0.8f,count / 20f)); - return (int) (damage * (count - 2) / 10f); - - } else { - - postpone(1.1f); - return 0; - - } - } - - @Override - public boolean act() { - detach(); - return true; - } - - @Override - public String desc() { - return Messages.get(this, "desc") + - (count <= 2 ? - Messages.get(this, "notenough") : - Messages.get(this, "bonusdmg", ((count - 2) * 20f))); - } - -} diff --git a/java/com/hmdzl/spspd/change/actors/buffs/Corruption.java b/java/com/hmdzl/spspd/change/actors/buffs/Corruption.java deleted file mode 100644 index dd3073c9..00000000 --- a/java/com/hmdzl/spspd/change/actors/buffs/Corruption.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * Shattered Pixel Dungeon - * Copyright (C) 2014-2019 Evan Debenham - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ - -package com.hmdzl.spspd.change.actors.buffs; - -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.hmdzl.spspd.change.ui.BuffIndicator; - -public class Corruption extends Buff { - - { - type = buffType.NEGATIVE; - } - - private float buildToDamage = 0f; - - @Override - public boolean act() { - buildToDamage += target.HT/200f; - - int damage = (int)buildToDamage; - buildToDamage -= damage; - - if (damage > 0 && damage < target.HP) - target.damage(damage, this); - - spend(TICK); - - return true; - } - - @Override - public void fx(boolean on) { - if (on) target.sprite.add( CharSprite.State.DARKENED ); - else if (target.invisible == 0) target.sprite.remove( CharSprite.State.DARKENED ); - } - - @Override - public int icon() { - return BuffIndicator.CORRUPT; - } - - @Override - public String toString() { - return Messages.get(this, "name"); - } - - @Override - public String desc() { - return Messages.get(this, "desc"); - } -} diff --git a/java/com/hmdzl/spspd/change/actors/buffs/CountDown.java b/java/com/hmdzl/spspd/change/actors/buffs/CountDown.java deleted file mode 100644 index 7ede74fb..00000000 --- a/java/com/hmdzl/spspd/change/actors/buffs/CountDown.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.buffs; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.ResultDescriptions; -import com.hmdzl.spspd.change.actors.mobs.BanditKing; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.effects.particles.ShadowParticle; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.ui.BuffIndicator; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.utils.Bundle; - -public class CountDown extends Buff { - - private int ticks = 0; - - private static final String TICKS = "ticks"; - - { - type = buffType.NEGATIVE; - } - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(TICKS, ticks); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - ticks = bundle.getInt(TICKS); - } - - - @Override - public int icon() { - return BuffIndicator.COUNTDOWN; - } - - @Override - public String toString() { - return Messages.get(this, "name"); - } - - @Override - public String desc() { - return Messages.get(this, "desc", ticks); - } - - @Override - public boolean act() { - if (target.isAlive()) { - ticks++; - if (ticks>5){ - target.sprite.emitter().burst(ShadowParticle.CURSE, 6); - target.damage(Math.round(target.HT / 4), this); - detach(); - } - } - - if (!target.isAlive() && target == Dungeon.hero) { - Dungeon.fail(Messages.format(ResultDescriptions.COUNTDOWN)); - //GLog.n(TXT_HERO_KILLED, toString()); - } - - spend(TICK); - - return true; - } -} diff --git a/java/com/hmdzl/spspd/change/actors/buffs/Cripple.java b/java/com/hmdzl/spspd/change/actors/buffs/Cripple.java deleted file mode 100644 index 3361d10b..00000000 --- a/java/com/hmdzl/spspd/change/actors/buffs/Cripple.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.buffs; - -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.ui.BuffIndicator; - -public class Cripple extends FlavourBuff { - - public static final float DURATION = 10f; - - { - type = buffType.NEGATIVE; - } - - @Override - public int icon() { - return BuffIndicator.CRIPPLE; - } - - @Override - public String toString() { - return Messages.get(this, "name"); - } - - @Override - public String heroMessage() { - return Messages.get(this, "heromsg"); - } - - @Override - public String desc() { - return Messages.get(this, "desc", dispTurns()); - } -} diff --git a/java/com/hmdzl/spspd/change/actors/buffs/DamageUp.java b/java/com/hmdzl/spspd/change/actors/buffs/DamageUp.java deleted file mode 100644 index 9eb6b548..00000000 --- a/java/com/hmdzl/spspd/change/actors/buffs/DamageUp.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.buffs; - -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.items.rings.RingOfElements.Resistance; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.ui.BuffIndicator; -import com.watabou.utils.Bundle; - -public class DamageUp extends FlavourBuff { - - private int level = 0; - private static final String LEVEL = "level"; - protected float left; - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(LEVEL, level); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - level = bundle.getInt(LEVEL); - } - - { - type = buffType.POSITIVE; - } - - public boolean act() { - spend(TICK); - return true; - } - @Override - public int icon() { - return BuffIndicator.ATTACK_UP; - } - - public int level() { - return level; - } - - public void level(int value) { - if (level < value) { - level = value; - } - } - - @Override - public String toString() { - return Messages.get(this, "name"); - } - - @Override - public String desc() { - return Messages.get(this, "desc",level()); - } - -} diff --git a/java/com/hmdzl/spspd/change/actors/buffs/DeadRaise.java b/java/com/hmdzl/spspd/change/actors/buffs/DeadRaise.java deleted file mode 100644 index 47983482..00000000 --- a/java/com/hmdzl/spspd/change/actors/buffs/DeadRaise.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * Shattered Pixel Dungeon - * Copyright (C) 2014-2015 Evan Debenham - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.buffs; - -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.ui.BuffIndicator; - -public class DeadRaise extends FlavourBuff { - - public static final float DURATION = 5f; - - { - type = buffType.NEGATIVE; - } - - @Override - public int icon() { - return BuffIndicator.TERROR; - } - - @Override - public String toString() { - return Messages.get(this, "name"); - } - - @Override - public String desc() { - return Messages.get(this, "desc", dispTurns()); - } -} diff --git a/java/com/hmdzl/spspd/change/actors/buffs/DefenceUp.java b/java/com/hmdzl/spspd/change/actors/buffs/DefenceUp.java deleted file mode 100644 index 63ac9786..00000000 --- a/java/com/hmdzl/spspd/change/actors/buffs/DefenceUp.java +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.buffs; - -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.items.rings.RingOfElements.Resistance; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.ui.BuffIndicator; -import com.watabou.utils.Bundle; - -public class DefenceUp extends FlavourBuff { - - private int level = 0; - private static final String LEVEL = "level"; - protected float left; - private static final String LEFT = "left"; - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(LEVEL, level); - bundle.put(LEFT, left); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - level = bundle.getInt(LEVEL); - left = bundle.getFloat(LEFT); - } - - public void set(float duration) { - this.left = duration; - }; - - { - type = buffType.POSITIVE; - } - - private static final float DURATION = 20f; - - public boolean act() { - - spend(TICK); - left -= TICK; - if (left <= 0) - detach(); - return true; - - } - - @Override - public int icon() { - return BuffIndicator.ARMOR; - } - - public int level() { - return level; - } - - public void level(int value) { - if (level < value) { - level = value; - } - } - @Override - public String toString() { - return Messages.get(this, "name"); - } - - @Override - public String desc() { - return Messages.get(this, "desc", dispTurns(),level()); - } - -} diff --git a/java/com/hmdzl/spspd/change/actors/buffs/Disarm.java b/java/com/hmdzl/spspd/change/actors/buffs/Disarm.java deleted file mode 100644 index 73b638fc..00000000 --- a/java/com/hmdzl/spspd/change/actors/buffs/Disarm.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.buffs; - -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.items.rings.RingOfElements.Resistance; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.ui.BuffIndicator; - -public class Disarm extends FlavourBuff { - - { - type = buffType.NEGATIVE; - } - - private static final float DURATION = 5f; - - @Override - public int icon() { - return BuffIndicator.DISARM; - } - - @Override - public String toString() { - return Messages.get(this, "name"); - } - - @Override - public String desc() { - return Messages.get(this, "desc", dispTurns()); - } - - public static float duration(Char ch) { - Resistance r = ch.buff(Resistance.class); - return r != null ? r.durationFactor() * DURATION : DURATION; - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/actors/buffs/Drowsy.java b/java/com/hmdzl/spspd/change/actors/buffs/Drowsy.java deleted file mode 100644 index 0e02677b..00000000 --- a/java/com/hmdzl/spspd/change/actors/buffs/Drowsy.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.buffs; - -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.ui.BuffIndicator; -import com.watabou.utils.Random; - -public class Drowsy extends Buff { - - { - type = buffType.NEUTRAL; - } - - - @Override - public int icon() { - return BuffIndicator.DROWSY; - } - - @Override - public boolean attachTo(Char target) { - if (!target.immunities().contains(Sleep.class) - && super.attachTo(target)) { - if (cooldown() == 0) - spend(Random.Int(3, 6)); - return true; - } - return false; - } - - @Override - public boolean act() { - Buff.affect(target, MagicalSleep.class); - - detach(); - return true; - } - - @Override - public String toString() { - return Messages.get(this, "name"); - } - - @Override - public String desc() { - return Messages.get(this, "desc", dispTurns(cooldown()+1)); - } -} diff --git a/java/com/hmdzl/spspd/change/actors/buffs/Dry.java b/java/com/hmdzl/spspd/change/actors/buffs/Dry.java deleted file mode 100644 index 1d3ad0b8..00000000 --- a/java/com/hmdzl/spspd/change/actors/buffs/Dry.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * Shattered Pixel Dungeon - * Copyright (C) 2014-2015 Evan Debenham - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.buffs; - -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.ui.BuffIndicator; - -public class Dry extends FlavourBuff { - - public static final float DURATION = 10f; - - { - type = buffType.NEGATIVE; - } - - @Override - public int icon() { - return BuffIndicator.DRY; - } - - @Override - public String toString() { - return Messages.get(this, "name"); - } - - @Override - public String desc() { - return Messages.get(this, "desc", dispTurns()); - } -} diff --git a/java/com/hmdzl/spspd/change/actors/buffs/EarthImbue.java b/java/com/hmdzl/spspd/change/actors/buffs/EarthImbue.java deleted file mode 100644 index 88af230d..00000000 --- a/java/com/hmdzl/spspd/change/actors/buffs/EarthImbue.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ - -package com.hmdzl.spspd.change.actors.buffs; - -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.particles.EarthParticle; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.ui.BuffIndicator; - -/** - * Created by debenhame on 19/11/2014. - */ -public class EarthImbue extends FlavourBuff { - - public static final float DURATION = 30f; - - public void proc(Char enemy) { - Buff.affect(enemy, Roots.class, 2); - CellEmitter.bottom(enemy.pos).start(EarthParticle.FACTORY, 0.05f, 8); - } - - @Override - public int icon() { - return BuffIndicator.PEARTH; - } - - @Override - public String toString() { - return Messages.get(this, "name"); - } - - @Override - public String desc() { - return Messages.get(this, "desc", dispTurns()); - } - - { - immunities.add(Paralysis.class); - immunities.add(Roots.class); - immunities.add(Slow.class); - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/actors/buffs/ExitFind.java b/java/com/hmdzl/spspd/change/actors/buffs/ExitFind.java deleted file mode 100644 index f7687e42..00000000 --- a/java/com/hmdzl/spspd/change/actors/buffs/ExitFind.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.buffs; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.ui.BuffIndicator; - -public class ExitFind extends FlavourBuff { - - public static final float DURATION = 1f; - - { - type = buffType.POSITIVE; - } - - @Override - public String toString() { - return Messages.get(this, "name"); - } - - @Override - public void detach() { - super.detach(); - Dungeon.observe(); - } - -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/actors/buffs/Feed.java b/java/com/hmdzl/spspd/change/actors/buffs/Feed.java deleted file mode 100644 index 94a61da9..00000000 --- a/java/com/hmdzl/spspd/change/actors/buffs/Feed.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * Shattered Pixel Dungeon - * Copyright (C) 2014-2015 Evan Debenham - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.buffs; - -import com.hmdzl.spspd.change.actors.blobs.ConfusionGas; -import com.hmdzl.spspd.change.actors.blobs.CorruptGas; -import com.hmdzl.spspd.change.actors.blobs.ElectriShock; -import com.hmdzl.spspd.change.actors.blobs.Fire; -import com.hmdzl.spspd.change.actors.blobs.Freezing; -import com.hmdzl.spspd.change.actors.blobs.ParalyticGas; -import com.hmdzl.spspd.change.actors.blobs.Regrowth; -import com.hmdzl.spspd.change.actors.blobs.ShockWeb; -import com.hmdzl.spspd.change.actors.blobs.StenchGas; -import com.hmdzl.spspd.change.actors.blobs.ToxicGas; -import com.hmdzl.spspd.change.actors.blobs.VenomGas; -import com.hmdzl.spspd.change.actors.blobs.weather.WeatherOfRain; -import com.hmdzl.spspd.change.actors.blobs.weather.WeatherOfSand; -import com.hmdzl.spspd.change.actors.blobs.weather.WeatherOfSnow; -import com.hmdzl.spspd.change.actors.blobs.weather.WeatherOfSun; -import com.hmdzl.spspd.change.actors.blobs.Web; -import com.hmdzl.spspd.change.levels.traps.LightningTrap; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.ui.BuffIndicator; - -public class Feed extends FlavourBuff { - - public static final float DURATION = 30f; - - @Override - public int icon() { - return BuffIndicator.FEED; - } - - @Override - public String toString() { - return Messages.get(this, "name"); - } - - @Override - public String desc() { - return Messages.get(this, "desc", dispTurns()); - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/actors/buffs/FireImbue.java b/java/com/hmdzl/spspd/change/actors/buffs/FireImbue.java deleted file mode 100644 index a5657d45..00000000 --- a/java/com/hmdzl/spspd/change/actors/buffs/FireImbue.java +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ - -package com.hmdzl.spspd.change.actors.buffs; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.effects.particles.FlameParticle; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.Terrain; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.ui.BuffIndicator; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -/** - * Created by debenhame on 19/11/2014. - */ -public class FireImbue extends Buff { - - public static final float DURATION = 30f; - - protected float left; - - private static final String LEFT = "left"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(LEFT, left); - - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - left = bundle.getFloat(LEFT); - } - - public void set(float duration) { - this.left = duration; - }; - - @Override - public boolean act() { - if (Dungeon.level.map[target.pos] == Terrain.GRASS) { - Level.set(target.pos, Terrain.EMBERS); - GameScene.updateMap(target.pos); - } - - spend(TICK); - left -= TICK; - if (left <= 0) - detach(); - - return true; - } - - public void proc(Char enemy) { - if (Random.Int(2) == 0) - Buff.affect(enemy, Burning.class).reignite(enemy); - - enemy.sprite.emitter().burst(FlameParticle.FACTORY, 2); - } - - @Override - public int icon() { - return BuffIndicator.PFIRE; - } - - @Override - public String toString() { - return Messages.get(this, "name"); - } - - @Override - public String desc() { - return Messages.get(this, "desc", dispTurns(left)); - } - - { - immunities.add(Burning.class); - } -} diff --git a/java/com/hmdzl/spspd/change/actors/buffs/FlavourBuff.java b/java/com/hmdzl/spspd/change/actors/buffs/FlavourBuff.java deleted file mode 100644 index c64a8ca8..00000000 --- a/java/com/hmdzl/spspd/change/actors/buffs/FlavourBuff.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.buffs; - -import java.text.DecimalFormat; - -//buff whose only logic is to wait and detach after a time. -public class FlavourBuff extends Buff { - - @Override - public boolean act() { - detach(); - return true; - } - - //flavour buffs can all just rely on cooldown() - protected String dispTurns() { - //add one turn as buffs act last, we want them to end at 1 visually, even if they end at 0 internally. - return dispTurns(cooldown()+1f); - } -} diff --git a/java/com/hmdzl/spspd/change/actors/buffs/ForeverShadow.java b/java/com/hmdzl/spspd/change/actors/buffs/ForeverShadow.java deleted file mode 100644 index 80f8dc1d..00000000 --- a/java/com/hmdzl/spspd/change/actors/buffs/ForeverShadow.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * Shattered Pixel Dungeon - * Copyright (C) 2014-2015 Evan Debenham - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.buffs; - -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.ConfusionGas; -import com.hmdzl.spspd.change.actors.blobs.CorruptGas; -import com.hmdzl.spspd.change.actors.blobs.ElectriShock; -import com.hmdzl.spspd.change.actors.blobs.Fire; -import com.hmdzl.spspd.change.actors.blobs.Freezing; -import com.hmdzl.spspd.change.actors.blobs.ParalyticGas; -import com.hmdzl.spspd.change.actors.blobs.Regrowth; -import com.hmdzl.spspd.change.actors.blobs.ShockWeb; -import com.hmdzl.spspd.change.actors.blobs.StenchGas; -import com.hmdzl.spspd.change.actors.blobs.ToxicGas; -import com.hmdzl.spspd.change.actors.blobs.VenomGas; -import com.hmdzl.spspd.change.actors.blobs.weather.WeatherOfRain; -import com.hmdzl.spspd.change.actors.blobs.weather.WeatherOfSand; -import com.hmdzl.spspd.change.actors.blobs.weather.WeatherOfSnow; -import com.hmdzl.spspd.change.actors.blobs.weather.WeatherOfSun; -import com.hmdzl.spspd.change.actors.blobs.Web; -import com.hmdzl.spspd.change.levels.traps.LightningTrap; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.hmdzl.spspd.change.ui.BuffIndicator; - -public class ForeverShadow extends FlavourBuff { - - public static final float DURATION = 30f; - - { - type = buffType.POSITIVE; - } - - @Override - public boolean attachTo(Char target) { - if (super.attachTo(target)) { - target.invisible++; - return true; - } else { - return false; - } - } - - @Override - public void detach() { - if (target.invisible > 0) - target.invisible--; - super.detach(); - } - - @Override - public void fx(boolean on) { - if (on) target.sprite.add( CharSprite.State.INVISIBLE ); - else if (target.invisible == 0) target.sprite.remove( CharSprite.State.INVISIBLE ); - } - - @Override - public int icon() { - return BuffIndicator.BLESS; - } - - @Override - public String toString() { - return Messages.get(this, "name"); - } - - - - - @Override - public String desc() { - return Messages.get(this, "desc", dispTurns()); - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/actors/buffs/Frost.java b/java/com/hmdzl/spspd/change/actors/buffs/Frost.java deleted file mode 100644 index 5878f9ef..00000000 --- a/java/com/hmdzl/spspd/change/actors/buffs/Frost.java +++ /dev/null @@ -1,135 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.buffs; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.Freezing; -import com.hmdzl.spspd.change.actors.blobs.FrostGas; -import com.hmdzl.spspd.change.actors.blobs.weather.WeatherOfSnow; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.mobs.Thief; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.food.meatfood.FrozenCarpaccio; -import com.hmdzl.spspd.change.items.food.meatfood.MysteryMeat; -import com.hmdzl.spspd.change.items.potions.Potion; -import com.hmdzl.spspd.change.items.potions.PotionOfMight; -import com.hmdzl.spspd.change.items.potions.PotionOfStrength; -import com.hmdzl.spspd.change.items.rings.RingOfElements.Resistance; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.ui.BuffIndicator; -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.hmdzl.spspd.change.utils.GLog; - -public class Frost extends FlavourBuff { - - private static final float DURATION = 5f; - - { - type = buffType.NEGATIVE; - } - - @Override - public boolean attachTo(Char target) { - if (super.attachTo(target)) { - - target.paralysed++; - Buff.detach( target, Burning.class ); - Buff.detach( target, Chill.class ); - - if (target instanceof Hero) { - - Hero hero = (Hero) target; - Item item = hero.belongings.randomUnequipped(); - if (item instanceof Potion - && !(item instanceof PotionOfStrength || item instanceof PotionOfMight)){ - - item = item.detach(hero.belongings.backpack); - GLog.w( Messages.get(this, "freezes", item.toString())); - ((Potion) item).shatter(hero.pos); - - } else if (item instanceof MysteryMeat) { - - item = item.detach(hero.belongings.backpack); - FrozenCarpaccio carpaccio = new FrozenCarpaccio(); - if (!carpaccio.collect(hero.belongings.backpack)) { - Dungeon.level.drop(carpaccio, target.pos).sprite.drop(); - } - GLog.w( Messages.get(this, "freezes", item.toString())); - - } - } else if (target instanceof Thief){ - Item item = ((Thief) target).item; - - if (item instanceof Potion && !(item instanceof PotionOfStrength || item instanceof PotionOfMight)) { - ((Potion) ((Thief) target).item).shatter(target.pos); - ((Thief) target).item = null; - } - } - - return true; - } else { - return false; - } - } - - @Override - public void detach() { - super.detach(); - if (target.paralysed > 0) - target.paralysed--; - if (Level.water[target.pos]) - Buff.prolong(target, Chill.class, 4f); - } - - @Override - public int icon() { - return BuffIndicator.FROST; - } - - //@Override - public void fx(boolean on) { - if (on) target.sprite.add(CharSprite.State.FROZEN); - else target.sprite.remove(CharSprite.State.FROZEN); - } - - @Override - public String toString() { - return Messages.get(this, "name"); - } - - @Override - public String desc() { - return Messages.get(this, "desc", dispTurns()); - } - - public static float duration(Char ch) { - Resistance r = ch.buff(Resistance.class); - return r != null ? r.durationFactor() * DURATION : DURATION; - } - - { - immunities.add( Chill.class ); - immunities.add( FrostGas.class ); - immunities.add( Freezing.class ); - immunities.add( Cold.class ); - immunities.add(WeatherOfSnow.class); - } - -} diff --git a/java/com/hmdzl/spspd/change/actors/buffs/FrostImbue.java b/java/com/hmdzl/spspd/change/actors/buffs/FrostImbue.java deleted file mode 100644 index 7e38500a..00000000 --- a/java/com/hmdzl/spspd/change/actors/buffs/FrostImbue.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * Shattered Pixel Dungeon - * Copyright (C) 2014-2019 Evan Debenham - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ - -package com.hmdzl.spspd.change.actors.buffs; - -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.effects.particles.SnowParticle; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.ui.BuffIndicator; -import com.watabou.noosa.Image; - -public class FrostImbue extends FlavourBuff { - - { - type = buffType.POSITIVE; - } - - public static final float DURATION = 50f; - - public void proc(Char enemy){ - Buff.affect(enemy, Chill.class, 2f); - enemy.sprite.emitter().burst( SnowParticle.FACTORY, 2 ); - } - - @Override - public int icon() { - return BuffIndicator.FROST; - } - - @Override - public String toString() { - return Messages.get(this, "name"); - } - - @Override - public String desc() { - return Messages.get(this, "desc", dispTurns()); - } - - { - immunities.add( Frost.class ); - immunities.add( Chill.class ); - } -} diff --git a/java/com/hmdzl/spspd/change/actors/buffs/FullMoonStrength.java b/java/com/hmdzl/spspd/change/actors/buffs/FullMoonStrength.java deleted file mode 100644 index 79cf35f2..00000000 --- a/java/com/hmdzl/spspd/change/actors/buffs/FullMoonStrength.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.buffs; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.Statistics; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.utils.Bundle; - -public class FullMoonStrength extends Buff { - - public static float LEVEL = 0.4f; - - private int hits = (Dungeon.checkNight() ? Math.max(8, Math.round(Statistics.deepestFloor/5)+9) : Math.max(2, Math.round(Statistics.deepestFloor/5)+3)); - - - private static final String HITS = "hits"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(HITS, hits); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - hits = bundle.getInt(HITS); - } - - //private int hits = Math.max(2, Math.round(Statistics.deepestFloor/5)+3); - @Override - public String toString() { - return Messages.get(this, "name"); - } - - @Override - public String heroMessage() { - return Messages.get(this, "heromsg"); - } - - @Override - public String desc() { - return Messages.get(this, "desc"); - } - - @Override - public void detach() { - hits--; - if(hits==0){ - super.detach(); - } - } - -} diff --git a/java/com/hmdzl/spspd/change/actors/buffs/GasesImmunity.java b/java/com/hmdzl/spspd/change/actors/buffs/GasesImmunity.java deleted file mode 100644 index f578e4aa..00000000 --- a/java/com/hmdzl/spspd/change/actors/buffs/GasesImmunity.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.buffs; - -import com.hmdzl.spspd.change.actors.blobs.ConfusionGas; -import com.hmdzl.spspd.change.actors.blobs.DarkGas; -import com.hmdzl.spspd.change.actors.blobs.ParalyticGas; -import com.hmdzl.spspd.change.actors.blobs.StenchGas; -import com.hmdzl.spspd.change.actors.blobs.TarGas; -import com.hmdzl.spspd.change.actors.blobs.ToxicGas; -import com.hmdzl.spspd.change.actors.blobs.weather.WeatherOfDead; -import com.hmdzl.spspd.change.actors.blobs.weather.WeatherOfRain; -import com.hmdzl.spspd.change.actors.blobs.weather.WeatherOfSand; -import com.hmdzl.spspd.change.actors.blobs.weather.WeatherOfSnow; -import com.hmdzl.spspd.change.actors.blobs.weather.WeatherOfSun; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.ui.BuffIndicator; - -public class GasesImmunity extends FlavourBuff { - - public static final float DURATION = 15f; - - @Override - public int icon() { - return BuffIndicator.IMMUNITY; - } - - @Override - public String toString() { - return Messages.get(this, "name"); - } - - { - immunities.add(ParalyticGas.class); - immunities.add(ToxicGas.class); - immunities.add(ConfusionGas.class); - immunities.add(StenchGas.class); - immunities.add(DarkGas.class); - immunities.add(TarGas.class); - immunities.add(WeatherOfDead.class); - immunities.add(WeatherOfRain.class); - immunities.add(WeatherOfSun.class); - immunities.add(WeatherOfSnow.class); - immunities.add(WeatherOfSand.class); - } - - @Override - public String desc() { - return Messages.get(this, "desc", dispTurns()); - } -} diff --git a/java/com/hmdzl/spspd/change/actors/buffs/GlassShield.java b/java/com/hmdzl/spspd/change/actors/buffs/GlassShield.java deleted file mode 100644 index 5af5216a..00000000 --- a/java/com/hmdzl/spspd/change/actors/buffs/GlassShield.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.buffs; - -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.items.rings.RingOfElements.Resistance; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.ui.BuffIndicator; -import com.watabou.utils.Bundle; - -public class GlassShield extends Buff { - - { - type = buffType.POSITIVE; - } - - private int turns = 0; - - @Override - public int icon() { - return BuffIndicator.GLASS_SHIELD; - } - - @Override - public void detach() { - turns--; - if(turns<=0){ - super.detach(); - } - } - - @Override - public String toString() { - return Messages.get(this, "name"); - } - - @Override - public String desc() { - return Messages.get(this, "desc",turns()); - } - - private static final String TURNS = "turns"; - - public int turns() { - return turns; - } - - public void turns(int value) { - if (turns< value) { - turns = value; - } - } - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(TURNS, turns); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - turns = bundle.getInt(TURNS); - } - -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/actors/buffs/GoldTouch.java b/java/com/hmdzl/spspd/change/actors/buffs/GoldTouch.java deleted file mode 100644 index 24eccad5..00000000 --- a/java/com/hmdzl/spspd/change/actors/buffs/GoldTouch.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * Shattered Pixel Dungeon - * Copyright (C) 2014-2015 Evan Debenham - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.buffs; - -import com.hmdzl.spspd.change.actors.blobs.ConfusionGas; -import com.hmdzl.spspd.change.actors.blobs.CorruptGas; -import com.hmdzl.spspd.change.actors.blobs.ElectriShock; -import com.hmdzl.spspd.change.actors.blobs.Fire; -import com.hmdzl.spspd.change.actors.blobs.Freezing; -import com.hmdzl.spspd.change.actors.blobs.ParalyticGas; -import com.hmdzl.spspd.change.actors.blobs.Regrowth; -import com.hmdzl.spspd.change.actors.blobs.ShockWeb; -import com.hmdzl.spspd.change.actors.blobs.StenchGas; -import com.hmdzl.spspd.change.actors.blobs.ToxicGas; -import com.hmdzl.spspd.change.actors.blobs.VenomGas; -import com.hmdzl.spspd.change.actors.blobs.weather.WeatherOfRain; -import com.hmdzl.spspd.change.actors.blobs.weather.WeatherOfSand; -import com.hmdzl.spspd.change.actors.blobs.weather.WeatherOfSnow; -import com.hmdzl.spspd.change.actors.blobs.weather.WeatherOfSun; -import com.hmdzl.spspd.change.actors.blobs.Web; -import com.hmdzl.spspd.change.levels.traps.LightningTrap; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.ui.BuffIndicator; - -public class GoldTouch extends FlavourBuff { - - public static final float DURATION = 30f; - - @Override - public int icon() { - return BuffIndicator.GOLDTOUCH; - } - - @Override - public String toString() { - return Messages.get(this, "name"); - } - - - @Override - public String desc() { - return Messages.get(this, "desc", dispTurns()); - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/actors/buffs/GrowSeed.java b/java/com/hmdzl/spspd/change/actors/buffs/GrowSeed.java deleted file mode 100644 index bc94056b..00000000 --- a/java/com/hmdzl/spspd/change/actors/buffs/GrowSeed.java +++ /dev/null @@ -1,131 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.buffs; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.ResultDescriptions; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.items.rings.RingOfElements.Resistance; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.hmdzl.spspd.change.ui.BuffIndicator; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -public class GrowSeed extends Buff implements Hero.Doom { - - { - type = buffType.NEGATIVE; - } - - private static final float DURATION = 10f; - - private float left; - - private static final String LEFT = "left"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(LEFT, left); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - left = bundle.getFloat(LEFT); - } - - @Override - public boolean act() { - - if (target.isAlive()) { - - int dmg = Random.Int(1, target.HT/20); - - target.damage(dmg, this); - - int p = target.pos; - for (int n : Level.NEIGHBOURS8) { - Char ch = Actor.findChar(n+p); - if (ch != null && ch != target && ch.isAlive()) { - ch.HP +=Random.Int( Math.min(dmg,ch.HT - ch.HP)); - } - } - - - } else { - detach(); - } - - - spend(TICK); - left -= TICK; - - if (left <= 0) { - - detach(); - } - - return true; - } - - public void reignite(Char ch) { - left = duration(ch); - } - - @Override - public int icon() { - return BuffIndicator.GROW_SEED; - } - - @Override - public void fx(boolean on) { - if (on) target.sprite.add(CharSprite.State.REGROW); - else target.sprite.remove(CharSprite.State.REGROW); - } - - @Override - public String heroMessage() { - return Messages.get(this, "heromsg"); - } - - @Override - public String toString() { - return Messages.get(this, "name"); - } - - @Override - public String desc() { - return Messages.get(this, "desc", dispTurns(left)); - } - - public static float duration(Char ch) { - Resistance r = ch.buff(Resistance.class); - return r != null ? r.durationFactor() * DURATION : DURATION; - } - - @Override - public void onDeath() { - Dungeon.fail(Messages.format(ResultDescriptions.ITEM)); - } -} diff --git a/java/com/hmdzl/spspd/change/actors/buffs/Haste.java b/java/com/hmdzl/spspd/change/actors/buffs/Haste.java deleted file mode 100644 index f88f36fc..00000000 --- a/java/com/hmdzl/spspd/change/actors/buffs/Haste.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.buffs; - -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.items.rings.RingOfElements.Resistance; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.ui.BuffIndicator; - -public class Haste extends FlavourBuff { - - public static final float DURATION = 10f; - - @Override - public int icon() { - return BuffIndicator.HASTE; - } - - @Override - public String toString() { - return Messages.get(this, "name"); - } - - @Override - public String desc() { - return Messages.get(this, "desc", dispTurns()); - } - -} diff --git a/java/com/hmdzl/spspd/change/actors/buffs/HighAttack.java b/java/com/hmdzl/spspd/change/actors/buffs/HighAttack.java deleted file mode 100644 index 98950ff2..00000000 --- a/java/com/hmdzl/spspd/change/actors/buffs/HighAttack.java +++ /dev/null @@ -1,128 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.buffs; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.items.artifacts.CloakOfShadows; -import com.hmdzl.spspd.change.items.artifacts.TimekeepersHourglass; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.Terrain; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.hmdzl.spspd.change.ui.BuffIndicator; -import com.watabou.utils.Bundle; - -public class HighAttack extends Buff { - - public static final float DURATION = 30f; - - private int level = 0; - private static final String LEVEL = "level"; - public static boolean nearwall = false; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(LEVEL, level); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - level = bundle.getInt(LEVEL); - } - - - - { - type = buffType.POSITIVE; - } - - @Override - public boolean attachTo(Char target) { - if (super.attachTo(target)) { - return true; - } else { - return false; - } - } - - public boolean act() { - - if (target.isAlive()) { - for (int i = 0; i < Level.NEIGHBOURS8.length; i++) { - final int pos = target.pos + Level.NEIGHBOURS8[i]; - if (Dungeon.level.map[pos] == Terrain.WALL || - Dungeon.level.map[pos] == Terrain.WALL_DECO || - Dungeon.level.map[pos] == Terrain.UNBREAK_WALL || - Dungeon.level.map[pos] == Terrain.CHASM_WALL || - Dungeon.level.map[pos] == Terrain.DOOR || - Dungeon.level.map[pos] == Terrain.OPEN_DOOR|| - Dungeon.level.map[pos] == Terrain.SECRET_DOOR|| - Dungeon.level.map[pos] == Terrain.BARRICADE || - Dungeon.level.map[pos] == Terrain.BOOKSHELF - ) { - nearwall = true; - } - } - if (nearwall == false){ - detach(); - } else { - level++; - spend(TICK); - nearwall = false; - } - - } else { - detach(); - } - - return true; - } - - @Override - public void detach() { - super.detach(); - } - - @Override - public int icon() { - return BuffIndicator.HIGH_ATTACK; - } - - public int level() { - return level; - } - - public void level(int value) { - if (level < value) { - level = value; - } - } - - @Override - public String toString() { - return Messages.get(this, "name"); - } - - @Override - public String desc() { - return Messages.get(this, "desc",level); - } -} diff --git a/java/com/hmdzl/spspd/change/actors/buffs/HighLight.java b/java/com/hmdzl/spspd/change/actors/buffs/HighLight.java deleted file mode 100644 index 8726f1f9..00000000 --- a/java/com/hmdzl/spspd/change/actors/buffs/HighLight.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.buffs; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.hmdzl.spspd.change.ui.BuffIndicator; - -public class HighLight extends FlavourBuff { - - public static final float DURATION = 500f; - public static final int DISTANCE = 10; - - @Override - public boolean attachTo(Char target) { - if (super.attachTo(target)) { - return true; - } else { - return false; - } - } - - @Override - public void detach() { - super.detach(); - } - - @Override - public int icon() { - return BuffIndicator.LIGHT; - } - - @Override - public void fx(boolean on) { - if (on) target.sprite.add(CharSprite.State.ILLUMINATED); - else target.sprite.remove(CharSprite.State.ILLUMINATED); - } - - @Override - public String toString() { - return Messages.get(this, "name"); - } - - @Override - public String desc() { - return Messages.get(this, "desc", dispTurns()); - } -} diff --git a/java/com/hmdzl/spspd/change/actors/buffs/HighVoice.java b/java/com/hmdzl/spspd/change/actors/buffs/HighVoice.java deleted file mode 100644 index 8268de08..00000000 --- a/java/com/hmdzl/spspd/change/actors/buffs/HighVoice.java +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.buffs; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.items.rings.RingOfElements.Resistance; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.ui.BuffIndicator; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -import javax.microedition.khronos.opengles.GL10; - -public class HighVoice extends FlavourBuff { - - public static final float DURATION = 10f; - - @Override - public int icon() { - return BuffIndicator.VOICE_UP; - } - - protected float left; - private static final String LEFT = "left"; - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(LEFT, left); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - left = bundle.getFloat(LEFT); - } - - public void set(float duration) { - this.left = duration; - }; - - @Override - public boolean act() { - if (target.isAlive()) { - if (target.buff(HighVoice.class) != null && Random.Int(8) == 0) { - if (target.HP > target.HT*0.75 ){ - Buff.affect(target,Haste.class,5f); - GLog.p(Messages.get(this,"speed",Dungeon.hero.givenName())); - } else { - target.HP += (int)(target.HT/4); - GLog.p(Messages.get(this,"heal",Dungeon.hero.givenName())); - } - } - left -= TICK; - if (left <= 2) - detach(); - spend(TICK); - - - } else { - - detach(); - - } - - return true; - } - - @Override - public String toString() { - return Messages.get(this, "name"); - } - - @Override - public String desc() { - return Messages.get(this, "desc", dispTurns()); - } - -} diff --git a/java/com/hmdzl/spspd/change/actors/buffs/Hunger.java b/java/com/hmdzl/spspd/change/actors/buffs/Hunger.java deleted file mode 100644 index 312ff46a..00000000 --- a/java/com/hmdzl/spspd/change/actors/buffs/Hunger.java +++ /dev/null @@ -1,221 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.buffs; - -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.Challenges; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.ResultDescriptions; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.hero.HeroClass; -import com.hmdzl.spspd.change.items.artifacts.Artifact; -import com.hmdzl.spspd.change.items.artifacts.HornOfPlenty; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.ui.BuffIndicator; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -public class Hunger extends Buff implements Hero.Doom { - - private static final float STEP = 10f; - - public static final float OVERFED = 150f; - public static final float HUNGRY = 600f; - public static final float STARVING = 800f; - - private float level; - private float partialDamage; - - private static final String LEVEL = "level"; - private static final String PARTIALDAMAGE = "partialDamage"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(LEVEL, level); - bundle.put( PARTIALDAMAGE, partialDamage ); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - level = bundle.getFloat(LEVEL); - partialDamage = bundle.getFloat(PARTIALDAMAGE); - } - - @Override - public boolean act() { - if (target.isAlive()) { - - Hero hero = (Hero) target; - - if (isStarving()) { - - partialDamage += target.HT/100f; - - if (partialDamage > 1){ - target.damage( (int)partialDamage, this); - partialDamage -= (int)partialDamage; - } - - } else { - - float newLevel = level + STEP; - boolean statusUpdated = false; - if (newLevel <= OVERFED && level > OVERFED) { - - GLog.n(Messages.get(this, "onoverfed")); - statusUpdated = true; - - } else if (newLevel >= OVERFED && level < OVERFED) { - - statusUpdated = true; - - } else if (newLevel >= STARVING) { - - GLog.n(Messages.get(this, "onstarving")); - //hero.resting = false; - hero.damage(1, this); - statusUpdated = true; - - hero.interrupt(); - - } else if (newLevel >= HUNGRY && level < HUNGRY) { - - GLog.w(Messages.get(this, "onhungry")); - statusUpdated = true; - - } - level = newLevel; - - if (statusUpdated) { - BuffIndicator.refreshHero(); - } - - } - spend(target.buff(Shadows.class) == null ? STEP : STEP * 1.5f); - - } else { - - diactivate(); - - } - - return true; - } - - public void satisfy(float energy) { - Artifact.ArtifactBuff buff = target - .buff(HornOfPlenty.hornRecharge.class); - if (buff != null && buff.isCursed()) { - energy = Math.round(energy * 0.75f); - GLog.n(Messages.get(this, "cursedhorn")); - } - if (level>=800f) { - energy = Math.round(energy * 1.5f); - } - if(Dungeon.isChallenged(Challenges.ENERGY_LOST)){ - energy = Math.round(energy * 0.4f); - } - - reduceHunger( energy ); - - } - - public void reduceHunger( float energy ) { - - level -= energy; - if (level < 0) { - level = 0; - } else if (level > STARVING) { - level = STARVING; - } - - BuffIndicator.refreshHero(); - } - - public boolean isStarving() { - return level >= STARVING; - } - - public boolean isOverfed() { - return level <= OVERFED; - } - - public boolean isHungry() { - return (level >= HUNGRY && level < STARVING); - } - - public int hungerLevel() { - return (int) level; - } - - @Override - public int icon() { - if (level < OVERFED) { - return BuffIndicator.OVERFED; - } else if (level < HUNGRY) { - return BuffIndicator.NONE; - } else if (level < STARVING) { - return BuffIndicator.HUNGER; - } else { - return BuffIndicator.STARVATION; - } - } - - @Override - public String toString() { - if (level < OVERFED) { - return Messages.get(this, "overfed"); - } else if (level < HUNGRY) { - return Messages.get(this, "normal"); - } else if (level < STARVING) { - return Messages.get(this, "hungry"); - } else { - return Messages.get(this, "starving"); - } - } - - @Override - public String desc() { - String result; - if (level < OVERFED) { - result = Messages.get(this, "desc_intro_overfed"); - } else if (level < HUNGRY) { - result = Messages.get(this, "desc_intro_normal"); - } else if (level < STARVING) { - result = Messages.get(this, "desc_intro_hungry"); - } else { - result = Messages.get(this, "desc_intro_starving"); - } - - result += Messages.get(this, "desc"); - - return result; - } - - @Override - public void onDeath() { - - Badges.validateDeathFromHunger(); - - Dungeon.fail(Messages.format(ResultDescriptions.HUNGER)); - //GLog.n(TXT_DEATH); - } -} diff --git a/java/com/hmdzl/spspd/change/actors/buffs/Invisibility.java b/java/com/hmdzl/spspd/change/actors/buffs/Invisibility.java deleted file mode 100644 index a3ca743d..00000000 --- a/java/com/hmdzl/spspd/change/actors/buffs/Invisibility.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.buffs; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.items.artifacts.CloakOfShadows; -import com.hmdzl.spspd.change.items.artifacts.TimekeepersHourglass; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.hmdzl.spspd.change.ui.BuffIndicator; - -public class Invisibility extends FlavourBuff { - - public static final float DURATION = 15f; - - { - type = buffType.POSITIVE; - } - - @Override - public boolean attachTo(Char target) { - if (super.attachTo(target)) { - target.invisible++; - return true; - } else { - return false; - } - } - - @Override - public void detach() { - if (target.invisible > 0) - target.invisible--; - super.detach(); - } - - @Override - public int icon() { - return BuffIndicator.INVISIBLE; - } - - @Override - public void fx(boolean on) { - if (on) target.sprite.add( CharSprite.State.INVISIBLE ); - else if (target.invisible == 0) target.sprite.remove( CharSprite.State.INVISIBLE ); - } - - @Override - public String toString() { - return Messages.get(this, "name"); - } - - @Override - public String desc() { - return Messages.get(this, "desc", dispTurns()); - } - - public static void dispel() { - Invisibility buff = Dungeon.hero.buff(Invisibility.class); - if (buff != null) { - buff.detach(); - } - CloakOfShadows.cloakStealth cloakBuff = Dungeon.hero - .buff(CloakOfShadows.cloakStealth.class); - if (cloakBuff != null) { - cloakBuff.act(); - cloakBuff.detach(); - } - // this isn't a form of invisibilty, but it is meant to dispel at the - // same time as it. - TimekeepersHourglass.timeFreeze timeFreeze = Dungeon.hero - .buff(TimekeepersHourglass.timeFreeze.class); - if (timeFreeze != null) { - timeFreeze.detach(); - } - } -} diff --git a/java/com/hmdzl/spspd/change/actors/buffs/Levitation.java b/java/com/hmdzl/spspd/change/actors/buffs/Levitation.java deleted file mode 100644 index 7bf387b7..00000000 --- a/java/com/hmdzl/spspd/change/actors/buffs/Levitation.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.buffs; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.hmdzl.spspd.change.ui.BuffIndicator; - -public class Levitation extends FlavourBuff { - - public static final float DURATION = 20f; - - @Override - public boolean attachTo(Char target) { - if (super.attachTo(target)) { - target.flying = true; - Buff.detach(target, Roots.class); - return true; - } else { - return false; - } - } - - @Override - public void detach() { - target.flying = false; - Dungeon.level.press(target.pos, target); - super.detach(); - } - - @Override - public int icon() { - return BuffIndicator.LEVITATION; - } - - @Override - public void fx(boolean on) { - if (on) target.sprite.add(CharSprite.State.LEVITATING); - else target.sprite.remove(CharSprite.State.LEVITATING); - } - - @Override - public String toString() { - return Messages.get(this, "name"); - } - - @Override - public String desc() { - return Messages.get(this, "desc", dispTurns()); - } -} diff --git a/java/com/hmdzl/spspd/change/actors/buffs/Light.java b/java/com/hmdzl/spspd/change/actors/buffs/Light.java deleted file mode 100644 index 1780a891..00000000 --- a/java/com/hmdzl/spspd/change/actors/buffs/Light.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.buffs; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.hmdzl.spspd.change.ui.BuffIndicator; - -public class Light extends FlavourBuff { - - public static final float DURATION = 300f; - public static final int DISTANCE = 6; - - @Override - public boolean attachTo(Char target) { - if (super.attachTo(target)) { - if (Dungeon.level != null) { - target.viewDistance = Math.max(Dungeon.level.viewDistance, - DISTANCE); - Dungeon.observe(); - } - return true; - } else { - return false; - } - } - - @Override - public void detach() { - target.viewDistance = Dungeon.level.viewDistance; - Dungeon.observe(); - super.detach(); - } - - @Override - public int icon() { - return BuffIndicator.LIGHT; - } - - @Override - public void fx(boolean on) { - if (on) target.sprite.add(CharSprite.State.ILLUMINATED); - else target.sprite.remove(CharSprite.State.ILLUMINATED); - } - - @Override - public String toString() { - return Messages.get(this, "name"); - } - - @Override - public String desc() { - return Messages.get(this, "desc", dispTurns()); - } -} diff --git a/java/com/hmdzl/spspd/change/actors/buffs/Locked.java b/java/com/hmdzl/spspd/change/actors/buffs/Locked.java deleted file mode 100644 index 1c151ebd..00000000 --- a/java/com/hmdzl/spspd/change/actors/buffs/Locked.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.buffs; - -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.items.rings.RingOfElements.Resistance; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.ui.BuffIndicator; - -public class Locked extends FlavourBuff { - - { - type = buffType.NEGATIVE; - } - - private static final float DURATION = 10f; - - @Override - public int icon() { - return BuffIndicator.LOCKED_FLOOR; - } - - @Override - public String toString() { - return Messages.get(this, "name"); - } - - @Override - public String desc() { - return Messages.get(this, "desc", dispTurns()); - } - - public static float duration(Char ch) { - Resistance r = ch.buff(Resistance.class); - return r != null ? r.durationFactor() * DURATION : DURATION; - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/actors/buffs/LokisPoison.java b/java/com/hmdzl/spspd/change/actors/buffs/LokisPoison.java deleted file mode 100644 index 437d689d..00000000 --- a/java/com/hmdzl/spspd/change/actors/buffs/LokisPoison.java +++ /dev/null @@ -1,122 +0,0 @@ -/* -` * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.buffs; - -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.ResultDescriptions; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.particles.PoisonParticle; -import com.hmdzl.spspd.change.items.rings.RingOfElements.Resistance; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.ui.BuffIndicator; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.utils.Bundle; - -public class LokisPoison extends Buff implements Hero.Doom { - - protected float left; - - private static final String LEFT = "left"; - - { - type = buffType.NEGATIVE; - } - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(LEFT, left); - - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - left = bundle.getFloat(LEFT); - } - - public void set(float duration) { - this.left = duration; - }; - - @Override - public int icon() { - return BuffIndicator.POISON; - } - - @Override - public String toString() { - return Messages.get(this, "name"); - } - - @Override - public String heroMessage() { - return Messages.get(this, "heromsg"); - } - - @Override - public String desc() { - return Messages.get(this, "desc", dispTurns(left)); - } - - - @Override - public boolean attachTo(Char target) { - if (super.attachTo(target) && target.sprite != null){ - CellEmitter.center(target.pos).burst( PoisonParticle.SPLASH, 5 ); - return true; - } else - return false; - } - - @Override - public boolean act() { - if (target.isAlive()) { - - target.damage((int) (left / 2) + 1, this); - spend(TICK); - - if ((left -= TICK) <= 0) { - detach(); - } - - } else { - - detach(); - - } - - return true; - } - - public static float durationFactor(Char ch) { - Resistance r = ch.buff(Resistance.class); - return r != null ? r.durationFactor() : 1; - } - - @Override - public void onDeath() { - Badges.validateDeathFromPoison(); - - Dungeon.fail(Messages.format(ResultDescriptions.POISON)); - //GLog.n("You died from poison..."); - } -} diff --git a/java/com/hmdzl/spspd/change/actors/buffs/MagicImmunity.java b/java/com/hmdzl/spspd/change/actors/buffs/MagicImmunity.java deleted file mode 100644 index 0c834d24..00000000 --- a/java/com/hmdzl/spspd/change/actors/buffs/MagicImmunity.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.buffs; - -import java.util.HashSet; - -import com.hmdzl.spspd.change.actors.blobs.ConfusionGas; -import com.hmdzl.spspd.change.actors.blobs.CorruptGas; -import com.hmdzl.spspd.change.actors.blobs.ParalyticGas; -import com.hmdzl.spspd.change.actors.blobs.StenchGas; -import com.hmdzl.spspd.change.actors.blobs.ToxicGas; -import com.hmdzl.spspd.change.actors.mobs.BrokenRobot; -import com.hmdzl.spspd.change.actors.mobs.Eye; -import com.hmdzl.spspd.change.actors.mobs.Warlock; -import com.hmdzl.spspd.change.actors.mobs.Yog; -import com.hmdzl.spspd.change.levels.traps.LightningTrap; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.ui.BuffIndicator; - -public class MagicImmunity extends FlavourBuff { - - public static final float DURATION = 10f; - - { - type = buffType.POSITIVE; - } - - @Override - public int icon() { - return BuffIndicator.DISPEL; - } - - @Override - public String toString() { - return Messages.get(this, "name"); - } - - @Override - public String desc() { - return Messages.get(this, "desc", dispTurns()); - } - - { - immunities.add(ParalyticGas.class); - immunities.add(ToxicGas.class); - immunities.add(ConfusionGas.class); - immunities.add(StenchGas.class); - immunities.add(Burning.class); - immunities.add(ToxicGas.class); - immunities.add(Poison.class); - immunities.add(LightningTrap.Electricity.class); - immunities.add(Warlock.class); - immunities.add(Eye.class); - immunities.add(Yog.BurningFist.class); - immunities.add(BrokenRobot.class); - immunities.add(CorruptGas.class); - } -} - diff --git a/java/com/hmdzl/spspd/change/actors/buffs/MagicalSleep.java b/java/com/hmdzl/spspd/change/actors/buffs/MagicalSleep.java deleted file mode 100644 index 456fbc38..00000000 --- a/java/com/hmdzl/spspd/change/actors/buffs/MagicalSleep.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.buffs; - -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.ui.BuffIndicator; -import com.hmdzl.spspd.change.utils.GLog; - -public class MagicalSleep extends Buff { - - private static final float STEP = 1f; - public static final float SWS = 1.5f; - - @Override - public boolean attachTo(Char target) { - if (super.attachTo(target) - && !target.immunities().contains(Sleep.class)) { - - if (target instanceof Hero) - if (target.HP == target.HT) { - GLog.i(Messages.get(this, "toohealthy")); - detach(); - return true; - } else { - GLog.i(Messages.get(this, "fallasleep")); - } - else if (target instanceof Mob) - ((Mob) target).state = ((Mob) target).SLEEPING; - - target.paralysed++; - - return true; - } else { - return false; - } - } - - @Override - public boolean act() { - if (target instanceof Hero) { - target.HP = Math.min(target.HP + 1, target.HT); - ((Hero) target).restoreHealth = true; - if (target.HP == target.HT) { - GLog.p(Messages.get(this, "wakeup")); - detach(); - } - } - spend(STEP); - return true; - } - - @Override - public void detach() { - if (target.paralysed > 0) - target.paralysed--; - if (target instanceof Hero) - ((Hero) target).restoreHealth = false; - super.detach(); - } - - @Override - public int icon() { - return BuffIndicator.MAGIC_SLEEP; - } - - @Override - public String toString() { - return Messages.get(this, "name"); - } - - @Override - public String desc() { - return Messages.get(this, "desc"); - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/actors/buffs/MechArmor.java b/java/com/hmdzl/spspd/change/actors/buffs/MechArmor.java deleted file mode 100644 index affc0bf2..00000000 --- a/java/com/hmdzl/spspd/change/actors/buffs/MechArmor.java +++ /dev/null @@ -1,88 +0,0 @@ -package com.hmdzl.spspd.change.actors.buffs; - -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.hmdzl.spspd.change.ui.BuffIndicator; -import com.watabou.utils.Bundle; - -public class MechArmor extends Buff { - - private static final float STEP = 1f; - - private int level; - - - @Override - public boolean act() { - - if (target.isAlive()) { - spend(TICK); - level --; - if (level <= 1) { - detach(); - Buff.detach( target, ShieldArmor.class ); - } - - } else { - - detach(); - - } - - return true; - //spend(STEP); - //return true; - } - - public int absorb(int damage) { - if (level <= damage) { - detach(); - return damage - level; - } else { - level -= damage; - return 0; - } - } - - public void level(int value) { - if (level < value) { - level = value; - } - } - - @Override - public int icon() { - return BuffIndicator.MECHARMOR; - } - - @Override - public String toString() { - return Messages.get(this, "name"); - } - - @Override - public String desc() { - return Messages.get(this, "desc", level); - } - - private static final String LEVEL = "level"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(LEVEL, level); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - level = bundle.getInt(LEVEL); - } - - //@Override - public void fx(boolean on) { - if (on) target.sprite.add(CharSprite.State.ILLUMINATED); - else target.sprite.remove(CharSprite.State.ILLUMINATED); - } - } \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/actors/buffs/MindVision.java b/java/com/hmdzl/spspd/change/actors/buffs/MindVision.java deleted file mode 100644 index df141918..00000000 --- a/java/com/hmdzl/spspd/change/actors/buffs/MindVision.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.buffs; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.ui.BuffIndicator; - -public class MindVision extends FlavourBuff { - - public static final float DURATION = 40f; - - public int distance = 2; - - @Override - public int icon() { - return BuffIndicator.MIND_VISION; - } - - @Override - public String toString() { - return Messages.get(this, "name"); - } - - @Override - public void detach() { - super.detach(); - Dungeon.observe(); - } - - @Override - public String desc() { - return Messages.get(this, "desc", dispTurns()); - } -} diff --git a/java/com/hmdzl/spspd/change/actors/buffs/MirrorShield.java b/java/com/hmdzl/spspd/change/actors/buffs/MirrorShield.java deleted file mode 100644 index deab3c92..00000000 --- a/java/com/hmdzl/spspd/change/actors/buffs/MirrorShield.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.buffs; - -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.items.rings.RingOfElements.Resistance; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.hmdzl.spspd.change.ui.BuffIndicator; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -public class MirrorShield extends FlavourBuff { - - { - type = buffType.POSITIVE; - } - - public int proc(int damage, Char attacker) { - - int deflected = Random.NormalIntRange(damage/2, damage); - damage = 0; - - attacker.damage(deflected, this); - - return damage; - } - - public int icon() { - return BuffIndicator.MIRROR_SHIELD; - } - - @Override - public void fx(boolean on) { - if (on) target.sprite.add(CharSprite.State.ILLUMINATED); - else target.sprite.remove(CharSprite.State.ILLUMINATED); - } - - @Override - public String toString() { - return Messages.get(this, "name"); - } - - @Override - public String desc() { - return Messages.get(this, "desc", dispTurns()); - } - -} diff --git a/java/com/hmdzl/spspd/change/actors/buffs/Muscle.java b/java/com/hmdzl/spspd/change/actors/buffs/Muscle.java deleted file mode 100644 index 379c1f28..00000000 --- a/java/com/hmdzl/spspd/change/actors/buffs/Muscle.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * Shattered Pixel Dungeon - * Copyright (C) 2014-2015 Evan Debenham - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.buffs; - -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.ui.BuffIndicator; - -public class Muscle extends FlavourBuff { - - public static final float DURATION = 200f; - - { - type = buffType.POSITIVE; - } - - - @Override - public int icon() { - return BuffIndicator.PBLOOD; - } - - @Override - public String toString() { - return Messages.get(this, "name"); - } - - @Override - public String desc() { - return Messages.get(this, "desc", dispTurns()); - } -} diff --git a/java/com/hmdzl/spspd/change/actors/buffs/Needling.java b/java/com/hmdzl/spspd/change/actors/buffs/Needling.java deleted file mode 100644 index ee9eaa98..00000000 --- a/java/com/hmdzl/spspd/change/actors/buffs/Needling.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * Shattered Pixel Dungeon - * Copyright (C) 2014-2015 Evan Debenham - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.buffs; - -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.ConfusionGas; -import com.hmdzl.spspd.change.actors.blobs.CorruptGas; -import com.hmdzl.spspd.change.actors.blobs.ElectriShock; -import com.hmdzl.spspd.change.actors.blobs.Fire; -import com.hmdzl.spspd.change.actors.blobs.Freezing; -import com.hmdzl.spspd.change.actors.blobs.ParalyticGas; -import com.hmdzl.spspd.change.actors.blobs.Regrowth; -import com.hmdzl.spspd.change.actors.blobs.ShockWeb; -import com.hmdzl.spspd.change.actors.blobs.StenchGas; -import com.hmdzl.spspd.change.actors.blobs.ToxicGas; -import com.hmdzl.spspd.change.actors.blobs.VenomGas; -import com.hmdzl.spspd.change.actors.blobs.weather.WeatherOfRain; -import com.hmdzl.spspd.change.actors.blobs.weather.WeatherOfSand; -import com.hmdzl.spspd.change.actors.blobs.weather.WeatherOfSnow; -import com.hmdzl.spspd.change.actors.blobs.weather.WeatherOfSun; -import com.hmdzl.spspd.change.actors.blobs.Web; -import com.hmdzl.spspd.change.levels.traps.LightningTrap; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.ui.BuffIndicator; -import com.watabou.utils.Random; - -public class Needling extends FlavourBuff { - - public static final float DURATION = 30f; - - { - type = buffType.POSITIVE; - } - - public void proc(Char enemy) { - switch (Random.Int(2)){ - case 0: - Buff.affect(enemy, ArmorBreak.class,5f).level(50); - break; - case 1: - Buff.affect(enemy, Bleeding.class).set(10); - break; - } - } - - - @Override - public int icon() { - return BuffIndicator.NEEDLING; - } - - @Override - public String toString() { - return Messages.get(this, "name"); - } - - - @Override - public String desc() { - return Messages.get(this, "desc", dispTurns()); - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/actors/buffs/NewCombo.java b/java/com/hmdzl/spspd/change/actors/buffs/NewCombo.java deleted file mode 100644 index 9f9145ea..00000000 --- a/java/com/hmdzl/spspd/change/actors/buffs/NewCombo.java +++ /dev/null @@ -1,310 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * Shattered Pixel Dungeon - * Copyright (C) 2014-2019 Evan Debenham - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ - -package com.hmdzl.spspd.change.actors.buffs; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.effects.Pushing; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.CellSelector; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ItemSprite; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.ui.ActionIndicator; -import com.hmdzl.spspd.change.ui.AttackIndicator; -import com.hmdzl.spspd.change.ui.BuffIndicator; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.Image; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundle; -import com.watabou.utils.Callback; -import com.watabou.utils.PathFinder; -import com.watabou.utils.Random; - -public class NewCombo extends Buff implements ActionIndicator.Action { - - private int count = 0; - private float comboTime = 0f; - private int misses = 0; - - @Override - public int icon() { - return BuffIndicator.COMBO; - } - - @Override - public String toString() { - return Messages.get(this, "name"); - } - - public void hit() { - - count++; - comboTime = 4f; - misses = 0; - - if (count >= 2) { - - ActionIndicator.setAction( this ); - Badges.validateMasteryCombo( count ); - - GLog.p( Messages.get(this, "combo", count) ); - - } - - } - - public void miss(){ - misses++; - comboTime = 4f; - if (misses >= 2){ - detach(); - } - } - - @Override - public void detach() { - super.detach(); - ActionIndicator.clearAction(this); - } - - @Override - public boolean act() { - comboTime-=TICK; - spend(TICK); - if (comboTime <= 0) { - detach(); - } - return true; - } - - @Override - public String desc() { - String desc = Messages.get(this, "desc"); - - if (count >= 8)desc += "\n\n" + Messages.get(this, "crush_desc"); - else if (count >= 6)desc += "\n\n" + Messages.get(this, "slam_desc"); - else if (count >= 4)desc += "\n\n" + Messages.get(this, "cleave_desc"); - else if (count >= 2)desc += "\n\n" + Messages.get(this, "clobber_desc"); - - return desc; - } - - private static final String COUNT = "count"; - private static final String TIME = "combotime"; - private static final String MISSES= "misses"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(COUNT, count); - bundle.put(TIME, comboTime); - bundle.put(MISSES, misses); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - count = bundle.getInt( COUNT ); - if (count >= 2) ActionIndicator.setAction(this); - comboTime = bundle.getFloat( TIME ); - misses = bundle.getInt( MISSES ); - } - - @Override - public Image getIcon() { - Image icon; - - icon = new ItemSprite(new Item(){ {image = ItemSpriteSheet.ERROR_WEAPON; }}); - - if (count >= 8)icon.tint(0xFFFFCC00); - else if (count >= 6)icon.tint(0xFFFFFF00); - else if (count >= 4)icon.tint(0xFFCCFF00); - else icon.tint(0xFF00FF00); - - return icon; - } - - @Override - public void doAction() { - GameScene.selectCell(finisher); - } - - private enum finisherType{ - CLOBBER, CLEAVE, SLAM, CRUSH; - } - - private CellSelector.Listener finisher = new CellSelector.Listener() { - - private finisherType type; - - @Override - public void onSelect(Integer cell) { - if (cell == null) return; - final Char enemy = Actor.findChar( cell ); - if (enemy == null || !((Hero)target).canAttack(enemy) || target.isCharmedBy( enemy )){ - GLog.w( Messages.get(NewCombo.class, "bad_target") ); - } else { - target.sprite.attack(cell, new Callback() { - @Override - public void call() { - if (count >= 8)type = finisherType.CRUSH; - else if (count >= 6)type = finisherType.SLAM; - else if (count >= 4)type = finisherType.CLEAVE; - else type = finisherType.CLOBBER; - doAttack(enemy); - } - }); - } - } - - private void doAttack(final Char enemy){ - - AttackIndicator.target(enemy); - - int dmg = target.damageRoll(); - - //variance in damage dealt - switch(type){ - case CLOBBER: - dmg = Math.round(dmg*0.6f); - break; - case CLEAVE: - dmg = Math.round(dmg*1.5f); - break; - case SLAM: - //rolls 2 times, takes the highest roll - int dmgReroll = target.damageRoll(); - if (dmgReroll > dmg) dmg = dmgReroll; - dmg = Math.round(dmg*1.6f); - break; - case CRUSH: - //rolls 4 times, takes the highest roll - for (int i = 1; i < 4; i++) { - dmgReroll = target.damageRoll(); - if (dmgReroll > dmg) dmg = dmgReroll; - } - dmg = Math.round(dmg*2.5f); - break; - } - - dmg -= Random.IntRange( 0, enemy.drRoll() ); - dmg = target.attackProc(enemy, dmg); - dmg = enemy.defenseProc(target, dmg); - enemy.damage( dmg, this ); - - //special effects - switch (type){ - case CLOBBER: - if (enemy.isAlive()){ - if (!enemy.properties().contains(Char.Property.IMMOVABLE)){ - for (int i = 0; i < Level.NEIGHBOURS8.length; i++) { - int ofs = Level.NEIGHBOURS8[i]; - if (enemy.pos - target.pos == ofs) { - int newPos = enemy.pos + ofs; - if ((Level.passable[newPos] || Level.avoid[newPos]) && Actor.findChar( newPos ) == null) { - - Actor.addDelayed( new Pushing( enemy, enemy.pos, newPos ), -1 ); - - enemy.pos = newPos; - // FIXME - if (enemy instanceof Mob) { - Dungeon.level.mobPress( (Mob)enemy ); - } else { - Dungeon.level.press( newPos, enemy ); - } - - } - break; - } - } - } - Buff.prolong(enemy, Vertigo.class, Random.NormalIntRange(1, 4)); - } - break; - case SLAM: - Buff.affect(target,ShieldArmor.class).level((int)(dmg/5)); - break; - default: - //nothing - break; - } - - if (target.buff(FireImbue.class) != null) - target.buff(FireImbue.class).proc(enemy); - if (target.buff(EarthImbue.class) != null) - target.buff(EarthImbue.class).proc(enemy); - if (target.buff(FrostImbue.class) != null) - target.buff(FrostImbue.class).proc(enemy); - if (target.buff(BloodImbue.class) != null) - target.buff(BloodImbue.class).proc(enemy); - - Sample.INSTANCE.play( Assets.SND_HIT, 1, 1, Random.Float( 0.8f, 1.25f ) ); - enemy.sprite.bloodBurstA( target.sprite.center(), dmg ); - enemy.sprite.flash(); - - if (!enemy.isAlive()){ - GLog.i( Messages.capitalize(Messages.get(Char.class, "defeat", enemy.name)) ); - } - - Hero hero = (Hero)target; - - //Post-attack behaviour - switch(type) { - case CLEAVE: - if (!enemy.isAlive()) { - //combo isn't reset, but rather increments with a cleave kill, and grants more time. - hit(); - comboTime = 10f; - } else { - detach(); - ActionIndicator.clearAction(NewCombo.this); - } - hero.spendAndNext(hero.attackDelay()); - break; - - default: - detach(); - ActionIndicator.clearAction(NewCombo.this); - hero.spendAndNext(hero.attackDelay()); - break; - } - - } - - @Override - public String prompt() { - if (count >= 8)return Messages.get(NewCombo.class, "crush_prompt"); - else if (count >= 6)return Messages.get(NewCombo.class, "slam_prompt"); - else if (count >= 4)return Messages.get(NewCombo.class, "cleave_prompt"); - else return Messages.get(NewCombo.class, "clobber_prompt"); - } - }; - } - diff --git a/java/com/hmdzl/spspd/change/actors/buffs/Notice.java b/java/com/hmdzl/spspd/change/actors/buffs/Notice.java deleted file mode 100644 index 452e39c4..00000000 --- a/java/com/hmdzl/spspd/change/actors/buffs/Notice.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * Shattered Pixel Dungeon - * Copyright (C) 2014-2015 Evan Debenham - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.buffs; - -import com.hmdzl.spspd.change.actors.blobs.ConfusionGas; -import com.hmdzl.spspd.change.actors.blobs.CorruptGas; -import com.hmdzl.spspd.change.actors.blobs.ElectriShock; -import com.hmdzl.spspd.change.actors.blobs.Fire; -import com.hmdzl.spspd.change.actors.blobs.Freezing; -import com.hmdzl.spspd.change.actors.blobs.ParalyticGas; -import com.hmdzl.spspd.change.actors.blobs.Regrowth; -import com.hmdzl.spspd.change.actors.blobs.ShockWeb; -import com.hmdzl.spspd.change.actors.blobs.StenchGas; -import com.hmdzl.spspd.change.actors.blobs.ToxicGas; -import com.hmdzl.spspd.change.actors.blobs.VenomGas; -import com.hmdzl.spspd.change.actors.blobs.weather.WeatherOfRain; -import com.hmdzl.spspd.change.actors.blobs.weather.WeatherOfSand; -import com.hmdzl.spspd.change.actors.blobs.weather.WeatherOfSnow; -import com.hmdzl.spspd.change.actors.blobs.weather.WeatherOfSun; -import com.hmdzl.spspd.change.actors.blobs.Web; -import com.hmdzl.spspd.change.levels.traps.LightningTrap; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.ui.BuffIndicator; - -public class Notice extends FlavourBuff { - - public static final float DURATION = 30f; - - @Override - public int icon() { - return BuffIndicator.NOTICE; - } - - @Override - public String toString() { - return Messages.get(this, "name"); - } - - - - @Override - public String desc() { - return Messages.get(this, "desc", dispTurns()); - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/actors/buffs/Paralysis.java b/java/com/hmdzl/spspd/change/actors/buffs/Paralysis.java deleted file mode 100644 index 89dd7ff6..00000000 --- a/java/com/hmdzl/spspd/change/actors/buffs/Paralysis.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.buffs; - -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.items.rings.RingOfElements.Resistance; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.hmdzl.spspd.change.ui.BuffIndicator; - -public class Paralysis extends FlavourBuff { - - private static final float DURATION = 10f; - - { - type = buffType.NEGATIVE; - } - - @Override - public boolean attachTo(Char target) { - if (super.attachTo(target)) { - target.paralysed++; - return true; - } else { - return false; - } - } - - @Override - public void detach() { - super.detach(); - if (target.paralysed > 0) - target.paralysed--; - } - - @Override - public int icon() { - return BuffIndicator.PARALYSIS; - } - - @Override - public void fx(boolean on) { - if (on) target.sprite.add(CharSprite.State.PARALYSED); - else target.sprite.remove(CharSprite.State.PARALYSED); - } - - @Override - public String heroMessage() { - return Messages.get(this, "heromsg"); - } - - @Override - public String toString() { - return Messages.get(this, "name"); - } - - @Override - public String desc() { - return Messages.get(this, "desc", dispTurns()); - } - - public static float duration(Char ch) { - Resistance r = ch.buff(Resistance.class); - return r != null ? r.durationFactor() * DURATION : DURATION; - } -} diff --git a/java/com/hmdzl/spspd/change/actors/buffs/ParyAttack.java b/java/com/hmdzl/spspd/change/actors/buffs/ParyAttack.java deleted file mode 100644 index ddef0dec..00000000 --- a/java/com/hmdzl/spspd/change/actors/buffs/ParyAttack.java +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.buffs; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.items.artifacts.CloakOfShadows; -import com.hmdzl.spspd.change.items.artifacts.TimekeepersHourglass; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.Terrain; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.hmdzl.spspd.change.ui.BuffIndicator; -import com.watabou.utils.Bundle; - -public class ParyAttack extends Buff { - - private int pos; - private int level = 0; - private static final String LEVEL = "level"; - private static final String POS = "pos"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(POS, pos); - bundle.put(LEVEL, level); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - pos = bundle.getInt(POS); - level = bundle.getInt(LEVEL); - } - - { - type = buffType.POSITIVE; - } - - - @Override - public boolean attachTo(Char target) { - pos = target.pos; - return super.attachTo(target); - } - - public boolean act() { - - if (target.isAlive()) { - - if (target.pos != pos) { - detach(); - } - - level++; - spend(TICK); - - } else { - detach(); - } - - return true; - } - - @Override - public void detach() { - super.detach(); - } - - @Override - public int icon() { - return BuffIndicator.BLESS; - } - - public int level() { - return level; - } - - public void level(int value) { - if (level < value) { - level = value; - } - } - - @Override - public String toString() { - return Messages.get(this, "name"); - } - - @Override - public String desc() { - return Messages.get(this, "desc",level/2.5); - } -} diff --git a/java/com/hmdzl/spspd/change/actors/buffs/PinCushion.java b/java/com/hmdzl/spspd/change/actors/buffs/PinCushion.java deleted file mode 100644 index d788831f..00000000 --- a/java/com/hmdzl/spspd/change/actors/buffs/PinCushion.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.hmdzl.spspd.change.actors.buffs; - -import java.util.ArrayList; -import java.util.Collection; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.weapon.missiles.MissileWeapon; -import com.watabou.utils.Bundle; - -/** - * Created by debenhame on 06/02/2015. - */ -public class PinCushion extends Buff { - - private ArrayList items = new ArrayList(); - - public void stick(MissileWeapon item) { - items.add(item); - } - - @Override - public void detach() { - for (Item item : items) - Dungeon.level.drop(item, target.pos).sprite.drop(); - super.detach(); - } - - private static final String ITEMS = "items"; - - @Override - public void storeInBundle(Bundle bundle) { - bundle.put(ITEMS, items); - super.storeInBundle(bundle); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - items = new ArrayList( - (Collection) ((Collection) bundle - .getCollection(ITEMS))); - super.restoreFromBundle(bundle); - } - -} diff --git a/java/com/hmdzl/spspd/change/actors/buffs/Poison.java b/java/com/hmdzl/spspd/change/actors/buffs/Poison.java deleted file mode 100644 index 5b48168f..00000000 --- a/java/com/hmdzl/spspd/change/actors/buffs/Poison.java +++ /dev/null @@ -1,117 +0,0 @@ -/* -` * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.buffs; - -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.ResultDescriptions; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.particles.PoisonParticle; -import com.hmdzl.spspd.change.items.rings.RingOfElements.Resistance; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.ui.BuffIndicator; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.utils.Bundle; - -public class Poison extends Buff implements Hero.Doom { - - protected float left; - - private static final String LEFT = "left"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(LEFT, left); - - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - left = bundle.getFloat(LEFT); - } - - public void set(float duration) { - this.left = duration; - }; - - @Override - public int icon() { - return BuffIndicator.POISON; - } - - @Override - public String toString() { - return Messages.get(this, "name"); - } - - @Override - public String heroMessage() { - return Messages.get(this, "heromsg"); - } - - @Override - public String desc() { - return Messages.get(this, "desc", dispTurns(left)); - } - - @Override - public boolean attachTo(Char target) { - if (super.attachTo(target) && target.sprite != null){ - CellEmitter.center(target.pos).burst( PoisonParticle.SPLASH, 5 ); - return true; - } else - return false; - } - - @Override - public boolean act() { - if (target.isAlive()) { - - target.damage((int) (left / 2) + 1, this); - spend(TICK); - - if ((left -= TICK) <= 0) { - detach(); - } - - } else { - - detach(); - - } - - return true; - } - - public static float durationFactor(Char ch) { - Resistance r = ch.buff(Resistance.class); - return r != null ? r.durationFactor() : 1; - } - - @Override - public void onDeath() { - Badges.validateDeathFromPoison(); - - Dungeon.fail(Messages.format(ResultDescriptions.POISON)); - //GLog.n("You died from poison..."); - } -} diff --git a/java/com/hmdzl/spspd/change/actors/buffs/Recharging.java b/java/com/hmdzl/spspd/change/actors/buffs/Recharging.java deleted file mode 100644 index f5b40a70..00000000 --- a/java/com/hmdzl/spspd/change/actors/buffs/Recharging.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * Shattered Pixel Dungeon - * Copyright (C) 2014-2015 Evan Debenham - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.buffs; - -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.ui.BuffIndicator; - -public class Recharging extends FlavourBuff { - - public static final float DURATION = 40f; - - @Override - public int icon() { - return BuffIndicator.RECHARGING; - } - - @Override - public String toString() { - return Messages.get(this, "name"); - } - - //want to process partial turns for this buff, and not count it when it's expiring. - //firstly, if this buff has half a turn left, should give out half the benefit. - //secondly, recall that buffs execute in random order, so this can cause a problem where we can't simply check - //if this buff is still attached, must instead directly check its remaining time, and act accordingly. - //otherwise this causes inconsistent behaviour where this may detach before, or after, a wand charger acts. - public float remainder() { - return Math.min(1f, this.cooldown()); - } - - @Override - public String desc() { - return Messages.get(this, "desc", dispTurns()); - } -} diff --git a/java/com/hmdzl/spspd/change/actors/buffs/Regeneration.java b/java/com/hmdzl/spspd/change/actors/buffs/Regeneration.java deleted file mode 100644 index 70666927..00000000 --- a/java/com/hmdzl/spspd/change/actors/buffs/Regeneration.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.buffs; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.hero.HeroClass; -import com.hmdzl.spspd.change.actors.hero.HeroSubClass; -import com.hmdzl.spspd.change.items.artifacts.ChaliceOfBlood; - -public class Regeneration extends Buff { - - private static final float REGENERATION_DELAY = 25; - - @Override - public boolean act() { - if (target.isAlive()) { - if (!((Hero) target).isStarving()){ - if (Dungeon.hero.subClass == HeroSubClass.PASTOR && target.HP < target.HT*1.5){ - target.HP += 2*Math.max(1,(int)(Dungeon.hero.lvl/5)); - } else if (target.HP < target.HT) { - target.HP += Math.min((target.HT - target.HP),Math.max(1,(int)(Dungeon.hero.lvl/5))); - } - } - - ChaliceOfBlood.chaliceRegen regenBuff = Dungeon.hero - .buff(ChaliceOfBlood.chaliceRegen.class); - - if (regenBuff != null) { - if (regenBuff.isCursed()) { - spend(REGENERATION_DELAY * 2f); - } else { - spend(Math.max(REGENERATION_DELAY - 2*regenBuff.level(), 5f)); - } - } else if (Dungeon.hero.heroClass== HeroClass.PERFORMER && Dungeon.skins == 2) { - spend(REGENERATION_DELAY*0.6f); - } else { spend(REGENERATION_DELAY);} - - } else { - - diactivate(); - - } - - return true; - } -} diff --git a/java/com/hmdzl/spspd/change/actors/buffs/Rhythm.java b/java/com/hmdzl/spspd/change/actors/buffs/Rhythm.java deleted file mode 100644 index 4dbd749a..00000000 --- a/java/com/hmdzl/spspd/change/actors/buffs/Rhythm.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.buffs; - -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.items.rings.RingOfElements.Resistance; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.ui.BuffIndicator; - -public class Rhythm extends FlavourBuff { - - public static final float DURATION = 10f; - - @Override - public int icon() { - return BuffIndicator.RHYTHM; - } - - @Override - public String toString() { - return Messages.get(this, "name"); - } - - @Override - public String desc() { - return Messages.get(this, "desc", dispTurns()); - } - -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/actors/buffs/Rhythm2.java b/java/com/hmdzl/spspd/change/actors/buffs/Rhythm2.java deleted file mode 100644 index 84fb8f4b..00000000 --- a/java/com/hmdzl/spspd/change/actors/buffs/Rhythm2.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.buffs; - -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.items.rings.RingOfElements.Resistance; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.ui.BuffIndicator; - -public class Rhythm2 extends FlavourBuff { - - public static final float DURATION = 10f; - - @Override - public int icon() { - return BuffIndicator.RHYTHM2; - } - - @Override - public String toString() { - return Messages.get(this, "name"); - } - - @Override - public String desc() { - return Messages.get(this, "desc", dispTurns()); - } - -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/actors/buffs/Roots.java b/java/com/hmdzl/spspd/change/actors/buffs/Roots.java deleted file mode 100644 index d1c62db5..00000000 --- a/java/com/hmdzl/spspd/change/actors/buffs/Roots.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.buffs; - -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.ui.BuffIndicator; - -public class Roots extends FlavourBuff { - - { - type = buffType.NEGATIVE; - } - - @Override - public boolean attachTo(Char target) { - if (!target.flying && super.attachTo(target)) { - target.rooted = true; - return true; - } else { - return false; - } - } - - @Override - public void detach() { - target.rooted = false; - super.detach(); - } - - @Override - public int icon() { - return BuffIndicator.ROOTS; - } - - @Override - public String toString() { - return Messages.get(this, "name"); - } - - @Override - public String heroMessage() { - return Messages.get(this, "heromsg"); - } - - @Override - public String desc() { - return Messages.get(this, "desc", dispTurns()); - } -} diff --git a/java/com/hmdzl/spspd/change/actors/buffs/Shadows.java b/java/com/hmdzl/spspd/change/actors/buffs/Shadows.java deleted file mode 100644 index 1b45b10a..00000000 --- a/java/com/hmdzl/spspd/change/actors/buffs/Shadows.java +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.buffs; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.ui.BuffIndicator; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundle; - -public class Shadows extends Invisibility { - - protected float left; - - private static final String LEFT = "left"; - - { - type = buffType.SILENT; - } - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(LEFT, left); - - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - left = bundle.getFloat(LEFT); - } - - @Override - public boolean attachTo(Char target) { - if (super.attachTo(target)) { - Sample.INSTANCE.play(Assets.SND_MELD); - Dungeon.observe(); - return true; - } else { - return false; - } - } - - @Override - public void detach() { - super.detach(); - Dungeon.observe(); - } - - @Override - public boolean act() { - if (target.isAlive()) { - - spend(TICK * 2); - - if (--left <= 0 || Dungeon.hero.visibleEnemies() > 0) { - detach(); - } - - } else { - - detach(); - - } - - return true; - } - - public void prolong() { - left = 2; - } - - @Override - public int icon() { - return BuffIndicator.SHADOWS; - } - - @Override - public String toString() { - return Messages.get(this, "name"); - } - - @Override - public String desc() { - return Messages.get(this, "desc"); - } - -} diff --git a/java/com/hmdzl/spspd/change/actors/buffs/Shield.java b/java/com/hmdzl/spspd/change/actors/buffs/Shield.java deleted file mode 100644 index 92b615da..00000000 --- a/java/com/hmdzl/spspd/change/actors/buffs/Shield.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.buffs; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.Statistics; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.ui.BuffIndicator; - -public class Shield extends Buff { - - public static float LEVEL = 0.4f; - - private int hits = (Dungeon.checkNight() ? Math.max(8, Math.round(Statistics.deepestFloor/5)+9) : Math.max(2, Math.round(Statistics.deepestFloor/5)+3)); - //private int hits = Math.max(2, Math.round(Statistics.deepestFloor/5)+3); - - { - type = buffType.POSITIVE; - } - - @Override - public int icon() { - return BuffIndicator.DISPEL; - } - - @Override - public String toString() { - return Messages.get(this, "name"); - } - - @Override - public String desc() { - return Messages.get(this, "desc"); - } - - @Override - public void detach() { - hits--; - if(hits==0){ - super.detach(); - } - } - -} diff --git a/java/com/hmdzl/spspd/change/actors/buffs/ShieldArmor.java b/java/com/hmdzl/spspd/change/actors/buffs/ShieldArmor.java deleted file mode 100644 index e0804fee..00000000 --- a/java/com/hmdzl/spspd/change/actors/buffs/ShieldArmor.java +++ /dev/null @@ -1,65 +0,0 @@ -package com.hmdzl.spspd.change.actors.buffs; - -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.ui.BuffIndicator; -import com.watabou.utils.Bundle; - -public class ShieldArmor extends Buff { - - private static final float STEP = 1f; - - private int level; - - - @Override - public boolean act() { - spend(STEP); - return true; - } - - public int absorb(int damage) { - if (level <= damage) { - detach(); - return damage - level; - } else { - level -= damage; - return 0; - } - } - - public void level(int value) { - if (level < value) { - level = value; - } - } - - @Override - public int icon() { - return BuffIndicator.ARMOR; - } - - @Override - public String toString() { - return Messages.get(this, "name"); - } - - @Override - public String desc() { - return Messages.get(this, "desc", level); - } - - private static final String LEVEL = "level"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(LEVEL, level); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - level = bundle.getInt(LEVEL); - } - } \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/actors/buffs/Shieldblock.java b/java/com/hmdzl/spspd/change/actors/buffs/Shieldblock.java deleted file mode 100644 index aad6b16e..00000000 --- a/java/com/hmdzl/spspd/change/actors/buffs/Shieldblock.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.buffs; - -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.items.rings.RingOfElements.Resistance; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.hmdzl.spspd.change.ui.BuffIndicator; - -public class Shieldblock extends FlavourBuff { - - private static final float DURATION = 10f; - - @Override - public boolean attachTo(Char target) { - if (super.attachTo(target)) { - target.paralysed ++ ; - return true; - } else { - return false; - } - } - - @Override - public void detach() { - super.detach(); - if (target.paralysed > 0) - target.paralysed--; - } - - @Override - public int icon() { - return BuffIndicator.SHIELDBLOCK; - } - - @Override - public void fx(boolean on) { - if (on) target.sprite.add(CharSprite.State.PARALYSED); - else target.sprite.remove(CharSprite.State.PARALYSED); - } - - @Override - public String toString() { - return Messages.get(this, "name"); - } - - @Override - public String desc() { - return Messages.get(this, "desc", dispTurns()); - } - - public static float duration(Char ch) { - Resistance r = ch.buff(Resistance.class); - return r != null ? r.durationFactor() * DURATION : DURATION; - } - -} diff --git a/java/com/hmdzl/spspd/change/actors/buffs/Shocked.java b/java/com/hmdzl/spspd/change/actors/buffs/Shocked.java deleted file mode 100644 index a009315b..00000000 --- a/java/com/hmdzl/spspd/change/actors/buffs/Shocked.java +++ /dev/null @@ -1,124 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * Yet Another Pixel Dungeon - * Copyright (C) 2015-2016 Considered Hamster - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.buffs; - -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.ResultDescriptions; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.particles.SparkParticle; -import com.hmdzl.spspd.change.items.EquipableItem; -import com.hmdzl.spspd.change.items.rings.RingOfElements; -import com.hmdzl.spspd.change.items.weapon.melee.FightGloves; -import com.hmdzl.spspd.change.items.weapon.melee.Knuckles; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.ui.BuffIndicator; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.Camera; -import com.watabou.utils.Random; - -import static com.hmdzl.spspd.change.Statistics.duration; - -public class Shocked extends FlavourBuff { - - //private static final String TXT_DISARMED = "Sudden shock have made you drop your %s on the ground!"; - public static final float DURATION = 5f; - - { - type = buffType.NEGATIVE; - } - - @Override - public int icon() { - return BuffIndicator.SHOCKED; - } - - - @Override - public String toString() { - return Messages.get(this, "name"); - } - - @Override - public String desc() { - return Messages.get(this, "desc", dispTurns()); - } - - /*@Override - public boolean act(){ - - Wet wet = target.buff(Wet.class); - - - if( target.isAlive()){ - if( !target.flying && Level.water[ target.pos ] || wet!= null){ - discharge(); - } else spend(TICK); - } - - if (Level.flamable[target.pos] && !target.flying) { - detach(); - } - return super.act(); - } - - public void discharge() { - - target.damage(Random.IntRange(target.HT/4,target.HT/6),this); - -// target.sprite.showStatus( CharSprite.NEGATIVE, "ZAP!"); - - if( target instanceof Hero ) { - - Camera.main.shake( 2, 0.3f ); - - Hero hero = (Hero)target; - EquipableItem weapon = hero.belongings.weapon; - - if( weapon != null && !(weapon instanceof Knuckles || weapon instanceof FightGloves) - && !weapon.cursed) { - GLog.w(Messages.get(this, "knock",weapon.name())); - weapon.doDrop(hero); - - } - - } else { - Buff.prolong(target,Paralysis.class,2f ); - } - - /*if (target.sprite.visible) { - target.sprite.centerEmitter().burst( SparkParticle.FACTORY, (int)Math.ceil( duration ) + 1 ); - } - - detach(); - }; - - @Override - public void onDeath() { - - //Badges.validateDeathFromFire(); - - Dungeon.fail(Messages.format(ResultDescriptions.POISON)); - //GLog.n(TXT_BURNED_TO_DEATH); - }*/ - -} diff --git a/java/com/hmdzl/spspd/change/actors/buffs/Silent.java b/java/com/hmdzl/spspd/change/actors/buffs/Silent.java deleted file mode 100644 index 1399b49e..00000000 --- a/java/com/hmdzl/spspd/change/actors/buffs/Silent.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.buffs; - -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.items.rings.RingOfElements.Resistance; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.ui.BuffIndicator; - -public class Silent extends FlavourBuff { - - { - type = buffType.NEGATIVE; - } - - private static final float DURATION = 5f; - - @Override - public int icon() { - return BuffIndicator.SILENT; - } - - @Override - public String toString() { - return Messages.get(this, "name"); - } - - @Override - public String desc() { - return Messages.get(this, "desc", dispTurns()); - } - - public static float duration(Char ch) { - Resistance r = ch.buff(Resistance.class); - return r != null ? r.durationFactor() * DURATION : DURATION; - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/actors/buffs/Sleep.java b/java/com/hmdzl/spspd/change/actors/buffs/Sleep.java deleted file mode 100644 index 7c52f131..00000000 --- a/java/com/hmdzl/spspd/change/actors/buffs/Sleep.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.buffs; - -public class Sleep extends FlavourBuff { - - public static final float SWS = 1.5f; - -} diff --git a/java/com/hmdzl/spspd/change/actors/buffs/Slow.java b/java/com/hmdzl/spspd/change/actors/buffs/Slow.java deleted file mode 100644 index 017febed..00000000 --- a/java/com/hmdzl/spspd/change/actors/buffs/Slow.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.buffs; - -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.items.rings.RingOfElements.Resistance; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.ui.BuffIndicator; - -public class Slow extends FlavourBuff { - - { - type = buffType.NEGATIVE; - } - - private static final float DURATION = 10f; - - @Override - public int icon() { - return BuffIndicator.SLOW; - } - - @Override - public String toString() { - return Messages.get(this, "name"); - } - - @Override - public String desc() { - return Messages.get(this, "desc", dispTurns()); - } - - public static float duration(Char ch) { - Resistance r = ch.buff(Resistance.class); - return r != null ? r.durationFactor() * DURATION : DURATION; - } -} diff --git a/java/com/hmdzl/spspd/change/actors/buffs/SnipersMark.java b/java/com/hmdzl/spspd/change/actors/buffs/SnipersMark.java deleted file mode 100644 index 70ef78f0..00000000 --- a/java/com/hmdzl/spspd/change/actors/buffs/SnipersMark.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.buffs; - -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.ui.BuffIndicator; -import com.watabou.utils.Bundle; - -public class SnipersMark extends FlavourBuff { - - public int object = 0; - - private static final String OBJECT = "object"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(OBJECT, object); - - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - object = bundle.getInt(OBJECT); - } - - @Override - public int icon() { - return BuffIndicator.MARK; - } - - @Override - public String toString() { - return Messages.get(this, "name"); - } - - @Override - public String desc() { - return Messages.get(this, "desc"); - } -} diff --git a/java/com/hmdzl/spspd/change/actors/buffs/SoulBless.java b/java/com/hmdzl/spspd/change/actors/buffs/SoulBless.java deleted file mode 100644 index 1eef491b..00000000 --- a/java/com/hmdzl/spspd/change/actors/buffs/SoulBless.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * Shattered Pixel Dungeon - * Copyright (C) 2014-2015 Evan Debenham - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.buffs; - -import com.hmdzl.spspd.change.actors.blobs.ConfusionGas; -import com.hmdzl.spspd.change.actors.blobs.CorruptGas; -import com.hmdzl.spspd.change.actors.blobs.ElectriShock; -import com.hmdzl.spspd.change.actors.blobs.Fire; -import com.hmdzl.spspd.change.actors.blobs.Freezing; -import com.hmdzl.spspd.change.actors.blobs.ParalyticGas; -import com.hmdzl.spspd.change.actors.blobs.Regrowth; -import com.hmdzl.spspd.change.actors.blobs.ShockWeb; -import com.hmdzl.spspd.change.actors.blobs.StenchGas; -import com.hmdzl.spspd.change.actors.blobs.ToxicGas; -import com.hmdzl.spspd.change.actors.blobs.VenomGas; -import com.hmdzl.spspd.change.actors.blobs.weather.WeatherOfRain; -import com.hmdzl.spspd.change.actors.blobs.weather.WeatherOfSand; -import com.hmdzl.spspd.change.actors.blobs.weather.WeatherOfSnow; -import com.hmdzl.spspd.change.actors.blobs.weather.WeatherOfSun; -import com.hmdzl.spspd.change.actors.blobs.Web; -import com.hmdzl.spspd.change.levels.traps.LightningTrap; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.ui.BuffIndicator; - -public class SoulBless extends FlavourBuff { - - public static final float DURATION = 30f; - - @Override - public int icon() { - return BuffIndicator.BLESS; - } - - @Override - public String toString() { - return Messages.get(this, "name"); - } - - - @Override - public String desc() { - return Messages.get(this, "desc", dispTurns()); - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/actors/buffs/SoulMark.java b/java/com/hmdzl/spspd/change/actors/buffs/SoulMark.java deleted file mode 100644 index 60e76050..00000000 --- a/java/com/hmdzl/spspd/change/actors/buffs/SoulMark.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * Shattered Pixel Dungeon - * Copyright (C) 2014-2015 Evan Debenham - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.buffs; - -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.hmdzl.spspd.change.ui.BuffIndicator; - -public class SoulMark extends FlavourBuff { - - public static final float DURATION = 10f; - - { - type = buffType.NEGATIVE; - } - - @Override - public int icon() { - return BuffIndicator.CORRUPT; - } - - public void fx(boolean on) { - if (on) target.sprite.add(CharSprite.State.MARKED); - else target.sprite.remove(CharSprite.State.MARKED); - } - - @Override - public String toString() { - return Messages.get(this, "name"); - } - - @Override - public String desc() { - return Messages.get(this, "desc", dispTurns()); - } -} diff --git a/java/com/hmdzl/spspd/change/actors/buffs/SpAttack.java b/java/com/hmdzl/spspd/change/actors/buffs/SpAttack.java deleted file mode 100644 index 2b55330d..00000000 --- a/java/com/hmdzl/spspd/change/actors/buffs/SpAttack.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * Shattered Pixel Dungeon - * Copyright (C) 2014-2015 Evan Debenham - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.buffs; - -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.ui.BuffIndicator; - -public class SpAttack extends FlavourBuff { - - public static final float DURATION = 30f; - - @Override - public int icon() { - return BuffIndicator.SMASH; - } - - @Override - public String toString() { - return Messages.get(this, "name"); - } - - @Override - public String desc() { - return Messages.get(this, "desc", dispTurns()); - } -} diff --git a/java/com/hmdzl/spspd/change/actors/buffs/Speed.java b/java/com/hmdzl/spspd/change/actors/buffs/Speed.java deleted file mode 100644 index 9af81240..00000000 --- a/java/com/hmdzl/spspd/change/actors/buffs/Speed.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.buffs; - -public class Speed extends FlavourBuff { - - public static final float DURATION = 10f; - -} diff --git a/java/com/hmdzl/spspd/change/actors/buffs/Strength.java b/java/com/hmdzl/spspd/change/actors/buffs/Strength.java deleted file mode 100644 index 7760eef6..00000000 --- a/java/com/hmdzl/spspd/change/actors/buffs/Strength.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.buffs; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.ui.BuffIndicator; - -public class Strength extends Buff { - - public static float LEVEL = 0.4f; - - @Override - public int icon() { - return BuffIndicator.MOON_FURY; - } - - @Override - public String toString() { - return Messages.get(this, "name"); - } - - @Override - public String desc() { - return Messages.get(this, "desc"); - } - - @Override - public void detach() { - - Buff buff = Dungeon.hero.buff(FullMoonStrength.class); - if (buff != null){ - - buff.detach(); - } else { - super.detach(); - } - - } -} diff --git a/java/com/hmdzl/spspd/change/actors/buffs/Tar.java b/java/com/hmdzl/spspd/change/actors/buffs/Tar.java deleted file mode 100644 index 0c107eec..00000000 --- a/java/com/hmdzl/spspd/change/actors/buffs/Tar.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.buffs; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.ResultDescriptions; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Burning; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.ui.BuffIndicator; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.utils.Random; - -public class Tar extends Buff { - - { - type = buffType.NEGATIVE; - } - - @Override - public int icon() { - return BuffIndicator.TAR; - } - - @Override - public String toString() { - return Messages.get(this, "name"); - } - - @Override - public String heroMessage() { - return Messages.get(this, "heromsg"); - } - - @Override - public String desc() { - return Messages.get(this, "desc"); - } - - @Override - public boolean act() { - if (target.isAlive()) { - Burning burning = target.buff(Burning.class); - if (target.isAlive() && burning!=null){ - Buff.affect(target,Burning.class).reignite(target); - } - spend(TICK); - } - if (Level.water[target.pos] && !target.flying) { - detach(); - } - - return true; - } -} diff --git a/java/com/hmdzl/spspd/change/actors/buffs/TargetShoot.java b/java/com/hmdzl/spspd/change/actors/buffs/TargetShoot.java deleted file mode 100644 index 7cbdf048..00000000 --- a/java/com/hmdzl/spspd/change/actors/buffs/TargetShoot.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.buffs; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.hmdzl.spspd.change.ui.BuffIndicator; - -public class TargetShoot extends FlavourBuff { - - public static final float DURATION = 30f; - - @Override - public int icon() { - return BuffIndicator.MARK; - } - - @Override - public String toString() { - return Messages.get(this, "name"); - } - - @Override - public String desc() { - return Messages.get(this, "desc", dispTurns()); - } -} diff --git a/java/com/hmdzl/spspd/change/actors/buffs/Taunt.java b/java/com/hmdzl/spspd/change/actors/buffs/Taunt.java deleted file mode 100644 index c8ba4aaf..00000000 --- a/java/com/hmdzl/spspd/change/actors/buffs/Taunt.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.buffs; - -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.items.rings.RingOfElements.Resistance; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.ui.BuffIndicator; -import com.watabou.utils.Bundle; - -public class Taunt extends Buff { - - { - type = buffType.NEGATIVE; - } - - @Override - public boolean act() { - if (target.isAlive()) { - spend(TICK); - } - return true; - } - -} diff --git a/java/com/hmdzl/spspd/change/actors/buffs/Terror.java b/java/com/hmdzl/spspd/change/actors/buffs/Terror.java deleted file mode 100644 index 98fdf7e2..00000000 --- a/java/com/hmdzl/spspd/change/actors/buffs/Terror.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.buffs; - -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.ui.BuffIndicator; -import com.watabou.utils.Bundle; - -public class Terror extends FlavourBuff { - - public static final float DURATION = 10f; - - public int object = 0; - - private static final String OBJECT = "object"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(OBJECT, object); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - object = bundle.getInt(OBJECT); - } - - @Override - public int icon() { - return BuffIndicator.TERROR; - } - - @Override - public String toString() { - return Messages.get(this, "name"); - } - - @Override - public String desc() { - return Messages.get(this, "desc", dispTurns()); - } - - public static void recover(Char target) { - Terror terror = target.buff(Terror.class); - if (terror != null && terror.cooldown() < DURATION) { - target.remove(terror); - } - } -} diff --git a/java/com/hmdzl/spspd/change/actors/buffs/ToxicImbue.java b/java/com/hmdzl/spspd/change/actors/buffs/ToxicImbue.java deleted file mode 100644 index f98a4feb..00000000 --- a/java/com/hmdzl/spspd/change/actors/buffs/ToxicImbue.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ - -package com.hmdzl.spspd.change.actors.buffs; - -import com.hmdzl.spspd.change.actors.blobs.Blob; -import com.hmdzl.spspd.change.actors.blobs.ToxicGas; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.ui.BuffIndicator; -import com.watabou.utils.Bundle; - -/** - * Created by debenhame on 19/11/2014. - */ -public class ToxicImbue extends Buff { - - public static final float DURATION = 30f; - - protected float left; - - private static final String LEFT = "left"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(LEFT, left); - - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - left = bundle.getFloat(LEFT); - } - - public void set(float duration) { - this.left = duration; - }; - - @Override - public boolean act() { - GameScene.add(Blob.seed(target.pos, 50, ToxicGas.class)); - - spend(TICK); - left -= TICK; - if (left <= 0) - detach(); - - return true; - } - - @Override - public int icon() { - return BuffIndicator.PTOXIC; - } - - @Override - public String toString() { - return Messages.get(this, "name"); - } - - @Override - public String desc() { - return Messages.get(this, "desc", dispTurns(left)); - } - - { - immunities.add(ToxicGas.class); - immunities.add(Poison.class); - } -} diff --git a/java/com/hmdzl/spspd/change/actors/buffs/Venom.java b/java/com/hmdzl/spspd/change/actors/buffs/Venom.java deleted file mode 100644 index 09bb7d20..00000000 --- a/java/com/hmdzl/spspd/change/actors/buffs/Venom.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * Shattered Pixel Dungeon - * Copyright (C) 2014-2015 Evan Debenham - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.buffs; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.ui.BuffIndicator; -import com.watabou.utils.Bundle; - -public class Venom extends Poison implements Hero.Doom { - - private int damage = 1; - - private static final String DAMAGE = "damage"; - - { - type = buffType.NEGATIVE; - } - - @Override - public void storeInBundle( Bundle bundle ) { - super.storeInBundle( bundle ); - bundle.put( DAMAGE, damage ); - - } - - @Override - public void restoreFromBundle( Bundle bundle ) { - super.restoreFromBundle( bundle ); - damage = bundle.getInt( DAMAGE ); - } - - public void set(float duration, int damage) { - set(duration); - this.damage = damage; - } - - @Override - public int icon() { - return BuffIndicator.POISON; - } - - @Override - public String toString() { - return Messages.get(this, "name"); - } - - @Override - public String desc() { - return Messages.get(this, "desc", dispTurns(left), damage); - } - - @Override - public boolean act() { - if (target.isAlive()) { - target.damage(damage, this); - if (damage < ((Dungeon.depth+1)/2)+1) - damage++; - - //want it to act after the cloud of venom it came from. - spend( TICK+0.1f ); - if ((left -= TICK) <= 0) { - detach(); - } - } else { - detach(); - } - - return true; - } - -} diff --git a/java/com/hmdzl/spspd/change/actors/buffs/Vertigo.java b/java/com/hmdzl/spspd/change/actors/buffs/Vertigo.java deleted file mode 100644 index eb6e6b8a..00000000 --- a/java/com/hmdzl/spspd/change/actors/buffs/Vertigo.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.buffs; - -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.items.rings.RingOfElements.Resistance; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.ui.BuffIndicator; - -public class Vertigo extends FlavourBuff { - - public static final float DURATION = 10f; - - { - type = buffType.NEGATIVE; - } - - @Override - public int icon() { - return BuffIndicator.VERTIGO; - } - - @Override - public String toString() { - return Messages.get(this, "name"); - } - - @Override - public String desc() { - return Messages.get(this, "desc", dispTurns()); - } - - public static float duration(Char ch) { - Resistance r = ch.buff(Resistance.class); - return r != null ? r.durationFactor() * DURATION : DURATION; - } -} diff --git a/java/com/hmdzl/spspd/change/actors/buffs/Weakness.java b/java/com/hmdzl/spspd/change/actors/buffs/Weakness.java deleted file mode 100644 index 7d67b451..00000000 --- a/java/com/hmdzl/spspd/change/actors/buffs/Weakness.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.buffs; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.items.rings.RingOfElements.Resistance; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.ui.BuffIndicator; - -public class Weakness extends FlavourBuff { - - private static final float DURATION = 40f; - - { - type = buffType.NEGATIVE; - } - - @Override - public int icon() { - return BuffIndicator.WEAKNESS; - } - - @Override - public String toString() { - return Messages.get(this, "name"); - } - - @Override - public boolean attachTo(Char target) { - if (super.attachTo(target) && target==Dungeon.hero) { - Hero hero = (Hero) target; - hero.weakened = true; - hero.belongings.discharge(); - - return true; - } else { - return false; - } - } - - @Override - public void detach() { - super.detach(); - if (target==Dungeon.hero){ - ((Hero) target).weakened = false; - } - } - - public static float duration(Char ch) { - Resistance r = ch.buff(Resistance.class); - return r != null ? r.durationFactor() * DURATION : DURATION; - } - - @Override - public String heroMessage() { - return Messages.get(this, "heromsg"); - } - - @Override - public String desc() { - return Messages.get(this, "desc", dispTurns()); - } -} diff --git a/java/com/hmdzl/spspd/change/actors/buffs/Wet.java b/java/com/hmdzl/spspd/change/actors/buffs/Wet.java deleted file mode 100644 index e8a4a7e0..00000000 --- a/java/com/hmdzl/spspd/change/actors/buffs/Wet.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * Shattered Pixel Dungeon - * Copyright (C) 2014-2015 Evan Debenham - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.buffs; - -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.ui.BuffIndicator; - -public class Wet extends FlavourBuff { - - public static final float DURATION = 10f; - - { - type = buffType.NEGATIVE; - } - - @Override - public int icon() { - return BuffIndicator.WET; - } - - @Override - public String toString() { - return Messages.get(this, "name"); - } - - @Override - public String desc() { - return Messages.get(this, "desc", dispTurns()); - } -} diff --git a/java/com/hmdzl/spspd/change/actors/buffs/armorbuff/GlyphDark.java b/java/com/hmdzl/spspd/change/actors/buffs/armorbuff/GlyphDark.java deleted file mode 100644 index d5f42c60..00000000 --- a/java/com/hmdzl/spspd/change/actors/buffs/armorbuff/GlyphDark.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.hmdzl.spspd.change.actors.buffs.armorbuff; - -import com.hmdzl.spspd.change.actors.blobs.weather.WeatherOfDead; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.CountDown; -import com.hmdzl.spspd.change.actors.buffs.DeadRaise; -import com.hmdzl.spspd.change.actors.buffs.Silent; -import com.hmdzl.spspd.change.actors.buffs.Weakness; -import com.hmdzl.spspd.change.actors.mobs.DwarfLich; -import com.hmdzl.spspd.change.actors.mobs.Fiend; -import com.hmdzl.spspd.change.actors.mobs.Warlock; - -public class GlyphDark extends Buff { - - { - immunities.add( Weakness.class ); - immunities.add( CountDown.class ); - immunities.add( DeadRaise.class ); - immunities.add( Silent.class ); - immunities.add( WeatherOfDead.class ); - - resistances.add( DwarfLich.class ); - resistances.add( Warlock.class ); - resistances.add( Fiend.class ); - } - - } \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/actors/buffs/armorbuff/GlyphEarth.java b/java/com/hmdzl/spspd/change/actors/buffs/armorbuff/GlyphEarth.java deleted file mode 100644 index c0fa49de..00000000 --- a/java/com/hmdzl/spspd/change/actors/buffs/armorbuff/GlyphEarth.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.hmdzl.spspd.change.actors.buffs.armorbuff; - -import com.hmdzl.spspd.change.actors.blobs.weather.WeatherOfSand; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Ooze; -import com.hmdzl.spspd.change.actors.buffs.Poison; -import com.hmdzl.spspd.change.actors.buffs.Roots; -import com.hmdzl.spspd.change.actors.buffs.Weakness; -import com.hmdzl.spspd.change.actors.mobs.DwarfLich; -import com.hmdzl.spspd.change.actors.mobs.Fiend; -import com.hmdzl.spspd.change.actors.mobs.Warlock; - - public class GlyphEarth extends Buff { - - { - immunities.add( Roots.class ); - immunities.add( Ooze.class ); - immunities.add( Poison.class ); - immunities.add(WeatherOfSand.class ); - } - - } \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/actors/buffs/armorbuff/GlyphElectricity.java b/java/com/hmdzl/spspd/change/actors/buffs/armorbuff/GlyphElectricity.java deleted file mode 100644 index 35b75c63..00000000 --- a/java/com/hmdzl/spspd/change/actors/buffs/armorbuff/GlyphElectricity.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.hmdzl.spspd.change.actors.buffs.armorbuff; - -import com.hmdzl.spspd.change.actors.blobs.ElectriShock; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Locked; -import com.hmdzl.spspd.change.actors.buffs.Shocked; -import com.hmdzl.spspd.change.actors.buffs.Weakness; -import com.hmdzl.spspd.change.actors.mobs.DwarfLich; -import com.hmdzl.spspd.change.actors.mobs.Fiend; -import com.hmdzl.spspd.change.actors.mobs.GnollShaman; -import com.hmdzl.spspd.change.actors.mobs.Shell; -import com.hmdzl.spspd.change.actors.mobs.Warlock; -import com.hmdzl.spspd.change.items.wands.WandOfLightning; -import com.hmdzl.spspd.change.levels.traps.LightningTrap; - -public class GlyphElectricity extends Buff { - - { - resistances.add( Shell.class ); - resistances.add( GnollShaman.class ); - - immunities.add( WandOfLightning.class ); - immunities.add( Shocked.class ); - immunities.add( ElectriShock.class ); - immunities.add( Locked.class ); - immunities.add( LightningTrap.Electricity.class ); - } - - } \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/actors/buffs/armorbuff/GlyphFire.java b/java/com/hmdzl/spspd/change/actors/buffs/armorbuff/GlyphFire.java deleted file mode 100644 index bbd3b5f9..00000000 --- a/java/com/hmdzl/spspd/change/actors/buffs/armorbuff/GlyphFire.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.hmdzl.spspd.change.actors.buffs.armorbuff; - -import com.hmdzl.spspd.change.actors.blobs.Fire; -import com.hmdzl.spspd.change.actors.blobs.TarGas; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Burning; -import com.hmdzl.spspd.change.actors.buffs.Hot; -import com.hmdzl.spspd.change.actors.buffs.Tar; -import com.hmdzl.spspd.change.actors.buffs.Weakness; -import com.hmdzl.spspd.change.actors.mobs.DwarfLich; -import com.hmdzl.spspd.change.actors.mobs.Fiend; -import com.hmdzl.spspd.change.actors.mobs.FireElemental; -import com.hmdzl.spspd.change.actors.mobs.Warlock; -import com.hmdzl.spspd.change.actors.mobs.Yog; - -public class GlyphFire extends Buff { - - { - immunities.add( Burning.class ); - resistances.add( FireElemental.class ); - resistances.add( Yog.BurningFist.class ); - immunities.add( Fire.class ); - immunities.add( Tar.class ); - immunities.add( TarGas.class ); - - immunities.add( Hot.class ); - } - - } \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/actors/buffs/armorbuff/GlyphIce.java b/java/com/hmdzl/spspd/change/actors/buffs/armorbuff/GlyphIce.java deleted file mode 100644 index 8000351c..00000000 --- a/java/com/hmdzl/spspd/change/actors/buffs/armorbuff/GlyphIce.java +++ /dev/null @@ -1,24 +0,0 @@ - -package com.hmdzl.spspd.change.actors.buffs.armorbuff; - -import com.hmdzl.spspd.change.actors.blobs.weather.WeatherOfSnow; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Chill; -import com.hmdzl.spspd.change.actors.buffs.Cold; -import com.hmdzl.spspd.change.actors.buffs.Frost; -import com.hmdzl.spspd.change.actors.buffs.Weakness; -import com.hmdzl.spspd.change.actors.mobs.DwarfLich; -import com.hmdzl.spspd.change.actors.mobs.Fiend; -import com.hmdzl.spspd.change.actors.mobs.Warlock; - -public class GlyphIce extends Buff { - - { - immunities.add( Frost.class ); - immunities.add( Cold.class ); - immunities.add( Chill.class ); - immunities.add(WeatherOfSnow.class ); - - } - - } \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/actors/buffs/armorbuff/GlyphLight.java b/java/com/hmdzl/spspd/change/actors/buffs/armorbuff/GlyphLight.java deleted file mode 100644 index 267e0a66..00000000 --- a/java/com/hmdzl/spspd/change/actors/buffs/armorbuff/GlyphLight.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.hmdzl.spspd.change.actors.buffs.armorbuff; - -import com.hmdzl.spspd.change.actors.blobs.weather.WeatherOfSun; -import com.hmdzl.spspd.change.actors.buffs.Blindness; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Charm; -import com.hmdzl.spspd.change.actors.buffs.Vertigo; -import com.hmdzl.spspd.change.actors.buffs.Weakness; -import com.hmdzl.spspd.change.actors.mobs.DwarfLich; -import com.hmdzl.spspd.change.actors.mobs.Fiend; -import com.hmdzl.spspd.change.actors.mobs.SewerHeart; -import com.hmdzl.spspd.change.actors.mobs.Warlock; - - public class GlyphLight extends Buff { - - { - immunities.add( Blindness.class ); - immunities.add( Vertigo.class ); - immunities.add( Charm.class ); - immunities.add(WeatherOfSun.class ); - } - - } \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/actors/buffs/faithbuff/BalanceFaith.java b/java/com/hmdzl/spspd/change/actors/buffs/faithbuff/BalanceFaith.java deleted file mode 100644 index 25e5d64b..00000000 --- a/java/com/hmdzl/spspd/change/actors/buffs/faithbuff/BalanceFaith.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.buffs.faithbuff; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.ResultDescriptions; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.ui.BuffIndicator; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.utils.Random; - -public class BalanceFaith extends Buff { - - @Override - public int icon() { - return BuffIndicator.BALANCE_FAITH; - } - - @Override - public String toString() { - return Messages.get(this, "name"); - } - - @Override - public String desc() { - return Messages.get(this, "desc"); - } - - @Override - public boolean act() { - if (target.isAlive()) { - spend(TICK); - } - return true; - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/actors/buffs/faithbuff/DemonFaith.java b/java/com/hmdzl/spspd/change/actors/buffs/faithbuff/DemonFaith.java deleted file mode 100644 index 1e4b83c7..00000000 --- a/java/com/hmdzl/spspd/change/actors/buffs/faithbuff/DemonFaith.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.buffs.faithbuff; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.ResultDescriptions; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.ui.BuffIndicator; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.utils.Random; - -public class DemonFaith extends Buff { - - @Override - public int icon() { - return BuffIndicator.DEMON_FAITH; - } - - @Override - public String toString() { - return Messages.get(this, "name"); - } - - @Override - public String desc() { - return Messages.get(this, "desc"); - } - - @Override - public boolean act() { - if (target.isAlive()) { - spend(TICK); - } - return true; - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/actors/buffs/faithbuff/HumanFaith.java b/java/com/hmdzl/spspd/change/actors/buffs/faithbuff/HumanFaith.java deleted file mode 100644 index 62620385..00000000 --- a/java/com/hmdzl/spspd/change/actors/buffs/faithbuff/HumanFaith.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.buffs.faithbuff; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.ResultDescriptions; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.ui.BuffIndicator; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.utils.Random; - -public class HumanFaith extends Buff { - - @Override - public int icon() { - return BuffIndicator.HUMAN_FAITH; - } - - @Override - public String toString() { - return Messages.get(this, "name"); - } - - @Override - public String desc() { - return Messages.get(this, "desc"); - } - - @Override - public boolean act() { - if (target.isAlive()) { - spend(TICK); - } - return true; - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/actors/buffs/faithbuff/MechFaith.java b/java/com/hmdzl/spspd/change/actors/buffs/faithbuff/MechFaith.java deleted file mode 100644 index eacd8009..00000000 --- a/java/com/hmdzl/spspd/change/actors/buffs/faithbuff/MechFaith.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.buffs.faithbuff; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.ResultDescriptions; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.ui.BuffIndicator; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.utils.Random; - -public class MechFaith extends Buff { - - @Override - public int icon() { - return BuffIndicator.MECH_FAITH; - } - - @Override - public String toString() { - return Messages.get(this, "name"); - } - - @Override - public String desc() { - return Messages.get(this, "desc"); - } - - @Override - public boolean act() { - if (target.isAlive()) { - spend(TICK); - } - return true; - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/actors/hero/Belongings.java b/java/com/hmdzl/spspd/change/actors/hero/Belongings.java deleted file mode 100644 index d8f513f6..00000000 --- a/java/com/hmdzl/spspd/change/actors/hero/Belongings.java +++ /dev/null @@ -1,356 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.hero; - -import java.util.Iterator; - -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.KindOfArmor; -import com.hmdzl.spspd.change.items.KindOfWeapon; -import com.hmdzl.spspd.change.items.KindofMisc; -import com.hmdzl.spspd.change.items.armor.Armor; -import com.hmdzl.spspd.change.items.bags.Bag; -import com.hmdzl.spspd.change.items.keys.IronKey; -import com.hmdzl.spspd.change.items.keys.Key; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfRemoveCurse; -import com.hmdzl.spspd.change.items.wands.Wand; -import com.hmdzl.spspd.change.items.weapon.guns.GunWeapon; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -public class Belongings implements Iterable { - - public static final int BACKPACK_SIZE = 29; - - private Hero owner; - - public Bag backpack; - - public KindOfWeapon weapon = null; - public KindOfArmor armor = null; - public KindofMisc misc1 = null; - public KindofMisc misc2 = null; - public KindofMisc misc3 = null; - - public Belongings(Hero owner) { - this.owner = owner; - - backpack = new Bag() { - { - name = Messages.get(Bag.class, "name"); - size = BACKPACK_SIZE; - } - }; - backpack.owner = owner; - } - - private static final String WEAPON = "weapon"; - private static final String ARMOR = "armor"; - private static final String MISC1 = "misc1"; - private static final String MISC2 = "misc2"; - private static final String MISC3 = "misc3"; - - public void storeInBundle(Bundle bundle) { - - backpack.storeInBundle(bundle); - - bundle.put(WEAPON, weapon); - bundle.put(ARMOR, armor); - bundle.put(MISC1, misc1); - bundle.put(MISC2, misc2); - bundle.put(MISC3, misc3); - } - - public void restoreFromBundle(Bundle bundle) { - - backpack.clear(); - backpack.restoreFromBundle(bundle); - - weapon = (KindOfWeapon) bundle.get(WEAPON); - if (weapon != null) { - weapon.activate(owner); - } - - armor = (KindOfArmor) bundle.get(ARMOR); - if (armor != null) { - armor.activate(owner); - } - //armor = (Armor) bundle.get(ARMOR); - - misc1 = (KindofMisc) bundle.get(MISC1); - if (misc1 != null) { - misc1.activate(owner); - } - - misc2 = (KindofMisc) bundle.get(MISC2); - if (misc2 != null) { - misc2.activate(owner); - } - - misc3 = (KindofMisc) bundle.get(MISC3); - if (misc3 != null) { - misc3.activate(owner); - } - - } - - @SuppressWarnings("unchecked") - public T getItem(Class itemClass) { - - for (Item item : this) { - if (itemClass.isInstance(item)) { - return (T) item; - } - } - - return null; - } - - @SuppressWarnings("unchecked") - public T getKey(Class kind, int depth) { - - for (Item item : backpack) { - if (item.getClass() == kind && ((Key) item).depth == depth) { - return (T) item; - } - } - - return null; - } - - public void countIronKeys() { - - IronKey.curDepthQuantity = 0; - - for (Item item : backpack) { - if (item instanceof IronKey - && ((IronKey) item).depth == Dungeon.depth) { - IronKey.curDepthQuantity += item.quantity(); - } - } - } - - public void identify() { - for (Item item : this) { - item.identify(); - } - } - - public void observe() { - if (weapon != null) { - weapon.identify(); - Badges.validateItemLevelAquired(weapon); - } - if (armor != null) { - armor.identify(); - Badges.validateItemLevelAquired(armor); - } - if (misc1 != null) { - misc1.identify(); - Badges.validateItemLevelAquired(misc1); - } - if (misc2 != null) { - misc2.identify(); - Badges.validateItemLevelAquired(misc2); - } - if (misc3 != null) { - misc3.identify(); - Badges.validateItemLevelAquired(misc3); - } - for (Item item : backpack) { - item.cursedKnown = true; - } - } - - public void observeS() { - for (Item item : backpack) { - item.cursedKnown = true; - } - } - - public void uncurseEquipped() { - ScrollOfRemoveCurse.uncurse(owner, armor, weapon, misc1, misc2, misc3); - } - - public Item randomUnequipped() { - return Random.element(backpack.items); - } - - public void resurrect(int depth) { - - for (Item item : backpack.items.toArray( new Item[0])) { - if (item instanceof Key) { - if (((Key)item).depth == depth) { - item.detachAll( backpack ); - } - } else if (item.unique) { - item.detachAll(backpack); - //you keep the bag itself, not its contents. - if (item instanceof Bag){ - ((Bag)item).clear(); - } - item.collect(); - } else if (!item.isEquipped( owner )) { - item.detachAll( backpack ); - } - } - - if (weapon != null) { - weapon.cursed = false; - weapon.activate(owner); - } - - if (armor != null) { - armor.cursed = false; - armor.activate(owner); - } - - if (misc1 != null) { - misc1.cursed = false; - misc1.activate(owner); - } - if (misc2 != null) { - misc2.cursed = false; - misc2.activate(owner); - } - if (misc3 != null) { - misc3.cursed = false; - misc3.activate(owner); - } - } - - public int charge(boolean full) { - - int count = 0; - - for (Item item : this) { - if (item instanceof Wand) { - Wand wand = (Wand) item; - if (wand.curCharges < wand.maxCharges) { - wand.curCharges = full ? wand.maxCharges - : wand.curCharges + 1; - count++; - - wand.updateQuickslot(); - } - } - } - - return count; - } - - public int relord() { - - int count = 0; - - for (Item item : this) { - if (item instanceof GunWeapon) { - GunWeapon gunweapon = (GunWeapon) item; - gunweapon.charge = gunweapon.charge + 1; - count++; - gunweapon.updateQuickslot(); - } - } - return count; - } - - public int discharge() { - - int count = 0; - - for (Item item : this) { - if (item instanceof Wand) { - Wand wand = (Wand) item; - if (wand.curCharges > 0) { - wand.curCharges--; - count++; - - wand.updateQuickslot(); - } - } - } - - return count; - } - - @Override - public Iterator iterator() { - return new ItemIterator(); - } - - private class ItemIterator implements Iterator { - - private int index = 0; - - private Iterator backpackIterator = backpack.iterator(); - - private Item[] equipped = { weapon, armor, misc1, misc2 ,misc3 }; - private int backpackIndex = equipped.length; - - @Override - public boolean hasNext() { - - for (int i = index; i < backpackIndex; i++) { - if (equipped[i] != null) { - return true; - } - } - - return backpackIterator.hasNext(); - } - - @Override - public Item next() { - - while (index < backpackIndex) { - Item item = equipped[index++]; - if (item != null) { - return item; - } - } - - return backpackIterator.next(); - } - - @Override - public void remove() { - switch (index) { - case 0: - equipped[0] = weapon = null; - break; - case 1: - equipped[1] = armor = null; - break; - case 2: - equipped[2] = misc1 = null; - break; - case 3: - equipped[3] = misc2 = null; - break; - case 4: - equipped[4] = misc3 = null; - break; - default: - backpackIterator.remove(); - } - } - } -} diff --git a/java/com/hmdzl/spspd/change/actors/hero/Hero.java b/java/com/hmdzl/spspd/change/actors/hero/Hero.java deleted file mode 100644 index e2caaa60..00000000 --- a/java/com/hmdzl/spspd/change/actors/hero/Hero.java +++ /dev/null @@ -1,2388 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.hero; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashSet; - -import com.hmdzl.spspd.change.Challenges; -import com.hmdzl.spspd.change.actors.buffs.AflyBless; -import com.hmdzl.spspd.change.actors.buffs.Arcane; -import com.hmdzl.spspd.change.actors.buffs.ArmorBreak; -import com.hmdzl.spspd.change.actors.buffs.AttackUp; -import com.hmdzl.spspd.change.actors.buffs.BloodAngry; -import com.hmdzl.spspd.change.actors.buffs.BoxStar; -import com.hmdzl.spspd.change.actors.buffs.Burning; -import com.hmdzl.spspd.change.actors.buffs.Charm; -import com.hmdzl.spspd.change.actors.buffs.DamageUp; -import com.hmdzl.spspd.change.actors.buffs.DeadRaise; -import com.hmdzl.spspd.change.actors.buffs.Disarm; -import com.hmdzl.spspd.change.actors.buffs.Dry; -import com.hmdzl.spspd.change.actors.buffs.GlassShield; -import com.hmdzl.spspd.change.actors.buffs.GoldTouch; -import com.hmdzl.spspd.change.actors.buffs.Haste; -import com.hmdzl.spspd.change.actors.buffs.HighAttack; -import com.hmdzl.spspd.change.actors.buffs.HighLight; -import com.hmdzl.spspd.change.actors.buffs.HighVoice; -import com.hmdzl.spspd.change.actors.buffs.Locked; -import com.hmdzl.spspd.change.actors.buffs.MirrorShield; -import com.hmdzl.spspd.change.actors.buffs.Muscle; -import com.hmdzl.spspd.change.actors.buffs.NewCombo; -import com.hmdzl.spspd.change.actors.buffs.Notice; -import com.hmdzl.spspd.change.actors.buffs.ParyAttack; -import com.hmdzl.spspd.change.actors.buffs.Rhythm; -import com.hmdzl.spspd.change.actors.buffs.Rhythm2; -import com.hmdzl.spspd.change.actors.buffs.Shocked; -import com.hmdzl.spspd.change.actors.buffs.Silent; -import com.hmdzl.spspd.change.actors.buffs.Terror; -import com.hmdzl.spspd.change.actors.buffs.WarGroove; -import com.hmdzl.spspd.change.actors.buffs.faithbuff.BalanceFaith; -import com.hmdzl.spspd.change.actors.buffs.faithbuff.DemonFaith; -import com.hmdzl.spspd.change.actors.buffs.faithbuff.HumanFaith; -import com.hmdzl.spspd.change.actors.buffs.faithbuff.LifeFaith; -import com.hmdzl.spspd.change.actors.buffs.faithbuff.MechFaith; -import com.hmdzl.spspd.change.actors.mobs.SommonSkeleton; -import com.hmdzl.spspd.change.effects.Lightning; -import com.hmdzl.spspd.change.items.DolyaSlate; -import com.hmdzl.spspd.change.items.Generator; -import com.hmdzl.spspd.change.items.KindOfArmor; -import com.hmdzl.spspd.change.items.armor.glyphs.Iceglyph; -import com.hmdzl.spspd.change.items.artifacts.AlienBag; -import com.hmdzl.spspd.change.items.artifacts.EtherealChains; -import com.hmdzl.spspd.change.items.artifacts.Pylon; -import com.hmdzl.spspd.change.items.misc.AttackShield; -import com.hmdzl.spspd.change.items.misc.BShovel; -import com.hmdzl.spspd.change.items.misc.CopyBall; -import com.hmdzl.spspd.change.items.misc.DanceLion; -import com.hmdzl.spspd.change.items.misc.FourClover; -import com.hmdzl.spspd.change.items.misc.GunOfSoldier; -import com.hmdzl.spspd.change.items.misc.HealBag; -import com.hmdzl.spspd.change.items.misc.HorseTotem; -import com.hmdzl.spspd.change.items.misc.JumpF; -import com.hmdzl.spspd.change.items.misc.JumpP; -import com.hmdzl.spspd.change.items.misc.JumpS; -import com.hmdzl.spspd.change.items.misc.PotionOfMage; -import com.hmdzl.spspd.change.items.misc.RangeBag; -import com.hmdzl.spspd.change.items.misc.SavageHelmet; -import com.hmdzl.spspd.change.items.misc.Shovel; -import com.hmdzl.spspd.change.items.rings.RingOfMagic; -import com.hmdzl.spspd.change.items.skills.ClassSkill; -import com.hmdzl.spspd.change.items.wands.WandOfFlow; -import com.hmdzl.spspd.change.items.weapon.melee.special.Goei; -import com.hmdzl.spspd.change.items.misc.MissileShield; -import com.hmdzl.spspd.change.mechanics.Ballistica; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.GamesInProgress; -import com.hmdzl.spspd.change.ResultDescriptions; -import com.hmdzl.spspd.change.Statistics; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Barkskin; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Combo; -import com.hmdzl.spspd.change.actors.buffs.Dewcharge; -import com.hmdzl.spspd.change.actors.buffs.Drowsy; -import com.hmdzl.spspd.change.actors.buffs.Fury; -import com.hmdzl.spspd.change.actors.buffs.Hunger; -import com.hmdzl.spspd.change.actors.buffs.Invisibility; -import com.hmdzl.spspd.change.actors.buffs.Light; -import com.hmdzl.spspd.change.actors.buffs.Paralysis; -import com.hmdzl.spspd.change.actors.buffs.Regeneration; -import com.hmdzl.spspd.change.actors.buffs.SnipersMark; -import com.hmdzl.spspd.change.actors.buffs.Strength; -import com.hmdzl.spspd.change.actors.buffs.Vertigo; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.actors.mobs.npcs.NPC; -import com.hmdzl.spspd.change.actors.mobs.pets.PET; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.CheckedCell; -import com.hmdzl.spspd.change.effects.Flare; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.Amulet; -import com.hmdzl.spspd.change.items.Ankh; -import com.hmdzl.spspd.change.items.Dewdrop; -import com.hmdzl.spspd.change.items.eggs.Egg; -import com.hmdzl.spspd.change.items.Heap; -import com.hmdzl.spspd.change.items.Heap.Type; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.KindOfWeapon; -import com.hmdzl.spspd.change.items.artifacts.CapeOfThorns; -import com.hmdzl.spspd.change.items.artifacts.DriedRose; -import com.hmdzl.spspd.change.items.artifacts.TalismanOfForesight; -import com.hmdzl.spspd.change.items.artifacts.TimekeepersHourglass; -import com.hmdzl.spspd.change.items.keys.GoldenKey; -import com.hmdzl.spspd.change.items.keys.GoldenSkeletonKey; -import com.hmdzl.spspd.change.items.keys.IronKey; -import com.hmdzl.spspd.change.items.keys.Key; -import com.hmdzl.spspd.change.items.keys.SkeletonKey; -import com.hmdzl.spspd.change.items.misc.AutoPotion.AutoHealPotion; -import com.hmdzl.spspd.change.items.potions.Potion; -import com.hmdzl.spspd.change.items.potions.PotionOfHealing; -import com.hmdzl.spspd.change.items.potions.PotionOfMight; -import com.hmdzl.spspd.change.items.potions.PotionOfStrength; -import com.hmdzl.spspd.change.items.rings.RingOfElements; -import com.hmdzl.spspd.change.items.rings.RingOfForce; -import com.hmdzl.spspd.change.items.rings.RingOfFuror; -import com.hmdzl.spspd.change.items.rings.RingOfHaste; -import com.hmdzl.spspd.change.items.rings.RingOfMight; -import com.hmdzl.spspd.change.items.rings.RingOfTenacity; -import com.hmdzl.spspd.change.items.scrolls.Scroll; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfMagicMapping; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfMagicalInfusion; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfUpgrade; -import com.hmdzl.spspd.change.items.weapon.melee.MeleeWeapon; -import com.hmdzl.spspd.change.items.misc.Jumpshoes; -import com.hmdzl.spspd.change.items.misc.JumpW; -import com.hmdzl.spspd.change.items.misc.JumpM; -import com.hmdzl.spspd.change.items.misc.JumpR; -import com.hmdzl.spspd.change.items.misc.JumpH; -import com.hmdzl.spspd.change.items.misc.Ankhshield; -import com.hmdzl.spspd.change.items.OrbOfZot; -import com.hmdzl.spspd.change.items.weapon.missiles.MissileWeapon; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.Terrain; -import com.hmdzl.spspd.change.levels.features.AlchemyPot; -import com.hmdzl.spspd.change.levels.features.Chasm; -import com.hmdzl.spspd.change.levels.features.Sign; -import com.hmdzl.spspd.change.plants.Earthroot; -import com.hmdzl.spspd.change.plants.Sungrass; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.scenes.InterlevelScene; -import com.hmdzl.spspd.change.scenes.SurfaceScene; -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.hmdzl.spspd.change.sprites.HeroSprite; -import com.hmdzl.spspd.change.ui.AttackIndicator; -import com.hmdzl.spspd.change.ui.BuffIndicator; -import com.hmdzl.spspd.change.ui.QuickSlotButton; -import com.hmdzl.spspd.change.utils.GLog; -import com.hmdzl.spspd.change.windows.WndAscend; -import com.hmdzl.spspd.change.windows.WndDescend; -import com.hmdzl.spspd.change.windows.WndMessage; -import com.hmdzl.spspd.change.windows.WndResurrect; -import com.hmdzl.spspd.change.windows.WndTradeItem; -import com.hmdzl.spspd.change.utils.BArray; -import com.watabou.noosa.Camera; -import com.watabou.noosa.Game; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.PathFinder; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -import static com.hmdzl.spspd.change.Dungeon.hero; - -public class Hero extends Char { - - private static final String TXT_VALUE = "%+d"; - - public static final int STARTING_STR = 10; - public static final int STARTING_MAGIC = 0; - - - private static final float TIME_TO_REST = 1f; - private static final float TIME_TO_SEARCH = 2f; - - public HeroClass heroClass = HeroClass.ROGUE; - public HeroSubClass subClass = HeroSubClass.NONE; - - public int hitSkill = 10; - public int evadeSkill = 5; - public int magicSkill = 0; - - public boolean ready = false; - - public boolean haspet = false; - public boolean petfollow = false; - public int petType = 0; - public int petLevel = 0; - public int petHP = 0; - public int petExperience = 0; - public int petCooldown = 0; - - private boolean damageInterrupt = true; - public HeroAction curAction = null; - public HeroAction lastAction = null; - - private Char enemy; - - private Item theKey; - private Item theSkeletonKey; - - public boolean restoreHealth = false; - - public MissileWeapon rangedWeapon = null; - public Belongings belongings; - - public int STR; - public boolean weakened = false; - - public float awareness; - - public int lvl = 1; - public int exp = 0; - - private ArrayList visibleEnemies; - - public Hero() { - super(); - name = Messages.get(this, "name"); - - HP = HT = 30; - STR = STARTING_STR; - magicSkill = STARTING_MAGIC; - - awareness = 0.1f; - - belongings = new Belongings(this); - - visibleEnemies = new ArrayList(); - } - - public int STR() { - int STR = this.STR; - - for (Buff buff : buffs(RingOfMight.Might.class)) { - STR += (int)(((RingOfMight.Might) buff).level/5); - } - - if (buff(Muscle.class)!= null) - STR += 2 ; - - if (buff(AflyBless.class)!= null) - STR += 1 ; - - return weakened ? STR - 3 : STR; - } - - public int magicSkill() { - int magicSkill = this.magicSkill; - - for (Buff buff : buffs(RingOfMagic.Magic.class)) { - magicSkill += Math.min(30,((RingOfMagic.Magic) buff).level); - } - if (subClass == HeroSubClass.BATTLEMAGE) - magicSkill += 5; - if (subClass == HeroSubClass.SUPERSTAR) - magicSkill += 4; - if (buff(Arcane.class)!= null) - magicSkill += 10; - - return magicSkill; - } - - private static final String ATTACK = "hitSkill"; - private static final String DEFENSE = "evadeSkill"; - private static final String MAGIC = "magicSkill"; - private static final String STRENGTH = "STR"; - private static final String LEVEL = "lvl"; - private static final String EXPERIENCE = "exp"; - private static final String HASPET = "haspet"; - private static final String PETFOLLOW = "petfollow"; - private static final String PETTYPE = "petType"; - private static final String PETLEVEL = "petLevel"; - private static final String PETHP = "petHP"; - private static final String PETEXP = "petExperience"; - private static final String PETCOOLDOWN = "petCooldown"; - - @Override - public void storeInBundle(Bundle bundle) { - - super.storeInBundle(bundle); - - heroClass.storeInBundle(bundle); - subClass.storeInBundle(bundle); - - bundle.put(ATTACK, hitSkill); - bundle.put(DEFENSE, evadeSkill); - bundle.put(MAGIC, magicSkill); - - bundle.put(STRENGTH, STR); - - bundle.put(LEVEL, lvl); - bundle.put(EXPERIENCE, exp); - bundle.put(HASPET, haspet); - bundle.put(PETFOLLOW, petfollow); - bundle.put(PETTYPE, petType); - bundle.put(PETLEVEL, petLevel); - bundle.put(PETHP, petHP); - bundle.put(PETEXP, petExperience); - bundle.put(PETCOOLDOWN, petCooldown); - - belongings.storeInBundle(bundle); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - - heroClass = HeroClass.restoreInBundle(bundle); - subClass = HeroSubClass.restoreInBundle(bundle); - - hitSkill = bundle.getInt(ATTACK); - evadeSkill = bundle.getInt(DEFENSE); - magicSkill = bundle.getInt(MAGIC); - - STR = bundle.getInt(STRENGTH); - updateAwareness(); - - lvl = bundle.getInt(LEVEL); - exp = bundle.getInt(EXPERIENCE); - haspet = bundle.getBoolean(HASPET); - petfollow = bundle.getBoolean(PETFOLLOW); - petType = bundle.getInt(PETTYPE); - petLevel = bundle.getInt(PETLEVEL); - petHP = bundle.getInt(PETHP); - petExperience = bundle.getInt(PETEXP); - petCooldown = bundle.getInt(PETCOOLDOWN); - - belongings.restoreFromBundle(bundle); - } - - public static void preview(GamesInProgress.Info info, Bundle bundle) { - info.level = bundle.getInt(LEVEL); - } - - public String className() { - return subClass == null || subClass == HeroSubClass.NONE ? heroClass - .title() : subClass.title(); - } - - public String givenName() { - return name.equals(Messages.get(this, "name")) ? className() : name; - } - - public void live() { - Buff.affect(this, Regeneration.class); - Buff.affect(this, Hunger.class); - } - - public int useskin() { - return belongings.armor == null ? 0 : 7 - Dungeon.skins; - } - - public boolean shoot(Char enemy, MissileWeapon wep) { - - rangedWeapon = wep; - boolean result = attack(enemy); - Invisibility.dispel(); - rangedWeapon = null; - - return result; - } - - @Override - public int hitSkill(Char target) { - float accuracy = 1; - - KindOfWeapon wep = rangedWeapon != null ? rangedWeapon - : belongings.weapon; - if (wep != null) { - return (int) (hitSkill * accuracy * wep.acuracyFactor(this)); - } else { - return (int) (hitSkill * accuracy); - } - } - - @Override - public int evadeSkill(Char enemy) { - float evasion = 1; - if (paralysed > 0) { - evasion /= 2; - } - KindOfArmor arm = belongings.armor; - if (arm != null) { - return (int) (evadeSkill * evasion * arm.dexterityFactor(this)); - } else { - return (int) (evadeSkill * evasion); - } - } - - @Override - public int drRoll() { - KindOfArmor arm = belongings.armor; - int dr; - //int bonus = 0; - //for (Buff buff : buffs(RingOfForce.Force.class)) { - //bonus += ((RingOfForce.Force) buff).level; - //} - Barkskin barkskin = buff(Barkskin.class); - if (arm != null) { - dr = arm.drRoll(this); - } else { - //int str = 6; - //dr = bonus == 0 ? str > 1 ? Random.NormalIntRange(1, str) : 1 - //: bonus > 0 ? str > 0 ? Random.NormalIntRange(str / 2 - //+ bonus, (int) (str * 0.5f * bonus) + str * 2) : 1 - //: 0; - dr = 0; - } - - //if (bonus > 0){ dr *= Math.min(3f,(1f + (bonus/15)*1f));} - - if (dr < 0) - dr = 0; - if (barkskin != null) { - dr += barkskin.level(); - } - if (Dungeon.hero.heroClass == HeroClass.SOLDIER && Dungeon.skins == 2) { - dr += Dungeon.hero.lvl; - } - return (int)dr; - } - - @Override - public int damageRoll() { - KindOfWeapon wep = rangedWeapon != null ? rangedWeapon - : belongings.weapon; - int dmg; - int bonus = 0; - for (Buff buff : buffs(RingOfForce.Force.class)) { - bonus += ((RingOfForce.Force) buff).level; - } - - if (wep != null) { - dmg = wep.damageRoll(this); - } else { - int str = 6; - dmg = bonus == 0 ? str > 1 ? Random.NormalIntRange(1, str) : 1 - : bonus > 0 ? str > 0 ? Random.NormalIntRange(str / 2 - + bonus, (int) (str * 0.5f * bonus) + str * 2) : 1 - : 0; - } - if (bonus > 0){ dmg *= Math.min(3f,(1f + (bonus*1.00/10)*1f));} - - if (dmg < 0) - dmg = 0; - - if (buff(Fury.class) != null){ dmg *= 1.30f; } - - if (buff(Strength.class) != null){ dmg *= 3f; Buff.detach(this, Strength.class);} - - HighAttack hatk = buff(HighAttack.class); - if (buff(HighAttack.class) != null){ - dmg *= hatk.level(); - Buff.detach(this, HighAttack.class); - } - - ParyAttack paryatk = buff(ParyAttack.class); - if (buff(ParyAttack.class) != null){ - dmg *= (1+paryatk.level()*0.4); - } - - - if (buff(WarGroove.class) != null){ dmg *= 1.5f; Buff.detach(this, WarGroove.class);} - - if (buff(Dry.class) != null){ dmg *= 0.80f; } - - if (buff(BloodAngry.class) != null){ dmg *= 1.50f; } - - if (buff(Rhythm2.class) != null){ dmg *= 1.20f; } - /*AttackUp atkup = buff(AttackUp.class); - if (atkup != null) { - dmg *=(1f+atkup.level()*0.01f); - } - - AttackDown atkdown = buff(AttackDown.class); - if (atkdown != null) { - dmg *=(1f-atkdown.level()*0.01f); - }*/ - - Hunger hunger = buff(Hunger.class); - if (hunger != null && hunger.isStarving()) { dmg *= 0.8f;} - if (hunger != null && hunger.isHungry()) { dmg *= 0.9f;} - if (hunger != null && hunger.isOverfed()) { dmg *= 1.2f; } - - return (int) dmg; - - } - - - @Override - public float speed() { - - float speed = super.speed(); - - int hasteLevel = 0; - for (Buff buff : buffs(RingOfHaste.Haste.class)) { - hasteLevel += ((RingOfHaste.Haste) buff).level; - } - - - if (hasteLevel != 0) { - if (hasteLevel < 30){ - speed *= (1+(hasteLevel*1.00/10)); - } - else speed *=4; - } - - if (hero.heroClass == HeroClass.HUNTRESS && Dungeon.skins == 2) { - speed += 0.5f; - - } - - return ((HeroSprite) sprite).sprint(subClass == HeroSubClass.FREERUNNER && !isStarving()) ? invisible > 0 ? 2.5f * speed - : 1.5f * speed : speed; - - - } - - public boolean canAttack(Char enemy){ - if (enemy == null || pos == enemy.pos) - return false; - - //can always attack adjacent enemies - if (Dungeon.level.adjacent(pos, enemy.pos)) - return true; - - KindOfWeapon wep = hero.belongings.weapon; - - if (wep != null && Dungeon.level.distance( pos, enemy.pos ) <= wep.reachFactor(this)){ - - boolean[] passable = BArray.not(Level.solid, null); - for (Mob m : Dungeon.level.mobs) - passable[m.pos] = false; - - PathFinder.buildDistanceMap(enemy.pos, passable, wep.reachFactor(this)); - - return PathFinder.distance[pos] <= wep.reachFactor(this); - - } else { - return false; - } - } - - - public float attackDelay() { - KindOfWeapon wep = rangedWeapon != null ? rangedWeapon - : belongings.weapon; - if (wep != null) { - - return wep.speedFactor(this); - - } else { - // Normally putting furor speed on unarmed attacks would be - // unnecessary - // But there's going to be that one guy who gets a furor+force ring - // combo - // This is for that one guy, you shall get your fists of fury! - int bonus = 0; - for (Buff buff : buffs(RingOfFuror.Furor.class)) { - bonus += ((RingOfFuror.Furor) buff).level; - } - return (float) ( 1 / Math.min( 4, 1 + bonus * 1.00 / 10) ); - } - } - - @Override - public void spend(float time) { - justMoved = false; - TimekeepersHourglass.timeFreeze freeze = buff(TimekeepersHourglass.timeFreeze.class); - if (freeze != null) { - freeze.processTime(time); - return; - } else if (Statistics.time < 1440 ) { - Statistics.time += time; - Dungeon.observe(); - } else if ( Statistics.time > 1440 ) { - Statistics.time += time; - Statistics.time -= 1440; - //Dungeon.observe(); - } else { - Statistics.time = 0; - //Dungeon.observe(); - } - - super.spend(time); - }; - - public void spendAndNext(float time) { - busy(); - spend(time); - next(); - } - - @Override - public boolean act() { - - super.act(); - - Statistics.moves++; - - Light light = buff(Light.class); - if (buff(HighLight.class) != null){ - viewDistance = 8; - Dungeon.observe(); - } else if ((Statistics.time > 360 && Statistics.time <601 ) || (Statistics.time > 840 && Statistics.time < 1081 )) { - viewDistance = 6; - Dungeon.observe(); - } else if (Statistics.time < 841 && Statistics.time > 600) { - viewDistance = 8; - Dungeon.observe(); - } else if (Statistics.time > 1080 && light == null) { - viewDistance = 4; - Dungeon.observe(); - } else if (Statistics.time < 361 && light == null) { - viewDistance = 2; - Dungeon.observe(); - } else {viewDistance = 5; - Dungeon.observe();} - - - if(Dungeon.dewDraw || Dungeon.dewWater){ Dungeon.level.currentmoves++;} - - if (paralysed > 0) { - - curAction = null; - - spendAndNext(TICK); - return false; - } - - Egg egg = belongings.getItem(Egg.class); - if (egg!=null){ - egg.moves++; - } - - DolyaSlate journal = belongings.getItem(DolyaSlate.class); - if (journal!=null && (Dungeon.depth < 26) - && (journal.level>1 || journal.rooms[0]) - && journal.charge spawnPoints = new ArrayList(); - for (int i = 0; i < Level.NEIGHBOURS8.length; i++) { - int p = pos + Level.NEIGHBOURS8[i]; - if (Actor.findChar(p) == null - && (Level.passable[p] || Level.avoid[p])) { - spawnPoints.add(p); - } - } - - if (spawnPoints.size() > 0) { - SommonSkeleton.spawnAt(Random.element(spawnPoints)); - Sample.INSTANCE.play(Assets.SND_CURSED); - } - } - - - /* - Heap heap = Dungeon.level.heaps.get(pos); - if (heap != null){ - heap.dewcollect(); - } - */ - - checkVisibleMobs(); - - if (curAction == null) { - - if (restoreHealth) { - spend(TIME_TO_REST); - next(); - return false; - } - - ready(); - return false; - - } else { - - restoreHealth = false; - - ready = false; - - if (curAction instanceof HeroAction.Move) { - - return actMove((HeroAction.Move) curAction); - - } else if (curAction instanceof HeroAction.Interact) { - - return actInteract((HeroAction.Interact) curAction); - - } else if (curAction instanceof HeroAction.InteractPet) { - - return actInteractPet((HeroAction.InteractPet) curAction); - - } else if (curAction instanceof HeroAction.Buy) { - - return actBuy((HeroAction.Buy) curAction); - - } else if (curAction instanceof HeroAction.PickUp) { - - return actPickUp((HeroAction.PickUp) curAction); - - } else if (curAction instanceof HeroAction.OpenChest) { - - return actOpenChest((HeroAction.OpenChest) curAction); - - } else if (curAction instanceof HeroAction.Unlock) { - - return actUnlock((HeroAction.Unlock) curAction); - - } else if (curAction instanceof HeroAction.Descend) { - - return actDescend((HeroAction.Descend) curAction); - - } else if (curAction instanceof HeroAction.Ascend) { - - return actAscend((HeroAction.Ascend) curAction); - - } else if (curAction instanceof HeroAction.Attack) { - - return actAttack((HeroAction.Attack) curAction); - - /*} else if (curAction instanceof HeroAction.Cook) { - - return actCook( (HeroAction.Cook)curAction );*/ - - } - } - - return false; - } - - public void busy() { - ready = false; - } - - private void ready() { - sprite.idle(); - curAction = null; - damageInterrupt = true; - ready = true; - - AttackIndicator.updateState(); - - GameScene.ready(); - } - - public void interrupt() { - if (isAlive() && curAction != null - && curAction instanceof HeroAction.Move && curAction.dst != pos) { - lastAction = curAction; - } - curAction = null; - } - - public void resume() { - curAction = lastAction; - lastAction = null; - damageInterrupt = false; - act(); - } - - - public boolean justMoved = false; - - private boolean actMove(HeroAction.Move action) { - - if (getCloser(action.dst)) { - justMoved = true; - return true; - - } else { - if (Dungeon.level.map[pos] == Terrain.SIGN && pos != Dungeon.level.pitSign) { - Sign.read(pos); - } else if (Dungeon.level.map[pos] == Terrain.SIGN && pos == Dungeon.level.pitSign){ - Sign.readPit(pos); - } else if (Dungeon.level.map[pos] == Terrain.ALCHEMY){ - AlchemyPot.cook(pos); - } - ready(); - - return false; - } - } - - private boolean actInteract(HeroAction.Interact action) { - - NPC npc = action.npc; - - if (Level.adjacent(pos, npc.pos)) { - - ready(); - sprite.turnTo(pos, npc.pos); - //npc.interact(); - //return false; - return npc.interact(); - - } else { - - if (Level.fieldOfView[npc.pos] && getCloser(npc.pos)) { - - return true; - - } else { - ready(); - return false; - } - - } - } - - private boolean actInteractPet(HeroAction.InteractPet action) { - - PET pet = action.pet; - - if (Level.adjacent(pos, pet.pos)) { - - ready(); - sprite.turnTo(pos, pet.pos); - //pet.interact(); - //return false; - return pet.interact(); - - } else { - - if (Level.fieldOfView[pet.pos] && getCloser(pet.pos)) { - - return true; - - } else { - ready(); - return false; - } - - } - } - - private boolean actBuy(HeroAction.Buy action) { - int dst = action.dst; - if (pos == dst || Level.adjacent(pos, dst)) { - - ready(); - - Heap heap = Dungeon.level.heaps.get(dst); - if (heap != null && heap.type == Type.FOR_SALE && heap.size() == 1) { - GameScene.show(new WndTradeItem(heap, true)); - } - - return false; - - } else if (getCloser(dst)) { - - return true; - - } else { - ready(); - return false; - } - } - - /*private boolean actAlchemy( HeroAction.Alchemy action ) { - int dst = action.dst; - if (Dungeon.level.distance(dst, pos) <= 1) { - - ready(); - GameScene.show(new WndAlchemy()); - return false; - - } else if (getCloser( dst )) { - - return true; - - } else { - ready(); - return false; - } - }*/ - - private boolean actPickUp(HeroAction.PickUp action) { - int dst = action.dst; - if (pos == dst) { - - Heap heap = Dungeon.level.heaps.get(pos); - if (heap != null) { - Item item = heap.pickUp(); - if (item.doPickUp(this)) { - - if (item instanceof Dewdrop - || item instanceof TimekeepersHourglass.sandBag - || item instanceof DriedRose.Petal) { - // Do Nothing - } else { - - boolean important = ((item instanceof ScrollOfUpgrade || item instanceof ScrollOfMagicalInfusion) && ((Scroll) item) - .isKnown()) - || ((item instanceof PotionOfStrength || item instanceof PotionOfMight) && ((Potion) item) - .isKnown()); - if (important) { - GLog.p(Messages.get(this, "you_now_have", item.name())); - } else { - GLog.i(Messages.get(this, "you_now_have", item.name())); - } - - // Alright, if anyone complains about not knowing the - // vial doesn't revive - // after this... I'm done, I'm just done. - } - - curAction = null; - } else { - Dungeon.level.drop(item, pos).sprite.drop(); - ready(); - } - } else { - ready(); - } - - return false; - - } else if (getCloser(dst)) { - - return true; - - } else { - ready(); - return false; - } - } - - private boolean actOpenChest(HeroAction.OpenChest action) { - int dst = action.dst; - if (Level.adjacent(pos, dst) || pos == dst) { - - Heap heap = Dungeon.level.heaps.get(dst); - if (heap != null - && (heap.type != Type.HEAP && heap.type != Type.FOR_SALE)) { - - theKey = null; - theSkeletonKey = null; - - if (heap.type == Type.LOCKED_CHEST - || heap.type == Type.CRYSTAL_CHEST - //|| heap.type == Type.MONSTERBOX - ) { - - theKey = belongings.getKey(GoldenKey.class, Dungeon.depth); - theSkeletonKey = belongings.getKey(GoldenSkeletonKey.class, 0); - - if (theKey == null && theSkeletonKey == null) { - GLog.w( Messages.get(this, "locked_chest")); - ready(); - return false; - } - } - - switch (heap.type) { - case TOMB: - Sample.INSTANCE.play(Assets.SND_TOMB); - Camera.main.shake(1, 0.5f); - break; - case SKELETON: - case REMAINS: - break; - default: - Sample.INSTANCE.play(Assets.SND_UNLOCK); - } - - spend(Key.TIME_TO_UNLOCK); - sprite.operate(dst); - - } else { - ready(); - } - - return false; - - } else if (getCloser(dst)) { - - return true; - - } else { - ready(); - return false; - } - } - - private boolean actUnlock(HeroAction.Unlock action) { - int doorCell = action.dst; - if (Level.adjacent(pos, doorCell)) { - - theKey = null; - int door = Dungeon.level.map[doorCell]; - - if (door == Terrain.LOCKED_DOOR) { - - theKey = belongings.getKey(IronKey.class, Dungeon.depth); - - } else if (door == Terrain.LOCKED_EXIT) { - - theKey = belongings.getKey(SkeletonKey.class, Dungeon.depth); - - } - - if (theKey != null) { - - spend(Key.TIME_TO_UNLOCK); - sprite.operate(doorCell); - - Sample.INSTANCE.play(Assets.SND_UNLOCK); - - } else { - GLog.w( Messages.get(Hero.class, "locked_door")); - ready(); - } - - return false; - - } else if (getCloser(doorCell)) { - - return true; - - } else { - ready(); - return false; - } - } - - private PET checkpet(){ - for (Mob mob : Dungeon.level.mobs) { - if(mob instanceof PET) { - return (PET) mob; - } - } - return null; - } - - private boolean checkpetNear(){ - for (int n : Level.NEIGHBOURS8) { - int c = pos + n; - if (Actor.findChar(c) instanceof PET) { - return true; - } - } - return false; - } - - private boolean actDescend(HeroAction.Descend action) { - int stairs = action.dst; - - if (!Dungeon.level.forcedone && ( Dungeon.dewDraw || Dungeon.dewWater ) - && (Dungeon.level.checkdew()>0 - || hero.buff(Dewcharge.class) != null)) - { - GameScene.show(new WndDescend()); - ready(); - return false; - } - - if (!Dungeon.level.forcedone && - ( Dungeon.dewDraw || Dungeon.dewWater ) && - !Dungeon.level.cleared && - !Dungeon.notClearableLevel(Dungeon.depth)) - { - GameScene.show(new WndDescend()); - ready(); - return false; - } - - - if (pos == stairs && pos == Dungeon.level.exit && !Dungeon.level.sealedlevel){ - - curAction = null; - - if(Dungeon.dewDraw || Dungeon.dewWater) { - - for (int i = 0; i < Level.LENGTH; i++) { - - if (!Dungeon.level.cleared && (Dungeon.dewDraw || Dungeon.dewWater) && !Dungeon.notClearableLevel(Dungeon.depth)) { - Dungeon.level.cleared = true; - Statistics.prevfloormoves = 0; - } - } - } - - PET pet = checkpet(); - if(pet!=null && checkpetNear()){ - hero.petType=pet.type; - hero.petLevel=pet.level; - hero.petHP=pet.HP; - hero.petExperience=pet.experience; - hero.petCooldown=pet.cooldown; - pet.destroy(); - petfollow=true; - } else if (hero.haspet && hero.petfollow) { - petfollow=true; - } else { - petfollow=false; - } - - Buff buff = buff(TimekeepersHourglass.timeFreeze.class); - if (buff != null) buff.detach(); - - InterlevelScene.mode = InterlevelScene.Mode.DESCEND; - Game.switchScene(InterlevelScene.class); - - return false; - - } else if (getCloser(stairs)) { - - return true; - - } else { - ready(); - return false; - } - } - - private boolean actAscend(HeroAction.Ascend action) { - int stairs = action.dst; - if (pos == stairs && pos == Dungeon.level.entrance) { - - if (Dungeon.depth == 1) { - - if (belongings.getItem(Amulet.class) == null) { - GameScene.show(new WndMessage(Messages.get(this, "leave"))); - ready(); - - } else if (Dungeon.level.forcedone){ - Dungeon.win(Messages.format(ResultDescriptions.WIN)); - Dungeon.deleteGame(hero.heroClass, true); - Game.switchScene(SurfaceScene.class); - } else { - GameScene.show(new WndAscend()); - ready(); - } - - } else if (Dungeon.depth == 34) { - curAction = null; - - Hunger hunger = buff(Hunger.class); - if (hunger != null && !hunger.isStarving()) { - hunger.satisfy(-Hunger.STARVING / 10); - } - - PET pet = checkpet(); - if(pet!=null && checkpetNear()){ - hero.petType=pet.type; - hero.petLevel=pet.level; - hero.petHP=pet.HP; - hero.petExperience=pet.experience; - hero.petCooldown=pet.cooldown; - pet.destroy(); - petfollow=true; - } else if (hero.haspet && hero.petfollow) { - petfollow=true; - } else { - petfollow=false; - } - - Buff buff = buff(TimekeepersHourglass.timeFreeze.class); - if (buff != null) - buff.detach(); - - for (Mob mob : Dungeon.level.mobs.toArray(new Mob[0])) - if (mob instanceof DriedRose.GhostHero) - mob.destroy(); - - InterlevelScene.mode = InterlevelScene.Mode.ASCEND; - Game.switchScene(InterlevelScene.class); - - - } else if (Dungeon.depth == 41) { - curAction = null; - - Hunger hunger = buff(Hunger.class); - if (hunger != null && !hunger.isStarving()) { - hunger.satisfy(-Hunger.STARVING / 10); - } - - PET pet = checkpet(); - if(pet!=null && checkpetNear()){ - hero.petType=pet.type; - hero.petLevel=pet.level; - hero.petHP=pet.HP; - hero.petExperience=pet.experience; - hero.petCooldown=pet.cooldown; - pet.destroy(); - petfollow=true; - } else if (hero.haspet && hero.petfollow) { - petfollow=true; - } else { - petfollow=false; - } - - Buff buff = buff(TimekeepersHourglass.timeFreeze.class); - if (buff != null) - buff.detach(); - - for (Mob mob : Dungeon.level.mobs.toArray(new Mob[0])) - if (mob instanceof DriedRose.GhostHero) - mob.destroy(); - - InterlevelScene.mode = InterlevelScene.Mode.ASCEND; - Game.switchScene(InterlevelScene.class); - - } else if (Dungeon.depth > 26 && !Dungeon.townCheck(Dungeon.depth)){ - ready(); - } else if (Dungeon.depth == 55 || Dungeon.depth == 99){ - ready(); - } else if (Dungeon.depth > 55 && Dungeon.level.locked){ - ready(); - } else { - - curAction = null; - - Hunger hunger = buff(Hunger.class); - if (hunger != null && !hunger.isStarving()) { - hunger.satisfy(-Hunger.STARVING / 10); - } - - PET pet = checkpet(); - if(pet!=null && checkpetNear()){ - hero.petType=pet.type; - hero.petLevel=pet.level; - hero.petHP=pet.HP; - hero.petExperience=pet.experience; - hero.petCooldown=pet.cooldown; - pet.destroy(); - petfollow=true; - } else if (hero.haspet && hero.petfollow) { - petfollow=true; - } else { - petfollow=false; - } - - Buff buff = buff(TimekeepersHourglass.timeFreeze.class); - if (buff != null) - buff.detach(); - - for (Mob mob : Dungeon.level.mobs.toArray(new Mob[0])) - if (mob instanceof DriedRose.GhostHero) - mob.destroy(); - - InterlevelScene.mode = InterlevelScene.Mode.ASCEND; - Game.switchScene(InterlevelScene.class); - } - - return false; - - } else if (getCloser(stairs)) { - - return true; - - } else { - ready(); - return false; - } - } - - private boolean actAttack(HeroAction.Attack action) { - - enemy = action.target; - - if (enemy.isAlive() && canAttack( enemy ) && !isCharmedBy( enemy ) && (buff(Disarm.class) == null)) { - - Invisibility.dispel(); - spend( attackDelay()); - sprite.attack( enemy.pos ); - - return false; - - } else { - - if (Level.fieldOfView[enemy.pos] && getCloser( enemy.pos )) { - - return true; - - } else { - ready(); - return false; - } - - } - } - - public Char enemy(){ - return enemy; - } - - public void rest(boolean fullRest) { - //search(true); - spendAndNext(TIME_TO_REST); - if (!fullRest) { - sprite.showStatus(CharSprite.DEFAULT, Messages.get(this, "wait")); - } - restoreHealth = fullRest; - } - - @Override - public int attackProc(Char enemy, int damage) { - KindOfWeapon wep = rangedWeapon != null ? rangedWeapon - : belongings.weapon; - - if (wep != null){ - wep.proc(this, enemy, damage); - } - - AttackShield atkshield = belongings.getItem(AttackShield.class); - if (atkshield!=null && atkshield.charge arcs = new ArrayList<>(); - arcs.add(new Lightning.Arc(pos - Level.WIDTH, pos + Level.WIDTH)); - arcs.add(new Lightning.Arc(pos - 1, pos + 1)); - sprite.parent.add( new Lightning( arcs, null ) ); - } - if (buff(GoldTouch.class)!=null){ - if (rangedWeapon == null && Dungeon.gold < (int)((1000000/(Math.max(1,20-Statistics.deepestFloor))))) { - int earngold = Math.min(1000 * hero.lvl, damage); - Dungeon.gold += earngold; - - hero.sprite.showStatus(CharSprite.NEUTRAL, TXT_VALUE, earngold); - } - } - - if (buff(MechFaith.class)!= null && ((enemy.properties().contains(Property.BEAST)) - || (enemy.properties().contains(Property.PLANT)) - || (enemy.properties().contains(Property.ELEMENT))) ){ - damage=(int)(damage*1.5); - } - - if (buff(LifeFaith.class)!= null && ((enemy.properties().contains(Property.MECH)) - || (enemy.properties().contains(Property.ALIEN)) - || (enemy.properties().contains(Property.GOBLIN))) ){ - damage=(int)(damage*1.5); - } - - if (buff(DemonFaith.class)!= null && ((enemy.properties().contains(Property.HUMAN)) - || (enemy.properties().contains(Property.ORC)) - || (enemy.properties().contains(Property.ELF)) - || (enemy.properties().contains(Property.DWARF)) - || (enemy.properties().contains(Property.TROLL)))){ - damage=(int)(damage*1.5); - } - - if (buff(HumanFaith.class)!= null && ((enemy.properties().contains(Property.DRAGON)) - || (enemy.properties().contains(Property.DEMONIC)) - || (enemy.properties().contains(Property.UNKNOW)) - || (enemy.properties().contains(Property.UNDEAD))) ){ - damage=(int)(damage*1.5); - } - - if (buff(BalanceFaith.class)!= null && ((enemy.properties().contains(Property.BOSS)) - || (enemy.properties().contains(Property.MINIBOSS))) ){ - damage=(int)(damage*1.5); - } - - HorseTotem horseTotem = belongings.getItem(HorseTotem.class); - HorseTotem.HorseTotemBless totembuff = buff(HorseTotem.HorseTotemBless.class); - if (totembuff != null) { - int x = Random.Int(1,damage/3); - damage +=x; - Buff.prolong(this, Haste.class,4f); - } else if (horseTotem!=null && Random.Int(5)==0) { - int x = Random.Int(1,damage/3); - damage +=x; - Buff.prolong(this, Haste.class,4f); - } - - RangeBag.RangeBagBless rangeBless = buff(RangeBag.RangeBagBless.class); - if (rangeBless != null){ - if (enemy.HP <= damage && Random.Int(6) == 0) { - Dungeon.level.drop(Generator.random(Generator.Category.LINKDROP), enemy.pos).sprite.drop(); - } - } - - return damage; - - } - - @Override - public int defenseProc(Char enemy, int damage) { - - KindOfArmor arm = belongings.armor; - - if (buff(HighVoice.class)!=null && Random.Int(5) == 0){ - Buff.affect(this, GlassShield.class).turns(2); - GLog.p(Messages.get(HighVoice.class,"save",Dungeon.hero.givenName())); - } - - CapeOfThorns.Thorns thorns = buff(CapeOfThorns.Thorns.class); - if (thorns != null) { - damage = thorns.proc(damage, enemy); - } - - MirrorShield mirror = buff(MirrorShield.class); - if (mirror != null) { - damage = mirror.proc(damage, enemy); - } - - BoxStar star = buff(BoxStar.class); - if (star != null) { - damage = star.proc(damage, enemy); - } - - Earthroot.Armor earmor = buff(Earthroot.Armor.class); - if (earmor != null) { - damage = earmor.absorb(damage); - } - - Sungrass.Health health = buff(Sungrass.Health.class); - if (health != null) { - health.absorb(damage); - } - - SavageHelmet helmet = belongings.getItem(SavageHelmet.class); - SavageHelmet.SavageHelmetBless helmetbuff = buff(SavageHelmet.SavageHelmetBless.class); - if (helmetbuff != null) { - helmetbuff.absorb(damage); - } else if (helmet!=null && Random.Int(5)==0) { - int x = Random.Int(1,damage/2); - damage -=x; - Buff.affect(this, DamageUp.class).level(x); - } - - if (arm != null) { - arm.proc(enemy, this, damage); - } - - switch (subClass) { - case LEADER: - switch (Random.Int (10)){ - case 0: - int oppositeDefender = enemy.pos + (enemy.pos - pos); - Ballistica trajectory = new Ballistica(enemy.pos, oppositeDefender, Ballistica.MAGIC_BOLT); - WandOfFlow.throwChar(enemy, trajectory, 1); - break; - case 1: - Buff.prolong(enemy,Silent.class,5f); - break; - case 2: - Buff.prolong(enemy,Disarm.class,5f); - break; - case 3: - Buff.prolong(enemy,Terror.class,5f); - break; - case 4: - Buff.prolong(enemy,ArmorBreak.class,5f).level(35); - break; - case 5: - Buff.prolong(enemy,Locked.class,5f); - break; - - default: - break; - - } - } - return damage; - } - - @Override - public void damage(int dmg, Object src) { - if (buff(TimekeepersHourglass.timeStasis.class) != null) - return; - - if (!(src instanceof Hunger || src instanceof Iceglyph.DeferedDamage) - && damageInterrupt){ - interrupt(); - restoreHealth = false; - } - - if (this.buff(Drowsy.class) != null) { - Buff.detach(this, Drowsy.class); - GLog.w(Messages.get(this, "pain_resist")); - } - - if (enemy != null) { - if (buff(LifeFaith.class) != null) { - if ((enemy.properties().contains(Property.BEAST)) - || (enemy.properties().contains(Property.PLANT)) - || (enemy.properties().contains(Property.ELEMENT))) { - dmg = (int) Math.ceil(dmg * 0.75); - } - } - - if (buff(MechFaith.class) != null) { - if ((enemy.properties().contains(Property.MECH)) - || (enemy.properties().contains(Property.ALIEN)) - || (enemy.properties().contains(Property.GOBLIN))) { - dmg = (int) Math.ceil(dmg * 0.75); - } - } - - if (buff(HumanFaith.class) != null) { - if ((enemy.properties().contains(Property.HUMAN)) - || (enemy.properties().contains(Property.ORC)) - || (enemy.properties().contains(Property.ELF)) - || (enemy.properties().contains(Property.DWARF)) - || (enemy.properties().contains(Property.TROLL))) { - dmg = (int) Math.ceil(dmg * 0.75); - } - } - - if (buff(DemonFaith.class) != null) { - if ((enemy.properties().contains(Property.DRAGON)) - || (enemy.properties().contains(Property.DEMONIC)) - || (enemy.properties().contains(Property.UNKNOW)) - || (enemy.properties().contains(Property.UNDEAD))) { - dmg = (int) Math.ceil(dmg * 0.75); - } - } - - if (buff(BalanceFaith.class) != null) { - if ((enemy.properties().contains(Property.BOSS)) - || (enemy.properties().contains(Property.MINIBOSS))) { - dmg = (int) Math.ceil(dmg * 0.75); - } - } - } - - int tenacity = 0; - for (Buff buff : buffs(RingOfTenacity.Tenacity.class)) { - tenacity += ((RingOfTenacity.Tenacity) buff).level; - } - - if (tenacity != 0) // (HT - HP)/HT = heroes current % missing health. - dmg = (int) Math.ceil(dmg * Math.max(0.60, (1- 1.00*tenacity/75))); - - if (buff(Fury.class) != null){dmg = (int) Math.ceil(dmg * 0.75);} - if (buff(BloodAngry.class) != null){dmg = (int) Math.ceil(dmg * 0.80);} - if (buff(Rhythm2.class) != null){dmg = (int) Math.ceil(dmg * 0.90);} - - if (subClass == HeroSubClass.LEADER){dmg = (int) Math.ceil(dmg * 0.80);} - - //if (buff(Hot.class) != null){dmg = (int) Math.ceil(dmg * 1.20);} - - /*DefenceUp drup = buff(DefenceUp.class); - if (buff(DefenceUp.class) != null) { - dmg = (int) Math.ceil(dmg *(-drup.level()*0.01+1)); - }*/ - - /*ArmorBreak ab = buff(ArmorBreak.class); - if (buff(ArmorBreak.class) != null){ - dmg= (int) Math.ceil(dmg *(ab.level()*0.01+1)); - }*/ - - - - super.damage(dmg, src); - - - if (subClass == HeroSubClass.BERSERKER && 0 < HP - && HP <= HT * Fury.LEVEL) { - Buff.affect(this, Fury.class); - } - - if (this.buff(AutoHealPotion.class) != null && ((float) HP / HT)<.1) { - PotionOfHealing pot = hero.belongings.getItem(PotionOfHealing.class); - if (pot != null) { - pot.detach(hero.belongings.backpack,1); - /* - if(!(Dungeon.hero.belongings.getItem(PotionOfHealing.class).quantity() > 0)){ - pot.detachAll(Dungeon.hero.belongings.backpack); - } - */ - GLog.w(Messages.get(this, "auto_potion")); - pot.apply(this); - } - else if (pot==null){ - GLog.w(Messages.get(this, "auto_potion_no")); - } - - } - - } - - private void checkVisibleMobs() { - ArrayList visible = new ArrayList(); - - boolean newMob = false; - Mob closest = null; - - for (Mob m : Dungeon.level.mobs) { - if (Level.fieldOfView[m.pos] && m.hostile) { - visible.add(m); - if (!visibleEnemies.contains(m)) { - newMob = true; - } - if (closest == null){ - closest = m; - } else if (distance(closest) > distance(m)) { - closest = m; - } - } - } - - if (closest != null && (QuickSlotButton.lastTarget == null || - !QuickSlotButton.lastTarget.isAlive() || - !Dungeon.visible[QuickSlotButton.lastTarget.pos])){ - QuickSlotButton.target(closest); - } - - if (newMob) { - interrupt(); - restoreHealth = false; - } - - visibleEnemies = visible; - } - - public int visibleEnemies() { - return visibleEnemies.size(); - } - - public Mob visibleEnemy(int index) { - return visibleEnemies.get(index % visibleEnemies.size()); - } - - private boolean getCloser(final int target) { - - if (rooted) { - Camera.main.shake(1, 1f); - return false; - } - - int step = -1; - - if (Level.adjacent(pos, target)) { - - if (Actor.findChar(target) == null) { - if (Level.pit[target] && !flying && !Chasm.jumpConfirmed) { - if (!Level.solid[target]) { - Chasm.heroJump(this); - interrupt(); - } - return false; - } - if (Level.passable[target] || Level.avoid[target]) { - step = target; - } - } - - } else { - - int len = Level.getLength(); - boolean[] p = Level.passable; - boolean[] v = Dungeon.level.visited; - boolean[] m = Dungeon.level.mapped; - boolean[] passable = new boolean[len]; - for (int i = 0; i < len; i++) { - passable[i] = p[i] && (v[i] || m[i]); - } - - step = Dungeon.findPath(this, pos, target, passable, - Level.fieldOfView); - } - - if (step != -1) { - - int oldPos = pos; - move(step); - sprite.move(oldPos, pos); - spend(1 / speed()); - - return true; - - } else { - - return false; - - } - - } - - public boolean handle(int cell) { - - if (cell == -1) { - return false; - } - - Char ch; - Heap heap; - if (Level.fieldOfView[cell] - && (ch = Actor.findChar(cell)) instanceof Mob) { - - if (ch instanceof NPC) { - curAction = new HeroAction.Interact((NPC) ch); - } else if (ch instanceof PET) { - curAction = new HeroAction.InteractPet((PET) ch); - } else { - curAction = new HeroAction.Attack(ch); - } - - } else if ((heap = Dungeon.level.heaps.get(cell)) != null) { - - switch (heap.type) { - case HEAP: - curAction = new HeroAction.PickUp(cell); - break; - case FOR_SALE: - curAction = heap.size() == 1 && heap.peek().price() > 0 ? new HeroAction.Buy( - cell) : new HeroAction.PickUp(cell); - break; - default: - curAction = new HeroAction.OpenChest(cell); - } - - } else if (Dungeon.level.map[cell] == Terrain.LOCKED_DOOR - || Dungeon.level.map[cell] == Terrain.LOCKED_EXIT) { - - curAction = new HeroAction.Unlock(cell); - - } else if (cell == Dungeon.level.exit && (Dungeon.depth < 26)) { - - curAction = new HeroAction.Descend(cell); - - } else if (cell == Dungeon.level.entrance) { - - curAction = new HeroAction.Ascend(cell); - - } else { - - curAction = new HeroAction.Move(cell); - lastAction = null; - - } - - return act(); - } - - public void earnExp(int exp) { - - this.exp += exp; - - float percent = exp/(float)maxExp(); - - EtherealChains.chainsRecharge chains = buff(EtherealChains.chainsRecharge.class); - if (chains != null) chains.gainExp(percent); - - AlienBag.bagRecharge bags = buff(AlienBag.bagRecharge.class); - if (bags != null) bags.gainExp(percent); - - Pylon.beaconRecharge pylon = buff(Pylon.beaconRecharge.class); - if (pylon != null) pylon.gainExp(percent); - - boolean levelUp = false; - while (this.exp >= maxExp()) { - this.exp -= maxExp(); - lvl++; - - if (Dungeon.isChallenged(Challenges.LISTLESS)){ - HT += 2; - HP += 1; - hitSkill++; - evadeSkill++; - } else if (lvl < 12) { - HT += 4; - HP += 4; - hitSkill++; - evadeSkill++; - } else { - HT += 5; - HP += 5; - hitSkill++; - evadeSkill++;} - FourClover.FourCloverBless fcb = buff(FourClover.FourCloverBless.class); - if (fcb != null){ - HT+=5; - magicSkill++; - Dungeon.gold+=1000; - hero.sprite.showStatus(CharSprite.NEUTRAL, TXT_VALUE, 1000); - - } - if (heroClass == HeroClass.SOLDIER){ - HT+=3; - } - if (lvl < 10) { - updateAwareness(); - } - - levelUp = true; - } - - if (levelUp) { - - GLog.p(Messages.get(this, "new_level"), lvl ); - sprite.showStatus(CharSprite.POSITIVE, Messages.get(Hero.class, "level_up") ); - Sample.INSTANCE.play(Assets.SND_LEVELUP); - - Badges.validateLevelReached(); - - int value = HT - HP; - if (value > 0) { - HP += value; - sprite.emitter().burst(Speck.factory(Speck.HEALING), 1); - } - - buff(Hunger.class).satisfy(10); - if(hero.heroClass == HeroClass.PERFORMER){ - Buff.prolong(hero,Rhythm.class,100); - Buff.affect(hero,GlassShield.class).turns(1); - } - if(hero.subClass == HeroSubClass.SUPERSTAR){ - Buff.prolong(hero,Rhythm2.class,100); - } - } - } - - public int maxExp() { - return 7 + lvl * 8; - } - - void updateAwareness() { - awareness = (float) (1 - Math.pow((heroClass == HeroClass.ROGUE ? 0.85 - : 0.90), (1 + Math.min(lvl, 9)) * 0.5)); - } - - public boolean isStarving() { - return buff(Hunger.class) != null - && buff(Hunger.class).isStarving(); - } - - public boolean isHungry() { - return buff(Hunger.class) != null - && buff(Hunger.class).isHungry(); - } - - public boolean isOverfed() { - return buff(Hunger.class) != null - && buff(Hunger.class).isOverfed(); - } - - @Override - public void add(Buff buff) { - - if (buff(TimekeepersHourglass.timeStasis.class) != null) - return; - - super.add(buff); - - if (sprite != null) { - String msg = buff.heroMessage(); - if (msg != null){ - GLog.w(msg); - } - - if (buff instanceof RingOfMight.Might) { - if (((RingOfMight.Might) buff).level > 0) { - HT += ((RingOfMight.Might) buff).level * 10; - } - } else if (buff instanceof Paralysis || buff instanceof Vertigo) { - interrupt(); - } - - } - BuffIndicator.refreshHero(); - } - - @Override - public void remove(Buff buff) { - super.remove(buff); - if (buff instanceof RingOfMight.Might) { - if (((RingOfMight.Might) buff).level > 0) { - HT -= ((RingOfMight.Might) buff).level * 10; - hero.damage(1, this); - if (!hero.isAlive()) { - Dungeon.fail(Messages.format(ResultDescriptions.ITEM)); - } - - } - } - - BuffIndicator.refreshHero(); - } - - @Override - public int stealth() { - int stealth = super.stealth(); - int shadow = 1; - KindOfArmor arm = belongings.armor; - if (arm != null) { - stealth += shadow * arm.stealthFactor(this); - } else { - stealth += shadow; - } - if (hero.subClass == HeroSubClass.AGENT){ - stealth += 5; - } - if (hero.heroClass == HeroClass.ROGUE && Dungeon.skins == 2){ - stealth += 8; - } - return stealth; - } - - @Override - public int energybase() { - int energybase = super.energybase(); - int energy = 1; - KindOfArmor arm = belongings.armor; - if (arm != null) { - energybase += energy * arm.energyFactor(this); - } else { - energybase += energy; - } - return energybase; - } - - @Override - public void die(Object cause) { - - curAction = null; - - Ankh ankh = null; - - // look for ankhs in player inventory, prioritize ones which are - // blessed. - for (Item item : belongings) { - if (item instanceof Ankh) { - if (ankh == null || ((Ankh) item).isBlessed()) { - ankh = (Ankh) item; - } - } - } - - if (ankh != null && ankh.isBlessed() && this.HT > 0) { - - this.HP = HT; - - Buff.detach(this, Paralysis.class); - spend(-cooldown()); - - new Flare(8, 32).color(0xFFFF66, true).show(sprite, 2f); - CellEmitter.get(this.pos) - .start(Speck.factory(Speck.LIGHT), 0.2f, 3); - - ankh.detach(belongings.backpack); - - Sample.INSTANCE.play(Assets.SND_TELEPORT); - GLog.w(Messages.get(this, "revive")); - Statistics.ankhsUsed++; - return; - } - - Actor.fixTime(); - super.die(cause); - - if (ankh == null) { - reallyDie(cause); - } else { - - //ankh.detach(belongings.backpack); - Dungeon.deleteGame(hero.heroClass, false); - GameScene.show(new WndResurrect(ankh, cause)); - - } - } - - public static void reallyDie(Object cause) { - - int length = Level.getLength(); - int[] map = Dungeon.level.map; - boolean[] visited = Dungeon.level.visited; - boolean[] discoverable = Level.discoverable; - - for (int i = 0; i < length; i++) { - - int terr = map[i]; - - if (discoverable[i]) { - - visited[i] = true; - if ((Terrain.flags[terr] & Terrain.SECRET) != 0) { - //Level.set(i, Terrain.discover(terr)); - //GameScene.updateMap(i); - Dungeon.level.discover( i ); - } - } - } - - Dungeon.observe(); - - hero.belongings.identify(); - - int pos = hero.pos; - - ArrayList passable = new ArrayList(); - for (Integer ofs : Level.NEIGHBOURS8) { - int cell = pos + ofs; - if ((Level.passable[cell] || Level.avoid[cell]) - && Dungeon.level.heaps.get(cell) == null) { - passable.add(cell); - } - } - Collections.shuffle(passable); - - ArrayList items = new ArrayList( - hero.belongings.backpack.items); - for (Integer cell : passable) { - if (items.isEmpty()) { - break; - } - - Item item = Random.element(items); - Dungeon.level.drop(item, cell).sprite.drop(pos); - items.remove(item); - } - - GameScene.gameOver(); - - if (cause instanceof Hero.Doom) { - ((Hero.Doom) cause).onDeath(); - } - - Dungeon.deleteGame(hero.heroClass, true); - } - - @Override - public void move(int step) { - super.move(step); - - if (!flying) { - - if (Level.water[pos]) { - Sample.INSTANCE.play(Assets.SND_WATER, 1, 1, - Random.Float(0.8f, 1.25f)); - } else { - Sample.INSTANCE.play(Assets.SND_STEP); - } - Dungeon.level.press(pos, this); - } - } - - @Override - public void onMotionComplete() { - Dungeon.observe(); - search(false); - - super.onMotionComplete(); - } - - - @Override - public void onAttackComplete() { - - AttackIndicator.target(enemy); - - //attack(enemy); - - boolean hit = attack( enemy ); - - if (buff(AttackShield.LongBuff.class)!=null && belongings.weapon == null){ - if (hit) { - Buff.affect( this, NewCombo.class ).hit(); - } else { - NewCombo newcombo = buff(NewCombo.class); - if (newcombo != null) newcombo.miss(); - } - } - curAction = null; - - Invisibility.dispel(); - - super.onAttackComplete(); - } - - @Override - public void onOperateComplete() { - - if (curAction instanceof HeroAction.Unlock) { - - if (theKey != null) { - theKey.detach(belongings.backpack); - theKey = null; - } - - int doorCell = ((HeroAction.Unlock) curAction).dst; - int door = Dungeon.level.map[doorCell]; - - Level.set(doorCell, door == Terrain.LOCKED_DOOR ? Terrain.DOOR - : Terrain.UNLOCKED_EXIT); - GameScene.updateMap(doorCell); - - } else if (curAction instanceof HeroAction.OpenChest) { - - if (theKey != null) { - theKey.detach(belongings.backpack); - theKey = null; - } else if (theKey == null && theSkeletonKey != null) { - theSkeletonKey.detach(belongings.backpack); - theSkeletonKey = null; - } - - Heap heap = Dungeon.level.heaps - .get(((HeroAction.OpenChest) curAction).dst); - if (heap.type == Type.SKELETON || heap.type == Type.REMAINS) { - Sample.INSTANCE.play(Assets.SND_BONES); - } - heap.open(this); - } - curAction = null; - - super.onOperateComplete(); - } - - public boolean search(boolean intentional) { - - boolean smthFound = false; - - int positive = 0; - int negative = 0; - Light light = buff(Light.class); - if (light != null){ - positive = 1; - } - int distance = 1 + positive + negative; - - - - float level = intentional ? (2 * awareness - awareness * awareness) - : awareness; - if (distance <= 0) { - level /= 2 - distance; - distance = 1; - } - - int cx = pos % Level.getWidth(); - int cy = pos / Level.getWidth(); - int ax = cx - distance; - if (ax < 0) { - ax = 0; - } - int bx = cx + distance; - if (bx >= Level.getWidth()) { - bx = Level.getWidth() - 1; - } - int ay = cy - distance; - if (ay < 0) { - ay = 0; - } - int by = cy + distance; - if (by >= Level.HEIGHT) { - by = Level.HEIGHT - 1; - } - - TalismanOfForesight.Foresight foresight = buff(TalismanOfForesight.Foresight.class); - boolean notice = buff(Notice.class) != null; - // cursed talisman of foresight makes unintentionally finding things - // impossible. - if (foresight != null && foresight.isCursed()) { - level = -1; - } - - for (int y = ay; y <= by; y++) { - for (int x = ax, p = ax + y * Level.getWidth(); x <= bx; x++, p++) { - - if (Dungeon.visible[p]) { - - if (intentional) { - sprite.parent.addToBack(new CheckedCell(p)); - } - - if (Level.secret[p] - && (intentional || Random.Float() < level || notice)) { - - int oldValue = Dungeon.level.map[p]; - - GameScene.discoverTile(p, oldValue); - - //Level.set(p, Terrain.discover(oldValue)); - - //GameScene.updateMap(p); - - Dungeon.level.discover( p ); - - ScrollOfMagicMapping.discover(p); - - smthFound = true; - - if (foresight != null && !foresight.isCursed()) - foresight.charge(); - } - } - } - } - - if (intentional) { - sprite.showStatus(CharSprite.DEFAULT, Messages.get(this, "search")); - sprite.operate(pos); - if (foresight != null && foresight.isCursed()) { - GLog.n(Messages.get(this, "search_distracted")); - spendAndNext(TIME_TO_SEARCH * 3); - } else { - spendAndNext(TIME_TO_SEARCH); - } - - } - - if (smthFound) { - GLog.w(Messages.get(this, "noticed_smth")); - Sample.INSTANCE.play(Assets.SND_SECRET); - interrupt(); - } - - return smthFound; - } - - - public void resurrect(int resetLevel) { - - HP = HT; - Dungeon.gold = 0; - exp = 0; - - belongings.resurrect(resetLevel); - - live(); - } - - @Override - public HashSet> resistances() { - RingOfElements.Resistance r = buff(RingOfElements.Resistance.class); - return r == null ? super.resistances() : r.resistances(); - } - - @Override - public HashSet> immunities() { - HashSet> immunities = new HashSet>(); - for (Buff buff : buffs()) { - for (Class immunity : buff.immunities) - immunities.add(immunity); - } - return immunities; - } - - @Override - public void next() { - super.next(); - } - - public static interface Doom { - public void onDeath(); - } -} diff --git a/java/com/hmdzl/spspd/change/actors/hero/HeroAction.java b/java/com/hmdzl/spspd/change/actors/hero/HeroAction.java deleted file mode 100644 index eb7c353c..00000000 --- a/java/com/hmdzl/spspd/change/actors/hero/HeroAction.java +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.hero; - -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.mobs.npcs.NPC; -import com.hmdzl.spspd.change.actors.mobs.pets.PET; - -public class HeroAction { - - public int dst; - - public static class Move extends HeroAction { - public Move(int dst) { - this.dst = dst; - } - } - - public static class PickUp extends HeroAction { - public PickUp(int dst) { - this.dst = dst; - } - } - - public static class OpenChest extends HeroAction { - public OpenChest(int dst) { - this.dst = dst; - } - } - - public static class Buy extends HeroAction { - public Buy(int dst) { - this.dst = dst; - } - } - - public static class Interact extends HeroAction { - public NPC npc; - - public Interact(NPC npc) { - this.npc = npc; - } - } - - public static class InteractPet extends HeroAction { - public PET pet; - - public InteractPet(PET pet) { - this.pet = pet; - } - } - - public static class Unlock extends HeroAction { - public Unlock(int door) { - this.dst = door; - } - } - - public static class Descend extends HeroAction { - public Descend(int stairs) { - this.dst = stairs; - } - } - - public static class Ascend extends HeroAction { - public Ascend(int stairs) { - this.dst = stairs; - } - } - - /*public static class Cook extends HeroAction { - public Cook(int pot) { - this.dst = pot; - } - }*/ - - public static class Attack extends HeroAction { - public Char target; - - public Attack( Char target) { - this.target = target; - } - } -} diff --git a/java/com/hmdzl/spspd/change/actors/hero/HeroClass.java b/java/com/hmdzl/spspd/change/actors/hero/HeroClass.java deleted file mode 100644 index 2e4da439..00000000 --- a/java/com/hmdzl/spspd/change/actors/hero/HeroClass.java +++ /dev/null @@ -1,831 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.hero; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.Challenges; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.items.Ankh; -import com.hmdzl.spspd.change.items.ArmorKit; -import com.hmdzl.spspd.change.items.DolyaSlate; -import com.hmdzl.spspd.change.items.Elevator; -import com.hmdzl.spspd.change.items.ExpOre; -import com.hmdzl.spspd.change.items.Palantir; -import com.hmdzl.spspd.change.items.PowerHand; -import com.hmdzl.spspd.change.items.SaveYourLife; -import com.hmdzl.spspd.change.items.SoulCollect; -import com.hmdzl.spspd.change.items.Stylus; -import com.hmdzl.spspd.change.items.TenguKey; -import com.hmdzl.spspd.change.items.TriForce; -import com.hmdzl.spspd.change.items.Weightstone; -import com.hmdzl.spspd.change.items.armor.normalarmor.BaseArmor; -import com.hmdzl.spspd.change.items.armor.normalarmor.DiscArmor; -import com.hmdzl.spspd.change.items.armor.normalarmor.LeatherArmor; -import com.hmdzl.spspd.change.items.armor.normalarmor.MailArmor; -import com.hmdzl.spspd.change.items.armor.normalarmor.RubberArmor; -import com.hmdzl.spspd.change.items.armor.normalarmor.StoneArmor; -import com.hmdzl.spspd.change.items.artifacts.AlienBag; -import com.hmdzl.spspd.change.items.artifacts.EtherealChains; -import com.hmdzl.spspd.change.items.artifacts.Pylon; -import com.hmdzl.spspd.change.items.artifacts.TimekeepersHourglass; -import com.hmdzl.spspd.change.items.bags.PotionBandolier; -import com.hmdzl.spspd.change.items.bags.SeedPouch; -import com.hmdzl.spspd.change.items.bags.WandHolster; -import com.hmdzl.spspd.change.items.bombs.FireBomb; -import com.hmdzl.spspd.change.items.bombs.IceBomb; -import com.hmdzl.spspd.change.items.bombs.StormBomb; -import com.hmdzl.spspd.change.items.challengelists.CaveChallenge; -import com.hmdzl.spspd.change.items.challengelists.ChallengeList; -import com.hmdzl.spspd.change.items.challengelists.CityChallenge; -import com.hmdzl.spspd.change.items.challengelists.CourageChallenge; -import com.hmdzl.spspd.change.items.challengelists.PowerChallenge; -import com.hmdzl.spspd.change.items.challengelists.PrisonChallenge; -import com.hmdzl.spspd.change.items.challengelists.SewerChallenge; -import com.hmdzl.spspd.change.items.challengelists.WisdomChallenge; -import com.hmdzl.spspd.change.items.journalpages.Vault; -import com.hmdzl.spspd.change.items.medicine.Hardpill; -import com.hmdzl.spspd.change.items.medicine.Powerpill; -import com.hmdzl.spspd.change.items.medicine.Smashpill; -import com.hmdzl.spspd.change.items.misc.AttackShield; -import com.hmdzl.spspd.change.items.misc.AttackShoes; -import com.hmdzl.spspd.change.items.misc.BShovel; -import com.hmdzl.spspd.change.items.misc.CopyBall; -import com.hmdzl.spspd.change.items.misc.DanceLion; -import com.hmdzl.spspd.change.items.misc.DemoScroll; -import com.hmdzl.spspd.change.items.misc.FaithSign; -import com.hmdzl.spspd.change.items.misc.GnollMark; -import com.hmdzl.spspd.change.items.misc.HealBag; -import com.hmdzl.spspd.change.items.misc.HorseTotem; -import com.hmdzl.spspd.change.items.misc.JumpF; -import com.hmdzl.spspd.change.items.misc.Jumpshoes; -import com.hmdzl.spspd.change.items.misc.MKbox; -import com.hmdzl.spspd.change.items.misc.MechPocket; -import com.hmdzl.spspd.change.items.misc.RangeBag; -import com.hmdzl.spspd.change.items.misc.SavageHelmet; -import com.hmdzl.spspd.change.items.misc.UndeadBook; -import com.hmdzl.spspd.change.items.nornstone.BlueNornStone; -import com.hmdzl.spspd.change.items.nornstone.GreenNornStone; -import com.hmdzl.spspd.change.items.nornstone.OrangeNornStone; -import com.hmdzl.spspd.change.items.nornstone.PurpleNornStone; -import com.hmdzl.spspd.change.items.nornstone.YellowNornStone; -import com.hmdzl.spspd.change.items.potions.PotionOfHealing; -import com.hmdzl.spspd.change.items.rings.RingOfAccuracy; -import com.hmdzl.spspd.change.items.rings.RingOfElements; -import com.hmdzl.spspd.change.items.rings.RingOfEnergy; -import com.hmdzl.spspd.change.items.rings.RingOfEvasion; -import com.hmdzl.spspd.change.items.rings.RingOfForce; -import com.hmdzl.spspd.change.items.rings.RingOfFuror; -import com.hmdzl.spspd.change.items.rings.RingOfHaste; -import com.hmdzl.spspd.change.items.rings.RingOfMagic; -import com.hmdzl.spspd.change.items.rings.RingOfMight; -import com.hmdzl.spspd.change.items.rings.RingOfSharpshooting; -import com.hmdzl.spspd.change.items.rings.RingOfTenacity; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfRegrowth; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfTerror; -import com.hmdzl.spspd.change.items.summon.FairyCard; -import com.hmdzl.spspd.change.items.TomeOfMastery; -import com.hmdzl.spspd.change.items.armor.normalarmor.VestArmor; -import com.hmdzl.spspd.change.items.armor.normalarmor.WoodenArmor; -import com.hmdzl.spspd.change.items.bags.ScrollHolder; -import com.hmdzl.spspd.change.items.bombs.DungeonBomb; -import com.hmdzl.spspd.change.items.food.Honey; -import com.hmdzl.spspd.change.items.food.staplefood.NormalRation; -import com.hmdzl.spspd.change.items.food.staplefood.Pasty; -import com.hmdzl.spspd.change.items.journalpages.SafeSpotPage; -import com.hmdzl.spspd.change.items.journalpages.Sokoban2; -import com.hmdzl.spspd.change.items.journalpages.Sokoban3; -import com.hmdzl.spspd.change.items.journalpages.Sokoban4; -import com.hmdzl.spspd.change.items.misc.Ankhshield; -import com.hmdzl.spspd.change.items.armor.normalarmor.ClothArmor; -import com.hmdzl.spspd.change.items.artifacts.CloakOfShadows; -import com.hmdzl.spspd.change.items.bags.KeyRing; -import com.hmdzl.spspd.change.items.eggs.RandomEgg; -import com.hmdzl.spspd.change.items.food.completefood.PetFood; -import com.hmdzl.spspd.change.items.journalpages.JournalPage; -import com.hmdzl.spspd.change.items.journalpages.Sokoban1; -import com.hmdzl.spspd.change.items.journalpages.Town; -import com.hmdzl.spspd.change.items.misc.GunOfSoldier; -import com.hmdzl.spspd.change.items.misc.JumpP; -import com.hmdzl.spspd.change.items.misc.JumpS; -import com.hmdzl.spspd.change.items.misc.PotionOfMage; -import com.hmdzl.spspd.change.items.misc.Shovel; -import com.hmdzl.spspd.change.items.potions.PotionOfExperience; -import com.hmdzl.spspd.change.items.potions.PotionOfInvisibility; -import com.hmdzl.spspd.change.items.potions.PotionOfLiquidFlame; -import com.hmdzl.spspd.change.items.potions.PotionOfMending; -import com.hmdzl.spspd.change.items.potions.PotionOfMight; -import com.hmdzl.spspd.change.items.potions.PotionOfMindVision; -import com.hmdzl.spspd.change.items.potions.PotionOfPurity; -import com.hmdzl.spspd.change.items.potions.PotionOfStrength; -import com.hmdzl.spspd.change.items.reward.SewerReward; -import com.hmdzl.spspd.change.items.scrolls.Scroll; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfIdentify; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfLullaby; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfMagicMapping; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfMagicalInfusion; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfRage; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfRemoveCurse; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfUpgrade; -import com.hmdzl.spspd.change.items.wands.CannonOfMage; -import com.hmdzl.spspd.change.items.wands.Wand; -import com.hmdzl.spspd.change.items.wands.WandOfDisintegration; -import com.hmdzl.spspd.change.items.wands.WandOfFirebolt; -import com.hmdzl.spspd.change.items.wands.WandOfFlock; -import com.hmdzl.spspd.change.items.wands.WandOfFreeze; -import com.hmdzl.spspd.change.items.wands.WandOfLightning; -import com.hmdzl.spspd.change.items.wands.WandOfMagicMissile; -import com.hmdzl.spspd.change.items.weapon.guns.GunA; -import com.hmdzl.spspd.change.items.weapon.guns.GunC; -import com.hmdzl.spspd.change.items.weapon.guns.GunE; -import com.hmdzl.spspd.change.items.weapon.guns.Sling; -import com.hmdzl.spspd.change.items.weapon.melee.Dagger; -import com.hmdzl.spspd.change.items.weapon.melee.Glaive; -import com.hmdzl.spspd.change.items.weapon.melee.Knuckles; -import com.hmdzl.spspd.change.items.weapon.melee.Rapier; -import com.hmdzl.spspd.change.items.weapon.melee.ShortSword; -import com.hmdzl.spspd.change.items.weapon.melee.MageBook; -import com.hmdzl.spspd.change.items.weapon.melee.Spear; -import com.hmdzl.spspd.change.items.weapon.melee.Triangolo; -import com.hmdzl.spspd.change.items.weapon.melee.Whip; -import com.hmdzl.spspd.change.items.weapon.melee.WoodenStaff; -import com.hmdzl.spspd.change.items.weapon.melee.special.DiamondPickaxe; -import com.hmdzl.spspd.change.items.weapon.melee.special.FireCracker; -import com.hmdzl.spspd.change.items.weapon.melee.special.LinkSword; -import com.hmdzl.spspd.change.items.weapon.melee.special.TestWeapon; -import com.hmdzl.spspd.change.items.weapon.melee.zero.EmptyPotion; -import com.hmdzl.spspd.change.items.weapon.missiles.Boomerang; -import com.hmdzl.spspd.change.items.weapon.missiles.EmpBola; -import com.hmdzl.spspd.change.items.weapon.missiles.ErrorAmmo; -import com.hmdzl.spspd.change.items.misc.JumpW; -import com.hmdzl.spspd.change.items.misc.JumpH; -import com.hmdzl.spspd.change.items.misc.JumpM; -import com.hmdzl.spspd.change.items.misc.JumpR; -import com.hmdzl.spspd.change.items.weapon.missiles.EscapeKnive; -import com.hmdzl.spspd.change.items.misc.MissileShield; -import com.hmdzl.spspd.change.items.weapon.missiles.ManyKnive; -import com.hmdzl.spspd.change.items.weapon.missiles.PocketBall; -import com.hmdzl.spspd.change.items.weapon.missiles.PoisonDart; -import com.hmdzl.spspd.change.items.weapon.missiles.Skull; -import com.hmdzl.spspd.change.items.weapon.missiles.Smoke; -import com.hmdzl.spspd.change.items.weapon.missiles.TaurcenBow; -import com.hmdzl.spspd.change.items.weapon.spammo.BattleAmmo; -import com.hmdzl.spspd.change.items.weapon.spammo.GoldAmmo; -import com.hmdzl.spspd.change.items.weapon.spammo.HeavyAmmo; -import com.hmdzl.spspd.change.items.weapon.spammo.WoodenAmmo; -import com.hmdzl.spspd.change.plants.Dewcatcher; -import com.hmdzl.spspd.change.plants.Seedpod; -import com.watabou.utils.Bundle; -import com.hmdzl.spspd.change.messages.Messages; - -public enum HeroClass { - - WARRIOR( "warrior" , "warrior_name"), - MAGE( "mage", "mage_name"), - ROGUE( "rogue","rogue_name" ), - HUNTRESS( "huntress", "huntress_name"), - PERFORMER( "performer", "performer_name"), - SOLDIER( "soldier", "soldier_name"), - FOLLOWER( "follower", "follower_name"); - - - private String title; - private String title2; - - private HeroClass(String title, String title2) { - this.title = title; - this.title2 = title2; - } - - - public void initHero(Hero hero) { - - hero.heroClass = this; - - initCommon( hero ); - - switch (this) { - case WARRIOR: - initWarrior( hero ); - break; - - case MAGE: - initMage( hero ); - break; - - case ROGUE: - initRogue( hero ); - break; - - case HUNTRESS: - initHuntress( hero ); - break; - - case PERFORMER: - initPerformer( hero ); - break; - - case SOLDIER: - initSoldier( hero ); - break; - - case FOLLOWER: - initFollower( hero ); - break; - - } - - /*if (Badges.isUnlocked(masteryBadge())) { - new TomeOfMastery().collect(); - }*/ - - hero.updateAwareness(); - } - - private static void initCommon(Hero hero) { - new KeyRing().collect(); - new NormalRation().identify().collect(); - - if (Dungeon.skins != 3) { - new Ankhshield().collect(); - } - if (Dungeon.skins == 3) { - EtherealChains chains = new EtherealChains(); - (hero.belongings.misc3 = chains).identify(); - hero.belongings.misc3.activate(hero); - new EmpBola(7).collect(); - new PoisonDart(7).collect(); - new Smoke(7).collect(); - new Weightstone().collect(); - new Stylus().collect(); - new PotionOfHealing().identify().collect(); - } - - if (Dungeon.skins == 0) { - new RandomEgg().collect(); - new PetFood().collect(); - new PocketBall().collect(); - } - - if (Dungeon.isChallenged(Challenges.ITEM_PHOBIA)){ - Dungeon.gold += 1000; - } - if (Dungeon.isChallenged(Challenges.LISTLESS)){ - new PotionOfMight().collect(); - new PotionOfMight().setKnown(); - new Honey().collect(); - } - if (Dungeon.isChallenged(Challenges.NIGHTMARE_VIRUS)){ - new Ankh().collect(); - } - if (Dungeon.isChallenged(Challenges.ENERGY_LOST)){ - new Pasty().collect(); - } - if (Dungeon.isChallenged(Challenges.DEW_REJECTION)){ - new Dewcatcher.Seed().collect(); - new Dewcatcher.Seed().collect(); - } - if (Dungeon.isChallenged(Challenges.DARKNESS)){ - new ScrollOfMagicMapping().collect(); - new ScrollOfMagicMapping().collect(); - new ScrollOfMagicMapping().setKnown(); - } - if (Dungeon.isChallenged(Challenges.ABRASION)){ - new ScrollOfUpgrade().collect(); - new ScrollOfUpgrade().setKnown(); - new ScrollOfMagicalInfusion().collect(); - new ScrollOfMagicalInfusion().setKnown(); - } - if (Dungeon.isChallenged(Challenges.TEST_TIME)){ - new Elevator().collect(); - new ArmorKit().collect(); - new SafeSpotPage().collect(); - new Town().collect(); - new SewerChallenge().collect(); - new PrisonChallenge().collect(); - new CaveChallenge().collect(); - new CityChallenge().collect(); - new ScrollHolder().collect(); - new SeedPouch().collect(); - new PotionBandolier().collect(); - new WandHolster().collect(); - new Sokoban1().collect(); - new Sokoban2().collect(); - new Sokoban3().collect(); - new Sokoban4().collect(); - new DolyaSlate().collect(); - new Vault().collect(); - new CourageChallenge().collect(); - new PowerChallenge().collect(); - new WisdomChallenge().collect(); - new TriForce().collect(); - new Palantir().collect(); - new SoulCollect(); - new ErrorAmmo(20).collect(); - new PowerHand().collect(); - new TomeOfMastery().collect(); - for(int i=0; i<199; i++){ - new ScrollOfMagicalInfusion().identify().collect(); - new ScrollOfUpgrade().identify().collect(); - new ScrollOfIdentify().identify().collect(); - new ScrollOfMagicMapping().identify().collect(); - new ExpOre().collect(); - new Pasty().collect(); - new PotionOfMindVision().identify().collect(); - new PotionOfStrength().identify().collect(); - new YellowNornStone().collect(); - new BlueNornStone().collect(); - new OrangeNornStone().collect(); - new PurpleNornStone().collect(); - new GreenNornStone().collect(); - } - for(int i=0; i<10; i++){ - new Seedpod.Seed().collect(); - new ScrollOfRegrowth().collect(); - } - new WandOfFlock().upgrade(10).identify().collect(); - new SewerReward().collect(); - new SaveYourLife().collect(); - new FireCracker().collect(); - - Dungeon.gold = 10000; - //Dungeon.gold = 10000000; - hero.HT=hero.HP=10000; - //hero.STR = hero.STR + 20; - Dungeon.depth = 1; - - } - } - - public Badges.Badge masteryBadge() { - switch (this) { - case WARRIOR: - return Badges.Badge.MASTERY_WARRIOR; - case MAGE: - return Badges.Badge.MASTERY_MAGE; - case ROGUE: - return Badges.Badge.MASTERY_ROGUE; - case HUNTRESS: - return Badges.Badge.MASTERY_HUNTRESS; - case PERFORMER: - return Badges.Badge.MASTERY_PERFORMER; - case SOLDIER: - return Badges.Badge.MASTERY_SOLDIER; - case FOLLOWER: - return Badges.Badge.MASTERY_FOLLOWER; - } - - return null; - } - - - private static void initWarrior(Hero hero) { - - if (Dungeon.skins == 1) { - (hero.belongings.armor = new VestArmor()).identify().upgrade(1); - RingOfForce force = new RingOfForce(); - (hero.belongings.misc1 = force).identify().upgrade(1); - hero.belongings.misc1.activate(hero); - - RingOfMight might = new RingOfMight(); - (hero.belongings.misc2 = might).identify().upgrade(1); - hero.belongings.misc2.activate(hero); - - new AttackShield().collect(); - new JumpW().collect(); - - } else if (Dungeon.skins == 2) { - hero.HT+=36; - hero.STR -=4; - hero.hitSkill-=4; - hero.evadeSkill+=1; - hero.magicSkill+=6; - (hero.belongings.armor = new BaseArmor()).upgrade(6).identify(); - new WandOfFirebolt().upgrade(6).identify().collect(); - new DemoScroll().collect(); - new PotionOfStrength().collect(); - new PotionOfStrength().collect(); - new PotionOfStrength().collect(); - new PotionOfStrength().collect(); - Dungeon.gold+=666; - new JumpW().collect(); - - } else if (Dungeon.skins == 3) { - - (hero.belongings.weapon = new Spear()).identify(); - (hero.belongings.armor = new DiscArmor()).identify(); - new MissileShield().collect(); - new SavageHelmet().collect(); - - hero.STR += 2; - Dungeon.limitedDrops.strengthPotions.count+=2; - - } else { - (hero.belongings.weapon = new ShortSword()).identify(); - (hero.belongings.armor = new WoodenArmor()).identify(); - new MissileShield().collect(); - new Powerpill().collect(); - new Smashpill().collect(); - new Hardpill().collect(); - new JumpW().collect(); - } - - new PotionOfStrength().setKnown(); - new ScrollOfUpgrade().setKnown(); - - } - - private static void initMage(Hero hero) { - - if (Dungeon.skins == 1) { - hero.STR+=4; - - (hero.belongings.weapon = new Whip()).identify().upgrade(2); - (hero.belongings.armor = new LeatherArmor()).identify().upgrade(1); - - Dungeon.limitedDrops.strengthPotions.count+=4; - new CannonOfMage().identify().collect(); - new JumpM().collect(); - } else if (Dungeon.skins == 2) { - hero.HT-=10; - hero.hitSkill-=5; - hero.evadeSkill+=2; - hero.magicSkill+=3; - (hero.belongings.weapon = new Dagger()).identify(); - (hero.belongings.armor = new VestArmor()).identify(); - new WandOfFirebolt().upgrade(1).identify().collect(); - new WandOfFreeze().upgrade(1).identify().collect(); - new WandOfLightning().upgrade(1).identify().collect(); - new GnollMark().collect(); - new JumpM().collect(); - } else if (Dungeon.skins == 3) { - - (hero.belongings.weapon = new WoodenStaff()).identify(); - (hero.belongings.armor = new VestArmor()).identify(); - - new WandOfFirebolt().identify().collect(); - new WandOfFreeze().identify().collect(); - new GnollMark().collect(); - new PotionOfMage().identify().collect(); - - } else { - (hero.belongings.weapon = new MageBook()).identify(); - (hero.belongings.armor = new ClothArmor()).identify(); - new WandOfMagicMissile().identify().collect(); - new WandOfDisintegration().identify().collect(); - new PotionOfMage().identify().collect(); - new JumpM().collect(); - - } - hero.magicSkill = hero.magicSkill + 3; - new ScrollOfIdentify().setKnown(); - new PotionOfLiquidFlame().setKnown(); - - } - - private static void initRogue(Hero hero) { - if (Dungeon.skins == 1) { - (hero.belongings.weapon = new LinkSword()).identify(); - hero.belongings.weapon.activate(hero); - (hero.belongings.armor = new WoodenArmor()).identify(); - hero.STR += 1; - Dungeon.limitedDrops.strengthPotions.count++; - EtherealChains ec = new EtherealChains(); - (hero.belongings.misc1 = ec).identify(); - hero.belongings.misc1.activate(hero); - new JumpR().collect(); - } else if (Dungeon.skins == 2) { - hero.HT-=20; - hero.evadeSkill+=3; - hero.magicSkill+=3; - (hero.belongings.weapon = new Dagger()).identify(); - (hero.belongings.armor = new ClothArmor()).identify(); - new UndeadBook().collect(); - new Skull(5).collect(); - new JumpR().collect(); - } else if (Dungeon.skins == 3) { - - (hero.belongings.weapon = new Glaive()).identify(); - (hero.belongings.armor = new DiscArmor()).identify(); - - CloakOfShadows cloak = new CloakOfShadows(); - (hero.belongings.misc1 = cloak).identify(); - hero.belongings.misc1.activate(hero); - - new HorseTotem().identify().collect(); - - hero.STR += 4; - Dungeon.limitedDrops.strengthPotions.count+=4; - - } else { - - (hero.belongings.weapon = new Dagger()).identify(); - (hero.belongings.armor = new VestArmor()).identify(); - - CloakOfShadows cloak = new CloakOfShadows(); - (hero.belongings.misc1 = cloak).identify(); - hero.belongings.misc1.activate(hero); - - new Smoke(3).identify().collect(); - new JumpR().collect(); - } - - new ScrollOfMagicMapping().setKnown(); - new PotionOfInvisibility().setKnown(); - } - - private static void initHuntress(Hero hero) { - if (Dungeon.skins == 1) { - hero.STR+=1; - (hero.belongings.weapon = new Dagger()).identify().upgrade(1); - (hero.belongings.armor = new RubberArmor()).identify().upgrade(1); - Dungeon.limitedDrops.strengthPotions.count++; - TimekeepersHourglass th = new TimekeepersHourglass(); - (hero.belongings.misc1 = th).identify(); - hero.belongings.misc1.activate(hero); - - new ManyKnive().upgrade(1).identify().collect(); - - EscapeKnive knife = new EscapeKnive(5); - knife.identify().collect(); - new JumpH().collect(); - } else if (Dungeon.skins == 2) { - hero.HT-=10; - hero.hitSkill+=5; - hero.evadeSkill+=3; - (hero.belongings.weapon = new Knuckles()).identify(); - (hero.belongings.armor = new ClothArmor()).identify(); - new TaurcenBow().identify().collect(); - new JumpH().collect(); - } else if (Dungeon.skins == 3) { - - (hero.belongings.weapon = new Knuckles()).identify(); - (hero.belongings.armor = new ClothArmor()).identify(); - - new TaurcenBow().identify().collect(); - new RangeBag().identify().collect(); - - } else { - (hero.belongings.weapon = new Knuckles()).identify(); - (hero.belongings.armor = new ClothArmor()).identify(); - - Boomerang boomerang = new Boomerang(null); - boomerang.identify().collect(); - EmpBola empbola = new EmpBola(3); - empbola.identify().collect(); - new JumpH().collect(); - } - new PotionOfMindVision().setKnown(); - new ScrollOfRemoveCurse().setKnown(); - } - - private static void initPerformer(Hero hero) { - - if (Dungeon.skins == 1) { - (hero.belongings.weapon = new GunA()).identify().upgrade(2); - (hero.belongings.armor = new VestArmor()).identify().upgrade(1); - new GoldAmmo().collect(); - new WoodenAmmo().collect(); - new BattleAmmo().collect(); - AlienBag alienBag = new AlienBag(); - (hero.belongings.misc1 = alienBag).identify(); - hero.belongings.misc1.activate(hero); - new BShovel().collect(); - new JumpP().collect(); - } else if (Dungeon.skins == 2) { - hero.HT-=10; - hero.magicSkill+=3; - hero.evadeSkill+=5; - (hero.belongings.weapon = new EmptyPotion()).identify(); - (hero.belongings.armor = new BaseArmor()).identify(); - new CopyBall().collect(); - new PotionOfMending().identify().collect(); - new PotionOfHealing().identify().collect(); - new JumpP().collect(); - } else if (Dungeon.skins == 3) { - - (hero.belongings.weapon = new Triangolo()).identify(); - (hero.belongings.armor = new ClothArmor()).identify(); - - new Shovel().identify().collect(); - new DanceLion().identify().collect(); - - } else { - - (hero.belongings.weapon = new Triangolo()).identify(); - (hero.belongings.armor = new ClothArmor()).identify(); - - new Shovel().identify().collect(); - new ScrollOfLullaby().collect(); - new JumpP().collect(); - - new FireBomb().collect(); - new IceBomb().collect(); - new StormBomb().collect(); - new DungeonBomb().collect(); - } - - new DungeonBomb().collect(); - new ScrollOfLullaby().setKnown(); - new PotionOfPurity().setKnown(); - } - - private static void initSoldier(Hero hero) { - if (Dungeon.skins == 1) { - hero.STR += 2; - (hero.belongings.armor = new LeatherArmor()).identify().upgrade(3); - Dungeon.limitedDrops.strengthPotions.count += 2; - - new AttackShoes().collect(); - new MKbox().collect(); - - }else if (Dungeon.skins == 2) { - hero.HT+=5; - hero.STR += 6; - hero.magicSkill+=5; - hero.hitSkill-=10; - hero.evadeSkill-=35; - (hero.belongings.weapon = new GunC()).identify(); - (hero.belongings.armor = new BaseArmor()).identify(); - Dungeon.limitedDrops.strengthPotions.count += 6; - new MechPocket().collect(); - new JumpS().collect(); - - } else if (Dungeon.skins == 3) { - - (hero.belongings.weapon = new GunA()).identify(); - (hero.belongings.armor = new VestArmor()).identify(); - - new HeavyAmmo().collect(); - new GunOfSoldier().identify().collect(); - new HealBag().identify().collect(); - - } else { - - (hero.belongings.weapon = new Sling()).identify(); - (hero.belongings.armor = new VestArmor()).identify(); - - new GunOfSoldier().identify().collect(); - - new JumpS().collect(); - EscapeKnive knife = new EscapeKnive(3); - knife.identify().collect(); - } - - new ScrollOfRage().setKnown(); - new PotionOfMending().setKnown(); - - hero.hitSkill = hero.hitSkill + 4; - hero.evadeSkill = hero.evadeSkill + 2; - } - - private static void initFollower(Hero hero) { - if (Dungeon.skins == 1) { - (hero.belongings.weapon = new DiamondPickaxe()).identify(); - (hero.belongings.armor = new LeatherArmor()).identify(); - hero.STR += 4; - Dungeon.limitedDrops.strengthPotions.count += 6; - new JumpF().collect(); - }else if (Dungeon.skins == 2) { - (hero.belongings.weapon = new Dagger()).upgrade(2).identify(); - (hero.belongings.armor = new VestArmor()).identify(); - Pylon pylon = new Pylon(); - (hero.belongings.misc1 = pylon).identify(); - hero.belongings.misc1.activate(hero); - new JumpF().collect(); - - } else if (Dungeon.skins == 3) { - - (hero.belongings.weapon = new Rapier()).identify(); - (hero.belongings.armor = new VestArmor()).identify(); - - new FaithSign().identify().collect(); - Pylon pylon = new Pylon(); - (hero.belongings.misc1 = pylon).identify(); - hero.belongings.misc1.activate(hero); - - hero.STR += 4; - Dungeon.limitedDrops.strengthPotions.count+=4; - - } else { - - (hero.belongings.weapon = new WoodenStaff()).identify(); - (hero.belongings.armor = new ClothArmor()).identify(); - new PotionOfHealing().identify().collect(); - new FaithSign().identify().collect(); - new JumpF().collect(); - } - - new ScrollOfTerror().setKnown(); - new PotionOfHealing().setKnown(); - - } - - public String title() { - return Messages.get(HeroClass.class, title); - } - - public String title2() { - return Messages.get(HeroClass.class, title2); - } - - - public String spritesheet() { - - switch (this) { - case WARRIOR: - return Assets.WARRIOR; - case MAGE: - return Assets.MAGE; - case ROGUE: - return Assets.ROGUE; - case HUNTRESS: - return Assets.HUNTRESS; - case PERFORMER: - return Assets.PERFORMER; - case SOLDIER: - return Assets.SOLDIER; - case FOLLOWER: - return Assets.FOLLOWER; - } - - return null; - } - - public String[] perks() { - - switch (this) { - case WARRIOR: - return new String[]{ - Messages.get(HeroClass.class, "warrior_desc_item"), - Messages.get(HeroClass.class, "warrior_desc_loadout"), - Messages.get(HeroClass.class, "warrior_desc_misc"), - }; - case MAGE: - return new String[]{ - Messages.get(HeroClass.class, "mage_desc_item"), - Messages.get(HeroClass.class, "mage_desc_loadout"), - Messages.get(HeroClass.class, "mage_desc_misc"), - }; - case ROGUE: - return new String[]{ - Messages.get(HeroClass.class, "rogue_desc_item"), - Messages.get(HeroClass.class, "rogue_desc_loadout"), - Messages.get(HeroClass.class, "rogue_desc_misc"), - }; - case HUNTRESS: - return new String[]{ - Messages.get(HeroClass.class, "huntress_desc_item"), - Messages.get(HeroClass.class, "huntress_desc_loadout"), - Messages.get(HeroClass.class, "huntress_desc_misc"), - }; - case PERFORMER: - return new String[]{ - Messages.get(HeroClass.class, "performer_desc_item"), - Messages.get(HeroClass.class, "performer_desc_loadout"), - Messages.get(HeroClass.class, "performer_desc_misc"), - }; - case SOLDIER: - return new String[]{ - Messages.get(HeroClass.class, "soldier_desc_item"), - Messages.get(HeroClass.class, "soldier_desc_loadout"), - Messages.get(HeroClass.class, "soldier_desc_misc"), - }; - case FOLLOWER: - return new String[]{ - Messages.get(HeroClass.class, "follower_desc_item"), - Messages.get(HeroClass.class, "follower_desc_loadout"), - Messages.get(HeroClass.class, "follower_desc_misc"), - }; - } - return null; - } - - private static final String CLASS = "class"; - - public void storeInBundle(Bundle bundle) { - bundle.put(CLASS, toString()); - } - - public static HeroClass restoreInBundle(Bundle bundle) { - String value = bundle.getString(CLASS); - return value.length() > 0 ? valueOf(value) : ROGUE; - } - - -} diff --git a/java/com/hmdzl/spspd/change/actors/hero/HeroSubClass.java b/java/com/hmdzl/spspd/change/actors/hero/HeroSubClass.java deleted file mode 100644 index 50b56c3c..00000000 --- a/java/com/hmdzl/spspd/change/actors/hero/HeroSubClass.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.hero; - -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.utils.Bundle; - -public enum HeroSubClass { - - NONE( null ), - - GLADIATOR( "gladiator" ), - BERSERKER( "berserker" ), - - WARLOCK( "warlock" ), - BATTLEMAGE( "battlemage" ), - - ASSASSIN( "assassin" ), - FREERUNNER( "freerunner" ), - - SNIPER( "sniper" ), - WARDEN( "warden" ), - - SUPERSTAR( "superstar" ), - JOKER( "joker" ), - - AGENT( "agent" ), - LEADER( "leader" ), - - PASTOR("pastor"), - ARTISAN("artisan"); - - private String title; - - HeroSubClass( String title ) { - this.title = title; - } - - public String title() { - return Messages.get(this, title); - } - - public String desc() { - return Messages.get(this, title+"_desc"); - } - - private static final String SUBCLASS = "subClass"; - - public void storeInBundle( Bundle bundle ) { - bundle.put( SUBCLASS, toString() ); - } - - public static HeroSubClass restoreInBundle( Bundle bundle ) { - String value = bundle.getString( SUBCLASS ); - return valueOf( value ); - } -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/Acidic.java b/java/com/hmdzl/spspd/change/actors/mobs/Acidic.java deleted file mode 100644 index e4ade5ad..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/Acidic.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs; - -import java.util.HashSet; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.Blob; -import com.hmdzl.spspd.change.actors.blobs.StenchGas; -import com.hmdzl.spspd.change.sprites.AcidicSprite; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.watabou.utils.Random; - -public class Acidic extends Scorpio { - - { - spriteClass = AcidicSprite.class; - - properties.add(Property.BEAST); - properties.add(Property.DEMONIC); - } - - @Override - public boolean act() { - GameScene.add(Blob.seed(pos, 30, StenchGas.class)); - return super.act(); - } - - @Override - public int defenseProc(Char enemy, int damage) { - - int dmg = Random.IntRange(0, damage/2); - if (dmg > 0) { - enemy.damage(dmg, this); - } - - return super.defenseProc(enemy, damage); - } - - @Override - public void die(Object cause) { - super.die(cause); - Badges.validateRare(this); - } - - private static final HashSet> IMMUNITIES = new HashSet>(); - static { - IMMUNITIES.add(StenchGas.class); - } - - @Override - public HashSet> immunities() { - return IMMUNITIES; - } -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/AdultDragonViolet.java b/java/com/hmdzl/spspd/change/actors/mobs/AdultDragonViolet.java deleted file mode 100644 index 40d43f9a..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/AdultDragonViolet.java +++ /dev/null @@ -1,168 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs; - -import java.util.HashSet; - -import com.hmdzl.spspd.change.actors.buffs.Silent; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.ToxicGas; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Poison; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.items.BossRush; -import com.hmdzl.spspd.change.items.Gold; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfPsionicBlast; -import com.hmdzl.spspd.change.items.weapon.enchantments.EnchantmentDark; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.mechanics.Ballistica; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.AdultDragonVioletSprite; -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.hmdzl.spspd.change.sprites.CrabKingSprite; -import com.hmdzl.spspd.change.sprites.VioletDragonSprite; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Callback; -import com.watabou.utils.Random; - -public class AdultDragonViolet extends Mob implements Callback{ - - private static final int JUMP_DELAY = 20; - private static final float TIME_TO_ZAP = 1f; - - { - spriteClass = AdultDragonVioletSprite.class; - baseSpeed = 1.5f; - - HP = HT = 8000; - EXP = 10; - evadeSkill = 40; - - loot = new BossRush(); - lootChance = 1f; - - properties.add(Property.DRAGON); - properties.add(Property.BOSS); - } - - private int timeToJump = JUMP_DELAY; - - - @Override - public int damageRoll() { - return Random.Int(60, 80); - } - - @Override - public int hitSkill(Char target) { - return 50; - } - - @Override - public int drRoll() { - return Random.NormalIntRange(20, 50); - } - - - @Override - public void die(Object cause) { - - super.die(cause); - - yell(Messages.get(this, "die")); - - } - - @Override - protected boolean canAttack(Char enemy) { - if (buff(Silent.class) != null){ - return Level.adjacent(pos, enemy.pos) && (!isCharmedBy(enemy)); - } else return new Ballistica( pos, enemy.pos, Ballistica.MAGIC_BOLT).collisionPos == enemy.pos; - } - - @Override - protected boolean doAttack(Char enemy) { - - if (Level.adjacent(pos, enemy.pos)) { - - return super.doAttack(enemy); - - } else { - - boolean visible = Level.fieldOfView[pos] - || Level.fieldOfView[enemy.pos]; - if (visible) { - ((AdultDragonVioletSprite) sprite).zap(enemy.pos); - } else { - zap(); - } - - return !visible; - } - } - - - private void zap() { - spend(TIME_TO_ZAP); - - - yell(Messages.get(this, "atk")); - - if (hit(this, enemy, true)) { - - int dmg = damageRoll(); - enemy.damage(dmg, this); - - Buff.affect(enemy,Poison.class).set(Poison.durationFactor(enemy)); - - } else { - enemy.sprite.showStatus(CharSprite.NEUTRAL, enemy.defenseVerb()); - } - - } - - public void onZapComplete() { - zap(); - next(); - } - - @Override - public void call() { - next(); - } - - private static final HashSet> RESISTANCES = new HashSet>(); - static { - RESISTANCES.add(ToxicGas.class); - RESISTANCES.add(Poison.class); - RESISTANCES.add(EnchantmentDark.class); - - } - - @Override - public HashSet> resistances() { - return RESISTANCES; - } -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/Albino.java b/java/com/hmdzl/spspd/change/actors/mobs/Albino.java deleted file mode 100644 index ac1d8ee3..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/Albino.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs; - -import java.util.HashSet; - -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.items.food.meatfood.Meat; -import com.hmdzl.spspd.change.sprites.AlbinoSprite; -import com.watabou.utils.Random; -import com.hmdzl.spspd.change.actors.blobs.Blob; -import com.hmdzl.spspd.change.actors.blobs.CorruptGas; -import com.hmdzl.spspd.change.actors.buffs.Amok; -import com.hmdzl.spspd.change.actors.buffs.Terror; -import com.hmdzl.spspd.change.actors.buffs.Vertigo; -import com.hmdzl.spspd.change.scenes.GameScene; - -public class Albino extends Rat { - - { - spriteClass = AlbinoSprite.class; - - HP = HT = 10+(Dungeon.depth*Random.NormalIntRange(1, 3)); - - loot = new Meat(); - lootChance = 1f; - - properties.add(Property.BEAST); - properties.add(Property.DEMONIC); - } - - @Override - public void die(Object cause) { - super.die(cause); - Badges.validateRare(this); - } - - @Override - public boolean act() { - GameScene.add(Blob.seed(pos, 15, CorruptGas.class)); - return super.act(); - } - - private static final HashSet> IMMUNITIES = new HashSet>(); - static { - IMMUNITIES.add(Amok.class); - IMMUNITIES.add(Terror.class); - IMMUNITIES.add(CorruptGas.class); - IMMUNITIES.add(Vertigo.class); - } - - @Override - public HashSet> immunities() { - return IMMUNITIES; - } -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/AlbinoPiranha.java b/java/com/hmdzl/spspd/change/actors/mobs/AlbinoPiranha.java deleted file mode 100644 index e283d2da..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/AlbinoPiranha.java +++ /dev/null @@ -1,206 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs; - -import java.util.HashSet; - -import com.hmdzl.spspd.change.actors.buffs.Corruption; -import com.hmdzl.spspd.change.items.food.vegetable.NutVegetable; -import com.hmdzl.spspd.change.items.food.vegetable.Vegetable; -import com.hmdzl.spspd.change.items.food.completefood.GoldenNut; -import com.hmdzl.spspd.change.items.reward.CaveReward; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfSacrifice; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.Statistics; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.ToxicGas; -import com.hmdzl.spspd.change.actors.buffs.Burning; -import com.hmdzl.spspd.change.actors.buffs.Frost; -import com.hmdzl.spspd.change.actors.buffs.Paralysis; -import com.hmdzl.spspd.change.actors.buffs.Roots; -import com.hmdzl.spspd.change.items.ConchShell; -import com.hmdzl.spspd.change.items.Generator; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.food.meatfood.Meat; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.sprites.AlbinoPiranhaSprite; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.utils.Random; - -public class AlbinoPiranha extends Mob { - - private static final String TXT_KILLCOUNT = "Albino Piranha Kill Count: %s"; - - { - spriteClass = AlbinoPiranhaSprite.class; - - baseSpeed = 1f; - - EXP = 5; - - loot = new Meat(); - lootChance = 0.1f; - - properties.add(Property.BEAST); - } - - public AlbinoPiranha() { - super(); - - HP = HT = 20 + Statistics.albinoPiranhasKilled*2; - evadeSkill = 40 + Statistics.albinoPiranhasKilled/5; - } - - protected boolean checkwater(int cell){ - return Level.water[cell]; - } - - - @Override - protected boolean act() { - - if (!Level.water[pos]) { - die(null); - return true; - - - } else { - // this causes pirahna to move away when a door is closed on them. - Dungeon.level.updateFieldOfView(this); - enemy = chooseEnemy(); - if (state == this.HUNTING - && !(enemy.isAlive() && Level.fieldOfView[enemy.pos] && enemy.invisible <= 0)) { - state = this.WANDERING; - int oldPos = pos; - int i = 0; - do { - i++; - target = Dungeon.level.randomDestination(); - if (i == 100) - return true; - } while (!getCloser(target)); - moveSprite(oldPos, pos); - return true; - } - - return super.act(); - } - } - - @Override - public int damageRoll() { - return Random.NormalIntRange(Statistics.albinoPiranhasKilled/2, 4 + Statistics.albinoPiranhasKilled); - } - - @Override - public int hitSkill(Char target) { - return 20 + Statistics.albinoPiranhasKilled; - } - - @Override - public int drRoll() { - return Statistics.albinoPiranhasKilled; - } - - @Override - public void die(Object cause) { - - super.die(cause); - - Statistics.albinoPiranhasKilled++; - GLog.w(Messages.get(Mob.class,"killcount",Statistics.albinoPiranhasKilled)); - - - explodeDew(pos); - if(Random.Int(105-Math.min(Statistics.albinoPiranhasKilled,100))==0){ - Dungeon.level.drop(new NutVegetable(), pos).sprite.drop(); - } - - if(Statistics.albinoPiranhasKilled == 25) { - Dungeon.limitedDrops.conchshell.drop(); - Dungeon.level.drop(new ConchShell(), pos).sprite.drop(); - } - - if(Statistics.albinoPiranhasKilled == 50) { - Dungeon.level.drop(new ScrollOfSacrifice(), pos).sprite.drop(); - } - - if(Statistics.albinoPiranhasKilled == 100) { - Dungeon.level.drop(new CaveReward(), pos).sprite.drop(); - } - - if (Statistics.goldThievesKilled>99 && Statistics.skeletonsKilled>99 - && Statistics.albinoPiranhasKilled == 100 && Statistics.archersKilled>99){ - Dungeon.level.drop(new GoldenNut(), pos).sprite.drop(); - } - - - - - } - - @Override - public boolean reset() { - return true; - } - - @Override - protected boolean getCloser(int target) { - - if (rooted) { - return false; - } - - int step = Dungeon.findPath(this, pos, target, Level.water, - Level.fieldOfView); - if (step != -1) { - move(step); - return true; - } else { - return false; - } - } - - @Override - protected boolean getFurther(int target) { - int step = Dungeon.flee(this, pos, target, Level.water, - Level.fieldOfView); - if (step != -1) { - move(step); - return true; - } else { - return false; - } - } - - private static final HashSet> IMMUNITIES = new HashSet>(); - static { - IMMUNITIES.add(Burning.class); - IMMUNITIES.add(Paralysis.class); - IMMUNITIES.add(ToxicGas.class); - IMMUNITIES.add(Roots.class); - IMMUNITIES.add(Frost.class); - IMMUNITIES.add(Corruption.class); - } - - @Override - public HashSet> immunities() { - return IMMUNITIES; - } -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/Assassin.java b/java/com/hmdzl/spspd/change/actors/mobs/Assassin.java deleted file mode 100644 index 34a8beb8..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/Assassin.java +++ /dev/null @@ -1,131 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs; - -import java.util.HashSet; - -import com.hmdzl.spspd.change.Statistics; -import com.hmdzl.spspd.change.actors.buffs.Locked; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.items.StoneOre; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.ToxicGas; -import com.hmdzl.spspd.change.actors.buffs.Poison; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfPsionicBlast; -import com.hmdzl.spspd.change.items.weapon.enchantments.EnchantmentDark; -import com.hmdzl.spspd.change.items.weapon.melee.special.TekkoKagi; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.mechanics.Ballistica; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.AssassinSprite; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.utils.Random; - -public class Assassin extends Mob { - - protected static final float SPAWN_DELAY = 2f; - - { - spriteClass = AssassinSprite.class; - baseSpeed = 2f; - - HP = HT = 80+(5*Random.NormalIntRange(2, 5)); - EXP = 10; - maxLvl = 18; - evadeSkill = 15; - - loot = new StoneOre(); - lootChance = 0.2f; - - properties.add(Property.HUMAN); - - } - - - @Override - public int damageRoll() { - return Random.NormalIntRange(10, 23); - } - - @Override - public int hitSkill(Char target) { - return 25; - } - - @Override - public int drRoll() { - return Random.NormalIntRange(0, 5); - } - @Override - protected float attackDelay() { - return 0.75f; - } - - @Override - public void die(Object cause) { - - super.die(cause); - Statistics.assassinsKilled++; - GLog.w(Messages.get(Mob.class,"killcount", Statistics.assassinsKilled)); - - if (Statistics.assassinsKilled == 100){ - Dungeon.level.drop(new TekkoKagi(), pos).sprite.drop(); - } - } - - @Override - protected boolean canAttack(Char enemy) { - if (buff(Locked.class) != null){ - return Level.adjacent(pos, enemy.pos) && (!isCharmedBy(enemy)); - } else - return new Ballistica( pos, enemy.pos, Ballistica.PROJECTILE).collisionPos == enemy.pos; - } - - public static Assassin spawnAt(int pos) { - if (Level.passable[pos] && Actor.findChar(pos) == null) { - - Assassin w = new Assassin(); - w.pos = pos; - w.state = w.HUNTING; - GameScene.add(w, SPAWN_DELAY); - - //w.sprite.alpha(0); - //w.sprite.parent.add(new AlphaTweener(w.sprite, 1, 0.5f)); - - return w; - - } else { - return null; - } - } - - private static final HashSet> RESISTANCES = new HashSet>(); - static { - RESISTANCES.add(ToxicGas.class); - RESISTANCES.add(Poison.class); - RESISTANCES.add(EnchantmentDark.class); - - } - - @Override - public HashSet> resistances() { - return RESISTANCES; - } -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/Bandit.java b/java/com/hmdzl/spspd/change/actors/mobs/Bandit.java deleted file mode 100644 index 4c881a4b..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/Bandit.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs; - -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.buffs.Blindness; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Cripple; -import com.hmdzl.spspd.change.actors.buffs.Poison; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.sprites.BanditSprite; -import com.watabou.utils.Random; - -public class Bandit extends Thief { - - public Item item; - - { - spriteClass = BanditSprite.class; - - // 1 in 30 chance to be a crazy bandit, equates to overall 1/90 chance. - lootChance = 1f; - - properties.add(Property.ELF); - } - - @Override - public int attackProc(Char enemy, int damage) { - - Buff.prolong(enemy, Blindness.class, Random.Int(5, 12)); - Buff.affect(enemy, Poison.class).set( - Random.Int(5, 7) * Poison.durationFactor(enemy)); - Buff.prolong(enemy, Cripple.class, Cripple.DURATION); - Dungeon.observe(); - - return damage; - } - - @Override - public void die(Object cause) { - super.die(cause); - Badges.validateRare(this); - } -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/BanditKing.java b/java/com/hmdzl/spspd/change/actors/mobs/BanditKing.java deleted file mode 100644 index 61c033f4..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/BanditKing.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs; - -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Blindness; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.CountDown; -import com.hmdzl.spspd.change.actors.buffs.Cripple; -import com.hmdzl.spspd.change.actors.buffs.Poison; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.weapon.melee.special.Spork; -import com.hmdzl.spspd.change.sprites.BanditKingSprite; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.utils.Random; - -public class BanditKing extends Mob { - - public Item item; - - { - spriteClass = BanditKingSprite.class; - HP = HT = 300; - EXP = 10; - maxLvl = 25; - flying = true; - - // 1 in 30 chance to be a crazy bandit, equates to overall 1/90 chance. - lootChance = 0.2f; - evadeSkill = 20; //20 - if (Dungeon.depth<25){Dungeon.sporkAvail = false;} - - properties.add(Property.ELF); - properties.add(Property.MINIBOSS); - } - - @Override - public int drRoll() { - return Random.NormalIntRange(10, 20); - } - - @Override - public float speed() { - return 2f; - } - - @Override - public int attackProc(Char enemy, int damage) { - if(enemy.buff(CountDown.class) == null){ - Buff.affect(enemy, CountDown.class); - state = FLEEING; - } - - return damage; - } - - @Override - public void die(Object cause) { - super.die(cause); - if (Dungeon.depth<25){ - yell(Messages.get(this, "die")); - GLog.n(Messages.get(this, "dis")); - if (!Dungeon.limitedDrops.spork.dropped()) { - Dungeon.level.drop(new Spork(), pos).sprite.drop(); - Dungeon.limitedDrops.spork.drop(); - Dungeon.sporkAvail = false; - yell(Messages.get(this, "spork")); - } - } - } -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/Bat.java b/java/com/hmdzl/spspd/change/actors/mobs/Bat.java deleted file mode 100644 index e51849c4..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/Bat.java +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs; - -import java.util.HashSet; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.food.meatfood.Meat; -import com.hmdzl.spspd.change.items.potions.PotionOfMending; - -import com.hmdzl.spspd.change.sprites.BatSprite; -import com.watabou.utils.Random; - -public class Bat extends Mob { - - { - spriteClass = BatSprite.class; - - HP = HT = 80+(adj(0)*Random.NormalIntRange(2, 5)); - evadeSkill = 15+adj(0); - baseSpeed = 2f; - - EXP = 9; - maxLvl = 25; - - flying = true; - - loot = new PotionOfMending(); - lootChance = 0.1667f; // by default, see die() - - lootOther = new Meat(); - lootChanceOther = 0.5f; // by default, see die() - - properties.add(Property.BEAST); - } - - @Override - public int damageRoll() { - return Random.NormalIntRange(15, 22+adj(0)); - } - - @Override - public int hitSkill(Char target) { - return 16+adj(0); - } - - @Override - public int drRoll() { - return adj(0); - } - - @Override - public int attackProc(Char enemy, int damage) { - - int reg = Math.min(damage, HT - HP); - - if (reg > 0) { - HP += reg; - sprite.emitter().burst(Speck.factory(Speck.HEALING), 1); - } - - return damage; - } - - @Override - public void die(Object cause) { - super.die(cause); - lootChance = 1f / 6 ; - - } - - @Override - protected Item createLoot() { - return super.createLoot(); - } - - private static final HashSet> RESISTANCES = new HashSet>(); - static { - - } - - @Override - public HashSet> resistances() { - return RESISTANCES; - } -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/Bestiary.java b/java/com/hmdzl/spspd/change/actors/mobs/Bestiary.java deleted file mode 100644 index 8041576f..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/Bestiary.java +++ /dev/null @@ -1,339 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.watabou.utils.Random; - -public class Bestiary { - - public static Mob mob(int depth) { - @SuppressWarnings("unchecked") - Class cl = (Class) mobClass(depth); - try { - return cl.newInstance(); - } catch (Exception e) { - return null; - } - } - - public static Mob mutable(int depth) { - @SuppressWarnings("unchecked") - Class cl = (Class) mobClass(depth); - - if (Random.Int(30) == 0) { - if (cl == Rat.class) { - cl = Albino.class; - } else if (cl == Thief.class) { - cl = Bandit.class; - } else if (cl == Brute.class) { - cl = Shielded.class; - } else if (cl == Monk.class) { - cl = Senior.class; - } else if (cl == Scorpio.class) { - cl = Acidic.class; - } - } - - try { - return cl.newInstance(); - } catch (Exception e) { - return null; - } - } - - private static Class mobClass(int depth) { - - float[] chances; - Class[] classes; - - - switch (depth) { - case 1: - chances = new float[]{1, 1, 0.02f}; - classes = new Class[]{Rat.class, BrownBat.class, - RatBoss.class}; - break; - case 2: - chances = new float[]{1, 1, 0.7f, 0.5f}; - classes = new Class[]{Rat.class, BrownBat.class, - DustElement.class, LiveMoss.class}; - break; - case 3: - chances = new float[]{1, 1, 0.8f, 0.6f, 0.4f, 0.2f, 0.7f }; - classes = new Class[]{ - Rat.class, BrownBat.class, - DustElement.class, LiveMoss.class, - Swarm.class, Crab.class,PatrolUAV.class}; - break; - case 4: - chances = new float[]{1, 1, 0.9f, 0.7f, 0.5f, 0.3f, 0.02f, 0.02f,0.7f}; - classes = new Class[]{Rat.class, BrownBat.class, - DustElement.class, LiveMoss.class, - Swarm.class, Crab.class, - Gnoll.class, Thief.class,PatrolUAV.class}; - break; - case 5: - if (Random.Int(3) == 1) { - chances = new float[]{ 1 }; - classes = new Class[]{Goo.class}; - } else if (Random.Int(2) == 1) { - chances = new float[]{ 1 }; - classes = new Class[]{SewerHeart.class}; - } else { - chances = new float[]{ 1 }; - classes = new Class[]{PlagueDoctor.class}; - } - break; - - case 6: - chances = new float[]{0.8f, 0.8f, 1, 1,0.5f}; - classes = new Class[]{Swarm.class, Crab.class, - Thief.class, Gnoll.class,PatrolUAV.class}; - break; - case 7: - chances = new float[]{0.6f, 1, 1, 0.4f,0.2f}; - classes = new Class[]{Crab.class, - Thief.class, Gnoll.class, - Guard.class, Zombie.class}; - break; - case 8: - chances = new float[]{1, 1, 0.5f, 0.4f, 0.3f,0.7f,0.5f}; - classes = new Class[]{Thief.class, Gnoll.class, - Guard.class, Assassin.class, TrollWarrior.class, Zombie.class,FireRabbit.class}; - break; - case 9: - if (Dungeon.sporkAvail) { - chances = new float[]{1, 1, 0.1f,1}; - classes = new Class[]{Assassin.class, TrollWarrior.class, BanditKing.class, Zombie.class}; - } else { - chances = new float[]{1, 1, 0.8f, 0.6f, 0.5f, 0.02f, 0.01f,1f,0.8f}; - classes = new Class[]{Thief.class, Gnoll.class, - Guard.class, Assassin.class, TrollWarrior.class, - Bat.class, Brute.class, Zombie.class,FireRabbit.class}; - } - break; - - case 10: - if (Random.Int(3) == 1){ - chances = new float[]{ 1 }; - classes = new Class[]{Tengu.class}; - }else if (Random.Int(2) == 1){ - //}else{ - chances = new float[]{ 1 }; - classes = new Class[]{PrisonWander.class}; - }else{ - chances = new float[] { 1 }; - classes = new Class[] { Tank.class }; - } - break; - - case 11: - chances = new float[] { 0.8f, 0.6f, 1, 0.7f, 0.5f,0.5f }; - classes = new Class[] { Assassin.class, TrollWarrior.class, - Bat.class, Skeleton.class,Brute.class,FireRabbit.class }; - break; - case 12: - chances = new float[] { 1, 0.9f, 0.7f, 0.5f, 0.3f ,0.9f }; - classes = new Class[] { Bat.class, Skeleton.class, Brute.class, - GnollShaman.class,Spinner.class,SandMob.class }; - break; - case 13: - chances = new float[] { 1, 1, 0.9f, 0.7f, 0.6f, 0.7f,0.4f, 0.02f }; - classes = new Class[] { Bat.class, Skeleton.class, Brute.class, - GnollShaman.class,Spinner.class, BrokenRobot.class,SandMob.class, - FireElemental.class }; - break; - case 14: - chances = new float[] { 1, 1, 1, 0.9f,0.8f,0.6f,0.6f,0.04f, 0.02f }; - classes = new Class[] { Bat.class, Skeleton.class, Brute.class, - GnollShaman.class,Spinner.class, BrokenRobot.class,SandMob.class, - FireElemental.class, Monk.class}; - break; - - case 15: - if (Random.Int(3) ==1) { - chances = new float[]{ 1 }; - classes = new Class[] { Hybrid.class }; - } else if (Random.Int(2) == 1){ - chances = new float[]{ 1 }; - classes = new Class[] { DM300.class }; - } else { - chances = new float[]{ 1 }; - classes = new Class[]{SpiderQueen.class}; - } - break; - - case 16: - chances = new float[] { 0.8f, 0.6f, 1, 1, 0.4f }; - classes = new Class[] { GnollShaman.class,BrokenRobot.class, - FireElemental.class, Warlock.class, Monk.class }; - break; - case 17: - chances = new float[] { 1, 1, 0.8f, 0.4f,0.4f ,0.2f }; - classes = new Class[] { FireElemental.class, Warlock.class,Monk.class, - Golem.class,SpiderBot.class, Musketeer.class}; - break; - case 18: - chances = new float[] { 1, 1, 1, 0.8f,0.8f, 0.6f, 0.2f,0.1f }; - classes = new Class[] { FireElemental.class, Warlock.class,Monk.class, - Golem.class, SpiderBot.class,Musketeer.class, DwarfLich.class,ManySkeleton.class }; - break; - case 19: - - chances = new float[] { 1, 1, 1, 1, 1,0.8f, 0.6f, 0.02f,0.3f }; - classes = new Class[] { FireElemental.class, Warlock.class,Monk.class, - Golem.class, SpiderBot.class,Musketeer.class, DwarfLich.class, - Succubus.class,ManySkeleton.class}; - break; - case 20: - if (Random.Int(3) ==1) { - chances = new float[]{ 1 }; - classes = new Class[] { LichDancer.class }; - } else if (Random.Int(2) == 1){ - chances = new float[]{ 1 }; - classes = new Class[] { ElderAvatar.class }; - } else { - chances = new float[] { 1 }; - classes = new Class[] { King.class }; - } - - break; - - case 22: - chances = new float[] { 0.8f,0.8f, 1, 1, 1, 0.2f, 0.2f }; - classes = new Class[] {Musketeer.class, DwarfLich.class, - Succubus.class, Eye.class, DemonGoo.class, DemonFlower.class, Sufferer.class}; - break; - case 23: - chances = new float[] { 1, 1, 1, 0.5f,0.5f, 0.5f,0.5f }; - classes = new Class[] { Succubus.class, Eye.class, DemonGoo.class, - Scorpio.class,ThiefImp.class , DemonFlower.class, Sufferer.class}; - break; - case 24: - chances = new float[] { 1, 1, 1, 1, 1, 1, 1 }; - classes = new Class[] {Succubus.class, Eye.class, DemonGoo.class, - Scorpio.class,ThiefImp.class, DemonFlower.class, Sufferer.class - }; - break; - - case 25: - chances = new float[] { 1 }; - classes = new Class[] { Yog.class }; - break; - - case 27: - chances = new float[] { 1, 0.05f,0.1f }; - classes = new Class[] { GnollArcher.class, ForestProtector.class,Brute.class }; - break; - case 28: - chances = new float[] { 1, 0.05f,0.1f }; - classes = new Class[] { MossySkeleton.class, GraveProtector.class,ManySkeleton.class}; - break; - case 29: - chances = new float[] { 1, 0.05f,0.1f }; - classes = new Class[] { AlbinoPiranha.class, FishProtector.class,Crab.class }; - break; - case 30: - chances = new float[] { 1, 0.05f,0.1f }; - classes = new Class[] { GoldThief.class, VaultProtector.class,Succubus.class}; - break; - - case 31: - chances = new float[] { 1, 0.1f }; - classes = new Class[] { BlueWraith.class, DwarfLich.class}; - break; - - case 32: - chances = new float[] { 1,0.05f }; - classes = new Class[] { Orc.class, GoldOrc.class}; - break; - case 33: - chances = new float[] { 1, 0.2f }; - classes = new Class[] { FlyingProtector.class, FireElemental.class }; - break; - case 35: - chances = new float[] {1, 1 }; - classes = new Class[] {GoldOrc.class, Fiend.class }; - break; - case 36: - chances = new float[] {1}; - classes = new Class[] {TenguDen.class}; - break; - case 41: - chances = new float[] {1}; - classes = new Class[] {BanditKing.class}; - break; - case 71: - chances = new float[] {1}; - classes = new Class[] {Dragonking.class}; - break; - case 85: - chances = new float[] { - 1,1, - 1,1, - 1,1,1, - 1,1, - 1,1,1,1, - 1,1,1, - 1,1,1,1, - 1,1,1, - 1,1,1,1, - 1, - 1,1, - 1,1}; - classes = new Class[] { - Rat.class, BrownBat.class, - DustElement.class, LiveMoss.class, - Swarm.class, Crab.class,PatrolUAV.class, - Thief.class, Gnoll.class, - Guard.class, Assassin.class, TrollWarrior.class, Zombie.class, - Bat.class, Skeleton.class, Brute.class, - GnollShaman.class,Spinner.class, BrokenRobot.class,SandMob.class, - FireElemental.class, Warlock.class,Monk.class, - Golem.class, SpiderBot.class,Musketeer.class, DwarfLich.class, - Succubus.class, Eye.class, DemonGoo.class, - Scorpio.class,ThiefImp.class, DemonFlower.class, Sufferer.class, - BlueWraith.class, - Orc.class,FlyingProtector.class, - GoldOrc.class, Fiend.class }; - break; - - default: - chances = new float[] { 1 }; - classes = new Class[] { Eye.class }; - } - - - - return classes[Random.chances(chances)]; - } - - public static boolean isUnique(Char mob) { - return mob instanceof Goo - || mob instanceof Tengu - || mob instanceof DM300 - || mob instanceof King - || mob instanceof Yog.BurningFist - || mob instanceof Yog.RottingFist - || mob instanceof FetidRat - || mob instanceof GnollTrickster - || mob instanceof GreatCrab; - } -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/BlueCat.java b/java/com/hmdzl/spspd/change/actors/mobs/BlueCat.java deleted file mode 100644 index 31b8f56a..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/BlueCat.java +++ /dev/null @@ -1,172 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Terror; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.items.Amulet; -import com.hmdzl.spspd.change.items.Generator; -import com.hmdzl.spspd.change.items.Gold; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.artifacts.MasterThievesArmband; -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.hmdzl.spspd.change.sprites.BanditKingSprite; -import com.hmdzl.spspd.change.utils.GLog; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -public class BlueCat extends Mob { - - protected static final String TXT_STOLE = "%s stole %s from you!"; - protected static final String TXT_CARRIES = "\n\n%s is carrying a _%s_. Stolen obviously."; - protected static final String TXT_RATCHECK1 = "Spork is avail"; - protected static final String TXT_RATCHECK2 = "Spork is not avail"; - - public Item item; - - { - spriteClass = BanditKingSprite.class; - - HP = HT = 20+(adj(0)*Random.NormalIntRange(3, 5)); - evadeSkill = 8+adj(0); - - EXP = 5; - - loot = new MasterThievesArmband().identify(); - lootChance = 0.01f; - - lootOther = Generator.Category.BERRY; - lootChanceOther = 1f; // by default, see die() - - FLEEING = new Fleeing(); - - properties.add(Property.ELF); - } - - private static final String ITEM = "item"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(ITEM, item); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - item = (Item) bundle.get(ITEM); - } - - @Override - public int damageRoll() { - return Random.NormalIntRange(1, 7+adj(0)); - } - - @Override - protected float attackDelay() { - return 0.5f; - } - - @Override - public void die(Object cause) { - - super.die(cause); - - if (item != null) { - Dungeon.level.drop(item, pos).sprite.drop(); - } - } - - @Override - protected Item createLoot() { - return new Gold(Random.NormalIntRange(100, 250)); - } - - @Override - public int hitSkill(Char target) { - return 120; - } - - @Override - public int drRoll() { - return 3; - } - - @Override - public int attackProc(Char enemy, int damage) { - if (item == null && enemy instanceof Hero && steal((Hero) enemy)) { - state = FLEEING; - } - - return damage; - } - - @Override - public int defenseProc(Char enemy, int damage) { - if (state == FLEEING) { - Dungeon.level.drop(new Gold(), pos).sprite.drop(); - } - - return damage; - } - - protected boolean steal(Hero hero) { - - Amulet item = hero.belongings.getItem(Amulet.class); - if (item != null) { - - item.updateQuickslot(); - - GLog.w(Messages.get(BlueCat.class, "stole", item.name()) ); - - this.item = item; - item.detachAll(hero.belongings.backpack); - - - return true; - } else { - return false; - } - } - - @Override - public String description() { - String desc = super.description(); - - if (item != null) { - desc += Messages.get(this, "carries", item.name() ); - } - - return desc; - } - - private class Fleeing extends Mob.Fleeing { - @Override - protected void nowhereToRun() { - if (buff(Terror.class) == null) { - sprite.showStatus(CharSprite.NEGATIVE, Messages.get(Mob.class, "rage")); - state = HUNTING; - } else { - super.nowhereToRun(); - } - } - } -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/BlueWraith.java b/java/com/hmdzl/spspd/change/actors/mobs/BlueWraith.java deleted file mode 100644 index 9b7a42a6..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/BlueWraith.java +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs; - -import com.hmdzl.spspd.change.items.Generator; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Terror; -import com.hmdzl.spspd.change.actors.buffs.Vertigo; -import com.hmdzl.spspd.change.effects.particles.ShadowParticle; -import com.hmdzl.spspd.change.items.RedDewdrop; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.BlueWraithSprite; -import com.watabou.noosa.tweeners.AlphaTweener; -import com.watabou.utils.Random; - -public class BlueWraith extends Wraith { - - { - spriteClass = BlueWraithSprite.class; - - HP = HT = 250; - evadeSkill = 24; - baseSpeed = 2f; - - EXP = 20; - - loot = Generator.random(Generator.Category.SEED); - lootChance = 1.0f; // by default, see die() - - properties.add(Property.UNDEAD); - - } - - @Override - public int attackProc(Char enemy, int damage) { - if (Random.Int(10) == 0) { - Buff.affect(enemy, Vertigo.class, Vertigo.duration(enemy)); - Buff.affect(enemy, Terror.class, Terror.DURATION).object = enemy.id(); - } - - return damage; - } - - @Override - public void adjustStats(int level) { - this.level = level; - evadeSkill = 24; - enemySeen = true; - } - - @Override - public int damageRoll() { - return Random.NormalIntRange(20, 90); - } - - @Override - public int hitSkill(Char target) { - return 46; - } - - @Override - public int drRoll() { - return Random.NormalIntRange(10, 25); - } - - @Override - protected boolean canAttack(Char enemy) { - return Dungeon.level.distance( pos, enemy.pos ) <= 2 ; - } - - public static BlueWraith spawnAt(int pos) { - - BlueWraith b = new BlueWraith(); - b.adjustStats(Dungeon.depth); - b.pos = pos; - b.state = b.HUNTING; - GameScene.add(b, SPAWN_DELAY); - - b.sprite.alpha(0); - b.sprite.parent.add(new AlphaTweener(b.sprite, 1, 0.5f)); - - b.sprite.emitter().burst(ShadowParticle.CURSE, 5); - - return b; - - - } - -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/BrokenRobot.java b/java/com/hmdzl/spspd/change/actors/mobs/BrokenRobot.java deleted file mode 100644 index afe4fe7e..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/BrokenRobot.java +++ /dev/null @@ -1,273 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs; - -import java.util.HashSet; - -import com.hmdzl.spspd.change.items.StoneOre; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.ResultDescriptions; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.ToxicGas; -import com.hmdzl.spspd.change.actors.blobs.Blob; -import com.hmdzl.spspd.change.actors.blobs.Fire; -import com.hmdzl.spspd.change.actors.blobs.TarGas; -import com.hmdzl.spspd.change.actors.buffs.Light; -import com.hmdzl.spspd.change.actors.buffs.Terror; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.particles.BlastParticle; -import com.hmdzl.spspd.change.effects.particles.PurpleParticle; -import com.hmdzl.spspd.change.effects.particles.SmokeParticle; -import com.hmdzl.spspd.change.items.Heap; -import com.hmdzl.spspd.change.items.RedDewdrop; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfRecharging; -import com.hmdzl.spspd.change.items.weapon.enchantments.EnchantmentDark; - -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.Terrain; -import com.hmdzl.spspd.change.mechanics.Ballistica; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.BrokenRobotSprite; -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.hmdzl.spspd.change.utils.GLog; - -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Random; - -public class BrokenRobot extends Mob { - - private static final String TXT_DEATHGAZE_KILLED = "%s's deathray killed you..."; - private static final float SPAWN_DELAY = 2f; - - { - spriteClass = BrokenRobotSprite.class; - - HP = HT = 120+(adj(0)*Random.NormalIntRange(4, 7)); - evadeSkill = 20+adj(1); - viewDistance = Light.DISTANCE; - - EXP = 13; - maxLvl = 25; - - - lootOther = new StoneOre(); - lootChanceOther = 0.25f; - - loot = new ScrollOfRecharging(); - lootChance = 0.25f; // by default, see die() - - properties.add(Property.MECH); - } - - private Ballistica beam; - - @Override - public int drRoll() { - return Random.NormalIntRange(0, 5); - } - - @Override - public boolean act() { - GameScene.add(Blob.seed(pos,30, TarGas.class)); - if(enemySeen){ - switch (Random.Int(50)) { - case 1: - GLog.n(Messages.get(this,"explode") ); - explode(pos); - if (HP<1){destroy();} - break; - } - } - - return super.act(); - } - - - - @Override - protected boolean canAttack(Char enemy) { - - beam = new Ballistica( pos, enemy.pos, Ballistica.STOP_TERRAIN); - - return beam.subPath(1, beam.dist).contains(enemy.pos); - } - - @Override - public int hitSkill(Char target) { - return 20+adj(0); - } - - @Override - protected float attackDelay() { - return 3f; - } - - @Override - protected boolean doAttack(Char enemy) { - - spend(attackDelay()); - - boolean rayVisible = false; - - for (int i : beam.subPath(0, beam.dist)) { - if (Dungeon.visible[i]) { - rayVisible = true; - } - } - - if (rayVisible) { - sprite.attack(beam.collisionPos); - return false; - } else { - attack(enemy); - return true; - } - } - - @Override - public boolean attack(Char enemy) { - - for (int pos : beam.subPath(1, beam.dist)) { - - Char ch = Actor.findChar( pos ); - if (ch == null) { - continue; - } - - if (hit(this, ch, true)) { - ch.damage(Random.NormalIntRange(2, 8+adj(0)), this); - - if (Dungeon.visible[pos]) { - ch.sprite.flash(); - CellEmitter.center(pos).burst(PurpleParticle.BURST, - Random.IntRange(1, 2)); - } - - if (!ch.isAlive() && ch == Dungeon.hero) { - Dungeon.fail(Messages.format(ResultDescriptions.MOB)); - //GLog.n(Messages.get(this, "kill")); - } - } else { - ch.sprite.showStatus(CharSprite.NEUTRAL, ch.defenseVerb()); - } - } - - return true; - } - - public static void spawnAround(int pos) { - for (int n : Level.NEIGHBOURS4) { - int cell = pos + n; - if (Level.passable[cell] && Actor.findChar(cell) == null) { - spawnAt(cell); - } - } - } - - public static BrokenRobot spawnAt(int pos) { - - BrokenRobot b = new BrokenRobot(); - - b.pos = pos; - b.state = b.HUNTING; - GameScene.add(b, SPAWN_DELAY); - - return b; - - } - - - public void explode(int cell) { - // We're blowing up, so no need for a fuse anymore. - - Sample.INSTANCE.play(Assets.SND_BLAST, 2); - - if (Dungeon.visible[cell]) { - CellEmitter.center(cell).burst(BlastParticle.FACTORY, 30); - } - - boolean terrainAffected = false; - for (int n : Level.NEIGHBOURS9) { - int c = cell + n; - if (c >= 0 && c < Level.getLength()) { - if (Dungeon.visible[c]) { - CellEmitter.get(c).burst(SmokeParticle.FACTORY, 4); - } - - if (Level.flamable[c]) { - Level.set(c, Terrain.EMBERS); - GameScene.updateMap(c); - terrainAffected = true; - } - - // destroys items / triggers bombs caught in the blast. - Heap heap = Dungeon.level.heaps.get(c); - if (heap != null) - heap.explode(); - - Char ch = Actor.findChar(c); - if (ch != null) { - // those not at the center of the blast take damage less - // consistently. - int minDamage = c == cell ? Dungeon.depth + 5 : 1; - int maxDamage = 10 + Dungeon.depth * 2; - - int dmg = Random.NormalIntRange(minDamage, maxDamage) - - Math.max(ch.drRoll(),0); - if (dmg > 0) { - ch.damage(dmg, this); - } - - if (ch == this && HP<1){ - die(this); - } - } - } - } - - if (terrainAffected) { - Dungeon.observe(); - } - } - - private static final HashSet> RESISTANCES = new HashSet>(); - static { - RESISTANCES.add(EnchantmentDark.class); - - } - - @Override - public HashSet> resistances() { - return RESISTANCES; - } - - private static final HashSet> IMMUNITIES = new HashSet>(); - static { - IMMUNITIES.add(Terror.class); - IMMUNITIES.add(ToxicGas.class); - } - - @Override - public HashSet> immunities() { - return IMMUNITIES; - } -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/BrownBat.java b/java/com/hmdzl/spspd/change/actors/mobs/BrownBat.java deleted file mode 100644 index 9c0d9bc7..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/BrownBat.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.items.Generator; -import com.hmdzl.spspd.change.items.food.meatfood.Meat; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.BrownBatSprite; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.utils.Random; - -public class BrownBat extends Mob { - - { - spriteClass = BrownBatSprite.class; - - HP = HT = 20; - evadeSkill = 1; - baseSpeed = 2f; - - EXP = 1; - maxLvl = 6; - - flying = true; - - loot = new Meat(); - lootChance = 0.5f; // by default, see die() - - lootOther = Generator.Category.BERRY; - lootChanceOther = 0.05f; // by default, see die() - - properties.add(Property.BEAST); - - } - - @Override - public int damageRoll() { - return Random.NormalIntRange(1, 4); - } - - @Override - public int hitSkill(Char target) { - return 5+Dungeon.depth; - } - - - @Override - public int drRoll() { - return 1; - } - - @Override - public void die(Object cause) { - super.die(cause); - - if (Random.Int(5) == 0) { - for (Mob mob : Dungeon.level.mobs.toArray(new Mob[0])) { - if (Random.Int(2) == 0 && enemy!=null){mob.beckon(enemy.pos);} - } - GLog.w(Messages.get(this,"die")); - } - - - } - -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/Brute.java b/java/com/hmdzl/spspd/change/actors/mobs/Brute.java deleted file mode 100644 index d7912eb2..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/Brute.java +++ /dev/null @@ -1,118 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs; - -import java.util.HashSet; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.DefenceUp; -import com.hmdzl.spspd.change.actors.buffs.Locked; -import com.hmdzl.spspd.change.actors.buffs.Terror; -import com.hmdzl.spspd.change.items.Gold; -import com.hmdzl.spspd.change.items.Generator; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.BruteSprite; -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -public class Brute extends Mob { - - private static final String TXT_ENRAGED = "%s becomes enraged!"; - - { - spriteClass = BruteSprite.class; - - HP = HT = 120+(adj(0)*Random.NormalIntRange(4, 8)); - evadeSkill = 15+adj(0); - - EXP = 8; - maxLvl = 25; - - loot = Gold.class; - lootChance = 0.5f; - - lootOther = Generator.random(Generator.Category.RANGEWEAPON); - lootChanceOther = 0.5f; // by default, see die() - - properties.add(Property.GNOLL); - } - - private boolean enraged = false; - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - enraged = HP < HT / 4; - } - - @Override - public int damageRoll() { - return enraged ? Random.NormalIntRange(25+adj(0), 60+adj(0)) : Random.NormalIntRange(10+adj(0), 35+adj(0)); - } - - @Override - public int hitSkill(Char target) { - return 20+adj(1); - } - - @Override - protected float attackDelay() { - return 1.2f; - } - @Override - public int drRoll() { - return Random.NormalIntRange(0, 10); - } - - @Override - public void damage(int dmg, Object src) { - super.damage(dmg, src); - - if (isAlive() && !enraged && HP < HT / 4) { - enraged = true; - Buff.affect(this,DefenceUp.class,5f).level(70); - spend(TICK); - if (Dungeon.visible[pos]) { - GLog.w(Messages.get(this, "enraged")); - sprite.showStatus(CharSprite.NEGATIVE, "enraged"); - } - } - } - - /*@Override - protected boolean canAttack(Char enemy) {if (buff(Locked.class) != null){ - return Level.adjacent(pos, enemy.pos) && (!isCharmedBy(enemy)); - } else - return Dungeon.level.distance( pos, enemy.pos ) <= 2 ; - } */ - - private static final HashSet> IMMUNITIES = new HashSet>(); - static { - IMMUNITIES.add(Terror.class); - } - - @Override - public HashSet> immunities() { - return IMMUNITIES; - } -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/Crab.java b/java/com/hmdzl/spspd/change/actors/mobs/Crab.java deleted file mode 100644 index e6d8d7cf..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/Crab.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs; - -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.items.food.meatfood.MysteryMeat; -import com.hmdzl.spspd.change.sprites.CrabSprite; -import com.watabou.utils.Random; - -public class Crab extends Mob { - - { - spriteClass = CrabSprite.class; - - HP = HT = 50+(adj(0)*Random.NormalIntRange(1, 3)); - evadeSkill = 5+adj(1); - baseSpeed = 2f; - - EXP = 3; - maxLvl = 9; - - loot = new MysteryMeat(); - lootChance = 0.5f; - - properties.add(Property.BEAST); - } - - @Override - public int damageRoll() { - return Random.NormalIntRange(3, 6+adj(0)); - } - - @Override - public int hitSkill(Char target) { - return 12+adj(0); - } - - @Override - public int drRoll() { - return Random.NormalIntRange(0, 4); - } - -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/CrabKing.java b/java/com/hmdzl/spspd/change/actors/mobs/CrabKing.java deleted file mode 100644 index e71177c7..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/CrabKing.java +++ /dev/null @@ -1,174 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs; - -import java.util.HashSet; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.ToxicGas; -import com.hmdzl.spspd.change.actors.buffs.Locked; -import com.hmdzl.spspd.change.actors.buffs.Poison; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.AdamantArmor; -import com.hmdzl.spspd.change.items.Gold; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfPsionicBlast; -import com.hmdzl.spspd.change.items.weapon.enchantments.EnchantmentDark; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.mechanics.Ballistica; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.CrabKingSprite; -import com.hmdzl.spspd.change.utils.GLog; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Random; - -public class CrabKing extends Mob { - - private static final int JUMP_DELAY = 5; - - { - spriteClass = CrabKingSprite.class; - baseSpeed = 2f; - - HP = HT = 1300; - EXP = 20; - evadeSkill = 30; - - properties.add(Property.BEAST); - properties.add(Property.BOSS); - } - - private int timeToJump = JUMP_DELAY; - - - @Override - public int damageRoll() { - return Random.NormalIntRange(20, 50); - } - - @Override - public int hitSkill(Char target) { - return 35; - } - - @Override - public int drRoll() { - return Random.NormalIntRange(5, 10); - } - - @Override - protected boolean act() { - boolean result = super.act(); - - - if (HP < HT) { - sprite.emitter().burst( Speck.factory( Speck.HEALING ), 1 ); - HP = HP + 10; - GLog.n(Messages.get(this,"heal")); - } - return result; - } - - @Override - public void die(Object cause) { - - super.die(cause); - - GameScene.bossSlain(); - - Dungeon.level.drop(new Gold(Random.Int(1900, 4000)), pos).sprite.drop(); - Dungeon.level.drop(new AdamantArmor(), pos).sprite.drop(); - Dungeon.crabkingkilled=true; - - yell(Messages.get(this,"die")); - - } - - @Override - protected boolean getCloser(int target) { - if (Level.fieldOfView[target]) { - jump(); - return true; - } else { - return super.getCloser(target); - } - } - - @Override - protected boolean canAttack(Char enemy) { - if (buff(Locked.class) != null){ - return Level.adjacent(pos, enemy.pos) && (!isCharmedBy(enemy)); - } else - return new Ballistica( pos, enemy.pos, Ballistica.PROJECTILE).collisionPos == enemy.pos; - } - - @Override - protected boolean doAttack(Char enemy) { - timeToJump--; - if (timeToJump <= 0 && Level.adjacent(pos, enemy.pos)) { - jump(); - return true; - } else { - return super.doAttack(enemy); - } - } - - private void jump() { - timeToJump = JUMP_DELAY; - - int newPos; - do { - newPos = Random.Int(Level.getLength()); - } while (!Level.fieldOfView[newPos] || !Level.passable[newPos] - || Level.adjacent(newPos, enemy.pos) - || Actor.findChar(newPos) != null); - - sprite.move(pos, newPos); - move(newPos); - - if (Dungeon.visible[newPos]) { - CellEmitter.get(newPos).burst(Speck.factory(Speck.WOOL), 6); - Sample.INSTANCE.play(Assets.SND_PUFF); - } - - spend(1 / speed()); - } - - @Override - public void notice() { - super.notice(); - yell(Messages.get(this,"notice")); - } - - private static final HashSet> RESISTANCES = new HashSet>(); - static { - RESISTANCES.add(ToxicGas.class); - RESISTANCES.add(Poison.class); - RESISTANCES.add(EnchantmentDark.class); - - } - - @Override - public HashSet> resistances() { - return RESISTANCES; - } -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/DM300.java b/java/com/hmdzl/spspd/change/actors/mobs/DM300.java deleted file mode 100644 index 80f178d8..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/DM300.java +++ /dev/null @@ -1,445 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs; - -import java.util.HashSet; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.Badges.Badge; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.Blob; -import com.hmdzl.spspd.change.actors.blobs.ConfusionGas; -import com.hmdzl.spspd.change.actors.blobs.ToxicGas; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Paralysis; -import com.hmdzl.spspd.change.actors.buffs.Terror; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.effects.particles.BlastParticle; -import com.hmdzl.spspd.change.effects.particles.ElmoParticle; -import com.hmdzl.spspd.change.effects.particles.SmokeParticle; -import com.hmdzl.spspd.change.effects.particles.SparkParticle; -import com.hmdzl.spspd.change.items.Generator; -import com.hmdzl.spspd.change.items.Gold; -import com.hmdzl.spspd.change.items.RedDewdrop; -import com.hmdzl.spspd.change.items.StoneOre; -import com.hmdzl.spspd.change.items.TomeOfMastery; -import com.hmdzl.spspd.change.items.artifacts.CapeOfThorns; -import com.hmdzl.spspd.change.levels.CavesBossLevel; -import com.hmdzl.spspd.change.levels.traps.LightningTrap; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.items.journalpages.Sokoban3; -import com.hmdzl.spspd.change.items.keys.SkeletonKey; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfPsionicBlast; -import com.hmdzl.spspd.change.items.weapon.enchantments.EnchantmentDark; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.Terrain; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.DM300Sprite; -import com.hmdzl.spspd.change.sprites.TowerSprite; -import com.hmdzl.spspd.change.utils.GLog; - -import com.watabou.noosa.Camera; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Callback; -import com.watabou.utils.PathFinder; -import com.watabou.utils.Random; - -public class DM300 extends Mob implements Callback { - - private static final float TIME_TO_ZAP = 2f; - - { - spriteClass = DM300Sprite.class; - - HP = HT = 800; - EXP = 50; - evadeSkill = 24; - - loot = new CapeOfThorns().identify(); - lootChance = 0.2f; - - lootOther = Generator.Category.NORNSTONE; - lootChanceOther = 1f; - - properties.add(Property.MECH); - properties.add(Property.BOSS); - } - - private int bossAlive = 0; - private int towerAlive = 0; - - @Override - public int damageRoll() { - - return Random.NormalIntRange(15, 19)*towerAlive; - } - - @Override - public int hitSkill(Char target) { - return 35; - } - - @Override - public int drRoll() { - return Random.NormalIntRange(10, 10+(4*towerAlive)); - } - - public void spawnTower() { - Tower a = new Tower(); - Tower b = new Tower(); - - do { - a.pos = pos + PathFinder.NEIGHBOURS8[Random.Int( 8 )]; - b.pos = pos + PathFinder.NEIGHBOURS8[Random.Int( 8 )]; - } while (!Dungeon.level.passable[a.pos] || !Dungeon.level.passable[b.pos] || a.pos == b.pos); - - GameScene.add(a); - GameScene.add(b); - } - - @Override - public boolean act() { - - if (towerAlive < 1){ - spawnTower(); - towerAlive++; - } - - GameScene.add(Blob.seed(pos, 30, ToxicGas.class)); - - return super.act(); - } - - @Override - public void move(int step) { - super.move(step); - - if (Dungeon.level.map[step] == Terrain.INACTIVE_TRAP && HP < HT) { - - HP += Random.Int(1, HT - HP); - sprite.emitter().burst(ElmoParticle.FACTORY, 5); - - if (Dungeon.visible[step] && Dungeon.hero.isAlive()) { - GLog.n(Messages.get(this,"heal")); - } - } - - int[] cells = { step - 1, step + 1, step - Level.getWidth(), - step + Level.getWidth(), step - 1 - Level.getWidth(), - step - 1 + Level.getWidth(), step + 1 - Level.getWidth(), - step + 1 + Level.getWidth() }; - int cell = cells[Random.Int(cells.length)]; - - if (Dungeon.visible[cell]) { - CellEmitter.get(cell).start(Speck.factory(Speck.ROCK), 0.07f, 10); - Camera.main.shake(3, 0.7f); - Sample.INSTANCE.play(Assets.SND_ROCKS); - - if (Level.water[cell]) { - GameScene.ripple(cell); - } else if (Dungeon.level.map[cell] == Terrain.EMPTY) { - Level.set(cell, Terrain.EMPTY_DECO); - GameScene.updateMap(cell); - } - } - - Char ch = Actor.findChar(cell); - if (ch != null && ch != this ) { - Buff.prolong(ch, Paralysis.class, 2); - } - } - - @Override - public void die(Object cause) { - - super.die(cause); - - for (Mob mob : Dungeon.level.mobs) { - - if (mob instanceof Tower){ - bossAlive++; - } - - } - - if(bossAlive==0){ - - GameScene.bossSlain(); - ((CavesBossLevel) Dungeon.level).unseal(); - Dungeon.level.drop(new SkeletonKey(Dungeon.depth), pos).sprite.drop(); - Badges.validateBossSlain(); - } - - Badges.Badge badgeToCheck = null; - switch (Dungeon.hero.heroClass) { - case WARRIOR: - badgeToCheck = Badge.MASTERY_WARRIOR; - break; - case MAGE: - badgeToCheck = Badge.MASTERY_MAGE; - break; - case ROGUE: - badgeToCheck = Badge.MASTERY_ROGUE; - break; - case HUNTRESS: - badgeToCheck = Badge.MASTERY_HUNTRESS; - break; - case PERFORMER: - badgeToCheck = Badge.MASTERY_PERFORMER; - break; - case SOLDIER: - badgeToCheck = Badge.MASTERY_SOLDIER; - break; - case FOLLOWER: - badgeToCheck = Badge.MASTERY_FOLLOWER; - break; - } - - - Dungeon.level.drop(new Sokoban3(), pos).sprite.drop(); - Dungeon.level.drop(new TomeOfMastery(), pos).sprite.drop(); - - yell(Messages.get(this,"die")); - } - - @Override - public void notice() { - super.notice(); - yell(Messages.get(this, "notice")); - } - - @Override - public void call() { - next(); - } - - private static final HashSet> RESISTANCES = new HashSet>(); - static { - RESISTANCES.add(EnchantmentDark.class); - - } - - @Override - public HashSet> resistances() { - return RESISTANCES; - } - - private static final HashSet> IMMUNITIES = new HashSet>(); - static { - IMMUNITIES.add(ToxicGas.class); - IMMUNITIES.add(Terror.class); - } - - @Override - public HashSet> immunities() { - return IMMUNITIES; - } - -public static class Tower extends Mob implements Callback { - - { - spriteClass = TowerSprite.class; - - HP = HT = 500+(Dungeon.depth*Random.NormalIntRange(2, 5)); - evadeSkill = 0; - - EXP = 25; - - hostile = false; - state = PASSIVE; - - loot = new StoneOre(); - lootChance = 1f; - - properties.add(Property.MECH); - properties.add(Property.BOSS); - } - - @Override - public void beckon(int cell) { - // Do nothing - } - - private int bossAlive = 0; - - @Override - public int damageRoll() { - return 0; - } - - @Override - public void damage(int dmg, Object src) { - - for (Mob mob : Dungeon.level.mobs) { - mob.beckon(Dungeon.hero.pos); - } - - GLog.w(Messages.get(this,"alert")); - CellEmitter.center(pos).start( - Speck.factory(Speck.SCREAM), 0.3f, 3); - Sample.INSTANCE.play(Assets.SND_CHALLENGE); - - super.damage(dmg, src); - } - - @Override - public int hitSkill(Char target) { - return 0; - } - - @Override - public int drRoll() { - return 0; - } - - @Override - protected boolean act() { - - switch (Random.Int(4)) { - case 1: - for (Mob mob : Dungeon.level.mobs) { - if (mob instanceof Tower && mob != this) { - mob.sprite.centerEmitter().burst(SparkParticle.FACTORY, 3); - mob.sprite.flash(); - } - } - break; - case 2: - if (Dungeon.level.mobs.size()<10){ - BrokenRobot.spawnAround(pos); - GLog.n(Messages.get(this,"robots")); - } - break; - } - - return super.act(); - } - - @Override - public void call() { - next(); - } - - public void explode(int cell) { - // We're blowing up, so no need for a fuse anymore. - - Sample.INSTANCE.play(Assets.SND_BLAST, 2); - - if (Dungeon.visible[cell]) { - CellEmitter.center(cell).burst(BlastParticle.FACTORY, 30); - } - - boolean terrainAffected = false; - for (int n : Level.NEIGHBOURS8) { - int c = cell + n; - if (c >= 0 && c < Level.getLength()) { - if (Dungeon.visible[c]) { - CellEmitter.get(c).burst(SmokeParticle.FACTORY, 4); - } - - if (Level.flamable[c]) { - Level.set(c, Terrain.EMBERS); - GameScene.updateMap(c); - terrainAffected = true; - } - - Char ch = Actor.findChar(c); - if (ch != null) { - // those not at the center of the blast take damage less - // consistently. - int minDamage = c == cell ? Dungeon.depth + 5 : 1; - int maxDamage = 10 + Dungeon.depth * 2; - - int dmg = Random.NormalIntRange(minDamage, maxDamage) - - Math.max(ch.drRoll(),0); - if (dmg > 0) { - ch.damage(dmg, this); - } - } - } - } - - if (terrainAffected) { - Dungeon.observe(); - } - } - - - @Override - public void add(Buff buff) { - } - - @Override - public void die(Object cause) { - - super.die(cause); - - explode(pos); - - for (Mob mob : Dungeon.level.mobs) { - - if (mob instanceof Tower || mob instanceof DM300){ - bossAlive++; - } - - } - - if(bossAlive==0){ - - GameScene.bossSlain(); - ((CavesBossLevel) Dungeon.level).unseal(); - Dungeon.level.drop(new SkeletonKey(Dungeon.depth), pos).sprite.drop(); - Dungeon.level.drop(new Gold(Random.Int(3000, 6000)), pos).sprite.drop(); - - Badges.validateBossSlain(); - } - explodeDew(pos); - } - - private static final HashSet> RESISTANCES = new HashSet>(); - static { - RESISTANCES.add(EnchantmentDark.class); - - RESISTANCES.add(LightningTrap.Electricity.class); - } - - @Override - public HashSet> resistances() { - return RESISTANCES; - } - - private static final HashSet> IMMUNITIES = new HashSet>(); - static { - IMMUNITIES.add(ToxicGas.class); - IMMUNITIES.add(Terror.class); - IMMUNITIES.add(ConfusionGas.class); - } - - @Override - public HashSet> immunities() { - return IMMUNITIES; - } - - -} - -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/DemonFlower.java b/java/com/hmdzl/spspd/change/actors/mobs/DemonFlower.java deleted file mode 100644 index f39edcc0..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/DemonFlower.java +++ /dev/null @@ -1,170 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs; - -import java.util.HashSet; - -import com.hmdzl.spspd.change.actors.buffs.ArmorBreak; -import com.hmdzl.spspd.change.actors.buffs.AttackDown; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Burning; -import com.hmdzl.spspd.change.actors.buffs.DefenceUp; -import com.hmdzl.spspd.change.actors.buffs.GrowSeed; -import com.hmdzl.spspd.change.actors.buffs.Locked; -import com.hmdzl.spspd.change.actors.buffs.Silent; -import com.hmdzl.spspd.change.items.Generator; -import com.hmdzl.spspd.change.items.TenguKey; -import com.hmdzl.spspd.change.items.artifacts.MasterThievesArmband; -import com.hmdzl.spspd.change.items.wands.WandOfLight; -import com.hmdzl.spspd.change.items.weapon.enchantments.EnchantmentLight; -import com.hmdzl.spspd.change.levels.PrisonBossLevel; -import com.hmdzl.spspd.change.levels.traps.PoisonTrap; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.ToxicGas; -import com.hmdzl.spspd.change.actors.buffs.Poison; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.TomeOfMastery; -import com.hmdzl.spspd.change.items.journalpages.Sokoban2; -import com.hmdzl.spspd.change.items.keys.SkeletonKey; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfMagicMapping; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfPsionicBlast; -import com.hmdzl.spspd.change.items.weapon.enchantments.EnchantmentDark; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.Terrain; -import com.hmdzl.spspd.change.mechanics.Ballistica; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.DemonflowerSprite; -import com.hmdzl.spspd.change.sprites.TenguSprite; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Random; - -public class DemonFlower extends Mob { - - private static final int DEBUFF_DELAY = 6; - - { - spriteClass = DemonflowerSprite.class; - - HP = HT = 450; - EXP = 25; - maxLvl = 35; - evadeSkill = 5; - - properties.add(Property.PLANT); - properties.add(Property.DEMONIC); - - loot = Generator.Category.SEED; - lootChance = 0.5f; - - } - - private int addDebuff = DEBUFF_DELAY; - - - @Override - public int damageRoll() { - return Random.NormalIntRange(26, 37); - } - - @Override - public int hitSkill(Char target) { - return 35+adj(1); - } - - @Override - protected float attackDelay() { - return 0.33f; - } - - @Override - public int drRoll() { - return Random.NormalIntRange(0, 5); - } - - @Override - protected boolean doAttack(Char enemy) { - addDebuff--; - if (addDebuff <= 0 && Level.adjacent(pos, enemy.pos) && (buff(Silent.class) == null)) { - debuffadd(); - return true; - } else { - return super.doAttack(enemy); - } - } - - @Override - public int defenseProc(Char enemy, int damage) { - - int dmg = damage; - if (dmg < HT/9 && buff(DefenceUp.class) == null) { - Buff.affect(this,DefenceUp.class,3f).level(dmg); - } - - return super.defenseProc(enemy, damage); - } - - private void debuffadd() { - addDebuff = DEBUFF_DELAY; - - int pos = enemy.pos; - Char ch; - if ((ch = Actor.findChar(pos)) != null) { - Buff.prolong(ch, AttackDown.class,5f).level(30); - Buff.prolong(ch, ArmorBreak.class,5f).level(30); - } - GLog.n(Messages.get(this,"debuff")); - - spend(1f); - } - - private static final HashSet> RESISTANCES = new HashSet>(); - private static final HashSet> WEAKNESS = new HashSet>(); - private static final HashSet> IMMUNITIES = new HashSet>(); - static { - WEAKNESS.add(Burning.class); - - RESISTANCES.add(ToxicGas.class); - RESISTANCES.add(Poison.class); - RESISTANCES.add(EnchantmentDark.class); - - IMMUNITIES.add(GrowSeed.class); - - } - - @Override - public HashSet> resistances() { - return RESISTANCES; - } - - @Override - public HashSet> weakness() { - return WEAKNESS; - } - - @Override - public HashSet> immunities() { - return IMMUNITIES; - } -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/DemonGoo.java b/java/com/hmdzl/spspd/change/actors/mobs/DemonGoo.java deleted file mode 100644 index c09154d4..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/DemonGoo.java +++ /dev/null @@ -1,216 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs; - -import java.util.ArrayList; -import java.util.HashSet; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.ToxicGas; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Burning; -import com.hmdzl.spspd.change.actors.buffs.Light; -import com.hmdzl.spspd.change.actors.buffs.Ooze; -import com.hmdzl.spspd.change.actors.buffs.Tar; -import com.hmdzl.spspd.change.actors.buffs.Poison; -import com.hmdzl.spspd.change.actors.buffs.Roots; -import com.hmdzl.spspd.change.effects.Pushing; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.StoneOre; -import com.hmdzl.spspd.change.items.potions.PotionOfMending; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfPsionicBlast; -import com.hmdzl.spspd.change.items.weapon.enchantments.EnchantmentDark; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.Terrain; -import com.hmdzl.spspd.change.levels.features.Door; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.DemonGooSprite; -import com.hmdzl.spspd.change.utils.GLog; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -public class DemonGoo extends Mob { - -protected static final float SPAWN_DELAY = 2f; - -private int demonGooGeneration = 0; - -private static final String DEMONGOOGENERATION = "demonGooGeneration"; - - { - HP = HT = 300+(adj(0)*Random.NormalIntRange(4, 7)); - EXP = 10; - maxLvl = 35; - evadeSkill = 10+adj(1); - //10 - spriteClass = DemonGooSprite.class; - baseSpeed = 2f; - viewDistance = Light.DISTANCE; - - loot = new StoneOre(); - lootChance = 1f; - - properties.add(Property.ELEMENT); - properties.add(Property.DEMONIC); - } - - private static final float SPLIT_DELAY = 1f; - - @Override - protected boolean act() { - boolean result = super.act(); - - if (Level.water[pos] && HP < HT) { - sprite.emitter().burst( Speck.factory( Speck.HEALING ), 1 ); - HP++; - } else if(Level.water[pos] && HP == HT && HT < 200){ - sprite.emitter().burst( Speck.factory( Speck.HEALING ), 1 ); - HT=HT+5; - HP=HT; - } - return result; - } - - - @Override - public int damageRoll() { - return Random.NormalIntRange(30+adj(1), 60+adj(1)); - } - - @Override - public int hitSkill(Char target) { - return 35+adj(1); - } - - @Override - public int drRoll() { - return Random.NormalIntRange(10, 15); - //10 - } - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(DEMONGOOGENERATION, demonGooGeneration); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - demonGooGeneration = bundle.getInt(DEMONGOOGENERATION); - } - - @Override - public int defenseProc(Char enemy, int damage) { - - if (HP >= damage + 2) { - ArrayList candidates = new ArrayList(); - boolean[] passable = Level.passable; - - int[] neighbours = { pos + 1, pos - 1, pos + Level.getWidth(), - pos - Level.getWidth() }; - for (int n : neighbours) { - if (passable[n] && Actor.findChar(n) == null) { - candidates.add(n); - } - } - - if (candidates.size() > 0) { - GLog.n(Messages.get(this, "divide")); - DemonGoo clone = split(); - clone.HP = (HP - damage) / 2; - clone.pos = Random.element(candidates); - clone.state = clone.HUNTING; - - if (Dungeon.level.map[clone.pos] == Terrain.DOOR) { - Door.enter(clone.pos); - } - - GameScene.add(clone, SPLIT_DELAY); - Actor.addDelayed(new Pushing(clone, pos, clone.pos), -1); - - HP -= clone.HP; - } - } - - return damage; - } - - - private DemonGoo split() { - DemonGoo clone = new DemonGoo(); - clone.demonGooGeneration = demonGooGeneration + 1; - if (buff(Burning.class) != null) { - Buff.affect(clone, Burning.class).reignite(clone); - } - if (buff(Poison.class) != null) { - Buff.affect(clone, Poison.class).set(2); - } - return clone; - } - - @Override - public int attackProc(Char enemy, int damage) { - if (Random.Int(3) == 0) { - Buff.affect(enemy, Ooze.class); - enemy.sprite.burst(0x000000, 5); - } - return damage; - } - - @Override - public void notice() { - super.notice(); - //yell(Messages.get(this, "notice")); - } - - @Override - public void die(Object cause) { - - super.die(cause); - //yell(Messages.get(this, "die")); - } - - private static final HashSet> RESISTANCES = new HashSet>(); - static { - RESISTANCES.add(ToxicGas.class); - RESISTANCES.add(EnchantmentDark.class); - - } - - @Override - public HashSet> resistances() { - return RESISTANCES; - } - - private static final HashSet> IMMUNITIES = new HashSet>(); - - static { - IMMUNITIES.add(Roots.class); - } - - @Override - public HashSet> immunities() { - return IMMUNITIES; - } - - -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/Dragonking.java b/java/com/hmdzl/spspd/change/actors/mobs/Dragonking.java deleted file mode 100644 index d0a65285..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/Dragonking.java +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs; - -import java.util.HashSet; - -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.Blob; -import com.hmdzl.spspd.change.actors.blobs.FrostGas; -import com.hmdzl.spspd.change.actors.blobs.ToxicGas; -import com.hmdzl.spspd.change.actors.buffs.Poison; -import com.hmdzl.spspd.change.items.keys.SkeletonKey; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfPsionicBlast; -import com.hmdzl.spspd.change.items.weapon.enchantments.EnchantmentDark; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.DragonkingSprite; -import com.watabou.utils.Random; -import com.hmdzl.spspd.change.actors.blobs.ShockWeb; - - -public class Dragonking extends Mob { - { - spriteClass = DragonkingSprite.class; - baseSpeed = 1f; - - HP = HT = 100; - EXP = 1; - evadeSkill = 0; - - properties.add(Property.DRAGON); - properties.add(Property.BOSS); - } - - @Override - public int damageRoll() { - return Random.NormalIntRange(0, 1); - } - - @Override - public int hitSkill(Char target) { - return 1; - } - - @Override - public int drRoll() { - return 0; - } - - @Override - public void die(Object cause) { - - super.die(cause); - GameScene.bossSlain(); - Dungeon.level.drop(new SkeletonKey(Dungeon.depth), pos).sprite.drop(); - UGoo.spawnAt(pos); - - } - - @Override - public void move(int step) { - GameScene.add(Blob.seed(pos, Random.Int(5, 7), ShockWeb.class)); - super.move(step); - } - - @Override - protected boolean doAttack(Char enemy) { - - return super.doAttack(enemy); - - } - - private static final HashSet> RESISTANCES = new HashSet>(); - static { - RESISTANCES.add(ToxicGas.class); - RESISTANCES.add(Poison.class); - RESISTANCES.add(EnchantmentDark.class); - - } - - @Override - public HashSet> resistances() { - return RESISTANCES; - } -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/DustElement.java b/java/com/hmdzl/spspd/change/actors/mobs/DustElement.java deleted file mode 100644 index e0bc6bd4..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/DustElement.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs; - -import com.hmdzl.spspd.change.actors.buffs.Blindness; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.items.Generator; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.sprites.DustElementSprite; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.utils.Random; - -public class DustElement extends Mob { - - { - spriteClass = DustElementSprite.class; - - HP = HT = 35+(Dungeon.depth*Random.NormalIntRange(1, 3)); - evadeSkill = 4+(Math.round((Dungeon.depth)/2)); - - EXP = 2; - maxLvl = 8; - - loot = Generator.random(Generator.Category.SEED); - lootChance = 0.5f; - - properties.add(Property.ELEMENT); - } - - @Override - public int damageRoll() { - return Random.NormalIntRange(2, 5+(Dungeon.depth)); - } - - @Override - public int hitSkill(Char target) { - return 11+(Dungeon.depth); - } - - @Override - public int attackProc(Char enemy, int damage) { - if (Random.Int(10) == 0) { - Buff.prolong(enemy, Blindness.class, Random.Int(3, 10)); - GLog.w(Messages.get(this,"blind")); - Dungeon.observe(); - } - - return damage; - } - - @Override - public int drRoll() { - return Random.NormalIntRange(0, 2); - } - -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/DwarfLich.java b/java/com/hmdzl/spspd/change/actors/mobs/DwarfLich.java deleted file mode 100644 index 7eb2fa50..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/DwarfLich.java +++ /dev/null @@ -1,123 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs; - -import java.util.HashSet; - -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Poison; -import com.hmdzl.spspd.change.items.food.fruit.Blackberry; -import com.hmdzl.spspd.change.items.potions.PotionOfHealing; - -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.mechanics.Ballistica; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.DwarfLichSprite; -import com.watabou.utils.Random; - -public class DwarfLich extends Mob { - - private static final float SPAWN_DELAY = 2f; - - { - spriteClass = DwarfLichSprite.class; - - HP = HT = 120+(adj(0)*Random.NormalIntRange(7, 5)); - evadeSkill = 24+adj(1); - - EXP = 14; - maxLvl = 30; - - loot = new PotionOfHealing(); - lootChance = 0.3f; - - lootOther = new Blackberry(); - lootChanceOther = 0.3f; - - properties.add(Property.UNDEAD); - properties.add(Property.DWARF); - } - - @Override - public int damageRoll() { - return Random.NormalIntRange(20, 32); - } - - @Override - public int hitSkill(Char target) { - return 36+adj(1); - } - - @Override - public int drRoll() { - return Random.NormalIntRange(5, 15); - } - - @Override - protected boolean canAttack(Char enemy) { - Ballistica attack = new Ballistica( pos, enemy.pos, Ballistica.MAGIC_BOLT); - return !Level.adjacent( pos, enemy.pos ) && attack.collisionPos == enemy.pos; - } - - @Override - protected boolean getCloser(int target) { - if (state == HUNTING) { - return enemySeen && getFurther(target); - } else { - return super.getCloser(target); - } - } - @Override - public void die(Object cause) { - RedWraith.spawnAt(this.pos); - super.die(cause); - } - - public static void spawnAround(int pos) { - for (int n : Level.NEIGHBOURS4) { - int cell = pos + n; - if (Level.passable[cell] && Actor.findChar(cell) == null) { - spawnAt(cell); - } - } - } - - public static DwarfLich spawnAt(int pos) { - - DwarfLich d = new DwarfLich(); - - d.pos = pos; - d.state = d.HUNTING; - GameScene.add(d, SPAWN_DELAY); - - return d; - - } - - private static final HashSet> RESISTANCES = new HashSet>(); - static { - - RESISTANCES.add(Poison.class); - } - - @Override - public HashSet> resistances() { - return RESISTANCES; - } -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/ElderAvatar.java b/java/com/hmdzl/spspd/change/actors/mobs/ElderAvatar.java deleted file mode 100644 index b72e37b0..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/ElderAvatar.java +++ /dev/null @@ -1,784 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs; - -import java.util.HashSet; - -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.Challenges; -import com.hmdzl.spspd.change.actors.blobs.DarkGas; -import com.hmdzl.spspd.change.actors.blobs.ElectriShock; -import com.hmdzl.spspd.change.actors.buffs.Amok; -import com.hmdzl.spspd.change.actors.buffs.ArmorBreak; -import com.hmdzl.spspd.change.actors.buffs.AttackDown; -import com.hmdzl.spspd.change.actors.buffs.Blindness; -import com.hmdzl.spspd.change.actors.buffs.Burning; -import com.hmdzl.spspd.change.actors.buffs.Charm; -import com.hmdzl.spspd.change.actors.buffs.Chill; -import com.hmdzl.spspd.change.actors.buffs.Disarm; -import com.hmdzl.spspd.change.actors.buffs.Frost; -import com.hmdzl.spspd.change.actors.buffs.GlassShield; -import com.hmdzl.spspd.change.actors.buffs.GrowSeed; -import com.hmdzl.spspd.change.actors.buffs.Locked; -import com.hmdzl.spspd.change.actors.buffs.ShieldArmor; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.items.ArmorKit; -import com.hmdzl.spspd.change.items.DolyaSlate; -import com.hmdzl.spspd.change.items.Generator; -import com.hmdzl.spspd.change.items.Gold; -import com.hmdzl.spspd.change.items.KindOfArmor; -import com.hmdzl.spspd.change.items.RedDewdrop; -import com.hmdzl.spspd.change.items.StoneOre; -import com.hmdzl.spspd.change.items.armor.normalarmor.NormalArmor; -import com.hmdzl.spspd.change.items.armor.normalarmor.RubberArmor; -import com.hmdzl.spspd.change.items.armor.normalarmor.WoodenArmor; -import com.hmdzl.spspd.change.items.artifacts.AlienBag; -import com.hmdzl.spspd.change.items.bombs.DangerousBomb; -import com.hmdzl.spspd.change.items.keys.SkeletonKey; -import com.hmdzl.spspd.change.levels.Terrain; -import com.hmdzl.spspd.change.mechanics.Ballistica; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.ToxicGas; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Paralysis; -import com.hmdzl.spspd.change.actors.buffs.Vertigo; -import com.hmdzl.spspd.change.effects.Flare; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.effects.particles.ElmoParticle; -import com.hmdzl.spspd.change.items.journalpages.Sokoban4; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfPsionicBlast; -import com.hmdzl.spspd.change.items.wands.WandOfDisintegration; -import com.hmdzl.spspd.change.items.weapon.enchantments.EnchantmentDark; -import com.hmdzl.spspd.change.levels.CityBossLevel; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ElderAvatarSprite; -import com.hmdzl.spspd.change.sprites.GolemSprite; -import com.hmdzl.spspd.change.sprites.MonkSprite; -import com.hmdzl.spspd.change.sprites.MusketeerSprite; -import com.hmdzl.spspd.change.sprites.ObeliskSprite; -import com.hmdzl.spspd.change.sprites.UndeadSprite; -import com.hmdzl.spspd.change.sprites.WarlockSprite; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundle; -import com.watabou.utils.PathFinder; -import com.watabou.utils.Random; - -public class ElderAvatar extends Mob { - - { - spriteClass = ElderAvatarSprite.class; - - HP = HT = 600; - EXP = 50; - evadeSkill = 25; - baseSpeed = 1f; - - loot = new AlienBag().identify(); - lootChance = 0.2f; - - lootOther = Generator.Category.GUNWEAPON; - lootChanceOther = 1f; - - properties.add(Property.ALIEN); - properties.add(Property.BOSS); - } - - private int orbAlive = 0; - private int waves = 0; - public static int breaks = 0; - - private static final String WAVES = "waves"; - private static final String BREAKS = "breaks"; - private static final String ORBALIVE = "orbAlive"; - - @Override - public void storeInBundle( Bundle bundle ) { - super.storeInBundle(bundle); - bundle.put( WAVES, waves ); - bundle.put( BREAKS, breaks ); - bundle.put( ORBALIVE, orbAlive ); - } - - @Override - public void restoreFromBundle( Bundle bundle ) { - super.restoreFromBundle(bundle); - waves = bundle.getInt( WAVES ); - breaks = bundle.getInt( BREAKS ); - orbAlive = bundle.getInt( ORBALIVE ); - } - - - public void spawnObe() { - Obelisk a = new Obelisk(); - - a.pos = Terrain.EMPTY_WELL; - do { - a.pos = Random.Int(Dungeon.level.randomRespawnCellMob()); - } while (Dungeon.level.map[a.pos] != Terrain.EMPTY_WELL - || Actor.findChar(a.pos) != null); - GameScene.add(a); - } - - @Override - public int damageRoll() { - return Dungeon.isChallenged(Challenges.TEST_TIME) ? Random.NormalIntRange(0, 1) : Random.NormalIntRange(25, 40); - } - - @Override - public int hitSkill(Char target) { - return 58; - } - - @Override - public int drRoll() { - return Random.NormalIntRange(8, 12); - } - - @Override - protected boolean canAttack(Char enemy) { - if (HP > 49) return Dungeon.level.distance(pos, enemy.pos) <= 3; - else return Dungeon.level.distance(pos, enemy.pos) <= 0; - } - - @Override - public int attackProc(Char enemy, int damage) { - if (Random.Int(5) == 0) { - new DangerousBomb().explode(enemy.pos); - } - if (Random.Int(8) == 0) { - Buff.affect(enemy, Charm.class, Charm.durationFactor(enemy) - * Random.IntRange(3, 5)).object = id(); - enemy.sprite.centerEmitter().start(Speck.factory(Speck.HEART), - 0.2f, 5); - Sample.INSTANCE.play(Assets.SND_CHARMS); - } - Hero hero = Dungeon.hero; - KindOfArmor armor = hero.belongings.armor; - if (Random.Int(10) == 0) { - if (armor != null && !(armor instanceof WoodenArmor || armor instanceof RubberArmor || armor instanceof NormalArmor) - && !armor.cursed) { - hero.belongings.armor = null; - Dungeon.level.drop(armor, hero.pos).sprite.drop(); - GLog.w(Messages.get(this, "disarm")); - } - } - return damage; - } - - public boolean checkObelisk() { - - int obeliskAlive = 0; - if (Dungeon.level.mobs != null) { - for (Mob mob : Dungeon.level.mobs) { - if (mob instanceof Obelisk && mob.HP > 10) { - obeliskAlive++; - } - } - } - if (obeliskAlive > 0) { - return true; - } else { - return false; - } - } - - @Override - public void damage(int dmg, Object src) { - if (dmg > this.HP && checkObelisk()) { - dmg = Random.Int(this.HP); - //Buff.affect(this,ShieldArmor.class).level(100); - } - super.damage(dmg, src); - } - - @Override - protected boolean act() { - - if (orbAlive < 1) { - spawnObe(); - orbAlive++; - - return true; - } - - if (HP < 50 && waves == 0 && breaks == 0) { - summonHunter(pos); - waves++; - Buff.affect(this,ShieldArmor.class).level(100); - sprite.centerEmitter().start(Speck.factory(Speck.SCREAM), 0.4f, 2); - Sample.INSTANCE.play(Assets.SND_CHALLENGE); - return true; - } - - if (HP < 50 && waves == 1 && breaks == 1) { - summonWarlock(pos); - waves++; - Buff.affect(this,ShieldArmor.class).level(100); - sprite.centerEmitter().start(Speck.factory(Speck.SCREAM), 0.4f, 2); - Sample.INSTANCE.play(Assets.SND_CHALLENGE); - return true; - } - - if (HP < 50 && waves == 2 && breaks == 2) { - summonMonk(pos); - waves++; - Buff.affect(this,ShieldArmor.class).level(100); - sprite.centerEmitter().start(Speck.factory(Speck.SCREAM), 0.4f, 2); - Sample.INSTANCE.play(Assets.SND_CHALLENGE); - return true; - } - - if (HP < 50 && waves == 3 && breaks == 3) { - summonMech(pos); - waves++; - Buff.affect(this,ShieldArmor.class).level(100); - sprite.centerEmitter().start(Speck.factory(Speck.SCREAM), 0.4f, 2); - Sample.INSTANCE.play(Assets.SND_CHALLENGE); - return true; - } - - return super.act(); - } - - private void summonHunter(int pos) { - TheHunter.spawnAround(pos); - } - - private void summonWarlock(int pos) { - TheWarlock.spawnAround(pos); - } - - private void summonMonk(int pos) { - TheMonk.spawnAround(pos); - } - - private void summonMech(int pos) { - TheMech.spawnAround(pos); - } - - @Override - public void die(Object cause) { - - yell(Messages.get(this, "died")); - - GameScene.bossSlain(); - ((CityBossLevel) Dungeon.level).unseal(); - if (!Dungeon.limitedDrops.journal.dropped()) { - Dungeon.level.drop(new DolyaSlate(), pos).sprite.drop(); - Dungeon.limitedDrops.journal.drop(); - } - Dungeon.level.drop(new Sokoban4(), pos).sprite.drop(); - - Dungeon.level.drop(new SkeletonKey(Dungeon.depth), pos).sprite.drop(); - Dungeon.level.drop(new Gold(Random.Int(4900, 10000)), pos).sprite.drop(); - - Badges.validateBossSlain(); - - super.die(cause); - } - - @Override - public void notice() { - super.notice(); - yell(Messages.get(this, "notice")); - } - - private static final HashSet> RESISTANCES = new HashSet>(); - - static { - RESISTANCES.add(ToxicGas.class); - RESISTANCES.add(Amok.class); - RESISTANCES.add(Vertigo.class); - - RESISTANCES.add(WandOfDisintegration.class); - } - - @Override - public HashSet> resistances() { - return RESISTANCES; - } - - private static final HashSet> IMMUNITIES = new HashSet>(); - - static { - IMMUNITIES.add(Paralysis.class); - IMMUNITIES.add(Charm.class); - } - - @Override - public HashSet> immunities() { - return IMMUNITIES; - } - - public static class TheHunter extends Mob { - - { - spriteClass = MusketeerSprite.class; - - HP = HT = 100; - evadeSkill = 15; - EXP = 0; - baseSpeed = 3f; - viewDistance = 6; - state = WANDERING; - properties.add(Property.ALIEN); - properties.add(Property.BOSS); - } - - @Override - public int damageRoll() { - return Random.NormalIntRange(20, 35); - } - - @Override - public int hitSkill(Char target) { - return 60; - } - - @Override - protected boolean canAttack(Char enemy) { - if (buff(Disarm.class) != null){ - return false; - } else - return new Ballistica( pos, enemy.pos, Ballistica.PROJECTILE).collisionPos == enemy.pos; - } - - @Override - public int attackProc(Char enemy, int damage) { - Buff.affect(this, Disarm.class,5f); - Buff.affect(enemy,ArmorBreak.class,3f).level(30); - return damage; - } - - @Override - public void damage(int dmg, Object src) { - super.damage(dmg, src); - if (src instanceof ToxicGas) { - ((ToxicGas) src).clear(pos); - } - } - - @Override - public void die(Object cause) { - super.die(cause); - } - - @Override - public int drRoll() { - return 5; - } - - public static void spawnAround(int pos) { - for (int n : Level.NEIGHBOURS4) { - int cell = pos + n; - if (Level.passable[cell] && Actor.findChar(cell) == null) { - spawnAt(cell); - } - } - } - - public static TheHunter spawnAt(int pos) { - - TheHunter d = new TheHunter(); - - d.pos = pos; - d.state = d.HUNTING; - GameScene.add(d, 2f); - - return d; - - } - - private static final HashSet> IMMUNITIES = new HashSet>(); - - static { - IMMUNITIES.add(Charm.class); - IMMUNITIES.add(Amok.class); - IMMUNITIES.add(Paralysis.class); - } - - @Override - public HashSet> immunities() { - return IMMUNITIES; - } - } - - public static class TheWarlock extends Mob { - { - spriteClass = WarlockSprite.class; - - HP = HT = 150; - evadeSkill = 15; - EXP = 0; - state = WANDERING; - properties.add(Property.ALIEN); - properties.add(Property.BOSS); - } - - @Override - public int damageRoll() { - return Random.NormalIntRange(25, 45); - } - - @Override - public int hitSkill(Char target) { - return 60; - } - - @Override - public int attackProc(Char enemy, int damage) { - Buff.prolong(enemy,Vertigo.class,3f); - Buff.prolong(enemy,AttackDown.class,3f).level(20); - return damage; - } - - @Override - public void damage(int dmg, Object src) { - dmg =(int)(dmg/2); - super.damage(dmg, src); - } - - @Override - public void die(Object cause) { - super.die(cause); - } - - @Override - public int drRoll() { - return 5; - } - - public static void spawnAround(int pos) { - for (int n : Level.NEIGHBOURS4) { - int cell = pos + n; - if (Level.passable[cell] && Actor.findChar(cell) == null) { - spawnAt(cell); - } - } - } - - public static TheWarlock spawnAt(int pos) { - - TheWarlock d = new TheWarlock(); - - d.pos = pos; - d.state = d.HUNTING; - GameScene.add(d, 2f); - - return d; - - } - - private static final HashSet> IMMUNITIES = new HashSet>(); - - static { - IMMUNITIES.add(Charm.class); - IMMUNITIES.add(Amok.class); - IMMUNITIES.add(Paralysis.class); - } - - @Override - public HashSet> immunities() { - return IMMUNITIES; - } - } - - public static class TheMonk extends Mob { - - { - spriteClass = MonkSprite.class; - - HP = HT = 100; - evadeSkill = 30; - EXP = 0; - baseSpeed = 2f; - viewDistance = 5; - state = WANDERING; - properties.add(Property.ALIEN); - properties.add(Property.BOSS); - } - - @Override - protected float attackDelay() { - return 0.5f; - } - - @Override - public int damageRoll() { - return Random.NormalIntRange(15, 30); - } - - @Override - public int hitSkill(Char target) { - return 60; - } - - @Override - public int attackProc(Char enemy, int damage) { - if (Random.Int(6) == 0) { - Buff.affect(this,GlassShield.class).turns(1); - } - Buff.prolong(enemy,Blindness.class,3f); - return damage; - } - - @Override - public void damage(int dmg, Object src) { - super.damage(dmg, src); - if (src instanceof ToxicGas) { - ((ToxicGas) src).clear(pos); - } - } - - @Override - public void die(Object cause) { - super.die(cause); - } - - @Override - public int drRoll() { - return 5; - } - - public static void spawnAround(int pos) { - for (int n : Level.NEIGHBOURS4) { - int cell = pos + n; - if (Level.passable[cell] && Actor.findChar(cell) == null) { - spawnAt(cell); - } - } - } - - public static TheMonk spawnAt(int pos) { - - TheMonk d = new TheMonk(); - - d.pos = pos; - d.state = d.HUNTING; - GameScene.add(d, 2f); - - return d; - - } - - private static final HashSet> IMMUNITIES = new HashSet>(); - - static { - IMMUNITIES.add(Charm.class); - IMMUNITIES.add(Amok.class); - IMMUNITIES.add(Paralysis.class); - } - - @Override - public HashSet> immunities() { - return IMMUNITIES; - } - } - - public static class TheMech extends Mob { - - { - spriteClass = GolemSprite.class; - - HP = HT = 200; - evadeSkill = 15; - EXP = 0; - state = WANDERING; - baseSpeed = 0.5f; - properties.add(Property.ALIEN); - properties.add(Property.MECH); - properties.add(Property.BOSS); - } - private int addshield = 0; - @Override - public int damageRoll() { - return Random.NormalIntRange(45, 70); - } - - @Override - public int hitSkill(Char target) { - return 30; - } - - @Override - protected boolean act() { - - if (addshield < 1) { - Buff.affect(this,ShieldArmor.class).level(100); - addshield++; - return true; - } - return super.act(); - } - - @Override - public int attackProc(Char enemy, int damage) { - Buff.affect(enemy, Burning.class).reignite(enemy); - return damage; - } - - @Override - public void damage(int dmg, Object src) { - super.damage(dmg, src); - } - - @Override - public void die(Object cause) { - super.die(cause); - } - - @Override - public int drRoll() { - return 10; - } - - public static void spawnAround(int pos) { - for (int n : Level.NEIGHBOURS4) { - int cell = pos + n; - if (Level.passable[cell] && Actor.findChar(cell) == null) { - spawnAt(cell); - } - } - } - - public static TheMech spawnAt(int pos) { - - TheMech d = new TheMech(); - - d.pos = pos; - d.state = d.HUNTING; - GameScene.add(d, 2f); - - return d; - - } - - private static final HashSet> IMMUNITIES = new HashSet>(); - - static { - IMMUNITIES.add(Burning.class); - IMMUNITIES.add(Frost.class); - IMMUNITIES.add(Chill.class); - IMMUNITIES.add(ElectriShock.class); - IMMUNITIES.add(ToxicGas.class); - IMMUNITIES.add(DarkGas.class); - IMMUNITIES.add(GrowSeed.class); - IMMUNITIES.add(Charm.class); - IMMUNITIES.add(Amok.class); - IMMUNITIES.add(Paralysis.class); - } - - @Override - public HashSet> immunities() { - return IMMUNITIES; - } - } - - public static class Obelisk extends Mob { - - { - spriteClass = ObeliskSprite.class; - - HP = HT = 1000; - evadeSkill = 0; - - EXP = 10; - - hostile = false; - state = PASSIVE; - - loot = new StoneOre(); - lootChance = 0.05f; - - properties.add(Property.UNKNOW); - properties.add(Property.BOSS); - } - - @Override - public void beckon(int cell) { - // Do nothing - } - - @Override - public void add(Buff buff) { - } - - @Override - public int damageRoll() { - return 0; - } - - @Override - public int hitSkill(Char target) { - return 0; - } - - @Override - public int drRoll() { - return 0; - } - - @Override - protected boolean act() { - - if (3 - ElderAvatar.breaks > 4 * HP / HT) { - ElderAvatar.breaks++; - for (Mob mob : Dungeon.level.mobs) { - if (mob instanceof ElderAvatar) { - mob.HP = 600; - } - } - return true; - } - return super.act(); - } - - public boolean checkElder() { - - int elderAlive = 0; - if (Dungeon.level.mobs != null) { - for (Mob mob : Dungeon.level.mobs) { - if (mob instanceof ElderAvatar && mob.HP > 20) { - elderAlive++; - } - } - } - if (elderAlive > 0) { - return true; - } else { - return false; - } - } - - @Override - public void damage(int dmg, Object src) { - if (checkElder()) { - yell(Messages.get(this, "impossible")); - } else { - super.damage(dmg, src); - } - } - - } -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/Eye.java b/java/com/hmdzl/spspd/change/actors/mobs/Eye.java deleted file mode 100644 index c8981e54..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/Eye.java +++ /dev/null @@ -1,200 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs; - -import java.util.HashSet; - -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.ResultDescriptions; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Light; -import com.hmdzl.spspd.change.actors.buffs.Terror; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.particles.PurpleParticle; -import com.hmdzl.spspd.change.items.food.meatfood.MysteryMeat; -import com.hmdzl.spspd.change.items.potions.PotionOfHealing; -import com.hmdzl.spspd.change.items.wands.WandOfDisintegration; -import com.hmdzl.spspd.change.items.weapon.enchantments.EnchantmentDark; - -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.mechanics.Ballistica; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.hmdzl.spspd.change.sprites.EyeSprite; - -import com.watabou.noosa.tweeners.AlphaTweener; -import com.watabou.utils.Random; - -public class Eye extends Mob { - - private static final String TXT_DEATHGAZE_KILLED = "%s's deathgaze killed you..."; - protected static final float SPAWN_DELAY = 2f; - - { - spriteClass = EyeSprite.class; - - HP = HT = 200+(adj(0)*Random.NormalIntRange(4, 7)); - evadeSkill = 20+adj(1); - viewDistance = Light.DISTANCE; - - EXP = 15; - maxLvl = 35; - - flying = true; - - loot = new PotionOfHealing(); - lootChance = 0.1f; - - lootOther = new MysteryMeat(); - lootChanceOther = 0.5f; // by default, see die() - - properties.add(Property.DEMONIC); - } - - private Ballistica beam; - - @Override - public int drRoll() { - return Random.NormalIntRange(10, 20); - } - - private int hitCell; - - @Override - protected boolean canAttack(Char enemy) { - - beam = new Ballistica( pos, enemy.pos, Ballistica.STOP_TERRAIN); - - return beam.subPath(1, beam.dist).contains(enemy.pos); - } - - - @Override - public int hitSkill(Char target) { - return 30+adj(0); - } - - @Override - protected float attackDelay() { - return 1.6f; - } - - @Override - protected boolean doAttack(Char enemy) { - - spend(attackDelay()); - - boolean rayVisible = false; - - for (int i : beam.subPath(0, beam.dist)) { - if (Dungeon.visible[i]) { - rayVisible = true; - } - } - - if (rayVisible) { - sprite.attack(beam.collisionPos); - return false; - } else { - attack(enemy); - return true; - } - } - - @Override - public boolean attack(Char enemy) { - - for (int pos : beam.subPath(1, beam.dist)) { - - Char ch = Actor.findChar( pos ); - if (ch == null) { - continue; - } - - if (hit(this, ch, true)) { - ch.damage(Random.NormalIntRange(14, 20+adj(0)), this); - - if (Dungeon.visible[pos]) { - ch.sprite.flash(); - CellEmitter.center(pos).burst(PurpleParticle.BURST, - Random.IntRange(1, 2)); - } - - if (!ch.isAlive() && ch == Dungeon.hero) { - Dungeon.fail(Messages.format(ResultDescriptions.MOB)); - //GLog.n(Messages.get(this, "kill")); - } - } else { - ch.sprite.showStatus(CharSprite.NEUTRAL, ch.defenseVerb()); - } - } - - return true; - } - - - public static void spawnAroundChance(int pos) { - for (int n : Level.NEIGHBOURS4) { - int cell = pos + n; - if (Level.passable[cell] && Actor.findChar(cell) == null && Random.Float()<0.50f) { - spawnAt(cell); - } - } - } - - public static Eye spawnAt(int pos) { - if (Level.passable[pos] && Actor.findChar(pos) == null) { - - Eye e = new Eye(); - e.pos = pos; - e.state = e.HUNTING; - GameScene.add(e, SPAWN_DELAY); - - e.sprite.alpha(0); - e.sprite.parent.add(new AlphaTweener(e.sprite, 1, 0.5f)); - - return e; - - } else { - return null; - } - } - - private static final HashSet> RESISTANCES = new HashSet>(); - static { - RESISTANCES.add(WandOfDisintegration.class); - RESISTANCES.add(EnchantmentDark.class); - } - - @Override - public HashSet> resistances() { - return RESISTANCES; - } - - private static final HashSet> IMMUNITIES = new HashSet>(); - static { - IMMUNITIES.add(Terror.class); - } - - @Override - public HashSet> immunities() { - return IMMUNITIES; - } -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/FetidRat.java b/java/com/hmdzl/spspd/change/actors/mobs/FetidRat.java deleted file mode 100644 index c6909fa4..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/FetidRat.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs; - -import java.util.HashSet; - -import com.hmdzl.spspd.change.actors.mobs.npcs.Ghost; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.Blob; -import com.hmdzl.spspd.change.actors.blobs.StenchGas; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Ooze; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.FetidRatSprite; - -import com.watabou.utils.Random; - - public class FetidRat extends Rat { - - { - //name = "fetidrat"; - spriteClass = FetidRatSprite.class; - - HP = HT = 45; - evadeSkill = 5; - - EXP = 4; - - state = WANDERING; - - properties.add(Property.BEAST); - properties.add(Property.MINIBOSS); - } - - @Override - public int hitSkill(Char target) { - return 12; - } - - @Override - public int drRoll() { - return Random.NormalIntRange(0, 2); - } - - @Override - public int attackProc(Char enemy, int damage) { - if (Random.Int(3) == 0) { - Buff.affect(enemy, Ooze.class); - } - - return damage; - } - - @Override - public int defenseProc(Char enemy, int damage) { - - GameScene.add(Blob.seed(pos, 20, StenchGas.class)); - - return super.defenseProc(enemy, damage); - } - - @Override - public void die(Object cause) { - super.die(cause); - - Ghost.Quest.process(); - } - - private static final HashSet> IMMUNITIES = new HashSet>(); - static { - IMMUNITIES.add(StenchGas.class); - } - - @Override - public HashSet> immunities() { - return IMMUNITIES; - } - } \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/actors/mobs/Fiend.java b/java/com/hmdzl/spspd/change/actors/mobs/Fiend.java deleted file mode 100644 index e1a6208a..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/Fiend.java +++ /dev/null @@ -1,167 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs; - -import com.hmdzl.spspd.change.actors.buffs.Silent; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.ResultDescriptions; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Weakness; -import com.hmdzl.spspd.change.items.Generator; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.mechanics.Ballistica; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.hmdzl.spspd.change.sprites.FiendSprite; - -import com.watabou.utils.Callback; -import com.watabou.utils.Random; - -public class Fiend extends Mob implements Callback { - - private static final float TIME_TO_ZAP = 2f; - - private static final String TXT_SHADOWBOLT_KILLED = "%s's shadow bolt killed you..."; - - private static final float SPAWN_DELAY = 6f; - - { - spriteClass = FiendSprite.class; - baseSpeed = 1.5f; - viewDistance = 4; - HP = HT = 80+(Dungeon.depth*Random.NormalIntRange(2, 5)); - evadeSkill = 2; - - EXP = 20; - - loot = Generator.Category.SCROLL; - lootChance = 0.15f; - - properties.add(Property.DEMONIC); - properties.add(Property.ELEMENT); - - } - - - @Override - public int damageRoll() { - return Random.NormalIntRange(Dungeon.depth/2, Dungeon.depth); - } - - @Override - public int hitSkill(Char target) { - return 50; - } - - @Override - public int drRoll() { - return Random.NormalIntRange(5, 10); - } - - @Override - protected boolean canAttack(Char enemy) { if (buff(Silent.class) != null){ - return Level.adjacent(pos, enemy.pos) && (!isCharmedBy(enemy)); - } else - return new Ballistica( pos, enemy.pos, Ballistica.MAGIC_BOLT).collisionPos == enemy.pos; - } - - @Override - protected boolean doAttack(Char enemy) { - - if (Level.adjacent(pos, enemy.pos)) { - - return super.doAttack(enemy); - - } else { - - boolean visible = Level.fieldOfView[pos] - || Level.fieldOfView[enemy.pos]; - if (visible) { - ((FiendSprite) sprite).zap(enemy.pos); - } else { - zap(); - } - - return !visible; - } - } - - private void zap() { - spend(TIME_TO_ZAP); - - if (hit(this, enemy, true)) { - if (enemy == Dungeon.hero && Random.Int(5) == 0) { - Buff.prolong(enemy, Weakness.class, Weakness.duration(enemy)); - } - - int dmg = Random.Int(20, 45); - enemy.damage(dmg, this); - - if (!enemy.isAlive() && enemy == Dungeon.hero) { - Dungeon.fail( Messages.format(ResultDescriptions.MOB)); - //GLog.n(Messages.get(this, "kill")); - } - } else { - enemy.sprite.showStatus(CharSprite.NEUTRAL, enemy.defenseVerb()); - } - } - - public void onZapComplete() { - zap(); - next(); - } - - @Override - public void call() { - next(); - } - - public static void spawnAround(int pos) { - for (int n : Level.NEIGHBOURS4) { - int cell = pos + n; - if (Level.passable[cell] && Actor.findChar(cell) == null) { - spawnAt(cell); - } - } - } - - public static void spawnAroundChance(int pos) { - for (int n : Level.NEIGHBOURS4) { - int cell = pos + n; - if (Level.passable[cell] && Actor.findChar(cell) == null && Random.Float() < 0.75f) { - spawnAt(cell); - } - } - } - - public static Fiend spawnAt(int pos) { - - Fiend b = new Fiend(); - - b.pos = pos; - b.state = b.HUNTING; - GameScene.add(b, SPAWN_DELAY); - - return b; - - } - -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/FireElemental.java b/java/com/hmdzl/spspd/change/actors/mobs/FireElemental.java deleted file mode 100644 index 1b460154..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/FireElemental.java +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs; - -import java.util.HashSet; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.Fire; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Burning; -import com.hmdzl.spspd.change.actors.buffs.Chill; -import com.hmdzl.spspd.change.actors.buffs.Frost; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.wands.WandOfFirebolt; -import com.hmdzl.spspd.change.items.potions.PotionOfLiquidFlame; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.sprites.FireElementalSprite; -import com.watabou.utils.Random; - -public class FireElemental extends Mob { - - { - spriteClass = FireElementalSprite.class; - - HP = HT = 120+(adj(0)*Random.NormalIntRange(4, 7)); - evadeSkill = 20+adj(0); - - EXP = 15; - maxLvl = 30; - - flying = true; - - loot = new PotionOfLiquidFlame(); - lootChance = 0.1f; - - lootOther = new WandOfFirebolt(); - lootChanceOther = 0.02f; // by default, see die() - - properties.add(Property.ELEMENT); - } - - @Override - public int damageRoll() { - return Random.NormalIntRange(16, 20+adj(1)); - } - - @Override - public int hitSkill(Char target) { - return 25+adj(1); - } - - @Override - public int drRoll() { - return Random.NormalIntRange(0, 5); - } - - @Override - public int attackProc(Char enemy, int damage) { - if (Random.Int(2) == 0) { - Buff.affect(enemy, Burning.class).reignite(enemy); - } - - return damage; - } - - @Override - protected boolean canAttack(Char enemy) { - return Dungeon.level.distance( pos, enemy.pos ) <= 2 ; - } - - @Override - public void add(Buff buff) { - if (buff instanceof Burning) { - if (HP < HT) { - HP++; - sprite.emitter().burst(Speck.factory(Speck.HEALING), 1); - } - } else if (buff instanceof Frost || buff instanceof Chill) { - if (Level.water[this.pos]) - damage(Random.NormalIntRange(HT / 2, HT), buff); - else - damage(Random.NormalIntRange(1, HT * 2 / 3), buff); - } else { - super.add(buff); - } - } - - private static final HashSet> IMMUNITIES = new HashSet>(); - static { - IMMUNITIES.add(Burning.class); - IMMUNITIES.add(Fire.class); - IMMUNITIES.add(WandOfFirebolt.class); - } - - @Override - public HashSet> immunities() { - return IMMUNITIES; - } -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/FireRabbit.java b/java/com/hmdzl/spspd/change/actors/mobs/FireRabbit.java deleted file mode 100644 index a6ddae35..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/FireRabbit.java +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs; - -import java.util.HashSet; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.Fire; -import com.hmdzl.spspd.change.actors.buffs.ArmorBreak; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Burning; -import com.hmdzl.spspd.change.actors.buffs.Chill; -import com.hmdzl.spspd.change.actors.buffs.Frost; -import com.hmdzl.spspd.change.actors.buffs.Locked; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.wands.WandOfFirebolt; -import com.hmdzl.spspd.change.items.potions.PotionOfLiquidFlame; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.FireElementalSprite; -import com.hmdzl.spspd.change.sprites.FireRabbitSprite; -import com.watabou.utils.Random; - -public class FireRabbit extends Mob { - - { - spriteClass = FireRabbitSprite.class; - - HP = HT = 80+(adj(0)*Random.NormalIntRange(3, 5)); - evadeSkill = 8+adj(0); - - EXP = 5; - maxLvl = 20; - - loot = new PotionOfLiquidFlame(); - lootChance = 0.1f; - - properties.add(Property.ORC); - } - - @Override - public int damageRoll() { - return Random.NormalIntRange(6, 8+adj(0)); - } - - @Override - public int hitSkill(Char target) { - return 12; - } - - @Override - public int drRoll() { - return Random.NormalIntRange(5, 10); - } - - @Override - public int attackProc(Char enemy, int damage) { - if (Random.Int(3) == 0) { - Buff.affect(enemy, Burning.class).reignite(enemy); - yell( Messages.get(this, "yell") ); - } - if (Dungeon.level.distance( pos, enemy.pos ) == 3){ - damage = 0; - Buff.affect(enemy, ArmorBreak.class,5f).level(20); - } - return damage; - } - - @Override - protected boolean canAttack(Char enemy) { - return Dungeon.level.distance( pos, enemy.pos ) <= 3 ; - } - - - private static final HashSet> IMMUNITIES = new HashSet>(); - static { - IMMUNITIES.add(Locked.class); - IMMUNITIES.add(Burning.class); - IMMUNITIES.add(Fire.class); - IMMUNITIES.add(WandOfFirebolt.class); - } - - @Override - public HashSet> immunities() { - return IMMUNITIES; - } -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/FishProtector.java b/java/com/hmdzl/spspd/change/actors/mobs/FishProtector.java deleted file mode 100644 index fc4e9ab4..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/FishProtector.java +++ /dev/null @@ -1,147 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs; - -import java.util.HashSet; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.ResultDescriptions; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Invisibility; -import com.hmdzl.spspd.change.actors.buffs.Silent; -import com.hmdzl.spspd.change.effects.particles.SparkParticle; -import com.hmdzl.spspd.change.items.VioletDewdrop; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.traps.LightningTrap; -import com.hmdzl.spspd.change.mechanics.Ballistica; -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.hmdzl.spspd.change.sprites.FishProtectorSprite; -import com.hmdzl.spspd.change.utils.GLog; - -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.noosa.Camera; -import com.watabou.utils.Callback; -import com.watabou.utils.Random; - -public class FishProtector extends Mob implements Callback { - - private static final float TIME_TO_ZAP = 2f; - - private static final String TXT_LIGHTNING_KILLED = "%s's lightning bolt killed you..."; - - { - spriteClass = FishProtectorSprite.class; - - EXP = 1; - state = HUNTING; - flying = true; - - HP = HT = 300; - evadeSkill = 25; - - loot = new VioletDewdrop(); - lootChance = 1f; - - properties.add(Property.ELEMENT); - } - - @Override - public int damageRoll() { - return Random.NormalIntRange(12, 20); - } - - @Override - public int hitSkill(Char target) { - return 25; - } - - @Override - public int drRoll() { - return Random.NormalIntRange(0, 15); - } - - - @Override - protected boolean canAttack(Char enemy) { if (buff(Silent.class) != null){ - return Level.adjacent(pos, enemy.pos) && (!isCharmedBy(enemy)); - } else - return new Ballistica( pos, enemy.pos, Ballistica.MAGIC_BOLT).collisionPos == enemy.pos; - } - - @Override - protected boolean doAttack(Char enemy) { - - if (Level.distance(pos, enemy.pos) <= 1) { - - return super.doAttack(enemy); - - } else { - - boolean visible = Level.fieldOfView[pos] - || Level.fieldOfView[enemy.pos]; - if (visible) { - ((FishProtectorSprite) sprite).zap(enemy.pos); - } - - spend(TIME_TO_ZAP); - - if (hit(this, enemy, true)) { - int dmg = Random.Int(25, 60); - if (Level.water[enemy.pos] && !enemy.flying) { - dmg *= 1.5f; - } - enemy.damage(dmg, this); - - enemy.sprite.centerEmitter().burst(SparkParticle.FACTORY, 3); - enemy.sprite.flash(); - - if (enemy == Dungeon.hero) { - - Camera.main.shake(2, 0.3f); - - if (!enemy.isAlive()) { - Dungeon.fail( Messages.format(ResultDescriptions.MOB) ); - //GLog.n(Messages.get(this, "zap_kill")); - } - } - } else { - enemy.sprite - .showStatus(CharSprite.NEUTRAL, enemy.defenseVerb()); - } - - return !visible; - } - } - - @Override - public void call() { - next(); - } - - - private static final HashSet> RESISTANCES = new HashSet>(); - static { - RESISTANCES.add(LightningTrap.Electricity.class); - RESISTANCES.add(Invisibility.class); - } - - @Override - public HashSet> resistances() { - return RESISTANCES; - } -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/FlyingProtector.java b/java/com/hmdzl/spspd/change/actors/mobs/FlyingProtector.java deleted file mode 100644 index 020ab713..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/FlyingProtector.java +++ /dev/null @@ -1,153 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs; - -import java.util.HashSet; - -import com.hmdzl.spspd.change.actors.buffs.Silent; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.ResultDescriptions; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.effects.particles.SparkParticle; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.traps.LightningTrap; -import com.hmdzl.spspd.change.mechanics.Ballistica; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.hmdzl.spspd.change.sprites.FlyingProtectorSprite; -import com.hmdzl.spspd.change.utils.GLog; - -import com.watabou.noosa.Camera; -import com.watabou.utils.Callback; -import com.watabou.utils.Random; - -public class FlyingProtector extends Mob implements Callback { - - private static final float TIME_TO_ZAP = 2f; - - private static final float SPAWN_DELAY = 0.2f; - - - private static final String TXT_LIGHTNING_KILLED = "%s's lightning bolt killed you..."; - - { - spriteClass = FlyingProtectorSprite.class; - - EXP = 5; - state = HUNTING; - flying = true; - - HP = HT = 50 + Dungeon.depth * 4; - evadeSkill = 4 + Dungeon.depth * 1; - - properties.add(Property.ELEMENT); - } - - @Override - public int damageRoll() { - return Random.NormalIntRange(20, 30); - } - - @Override - public int hitSkill(Char target) { - return (int) ((9 + Dungeon.depth)); - } - - @Override - public int drRoll() { - return Random.NormalIntRange(0, Dungeon.depth); - } - - @Override - protected boolean canAttack(Char enemy) { if (buff(Silent.class) != null){ - return Level.adjacent(pos, enemy.pos) && (!isCharmedBy(enemy)); - } else - return new Ballistica( pos, enemy.pos, Ballistica.MAGIC_BOLT).collisionPos == enemy.pos; - } - - @Override - protected boolean doAttack(Char enemy) { - - if (Level.distance(pos, enemy.pos) <= 1) { - - return super.doAttack(enemy); - - } else { - - boolean visible = Level.fieldOfView[pos] - || Level.fieldOfView[enemy.pos]; - if (visible) { - ((FlyingProtectorSprite) sprite).zap(enemy.pos); - } - - spend(TIME_TO_ZAP); - - if (hit(this, enemy, true)) { - int dmg = Random.Int(25, 40); - if (Level.water[enemy.pos] && !enemy.flying) { - dmg *= 1.5f; - } - enemy.damage(dmg, this); - - enemy.sprite.centerEmitter().burst(SparkParticle.FACTORY, 3); - enemy.sprite.flash(); - - if (enemy == Dungeon.hero) { - - Camera.main.shake(2, 0.3f); - - if (!enemy.isAlive()) { - Dungeon.fail( Messages.format(ResultDescriptions.MOB) ); - //GLog.n(Messages.get(this, "kill")); - } - } - } else { - enemy.sprite - .showStatus(CharSprite.NEUTRAL, enemy.defenseVerb()); - } - - return !visible; - } - } - - public static FlyingProtector spawnAt(int pos) { - - FlyingProtector b = new FlyingProtector(); - - b.pos = pos; - b.state = b.HUNTING; - GameScene.add(b, SPAWN_DELAY); - return b; - } - - @Override - public void call() { - next(); - } - - private static final HashSet> RESISTANCES = new HashSet>(); - static { - RESISTANCES.add(LightningTrap.Electricity.class); - } - - @Override - public HashSet> resistances() { - return RESISTANCES; - } -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/ForestProtector.java b/java/com/hmdzl/spspd/change/actors/mobs/ForestProtector.java deleted file mode 100644 index e7d93d0c..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/ForestProtector.java +++ /dev/null @@ -1,145 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs; - -import java.util.HashSet; - -import com.hmdzl.spspd.change.actors.buffs.Silent; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.ResultDescriptions; -import com.hmdzl.spspd.change.Statistics; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.effects.particles.SparkParticle; -import com.hmdzl.spspd.change.items.VioletDewdrop; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.traps.LightningTrap; -import com.hmdzl.spspd.change.mechanics.Ballistica; -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.hmdzl.spspd.change.sprites.ForestProtectorSprite; -import com.hmdzl.spspd.change.utils.GLog; - -import com.watabou.noosa.Camera; -import com.watabou.utils.Callback; -import com.watabou.utils.Random; - -public class ForestProtector extends Mob implements Callback { - - private static final float TIME_TO_ZAP = 2f; - - private static final String TXT_LIGHTNING_KILLED = "%s's lightning bolt killed you..."; - - { - spriteClass = ForestProtectorSprite.class; - - - EXP = 1; - state = HUNTING; - flying = true; - - HP = HT = 250; - evadeSkill = 10; - - loot = new VioletDewdrop(); - lootChance = 1f; - - properties.add(Property.ELEMENT); - } - - @Override - public int damageRoll() { - return Random.NormalIntRange(5, 10); - } - - @Override - public int hitSkill(Char target) { - return 16; - } - - @Override - public int drRoll() { - return Random.NormalIntRange(0, 5); - } - - @Override - protected boolean canAttack(Char enemy) { if (buff(Silent.class) != null){ - return Level.adjacent(pos, enemy.pos) && (!isCharmedBy(enemy)); - } else - return new Ballistica( pos, enemy.pos, Ballistica.MAGIC_BOLT).collisionPos == enemy.pos; - } - - @Override - protected boolean doAttack(Char enemy) { - - if (Level.distance(pos, enemy.pos) <= 1) { - - return super.doAttack(enemy); - - } else { - - boolean visible = Level.fieldOfView[pos] - || Level.fieldOfView[enemy.pos]; - if (visible) { - ((ForestProtectorSprite) sprite).zap(enemy.pos); - } - - spend(TIME_TO_ZAP); - - if (hit(this, enemy, true)) { - int dmg = Random.Int(5+Math.round(Statistics.archersKilled/10), 10+Math.round(Statistics.archersKilled/5)); - if (Level.water[enemy.pos] && !enemy.flying) { - dmg *= 1.5f; - } - enemy.damage(dmg, this); - - enemy.sprite.centerEmitter().burst(SparkParticle.FACTORY, 3); - enemy.sprite.flash(); - - if (enemy == Dungeon.hero) { - - Camera.main.shake(2, 0.3f); - - if (!enemy.isAlive()) { - Dungeon.fail(Messages.format(ResultDescriptions.MOB)); - //GLog.n(Messages.get(this, "kill")); - } - } - } else { - enemy.sprite - .showStatus(CharSprite.NEUTRAL, enemy.defenseVerb()); - } - - return !visible; - } - } - - @Override - public void call() { - next(); - } - - private static final HashSet> RESISTANCES = new HashSet>(); - static { - RESISTANCES.add(LightningTrap.Electricity.class); - } - - @Override - public HashSet> resistances() { - return RESISTANCES; - } -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/Gnoll.java b/java/com/hmdzl/spspd/change/actors/mobs/Gnoll.java deleted file mode 100644 index 54d73b39..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/Gnoll.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.buffs.Locked; -import com.hmdzl.spspd.change.items.Generator; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.items.Gold; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.sprites.GnollSprite; -import com.watabou.utils.Random; - -public class Gnoll extends Mob { - - { - spriteClass = GnollSprite.class; - - HP = HT = 70+(adj(0)*Random.NormalIntRange(3, 7)); - evadeSkill = 9+adj(1); - - - EXP = 10; - maxLvl = 18; - - loot = Gold.class; - lootChance = 0.5f; - - lootOther = Generator.random(Generator.Category.RANGEWEAPON); - lootChanceOther = 0.5f; // by default, see die() - - properties.add(Property.GNOLL); - } - - @Override - public int damageRoll() { - return Random.NormalIntRange(10+adj(0), 20+adj(0)); - } - - - @Override - protected boolean canAttack(Char enemy) {if (buff(Locked.class) != null){ - return Level.adjacent(pos, enemy.pos) && (!isCharmedBy(enemy)); - } else - return Dungeon.level.distance( pos, enemy.pos ) <= 2 ; - } - - @Override - public int hitSkill(Char target) { - return 12+adj(0); - } - - @Override - public int drRoll() { - return Random.NormalIntRange(5, 8); - } - -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/GnollArcher.java b/java/com/hmdzl/spspd/change/actors/mobs/GnollArcher.java deleted file mode 100644 index a34e0d09..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/GnollArcher.java +++ /dev/null @@ -1,131 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.Statistics; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Locked; -import com.hmdzl.spspd.change.items.Gold; -import com.hmdzl.spspd.change.items.TenguKey; -import com.hmdzl.spspd.change.items.TreasureMap; -import com.hmdzl.spspd.change.items.challengelists.SewerChallenge; -import com.hmdzl.spspd.change.items.food.completefood.GoldenNut; -import com.hmdzl.spspd.change.items.reward.SewerReward; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfSacrifice; -import com.hmdzl.spspd.change.items.weapon.missiles.ForestDart; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.mechanics.Ballistica; -import com.hmdzl.spspd.change.sprites.GnollArcherSprite; -import com.hmdzl.spspd.change.utils.GLog; - -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.utils.Random; - -public class GnollArcher extends Mob { - - private static final String TXT_KILLCOUNT = "Gnoll Archer Kill Count: %s"; - { - //name = "gnollarcher"; - spriteClass = GnollArcherSprite.class; - - HP = HT = 25 + Statistics.archersKilled; - evadeSkill = 5; - - EXP = 1; - - baseSpeed = 0.9f; - - state = WANDERING; - - properties.add(Property.GNOLL); - - } - - @Override - public int hitSkill(Char target) { - return 30; - } - - @Override - protected boolean canAttack(Char enemy) { - Ballistica attack = new Ballistica( pos, enemy.pos, Ballistica.PROJECTILE); - if (buff(Locked.class) != null){ - return Level.adjacent(pos, enemy.pos) && (!isCharmedBy(enemy)); - } else - - return !Level.adjacent(pos, enemy.pos) && attack.collisionPos == enemy.pos; - } - - @Override - public int damageRoll() { - return Random.NormalIntRange(1+Math.round(Statistics.archersKilled/10), 8+Math.round(Statistics.archersKilled/5)); - } - - @Override - public int drRoll() { - return 0; - } - - @Override - protected boolean getCloser(int target) { - if (Level.adjacent(pos, enemy.pos)) { - return getFurther(target); - } else { - return super.getCloser(target); - } - } - - @Override - public void die(Object cause) { - super.die(cause); - if (Dungeon.depth > 25) { - Dungeon.level.drop(new ForestDart(3), pos).sprite.drop(); - } - - Statistics.archersKilled++; - GLog.w(Messages.get(Mob.class, "killcount", Statistics.archersKilled)); - - - if (!Dungeon.limitedDrops.sewerkey.dropped() && Dungeon.depth < 27) { - Dungeon.limitedDrops.sewerkey.drop(); - Dungeon.level.drop(new SewerChallenge(), pos).sprite.drop(); - explodeDew(pos); - } else { - explodeDew(pos); - } - - if (Statistics.archersKilled == 25) { - Dungeon.limitedDrops.treasuremap.drop(); - Dungeon.level.drop(new TreasureMap(), pos).sprite.drop(); - } - - if (Statistics.archersKilled == 50) { - Dungeon.level.drop(new ScrollOfSacrifice(), pos).sprite.drop(); - } - - if (Statistics.archersKilled == 100) { - Dungeon.level.drop(new SewerReward(), pos).sprite.drop(); - } - - if (Statistics.goldThievesKilled > 99 && Statistics.skeletonsKilled > 99 - && Statistics.albinoPiranhasKilled > 99 && Statistics.archersKilled == 100 ) { - Dungeon.level.drop(new GoldenNut(), pos).sprite.drop(); - } - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/actors/mobs/GnollKing.java b/java/com/hmdzl/spspd/change/actors/mobs/GnollKing.java deleted file mode 100644 index ce476c3d..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/GnollKing.java +++ /dev/null @@ -1,339 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs; - -import java.util.ArrayList; -import java.util.HashSet; - -import com.hmdzl.spspd.change.items.quest.GnollClothes; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.items.Gold; -import com.hmdzl.spspd.change.sprites.GnollKingSprite; -import com.hmdzl.spspd.change.sprites.GnollKeeperSprite; -import com.hmdzl.spspd.change.items.AdamantRing; -import com.hmdzl.spspd.change.actors.buffs.Burning; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.blobs.Blob; -import com.hmdzl.spspd.change.actors.blobs.CorruptGas; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Cripple; -import com.hmdzl.spspd.change.actors.buffs.Roots; -import com.hmdzl.spspd.change.actors.buffs.Weakness; -import com.hmdzl.spspd.change.actors.buffs.Amok; -import com.hmdzl.spspd.change.actors.buffs.Bleeding; -import com.hmdzl.spspd.change.actors.buffs.Charm; -import com.hmdzl.spspd.change.actors.buffs.Poison; -import com.hmdzl.spspd.change.actors.buffs.Sleep; -import com.hmdzl.spspd.change.actors.buffs.Terror; -import com.hmdzl.spspd.change.actors.buffs.Vertigo; -import com.hmdzl.spspd.change.actors.buffs.Paralysis; -import com.hmdzl.spspd.change.actors.blobs.ToxicGas; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfPsionicBlast; -import com.hmdzl.spspd.change.items.weapon.enchantments.EnchantmentDark; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.levels.Level; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -public class GnollKing extends Mob { - - protected int breaks = 0; - - { - spriteClass = GnollKingSprite.class; - - HP = HT = 1000; - evadeSkill = 0; - - EXP = 30; - - baseSpeed = 0.75f; - - loot = new GnollClothes(); - lootChance = 1f; - - FLEEING = new Fleeing(); - - properties.add(Property.GNOLL); - properties.add(Property.BOSS); - } - - @Override - public int damageRoll() { - return Random.NormalIntRange(15,25); - } - - @Override - public int hitSkill(Char target) { - return 100; - } - - @Override - public int drRoll() { - return Random.NormalIntRange(0, 5); - } - - @Override - public float speed() { - if (breaks == 1) return 4*super.speed(); - else return super.speed(); - } - - - @Override - public boolean act() { - - if( 3 - breaks > 4 * HP / HT ) { - breaks++; - yell(Messages.get(this,"angry")); - return true; - } - - if (breaks == 1){ - state = FLEEING; - } - - if (breaks == 2){ - state = HUNTING; - } - - if (breaks > 0){ - int newPos = -1; - for (int i = 0; i < 10; i++) { - newPos = Dungeon.level.randomRespawnCellMob(); - if (newPos != -1) { - break; - } - } - if (Dungeon.level.mobs.size()<4){ - GnollKeeper.spawnAroundChance(newPos); - } - } - return super.act(); - } - - @Override - public int attackProc(Char enemy, int damage) { - - if (breaks == 0){ - if (Random.Int(2) == 0) { - if(enemy == Dungeon.hero){ - Buff.prolong(enemy, Cripple.class, 3 ); - } - } - } - - - if (breaks == 2){ - if (Random.Int(2) == 0) { - if(enemy == Dungeon.hero){ - Buff.prolong(enemy, Roots.class, 3 ); - } - } - } - - if (breaks == 3){ - if (Random.Int(2) == 0) { - if(enemy == Dungeon.hero){ - Buff.prolong(enemy, Weakness.class, 3); - } - } - } - - return damage; - } - - @Override - public int defenseProc(Char enemy, int damage) { - - int dmg = Random.IntRange(0, 20); - - if (breaks == 3){ - if (dmg > 0 || (Random.Int(3) == 0 )) { - enemy.damage(dmg, this); - } - } - return super.defenseProc(enemy, damage); - } - - @Override - public void damage(int dmg, Object src) { - - dmg = Random.Int(10,20); - - if (breaks == 2){ - if (dmg > 15){ - GameScene.add(Blob.seed(pos, 30, CorruptGas.class)); - } - } - super.damage(dmg, src); - } - - @Override - protected boolean canAttack(Char enemy) { - - if (breaks == 2){ - return Dungeon.level.distance( pos, enemy.pos ) <= 2 ;} - else return Dungeon.level.distance( pos, enemy.pos ) <= 1; - } - - @Override - public void die(Object cause) { - - super.die(cause); - - GameScene.bossSlain(); - Dungeon.level.drop(new AdamantRing(), pos).sprite.drop(); - Dungeon.level.drop(new Gold(Random.Int(1000, 1500)), pos).sprite.drop(); - - - Dungeon.gnollkingkilled=true; - - yell(Messages.get(this,"die")); - - } - - @Override - public void notice() { - super.notice(); - yell(Messages.get(this,"notice")); - } - - - private static final HashSet> RESISTANCES = new HashSet>(); - private static final HashSet> IMMUNITIES = new HashSet>(); - static { - RESISTANCES.add(ToxicGas.class); - RESISTANCES.add(Poison.class); - RESISTANCES.add(EnchantmentDark.class); - IMMUNITIES.add(EnchantmentDark.class); - IMMUNITIES.add(Terror.class); - IMMUNITIES.add(Amok.class); - IMMUNITIES.add(Charm.class); - IMMUNITIES.add(Sleep.class); - IMMUNITIES.add(Burning.class); - IMMUNITIES.add(ToxicGas.class); - IMMUNITIES.add(ScrollOfPsionicBlast.class); - IMMUNITIES.add(Vertigo.class); - IMMUNITIES.add(Paralysis.class); - IMMUNITIES.add(Bleeding.class); - IMMUNITIES.add(CorruptGas.class); - } - - @Override - public HashSet> immunities() { - return IMMUNITIES; - } - - @Override - public HashSet> resistances() { - return RESISTANCES; - } - - private static final String BREAKS = "breaks"; - - @Override - public void storeInBundle( Bundle bundle ) { - super.storeInBundle(bundle); - bundle.put( BREAKS, breaks ); - } - - @Override - public void restoreFromBundle( Bundle bundle ) { - super.restoreFromBundle(bundle); - breaks = bundle.getInt( BREAKS ); - } - public static class GnollKeeper extends Mob { - - private static final float SPAWN_DELAY = 10f; - - { - //name = "Gnoll Keeper"; - spriteClass = GnollKeeperSprite.class; - - HP = HT = 5; - evadeSkill = 10; - - EXP = 0; - - state = WANDERING; - } - - @Override - public int hitSkill(Char target) { - return 36; - } - - @Override - public int damageRoll() { - return Random.NormalIntRange(0, 0); - } - - @Override - public int drRoll() { - return 1; - } - - @Override - public int attackProc(Char enemy, int damage) { - yell(Messages.get(this ,"safe")); - return damage; - } - - @Override - public boolean act() { - - return super.act(); - } - - public static void spawnAround(int pos) { - for (int n : Level.NEIGHBOURS4) { - int cell = pos + n; - if (Level.passable[cell] && Actor.findChar(cell) == null) { - spawnAt(cell); - } - } - } - - public static void spawnAroundChance(int pos) { - for (int n : Level.NEIGHBOURS4) { - int cell = pos + n; - if (Level.passable[cell] && Actor.findChar(cell) == null && Random.Float() < 0.75f) { - spawnAt(cell); - } - } - } - - public static GnollKeeper spawnAt(int pos) { - - GnollKeeper g1 = new GnollKeeper(); - - g1.pos = pos; - g1.state = g1.HUNTING; - GameScene.add(g1, SPAWN_DELAY); - - return g1; - - } - - } - -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/actors/mobs/GnollShaman.java b/java/com/hmdzl/spspd/change/actors/mobs/GnollShaman.java deleted file mode 100644 index 1d30b355..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/GnollShaman.java +++ /dev/null @@ -1,145 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs; - -import java.util.HashSet; - -import com.hmdzl.spspd.change.actors.buffs.Silent; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.ResultDescriptions; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.effects.particles.SparkParticle; -import com.hmdzl.spspd.change.items.Generator; -import com.hmdzl.spspd.change.items.wands.WandOfLightning; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.traps.LightningTrap; -import com.hmdzl.spspd.change.mechanics.Ballistica; -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.hmdzl.spspd.change.sprites.ShamanSprite; - -import com.watabou.noosa.Camera; -import com.watabou.utils.Callback; -import com.watabou.utils.Random; - -public class GnollShaman extends Mob implements Callback { - - private static final float TIME_TO_ZAP = 2f; - - private static final String TXT_LIGHTNING_KILLED = "%s's lightning bolt killed you..."; - - { - spriteClass = ShamanSprite.class; - - HP = HT = 80+(adj(0)*Random.NormalIntRange(2, 5)); - evadeSkill = 15+adj(0); - - EXP = 10; - maxLvl = 25; - - loot = Generator.Category.SCROLL; - lootChance = 0.15f; - - lootOther = new WandOfLightning(); - lootChanceOther = 0.02f; - - properties.add(Property.GNOLL); - } - - @Override - public int damageRoll() { - return Random.NormalIntRange(14, 20+adj(0)); - } - - @Override - public int hitSkill(Char target) { - return 16+adj(0); - } - - @Override - public int drRoll() { - return Random.NormalIntRange(0, 4); - } - - @Override - protected boolean canAttack(Char enemy) { if (buff(Silent.class) != null){ - return Level.adjacent(pos, enemy.pos) && (!isCharmedBy(enemy)); - } else - return new Ballistica( pos, enemy.pos, Ballistica.MAGIC_BOLT).collisionPos == enemy.pos; - } - - @Override - protected boolean doAttack(Char enemy) { - - if (Level.distance(pos, enemy.pos) <= 1) { - - return super.doAttack(enemy); - - } else { - - boolean visible = Level.fieldOfView[pos] - || Level.fieldOfView[enemy.pos]; - if (visible) { - ((ShamanSprite) sprite).zap(enemy.pos); - } - - spend(TIME_TO_ZAP); - - if (hit(this, enemy, true)) { - int dmg = Random.Int(2+adj(0), 12+adj(3)); - if (Level.water[enemy.pos] && !enemy.flying) { - dmg *= 1.5f; - } - enemy.damage(dmg, this); - - enemy.sprite.centerEmitter().burst(SparkParticle.FACTORY, 3); - enemy.sprite.flash(); - - if (enemy == Dungeon.hero) { - - Camera.main.shake(2, 0.3f); - - if (!enemy.isAlive()) { - Dungeon.fail( Messages.format(ResultDescriptions.MOB)); - //GLog.n(Messages.get(this, "zap_kill")); - } - } - } else { - enemy.sprite - .showStatus(CharSprite.NEUTRAL, enemy.defenseVerb()); - } - - return !visible; - } - } - - @Override - public void call() { - next(); - } - - private static final HashSet> RESISTANCES = new HashSet>(); - static { - RESISTANCES.add(LightningTrap.Electricity.class); - } - - @Override - public HashSet> resistances() { - return RESISTANCES; - } -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/GnollTrickster.java b/java/com/hmdzl/spspd/change/actors/mobs/GnollTrickster.java deleted file mode 100644 index 627475c0..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/GnollTrickster.java +++ /dev/null @@ -1,127 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs; - -import com.hmdzl.spspd.change.actors.buffs.Locked; -import com.hmdzl.spspd.change.actors.mobs.npcs.Ghost; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.Blob; -import com.hmdzl.spspd.change.actors.blobs.Fire; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Burning; -import com.hmdzl.spspd.change.actors.buffs.Poison; -import com.hmdzl.spspd.change.items.Generator; -import com.hmdzl.spspd.change.items.weapon.missiles.PoisonDart; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.mechanics.Ballistica; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.GnollTricksterSprite; - -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - - public class GnollTrickster extends Gnoll { - { - //name = "gnolltrickster"; - spriteClass = GnollTricksterSprite.class; - - HP = HT = 60; - evadeSkill = 5; - - EXP = 5; - - state = WANDERING; - - loot = Generator.random(PoisonDart.class); - lootChance = 1f; - - properties.add(Property.GNOLL); - properties.add(Property.MINIBOSS); - } - - private int combo = 0; - - @Override - public int hitSkill(Char target) { - return 16; - } - - @Override - protected boolean canAttack(Char enemy) { - Ballistica attack = new Ballistica( pos, enemy.pos, Ballistica.PROJECTILE); - if (buff(Locked.class) != null){ - return Level.adjacent(pos, enemy.pos) && (!isCharmedBy(enemy)); - } else - return !Level.adjacent( pos, enemy.pos ) && attack.collisionPos == enemy.pos; - } - - @Override - public int attackProc(Char enemy, int damage) { - // The gnoll's attacks get more severe the more the player lets it - // hit them - combo++; - int effect = Random.Int(4) + combo; - - if (effect > 2) { - - if (effect >= 6 && enemy.buff(Burning.class) == null) { - - if (Level.flamable[enemy.pos]) - GameScene.add(Blob.seed(enemy.pos, 4, Fire.class)); - Buff.affect(enemy, Burning.class).reignite(enemy); - - } else - Buff.affect(enemy, Poison.class).set( - (effect - 2) * Poison.durationFactor(enemy)); - - } - return damage; - } - - @Override - protected boolean getCloser(int target) { - combo = 0; // if he's moving, he isn't attacking, reset combo. - if (Level.adjacent(pos, enemy.pos)) { - return getFurther(target); - } else { - return super.getCloser(target); - } - } - - @Override - public void die(Object cause) { - super.die(cause); - - Ghost.Quest.process(); - } - - private static final String COMBO = "combo"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(COMBO, combo); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - combo = bundle.getInt(COMBO); - } - - } \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/actors/mobs/GoldCollector.java b/java/com/hmdzl/spspd/change/actors/mobs/GoldCollector.java deleted file mode 100644 index 0c231b73..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/GoldCollector.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Taunt; -import com.hmdzl.spspd.change.items.food.meatfood.Meat; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.RatSprite; -import com.watabou.utils.Random; - -public class GoldCollector extends Mob { - - { - spriteClass = RatSprite.class; - - HP = HT = Dungeon.gold; - evadeSkill = Dungeon.gold; - baseSpeed = 3f; - flying = true; - - state = WANDERING; - - properties.add(Property.BOSS); - } - - @Override - public int damageRoll() { - return Dungeon.gold; - } - - @Override - public int hitSkill(Char target) { - return Dungeon.gold; - } - - @Override - public int attackProc(Char enemy, int damage) { - if (enemy.buff(Taunt.class)== null && enemy == Dungeon.hero) { - Buff.affect(enemy, Taunt.class); - Dungeon.gold=0; - damage = 0; - this.damage(this.HT*2,this); - return damage; - } else return damage; - } - - @Override - public int drRoll() { - return Dungeon.gold; - } - - @Override - public void add( Buff buff ) { - //in other words, can't be directly affected by buffs/debuffs. - } -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/GoldOrc.java b/java/com/hmdzl/spspd/change/actors/mobs/GoldOrc.java deleted file mode 100644 index 86ecd8b6..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/GoldOrc.java +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs; - -import java.util.HashSet; - -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Amok; -import com.hmdzl.spspd.change.actors.blobs.Blob; -import com.hmdzl.spspd.change.actors.blobs.CorruptGas; -import com.hmdzl.spspd.change.actors.buffs.Terror; -import com.hmdzl.spspd.change.actors.buffs.Vertigo; -import com.hmdzl.spspd.change.sprites.GoldOrcSprite; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.watabou.utils.Random; - -public class GoldOrc extends Mob { - - { - spriteClass = GoldOrcSprite.class; - state = SLEEPING; - - HP = HT = 500; - evadeSkill = 35; - - EXP = 25; - - properties.add(Property.ORC); - properties.add(Property.DEMONIC); - } - - @Override - public int damageRoll() { - return Random.NormalIntRange(55, 115); - } - - @Override - public int hitSkill(Char target) { - return 55; - } - - @Override - protected float attackDelay() { - return 1.5f; - } - - @Override - public int drRoll() { - return Random.NormalIntRange(16, 32); - } - - @Override - public void damage(int dmg, Object src) { - if (dmg > HT/8){ - GameScene.add(Blob.seed(pos, 30, CorruptGas.class)); - } - super.damage(dmg, src); - } - - - private static final HashSet> RESISTANCES = new HashSet>(); - static { - } - - @Override - public HashSet> resistances() { - return RESISTANCES; - } - - private static final HashSet> IMMUNITIES = new HashSet>(); - static { - IMMUNITIES.add(Amok.class); - IMMUNITIES.add(Terror.class); - IMMUNITIES.add(CorruptGas.class); - IMMUNITIES.add(Vertigo.class); - - } - - @Override - public HashSet> immunities() { - return IMMUNITIES; - } -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/GoldThief.java b/java/com/hmdzl/spspd/change/actors/mobs/GoldThief.java deleted file mode 100644 index e47b3964..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/GoldThief.java +++ /dev/null @@ -1,183 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs; - -import com.hmdzl.spspd.change.items.challengelists.CityChallenge; -import com.hmdzl.spspd.change.items.food.completefood.GoldenNut; -import com.hmdzl.spspd.change.items.reward.CityReward; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfSacrifice; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.Statistics; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Terror; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.items.AncientCoin; -import com.hmdzl.spspd.change.items.Gold; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.hmdzl.spspd.change.sprites.GoldThiefSprite; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -public class GoldThief extends Mob { - - protected static final String TXT_STOLE = "%s stole %s gold from you!"; - private static final String TXT_KILLCOUNT = "Gold Thief Kill Count: %s"; - - public Item item; - - { - spriteClass = GoldThiefSprite.class; - - HP = HT = 100+Statistics.goldThievesKilled; - evadeSkill = 26; - - EXP = 1; - - FLEEING = new Fleeing(); - - properties.add(Property.ELF); - } - - private int goldtodrop = 0; - - private static final String GOLDTODROP = "goldtodrop"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(GOLDTODROP, goldtodrop); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - goldtodrop = bundle.getInt(GOLDTODROP); - } - - @Override - public int damageRoll() { - return Random.NormalIntRange(20, 30+Statistics.goldThievesKilled/2); - } - - @Override - protected float attackDelay() { - return 0.75f; - } - - @Override - public void die(Object cause) { - - super.die(cause); - Statistics.goldThievesKilled++; - GLog.w(Messages.get(Mob.class,"killcount",Statistics.goldThievesKilled)); - - - if (item != null) { - Dungeon.level.drop(item, pos).sprite.drop(); - } - - if (!Dungeon.limitedDrops.citykey.dropped() && Dungeon.depth<27) { - Dungeon.limitedDrops.citykey.drop(); - Dungeon.level.drop(new CityChallenge(), pos).sprite.drop(); - explodeDew(pos); - } else { - explodeDew(pos); - } - - if(Statistics.goldThievesKilled == 25) { - Dungeon.limitedDrops.ancientcoin.drop(); - Dungeon.level.drop(new AncientCoin(), pos).sprite.drop(); - } - - if(Statistics.goldThievesKilled == 50) { - Dungeon.level.drop(new ScrollOfSacrifice(), pos).sprite.drop(); - } - - if(Statistics.goldThievesKilled == 100) { - Dungeon.level.drop(new CityReward(), pos).sprite.drop(); - } - - if (Statistics.goldThievesKilled == 100 && Statistics.skeletonsKilled>99 - && Statistics.albinoPiranhasKilled>99 && Statistics.archersKilled>99){ - Dungeon.level.drop(new GoldenNut(), pos).sprite.drop(); - } - - } - - @Override - protected Item createLoot() { - return new Gold(Random.NormalIntRange(goldtodrop+50, goldtodrop+100)); - } - - @Override - public int hitSkill(Char target) { - return 40; - } - - @Override - public int drRoll() { - return 13+Math.round((Statistics.goldThievesKilled+1/10)+1); - } - - @Override - public int attackProc(Char enemy, int damage) { - if (item == null && enemy instanceof Hero && steal((Hero) enemy)) { - state = FLEEING; - } - - return damage; - } - - @Override - public int defenseProc(Char enemy, int damage) { - if (state == FLEEING) { - Dungeon.level.drop(new Gold(), pos).sprite.drop(); - } - - return damage; - } - - protected boolean steal(Hero hero) { - - Gold gold = new Gold(Random.Int(100, 300)); - if (gold.quantity() > 0) { - goldtodrop = Math.min((gold.quantity()+100),Dungeon.gold); - Dungeon.gold -= goldtodrop; - GLog.w(Messages.get(GoldThief.class, "stole", gold.quantity())); - return true; - } else { - return false; - } - } - - private class Fleeing extends Mob.Fleeing { - @Override - protected void nowhereToRun() { - if (buff(Terror.class) == null) { - sprite.showStatus(CharSprite.NEGATIVE, Messages.get(Mob.class, "rage")); - state = HUNTING; - } else { - super.nowhereToRun(); - } - } - } -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/Golem.java b/java/com/hmdzl/spspd/change/actors/mobs/Golem.java deleted file mode 100644 index 994b9087..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/Golem.java +++ /dev/null @@ -1,126 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs; - -import java.util.HashSet; - -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.hero.HeroClass; -import com.hmdzl.spspd.change.items.StoneOre; -import com.hmdzl.spspd.change.items.Generator; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.Blob; -import com.hmdzl.spspd.change.actors.blobs.TarGas; -import com.hmdzl.spspd.change.actors.buffs.Amok; -import com.hmdzl.spspd.change.actors.buffs.Tar; -import com.hmdzl.spspd.change.actors.buffs.Sleep; -import com.hmdzl.spspd.change.actors.buffs.Terror; -import com.hmdzl.spspd.change.actors.mobs.npcs.Imp; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.GolemSprite; - -import com.watabou.utils.Random; - -public class Golem extends Mob { - - { - spriteClass = GolemSprite.class; - - HP = HT = 180+(adj(0)*Random.NormalIntRange(4, 7)); - evadeSkill = 18+adj(1); - - EXP = 15; - maxLvl = 30; - - loot = new StoneOre(); - lootChance = 0.5f; - - properties.add(Property.MECH); - } - - @Override - public boolean act() { - //GameScene.add(Blob.seed(pos, 30, TarGas.class)); - return super.act(); - } - - @Override - public int damageRoll() { - return Random.NormalIntRange(20+adj(0), 60+adj(1)); - } - - @Override - public int hitSkill(Char target) { - return 28+adj(1); - } - - @Override - protected float attackDelay() { - return 1.5f; - } - - @Override - public int drRoll() { - return Random.NormalIntRange(10, 15); - } - - @Override - public void damage(int dmg, Object src) { - if (dmg > HT/8){ - GameScene.add(Blob.seed(pos, 30, TarGas.class)); - } - super.damage(dmg, src); - } - - @Override - public void die(Object cause) { - - Imp.Quest.process(this); - if (Dungeon.limitedDrops.nornstones.count<6 - && Random.Int(6)<3 - ){ - Dungeon.level.drop(Generator.random(Generator.Category.NORNSTONE), pos).sprite.drop(); - Dungeon.limitedDrops.nornstones.count++; - } - super.die(cause); - } - - private static final HashSet> RESISTANCES = new HashSet>(); - static { - } - - @Override - public HashSet> resistances() { - return RESISTANCES; - } - - private static final HashSet> IMMUNITIES = new HashSet>(); - static { - IMMUNITIES.add(Amok.class); - IMMUNITIES.add(Terror.class); - IMMUNITIES.add(Sleep.class); - IMMUNITIES.add(TarGas.class); - IMMUNITIES.add(Tar.class); - } - - @Override - public HashSet> immunities() { - return IMMUNITIES; - } -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/Goo.java b/java/com/hmdzl/spspd/change/actors/mobs/Goo.java deleted file mode 100644 index e8721007..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/Goo.java +++ /dev/null @@ -1,573 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs; - -import java.util.ArrayList; -import java.util.HashSet; - -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.blobs.Web; -import com.hmdzl.spspd.change.actors.buffs.Burning; -import com.hmdzl.spspd.change.actors.buffs.Poison; -import com.hmdzl.spspd.change.actors.buffs.Terror; -import com.hmdzl.spspd.change.effects.Pushing; -import com.hmdzl.spspd.change.items.StoneOre; -import com.hmdzl.spspd.change.items.UpgradeBlobViolet; -import com.hmdzl.spspd.change.items.wands.WandOfFirebolt; -import com.hmdzl.spspd.change.items.weapon.enchantments.EnchantmentFire; -import com.hmdzl.spspd.change.levels.Terrain; -import com.hmdzl.spspd.change.levels.features.Door; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.Badges.Badge; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.Blob; -import com.hmdzl.spspd.change.actors.blobs.GooWarn; -import com.hmdzl.spspd.change.actors.blobs.ToxicGas; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Ooze; -import com.hmdzl.spspd.change.actors.buffs.Roots; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.effects.particles.ElmoParticle; -import com.hmdzl.spspd.change.items.summon.ActiveMrDestructo; -import com.hmdzl.spspd.change.items.journalpages.Sokoban1; -import com.hmdzl.spspd.change.items.keys.SkeletonKey; -import com.hmdzl.spspd.change.items.weapon.enchantments.EnchantmentDark; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.SewerBossLevel; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.hmdzl.spspd.change.sprites.GooSprite; -import com.hmdzl.spspd.change.sprites.PoisonGooSprite; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.Camera; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -public class Goo extends Mob { - { - HP = HT = 350; - EXP = 20; - evadeSkill = 12; - spriteClass = GooSprite.class; - - loot = new UpgradeBlobViolet(); - lootChance = 0.2f; - - lootOther = new ActiveMrDestructo(); - lootChanceOther = 1f; - - properties.add(Property.ELEMENT); - properties.add(Property.BOSS); - } - - private int pumpedUp = 0; - private int goosAlive = 0; - - @Override - public int damageRoll() { - if (pumpedUp > 0) { - pumpedUp = 0; - for (int i = 0; i < Level.NEIGHBOURS9DIST2.length; i++) { - int j = pos + Level.NEIGHBOURS9DIST2[i]; - if (j >= 0 && j <= 1023 && Level.passable[j]) - CellEmitter.get(j).burst(ElmoParticle.FACTORY, 10); - } - Sample.INSTANCE.play(Assets.SND_BURNING); - return Random.NormalIntRange(5, 30); - } else { - return Random.NormalIntRange(2, 12); - } - } - - @Override - public int hitSkill(Char target) { - return (pumpedUp > 0) ? 30 : 15; - } - - @Override - public int drRoll() { - return Random.NormalIntRange(0, 2); - } - - @Override - public boolean act() { - - if (Level.water[pos] && HP < HT) { - sprite.emitter().burst( Speck.factory( Speck.HEALING ), 1 ); - HP++; - } - - return super.act(); - } - - - @Override - protected boolean canAttack(Char enemy) { - return (pumpedUp > 0) ? distance(enemy) <= 2 : super.canAttack(enemy); - } - - @Override - public int attackProc(Char enemy, int damage) { - if (Random.Int(3) == 0) { - Buff.affect(enemy, Ooze.class); - enemy.sprite.burst(0x000000, 5); - } - - if (pumpedUp > 0) { - Camera.main.shake(3, 0.2f); - } - - return damage; - } - - @Override - protected boolean doAttack(Char enemy) { - if (pumpedUp == 1) { - ((GooSprite) sprite).pumpUp(); - for (int i = 0; i < Level.NEIGHBOURS9DIST2.length; i++) { - int j = pos + Level.NEIGHBOURS9DIST2[i]; - if (j >= 0 && j <= 1023 && Level.passable[j]) - GameScene.add(Blob.seed(j, 2, GooWarn.class)); - } - pumpedUp++; - - spend(attackDelay()); - - return true; - } else if (pumpedUp >= 2 || Random.Int( (HP*2 <= HT) ? 2 : 5 ) > 0) { - - boolean visible = Dungeon.visible[pos]; - - if (visible) { - if (pumpedUp >= 2) { - ((GooSprite) sprite).pumpAttack(); - } else - sprite.attack(enemy.pos); - } else { - attack(enemy); - } - - spend(attackDelay()); - - return !visible; - - } else { - - pumpedUp++; - - ((GooSprite) sprite).pumpUp(); - - for (int i = 0; i < Level.NEIGHBOURS9.length; i++) { - int j = pos + Level.NEIGHBOURS9[i]; - GameScene.add(Blob.seed(j, 2, GooWarn.class)); - - } - - if (Dungeon.visible[pos]) { - sprite.showStatus(CharSprite.NEGATIVE, "!!!"); - GLog.n(Messages.get(this,"atk")); - } - - spend(attackDelay()); - - return true; - } - } - - @Override - public boolean attack(Char enemy) { - boolean result = super.attack(enemy); - pumpedUp = 0; - return result; - } - - @Override - protected boolean getCloser(int target) { - pumpedUp = 0; - return super.getCloser(target); - } - - @Override - public void die(Object cause) { - - super.die(cause); - - for (Mob mob : Dungeon.level.mobs) { - - if (mob instanceof Goo || mob instanceof PoisonGoo){ - goosAlive++; - } - - } - - if(goosAlive==0){ - - ((SewerBossLevel) Dungeon.level).unseal(); - - GameScene.bossSlain(); - Dungeon.level.drop(new SkeletonKey(Dungeon.depth), pos).sprite.drop(); - Badges.validateBossSlain(); - } - - Badges.Badge badgeToCheck = null; - switch (Dungeon.hero.heroClass) { - case WARRIOR: - badgeToCheck = Badge.MASTERY_WARRIOR; - break; - case MAGE: - badgeToCheck = Badge.MASTERY_MAGE; - break; - case ROGUE: - badgeToCheck = Badge.MASTERY_ROGUE; - break; - case HUNTRESS: - badgeToCheck = Badge.MASTERY_HUNTRESS; - break; - case PERFORMER: - badgeToCheck = Badge.MASTERY_PERFORMER; - break; - case SOLDIER: - badgeToCheck = Badge.MASTERY_SOLDIER; - break; - case FOLLOWER: - badgeToCheck = Badge.MASTERY_FOLLOWER; - break; - } - - - Dungeon.level.drop(new Sokoban1(), pos).sprite.drop(); - - - yell("glurp... glurp..."); - } - - protected boolean spawnedMini = false; - - @Override - public void notice() { - super.notice(); - yell("GLURP-GLURP!"); - ((SewerBossLevel) Dungeon.level).seal(); - if (!spawnedMini){ - PoisonGoo.spawnAround(pos); - spawnedMini = true; - } - } - - private final String PUMPEDUP = "pumpedup"; - - @Override - public void storeInBundle(Bundle bundle) { - - super.storeInBundle(bundle); - - bundle.put(PUMPEDUP, pumpedUp); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - - super.restoreFromBundle(bundle); - - pumpedUp = bundle.getInt(PUMPEDUP); - } - - private static final HashSet> IMMUNITIES = new HashSet>(); - private static final HashSet> RESISTANCES = new HashSet>(); - private static final HashSet> WEAKNESS = new HashSet>(); - static { - RESISTANCES.add(ToxicGas.class); - RESISTANCES.add(EnchantmentDark.class); - - - IMMUNITIES.add(Roots.class); - - WEAKNESS.add(Burning.class); - WEAKNESS.add(WandOfFirebolt.class); - WEAKNESS.add(EnchantmentFire.class); - } - - @Override - public HashSet> resistances() { - return RESISTANCES; - } - - @Override - public HashSet> immunities() { - return IMMUNITIES; - } - - @Override - public HashSet> weakness() { - return WEAKNESS; - } - - public static class PoisonGoo extends Mob { - - protected static final float SPAWN_DELAY = 2f; - - private boolean gooSplit = false; - - private int gooGeneration = 0; - private int goosAlive = 0; - - private static final String GOOGENERATION = "gooGeneration"; - - { - HP = HT = 100; - EXP = 1; - evadeSkill = 12; - spriteClass = PoisonGooSprite.class; - baseSpeed = 1.5f; - - loot = new StoneOre(); - lootChance = 0.25f; - FLEEING = new Fleeing(); - - properties.add(Property.ELEMENT); - properties.add(Property.MINIBOSS); - } - - private static final float SPLIT_DELAY = 1f; - - @Override - protected boolean act() { - boolean result = super.act(); - - if (state == FLEEING && buff(Terror.class) == null && enemy != null - && enemySeen && enemy.buff(Poison.class) == null) { - state = HUNTING; - } - if (Level.water[pos] && HP < HT) { - sprite.emitter().burst( Speck.factory( Speck.HEALING ), 1 ); - HP++; - } else if(Level.water[pos] && HP == HT && HT < 100){ - sprite.emitter().burst( Speck.factory( Speck.HEALING ), 1 ); - HT=HT+5; - HP=HT; - } - return result; - } - - @Override - public int attackProc(Char enemy, int damage) { - if (Random.Int(1) == 0) { - Buff.affect(enemy, Poison.class).set( - Random.Int(7, 10) * Poison.durationFactor(enemy)); - state = FLEEING; - } - - return damage; - } - - @Override - public void move(int step) { - if (state == FLEEING) { - GameScene.add(Blob.seed(pos, Random.Int(7, 10), Web.class)); - } - super.move(step); - } - - @Override - public int damageRoll() { - return Random.NormalIntRange(1, 10); - } - - @Override - public int hitSkill(Char target) { - return 5; - } - - @Override - public int drRoll() { - return 0; - } - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(GOOGENERATION, gooGeneration); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - gooGeneration = bundle.getInt(GOOGENERATION); - } - - @Override - public int defenseProc(Char enemy, int damage) { - gooSplit = false; - for (Mob mob : Dungeon.level.mobs) { - if (mob instanceof Goo) { - gooSplit = true; - } - } - if (HP >= damage + 2 && gooSplit) { - ArrayList candidates = new ArrayList(); - boolean[] passable = Level.passable; - - int[] neighbours = { pos + 1, pos - 1, pos + Level.getWidth(), - pos - Level.getWidth() }; - for (int n : neighbours) { - if (passable[n] && Actor.findChar(n) == null) { - candidates.add(n); - } - } - - if (candidates.size() > 0) { - PoisonGoo clone = split(); - clone.HP = (HP - damage) / 2; - clone.pos = Random.element(candidates); - clone.state = clone.HUNTING; - - if (Dungeon.level.map[clone.pos] == Terrain.DOOR) { - Door.enter(clone.pos); - } - - GameScene.add(clone, SPLIT_DELAY); - Actor.addDelayed(new Pushing(clone, pos, clone.pos), -1); - - HP -= clone.HP; - } - } - - return damage; - } - - - private PoisonGoo split() { - PoisonGoo clone = new PoisonGoo(); - clone.gooGeneration = gooGeneration + 1; - if (buff(Burning.class) != null) { - Buff.affect(clone, Burning.class).reignite(clone); - } - if (buff(Poison.class) != null) { - Buff.affect(clone, Poison.class).set(2); - } - return clone; - } - - - - - @Override - public void die(Object cause) { - - if (gooGeneration > 0){ - lootChance = 0; - } - - super.die(cause); - - for (Mob mob : Dungeon.level.mobs) { - - if (mob instanceof Goo || mob instanceof PoisonGoo){ - goosAlive++; - } - - } - - if(goosAlive==0){ - ((SewerBossLevel) Dungeon.level).unseal(); - - GameScene.bossSlain(); - Dungeon.level.drop(new SkeletonKey(Dungeon.depth), pos).sprite.drop(); - - //Dungeon.level.drop(new Gold(Random.Int(900, 2000)), pos).sprite.drop(); - - Badges.validateBossSlain(); - } else { - - //Dungeon.level.drop(new Gold(Random.Int(100, 200)), pos).sprite.drop(); - } - - yell("glurp... glurp..."); - } - - @Override - public void notice() { - super.notice(); - yell("GLURP-GLURP!"); - } - - private static final HashSet> RESISTANCES = new HashSet>(); - static { - RESISTANCES.add(ToxicGas.class); - RESISTANCES.add(EnchantmentDark.class); - - } - - @Override - public HashSet> resistances() { - return RESISTANCES; - } - - private static final HashSet> IMMUNITIES = new HashSet>(); - - static { - IMMUNITIES.add(Roots.class); - } - - @Override - public HashSet> immunities() { - return IMMUNITIES; - } - - private class Fleeing extends Mob.Fleeing { - @Override - protected void nowhereToRun() { - if (buff(Terror.class) == null) { - state = HUNTING; - } else { - super.nowhereToRun(); - } - } - } - - - public static void spawnAround(int pos) { - for (int n : Level.NEIGHBOURS4) { - int cell = pos + n; - if (Level.passable[cell] && Actor.findChar(cell) == null) { - spawnAt(cell); - } - } - } - - public static PoisonGoo spawnAt(int pos) { - - PoisonGoo b = new PoisonGoo(); - - b.pos = pos; - b.state = b.HUNTING; - GameScene.add(b, SPAWN_DELAY); - - return b; - - } - - - } - -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/GraveProtector.java b/java/com/hmdzl/spspd/change/actors/mobs/GraveProtector.java deleted file mode 100644 index 86a342e8..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/GraveProtector.java +++ /dev/null @@ -1,144 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs; - -import java.util.HashSet; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.ResultDescriptions; -import com.hmdzl.spspd.change.Statistics; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Silent; -import com.hmdzl.spspd.change.effects.particles.SparkParticle; -import com.hmdzl.spspd.change.items.VioletDewdrop; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.traps.LightningTrap; -import com.hmdzl.spspd.change.mechanics.Ballistica; -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.hmdzl.spspd.change.sprites.GraveProtectorSprite; -import com.hmdzl.spspd.change.utils.GLog; - -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.noosa.Camera; -import com.watabou.utils.Callback; -import com.watabou.utils.Random; - -public class GraveProtector extends Mob implements Callback { - - private static final float TIME_TO_ZAP = 2f; - - private static final String TXT_LIGHTNING_KILLED = "%s's lightning bolt killed you..."; - - { - spriteClass = GraveProtectorSprite.class; - - EXP = 1; - state = HUNTING; - flying = true; - - HP = HT = 350; - evadeSkill = 15; - - loot = new VioletDewdrop(); - lootChance = 1f; - - properties.add(Property.ELEMENT); - } - - @Override - public int damageRoll() { - return Random.NormalIntRange(8+Math.round(Statistics.skeletonsKilled/10), 15+Math.round(Statistics.skeletonsKilled/5)); - } - - @Override - public int hitSkill(Char target) { - return 20; - } - - @Override - public int drRoll() { - return Random.NormalIntRange(0, 8); - } - - @Override - protected boolean canAttack(Char enemy) { if (buff(Silent.class) != null){ - return Level.adjacent(pos, enemy.pos) && (!isCharmedBy(enemy)); - } else - return new Ballistica( pos, enemy.pos, Ballistica.MAGIC_BOLT).collisionPos == enemy.pos; - } - - @Override - protected boolean doAttack(Char enemy) { - - if (Level.distance(pos, enemy.pos) <= 1) { - - return super.doAttack(enemy); - - } else { - - boolean visible = Level.fieldOfView[pos] - || Level.fieldOfView[enemy.pos]; - if (visible) { - ((GraveProtectorSprite) sprite).zap(enemy.pos); - } - - spend(TIME_TO_ZAP); - - if (hit(this, enemy, true)) { - int dmg = Random.Int(10+Math.round(Statistics.skeletonsKilled/10), 25+Math.round(Statistics.skeletonsKilled/5)); - if (Level.water[enemy.pos] && !enemy.flying) { - dmg *= 1.5f; - } - enemy.damage(dmg, this); - - enemy.sprite.centerEmitter().burst(SparkParticle.FACTORY, 3); - enemy.sprite.flash(); - - if (enemy == Dungeon.hero) { - - Camera.main.shake(2, 0.3f); - - if (!enemy.isAlive()) { - Dungeon.fail( Messages.format(ResultDescriptions.MOB)); - //GLog.n(Messages.get(this, "kill")); - } - } - } else { - enemy.sprite - .showStatus(CharSprite.NEUTRAL, enemy.defenseVerb()); - } - - return !visible; - } - } - - @Override - public void call() { - next(); - } - - private static final HashSet> RESISTANCES = new HashSet>(); - static { - RESISTANCES.add(LightningTrap.Electricity.class); - } - - @Override - public HashSet> resistances() { - return RESISTANCES; - } -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/GreatCrab.java b/java/com/hmdzl/spspd/change/actors/mobs/GreatCrab.java deleted file mode 100644 index cef4d923..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/GreatCrab.java +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs; - -import com.hmdzl.spspd.change.actors.mobs.npcs.Ghost; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.items.food.meatfood.MysteryMeat; -import com.hmdzl.spspd.change.items.wands.Wand; -import com.hmdzl.spspd.change.levels.traps.LightningTrap; -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.hmdzl.spspd.change.sprites.GreatCrabSprite; -import com.hmdzl.spspd.change.utils.GLog; - -import com.hmdzl.spspd.change.messages.Messages; - -public class GreatCrab extends Crab { - { - //name = "great crab"; - spriteClass = GreatCrabSprite.class; - - HP = HT = 100; - evadeSkill = 0; // see damage() - baseSpeed = 1f; - - EXP = 6; - - state = WANDERING; - - properties.add(Property.BEAST); - properties.add(Property.MINIBOSS); - } - - private int moving = 0; - - @Override - protected boolean getCloser(int target) { - // this is used so that the crab remains slower, but still detects - // the player at the expected rate. - moving++; - if (moving < 3) { - return super.getCloser(target); - } else { - moving = 0; - return true; - } - - } - - @Override - public void damage(int dmg, Object src) { - // crab blocks all attacks originating from the hero or enemy - // characters or traps if it is alerted. - // All direct damage from these sources is negated, no exceptions. - // blob/debuff effects go through as normal. - if ((enemySeen && state != SLEEPING && paralysed == 0) - && (src instanceof Wand || src instanceof LightningTrap.Electricity || src instanceof Char)){ - GLog.n( Messages.get(this, "noticed") ); - sprite.showStatus( CharSprite.NEUTRAL, Messages.get(this, "blocked") ); - } else { - super.damage(dmg, src); - } - } - - @Override - public void die(Object cause) { - super.die(cause); - - Ghost.Quest.process(); - - Dungeon.level.drop(new MysteryMeat(), pos); - Dungeon.level.drop(new MysteryMeat(), pos).sprite.drop(); - } - - } \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/actors/mobs/GreyRat.java b/java/com/hmdzl/spspd/change/actors/mobs/GreyRat.java deleted file mode 100644 index 65572811..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/GreyRat.java +++ /dev/null @@ -1,140 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs; - -import java.util.HashSet; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.StenchGas; -import com.hmdzl.spspd.change.actors.blobs.ToxicGas; -import com.hmdzl.spspd.change.actors.buffs.Amok; -import com.hmdzl.spspd.change.actors.buffs.Burning; -import com.hmdzl.spspd.change.actors.buffs.Poison; -import com.hmdzl.spspd.change.actors.buffs.Sleep; -import com.hmdzl.spspd.change.actors.buffs.Terror; -import com.hmdzl.spspd.change.actors.buffs.Vertigo; -import com.hmdzl.spspd.change.items.Generator; -import com.hmdzl.spspd.change.items.food.meatfood.Meat; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfPsionicBlast; -import com.hmdzl.spspd.change.items.weapon.enchantments.EnchantmentDark; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.GreyRatSprite; -import com.watabou.utils.Random; - -public class GreyRat extends Mob { - - - private static final float SPAWN_DELAY = 2f; - - { - spriteClass = GreyRatSprite.class; - - HP = HT = 80+(adj(0)*Random.NormalIntRange(3, 5)); - evadeSkill = 8+adj(0); - - EXP = 5; - - loot = new Meat(); - lootChance = 0.5f; - - lootOther = Generator.Category.MUSHROOM; - lootChanceOther = 0.25f; - - properties.add(Property.BEAST); - - } - - - - @Override - public int damageRoll() { - return Random.NormalIntRange(1, 7+adj(0)); - } - - @Override - protected float attackDelay() { - return 0.8f; - } - - - @Override - public int hitSkill(Char target) { - return 6 + Dungeon.depth; - } - - @Override - public int drRoll() { - return Random.NormalIntRange(0, 3); - } - - public static void spawnAround(int pos) { - for (int n : Level.NEIGHBOURS4) { - int cell = pos + n; - if (Level.passable[cell] && Actor.findChar(cell) == null) { - spawnAt(cell); - } - } - } - - public static GreyRat spawnAt(int pos) { - - GreyRat b = new GreyRat(); - - b.pos = pos; - b.state = b.HUNTING; - GameScene.add(b, SPAWN_DELAY); - - return b; - - } - - private static final HashSet> RESISTANCES = new HashSet>(); - static { - RESISTANCES.add(ToxicGas.class); - RESISTANCES.add(EnchantmentDark.class); - - } - - @Override - public HashSet> resistances() { - return RESISTANCES; - } - - private static final HashSet> IMMUNITIES = new HashSet>(); - static { - IMMUNITIES.add(Amok.class); - IMMUNITIES.add(Sleep.class); - IMMUNITIES.add(Terror.class); - IMMUNITIES.add(Burning.class); - IMMUNITIES.add(ScrollOfPsionicBlast.class); - IMMUNITIES.add(Vertigo.class); - IMMUNITIES.add(Poison.class); - IMMUNITIES.add(StenchGas.class); - } - - @Override - public HashSet> immunities() { - return IMMUNITIES; - } - - - -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/Guard.java b/java/com/hmdzl/spspd/change/actors/mobs/Guard.java deleted file mode 100644 index e07488d5..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/Guard.java +++ /dev/null @@ -1,232 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs; - -import java.util.HashSet; - -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.buffs.Cripple; -import com.hmdzl.spspd.change.actors.buffs.Silent; -import com.hmdzl.spspd.change.effects.Chains; -import com.hmdzl.spspd.change.effects.Pushing; -import com.hmdzl.spspd.change.mechanics.Ballistica; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.ResultDescriptions; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.items.Generator; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.weapon.enchantments.EnchantmentDark; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.sprites.GuardSprite; - -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundle; -import com.watabou.utils.Callback; -import com.watabou.utils.Random; - - - -public class Guard extends Mob { - - private boolean chainsUsed = false; - - { - spriteClass = GuardSprite.class; - - HP = HT = 75+(adj(0)*Random.NormalIntRange(3, 7)); - evadeSkill = 9+adj(1); - - EXP = 10; - maxLvl = 20; - - loot = Generator.Category.ARMOR; - lootChance = 0.2f; - - properties.add(Property.HUMAN); - //HUNTING = new Hunting(); - } - - @Override - public int damageRoll() { - return Random.NormalIntRange(12+adj(0), 20+adj(3)); - } - - @Override - protected float attackDelay() { - return 1.2f; - } - - @Override - protected boolean act() { - Dungeon.level.updateFieldOfView( this ); - - if (state == HUNTING && - paralysed <= 0 && - enemy != null && - enemy.invisible == 0 && - Level.fieldOfView[enemy.pos] && - Level.distance( pos, enemy.pos ) < 5 && !Level.adjacent( pos, enemy.pos ) && - Random.Int(3) == 0 && (buff(Silent.class) == null) && - - chain(enemy.pos)) { - - return false; - - } else { - return super.act(); - } - } - private boolean chain(int target){ - if (chainsUsed || enemy.properties().contains(Property.IMMOVABLE)) - return false; - - Ballistica chain = new Ballistica(pos, target, Ballistica.PROJECTILE); - - if (chain.collisionPos != enemy.pos || Level.pit[chain.path.get(1)]) - return false; - else { - int newPos = -1; - for (int i : chain.subPath(1, chain.dist)){ - if (!Level.solid[i] && Actor.findChar(i) == null){ - newPos = i; - break; - } - } - - if (newPos == -1){ - return false; - } else { - final int newPosFinal = newPos; - yell( Messages.get(this, "scorpion") ); - sprite.parent.add(new Chains(pos, enemy.pos, new Callback() { - public void call() { - Actor.addDelayed(new Pushing(enemy, enemy.pos, newPosFinal), -1); - enemy.pos = newPosFinal; - Dungeon.level.press(newPosFinal, enemy); - Cripple.prolong(enemy, Cripple.class, 4f); - if (enemy == Dungeon.hero) { - Dungeon.hero.interrupt(); - Dungeon.observe(); - } - next(); - } - })); - } - } - chainsUsed = true; - return true; - } - - - @Override - public void die(Object cause) { - - super.die(cause); - - boolean heroKilled = false; - for (int i = 0; i < Level.NEIGHBOURS8.length; i++) { - Char ch = findChar(pos + Level.NEIGHBOURS8[i]); - if (ch != null && ch.isAlive()) { - int damage = Math.max(0, - Random.NormalIntRange(3, 8) - Random.IntRange(0, ch.drRoll() / 2)); - ch.damage(damage, this); - if (ch == Dungeon.hero && !ch.isAlive()) { - heroKilled = true; - } - } - } - - if (Dungeon.visible[pos]) { - Sample.INSTANCE.play(Assets.SND_BONES); - } - - if (heroKilled) { - Dungeon.fail(Messages.format(ResultDescriptions.MOB)); - //GLog.n(Messages.get(this, "kill")); - } - } - - @Override - protected Item createLoot() { - Item loot = Generator.random(Generator.Category.ARMOR); - for (int i = 0; i < 2; i++) { - Item l = Generator.random(Generator.Category.ARMOR); - if (l.level < loot.level) { - loot = l; - } - } - return loot; - } - - @Override - public int hitSkill(Char target) { - return 12+adj(0); - } - - @Override - public int drRoll() { - return Random.NormalIntRange(5, 10); - } - - private final String CHAINSUSED = "chainsused"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(CHAINSUSED, chainsUsed); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - chainsUsed = bundle.getBoolean(CHAINSUSED); - } - - private static final HashSet> IMMUNITIES = new HashSet>(); - static { - IMMUNITIES.add(EnchantmentDark.class); - } - - @Override - public HashSet> immunities() { - return IMMUNITIES; - } - - /*private class Hunting extends Mob.Hunting{ - @Override - public boolean act( boolean enemyInFOV, boolean justAlerted ) { - enemySeen = enemyInFOV; - - if (!chainsUsed - && enemyInFOV - && !isCharmedBy( enemy ) - && !canAttack( enemy ) - && Dungeon.level.distance( pos, enemy.pos ) < 5 - && Random.Int(3) == 0 - - && chain(enemy.pos)){ - return false; - } else { - return super.act( enemyInFOV, justAlerted ); - } - - } - } */ -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/HermitCrab.java b/java/com/hmdzl/spspd/change/actors/mobs/HermitCrab.java deleted file mode 100644 index 1e8539cd..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/HermitCrab.java +++ /dev/null @@ -1,173 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs; - -import java.util.HashSet; - -import com.hmdzl.spspd.change.actors.buffs.Silent; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.ResultDescriptions; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.effects.particles.SparkParticle; -import com.hmdzl.spspd.change.items.Generator; -import com.hmdzl.spspd.change.items.Gold; -import com.hmdzl.spspd.change.items.keys.GoldenSkeletonKey; -import com.hmdzl.spspd.change.items.keys.SkeletonKey; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.traps.LightningTrap; -import com.hmdzl.spspd.change.mechanics.Ballistica; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.hmdzl.spspd.change.sprites.HermitCrabSprite; -import com.hmdzl.spspd.change.utils.GLog; - -import com.watabou.noosa.Camera; -import com.watabou.utils.Callback; -import com.watabou.utils.Random; - -public class HermitCrab extends Mob implements Callback { - - private static final float TIME_TO_ZAP = 2f; - - private static final String TXT_LIGHTNING_KILLED = "%s's lightning bolt killed you..."; - private static final String TXT_SHELL_ABSORB = "Hermit Crab absorbed the attack in its shell."; - private static final String TXT_SHELL_CHARGE = "Lightning Shell charged by %s."; - - { - spriteClass = HermitCrabSprite.class; - - HP = HT = 200; - evadeSkill = 22; - - EXP = 60; - - loot = Generator.Category.BERRY; - lootChance = 0.33f; - - properties.add(Property.BEAST); - properties.add(Property.BOSS); - - } - - @Override - public int damageRoll() { - return Random.NormalIntRange(25, 50); - } - - @Override - public int hitSkill(Char target) { - return 25; - } - - @Override - public int drRoll() { - return Random.NormalIntRange(0, 4); - } - - @Override - public void damage(int dmg, Object src) { - - if (dmg>HT/4 && src != this){ - for (Mob mob : Dungeon.level.mobs) { - if (mob instanceof Shell && mob.isAlive()){ - GLog.n(Messages.get(this, "absorb")); - dmg=1; - } - } - } - super.damage(dmg, src); - } - - - @Override - protected boolean canAttack(Char enemy) { if (buff(Silent.class) != null){ - return Level.adjacent(pos, enemy.pos) && (!isCharmedBy(enemy)); - } else - return new Ballistica( pos, enemy.pos, Ballistica.MAGIC_BOLT).collisionPos == enemy.pos; - } - - @Override - protected boolean doAttack(Char enemy) { - - if (Level.distance(pos, enemy.pos) <= 1) { - - return super.doAttack(enemy); - - } else { - - boolean visible = Level.fieldOfView[pos] - || Level.fieldOfView[enemy.pos]; - if (visible) { - ((HermitCrabSprite) sprite).zap(enemy.pos); - } - - spend(TIME_TO_ZAP); - - if (hit(this, enemy, true)) { - int dmg = Random.Int(15, 30); - if (Level.water[enemy.pos] && !enemy.flying) { - dmg *= 1.5f; - } - enemy.damage(dmg, this); - - enemy.sprite.centerEmitter().burst(SparkParticle.FACTORY, 3); - enemy.sprite.flash(); - - if (enemy == Dungeon.hero) { - - Camera.main.shake(2, 0.3f); - - if (!enemy.isAlive()) { - Dungeon.fail(Messages.format(ResultDescriptions.MOB)); - //GLog.n(Messages.get(this, "kill")); - } - } - } else { - enemy.sprite - .showStatus(CharSprite.NEUTRAL, enemy.defenseVerb()); - } - - return !visible; - } - } - - @Override - public void call() { - next(); - } - - @Override - public void die(Object cause) { - super.die(cause); - if(Random.Int(1)==0){ - Dungeon.level.drop(new GoldenSkeletonKey(0), pos).sprite.drop(); - } - } - - private static final HashSet> RESISTANCES = new HashSet>(); - static { - RESISTANCES.add(LightningTrap.Electricity.class); - } - - @Override - public HashSet> resistances() { - return RESISTANCES; - } -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/Hybrid.java b/java/com/hmdzl/spspd/change/actors/mobs/Hybrid.java deleted file mode 100644 index 265c6eae..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/Hybrid.java +++ /dev/null @@ -1,355 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * Shattered Pixel Dungeon - * Copyright (C) 2014-2015 Evan Debenham - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs; - - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.Badges.Badge; -import com.hmdzl.spspd.change.Challenges; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.ResultDescriptions; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.Blob; -import com.hmdzl.spspd.change.actors.blobs.ConfusionGas; -import com.hmdzl.spspd.change.actors.blobs.DarkGas; -import com.hmdzl.spspd.change.actors.blobs.GooWarn; -import com.hmdzl.spspd.change.actors.blobs.ParalyticGas; -import com.hmdzl.spspd.change.actors.blobs.ToxicGas; -import com.hmdzl.spspd.change.actors.buffs.AttackDown; -import com.hmdzl.spspd.change.actors.buffs.AttackUp; -import com.hmdzl.spspd.change.actors.buffs.Bleeding; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Burning; -import com.hmdzl.spspd.change.actors.buffs.Cripple; -import com.hmdzl.spspd.change.actors.buffs.DefenceUp; -import com.hmdzl.spspd.change.actors.buffs.Ooze; -import com.hmdzl.spspd.change.actors.buffs.Poison; -import com.hmdzl.spspd.change.actors.buffs.ShieldArmor; -import com.hmdzl.spspd.change.actors.buffs.Speed; -import com.hmdzl.spspd.change.actors.buffs.Tar; -import com.hmdzl.spspd.change.actors.buffs.Terror; -import com.hmdzl.spspd.change.actors.buffs.Vertigo; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Pushing; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.effects.particles.ElmoParticle; -import com.hmdzl.spspd.change.effects.particles.PurpleParticle; -import com.hmdzl.spspd.change.effects.particles.ShadowParticle; -import com.hmdzl.spspd.change.items.Generator; -import com.hmdzl.spspd.change.items.StoneOre; -import com.hmdzl.spspd.change.items.TomeOfMastery; -import com.hmdzl.spspd.change.items.artifacts.AlchemistsToolkit; -import com.hmdzl.spspd.change.items.bombs.DangerousBomb; -import com.hmdzl.spspd.change.items.eggs.EasterEgg; -import com.hmdzl.spspd.change.items.eggs.Egg; -import com.hmdzl.spspd.change.items.eggs.GoldDragonEgg; -import com.hmdzl.spspd.change.items.journalpages.Sokoban1; -import com.hmdzl.spspd.change.items.journalpages.Sokoban3; -import com.hmdzl.spspd.change.items.keys.SkeletonKey; -import com.hmdzl.spspd.change.items.potions.PotionOfExperience; -import com.hmdzl.spspd.change.items.potions.PotionOfMight; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfUpgrade; -import com.hmdzl.spspd.change.items.wands.WandOfLight; -import com.hmdzl.spspd.change.levels.CavesBossLevel; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.SewerBossLevel; -import com.hmdzl.spspd.change.levels.Terrain; -import com.hmdzl.spspd.change.levels.features.Door; -import com.hmdzl.spspd.change.mechanics.Ballistica; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.hmdzl.spspd.change.sprites.ErrorSprite; -import com.hmdzl.spspd.change.sprites.GooSprite; -import com.hmdzl.spspd.change.sprites.HybridSprite; -import com.hmdzl.spspd.change.sprites.PlagueDoctorSprite; -import com.hmdzl.spspd.change.sprites.SandmobSprite; -import com.hmdzl.spspd.change.sprites.SewerHeartSprite; -import com.hmdzl.spspd.change.sprites.ShadowRatSprite; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.Camera; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -import java.util.ArrayList; -import java.util.HashSet; - -import static com.hmdzl.spspd.change.Dungeon.hero; - -public class Hybrid extends Mob { - - { - spriteClass = HybridSprite.class; - - HP = HT = 800; - evadeSkill = 10; - baseSpeed = 1.5f; - - EXP = 50; - - loot = Generator.Category.EGGS; - lootChance = 0.2f; - - lootOther = new PotionOfExperience(); - lootChanceOther = 1f; - - FLEEING = new Fleeing(); - - properties.add(Property.BEAST); - properties.add(Property.ALIEN); - properties.add(Property.UNDEAD); - properties.add(Property.MECH); - properties.add(Property.BOSS); - } - - private int breaks=0; - - @Override - public boolean act() { - DangerousBomb bomb = new DangerousBomb(); - if (3 - breaks > 4 * HP / HT) { - breaks++; - bomb.explode(pos); - Buff.affect(this,ShieldArmor.class).level(200); - return true; - } - - return super.act(); - } - - @Override - public void move(int step) { - super.move(step); - - if (Dungeon.level.map[step] == Terrain.INACTIVE_TRAP) { - if (state == FLEEING){ - Buff.affect(this,ShieldArmor.class).level(200); - yell(Messages.get(this, "shield")); - state = HUNTING; - } - - } - - } - - @Override - public int attackProc(Char enemy, int damage) { - if (Random.Int(5) == 0) { - Buff.affect(enemy, Poison.class).set( - Random.Int(7, 9) * Poison.durationFactor(enemy)); - state = FLEEING; - } - - - return damage; - } - - @Override - public int defenseProc(Char enemy, int damage) { - if (Random.Int(3) == 0) { - Buff.affect(enemy, Tar.class); - state = HUNTING; - } - return super.defenseProc(enemy, damage); - } - - - - @Override - public void damage(int dmg, Object src) { - if ( breaks > 2 && dmg > 5){ - ArrayList candidates = new ArrayList(); - boolean[] passable = Level.passable; - - int[] neighbours = { pos + 1, pos - 1, pos + Level.getWidth(), - pos - Level.getWidth() }; - for (int n : neighbours) { - if (passable[n] && Actor.findChar(n) == null) { - candidates.add(n); - } - } - - if (candidates.size() > 0) { - - Mixers clone = new Mixers(); - clone.HT = dmg; - clone.HP = dmg; - clone.pos = Random.element(candidates); - clone.state = clone.HUNTING; - - if (Dungeon.level.map[clone.pos] == Terrain.DOOR) { - Door.enter(clone.pos); - } - - GameScene.add(clone, 1f); - Actor.addDelayed(new Pushing(clone, pos, clone.pos), -1); - } - } - - super.damage(dmg, src); - } - - @Override - public void destroy() { - super.destroy(); - } - - @Override - protected boolean canAttack(Char enemy) { - return Dungeon.level.distance( pos, enemy.pos ) <= 2 ; - } - - @Override - public void die(Object cause) { - super.die(cause); - GameScene.bossSlain(); - ((CavesBossLevel) Dungeon.level).unseal(); - Dungeon.level.drop(new SkeletonKey(Dungeon.depth), pos).sprite.drop(); - Badges.validateBossSlain(); - - Badges.Badge badgeToCheck = null; - switch (Dungeon.hero.heroClass) { - case WARRIOR: - badgeToCheck = Badge.MASTERY_WARRIOR; - break; - case MAGE: - badgeToCheck = Badge.MASTERY_MAGE; - break; - case ROGUE: - badgeToCheck = Badge.MASTERY_ROGUE; - break; - case HUNTRESS: - badgeToCheck = Badge.MASTERY_HUNTRESS; - break; - case PERFORMER: - badgeToCheck = Badge.MASTERY_PERFORMER; - break; - case SOLDIER: - badgeToCheck = Badge.MASTERY_SOLDIER; - break; - case FOLLOWER: - badgeToCheck = Badge.MASTERY_FOLLOWER; - break; - } - - Dungeon.level.drop(new TomeOfMastery(), pos).sprite.drop(); - Dungeon.level.drop(new Sokoban3(), pos).sprite.drop(); - yell(Messages.get(this,"die")); - - } - - @Override - public void notice() { - super.notice(); - yell(Messages.get(this, "notice")); - } - - @Override - public int damageRoll() { - return Dungeon.isChallenged(Challenges.TEST_TIME) ? Random.NormalIntRange(0, 1) : Random.NormalIntRange(30, 42); - } - - - - @Override - public int hitSkill(Char target) { - return 50; - } - - @Override - public int drRoll() { - return Random.NormalIntRange(10, 15); - } - - private static final String BREAKS = "breaks"; - - @Override - public void storeInBundle( Bundle bundle ) { - super.storeInBundle(bundle); - bundle.put( BREAKS, breaks ); - } - - @Override - public void restoreFromBundle( Bundle bundle ) { - super.restoreFromBundle(bundle); - breaks = bundle.getInt( BREAKS ); - } - - private static final HashSet> IMMUNITIES = new HashSet<>(); - static { - IMMUNITIES.add(ToxicGas.class ); - IMMUNITIES.add(ParalyticGas.class); - IMMUNITIES.add(DarkGas.class); - IMMUNITIES.add(ConfusionGas.class); - } - - @Override - public HashSet> immunities() { - return IMMUNITIES; - } - - public static class Mixers extends Mob { - - { - spriteClass = HybridSprite.class; - - HP = HT = 1; - evadeSkill = 0; - baseSpeed = 1f; - properties.add(Property.UNKNOW); - properties.add(Property.BOSS); - } - - private static final float SPAWN_DELAY = 1f; - - @Override - public int damageRoll() { - return Random.NormalIntRange(25, 55 ); - } - - @Override - public int hitSkill(Char target) { - return 100; - } - - @Override - public int drRoll() { - return 0; - } - - public static Mixers spawnAt(int pos) { - - Mixers b = new Mixers(); - - b.pos = pos; - b.state = b.HUNTING; - GameScene.add(b, SPAWN_DELAY); - - return b; - - } - } - -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/actors/mobs/King.java b/java/com/hmdzl/spspd/change/actors/mobs/King.java deleted file mode 100644 index 7e4fc480..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/King.java +++ /dev/null @@ -1,476 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs; - -import java.util.HashSet; - -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.items.ArmorKit; -import com.hmdzl.spspd.change.items.DolyaSlate; -import com.hmdzl.spspd.change.items.Gold; -import com.hmdzl.spspd.change.items.RedDewdrop; -import com.hmdzl.spspd.change.items.StoneOre; -import com.hmdzl.spspd.change.items.artifacts.ChaliceOfBlood; -import com.hmdzl.spspd.change.items.keys.SkeletonKey; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfTeleportation; -import com.hmdzl.spspd.change.items.weapon.missiles.Skull; -import com.hmdzl.spspd.change.levels.Terrain; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.ToxicGas; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Paralysis; -import com.hmdzl.spspd.change.actors.buffs.Vertigo; -import com.hmdzl.spspd.change.effects.Flare; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.effects.particles.ElmoParticle; -import com.hmdzl.spspd.change.items.journalpages.Sokoban4; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfPsionicBlast; -import com.hmdzl.spspd.change.items.wands.WandOfDisintegration; -import com.hmdzl.spspd.change.items.weapon.enchantments.EnchantmentDark; -import com.hmdzl.spspd.change.levels.CityBossLevel; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.DwarfKingTombSprite; -import com.hmdzl.spspd.change.sprites.KingSprite; -import com.hmdzl.spspd.change.sprites.UndeadSprite; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundle; -import com.watabou.utils.PathFinder; -import com.watabou.utils.Random; - -public class King extends Mob { - - private static final int MAX_ARMY_SIZE = 5; - private static final int REGEN = 3; - - - { - spriteClass = KingSprite.class; - - HP = HT = 1500; - EXP = 60; - evadeSkill = 25; - baseSpeed = 0.75f; - - loot = new ChaliceOfBlood().identify(); - lootChance = 0.2f; - - lootOther = new Skull(5); - lootChanceOther = 1f; - - properties.add(Property.DWARF); - properties.add(Property.BOSS); - - Undead.count = 0; - - } - - private boolean nextPedestal = true; - - private int tombAlive = 0; - private static final String TOMBALIVE = "tombAlive"; - private static final String PEDESTAL = "pedestal"; - - public void spawnTomb() { - DwarfKingTomb a = new DwarfKingTomb(); - - a.pos = Terrain.EMPTY_WELL; - do { - a.pos = Random.Int(Dungeon.level.randomRespawnCellMob()); - } while (Dungeon.level.map[a.pos] != Terrain.EMPTY_WELL - || Actor.findChar(a.pos) != null); - GameScene.add(a); - } - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(PEDESTAL, nextPedestal); - bundle.put( TOMBALIVE, tombAlive ); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - nextPedestal = bundle.getBoolean(PEDESTAL); - tombAlive = bundle.getInt( TOMBALIVE ); - } - - @Override - public int damageRoll() { - return Random.NormalIntRange(20, 38); - } - - @Override - public int hitSkill(Char target) { - return 62; - } - - @Override - public int drRoll() { - return Random.NormalIntRange(0, 14); - } - - @Override - protected boolean getCloser(int target) { - return canTryToSummon() ? super.getCloser(CityBossLevel - .pedestal(nextPedestal)) : super.getCloser(target); - } - - @Override - protected boolean canAttack(Char enemy) { - return canTryToSummon() ? pos == CityBossLevel.pedestal(nextPedestal) - : Level.adjacent(pos, enemy.pos); - } - - private boolean canTryToSummon() { - if (Undead.count < maxArmySize()) { - Char ch = Actor.findChar(CityBossLevel.pedestal(nextPedestal)); - return ch == this || ch == null; - } else { - return false; - } - } - - @Override - public boolean attack(Char enemy) { - if (canTryToSummon() && pos == CityBossLevel.pedestal(nextPedestal)) { - summon(); - return true; - } else { - if (Actor.findChar(CityBossLevel.pedestal(nextPedestal)) == enemy) { - nextPedestal = !nextPedestal; - } - return super.attack(enemy); - } - } - - - @Override - protected boolean act() { - - if (tombAlive < 1){ - spawnTomb(); - tombAlive++; - } - - if (HP < HT) { - sprite.emitter().burst( Speck.factory( Speck.HEALING ), 1 ); - HP = HP + REGEN; - } - - return super.act(); - } - - - private void summonLiches (int pos){ - DwarfLich.spawnAround(pos); - } - - @Override - public void die(Object cause) { - - int findTomb=Dungeon.hero.pos; - yell(Messages.get(this, "cannot")); - for (Mob mob : Dungeon.level.mobs) { - if (mob instanceof DwarfKingTomb){findTomb=mob.pos;} - } - - Dungeon.level.drop(new Sokoban4(), pos).sprite.drop(); - - if (!Dungeon.limitedDrops.journal.dropped()){ - Dungeon.level.drop(new DolyaSlate(), pos).sprite.drop(); - Dungeon.limitedDrops.journal.drop(); - } - - summonLiches(findTomb); - GLog.n(Messages.get(this, "liches")); - - super.die(cause); - - } - - private int maxArmySize() { - return 1 + MAX_ARMY_SIZE * (HT - HP) / HT; - } - - private void summon() { - - nextPedestal = !nextPedestal; - - sprite.centerEmitter().start(Speck.factory(Speck.SCREAM), 0.4f, 2); - Sample.INSTANCE.play(Assets.SND_CHALLENGE); - - boolean[] passable = Level.passable.clone(); - for (Actor actor : Actor.all()) { - if (actor instanceof Char) { - passable[((Char) actor).pos] = false; - } - } - - int undeadsToSummon = maxArmySize() - Undead.count; - - PathFinder.buildDistanceMap(pos, passable, undeadsToSummon); - PathFinder.distance[pos] = Integer.MAX_VALUE; - int dist = 1; - - undeadLabel: for (int i = 0; i < undeadsToSummon; i++) { - do { - for (int j = 0; j < Level.getLength(); j++) { - if (PathFinder.distance[j] == dist) { - - Undead undead = new Undead(); - undead.pos = j; - GameScene.add(undead); - - ScrollOfTeleportation.appear(undead, j); - new Flare(3, 32).color(0x000000, false).show( - undead.sprite, 2f); - - PathFinder.distance[j] = Integer.MAX_VALUE; - - continue undeadLabel; - } - } - dist++; - } while (dist < undeadsToSummon); - } - - yell(Messages.get(this, "arise")); - HP += Random.Int(1, HT - HP); - sprite.emitter().burst(ElmoParticle.FACTORY, 5); - } - - @Override - public void notice() { - super.notice(); - yell(Messages.get(this,"meeting")); - } - - private static final HashSet> RESISTANCES = new HashSet>(); - static { - RESISTANCES.add(ToxicGas.class); - RESISTANCES.add(EnchantmentDark.class); - - RESISTANCES.add(WandOfDisintegration.class); - } - - @Override - public HashSet> resistances() { - return RESISTANCES; - } - - private static final HashSet> IMMUNITIES = new HashSet>(); - static { - IMMUNITIES.add(Paralysis.class); - IMMUNITIES.add(Vertigo.class); - } - - @Override - public HashSet> immunities() { - return IMMUNITIES; - } - - public static class Undead extends Mob { - - public static int count = 0; - - { - //name = "undead dwarf"; - spriteClass = UndeadSprite.class; - - HP = HT = 100; - evadeSkill = 15; - - EXP = 0; - - state = WANDERING; - - - properties.add(Property.UNDEAD); - properties.add(Property.BOSS); - } - - @Override - protected void onAdd() { - count++; - super.onAdd(); - } - - @Override - protected void onRemove() { - count--; - super.onRemove(); - } - - @Override - public int damageRoll() { - return Random.NormalIntRange(12, 16); - } - - @Override - public int hitSkill(Char target) { - return 49; - } - - @Override - public int attackProc(Char enemy, int damage) { - if (Random.Int(MAX_ARMY_SIZE) == 0) { - Buff.prolong(enemy, Paralysis.class, 1); - } - - return damage; - } - - @Override - public void damage(int dmg, Object src) { - super.damage(dmg, src); - if (src instanceof ToxicGas) { - ((ToxicGas) src).clear(pos); - } - } - - @Override - public void die(Object cause) { - super.die(cause); - - if (Dungeon.visible[pos]) { - Sample.INSTANCE.play(Assets.SND_BONES); - } - } - - @Override - public int drRoll() { - return 5; - } - - private static final HashSet> IMMUNITIES = new HashSet>(); - static { - IMMUNITIES.add(EnchantmentDark.class); - IMMUNITIES.add(Paralysis.class); - } - - @Override - public HashSet> immunities() { - return IMMUNITIES; - } - } - - public static class DwarfKingTomb extends Mob { - - { - spriteClass = DwarfKingTombSprite.class; - - HP = HT = 1000; - evadeSkill = 5; - - EXP = 10; - - hostile = false; - state = PASSIVE; - - loot = new StoneOre(); - lootChance = 0.05f; - - properties.add(Property.UNKNOW); - properties.add(Property.BOSS); - } - - @Override - public void beckon(int cell) { - // Do nothing - } - - @Override - public void add(Buff buff) { - } - - - @Override - public int damageRoll() { - return 0; - } - - @Override - public int hitSkill(Char target) { - return 0; - } - - @Override - public int drRoll() { - return 0; - - } - - - public boolean checkKing(){ - - int kingAlive=0; - if(Dungeon.level.mobs!=null){ - for (Mob mob : Dungeon.level.mobs) { - if (mob instanceof King){ - kingAlive++; - } - } - } - if (kingAlive>0){ - return true; - } else { - return false; - } - } - - @Override - public void damage(int dmg, Object src) { - if(checkKing()){ - yell(Messages.get(this , "impossible")); - } else { - super.damage(dmg, src); - } - } - - @SuppressWarnings("unchecked") - @Override - public void die(Object cause) { - - super.die(cause); - - for (Mob mob : (Iterable) Dungeon.level.mobs.clone()) { - if (mob instanceof DwarfLich || mob instanceof King || mob instanceof King.Undead || mob instanceof Wraith) { - mob.die(cause); - } - } - - GameScene.bossSlain(); - ((CityBossLevel) Dungeon.level).unseal(); - - Dungeon.level.drop(new SkeletonKey(Dungeon.depth), pos).sprite.drop(); - Dungeon.level.drop(new Gold(Random.Int(1000, 2000)), pos).sprite.drop(); - - Badges.validateBossSlain(); - - } - - -} -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/LevelChecker.java b/java/com/hmdzl/spspd/change/actors/mobs/LevelChecker.java deleted file mode 100644 index f27033d4..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/LevelChecker.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Shocked; -import com.hmdzl.spspd.change.actors.buffs.Taunt; -import com.hmdzl.spspd.change.items.food.meatfood.Meat; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.RatSprite; -import com.watabou.utils.Random; - -public class LevelChecker extends Mob { - - { - spriteClass = RatSprite.class; - - HP = HT = Dungeon.hero.lvl*1000; - evadeSkill = Dungeon.hero.lvl*1000; - baseSpeed = 3f; - flying = true; - - state = WANDERING; - - properties.add(Property.BOSS); - } - - @Override - protected boolean getCloser(int target) { - return super.getCloser(Dungeon.hero.pos); - } - - @Override - public int damageRoll() { - return Dungeon.hero.lvl*1000; - } - - @Override - public int attackProc(Char enemy, int damage) { - if (enemy.buff(Taunt.class)== null && enemy == Dungeon.hero) { - Buff.affect(enemy, Taunt.class); - Dungeon.hero.exp=0; - Dungeon.hero.lvl=1; - - //Dungeon.hero.HT=30; - //Dungeon.hero.hitSkill=10; - //Dungeon.hero.evadeSkill=5; - damage = 0; - this.damage(this.HT*2,this); - return damage; - } else return damage; - } - - @Override - public int hitSkill(Char target) { - return Dungeon.hero.lvl*1000; - } - - @Override - public int drRoll() { - return Dungeon.hero.lvl*1000; - } - - @Override - public void add( Buff buff ) { - //in other words, can't be directly affected by buffs/debuffs. - } -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/LichDancer.java b/java/com/hmdzl/spspd/change/actors/mobs/LichDancer.java deleted file mode 100644 index 537efeac..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/LichDancer.java +++ /dev/null @@ -1,393 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs; - -import java.util.ArrayList; -import java.util.HashSet; - -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.ShatteredPixelDungeon; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.items.ArmorKit; -import com.hmdzl.spspd.change.items.DolyaSlate; -import com.hmdzl.spspd.change.items.Generator; -import com.hmdzl.spspd.change.items.Gold; -import com.hmdzl.spspd.change.items.RedDewdrop; -import com.hmdzl.spspd.change.items.StoneOre; -import com.hmdzl.spspd.change.items.artifacts.GlassTotem; -import com.hmdzl.spspd.change.items.bombs.DungeonBomb; -import com.hmdzl.spspd.change.items.keys.SkeletonKey; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfTeleportation; -import com.hmdzl.spspd.change.levels.Terrain; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.ToxicGas; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Paralysis; -import com.hmdzl.spspd.change.actors.buffs.Vertigo; -import com.hmdzl.spspd.change.effects.Flare; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.effects.particles.ElmoParticle; -import com.hmdzl.spspd.change.items.journalpages.Sokoban4; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfPsionicBlast; -import com.hmdzl.spspd.change.items.wands.WandOfDisintegration; -import com.hmdzl.spspd.change.items.weapon.enchantments.EnchantmentDark; -import com.hmdzl.spspd.change.levels.CityBossLevel; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.BatteryTombSprite; -import com.hmdzl.spspd.change.sprites.DwarfKingTombSprite; -import com.hmdzl.spspd.change.sprites.KingSprite; -import com.hmdzl.spspd.change.sprites.LichDancerSprite; -import com.hmdzl.spspd.change.sprites.SeekingBombSprite; -import com.hmdzl.spspd.change.sprites.UndeadSprite; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundle; -import com.watabou.utils.PathFinder; -import com.watabou.utils.Random; - -import static com.hmdzl.spspd.change.Dungeon.hero; - -public class LichDancer extends Mob { - - private static final int MAX_ARMY_SIZE = 4; - - - { - spriteClass = LichDancerSprite.class; - - HP = HT = 1000; - EXP = 60; - evadeSkill = 25; - baseSpeed = 1f; - - loot = new GlassTotem().identify(); - lootChance = 0.2f; - - lootOther = Generator.Category.MUSICWEAPON; - lootChanceOther= 1f; - - properties.add(Property.UNDEAD); - properties.add(Property.BOSS); - - } - - private int breaks=0; - - public void spawnTomb() { - BatteryTomb a = new BatteryTomb(); - a.pos = Terrain.PEDESTAL; - do { - a.pos = Random.Int(Dungeon.level.randomRespawnCellMob()); - } while (Dungeon.level.map[a.pos] != Terrain.PEDESTAL - || Actor.findChar(a.pos) != null); - GameScene.add(a); - } - - @Override - public int damageRoll() { - return Random.NormalIntRange(20, 38); - } - - @Override - public int hitSkill(Char target) { - return 65; - } - - @Override - public int drRoll() { - return Random.NormalIntRange(0, 20); - } - - @Override - protected boolean act() { - - if( 3 - breaks > 4 * HP / HT ) { - breaks++; - spawnTomb(); - jump(); - return true; - } - - if (Random.Int(5) == 0 && breaks > 0){ - ArrayList spawnPoints = new ArrayList<>(); - - for (int i = 0; i < PathFinder.NEIGHBOURS8.length; i++) { - int p = enemy.pos + PathFinder.NEIGHBOURS8[i]; - if (Actor.findChar( p ) == null && (Dungeon.level.passable[p] || Dungeon.level.avoid[p])) { - spawnPoints.add( p ); - } - } - - if (spawnPoints.size() > 0) { - Mob m = new LinkBomb(); - if (m != null) { - GameScene.add(m); - ScrollOfTeleportation.appear(m, Random.element(spawnPoints)); - } - } - } - - if (HP < HT) { - //sprite.emitter().burst( Speck.factory( Speck.HEALING ), 1 ); - HP = HP + 3; - } - - return super.act(); - } - - private void jump() { - int newPos; - do { - newPos = Random.Int(Level.getLength()); - } while (Dungeon.level.map[newPos] != Terrain.EMPTY_WELL); - sprite.move(pos, newPos); - move(newPos); - - if (Dungeon.visible[newPos]) { - CellEmitter.get(newPos).burst(Speck.factory(Speck.WOOL), 6); - Sample.INSTANCE.play(Assets.SND_PUFF); - } - - spend(1 / speed()); - } - - @Override - public int attackProc(Char enemy, int damage) { - if (Random.Int(5) == 0) { - Buff.prolong(enemy, Vertigo.class,3f); - } - return damage; - } - - - - private static final String BREAKS = "breaks"; - - @Override - public void storeInBundle( Bundle bundle ) { - super.storeInBundle(bundle); - bundle.put( BREAKS, breaks ); - } - - @Override - public void restoreFromBundle( Bundle bundle ) { - super.restoreFromBundle(bundle); - breaks = bundle.getInt( BREAKS ); - } - - @Override - public void die(Object cause) { - - Dungeon.level.drop(new Sokoban4(), pos).sprite.drop(); - - if (!Dungeon.limitedDrops.journal.dropped()){ - Dungeon.level.drop(new DolyaSlate(), pos).sprite.drop(); - Dungeon.limitedDrops.journal.drop(); - } - - GameScene.bossSlain(); - ((CityBossLevel) Dungeon.level).unseal(); - - Dungeon.level.drop(new SkeletonKey(Dungeon.depth), pos).sprite.drop(); - Dungeon.level.drop(new Gold(Random.Int(1000, 2000)), pos).sprite.drop(); - - Badges.validateBossSlain(); - //summonLiches(findTomb); - //GLog.n(Messages.get(this, "liches")); - - super.die(cause); - - } - - private int maxArmySize() { - return 2; - } - - public boolean checkBattery() { - - int batteryAlive = 0; - if (Dungeon.level.mobs != null) { - for (Mob mob : Dungeon.level.mobs) { - if (mob instanceof BatteryTomb) { - batteryAlive++; - } - } - } - if (batteryAlive > 0) { - return true; - } else { - return false; - } - } - - @Override - public void damage(int dmg, Object src) { - if (checkBattery()) { - dmg = Random.Int(10); - //Buff.affect(this,ShieldArmor.class).level(100); - } - super.damage(dmg, src); - } - - @Override - public void notice() { - super.notice(); - yell(Messages.get(this,"notice")); - } - - private static final HashSet> RESISTANCES = new HashSet>(); - static { - RESISTANCES.add(ToxicGas.class); - RESISTANCES.add(EnchantmentDark.class); - - RESISTANCES.add(WandOfDisintegration.class); - } - - @Override - public HashSet> resistances() { - return RESISTANCES; - } - - private static final HashSet> IMMUNITIES = new HashSet>(); - static { - IMMUNITIES.add(Paralysis.class); - IMMUNITIES.add(Vertigo.class); - } - - @Override - public HashSet> immunities() { - return IMMUNITIES; - } - - public static class BatteryTomb extends Mob { - - { - spriteClass = BatteryTombSprite.class; - - HP = HT = 200; - evadeSkill = 0; - - EXP = 10; - - hostile = false; - state = PASSIVE; - - loot = new StoneOre(); - lootChance = 0.05f; - - properties.add(Property.MECH); - properties.add(Property.BOSS); - } - - @Override - public boolean act() { - - if( Random.Int(20) == 0 && Dungeon.level.mobs.size()< 6) { - ManySkeleton.spawnAround(pos); - } - return super.act(); - } - - @Override - public void beckon(int cell) { - // Do nothing - } - - @Override - public void add(Buff buff) { - } - - - @Override - public int damageRoll() { - return 0; - } - - @Override - public int hitSkill(Char target) { - return 0; - } - - @Override - public int drRoll() { - return 0; - - } - - @Override - public void damage(int dmg, Object src) { - if ( dmg > 50 ) dmg = 50; - super.damage(dmg, src); - - } -} - public static class LinkBomb extends Mob { - { - spriteClass = SeekingBombSprite.class; - - HP = HT = 1; - evadeSkill = 0; - baseSpeed = 1f; - EXP = 0; - - state = PASSIVE; - - properties.add(Property.MECH); - properties.add(Property.MINIBOSS); - } - - private int bombtime=3; - private static final String BOMBTIME = "bombtime"; - - public void storeInBundle( Bundle bundle ) { - super.storeInBundle(bundle); - bundle.put( BOMBTIME, bombtime ); - } - - @Override - public void restoreFromBundle( Bundle bundle ) { - super.restoreFromBundle(bundle); - bombtime = bundle.getInt( BOMBTIME ); - } - - @Override - public int drRoll() { - return 0; - } - - @Override - public boolean act() { - yell(""+bombtime+"!"); - if (bombtime < 1){ - DungeonBomb bomb = new DungeonBomb(); - bomb.explode(pos); - yell("KA-BOOM!!!"); - destroy(); - sprite.die(); - } - bombtime --; - return super.act(); - } - - } -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/LitTower.java b/java/com/hmdzl/spspd/change/actors/mobs/LitTower.java deleted file mode 100644 index 24cf56cc..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/LitTower.java +++ /dev/null @@ -1,207 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs; - -import java.util.HashSet; - -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.ResultDescriptions; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.ConfusionGas; -import com.hmdzl.spspd.change.actors.blobs.ToxicGas; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Terror; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.actors.mobs.Yog.InfectingFist; -import com.hmdzl.spspd.change.actors.mobs.Yog.PinningFist; -import com.hmdzl.spspd.change.actors.mobs.Yog.RottingFist; -import com.hmdzl.spspd.change.effects.particles.SparkParticle; -import com.hmdzl.spspd.change.items.RedDewdrop; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfPsionicBlast; -import com.hmdzl.spspd.change.items.weapon.enchantments.EnchantmentDark; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.traps.LightningTrap; -import com.hmdzl.spspd.change.mechanics.Ballistica; -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.hmdzl.spspd.change.sprites.OtiluckStoneSprite; -import com.hmdzl.spspd.change.sprites.ShellSprite; -import com.hmdzl.spspd.change.utils.GLog; - -import com.watabou.noosa.Camera; -import com.watabou.utils.Callback; -import com.watabou.utils.Random; - -public class LitTower extends Mob implements Callback { - - private static final float TIME_TO_ZAP = 2f; - - private static final String TXT_LIGHTNING_KILLED = "%s's lightning bolt killed you..."; - - { - spriteClass = OtiluckStoneSprite.class; - - HP = HT = 600; - evadeSkill = 1000; - - EXP = 25; - - hostile = false; - state = PASSIVE; - - loot = new RedDewdrop(); - lootChance = 1f; - - properties.add(Property.MECH); - properties.add(Property.BOSS); - } - - @Override - public void beckon(int cell) { - // Do nothing - } - - @Override - public int damageRoll() { - return 0; - } - - - @Override - public int hitSkill(Char target) { - return 100; - } - - @Override - public int drRoll() { - return 1000; - } - - - @Override - public void damage(int dmg, Object src) { - } - - @Override - protected boolean act() { - if(Level.distance(pos, Dungeon.hero.pos)<5 && Dungeon.hero.isAlive() && checkOtiluke()){ - zapAll(Dungeon.hero.pos); - } - return super.act(); - } - - @Override - public void call() { - next(); - } - - protected boolean checkOtiluke(){ - boolean check = false; - - for (Mob mob : Dungeon.level.mobs) { - if (mob instanceof Otiluke) { - check=true; - } - } - return check; - } - - - protected boolean heroNear (){ - boolean check=false; - for (int i : Level.NEIGHBOURS9DIST2){ - int cell=pos+i; - if (Actor.findChar(cell) != null - && (Actor.findChar(cell) instanceof Hero) - ){ - check=true; - } - } - return check; - } - - - @Override - protected boolean canAttack(Char enemy) { - return new Ballistica( pos, enemy.pos, Ballistica.MAGIC_BOLT).collisionPos == enemy.pos; - } - - @Override - protected boolean doAttack(Char enemy) { - return false; - } - - - public void zapAll(int loc){ - - yell(Messages.get(this,"zap")); - - Char hero=Dungeon.hero; - - int mobDmg=Random.Int(200, 300); - - - boolean visible = Level.fieldOfView[pos] || Level.fieldOfView[loc]; - - - if (visible) { - ((OtiluckStoneSprite) sprite).zap(loc); - } - - - hero.damage(mobDmg, this); - - hero.sprite.centerEmitter().burst(SparkParticle.FACTORY, 3); - hero.sprite.flash(); - - Camera.main.shake(2, 0.3f); - } - - @Override - public void add(Buff buff) { - } - - - private static final HashSet> RESISTANCES = new HashSet>(); - static { - RESISTANCES.add(EnchantmentDark.class); - - RESISTANCES.add(LightningTrap.Electricity.class); - } - - @Override - public HashSet> resistances() { - return RESISTANCES; - } - - private static final HashSet> IMMUNITIES = new HashSet>(); - static { - IMMUNITIES.add(ToxicGas.class); - IMMUNITIES.add(Terror.class); - IMMUNITIES.add(ConfusionGas.class); - } - - @Override - public HashSet> immunities() { - return IMMUNITIES; - } - - -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/LiveMoss.java b/java/com/hmdzl/spspd/change/actors/mobs/LiveMoss.java deleted file mode 100644 index ccee62e9..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/LiveMoss.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs; - -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.GrowSeed; -import com.hmdzl.spspd.change.items.Generator; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.sprites.LiveMossSprite; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -public class LiveMoss extends Mob { - - private boolean liveseed = false; - - { - spriteClass = LiveMossSprite.class; - - HP = HT = 50+(adj(0)*Random.NormalIntRange(1, 3)); - evadeSkill = 5+adj(1); - - EXP = 5; - maxLvl = 9; - - loot = Generator.random(Generator.Category.MUSHROOM); - lootChance = 0.2f; - - properties.add(Property.PLANT); - } - - @Override - public int damageRoll() { - return Random.NormalIntRange(3, 6+adj(0)); - } - - @Override - public int hitSkill(Char target) { - return 12+adj(0); - } - - @Override - public int drRoll() { - return Random.NormalIntRange(0, 4); - } - - @Override - public int attackProc(Char enemy, int damage) { - if (Random.Int(3) == 0 && !liveseed) { - Buff.affect(enemy, GrowSeed.class).reignite(enemy); - liveseed=true; - } - - return damage; - } - - private final String LIVESEED = "liveseed"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(LIVESEED, liveseed); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - liveseed = bundle.getBoolean(LIVESEED); - } - -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/MagicEye.java b/java/com/hmdzl/spspd/change/actors/mobs/MagicEye.java deleted file mode 100644 index fd44fe60..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/MagicEye.java +++ /dev/null @@ -1,193 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs; - -import java.util.HashSet; - -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.ResultDescriptions; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Light; -import com.hmdzl.spspd.change.actors.buffs.Terror; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.particles.PurpleParticle; -import com.hmdzl.spspd.change.items.potions.PotionOfMending; -import com.hmdzl.spspd.change.items.wands.WandOfDisintegration; -import com.hmdzl.spspd.change.items.weapon.enchantments.EnchantmentDark; - -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.mechanics.Ballistica; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.hmdzl.spspd.change.sprites.MagicEyeSprite; - -import com.watabou.noosa.tweeners.AlphaTweener; -import com.watabou.utils.Random; - -public class MagicEye extends Mob { - - private static final String TXT_DEATHGAZE_KILLED = "%s's deathgaze killed you..."; - protected static final float SPAWN_DELAY = 2f; - - { - spriteClass = MagicEyeSprite.class; - - HP = HT = 100+(adj(0)*Random.NormalIntRange(4, 7)); - evadeSkill = 40+adj(1); - viewDistance = Light.DISTANCE; - - EXP = 16; - - flying = true; - - loot = new PotionOfMending(); - lootChance = 0.05f; - - properties.add(Property.DEMONIC); - properties.add(Property.ELEMENT); - } - - private Ballistica beam; - - @Override - public int drRoll() { - return Random.NormalIntRange(0, 20); - } - - @Override - protected boolean canAttack(Char enemy) { - - beam = new Ballistica( pos, enemy.pos, Ballistica.STOP_TERRAIN); - - return beam.subPath(1, beam.dist).contains(enemy.pos); - } - - @Override - public int hitSkill(Char target) { - return 30+adj(0); - } - - @Override - protected float attackDelay() { - return 2f; - } - - @Override - protected boolean doAttack(Char enemy) { - - spend(attackDelay()); - - boolean rayVisible = false; - - for (int i : beam.subPath(0, beam.dist)) { - if (Dungeon.visible[i]) { - rayVisible = true; - } - } - - if (rayVisible) { - sprite.attack( beam.collisionPos ); - return false; - } else { - attack( enemy ); - return true; - } - } - - @Override - public boolean attack(Char enemy) { - - for (int pos : beam.subPath(1, beam.dist)) { - - Char ch = Actor.findChar(pos); - if (ch == null) { - continue; - } - - if (hit(this, ch, true)) { - ch.damage(Random.NormalIntRange(50, 100), this); - damage(Random.NormalIntRange(50, 100), this); - if (Dungeon.visible[pos]) { - ch.sprite.flash(); - CellEmitter.center(pos).burst(PurpleParticle.BURST, - Random.IntRange(1, 2)); - } - - if (!ch.isAlive() && ch == Dungeon.hero) { - Dungeon.fail( Messages.format(ResultDescriptions.MOB)); - //GLog.n(Messages.get(this, "kill")); - } - } else { - ch.sprite.showStatus(CharSprite.NEUTRAL, ch.defenseVerb()); - } - } - - return true; - } - - public static void spawnAroundChance(int pos) { - for (int n : Level.NEIGHBOURS4) { - int cell = pos + n; - if (Level.passable[cell] && Actor.findChar(cell) == null && Random.Float()<0.50f) { - spawnAt(cell); - } - } - } - - public static MagicEye spawnAt(int pos) { - if (Level.passable[pos] && Actor.findChar(pos) == null) { - - MagicEye e = new MagicEye(); - e.pos = pos; - e.state = e.HUNTING; - GameScene.add(e, SPAWN_DELAY); - - e.sprite.alpha(0); - e.sprite.parent.add(new AlphaTweener(e.sprite, 1, 0.5f)); - - return e; - - } else { - return null; - } - } - - private static final HashSet> RESISTANCES = new HashSet>(); - static { - RESISTANCES.add(WandOfDisintegration.class); - RESISTANCES.add(EnchantmentDark.class); - - } - - @Override - public HashSet> resistances() { - return RESISTANCES; - } - - private static final HashSet> IMMUNITIES = new HashSet>(); - static { - IMMUNITIES.add(Terror.class); - } - - @Override - public HashSet> immunities() { - return IMMUNITIES; - } -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/ManySkeleton.java b/java/com/hmdzl/spspd/change/actors/mobs/ManySkeleton.java deleted file mode 100644 index 661e880a..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/ManySkeleton.java +++ /dev/null @@ -1,150 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Burning; -import com.hmdzl.spspd.change.actors.buffs.Poison; -import com.hmdzl.spspd.change.effects.Pushing; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.potions.PotionOfMending; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.Terrain; -import com.hmdzl.spspd.change.levels.features.Door; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ManySkeletonSprite; -import com.hmdzl.spspd.change.sprites.SwarmSprite; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -public class ManySkeleton extends Mob { - - { - spriteClass = ManySkeletonSprite.class; - - HP = HT = 100; - evadeSkill = 5; - - EXP = 10; - maxLvl = 30; - - flying = true; - - properties.add(Property.UNDEAD); - } - - private static final float SPLIT_DELAY = 1f; - - int generation = 0; - - private static final String GENERATION = "generation"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(GENERATION, generation); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - generation = bundle.getInt(GENERATION); - } - - @Override - public int damageRoll() { - return Random.NormalIntRange(4, 7); - } - - @Override - public int defenseProc(Char enemy, int damage) { - - if (HP >= damage + 2) { - ArrayList candidates = new ArrayList(); - boolean[] passable = Level.passable; - - int[] neighbours = { pos + 1, pos - 1, pos + Level.getWidth(), - pos - Level.getWidth() }; - for (int n : neighbours) { - if (passable[n] && Actor.findChar(n) == null) { - candidates.add(n); - } - } - - if (candidates.size() > 0) { - - SommonSkeleton clone = new SommonSkeleton(); - clone.HP = (HP - damage) / 2; - clone.pos = Random.element(candidates); - clone.state = clone.HUNTING; - - if (Dungeon.level.map[clone.pos] == Terrain.DOOR) { - Door.enter(clone.pos); - } - - GameScene.add(clone, SPLIT_DELAY); - Actor.addDelayed(new Pushing(clone, pos, clone.pos), -1); - - HP -= clone.HP; - } - } - - return damage; - } - - @Override - public int hitSkill(Char target) { - return 30+adj(01); - } - - @Override - public void die(Object cause) { - Skeleton.spawnAround(this.pos); - super.die(cause); - } - - public static void spawnAround(int pos) { - for (int n : Level.NEIGHBOURS4) { - int cell = pos + n; - if (Level.passable[cell] && Actor.findChar(cell) == null) { - spawnAt(cell); - } - } - } - - public static ManySkeleton spawnAt(int pos) { - if (Level.passable[pos] && Actor.findChar(pos) == null) { - - ManySkeleton w = new ManySkeleton(); - w.pos = pos; - w.state = w.HUNTING; - GameScene.add(w, 1f); - return w; - - } else { - return null; - } - } - -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/Mimic.java b/java/com/hmdzl/spspd/change/actors/mobs/Mimic.java deleted file mode 100644 index 016ef971..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/Mimic.java +++ /dev/null @@ -1,171 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashSet; -import java.util.List; - -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Pushing; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.Gold; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfPsionicBlast; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.MimicSprite; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -public class Mimic extends Mob { - - private int level; - - { - spriteClass = MimicSprite.class; - - properties.add(Property.UNKNOW); - } - - public ArrayList items; - - private static final String LEVEL = "level"; - private static final String ITEMS = "items"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(ITEMS, items); - bundle.put(LEVEL, level); - } - - @SuppressWarnings("unchecked") - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - items = new ArrayList( - (Collection) ((Collection) bundle.getCollection(ITEMS))); - adjustStats(bundle.getInt(LEVEL)); - } - - @Override - public int damageRoll() { - return Random.NormalIntRange(HT/20, HT/10); - } - - @Override - public int hitSkill(Char target) { - return 9 + level; - } - - @Override - public int attackProc(Char enemy, int damage) { - return super.attackProc(enemy, damage); - } - - public void adjustStats(int level) { - this.level = level; - - HT = (30 + level) * 4; - EXP = 2 + 2 * (level - 1) / 5; - evadeSkill = hitSkill(null) / 2; - - enemySeen = true; - } - - @Override - public void die(Object cause) { - - super.die(cause); - - if (items != null) { - for (Item item : items) { - Dungeon.level.drop(item, pos).sprite.drop(); - } - } - } - - @Override - public boolean reset() { - state = WANDERING; - return true; - } - - public static Mimic spawnAt(int pos, List items) { - Char ch = Actor.findChar(pos); - if (ch != null) { - ArrayList candidates = new ArrayList(); - for (int n : Level.NEIGHBOURS8) { - int cell = pos + n; - if ((Level.passable[cell] || Level.avoid[cell]) - && Actor.findChar(cell) == null) { - candidates.add(cell); - } - } - if (candidates.size() > 0) { - int newPos = Random.element(candidates); - Actor.addDelayed(new Pushing(ch, ch.pos, newPos), -1); - - ch.pos = newPos; - // FIXME - if (ch instanceof Mob) { - Dungeon.level.mobPress((Mob) ch); - } else { - Dungeon.level.press(newPos, ch); - } - } else { - return null; - } - } - - Mimic m = new Mimic(); - m.items = new ArrayList(items); - m.adjustStats(Dungeon.depth); - m.HP = m.HT; - m.pos = pos; - m.state = m.HUNTING; - GameScene.add(m, 1); - - m.sprite.turnTo(pos, Dungeon.hero.pos); - - if (Dungeon.visible[m.pos]) { - CellEmitter.get(pos).burst(Speck.factory(Speck.STAR), 10); - Sample.INSTANCE.play(Assets.SND_MIMIC); - } - - return m; - } - - private static final HashSet> IMMUNITIES = new HashSet>(); - static { - IMMUNITIES.add(ScrollOfPsionicBlast.class); - } - - @Override - public HashSet> immunities() { - return IMMUNITIES; - } -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/MineSentinel.java b/java/com/hmdzl/spspd/change/actors/mobs/MineSentinel.java deleted file mode 100644 index a5acb09f..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/MineSentinel.java +++ /dev/null @@ -1,264 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs; - -import java.util.ArrayList; -import java.util.HashSet; - -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.ToxicGas; -import com.hmdzl.spspd.change.actors.buffs.Amok; -import com.hmdzl.spspd.change.actors.buffs.Burning; -import com.hmdzl.spspd.change.actors.buffs.Charm; -import com.hmdzl.spspd.change.actors.buffs.Poison; -import com.hmdzl.spspd.change.actors.buffs.Sleep; -import com.hmdzl.spspd.change.actors.buffs.Terror; -import com.hmdzl.spspd.change.actors.buffs.Vertigo; -import com.hmdzl.spspd.change.actors.buffs.Paralysis; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.Generator; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfPsionicBlast; -import com.hmdzl.spspd.change.items.weapon.Weapon; -import com.hmdzl.spspd.change.items.weapon.Weapon.Enchantment; -import com.hmdzl.spspd.change.items.weapon.enchantments.EnchantmentDark; - -import com.hmdzl.spspd.change.items.weapon.melee.MeleeWeapon; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.sprites.SentinelSprite; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -public class MineSentinel extends Mob { - - - { - spriteClass = SentinelSprite.class; - - EXP = 25; - state = PASSIVE; - - properties.add(Property.MECH); - } - private static final int REGENERATION = 100; - - private Weapon weapon; - - public MineSentinel() { - super(); - - do { - weapon = (Weapon) Generator.random(Generator.Category.OLDWEAPON); - } while (!(weapon instanceof MeleeWeapon) || weapon.level < 0); - - weapon.identify(); - weapon.enchant(Enchantment.randomLow()); - weapon.upgrade(10); - - - HP = HT = 400 + Dungeon.depth * 10; - //HP = HT = 5; - evadeSkill = 15; - //evadeSkill = 2; - } - - private static final String WEAPON = "weapon"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(WEAPON, weapon); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - weapon = (Weapon) bundle.get(WEAPON); - } - - @Override - protected boolean act() { - - Hero hero = Dungeon.hero; - ArrayList spawnPoints = new ArrayList(); - - - if(state==HUNTING){ - for (int i = 0; i < Level.NEIGHBOURS8.length; i++) { - int p = pos + Level.NEIGHBOURS8[i]; - Char ch = Actor.findChar(p); - if (ch != null && ch instanceof MineSentinel && Random.Int(10)<2) { - ch.damage(1, this); - if (((Mob)ch).state==PASSIVE){ - ((Mob)ch).state = HUNTING; - } - break; - } - } - - } - - if (!heroNear() && Random.Float() < 0.50f && state==HUNTING){ - for (int i = 0; i < Level.NEIGHBOURS8.length; i++) { - int p = hero.pos + Level.NEIGHBOURS8[i]; - if (Actor.findChar(p) == null - && (Level.passable[p] || Level.avoid[p])) { - spawnPoints.add(p); - } - } - - if (spawnPoints.size() > 0) { - int newPos; - newPos=Random.element(spawnPoints); - Actor.freeCell(pos); - CellEmitter.get(pos).start(Speck.factory(Speck.LIGHT), 0.2f, 3); - pos = newPos; - sprite.place(pos); - sprite.visible = Dungeon.visible[pos]; - } - - } else { - - if (HP<(HT/4) && Random.Float() < 0.50f && state!=PASSIVE){ - int newPos = -1; - for (int i = 0; i < 20; i++) { - newPos = Dungeon.level.randomRespawnCellMob(); - if (newPos != -1) { - break; - } - } - if (newPos != -1) { - Actor.freeCell(pos); - CellEmitter.get(pos).start(Speck.factory(Speck.LIGHT), 0.2f, 3); - pos = newPos; - sprite.place(pos); - sprite.visible = Dungeon.visible[pos]; - HP += REGENERATION; - } - - } - } - return super.act(); - } - - protected boolean heroNear (){ - boolean check=false; - for (int i : Level.NEIGHBOURS9DIST2){ - int cell=pos+i; - if (Actor.findChar(cell) != null - && (Actor.findChar(cell) instanceof Hero) - ){ - check=true; - } - } - return check; - } - - @Override - public int damageRoll() { - return Random.NormalIntRange(weapon.MIN, weapon.MAX); - } - - @Override - public int hitSkill(Char target) { - return (int) ((30 + Dungeon.depth*2) * weapon.ACU); - } - - @Override - protected float attackDelay() { - return weapon.DLY; - } - - @Override - public int drRoll() { - //return Dungeon.depth*3; - return Random.NormalIntRange(3, 30); - } - - @Override - public void damage(int dmg, Object src) { - - if (state == PASSIVE) { - state = HUNTING; - } - - super.damage(dmg, src); - } - - - @Override - public int attackProc(Char enemy, int damage) { - weapon.proc(this, enemy, damage); - return damage; - } - - @Override - public void beckon(int cell) { - // Do nothing - } - - @Override - public void die(Object cause) { - super.die(cause); - Dungeon.level.drop(weapon, pos).sprite.drop(); - } - - @Override - public boolean reset() { - state = PASSIVE; - return true; - } - - @Override - public String description() { - return Messages.get(this, "desc", weapon.name()); - } - - private static final HashSet> RESISTANCES = new HashSet>(); - private static final HashSet> IMMUNITIES = new HashSet>(); - static { - RESISTANCES.add(ToxicGas.class); - RESISTANCES.add(Poison.class); - RESISTANCES.add(EnchantmentDark.class); - - IMMUNITIES.add(EnchantmentDark.class); - IMMUNITIES.add(Terror.class); - IMMUNITIES.add(Amok.class); - IMMUNITIES.add(Charm.class); - IMMUNITIES.add(Sleep.class); - IMMUNITIES.add(Burning.class); - IMMUNITIES.add(ToxicGas.class); - IMMUNITIES.add(ScrollOfPsionicBlast.class); - IMMUNITIES.add(Vertigo.class); - IMMUNITIES.add(Paralysis.class); - } - - @Override - public HashSet> resistances() { - return RESISTANCES; - } - - @Override - public HashSet> immunities() { - return IMMUNITIES; - } -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/Mob.java b/java/com/hmdzl/spspd/change/actors/mobs/Mob.java deleted file mode 100644 index a12b8909..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/Mob.java +++ /dev/null @@ -1,1061 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs; - -import java.util.ArrayList; -import java.util.HashSet; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.Challenges; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.Statistics; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.AflyBless; -import com.hmdzl.spspd.change.actors.buffs.Amok; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Corruption; -import com.hmdzl.spspd.change.actors.buffs.Dewcharge; -import com.hmdzl.spspd.change.actors.buffs.Disarm; -import com.hmdzl.spspd.change.actors.buffs.Feed; -import com.hmdzl.spspd.change.actors.buffs.Hunger; -import com.hmdzl.spspd.change.actors.buffs.Rhythm; -import com.hmdzl.spspd.change.actors.buffs.Rhythm2; -import com.hmdzl.spspd.change.actors.buffs.Sleep; -import com.hmdzl.spspd.change.actors.buffs.SoulMark; -import com.hmdzl.spspd.change.actors.buffs.SpAttack; -import com.hmdzl.spspd.change.actors.buffs.Taunt; -import com.hmdzl.spspd.change.actors.buffs.Terror; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.hero.HeroClass; -import com.hmdzl.spspd.change.actors.hero.HeroSubClass; -import com.hmdzl.spspd.change.actors.mobs.npcs.NPC; -import com.hmdzl.spspd.change.effects.Pushing; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.effects.Surprise; -import com.hmdzl.spspd.change.effects.Wound; -import com.hmdzl.spspd.change.items.Generator; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.RedDewdrop; -import com.hmdzl.spspd.change.items.VioletDewdrop; -import com.hmdzl.spspd.change.items.YellowDewdrop; -import com.hmdzl.spspd.change.items.artifacts.TimekeepersHourglass; -import com.hmdzl.spspd.change.items.misc.LuckyBadge; -import com.hmdzl.spspd.change.items.misc.Shovel; -import com.hmdzl.spspd.change.items.rings.RingOfAccuracy; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.Level.Feeling; -import com.hmdzl.spspd.change.levels.Terrain; -import com.hmdzl.spspd.change.levels.features.Door; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.hmdzl.spspd.change.utils.GLog; -import com.hmdzl.spspd.change.items.misc.Spectacles.MagicSight; - -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -public abstract class Mob extends Char { - - { - name = Messages.get(this, "name"); - } - - private static final String TXT_DIED = "You hear something died in the distance"; - - protected static final String TXT_NOTICE1 = "?!"; - protected static final String TXT_RAGE = "#$%^"; - protected static final String TXT_EXP = "%+dEXP"; - - public AiState SLEEPING = new Sleeping(); - public AiState HUNTING = new Hunting(); - public AiState WANDERING = new Wandering(); - public AiState FLEEING = new Fleeing(); - public AiState PASSIVE = new Passive(); - public AiState state = SLEEPING; - - public Class spriteClass; - - protected int target = -1; - - protected int evadeSkill = 0; - - //public int EXP = 1; - protected int EXP = 1; - //public int maxLvl = 100; - protected int maxLvl = 100; - protected int dewLvl = 1; - - protected Char enemy; - protected boolean enemySeen; - protected boolean alerted = false; - - protected static final float TIME_TO_WAKE_UP = 1f; - - public boolean hostile = true; - public boolean ally = false; - public boolean originalgen = false; - - private static final String STATE = "state"; - private static final String SEEN = "seen"; - private static final String TARGET = "target"; - private static final String ORIGINAL = "originalgen"; - - public int getExp(){ - return EXP; - } - - @Override - public void storeInBundle(Bundle bundle) { - - super.storeInBundle(bundle); - - if (state == SLEEPING) { - bundle.put(STATE, Sleeping.TAG); - } else if (state == WANDERING) { - bundle.put(STATE, Wandering.TAG); - } else if (state == HUNTING) { - bundle.put(STATE, Hunting.TAG); - } else if (state == FLEEING) { - bundle.put(STATE, Fleeing.TAG); - } else if (state == PASSIVE) { - bundle.put(STATE, Passive.TAG); - } - bundle.put(SEEN, enemySeen); - bundle.put(TARGET, target); - bundle.put(ORIGINAL, originalgen); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - - super.restoreFromBundle(bundle); - - String state = bundle.getString(STATE); - if (state.equals(Sleeping.TAG)) { - this.state = SLEEPING; - } else if (state.equals(Wandering.TAG)) { - this.state = WANDERING; - } else if (state.equals(Hunting.TAG)) { - this.state = HUNTING; - } else if (state.equals(Fleeing.TAG)) { - this.state = FLEEING; - } else if (state.equals(Passive.TAG)) { - this.state = PASSIVE; - } - - enemySeen = bundle.getBoolean(SEEN); - - target = bundle.getInt(TARGET); - - originalgen = bundle.getBoolean(ORIGINAL); - } - - public CharSprite sprite() { - CharSprite sprite = null; - try { - sprite = spriteClass.newInstance(); - } catch (Exception e) { - } - return sprite; - } - - @Override - protected boolean act() { - - super.act(); - - boolean justAlerted = alerted; - alerted = false; - - //sprite.hideAlert(); - if (justAlerted){ - sprite.showAlert(); - } else { - sprite.hideAlert(); - sprite.hideLost(); - } - - - if (paralysed > 0) { - enemySeen = false; - spend(TICK); - return true; - } - - enemy = chooseEnemy(); - - if (!(this instanceof NPC)){ - if (enemy != null) { - ArrayList candidates = new ArrayList(); - for (int n : Level.NEIGHBOURS8) { - int cell = enemy.pos + n; - if ((Level.passable[cell] || Level.avoid[cell])) { - candidates.add(cell); - } - } - if (candidates.size() > 0 && this.pos == enemy.pos) { - int newPos = Random.element(candidates); - Actor.addDelayed(new Pushing(enemy, enemy.pos, newPos), -1); - enemy.pos = newPos; - } - } - } - boolean enemyInFOV = enemy != null && enemy.isAlive() - && Level.fieldOfView[enemy.pos] && enemy.invisible<=0 ; - - return state.act(enemyInFOV, justAlerted); - - } - - protected Char chooseEnemy() { - - Terror terror = buff( Terror.class ); - if (terror != null) { - Char source = (Char)Actor.findById( terror.object ); - if (source != null) { - return source; - } - } - - //find a new enemy if.. - boolean newEnemy = false; - //we have no enemy, or the current one is dead - if ( enemy == null || !enemy.isAlive() || state == WANDERING) - newEnemy = true; - //We are corrupted, and current enemy is either the hero or another corrupted character. - else if (buff(Corruption.class) != null && (enemy == Dungeon.hero || enemy.buff(Corruption.class) != null)) - newEnemy = true; - //We are amoked and current enemy is the hero - else if (buff( Amok.class ) != null && enemy == Dungeon.hero) - newEnemy = true; - - if ( newEnemy ) { - - HashSet enemies = new HashSet<>(); - - //if the mob is corrupted... - if ( buff(Corruption.class) != null) { - - //look for enemy mobs to attack, which are also not corrupted - for (Mob mob : Dungeon.level.mobs) - if (mob != this && Level.fieldOfView[mob.pos] && mob.hostile && mob.buff(Corruption.class) == null) - enemies.add(mob); - if (enemies.size() > 0) return Random.element(enemies); - - //otherwise go for nothing - return this; - - //if the mob is amoked... - } else if ( buff(Amok.class) != null) { - - //try to find an enemy mob to attack first. - for (Mob mob : Dungeon.level.mobs) - if (mob != this && Level.fieldOfView[mob.pos] && mob.hostile) - enemies.add(mob); - if (enemies.size() > 0) return Random.element(enemies); - - //try to find ally mobs to attack second. - for (Mob mob : Dungeon.level.mobs) - if (mob != this && Level.fieldOfView[mob.pos] && mob.ally) - enemies.add(mob); - if (enemies.size() > 0) return Random.element(enemies); - - //if there is nothing, go for the hero - else return Dungeon.hero; - - } else { - - //try to find ally mobs to attack. - for (Mob mob : Dungeon.level.mobs) - if (mob != this && Level.fieldOfView[mob.pos] && mob.ally) - enemies.add(mob); - - //and add the hero to the list of targets. - enemies.add(Dungeon.hero); - - //go after the closest enemy, preferring the hero if two are equidistant - // Char closest = null; - //for (Char curr : enemies){ - //if (closest == null - // || Dungeon.level.distance(pos, curr.pos) < Dungeon.level.distance(pos, closest.pos) - // || Dungeon.level.distance(pos, curr.pos) == Dungeon.level.distance(pos, closest.pos) && curr == Dungeon.hero){ - //closest = curr; - //} - //} - //return closest; - return Random.element(enemies); - - } - - } else - return enemy; - - // resets target if: the target is dead, the target has been lost - // (wandering) - // or if the mob is amoked and targeting the hero (will try to target - // something else) - /*if (enemy != null && !enemy.isAlive() || state == WANDERING - || (buff(Amok.class) != null && enemy == Dungeon.hero) - || (buff(Corruption.class) != null && enemy == Dungeon.hero)) - enemy = null; - // if there is no current target, find a new one. - if (enemy == null) { - HashSet enemies = new HashSet(); - // if the mob is amoked... - if (buff(Amok.class) != null) { - // try to find an enemy mob to attack first. - for (Mob mob : Dungeon.level.mobs) - if (mob != this && Level.fieldOfView[mob.pos] - && mob.hostile) - enemies.add(mob); - if (enemies.size() > 0) - return Random.element(enemies); - // try to find ally mobs to attack second. - for (Mob mob : Dungeon.level.mobs) - if (mob != this && Level.fieldOfView[mob.pos] && mob.ally) - enemies.add(mob); - if (enemies.size() > 0) - return Random.element(enemies); - - // if there is nothing, go for the hero. - return Dungeon.hero; - - // if the mob is Corruption... - } else if (buff(Corruption.class) != null) { - // try to find an enemy mob to attack first. - for (Mob mob : Dungeon.level.mobs) - if (mob != this && Level.fieldOfView[mob.pos] - && mob.hostile) - enemies.add(mob); - if (enemies.size() > 0) - return Random.element(enemies); - - // try to find ally mobs to attack second. - for (Mob mob : Dungeon.level.mobs) - if (mob != this && Level.fieldOfView[mob.pos] && !mob.ally) - enemies.add(mob); - if (enemies.size() > 0) - return Random.element(enemies); - - // if there is nothing, go for the itself. - return null; - // if the mob is not amoked... - } else { - // try to find ally mobs to attack. - for (Mob mob : Dungeon.level.mobs) - if (mob != this && Level.fieldOfView[mob.pos] && mob.ally) - enemies.add(mob); - // and add the hero to the list of targets. - enemies.add(Dungeon.hero); - // target one at random. - return Random.element(enemies); - - } - - } else - return enemy; - */ - - } - - protected boolean moveSprite(int from, int to) { - - if (sprite.isVisible() - && (Dungeon.visible[from] || Dungeon.visible[to])) { - sprite.move(from, to); - return true; - } else { - sprite.place(to); - return true; - } - } - - @Override - public void add(Buff buff) { - super.add(buff); - if (buff instanceof Amok) { - if (sprite != null) { - sprite.showStatus(CharSprite.NEGATIVE, Messages.get(this, "rage")); - } - state = HUNTING; - } else if (buff instanceof Terror) { - state = FLEEING; - } else if (buff instanceof Sleep) { - state = SLEEPING; - this.sprite().showSleep(); - postpone(Sleep.SWS); - } - } - - @Override - public void remove(Buff buff) { - super.remove(buff); - if (buff instanceof Terror) { - sprite.showStatus(CharSprite.NEGATIVE,Messages.get(this, "rage")); - state = HUNTING; - } - } - - protected boolean canAttack(Char enemy) { - return Level.adjacent(pos, enemy.pos) && (!isCharmedBy(enemy) && (buff(Disarm.class) == null)); - } - - protected boolean getCloser(int target) { - - if (rooted) { - return false; - } - - int step = Dungeon.findPath(this, pos, target, Level.passable, - Level.fieldOfView); - if (step != -1) { - move(step); - return true; - } else { - return false; - } - } - - protected boolean getFurther(int target) { - int step = Dungeon.flee(this, pos, target, Level.passable, - Level.fieldOfView); - if (step != -1) { - move(step); - return true; - } else { - return false; - } - } - - @Override - public void updateSpriteState() { - super.updateSpriteState(); - if (Dungeon.hero.buff(TimekeepersHourglass.timeFreeze.class) != null) - sprite.add(CharSprite.State.PARALYSED); - } - - @Override - public void move(int step) { - super.move(step); - - if (!flying) { - Dungeon.level.mobPress(this); - } - } - - protected float attackDelay() { - return 1f; - } - - protected boolean doAttack(Char enemy) { - - boolean visible = Dungeon.visible[pos]; - - if (visible) { - sprite.attack(enemy.pos); - } else { - attack(enemy); - } - - spend(attackDelay()); - - return !visible; - } - - @Override - public void onAttackComplete() { - attack(enemy); - super.onAttackComplete(); - } - - @Override - public int evadeSkill(Char enemy) { - if (enemySeen && (paralysed == 0)) { - int evadeSkill = this.evadeSkill; - int penalty = 0; - for (Buff buff : enemy.buffs(RingOfAccuracy.Accuracy.class)) { - penalty += ((RingOfAccuracy.Accuracy) buff).level; - } - if (penalty != 0 && enemy == Dungeon.hero) - evadeSkill *= Math.pow(0.75, penalty); - return evadeSkill; - } else { - return 0; - } - } - - @Override - public int drRoll() { - return 0; - } - - @Override - public int defenseProc(Char enemy, int damage) { - if (!enemySeen && enemy == Dungeon.hero) { - if (((Hero)enemy).subClass == HeroSubClass.ASSASSIN) { - damage *= 1.5f; - Wound.hit(this); - } else { - Surprise.hit(this); - } - } - - SpAttack spatk = enemy.buff(SpAttack.class); - - if (HP == HT && spatk != null) { - damage *= 3f; - } - - if (HP < HT/4 && spatk != null) { - damage *= 1.5f; - } - - if (buff(SoulMark.class) != null) { - int restoration = Math.max(damage, HP); - Dungeon.hero.buff(Hunger.class).satisfy(restoration*0.5f); - Dungeon.hero.HP = (int)Math.ceil(Math.min(Dungeon.hero.HT, Dungeon.hero.HP+(restoration*0.25f))); - Dungeon.hero.sprite.emitter().burst( Speck.factory(Speck.HEALING), 1 ); - } - - return damage; - } - - public void aggro(Char ch) { - enemy = ch; - if (state != PASSIVE){ - state = HUNTING; - } - } - - public int adj(int type){ - - int adjustment; - - if (type == 0){ - adjustment = Dungeon.depth; - } else if (type == 1){ - adjustment = (int) Dungeon.depth/2; - } else if (type == 2){ - adjustment = (int) Dungeon.depth/4; - } else if (type == 3){ - adjustment = (int) Dungeon.depth*2; - } else adjustment = 1; - - return adjustment; - } - - @Override - public void damage(int dmg, Object src) { - - Terror.recover(this); - - if (state == SLEEPING) { - state = WANDERING; - } - - if (state != HUNTING) { - alerted = true; - } - //alerted = true; - - super.damage(dmg, src); - } - - @Override - public void destroy() { - - super.destroy(); - - Dungeon.level.mobs.remove(this); - - if (Dungeon.hero.isAlive()) { - - if (hostile) { - Statistics.enemiesSlain++; - Badges.validateMonstersSlain(); - Statistics.qualifiedForNoKilling = false; - - if (Dungeon.level.feeling == Feeling.DARK) { - Statistics.nightHunt++; - } else { - Statistics.nightHunt = 0; - } - Badges.validateNightHunter(); - - } - - if(Dungeon.hero.heroClass == HeroClass.PERFORMER){ - Buff.affect(Dungeon.hero,Rhythm.class,10); - - Shovel shovel = Dungeon.hero.belongings.getItem(Shovel.class); - if (shovel!=null && shovel.charge 0) { - Dungeon.hero.sprite.showStatus(CharSprite.POSITIVE, Messages.get(this, "exp", EXP)); - Dungeon.hero.earnExp(EXP); - } else if (EXP > 0) { - EXP = 1; - Dungeon.hero.sprite.showStatus(CharSprite.POSITIVE, Messages.get(this, "exp", EXP)); - Dungeon.hero.earnExp(EXP); - } - } - } - - public boolean checkOriginalGenMobs (){ - for (Mob mob : Dungeon.level.mobs.toArray(new Mob[0])) { - if (mob.originalgen){return true;} - } - return false; - } - - @Override - public void die(Object cause) { - - super.die(cause); - - int generation=0; - - if(this instanceof Swarm){ - Swarm swarm = (Swarm) this; - generation=swarm.generation; - } - - if(this instanceof Virus){ - Virus virus = (Virus) this; - generation=virus.generation; - } - - if(this instanceof SandMob.MiniSand){ - SandMob.MiniSand mnsand = (SandMob.MiniSand) this; - generation=mnsand.generation; - } - - if (Dungeon.hero.buff(Dewcharge.class) != null && generation==0) { - explodeDewHigh(pos); - } - - if (!Dungeon.level.cleared && originalgen && !checkOriginalGenMobs() && Dungeon.depth>2 - && Dungeon.depth<25 && !Dungeon.bossLevel(Dungeon.depth) && (Dungeon.dewDraw || Dungeon.dewWater)){ - Dungeon.level.cleared=true; - GameScene.levelCleared(); - if(Dungeon.depth>0){Statistics.prevfloormoves=Math.max(Dungeon.pars[Dungeon.depth]-Dungeon.level.currentmoves,0); - if (Statistics.prevfloormoves>1){ - GLog.h(Messages.get(this, "clear1"), Statistics.prevfloormoves); - } else if (Statistics.prevfloormoves==1){ - GLog.h(Messages.get(this, "clear2")); - } else if (Statistics.prevfloormoves==0){ - GLog.h(Messages.get(this, "clear3")); - } - } - } - - float lootChance = this.lootChance; - float lootChanceOther = this.lootChanceOther; - int bonus = 0; - for (Buff buff : Dungeon.hero.buffs(LuckyBadge.GreatLucky.class)) { - bonus += ((LuckyBadge.GreatLucky) buff).level; - } - if (Dungeon.hero.heroClass == HeroClass.SOLDIER) - bonus += 5; - if (Dungeon.hero.buff(AflyBless.class)!=null) { - bonus += 5; - } - - lootChance += 0.02*bonus; - lootChanceOther += 0.02*bonus; - - if (Random.Float() < lootChance && Dungeon.hero.lvl <= maxLvl + 800) { - Item loot = createLoot(); - if (loot != null) - Dungeon.level.drop(loot, pos).sprite.drop(); - - } else if (Random.Float() < lootChanceOther - && Dungeon.hero.lvl <= maxLvl + 800) { - Item lootOther = createLootOther(); - if (lootOther != null) - Dungeon.level.drop(lootOther, pos).sprite.drop(); - } - - if (Dungeon.hero.isAlive() && !Dungeon.visible[pos]) { - GLog.i(Messages.get(this, "died")); - } - - if (Dungeon.isChallenged(Challenges.NIGHTMARE_VIRUS) && !(this instanceof Virus)) { - ArrayList candidates = new ArrayList(); - boolean[] passable = Level.passable; - int[] neighbours = { pos + 1, pos - 1, pos + Level.getWidth(), - pos - Level.getWidth() }; - for (int n : neighbours) { - if (passable[n] && Actor.findChar(n) == null) { - candidates.add(n); - } - } - - if (candidates.size() > 0) { - - Virus virus = new Virus(); - virus.pos = Random.element(candidates); - virus.state = virus.HUNTING; - - if (Dungeon.level.map[virus.pos] == Terrain.DOOR) { - Door.enter(virus.pos); - } - - GameScene.add(virus, 1f); - Actor.addDelayed(new Pushing(virus, pos, virus.pos), -1); - } - - } - - } - - protected Object loot = null; - protected Object lootOther = null; - protected float lootChance = 0; - protected float lootChanceOther = 0; - - @SuppressWarnings("unchecked") - protected Item createLoot() { - Item item; - if (loot instanceof Generator.Category) { - - item = Generator.random((Generator.Category) loot); - - } else if (loot instanceof Class) { - - item = Generator.random((Class) loot); - - } else { - - item = (Item) loot; - - } - return item; - } - - @SuppressWarnings("unchecked") - protected Item createLootOther() { - Item item; - if (lootOther instanceof Generator.Category) { - - item = Generator.random((Generator.Category) lootOther); - - } else if (lootOther instanceof Class) { - - item = Generator.random((Class) lootOther); - - } else { - - item = (Item) lootOther; - - } - return item; - } - - public void explodeDew(int cell) { - - if (Dungeon.dewDraw || Dungeon.dewWater){ - Sample.INSTANCE.play(Assets.SND_BLAST, 2); - - if (Dungeon.isChallenged(Challenges.DEW_REJECTION)) { - for (int n : Level.NEIGHBOURS4) { - int c = cell + n; - if (c >= 0 && c < Level.getLength() && Level.passable[c]) { - - if (Random.Int(20) == 1) { - Dungeon.level.drop(new VioletDewdrop(), c).sprite.drop(); - } else if (Random.Int(8) == 1) { - Dungeon.level.drop(new RedDewdrop(), c).sprite.drop(); - } - } - } - } else { - for (int n : Level.NEIGHBOURS9) { - int c = cell + n; - if (c >= 0 && c < Level.getLength() && Level.passable[c]) { - - if (Random.Int(20) == 1) { - Dungeon.level.drop(new VioletDewdrop(), c).sprite.drop(); - } else if (Random.Int(8) == 1) { - Dungeon.level.drop(new RedDewdrop(), c).sprite.drop(); - } - } - } - } - } - } - - public void explodeDewHigh(int cell) { - - if (Dungeon.dewDraw || Dungeon.dewWater){ - Sample.INSTANCE.play(Assets.SND_BLAST, 2); - - if (Dungeon.isChallenged(Challenges.DEW_REJECTION)) { - for (int n : Level.NEIGHBOURS4) { - int c = cell + n; - if (c >= 0 && c < Level.getLength() && Level.passable[c]) { - - if (Random.Int(80) == 1) { - Dungeon.level.drop(new VioletDewdrop(), c).sprite.drop(); - } else if (Random.Int(10) == 1) { - Dungeon.level.drop(new RedDewdrop(), c).sprite.drop(); - } else if (Random.Int(2) == 0) { - Dungeon.level.drop(new YellowDewdrop(), c).sprite.drop(); - } - } - } - }else{ - for (int n : Level.NEIGHBOURS9) { - int c = cell + n; - if (c >= 0 && c < Level.getLength() && Level.passable[c]) { - - if (Random.Int(80)==1){Dungeon.level.drop(new VioletDewdrop(), c).sprite.drop();} - else if (Random.Int(10)==1){Dungeon.level.drop(new RedDewdrop(), c).sprite.drop();} - else if (Random.Int(2)==0){Dungeon.level.drop(new YellowDewdrop(), c).sprite.drop();} - } - } - } - } - } - - public boolean reset() { - return false; - } - - public void beckon(int cell) { - - notice(); - - if (state != HUNTING) { - state = WANDERING; - } - target = cell; - } - - public String description() { - return Messages.get(this, "desc"); - } - - public void notice() { - sprite.showAlert(); - } - - public void yell(String str) { - GLog.n("%s: \"%s\" ", name, str); - } - - // returns true when a mob sees the hero, and is currently targeting them. - public boolean focusingHero() { - return enemySeen && (target == Dungeon.hero.pos); - } - - public interface AiState { - public boolean act(boolean enemyInFOV, boolean justAlerted); - - public String status(); - } - - private class Sleeping implements AiState { - - public static final String TAG = "SLEEPING"; - - @Override - public boolean act(boolean enemyInFOV, boolean justAlerted) { - if (enemyInFOV - && Random.Int(distance(enemy) + enemy.stealth() - + (enemy.flying ? 2 : 0)) == 0) { - - enemySeen = true; - - notice(); - state = HUNTING; - target = enemy.pos; - - spend(TIME_TO_WAKE_UP); - - } else { - - enemySeen = false; - - spend(TICK); - - } - return true; - } - - @Override - public String status() { - return Messages.get(this, "status", name); - } - } - - private class Wandering implements AiState { - - public static final String TAG = "WANDERING"; - - @Override - public boolean act(boolean enemyInFOV, boolean justAlerted) { - if (enemyInFOV - && (justAlerted || Random.Int(distance(enemy) / 2 - + enemy.stealth()) == 0)) { - - enemySeen = true; - - notice(); - alerted = true; - state = HUNTING; - target = enemy.pos; - - } else { - - enemySeen = false; - - int oldPos = pos; - if (target != -1 && getCloser(target)) { - spend(1 / speed()); - return moveSprite(oldPos, pos); - } else { - target = Dungeon.level.randomDestination(); - spend(TICK); - } - - } - return true; - } - - @Override - public String status() { - return Messages.get(this, "status", name); - } - } - - private class Hunting implements AiState { - - public static final String TAG = "HUNTING"; - - @Override - public boolean act(boolean enemyInFOV, boolean justAlerted) { - enemySeen = enemyInFOV; - if (enemyInFOV && !isCharmedBy( enemy ) && canAttack(enemy)) { - - return doAttack(enemy); - - } else { - - if (enemyInFOV) { - target = enemy.pos; - } else if (enemy == null) { - state = WANDERING; - target = Dungeon.level.randomDestination(); - return true; - } - - int oldPos = pos; - if (target != -1 && getCloser(target)) { - - spend(1 / speed()); - return moveSprite(oldPos, pos); - - } else { - - spend(TICK); - if (!enemyInFOV) { - sprite.showLost(); - state = WANDERING; - target = Dungeon.level.randomDestination(); - } - return true; - } - } - } - - @Override - public String status() { - return Messages.get(this, "status", name); - } - } - - protected class Fleeing implements AiState { - - public static final String TAG = "FLEEING"; - - @Override - public boolean act(boolean enemyInFOV, boolean justAlerted) { - enemySeen = enemyInFOV; - if (enemyInFOV) { - target = enemy.pos; - } - - int oldPos = pos; - if (target != -1 && getFurther(target)) { - - spend(1 / speed()); - return moveSprite(oldPos, pos); - - } else { - - spend(TICK); - nowhereToRun(); - - return true; - } - } - - protected void nowhereToRun() { - } - - @Override - public String status() { - return Messages.get(this, "status", name); - } - } - - private class Passive implements AiState { - - public static final String TAG = "PASSIVE"; - - @Override - public boolean act(boolean enemyInFOV, boolean justAlerted) { - enemySeen = false; - spend(TICK); - return true; - } - - @Override - public String status() { - return Messages.get(this, "status", name); - } - } - - -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/Monk.java b/java/com/hmdzl/spspd/change/actors/mobs/Monk.java deleted file mode 100644 index 86336f66..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/Monk.java +++ /dev/null @@ -1,119 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs; - -import java.util.HashSet; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Amok; -import com.hmdzl.spspd.change.actors.buffs.Terror; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.mobs.npcs.Imp; -import com.hmdzl.spspd.change.items.KindOfWeapon; -import com.hmdzl.spspd.change.items.food.Food; -import com.hmdzl.spspd.change.items.food.staplefood.NormalRation; -import com.hmdzl.spspd.change.items.food.staplefood.OverpricedRation; -import com.hmdzl.spspd.change.items.food.staplefood.Pasty; -import com.hmdzl.spspd.change.items.weapon.melee.FightGloves; -import com.hmdzl.spspd.change.items.weapon.melee.Knuckles; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.MonkSprite; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.utils.Random; - -public class Monk extends Mob { - - public static final String TXT_DISARM = "%s has knocked the %s from your hands!"; - - { - spriteClass = MonkSprite.class; - - HP = HT = 160+(adj(0)*Random.NormalIntRange(3, 5)); - evadeSkill = 30+adj(1); - - EXP = 14; - maxLvl = 30; - - loot = new NormalRation(); - lootChance = 0.1f; - - lootOther = new OverpricedRation(); - lootChanceOther = 0.4f; // by default, see die() - - properties.add(Property.DWARF); - } - - @Override - public int damageRoll() { - return Random.NormalIntRange(22, 36+adj(0)); - } - - @Override - public int hitSkill(Char target) { - return 30+adj(01); - } - - @Override - protected float attackDelay() { - return 0.5f; - } - - @Override - public int drRoll() { - return Random.NormalIntRange(2, 12); - } - - @Override - public void die(Object cause) { - Imp.Quest.process(this); - - super.die(cause); - } - - @Override - public int attackProc(Char enemy, int damage) { - - if (Random.Int(12) == 0 && enemy == Dungeon.hero) { - - Hero hero = Dungeon.hero; - KindOfWeapon weapon = hero.belongings.weapon; - - if (weapon != null && !(weapon instanceof Knuckles || weapon instanceof FightGloves) - && !weapon.cursed) { - hero.belongings.weapon = null; - Dungeon.level.drop(weapon, hero.pos).sprite.drop(); - GLog.w(Messages.get(this, "disarm")); - weapon.updateQuickslot(); - } - } - - return damage; - } - - private static final HashSet> IMMUNITIES = new HashSet>(); - static { - IMMUNITIES.add(Amok.class); - IMMUNITIES.add(Terror.class); - } - - @Override - public HashSet> immunities() { - return IMMUNITIES; - } -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/MonsterBox.java b/java/com/hmdzl/spspd/change/actors/mobs/MonsterBox.java deleted file mode 100644 index 6bc109c3..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/MonsterBox.java +++ /dev/null @@ -1,183 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashSet; -import java.util.List; - -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Pushing; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfPsionicBlast; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.MonsterBoxSprite; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -public class MonsterBox extends Mob { - - private int level; - - { - name = "monster box"; - spriteClass = MonsterBoxSprite.class; - - properties.add(Property.UNKNOW); - } - - public ArrayList items; - - private static final String LEVEL = "level"; - private static final String ITEMS = "items"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(ITEMS, items); - bundle.put(LEVEL, level); - } - - @SuppressWarnings("unchecked") - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - items = new ArrayList( - (Collection) ((Collection) bundle.getCollection(ITEMS))); - adjustStats(bundle.getInt(LEVEL)); - } - - @Override - public int damageRoll() { - return Random.NormalIntRange(HT / 10, HT / 4); - } - - @Override - public int hitSkill(Char target) { - return 9 + level; - } - - - public void adjustStats(int level) { - this.level = level; - - HT = (3 + level) * 4; - EXP = 2 + 2 * (level - 1) / 5; - evadeSkill = hitSkill(null) / 2; - - enemySeen = true; - } - - //@Override - //protected boolean act() { - // Char ch = Actor.findChar(pos); - // if (Random.Int(5)==0){ - // SummoningTrap.trigger(pos, ch); - // } - // return rooted; - //} - - @Override - public void die(Object cause) { - - super.die(cause); - - if (items != null) { - for (Item item : items) { - Dungeon.level.drop(item, pos).sprite.drop(); - } - } - } - - @Override - public boolean reset() { - state = WANDERING; - return true; - } - - @Override - public String description() { - return "Mimics are magical creatures which can take any shape they wish. In dungeons they almost always " - + "choose a shape of a treasure chest, because they know how to beckon an adventurer."; - } - - public static MonsterBox spawnAt(int pos, List items) { - Char ch = Actor.findChar(pos); - if (ch != null) { - ArrayList candidates = new ArrayList(); - for (int n : Level.NEIGHBOURS8) { - int cell = pos + n; - if ((Level.passable[cell] || Level.avoid[cell]) - && Actor.findChar(cell) == null) { - candidates.add(cell); - } - } - if (candidates.size() > 0) { - int newPos = Random.element(candidates); - Actor.addDelayed(new Pushing(ch, ch.pos, newPos), -1); - - ch.pos = newPos; - // FIXME - if (ch instanceof Mob) { - Dungeon.level.mobPress((Mob) ch); - } else { - Dungeon.level.press(newPos, ch); - } - } else { - return null; - } - } - - MonsterBox m = new MonsterBox(); - m.items = new ArrayList(items); - m.adjustStats(Dungeon.depth); - m.HP = m.HT; - m.pos = pos; - m.state = m.HUNTING; - GameScene.add(m, 1); - - m.sprite.turnTo(pos, Dungeon.hero.pos); - //Buff.affect(m, Roots.class, 1000); - - if (Dungeon.visible[m.pos]) { - CellEmitter.get(pos).burst(Speck.factory(Speck.STAR), 10); - Sample.INSTANCE.play(Assets.SND_MIMIC); - } - - return m; - } - - private static final HashSet> IMMUNITIES = new HashSet>(); - static { - IMMUNITIES.add(ScrollOfPsionicBlast.class); - } - - @Override - public HashSet> immunities() { - return IMMUNITIES; - } -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/MossySkeleton.java b/java/com/hmdzl/spspd/change/actors/mobs/MossySkeleton.java deleted file mode 100644 index 59aa2694..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/MossySkeleton.java +++ /dev/null @@ -1,136 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs; - -import java.util.HashSet; - -import com.hmdzl.spspd.change.items.challengelists.PrisonChallenge; -import com.hmdzl.spspd.change.items.food.completefood.GoldenNut; -import com.hmdzl.spspd.change.items.reward.PrisonReward; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfSacrifice; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.Statistics; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.items.Bone; -import com.hmdzl.spspd.change.items.RedDewdrop; -import com.hmdzl.spspd.change.items.YellowDewdrop; -import com.hmdzl.spspd.change.items.weapon.enchantments.EnchantmentDark; -import com.hmdzl.spspd.change.sprites.MossySkeletonSprite; -import com.hmdzl.spspd.change.utils.GLog; - -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Random; - -public class MossySkeleton extends Mob { - - private static final String TXT_KILLCOUNT = "Mossy Skeleton Kill Count: %s"; - - { - spriteClass = MossySkeletonSprite.class; - - HP = HT = 90+(10*Random.NormalIntRange(7, 10)); - evadeSkill = 20; - - EXP = 1; - - baseSpeed = 0.5f+(Math.min(1f, Statistics.skeletonsKilled/50)); - - loot = new YellowDewdrop(); - lootChance = 0.5f; // by default, see die() - - lootOther= new RedDewdrop(); - lootChanceOther = 0.1f; // by default, see die() - - properties.add(Property.UNDEAD); - } - - @Override - public int damageRoll() { - return Random.NormalIntRange(20+Math.round(Statistics.skeletonsKilled/10), 45+Math.round(Statistics.skeletonsKilled/5)); - - } - - @Override - protected float attackDelay() { - return 2f-(Math.min(1.5f, Statistics.skeletonsKilled/50)); - } - - @Override - public void die(Object cause) { - - super.die(cause); - - Statistics.skeletonsKilled++; - GLog.w(Messages.get(Mob.class,"killcount", Statistics.skeletonsKilled)); - - if (!Dungeon.limitedDrops.prisonkey.dropped() && Dungeon.depth<27) { - Dungeon.limitedDrops.prisonkey.drop(); - Dungeon.level.drop(new PrisonChallenge(), pos).sprite.drop(); - explodeDew(pos); - } else { - explodeDew(pos); - } - - if(Statistics.skeletonsKilled == 25) { - Dungeon.limitedDrops.bone.drop(); - Dungeon.level.drop(new Bone(), pos).sprite.drop(); - } - - if(Statistics.skeletonsKilled == 50) { - Dungeon.level.drop(new ScrollOfSacrifice(), pos).sprite.drop(); - } - - if(Statistics.skeletonsKilled == 100) { - Dungeon.level.drop(new PrisonReward(), pos).sprite.drop(); - } - - if (Statistics.goldThievesKilled>99 && Statistics.skeletonsKilled == 100 - && Statistics.albinoPiranhasKilled>99 && Statistics.archersKilled>99){ - Dungeon.level.drop(new GoldenNut(), pos).sprite.drop(); - } - - if (Dungeon.visible[pos]) { - Sample.INSTANCE.play(Assets.SND_BONES); - } - } - - - - - @Override - public int hitSkill(Char target) { - return 28; - } - - @Override - public int drRoll() { - return 10+Statistics.skeletonsKilled/5; - } - - private static final HashSet> IMMUNITIES = new HashSet>(); - static { - IMMUNITIES.add(EnchantmentDark.class); - } - - @Override - public HashSet> immunities() { - return IMMUNITIES; - } -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/Musketeer.java b/java/com/hmdzl/spspd/change/actors/mobs/Musketeer.java deleted file mode 100644 index c70fec69..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/Musketeer.java +++ /dev/null @@ -1,149 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs; - -import java.util.HashSet; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Amok; -import com.hmdzl.spspd.change.actors.buffs.ArmorBreak; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Terror; -import com.hmdzl.spspd.change.effects.particles.EnergyParticle; -import com.hmdzl.spspd.change.items.StoneOre; -import com.hmdzl.spspd.change.items.bombs.Bomb; -import com.hmdzl.spspd.change.items.bombs.DungeonBomb; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.mechanics.Ballistica; -import com.hmdzl.spspd.change.sprites.MusketeerSprite; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -public class Musketeer extends Mob { - - - private boolean charged = false; - - private static final String CHARGED = "charged"; - - { - spriteClass = MusketeerSprite.class; - - HP = HT = 160+(adj(0)*Random.NormalIntRange(3, 5)); - evadeSkill = 30+adj(1); - - EXP = 12; - maxLvl = 30; - - loot = new StoneOre(); - lootChance = 0.2f; - - lootOther = new DungeonBomb(); - lootChanceOther = 0.1f; // by default, see die() - - properties.add(Property.DWARF); - } - - @Override - public boolean act() { - - if( !enemySeen ) - charged = false; - - return super.act(); - - } - - @Override - protected boolean doAttack( Char enemy ) { - //Ballistica dis = new Ballistica(pos, enemy.pos, Ballistica.PROJECTILE); - int dist = Level.distance(pos, enemy.pos); - if (dist == 1){ - return super.doAttack( enemy ); - } else if( enemySeen && state != SLEEPING && paralysed == 0 && !charged ) { - - charged = true; - - if( Dungeon.visible[ pos ] ) { - sprite.centerEmitter().burst(EnergyParticle.FACTORY, 15); - } - - spend( attackDelay() ); - - return true; - - } else { - - charged = false; - - return super.doAttack( enemy ); - } - } - - @Override - protected boolean canAttack( Char enemy ) { - return new Ballistica( pos, enemy.pos, Ballistica.MAGIC_BOLT).collisionPos == enemy.pos; - } - - @Override - public int damageRoll() { - return Random.NormalIntRange(35, 60+adj(0)); - } - - @Override - public int hitSkill(Char target) { - return 35+adj(01); - } - - @Override - public int drRoll() { - return Random.NormalIntRange(5, 10); - } - - @Override - public int attackProc(Char enemy, int damage) { - int dist = Level.distance(pos, enemy.pos); - if (dist > 1 && Random.Int(4)< 1 ){ - Buff.affect(enemy, ArmorBreak.class,5f).level(25); - } - return damage; - } - private static final HashSet> IMMUNITIES = new HashSet>(); - static { - IMMUNITIES.add(Amok.class); - IMMUNITIES.add(Terror.class); - } - - @Override - public HashSet> immunities() { - return IMMUNITIES; - } - - @Override - public void storeInBundle( Bundle bundle ) { - super.storeInBundle(bundle); - bundle.put( CHARGED, charged ); - } - - @Override - public void restoreFromBundle( Bundle bundle ) { - super.restoreFromBundle(bundle); - charged = bundle.getBoolean( CHARGED ); - } -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/NormalCell.java b/java/com/hmdzl/spspd/change/actors/mobs/NormalCell.java deleted file mode 100644 index 88e0a130..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/NormalCell.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.items.food.meatfood.MysteryMeat; -import com.hmdzl.spspd.change.sprites.CellmobSprite; -import com.hmdzl.spspd.change.sprites.CrabSprite; -import com.hmdzl.spspd.change.sprites.ErrorSprite; -import com.watabou.utils.Random; - -public class NormalCell extends Mob { - - { - spriteClass = CellmobSprite.class; - - HP = HT = 1; - evadeSkill = 0; - baseSpeed = 0.5f; - - properties.add(Property.BOSS); - properties.add(Property.MINIBOSS); - } - - @Override - public int damageRoll() { - return Random.NormalIntRange(Dungeon.hero.HT/20, Dungeon.hero.HT/10); - } - - @Override - public int hitSkill(Char target) { - return 99; - } - -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/OrbOfZotMob.java b/java/com/hmdzl/spspd/change/actors/mobs/OrbOfZotMob.java deleted file mode 100644 index f34056ef..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/OrbOfZotMob.java +++ /dev/null @@ -1,221 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs; - -import java.util.HashSet; - -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.ResultDescriptions; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.ToxicGas; -import com.hmdzl.spspd.change.actors.buffs.Terror; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.particles.PurpleParticle; -import com.hmdzl.spspd.change.items.OrbOfZot; -import com.hmdzl.spspd.change.items.weapon.enchantments.EnchantmentDark; - -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.mechanics.Ballistica; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.hmdzl.spspd.change.sprites.OrbOfZotSprite; -import com.hmdzl.spspd.change.utils.GLog; - -import com.watabou.utils.Random; - -public class OrbOfZotMob extends Mob { - - private static final String TXT_DEATHGAZE_KILLED = "%s's deathray killed you..."; - - { - spriteClass = OrbOfZotSprite.class; - hostile = false; - state = HUNTING; - HP = HT= 500; - evadeSkill = 35; - - properties.add(Property.MECH); - } - - private Ballistica beam; - - private static final float SPAWN_DELAY = 1f; - - - @Override - public int drRoll() { - return 0; - } - - - @Override - protected boolean act() { - - for (int n : Level.NEIGHBOURS8DIST2) { - int c = pos + n; - if (c0){ - Char ch = Actor.findChar(c); - } - } - //Level.fieldOfView[Dungeon.hero.pos] && - - boolean result = super.act(); - return result; - } - - @Override - public void move(int step) { - } - - @Override - protected Char chooseEnemy() { - - if (enemy == null || !enemy.isAlive()) { - HashSet enemies = new HashSet(); - for (Mob mob : Dungeon.level.mobs) { - if (mob.hostile && Level.fieldOfView[mob.pos]) { - enemies.add(mob); - } - } - - enemy = enemies.size() > 0 ? Random.element(enemies) : null; - } - - return enemy; - } - - - - public static OrbOfZotMob spawnAt(int pos) { - - OrbOfZotMob b = new OrbOfZotMob(); - - b.pos = pos; - b.state = b.HUNTING; - GameScene.add(b, SPAWN_DELAY); - - return b; - - } - - private int hitCell; - - @Override - protected boolean canAttack(Char enemy) { - - beam = new Ballistica( pos, enemy.pos, Ballistica.STOP_TERRAIN); - - return beam.subPath(1, beam.dist).contains(enemy.pos); - } - - @Override - public int hitSkill(Char target) { - return 70+(Dungeon.depth); - } - - @Override - protected boolean doAttack(Char enemy) { - - spend(attackDelay()); - - boolean rayVisible = false; - - for (int i : beam.subPath(0, beam.dist)) { - if (Dungeon.visible[i]) { - rayVisible = true; - } - } - - if (rayVisible) { - sprite.attack( beam.collisionPos ); - return false; - } else { - attack(enemy); - return true; - } - } - - @Override - public boolean attack(Char enemy) { - - for (int pos : beam.subPath(1, beam.dist)) { - - Char ch = Actor.findChar( pos ); - if (ch == null) { - continue; - } - - if (hit(this, ch, true)) { - ch.damage(Random.NormalIntRange(100, 200), this); - damage(Random.NormalIntRange(10, 20), this); - - - if (Dungeon.visible[pos]) { - ch.sprite.flash(); - CellEmitter.center(pos).burst(PurpleParticle.BURST, - Random.IntRange(1, 2)); - } - - if (!ch.isAlive() && ch == Dungeon.hero) { - Dungeon.fail(Messages.format(ResultDescriptions.MOB)); - //GLog.n(Messages.get(this, "kill")); - } - } else { - ch.sprite.showStatus(CharSprite.NEUTRAL, ch.defenseVerb()); - } - } - - return true; - } - - @Override - public void beckon(int cell) { - } - - @Override - public void die(Object cause) { - - yell(Messages.get(this, "die")); - Dungeon.level.drop(new OrbOfZot(), pos); - super.die(cause); - } - - private static final HashSet> RESISTANCES = new HashSet>(); - static { - RESISTANCES.add(EnchantmentDark.class); - - } - - @Override - public HashSet> resistances() { - return RESISTANCES; - } - - private static final HashSet> IMMUNITIES = new HashSet>(); - static { - IMMUNITIES.add(Terror.class); - IMMUNITIES.add(ToxicGas.class); - } - - @Override - public HashSet> immunities() { - return IMMUNITIES; - } -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/Orc.java b/java/com/hmdzl/spspd/change/actors/mobs/Orc.java deleted file mode 100644 index 28808fcf..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/Orc.java +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs; - -import java.util.HashSet; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.Blob; -import com.hmdzl.spspd.change.actors.blobs.CorruptGas; -import com.hmdzl.spspd.change.actors.buffs.Amok; -import com.hmdzl.spspd.change.actors.buffs.Terror; -import com.hmdzl.spspd.change.actors.buffs.Vertigo; -import com.hmdzl.spspd.change.sprites.OrcSprite; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.watabou.utils.Random; - -public class Orc extends Mob { - - { - spriteClass = OrcSprite.class; - state = SLEEPING; - - HP = HT = 200+(Dungeon.depth*10); - evadeSkill = 18+(Math.round((Dungeon.depth)/2)); - - EXP = 22; - maxLvl = 40; - - properties.add(Property.ORC); - } - - @Override - public int damageRoll() { - return Random.NormalIntRange(50, 90); - } - - @Override - public int hitSkill(Char target) { - return 35; - } - - @Override - protected float attackDelay() { - return 1.5f; - } - - @Override - public int drRoll() { - return Random.NormalIntRange(16, 32); - } - - @Override - public void damage(int dmg, Object src) { - if (dmg > HT/8){ - GameScene.add(Blob.seed(pos, 30, CorruptGas.class)); - } - super.damage(dmg, src); - } - - private static final HashSet> RESISTANCES = new HashSet>(); - static { - } - - @Override - public HashSet> resistances() { - return RESISTANCES; - } - - private static final HashSet> IMMUNITIES = new HashSet>(); - static { - IMMUNITIES.add(Amok.class); - IMMUNITIES.add(Terror.class); - IMMUNITIES.add(CorruptGas.class); - IMMUNITIES.add(Vertigo.class); - } - - @Override - public HashSet> immunities() { - return IMMUNITIES; - } -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/Otiluke.java b/java/com/hmdzl/spspd/change/actors/mobs/Otiluke.java deleted file mode 100644 index 72920c7a..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/Otiluke.java +++ /dev/null @@ -1,210 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs; - -import java.util.HashSet; - -import com.hmdzl.spspd.change.actors.buffs.Silent; -import com.hmdzl.spspd.change.items.food.completefood.Crystalnucleus; -import com.hmdzl.spspd.change.items.misc.SkillOfMig; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.ResultDescriptions; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.ToxicGas; -import com.hmdzl.spspd.change.actors.buffs.Amok; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Burning; -import com.hmdzl.spspd.change.actors.buffs.Charm; -import com.hmdzl.spspd.change.actors.buffs.Poison; -import com.hmdzl.spspd.change.actors.buffs.Sleep; -import com.hmdzl.spspd.change.actors.buffs.Terror; -import com.hmdzl.spspd.change.actors.buffs.Vertigo; -import com.hmdzl.spspd.change.actors.buffs.Weakness; -import com.hmdzl.spspd.change.actors.buffs.Paralysis; -import com.hmdzl.spspd.change.items.eggs.ShadowDragonEgg; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfPsionicBlast; -import com.hmdzl.spspd.change.items.weapon.enchantments.EnchantmentDark; - -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.mechanics.Ballistica; -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.hmdzl.spspd.change.sprites.OtilukeSprite; - -import com.watabou.utils.Callback; -import com.watabou.utils.Random; - -public class Otiluke extends Mob implements Callback { - - private static final float TIME_TO_ZAP = 1f; - - private static final String TXT_SHADOWBOLT_KILLED = "%s's shadow bolt killed you..."; - - { - spriteClass = OtilukeSprite.class; - - HP = HT = 10000; - evadeSkill = 40; - - state=PASSIVE; - - EXP = 101; - - loot = new SkillOfMig(); - lootChance = 1f; - - properties.add(Property.ELEMENT); - properties.add(Property.BOSS); - - } - - @Override - public int damageRoll() { - return Random.NormalIntRange(150, 150+adj(0)); - } - - @Override - public int hitSkill(Char target) { - return 150+adj(0); - } - - @Override - public int drRoll() { - return Random.NormalIntRange(20, 40); - } - - @Override - public void damage(int dmg, Object src) { - - if (state == PASSIVE) { - state = HUNTING; - } - - if(state==HUNTING){ - - for (Mob mob : Dungeon.level.mobs) { - if (mob != null && mob instanceof MineSentinel && Random.Int(20)<2) { - if (mob.state==PASSIVE){ - mob.damage(1, this); - mob.state = HUNTING; - } - break; - } - } - } - - super.damage(dmg, src); - } - - - - - @Override - protected boolean canAttack(Char enemy) { if (buff(Silent.class) != null){ - return Level.adjacent(pos, enemy.pos) && (!isCharmedBy(enemy)); - } else - return new Ballistica( pos, enemy.pos, Ballistica.MAGIC_BOLT).collisionPos == enemy.pos; - } - - @Override - protected boolean doAttack(Char enemy) { - - if (Level.adjacent(pos, enemy.pos)) { - - return super.doAttack(enemy); - - } else { - - boolean visible = Level.fieldOfView[pos] - || Level.fieldOfView[enemy.pos]; - if (visible) { - ((OtilukeSprite) sprite).zap(enemy.pos); - } else { - zap(); - } - - return !visible; - } - } - - private void zap() { - spend(TIME_TO_ZAP); - - if (hit(this, enemy, true)) { - if (enemy == Dungeon.hero && Random.Int(2) == 0) { - Buff.prolong(enemy, Weakness.class, Weakness.duration(enemy)); - } - - int dmg = Random.Int(100, 160+adj(0)); - enemy.damage(dmg, this); - - if (!enemy.isAlive() && enemy == Dungeon.hero) { - Dungeon.fail(Messages.format(ResultDescriptions.MOB)); - //GLog.n(Messages.get(this, "kill")); - } - } else { - enemy.sprite.showStatus(CharSprite.NEUTRAL, enemy.defenseVerb()); - } - } - - public void onZapComplete() { - zap(); - next(); - } - - @Override - public void call() { - next(); - } - - - @Override - public void die(Object cause) { - super.die(cause); - Dungeon.level.locked=false; - - } - - private static final HashSet> RESISTANCES = new HashSet>(); - private static final HashSet> IMMUNITIES = new HashSet>(); - static { - RESISTANCES.add(ToxicGas.class); - RESISTANCES.add(Poison.class); - RESISTANCES.add(EnchantmentDark.class); - - IMMUNITIES.add(EnchantmentDark.class); - IMMUNITIES.add(Terror.class); - IMMUNITIES.add(Amok.class); - IMMUNITIES.add(Charm.class); - IMMUNITIES.add(Sleep.class); - IMMUNITIES.add(Burning.class); - IMMUNITIES.add(ToxicGas.class); - IMMUNITIES.add(ScrollOfPsionicBlast.class); - IMMUNITIES.add(Vertigo.class); - IMMUNITIES.add(Paralysis.class); - } - - @Override - public HashSet> resistances() { - return RESISTANCES; - } - - @Override - public HashSet> immunities() { - return IMMUNITIES; - }} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/PatrolUAV.java b/java/com/hmdzl/spspd/change/actors/mobs/PatrolUAV.java deleted file mode 100644 index 431f27a1..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/PatrolUAV.java +++ /dev/null @@ -1,111 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.Blob; -import com.hmdzl.spspd.change.actors.blobs.ElectriShock; -import com.hmdzl.spspd.change.actors.buffs.Amok; -import com.hmdzl.spspd.change.actors.buffs.Burning; -import com.hmdzl.spspd.change.actors.buffs.Sleep; -import com.hmdzl.spspd.change.actors.buffs.Terror; -import com.hmdzl.spspd.change.actors.buffs.Vertigo; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.particles.EnergyParticle; -import com.hmdzl.spspd.change.items.StoneOre; -import com.hmdzl.spspd.change.items.food.meatfood.Meat; -import com.hmdzl.spspd.change.items.wands.WandOfLightning; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.MrDestructoSprite; -import com.hmdzl.spspd.change.sprites.PatrolUAVSprite; -import com.watabou.utils.Random; - -import java.util.HashSet; - -public class PatrolUAV extends Mob { - - - { - spriteClass = PatrolUAVSprite.class; - - HP = HT = 50+(Dungeon.depth*Random.NormalIntRange(1, 3)); - evadeSkill = adj(1); - - EXP = 5; - maxLvl = 10; - - state = WANDERING; - - flying = true; - - loot = new StoneOre(); - lootChance = 0.4f; - - properties.add(Property.MECH); - } - - - - @Override - public int damageRoll() { - return Random.NormalIntRange(4, 7); - } - - @Override - public int hitSkill(Char target) { - return 5; - } - - @Override - public int drRoll() { - return Random.NormalIntRange(5, 10); - } - - @Override - public void die(Object cause) { - - super.die(cause); - for (int i : Level.NEIGHBOURS9) { - if (Level.insideMap(pos+i) && !Level.solid[pos+i]) { - GameScene.add(Blob.seed(pos + i, 3, ElectriShock.class)); - CellEmitter.get(pos + i).burst(EnergyParticle.FACTORY, 5); - } - } - - } - - - private static final HashSet> IMMUNITIES = new HashSet>(); - static { - IMMUNITIES.add(Amok.class); - IMMUNITIES.add(Sleep.class); - IMMUNITIES.add(Terror.class); - IMMUNITIES.add(Burning.class); - IMMUNITIES.add(Vertigo.class); - IMMUNITIES.add(ElectriShock.class); - IMMUNITIES.add(WandOfLightning.class); - } - @Override - public HashSet> immunities() { - return IMMUNITIES; - } - -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/Piranha.java b/java/com/hmdzl/spspd/change/actors/mobs/Piranha.java deleted file mode 100644 index 3363a5d5..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/Piranha.java +++ /dev/null @@ -1,164 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs; - -import java.util.HashSet; - -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.Statistics; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.ToxicGas; -import com.hmdzl.spspd.change.actors.buffs.Burning; -import com.hmdzl.spspd.change.actors.buffs.Corruption; -import com.hmdzl.spspd.change.actors.buffs.Frost; -import com.hmdzl.spspd.change.actors.buffs.Paralysis; -import com.hmdzl.spspd.change.actors.buffs.Roots; -import com.hmdzl.spspd.change.items.challengelists.CaveChallenge; -import com.hmdzl.spspd.change.items.food.meatfood.Meat; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.sprites.PiranhaSprite; -import com.watabou.utils.Random; - -public class Piranha extends Mob { - - { - spriteClass = PiranhaSprite.class; - - baseSpeed = 1.5f; - - EXP = 5; - - loot = new Meat(); - lootChance = 1f; - - properties.add(Property.BEAST); - } - - public Piranha() { - super(); - - HP = HT = 40 + Dungeon.depth * 5; - evadeSkill = 10 + Dungeon.depth * 2; - } - - @Override - protected boolean act() { - if (!Level.water[pos]) { - die(null); - return true; - } else { - // this causes pirahna to move away when a door is closed on them. - Dungeon.level.updateFieldOfView(this); - enemy = chooseEnemy(); - if (state == this.HUNTING - && !(enemy.isAlive() && Level.fieldOfView[enemy.pos] && enemy.invisible <= 0)) { - state = this.WANDERING; - int oldPos = pos; - int i = 0; - do { - i++; - target = Dungeon.level.randomDestination(); - if (i == 100) - return true; - } while (!getCloser(target)); - moveSprite(oldPos, pos); - return true; - } - - return super.act(); - } - } - - @Override - public int damageRoll() { - return Random.NormalIntRange(Dungeon.depth, 4 + Dungeon.depth * 2); - } - - @Override - public int hitSkill(Char target) { - return 20 + Dungeon.depth * 2; - } - - @Override - public int drRoll() { - return Random.NormalIntRange(0, Dungeon.depth); - } - - @Override - public void die(Object cause) { - super.die(cause); - - if (!Dungeon.limitedDrops.caveskey.dropped() && Statistics.deepestFloor > 10) { - Dungeon.limitedDrops.caveskey.drop(); - Dungeon.level.drop(new CaveChallenge(), pos).sprite.drop(); - } - - Statistics.piranhasKilled++; - Badges.validatePiranhasKilled(); - } - - @Override - public boolean reset() { - return true; - } - - @Override - protected boolean getCloser(int target) { - - if (rooted) { - return false; - } - - int step = Dungeon.findPath(this, pos, target, Level.water, - Level.fieldOfView); - if (step != -1) { - move(step); - return true; - } else { - return false; - } - } - - @Override - protected boolean getFurther(int target) { - int step = Dungeon.flee(this, pos, target, Level.water, - Level.fieldOfView); - if (step != -1) { - move(step); - return true; - } else { - return false; - } - } - - private static final HashSet> IMMUNITIES = new HashSet>(); - static { - IMMUNITIES.add(Burning.class); - IMMUNITIES.add(Paralysis.class); - IMMUNITIES.add(ToxicGas.class); - IMMUNITIES.add(Roots.class); - IMMUNITIES.add(Frost.class); - IMMUNITIES.add(Corruption.class); - } - - @Override - public HashSet> immunities() { - return IMMUNITIES; - } -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/PlagueDoctor.java b/java/com/hmdzl/spspd/change/actors/mobs/PlagueDoctor.java deleted file mode 100644 index 9556e887..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/PlagueDoctor.java +++ /dev/null @@ -1,474 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * Shattered Pixel Dungeon - * Copyright (C) 2014-2015 Evan Debenham - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs; - - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.Badges.Badge; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.ResultDescriptions; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.Blob; -import com.hmdzl.spspd.change.actors.blobs.ConfusionGas; -import com.hmdzl.spspd.change.actors.blobs.DarkGas; -import com.hmdzl.spspd.change.actors.blobs.GooWarn; -import com.hmdzl.spspd.change.actors.blobs.ParalyticGas; -import com.hmdzl.spspd.change.actors.blobs.ToxicGas; -import com.hmdzl.spspd.change.actors.buffs.AttackDown; -import com.hmdzl.spspd.change.actors.buffs.AttackUp; -import com.hmdzl.spspd.change.actors.buffs.Bleeding; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Burning; -import com.hmdzl.spspd.change.actors.buffs.Cripple; -import com.hmdzl.spspd.change.actors.buffs.DefenceUp; -import com.hmdzl.spspd.change.actors.buffs.Ooze; -import com.hmdzl.spspd.change.actors.buffs.Poison; -import com.hmdzl.spspd.change.actors.buffs.Speed; -import com.hmdzl.spspd.change.actors.buffs.Terror; -import com.hmdzl.spspd.change.actors.buffs.Vertigo; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.effects.particles.ElmoParticle; -import com.hmdzl.spspd.change.effects.particles.PurpleParticle; -import com.hmdzl.spspd.change.effects.particles.ShadowParticle; -import com.hmdzl.spspd.change.items.Generator; -import com.hmdzl.spspd.change.items.StoneOre; -import com.hmdzl.spspd.change.items.artifacts.AlchemistsToolkit; -import com.hmdzl.spspd.change.items.eggs.EasterEgg; -import com.hmdzl.spspd.change.items.eggs.Egg; -import com.hmdzl.spspd.change.items.journalpages.Sokoban1; -import com.hmdzl.spspd.change.items.keys.SkeletonKey; -import com.hmdzl.spspd.change.items.potions.PotionOfMight; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfUpgrade; -import com.hmdzl.spspd.change.items.wands.WandOfLight; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.SewerBossLevel; -import com.hmdzl.spspd.change.mechanics.Ballistica; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.hmdzl.spspd.change.sprites.GooSprite; -import com.hmdzl.spspd.change.sprites.PlagueDoctorSprite; -import com.hmdzl.spspd.change.sprites.SewerHeartSprite; -import com.hmdzl.spspd.change.sprites.ShadowRatSprite; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.Camera; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -import java.util.HashSet; - -import static com.hmdzl.spspd.change.Dungeon.hero; - -public class PlagueDoctor extends Mob { - - { - spriteClass = PlagueDoctorSprite.class; - - HP = HT = 500; - evadeSkill = 5; - baseSpeed = 0.75f; - - EXP = 30; - - loot = new AlchemistsToolkit(); - lootChance = 0.2f; - - lootOther = Generator.Category.POTION; - lootChanceOther = 1f; - - FLEEING = new Fleeing(); - - properties.add(Property.HUMAN); - properties.add(Property.BOSS); - } - - private int breaks=0; - - @Override - public void notice() { - super.notice(); - yell(Messages.get(this, "notice")); - ((SewerBossLevel) Dungeon.level).seal(); - if (!spawnedshadow) { - Buff.affect(hero, ShadowRatSummon.class); - spawnedshadow = true; - } - //state = PASSIVE; - } - - - @Override - public boolean act() { - - if (3 - breaks > 4 * HP / HT) { - breaks++; - if (breaks > 1){ - GLog.i(Messages.get(this, "crazy")); - yell(Messages.get(this, "yell2")); - } - return true; - } - - if (breaks == 1){ - state = FLEEING; - GameScene.add(Blob.seed(pos, 20, ToxicGas.class)); - } - - if (breaks == 2){ - state = HUNTING; - } - - return super.act(); - } - - @Override - public int attackProc(Char enemy, int damage) { - - if (breaks == 0){ - if (Random.Int(2) == 0) { - switch (Random.Int (4)) { - case 0: - enemy.HP += (int)((enemy.HT)/10); - enemy.sprite.emitter().start(Speck.factory(Speck.HEALING), 0.4f,1); - break; - case 1: - Buff.affect(enemy, AttackUp.class, 5f).level(20); - break; - case 2: - Buff.affect(enemy, DefenceUp.class, 5f).level(20); - break; - case 3: - Buff.affect(enemy, Speed.class, 5f); - break; - default: - break; - } - } - damage = 0 ; - if (Random.Int(3) == 0) { - yell(Messages.get(this, "yell")); - } - } - - - if (breaks == 2){ - if (Random.Int(2) == 0) { - Buff.affect(enemy, Bleeding.class).set(5); - } - } - - if (breaks == 3){ - Buff.affect(this,AttackUp.class,5f).level(50); - Buff.affect(this,DefenceUp.class,5f).level(25); - } - - return damage; - } - - @Override - public int defenseProc(Char enemy, int damage) { - if (breaks == 1 && Random.Int(2) == 0){ - switch (Random.Int (4)) { - case 0: - GameScene.add(Blob.seed(pos, 25, ToxicGas.class)); - break; - case 1: - GameScene.add(Blob.seed(pos, 25, ConfusionGas.class)); - break; - case 2: - GameScene.add(Blob.seed(pos, 25, ParalyticGas.class)); - break; - case 3: - GameScene.add(Blob.seed(pos, 25, DarkGas.class)); - break; - default: - break; - } - } - return super.defenseProc(enemy, damage); - } - - @Override - public void damage(int dmg, Object src) { - super.damage(dmg, src); - } - - @Override - public void destroy() { - super.destroy(); - for (Mob mob : Dungeon.level.mobs.toArray(new Mob[Dungeon.level.mobs.size()])) { - if (mob instanceof ShadowRat) { - mob.die(null); - } - } - } - - @Override - protected boolean canAttack(Char enemy) { - return super.canAttack(enemy); - } - - @Override - public void die(Object cause) { - super.die(cause); - ((SewerBossLevel) Dungeon.level).unseal(); - - GameScene.bossSlain(); - Dungeon.level.drop(new SkeletonKey(Dungeon.depth), pos).sprite.drop(); - Badges.validateBossSlain(); - - Buff.detach(hero, ShadowRatSummon.class); - - Badges.Badge badgeToCheck = null; - switch (hero.heroClass) { - case WARRIOR: - badgeToCheck = Badge.MASTERY_WARRIOR; - break; - case MAGE: - badgeToCheck = Badge.MASTERY_MAGE; - break; - case ROGUE: - badgeToCheck = Badge.MASTERY_ROGUE; - break; - case HUNTRESS: - badgeToCheck = Badge.MASTERY_HUNTRESS; - break; - case PERFORMER: - badgeToCheck = Badge.MASTERY_PERFORMER; - break; - case SOLDIER: - badgeToCheck = Badge.MASTERY_SOLDIER; - break; - case FOLLOWER: - badgeToCheck = Badge.MASTERY_FOLLOWER; - break; - } - Dungeon.level.drop(new Sokoban1(), pos).sprite.drop(); - } - - @Override - public int damageRoll() { - int min = 6; - int max = 19; - return Random.NormalIntRange(min, max); - - } - - @Override - public int hitSkill(Char target) { - return 30; - } - - @Override - public int drRoll() { - return Random.NormalIntRange(0, 5); - } - - private static final HashSet> IMMUNITIES = new HashSet<>(); - static { - IMMUNITIES.add(ToxicGas.class ); - IMMUNITIES.add(ParalyticGas.class); - IMMUNITIES.add(DarkGas.class); - IMMUNITIES.add(ConfusionGas.class); - } - - @Override - public HashSet> immunities() { - return IMMUNITIES; - } - - private static final String BREAKS = "breaks"; - - @Override - public void storeInBundle( Bundle bundle ) { - super.storeInBundle(bundle); - bundle.put( BREAKS, breaks ); - } - - @Override - public void restoreFromBundle( Bundle bundle ) { - super.restoreFromBundle(bundle); - breaks = bundle.getInt( BREAKS ); - } - - protected boolean spawnedshadow = false; - - public static class ShadowRatSummon extends Buff { - - int spawnPower = 0; - - @Override - public boolean act() { - spawnPower++; - int srat = 1; //we include the wraith we're trying to spawn - for (Mob mob : Dungeon.level.mobs) { - if (mob instanceof ShadowRat) { - srat++; - } - } - - int powerNeeded = Math.min(10, srat); - - if (powerNeeded <= spawnPower) { - spawnPower -= powerNeeded; - int pos = 0; - do { - pos = Random.Int(Dungeon.level.randomRespawnCellMob()); - } while (!Dungeon.level.passable[pos] || Actor.findChar(pos) != null); - ShadowRat.spawnAt(pos); - Sample.INSTANCE.play(Assets.SND_BURNING); - } - - spend(TICK); - return true; - } - - public void dispel() { - detach(); - for (Mob mob : Dungeon.level.mobs.toArray(new Mob[0])) { - if (mob instanceof ShadowRat) { - mob.die(null); - } - } - } - - private static String SPAWNPOWER = "spawnpower"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(SPAWNPOWER, spawnPower); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - spawnPower = bundle.getInt(SPAWNPOWER); - } - } - - public static class ShadowRat extends Mob { - - - private static final float SPAWN_DELAY = 2f; - - { - spriteClass = ShadowRatSprite.class; - - HP = HT = 60; - evadeSkill = 3; - EXP = 1; - - loot = new StoneOre(); - lootChance = 0.2f; - - properties.add(Property.ELEMENT); - properties.add(Property.MINIBOSS); - } - - - @Override - public void damage(int dmg, Object src) { - if (src instanceof WandOfLight) { - destroy(); - sprite.die(); - } else { - - super.damage(dmg, src); - } - } - - @Override - public int attackProc( Char enemy, int damage) { - damage = super.attackProc(enemy, damage); - if (Random.Int(3) < 1) { - Buff.prolong(enemy, AttackDown.class, 10f).level(25); - } else - if (Random.Int(3) < 1) { - Buff.prolong(enemy, Vertigo.class, 5f); - } - return super.attackProc(enemy, damage); - } - - @Override - public int damageRoll() { - return Random.NormalIntRange(6, 9); - } - - @Override - public int hitSkill(Char target) { - return 25; - } - - @Override - public int drRoll() { - return 0; - } - - private static final HashSet> IMMUNITIES = new HashSet<>(); - static { - IMMUNITIES.add( ToxicGas.class ); - IMMUNITIES.add(Poison.class); - IMMUNITIES.add(Burning.class); - } - - @Override - public HashSet> immunities() { - return IMMUNITIES; - } - - public static void spawnAround(int pos) { - for (int n : Level.NEIGHBOURS8) { - int cell = pos + n; - if (Level.passable[cell] && Actor.findChar(cell) == null) { - spawnAt(cell); - } - } - } - - public static void spawnAroundChance(int pos) { - for (int n : Level.NEIGHBOURS4) { - int cell = pos + n; - if (Level.passable[cell] && Actor.findChar(cell) == null && Random.Float() < 0.75f) { - spawnAt(cell); - } - } - } - - public static ShadowRat spawnAt(int pos) { - - ShadowRat b = new ShadowRat(); - - b.pos = pos; - b.state = b.HUNTING; - GameScene.add(b, SPAWN_DELAY); - - return b; - - } - } - -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/actors/mobs/PrisonWander.java b/java/com/hmdzl/spspd/change/actors/mobs/PrisonWander.java deleted file mode 100644 index 78eff865..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/PrisonWander.java +++ /dev/null @@ -1,395 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs; - -import java.util.HashSet; - -import com.hmdzl.spspd.change.actors.buffs.Blindness; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Burning; -import com.hmdzl.spspd.change.actors.buffs.Chill; -import com.hmdzl.spspd.change.actors.buffs.Cripple; -import com.hmdzl.spspd.change.actors.buffs.GlassShield; -import com.hmdzl.spspd.change.actors.buffs.Vertigo; -import com.hmdzl.spspd.change.actors.buffs.Weakness; -import com.hmdzl.spspd.change.effects.Chains; -import com.hmdzl.spspd.change.effects.Pushing; -import com.hmdzl.spspd.change.items.ArmorKit; -import com.hmdzl.spspd.change.items.Generator; -import com.hmdzl.spspd.change.items.TenguKey; -import com.hmdzl.spspd.change.items.artifacts.EtherealChains; -import com.hmdzl.spspd.change.items.bombs.Bomb; -import com.hmdzl.spspd.change.items.bombs.DungeonBomb; -import com.hmdzl.spspd.change.items.wands.WandOfFlow; -import com.hmdzl.spspd.change.items.wands.WandOfLight; -import com.hmdzl.spspd.change.items.weapon.enchantments.EnchantmentLight; -import com.hmdzl.spspd.change.levels.PrisonBossLevel; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.ToxicGas; -import com.hmdzl.spspd.change.actors.buffs.Poison; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.TomeOfMastery; -import com.hmdzl.spspd.change.items.journalpages.Sokoban2; -import com.hmdzl.spspd.change.items.keys.SkeletonKey; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfPsionicBlast; -import com.hmdzl.spspd.change.items.weapon.enchantments.EnchantmentDark; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.mechanics.Ballistica; -import com.hmdzl.spspd.change.plants.Blindweed; -import com.hmdzl.spspd.change.plants.Firebloom; -import com.hmdzl.spspd.change.plants.Icecap; -import com.hmdzl.spspd.change.plants.Plant; -import com.hmdzl.spspd.change.plants.Sorrowmoss; -import com.hmdzl.spspd.change.plants.Stormvine; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.PrisonWanderSprite; -import com.hmdzl.spspd.change.sprites.SeekingBombSprite; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundle; -import com.watabou.utils.Callback; -import com.watabou.utils.Random; - -import static com.hmdzl.spspd.change.Dungeon.hero; - -public class PrisonWander extends Mob { - - private boolean chainsUsed = false; - - { - spriteClass = PrisonWanderSprite.class; - - HP = HT = 800; - EXP = 40; - evadeSkill = 20; - viewDistance = 7; - - properties.add(Property.HUMAN); - properties.add(Property.BOSS); - - loot = new EtherealChains(); - lootChance = 0.2f; - - lootOther = new DungeonBomb(); - lootChanceOther = 1f; - - } - - private int breaks=0; - - @Override - public int damageRoll() { - return Random.NormalIntRange(12, 21); - } - - public void spawnBomb() { - int newPos2; - do { - newPos2 = Random.Int(Level.getLength()); - } while (!Level.fieldOfView[newPos2] || !Level.passable[newPos2] - || Level.adjacent(newPos2, hero.pos) - || Actor.findChar(newPos2) != null); - SeekBombP bomb1 = new SeekBombP(); - bomb1.pos = newPos2; - GameScene.add(bomb1); - } - - @Override - protected float attackDelay() { - return 0.75f; - } - - @Override - protected boolean act() { - if( 7 - breaks > 8 * HP / HT && HP > 0) { - breaks++; - - if (breaks < 4) { - Buff.affect(this, GlassShield.class).turns(1); - spawnBomb(); - chainsUsed = false; - } - return true; - } - Dungeon.level.updateFieldOfView( this ); - if (!chainsUsed && state == HUNTING && - paralysed <= 0 && - enemy != null && - enemy.invisible == 0 && - Level.fieldOfView[enemy.pos] && - Level.distance( pos, enemy.pos ) < 5 && !Level.adjacent( pos, enemy.pos ) && - Random.Int(3) == 0 && - chain(enemy.pos) && HP > 0) { - return false; - } else if(Random.Int(10)<1 && breaks < 4 ){ - Plant.Seed seed = (Plant.Seed) Generator.random(Generator.Category.SEED2); - Dungeon.level.plant(seed, this.pos); - return true; - } else { - return super.act(); - } - } - - private boolean chain(int target){ - //if (chainsUsed || enemy.properties().contains(Property.IMMOVABLE)) - //return false; - Ballistica chain = new Ballistica(pos, target, Ballistica.PROJECTILE); - - if (chain.collisionPos != enemy.pos || Level.pit[chain.path.get(1)]) - return false; - else { - int newPos = -1; - for (int i : chain.subPath(1, chain.dist)){ - if (!Level.solid[i] && Actor.findChar(i) == null){ - newPos = i; - break; - } - } - - if (newPos == -1){ - return false; - } else { - final int newPosFinal = newPos; - yell( Messages.get(this, "scorpion") ); - sprite.parent.add(new Chains(pos, enemy.pos, new Callback() { - public void call() { - Actor.addDelayed(new Pushing(enemy, enemy.pos, newPosFinal), -1); - enemy.pos = newPosFinal; - Dungeon.level.press(newPosFinal, enemy); - Cripple.prolong(enemy, Cripple.class, 4f); - Vertigo.prolong(enemy, Vertigo.class, 8f); - if (enemy == hero) { - hero.interrupt(); - Dungeon.observe(); - } - next(); - } - })); - } - } - chainsUsed = true; - return true; - } - - @Override - public int hitSkill(Char target) { - return 35; - } - - @Override - public int drRoll() { - return Random.NormalIntRange(7, 12); - } - - - - @Override - public int attackProc(Char enemy, int damage) { - if (Random.Int(10)<2){ - int oppositeDefender = enemy.pos + (enemy.pos - pos); - Ballistica trajectory = new Ballistica(enemy.pos, oppositeDefender, Ballistica.MAGIC_BOLT); - WandOfFlow.throwChar(enemy, trajectory, 1); - } else if ((Random.Int(10)<2)) { - int newPos; - do { - newPos = Random.Int(Level.getLength()); - } while (!Level.fieldOfView[newPos] || !Level.passable[newPos] - || Level.adjacent(newPos, hero.pos) - || Actor.findChar(newPos) != null); - - Buff.affect(hero, Weakness.class,5f); - hero.sprite.move(pos, newPos); - hero.move(newPos); - - if (Dungeon.visible[newPos]) { - CellEmitter.get(newPos).burst(Speck.factory(Speck.WOOL), 6); - Sample.INSTANCE.play(Assets.SND_PUFF); - } - - spend(1f); - } - - return damage; - } - - @Override - public void notice() { - super.notice(); - yell(Messages.get(this, "notice")); - - } - - @Override - public void die(Object cause) { - - yell(Messages.get(this,"die")); - - GameScene.bossSlain(); - - Badges.validateBossSlain(); - - ((PrisonBossLevel) Dungeon.level).unseal(); - - Dungeon.level.drop(new ArmorKit(), pos).sprite.drop(); - - Dungeon.level.drop(new Sokoban2(), pos).sprite.drop(); - Dungeon.level.drop(new SkeletonKey(Dungeon.depth), pos).sprite.drop(); - Dungeon.level.drop(new TenguKey(), pos).sprite.drop(); - - super.die(cause); - } - - private final String CHAINSUSED = "chainsused"; - private static final String BREAKS = "breaks"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(CHAINSUSED, chainsUsed); - bundle.put( BREAKS, breaks ); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - chainsUsed = bundle.getBoolean(CHAINSUSED); - breaks = bundle.getInt( BREAKS ); - } - - private static final HashSet> RESISTANCES = new HashSet>(); - private static final HashSet> WEAKNESS = new HashSet>(); - private static final HashSet> IMMUNITIES = new HashSet<>(); - static { - WEAKNESS.add(WandOfLight.class); - WEAKNESS.add(EnchantmentLight.class); - - IMMUNITIES.add(Burning.class); - RESISTANCES.add(ToxicGas.class); - IMMUNITIES.add(Poison.class); - IMMUNITIES.add(Chill.class); - IMMUNITIES.add(Blindness.class); - IMMUNITIES.add(Vertigo.class); - RESISTANCES.add(EnchantmentDark.class); - - - IMMUNITIES.add(Icecap.class); - IMMUNITIES.add(Firebloom.class); - IMMUNITIES.add(Blindweed.class); - IMMUNITIES.add(Stormvine.class); - IMMUNITIES.add(Sorrowmoss.class); - } - - @Override - public HashSet> resistances() { - return RESISTANCES; - } - - @Override - public HashSet> weakness() { - return WEAKNESS; - } - - @Override - public HashSet> immunities() { - return IMMUNITIES; - } - - public static class SeekBombP extends Mob { - - private static final int BOMB_DELAY = 8; - private int timeToBomb = BOMB_DELAY; - { - spriteClass = SeekingBombSprite.class; - - HP = HT = 1; - evadeSkill = 0; - baseSpeed = 1f; - timeToBomb = BOMB_DELAY; - EXP = 0; - - state = HUNTING; - - properties.add(Property.MECH); - properties.add(Property.MINIBOSS); - } - - @Override - public int attackProc(Char enemy, int damage) { - int dmg = super.attackProc(enemy, damage); - - DungeonBomb bomb = new DungeonBomb(); - bomb.explode(pos); - yell("KA-BOOM!!!"); - - destroy(); - sprite.die(); - - return dmg; - } - - @Override - public void die(Object cause) { - DungeonBomb bomb = new DungeonBomb(); - bomb.explode(pos); - super.die(cause); - - } - - @Override - public int hitSkill(Char target) { - return 10; - } - - @Override - public int damageRoll() { - return Random.NormalIntRange(0, 1); - } - - @Override - public int drRoll() { - return 0; - } - - @Override - public boolean act() { - yell(""+timeToBomb+"!"); - if (timeToBomb == 0){ - DungeonBomb bomb = new DungeonBomb(); - bomb.explode(pos); - yell("KA-BOOM!!!"); - destroy(); - sprite.die(); - } - - return super.act(); - } - - @Override - public void move(int step) { - super.move(step); - timeToBomb --; - } - - } - -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/Rat.java b/java/com/hmdzl/spspd/change/actors/mobs/Rat.java deleted file mode 100644 index 81f53006..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/Rat.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.items.food.meatfood.Meat; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.RatSprite; -import com.watabou.utils.Random; - -public class Rat extends Mob { - - - private static final float SPAWN_DELAY = 2f; - - { - spriteClass = RatSprite.class; - - HP = HT = 40+(Dungeon.depth*Random.NormalIntRange(1, 3)); - evadeSkill = 3+(Math.round((Dungeon.depth)/2)); - - EXP = 1; - maxLvl = 4; - - loot = new Meat(); - lootChance = 0.5f; - - properties.add(Property.BEAST); - } - - - - @Override - public int damageRoll() { - return Random.NormalIntRange(1, 5+Dungeon.depth); - } - - @Override - public int hitSkill(Char target) { - return 5+Dungeon.depth; - } - - @Override - public int drRoll() { - return 1; - } - - public static void spawnAround(int pos) { - for (int n : Level.NEIGHBOURS4) { - int cell = pos + n; - if (Level.passable[cell] && Actor.findChar(cell) == null) { - spawnAt(cell); - } - } - } - - public static Rat spawnAt(int pos) { - - Rat b = new Rat(); - - b.pos = pos; - b.state = b.HUNTING; - GameScene.add(b, SPAWN_DELAY); - - return b; - - } - - - -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/RatBoss.java b/java/com/hmdzl/spspd/change/actors/mobs/RatBoss.java deleted file mode 100644 index 90bcc3b2..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/RatBoss.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs; - - -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.items.Generator; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfRegrowth; -import com.hmdzl.spspd.change.sprites.RatBossSprite; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.utils.Random; - -public class RatBoss extends Mob { - - { - spriteClass = RatBossSprite.class; - - HP = HT = 50+(Dungeon.depth*Random.NormalIntRange(2, 5)); - evadeSkill = 5+(Dungeon.depth/4); - - EXP = 10; - - loot = Generator.Category.BERRY; - lootChance = 0.5f; - - lootOther = new ScrollOfRegrowth(); - lootChanceOther = 0.1f; - - properties.add(Property.BEAST); - properties.add(Property.BOSS); - } - - private boolean spawnedRats = false; - - @Override - public int damageRoll() { - return Random.NormalIntRange(2+Dungeon.depth/2, 8+(Dungeon.depth)); - } - - @Override - public int hitSkill(Char target) { - return 11+Dungeon.depth; - } - - @Override - public int drRoll() { - return Dungeon.depth/2; - } - - @Override - public void notice() { - super.notice(); - if (!spawnedRats){ - Rat.spawnAround(pos); - spawnedRats = true; - } - } -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/RedWraith.java b/java/com/hmdzl/spspd/change/actors/mobs/RedWraith.java deleted file mode 100644 index 3166dd1d..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/RedWraith.java +++ /dev/null @@ -1,200 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs; - -import java.util.HashSet; - -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.ToxicGas; -import com.hmdzl.spspd.change.actors.buffs.Amok; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Burning; -import com.hmdzl.spspd.change.actors.buffs.Charm; -import com.hmdzl.spspd.change.actors.buffs.Frost; -import com.hmdzl.spspd.change.actors.buffs.Paralysis; -import com.hmdzl.spspd.change.actors.buffs.Roots; -import com.hmdzl.spspd.change.actors.buffs.Sleep; -import com.hmdzl.spspd.change.actors.buffs.Terror; -import com.hmdzl.spspd.change.actors.buffs.Vertigo; -import com.hmdzl.spspd.change.effects.particles.ShadowParticle; -import com.hmdzl.spspd.change.items.RedDewdrop; -import com.hmdzl.spspd.change.items.Generator; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfPsionicBlast; -import com.hmdzl.spspd.change.items.weapon.enchantments.EnchantmentDark; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.RedWraithSprite; -import com.watabou.noosa.tweeners.AlphaTweener; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -public class RedWraith extends Mob { - - protected static final float SPAWN_DELAY = 2f; - - protected int level; - - { - spriteClass = RedWraithSprite.class; - - HP = HT = 10 + Dungeon.depth; - EXP = 1 ; - - flying = true; - - loot = new RedDewdrop(); - lootChance = 0.5f; - - lootOther = Generator.Category.RING; - lootChanceOther = 0.1f; - - properties.add(Property.UNDEAD); - - } - - protected static final String LEVEL = "level"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(LEVEL, level); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - level = bundle.getInt(LEVEL); - adjustStats(level); - } - - @Override - public int damageRoll() { - return Random.NormalIntRange(1, 3 + level); - } - - @Override - public int hitSkill(Char target) { - return 10 + level; - } - - public void adjustStats(int level) { - this.level = level; - evadeSkill = hitSkill(null) * 5; - enemySeen = true; - } - - @Override - public int attackProc(Char enemy, int damage) { - if (Random.Int(4) == 0) { - Buff.affect(enemy, Vertigo.class, Vertigo.duration(enemy)); - Buff.affect(enemy, Terror.class, Terror.DURATION).object = enemy.id(); - } - - return damage; - } - - @Override - protected boolean canAttack(Char enemy) { - return Dungeon.level.distance( pos, enemy.pos ) <= 2 ; - } - - @Override - public void die(Object cause) { - - /*if (!Dungeon.limitedDrops.ringofhaste.dropped() && Random.Float()<0.1f) { - Dungeon.limitedDrops.ringofhaste.drop(); - Dungeon.level.drop(new RingOfHaste(), pos).sprite.drop(); - explodeDew(pos); - } else { - explodeDew(pos); - }*/ - - super.die(cause); - - } - - //public void damage(int dmg, Object src) { - // if (enemySeen - // && (src instanceof Wand || src instanceof LightningTrap.Electricity || src instanceof Char)) { - // GLog.n("The attack passes through the wraith."); - // sprite.showStatus(CharSprite.NEUTRAL, "missed"); - // } else { - // super.damage(dmg, src); - // } - //} - - @Override - public boolean reset() { - state = WANDERING; - return true; - } - - public static void spawnAround(int pos) { - for (int n : Level.NEIGHBOURS4) { - int cell = pos + n; - if (Level.passable[cell] && Actor.findChar(cell) == null) { - spawnAt(cell); - } - } - } - - public static RedWraith spawnAt(int pos) { - if (Level.passable[pos] && Actor.findChar(pos) == null) { - - RedWraith w = new RedWraith(); - w.adjustStats(Dungeon.depth); - w.pos = pos; - w.state = w.HUNTING; - GameScene.add(w, SPAWN_DELAY); - - w.sprite.alpha(0); - w.sprite.parent.add(new AlphaTweener(w.sprite, 1, 0.5f)); - - w.sprite.emitter().burst(ShadowParticle.CURSE, 5); - - return w; - - } else { - return null; - } - } - - protected static final HashSet> IMMUNITIES = new HashSet>(); - static { - IMMUNITIES.add(EnchantmentDark.class); - IMMUNITIES.add(Terror.class); - IMMUNITIES.add(Amok.class); - IMMUNITIES.add(Charm.class); - IMMUNITIES.add(Sleep.class); - IMMUNITIES.add(ToxicGas.class); - IMMUNITIES.add(ScrollOfPsionicBlast.class); - IMMUNITIES.add(Vertigo.class); - IMMUNITIES.add(Burning.class); - IMMUNITIES.add(Paralysis.class); - IMMUNITIES.add(Roots.class); - IMMUNITIES.add(Frost.class); - } - - @Override - public HashSet> immunities() { - return IMMUNITIES; - } -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/SandMob.java b/java/com/hmdzl/spspd/change/actors/mobs/SandMob.java deleted file mode 100644 index da968584..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/SandMob.java +++ /dev/null @@ -1,171 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs; - -import java.util.HashSet; - -import com.hmdzl.spspd.change.actors.buffs.Dry; -import com.hmdzl.spspd.change.actors.buffs.Paralysis; -import com.hmdzl.spspd.change.actors.buffs.Slow; -import com.hmdzl.spspd.change.items.food.WaterItem; -import com.hmdzl.spspd.change.items.weapon.enchantments.EnchantmentEarth; -import com.hmdzl.spspd.change.items.weapon.enchantments.EnchantmentEarth2; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.SandmobSprite; -import com.watabou.utils.Random; - -public class SandMob extends Mob { - - { - spriteClass = SandmobSprite.class; - - HP = HT = 90+(adj(0)*Random.NormalIntRange(2, 5)); - evadeSkill = 5+adj(0); - baseSpeed = 0.5f; - - EXP = 10; - maxLvl = 25; - - loot = new WaterItem(); - //loot = new PotionOfMending(); potential nerf - lootChance = 0.5f; // by default, see die() - - properties.add(Property.ELEMENT); - } - - @Override - public int damageRoll() { - return Random.NormalIntRange(17, 25+adj(0)); - } - - @Override - public int hitSkill(Char target) { - return 10+adj(0); - } - - @Override - public int drRoll() { - return Random.NormalIntRange(0, 10); - } - - - @Override - public int attackProc(Char enemy, int damage) { - if (Random.Int(5) == 0) { - Buff.prolong(enemy, Dry.class, 10f); - } - - if (Random.Int(5) == 0) { - Buff.prolong(enemy, Slow.class, 10f); - } - - return damage; - } - - @Override - public void die(Object cause) { - MiniSand.spawnAround(this.pos); - super.die(cause); - } - - public static class MiniSand extends Mob { - - protected static final float SPAWN_DELAY = 1f; - { - spriteClass = SandmobSprite.class; - - HP = HT = 45+(adj(0)*Random.NormalIntRange(2, 5)); - evadeSkill = 25; - - - EXP = 0; - - state = WANDERING; - } - - int generation = 0; - - @Override - public int damageRoll() { - return Random.NormalIntRange(15, 20+adj(0)); - } - - @Override - public int hitSkill(Char target) { - return 30+adj(0); - } - - @Override - public int drRoll() { - return 0; - } - - @Override - public int attackProc(Char enemy, int damage) { - if (Random.Int(5) == 0) { - Buff.prolong(enemy, Dry.class, 10f); - } - - if (Random.Int(5) == 0) { - Buff.prolong(enemy, Slow.class, 10f); - } - - return damage; - } - - public static void spawnAround(int pos) { - for (int n : Level.NEIGHBOURS4) { - int cell = pos + n; - if (Level.passable[cell] && Actor.findChar(cell) == null) { - spawnAt(cell); - } - } - } - - public static MiniSand spawnAt(int pos) { - if (Level.passable[pos] && Actor.findChar(pos) == null) { - - MiniSand w = new MiniSand(); - w.pos = pos; - w.state = w.HUNTING; - GameScene.add(w, SPAWN_DELAY); - return w; - - } else { - return null; - } - } - - private static final HashSet> IMMUNITIES = new HashSet>(); - static { - IMMUNITIES.add(EnchantmentEarth.class); - IMMUNITIES.add(EnchantmentEarth2.class); - IMMUNITIES.add(Paralysis.class); - } - - @Override - public HashSet> immunities() { - return IMMUNITIES; - } - } - -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/Scorpio.java b/java/com/hmdzl/spspd/change/actors/mobs/Scorpio.java deleted file mode 100644 index 85ddbd49..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/Scorpio.java +++ /dev/null @@ -1,121 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs; - -import java.util.HashSet; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Cripple; -import com.hmdzl.spspd.change.actors.buffs.Light; -import com.hmdzl.spspd.change.actors.buffs.Locked; -import com.hmdzl.spspd.change.actors.buffs.Poison; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.food.meatfood.MysteryMeat; -import com.hmdzl.spspd.change.items.potions.PotionOfHealing; - -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.sprites.ScorpioSprite; -import com.watabou.utils.Random; - -public class Scorpio extends Mob { - - { - spriteClass = ScorpioSprite.class; - - HP = HT = 180+(adj(0)*Random.NormalIntRange(1, 3)); - evadeSkill = 24+adj(1); - viewDistance = Light.DISTANCE; - - EXP = 17; - maxLvl = 35; - - loot = new PotionOfHealing(); - lootChance = 0.2f; - - lootOther = new MysteryMeat(); - lootChanceOther = 0.30f; // by default, see die() - - properties.add(Property.BEAST); - } - - @Override - public int damageRoll() { - return Random.NormalIntRange(20, 52+adj(0)); - } - - @Override - public int hitSkill(Char target) { - return 36+adj(1); - } - - @Override - public int drRoll() { - return Random.NormalIntRange(10, 20); - } - - @Override - protected boolean canAttack(Char enemy) { - if (buff(Locked.class) != null){ - return Level.adjacent(pos, enemy.pos) && (!isCharmedBy(enemy)); - } else - return Dungeon.level.distance( pos, enemy.pos ) <= 2 ; - } - - - @Override - public int attackProc(Char enemy, int damage) { - if (Random.Int(2) == 0) { - Buff.prolong(enemy, Cripple.class, Cripple.DURATION); - } - - return damage; - } - - @Override - protected boolean getCloser(int target) { - if (state == HUNTING) { - return enemySeen && getFurther(target); - } else { - return super.getCloser(target); - } - } - - @Override - protected Item createLoot() { - // 5/count+5 total chance of getting healing, failing the 2nd roll drops - // mystery meat instead. - if (Random.Int(5 ) <= 24) { - return (Item) loot; - } else { - return new MysteryMeat(); - } - } - - private static final HashSet> RESISTANCES = new HashSet>(); - static { - - RESISTANCES.add(Poison.class); - } - - @Override - public HashSet> resistances() { - return RESISTANCES; - } -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/Senior.java b/java/com/hmdzl/spspd/change/actors/mobs/Senior.java deleted file mode 100644 index 4be074d0..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/Senior.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs; - -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Paralysis; -import com.hmdzl.spspd.change.sprites.SeniorSprite; -import com.watabou.utils.Random; - -public class Senior extends Monk { - - { - spriteClass = SeniorSprite.class; - - properties.add(Property.DWARF); - } - - @Override - public int damageRoll() { - return Random.NormalIntRange(32, 56+adj(0)); - } - - @Override - public int attackProc(Char enemy, int damage) { - if (Random.Int(10) == 0) { - Buff.prolong(enemy, Paralysis.class, 1.1f); - } - return super.attackProc(enemy, damage); - } - - @Override - public int defenseProc(Char enemy, int damage) { - - int dmg = Random.IntRange(0, damage/3); - if (dmg > 0) { - enemy.damage(dmg, this); - } - - return super.defenseProc(enemy, damage); - } - - - - @Override - public void die(Object cause) { - super.die(cause); - - Badges.validateRare(this); - } -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/Sentinel.java b/java/com/hmdzl/spspd/change/actors/mobs/Sentinel.java deleted file mode 100644 index ce3ce5c9..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/Sentinel.java +++ /dev/null @@ -1,184 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs; - -import java.util.HashSet; - -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Levitation; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.Journal; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.ToxicGas; -import com.hmdzl.spspd.change.actors.buffs.Poison; -import com.hmdzl.spspd.change.items.Generator; -import com.hmdzl.spspd.change.items.weapon.Weapon; -import com.hmdzl.spspd.change.items.weapon.Weapon.Enchantment; -import com.hmdzl.spspd.change.items.weapon.enchantments.EnchantmentDark; - -import com.hmdzl.spspd.change.items.weapon.melee.MeleeWeapon; -import com.hmdzl.spspd.change.sprites.SentinelSprite; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -public class Sentinel extends Mob { - - { - spriteClass = SentinelSprite.class; - - EXP = 18; - state = PASSIVE; - - properties.add(Property.MECH); - } - - private Weapon weapon; - - public Sentinel() { - super(); - - do { - weapon = (Weapon) Generator.random(Generator.Category.OLDWEAPON); - } while (!(weapon instanceof MeleeWeapon) || weapon.level < 0); - - weapon.identify(); - weapon.enchant(Enchantment.random()); - weapon.upgrade(); - weapon.upgrade(); - weapon.upgrade(); - - HP = HT = 15 + Dungeon.depth * 8; - evadeSkill = 4 + Dungeon.depth * 2; - } - - private static final String WEAPON = "weapon"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(WEAPON, weapon); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - weapon = (Weapon) bundle.get(WEAPON); - } - - @Override - protected boolean act() { - if (Dungeon.visible[pos]) { - Journal.add(Journal.Feature.STATUE); - } - return super.act(); - } - - @Override - public int damageRoll() { - return Random.NormalIntRange(weapon.MIN, weapon.MAX); - } - - @Override - public int hitSkill(Char target) { - return (int) ((9 + Dungeon.depth) * weapon.ACU); - } - - @Override - protected float attackDelay() { - return weapon.DLY; - } - - @Override - public int drRoll() { - return Random.NormalIntRange(0, Dungeon.depth); - } - - @Override - public void damage(int dmg, Object src) { - - if (state == PASSIVE) { - state = HUNTING; - } - - super.damage(dmg, src); - - Buff.prolong(this,Levitation.class,10f); - } - - @Override - public int attackProc(Char enemy, int damage) { - weapon.proc(this, enemy, damage); - return damage; - } - - @Override - public void beckon(int cell) { - // Do nothing - } - - @Override - public void die(Object cause) { - Dungeon.level.drop(weapon, pos).sprite.drop(); - explodeDew(pos); - /*if (!Dungeon.limitedDrops.hallskey.dropped() && Dungeon.depth==24) { - Dungeon.limitedDrops.hallskey.drop(); - Dungeon.level.drop(new HallsKey(), pos).sprite.drop(); - - } */ - super.die(cause); - } - - @Override - public void destroy() { - Journal.remove(Journal.Feature.STATUE); - super.destroy(); - } - - - @Override - public boolean reset() { - state = PASSIVE; - return true; - } - - @Override - public String description() { - return Messages.get(this, "desc", weapon.name()); - } - - private static final HashSet> RESISTANCES = new HashSet>(); - private static final HashSet> IMMUNITIES = new HashSet>(); - static { - RESISTANCES.add(ToxicGas.class); - RESISTANCES.add(Poison.class); - RESISTANCES.add(EnchantmentDark.class); - - } - - @Override - public HashSet> resistances() { - return RESISTANCES; - } - - @Override - public HashSet> immunities() { - return IMMUNITIES; - } -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/SewerHeart.java b/java/com/hmdzl/spspd/change/actors/mobs/SewerHeart.java deleted file mode 100644 index 16844b9a..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/SewerHeart.java +++ /dev/null @@ -1,539 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * Shattered Pixel Dungeon - * Copyright (C) 2014-2015 Evan Debenham - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs; - - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.Badges.Badge; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.ResultDescriptions; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.Blob; -import com.hmdzl.spspd.change.actors.blobs.GooWarn; -import com.hmdzl.spspd.change.actors.blobs.ToxicGas; -import com.hmdzl.spspd.change.actors.buffs.Bleeding; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Burning; -import com.hmdzl.spspd.change.actors.buffs.Cripple; -import com.hmdzl.spspd.change.actors.buffs.GrowSeed; -import com.hmdzl.spspd.change.actors.buffs.Ooze; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.effects.particles.ElmoParticle; -import com.hmdzl.spspd.change.effects.particles.PurpleParticle; -import com.hmdzl.spspd.change.items.Generator; -import com.hmdzl.spspd.change.items.eggs.EasterEgg; -import com.hmdzl.spspd.change.items.eggs.Egg; -import com.hmdzl.spspd.change.items.journalpages.Sokoban1; -import com.hmdzl.spspd.change.items.keys.SkeletonKey; -import com.hmdzl.spspd.change.items.potions.PotionOfMight; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.SewerBossLevel; -import com.hmdzl.spspd.change.mechanics.Ballistica; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.plants.Rotberry; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.hmdzl.spspd.change.sprites.GooSprite; -import com.hmdzl.spspd.change.sprites.SewerHeartSprite; -import com.hmdzl.spspd.change.sprites.SewerLasherSprite; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.Camera; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -import java.util.HashSet; - -import static com.hmdzl.spspd.change.Dungeon.hero; - -public class SewerHeart extends Mob { - - { - spriteClass = SewerHeartSprite.class; - - HP = HT = 500; - evadeSkill = 0; - - EXP = 30; - - loot = new Rotberry.Seed(); - lootChance = 0.2f; - - lootOther = Generator.Category.SEED; - lootChanceOther = 1f; - - properties.add(Property.PLANT); - properties.add(Property.BOSS); - } - - private Ballistica beam; - private int beamTarget = -1; - private int breaks=0; - private int beamCooldown=0; - public boolean beamCharged; - - @Override - public void notice() { - super.notice(); - //yell("GLURP-GLURP!"); - ((SewerBossLevel) Dungeon.level).seal(); - if (!spawnedLasher){ - Buff.affect(hero, LasherSpawner.class);; - spawnedLasher = true; - } - state = PASSIVE; - } - - - @Override - public boolean act() { - - if( 5 - breaks > 6 * HP / HT ) { - breaks++; - return true; - } - - if (breaks ==3 && state == PASSIVE){ - state = HUNTING; - } - - if (beamCharged && state != HUNTING){ - beamCharged = false; - } - if (beam == null && beamTarget != -1) { - beam = new Ballistica(pos, beamTarget, Ballistica.STOP_TERRAIN); - sprite.turnTo(pos, beamTarget); - } - if (beamCooldown > 0) - beamCooldown--; - return super.act(); - } - - @Override - public void damage(int dmg, Object src) { - if( (5 - breaks) > 6 * HP / HT ) { - int newPos = -1; - for (int i = 0; i < 20; i++) { - newPos = Dungeon.level.randomRespawnCellMob(); - if (newPos != -1) { - break; - } - } - if (newPos != -1){ - Actor.freeCell(pos); - CellEmitter.get(pos).start(Speck.factory(Speck.LIGHT), 0.2f, 3); - pos = newPos; - sprite.place(pos); - sprite.visible = Dungeon.visible[pos]; - GLog.n(Messages.get(this, "blink")); - } - if (Dungeon.level.mobs.size()< hero.lvl*2){ - SewerLasher.spawnAroundChance(newPos); - } - } - - super.damage(dmg, src); - - } - - @Override - public int defenseProc(Char enemy, int damage) { - GameScene.add(Blob.seed(pos, 20, ToxicGas.class)); - - return super.defenseProc(enemy, damage); - } - - @Override - protected boolean getCloser(int target) { - return false; - } - - @Override - public void destroy() { - super.destroy(); - for (Mob mob : Dungeon.level.mobs.toArray(new Mob[Dungeon.level.mobs.size()])){ - if (mob instanceof SewerLasher){ - mob.die(null); - } - } - } - - @Override - protected boolean canAttack(Char enemy) { - if (beamCooldown == 0) { - Ballistica aim = new Ballistica(pos, enemy.pos, Ballistica.STOP_TERRAIN); - - if (enemy.invisible == 0 && !isCharmedBy(enemy) && Level.fieldOfView[enemy.pos] && aim.subPath(1, aim.dist).contains(enemy.pos)){ - beam = aim; - beamTarget = aim.collisionPos; - return true; - } else - //if the beam is charged, it has to attack, will aim at previous location of target. - return beamCharged; - } else - return super.canAttack(enemy); - } - - @Override - protected boolean doAttack(Char enemy) { - if (beamCooldown > 0) { - return super.doAttack(enemy); - } else if (!beamCharged){ - ((SewerHeartSprite)sprite).charge( enemy.pos ); - spend( attackDelay()*2f ); - beamCharged = true; - return true; - } else { - - spend( attackDelay() ); - - beam = new Ballistica(pos, beamTarget, Ballistica.STOP_TERRAIN); - if (Level.fieldOfView[pos] || Level.fieldOfView[beam.collisionPos] ) { - sprite.zap( beam.collisionPos ); - return false; - } else { - deathGaze(); - return true; - } - }} - - public void deathGaze(){ - if (!beamCharged || beamCooldown > 0 || beam == null) - return; - - beamCharged = false; - beamCooldown = Random.IntRange(3, 6); - - boolean terrainAffected = false; - - for (int pos : beam.subPath(1, beam.dist)) { - - if (Dungeon.level.flamable[pos]) { - - Dungeon.level.destroy( pos ); - GameScene.updateMap( pos ); - terrainAffected = true; - - } - - Char ch = Actor.findChar( pos ); - if (ch == null) { - continue; - } - - if (hit( this, ch, true )) { - ch.damage( Random.NormalIntRange( 20, 35 ), this ); - - if (Level.fieldOfView[pos]) { - ch.sprite.flash(); - CellEmitter.center( pos ).burst( PurpleParticle.BURST, Random.IntRange( 1, 2 ) ); - } - - if (!ch.isAlive() && ch == Dungeon.hero) { - Dungeon.fail( Messages.format(ResultDescriptions.BURNING)); - } - } else { - ch.sprite.showStatus( CharSprite.NEUTRAL, ch.defenseVerb() ); - } - } - - if (terrainAffected) { - Dungeon.observe(); - } - - beam = null; - beamTarget = -1; - } - - @Override - public void die(Object cause) { - super.die(cause); - ((SewerBossLevel) Dungeon.level).unseal(); - - GameScene.bossSlain(); - Dungeon.level.drop(new SkeletonKey(Dungeon.depth), pos).sprite.drop(); - Badges.validateBossSlain(); - - Buff.detach(hero, LasherSpawner.class); - - Badges.Badge badgeToCheck = null; - switch (hero.heroClass) { - case WARRIOR: - badgeToCheck = Badge.MASTERY_WARRIOR; - break; - case MAGE: - badgeToCheck = Badge.MASTERY_MAGE; - break; - case ROGUE: - badgeToCheck = Badge.MASTERY_ROGUE; - break; - case HUNTRESS: - badgeToCheck = Badge.MASTERY_HUNTRESS; - break; - case PERFORMER: - badgeToCheck = Badge.MASTERY_PERFORMER; - break; - case SOLDIER: - badgeToCheck = Badge.MASTERY_SOLDIER; - break; - case FOLLOWER: - badgeToCheck = Badge.MASTERY_FOLLOWER; - break; - } - Dungeon.level.drop(new Sokoban1(), pos).sprite.drop(); - } - - @Override - public int damageRoll() { - int min = (HP*2 <= HT) ? 5 : 2; - int max = (HP*2 <= HT) ? 16 : 8; - return Random.NormalIntRange( min, max ); - - } - - @Override - public int hitSkill( Char target ) { - return 30; - } - - @Override - public int drRoll() { - return Random.NormalIntRange(0, 2); - } - - protected boolean spawnedLasher = false; - - - private static final String BEAM_TARGET = "beamTarget"; - private static final String BEAM_COOLDOWN = "beamCooldown"; - private static final String BEAM_CHARGED = "beamCharged"; - private static final String BREAKS = "breaks"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put( BEAM_TARGET, beamTarget); - bundle.put( BEAM_COOLDOWN, beamCooldown ); - bundle.put( BEAM_CHARGED, beamCharged ); - bundle.put( BREAKS, breaks ); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - if (bundle.contains(BEAM_TARGET)) - beamTarget = bundle.getInt(BEAM_TARGET); - beamCooldown = bundle.getInt(BEAM_COOLDOWN); - beamCharged = bundle.getBoolean(BEAM_CHARGED); - breaks = bundle.getInt( BREAKS ); - } - - private static final HashSet> IMMUNITIES = new HashSet<>(); - static { - IMMUNITIES.add( ToxicGas.class ); - } - - @Override - public HashSet> immunities() { - return IMMUNITIES; - } - - public static class LasherSpawner extends Buff { - - int spawnPower = 0; - - @Override - public boolean act() { - spawnPower++; - int lasher = 1; //we include the wraith we're trying to spawn - for (Mob mob : Dungeon.level.mobs){ - if (mob instanceof SewerLasher){ - lasher++; - } - } - - int powerNeeded = Math.min(25, lasher); - - if (powerNeeded <= spawnPower){ - spawnPower -= powerNeeded; - int pos = 0; - do{ - pos = Random.Int(Dungeon.level.randomRespawnCellMob()); - } while (!Dungeon.level.passable[pos] || Actor.findChar( pos ) != null); - SewerLasher.spawnAt(pos); - Sample.INSTANCE.play(Assets.SND_BURNING); - } - - spend(TICK); - return true; - } - - public void dispel(){ - detach(); - for (Mob mob : Dungeon.level.mobs.toArray(new Mob[0])){ - if (mob instanceof SewerLasher){ - mob.die(null); - } - } - } - - private static String SPAWNPOWER = "spawnpower"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put( SPAWNPOWER, spawnPower ); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - spawnPower = bundle.getInt( SPAWNPOWER ); - } - } - public static class SewerLasher extends Mob { - - protected static final float SPAWN_DELAY = 2f; - - { - spriteClass = SewerLasherSprite.class; - - HP = HT = 60; - evadeSkill = 0; - - EXP = 1; - - loot = Generator.Category.SEED; - lootChance = 0.2f; - - state = HUNTING; - - properties.add(Property.PLANT); - properties.add(Property.MINIBOSS); - //properties.add(Property.IMMOVABLE); - } - - @Override - protected boolean act() { - if (enemy == null || !Level.adjacent(pos, enemy.pos)) { - HP = Math.min(HT, HP + 3); - } - return super.act(); - } - - @Override - public void damage(int dmg, Object src) { - if (src instanceof Burning) { - destroy(); - sprite.die(); - } else { - - super.damage(dmg, src); - } - } - - @Override - public int attackProc( Char enemy, int damage) { - damage = super.attackProc(enemy, damage); - if (Random.Int(5) < 1) { - Buff.affect(enemy, Cripple.class, 2f); - } else - if (Random.Int(4) < 1) { - Buff.affect(enemy, GrowSeed.class).reignite(enemy); - } else - if (Random.Int(3) < 1) { - Buff.affect(enemy, Bleeding.class).set(damage);} - - return super.attackProc(enemy, damage); - - } - @Override - protected boolean getCloser(int target) { - return true; - } - - @Override - protected boolean getFurther(int target) { - return true; - } - - @Override - public int damageRoll() { - return Random.NormalIntRange(4, 12); - } - - @Override - public int hitSkill( Char target ) { - return 15; - } - - @Override - public int drRoll() { - return Random.NormalIntRange(2, 8); - } - - private static final HashSet> IMMUNITIES = new HashSet<>(); - static { - IMMUNITIES.add( ToxicGas.class ); - } - - @Override - public HashSet> immunities() { - return IMMUNITIES; - } - - public static void spawnAround(int pos) { - for (int n : Level.NEIGHBOURS8) { - int cell = pos + n; - if (Level.passable[cell] && Actor.findChar(cell) == null) { - spawnAt(cell); - } - } - } - - public static void spawnAroundChance(int pos) { - for (int n : Level.NEIGHBOURS4) { - int cell = pos + n; - if (Level.passable[cell] && Actor.findChar(cell) == null && Random.Float() < 0.75f) { - spawnAt(cell); - } - } - } - - public static SewerLasher spawnAt(int pos) { - - SewerLasher b = new SewerLasher(); - - b.pos = pos; - b.state = b.HUNTING; - GameScene.add(b, SPAWN_DELAY); - - return b; - - } - - - } - -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/ShadowYog.java b/java/com/hmdzl/spspd/change/actors/mobs/ShadowYog.java deleted file mode 100644 index ff1b6eb6..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/ShadowYog.java +++ /dev/null @@ -1,221 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs; - -import java.util.HashSet; - -import com.hmdzl.spspd.change.actors.blobs.Blob; -import com.hmdzl.spspd.change.levels.traps.SummoningTrap; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.Statistics; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.ToxicGas; -import com.hmdzl.spspd.change.actors.buffs.Amok; -import com.hmdzl.spspd.change.actors.buffs.Burning; -import com.hmdzl.spspd.change.actors.buffs.Charm; -import com.hmdzl.spspd.change.actors.buffs.Sleep; -import com.hmdzl.spspd.change.actors.buffs.Terror; -import com.hmdzl.spspd.change.actors.buffs.Vertigo; -import com.hmdzl.spspd.change.actors.buffs.Paralysis; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.OrbOfZot; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfPsionicBlast; -import com.hmdzl.spspd.change.items.weapon.enchantments.EnchantmentDark; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.Terrain; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ShadowYogSprite; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -public class ShadowYog extends Mob { - - { - spriteClass = ShadowYogSprite.class; - - HP = HT = 50*Dungeon.hero.lvl; - - baseSpeed = 2f; - evadeSkill = 32; - - EXP = 100; - - state = PASSIVE; - - properties.add(Property.UNKNOW); - properties.add(Property.BOSS); - } - - private int yogsAlive = 0; - private int breaks=0; - private static final String BREAKS = "breaks"; - - @Override - public void storeInBundle( Bundle bundle ) { - super.storeInBundle(bundle); - bundle.put( BREAKS, breaks ); - } - - @Override - public void restoreFromBundle( Bundle bundle ) { - super.restoreFromBundle(bundle); - breaks = bundle.getInt( BREAKS ); - } - - @Override - public int damageRoll() { - return Random.NormalIntRange(43, 83); - } - - @Override - public int hitSkill(Char target) { - return 50; - } - - public ShadowYog() { - super(); - } - - @Override - public int drRoll() { - return 25; - } - - @Override - public boolean act() { - - if (5 - breaks > 6 * HP / HT) { - breaks++; - int newPos = -1; - for (int i = 0; i < 20; i++) { - newPos = Dungeon.level.randomRespawnCellMob(); - if (newPos != -1) { - break; - } - } - if (newPos != -1) { - Actor.freeCell(pos); - CellEmitter.get(pos).start(Speck.factory(Speck.LIGHT), 0.2f, 3); - pos = newPos; - sprite.place(pos); - sprite.visible = Dungeon.visible[pos]; - GLog.n(Messages.get(this, "blink")); - } - return true; - } - return super.act(); - } - - @Override - public void damage(int dmg, Object src) { - - //for (Mob mob : Dungeon.level.mobs) { - // mob.beckon(pos); - // } - - for (int i = 0; i < 4; i++) { - int trapPos; - do { - trapPos = Random.Int(Level.getLength()); - } while (!Level.fieldOfView[trapPos] || !Level.passable[trapPos]); - - if (Dungeon.level.map[trapPos] == Terrain.INACTIVE_TRAP) { - Dungeon.level.setTrap( new SummoningTrap().reveal(), trapPos ); - Level.set(trapPos,Terrain.TRAP); - GameScene.updateMap(trapPos); - } - } - if (Dungeon.level.mobs.size()) Dungeon.level.mobs.clone()) { - if (mob instanceof Rat || mob instanceof GoldOrc || mob instanceof Fiend || mob instanceof Eye) { - mob.die(cause); - } - } - - yell(Messages.get(this,"die")); - } - } - - @Override - public void notice() { - super.notice(); - yell(Messages.get(this,"illusion")); - } - - private static final HashSet> IMMUNITIES = new HashSet>(); - static { - - IMMUNITIES.add(EnchantmentDark.class); - IMMUNITIES.add(Terror.class); - IMMUNITIES.add(Amok.class); - IMMUNITIES.add(Charm.class); - IMMUNITIES.add(Sleep.class); - IMMUNITIES.add(Burning.class); - IMMUNITIES.add(ToxicGas.class); - IMMUNITIES.add(ScrollOfPsionicBlast.class); - IMMUNITIES.add(Paralysis.class); - IMMUNITIES.add(Vertigo.class); - } - - @Override - public HashSet> immunities() { - return IMMUNITIES; - } - - } diff --git a/java/com/hmdzl/spspd/change/actors/mobs/Shell.java b/java/com/hmdzl/spspd/change/actors/mobs/Shell.java deleted file mode 100644 index 6a852700..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/Shell.java +++ /dev/null @@ -1,330 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs; - -import java.util.HashSet; - -import com.hmdzl.spspd.change.actors.buffs.Silent; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.ResultDescriptions; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.ToxicGas; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Terror; -import com.hmdzl.spspd.change.effects.particles.SparkParticle; -import com.hmdzl.spspd.change.items.RedDewdrop; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfPsionicBlast; -import com.hmdzl.spspd.change.items.weapon.enchantments.EnchantmentDark; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.traps.LightningTrap; -import com.hmdzl.spspd.change.mechanics.Ballistica; -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.hmdzl.spspd.change.sprites.ShellSprite; -import com.hmdzl.spspd.change.utils.GLog; - -import com.watabou.noosa.Camera; -import com.watabou.utils.Bundle; -import com.watabou.utils.Callback; -import com.watabou.utils.Random; - -public class Shell extends Mob implements Callback { - - private static final float TIME_TO_ZAP = 2f; - - { - spriteClass = ShellSprite.class; - - HP = HT = 500; - evadeSkill = 0; - - EXP = 50; - - hostile = false; - state = PASSIVE; - - loot = new RedDewdrop(); - lootChance = 1f; - - properties.add(Property.MECH); - properties.add(Property.BOSS); - } - - private int shellCharge=0; - - private static final String SHELLCHARGE = "shellCharge"; - - @Override - public void storeInBundle( Bundle bundle ) { - super.storeInBundle(bundle); - bundle.put( SHELLCHARGE, shellCharge ); - } - - @Override - public void restoreFromBundle( Bundle bundle ) { - super.restoreFromBundle(bundle); - shellCharge = bundle.getInt( SHELLCHARGE ); - } - - - @Override - public void beckon(int cell) { - // Do nothing - } - - @Override - public int damageRoll() { - return 0; - } - - @Override - public void damage(int dmg, Object src) { - if(shellCharge>0){zapAround(1);} - super.damage(dmg, src); - } - - @Override - public int hitSkill(Char target) { - return 100; - } - - @Override - public int drRoll() { - return 0; - } - - @Override - protected boolean act() { - - if(Random.Int(shellCharge)>20 && Dungeon.hero.isAlive()){ - zapAll(1); - } - return super.act(); - } - - @Override - public void call() { - next(); - } - - - @Override - protected boolean canAttack(Char enemy) { if (buff(Silent.class) != null){ - return Level.adjacent(pos, enemy.pos) && (!isCharmedBy(enemy)); - } else - return new Ballistica( pos, enemy.pos, Ballistica.MAGIC_BOLT).collisionPos == enemy.pos; - } - - @Override - protected boolean doAttack(Char enemy) { - - if (Level.distance(pos, enemy.pos) <= 1) { - - return super.doAttack(enemy); - - } else { - - boolean visible = Level.fieldOfView[pos] - || Level.fieldOfView[enemy.pos]; - if (visible) { - ((ShellSprite) sprite).zap(enemy.pos); - } - zapAll(10); - spend(TIME_TO_ZAP); - - if (hit(this, enemy, true)) { - int dmg = Random.Int(Math.round(shellCharge/4), Math.round(shellCharge/2)); - shellCharge-=dmg; - - if (Level.water[enemy.pos] && !enemy.flying) { - dmg *= 1.5f; - } - enemy.damage(dmg, this); - - enemy.sprite.centerEmitter().burst(SparkParticle.FACTORY, 3); - enemy.sprite.flash(); - - if (enemy == Dungeon.hero) { - - Camera.main.shake(2, 0.3f); - - if (!enemy.isAlive()) { - Dungeon.fail(Messages.format(ResultDescriptions.MOB)); - //GLog.n(Messages.get(this, "kill")); - } - } - } else { - enemy.sprite - .showStatus(CharSprite.NEUTRAL, enemy.defenseVerb()); - } - - return !visible; - } - } - - - public void zapAll(int dmg){ - - GLog.n(Messages.get(this, "zap")); - - int heroDmg=0; - int mobDmg=Random.Int(1, 2+Math.round(dmg/4)); - - for (Mob mob : Dungeon.level.mobs) { - - - if (Level.distance(pos, mob.pos) > 1 && mob.isAlive()){ - boolean visible = Level.fieldOfView[pos] - || Level.fieldOfView[mob.pos]; - - - if (visible) { - ((ShellSprite) sprite).zap(mob.pos); - } - - mob.damage(mobDmg, this); - - mob.sprite.centerEmitter().burst(SparkParticle.FACTORY, 3); - mob.sprite.flash(); - - } - } - - - if (Dungeon.hero.isAlive()){ - - Char hero=Dungeon.hero; - - if (Level.distance(pos, hero.pos) > 1){ - - boolean visibleHero = Level.fieldOfView[pos] - || Level.fieldOfView[hero.pos]; - if (visibleHero && Random.Int(4) > 2 ) { - ((ShellSprite) sprite).zap(hero.pos); - } - - heroDmg = Random.Int(Math.round(shellCharge/4), Math.round(shellCharge/2)); - shellCharge-=heroDmg; - - hero.damage(heroDmg, this); - - hero.sprite.centerEmitter().burst(SparkParticle.FACTORY, 3); - hero.sprite.flash(); - - } - } - - - } - -public void zapAround(int dmg){ - - GLog.n(Messages.get(this, "zap")); - - int heroDmg=0; - int mobDmg=Random.Int(1, 2+Math.round(dmg/4)); - - for (int n : Level.NEIGHBOURS8) { - int c = pos + n; - - Char ch = Actor.findChar(c); - if (ch != null && ch != Dungeon.hero && ch.isAlive()) { - - boolean visible = Level.fieldOfView[pos] - || Level.fieldOfView[ch.pos]; - - if (visible) { - ((ShellSprite) sprite).zap(ch.pos); - } - - if (Level.water[ch.pos] && !ch.flying) { - mobDmg *= 1.5f; - } - ch.damage(mobDmg, this); - - ch.sprite.centerEmitter().burst(SparkParticle.FACTORY, 3); - ch.sprite.flash(); - - - } else if (ch != null && ch == Dungeon.hero && ch.isAlive()){ - - heroDmg = Random.Int(shellCharge/2, shellCharge); - - if(dmg> RESISTANCES = new HashSet>(); - static { - RESISTANCES.add(EnchantmentDark.class); - - RESISTANCES.add(LightningTrap.Electricity.class); - } - - @Override - public HashSet> resistances() { - return RESISTANCES; - } - - private static final HashSet> IMMUNITIES = new HashSet>(); - static { - IMMUNITIES.add(ToxicGas.class); - IMMUNITIES.add(Terror.class); - } - - @Override - public HashSet> immunities() { - return IMMUNITIES; - } - - -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/Shielded.java b/java/com/hmdzl/spspd/change/actors/mobs/Shielded.java deleted file mode 100644 index db8d06fe..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/Shielded.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs; - -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.sprites.ShieldedSprite; -import com.watabou.utils.Random; - -public class Shielded extends Brute { - - { - spriteClass = ShieldedSprite.class; - - evadeSkill = 20+adj(0); - - properties.add(Property.GNOLL); - } - - @Override - public int drRoll() { - return Random.NormalIntRange(10, 30); - } - - @Override - public int defenseProc(Char enemy, int damage) { - - int dmg = Random.IntRange(0, damage/4); - if (dmg > 0) { - enemy.damage(dmg, this); - } - - return super.defenseProc(enemy, damage); - } - - - @Override - public void die(Object cause) { - super.die(cause); - Badges.validateRare(this); - } -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/Skeleton.java b/java/com/hmdzl/spspd/change/actors/mobs/Skeleton.java deleted file mode 100644 index da0eb29d..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/Skeleton.java +++ /dev/null @@ -1,169 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs; - -import java.util.HashSet; - -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Silent; -import com.hmdzl.spspd.change.effects.particles.ShadowParticle; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.ResultDescriptions; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.items.Generator; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.weapon.enchantments.EnchantmentDark; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.SkeletonSprite; -import com.hmdzl.spspd.change.utils.GLog; - -import com.watabou.noosa.audio.Sample; -import com.watabou.noosa.tweeners.AlphaTweener; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -public class Skeleton extends Mob { - - protected static final float SPAWN_DELAY = 2f; - protected static final String LEVEL = "level"; - - protected int level; - { - spriteClass = SkeletonSprite.class; - - HP = HT = 80+(adj(0)*Random.NormalIntRange(2, 5)); - evadeSkill = 15+adj(0); - baseSpeed = 0.8f; - - - EXP = 5; - maxLvl = 25; - - loot = Generator.Category.WEAPON; - lootChance = 0.15f; - - properties.add(Property.UNDEAD); - } - - @Override - public int damageRoll() { - return Random.NormalIntRange(15, 22+adj(0)); - } - - - @Override - public void die(Object cause) { - - super.die(cause); - - boolean heroKilled = false; - for (int i = 0; i < Level.NEIGHBOURS8.length; i++) { - Char ch = findChar(pos + Level.NEIGHBOURS8[i]); - if (ch != null && ch.isAlive()) { - int damage = Math.max(0, - Random.NormalIntRange(3, 8) - Random.IntRange(0, ch.drRoll() / 2)); - ch.damage(damage, this); - Buff.affect(ch,Silent.class,10f); - if (ch == Dungeon.hero && !ch.isAlive()) { - heroKilled = true; - } - } - } - - if (Dungeon.visible[pos]) { - Sample.INSTANCE.play(Assets.SND_BONES); - } - - if (heroKilled) { - Dungeon.fail( Messages.format(ResultDescriptions.MOB)); - //GLog.n(Messages.get(this, "kill")); - } - } - - @Override - protected Item createLoot() { - Item loot = Generator.random(Generator.Category.WEAPON); - for (int i = 0; i < 2; i++) { - Item l = Generator.random(Generator.Category.WEAPON); - if (l.level < loot.level) { - loot = l; - } - } - return loot; - } - - @Override - public int hitSkill(Char target) { - return 16+adj(0); - } - - @Override - public int drRoll() { - return Random.NormalIntRange(2, 5); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - level = bundle.getInt(LEVEL); - adjustStats(level); - } - - public void adjustStats(int level) { - this.level = level; - evadeSkill = hitSkill(null) * 5; - enemySeen = true; - } - - private static final HashSet> IMMUNITIES = new HashSet>(); - static { - IMMUNITIES.add(EnchantmentDark.class); - } - - @Override - public HashSet> immunities() { - return IMMUNITIES; - } - - public static void spawnAround(int pos) { - for (int n : Level.NEIGHBOURS4) { - int cell = pos + n; - if (Level.passable[cell] && Actor.findChar(cell) == null) { - spawnAt(cell); - } - } - } - - public static Skeleton spawnAt(int pos) { - if (Level.passable[pos] && Actor.findChar(pos) == null) { - - Skeleton w = new Skeleton(); - w.pos = pos; - w.state = w.HUNTING; - GameScene.add(w, SPAWN_DELAY); - return w; - - } else { - return null; - } - } -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/SkeletonHand1.java b/java/com/hmdzl/spspd/change/actors/mobs/SkeletonHand1.java deleted file mode 100644 index f39de905..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/SkeletonHand1.java +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs; - -import java.util.HashSet; - -import com.hmdzl.spspd.change.actors.blobs.Fire; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Burning; -import com.hmdzl.spspd.change.actors.buffs.Terror; -import com.hmdzl.spspd.change.items.potions.PotionOfLiquidFlame; -import com.hmdzl.spspd.change.items.wands.WandOfFirebolt; -import com.hmdzl.spspd.change.sprites.SkeletonHand1Sprite; -import com.watabou.utils.Random; - -public class SkeletonHand1 extends Mob { - - { - spriteClass = SkeletonHand1Sprite.class; - - HP = HT = 1000; - evadeSkill = 30; - - EXP = 10; - maxLvl = 20; - - flying = true; - - loot = new PotionOfLiquidFlame(); - lootChance = 0.1f; - - properties.add(Property.UNDEAD); - properties.add(Property.BOSS); - } - - @Override - public int damageRoll() { - return Random.NormalIntRange(10, 30); - } - - @Override - public int hitSkill(Char target) { - return 25; - } - - @Override - public int drRoll() { - return Random.NormalIntRange(0, 15); - } - - @Override - protected boolean act() { - boolean result = super.act(); - - if (state == FLEEING && buff(Terror.class) == null && enemy != null - && enemySeen && enemy.buff(Burning.class) == null) { - state = HUNTING; - } - return result; - } - - @Override - public int attackProc(Char enemy, int damage) { - if (Random.Int(2) == 0) { - if(enemy == Dungeon.hero){ - Buff.affect(enemy, Burning.class).reignite(enemy); - state = FLEEING; - } - } - - return damage; - } - - @Override - protected boolean canAttack(Char enemy) { - return Dungeon.level.distance( pos, enemy.pos ) <= 2; - } - - private static final HashSet> IMMUNITIES = new HashSet>(); - static { - IMMUNITIES.add(Burning.class); - IMMUNITIES.add(Fire.class); - IMMUNITIES.add(WandOfFirebolt.class); - } - - @Override - public HashSet> immunities() { - return IMMUNITIES; - } -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/SkeletonHand2.java b/java/com/hmdzl/spspd/change/actors/mobs/SkeletonHand2.java deleted file mode 100644 index e7297e0b..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/SkeletonHand2.java +++ /dev/null @@ -1,111 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs; - -import java.util.HashSet; - -import com.hmdzl.spspd.change.actors.blobs.Fire; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Burning; -import com.hmdzl.spspd.change.actors.buffs.Roots; -import com.hmdzl.spspd.change.actors.buffs.Terror; -import com.hmdzl.spspd.change.items.potions.PotionOfLiquidFlame; -import com.hmdzl.spspd.change.items.wands.WandOfFirebolt; - -import com.hmdzl.spspd.change.sprites.SkeletonHand2Sprite; -import com.watabou.utils.Random; - -public class SkeletonHand2 extends Mob { - - { - spriteClass = SkeletonHand2Sprite.class; - - HP = HT = 1000; - evadeSkill = 30; - - EXP = 10; - maxLvl = 20; - - flying = true; - - loot = new PotionOfLiquidFlame(); - lootChance = 0.1f; - - properties.add(Property.UNDEAD); - properties.add(Property.BOSS); - - } - - @Override - public int damageRoll() { - return Random.NormalIntRange(10, 30); - } - - @Override - public int hitSkill(Char target) { - return 25; - } - - @Override - public int drRoll() { - return Random.NormalIntRange(0, 15); - } - - @Override - protected boolean act() { - boolean result = super.act(); - - if (state == FLEEING && buff(Terror.class) == null && enemy != null - && enemySeen && enemy.buff(Roots.class) == null) { - state = HUNTING; - } - return result; - } - - @Override - public int attackProc(Char enemy, int damage) { - if (Random.Int(2) == 0) { - if(enemy == Dungeon.hero){ - Buff.prolong(enemy, Roots.class, 20); - state = FLEEING; - } - } - - return damage; - } - - @Override - protected boolean canAttack(Char enemy) { - return Dungeon.level.distance( pos, enemy.pos ) <= 2; - } - - private static final HashSet> IMMUNITIES = new HashSet>(); - static { - IMMUNITIES.add(Burning.class); - IMMUNITIES.add(Fire.class); - IMMUNITIES.add(WandOfFirebolt.class); - } - - @Override - public HashSet> immunities() { - return IMMUNITIES; - } -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/SkeletonKing.java b/java/com/hmdzl/spspd/change/actors/mobs/SkeletonKing.java deleted file mode 100644 index 4acfe1a7..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/SkeletonKing.java +++ /dev/null @@ -1,134 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs; - -import java.util.HashSet; - -import com.hmdzl.spspd.change.actors.blobs.Fire; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Burning; -import com.hmdzl.spspd.change.actors.buffs.Terror; -import com.hmdzl.spspd.change.actors.buffs.Weakness; -import com.hmdzl.spspd.change.items.AdamantWeapon; -import com.hmdzl.spspd.change.items.Gold; -import com.hmdzl.spspd.change.items.potions.PotionOfLiquidFlame; -import com.hmdzl.spspd.change.items.wands.WandOfFirebolt; - -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.SkeletonKingSprite; -import com.watabou.utils.Random; - -public class SkeletonKing extends Mob { - - { - spriteClass = SkeletonKingSprite.class; - - HP = HT = 2000; - evadeSkill = 30; - - EXP = 50; - - flying = true; - - loot = new PotionOfLiquidFlame(); - lootChance = 0.1f; - - properties.add(Property.UNDEAD); - properties.add(Property.BOSS); - } - - @Override - public int damageRoll() { - return Random.NormalIntRange(20, 40); - } - - @Override - public int hitSkill(Char target) { - return 25; - } - - @Override - public int drRoll() { - return Random.NormalIntRange(10, 25); - } - - @Override - protected boolean act() { - boolean result = super.act(); - - if (state == FLEEING && buff(Terror.class) == null && enemy != null - && enemySeen && enemy.buff(Weakness.class) == null) { - state = HUNTING; - } - return result; - } - - @Override - public int attackProc(Char enemy, int damage) { - if (Random.Int(2) == 0) { - if(enemy == Dungeon.hero){ - Buff.prolong(enemy, Weakness.class, Weakness.duration(enemy)); - state = FLEEING; - } - } - - return damage; - } - - @Override - protected boolean canAttack(Char enemy) { - return Dungeon.level.distance( pos, enemy.pos ) <= 3; - } - - @Override - public void die(Object cause) { - super.die(cause); - - GameScene.bossSlain(); - Dungeon.level.drop(new Gold(Random.Int(1900, 4000)), pos).sprite.drop(); - Dungeon.level.drop(new AdamantWeapon(), pos).sprite.drop(); - Dungeon.skeletonkingkilled=true; - - - - yell(Messages.get(this,"die")); - - } - - - @Override - public void notice() { - super.notice(); - yell(Messages.get(this, "notice", Dungeon.hero.givenName())); - } - - private static final HashSet> IMMUNITIES = new HashSet>(); - static { - IMMUNITIES.add(Burning.class); - IMMUNITIES.add(Fire.class); - IMMUNITIES.add(WandOfFirebolt.class); - } - - @Override - public HashSet> immunities() { - return IMMUNITIES; - } -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/SokobanSentinel.java b/java/com/hmdzl/spspd/change/actors/mobs/SokobanSentinel.java deleted file mode 100644 index 150daa6b..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/SokobanSentinel.java +++ /dev/null @@ -1,205 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs; - -import java.util.HashSet; - -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.Journal; -import com.hmdzl.spspd.change.Statistics; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.ToxicGas; -import com.hmdzl.spspd.change.actors.buffs.Poison; -import com.hmdzl.spspd.change.items.Generator; -import com.hmdzl.spspd.change.items.weapon.Weapon; -import com.hmdzl.spspd.change.items.weapon.Weapon.Enchantment; -import com.hmdzl.spspd.change.items.weapon.enchantments.EnchantmentDark; - -import com.hmdzl.spspd.change.items.weapon.melee.MeleeWeapon; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.sprites.SentinelSprite; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -public class SokobanSentinel extends Mob { - - { - spriteClass = SentinelSprite.class; - - baseSpeed = 0.5f; - - EXP = 18; - state = PASSIVE; - - properties.add(Property.MECH); - } - - private Weapon weapon; - - public SokobanSentinel() { - super(); - - do { - weapon = (Weapon) Generator.random(Generator.Category.OLDWEAPON); - } while (!(weapon instanceof MeleeWeapon) || weapon.level < 3); - - weapon.identify(); - weapon.enchant(Enchantment.random()); - weapon.upgrade(); - weapon.upgrade(); - weapon.upgrade(); - weapon.upgrade(); - weapon.upgrade(); - - - HP = HT = 500; - evadeSkill = 40; - } - - private static final String WEAPON = "weapon"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(WEAPON, weapon); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - weapon = (Weapon) bundle.get(WEAPON); - } - - - @Override - public int damageRoll() { - return Random.NormalIntRange(weapon.MIN, weapon.MAX); - } - - @Override - public int hitSkill(Char target) { - return 40; - } - - @Override - protected float attackDelay() { - return weapon.DLY; - } - - @Override - public int drRoll() { - return Random.NormalIntRange(0, Dungeon.depth); - } - - @Override - public void damage(int dmg, Object src) { - - if (state == PASSIVE) { - state = HUNTING; - } - - super.damage(dmg, src); - } - - @Override - protected boolean getCloser(int target) { - - if (rooted) { - return false; - } - - int step = Dungeon.findPath(this, pos, target, Level.passable, - Level.fieldOfView); - if (step != -1 && !Level.avoid[step]) { - move(step); - return true; - } else { - return false; - } - } - - @Override - protected boolean act() { - - - // this causes pirahna to move away when a door is closed on them. - Dungeon.level.updateFieldOfView(this); - enemy = chooseEnemy(); - if (state == this.HUNTING - && !(enemy.isAlive() && Level.fieldOfView[enemy.pos] && enemy.invisible <= 0)) { - state = this.WANDERING; - int oldPos = pos; - int i = 0; - do { - i++; - target = Dungeon.level.randomDestination(); - if (i == 100) - return true; - } while (!getCloser(target)); - moveSprite(oldPos, pos); - return true; - } else if (state == this.PASSIVE - && !(enemy.isAlive() && Level.fieldOfView[enemy.pos] && enemy.invisible <= 0)){ - state = this.HUNTING; - } - - return super.act(); - - } - @Override - public int attackProc(Char enemy, int damage) { - weapon.proc(this, enemy, damage); - return damage; - } - - @Override - public void beckon(int cell) { - // Do nothing - } - - @Override - public void die(Object cause) { - //Dungeon.level.drop(weapon, pos).sprite.drop(); - super.die(cause); - } - - @Override - public String description() { - return Messages.get(this, "desc", weapon.name()); - } - - private static final HashSet> RESISTANCES = new HashSet>(); - private static final HashSet> IMMUNITIES = new HashSet>(); - static { - RESISTANCES.add(ToxicGas.class); - RESISTANCES.add(Poison.class); - RESISTANCES.add(EnchantmentDark.class); - - } - - @Override - public HashSet> resistances() { - return RESISTANCES; - } - - @Override - public HashSet> immunities() { - return IMMUNITIES; - } -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/SommonSkeleton.java b/java/com/hmdzl/spspd/change/actors/mobs/SommonSkeleton.java deleted file mode 100644 index ff208bee..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/SommonSkeleton.java +++ /dev/null @@ -1,134 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs; - -import java.util.HashSet; - -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Silent; -import com.hmdzl.spspd.change.effects.particles.ShadowParticle; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.ResultDescriptions; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.items.Generator; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.weapon.enchantments.EnchantmentDark; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.SkeletonSprite; -import com.hmdzl.spspd.change.utils.GLog; - -import com.watabou.noosa.audio.Sample; -import com.watabou.noosa.tweeners.AlphaTweener; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -public class SommonSkeleton extends Mob { - - protected static final float SPAWN_DELAY = 2f; - protected static final String LEVEL = "level"; - - protected int level; - { - spriteClass = SkeletonSprite.class; - - HP = HT = 80+(adj(0)*Random.NormalIntRange(2, 5)); - evadeSkill = 15+adj(0); - baseSpeed = 0.8f; - - properties.add(Property.UNDEAD); - } - - @Override - public int damageRoll() { - return Random.NormalIntRange(15, 22+adj(0)); - } - - - @Override - public void die(Object cause) { - super.die(cause); - } - - @Override - public int hitSkill(Char target) { - return 16+adj(0); - } - - @Override - public int drRoll() { - return Random.NormalIntRange(0, 4); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - level = bundle.getInt(LEVEL); - adjustStats(level); - } - - public void adjustStats(int level) { - this.level = level; - evadeSkill = hitSkill(null) * 5; - enemySeen = true; - } - - public static void spawnAround(int pos) { - for (int n : Level.NEIGHBOURS4) { - int cell = pos + n; - if (Level.passable[cell] && Actor.findChar(cell) == null) { - spawnAt(cell); - } - } - } - - public static SommonSkeleton spawnAt(int pos) { - if (Level.passable[pos] && Actor.findChar(pos) == null) { - - SommonSkeleton w = new SommonSkeleton(); - w.adjustStats(Dungeon.depth); - w.pos = pos; - w.state = w.HUNTING; - GameScene.add(w, SPAWN_DELAY); - - w.sprite.alpha(0); - w.sprite.parent.add(new AlphaTweener(w.sprite, 1, 0.5f)); - - w.sprite.emitter().burst(ShadowParticle.CURSE, 5); - - return w; - - } else { - return null; - } - } - - - private static final HashSet> IMMUNITIES = new HashSet>(); - static { - IMMUNITIES.add(EnchantmentDark.class); - } - - @Override - public HashSet> immunities() { - return IMMUNITIES; - } -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/SpiderBot.java b/java/com/hmdzl/spspd/change/actors/mobs/SpiderBot.java deleted file mode 100644 index d88729b2..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/SpiderBot.java +++ /dev/null @@ -1,133 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs; - -import java.util.HashSet; - -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.Blob; -import com.hmdzl.spspd.change.actors.blobs.ShockWeb; -import com.hmdzl.spspd.change.actors.blobs.Web; -import com.hmdzl.spspd.change.actors.buffs.Bleeding; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Poison; -import com.hmdzl.spspd.change.actors.buffs.Roots; -import com.hmdzl.spspd.change.actors.buffs.Tar; -import com.hmdzl.spspd.change.actors.buffs.Terror; -import com.hmdzl.spspd.change.items.StoneOre; -import com.hmdzl.spspd.change.items.food.meatfood.MysteryMeat; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.SpiderBotSprite; -import com.hmdzl.spspd.change.sprites.SpinnerSprite; -import com.watabou.utils.Random; - -public class SpiderBot extends Mob { - - { - spriteClass = SpiderBotSprite.class; - - HP = HT = 150+(adj(0)*Random.NormalIntRange(4, 7)); - evadeSkill = 25+adj(1); - - EXP = 12; - maxLvl = 30; - - loot = new StoneOre(); - lootChance = 0.3f; - - FLEEING = new Fleeing(); - - properties.add(Property.MECH); - } - - @Override - public int damageRoll() { - return Random.NormalIntRange(15+adj(0), 40+adj(1)); - } - - @Override - public int hitSkill(Char target) { - return 30+adj(0); - } - - @Override - public int drRoll() { - return Random.NormalIntRange(0, 20); - } - - @Override - protected boolean act() { - boolean result = super.act(); - - if (state == FLEEING && buff(Terror.class) == null && enemy != null - && enemySeen && enemy.buff(Tar.class) == null) { - state = HUNTING; - } - return result; - } - - @Override - public int attackProc(Char enemy, int damage) { - if (Random.Int(3) == 0) { - Buff.affect(enemy, Tar.class); - state = FLEEING; - } - return damage; - } - - @Override - public void move(int step) { - if (state == FLEEING) { - GameScene.add(Blob.seed(pos, Random.Int(5, 7), ShockWeb.class)); - } - super.move(step); - } - - private static final HashSet> RESISTANCES = new HashSet>(); - - static { - RESISTANCES.add(Bleeding.class); - } - - @Override - public HashSet> resistances() { - return RESISTANCES; - } - - private static final HashSet> IMMUNITIES = new HashSet>(); - - static { - IMMUNITIES.add(Roots.class); - } - - @Override - public HashSet> immunities() { - return IMMUNITIES; - } - - private class Fleeing extends Mob.Fleeing { - @Override - protected void nowhereToRun() { - if (buff(Terror.class) == null) { - state = HUNTING; - } else { - super.nowhereToRun(); - } - } - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/actors/mobs/SpiderQueen.java b/java/com/hmdzl/spspd/change/actors/mobs/SpiderQueen.java deleted file mode 100644 index c6acb30b..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/SpiderQueen.java +++ /dev/null @@ -1,665 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs; - -import java.util.ArrayList; -import java.util.HashSet; - -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.Badges.Badge; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.Blob; -import com.hmdzl.spspd.change.actors.blobs.ConfusionGas; -import com.hmdzl.spspd.change.actors.blobs.DarkGas; -import com.hmdzl.spspd.change.actors.blobs.SlowWeb; -import com.hmdzl.spspd.change.actors.blobs.ToxicGas; -import com.hmdzl.spspd.change.actors.buffs.Amok; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.DefenceUp; -import com.hmdzl.spspd.change.actors.buffs.Poison; -import com.hmdzl.spspd.change.actors.buffs.Roots; -import com.hmdzl.spspd.change.actors.buffs.Sleep; -import com.hmdzl.spspd.change.actors.buffs.Slow; -import com.hmdzl.spspd.change.actors.buffs.Terror; -import com.hmdzl.spspd.change.actors.buffs.Vertigo; -import com.hmdzl.spspd.change.effects.Pushing; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.effects.particles.ElmoParticle; -import com.hmdzl.spspd.change.items.Generator; -import com.hmdzl.spspd.change.items.TomeOfMastery; -import com.hmdzl.spspd.change.items.artifacts.RobotDMT; -import com.hmdzl.spspd.change.items.food.meatfood.MysteryMeat; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfTeleportation; -import com.hmdzl.spspd.change.levels.CavesBossLevel; -import com.hmdzl.spspd.change.levels.features.Door; -import com.hmdzl.spspd.change.mechanics.Ballistica; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.items.journalpages.Sokoban3; -import com.hmdzl.spspd.change.items.keys.SkeletonKey; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.Terrain; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.SpiderEggSprite; -import com.hmdzl.spspd.change.sprites.SpiderGoldSprite; -import com.hmdzl.spspd.change.sprites.SpiderJumpSprite; -import com.hmdzl.spspd.change.sprites.SpiderMindSprite; -import com.hmdzl.spspd.change.sprites.SpiderNormalSprite; -import com.hmdzl.spspd.change.sprites.SpiderQueenSprite; -import com.hmdzl.spspd.change.utils.GLog; - -import com.watabou.utils.Random; - -public class SpiderQueen extends Mob { - - { - spriteClass = SpiderQueenSprite.class; - - HP = HT = 1000; - EXP = 50; - evadeSkill = 35; - baseSpeed = 0.8f; - - loot = new RobotDMT().identify(); - lootChance = 0.2f; - - lootOther = Generator.Category.ARMOR; - lootChance = 1f; - - properties.add(Property.BEAST); - properties.add(Property.BOSS); - } - - @Override - public int damageRoll() { - return Random.NormalIntRange(21, 36); - } - - @Override - public int hitSkill(Char target) { - return 40; - } - - @Override - public int drRoll() { - return Random.NormalIntRange(5, 20); - } - - @Override - public boolean act() { - boolean result = super.act(); - - if (state == FLEEING && buff(Terror.class) == null && enemy != null - && enemySeen && enemy.buff(Poison.class) == null) { - state = HUNTING; - } - return result; - } - - @Override - public int attackProc(Char enemy, int damage) { - if (Random.Int(2) == 0) { - Buff.affect(enemy, Poison.class).set( - Random.Int(7, 9) * Poison.durationFactor(enemy)); - state = FLEEING; - } - - return damage; - } - - @Override - public void move(int step) { - super.move(step); - - if (Dungeon.level.map[step] == Terrain.INACTIVE_TRAP ) { - sprite.emitter().burst(ElmoParticle.FACTORY, 5); - - ArrayList candidates = new ArrayList(); - boolean[] passable = Level.passable; - int[] neighbours = { pos + 1, pos - 1, pos + Level.getWidth(), - pos - Level.getWidth() }; - for (int n : neighbours) { - if (passable[n] && Actor.findChar(n) == null) { - candidates.add(n); - } - } - if (candidates.size() > 0) { - - SpiderEgg segg = new SpiderEgg(); - segg.HP = 25; - segg.pos = Random.element(candidates); - segg.state = segg.PASSIVE; - - if (Dungeon.level.map[segg.pos] == Terrain.DOOR) { - Door.enter(segg.pos); - } - - GameScene.add(segg, 1f); - Actor.addDelayed(new Pushing(segg, pos, segg.pos), -1); - damage(1,this); - } - - if (Dungeon.visible[step] && Dungeon.hero.isAlive()) { - GLog.n(Messages.get(this,"egg")); - } - } - - } - - @Override - public void die(Object cause) { - - GameScene.bossSlain(); - ((CavesBossLevel) Dungeon.level).unseal(); - Dungeon.level.drop(new SkeletonKey(Dungeon.depth), pos).sprite.drop(); - Badges.validateBossSlain(); - - Badges.Badge badgeToCheck = null; - switch (Dungeon.hero.heroClass) { - case WARRIOR: - badgeToCheck = Badge.MASTERY_WARRIOR; - break; - case MAGE: - badgeToCheck = Badge.MASTERY_MAGE; - break; - case ROGUE: - badgeToCheck = Badge.MASTERY_ROGUE; - break; - case HUNTRESS: - badgeToCheck = Badge.MASTERY_HUNTRESS; - break; - case PERFORMER: - badgeToCheck = Badge.MASTERY_PERFORMER; - break; - case SOLDIER: - badgeToCheck = Badge.MASTERY_SOLDIER; - break; - case FOLLOWER: - badgeToCheck = Badge.MASTERY_FOLLOWER; - break; - } - - Dungeon.level.drop(new TomeOfMastery(), pos).sprite.drop(); - - Dungeon.level.drop(new Sokoban3(), pos).sprite.drop(); - yell(Messages.get(this,"die")); - super.die(cause); - } - - @Override - public void notice() { - super.notice(); - yell(Messages.get(this, "notice")); - } - - private static final HashSet> RESISTANCES = new HashSet>(); - - static { - RESISTANCES.add(Poison.class); - } - - @Override - public HashSet> resistances() { - return RESISTANCES; - } - - private static final HashSet> IMMUNITIES = new HashSet>(); - - static { - IMMUNITIES.add(Slow.class); - IMMUNITIES.add(Roots.class); - } - - @Override - public HashSet> immunities() { - return IMMUNITIES; - } - - private class Fleeing extends Mob.Fleeing { - @Override - protected void nowhereToRun() { - if (buff(Terror.class) == null) { - state = HUNTING; - } else { - super.nowhereToRun(); - } - } - } - - public static class SpiderEgg extends Mob { - - { - spriteClass = SpiderEggSprite.class; - - HP = HT = 25; - evadeSkill = 0; - - EXP = 0; - - state = PASSIVE; - properties.add(Property.UNKNOW); - properties.add(Property.BOSS); - } - - private int life_p=0; - - @Override - public void beckon(int cell) { - // Do nothing - } - - @Override - public void die(Object cause) { - super.die(cause); - if (life_p > 20){ - SpiderGold.spawnAt(pos); - } else if(life_p > 10) { - SpiderJumper.spawnAt(pos); - } else if(life_p > 5 ){ - SpiderMind.spawnAt(pos); - } else SpiderWorker.spawnAt(pos); - } - - @Override - public int hitSkill(Char target) { - return 0; - } - - @Override - public int damageRoll() { - return Random.NormalIntRange(0, 1); - } - - @Override - public int drRoll() { - return 0; - } - - @Override - public boolean act() { - for (int i = 0; i < Level.NEIGHBOURS9DIST2.length; i++) { - GameScene.add(Blob.seed(pos + Level.NEIGHBOURS9DIST2[i], 2, - SlowWeb.class)); - } - life_p ++; - damage(1,this); - return super.act(); - } - - private static final HashSet> IMMUNITIES = new HashSet>(); - static { - IMMUNITIES.add(Amok.class); - IMMUNITIES.add(Sleep.class); - IMMUNITIES.add(Terror.class); - IMMUNITIES.add(Poison.class); - IMMUNITIES.add(Vertigo.class); - IMMUNITIES.add(ToxicGas.class); - IMMUNITIES.add(Slow.class); - } - - @Override - public HashSet> immunities() { - return IMMUNITIES; - } - } - - public static class SpiderWorker extends Mob { - - { - spriteClass = SpiderNormalSprite.class; - - HP = HT = 150; - evadeSkill = 10; - - EXP = 9; - maxLvl = 16; - - loot = new MysteryMeat(); - lootChance = 0.15f; - - properties.add(Property.BEAST); - } - - private static final float SPAWN_DELAY = 1f; - - @Override - public int damageRoll() { - return Random.NormalIntRange(12, 26+adj(0)); - } - - @Override - public int hitSkill(Char target) { - return 20+adj(0); - } - - @Override - public int drRoll() { - return Random.NormalIntRange(6, 10); - } - - - private static final HashSet> RESISTANCES = new HashSet>(); - - static { - RESISTANCES.add(Poison.class); - } - - @Override - public HashSet> resistances() { - return RESISTANCES; - } - - private static final HashSet> IMMUNITIES = new HashSet>(); - - static { - IMMUNITIES.add(Roots.class); - IMMUNITIES.add(SlowWeb.class); - } - - @Override - public HashSet> immunities() { - return IMMUNITIES; - } - - public static SpiderWorker spawnAt(int pos) { - - SpiderWorker b = new SpiderWorker(); - - b.pos = pos; - b.state = b.HUNTING; - GameScene.add(b, SPAWN_DELAY); - - return b; - - } - } - - public static class SpiderMind extends SpiderWorker { - - { - spriteClass = SpiderMindSprite.class; - - HP = HT = 100; - evadeSkill = 20; - - properties.add(Property.BEAST); - } - - private static final float SPAWN_DELAY = 1f; - - @Override - public int damageRoll() { - return Random.NormalIntRange(5, 10+adj(0)); - } - - @Override - public int hitSkill(Char target) { - return 20+adj(0); - } - - @Override - public int drRoll() { - return 0; - } - - @Override - public int attackProc(Char enemy, int damage) { - int reg = Random.Int(damage); - if (reg > 0) { - HP += reg; - sprite.emitter().burst(Speck.factory(Speck.HEALING), 1); - } - return damage; - } - - - @Override - public boolean act() { - GameScene.add(Blob.seed(pos, 15, DarkGas.class)); - return super.act(); - } - - private static final HashSet> RESISTANCES = new HashSet>(); - - static { - RESISTANCES.add(Poison.class); - } - - @Override - public HashSet> resistances() { - return RESISTANCES; - } - - private static final HashSet> IMMUNITIES = new HashSet>(); - - static { - IMMUNITIES.add(Roots.class); - } - - @Override - public HashSet> immunities() { - return IMMUNITIES; - } - - public static SpiderMind spawnAt(int pos) { - - SpiderMind b = new SpiderMind(); - - b.pos = pos; - b.state = b.HUNTING; - GameScene.add(b, SPAWN_DELAY); - - return b; - - } - } - public static class SpiderJumper extends SpiderWorker{ - - private static final int BLINK_DELAY = 3; - - private int delay = 0; - - { - spriteClass = SpiderJumpSprite.class; - - HP = HT = 150; - evadeSkill = 10; - - properties.add(Property.BEAST); - } - - private static final float SPAWN_DELAY = 1f; - - @Override - public int damageRoll() { - return Random.NormalIntRange(12, 26+adj(0)); - } - - @Override - public int hitSkill(Char target) { - return 20+adj(0); - } - - @Override - public int drRoll() { - return Random.NormalIntRange(6, 10); - } - - @Override - protected boolean getCloser(int target) { - if (Level.fieldOfView[target] && Level.distance(pos, target) > 2 - && delay <= 0) { - - blink(target); - spend(-1 / speed()); - return true; - - } else { - - delay--; - return super.getCloser(target); - - } - } - - private void blink(int target) { - - Ballistica route = new Ballistica( pos, target, Ballistica.PROJECTILE); - int cell = route.collisionPos; - - //can't occupy the same cell as another char, so move back one. - if (Actor.findChar( cell ) != null && cell != this.pos) - cell = route.path.get(route.dist-1); - - if (Level.avoid[ cell ]){ - ArrayList candidates = new ArrayList<>(); - for (int n : Level.NEIGHBOURS8) { - cell = route.collisionPos + n; - if (Level.passable[cell] && Actor.findChar( cell ) == null) { - candidates.add( cell ); - } - } - if (candidates.size() > 0) - cell = Random.element(candidates); - else { - delay = BLINK_DELAY; - return; - } - } - - ScrollOfTeleportation.appear( this, cell ); - - delay = BLINK_DELAY; - } - - private static final HashSet> RESISTANCES = new HashSet>(); - - static { - RESISTANCES.add(Poison.class); - } - - @Override - public HashSet> resistances() { - return RESISTANCES; - } - - private static final HashSet> IMMUNITIES = new HashSet>(); - - static { - IMMUNITIES.add(Roots.class); - } - - @Override - public HashSet> immunities() { - return IMMUNITIES; - } - - public static SpiderJumper spawnAt(int pos) { - - SpiderJumper b = new SpiderJumper(); - - b.pos = pos; - b.state = b.HUNTING; - GameScene.add(b, SPAWN_DELAY); - - return b; - - } - } - public static class SpiderGold extends SpiderWorker { - - { - spriteClass = SpiderGoldSprite.class; - - HP = HT = 300; - evadeSkill = 5; - baseSpeed = 0.75f; - - properties.add(Property.BEAST); - } - - private static final float SPAWN_DELAY = 1f; - - @Override - public int damageRoll() { - return Random.NormalIntRange(20, 30+adj(0)); - } - - @Override - public int hitSkill(Char target) { - return 40+adj(0); - } - - @Override - public int drRoll() { - return Random.NormalIntRange(0, 10); - } - - @Override - public boolean act() { - GameScene.add(Blob.seed(pos, 15, ConfusionGas.class)); - return super.act(); - } - - @Override - public int defenseProc(Char enemy, int damage) { - - Buff.affect(this,DefenceUp.class,3f).level(20); - - return super.defenseProc(enemy, damage); - } - - private static final HashSet> RESISTANCES = new HashSet>(); - - static { - RESISTANCES.add(Poison.class); - } - - @Override - public HashSet> resistances() { - return RESISTANCES; - } - - private static final HashSet> IMMUNITIES = new HashSet>(); - - static { - IMMUNITIES.add(ConfusionGas.class); - IMMUNITIES.add(Roots.class); - } - - @Override - public HashSet> immunities() { - return IMMUNITIES; - } - - public static SpiderGold spawnAt(int pos) { - - SpiderGold b = new SpiderGold(); - - b.pos = pos; - b.state = b.HUNTING; - GameScene.add(b, SPAWN_DELAY); - - return b; - - } - } - - -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/Spinner.java b/java/com/hmdzl/spspd/change/actors/mobs/Spinner.java deleted file mode 100644 index 2320aa3f..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/Spinner.java +++ /dev/null @@ -1,130 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs; - -import java.util.HashSet; - -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.Blob; -import com.hmdzl.spspd.change.actors.blobs.Web; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Poison; -import com.hmdzl.spspd.change.actors.buffs.Roots; -import com.hmdzl.spspd.change.actors.buffs.Terror; -import com.hmdzl.spspd.change.items.food.meatfood.MysteryMeat; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.SpinnerSprite; -import com.watabou.utils.Random; - -public class Spinner extends Mob { - - { - spriteClass = SpinnerSprite.class; - - HP = HT = 120+(adj(0)*Random.NormalIntRange(5, 7)); - evadeSkill = 14+adj(1); - - EXP = 9; - maxLvl = 25; - - loot = new MysteryMeat(); - lootChance = 0.15f; - - FLEEING = new Fleeing(); - - properties.add(Property.BEAST); - } - - @Override - public int damageRoll() { - return Random.NormalIntRange(12, 26+adj(0)); - } - - @Override - public int hitSkill(Char target) { - return 20+adj(0); - } - - @Override - public int drRoll() { - return Random.NormalIntRange(6, 10); - } - - @Override - protected boolean act() { - boolean result = super.act(); - - if (state == FLEEING && buff(Terror.class) == null && enemy != null - && enemySeen && enemy.buff(Poison.class) == null) { - state = HUNTING; - } - return result; - } - - @Override - public int attackProc(Char enemy, int damage) { - if (Random.Int(2) == 0) { - Buff.affect(enemy, Poison.class).set( - Random.Int(7, 9) * Poison.durationFactor(enemy)); - state = FLEEING; - } - - return damage; - } - - @Override - public void move(int step) { - if (state == FLEEING) { - GameScene.add(Blob.seed(pos, Random.Int(5, 7), Web.class)); - } - super.move(step); - } - - private static final HashSet> RESISTANCES = new HashSet>(); - - static { - RESISTANCES.add(Poison.class); - } - - @Override - public HashSet> resistances() { - return RESISTANCES; - } - - private static final HashSet> IMMUNITIES = new HashSet>(); - - static { - IMMUNITIES.add(Roots.class); - } - - @Override - public HashSet> immunities() { - return IMMUNITIES; - } - - private class Fleeing extends Mob.Fleeing { - @Override - protected void nowhereToRun() { - if (buff(Terror.class) == null) { - state = HUNTING; - } else { - super.nowhereToRun(); - } - } - } -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/Statue.java b/java/com/hmdzl/spspd/change/actors/mobs/Statue.java deleted file mode 100644 index 72423e25..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/Statue.java +++ /dev/null @@ -1,174 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs; - -import java.util.HashSet; - -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.Journal; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.ToxicGas; -import com.hmdzl.spspd.change.actors.buffs.Poison; -import com.hmdzl.spspd.change.items.Generator; -import com.hmdzl.spspd.change.items.weapon.Weapon; -import com.hmdzl.spspd.change.items.weapon.Weapon.Enchantment; -import com.hmdzl.spspd.change.items.weapon.enchantments.EnchantmentDark; - -import com.hmdzl.spspd.change.items.weapon.melee.MeleeWeapon; -import com.hmdzl.spspd.change.sprites.StatueSprite; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -public class Statue extends Mob { - - { - spriteClass = StatueSprite.class; - - EXP = 50 + Dungeon.depth * 2; - state = PASSIVE; - - properties.add(Property.ELEMENT); - } - - private Weapon weapon; - - public Statue() { - super(); - - do { - weapon = (Weapon) Generator.random(Generator.Category.OLDWEAPON); - } while (!(weapon instanceof MeleeWeapon) || weapon.level < 0); - - weapon.identify(); - weapon.enchant(Enchantment.random()); - - HP = HT = 15 + Dungeon.depth * 5; - evadeSkill = 4 + Dungeon.depth * 2; - } - - private static final String WEAPON = "weapon"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(WEAPON, weapon); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - weapon = (Weapon) bundle.get(WEAPON); - } - - @Override - protected boolean act() { - if (Dungeon.visible[pos]) { - Journal.add(Journal.Feature.STATUE); - } - return super.act(); - } - - @Override - public int damageRoll() { - return Random.NormalIntRange(weapon.MIN, weapon.MAX); - } - - @Override - public int hitSkill(Char target) { - return (int) ((9 + Dungeon.depth) * weapon.ACU); - } - - @Override - protected float attackDelay() { - return weapon.DLY; - } - - @Override - public int drRoll() { - return Random.NormalIntRange(0, Dungeon.depth); - } - - @Override - protected boolean canAttack(Char enemy) { - return Dungeon.level.distance( pos, enemy.pos ) <= weapon.RCH; - } - - @Override - public void damage(int dmg, Object src) { - - if (state == PASSIVE) { - state = HUNTING; - } - - super.damage(dmg, src); - } - - @Override - public int attackProc(Char enemy, int damage) { - weapon.proc(this, enemy, damage); - return damage; - } - - @Override - public void beckon(int cell) { - // Do nothing - } - - @Override - public void die(Object cause) { - Dungeon.level.drop(weapon, pos).sprite.drop(); - super.die(cause); - } - - @Override - public void destroy() { - Journal.remove(Journal.Feature.STATUE); - super.destroy(); - } - - @Override - public boolean reset() { - state = PASSIVE; - return true; - } - - @Override - public String description() { - return Messages.get(this, "desc", weapon.name()); - } - - private static final HashSet> RESISTANCES = new HashSet>(); - private static final HashSet> IMMUNITIES = new HashSet>(); - static { - RESISTANCES.add(ToxicGas.class); - RESISTANCES.add(Poison.class); - RESISTANCES.add(EnchantmentDark.class); - - } - - @Override - public HashSet> resistances() { - return RESISTANCES; - } - - @Override - public HashSet> immunities() { - return IMMUNITIES; - } -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/Succubus.java b/java/com/hmdzl/spspd/change/actors/mobs/Succubus.java deleted file mode 100644 index 43ea89cc..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/Succubus.java +++ /dev/null @@ -1,169 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs; - -import java.util.ArrayList; -import java.util.HashSet; - -import com.hmdzl.spspd.change.actors.buffs.Silent; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfTeleportation; -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Charm; -import com.hmdzl.spspd.change.actors.buffs.Light; -import com.hmdzl.spspd.change.actors.buffs.Sleep; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.food.meatfood.MysteryMeat; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfLullaby; - -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.mechanics.Ballistica; -import com.hmdzl.spspd.change.sprites.SuccubusSprite; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Random; - -public class Succubus extends Mob { - - private static final int BLINK_DELAY = 5; - - private int delay = 0; - - { - spriteClass = SuccubusSprite.class; - - HP = HT = 110+(adj(0)*Random.NormalIntRange(5, 7)); - evadeSkill = 25+adj(1); - viewDistance = Light.DISTANCE; - - EXP = 12; - maxLvl = 35; - - loot = new ScrollOfLullaby(); - lootChance = 0.05f; - - lootOther = new MysteryMeat(); - lootChanceOther = 0.1f; // by default, see die() - - properties.add(Property.DEMONIC); - } - - @Override - public int damageRoll() { - return Random.NormalIntRange(15, 25+adj(0)); - } - - @Override - public int attackProc(Char enemy, int damage) { - - if (Random.Int(3) == 0) { - Buff.affect(enemy, Charm.class, Charm.durationFactor(enemy) - * Random.IntRange(3, 7)).object = id(); - enemy.sprite.centerEmitter().start(Speck.factory(Speck.HEART), - 0.2f, 5); - Sample.INSTANCE.play(Assets.SND_CHARMS); - } - - int reg = Math.min(damage, HT - HP); - - if (reg > 0) { - HP += reg; - sprite.emitter().burst(Speck.factory(Speck.HEALING), 1); - } - - return damage; - } - - @Override - protected boolean getCloser(int target) { - if (Level.fieldOfView[target] && Level.distance(pos, target) > 2 - && delay <= 0 &&(buff(Silent.class) == null) ) { - - blink(target); - spend(-1 / speed()); - return true; - - } else { - - delay--; - return super.getCloser(target); - - } - } - - private void blink(int target) { - - Ballistica route = new Ballistica( pos, target, Ballistica.PROJECTILE); - int cell = route.collisionPos; - - //can't occupy the same cell as another char, so move back one. - if (Actor.findChar( cell ) != null && cell != this.pos) - cell = route.path.get(route.dist-1); - - if (Level.avoid[ cell ]){ - ArrayList candidates = new ArrayList<>(); - for (int n : Level.NEIGHBOURS8) { - cell = route.collisionPos + n; - if (Level.passable[cell] && Actor.findChar( cell ) == null) { - candidates.add( cell ); - } - } - if (candidates.size() > 0) - cell = Random.element(candidates); - else { - delay = BLINK_DELAY; - return; - } - } - - ScrollOfTeleportation.appear( this, cell ); - - delay = BLINK_DELAY; - } - - @Override - public int hitSkill(Char target) { - return 40+adj(1); - } - - @Override - public int drRoll() { - return Random.NormalIntRange(5, 10); - } - - private static final HashSet> RESISTANCES = new HashSet>(); - static { - - } - - @Override - public HashSet> resistances() { - return RESISTANCES; - } - - private static final HashSet> IMMUNITIES = new HashSet>(); - static { - IMMUNITIES.add(Sleep.class); - } - - @Override - public HashSet> immunities() { - return IMMUNITIES; - } -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/Sufferer.java b/java/com/hmdzl/spspd/change/actors/mobs/Sufferer.java deleted file mode 100644 index 81c6b791..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/Sufferer.java +++ /dev/null @@ -1,106 +0,0 @@ - /* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs; - -import java.util.HashSet; - -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.GlassShield; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.hero.HeroClass; -import com.hmdzl.spspd.change.items.StoneOre; -import com.hmdzl.spspd.change.items.Generator; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.Blob; -import com.hmdzl.spspd.change.actors.blobs.TarGas; -import com.hmdzl.spspd.change.actors.buffs.Amok; -import com.hmdzl.spspd.change.actors.buffs.Tar; -import com.hmdzl.spspd.change.actors.buffs.Sleep; -import com.hmdzl.spspd.change.actors.buffs.Terror; -import com.hmdzl.spspd.change.actors.mobs.npcs.Imp; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.GolemSprite; - -import com.hmdzl.spspd.change.sprites.SuffererSprite; -import com.watabou.utils.Random; - -public class Sufferer extends Mob { - - { - spriteClass = SuffererSprite.class; - - HP = HT = 180+(adj(0)*Random.NormalIntRange(4, 7)); - evadeSkill = 16+adj(1); - - EXP = 16; - maxLvl = 35; - - loot = Generator.Category.SCROLL; - lootChance = 0.35f; - - properties.add(Property.DEMONIC); - properties.add(Property.HUMAN); - } - - @Override - public int damageRoll() { - return Random.NormalIntRange(12+adj(0), 40+adj(1)); - } - - @Override - public int hitSkill(Char target) { - return 34+adj(1); - } - - - @Override - public int drRoll() { - return Random.NormalIntRange(0, 10); - } - - @Override - public int defenseProc(Char enemy, int damage) { - - int dmg = damage; - if (dmg > 50 && buff(GlassShield.class) == null) { - Buff.affect(this,GlassShield.class).turns(4); - } - - return super.defenseProc(enemy, damage); - } - - private static final HashSet> RESISTANCES = new HashSet>(); - - @Override - public HashSet> resistances() { - return RESISTANCES; - } - - private static final HashSet> IMMUNITIES = new HashSet>(); - static { - IMMUNITIES.add(Amok.class); - IMMUNITIES.add(Terror.class); - IMMUNITIES.add(Sleep.class); - } - - @Override - public HashSet> immunities() { - return IMMUNITIES; - } -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/Swarm.java b/java/com/hmdzl/spspd/change/actors/mobs/Swarm.java deleted file mode 100644 index f32ec1df..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/Swarm.java +++ /dev/null @@ -1,147 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Burning; -import com.hmdzl.spspd.change.actors.buffs.Poison; -import com.hmdzl.spspd.change.effects.Pushing; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.potions.PotionOfMending; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.Terrain; -import com.hmdzl.spspd.change.levels.features.Door; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.SwarmSprite; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -public class Swarm extends Mob { - - { - spriteClass = SwarmSprite.class; - - HP = HT = 60; - evadeSkill = 5; - - maxLvl = 10; - - flying = true; - - loot = new PotionOfMending(); - //loot = new PotionOfMending(); potential nerf - lootChance = 0.1f; // by default, see die() - - properties.add(Property.BEAST); - } - - private static final float SPLIT_DELAY = 1f; - - int generation = 0; - - private static final String GENERATION = "generation"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(GENERATION, generation); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - generation = bundle.getInt(GENERATION); - } - - @Override - public int damageRoll() { - return Random.NormalIntRange(4, 7); - } - - @Override - public int defenseProc(Char enemy, int damage) { - - if (HP >= damage + 2) { - ArrayList candidates = new ArrayList(); - boolean[] passable = Level.passable; - - int[] neighbours = { pos + 1, pos - 1, pos + Level.getWidth(), - pos - Level.getWidth() }; - for (int n : neighbours) { - if (passable[n] && Actor.findChar(n) == null) { - candidates.add(n); - } - } - - if (candidates.size() > 0) { - - Swarm clone = split(); - clone.HP = (HP - damage) / 2; - clone.pos = Random.element(candidates); - clone.state = clone.HUNTING; - - if (Dungeon.level.map[clone.pos] == Terrain.DOOR) { - Door.enter(clone.pos); - } - - GameScene.add(clone, SPLIT_DELAY); - Actor.addDelayed(new Pushing(clone, pos, clone.pos), -1); - - HP -= clone.HP; - } - } - - return damage; - } - - @Override - public int hitSkill(Char target) { - return 10; - } - - private Swarm split() { - Swarm clone = new Swarm(); - clone.generation = generation + 1; - if (buff(Burning.class) != null) { - Buff.affect(clone, Burning.class).reignite(clone); - } - if (buff(Poison.class) != null) { - Buff.affect(clone, Poison.class).set(2); - } - return clone; - } - - @Override - public void die(Object cause) { - // sets drop chance - lootChance = 0.5f / (5 / (generation + 1)); - super.die(cause); - } - - @Override - protected Item createLoot() { - return super.createLoot(); - } - -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/Tank.java b/java/com/hmdzl/spspd/change/actors/mobs/Tank.java deleted file mode 100644 index c8ad2c49..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/Tank.java +++ /dev/null @@ -1,279 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs; - -import java.util.ArrayList; -import java.util.HashSet; - -import com.hmdzl.spspd.change.actors.buffs.ArmorBreak; -import com.hmdzl.spspd.change.actors.buffs.AttackDown; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Burning; -import com.hmdzl.spspd.change.actors.buffs.Locked; -import com.hmdzl.spspd.change.actors.buffs.Silent; -import com.hmdzl.spspd.change.actors.buffs.Vertigo; -import com.hmdzl.spspd.change.items.ArmorKit; -import com.hmdzl.spspd.change.items.TenguKey; -import com.hmdzl.spspd.change.items.armor.Armor; -import com.hmdzl.spspd.change.items.artifacts.DriedRose; -import com.hmdzl.spspd.change.items.artifacts.MasterThievesArmband; -import com.hmdzl.spspd.change.items.potions.PotionOfToxicGas; -import com.hmdzl.spspd.change.items.wands.WandOfFlow; -import com.hmdzl.spspd.change.items.wands.WandOfLight; -import com.hmdzl.spspd.change.items.weapon.enchantments.EnchantmentLight; -import com.hmdzl.spspd.change.levels.PrisonBossLevel; -import com.hmdzl.spspd.change.levels.traps.PoisonTrap; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.ToxicGas; -import com.hmdzl.spspd.change.actors.buffs.Poison; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.TomeOfMastery; -import com.hmdzl.spspd.change.items.journalpages.Sokoban2; -import com.hmdzl.spspd.change.items.keys.SkeletonKey; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfMagicMapping; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfPsionicBlast; -import com.hmdzl.spspd.change.items.weapon.enchantments.EnchantmentDark; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.Terrain; -import com.hmdzl.spspd.change.mechanics.Ballistica; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ErrorSprite; -import com.hmdzl.spspd.change.sprites.TankSprite; -import com.hmdzl.spspd.change.sprites.TenguSprite; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.Camera; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Random; - -public class Tank extends Mob { - - private static final int JUMP_DELAY = 20; - - { - spriteClass = TankSprite.class; - - HP = HT = 1000; - EXP = 40; - evadeSkill = 5; - viewDistance = 4; - - properties.add(Property.UNDEAD); - properties.add(Property.BOSS); - - loot = new DriedRose().identify(); - lootChance = 0.2f; - - lootOther = new PotionOfToxicGas(); - lootChanceOther = 1f; // by default, see die() - - } - - private int timeToJump = JUMP_DELAY; - private boolean rock = true; - - @Override - public int damageRoll() { - return Random.NormalIntRange(40, 65); - } - - @Override - public int hitSkill(Char target) { - return 60; - } - - @Override - public int drRoll() { - return 0; - } - - @Override - protected float attackDelay() { - return 3f; - } - - @Override - public void die(Object cause) { - yell(Messages.get(this,"die")); - - GameScene.bossSlain(); - - Badges.validateBossSlain(); - - ((PrisonBossLevel) Dungeon.level).unseal(); - - - Dungeon.level.drop(new ArmorKit(), pos).sprite.drop(); - - Dungeon.level.drop(new Sokoban2(), pos).sprite.drop(); - Dungeon.level.drop(new SkeletonKey(Dungeon.depth), pos).sprite.drop(); - Dungeon.level.drop(new TenguKey(), pos).sprite.drop(); - - super.die(cause); - } - - @Override - public boolean act() { - Dungeon.level.updateFieldOfView( this ); - timeToJump--; - if (timeToJump == 0 ) { - jump(); - rock=false; - } - if (!rock&& timeToJump > 5 && timeToJump < 15 && state == HUNTING && - paralysed <= 0 && - enemy != null && - enemy.invisible == 0 && - Level.fieldOfView[enemy.pos] && - Level.distance( pos, enemy.pos ) < 5 && !Level.adjacent( pos, enemy.pos ) && - Random.Int(3) == 0 && HP > 0 ) { - rockattack(); - } - - return super.act(); - } - - @Override - public void move(int step) { - super.move(step); - - int[] cells = { step - 1, step + 1, step - Level.getWidth(), - step + Level.getWidth(), step - 1 - Level.getWidth(), - step - 1 + Level.getWidth(), step + 1 - Level.getWidth(), - step + 1 + Level.getWidth() }; - int cell = cells[Random.Int(cells.length)]; - - if (Dungeon.visible[cell]) { - CellEmitter.get(cell).start(Speck.factory(Speck.ROCK), 0.07f, 10); - Camera.main.shake(3, 0.7f); - Sample.INSTANCE.play(Assets.SND_ROCKS); - } - - Char ch = Actor.findChar(cell); - if (ch != null && ch != this) { - Buff.prolong(ch, Vertigo.class, 2f); - } - } - - @Override - public int attackProc(Char enemy, int damage) { - int oppositeDefender = enemy.pos + (enemy.pos - pos); - Ballistica trajectory = new Ballistica(enemy.pos, oppositeDefender, Ballistica.MAGIC_BOLT); - WandOfFlow.throwChar(enemy, trajectory, 1); - Buff.affect(enemy, Vertigo.class,3f); - return damage; - } - - private void jump() { - timeToJump = JUMP_DELAY; - int heropos = Dungeon.hero.pos; - ArrayList candidates = new ArrayList(); - boolean[] passable = Level.passable; - int[] heroneighbours = {heropos - 1, heropos + 1, heropos - Level.getWidth(), - heropos + Level.getWidth(), heropos - 1 - Level.getWidth(), - heropos - 1 + Level.getWidth(), heropos + 1 - Level.getWidth(), - heropos + 1 + Level.getWidth()}; - for (int n : heroneighbours) { - if (passable[n] && Actor.findChar(n) == null) { - candidates.add(n); - } - - if (candidates.size() > 0) { - int newPos; - newPos = Random.element(candidates); - sprite.move(pos, newPos); - move(newPos); - - - for (int n2 : Level.NEIGHBOURS8) { - int blockpos = newPos + n2; - if (blockpos > 0 && Dungeon.level.map[blockpos] == Terrain.WALL) { - Level.set(blockpos, Terrain.EMBERS); - GameScene.updateMap(blockpos); - } - } - - } - } - spend(2f); - } - - private void rockattack() { - rock = true; - int heropos = Dungeon.hero.pos; - ArrayList candidates = new ArrayList(); - boolean[] passable = Level.passable; - - int[] heroneighbours2 = { heropos + 1, heropos - 1, heropos + Level.getWidth(), - heropos - Level.getWidth() }; - for (int n : heroneighbours2) { - if (passable[n] && Actor.findChar(n) == null) { - candidates.add(n); - } - } - if (candidates.size() > 0) { - int rockpos; - rockpos = Random.element(candidates); - - Level.set(rockpos, Terrain.WALL); - GameScene.updateMap(rockpos); - - for (int n : Level.NEIGHBOURS8) { - Char ch = Actor.findChar(n+rockpos); - if (ch != null && ch.isAlive()) { - ch.damage(15,this); - } - } - } - - GLog.n(Messages.get(Tank.class,"rock")); - } - - @Override - public void notice() { - super.notice(); - yell(Messages.get(this, "notice")); - } - - private static final HashSet> RESISTANCES = new HashSet>(); - private static final HashSet> WEAKNESS = new HashSet>(); - static { - WEAKNESS.add(WandOfLight.class); - WEAKNESS.add(EnchantmentLight.class); - - RESISTANCES.add(ToxicGas.class); - RESISTANCES.add(Poison.class); - RESISTANCES.add(EnchantmentDark.class); - - } - - @Override - public HashSet> resistances() { - return RESISTANCES; - } - - @Override - public HashSet> weakness() { - return WEAKNESS; - } -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/Tengu.java b/java/com/hmdzl/spspd/change/actors/mobs/Tengu.java deleted file mode 100644 index f6d7c663..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/Tengu.java +++ /dev/null @@ -1,225 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs; - -import java.util.HashSet; - -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Burning; -import com.hmdzl.spspd.change.actors.buffs.Locked; -import com.hmdzl.spspd.change.actors.buffs.Silent; -import com.hmdzl.spspd.change.items.ArmorKit; -import com.hmdzl.spspd.change.items.TenguKey; -import com.hmdzl.spspd.change.items.artifacts.MasterThievesArmband; -import com.hmdzl.spspd.change.items.wands.WandOfLight; -import com.hmdzl.spspd.change.items.weapon.enchantments.EnchantmentLight; -import com.hmdzl.spspd.change.items.weapon.missiles.HugeShuriken; -import com.hmdzl.spspd.change.levels.PrisonBossLevel; -import com.hmdzl.spspd.change.levels.traps.PoisonTrap; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.ToxicGas; -import com.hmdzl.spspd.change.actors.buffs.Poison; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.TomeOfMastery; -import com.hmdzl.spspd.change.items.journalpages.Sokoban2; -import com.hmdzl.spspd.change.items.keys.SkeletonKey; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfMagicMapping; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfPsionicBlast; -import com.hmdzl.spspd.change.items.weapon.enchantments.EnchantmentDark; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.Terrain; -import com.hmdzl.spspd.change.mechanics.Ballistica; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.TenguSprite; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Random; - -public class Tengu extends Mob { - - private static final int JUMP_DELAY = 5; - - { - spriteClass = TenguSprite.class; - - HP = HT = 600; - EXP = 40; - evadeSkill = 30; - viewDistance = 5; - - properties.add(Property.HUMAN); - properties.add(Property.BOSS); - - loot = new MasterThievesArmband().identify(); - lootChance = 0.2f; - - lootOther = new HugeShuriken(20); - lootChanceOther = 1f; // by default, see die() - - } - - private int timeToJump = JUMP_DELAY; - - - @Override - public int damageRoll() { - return Random.NormalIntRange(23, 35); - } - - @Override - public int hitSkill(Char target) { - return 40; - } - - @Override - public int drRoll() { - return Random.NormalIntRange(0, 5); - } - - @Override - public void die(Object cause) { - yell(Messages.get(this,"die")); - GameScene.bossSlain(); - Badges.validateBossSlain(); - ((PrisonBossLevel) Dungeon.level).unseal(); - Dungeon.level.drop(new ArmorKit(), pos).sprite.drop(); - Dungeon.level.drop(new Sokoban2(), pos).sprite.drop(); - Dungeon.level.drop(new SkeletonKey(Dungeon.depth), pos).sprite.drop(); - Dungeon.level.drop(new TenguKey(), pos).sprite.drop(); - super.die(cause); - } - - @Override - protected boolean getCloser(int target) { - if (Level.fieldOfView[target]) { - jump(); - return true; - } else { - return super.getCloser(target); - } - } - - @Override - protected boolean canAttack(Char enemy) { - if (buff(Locked.class) != null){ - return Level.adjacent(pos, enemy.pos) && (!isCharmedBy(enemy)); - } else - return new Ballistica( pos, enemy.pos, Ballistica.PROJECTILE).collisionPos == enemy.pos; - } - - @Override - protected boolean doAttack(Char enemy) { - timeToJump--; - if (timeToJump <= 0 && Level.adjacent(pos, enemy.pos)) { - jump(); - return true; - } else { - return super.doAttack(enemy); - } - } - - @Override - public int attackProc(Char enemy, int damage) { - - if (Level.distance(pos, enemy.pos) == 1 ) { - Buff.affect(enemy,Silent.class,.5f); - timeToJump--; - } - - if (Level.distance(pos, enemy.pos) > 1 && Random.Int(10) > 7){ - Buff.affect(enemy, Locked.class,5f); - timeToJump++; - } - - if (Level.distance(pos, enemy.pos) > 1 && Random.Int(10) > 9){ - Buff.affect(enemy, Burning.class).reignite(enemy); - timeToJump++; - } - - return damage; - } - - private void jump() { - timeToJump = JUMP_DELAY; - - for (int i = 0; i < 3; i++) { - int trapPos; - do { - trapPos = Random.Int(Level.getLength()); - } while (!Level.fieldOfView[trapPos] || !Level.passable[trapPos]); - - if (Dungeon.level.map[trapPos] == Terrain.INACTIVE_TRAP) { - Dungeon.level.setTrap( new PoisonTrap().reveal(), trapPos ); - Level.set(trapPos, Terrain.TRAP); - GameScene.updateMap(trapPos); - ScrollOfMagicMapping.discover(trapPos); - } - } - - int newPos; - do { - newPos = Random.Int(Level.getLength()); - } while (!Level.fieldOfView[newPos] || !Level.passable[newPos] - || Level.adjacent(newPos, enemy.pos) - || Actor.findChar(newPos) != null); - - sprite.move(pos, newPos); - move(newPos); - - if (Dungeon.visible[newPos]) { - CellEmitter.get(newPos).burst(Speck.factory(Speck.WOOL), 6); - Sample.INSTANCE.play(Assets.SND_PUFF); - } - - spend(1 / speed()); - } - - @Override - public void notice() { - super.notice(); - yell(Messages.get(this, "notice", Dungeon.hero.givenName())); - } - - private static final HashSet> RESISTANCES = new HashSet>(); - private static final HashSet> WEAKNESS = new HashSet>(); - static { - WEAKNESS.add(WandOfLight.class); - WEAKNESS.add(EnchantmentLight.class); - - RESISTANCES.add(Burning.class); - RESISTANCES.add(ToxicGas.class); - RESISTANCES.add(Poison.class); - RESISTANCES.add(EnchantmentDark.class); - - } - - @Override - public HashSet> resistances() { - return RESISTANCES; - } - - @Override - public HashSet> weakness() { - return WEAKNESS; - } -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/TenguDen.java b/java/com/hmdzl/spspd/change/actors/mobs/TenguDen.java deleted file mode 100644 index b7defb45..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/TenguDen.java +++ /dev/null @@ -1,210 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs; - -import java.util.HashSet; - -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Burning; -import com.hmdzl.spspd.change.actors.buffs.Locked; -import com.hmdzl.spspd.change.actors.buffs.Paralysis; -import com.hmdzl.spspd.change.actors.buffs.Slow; -import com.hmdzl.spspd.change.effects.particles.FlameParticle; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.ToxicGas; -import com.hmdzl.spspd.change.actors.buffs.Poison; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.AdamantRing; -import com.hmdzl.spspd.change.items.Gold; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfPsionicBlast; -import com.hmdzl.spspd.change.items.weapon.enchantments.EnchantmentDark; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.mechanics.Ballistica; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.TenguSprite; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Random; - -public class TenguDen extends Mob { - - private static final int JUMP_DELAY = 5; - protected static final float SPAWN_DELAY = 2f; - - { - spriteClass = TenguSprite.class; - baseSpeed = 2f; - - HP = HT = 2000; - EXP = 20; - evadeSkill = 30; - - properties.add(Property.HUMAN); - properties.add(Property.BOSS); - } - - private int timeToJump = JUMP_DELAY; - - - @Override - public int damageRoll() { - return Random.NormalIntRange(15, 25); - } - - @Override - public int hitSkill(Char target) { - return 28; - } - - @Override - public int drRoll() { - return Random.NormalIntRange(10, 20); - } - - - - - @Override - public void die(Object cause) { - - super.die(cause); - - GameScene.bossSlain(); - Dungeon.tengudenkilled=true; - yell(Messages.get(this,"die")); - - Dungeon.level.drop(new AdamantRing(), pos).sprite.drop(); - Dungeon.level.drop(new Gold(Random.Int(1900, 4000)), pos).sprite.drop(); - - } - - @Override - protected boolean getCloser(int target) { - if (Level.fieldOfView[target]) { - jump(); - return true; - } else { - return super.getCloser(target); - } - } - - @Override - protected boolean canAttack(Char enemy) { - if (buff(Locked.class) != null){ - return Level.adjacent(pos, enemy.pos) && (!isCharmedBy(enemy)); - } else - return new Ballistica( pos, enemy.pos, Ballistica.PROJECTILE).collisionPos == enemy.pos; - } - - @Override - protected boolean doAttack(Char enemy) { - timeToJump--; - if (timeToJump <= 0 ) { - jump(); - return true; - } else { - return super.doAttack(enemy); - } - } - - @Override - public int attackProc(Char enemy, int damage) { - if(Random.Int(15)==0){ - Buff.affect(enemy, Burning.class).reignite(enemy); - enemy.sprite.emitter().burst(FlameParticle.FACTORY, 5); - } - if(Random.Int(20)==0){ - Buff.affect(enemy, Slow.class, Slow.duration(enemy) / 2); - } - - if(Random.Int(30)==0){ - Buff.prolong(enemy, Paralysis.class, 2f); - } - - return damage; - } - - - private void jump() { - timeToJump = JUMP_DELAY; - - int newPos; - do { - newPos = Random.Int(Level.getLength()); - } while (!Level.passable[newPos] - || Level.adjacent(newPos, Dungeon.hero.pos) - || Actor.findChar(newPos) != null); - - sprite.move(pos, newPos); - move(newPos); - - if (Dungeon.visible[newPos]) { - CellEmitter.get(newPos).burst(Speck.factory(Speck.WOOL), 6); - Sample.INSTANCE.play(Assets.SND_PUFF); - } - - spend(1 / speed()); - - if (Dungeon.level.mobs.size()<7){ - Assassin.spawnAt(pos); - } - - - } - - public static TenguDen spawnAt(int pos) { - if (Level.passable[pos] && Actor.findChar(pos) == null) { - - TenguDen w = new TenguDen(); - w.pos = pos; - w.state = w.HUNTING; - GameScene.add(w, SPAWN_DELAY); - - //w.sprite.alpha(0); - //w.sprite.parent.add(new AlphaTweener(w.sprite, 1, 0.5f)); - - return w; - - } else { - return null; - } - } - - @Override - public void notice() { - super.notice(); - yell(Messages.get(this,"notice")); - } - - private static final HashSet> RESISTANCES = new HashSet>(); - static { - RESISTANCES.add(ToxicGas.class); - RESISTANCES.add(Poison.class); - RESISTANCES.add(EnchantmentDark.class); - - } - - @Override - public HashSet> resistances() { - return RESISTANCES; - } -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/TestMob.java b/java/com/hmdzl/spspd/change/actors/mobs/TestMob.java deleted file mode 100644 index 9b92d0ef..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/TestMob.java +++ /dev/null @@ -1,152 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs; - -import com.hmdzl.spspd.change.actors.blobs.ToxicGas; -import com.hmdzl.spspd.change.actors.buffs.Amok; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Burning; -import com.hmdzl.spspd.change.actors.buffs.Charm; -import com.hmdzl.spspd.change.actors.buffs.Levitation; -import com.hmdzl.spspd.change.actors.buffs.ShieldArmor; -import com.hmdzl.spspd.change.actors.buffs.Sleep; -import com.hmdzl.spspd.change.actors.buffs.Terror; -import com.hmdzl.spspd.change.actors.buffs.Vertigo; -import com.hmdzl.spspd.change.items.bags.HeartOfScarecrow; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfPsionicBlast; -import com.hmdzl.spspd.change.items.wands.WandOfFirebolt; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.items.weapon.enchantments.EnchantmentDark; -import com.hmdzl.spspd.change.sprites.ScarecrowSprite; -import com.watabou.utils.Bundle; - -import java.util.HashSet; - -public class TestMob extends Mob { - - - private boolean skill = false; - - { - spriteClass = ScarecrowSprite.class; - - HP = HT = 100000; - evadeSkill = 0; - - state = PASSIVE; - - properties.add(Property.PLANT); - } - - - @Override - public boolean act() { - //if( HP < HT && skill == false ) { - //Buff.affect(this,AttackUp.class,5f).level(20); - //Buff.affect(this,DefenceUp.class,5f).level(80); - // skill = true; - // } - return super.act(); - } - - @Override - public void damage(int dmg, Object src) { - - super.damage(dmg, src); - //if (dmg >5) Buff.affect(this,ShieldArmor.class).level(20); - //Buff.prolong(this,Levitation.class,10f); - } - - @Override - public int damageRoll() { - return 1; - } - - @Override - public int hitSkill(Char target) { - return 100; - } - - @Override - public int drRoll() { - return 0; - } - - - @Override - public void beckon(int cell) { - // Do nothing - } - - @Override - public void die(Object cause) { - super.die(cause); - if (!Dungeon.limitedDrops.heartScarecrow.dropped()) { - Dungeon.limitedDrops.heartScarecrow.drop(); - Dungeon.level.drop(new HeartOfScarecrow(), pos).sprite.drop(); - explodeDew(pos); - } - - } - - private static final HashSet> RESISTANCES = new HashSet>(); - private static final HashSet> WEAKNESS = new HashSet>(); - private static final HashSet> IMMUNITIES = new HashSet>(); - static { - WEAKNESS.add(Burning.class); - WEAKNESS.add(WandOfFirebolt.class); - //WEAKNESS.add(TestWeapon.class); - IMMUNITIES.add(Terror.class); - IMMUNITIES.add(Amok.class); - IMMUNITIES.add(Charm.class); - IMMUNITIES.add(Sleep.class); - IMMUNITIES.add(Vertigo.class); - } - - @Override - public HashSet> resistances() { - return RESISTANCES; - } - - @Override - public HashSet> weakness() { - return WEAKNESS; - } - - @Override - public HashSet> immunities() { - return IMMUNITIES; - } - - - private final String SKILL = "skill"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(SKILL, skill); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - skill = bundle.getBoolean(SKILL); - } - -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/TestMob2.java b/java/com/hmdzl/spspd/change/actors/mobs/TestMob2.java deleted file mode 100644 index e95d0269..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/TestMob2.java +++ /dev/null @@ -1,154 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs; - -import com.hmdzl.spspd.change.actors.blobs.ElectriShock; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Burning; -import com.hmdzl.spspd.change.actors.buffs.Levitation; -import com.hmdzl.spspd.change.actors.buffs.Locked; -import com.hmdzl.spspd.change.actors.buffs.Shocked; -import com.hmdzl.spspd.change.actors.buffs.Silent; -import com.hmdzl.spspd.change.items.bags.HeartOfScarecrow; -import com.hmdzl.spspd.change.items.wands.WandOfLightning; -import com.hmdzl.spspd.change.items.weapon.enchantments.EnchantmentShock; -import com.hmdzl.spspd.change.items.weapon.enchantments.EnchantmentShock2; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.mechanics.Ballistica; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.sprites.ScarecrowSprite; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -import java.util.HashSet; - -public class TestMob2 extends Mob { - - - private boolean skill = false; - - { - spriteClass = ScarecrowSprite.class; - - HP = HT = 100000; - evadeSkill = 0; - - state = PASSIVE; - - properties.add(Property.MECH); - } - - - @Override - public boolean act() { - //if( HP < HT && skill == false ) { - //Buff.affect(this,AttackUp.class,5f).level(20); - //Buff.affect(this,DefenceUp.class,5f).level(80); - // skill = true; - // } - return super.act(); - } - - @Override - public void damage(int dmg, Object src) { - - if (state == PASSIVE) { - state = HUNTING; - } - super.damage(dmg, src); - //Buff.prolong(this,Levitation.class,10f); - //Buff.prolong(this,ArmorBreak.class,10f).level(50); - } - - @Override - public int attackProc(Char enemy, int damage) { - Buff.prolong(enemy,Shocked.class,2f); - return damage; - } - - @Override - public int damageRoll() { - return 5; - } - - @Override - public int hitSkill(Char target) { - return 100; - } - - @Override - public int drRoll() { - return 0; - } - - @Override - protected boolean canAttack(Char enemy) { - if (buff(Locked.class) != null){ - return Level.adjacent(pos, enemy.pos) && (!isCharmedBy(enemy)); - } else - return new Ballistica( pos, enemy.pos, Ballistica.PROJECTILE).collisionPos == enemy.pos; - } - - @Override - public void die(Object cause) { - super.die(cause); - - if (!Dungeon.limitedDrops.heartScarecrow.dropped()) { - Dungeon.limitedDrops.heartScarecrow.drop(); - Dungeon.level.drop(new HeartOfScarecrow(), pos).sprite.drop(); - explodeDew(pos); - } - - } - - private static final HashSet> RESISTANCES = new HashSet>(); - private static final HashSet> WEAKNESS = new HashSet>(); - static { - WEAKNESS.add(ElectriShock.class); - WEAKNESS.add(WandOfLightning.class); - WEAKNESS.add(EnchantmentShock.class); - WEAKNESS.add(EnchantmentShock2.class); - } - - @Override - public HashSet> resistances() { - return RESISTANCES; - } - - @Override - public HashSet> weakness() { - return WEAKNESS; - } - - - private final String SKILL = "skill"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(SKILL, skill); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - skill = bundle.getBoolean(SKILL); - } - -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/Thief.java b/java/com/hmdzl/spspd/change/actors/mobs/Thief.java deleted file mode 100644 index 9fbf687c..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/Thief.java +++ /dev/null @@ -1,130 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs; - -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Locked; -import com.hmdzl.spspd.change.items.food.vegetable.NutVegetable; -import com.hmdzl.spspd.change.items.food.vegetable.Vegetable; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Terror; -import com.hmdzl.spspd.change.items.Generator; -import com.hmdzl.spspd.change.items.Gold; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.hmdzl.spspd.change.sprites.ThiefSprite; -import com.watabou.utils.Random; - -public class Thief extends Mob { - - public Item item; - - { - spriteClass = ThiefSprite.class; - - HP = HT = 80+(adj(0)*Random.NormalIntRange(3, 5)); - evadeSkill = 8+adj(0); - - EXP = 5; - maxLvl = 20; - - loot = new NutVegetable(); - lootChance = 0.1f; - - lootOther = Generator.Category.BERRY; - lootChanceOther = 0.05f; // by default, see die() - - FLEEING = new Fleeing(); - - properties.add(Property.ELF); - } - - @Override - public int damageRoll() { - return Random.NormalIntRange(1, 7+adj(0)); - } - - @Override - protected float attackDelay() { - return 0.5f; - } - - @Override - protected boolean act() { - boolean result = super.act(); - - if (state == FLEEING && buff(Terror.class) == null && enemy != null - && enemySeen && enemy.buff(Locked.class) == null) { - state = HUNTING; - } - return result; - } - - @Override - public void die(Object cause) { - super.die(cause); - } - - @Override - protected Item createLoot() { - return super.createLoot(); - } - - @Override - public int hitSkill(Char target) { - return 12; - } - - @Override - public int drRoll() { - return Random.NormalIntRange(0, 3); - } - - @Override - public int attackProc(Char enemy, int damage) { - if (Random.Int(5) == 0) { - Buff.affect(enemy, Locked.class,20f); - state = FLEEING; - } - - return damage; - } - - @Override - public int defenseProc(Char enemy, int damage) { - if (state == FLEEING) { - Dungeon.level.drop(new Gold(), pos).sprite.drop(); - } - - return damage; - } - - private class Fleeing extends Mob.Fleeing { - @Override - protected void nowhereToRun() { - if (buff(Terror.class) == null) { - sprite.showStatus(CharSprite.NEGATIVE, Messages.get(Mob.class, "rage")); - state = HUNTING; - } else { - super.nowhereToRun(); - } - } - } -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/ThiefImp.java b/java/com/hmdzl/spspd/change/actors/mobs/ThiefImp.java deleted file mode 100644 index d6418b25..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/ThiefImp.java +++ /dev/null @@ -1,173 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs; - -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Terror; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.items.Generator; -import com.hmdzl.spspd.change.items.Gold; -import com.hmdzl.spspd.change.items.summon.Honeypot; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.hmdzl.spspd.change.sprites.ThiefImpSprite; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -public class ThiefImp extends Mob { - - protected static final String TXT_STOLE = "%s stole %s from you!"; - protected static final String TXT_CARRIES = "\n\n%s is carrying a _%s_. Stolen obviously."; - protected static final String TXT_RATCHECK1 = "Spork is avail"; - protected static final String TXT_RATCHECK2 = "Spork is not avail"; - - public Item item; - - { - spriteClass = ThiefImpSprite.class; - - HP = HT = 200+(adj(0)*Random.NormalIntRange(4, 7)); - evadeSkill = 20+adj(1); - - EXP = 13; - maxLvl = 35; - - flying = true; - - loot = Generator.Category.BERRY; - lootChance = 0.05f; - - FLEEING = new Fleeing(); - - properties.add(Property.DEMONIC); - } - - private static final String ITEM = "item"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(ITEM, item); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - item = (Item) bundle.get(ITEM); - } - - @Override - public int damageRoll() { - return Random.NormalIntRange(15, 25+adj(0)); - } - - - @Override - public void die(Object cause) { - - super.die(cause); - - if (item != null) { - Dungeon.level.drop(item, pos).sprite.drop(); - } - } - - @Override - protected Item createLoot() { - return new Gold(Random.NormalIntRange(100, 250)); - } - - @Override - public int hitSkill(Char target) { - return 30+adj(0); - } - - @Override - public int drRoll() { - return Random.NormalIntRange(10, 20); - } - - @Override - public int attackProc(Char enemy, int damage) { - if (item == null && enemy instanceof Hero && steal((Hero) enemy)) { - state = FLEEING; - } - - return damage; - } - - @Override - public int defenseProc(Char enemy, int damage) { - if (state == FLEEING) { - Dungeon.level.drop(new Gold(), pos).sprite.drop(); - } - - return damage; - } - - protected boolean steal(Hero hero) { - - Item item = hero.belongings.randomUnequipped(); - - if (item != null && !item.unique && item.level < 1 ) { - - Dungeon.quickslot.clearItem( item ); - item.updateQuickslot(); - GLog.w(Messages.get(ThiefImp.class, "stole", item.name())); - - if (item instanceof Honeypot) { - this.item = ((Honeypot) item).shatter(this, this.pos); - item.detach(hero.belongings.backpack); - } else { - this.item = item.detach( hero.belongings.backpack ); - if (item instanceof Honeypot.ShatteredPot) - ((Honeypot.ShatteredPot) item).setHolder(this); - } - - return true; - } else { - return false; - } - } - - @Override - public String description() { - String desc = super.description(); - - if (item != null) { - desc += Messages.get(this, "carries", item.name() ); - } - - return desc; - } - - private class Fleeing extends Mob.Fleeing { - @Override - protected void nowhereToRun() { - if (buff(Terror.class) == null) { - sprite.showStatus(CharSprite.NEGATIVE, Messages.get(Mob.class, "rage")); - state = HUNTING; - } else { - super.nowhereToRun(); - } - } - } -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/ThiefKing.java b/java/com/hmdzl/spspd/change/actors/mobs/ThiefKing.java deleted file mode 100644 index 796a2a5f..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/ThiefKing.java +++ /dev/null @@ -1,116 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs; - -import java.util.HashSet; - -import com.hmdzl.spspd.change.actors.buffs.Locked; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.items.AdamantRing; -import com.hmdzl.spspd.change.items.Generator; -import com.hmdzl.spspd.change.items.Gold; -import com.hmdzl.spspd.change.levels.traps.LightningTrap; -import com.hmdzl.spspd.change.mechanics.Ballistica; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ThiefKingSprite; -import com.watabou.utils.Callback; -import com.watabou.utils.Random; - -public class ThiefKing extends Mob implements Callback { - - - { - spriteClass = ThiefKingSprite.class; - - HP = HT = 2000; - evadeSkill = 28; - - EXP = 60; - flying = true; - - loot = Generator.Category.SCROLL; - lootChance = 1f; - - properties.add(Property.ELF); - properties.add(Property.BOSS); - } - - @Override - public int damageRoll() { - return Random.NormalIntRange(20, 70); - } - - @Override - public int hitSkill(Char target) { - return 25; - } - - @Override - public int drRoll() { - return Random.NormalIntRange(6, 14); - } - - @Override - protected boolean canAttack(Char enemy) { - if (buff(Locked.class) != null){ - return Level.adjacent(pos, enemy.pos) && (!isCharmedBy(enemy)); - } else - return new Ballistica( pos, enemy.pos, Ballistica.PROJECTILE).collisionPos == enemy.pos; - } - - @Override - public void die(Object cause) { - - super.die(cause); - - GameScene.bossSlain(); - Dungeon.level.drop(new AdamantRing(), pos).sprite.drop(); - Dungeon.level.drop(new Gold(Random.Int(1900, 4000)), pos).sprite.drop(); - - - Dungeon.banditkingkilled=true; - - yell(Messages.get(this,"die")); - - } - - - @Override - public void call() { - next(); - } - - @Override - public void notice() { - super.notice(); - yell(Messages.get(this,"notice",Dungeon.hero.givenName())); - } - - private static final HashSet> RESISTANCES = new HashSet>(); - static { - RESISTANCES.add(LightningTrap.Electricity.class); - } - - @Override - public HashSet> resistances() { - return RESISTANCES; - } -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/TrollWarrior.java b/java/com/hmdzl/spspd/change/actors/mobs/TrollWarrior.java deleted file mode 100644 index eff25fbb..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/TrollWarrior.java +++ /dev/null @@ -1,122 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs; - -import java.util.HashSet; - -import com.hmdzl.spspd.change.Statistics; -import com.hmdzl.spspd.change.actors.buffs.AttackUp; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.DefenceUp; -import com.hmdzl.spspd.change.items.weapon.enchantments.EnchantmentDark; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.items.StoneOre; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.ToxicGas; -import com.hmdzl.spspd.change.actors.buffs.Poison; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfPsionicBlast; -import com.hmdzl.spspd.change.items.weapon.melee.special.TekkoKagi; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.mechanics.Ballistica; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.AssassinSprite; -import com.hmdzl.spspd.change.sprites.ErrorSprite; -import com.hmdzl.spspd.change.sprites.TrollWarriorSprite; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -public class TrollWarrior extends Mob { - - private boolean endless = false; - - { - spriteClass = TrollWarriorSprite.class; - baseSpeed = 1.2f; - - HP = HT = 80+(5*Random.NormalIntRange(2, 5)); - EXP = 10; - maxLvl = 20; - evadeSkill = 15; - - loot = new StoneOre(); - lootChance = 0.2f; - - properties.add(Property.TROLL); - - } - - @Override - public boolean act() { - if( HP < HT && endless == false ) { - Buff.affect(this,AttackUp.class,8f).level(20); - Buff.affect(this,DefenceUp.class,8f).level(80); - endless = true; - yell(Messages.get(this,"angry"));} - return super.act(); - } - - @Override - public int damageRoll() { - return Random.NormalIntRange(15, 30); - } - - @Override - public int hitSkill(Char target) { - return 30; - } - - @Override - public int drRoll() { - return Random.NormalIntRange(5, 7); - } - @Override - protected float attackDelay() { - return 1.2f; - } - - private static final HashSet> RESISTANCES = new HashSet>(); - static { - RESISTANCES.add(ToxicGas.class); - RESISTANCES.add(Poison.class); - RESISTANCES.add(EnchantmentDark.class); - - } - - @Override - public HashSet> resistances() { - return RESISTANCES; - } - - private final String ENDLESS = "endless"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(ENDLESS, endless); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - endless = bundle.getBoolean(ENDLESS); - } - -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/UAmulet.java b/java/com/hmdzl/spspd/change/actors/mobs/UAmulet.java deleted file mode 100644 index d1dffbef..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/UAmulet.java +++ /dev/null @@ -1,238 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ - -package com.hmdzl.spspd.change.actors.mobs; - -import java.util.HashSet; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.Blob; -import com.hmdzl.spspd.change.actors.blobs.ToxicGas; -import com.hmdzl.spspd.change.actors.buffs.Amok; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Burning; -import com.hmdzl.spspd.change.actors.buffs.Charm; -import com.hmdzl.spspd.change.actors.buffs.MagicalSleep; -import com.hmdzl.spspd.change.actors.buffs.Poison; -import com.hmdzl.spspd.change.actors.buffs.Sleep; -import com.hmdzl.spspd.change.actors.buffs.Terror; -import com.hmdzl.spspd.change.actors.buffs.Vertigo; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.mobs.npcs.NPC; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfPsionicBlast; -import com.hmdzl.spspd.change.items.weapon.enchantments.EnchantmentDark; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.hmdzl.spspd.change.sprites.ErrorSprite; - -import com.hmdzl.spspd.change.sprites.MirrorSprite; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; -import com.hmdzl.spspd.change.actors.blobs.CorruptGas; -import com.hmdzl.spspd.change.actors.buffs.Bleeding; -import com.hmdzl.spspd.change.actors.buffs.Paralysis; -import com.hmdzl.spspd.change.items.Playericon; - -public class UAmulet extends Mob { - - protected static final float SPAWN_DELAY = 2f; - - { - spriteClass = ErrorSprite.class; - baseSpeed = 0.75f; - - HP = HT = 1000; - EXP = 20; - evadeSkill = 5; - - loot = new Playericon(); - lootChance = 1f; - - properties.add(Property.UNKNOW); - properties.add(Property.BOSS); - } - - private int breaks=0; - - @Override - public int damageRoll() { - return Random.NormalIntRange(Dungeon.hero.lvl/2, Dungeon.hero.lvl); - } - - @Override - public int hitSkill(Char target) { - return 100; - } - - @Override - public int drRoll() { - return Random.NormalIntRange(0, 2); - } - - @Override - public float speed() { - if (breaks == 3) return 2*super.speed(); - else return super.speed(); - } - - @Override - public boolean act() { - - if( 3 - breaks > 4 * HP / HT ) { - breaks++; - //DarkMirror.spawnAround(pos); - return true; - } - return super.act(); - } - - private static final String BREAKS = "breaks"; - - @Override - public void storeInBundle( Bundle bundle ) { - super.storeInBundle(bundle); - bundle.put( BREAKS, breaks ); - } - - @Override - public void restoreFromBundle( Bundle bundle ) { - super.restoreFromBundle(bundle); - breaks = bundle.getInt( BREAKS ); - } - - @Override - public void damage(int dmg, Object src) { - - dmg = Random.Int(10,20); - if (dmg > 15){ - GameScene.add(Blob.seed(pos, 30, CorruptGas.class)); - } - super.damage(dmg, src); - } - - @Override - public void die(Object cause) { - - GameScene.bossSlain(); - super.die(cause); - //UYog.spawnAt(pos); - } - - public static UAmulet spawnAt(int pos) { - if (Level.passable[pos] && Actor.findChar(pos) == null) { - - UAmulet w = new UAmulet(); - w.pos = pos; - w.state = w.HUNTING; - GameScene.add(w, SPAWN_DELAY); - - return w; - - } else { - return null; - } - } - - private static final HashSet> RESISTANCES = new HashSet>(); - private static final HashSet> IMMUNITIES = new HashSet>(); - static { - RESISTANCES.add(ToxicGas.class); - RESISTANCES.add(Poison.class); - RESISTANCES.add(EnchantmentDark.class); - IMMUNITIES.add(EnchantmentDark.class); - IMMUNITIES.add(Terror.class); - IMMUNITIES.add(Amok.class); - IMMUNITIES.add(Charm.class); - IMMUNITIES.add(Sleep.class); - IMMUNITIES.add(Burning.class); - IMMUNITIES.add(ToxicGas.class); - IMMUNITIES.add(ScrollOfPsionicBlast.class); - IMMUNITIES.add(Vertigo.class); - IMMUNITIES.add(Paralysis.class); - IMMUNITIES.add(Bleeding.class); - IMMUNITIES.add(CorruptGas.class); - - } - - @Override - public HashSet> immunities() { - return IMMUNITIES; - } - - @Override - public HashSet> resistances() { - return RESISTANCES; - } - - - public static class DarkMirror extends Mob { - - { - //name = "mirror image"; - spriteClass = MirrorSprite.class; - - HP = HT = Dungeon.hero.HT/5; - state = HUNTING; - - properties.add(Property.UNKNOW); - } - - public int tier; - - @Override - public int hitSkill(Char target) { - return 100; - } - - @Override - public int damageRoll() { - return (int)(Dungeon.hero.HT/10); - } - - @Override - public int attackProc(Char enemy, int damage) { - int dmg = super.attackProc(enemy, damage); - return dmg; - } - - public static void spawnAround(int pos) { - for (int n : Level.NEIGHBOURS4) { - int cell = pos + n; - if (Level.passable[cell] && Actor.findChar(cell) == null) { - spawnAt(cell); - } - } - } - - public static DarkMirror spawnAt(int pos) { - - DarkMirror d = new DarkMirror(); - - d.pos = pos; - d.state = d.HUNTING; - GameScene.add(d, 2f); - - return d; - - } - - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/actors/mobs/UDM300.java b/java/com/hmdzl/spspd/change/actors/mobs/UDM300.java deleted file mode 100644 index fefa97d4..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/UDM300.java +++ /dev/null @@ -1,345 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ - -package com.hmdzl.spspd.change.actors.mobs; - -import java.util.HashSet; - -import com.hmdzl.spspd.change.items.bombs.DungeonBomb; -import com.hmdzl.spspd.change.sprites.DM300Sprite; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.Blob; -import com.hmdzl.spspd.change.actors.blobs.ToxicGas; -import com.hmdzl.spspd.change.actors.blobs.ShockWeb; -import com.hmdzl.spspd.change.actors.blobs.FrostGas; -import com.hmdzl.spspd.change.actors.blobs.TarGas; -import com.hmdzl.spspd.change.actors.blobs.DarkGas; -import com.hmdzl.spspd.change.actors.buffs.Amok; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Burning; -import com.hmdzl.spspd.change.actors.buffs.Charm; -import com.hmdzl.spspd.change.actors.buffs.Poison; -import com.hmdzl.spspd.change.actors.buffs.Sleep; -import com.hmdzl.spspd.change.actors.buffs.Terror; -import com.hmdzl.spspd.change.actors.buffs.Vertigo; -import com.hmdzl.spspd.change.items.bombs.Bomb; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfPsionicBlast; -import com.hmdzl.spspd.change.items.weapon.enchantments.EnchantmentDark; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.UDM300Sprite; -import com.watabou.utils.Random; -import com.hmdzl.spspd.change.actors.blobs.CorruptGas; -import com.hmdzl.spspd.change.actors.buffs.Bleeding; -import com.hmdzl.spspd.change.actors.buffs.Tar; -import com.hmdzl.spspd.change.actors.buffs.Paralysis; -import com.hmdzl.spspd.change.sprites.SeekingBombSprite; - -public class UDM300 extends Mob { - - protected static final float SPAWN_DELAY = 2f; - - { - spriteClass = UDM300Sprite.class; - baseSpeed = 0.75f; - - HP = HT = 1000; - EXP = 20; - evadeSkill = 5; - - FLEEING = new Fleeing(); - - properties.add(Property.MECH); - properties.add(Property.BOSS); - } - - private int breaks=0; - private static int CountBomb = 0; - - @Override - public int damageRoll() { - return Random.NormalIntRange(Dungeon.hero.lvl/2, Dungeon.hero.lvl); - } - - @Override - public int hitSkill(Char target) { - return 100; - } - - @Override - public int drRoll() { - return Random.NormalIntRange(0, 2); - } - - @Override - public float speed() { - if (breaks == 3) return 2*super.speed(); - else return super.speed(); - } - - public void spawnBomb() { - SeekBomb bomb1 = new SeekBomb(); - SeekBomb bomb2 = new SeekBomb(); - SeekBomb bomb3 = new SeekBomb(); - SeekBomb bomb4 = new SeekBomb(); - - bomb1.pos = Dungeon.level.randomRespawnCellMob(); - bomb2.pos = Dungeon.level.randomRespawnCellMob(); - bomb3.pos = Dungeon.level.randomRespawnCellMob(); - bomb4.pos = Dungeon.level.randomRespawnCellMob(); - - GameScene.add(bomb1); - GameScene.add(bomb2); - GameScene.add(bomb3); - GameScene.add(bomb4); - } - - @Override - public boolean act() { - - if( 3 - breaks > 4 * HP / HT ) { - - breaks++; - spawnBomb(); - return true; - } - - if (breaks == 1){ - GameScene.add(Blob.seed(pos, 30, FrostGas.class)); - } - - if (breaks == 2){ - GameScene.add(Blob.seed(pos, 60, TarGas.class)); - } - - if (breaks == 3){ - GameScene.add(Blob.seed(pos, 100, DarkGas.class)); - } - - if (state == FLEEING && buff(Terror.class) == null && enemy != null - && enemySeen && (enemy.buff(Poison.class) == null && enemy.buff(Burning.class) == null && enemy.buff(Tar.class) == null)) { - state = HUNTING; - } - - return super.act(); - - } - - @Override - public int attackProc(Char enemy, int damage) { - if (breaks == 0 ){ - if (Random.Int(2) == 0) { - Buff.affect(enemy, Poison.class).set(Random.Int(7, 9) * Poison.durationFactor(enemy)); - state = FLEEING; - } - } - if (breaks == 1 ){ - if (Random.Int(2) == 0) { - Buff.affect(enemy, Tar.class); - state = FLEEING; - } - } - if (breaks == 2 ){ - if (Random.Int(2) == 0) { - Buff.affect(enemy, Burning.class).reignite(enemy); - state = FLEEING; - } - } - - - return damage; - } - - @Override - public void move(int step) { - if (state == FLEEING) { - GameScene.add(Blob.seed(pos, Random.Int(5, 7), ShockWeb.class)); - } - super.move(step); - } - - @Override - public void damage(int dmg, Object src) { - - dmg = Random.Int(10,20); - if (dmg > 15){ - GameScene.add(Blob.seed(pos, 30, CorruptGas.class)); - } - super.damage(dmg, src); - } - - @Override - public int defenseProc(Char enemy, int damage) { - - int dmg = Random.IntRange(0, damage/3); - - if (dmg > 0 || (Random.Int(3) == 0 )) { - enemy.damage(dmg, this); - } - - return super.defenseProc(enemy, damage); - } - - @Override - public void die(Object cause) { - - GameScene.bossSlain(); - super.die(cause); - UKing.spawnAt(pos); - } - - public static UDM300 spawnAt(int pos) { - if (Level.passable[pos] && Actor.findChar(pos) == null) { - - UDM300 w = new UDM300(); - w.pos = pos; - w.state = w.HUNTING; - GameScene.add(w, SPAWN_DELAY); - - return w; - - } else { - return null; - } - } - - private class Fleeing extends Mob.Fleeing { - @Override - protected void nowhereToRun() { - if (buff(Terror.class) == null) { - state = HUNTING; - } else { - super.nowhereToRun(); - } - } - } - - private static final HashSet> RESISTANCES = new HashSet>(); - private static final HashSet> IMMUNITIES = new HashSet>(); - static { - RESISTANCES.add(ToxicGas.class); - RESISTANCES.add(Poison.class); - RESISTANCES.add(EnchantmentDark.class); - IMMUNITIES.add(EnchantmentDark.class); - IMMUNITIES.add(Terror.class); - IMMUNITIES.add(Amok.class); - IMMUNITIES.add(Charm.class); - IMMUNITIES.add(Sleep.class); - IMMUNITIES.add(Burning.class); - IMMUNITIES.add(ToxicGas.class); - IMMUNITIES.add(ScrollOfPsionicBlast.class); - IMMUNITIES.add(Vertigo.class); - IMMUNITIES.add(Paralysis.class); - IMMUNITIES.add(Bleeding.class); - IMMUNITIES.add(CorruptGas.class); - IMMUNITIES.add(FrostGas.class); - IMMUNITIES.add(TarGas.class); - IMMUNITIES.add(Tar.class); - } - - @Override - public HashSet> immunities() { - return IMMUNITIES; - } - - @Override - public HashSet> resistances() { - return RESISTANCES; - } - - public static class SeekBomb extends Mob { - - private static final int BOMB_DELAY = 10; - private int timeToBomb = BOMB_DELAY; - { - spriteClass = SeekingBombSprite.class; - - HP = HT = 1; - evadeSkill = 0; - baseSpeed = 1f; - timeToBomb = BOMB_DELAY; - EXP = 0; - - state = HUNTING; - - properties.add(Property.MECH); - properties.add(Property.MINIBOSS); - } - - @Override - public int attackProc(Char enemy, int damage) { - int dmg = super.attackProc(enemy, damage); - - DungeonBomb bomb = new DungeonBomb(); - bomb.explode(pos); - yell("KA-BOOM!!!"); - - destroy(); - sprite.die(); - - return dmg; - } - - @Override - public void die(Object cause) { - DungeonBomb bomb = new DungeonBomb(); - bomb.explode(pos); - super.die(cause); - - } - - @Override - public int hitSkill(Char target) { - return 10; - } - - @Override - public int damageRoll() { - return Random.NormalIntRange(0, 1); - } - - @Override - public int drRoll() { - return 0; - } - - @Override - public boolean act() { - yell(""+timeToBomb+"!"); - if (timeToBomb == 0){ - DungeonBomb bomb = new DungeonBomb(); - bomb.explode(pos); - yell("KA-BOOM!!!"); - destroy(); - sprite.die(); - } - - return super.act(); - } - - @Override - public void move(int step) { - super.move(step); - timeToBomb --; - } - - } - -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/actors/mobs/UGoo.java b/java/com/hmdzl/spspd/change/actors/mobs/UGoo.java deleted file mode 100644 index 4e39ae6f..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/UGoo.java +++ /dev/null @@ -1,630 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ - -package com.hmdzl.spspd.change.actors.mobs; - -import java.util.HashSet; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.ResultDescriptions; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.Blob; -import com.hmdzl.spspd.change.actors.blobs.ElectriShock; -import com.hmdzl.spspd.change.actors.blobs.Fire; -import com.hmdzl.spspd.change.actors.blobs.FrostGas; -import com.hmdzl.spspd.change.actors.blobs.ToxicGas; -import com.hmdzl.spspd.change.actors.buffs.Amok; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Burning; -import com.hmdzl.spspd.change.actors.buffs.Charm; -import com.hmdzl.spspd.change.actors.buffs.Ooze; -import com.hmdzl.spspd.change.actors.buffs.Poison; -import com.hmdzl.spspd.change.actors.buffs.Roots; -import com.hmdzl.spspd.change.actors.buffs.Silent; -import com.hmdzl.spspd.change.actors.buffs.Sleep; -import com.hmdzl.spspd.change.actors.buffs.Terror; -import com.hmdzl.spspd.change.actors.buffs.Vertigo; -import com.hmdzl.spspd.change.effects.particles.ShadowParticle; -import com.hmdzl.spspd.change.effects.particles.SparkParticle; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfPsionicBlast; -import com.hmdzl.spspd.change.items.weapon.enchantments.EnchantmentDark; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.traps.LightningTrap; -import com.hmdzl.spspd.change.mechanics.Ballistica; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.hmdzl.spspd.change.sprites.ErrorSprite; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.ShamanSprite; -import com.hmdzl.spspd.change.sprites.UGooSprite; -import com.hmdzl.spspd.change.utils.GLog; - -import com.watabou.noosa.Camera; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; -import com.hmdzl.spspd.change.sprites.GooSprite; -import com.hmdzl.spspd.change.actors.blobs.CorruptGas; -import com.hmdzl.spspd.change.actors.buffs.Bleeding; -import com.hmdzl.spspd.change.actors.buffs.Paralysis; -import com.hmdzl.spspd.change.items.weapon.melee.special.Handcannon; - - -public class UGoo extends Mob { - - protected static final float SPAWN_DELAY = 2f; - private static final String TXT_UNKNOW = "??? I know nothing about it ???"; - - { - spriteClass = UGooSprite.class; - baseSpeed = 0.25f; - - HP = HT = 1000; - EXP = 20; - evadeSkill = 5; - - loot = new Handcannon(); - lootChance = 1f; - - properties.add(Property.ELEMENT); - properties.add(Property.UNKNOW); - properties.add(Property.BOSS); - } - - private int breaks=0; - private static int GoosCount = 0; - - public void spawnGoos() { - EarthGoo goo1 = new EarthGoo(); - FireGoo goo2 = new FireGoo(); - ShockGoo goo3 = new ShockGoo(); - IceGoo goo4 = new IceGoo(); - - - goo1.pos = Dungeon.level.randomRespawnCellMob(); - goo2.pos = Dungeon.level.randomRespawnCellMob(); - goo3.pos = Dungeon.level.randomRespawnCellMob(); - goo4.pos = Dungeon.level.randomRespawnCellMob(); - - GameScene.add(goo1); - GameScene.add(goo2); - GameScene.add(goo3); - GameScene.add(goo4); - } - - - @Override - public int damageRoll() { - return Random.NormalIntRange(Dungeon.hero.lvl/2, Dungeon.hero.lvl); - } - - @Override - public int hitSkill(Char target) { - return 100; - } - - @Override - public int drRoll() { - return Random.NormalIntRange(0, 2); - } - - @Override - public float speed() { - if (breaks == 3) return 6*super.speed(); - else return super.speed(); - } - - private static final String BREAKS = "breaks"; - - @Override - public void storeInBundle( Bundle bundle ) { - super.storeInBundle(bundle); - bundle.put( BREAKS, breaks ); - } - - @Override - public void restoreFromBundle( Bundle bundle ) { - super.restoreFromBundle(bundle); - breaks = bundle.getInt( BREAKS ); - } - - @Override - public boolean act() { - - if( 3 - breaks > 4 * HP / HT ) { - - if (GoosCount==0){ - spawnGoos(); - } - breaks++; - - return true; - } - - if (breaks == 1){ - - } - - if (breaks == 2){ - - } - - if (breaks > 0){ - - } - return super.act(); - } - - @Override - public void damage(int dmg, Object src) { - - if (GoosCount > 0){ - dmg = Random.Int(0,1); - } else dmg = Random.Int(10,20); - if (dmg > 15){ - GameScene.add(Blob.seed(pos, 30, CorruptGas.class)); - } - super.damage(dmg, src); - } - - @Override - public void die(Object cause) { - for (Mob mob : (Iterable) Dungeon.level.mobs.clone()) { - if (mob instanceof FireGoo || mob instanceof EarthGoo || mob instanceof Eye || mob instanceof ShockGoo || mob instanceof IceGoo) { - mob.die(cause); - } - } - - GameScene.bossSlain(); - super.die(cause); - UTengu.spawnAt(pos); - } - - public static UGoo spawnAt(int pos) { - if (Level.passable[pos] && Actor.findChar(pos) == null) { - - UGoo w = new UGoo(); - w.pos = pos; - w.state = w.HUNTING; - GameScene.add(w, SPAWN_DELAY); - GoosCount = 0; - - return w; - - } else { - return null; - } - } - - private static final HashSet> RESISTANCES = new HashSet>(); - private static final HashSet> IMMUNITIES = new HashSet>(); - static { - RESISTANCES.add(ToxicGas.class); - RESISTANCES.add(Poison.class); - RESISTANCES.add(EnchantmentDark.class); - IMMUNITIES.add(EnchantmentDark.class); - IMMUNITIES.add(Terror.class); - IMMUNITIES.add(Amok.class); - IMMUNITIES.add(Charm.class); - IMMUNITIES.add(Sleep.class); - IMMUNITIES.add(Burning.class); - IMMUNITIES.add(ToxicGas.class); - IMMUNITIES.add(ScrollOfPsionicBlast.class); - IMMUNITIES.add(Vertigo.class); - IMMUNITIES.add(Paralysis.class); - IMMUNITIES.add(Bleeding.class); - IMMUNITIES.add(CorruptGas.class); - } - - @Override - public HashSet> immunities() { - return IMMUNITIES; - } - - @Override - public HashSet> resistances() { - return RESISTANCES; - } - - public static class EarthGoo extends Mob { - - { - spriteClass =UGooSprite.EarthSpawnSprite.class; - - HP = HT = 10; - evadeSkill = 5; - baseSpeed = 0.75f; - - EXP = 0; - - state = WANDERING; - - properties.add(Property.ELEMENT); - properties.add(Property.UNKNOW); - properties.add(Property.MINIBOSS); - } - - public EarthGoo() { - super(); - GoosCount++; - } - - @Override - public void die(Object cause) { - super.die(cause); - GoosCount--; - } - - @Override - public int hitSkill(Char target) { - return 10; - } - - @Override - public int damageRoll() { - return Random.NormalIntRange(0, 1); - } - - @Override - public int drRoll() { - return 0; - } - - @Override - public int attackProc(Char enemy, int damage) { - if (Random.Int(5) == 0) { - Buff.affect(enemy, Ooze.class); - enemy.sprite.burst(0xFF000000, 5); - } - if (Random.Int(5) == 0) { - Buff.prolong(enemy, Roots.class,2f); - enemy.sprite.burst(0xFF000000, 5); - } - - return damage; - } - - private static final HashSet> RESISTANCES = new HashSet>(); - static { - RESISTANCES.add(ToxicGas.class); - RESISTANCES.add(EnchantmentDark.class); - - } - - @Override - public HashSet> resistances() { - return RESISTANCES; - } - - private static final HashSet> IMMUNITIES = new HashSet>(); - static { - IMMUNITIES.add(Amok.class); - IMMUNITIES.add(Sleep.class); - IMMUNITIES.add(Terror.class); - IMMUNITIES.add(Poison.class); - IMMUNITIES.add(Vertigo.class); - IMMUNITIES.add(ToxicGas.class); - } - - @Override - public HashSet> immunities() { - return IMMUNITIES; - } - } - - public static class FireGoo extends Mob { - - { - spriteClass = UGooSprite.FireSpawnSprite.class; - - HP = HT = 10; - evadeSkill = 5; - baseSpeed = 0.75f; - - EXP = 0; - - state = WANDERING; - - properties.add(Property.ELEMENT); - properties.add(Property.UNKNOW); - properties.add(Property.MINIBOSS); - } - - public FireGoo() { - super(); - GoosCount++; - } - - @Override - public void die(Object cause) { - super.die(cause); - GoosCount--; - } - - @Override - public int hitSkill(Char target) { - return 10; - } - - @Override - public int damageRoll() { - return Random.NormalIntRange(0, 1); - } - - @Override - public int drRoll() { - return 2; - } - - @Override - protected boolean canAttack(Char enemy) { if (buff(Silent.class) != null){ - return Level.adjacent(pos, enemy.pos) && (!isCharmedBy(enemy)); - } else - return new Ballistica( pos, enemy.pos, Ballistica.MAGIC_BOLT).collisionPos == enemy.pos; - } - - @Override - public boolean attack(Char enemy) { - - if (!Level.adjacent(pos, enemy.pos)) { - spend(attackDelay()); - - if (hit(this, enemy, true)) { - - int dmg = damageRoll(); - enemy.damage(dmg, this); - - enemy.sprite.bloodBurstA(sprite.center(), dmg); - enemy.sprite.flash(); - - if (!enemy.isAlive() && enemy == Dungeon.hero) { - Dungeon.fail(Messages.format(ResultDescriptions.MOB)); - //GLog.n(TXT_KILL, name); - } - return true; - - } else { - - enemy.sprite.showStatus(CharSprite.NEUTRAL, - enemy.defenseVerb()); - return false; - } - } else { - return super.attack(enemy); - } - } - - @Override - public boolean act() { - - for (int i = 0; i < Level.NEIGHBOURS9.length; i++) { - GameScene.add(Blob.seed(pos + Level.NEIGHBOURS9[i], 2, - Fire.class)); - } - - return super.act(); - } - - private static final HashSet> RESISTANCES = new HashSet>(); - static { - RESISTANCES.add(ToxicGas.class); - RESISTANCES.add(EnchantmentDark.class); - - } - - @Override - public HashSet> resistances() { - return RESISTANCES; - } - - private static final HashSet> IMMUNITIES = new HashSet>(); - static { - IMMUNITIES.add(Amok.class); - IMMUNITIES.add(Sleep.class); - IMMUNITIES.add(Terror.class); - IMMUNITIES.add(Burning.class); - IMMUNITIES.add(ScrollOfPsionicBlast.class); - IMMUNITIES.add(Vertigo.class); - IMMUNITIES.add(ToxicGas.class); - } - - @Override - public HashSet> immunities() { - return IMMUNITIES; - } - } - - public static class IceGoo extends Mob { - - { - spriteClass = UGooSprite.IceSpawnSprite.class; - - HP = HT = 10; - evadeSkill = 5; - baseSpeed = 0.75f; - - EXP = 0; - - state = FLEEING; - - properties.add(Property.ELEMENT); - properties.add(Property.UNKNOW); - properties.add(Property.MINIBOSS); - } - - public IceGoo() { - super(); - GoosCount++; - } - - @Override - public void die(Object cause) { - super.die(cause); - GoosCount--; - } - - @Override - public int hitSkill(Char target) { - return 10; - } - - @Override - public int damageRoll() { - return Random.NormalIntRange(0, 1); - } - - @Override - public int drRoll() { - return 2; - } - - @Override - public int attackProc(Char enemy, int damage) { - return damage; - } - - @Override - public boolean act() { - - for (int i = 0; i < Level.NEIGHBOURS9.length; i++) { - GameScene.add(Blob.seed(pos + Level.NEIGHBOURS9[i], 2, - FrostGas.class)); - } - - return super.act(); - } - - private static final HashSet> RESISTANCES = new HashSet>(); - static { - RESISTANCES.add(ToxicGas.class); - RESISTANCES.add(EnchantmentDark.class); - - } - - @Override - public HashSet> resistances() { - return RESISTANCES; - } - - private static final HashSet> IMMUNITIES = new HashSet>(); - static { - IMMUNITIES.add(Amok.class); - IMMUNITIES.add(Sleep.class); - IMMUNITIES.add(Terror.class); - IMMUNITIES.add(Poison.class); - IMMUNITIES.add(Vertigo.class); - IMMUNITIES.add(ToxicGas.class); - IMMUNITIES.add(FrostGas.class); - - } - - @Override - public HashSet> immunities() { - return IMMUNITIES; - } - } - - - public static class ShockGoo extends Mob { - private static final float TIME_TO_ZAP = 2f; - { - spriteClass = UGooSprite.ShockSpawnSprite.class; - - HP = HT = 10; - evadeSkill = 5; - baseSpeed = 0.75f; - - EXP = 0; - - state = WANDERING; - - properties.add(Property.ELEMENT); - properties.add(Property.UNKNOW); - properties.add(Property.MINIBOSS); - } - - public ShockGoo() { - super(); - GoosCount++; - } - - @Override - public void die(Object cause) { - super.die(cause); - GoosCount--; - } - - @Override - public int hitSkill(Char target) { - return 10; - } - - @Override - public int damageRoll() { - return Random.NormalIntRange(0, 1); - } - - @Override - public int drRoll() { - return 2; - } - - @Override - protected boolean canAttack(Char enemy) { if (buff(Silent.class) != null){ - return Level.adjacent(pos, enemy.pos) && (!isCharmedBy(enemy)); - } else - return new Ballistica( pos, enemy.pos, Ballistica.MAGIC_BOLT).collisionPos == enemy.pos; - } - - @Override - public void damage(int dmg, Object src) { - GameScene.add(Blob.seed(pos, 5, ElectriShock.class)); - super.damage(dmg, src); - } - - - - private static final HashSet> RESISTANCES = new HashSet>(); - static { - RESISTANCES.add(ToxicGas.class); - RESISTANCES.add(EnchantmentDark.class); - - } - - @Override - public HashSet> resistances() { - return RESISTANCES; - } - - private static final HashSet> IMMUNITIES = new HashSet>(); - static { - IMMUNITIES.add(Amok.class); - IMMUNITIES.add(Sleep.class); - IMMUNITIES.add(Terror.class); - IMMUNITIES.add(Burning.class); - IMMUNITIES.add(ScrollOfPsionicBlast.class); - IMMUNITIES.add(Vertigo.class); - IMMUNITIES.add(ElectriShock.class); - } - - @Override - public HashSet> immunities() { - return IMMUNITIES; - } - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/actors/mobs/UKing.java b/java/com/hmdzl/spspd/change/actors/mobs/UKing.java deleted file mode 100644 index accd0eec..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/UKing.java +++ /dev/null @@ -1,231 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ - -package com.hmdzl.spspd.change.actors.mobs; - -import java.util.HashSet; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.ToxicGas; -import com.hmdzl.spspd.change.actors.buffs.Amok; -import com.hmdzl.spspd.change.actors.buffs.AttackUp; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Burning; -import com.hmdzl.spspd.change.actors.buffs.Charm; -import com.hmdzl.spspd.change.actors.buffs.Poison; -import com.hmdzl.spspd.change.actors.buffs.Roots; -import com.hmdzl.spspd.change.actors.buffs.Sleep; -import com.hmdzl.spspd.change.actors.buffs.Terror; -import com.hmdzl.spspd.change.actors.buffs.Vertigo; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.misc.FourClover; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfPsionicBlast; -import com.hmdzl.spspd.change.items.weapon.enchantments.EnchantmentDark; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.Terrain; -import com.hmdzl.spspd.change.scenes.GameScene; - -import com.hmdzl.spspd.change.sprites.PlantKingSprite; -import com.hmdzl.spspd.change.sprites.SewerLasherSprite; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; -import com.hmdzl.spspd.change.actors.blobs.CorruptGas; -import com.hmdzl.spspd.change.actors.buffs.Bleeding; -import com.hmdzl.spspd.change.actors.buffs.Paralysis; - -public class UKing extends Mob { - - protected static final float SPAWN_DELAY = 2f; - - { - spriteClass = PlantKingSprite.class; - baseSpeed = 1f; - - HP = HT = 2000; - EXP = 20; - evadeSkill = 5; - flying = true; - - loot = new FourClover(); - lootChance = 1f; - - properties.add(Property.PLANT); - properties.add(Property.BOSS); - } - - private int breaks=0; - - @Override - public int damageRoll() { - return Random.NormalIntRange(Dungeon.hero.lvl/2, Dungeon.hero.lvl); - } - - @Override - public int hitSkill(Char target) { - return 100; - } - - @Override - public int drRoll() { - return Random.NormalIntRange(0, 2); - } - - @Override - public boolean act() { - - if (Level.flamable[pos] && HP < HT) { - sprite.emitter().burst( Speck.factory( Speck.HEALING ), 1 ); - HP++; - } - - if( 3 - breaks > 4 * HP / HT ) { - breaks++; - for (int i = 0; i < Level.NEIGHBOURS9.length; i++) { - if (i == Terrain.EMPTY || i == Terrain.EMBERS - || i == Terrain.EMPTY_DECO || i == Terrain.GRASS) { - - Level.set(i, Terrain.HIGH_GRASS); - - } - } - return true; - } - - return super.act(); - } - - @Override - public void move(int step) { - super.move(step); - - int[] cells = { step - 1, step + 1, step - Level.getWidth(), - step + Level.getWidth(), step - 1 - Level.getWidth(), - step - 1 + Level.getWidth(), step + 1 - Level.getWidth(), - step + 1 + Level.getWidth() }; - int cell = cells[Random.Int(cells.length)]; - - if (cell == Terrain.EMPTY || cell == Terrain.EMBERS - || cell == Terrain.EMPTY_DECO) { - - Level.set(cell, Terrain.GRASS); - - } - } - - @Override - public float speed() { - if (breaks == 3) return 2*super.speed(); - else return super.speed(); - } - - @Override - protected boolean canAttack(Char enemy) { - if (breaks >2){ - return Dungeon.level.distance( pos, enemy.pos ) <= 3;} - else return Dungeon.level.distance( pos, enemy.pos ) <= 1; - } - - @Override - public int attackProc(Char enemy, int damage) { - if (breaks >2){ - if(Random.Int(5)>2){ - Buff.prolong(enemy, Roots.class,2f); - } else Buff.affect(enemy, Poison.class).set(5); - } - return damage; - } - - private static final String BREAKS = "breaks"; - - @Override - public void storeInBundle( Bundle bundle ) { - super.storeInBundle(bundle); - bundle.put( BREAKS, breaks ); - } - - @Override - public void restoreFromBundle( Bundle bundle ) { - super.restoreFromBundle(bundle); - breaks = bundle.getInt( BREAKS ); - } - - @Override - public void damage(int dmg, Object src) { - - dmg = (int)(dmg*0.6); - Buff.affect(this, AttackUp.class,3f).level((int)(15*dmg/85)); - super.damage(dmg, src); - } - - @Override - public void die(Object cause) { - - GameScene.bossSlain(); - super.die(cause); - UIcecorps.spawnAt(pos); - } - - public static UKing spawnAt(int pos) { - if (Level.passable[pos] && Actor.findChar(pos) == null) { - - UKing w = new UKing(); - w.pos = pos; - w.state = w.HUNTING; - GameScene.add(w, SPAWN_DELAY); - - return w; - - } else { - return null; - } - } - - private static final HashSet> RESISTANCES = new HashSet>(); - private static final HashSet> IMMUNITIES = new HashSet>(); - static { - RESISTANCES.add(ToxicGas.class); - RESISTANCES.add(Poison.class); - RESISTANCES.add(EnchantmentDark.class); - IMMUNITIES.add(EnchantmentDark.class); - IMMUNITIES.add(Terror.class); - IMMUNITIES.add(Amok.class); - IMMUNITIES.add(Charm.class); - IMMUNITIES.add(Sleep.class); - IMMUNITIES.add(Burning.class); - IMMUNITIES.add(ToxicGas.class); - IMMUNITIES.add(ScrollOfPsionicBlast.class); - IMMUNITIES.add(Vertigo.class); - IMMUNITIES.add(Paralysis.class); - IMMUNITIES.add(Bleeding.class); - IMMUNITIES.add(CorruptGas.class); - - } - - @Override - public HashSet> immunities() { - return IMMUNITIES; - } - - @Override - public HashSet> resistances() { - return RESISTANCES; - } - -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/actors/mobs/UTengu.java b/java/com/hmdzl/spspd/change/actors/mobs/UTengu.java deleted file mode 100644 index 3964b179..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/UTengu.java +++ /dev/null @@ -1,281 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ - -package com.hmdzl.spspd.change.actors.mobs; - -import com.hmdzl.spspd.change.effects.Pushing; -import com.hmdzl.spspd.change.items.wands.WandOfFlow; -import com.hmdzl.spspd.change.messages.Messages; -import java.util.HashSet; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.Blob; -import com.hmdzl.spspd.change.actors.blobs.ToxicGas; -import com.hmdzl.spspd.change.actors.buffs.Amok; -import com.hmdzl.spspd.change.actors.buffs.Burning; -import com.hmdzl.spspd.change.actors.buffs.Charm; -import com.hmdzl.spspd.change.actors.buffs.Poison; -import com.hmdzl.spspd.change.actors.buffs.Sleep; -import com.hmdzl.spspd.change.actors.buffs.Terror; -import com.hmdzl.spspd.change.actors.buffs.Vertigo; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfPsionicBlast; -import com.hmdzl.spspd.change.items.weapon.enchantments.EnchantmentDark; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.UTenguSprite; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; -import com.hmdzl.spspd.change.sprites.TenguSprite; -import com.hmdzl.spspd.change.actors.blobs.CorruptGas; -import com.hmdzl.spspd.change.actors.buffs.Bleeding; -import com.hmdzl.spspd.change.actors.buffs.Paralysis; -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.mechanics.Ballistica; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.watabou.noosa.audio.Sample; - - - -public class UTengu extends Mob { - - private int timeToJump = JUMP_DELAY; - private static final int JUMP_DELAY = 10; - protected static final float SPAWN_DELAY = 2f; - private static final String TXT_UNKNOW = "??? I know nothing about it ???"; - private static final int maxDistance = 3; - - { - spriteClass = UTenguSprite.class; - baseSpeed = 1f; - - HP = HT = 1000; - EXP = 20; - evadeSkill = 5; - - properties.add(Property.HUMAN); - properties.add(Property.BOSS); - } - - private int breaks=0; - - @Override - public int damageRoll() { - return Random.NormalIntRange(Dungeon.hero.lvl/2, Dungeon.hero.lvl); - } - - @Override - public int hitSkill(Char target) { - return 100; - } - - @Override - public int drRoll() { - return Random.NormalIntRange(0, 2); - } - - @Override - public float speed() { - if (breaks == 3) return 2*super.speed(); - else return super.speed(); - } - - @Override - public boolean act() { - - if( 3 - breaks > 4 * HP / HT ) { - breaks++; - return true; - } - - if (breaks == 1){ - - } - - if (breaks == 2){ - - } - - if (breaks > 0){ - - } - return super.act(); - } - - private static final String BREAKS = "breaks"; - - @Override - public void storeInBundle( Bundle bundle ) { - super.storeInBundle(bundle); - bundle.put( BREAKS, breaks ); - } - - @Override - public void restoreFromBundle( Bundle bundle ) { - super.restoreFromBundle(bundle); - breaks = bundle.getInt( BREAKS ); - - } - - @Override - public void damage(int dmg, Object src) { - - dmg = Random.Int(10,20); - if (dmg > 15){ - GameScene.add(Blob.seed(pos, 30, CorruptGas.class)); - } - super.damage(dmg, src); - } - @Override - public int defenseProc(Char enemy, int damage) { - - int dmg = Random.IntRange(0, 20); - - if (breaks == 2){ - if (dmg > 0 || (Random.Int(3) == 0 )) { - enemy.damage(dmg, this); - } - } - return super.defenseProc(enemy, damage); - } - - @Override - protected boolean canAttack(Char enemy) { - if (breaks <2){ - return Dungeon.level.distance( pos, enemy.pos ) <= 4;} - else return Dungeon.level.distance( pos, enemy.pos ) <= 1; - } - - @Override - protected boolean doAttack(Char enemy) { - timeToJump--; - if (timeToJump <= 0 && Level.adjacent(pos, enemy.pos)) { - jump(); - return true; - } else { - return super.doAttack(enemy); - } - } - - @Override - public int attackProc(Char enemy, int damage) { - Char ch; - - if (Random.Int( 5 ) >= 3 && Dungeon.level.distance( pos, enemy.pos )<= 1){ - int oppositeTengu = enemy.pos + (enemy.pos - pos); - Ballistica trajectory = new Ballistica(enemy.pos, oppositeTengu, Ballistica.MAGIC_BOLT); - WandOfFlow.throwChar(enemy, trajectory, 1); - } - /*for (int i = 1; i < maxDistance; i++) { - - int c = Ballistica.trace[i]; - - if ((ch = Actor.findChar(c)) != null && ch instanceof Hero) { - int next = Ballistica.trace[i + 1]; - if ((Dungeon.level.passable[next] || Dungeon.level.avoid[next]) - && Actor.findChar(next) == null) { - ch.move(next); - Actor.addDelayed(new Pushing(ch, ch.pos, next), -1); - Dungeon.observe(); - } else { - return damage *2 ; - } - } - }*/ - return damage; - } - - @Override - public void die(Object cause) { - - GameScene.bossSlain(); - super.die(cause); - UDM300.spawnAt(pos); - } - - public static UTengu spawnAt(int pos) { - if (Level.passable[pos] && Actor.findChar(pos) == null) { - - UTengu w = new UTengu(); - w.pos = pos; - w.state = w.HUNTING; - GameScene.add(w, SPAWN_DELAY); - - return w; - - } else { - return null; - } - } - - private void jump() { - timeToJump = JUMP_DELAY; - - int newPos; - do { - newPos = Random.Int(Level.getLength()); - } while (!Level.fieldOfView[newPos] || !Level.passable[newPos] - || Level.adjacent(newPos, enemy.pos) - || Actor.findChar(newPos) != null); - - sprite.move(pos, newPos); - move(newPos); - - if (Dungeon.visible[newPos]) { - CellEmitter.get(newPos).burst(Speck.factory(Speck.WOOL), 6); - Sample.INSTANCE.play(Assets.SND_PUFF); - } - - spend(1 / speed()); - - } - - private static final HashSet> RESISTANCES = new HashSet>(); - private static final HashSet> IMMUNITIES = new HashSet>(); - static { - RESISTANCES.add(ToxicGas.class); - RESISTANCES.add(Poison.class); - RESISTANCES.add(EnchantmentDark.class); - IMMUNITIES.add(EnchantmentDark.class); - IMMUNITIES.add(Terror.class); - IMMUNITIES.add(Amok.class); - IMMUNITIES.add(Charm.class); - IMMUNITIES.add(Sleep.class); - IMMUNITIES.add(Burning.class); - IMMUNITIES.add(ToxicGas.class); - IMMUNITIES.add(ScrollOfPsionicBlast.class); - IMMUNITIES.add(Vertigo.class); - IMMUNITIES.add(Paralysis.class); - IMMUNITIES.add(Bleeding.class); - IMMUNITIES.add(CorruptGas.class); - - } - - @Override - public HashSet> immunities() { - return IMMUNITIES; - } - - @Override - public HashSet> resistances() { - return RESISTANCES; - } - -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/actors/mobs/UYog.java b/java/com/hmdzl/spspd/change/actors/mobs/UYog.java deleted file mode 100644 index c53c0e45..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/UYog.java +++ /dev/null @@ -1,192 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ - -package com.hmdzl.spspd.change.actors.mobs; - -import java.util.HashSet; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.Blob; -import com.hmdzl.spspd.change.actors.blobs.ToxicGas; -import com.hmdzl.spspd.change.actors.buffs.Amok; -import com.hmdzl.spspd.change.actors.buffs.Burning; -import com.hmdzl.spspd.change.actors.buffs.Charm; -import com.hmdzl.spspd.change.actors.buffs.Poison; -import com.hmdzl.spspd.change.actors.buffs.Sleep; -import com.hmdzl.spspd.change.actors.buffs.Terror; -import com.hmdzl.spspd.change.actors.buffs.Vertigo; -import com.hmdzl.spspd.change.items.PowerHand; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfPsionicBlast; -import com.hmdzl.spspd.change.items.weapon.enchantments.EnchantmentDark; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ErrorSprite; - -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; -import com.hmdzl.spspd.change.actors.blobs.CorruptGas; -import com.hmdzl.spspd.change.actors.buffs.Bleeding; -import com.hmdzl.spspd.change.actors.buffs.Paralysis; - -public class UYog extends Mob { - - protected static final float SPAWN_DELAY = 2f; - private static final String TXT_UNKNOW = "??? I know nothing about it ???"; - { - spriteClass = ErrorSprite.class; - baseSpeed = 0.75f; - - HP = HT = 1000; - EXP = 20; - evadeSkill = 5; - - loot = new PowerHand(); - lootChance = 1f; - - properties.add(Property.UNKNOW); - properties.add(Property.BOSS); - } - - private int breaks=0; - - @Override - public int damageRoll() { - return Random.NormalIntRange(Dungeon.hero.lvl/2, Dungeon.hero.lvl); - } - - @Override - public int hitSkill(Char target) { - return 100; - } - - @Override - public int drRoll() { - return Random.NormalIntRange(0, 2); - } - - @Override - public float speed() { - if (breaks == 3) return 2*super.speed(); - else return super.speed(); - } - - @Override - public boolean act() { - - if( 3 - breaks > 4 * HP / HT ) { - - breaks++; - - return true; - } - - if (breaks == 1){ - - } - - if (breaks == 2){ - - } - - if (breaks > 0){ - - } - return super.act(); - } - - private static final String BREAKS = "breaks"; - - @Override - public void storeInBundle( Bundle bundle ) { - super.storeInBundle(bundle); - bundle.put( BREAKS, breaks ); - } - - @Override - public void restoreFromBundle( Bundle bundle ) { - super.restoreFromBundle(bundle); - breaks = bundle.getInt( BREAKS ); - } - - @Override - public void damage(int dmg, Object src) { - - dmg = Random.Int(10,20); - if (dmg > 15){ - GameScene.add(Blob.seed(pos, 30, CorruptGas.class)); - } - super.damage(dmg, src); - } - - @Override - public void die(Object cause) { - - GameScene.bossSlain(); - super.die(cause); - UAmulet.spawnAt(pos); - } - - public static UYog spawnAt(int pos) { - if (Level.passable[pos] && Actor.findChar(pos) == null) { - - UYog w = new UYog(); - w.pos = pos; - w.state = w.HUNTING; - GameScene.add(w, SPAWN_DELAY); - - return w; - - } else { - return null; - } - } - - private static final HashSet> RESISTANCES = new HashSet>(); - private static final HashSet> IMMUNITIES = new HashSet>(); - static { - RESISTANCES.add(ToxicGas.class); - RESISTANCES.add(Poison.class); - RESISTANCES.add(EnchantmentDark.class); - IMMUNITIES.add(EnchantmentDark.class); - IMMUNITIES.add(Terror.class); - IMMUNITIES.add(Amok.class); - IMMUNITIES.add(Charm.class); - IMMUNITIES.add(Sleep.class); - IMMUNITIES.add(Burning.class); - IMMUNITIES.add(ToxicGas.class); - IMMUNITIES.add(ScrollOfPsionicBlast.class); - IMMUNITIES.add(Vertigo.class); - IMMUNITIES.add(Paralysis.class); - IMMUNITIES.add(Bleeding.class); - IMMUNITIES.add(CorruptGas.class); - - } - - @Override - public HashSet> immunities() { - return IMMUNITIES; - } - - @Override - public HashSet> resistances() { - return RESISTANCES; - } - -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/actors/mobs/VaultProtector.java b/java/com/hmdzl/spspd/change/actors/mobs/VaultProtector.java deleted file mode 100644 index ec9cf717..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/VaultProtector.java +++ /dev/null @@ -1,143 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs; - -import java.util.HashSet; - -import com.hmdzl.spspd.change.actors.buffs.Silent; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.ResultDescriptions; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.effects.particles.SparkParticle; -import com.hmdzl.spspd.change.items.VioletDewdrop; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.traps.LightningTrap; -import com.hmdzl.spspd.change.mechanics.Ballistica; -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.hmdzl.spspd.change.sprites.VaultProtectorSprite; -import com.hmdzl.spspd.change.utils.GLog; - -import com.watabou.noosa.Camera; -import com.watabou.utils.Callback; -import com.watabou.utils.Random; - -public class VaultProtector extends Mob implements Callback { - - private static final float TIME_TO_ZAP = 2f; - - private static final String TXT_LIGHTNING_KILLED = "%s's lightning bolt killed you..."; - - { - spriteClass = VaultProtectorSprite.class; - - EXP = 1; - state = HUNTING; - flying = true; - - HP = HT = 400; - evadeSkill = 10; - - loot = new VioletDewdrop(); - lootChance = 1f; - - properties.add(Property.ELEMENT); - } - - @Override - public int damageRoll() { - return Random.NormalIntRange(20, 40); - } - - @Override - public int hitSkill(Char target) { - return 35; - } - - @Override - public int drRoll() { - return Random.NormalIntRange(10, 20); - } - - @Override - protected boolean canAttack(Char enemy) { if (buff(Silent.class) != null){ - return Level.adjacent(pos, enemy.pos) && (!isCharmedBy(enemy)); - } else - return new Ballistica( pos, enemy.pos, Ballistica.MAGIC_BOLT).collisionPos == enemy.pos; - } - - @Override - protected boolean doAttack(Char enemy) { - - if (Level.distance(pos, enemy.pos) <= 1) { - - return super.doAttack(enemy); - - } else { - - boolean visible = Level.fieldOfView[pos] - || Level.fieldOfView[enemy.pos]; - if (visible) { - ((VaultProtectorSprite) sprite).zap(enemy.pos); - } - - spend(TIME_TO_ZAP); - - if (hit(this, enemy, true)) { - int dmg = Random.Int(30, 70); - if (Level.water[enemy.pos] && !enemy.flying) { - dmg *= 1.5f; - } - enemy.damage(dmg, this); - - enemy.sprite.centerEmitter().burst(SparkParticle.FACTORY, 3); - enemy.sprite.flash(); - - if (enemy == Dungeon.hero) { - - Camera.main.shake(2, 0.3f); - - if (!enemy.isAlive()) { - Dungeon.fail( Messages.format(ResultDescriptions.MOB)); - //GLog.n(Messages.get(this, "kill")); - } - } - } else { - enemy.sprite - .showStatus(CharSprite.NEUTRAL, enemy.defenseVerb()); - } - - return !visible; - } - } - - @Override - public void call() { - next(); - } - - private static final HashSet> RESISTANCES = new HashSet>(); - static { - RESISTANCES.add(LightningTrap.Electricity.class); - } - - @Override - public HashSet> resistances() { - return RESISTANCES; - } -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/Virus.java b/java/com/hmdzl/spspd/change/actors/mobs/Virus.java deleted file mode 100644 index 2fcc25bd..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/Virus.java +++ /dev/null @@ -1,139 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ - -package com.hmdzl.spspd.change.actors.mobs; - -import java.util.HashSet; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.ResultDescriptions; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.Blob; -import com.hmdzl.spspd.change.actors.blobs.ElectriShock; -import com.hmdzl.spspd.change.actors.blobs.Fire; -import com.hmdzl.spspd.change.actors.blobs.FrostGas; -import com.hmdzl.spspd.change.actors.blobs.ToxicGas; -import com.hmdzl.spspd.change.actors.buffs.Amok; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Burning; -import com.hmdzl.spspd.change.actors.buffs.Charm; -import com.hmdzl.spspd.change.actors.buffs.Ooze; -import com.hmdzl.spspd.change.actors.buffs.Poison; -import com.hmdzl.spspd.change.actors.buffs.Roots; -import com.hmdzl.spspd.change.actors.buffs.Sleep; -import com.hmdzl.spspd.change.actors.buffs.Terror; -import com.hmdzl.spspd.change.actors.buffs.Vertigo; -import com.hmdzl.spspd.change.effects.particles.ShadowParticle; -import com.hmdzl.spspd.change.effects.particles.SparkParticle; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfPsionicBlast; -import com.hmdzl.spspd.change.items.weapon.enchantments.EnchantmentDark; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.traps.LightningTrap; -import com.hmdzl.spspd.change.mechanics.Ballistica; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.hmdzl.spspd.change.sprites.ErrorSprite; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.ShamanSprite; -import com.hmdzl.spspd.change.sprites.UGooSprite; -import com.hmdzl.spspd.change.utils.GLog; - -import com.watabou.noosa.Camera; -import com.watabou.utils.Random; -import com.hmdzl.spspd.change.sprites.GooSprite; -import com.hmdzl.spspd.change.actors.blobs.CorruptGas; -import com.hmdzl.spspd.change.actors.buffs.Bleeding; -import com.hmdzl.spspd.change.actors.buffs.Paralysis; -import com.hmdzl.spspd.change.items.weapon.melee.special.Handcannon; - - -public class Virus extends Mob { - protected static final float SPAWN_DELAY = 1f; - { - spriteClass = ErrorSprite.class; - HP = HT = (int)Dungeon.hero.HT/5; - EXP = 0; - evadeSkill = Dungeon.hero.evadeSkill; - - properties.add(Property.UNKNOW); - properties.add(Property.BOSS); - } - - int generation = 0; - - @Override - public int damageRoll() { - return Random.NormalIntRange(Dungeon.hero.lvl/2, Dungeon.hero.lvl); - } - - @Override - public int hitSkill(Char target) { - return Dungeon.hero.hitSkill; - } - - @Override - protected boolean act() { - damage(1, this); - return super.act(); - } - - @Override - public int drRoll() { - return 0; - } - - @Override - public float speed() { - return 1f; - } - - @Override - public void damage(int dmg, Object src) { - - if (dmg > HT/2){ - GameScene.add(Blob.seed(pos, 50, CorruptGas.class)); - } - super.damage(dmg, src); - } - - @Override - public void die(Object cause) { - super.die(cause); - } - - @Override - public void add( Buff buff ) { - //in other words, can't be directly affected by buffs/debuffs. - } - - private static final HashSet> IMMUNITIES = new HashSet>(); - static { - - IMMUNITIES.add(EnchantmentDark.class); - IMMUNITIES.add(Burning.class); - IMMUNITIES.add(ToxicGas.class); - IMMUNITIES.add(ScrollOfPsionicBlast.class); - IMMUNITIES.add(CorruptGas.class); - } - - @Override - public HashSet> immunities() { - return IMMUNITIES; - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/actors/mobs/Warlock.java b/java/com/hmdzl/spspd/change/actors/mobs/Warlock.java deleted file mode 100644 index 726f5b02..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/Warlock.java +++ /dev/null @@ -1,153 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs; - -import java.util.HashSet; - -import com.hmdzl.spspd.change.actors.buffs.Silent; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.ResultDescriptions; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Weakness; -import com.hmdzl.spspd.change.items.Generator; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.potions.PotionOfHealing; -import com.hmdzl.spspd.change.items.weapon.enchantments.EnchantmentDark; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.mechanics.Ballistica; -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.hmdzl.spspd.change.sprites.WarlockSprite; - -import com.watabou.utils.Callback; -import com.watabou.utils.Random; - -public class Warlock extends Mob implements Callback { - - private static final float TIME_TO_ZAP = 1f; - - private static final String TXT_SHADOWBOLT_KILLED = "%s's shadow bolt killed you..."; - - { - spriteClass = WarlockSprite.class; - - HP = HT = 120+(adj(0)*Random.NormalIntRange(5, 7)); - evadeSkill = 18+adj(0); - - EXP = 11; - maxLvl = 30; - - loot = Generator.Category.POTION; - lootChance = 0.83f; - - lootOther = Generator.Category.WAND; - lootChanceOther = 0.02f; // by default, see die() - - properties.add(Property.DWARF); - } - - @Override - public int damageRoll() { - return Random.NormalIntRange(12, 25+adj(0)); - } - - @Override - public int hitSkill(Char target) { - return 25+adj(0); - } - - @Override - public int drRoll() { - return Random.NormalIntRange(4, 8); - } - - @Override - protected boolean canAttack(Char enemy) { if (buff(Silent.class) != null){ - return Level.adjacent(pos, enemy.pos) && (!isCharmedBy(enemy)); - } else - return new Ballistica( pos, enemy.pos, Ballistica.MAGIC_BOLT).collisionPos == enemy.pos; - } - - @Override - protected boolean doAttack(Char enemy) { - - if (Level.adjacent(pos, enemy.pos)) { - - return super.doAttack(enemy); - - } else { - - boolean visible = Level.fieldOfView[pos] - || Level.fieldOfView[enemy.pos]; - if (visible) { - ((WarlockSprite) sprite).zap(enemy.pos); - } else { - zap(); - } - - return !visible; - } - } - - private void zap() { - spend(TIME_TO_ZAP); - - if (hit(this, enemy, true)) { - if (enemy == Dungeon.hero && Random.Int(2) == 0) { - Buff.prolong(enemy, Weakness.class, Weakness.duration(enemy)); - } - - int dmg = Random.Int(16, 24+adj(0)); - enemy.damage(dmg, this); - - if (!enemy.isAlive() && enemy == Dungeon.hero) { - Dungeon.fail(Messages.format(ResultDescriptions.MOB)); - //GLog.n(Messages.get(this, "kill")); - } - } else { - enemy.sprite.showStatus(CharSprite.NEUTRAL, enemy.defenseVerb()); - } - } - - public void onZapComplete() { - zap(); - next(); - } - - @Override - public void call() { - next(); - } - - @Override - public Item createLoot() { - Item loot = super.createLoot(); - return loot; - } - - private static final HashSet> RESISTANCES = new HashSet>(); - static { - RESISTANCES.add(EnchantmentDark.class); - } - - @Override - public HashSet> resistances() { - return RESISTANCES; - } -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/Wraith.java b/java/com/hmdzl/spspd/change/actors/mobs/Wraith.java deleted file mode 100644 index 681a951f..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/Wraith.java +++ /dev/null @@ -1,191 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs; - -import java.util.HashSet; - -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.ToxicGas; -import com.hmdzl.spspd.change.actors.buffs.Amok; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Burning; -import com.hmdzl.spspd.change.actors.buffs.Charm; -import com.hmdzl.spspd.change.actors.buffs.Frost; -import com.hmdzl.spspd.change.actors.buffs.Paralysis; -import com.hmdzl.spspd.change.actors.buffs.Roots; -import com.hmdzl.spspd.change.actors.buffs.Sleep; -import com.hmdzl.spspd.change.actors.buffs.Terror; -import com.hmdzl.spspd.change.actors.buffs.Vertigo; -import com.hmdzl.spspd.change.effects.particles.ShadowParticle; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfMagicalInfusion; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfPsionicBlast; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfUpgrade; -import com.hmdzl.spspd.change.items.weapon.enchantments.EnchantmentDark; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.WraithSprite; -import com.watabou.noosa.tweeners.AlphaTweener; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -public class Wraith extends Mob { - - protected static final float SPAWN_DELAY = 2f; - - protected int level; - - { - spriteClass = WraithSprite.class; - - HP = HT = 1+Dungeon.depth; - EXP = 1; - - flying = true; - - loot = new ScrollOfMagicalInfusion(); - lootChance = 0.06f; - - lootOther = new ScrollOfUpgrade(); - lootChanceOther = 0.09f; - - properties.add(Property.UNDEAD); - } - - protected static final String LEVEL = "level"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(LEVEL, level); - } - - @Override - protected boolean canAttack(Char enemy) { - return Dungeon.level.distance( pos, enemy.pos ) <= 4 ; - } - - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - level = bundle.getInt(LEVEL); - adjustStats(level); - } - - @Override - public int damageRoll() { - return Random.NormalIntRange(1, 3 + level); - } - - @Override - public int hitSkill(Char target) { - return 10 + level; - } - - public void adjustStats(int level) { - this.level = level; - evadeSkill = hitSkill(null) * 5; - enemySeen = true; - } - - @Override - public int attackProc(Char enemy, int damage) { - if (Random.Int(10) == 0) { - Buff.affect(enemy, Vertigo.class, Vertigo.duration(enemy)); - Buff.affect(enemy, Terror.class, Terror.DURATION).object = enemy.id(); - } - - return damage; - } - - //public void damage(int dmg, Object src) { - // if (enemySeen - // && (src instanceof Wand || src instanceof LightningTrap.Electricity || src instanceof Char)) { - // GLog.n("The attack passes through the wraith."); - // sprite.showStatus(CharSprite.NEUTRAL, "missed"); - // } else { - // super.damage(dmg, src); - // } - //} - - @Override - public boolean reset() { - state = WANDERING; - return true; - } - - @Override - public void notice() { - super.notice(); - if (Dungeon.getMonth()==9) {yell("BOO!");} - } - - public static void spawnAround(int pos) { - for (int n : Level.NEIGHBOURS4) { - int cell = pos + n; - if (Level.passable[cell] && Actor.findChar(cell) == null) { - spawnAt(cell); - } - } - } - - public static Wraith spawnAt(int pos) { - if (Level.passable[pos] && Actor.findChar(pos) == null) { - - Wraith w = new Wraith(); - w.adjustStats(Dungeon.depth); - w.pos = pos; - w.state = w.HUNTING; - GameScene.add(w, SPAWN_DELAY); - - w.sprite.alpha(0); - w.sprite.parent.add(new AlphaTweener(w.sprite, 1, 0.5f)); - - w.sprite.emitter().burst(ShadowParticle.CURSE, 5); - - return w; - - } else { - return null; - } - } - - protected static final HashSet> IMMUNITIES = new HashSet>(); - static { - IMMUNITIES.add(EnchantmentDark.class); - IMMUNITIES.add(Terror.class); - IMMUNITIES.add(Amok.class); - IMMUNITIES.add(Charm.class); - IMMUNITIES.add(Sleep.class); - IMMUNITIES.add(ToxicGas.class); - IMMUNITIES.add(ScrollOfPsionicBlast.class); - IMMUNITIES.add(Vertigo.class); - IMMUNITIES.add(Burning.class); - IMMUNITIES.add(Paralysis.class); - IMMUNITIES.add(Roots.class); - IMMUNITIES.add(Frost.class); - } - - @Override - public HashSet> immunities() { - return IMMUNITIES; - } -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/YearBeast.java b/java/com/hmdzl/spspd/change/actors/mobs/YearBeast.java deleted file mode 100644 index c7b2d4f2..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/YearBeast.java +++ /dev/null @@ -1,261 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs; - -import java.util.HashSet; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.Blob; -import com.hmdzl.spspd.change.actors.blobs.Fire; -import com.hmdzl.spspd.change.actors.blobs.ToxicGas; -import com.hmdzl.spspd.change.actors.buffs.Amok; -import com.hmdzl.spspd.change.actors.buffs.AttackUp; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Burning; -import com.hmdzl.spspd.change.actors.buffs.Charm; -import com.hmdzl.spspd.change.actors.buffs.DefenceUp; -import com.hmdzl.spspd.change.actors.buffs.Frost; -import com.hmdzl.spspd.change.actors.buffs.GlassShield; -import com.hmdzl.spspd.change.actors.buffs.Poison; -import com.hmdzl.spspd.change.actors.buffs.Sleep; -import com.hmdzl.spspd.change.actors.buffs.Terror; -import com.hmdzl.spspd.change.actors.buffs.Vertigo; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.effects.particles.ElmoParticle; -import com.hmdzl.spspd.change.items.KindOfArmor; -import com.hmdzl.spspd.change.items.KindOfWeapon; -import com.hmdzl.spspd.change.items.TenguKey; -import com.hmdzl.spspd.change.items.armor.normalarmor.NormalArmor; -import com.hmdzl.spspd.change.items.armor.normalarmor.RubberArmor; -import com.hmdzl.spspd.change.items.armor.normalarmor.WoodenArmor; -import com.hmdzl.spspd.change.items.journalpages.Vault; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfPsionicBlast; -import com.hmdzl.spspd.change.items.summon.Honeypot; -import com.hmdzl.spspd.change.items.wands.WandOfFlow; -import com.hmdzl.spspd.change.items.weapon.melee.FightGloves; -import com.hmdzl.spspd.change.items.weapon.melee.Knuckles; -import com.hmdzl.spspd.change.items.weapon.melee.special.FireCracker; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.mechanics.Ballistica; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.BeastYearSprite; -import com.hmdzl.spspd.change.sprites.ErrorSprite; -import com.hmdzl.spspd.change.sprites.TenguSprite; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -public class YearBeast extends Mob { - protected static final float SPAWN_DELAY = 1f; - { - //name = "YearBeast"; - spriteClass = BeastYearSprite.class; - baseSpeed = 1f; - - HP = HT = 1000; - EXP = 0; - evadeSkill = 30; - viewDistance = 6; - baseSpeed=1.5f; - flying = true; - } - - private int times=0; - - private static final String TIMES = "times"; - - @Override - public void storeInBundle( Bundle bundle ) { - super.storeInBundle(bundle); - bundle.put( TIMES, times ); - } - - @Override - public void restoreFromBundle( Bundle bundle ) { - super.restoreFromBundle(bundle); - times = bundle.getInt( TIMES ); - } - - @Override - public int damageRoll() { - return Random.NormalIntRange(40, 60); - } - - @Override - public int hitSkill(Char target) { - return 40; - } - - - @Override - public boolean act() { - times++; - for (Char ch : Dungeon.level.mobs) { - Buff.affect(ch,Burning.class).reignite(ch); - } - for (int i = 0; i < Level.NEIGHBOURS9.length; i++) { - GameScene.add(Blob.seed(pos + Level.NEIGHBOURS9[i], 2, - Fire.class)); - } - return super.act(); - } - @Override - protected boolean canAttack(Char enemy) { - return Dungeon.level.distance( pos, enemy.pos ) <= 2 ; - } - @Override - public int attackProc(Char enemy, int damage) { - - if (Random.Int(2) == 0) { - Buff.affect(enemy, Burning.class).reignite(enemy); - } else { - Buff.affect(enemy, Frost.class); - } - - if (Random.Int(5) == 0) { - Buff.affect(enemy, Charm.class,4f); - } - - if (Random.Int(5) == 0) { - int oppositeDefender = enemy.pos + (enemy.pos - pos); - Ballistica trajectory = new Ballistica(enemy.pos, oppositeDefender, Ballistica.MAGIC_BOLT); - WandOfFlow.throwChar(enemy, trajectory, 1); - Buff.affect(enemy, Vertigo.class,3f); - } - - if (enemy == Dungeon.hero) { - Hero hero = Dungeon.hero; - KindOfWeapon weapon = hero.belongings.weapon; - KindOfArmor armor = hero.belongings.armor; - if (Random.Int(10)==0){ - if (Random.Int(2)==0) { - if (weapon != null && !(weapon instanceof Knuckles || weapon instanceof FightGloves) - && !weapon.cursed) { - hero.belongings.weapon = null; - Dungeon.level.drop(weapon, hero.pos).sprite.drop(); - GLog.w(Messages.get(this, "disarm")); - } - } else { - if (armor != null && !(armor instanceof WoodenArmor || armor instanceof RubberArmor || armor instanceof NormalArmor) - && !armor.cursed) { - hero.belongings.armor = null; - Dungeon.level.drop(armor, hero.pos).sprite.drop(); - GLog.w(Messages.get(this, "disarm")); - } - } - } - } - - return damage; - } - - @Override - public int defenseProc(Char enemy, int damage) { - - int dmg = damage; - if (dmg > 200 && buff(GlassShield.class) == null) { - Buff.affect(this,GlassShield.class).turns(3); - } - Buff.prolong(this,DefenceUp.class,3f).level(20); - Buff.prolong(this,AttackUp.class,3f).level(20); - return super.defenseProc(enemy, damage); - } - - @Override - public void damage(int dmg, Object src) { - if ( src instanceof FireCracker) { - times=0; - } - - super.damage(dmg, src); - } - - - @Override - public void die(Object cause) { - - //super.die(cause); - - if (times>= (Dungeon.getMonth()<3 ? 1000 : 5)){ - yell(Messages.get(this, "escape")); - } else { - yell(Messages.get(this, "die")); - Dungeon.level.drop(new Vault(), pos).sprite.drop(); - } - times=0; - destroy(); - sprite.killAndErase(); - CellEmitter.get(pos).burst(ElmoParticle.FACTORY, 6); - - } - - public static YearBeast spawnAt(int pos) { - if (Level.passable[pos] && Actor.findChar(pos) == null) { - - YearBeast w = new YearBeast(); - w.pos = pos; - w.state = w.HUNTING; - GameScene.add(w, SPAWN_DELAY); - return w; - } else { - return null; - } - } - - @Override - public void notice() { - super.notice(); - yell(Messages.get(this, "notice")); - } - - - - @Override - public HashSet> immunities() { - return IMMUNITIES; - } - - @Override - public HashSet> resistances() { - return RESISTANCES; - } - - private static final HashSet> IMMUNITIES = new HashSet>(); - private static final HashSet> RESISTANCES = new HashSet>(); - static { - RESISTANCES.add(ToxicGas.class); - RESISTANCES.add(Poison.class); - RESISTANCES.add(ScrollOfPsionicBlast.class); - IMMUNITIES.add(Charm.class); - IMMUNITIES.add(Sleep.class); - IMMUNITIES.add(Terror.class); - IMMUNITIES.add(Fire.class); - IMMUNITIES.add(Vertigo.class); - IMMUNITIES.add(Burning.class); - } - -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/YearBeast2.java b/java/com/hmdzl/spspd/change/actors/mobs/YearBeast2.java deleted file mode 100644 index 43759433..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/YearBeast2.java +++ /dev/null @@ -1,239 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs; - -import java.util.HashSet; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.Blob; -import com.hmdzl.spspd.change.actors.blobs.Fire; -import com.hmdzl.spspd.change.actors.blobs.ToxicGas; -import com.hmdzl.spspd.change.actors.buffs.Amok; -import com.hmdzl.spspd.change.actors.buffs.AttackUp; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Burning; -import com.hmdzl.spspd.change.actors.buffs.Charm; -import com.hmdzl.spspd.change.actors.buffs.DefenceUp; -import com.hmdzl.spspd.change.actors.buffs.Frost; -import com.hmdzl.spspd.change.actors.buffs.GlassShield; -import com.hmdzl.spspd.change.actors.buffs.Poison; -import com.hmdzl.spspd.change.actors.buffs.Sleep; -import com.hmdzl.spspd.change.actors.buffs.Terror; -import com.hmdzl.spspd.change.actors.buffs.Vertigo; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.effects.particles.ElmoParticle; -import com.hmdzl.spspd.change.items.KindOfArmor; -import com.hmdzl.spspd.change.items.KindOfWeapon; -import com.hmdzl.spspd.change.items.TenguKey; -import com.hmdzl.spspd.change.items.armor.normalarmor.NormalArmor; -import com.hmdzl.spspd.change.items.armor.normalarmor.RubberArmor; -import com.hmdzl.spspd.change.items.armor.normalarmor.WoodenArmor; -import com.hmdzl.spspd.change.items.eggs.YearPetEgg; -import com.hmdzl.spspd.change.items.journalpages.Vault; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfPsionicBlast; -import com.hmdzl.spspd.change.items.summon.Honeypot; -import com.hmdzl.spspd.change.items.wands.Wand; -import com.hmdzl.spspd.change.items.wands.WandOfFlow; -import com.hmdzl.spspd.change.items.weapon.melee.FightGloves; -import com.hmdzl.spspd.change.items.weapon.melee.Knuckles; -import com.hmdzl.spspd.change.items.weapon.melee.special.FireCracker; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.mechanics.Ballistica; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.BeastYearSprite; -import com.hmdzl.spspd.change.sprites.ErrorSprite; -import com.hmdzl.spspd.change.sprites.TenguSprite; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -public class YearBeast2 extends Mob { - protected static final float SPAWN_DELAY = 1f; - { - //name = "YearBeast"; - spriteClass = BeastYearSprite.class; - baseSpeed = 1f; - - HP = HT = 1000; - EXP = 0; - evadeSkill = 30; - viewDistance = 6; - baseSpeed=1.5f; - flying = true; - } - - private int times=0; - - private static final String TIMES = "times"; - - @Override - public void storeInBundle( Bundle bundle ) { - super.storeInBundle(bundle); - bundle.put( TIMES, times ); - } - - @Override - public void restoreFromBundle( Bundle bundle ) { - super.restoreFromBundle(bundle); - times = bundle.getInt( TIMES ); - } - - @Override - public int damageRoll() { - return Random.NormalIntRange(40, 60); - } - - @Override - public int hitSkill(Char target) { - return 40; - } - - - @Override - public boolean act() { - times++; - return super.act(); - } - @Override - protected boolean canAttack(Char enemy) { - return Dungeon.level.distance( pos, enemy.pos ) <= 2 ; - } - @Override - public int attackProc(Char enemy, int damage) { - - if (Random.Int(2) == 0) { - Buff.affect(enemy, Burning.class).reignite(enemy); - } else { - Buff.affect(enemy, Frost.class); - } - - if (Random.Int(5) == 0) { - Buff.affect(enemy, Charm.class,4f); - } - - if (Random.Int(5) == 0) { - int oppositeDefender = enemy.pos + (enemy.pos - pos); - Ballistica trajectory = new Ballistica(enemy.pos, oppositeDefender, Ballistica.MAGIC_BOLT); - WandOfFlow.throwChar(enemy, trajectory, 1); - Buff.affect(enemy, Vertigo.class,3f); - } - - if (enemy == Dungeon.hero) { - Hero hero = Dungeon.hero; - KindOfWeapon weapon = hero.belongings.weapon; - KindOfArmor armor = hero.belongings.armor; - if (Random.Int(10)==0){ - if (Random.Int(2)==0) { - if (weapon != null && !(weapon instanceof Knuckles || weapon instanceof FightGloves) - && !weapon.cursed) { - hero.belongings.weapon = null; - Dungeon.level.drop(weapon, hero.pos).sprite.drop(); - GLog.w(Messages.get(this, "disarm")); - } - } else { - if (armor != null && !(armor instanceof WoodenArmor || armor instanceof RubberArmor || armor instanceof NormalArmor) - && !armor.cursed) { - hero.belongings.armor = null; - Dungeon.level.drop(armor, hero.pos).sprite.drop(); - GLog.w(Messages.get(this, "disarm")); - } - } - } - } - - return damage; - } - - @Override - public int defenseProc(Char enemy, int damage) { - - int dmg = damage; - if (dmg > 200 && buff(GlassShield.class) == null) { - Buff.affect(this,GlassShield.class).turns(3); - } - Buff.prolong(this,DefenceUp.class,2f).level(times); - Buff.prolong(this,AttackUp.class,4f).level(times); - return super.defenseProc(enemy, damage); - } - - @Override - public void damage(int dmg, Object src) { - - if(src instanceof Wand) { - dmg = (int)(dmg/3); - } - - if ( src instanceof FireCracker) { - times=0; - } - - if (times > 50) - times-=3; - - super.damage(dmg, src); - } - - - @Override - public void die(Object cause) { - super.die(cause); - Dungeon.level.drop(new YearPetEgg(), pos).sprite.drop(); - } - - @Override - public void notice() { - super.notice(); - yell(Messages.get(this, "notice")); - } - - - - @Override - public HashSet> immunities() { - return IMMUNITIES; - } - - @Override - public HashSet> resistances() { - return RESISTANCES; - } - - private static final HashSet> IMMUNITIES = new HashSet>(); - private static final HashSet> RESISTANCES = new HashSet>(); - static { - RESISTANCES.add(ToxicGas.class); - RESISTANCES.add(Poison.class); - RESISTANCES.add(ScrollOfPsionicBlast.class); - IMMUNITIES.add(Charm.class); - IMMUNITIES.add(Sleep.class); - IMMUNITIES.add(Terror.class); - IMMUNITIES.add(Fire.class); - IMMUNITIES.add(Vertigo.class); - IMMUNITIES.add(Burning.class); - } - -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/Yog.java b/java/com/hmdzl/spspd/change/actors/mobs/Yog.java deleted file mode 100644 index ffb0cd5c..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/Yog.java +++ /dev/null @@ -1,747 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs; - -import java.time.Year; -import java.util.ArrayList; -import java.util.HashSet; - -import com.hmdzl.spspd.change.actors.buffs.Silent; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.items.DolyaSlate; -import com.hmdzl.spspd.change.items.Elevator; -import com.hmdzl.spspd.change.items.journalpages.Vault; -import com.hmdzl.spspd.change.levels.HallsBossLevel; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.ResultDescriptions; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.Blob; -import com.hmdzl.spspd.change.actors.blobs.Fire; -import com.hmdzl.spspd.change.actors.blobs.ToxicGas; -import com.hmdzl.spspd.change.actors.buffs.Amok; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Burning; -import com.hmdzl.spspd.change.actors.buffs.Charm; -import com.hmdzl.spspd.change.actors.buffs.Ooze; -import com.hmdzl.spspd.change.actors.buffs.Poison; -import com.hmdzl.spspd.change.actors.buffs.Roots; -import com.hmdzl.spspd.change.actors.buffs.Sleep; -import com.hmdzl.spspd.change.actors.buffs.Terror; -import com.hmdzl.spspd.change.actors.buffs.Vertigo; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Pushing; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.effects.particles.ShadowParticle; -import com.hmdzl.spspd.change.items.keys.SkeletonKey; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfPsionicBlast; -import com.hmdzl.spspd.change.items.weapon.enchantments.EnchantmentDark; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.mechanics.Ballistica; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.BurningFistSprite; -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.hmdzl.spspd.change.sprites.InfectingFistSprite; -import com.hmdzl.spspd.change.sprites.LarvaSprite; -import com.hmdzl.spspd.change.sprites.PinningFistSprite; -import com.hmdzl.spspd.change.sprites.RottingFistSprite; -import com.hmdzl.spspd.change.sprites.YogSprite; -import com.hmdzl.spspd.change.utils.GLog; - -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -public class Yog extends Mob { - - { - spriteClass = YogSprite.class; - - HP = HT = 2000; - - EXP = 50; - - state = PASSIVE; - - properties.add(Property.UNKNOW); - properties.add(Property.BOSS); - } - - private static final int REGENERATION = 50; - private int breaks=0; - - public boolean checkYear() { - - int yearAlive = 0; - if (Dungeon.level.mobs != null) { - for (Mob mob : Dungeon.level.mobs) { - if (mob instanceof YearBeast) { - yearAlive++; - } - } - } - if (yearAlive++ > 0) { - return true; - } else { - return false; - } - } - - @Override - public boolean act() { - - if( 4 - breaks > 5 * HP / HT ) { - breaks++; - int newPos = -1; - for (int i = 0; i < 20; i++) { - newPos = Dungeon.level.randomRespawnCellMob(); - if (newPos != -1) { - break; - } - } - if (newPos != -1) { - Actor.freeCell(pos); - CellEmitter.get(pos).start(Speck.factory(Speck.LIGHT), 0.2f, 3); - pos = newPos; - sprite.place(pos); - sprite.visible = Dungeon.visible[pos]; - GLog.n(Messages.get(this, "blink")); - } - - if (breaks == 4 && !checkYear()){ - int newPos2; - do { - newPos2 = Random.Int(Level.getLength()); - } while (!Level.passable[newPos2] - || Level.adjacent(newPos2, Dungeon.hero.pos) - || Actor.findChar(newPos2) != null); - YearBeast.spawnAt(newPos2); - } - return true; - } - - return super.act(); - } - - private static final String BREAKS = "breaks"; - - @Override - public void storeInBundle( Bundle bundle ) { - super.storeInBundle(bundle); - bundle.put( BREAKS, breaks ); - } - - @Override - public void restoreFromBundle( Bundle bundle ) { - super.restoreFromBundle(bundle); - breaks = bundle.getInt( BREAKS ); - - } - private static int fistsCount = 0; - - public Yog() { - super(); - } - - public void spawnFists() { - RottingFist fist1 = new RottingFist(); - BurningFist fist2 = new BurningFist(); - PinningFist fist3 = new PinningFist(); - InfectingFist fist4 = new InfectingFist(); - - - fist1.pos = Dungeon.level.randomRespawnCellMob(); - fist2.pos = Dungeon.level.randomRespawnCellMob(); - fist3.pos = Dungeon.level.randomRespawnCellMob(); - fist4.pos = Dungeon.level.randomRespawnCellMob(); - - GameScene.add(fist1); - GameScene.add(fist2); - GameScene.add(fist3); - GameScene.add(fist4); - } - - @Override - public int drRoll() { - - int checkFists = 0; - - for (Mob mob : Dungeon.level.mobs) { - if (mob instanceof BurningFist || mob instanceof RottingFist || mob instanceof PinningFist || mob instanceof InfectingFist) { - checkFists++; - } - } - - return 0+(30*checkFists); - } - - @Override - public int damageRoll() { - return Random.NormalIntRange(54, 96); - } - - @Override - public void damage(int dmg, Object src) { - if (dmg > HP && (src instanceof Hero)) { - dmg = 1; - } - super.damage(dmg, src); - } - - @Override - public int defenseProc(Char enemy, int damage) { - - ArrayList spawnPoints = new ArrayList(); - - for (int i = 0; i < Level.NEIGHBOURS8.length; i++) { - int p = pos + Level.NEIGHBOURS8[i]; - if (Actor.findChar(p) == null - && (Level.passable[p] || Level.avoid[p])) { - spawnPoints.add(p); - } - } - - if (spawnPoints.size() > 0) { - Larva larva = new Larva(); - larva.pos = Random.element(spawnPoints); - - GameScene.add(larva); - Actor.addDelayed(new Pushing(larva, pos, larva.pos), -1); - } - - for (Mob mob : Dungeon.level.mobs) { - if (mob instanceof BurningFist || mob instanceof RottingFist || mob instanceof InfectingFist || mob instanceof PinningFist - || mob instanceof Larva) { - mob.aggro(enemy); - } - } - if (fistsCount<1){ - spawnFists(); - sprite.emitter().burst(ShadowParticle.UP, 2); - this.damage(REGENERATION,this); - } - return super.defenseProc(enemy, damage); - } - - @Override - public void beckon(int cell) { - } - - @SuppressWarnings("unchecked") - @Override - public void die(Object cause) { - - ((HallsBossLevel) Dungeon.level).unseal(); - - for (Mob mob : (Iterable) Dungeon.level.mobs.clone()) { - if (mob instanceof BurningFist || mob instanceof RottingFist || mob instanceof Eye || mob instanceof PinningFist || mob instanceof InfectingFist) { - mob.die(cause); - } - } - - if (!Dungeon.limitedDrops.journal.dropped()){ - Dungeon.level.drop(new DolyaSlate(), pos).sprite.drop(); - Dungeon.limitedDrops.journal.drop(); - } - Dungeon.level.drop(new Elevator(), pos).sprite.drop(); - //Dungeon.level.drop(new Vault(), pos).sprite.drop(); - GameScene.bossSlain(); - Dungeon.level.drop(new SkeletonKey(Dungeon.depth), pos).sprite.drop(); - //Dungeon.level.drop(new Gold(Random.Int(6000, 8000)), pos).sprite.drop(); - super.die(cause); - - yell(Messages.get(this, "die")); - } - - @Override - public void notice() { - super.notice(); - yell(Messages.get(this, "notice")); - } - - - private static final HashSet> IMMUNITIES = new HashSet>(); - static { - - IMMUNITIES.add(EnchantmentDark.class); - IMMUNITIES.add(Terror.class); - IMMUNITIES.add(Amok.class); - IMMUNITIES.add(Charm.class); - IMMUNITIES.add(Sleep.class); - IMMUNITIES.add(Burning.class); - IMMUNITIES.add(ToxicGas.class); - IMMUNITIES.add(ScrollOfPsionicBlast.class); - IMMUNITIES.add(Vertigo.class); - } - - @Override - public HashSet> immunities() { - return IMMUNITIES; - } - - public static class RottingFist extends Mob { - - private static final int REGENERATION = 50; - - { - //name = "rotting fist"; - spriteClass = RottingFistSprite.class; - - HP = HT = 1500; - evadeSkill = 25; - - EXP = 0; - - state = WANDERING; - properties.add(Property.ELEMENT); - properties.add(Property.BOSS); - } - - public RottingFist() { - super(); - fistsCount++; - } - - @Override - public void die(Object cause) { - super.die(cause); - fistsCount--; - } - - @Override - public int hitSkill(Char target) { - return 36; - } - - @Override - public int damageRoll() { - return Random.NormalIntRange(44, 86); - } - - @Override - public int drRoll() { - return 35; - } - - @Override - public int attackProc(Char enemy, int damage) { - if (Random.Int(3) == 0) { - Buff.affect(enemy, Ooze.class); - enemy.sprite.burst(0xFF000000, 5); - } - - return damage; - } - - @Override - public boolean act() { - - if (Level.water[pos] && HP < HT) { - sprite.emitter().burst(ShadowParticle.UP, 2); - HP += REGENERATION; - } - - return super.act(); - } - - private static final HashSet> RESISTANCES = new HashSet>(); - static { - RESISTANCES.add(ToxicGas.class); - RESISTANCES.add(EnchantmentDark.class); - - } - - @Override - public HashSet> resistances() { - return RESISTANCES; - } - - private static final HashSet> IMMUNITIES = new HashSet>(); - static { - IMMUNITIES.add(Amok.class); - IMMUNITIES.add(Sleep.class); - IMMUNITIES.add(Terror.class); - IMMUNITIES.add(Poison.class); - IMMUNITIES.add(Vertigo.class); - IMMUNITIES.add(ToxicGas.class); - } - - @Override - public HashSet> immunities() { - return IMMUNITIES; - } - } - - public static class BurningFist extends Mob { - - { - spriteClass = BurningFistSprite.class; - - HP = HT = 1000; - evadeSkill = 25; - - EXP = 0; - - state = WANDERING; - properties.add(Property.ELEMENT); - properties.add(Property.BOSS); - } - - public BurningFist() { - super(); - fistsCount++; - } - - @Override - public void die(Object cause) { - super.die(cause); - fistsCount--; - } - - @Override - public int hitSkill(Char target) { - return 36; - } - - @Override - public int damageRoll() { - return Random.NormalIntRange(40, 52); - } - - @Override - public int drRoll() { - return 25; - } - - @Override - protected boolean canAttack(Char enemy) { if (buff(Silent.class) != null){ - return Level.adjacent(pos, enemy.pos) && (!isCharmedBy(enemy)); - } else - return new Ballistica( pos, enemy.pos, Ballistica.MAGIC_BOLT).collisionPos == enemy.pos; - } - - @Override - public boolean attack(Char enemy) { - - if (!Level.adjacent(pos, enemy.pos)) { - spend(attackDelay()); - - if (hit(this, enemy, true)) { - - int dmg = damageRoll(); - enemy.damage(dmg, this); - - enemy.sprite.bloodBurstA(sprite.center(), dmg); - enemy.sprite.flash(); - - if (!enemy.isAlive() && enemy == Dungeon.hero) { - Dungeon.fail(Messages.format(ResultDescriptions.MOB)); - //GLog.n(TXT_KILL, name); - } - return true; - - } else { - - enemy.sprite.showStatus(CharSprite.NEUTRAL, - enemy.defenseVerb()); - return false; - } - } else { - return super.attack(enemy); - } - } - - @Override - public boolean act() { - - for (int i = 0; i < Level.NEIGHBOURS9.length; i++) { - GameScene.add(Blob.seed(pos + Level.NEIGHBOURS9[i], 2, - Fire.class)); - } - - return super.act(); - } - - private static final HashSet> RESISTANCES = new HashSet>(); - static { - RESISTANCES.add(EnchantmentDark.class); - - } - - @Override - public HashSet> resistances() { - return RESISTANCES; - } - - private static final HashSet> IMMUNITIES = new HashSet>(); - static { - IMMUNITIES.add(Amok.class); - IMMUNITIES.add(Sleep.class); - IMMUNITIES.add(Terror.class); - IMMUNITIES.add(Burning.class); - IMMUNITIES.add(ScrollOfPsionicBlast.class); - IMMUNITIES.add(Vertigo.class); - IMMUNITIES.add(ToxicGas.class); - } - - @Override - public HashSet> immunities() { - return IMMUNITIES; - } - } - - public static class InfectingFist extends Mob { - - { - spriteClass = InfectingFistSprite.class; - - HP = HT = 1500; - evadeSkill = 25; - - EXP = 0; - - state = WANDERING; - properties.add(Property.ELEMENT); - properties.add(Property.BOSS); - } - - public InfectingFist() { - super(); - fistsCount++; - } - - @Override - public void die(Object cause) { - super.die(cause); - fistsCount--; - } - - @Override - public int hitSkill(Char target) { - return 36; - } - - @Override - public int damageRoll() { - return Random.NormalIntRange(44, 86); - } - - @Override - public int drRoll() { - return 35; - } - - @Override - public int attackProc(Char enemy, int damage) { - if (Random.Int(2) == 0) { - Buff.affect(enemy, Poison.class).set(Random.Int(7, 9) * Poison.durationFactor(enemy)); - state = FLEEING; - } - - return damage; - } - - @Override - public boolean act() { - - GameScene.add(Blob.seed(pos, 30, ToxicGas.class)); - - return super.act(); - } - - private static final HashSet> RESISTANCES = new HashSet>(); - static { - RESISTANCES.add(ToxicGas.class); - RESISTANCES.add(EnchantmentDark.class); - - } - - @Override - public HashSet> resistances() { - return RESISTANCES; - } - - private static final HashSet> IMMUNITIES = new HashSet>(); - static { - IMMUNITIES.add(Amok.class); - IMMUNITIES.add(Sleep.class); - IMMUNITIES.add(Terror.class); - IMMUNITIES.add(Poison.class); - IMMUNITIES.add(Vertigo.class); - IMMUNITIES.add(ToxicGas.class); - } - - @Override - public HashSet> immunities() { - return IMMUNITIES; - } - } - - - public static class PinningFist extends Mob { - - { - spriteClass = PinningFistSprite.class; - - HP = HT = 1000; - evadeSkill = 25; - - EXP = 0; - - state = WANDERING; - properties.add(Property.ELEMENT); - properties.add(Property.BOSS); - } - - public PinningFist() { - super(); - fistsCount++; - } - - @Override - public void die(Object cause) { - super.die(cause); - fistsCount--; - } - - @Override - public int hitSkill(Char target) { - return 36; - } - - @Override - public int damageRoll() { - return Random.NormalIntRange(30, 42); - } - - @Override - public int drRoll() { - return 25; - } - - @Override - protected boolean canAttack(Char enemy) { if (buff(Silent.class) != null){ - return Level.adjacent(pos, enemy.pos) && (!isCharmedBy(enemy)); - } else - return new Ballistica( pos, enemy.pos, Ballistica.MAGIC_BOLT).collisionPos == enemy.pos; - } - - @Override - protected boolean getCloser(int target) { - if (state == HUNTING) { - return enemySeen && getFurther(target); - } else { - return super.getCloser(target); - } - } - - @Override - public boolean attack(Char enemy) { - - if (!Level.adjacent(pos, enemy.pos)) { - spend(attackDelay()); - - if (hit(this, enemy, true)) { - - int dmg = damageRoll(); - enemy.damage(dmg, this); - - if(Random.Int(10)==0){ - Buff.prolong(enemy, Roots.class, 20); - } - - enemy.sprite.bloodBurstA(sprite.center(), dmg); - enemy.sprite.flash(); - - if (!enemy.isAlive() && enemy == Dungeon.hero) { - Dungeon.fail(Messages.format(ResultDescriptions.MOB)); - GLog.n(TXT_KILL, name); - } - return true; - - } else { - - enemy.sprite.showStatus(CharSprite.NEUTRAL, - enemy.defenseVerb()); - return false; - } - } else { - return super.attack(enemy); - } - } - - - private static final HashSet> RESISTANCES = new HashSet>(); - static { - RESISTANCES.add(ToxicGas.class); - RESISTANCES.add(EnchantmentDark.class); - - } - - @Override - public HashSet> resistances() { - return RESISTANCES; - } - - private static final HashSet> IMMUNITIES = new HashSet>(); - static { - IMMUNITIES.add(Amok.class); - IMMUNITIES.add(Sleep.class); - IMMUNITIES.add(Terror.class); - IMMUNITIES.add(Burning.class); - IMMUNITIES.add(ScrollOfPsionicBlast.class); - IMMUNITIES.add(Vertigo.class); - } - - @Override - public HashSet> immunities() { - return IMMUNITIES; - } - } - - public static class Larva extends Mob { - - { - spriteClass = LarvaSprite.class; - - HP = HT = 25; - evadeSkill = 20; - - EXP = 0; - - state = HUNTING; - properties.add(Property.UNKNOW); - } - - @Override - public int hitSkill(Char target) { - return 30; - } - - @Override - public int damageRoll() { - return Random.NormalIntRange(15, 20); - } - - @Override - public int drRoll() { - return 8; - } - - } -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/Zombie.java b/java/com/hmdzl/spspd/change/actors/mobs/Zombie.java deleted file mode 100644 index c65cecc3..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/Zombie.java +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.ToxicGas; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Burning; -import com.hmdzl.spspd.change.actors.buffs.Poison; -import com.hmdzl.spspd.change.items.food.meatfood.Meat; -import com.hmdzl.spspd.change.items.potions.PotionOfToxicGas; -import com.hmdzl.spspd.change.items.wands.WandOfFirebolt; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ZombieSprite; -import com.watabou.utils.Random; - -import java.util.HashSet; - -public class Zombie extends Mob { - - - { - spriteClass = ZombieSprite.class; - - HP = HT = 70+(adj(0)*Random.NormalIntRange(3, 7)); - evadeSkill = 9+adj(1); - baseSpeed = 2f; - - - EXP = 7; - maxLvl = 18; - - state = WANDERING; - - loot = PotionOfToxicGas.class; - lootChance = 0.1f; - - properties.add(Property.UNDEAD); - } - - @Override - protected float attackDelay() { - return 2f; - } - - @Override - public int damageRoll() { - return Random.NormalIntRange(10+adj(0), 20+adj(0)); - } - - @Override - public int hitSkill(Char target) { - return 15 +adj(0); - } - - @Override - public int drRoll() { - return Random.NormalIntRange(3, 8); - } - - @Override - public int attackProc(Char enemy, int damage) { - if (Random.Int(5) == 0) { - Buff.affect(enemy, Poison.class).set( - Random.Int(7, 9) * Poison.durationFactor(enemy)); - } - - return damage; - } - - private static final HashSet> RESISTANCES = new HashSet>(); - private static final HashSet> WEAKNESS = new HashSet>(); - static { - WEAKNESS.add(Burning.class); - WEAKNESS.add(WandOfFirebolt.class); - RESISTANCES.add(ToxicGas.class); - } - - @Override - public HashSet> resistances() { - return RESISTANCES; - } - - @Override - public HashSet> weakness() { - return WEAKNESS; - } -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/Zot.java b/java/com/hmdzl/spspd/change/actors/mobs/Zot.java deleted file mode 100644 index c588b890..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/Zot.java +++ /dev/null @@ -1,319 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs; - -import java.util.ArrayList; -import java.util.HashSet; - -import com.hmdzl.spspd.change.actors.buffs.Silent; -import com.hmdzl.spspd.change.items.SoulCollect; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.ToxicGas; -import com.hmdzl.spspd.change.actors.buffs.Amok; -import com.hmdzl.spspd.change.actors.buffs.Burning; -import com.hmdzl.spspd.change.actors.buffs.Charm; -import com.hmdzl.spspd.change.actors.buffs.Poison; -import com.hmdzl.spspd.change.actors.buffs.Sleep; -import com.hmdzl.spspd.change.actors.buffs.Terror; -import com.hmdzl.spspd.change.actors.buffs.Vertigo; -import com.hmdzl.spspd.change.actors.buffs.Paralysis; -import com.hmdzl.spspd.change.actors.hero.HeroClass; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Pushing; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.misc.AutoPotion.AutoHealPotion; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfPsionicBlast; -import com.hmdzl.spspd.change.items.weapon.enchantments.EnchantmentDark; - -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.mechanics.Ballistica; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ZotSprite; - -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Random; - -public class Zot extends Mob { - - private static final int JUMP_DELAY = 10; - - { - spriteClass = ZotSprite.class; - baseSpeed = 0.5f; - - HP = HT = 25000; - //HP = HT = 25; - EXP = 20; - evadeSkill = 40; - //evadeSkill = 0; - - loot = new SoulCollect(); - lootChance = 1f; - - properties.add(Property.UNKNOW); - properties.add(Property.BOSS); - } - - private int timeToJump = JUMP_DELAY; - - - @Override - public int damageRoll() { - return Random.NormalIntRange(75, 125); - //return Random.NormalIntRange(1, 2); - } - - @Override - public int hitSkill(Char target) { - return 200; - } - - @Override - public int drRoll() { - return Random.NormalIntRange(25, 45); - //return 0; - } - - @Override - protected boolean act() { - - if (paralysed > 0) { - yell(Messages.get(this,"pain")); - - if(!checkEyes()){ - ArrayList spawnPoints = new ArrayList(); - - for (int i = 0; /*i < Level.NEIGHBOURS4.length*/ i < 2; i++) { - int p = Dungeon.hero.pos + Level.NEIGHBOURS4[i]; - if (Actor.findChar(p) == null - && (Level.passable[p] || Level.avoid[p])) { - spawnPoints.add(p); - } - } - - if (spawnPoints.size() > 0 && Random.Int(10) == 0) { - MagicEye eye = new MagicEye(); - eye.pos = Random.element(spawnPoints); - - GameScene.add(eye); - Actor.addDelayed(new Pushing(eye, pos, eye.pos), -1); - } - } - - if (HP < HT) { - sprite.emitter().burst( Speck.factory( Speck.HEALING ), 1 ); - HP = HP + 5; - } - } - - - boolean result = super.act(); - - int regen = Dungeon.hero.buff(AutoHealPotion.class) != null ? 1 : Random.Int(2,5); - - - if (HP < HT) { - sprite.emitter().burst( Speck.factory( Speck.HEALING ), 1 ); - HP = HP + regen; - } - return result; - } - - @SuppressWarnings("unchecked") - @Override - public void die(Object cause) { - - yell(Messages.get(this,"die")); - - super.die(cause); - - GameScene.bossSlain(); - //Dungeon.level.locked=false; - Dungeon.zotkilled=true; - - for (Mob mob : Dungeon.level.mobs.toArray(new Mob[Dungeon.level.mobs.size()])) { - if (mob instanceof ZotPhase || mob instanceof MagicEye) { - mob.die(null); - } - } - } - - @Override - protected boolean getCloser(int target) { - if (Level.fieldOfView[target]) { - jump(); - return true; - } else { - return super.getCloser(target); - } - } - - @Override - protected boolean canAttack(Char enemy) { - if (buff(Silent.class) != null){ - return Level.adjacent(pos, enemy.pos) && (!isCharmedBy(enemy)); - } else - return new Ballistica( pos, enemy.pos, Ballistica.MAGIC_BOLT).collisionPos == enemy.pos; - } - - @Override - protected boolean doAttack(Char enemy) { - timeToJump--; - if (timeToJump <= 0 && Level.adjacent(pos, enemy.pos)) { - jump(); - return true; - } else { - return super.doAttack(enemy); - } - } - - private void jump() { - timeToJump = JUMP_DELAY; - - if (!checkPhases()){ - ArrayList spawnPoints = new ArrayList(); - - for (int i = 0; i < Level.NEIGHBOURS8.length; i++) { - int p = pos + Level.NEIGHBOURS8[i]; - if (Actor.findChar(p) == null - && (Level.passable[p] || Level.avoid[p])) { - spawnPoints.add(p); - } - } - - if (spawnPoints.size() > 0) { - ZotPhase zot = new ZotPhase(); - zot.pos = Random.element(spawnPoints); - - GameScene.add(zot); - Actor.addDelayed(new Pushing(zot, pos, zot.pos), -1); - } - } - - int newPos; - do { - newPos = Random.Int(Level.getLength()); - } while (!Level.fieldOfView[newPos] || !Level.passable[newPos] - || Level.adjacent(newPos, enemy.pos) - || Actor.findChar(newPos) != null); - - sprite.move(pos, newPos); - move(newPos); - - if (Dungeon.visible[newPos]) { - CellEmitter.get(newPos).burst(Speck.factory(Speck.WOOL), 6); - Sample.INSTANCE.play(Assets.SND_PUFF); - } - - spend(1 / speed()); - } - - private boolean checkPhases(){ - boolean check = false; - int phases = 0; - for (Mob mob : Dungeon.level.mobs) { - if (mob != null && mob instanceof ZotPhase) { - phases++; - if (phases>6){ - check=true; - } - } - } - return check; - - } - - private boolean checkEyes(){ - boolean check = false; - int phases = 0; - for (Mob mob : Dungeon.level.mobs) { - if (mob != null && mob instanceof MagicEye) { - phases++; - if (phases>10){ - check=true; - } - } - } - return check; - } - - @Override - public void damage(int dmg, Object src) { - - if(!checkPhases()){ - ArrayList spawnPoints = new ArrayList(); - - for (int i = 0; i < Level.NEIGHBOURS8.length; i++) { - int p = Dungeon.hero.pos + Level.NEIGHBOURS8[i]; - if (Actor.findChar(p) == null - && (Level.passable[p] || Level.avoid[p])) { - spawnPoints.add(p); - } - } - - if (spawnPoints.size() > 0) { - MagicEye eye = new MagicEye(); - eye.pos = Random.element(spawnPoints); - - GameScene.add(eye); - Actor.addDelayed(new Pushing(eye, pos, eye.pos), -1); - } - } - - super.damage(dmg, src); - } - - @Override - public void notice() { - super.notice(); - yell(Messages.get(this,"notice")); - } - - private static final HashSet> RESISTANCES = new HashSet>(); - private static final HashSet> IMMUNITIES = new HashSet>(); - static { - RESISTANCES.add(ToxicGas.class); - RESISTANCES.add(Poison.class); - RESISTANCES.add(EnchantmentDark.class); - - IMMUNITIES.add(EnchantmentDark.class); - IMMUNITIES.add(Terror.class); - IMMUNITIES.add(Amok.class); - IMMUNITIES.add(Charm.class); - IMMUNITIES.add(Sleep.class); - IMMUNITIES.add(Burning.class); - IMMUNITIES.add(ToxicGas.class); - IMMUNITIES.add(ScrollOfPsionicBlast.class); - IMMUNITIES.add(Vertigo.class); - IMMUNITIES.add(Paralysis.class); - } - - @Override - public HashSet> resistances() { - return RESISTANCES; - } - - @Override - public HashSet> immunities() { - return IMMUNITIES; - } -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/ZotPhase.java b/java/com/hmdzl/spspd/change/actors/mobs/ZotPhase.java deleted file mode 100644 index ecc6cb8d..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/ZotPhase.java +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs; - -import java.util.HashSet; - -import com.hmdzl.spspd.change.actors.buffs.Silent; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.ResultDescriptions; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.effects.particles.SparkParticle; -import com.hmdzl.spspd.change.items.Generator; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.traps.LightningTrap; -import com.hmdzl.spspd.change.mechanics.Ballistica; -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.hmdzl.spspd.change.sprites.ZotPhaseSprite; - -import com.watabou.noosa.Camera; -import com.watabou.utils.Callback; -import com.watabou.utils.Random; - -public class ZotPhase extends Mob{ - - private static final float TIME_TO_ZAP = 2f; - - private static final String TXT_LIGHTNING_KILLED = "%s's lightning bolt killed you..."; - - { - spriteClass = ZotPhaseSprite.class; - - HP = HT = 200; - evadeSkill = 40; - baseSpeed = 1f; - - EXP = 30; - - loot = Generator.Category.SCROLL; - lootChance = 0.33f; - - properties.add(Property.UNKNOW); - - } - - @Override - public int damageRoll() { - return Random.NormalIntRange(115, 160+adj(1)); - } - - @Override - public int hitSkill(Char target) { - return 100+adj(0); - } - - @Override - protected float attackDelay() { - return 2f; - } - - - @Override - public int drRoll() { - return 0; - } - - @Override - protected boolean canAttack(Char enemy) { if (buff(Silent.class) != null){ - return Level.adjacent(pos, enemy.pos) && (!isCharmedBy(enemy)); - } else - return new Ballistica( pos, enemy.pos, Ballistica.MAGIC_BOLT).collisionPos == enemy.pos; - } - - private static final HashSet> RESISTANCES = new HashSet>(); - static { - RESISTANCES.add(LightningTrap.Electricity.class); - } - - @Override - public HashSet> resistances() { - return RESISTANCES; - } -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/npcs/AFly.java b/java/com/hmdzl/spspd/change/actors/mobs/npcs/AFly.java deleted file mode 100644 index 22716c2e..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/npcs/AFly.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs.npcs; - - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.AFlySprite; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.windows.WndAflyInfo; -import com.watabou.utils.Random; - -public class AFly extends NPC { - - { - //name = "AFly"; - spriteClass = AFlySprite.class; - //state = WANDERING; - properties.add(Property.ELF); - properties.add(Property.DEMONIC); - } - - /*@Override - protected boolean act() { - throwItem(); - return super.act(); - } */ - - @Override - public int evadeSkill(Char enemy) { - return 1000; - } - - - @Override - protected Char chooseEnemy() { - return null; - } - - @Override - public void damage(int dmg, Object src) { - } - - @Override - public void add(Buff buff) { - } - - @Override - public boolean reset() { - return true; - } - - - - @Override - public boolean interact() { - - sprite.turnTo(pos, Dungeon.hero.pos); - switch (Random.Int (2)) { - case 0: - yell(Messages.get(this, "yell1")); - break; - case 1: - GameScene.show(new WndAflyInfo()); - break; - } - return true; - } - -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/npcs/ARealMan.java b/java/com/hmdzl/spspd/change/actors/mobs/npcs/ARealMan.java deleted file mode 100644 index 05d44ba6..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/npcs/ARealMan.java +++ /dev/null @@ -1,64 +0,0 @@ -package com.hmdzl.spspd.change.actors.mobs.npcs; - - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ARealManSprite; -import com.hmdzl.spspd.change.sprites.G2159687Sprite; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.windows.WndHotel; -import com.hmdzl.spspd.change.windows.WndMix; -import com.hmdzl.spspd.change.windows.WndONS; -import com.watabou.utils.Random; - -public class ARealMan extends NPC { - - { - //name = Messages.get(this,"name"); - spriteClass = ARealManSprite.class; - properties.add(Property.BEAST); - } - - @Override - protected boolean act() { - throwItem(); - return super.act(); - } - - @Override - public int evadeSkill(Char enemy) { - return 1000; - } - - - @Override - protected Char chooseEnemy() { - return null; - } - - @Override - public void damage(int dmg, Object src) { - } - - @Override - public void add(Buff buff) { - } - - @Override - public boolean reset() { - return true; - } - - - - @Override - public boolean interact() { - - sprite.turnTo(pos, Dungeon.hero.pos); - GameScene.show(new WndMix()); - return true; - } - -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/actors/mobs/npcs/Apostle.java b/java/com/hmdzl/spspd/change/actors/mobs/npcs/Apostle.java deleted file mode 100644 index 2cfa52a3..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/npcs/Apostle.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs.npcs; - - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.sprites.ApostleSprite; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.utils.Random; - -public class Apostle extends NPC { - - { - //name = "apostle"; - spriteClass = ApostleSprite.class; - //state = WANDERING; - properties.add(Property.MECH); - properties.add(Property.ELEMENT); - } - - /*@Override - protected boolean act() { - throwItem(); - return super.act(); - } */ - - @Override - public int evadeSkill(Char enemy) { - return 1000; - } - - - @Override - protected Char chooseEnemy() { - return null; - } - - @Override - public void damage(int dmg, Object src) { - } - - @Override - public void add(Buff buff) { - } - - @Override - public boolean reset() { - return true; - } - - - - @Override - public boolean interact() { - - sprite.turnTo(pos, Dungeon.hero.pos); - switch (Random.Int (2)) { - case 0: - yell(Messages.get(this, "yell1")); - break; - case 1: - yell(Messages.get(this, "yell1")); - break; - } - return true; - } - -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/npcs/Bilboldev.java b/java/com/hmdzl/spspd/change/actors/mobs/npcs/Bilboldev.java deleted file mode 100644 index 767dff06..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/npcs/Bilboldev.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs.npcs; - - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.sprites.BilboldevSprite; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.utils.Random; - -public class Bilboldev extends NPC { - - { - //name = "Bilboldev"; - spriteClass = BilboldevSprite.class; - properties.add(Property.MECH); - } - - @Override - protected boolean act() { - throwItem(); - return super.act(); - } - - @Override - public int evadeSkill(Char enemy) { - return 1000; - } - - - @Override - protected Char chooseEnemy() { - return null; - } - - @Override - public void damage(int dmg, Object src) { - } - - @Override - public void add(Buff buff) { - } - - @Override - public boolean reset() { - return true; - } - - - - @Override - public boolean interact() { - - sprite.turnTo(pos, Dungeon.hero.pos); - switch (Random.Int (3)) { - case 0: - yell(Messages.get(this, "yell1")); - break; - case 1: - yell(Messages.get(this, "yell2")); - break; - case 2: - yell(Messages.get(this, "yell3")); - break; - } - return true; - } -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/npcs/Blacksmith.java b/java/com/hmdzl/spspd/change/actors/mobs/npcs/Blacksmith.java deleted file mode 100644 index 260f14a1..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/npcs/Blacksmith.java +++ /dev/null @@ -1,370 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs.npcs; - -import java.util.Collection; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.Journal; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.items.EquipableItem; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.TriForce; -import com.hmdzl.spspd.change.items.TriforceOfCourage; -import com.hmdzl.spspd.change.items.TriforceOfPower; -import com.hmdzl.spspd.change.items.TriforceOfWisdom; -import com.hmdzl.spspd.change.items.quest.DarkGold; -import com.hmdzl.spspd.change.items.quest.Pickaxe; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfUpgrade; -import com.hmdzl.spspd.change.items.weapon.melee.special.Handcannon; -import com.hmdzl.spspd.change.levels.Room; -import com.hmdzl.spspd.change.levels.Room.Type; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.BlacksmithSprite; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.utils.GLog; -import com.hmdzl.spspd.change.windows.WndBlacksmith; -import com.hmdzl.spspd.change.windows.WndQuest; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -public class Blacksmith extends NPC { - - private static final String TXT_GOLD_1 = "Hey human! Wanna be useful, eh? Take dis pickaxe and mine me some _dark gold ore_, _15 pieces_ should be enough. " - + "What do you mean, how am I gonna pay? You greedy...\n" - + "Ok, ok, I don't have money to pay, but I can do some smithin' for you. Consider yourself lucky, " - + "We're the only blacksmiths around."; - private static final String TXT_BLOOD_1 = "Hey human! Wanna be useful, eh? Take dis pickaxe and _kill a bat_ wit' it, I need its blood on the head. " - + "What do you mean, how am I gonna pay? You greedy...\n" - + "Ok, ok, I don't have money to pay, but I can do some smithin' for you. Consider yourself lucky, " - + "We're the only blacksmiths around."; - private static final String TXT2 = "Are you kiddin' me? Where is my pickaxe?!"; - private static final String TXT3 = "Dark gold ore. 15 pieces. Seriously, is it dat hard?"; - private static final String TXT4 = "I said I need bat blood on the pickaxe. Chop chop!"; - private static final String TXT_COMPLETED = "Oh, you have returned... Better late dan never."; - private static final String TXT_GET_LOST = "I'm busy. Get lost!"; - - private static final String TXT_LOOKS_BETTER = "your %s certainly looks better now"; - private static final String COLLECTED = "Finally, the TriForce. I will forge them for you..."; - - { - //name = "troll blacksmith named Bop"; - spriteClass = BlacksmithSprite.class; - properties.add(Property.TROLL); - properties.add(Property.IMMOVABLE); - } - - - @Override - protected boolean act() { - throwItem(); - return super.act(); - } - - @Override - public boolean interact() { - - sprite.turnTo(pos, Dungeon.hero.pos); - - if (checksan()){ - tell(Messages.get(this, "triforce")); - TriForce san = new TriForce(); - Dungeon.triforce = true; - Dungeon.level.drop(san, Dungeon.hero.pos).sprite.drop(); - } - - if (!Quest.given) { - - GameScene.show(new WndQuest(this, - Quest.alternative ? Messages.get(this, "blood_1") : Messages.get(this, "gold_1")) { - - @Override - public void onBackPressed() { - super.onBackPressed(); - - Quest.given = true; - Quest.completed = false; - - Pickaxe pick = new Pickaxe(); - - Dungeon.level.drop(pick, Dungeon.hero.pos).sprite.drop(); - - }; - }); - - Journal.add(Journal.Feature.TROLL); - - } else if (!Quest.completed) { - if (Quest.alternative) { - - Pickaxe pick = Dungeon.hero.belongings.getItem(Pickaxe.class); - if (pick == null) { - tell(Messages.get(this, "lost_pick")); - } else if (!pick.bloodStained) { - tell(Messages.get(this, "blood_2")); - } else { - //if (pick.isEquipped(Dungeon.hero)) { - // pick.doUnequip(Dungeon.hero, false); - //} - //pick.detach(Dungeon.hero.belongings.backpack); - yell( Messages.get(this, "keeppickaxe")); - tell(Messages.get(this, "completed")); - - Quest.completed = true; - Quest.reforged = false; - } - - } else { - - Pickaxe pick = Dungeon.hero.belongings.getItem(Pickaxe.class); - DarkGold gold = Dungeon.hero.belongings.getItem(DarkGold.class); - if (pick == null) { - tell(Messages.get(this, "lost_pick")); - } else if (gold == null || gold.quantity() < 15) { - tell(Messages.get(this, "gold_2")); - } else { - //if (pick.isEquipped(Dungeon.hero)) { - // pick.doUnequip(Dungeon.hero, false); - //} - //pick.detach(Dungeon.hero.belongings.backpack); - yell( Messages.get(this, "keeppickaxe")); - tell( Messages.get(this, "completed")); - - Quest.completed = true; - Quest.reforged = false; - } - - } - } else if (!Quest.reforged) { - - GameScene.show(new WndBlacksmith(this, Dungeon.hero)); - - } else { - - tell(Messages.get(this, "get_lost")); - - - } - return false; - } - - private void tell(String text) { - GameScene.show(new WndQuest(this, text)); - } - - public static String verify(Item item1, Item item2) { - - if (item1 == item2) { - return Messages.get(Blacksmith.class, "same_item"); - } - - //if (item1.getClass() != item2.getClass()) { - // return "Select 2 items of the same type!"; - //} - - if (!item1.isIdentified() || !item2.isIdentified()) { - return Messages.get(Blacksmith.class, "un_ided"); - } - - if (item1.cursed || item2.cursed) { - return Messages.get(Blacksmith.class, "cursed"); - } - - if (item1.level < 0 || item2.level < 1) { - return Messages.get(Blacksmith.class, "degraded"); - } - - if ((item1.level + item2.level > 15) && !item1.isReinforced()) { - return Messages.get(Blacksmith.class, "need_reinforced"); - } - - if (!item1.isUpgradable() || !item2.isUpgradable()) { - return Messages.get(Blacksmith.class, "cant_reforge"); - } - - return null; - } - - private static float upgradeChance = 0.5f; - public static void upgrade(Item item1, Item item2) { - - Item first, second; - - first = item1; - second = item2; - - - Sample.INSTANCE.play(Assets.SND_EVOKE); - ScrollOfUpgrade.upgrade(Dungeon.hero); - Item.evoke(Dungeon.hero); - - if (first.isEquipped(Dungeon.hero)) { - ((EquipableItem) first).doUnequip(Dungeon.hero, true); - } - - DarkGold gold = Dungeon.hero.belongings.getItem(DarkGold.class); - if (gold!=null){ - upgradeChance = (upgradeChance + (gold.quantity()*0.05f)); - } - if (first != null) { - for(int i=0; i rooms) { - //if (!spawned && Dungeon.depth > 11 && Random.Int( 15 - Dungeon.depth ) == 0) { - if (!spawned ) { - - Room blacksmith = null; - for (Room r : rooms) { - if (r.type == Type.STANDARD && r.width() > 4 - && r.height() > 4) { - blacksmith = r; - blacksmith.type = Type.BLACKSMITH; - - spawned = true; - - Handcannon saw = Dungeon.hero.belongings.getItem(Handcannon.class); - if (saw==null){ - alternative = Random.Int(2) == 0; - } else { - alternative = false; - } - given = false; - - break; - } - } - } - return spawned; - } - } -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/npcs/Blacksmith2.java b/java/com/hmdzl/spspd/change/actors/mobs/npcs/Blacksmith2.java deleted file mode 100644 index e0d7ce0c..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/npcs/Blacksmith2.java +++ /dev/null @@ -1,201 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs.npcs; - -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.items.AdamantArmor; -import com.hmdzl.spspd.change.items.AdamantRing; -import com.hmdzl.spspd.change.items.AdamantWand; -import com.hmdzl.spspd.change.items.AdamantWeapon; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.armor.Armor; -import com.hmdzl.spspd.change.items.quest.DarkGold; -import com.hmdzl.spspd.change.items.rings.Ring; -import com.hmdzl.spspd.change.items.wands.Wand; -import com.hmdzl.spspd.change.items.weapon.guns.GunWeapon; -import com.hmdzl.spspd.change.items.weapon.melee.MeleeWeapon; -import com.hmdzl.spspd.change.items.weapon.missiles.Boomerang; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ElectricwelderSprite; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.utils.GLog; -import com.hmdzl.spspd.change.windows.WndBlacksmith2; -import com.hmdzl.spspd.change.windows.WndQuest; - -public class Blacksmith2 extends NPC { - - - private static final String TXT_LOOKS_BETTER = "your %s pulsates with magical energy. "; - private static final String TXT_GET_LOST = "I'm busy. Get lost!"; - private static final String TXT2 = "My brother and I make all the items in this dungeon. " - +"He melts down two upgraded items to enhance one of them. " - +"My specialty is reinforcing items with adamantite. " - +"Come back to me when you have 50 dark gold and some adamantite for me to work with. " ; - - private static final String TXT3 = "Oh ho! Looks like you have some adamantite there. " - +"I can reinforce an item with adamantite if you wish. " - +"Reinforced items can handle higher levels of magical upgrade. " - +"It'll cost you though!. " - +"Come back to me when you have 50 dark gold. " ; - - - - { - //name = "troll blacksmith named Bip"; - spriteClass = ElectricwelderSprite.class; - properties.add(Property.TROLL); - properties.add(Property.IMMOVABLE); - } - - - @Override - protected boolean act() { - throwItem(); - return super.act(); - } - - @Override - public boolean interact() { - - sprite.turnTo(pos, Dungeon.hero.pos); - - - DarkGold gold = Dungeon.hero.belongings.getItem(DarkGold.class); - if (!checkAdamant()) { - tell(Messages.get(Blacksmith2.class, "himself")); - } else if (gold == null || gold.quantity() < 50) { - tell(Messages.get(Blacksmith2.class, "adamantite")); - } else if (checkAdamant() && gold != null && gold.quantity() > 49){ - GameScene.show(new WndBlacksmith2(this, Dungeon.hero)); - } else { - tell(Messages.get(Blacksmith2.class, "himself")); - } - return false; - } - - public static String verify(Item item1, Item item2) { - - if (item1 == item2) { - return Messages.get(Blacksmith2.class, "same_item"); - } - - if (!item1.isIdentified()) { - return Messages.get(Blacksmith2.class, "un_ided"); - } - - if (item1.cursed) { - return Messages.get(Blacksmith2.class, "cursed"); - } - - if (item1.reinforced) { - return Messages.get(Blacksmith2.class, "already_reforge"); - } - - if (item1.level < 0) { - return Messages.get(Blacksmith2.class, "degraded"); - } - - if (!item1.isUpgradable()) { - return Messages.get(Blacksmith2.class, "cant_reforge"); - } - - if(item1 instanceof Armor && item2 instanceof AdamantArmor){ - return null; - } - - if(item1 instanceof MeleeWeapon && item2 instanceof AdamantWeapon){ - return null; - } - - if(item1 instanceof GunWeapon && item2 instanceof AdamantWeapon){ - return null; - } - - if(item1 instanceof Wand && item2 instanceof AdamantWand){ - return null; - } - - if(item1 instanceof Ring && item2 instanceof AdamantRing){ - return null; - } - - return Messages.get(Blacksmith2.class, "cant_work"); - - } - - public static void upgrade(Item item1, Item item2) { - - item1.reinforced=true; - item2.detach(Dungeon.hero.belongings.backpack); - DarkGold gold = Dungeon.hero.belongings.getItem(DarkGold.class); - if (gold != null && gold.quantity() > 49 ) { - gold.detach(Dungeon.hero.belongings.backpack,50); - if(!(Dungeon.hero.belongings.getItem(DarkGold.class).quantity() > 0)){ - gold.detachAll(Dungeon.hero.belongings.backpack); - } - } - - GLog.p(TXT_LOOKS_BETTER, item1.name()); - Dungeon.hero.spendAndNext(2f); - Badges.validateItemLevelAquired(item1); - - } - - - private void tell(String text) { - GameScene.show(new WndQuest(this, text)); - } - - - public static boolean checkAdamant() { - AdamantArmor armor1 = Dungeon.hero.belongings.getItem(AdamantArmor.class); - AdamantWeapon weapon1 = Dungeon.hero.belongings.getItem(AdamantWeapon.class); - AdamantRing ring1 = Dungeon.hero.belongings.getItem(AdamantRing.class); - AdamantWand wand1 = Dungeon.hero.belongings.getItem(AdamantWand.class); - - if(armor1!=null || weapon1!=null || ring1!=null || wand1!=null) { - return true; - } - return false; - } - - - - - @Override - public int evadeSkill(Char enemy) { - return 1000; - } - - @Override - public void damage(int dmg, Object src) { - } - - @Override - public void add(Buff buff) { - } - - @Override - public boolean reset() { - return true; - } - -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/npcs/Coconut.java b/java/com/hmdzl/spspd/change/actors/mobs/npcs/Coconut.java deleted file mode 100644 index 292d2acc..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/npcs/Coconut.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs.npcs; - - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.sprites.CoconutSprite; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.utils.Random; - -public class Coconut extends NPC { - - { - //name = Messages.get(this,"name"); - spriteClass = CoconutSprite.class; - properties.add(Property.MECH); - - } - - @Override - protected boolean act() { - throwItem(); - return super.act(); - } - - @Override - public int evadeSkill(Char enemy) { - return 1000; - } - - - @Override - protected Char chooseEnemy() { - return null; - } - - @Override - public void damage(int dmg, Object src) { - } - - @Override - public void add(Buff buff) { - } - - @Override - public boolean reset() { - return true; - } - - - - @Override - public boolean interact() { - - sprite.turnTo(pos, Dungeon.hero.pos); - switch (Random.Int (3)) { - case 0: - yell(Messages.get(this, "yell1")); - break; - case 1: - yell(Messages.get(this, "yell2")); - break; - case 2: - yell(Messages.get(this, "yell3")); - break; - } - return true; - } -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/npcs/Coconut2.java b/java/com/hmdzl/spspd/change/actors/mobs/npcs/Coconut2.java deleted file mode 100644 index 036265e4..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/npcs/Coconut2.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs.npcs; - - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.sprites.CoconutSprite; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.utils.Random; - -public class Coconut2 extends NPC { - - { - //name = Messages.get(this,"name"); - spriteClass = CoconutSprite.class; - properties.add(Property.MECH); - - } - - @Override - protected boolean act() { - throwItem(); - return super.act(); - } - - @Override - public int evadeSkill(Char enemy) { - return 1000; - } - - - @Override - protected Char chooseEnemy() { - return null; - } - - @Override - public void damage(int dmg, Object src) { - } - - @Override - public void add(Buff buff) { - } - - @Override - public boolean reset() { - return true; - } - - - - @Override - public boolean interact() { - - sprite.turnTo(pos, Dungeon.hero.pos); - switch (Random.Int (3)) { - case 0: - yell(Messages.get(this, "yell1")); - break; - case 1: - yell(Messages.get(this, "yell2")); - break; - case 2: - yell(Messages.get(this, "yell3")); - break; - } - return true; - } -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/npcs/ConsideredHamster.java b/java/com/hmdzl/spspd/change/actors/mobs/npcs/ConsideredHamster.java deleted file mode 100644 index 4660f1c2..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/npcs/ConsideredHamster.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs.npcs; - - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.sprites.MimicSprite; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.utils.Random; - -public class ConsideredHamster extends NPC { - - { - //name = "Mimic"; - spriteClass = MimicSprite.class; - properties.add(Property.UNKNOW); - } - - @Override - protected boolean act() { - throwItem(); - return super.act(); - } - - @Override - public int evadeSkill(Char enemy) { - return 1000; - } - - - @Override - protected Char chooseEnemy() { - return null; - } - - @Override - public void damage(int dmg, Object src) { - } - - @Override - public void add(Buff buff) { - } - - @Override - public boolean reset() { - return true; - } - - - - @Override - public boolean interact() { - - sprite.turnTo(pos, Dungeon.hero.pos); - switch (Random.Int (2)) { - case 0: - yell(Messages.get(this, "yell1")); - break; - case 1: - yell(Messages.get(this, "yell2")); - break; - } - return true; - } -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/npcs/Dachhack.java b/java/com/hmdzl/spspd/change/actors/mobs/npcs/Dachhack.java deleted file mode 100644 index a7ed30f6..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/npcs/Dachhack.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs.npcs; - - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.sprites.DachhackSprite; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.utils.Random; - -public class Dachhack extends NPC { - - { - //name = "dachhack"; - spriteClass = DachhackSprite.class; - properties.add(Property.PLANT); - } - - @Override - protected boolean act() { - throwItem(); - return super.act(); - } - - @Override - public int evadeSkill(Char enemy) { - return 1000; - } - - - @Override - protected Char chooseEnemy() { - return null; - } - - @Override - public void damage(int dmg, Object src) { - } - - @Override - public void add(Buff buff) { - } - - @Override - public boolean reset() { - return true; - } - - - - @Override - public boolean interact() { - - sprite.turnTo(pos, Dungeon.hero.pos); - switch (Random.Int (3)) { - case 0: - yell(Messages.get(this, "yell1")); - break; - case 1: - yell(Messages.get(this, "yell2")); - break; - case 2: - yell(Messages.get(this, "yell3")); - break; - } - return true; - } -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/npcs/DreamPlayer.java b/java/com/hmdzl/spspd/change/actors/mobs/npcs/DreamPlayer.java deleted file mode 100644 index 6ffbe7ea..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/npcs/DreamPlayer.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs.npcs; - - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.sprites.DreamPlayerSprite; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.utils.Random; - -public class DreamPlayer extends NPC { - - { - //name = "DreamPlayer"; - spriteClass = DreamPlayerSprite.class; - state = WANDERING; - properties.add(Property.ELEMENT); - } - - /*@Override - protected boolean act() { - throwItem(); - return super.act(); - } */ - - @Override - public int evadeSkill(Char enemy) { - return 1000; - } - - - @Override - protected Char chooseEnemy() { - return null; - } - - @Override - public void damage(int dmg, Object src) { - } - - @Override - public void add(Buff buff) { - } - - @Override - public boolean reset() { - return true; - } - - - - @Override - public boolean interact() { - - sprite.turnTo(pos, Dungeon.hero.pos); - switch (Random.Int (2)) { - case 0: - yell(Messages.get(this, "yell1")); - break; - case 1: - yell(Messages.get(this, "yell2")); - break; - } - return true; - } - -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/npcs/Evan.java b/java/com/hmdzl/spspd/change/actors/mobs/npcs/Evan.java deleted file mode 100644 index 9734ea66..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/npcs/Evan.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs.npcs; - - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.sprites.EvanSprite; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.utils.Random; - -public class Evan extends NPC { - - { - //name = "Shattered Pixel Dungeon"; - spriteClass = EvanSprite.class; - properties.add(Property.MECH); - } - - @Override - protected boolean act() { - throwItem(); - return super.act(); - } - - @Override - public int evadeSkill(Char enemy) { - return 1000; - } - - - @Override - protected Char chooseEnemy() { - return null; - } - - @Override - public void damage(int dmg, Object src) { - } - - @Override - public void add(Buff buff) { - } - - @Override - public boolean reset() { - return true; - } - - - - @Override - public boolean interact() { - - sprite.turnTo(pos, Dungeon.hero.pos); - switch (Random.Int (2)) { - case 0: - yell(Messages.get(this, "yell1")); - break; - case 1: - yell(Messages.get(this, "yell2")); - break; - } - return true; - } -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/npcs/FruitCat.java b/java/com/hmdzl/spspd/change/actors/mobs/npcs/FruitCat.java deleted file mode 100644 index bffdcde0..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/npcs/FruitCat.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs.npcs; - - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.sprites.FruitCatSprite; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.utils.Random; - -public class FruitCat extends NPC { - - { - //name = Messages.get(this,"name"); - spriteClass = FruitCatSprite.class; - properties.add(Property.BEAST); - } - - @Override - protected boolean act() { - throwItem(); - return super.act(); - } - - @Override - public int evadeSkill(Char enemy) { - return 1000; - } - - - @Override - protected Char chooseEnemy() { - return null; - } - - @Override - public void damage(int dmg, Object src) { - } - - @Override - public void add(Buff buff) { - } - - @Override - public boolean reset() { - return true; - } - - - - @Override - public boolean interact() { - - sprite.turnTo(pos, Dungeon.hero.pos); - switch (Random.Int (2)) { - case 0: - yell(Messages.get(this, "yell1")); - break; - case 1: - yell(Messages.get(this, "yell2")); - break; - } - return true; - } - -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/npcs/G2159687.java b/java/com/hmdzl/spspd/change/actors/mobs/npcs/G2159687.java deleted file mode 100644 index 545d9f25..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/npcs/G2159687.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs.npcs; - - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.G2159687Sprite; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.windows.WndHotel; -import com.hmdzl.spspd.change.windows.WndONS; -import com.watabou.utils.Random; - -public class G2159687 extends NPC { - - { - //name = "G2159687"; - spriteClass = G2159687Sprite.class; - properties.add(Property.UNKNOW); - } - - @Override - protected boolean act() { - throwItem(); - return super.act(); - } - - @Override - public int evadeSkill(Char enemy) { - return 1000; - } - - - @Override - protected Char chooseEnemy() { - return null; - } - - @Override - public void damage(int dmg, Object src) { - } - - @Override - public void add(Buff buff) { - } - - @Override - public boolean reset() { - return true; - } - - - - @Override - public boolean interact() { - - sprite.turnTo(pos, Dungeon.hero.pos); - switch (Random.Int (3)) { - case 0: - yell(Messages.get(this, "yell1")); - break; - case 1: - yell(Messages.get(this, "yell2")); - break; - case 2: - GameScene.show(new WndHotel()); - break; - } - return true; - } -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/npcs/Ghost.java b/java/com/hmdzl/spspd/change/actors/mobs/npcs/Ghost.java deleted file mode 100644 index a425bf88..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/npcs/Ghost.java +++ /dev/null @@ -1,355 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs.npcs; - -import java.util.HashSet; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.Journal; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Paralysis; -import com.hmdzl.spspd.change.actors.buffs.Roots; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.actors.mobs.FetidRat; -import com.hmdzl.spspd.change.actors.mobs.GnollTrickster; -import com.hmdzl.spspd.change.actors.mobs.GreatCrab; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.Generator; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.armor.Armor; -import com.hmdzl.spspd.change.items.weapon.Weapon; -import com.hmdzl.spspd.change.items.weapon.missiles.MissileWeapon; -import com.hmdzl.spspd.change.levels.SewerLevel; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.GhostSprite; -import com.hmdzl.spspd.change.utils.GLog; - -import com.hmdzl.spspd.change.windows.WndQuest; -import com.hmdzl.spspd.change.windows.WndSadGhost; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -public class Ghost extends NPC { - - { - //name = "sad ghost"; - spriteClass = GhostSprite.class; - - flying = true; - - state = WANDERING; - properties.add(Property.UNDEAD); - } - - private static final String TXT_RAT1 = "Hello %s... Once I was like you - strong and confident... " - + "But I was slain by a foul beast... I can't leave this place... Not until I have my revenge... " - + "Slay the _fetid rat_, that has taken my life...\n\n" - + "It stalks this floor... Spreading filth everywhere... " - + "_Beware its cloud of stink and corrosive bite, the acid dissolves in water..._ "; - - private static final String TXT_RAT2 = "Please... Help me... Slay the abomination...\n\n" - + "_Fight it near water... Avoid the stench..._"; - - private static final String TXT_GNOLL1 = "Hello %s... Once I was like you - strong and confident... " - + "But I was slain by a devious foe... I can't leave this place... Not until I have my revenge... " - + "Slay the _gnoll trickster_, that has taken my life...\n\n" - + "It is not like the other gnolls... It hides and uses thrown weapons... " - + "_Beware its poisonous and incendiary darts, don't attack from a distance..._"; - - private static final String TXT_GNOLL2 = "Please... Help me... Slay the trickster...\n\n" - + "_Don't let it hit you... Get near to it..._"; - - private static final String TXT_CRAB1 = "Hello %s... Once I was like you - strong and confident... " - + "But I was slain by an ancient creature... I can't leave this place... Not until I have my revenge... " - + "Slay the _great crab_, that has taken my life...\n\n" - + "It is unnaturally old... With a massive single claw and a thick shell... " - + "_Beware its claw, you must surprise the crab or it will block with it..._"; - - private static final String TXT_CRAB2 = "Please... Help me... Slay the Crustacean...\n\n" - + "_It will always block... When it sees you coming..._"; - - public Ghost() { - super(); - - Sample.INSTANCE.load(Assets.SND_GHOST); - } - - @Override - public int evadeSkill(Char enemy) { - return 1000; - } - - //@Override - //public String defenseVerb() { - // return "evaded"; - //} - - @Override - public float speed() { - return 0.5f; - } - - @Override - protected Char chooseEnemy() { - return null; - } - - @Override - public void damage(int dmg, Object src) { - } - - @Override - public void add(Buff buff) { - } - - @Override - public boolean reset() { - return true; - } - - @Override - public boolean interact() { - sprite.turnTo(pos, Dungeon.hero.pos); - - Sample.INSTANCE.play(Assets.SND_GHOST); - - if (Quest.given) { - if (Quest.weapon != null) { - if (Quest.processed) { - GameScene.show(new WndSadGhost(this, Quest.type)); - } else { - switch (Quest.type) { - case 1: - default: - GameScene.show(new WndQuest(this, Messages.get(this, "rat_2"))); - break; - case 2: - GameScene.show(new WndQuest(this, Messages.get(this, "gnoll_2"))); - break; - case 3: - GameScene.show(new WndQuest(this, Messages.get(this, "crab_2"))); - break; - } - - int newPos = -1; - for (int i = 0; i < 10; i++) { - newPos = Dungeon.level.randomRespawnCell(); - if (newPos != -1) { - break; - } - } - if (newPos != -1) { - - //Actor.freeCell(pos); - - CellEmitter.get(pos).start(Speck.factory(Speck.LIGHT), - 0.2f, 3); - pos = newPos; - sprite.place(pos); - sprite.visible = Dungeon.visible[pos]; - } - } - } - } else { - Mob questBoss; - String txt_quest; - - switch (Quest.type){ - case 1: default: - questBoss = new FetidRat(); - txt_quest = Messages.get(this, "rat_1", Dungeon.hero.givenName()); break; - case 2: - questBoss = new GnollTrickster(); - txt_quest = Messages.get(this, "gnoll_1", Dungeon.hero.givenName()); break; - case 3: - questBoss = new GreatCrab(); - txt_quest = Messages.get(this, "crab_1", Dungeon.hero.givenName()); break; - } - - questBoss.pos = Dungeon.level.randomRespawnCell(); - - if (questBoss.pos != -1) { - GameScene.add(questBoss); - GameScene.show(new WndQuest(this, txt_quest)); - Quest.given = true; - Journal.add(Journal.Feature.GHOST); - } - - } - return false; - } - - private static final HashSet> IMMUNITIES = new HashSet>(); - static { - IMMUNITIES.add(Paralysis.class); - IMMUNITIES.add(Roots.class); - } - - @Override - public HashSet> immunities() { - return IMMUNITIES; - } - - public static class Quest { - - private static boolean spawned; - - private static int type; - - private static boolean given; - public static boolean processed; - - private static int depth; - - public static Weapon weapon; - public static Armor armor; - - public static void reset() { - spawned = false; - - weapon = null; - armor = null; - } - - private static final String NODE = "sadGhost"; - - private static final String SPAWNED = "spawned"; - private static final String TYPE = "type"; - private static final String GIVEN = "given"; - private static final String PROCESSED = "processed"; - private static final String DEPTH = "depth"; - private static final String WEAPON = "weapon"; - private static final String ARMOR = "armor"; - - public static void storeInBundle(Bundle bundle) { - - Bundle node = new Bundle(); - - node.put(SPAWNED, spawned); - - if (spawned) { - - node.put(TYPE, type); - - node.put(GIVEN, given); - node.put(DEPTH, depth); - node.put(PROCESSED, processed); - - node.put(WEAPON, weapon); - node.put(ARMOR, armor); - } - - bundle.put(NODE, node); - } - - public static void restoreFromBundle(Bundle bundle) { - - Bundle node = bundle.getBundle(NODE); - - if (!node.isNull() && (spawned = node.getBoolean(SPAWNED))) { - - type = node.getInt(TYPE); - given = node.getBoolean(GIVEN); - processed = node.getBoolean(PROCESSED); - - depth = node.getInt(DEPTH); - - weapon = (Weapon) node.get(WEAPON); - armor = (Armor) node.get(ARMOR); - } else { - reset(); - } - } - - public static void spawn(SewerLevel level) { - if (!spawned && Dungeon.depth > 1 - && Random.Int(5 - Dungeon.depth) == 0) { - - Ghost ghost = new Ghost(); - do { - ghost.pos = level.randomRespawnCell(); - } while (ghost.pos == -1); - level.mobs.add(ghost); - //Actor.occupyCell(ghost); - - spawned = true; - // dungeon depth determines type of quest. - // depth2=fetid rat, 3=gnoll trickster, 4=great crab - type = Dungeon.depth - 1; - - given = false; - processed = false; - depth = Dungeon.depth; - - do { - weapon = Generator.randomWeapon(10); - } while (weapon instanceof MissileWeapon); - armor = Generator.randomArmor(10); - - for (int i = 1; i <= 3; i++) { - Item another; - do { - another = Generator.randomWeapon(10 + i); - } while (another instanceof MissileWeapon); - if (another.level >= weapon.level) { - weapon = (Weapon) another; - } - another = Generator.randomArmor(10 + i); - if (another.level >= armor.level) { - armor = (Armor) another; - } - } - - weapon.identify(); - armor.identify(); - } - } - - public static void process() { - if (spawned && given && !processed && (depth == Dungeon.depth)) { - GLog.n(Messages.get(Ghost.class, "find_me")); - for (Mob m : Dungeon.level.mobs){ - if (m instanceof Ghost) - m.beckon(Dungeon.hero.pos); - } - Sample.INSTANCE.play(Assets.SND_GHOST); - processed = true; - Generator.Category.ARTIFACT.probs[10] = 1; // flags the dried - // rose as - // spawnable. - } - } - - public static void complete() { - weapon = null; - armor = null; - - Journal.remove(Journal.Feature.GHOST); - } - - public static boolean completed(){ - return spawned && processed; - } - } - -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/npcs/GoblinPlayer.java b/java/com/hmdzl/spspd/change/actors/mobs/npcs/GoblinPlayer.java deleted file mode 100644 index d13545f3..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/npcs/GoblinPlayer.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs.npcs; - - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.sprites.GoblinPlayerSprite; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.utils.Random; - -public class GoblinPlayer extends NPC { - - { - //name = "GoblinPlayer"; - spriteClass = GoblinPlayerSprite.class; - //state = WANDERING; - properties.add(Property.GOBLIN); - } - - /*@Override - protected boolean act() { - throwItem(); - return super.act(); - } */ - - @Override - public int evadeSkill(Char enemy) { - return 1000; - } - - - @Override - protected Char chooseEnemy() { - return null; - } - - @Override - public void damage(int dmg, Object src) { - } - - @Override - public void add(Buff buff) { - } - - @Override - public boolean reset() { - return true; - } - - - - @Override - public boolean interact() { - - sprite.turnTo(pos, Dungeon.hero.pos); - switch (Random.Int (2)) { - case 0: - yell(Messages.get(this, "yell1")); - break; - case 1: - yell(Messages.get(this, "yell2")); - break; - } - return true; - } - -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/npcs/HBB.java b/java/com/hmdzl/spspd/change/actors/mobs/npcs/HBB.java deleted file mode 100644 index d6ed29e5..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/npcs/HBB.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs.npcs; - - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.items.Flag; -import com.hmdzl.spspd.change.sprites.HBBSprite; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.utils.Random; - -public class HBB extends NPC { - - { - //name = "Rawberry"; - name = Messages.get(this,"name"); - spriteClass = HBBSprite.class; - properties.add(Property.BEAST); - } - - @Override - protected boolean act() { - throwItem(); - return super.act(); - } - - @Override - public int evadeSkill(Char enemy) { - return 1000; - } - - - @Override - protected Char chooseEnemy() { - return null; - } - - @Override - public void damage(int dmg, Object src) { - } - - @Override - public void add(Buff buff) { - } - - @Override - public boolean reset() { - return true; - } - - - - @Override - public boolean interact() { - - sprite.turnTo(pos, Dungeon.hero.pos); - switch (Random.Int (3)) { - case 0: - yell(Messages.get(this, "yell1")); - break; - case 1: - yell(Messages.get(this, "yell2")); - break; - case 2: - yell(Messages.get(this, "yell3")); - break; - //case 3: - //Dungeon.level.drop(new Flag(), Dungeon.hero.pos).sprite.drop(); - //break; - } - return false; - } - -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/npcs/HateSokoban.java b/java/com/hmdzl/spspd/change/actors/mobs/npcs/HateSokoban.java deleted file mode 100644 index 98af96c1..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/npcs/HateSokoban.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs.npcs; - - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.sprites.HateSokobanSprite; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.utils.Random; - -public class HateSokoban extends NPC { - - { - //name = Messages.get(this,"name"); - spriteClass = HateSokobanSprite.class; - properties.add(Property.BEAST); - } - - @Override - protected boolean act() { - throwItem(); - return super.act(); - } - - @Override - public int evadeSkill(Char enemy) { - return 1000; - } - - - @Override - protected Char chooseEnemy() { - return null; - } - - @Override - public void damage(int dmg, Object src) { - } - - @Override - public void add(Buff buff) { - } - - @Override - public boolean reset() { - return true; - } - - @Override - public boolean interact() { - - sprite.turnTo(pos, Dungeon.hero.pos); - switch (Random.Int (2)) { - case 0: - yell(Messages.get(this, "yell1")); - break; - case 1: - yell(Messages.get(this, "yell2")); - break; - } - return false; - } -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/npcs/HeXA.java b/java/com/hmdzl/spspd/change/actors/mobs/npcs/HeXA.java deleted file mode 100644 index fd1b860f..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/npcs/HeXA.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs.npcs; - - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.sprites.HeXASprite; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.utils.Random; - -public class HeXA extends NPC { - - { - //name = "UNIST HeXA"; - spriteClass = HeXASprite.class; - properties.add(Property.ELEMENT); - } - - @Override - protected boolean act() { - throwItem(); - return super.act(); - } - - @Override - public int evadeSkill(Char enemy) { - return 1000; - } - - - @Override - protected Char chooseEnemy() { - return null; - } - - @Override - public void damage(int dmg, Object src) { - } - - @Override - public void add(Buff buff) { - } - - @Override - public boolean reset() { - return true; - } - - - - @Override - public boolean interact() { - - sprite.turnTo(pos, Dungeon.hero.pos); - switch (Random.Int (2)) { - case 0: - yell(Messages.get(this, "yell1")); - break; - case 1: - yell(Messages.get(this, "yell2")); - break; - } - return false; - } -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/npcs/Hmdzl001.java b/java/com/hmdzl/spspd/change/actors/mobs/npcs/Hmdzl001.java deleted file mode 100644 index 9abd5ced..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/npcs/Hmdzl001.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs.npcs; - - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.sprites.CoconutSprite; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.Hmdzl001Sprite; -import com.watabou.utils.Random; - -public class Hmdzl001 extends NPC { - - { - //name = Messages.get(this,"name"); - spriteClass = Hmdzl001Sprite.class; - properties.add(Property.PLANT); - - } - - @Override - protected boolean act() { - throwItem(); - return super.act(); - } - - @Override - public int evadeSkill(Char enemy) { - return 1000; - } - - - @Override - protected Char chooseEnemy() { - return null; - } - - @Override - public void damage(int dmg, Object src) { - } - - @Override - public void add(Buff buff) { - } - - @Override - public boolean reset() { - return true; - } - - - - @Override - public boolean interact() { - - sprite.turnTo(pos, Dungeon.hero.pos); - switch (Random.Int (3)) { - case 0: - yell(Messages.get(this, "yell1")); - break; - case 1: - yell(Messages.get(this, "yell2")); - break; - case 2: - yell(Messages.get(this, "yell3")); - break; - } - return true; - } -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/npcs/HoneyPoooot.java b/java/com/hmdzl/spspd/change/actors/mobs/npcs/HoneyPoooot.java deleted file mode 100644 index 28a5f004..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/npcs/HoneyPoooot.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs.npcs; - - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.sprites.HoneyPooootSprite; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.utils.Random; - -public class HoneyPoooot extends NPC { - - { - //name = "HoneyPoooot"; - spriteClass = HoneyPooootSprite.class; - //state = WANDERING; - properties.add(Property.ELF); - } - - /*@Override - protected boolean act() { - throwItem(); - return super.act(); - } */ - - @Override - public int evadeSkill(Char enemy) { - return 1000; - } - - - @Override - protected Char chooseEnemy() { - return null; - } - - @Override - public void damage(int dmg, Object src) { - } - - @Override - public void add(Buff buff) { - } - - @Override - public boolean reset() { - return true; - } - - - - @Override - public boolean interact() { - - sprite.turnTo(pos, Dungeon.hero.pos); - switch (Random.Int (2)) { - case 0: - yell(Messages.get(this, "yell1")); - break; - case 1: - yell(Messages.get(this, "yell2")); - break; - } - return true; - } - -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/npcs/Ice13.java b/java/com/hmdzl/spspd/change/actors/mobs/npcs/Ice13.java deleted file mode 100644 index 8839acb7..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/npcs/Ice13.java +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs.npcs; - - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.sprites.Ice13Sprite; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.utils.Random; - -public class Ice13 extends NPC { - - { - //name = "Ice13"; - spriteClass = Ice13Sprite.class; - //state = WANDERING; - properties.add(Property.HUMAN); - } - - /*@Override - protected boolean act() { - throwItem(); - return super.act(); - } */ - - @Override - public int evadeSkill(Char enemy) { - return 1000; - } - - - @Override - protected Char chooseEnemy() { - return null; - } - - @Override - public void damage(int dmg, Object src) { - } - - @Override - public void add(Buff buff) { - } - - @Override - public boolean reset() { - return true; - } - - - - @Override - public boolean interact() { - - sprite.turnTo(pos, Dungeon.hero.pos); - switch (Random.Int (6)) { - case 0: - yell(Messages.get(this, "yell1")); - break; - case 1: - yell(Messages.get(this, "yell2")); - break; - case 2: - yell(Messages.get(this, "yell3")); - break; - case 3: - yell(Messages.get(this, "yell4")); - break; - case 4: - yell(Messages.get(this, "yell5")); - break; - case 5: - yell(Messages.get(this, "yell6")); - break; - } - return true; - } - -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/npcs/Imp.java b/java/com/hmdzl/spspd/change/actors/mobs/npcs/Imp.java deleted file mode 100644 index e98b0e3f..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/npcs/Imp.java +++ /dev/null @@ -1,227 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs.npcs; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.Journal; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.mobs.Golem; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.actors.mobs.Monk; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.items.Generator; -import com.hmdzl.spspd.change.items.quest.DwarfToken; -import com.hmdzl.spspd.change.items.rings.Ring; -import com.hmdzl.spspd.change.levels.CityLevel; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ImpSprite; - -import com.hmdzl.spspd.change.windows.WndImp; -import com.hmdzl.spspd.change.windows.WndQuest; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -public class Imp extends NPC { - - { - //name = "ambitious imp"; - spriteClass = ImpSprite.class; - properties.add(Property.DEMONIC); - properties.add(Property.IMMOVABLE); - } - - private boolean seenBefore = false; - - @Override - protected boolean act() { - - if (!Quest.given && Dungeon.visible[pos]) { - if (!seenBefore) { - yell( Messages.get(this, "hey", Dungeon.hero.givenName())); - } - seenBefore = true; - } else { - seenBefore = false; - } - - throwItem(); - - return super.act(); - } - - @Override - public int evadeSkill(Char enemy) { - return 1000; - } - - @Override - public void damage(int dmg, Object src) { - } - - @Override - public void add(Buff buff) { - } - - @Override - public boolean reset() { - return true; - } - - @Override - public boolean interact() { - - sprite.turnTo(pos, Dungeon.hero.pos); - if (Quest.given) { - - DwarfToken tokens = Dungeon.hero.belongings - .getItem(DwarfToken.class); - if (tokens != null - && (tokens.quantity() >= 8 || (!Quest.alternative && tokens - .quantity() >= 6))) { - GameScene.show(new WndImp(this, tokens)); - } else { - tell(Quest.alternative ? - Messages.get(this, "monks_2", Dungeon.hero.givenName()) - : Messages.get(this, "golems_2", Dungeon.hero.givenName())); - } - - } else { - tell(Quest.alternative ? Messages.get(this, "monks_1") : Messages.get(this, "golems_1")); - Quest.given = true; - Quest.completed = false; - - Journal.add(Journal.Feature.IMP); - } - return false; - } - - private void tell( String text ) { - GameScene.show( - new WndQuest( this, text )); - } - - public void flee() { - - yell(Messages.get(this, "cya", Dungeon.hero.givenName())); - - destroy(); - sprite.die(); - } - - public static class Quest { - - private static boolean alternative; - - private static boolean spawned; - private static boolean given; - private static boolean completed; - - public static Ring reward; - - public static void reset() { - spawned = false; - - reward = null; - } - - private static final String NODE = "demon"; - - private static final String ALTERNATIVE = "alternative"; - private static final String SPAWNED = "spawned"; - private static final String GIVEN = "given"; - private static final String COMPLETED = "completed"; - private static final String REWARD = "reward"; - - public static void storeInBundle(Bundle bundle) { - - Bundle node = new Bundle(); - - node.put(SPAWNED, spawned); - - if (spawned) { - node.put(ALTERNATIVE, alternative); - - node.put(GIVEN, given); - node.put(COMPLETED, completed); - node.put(REWARD, reward); - } - - bundle.put(NODE, node); - } - - public static void restoreFromBundle(Bundle bundle) { - - Bundle node = bundle.getBundle(NODE); - - if (!node.isNull() && (spawned = node.getBoolean(SPAWNED))) { - alternative = node.getBoolean(ALTERNATIVE); - - given = node.getBoolean(GIVEN); - completed = node.getBoolean(COMPLETED); - reward = (Ring) node.get(REWARD); - } - } - - public static void spawn(CityLevel level) { - if (!spawned && Dungeon.depth > 16 - ) { - - Imp npc = new Imp(); - do { - npc.pos = level.randomRespawnCell(); - } while (npc.pos == -1 || level.heaps.get(npc.pos) != null); - level.mobs.add(npc); - Actor.occupyCell(npc); - - spawned = true; - alternative = Random.Int(2) == 0; - - given = false; - - do { - reward = (Ring) Generator.random(Generator.Category.RING); - } while (reward.cursed); - reward.upgrade(2); - reward.cursed = true; - } - } - - public static void process(Mob mob) { - if (spawned && given && !completed) { - if ((alternative && mob instanceof Monk) - || (!alternative && mob instanceof Golem)) { - - Dungeon.level.drop(new DwarfToken(), mob.pos).sprite.drop(); - } - } - } - - public static void complete() { - reward = null; - completed = true; - - Journal.remove(Journal.Feature.IMP); - } - - public static boolean isCompleted() { - return completed; - } - } -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/npcs/ImpShopkeeper.java b/java/com/hmdzl/spspd/change/actors/mobs/npcs/ImpShopkeeper.java deleted file mode 100644 index 3a3fff50..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/npcs/ImpShopkeeper.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs.npcs; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.Statistics; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.effects.particles.ElmoParticle; -import com.hmdzl.spspd.change.items.Heap; -import com.hmdzl.spspd.change.sprites.ImpSprite; - -import com.hmdzl.spspd.change.messages.Messages; - -public class ImpShopkeeper extends Shopkeeper { - - { - //name = "ambitious imp"; - spriteClass = ImpSprite.class; - properties.remove(Property.HUMAN); - properties.add(Property.DEMONIC); - properties.add(Property.IMMOVABLE); - } - - private boolean seenBefore = false; - private boolean killedYog = false; - - @Override - protected boolean act() { - - if (!seenBefore && Dungeon.visible[pos]) { - yell(Messages.get(this, "greeting", Dungeon.hero.givenName())); - seenBefore = true; - } - - if (Statistics.amuletObtained && !killedYog && Dungeon.visible[pos]) { - yell(Messages.get(this, "greeting2", Dungeon.hero.givenName())); - killedYog = true; - } - - return super.act(); - } - - @Override - public int evadeSkill(Char enemy) { - return 1000; - } -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/npcs/Jinkeloid.java b/java/com/hmdzl/spspd/change/actors/mobs/npcs/Jinkeloid.java deleted file mode 100644 index 800b23f9..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/npcs/Jinkeloid.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs.npcs; - - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.sprites.JinkeloidSprite; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.utils.Random; - -public class Jinkeloid extends NPC { - - { - //name = "In vitro rose"; - //name = Messages.get(this,"name"); - spriteClass = JinkeloidSprite.class; - properties.add(Property.ELEMENT); - } - - @Override - protected boolean act() { - throwItem(); - return super.act(); - } - - @Override - public int evadeSkill(Char enemy) { - return 1000; - } - - - @Override - protected Char chooseEnemy() { - return null; - } - - @Override - public void damage(int dmg, Object src) { - } - - @Override - public void add(Buff buff) { - } - - @Override - public boolean reset() { - return true; - } - - - - @Override - public boolean interact() { - - sprite.turnTo(pos, Dungeon.hero.pos); - switch (Random.Int (2)) { - case 0: - yell(Messages.get(this, "yell1")); - break; - case 1: - //yell("Developer is in there... 576115291 "); - yell(Messages.get(this, "yell2")); - break; - } - return true; - } -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/npcs/Juh9870.java b/java/com/hmdzl/spspd/change/actors/mobs/npcs/Juh9870.java deleted file mode 100644 index 34414b1f..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/npcs/Juh9870.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs.npcs; - - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.sprites.Juh9870Sprite; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.utils.Random; - -public class Juh9870 extends NPC { - - { - //name = "Juh9870"; - spriteClass = Juh9870Sprite.class; - properties.add(Property.GOBLIN); - } - - @Override - protected boolean act() { - throwItem(); - return super.act(); - } - - @Override - public int evadeSkill(Char enemy) { - return 1000; - } - - - @Override - protected Char chooseEnemy() { - return null; - } - - @Override - public void damage(int dmg, Object src) { - } - - @Override - public void add(Buff buff) { - } - - @Override - public boolean reset() { - return true; - } - - - - @Override - public boolean interact() { - - sprite.turnTo(pos, Dungeon.hero.pos); - switch (Random.Int (2)) { - case 0: - yell(Messages.get(this, "yell1")); - break; - case 1: - yell(Messages.get(this, "yell2")); - break; - } - return true; - } -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/npcs/Kostis12345.java b/java/com/hmdzl/spspd/change/actors/mobs/npcs/Kostis12345.java deleted file mode 100644 index 34acd5db..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/npcs/Kostis12345.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs.npcs; - - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.sprites.Kostis12345Sprite; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.utils.Random; - -public class Kostis12345 extends NPC { - - { - //name = "kostis12345"; - spriteClass = Kostis12345Sprite.class; - //state = WANDERING; - properties.add(Property.UNKNOW); - } - - /*@Override - protected boolean act() { - throwItem(); - return super.act(); - } */ - - @Override - public int evadeSkill(Char enemy) { - return 1000; - } - - - @Override - protected Char chooseEnemy() { - return null; - } - - @Override - public void damage(int dmg, Object src) { - } - - @Override - public void add(Buff buff) { - } - - @Override - public boolean reset() { - return true; - } - - - - @Override - public boolean interact() { - - sprite.turnTo(pos, Dungeon.hero.pos); - switch (Random.Int (2)) { - case 0: - yell(Messages.get(this, "yell1")); - break; - case 1: - yell(Messages.get(this, "yell2")); - break; - } - return true; - } - -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/npcs/LaJi.java b/java/com/hmdzl/spspd/change/actors/mobs/npcs/LaJi.java deleted file mode 100644 index ccb66acb..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/npcs/LaJi.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs.npcs; - - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.sprites.LaJiSprite; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.utils.Random; - -public class LaJi extends NPC { - - { - //name = Messages.get(this,"name"); - spriteClass = LaJiSprite.class; - state = WANDERING; - properties.add(Property.ORC); - } - - - @Override - public int evadeSkill(Char enemy) { - return 1000; - } - - - @Override - protected Char chooseEnemy() { - return null; - } - - @Override - public void damage(int dmg, Object src) { - } - - @Override - public void add(Buff buff) { - } - - @Override - public boolean reset() { - return true; - } - - - - @Override - public boolean interact() { - - sprite.turnTo(pos, Dungeon.hero.pos); - switch (Random.Int (3)) { - case 0: - yell(Messages.get(this, "yell1")); - break; - case 1: - yell(Messages.get(this, "yell2")); - break; - case 2: - yell(Messages.get(this, "yell3")); - break; - } - return true; - } -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/npcs/Locastan.java b/java/com/hmdzl/spspd/change/actors/mobs/npcs/Locastan.java deleted file mode 100644 index ad1664b0..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/npcs/Locastan.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs.npcs; - - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.sprites.LocastanSprite; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.utils.Random; - -public class Locastan extends NPC { - - { - //name = "Locastan"; - spriteClass = LocastanSprite.class; - properties.add(Property.GOBLIN); - } - - @Override - protected boolean act() { - throwItem(); - return super.act(); - } - - @Override - public int evadeSkill(Char enemy) { - return 1000; - } - - - @Override - protected Char chooseEnemy() { - return null; - } - - @Override - public void damage(int dmg, Object src) { - } - - @Override - public void add(Buff buff) { - } - - @Override - public boolean reset() { - return true; - } - - - - @Override - public boolean interact() { - - sprite.turnTo(pos, Dungeon.hero.pos); - switch (Random.Int (3)) { - case 0: - yell(Messages.get(this, "yell1")); - break; - case 1: - yell(Messages.get(this, "yell2")); - break; - case 2: - yell(Messages.get(this, "yell3")); - break; - } - return true; - } -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/npcs/Lyn.java b/java/com/hmdzl/spspd/change/actors/mobs/npcs/Lyn.java deleted file mode 100644 index c52714e7..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/npcs/Lyn.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs.npcs; - - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.sprites.LynSprite; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.utils.Random; - -public class Lyn extends NPC { - - { - //name = "Lyn-0401"; - spriteClass = LynSprite.class; - properties.add(Property.ELF); - properties.add(Property.DEMONIC); - } - - @Override - protected boolean act() { - throwItem(); - return super.act(); - } - - @Override - public int evadeSkill(Char enemy) { - return 1000; - } - - - @Override - protected Char chooseEnemy() { - return null; - } - - @Override - public void damage(int dmg, Object src) { - } - - @Override - public void add(Buff buff) { - } - - @Override - public boolean reset() { - return true; - } - - - - @Override - public boolean interact() { - - sprite.turnTo(pos, Dungeon.hero.pos); - switch (Random.Int (2)) { - case 0: - yell(Messages.get(this, "yell1")); - break; - case 1: - yell(Messages.get(this, "yell2")); - break; - } - return true; - } -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/npcs/Lynn.java b/java/com/hmdzl/spspd/change/actors/mobs/npcs/Lynn.java deleted file mode 100644 index c8467d19..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/npcs/Lynn.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs.npcs; - - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.sprites.LynnSprite; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.utils.Random; - -public class Lynn extends NPC { - - { - //name = "Lynn"; - spriteClass = LynnSprite.class; - properties.add(Property.ELF); - } - - @Override - protected boolean act() { - throwItem(); - return super.act(); - } - - @Override - public int evadeSkill(Char enemy) { - return 1000; - } - - - @Override - protected Char chooseEnemy() { - return null; - } - - @Override - public void damage(int dmg, Object src) { - } - - @Override - public void add(Buff buff) { - } - - @Override - public boolean reset() { - return true; - } - - - - @Override - public boolean interact() { - - sprite.turnTo(pos, Dungeon.hero.pos); - switch (Random.Int (2)) { - case 0: - yell(Messages.get(this, "yell1")); - break; - case 1: - yell(Messages.get(this, "yell2")); - break; - } - return true; - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/actors/mobs/npcs/MemoryOfSand.java b/java/com/hmdzl/spspd/change/actors/mobs/npcs/MemoryOfSand.java deleted file mode 100644 index 5260e779..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/npcs/MemoryOfSand.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs.npcs; - - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.sprites.MemoryOfSandSprite; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.utils.Random; - -public class MemoryOfSand extends NPC { - - { - //name = Messages.get(this,"name"); - spriteClass = MemoryOfSandSprite.class; - properties.add(Property.HUMAN); - } - - @Override - protected boolean act() { - throwItem(); - return super.act(); - } - - @Override - public int evadeSkill(Char enemy) { - return 1000; - } - - - @Override - protected Char chooseEnemy() { - return null; - } - - @Override - public void damage(int dmg, Object src) { - } - - @Override - public void add(Buff buff) { - } - - @Override - public boolean reset() { - return true; - } - - - - @Override - public boolean interact() { - - sprite.turnTo(pos, Dungeon.hero.pos); - switch (Random.Int (2)) { - case 0: - yell(Messages.get(this, "yell1")); - break; - case 1: - yell(Messages.get(this, "yell2")); - break; - } - return true; - } -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/npcs/Millilitre.java b/java/com/hmdzl/spspd/change/actors/mobs/npcs/Millilitre.java deleted file mode 100644 index d2e85aeb..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/npcs/Millilitre.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs.npcs; - - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.sprites.MillilitreSprite; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.utils.Random; - -public class Millilitre extends NPC { - - { - //name = "Millilitre"; - spriteClass = MillilitreSprite.class; - //state = WANDERING; - properties.add(Property.HUMAN); - } - - /*@Override - protected boolean act() { - throwItem(); - return super.act(); - } */ - - @Override - public int evadeSkill(Char enemy) { - return 1000; - } - - - @Override - protected Char chooseEnemy() { - return null; - } - - @Override - public void damage(int dmg, Object src) { - } - - @Override - public void add(Buff buff) { - } - - @Override - public boolean reset() { - return true; - } - - - - @Override - public boolean interact() { - - sprite.turnTo(pos, Dungeon.hero.pos); - switch (Random.Int (2)) { - case 0: - yell(Messages.get(this, "yell1")); - break; - case 1: - yell(Messages.get(this, "yell2")); - break; - } - return true; - } - -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/npcs/MirrorImage.java b/java/com/hmdzl/spspd/change/actors/mobs/npcs/MirrorImage.java deleted file mode 100644 index a63fbc56..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/npcs/MirrorImage.java +++ /dev/null @@ -1,165 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs.npcs; - -import java.util.HashSet; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.ToxicGas; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Burning; -import com.hmdzl.spspd.change.actors.buffs.MagicalSleep; -import com.hmdzl.spspd.change.actors.buffs.Paralysis; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.hmdzl.spspd.change.sprites.MirrorSprite; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -public class MirrorImage extends NPC { - - { - //name = "mirror image"; - spriteClass = MirrorSprite.class; - - state = HUNTING; - - properties.add(Property.UNKNOW); - } - - public int skin; - - private int attack; - private int damage; - - private static final String SKIN = "skin"; - private static final String ATTACK = "attack"; - private static final String DAMAGE = "damage"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(SKIN, skin); - bundle.put(ATTACK, attack); - bundle.put(DAMAGE, damage); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - skin = bundle.getInt(SKIN); - attack = bundle.getInt(ATTACK); - damage = bundle.getInt(DAMAGE); - } - - public void duplicate(Hero hero) { - skin = hero.useskin(); - attack = hero.hitSkill(hero); - damage = hero.damageRoll(); - } - - @Override - public int hitSkill(Char target) { - return attack; - } - - @Override - public int damageRoll() { - return damage; - } - - @Override - public int attackProc(Char enemy, int damage) { - int dmg = super.attackProc(enemy, damage); - - destroy(); - sprite.die(); - - return dmg; - } - - @Override - protected Char chooseEnemy() { - - if (enemy == null || !enemy.isAlive()) { - HashSet enemies = new HashSet(); - for (Mob mob : Dungeon.level.mobs) { - if (mob.hostile && Level.fieldOfView[mob.pos]) { - enemies.add(mob); - } - } - - enemy = enemies.size() > 0 ? Random.element(enemies) : null; - } - - return enemy; - } - - @Override - public CharSprite sprite() { - CharSprite s = super.sprite(); - ((MirrorSprite) s).updateArmor(skin); - return s; - } - - - @Override - public boolean interact() { - if (!Dungeon.level.passable[pos]){ - return true; - } - if (this.buff(MagicalSleep.class) != null) { - Buff.detach(this, MagicalSleep.class); - } - - if (state == SLEEPING) { - state = HUNTING; - } - if (buff(Paralysis.class) != null) { - Buff.detach(this, Paralysis.class); - } - - int curPos = pos; - - moveSprite(pos, Dungeon.hero.pos); - move(Dungeon.hero.pos); - - Dungeon.hero.sprite.move(Dungeon.hero.pos, curPos); - Dungeon.hero.move(curPos); - - Dungeon.hero.spend(1 / Dungeon.hero.speed()); - Dungeon.hero.busy(); - return true; - } - - private static final HashSet> IMMUNITIES = new HashSet>(); - static { - IMMUNITIES.add(ToxicGas.class); - IMMUNITIES.add(Burning.class); - } - - @Override - public HashSet> immunities() { - return IMMUNITIES; - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/actors/mobs/npcs/Mtree.java b/java/com/hmdzl/spspd/change/actors/mobs/npcs/Mtree.java deleted file mode 100644 index e7b45827..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/npcs/Mtree.java +++ /dev/null @@ -1,111 +0,0 @@ - package com.hmdzl.spspd.change.actors.mobs.npcs; - - - import com.hmdzl.spspd.change.Dungeon; - import com.hmdzl.spspd.change.actors.Char; - import com.hmdzl.spspd.change.actors.buffs.Buff; - import com.hmdzl.spspd.change.actors.buffs.GrowSeed; - import com.hmdzl.spspd.change.actors.buffs.Poison; - import com.hmdzl.spspd.change.actors.mobs.Mob; - import com.hmdzl.spspd.change.levels.Level; - import com.hmdzl.spspd.change.sprites.ErrorSprite; - import com.hmdzl.spspd.change.sprites.PlantKingSprite; - import com.watabou.utils.Random; - - import java.util.HashSet; - - public class Mtree extends NPC { - - { - //name = "Mtree"; - spriteClass = PlantKingSprite.class; - - HP = 10; - HT = 10; - - viewDistance = 6; - ally=true; - flying = false; - state = WANDERING; - } - - - @Override - public int hitSkill(Char target) { - return 40; - } - - @Override - public int damageRoll() { - return Random.NormalIntRange(10, 30); - } - - @Override - protected boolean canAttack(Char enemy) { - return super.canAttack(enemy); - } - - @Override - public int attackProc(Char enemy, int damage) { - if (Random.Int(10) == 0) { - Buff.affect(enemy, GrowSeed.class); - destroy(); - } - - return damage; - } - - @Override - protected boolean getCloser(int target) { - if (state == WANDERING - || Level.distance(target, Dungeon.hero.pos) > 6) - this.target = target = Dungeon.hero.pos; - return super.getCloser(target); - } - @Override - protected Char chooseEnemy() { - if (enemy == null || !enemy.isAlive() || state == WANDERING) { - - HashSet enemies = new HashSet(); - for (Mob mob : Dungeon.level.mobs) { - if (mob.hostile && Level.fieldOfView[mob.pos] - && mob.state != mob.PASSIVE) { - enemies.add(mob); - } - } - enemy = enemies.size() > 0 ? Random.element(enemies) : null; - } - return enemy; - } - - @Override - public boolean interact() { - if (Dungeon.level.passable[pos] || Dungeon.hero.flying) { - int curPos = pos; - - moveSprite(pos, Dungeon.hero.pos); - move(Dungeon.hero.pos); - - Dungeon.hero.sprite.move(Dungeon.hero.pos, curPos); - Dungeon.hero.move(curPos); - - Dungeon.hero.spend(1 / Dungeon.hero.speed()); - Dungeon.hero.busy(); - return true; - } else { - return false; - } - } - - private static final HashSet> IMMUNITIES = new HashSet>(); - - static { - IMMUNITIES.add(Poison.class); - } - - @Override - public HashSet> immunities() { - return IMMUNITIES; - } - - } \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/actors/mobs/npcs/NPC.java b/java/com/hmdzl/spspd/change/actors/mobs/npcs/NPC.java deleted file mode 100644 index f56a7a88..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/npcs/NPC.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs.npcs; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.items.Heap; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.utils.Random; - -public abstract class NPC extends Mob { - - { - HP = HT = 1; - EXP = 0; - - hostile = false; - state = PASSIVE; - - } - - protected void throwItem() { - Heap heap = Dungeon.level.heaps.get(pos); - if (heap != null && heap.type != Heap.Type.FOR_SALE) { - int n; - do { - n = pos + Level.NEIGHBOURS8[Random.Int(8)]; - } while (!Level.passable[n] && !Level.avoid[n]); - Dungeon.level.drop(heap.pickUp(), n).sprite.drop(pos); - } - } - - @Override - public void beckon(int cell) { - } - - abstract public boolean interact(); -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/actors/mobs/npcs/NYRDS.java b/java/com/hmdzl/spspd/change/actors/mobs/npcs/NYRDS.java deleted file mode 100644 index 7592a5f8..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/npcs/NYRDS.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs.npcs; - - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.sprites.NYRDSSprite; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.utils.Random; - -public class NYRDS extends NPC { - - { - //name = "nyrdie"; - spriteClass = NYRDSSprite.class; - properties.add(Property.UNKNOW); - } - - @Override - protected boolean act() { - throwItem(); - return super.act(); - } - - @Override - public int evadeSkill(Char enemy) { - return 1000; - } - - - @Override - protected Char chooseEnemy() { - return null; - } - - @Override - public void damage(int dmg, Object src) { - } - - @Override - public void add(Buff buff) { - } - - @Override - public boolean reset() { - return true; - } - - @Override - public boolean interact() { - - sprite.turnTo(pos, Dungeon.hero.pos); - switch (Random.Int (2)) { - case 0: - yell(Messages.get(this, "yell1")); - break; - case 1: - yell(Messages.get(this, "yell2")); - break; - } - return true; - } -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/npcs/NewPlayer.java b/java/com/hmdzl/spspd/change/actors/mobs/npcs/NewPlayer.java deleted file mode 100644 index 4eb4c263..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/npcs/NewPlayer.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs.npcs; - - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.sprites.NewPlayerSprite; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.utils.Random; - -public class NewPlayer extends NPC { - - { - //name = NewPlayer; - spriteClass = NewPlayerSprite.class; - state = WANDERING; - properties.add(Property.UNKNOW); - } - - - @Override - public int evadeSkill(Char enemy) { - return 1000; - } - - - @Override - protected Char chooseEnemy() { - return null; - } - - @Override - public void damage(int dmg, Object src) { - } - - @Override - public void add(Buff buff) { - } - - @Override - public boolean reset() { - return true; - } - - - - @Override - public boolean interact() { - - sprite.turnTo(pos, Dungeon.hero.pos); - switch (Random.Int (2)) { - case 0: - yell(Messages.get(this, "yell1")); - break; - case 1: - yell(Messages.get(this, "yell2")); - break; - } - return true; - } -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/npcs/NutPainter.java b/java/com/hmdzl/spspd/change/actors/mobs/npcs/NutPainter.java deleted file mode 100644 index 2ea55abc..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/npcs/NutPainter.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs.npcs; - - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.sprites.PainterSprite; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.utils.Random; - -public class NutPainter extends NPC { - - { - //name = "NutPainter"; - spriteClass = PainterSprite.class; - //state = WANDERING; - properties.add(Property.HUMAN); - } - - /*@Override - protected boolean act() { - throwItem(); - return super.act(); - } */ - - @Override - public int evadeSkill(Char enemy) { - return 1000; - } - - - @Override - protected Char chooseEnemy() { - return null; - } - - @Override - public void damage(int dmg, Object src) { - } - - @Override - public void add(Buff buff) { - } - - @Override - public boolean reset() { - return true; - } - - - - @Override - public boolean interact() { - - sprite.turnTo(pos, Dungeon.hero.pos); - switch (Random.Int (2)) { - case 0: - yell(Messages.get(this, "yell1")); - break; - case 1: - yell(Messages.get(this, "yell2")); - break; - } - return true; - } - -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/npcs/OldNewStwist.java b/java/com/hmdzl/spspd/change/actors/mobs/npcs/OldNewStwist.java deleted file mode 100644 index f1b6a441..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/npcs/OldNewStwist.java +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs.npcs; - - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.Statistics; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.items.Heap; -import com.hmdzl.spspd.change.items.quest.GnollClothes; -import com.hmdzl.spspd.change.items.weapon.melee.special.Spork; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.OldNewStwistSprite; -import com.hmdzl.spspd.change.windows.WndONS; - -public class OldNewStwist extends NPC { - - { - //name = "oldnewstwist"; - spriteClass = OldNewStwistSprite.class; - - state = SLEEPING; - properties.add(Property.GNOLL); - } - - @Override - public int evadeSkill(Char enemy) { - return 1000; - } - - @Override - protected Char chooseEnemy() { - return null; - } - - @Override - public void damage(int dmg, Object src) { - } - - @Override - public void add(Buff buff) { - } - - @Override - public boolean reset() { - return true; - } - - - - @Override - public boolean interact() { - - GnollClothes clothes = Dungeon.hero.belongings.getItem(GnollClothes.class); - - sprite.turnTo(pos, Dungeon.hero.pos); - if (state == SLEEPING && Dungeon.gnollmission==false) { - notice(); - yell(Messages.get(this, "yell1")); - yell(Messages.get(this, "yell2")); - state = PASSIVE; - } else if (Dungeon.gnollmission==false && clothes == null){ - yell(Messages.get(this, "yell3")); - } else if (Dungeon.gnollmission==false && clothes!=null ){ - yell(Messages.get(this, "yell4")); - GameScene.show(new WndONS(this, clothes)); - } else if (Dungeon.gnollmission==true && state == PASSIVE) { - yell(Messages.get(this, "yell5")); - } else { - notice(); - yell(Messages.get(this, "yell6")); - state = PASSIVE; - } - return true; - } - - @Override - public String description() { - return ((OldNewStwistSprite) sprite).gnollmission ? - Messages.get(this, "desc_gnollmission") : super.description(); - } -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/npcs/Omicronrg9.java b/java/com/hmdzl/spspd/change/actors/mobs/npcs/Omicronrg9.java deleted file mode 100644 index 1e582d34..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/npcs/Omicronrg9.java +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs.npcs; - - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.sprites.Omicronrg9Sprite; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.utils.Random; - -public class Omicronrg9 extends NPC { - - { - //name = "omicronrg9"; - spriteClass = Omicronrg9Sprite.class; - state = WANDERING; - properties.add(Property.HUMAN); - } - - /*@Override - protected boolean act() { - throwItem(); - return super.act(); - } */ - - @Override - public int evadeSkill(Char enemy) { - return 1000; - } - - - @Override - protected Char chooseEnemy() { - return null; - } - - @Override - public void damage(int dmg, Object src) { - } - - @Override - public void add(Buff buff) { - } - - @Override - public boolean reset() { - return true; - } - - - - @Override - public boolean interact() { - - sprite.turnTo(pos, Dungeon.hero.pos); - switch (Random.Int (6)) { - case 0: - yell(Messages.get(this, "yell1")); - break; - case 1: - yell(Messages.get(this, "yell2")); - break; - case 2: - yell(Messages.get(this, "yell3")); - break; - case 3: - yell(Messages.get(this, "yell4")); - break; - case 4: - yell(Messages.get(this, "yell5")); - break; - case 5: - yell(Messages.get(this, "yell6")); - break; - } - return true; - } - -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/npcs/OtilukeNPC.java b/java/com/hmdzl/spspd/change/actors/mobs/npcs/OtilukeNPC.java deleted file mode 100644 index 7b8dea65..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/npcs/OtilukeNPC.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs.npcs; - -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.items.Amulet; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.OtilukeNPCSprite; - -import com.hmdzl.spspd.change.windows.WndQuest; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -public class OtilukeNPC extends NPC { - - { - //name = "Otiluke"; - spriteClass = OtilukeNPCSprite.class; - properties.add(Property.HUMAN); - } - - @Override - protected boolean act() { - throwItem(); - return super.act(); - } - - @Override - public int evadeSkill(Char enemy) { - return 1000; - } - - @Override - protected Char chooseEnemy() { - return null; - } - - @Override - public void damage(int dmg, Object src) { - } - - @Override - public void add(Buff buff) { - } - - @Override - public boolean reset() { - return true; - } - - @Override - public boolean interact() { - - sprite.turnTo(pos, Dungeon.hero.pos); - switch (Random.Int (3)) { - case 0: - yell(Messages.get(this, "yell1")); - break; - case 1: - yell(Messages.get(this, "yell2")); - break; - case 2: - yell(Messages.get(this, "yell3")); - Dungeon.level.drop(new Amulet(), Dungeon.hero.pos).sprite.drop(); - break; - } - return true; - - } -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/npcs/RENnpc.java b/java/com/hmdzl/spspd/change/actors/mobs/npcs/RENnpc.java deleted file mode 100644 index 1d24e421..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/npcs/RENnpc.java +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs.npcs; - - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.Statistics; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.items.ChallengeBook; -import com.hmdzl.spspd.change.items.food.meatfood.ChargrilledMeat; -import com.hmdzl.spspd.change.items.weapon.melee.special.Goei; -import com.hmdzl.spspd.change.sprites.RENSprite; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.utils.Random; - -public class RENnpc extends NPC { - - { - //name = "RENnpc"; - spriteClass = RENSprite.class; - properties.add(Property.ELF);; - } - - @Override - protected boolean act() { - throwItem(); - return super.act(); - } - - @Override - public int evadeSkill(Char enemy) { - return 1000; - } - - - @Override - protected Char chooseEnemy() { - return null; - } - - @Override - public void damage(int dmg, Object src) { - } - - @Override - public void add(Buff buff) { - } - - @Override - public boolean reset() { - return true; - } - - - - @Override - public boolean interact() { - - sprite.turnTo(pos, Dungeon.hero.pos); - if(Dungeon.challengebookdrop == false) { - //Dungeon.limitedDrops.challengebook.dropped(); - Dungeon.level.drop(new ChallengeBook(), Dungeon.hero.pos).sprite.drop(); - Dungeon.challengebookdrop = true; - yell(Messages.get(this, "yell3")); - - } else if(Dungeon.goeidrop == false && (Statistics.archersKilled > 50 && Statistics.skeletonsKilled > 50 && Statistics.albinoPiranhasKilled > 50 && Statistics.goldThievesKilled > 50)){ - Dungeon.level.drop(new Goei(), Dungeon.hero.pos).sprite.drop(); - Dungeon.goeidrop = true; - yell(Messages.get(this, "yell5")); - } else - switch (Random.Int (3)) { - case 0: - yell(Messages.get(this, "yell1")); - break; - case 1: - yell(Messages.get(this, "yell2")); - break; - case 2: - yell(Messages.get(this, "yell4")); - break; - } - return true; - } -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/npcs/RainTrainer.java b/java/com/hmdzl/spspd/change/actors/mobs/npcs/RainTrainer.java deleted file mode 100644 index c1817341..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/npcs/RainTrainer.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs.npcs; - - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.sprites.HeXASprite; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.RainSprite; -import com.watabou.utils.Random; - -public class RainTrainer extends NPC { - - { - //name = "Rain"; - spriteClass = RainSprite.class; - properties.add(Property.ELEMENT); - } - - @Override - protected boolean act() { - throwItem(); - return super.act(); - } - - @Override - public int evadeSkill(Char enemy) { - return 1000; - } - - - @Override - protected Char chooseEnemy() { - return null; - } - - @Override - public void damage(int dmg, Object src) { - } - - @Override - public void add(Buff buff) { - } - - @Override - public boolean reset() { - return true; - } - - - - @Override - public boolean interact() { - - sprite.turnTo(pos, Dungeon.hero.pos); - switch (Random.Int (2)) { - case 0: - yell(Messages.get(this, "yell1")); - break; - case 1: - yell(Messages.get(this, "yell2")); - break; - } - return true; - } -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/npcs/RatKing.java b/java/com/hmdzl/spspd/change/actors/mobs/npcs/RatKing.java deleted file mode 100644 index 2b830aa3..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/npcs/RatKing.java +++ /dev/null @@ -1,119 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs.npcs; - - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.Statistics; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.items.Heap; -import com.hmdzl.spspd.change.items.weapon.melee.special.Spork; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.RatKingSprite; - -public class RatKing extends NPC { - - { - //name = "rat king"; - spriteClass = RatKingSprite.class; - - state = SLEEPING; - properties.add(Property.BEAST); - properties.add(Property.BOSS); - } - - @Override - public int evadeSkill(Char enemy) { - return 1000; - } - - @Override - public float speed() { - return 2f; - } - - @Override - protected Char chooseEnemy() { - return null; - } - - @Override - public void damage(int dmg, Object src) { - } - - @Override - public void add(Buff buff) { - } - - @Override - public boolean reset() { - return true; - } - - - - @Override - public boolean interact() { - - int checkChests = 2; - int length = Level.getLength(); - for (int i = 0; i < length; i++) { - Heap chest = Dungeon.level.heaps.get(i); - if(chest != null && chest.chestCheck()){checkChests++;} - } - - Spork spork = Dungeon.hero.belongings.getItem(Spork.class); - //RunicBlade runicblade = Dungeon.hero.belongings.getItem(RunicBlade.class); - - sprite.turnTo(pos, Dungeon.hero.pos); - if (state == SLEEPING) { - notice(); - yell(Messages.get(this, "not_sleeping")); - yell(Messages.get(this, "not_takeing")); - state = WANDERING; - //} else if (Statistics.deepestFloor>9 && checkChests >= Dungeon.ratChests && spork==null && runicblade==null){ - } else if (Statistics.deepestFloor>10 && checkChests >= Dungeon.ratChests && spork==null){ - yell(Messages.get(this, "thanks")); - Dungeon.sporkAvail = true; - } else if (checkChests < Dungeon.ratChests){ - Dungeon.sporkAvail = false; - yell(Messages.get(this, "why")); - } else if (spork!=null) { - //yell("You found my spork! Here, trade me for this old one."); - yell(Messages.get(this, "havefun")); - //if (spork.isEquipped(Dungeon.hero)) { - // spork.doUnequip(Dungeon.hero, false); - //} - //spork.detach(Dungeon.hero.belongings.backpack); - //Dungeon.level.drop(new RunicBlade().enchantNom(), pos).sprite.drop(); - //Dungeon.limitedDrops.runicblade.drop(); - - } else { - yell(Messages.get(this, "what_is_it")); - } - return true; - } - - @Override - public String description() { - return ((RatKingSprite) sprite).festive ? - Messages.get(this, "desc_festive") : super.description(); - } -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/npcs/RatKingDen.java b/java/com/hmdzl/spspd/change/actors/mobs/npcs/RatKingDen.java deleted file mode 100644 index 5e0e36ef..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/npcs/RatKingDen.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs.npcs; - - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.RatKingSprite; - -public class RatKingDen extends NPC { - - { - //name = "rat king"; - spriteClass = RatKingSprite.class; - - state = SLEEPING; - properties.add(Property.BEAST); - properties.add(Property.BOSS); - } - - @Override - public int evadeSkill(Char enemy) { - return 1000; - } - - @Override - public float speed() { - return 2f; - } - - @Override - protected Char chooseEnemy() { - return null; - } - - @Override - public void damage(int dmg, Object src) { - } - - @Override - public void add(Buff buff) { - } - - @Override - public boolean reset() { - return true; - } - - - - @Override - public boolean interact() { - - sprite.turnTo(pos, Dungeon.hero.pos); - if (state == SLEEPING) { - notice(); - yell(Messages.get(this, "not_sleeping")); - state = WANDERING; - - } else { - yell(Messages.get(this, "what_is_it")); - } - return true; - } - - @Override - public String description() { - return ((RatKingSprite) sprite).festive ? - Messages.get(this, "desc_festive") - : super.description(); - } -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/npcs/Ravenwolf.java b/java/com/hmdzl/spspd/change/actors/mobs/npcs/Ravenwolf.java deleted file mode 100644 index d59aa434..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/npcs/Ravenwolf.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs.npcs; - - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.sprites.RavenwolfSprite; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.utils.Random; - -public class Ravenwolf extends NPC { - - { - //name = "ravenwolf"; - spriteClass = RavenwolfSprite.class; - //state = WANDERING; - properties.add(Property.UNKNOW); - } - - /*@Override - protected boolean act() { - throwItem(); - return super.act(); - } */ - - @Override - public int evadeSkill(Char enemy) { - return 1000; - } - - - @Override - protected Char chooseEnemy() { - return null; - } - - @Override - public void damage(int dmg, Object src) { - } - - @Override - public void add(Buff buff) { - } - - @Override - public boolean reset() { - return true; - } - - - - @Override - public boolean interact() { - - sprite.turnTo(pos, Dungeon.hero.pos); - switch (Random.Int (2)) { - case 0: - yell(Messages.get(this, "yell1")); - break; - case 1: - yell(Messages.get(this, "yell2")); - break; - } - return true; - } - -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/npcs/Rustyblade.java b/java/com/hmdzl/spspd/change/actors/mobs/npcs/Rustyblade.java deleted file mode 100644 index ee99de96..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/npcs/Rustyblade.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs.npcs; - - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.sprites.RustybladeSprite; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.utils.Random; - -public class Rustyblade extends NPC { - - { - //name = Messages.get(this,"name"); - spriteClass = RustybladeSprite.class; - properties.add(Property.HUMAN); - } - - @Override - protected boolean act() { - throwItem(); - return super.act(); - } - - @Override - public int evadeSkill(Char enemy) { - return 1000; - } - - - @Override - protected Char chooseEnemy() { - return null; - } - - @Override - public void damage(int dmg, Object src) { - } - - @Override - public void add(Buff buff) { - } - - @Override - public boolean reset() { - return true; - } - - - - @Override - public boolean interact() { - - sprite.turnTo(pos, Dungeon.hero.pos); - switch (Random.Int (2)) { - case 0: - yell(Messages.get(this, "yell1")); - break; - case 1: - yell(Messages.get(this, "yell2")); - break; - } - return true; - } - -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/npcs/SFB.java b/java/com/hmdzl/spspd/change/actors/mobs/npcs/SFB.java deleted file mode 100644 index de4f524e..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/npcs/SFB.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs.npcs; - - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.sprites.SFBSprite; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.utils.Random; - -public class SFB extends NPC { - - { - //name = "Shattered Flame Blast"; - spriteClass = SFBSprite.class; - properties.add(Property.UNKNOW); - } - - @Override - protected boolean act() { - if (Dungeon.visible[pos]) { - - yell(Messages.get(this, "hello")); - } - throwItem(); - return super.act(); - } - - @Override - public int evadeSkill(Char enemy) { - return 1000; - } - - - @Override - protected Char chooseEnemy() { - return null; - } - - @Override - public void damage(int dmg, Object src) { - } - - @Override - public void add(Buff buff) { - } - - @Override - public boolean reset() { - return true; - } - - - - @Override - public boolean interact() { - - sprite.turnTo(pos, Dungeon.hero.pos); - switch (Random.Int (2)) { - case 0: - yell(Messages.get(this, "yell1")); - break; - case 1: - yell(Messages.get(this, "yell2")); - break; - } - return true; - } -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/npcs/SP931.java b/java/com/hmdzl/spspd/change/actors/mobs/npcs/SP931.java deleted file mode 100644 index 76777741..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/npcs/SP931.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs.npcs; - - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.sprites.SP931Sprite; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.utils.Random; - -public class SP931 extends NPC { - - { - //name = "931451545"; - spriteClass = SP931Sprite.class; - state = WANDERING; - properties.add(Property.UNKNOW); - } - - /*@Override - protected boolean act() { - throwItem(); - return super.act(); - } */ - - @Override - public int evadeSkill(Char enemy) { - return 1000; - } - - - @Override - protected Char chooseEnemy() { - return null; - } - - @Override - public void damage(int dmg, Object src) { - } - - @Override - public void add(Buff buff) { - } - - @Override - public boolean reset() { - return true; - } - - - - @Override - public boolean interact() { - - sprite.turnTo(pos, Dungeon.hero.pos); - switch (Random.Int (2)) { - case 0: - yell(Messages.get(this, "yell1")); - break; - case 1: - yell(Messages.get(this, "yell2")); - break; - } - return true; - } - -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/npcs/SadSaltan.java b/java/com/hmdzl/spspd/change/actors/mobs/npcs/SadSaltan.java deleted file mode 100644 index ae92834e..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/npcs/SadSaltan.java +++ /dev/null @@ -1,69 +0,0 @@ -package com.hmdzl.spspd.change.actors.mobs.npcs; - - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.sprites.SadSaltanSprite; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.utils.Random; - -public class SadSaltan extends NPC { - - { - //name = "SadSaltan"; - spriteClass = SadSaltanSprite.class; - state = WANDERING; - properties.add(Property.HUMAN); - } - - /*@Override - protected boolean act() { - throwItem(); - return super.act(); - }*/ - - @Override - public int evadeSkill(Char enemy) { - return 1000; - } - - - @Override - protected Char chooseEnemy() { - return null; - } - - @Override - public void damage(int dmg, Object src) { - } - - @Override - public void add(Buff buff) { - } - - @Override - public boolean reset() { - return true; - } - - - - @Override - public boolean interact() { - - sprite.turnTo(pos, Dungeon.hero.pos); - switch (Random.Int (3)) { - case 0: - yell(Messages.get(this, "yell1")); - break; - case 1: - yell(Messages.get(this, "yell2")); - break; - case 2: - yell(Messages.get(this, "yell3")); - break; - } - return true; - } -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/npcs/SaidbySun.java b/java/com/hmdzl/spspd/change/actors/mobs/npcs/SaidbySun.java deleted file mode 100644 index ede22e52..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/npcs/SaidbySun.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs.npcs; - - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.sprites.SaidbySunSprite; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.utils.Random; - -public class SaidbySun extends NPC { - - { - //name = "SaidbySun"; - spriteClass = SaidbySunSprite.class; - //state = WANDERING; - properties.add(Property.BEAST); - } - - /*@Override - protected boolean act() { - throwItem(); - return super.act(); - } */ - - @Override - public int evadeSkill(Char enemy) { - return 1000; - } - - - @Override - protected Char chooseEnemy() { - return null; - } - - @Override - public void damage(int dmg, Object src) { - } - - @Override - public void add(Buff buff) { - } - - @Override - public boolean reset() { - return true; - } - - - - @Override - public boolean interact() { - - sprite.turnTo(pos, Dungeon.hero.pos); - switch (Random.Int (2)) { - case 0: - yell(Messages.get(this, "yell1")); - break; - case 1: - yell(Messages.get(this, "yell2")); - break; - } - return true; - } - -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/npcs/Sheep.java b/java/com/hmdzl/spspd/change/actors/mobs/npcs/Sheep.java deleted file mode 100644 index 06864ec0..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/npcs/Sheep.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * Shattered Pixel Dungeon - * Copyright (C) 2014-2015 Evan Debenham - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs.npcs; - -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.SheepSprite; -import com.watabou.utils.Random; - -public class Sheep extends NPC { - - private static final String[] LINE_KEYS = {"Baa!", "Baa?", "Baa.", "Baa..."}; - - { - spriteClass = SheepSprite.class; - properties.add(Property.BEAST); - } - - public float lifespan; - - private boolean initialized = false; - - @Override - protected boolean act() { - if (initialized) { - HP = 0; - - destroy(); - sprite.die(); - - } else { - initialized = true; - spend( lifespan + Random.Float(2) ); - } - return true; - } - - @Override - public void damage( int dmg, Object src ) { - } - - @Override - public boolean interact() { - yell( Messages.get(this, Random.element(LINE_KEYS)) ); - return false; - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/actors/mobs/npcs/SheepSokoban.java b/java/com/hmdzl/spspd/change/actors/mobs/npcs/SheepSokoban.java deleted file mode 100644 index 3daaf74b..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/npcs/SheepSokoban.java +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs.npcs; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.sprites.SokobanSheepSprite; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.utils.Random; - -public class SheepSokoban extends NPC { - - -{ -spriteClass = SokobanSheepSprite.class; -properties.add(Property.UNKNOW); -} - - -@Override -protected boolean act() { - throwItem(); - return super.act(); -} - -@Override -public void add(Buff buff) { -} - - @Override - public void beckon(int cell) { - // Do nothing - } - -@Override -public void damage(int dmg, Object src) { -} - -/* -W-1 -W -W+1 - * -1 P +1 - * W-1 W W+1 - * - */ - -@Override -public boolean interact() { - int curPos = pos; - int movPos = pos; - int width = Level.getWidth(); - boolean moved = false; - int posDif = Dungeon.hero.pos-curPos; - - if (posDif==1) { - movPos = curPos-1; - } else if(posDif==-1) { - movPos = curPos+1; - } else if(posDif==width) { - movPos = curPos-width; - } else if(posDif==-width) { - movPos = curPos+width; - } - - if (movPos != pos && (Level.passable[movPos] || Level.avoid[movPos]) && Actor.findChar(movPos) == null){ - - moveSprite(curPos,movPos); - move(movPos); - moved=true; - - } - - if(moved){ - Dungeon.hero.sprite.move(Dungeon.hero.pos, curPos); - Dungeon.hero.move(curPos); - } - - Dungeon.hero.spend(1 / Dungeon.hero.speed()); - Dungeon.hero.busy(); - return true; - //yell(Random.element(QUOTES)); - -} - -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/npcs/SheepSokobanBlack.java b/java/com/hmdzl/spspd/change/actors/mobs/npcs/SheepSokobanBlack.java deleted file mode 100644 index 4c10520b..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/npcs/SheepSokobanBlack.java +++ /dev/null @@ -1,111 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs.npcs; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.effects.particles.ShadowParticle; -import com.hmdzl.spspd.change.items.wands.WandOfBlood; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.sprites.SokobanBlackSheepSprite; -import com.hmdzl.spspd.change.sprites.SokobanSheepSwitchSprite; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.utils.Random; - -public class SheepSokobanBlack extends NPC { - -{ -spriteClass = SokobanBlackSheepSprite.class; - properties.add(Property.UNKNOW); -} - - -@Override -protected boolean act() { - throwItem(); - return super.act(); -} - -@Override -public void damage(int dmg, Object src) { -} -@Override -public void add(Buff buff) { -} - - @Override - public void beckon(int cell) { - // Do nothing - } - -@Override -public boolean interact() { - int traps = Dungeon.level.countFleeceTraps(pos, 5); - int newPos = -1; - int curPos = pos; - int count = 100; - int dist = 6; - boolean moved = false; - - if (traps>0){ - - do { - newPos = Dungeon.level.randomRespawnCellSheep(pos, 5); - dist = Level.distance(newPos, pos); - if (count-- <= 0) { - break; - } - } while (newPos == -1); - - } - - if (newPos == -1) { - - - //yell( Messages.get(Sheep.class, Random.element(LINE_KEYS))); - //yell("pos = " + dist); - destroy(); - sprite.killAndErase(); - sprite.emitter().burst(ShadowParticle.UP, 5); - moved=true; - - } else { - //yell( Messages.get(Sheep.class, Random.element(LINE_KEYS))); - //yell("pos = " + dist); - Actor.freeCell(pos); - CellEmitter.get(pos).start(Speck.factory(Speck.LIGHT), 0.2f, 3); - pos = newPos; - move(pos); - moved=true; - } - - if(moved){ - Dungeon.hero.sprite.move(Dungeon.hero.pos, curPos); - Dungeon.hero.move(curPos); - } - - Dungeon.hero.spend(1 / Dungeon.hero.speed()); - Dungeon.hero.busy(); - return true; - } - -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/npcs/SheepSokobanCorner.java b/java/com/hmdzl/spspd/change/actors/mobs/npcs/SheepSokobanCorner.java deleted file mode 100644 index de082438..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/npcs/SheepSokobanCorner.java +++ /dev/null @@ -1,112 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs.npcs; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.sprites.SokobanCornerSheepSprite; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.utils.Random; - -public class SheepSokobanCorner extends NPC { - - -{ -spriteClass = SokobanCornerSheepSprite.class; - properties.add(Property.UNKNOW); -} - - -@Override -protected boolean act() { - throwItem(); - return super.act(); -} - -@Override -public void damage(int dmg, Object src) { -} - - @Override - public void beckon(int cell) { - // Do nothing - } - -@Override -public void add(Buff buff) { -} - -/* -W-1 -W -W+1 - * -1 P +1 - * W-1 W W+1 - * - */ - -@Override -public boolean interact() { - int curPos = pos; - int movPos = pos; - int width = Level.getWidth(); - boolean moved = false; - int posDif = Dungeon.hero.pos-curPos; - - if (posDif==1) { - movPos = curPos-1; - } else if(posDif==-1) { - movPos = curPos+1; - } else if(posDif==width) { - movPos = curPos-width; - } else if(posDif==-width) { - movPos = curPos+width; - } - - else if(posDif==-width+1) { - movPos = curPos+width-1; - - } else if(posDif==-width-1) { - movPos = curPos+width+1; - - } else if(posDif==width+1) { - movPos = curPos-(width+1); - - } else if(posDif==width-1) { - movPos = curPos-(width-1); - } - - if (movPos != pos && (Level.passable[movPos] || Level.avoid[movPos]) && Actor.findChar(movPos) == null){ - - moveSprite(curPos,movPos); - move(movPos); - moved=true; - - } - - if(moved){ - Dungeon.hero.sprite.move(Dungeon.hero.pos, curPos); - Dungeon.hero.move(curPos); - } - Dungeon.hero.spend(1 / Dungeon.hero.speed()); - Dungeon.hero.busy(); - return true; - //yell(Random.element(QUOTES)); - -} - -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/npcs/SheepSokobanStop.java b/java/com/hmdzl/spspd/change/actors/mobs/npcs/SheepSokobanStop.java deleted file mode 100644 index 84d4e516..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/npcs/SheepSokobanStop.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs.npcs; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.sprites.SheepSprite; -import com.hmdzl.spspd.change.sprites.SokobanSheepSprite; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.utils.Random; - -public class SheepSokobanStop extends NPC { - private static final String[] LINE_KEYS = {"Baa!", "Baa?", "Baa.", "Baa..."}; -{ -spriteClass = SheepSprite.class; - properties.add(Property.UNKNOW); -} - - -@Override -protected boolean act() { - throwItem(); - return super.act(); -} - -@Override -public void damage(int dmg, Object src) { -} - - @Override - public void beckon(int cell) { - // Do nothing - } - -@Override -public void add(Buff buff) { -} - -/* -W-1 -W -W+1 - * -1 P +1 - * W-1 W W+1 - * - */ - -@Override -public boolean interact() { - yell( Messages.get(this, Random.element(LINE_KEYS))); - return false; -} - -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/npcs/SheepSokobanSwitch.java b/java/com/hmdzl/spspd/change/actors/mobs/npcs/SheepSokobanSwitch.java deleted file mode 100644 index 352a67ed..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/npcs/SheepSokobanSwitch.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs.npcs; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.sprites.SokobanSheepSwitchSprite; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.utils.Random; - -public class SheepSokobanSwitch extends NPC { - -{ -spriteClass = SokobanSheepSwitchSprite.class; - properties.add(Property.UNKNOW); -} - - -@Override -protected boolean act() { - throwItem(); - return super.act(); -} - -@Override -public void damage(int dmg, Object src) { -} -@Override -public void add(Buff buff) { -} - - @Override - public void beckon(int cell) { - // Do nothing - } - -@Override -public boolean interact() { - int curPos = pos; - - //yell(Random.element(QUOTES)); - moveSprite(pos, Dungeon.hero.pos); - move(Dungeon.hero.pos); - - Dungeon.hero.sprite.move(Dungeon.hero.pos, curPos); - Dungeon.hero.move(curPos); - - Dungeon.hero.spend(1 / Dungeon.hero.speed()); - Dungeon.hero.busy(); - return true; - } - -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/npcs/Shopkeeper.java b/java/com/hmdzl/spspd/change/actors/mobs/npcs/Shopkeeper.java deleted file mode 100644 index 3f50302a..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/npcs/Shopkeeper.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs.npcs; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.particles.ElmoParticle; -import com.hmdzl.spspd.change.items.Heap; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ShopkeeperSprite; -import com.hmdzl.spspd.change.windows.WndBag; -import com.hmdzl.spspd.change.windows.WndTradeItem; -import com.hmdzl.spspd.change.messages.Messages; - -public class Shopkeeper extends NPC { - - { - //name = "shopkeeper"; - spriteClass = ShopkeeperSprite.class; - properties.add(Property.HUMAN); - properties.add(Property.IMMOVABLE); - } - - @Override - protected boolean act() { - - throwItem(); - - sprite.turnTo(pos, Dungeon.hero.pos); - spend(TICK); - return true; - } - - @Override - public int evadeSkill(Char enemy) { - return 1000; - } - - @Override - public void damage(int dmg, Object src) { - } - - @Override - public void add(Buff buff) { - } - - @Override - public boolean reset() { - return true; - } - - public static WndBag sell() { - return GameScene.selectItem(itemSelector, WndBag.Mode.FOR_SALE, - Messages.get(Shopkeeper.class, "sell")); - } - - private static WndBag.Listener itemSelector = new WndBag.Listener() { - @Override - public void onSelect(Item item) { - if (item != null) { - - WndBag parentWnd = sell(); - GameScene.show(new WndTradeItem(item, parentWnd)); - } - } - }; - - @Override - public boolean interact() { - sell(); - return false; - } -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/npcs/Shower.java b/java/com/hmdzl/spspd/change/actors/mobs/npcs/Shower.java deleted file mode 100644 index 1e673b1c..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/npcs/Shower.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs.npcs; - - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.sprites.ShowerSprite; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.utils.Random; - -public class Shower extends NPC { - - { - //name = "Shower"; - spriteClass = ShowerSprite.class; - state = WANDERING; - properties.add(Property.ELF); - } - - /*@Override - protected boolean act() { - throwItem(); - return super.act(); - } */ - - @Override - public int evadeSkill(Char enemy) { - return 1000; - } - - - @Override - protected Char chooseEnemy() { - return null; - } - - @Override - public void damage(int dmg, Object src) { - } - - @Override - public void add(Buff buff) { - } - - @Override - public boolean reset() { - return true; - } - - - - @Override - public boolean interact() { - - sprite.turnTo(pos, Dungeon.hero.pos); - switch (Random.Int (3)) { - case 0: - yell(Messages.get(this, "yell1")); - break; - case 1: - yell(Messages.get(this, "yell2")); - break; - case 2: - yell(Messages.get(this, "yell3")); - break; - } - return true; - } - -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/npcs/StormAndRain.java b/java/com/hmdzl/spspd/change/actors/mobs/npcs/StormAndRain.java deleted file mode 100644 index 4a617187..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/npcs/StormAndRain.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs.npcs; - - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.sprites.StormAndRainSprite; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.utils.Random; - -public class StormAndRain extends NPC { - - { - //name = Messages.get(this,"name"); - spriteClass = StormAndRainSprite.class; - properties.add(Property.DEMONIC); - } - - @Override - protected boolean act() { - throwItem(); - return super.act(); - } - - @Override - public int evadeSkill(Char enemy) { - return 1000; - } - - - @Override - protected Char chooseEnemy() { - return null; - } - - @Override - public void damage(int dmg, Object src) { - } - - @Override - public void add(Buff buff) { - } - - @Override - public boolean reset() { - return true; - } - - - - @Override - public boolean interact() { - - sprite.turnTo(pos, Dungeon.hero.pos); - switch (Random.Int (2)) { - case 0: - yell(Messages.get(this, "yell1")); - break; - case 1: - yell(Messages.get(this, "yell2")); - break; - } - return true; - } -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/npcs/Tempest102.java b/java/com/hmdzl/spspd/change/actors/mobs/npcs/Tempest102.java deleted file mode 100644 index 0fad09ec..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/npcs/Tempest102.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs.npcs; - - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.sprites.Tempest102Sprite; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.utils.Random; - -public class Tempest102 extends NPC { - - { - //name = Messages.get(this,"name"); - spriteClass = Tempest102Sprite.class; - properties.add(Property.HUMAN); - } - - @Override - protected boolean act() { - throwItem(); - return super.act(); - } - - @Override - public int evadeSkill(Char enemy) { - return 1000; - } - - - @Override - protected Char chooseEnemy() { - return null; - } - - @Override - public void damage(int dmg, Object src) { - } - - @Override - public void add(Buff buff) { - } - - @Override - public boolean reset() { - return true; - } - - - - @Override - public boolean interact() { - - sprite.turnTo(pos, Dungeon.hero.pos); - switch (Random.Int (2)) { - case 0: - yell(Messages.get(this, "yell1")); - break; - case 1: - yell(Messages.get(this, "yell2")); - break; - } - return true; - } -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/npcs/ThankList.java b/java/com/hmdzl/spspd/change/actors/mobs/npcs/ThankList.java deleted file mode 100644 index dc326092..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/npcs/ThankList.java +++ /dev/null @@ -1,202 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs.npcs; - - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.sprites.Kostis12345Sprite; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.ThankListSprite; -import com.watabou.utils.Random; - -public class ThankList extends NPC { - - { - //name = "ThankList"; - spriteClass = ThankListSprite.class; - //state = WANDERING; - properties.add(Property.UNKNOW); - } - - /*@Override - protected boolean act() { - throwItem(); - return super.act(); - } */ - - @Override - public int evadeSkill(Char enemy) { - return 1000; - } - - - @Override - protected Char chooseEnemy() { - return null; - } - - @Override - public void damage(int dmg, Object src) { - } - - @Override - public void add(Buff buff) { - } - - @Override - public boolean reset() { - return true; - } - - - - @Override - public boolean interact() { - - sprite.turnTo(pos, Dungeon.hero.pos); - switch (Random.Int (46)) { - case 0: - yell("SuperSaiyan99"); - break; - case 1: - yell("‎Noodlemire"); - break; - case 3: - yell("猫佑薄荷"); - break; - case 4: - yell("RavenWolf"); - break; - case 5: - yell("Watabou"); - break; - case 6: - yell("‎Bilboldev"); - break; - case 7: - yell("‎ConsideredHamster"); - break; - case 8: - yell("‎Dachhack"); - break; - case 9: - yell("‎HeXA"); - break; - case 10: - yell("‎Juh9870"); - break; - case 11: - yell("Locastan"); - break; - case 12: - yell("‎NYRDS"); - break; - case 13: - yell("‎OldNewStwist"); - break; - case 14: - yell("‎SadSaltan"); - break; - case 15: - yell("Typedscroll"); - break; - case 16: - yell("‎Leppan"); - break; - case 17: - yell("Sharku2011"); - break; - case 18: - yell("‎老雷霆"); - break; - case 19: - yell("‎qi"); - break; - case 20: - yell("‎ian949"); - break; - case 22: - yell("‎RaiseDead"); - break; - case 23: - yell("‎指虎教徒"); - break; - case 25: - yell("白幽妹"); - break; - case 26: - yell("章华"); - break; - case 27: - yell("Hmorow12"); - break; - case 28: - yell("Eccentric_eye"); - break; - case 29: - yell("Ropuszka"); - break; - case 30: - yell("TrashboxBobylev"); - break; - case 31: - yell("Q1a2q1a2"); - break; - case 32: - yell("QueenOfTheMeowntain"); - break; - case 33: - yell("Buue2"); - break; - case 34: - yell("lighthouse64"); - break; - case 35: - yell("najecniv20"); - break; - case 36: - yell("Torian99"); - break; - case 37: - yell("deeperbroken"); - break; - case 38: - yell("DGN1"); - break; - case 39: - yell("Eldskutf"); - break; - case 41: - yell("SkyMuffin"); - break; - case 42: - yell("DragosCat1"); - break; - case 43: - yell("BlankDriver"); - break; - case 45: - yell(Messages.get(this, "yell1")); - break; - } - return true; - } - -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/npcs/Tinkerer1.java b/java/com/hmdzl/spspd/change/actors/mobs/npcs/Tinkerer1.java deleted file mode 100644 index a2038892..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/npcs/Tinkerer1.java +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs.npcs; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.items.DewVial; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.quest.Mushroom; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.TinkererSprite; - -import com.hmdzl.spspd.change.windows.WndQuest; -import com.hmdzl.spspd.change.windows.WndTinkerer; -import com.hmdzl.spspd.change.messages.Messages; - -public class Tinkerer1 extends NPC { - - { - //name = "tinkerer"; - spriteClass = TinkererSprite.class; - properties.add(Property.HUMAN); - properties.add(Property.IMMOVABLE); - } - - private static final String TXT_DUNGEON = "Oh wow, have you seen this dungeon! This is an awesome dungeon. " - + "I'm here checking things out of course, but also scavenging for toadstool mushrooms. " - + "Could you bring me any toadstool mushrooms you find? "; - - private static final String TXT_DUNGEON2 = "Oh wow, have you seen this dungeon! This is an awesome dungeon. "; - - private static final String TXT_MUSH = "Any luck finding toadstool mushrooms, %s?"; - - @Override - protected boolean act() { - throwItem(); - return super.act(); - } - - @Override - public int evadeSkill(Char enemy) { - return 1000; - } - - @Override - public void damage(int dmg, Object src) { - } - - @Override - public void add(Buff buff) { - } - - @Override - public boolean reset() { - return true; - } - - @Override - public boolean interact() { - - sprite.turnTo(pos, Dungeon.hero.pos); - Item item = Dungeon.hero.belongings.getItem(Mushroom.class); - Item vial = Dungeon.hero.belongings.getItem(DewVial.class); - if (item != null && vial != null) { - GameScene.show(new WndTinkerer(this, item)); - } else if (item == null && vial != null) { - tell(Messages.get(this, "tell1")); - } else { - tell(Messages.get(this, "tell2")); - } - return false; - } - - private void tell( String text ) { - GameScene.show( - new WndQuest( this, text )); - } - -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/npcs/Tinkerer2.java b/java/com/hmdzl/spspd/change/actors/mobs/npcs/Tinkerer2.java deleted file mode 100644 index 426bd359..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/npcs/Tinkerer2.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs.npcs; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.items.summon.ActiveMrDestructo; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.quest.Mushroom; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.LynnSprite; - -import com.hmdzl.spspd.change.windows.WndQuest; -import com.hmdzl.spspd.change.windows.WndTinkerer2; -import com.hmdzl.spspd.change.messages.Messages; - -public class Tinkerer2 extends NPC { - - { - //name = "tinkerer"; - spriteClass = LynnSprite.class; - properties.add(Property.ELF); - properties.add(Property.IMMOVABLE); - } - - private static final String TXT_DUNGEON = "I'm scavenging for toadstool mushrooms. " - + "Could you bring me any toadstool mushrooms you find? "; - - - private static final String TXT_MUSH = "Any luck finding toadstool mushrooms, %s?"; - - @Override - protected boolean act() { - throwItem(); - return super.act(); - } - - @Override - public int evadeSkill(Char enemy) { - return 1000; - } - - @Override - public void damage(int dmg, Object src) { - } - - @Override - public void add(Buff buff) { - } - - @Override - public boolean reset() { - return true; - } - - @Override - public boolean interact() { - - sprite.turnTo(pos, Dungeon.hero.pos); - Item item = Dungeon.hero.belongings.getItem(Mushroom.class); - Item acmrd = Dungeon.hero.belongings.getItem(ActiveMrDestructo.class); - if (item != null && acmrd != null) { - GameScene.show(new WndTinkerer2(this, item, acmrd)); - } else if (item != null) { - GameScene.show(new WndTinkerer2(this, item, null)); - } else { - tell(Messages.get(this, "tell1")); - } - return false; - } - - private void tell( String text ) { - GameScene.show( - new WndQuest( this, text )); - } -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/npcs/Tinkerer3.java b/java/com/hmdzl/spspd/change/actors/mobs/npcs/Tinkerer3.java deleted file mode 100644 index 2ee2b613..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/npcs/Tinkerer3.java +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs.npcs; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.items.DewVial; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.quest.Mushroom; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.TinkererSprite; - -import com.hmdzl.spspd.change.windows.WndQuest; -import com.hmdzl.spspd.change.windows.WndTinkerer3; -import com.hmdzl.spspd.change.messages.Messages; - -public class Tinkerer3 extends NPC { - - { - //name = "tinkerer"; - spriteClass = TinkererSprite.class; - properties.add(Property.HUMAN); - properties.add(Property.IMMOVABLE); - } - - private static final String TXT_DUNGEON = "I'm scavenging for toadstool mushrooms. " - + "Could you bring me any toadstool mushrooms you find? "; - - private static final String TXT_DUNGEON2 = "Oh wow, have you seen this dungeon! This is an awesome dungeon. "; - - private static final String TXT_MUSH = "Any luck finding toadstool mushrooms, %s?"; - - @Override - protected boolean act() { - throwItem(); - return super.act(); - } - - @Override - public int evadeSkill(Char enemy) { - return 1000; - } - - @Override - public void damage(int dmg, Object src) { - } - - @Override - public void add(Buff buff) { - } - - @Override - public boolean reset() { - return true; - } - - @Override - public boolean interact() { - - sprite.turnTo(pos, Dungeon.hero.pos); - Item item = Dungeon.hero.belongings.getItem(Mushroom.class); - Item vial = Dungeon.hero.belongings.getItem(DewVial.class); - if (item != null && vial != null) { - GameScene.show(new WndTinkerer3(this, item)); - } else if (item == null && vial != null) { - tell(Messages.get(this, "tell1")); - } else { - tell(Messages.get(this, "tell2")); - } - return false; - } - - private void tell( String text ) { - GameScene.show( - new WndQuest( this, text )); - } - -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/npcs/Tinkerer4.java b/java/com/hmdzl/spspd/change/actors/mobs/npcs/Tinkerer4.java deleted file mode 100644 index 27f2aff1..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/npcs/Tinkerer4.java +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs.npcs; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.NoodlemireSprite; -import com.hmdzl.spspd.change.sprites.VillagerSprite; - -import com.hmdzl.spspd.change.windows.WndQuest; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.utils.Bundle; - -public class Tinkerer4 extends NPC { - - { - //name = "villager"; - spriteClass = NoodlemireSprite.class; - properties.add(Property.HUMAN); - } - - private static final String TXT_DUNGEON = "Otiluke? He came through here a few years ago.\n\n" - +"There used to be a mine to the Southwest of the town. " - +"It was overrun by demons and Otiluke sealed it off.\n\n" - +"We have not seen him since."; - - - private static final String TXT_DUNGEON2 = "The mine was covered up by bushes in the Southwest corner of the town. "; - - - @Override - protected boolean act() { - throwItem(); - return super.act(); - } - - private boolean first=true; - - private static final String FIRST = "first"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(FIRST, first); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - first = bundle.getBoolean(FIRST); - } - - @Override - protected Char chooseEnemy() { - return null; - } - @Override - public int evadeSkill(Char enemy) { - return 1000; - } - - @Override - public void damage(int dmg, Object src) { - } - - @Override - public void add(Buff buff) { - } - - @Override - public boolean interact() { - - sprite.turnTo(pos, Dungeon.hero.pos); - - if (first){ - tell(Messages.get(this, "tell1")); - first=false; - } else { - tell(Messages.get(this, "tell2")); - } - return true; - - } - - private void tell( String text ) { - GameScene.show( - new WndQuest( this, text )); - } - -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/npcs/Tinkerer5.java b/java/com/hmdzl/spspd/change/actors/mobs/npcs/Tinkerer5.java deleted file mode 100644 index c4a65b81..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/npcs/Tinkerer5.java +++ /dev/null @@ -1,114 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs.npcs; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.items.food.meatfood.ChargrilledMeat; -import com.hmdzl.spspd.change.scenes.GameScene; - -import com.hmdzl.spspd.change.sprites.Xavier251998Sprite; -import com.hmdzl.spspd.change.windows.WndQuest; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -public class Tinkerer5 extends NPC { - - { - //name = "villager"; - spriteClass = Xavier251998Sprite.class; - properties.add(Property.HUMAN); - } - - private static final String TXT_DUNGEON = "We used to mine stone ore out of the mines. " - +"But now a powerful dargon ruin the enter and watch in there." - +"Be careful if you enter its space."; - - - private static final String TXT_DUNGEON2 = "The building directly to the East from here houses the alter of the Gods. " - +"Bringing three Norn stones to the alter will be rewarded with a special treasure. "; - - private static final String TXT_DUNGEON3 = "You will need this food.Good luck!"; - - @Override - protected boolean act() { - throwItem(); - return super.act(); - } - - @Override - protected Char chooseEnemy() { - return null; - } - - private boolean first=true; - - private static final String FIRST = "first"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(FIRST, first); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - first = bundle.getBoolean(FIRST); - } - - @Override - public int evadeSkill(Char enemy) { - return 1000; - } - - - @Override - public void damage(int dmg, Object src) { - } - - @Override - public void add(Buff buff) { - } - - - @Override - public boolean interact() { - - sprite.turnTo(pos, Dungeon.hero.pos); - - if(first) { - first=false; - tell(Messages.get(this, "tell3")); - Dungeon.level.drop(new ChargrilledMeat(), Dungeon.hero.pos).sprite.drop(); - } else if (Random.Int(2)==0) { - tell(Messages.get(this, "tell1")); - } else { - tell(Messages.get(this, "tell2")); - } - - return true; - - } - - private void tell(String text ) { - GameScene.show(new WndQuest(this,text )); - } -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/npcs/TypedScroll.java b/java/com/hmdzl/spspd/change/actors/mobs/npcs/TypedScroll.java deleted file mode 100644 index e64e364a..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/npcs/TypedScroll.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs.npcs; - - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.sprites.TypedScrollSprite; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.utils.Random; - -public class TypedScroll extends NPC { - - { - //name = "TypedScroll"; - spriteClass = TypedScrollSprite.class; - properties.add(Property.DEMONIC); - properties.add(Property.UNKNOW); - } - - @Override - protected boolean act() { - throwItem(); - return super.act(); - } - - @Override - public int evadeSkill(Char enemy) { - return 1000; - } - - - @Override - protected Char chooseEnemy() { - return null; - } - - @Override - public void damage(int dmg, Object src) { - } - - @Override - public void add(Buff buff) { - } - - @Override - public boolean reset() { - return true; - } - - - - @Override - public boolean interact() { - - sprite.turnTo(pos, Dungeon.hero.pos); - switch (Random.Int (2)) { - case 0: - yell(Messages.get(this, "yell1")); - break; - case 1: - yell(Messages.get(this, "yell2")); - break; - } - return true; - } -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/npcs/Udawos.java b/java/com/hmdzl/spspd/change/actors/mobs/npcs/Udawos.java deleted file mode 100644 index 72577814..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/npcs/Udawos.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs.npcs; - - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.sprites.UdawosSprite; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.utils.Random; - -public class Udawos extends NPC { - - { - //name = "Udawos"; - spriteClass = UdawosSprite.class; - properties.add(Property.DWARF); - } - - @Override - protected boolean act() { - throwItem(); - return super.act(); - } - - @Override - public int evadeSkill(Char enemy) { - return 1000; - } - - - @Override - protected Char chooseEnemy() { - return null; - } - - @Override - public void damage(int dmg, Object src) { - } - - @Override - public void add(Buff buff) { - } - - @Override - public boolean reset() { - return true; - } - - - - @Override - public boolean interact() { - - switch (Random.Int (2)) { - case 0: - yell(Messages.get(this, "yell1")); - break; - case 1: - yell(Messages.get(this, "yell2")); - break; - } - return true; - } -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/npcs/UncleS.java b/java/com/hmdzl/spspd/change/actors/mobs/npcs/UncleS.java deleted file mode 100644 index dd28ce81..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/npcs/UncleS.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs.npcs; - - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.sprites.CoconutSprite; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.UncleSSprite; -import com.hmdzl.spspd.change.sprites.WhiteGhostSprite; -import com.watabou.utils.Random; - -public class UncleS extends NPC { - - { - spriteClass = UncleSSprite.class; - properties.add(Property.HUMAN); - - } - - @Override - protected boolean act() { - throwItem(); - return super.act(); - } - - @Override - public int evadeSkill(Char enemy) { - return 1000; - } - - - @Override - protected Char chooseEnemy() { - return null; - } - - @Override - public void damage(int dmg, Object src) { - } - - @Override - public void add(Buff buff) { - } - - @Override - public boolean reset() { - return true; - } - - - - @Override - public boolean interact() { - - sprite.turnTo(pos, Dungeon.hero.pos); - yell(Messages.get(this, "yell1")); - return true; - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/actors/mobs/npcs/Wandmaker.java b/java/com/hmdzl/spspd/change/actors/mobs/npcs/Wandmaker.java deleted file mode 100644 index 43cb2d37..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/npcs/Wandmaker.java +++ /dev/null @@ -1,327 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs.npcs; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Challenges; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.Journal; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.items.Heap; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.quest.CorpseDust; -import com.hmdzl.spspd.change.items.wands.Wand; -import com.hmdzl.spspd.change.items.wands.WandOfAcid; -import com.hmdzl.spspd.change.items.wands.WandOfCharm; -import com.hmdzl.spspd.change.items.wands.WandOfFlock; -import com.hmdzl.spspd.change.items.wands.WandOfMagicMissile; -import com.hmdzl.spspd.change.items.wands.WandOfMeteorite; -import com.hmdzl.spspd.change.items.wands.WandOfBlood; -import com.hmdzl.spspd.change.items.wands.WandOfDisintegration; -import com.hmdzl.spspd.change.items.wands.WandOfFirebolt; -import com.hmdzl.spspd.change.items.wands.WandOfLightning; -import com.hmdzl.spspd.change.items.wands.WandOfPoison; -import com.hmdzl.spspd.change.items.wands.WandOfLight; -import com.hmdzl.spspd.change.items.wands.WandOfFreeze; -import com.hmdzl.spspd.change.items.wands.WandOfFlow; -import com.hmdzl.spspd.change.items.wands.WandOfTCloud; -import com.hmdzl.spspd.change.levels.PrisonLevel; -import com.hmdzl.spspd.change.levels.Room; -import com.hmdzl.spspd.change.levels.Terrain; -import com.hmdzl.spspd.change.plants.Rotberry; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.WandmakerSprite; - -import com.hmdzl.spspd.change.windows.WndQuest; -import com.hmdzl.spspd.change.windows.WndWandmaker; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; -import com.hmdzl.spspd.change.messages.Messages; - -public class Wandmaker extends NPC { - - { - //name = "old wandmaker"; - spriteClass = WandmakerSprite.class; - properties.add(Property.HUMAN); - properties.add(Property.IMMOVABLE); - } - - private static final String TXT_BERRY1 = "Oh, what a pleasant surprise to meet a decent person in such place! I came here for a rare ingredient - " - + "a _Rotberry seed_. Being a magic user, I'm quite able to defend myself against local monsters, " - + "but I'm getting lost in no time, it's very embarrassing. Probably you could help me? I would be " - + "happy to pay for your service with one of my best wands."; - - private static final String TXT_DUST1 = "Oh, what a pleasant surprise to meet a decent person in such place! I came here for a rare ingredient - " - + "_corpse dust_. It can be gathered from skeletal remains and there is an ample number of them in the dungeon. " - + "Being a magic user, I'm quite able to defend myself against local monsters, but I'm getting lost in no time, " - + "it's very embarrassing. Probably you could help me? I would be happy to pay for your service with one of my best wands."; - - private static final String TXT_BERRY2 = "Any luck with a Rotberry seed, %s? No? Don't worry, I'm not in a hurry."; - - private static final String TXT_DUST2 = "Any luck with corpse dust, %s? Bone piles are the most obvious places to look."; - - @Override - protected boolean act() { - throwItem(); - return super.act(); - } - - @Override - public int evadeSkill(Char enemy) { - return 1000; - } - - @Override - public void damage(int dmg, Object src) { - } - - @Override - public void add(Buff buff) { - } - - @Override - public boolean reset() { - return true; - } - - @Override - public boolean interact() { - - sprite.turnTo(pos, Dungeon.hero.pos); - if (Quest.given) { - - Item item = Quest.alternative ? Dungeon.hero.belongings - .getItem(CorpseDust.class) : Dungeon.hero.belongings - .getItem(Rotberry.Seed.class); - if (item != null) { - GameScene.show(new WndWandmaker(this, item)); - } else { - tell(Quest.alternative ? - Messages.get(this, "dust_2", Dungeon.hero.givenName()) - : Messages.get(this, "berry_2" , Dungeon.hero.givenName())); - } - - } else { - - Quest.placeItem(); - - if (Quest.given) - tell(Quest.alternative ? Messages.get(this, "dust_1") : Messages.get(this, "berry_1")); - - Journal.add(Journal.Feature.WANDMAKER); - } - return false; - } - - private void tell(String text) { - GameScene.show(new WndQuest(this,text)); - } - - public static class Quest { - - private static boolean spawned; - - private static boolean alternative; - - private static boolean given; - - public static Wand wand1; - public static Wand wand2; - - public static void reset() { - spawned = false; - - wand1 = null; - wand2 = null; - } - - private static final String NODE = "wandmaker"; - - private static final String SPAWNED = "spawned"; - private static final String ALTERNATIVE = "alternative"; - private static final String GIVEN = "given"; - private static final String WAND1 = "wand1"; - private static final String WAND2 = "wand2"; - - public static void storeInBundle(Bundle bundle) { - - Bundle node = new Bundle(); - - node.put(SPAWNED, spawned); - - if (spawned) { - - node.put(ALTERNATIVE, alternative); - - node.put(GIVEN, given); - - node.put(WAND1, wand1); - node.put(WAND2, wand2); - } - - bundle.put(NODE, node); - } - - public static void restoreFromBundle(Bundle bundle) { - - Bundle node = bundle.getBundle(NODE); - - if (!node.isNull() && (spawned = node.getBoolean(SPAWNED))) { - - alternative = node.getBoolean(ALTERNATIVE); - - given = node.getBoolean(GIVEN); - - wand1 = (Wand) node.get(WAND1); - wand2 = (Wand) node.get(WAND2); - } else { - reset(); - } - } - - public static void spawn(PrisonLevel level, Room room) { - if (!spawned && Dungeon.depth==7) { - - Wandmaker npc = new Wandmaker(); - do { - npc.pos = room.random(); - } while (level.map[npc.pos] == Terrain.ENTRANCE - || level.map[npc.pos] == Terrain.SIGN); - level.mobs.add(npc); - Actor.occupyCell(npc); - - spawned = true; - - //if (Dungeon.isChallenged(Challenges.NO_HERBALISM)){ - //alternative=true; - //} else { - alternative = Random.Int(2) == 0; - //} - - given = false; - - switch (Random.Int(7)) { - case 0: - wand1 = new WandOfLight(); - break; - case 1: - wand1 = new WandOfDisintegration(); - break; - case 2: - wand1 = new WandOfFirebolt(); - break; - case 3: - wand1 = new WandOfLightning(); - break; - case 4: - wand1 = new WandOfAcid(); - break; - case 5: - wand1 = new WandOfBlood(); - break; - case 6: - wand1 = new WandOfFreeze(); - break; - } - wand1.random().upgrade(); - - switch (Random.Int(7)) { - case 0: - wand2 = new WandOfCharm(); - break; - case 1: - wand2 = new WandOfFlock(); - break; - case 2: - wand2 = new WandOfPoison(); - break; - case 3: - wand2 = new WandOfMeteorite(); - break; - case 4: - wand2 = new WandOfFlow(); - break; - case 5: - wand2 = new WandOfTCloud(); - break; - case 6: - wand2 = new WandOfFlow(); - break; - case 7: - wand2 = new WandOfMagicMissile(); - break; - } - wand2.random().upgrade(); - } - } - - public static void placeItem() { - if (alternative /*|| Dungeon.isChallenged(Challenges.NO_HERBALISM)*/) { - - ArrayList candidates = new ArrayList(); - for (Heap heap : Dungeon.level.heaps.values()) { - if (heap.type == Heap.Type.SKELETON - && !Dungeon.visible[heap.pos]) { - candidates.add(heap); - } - } - - if (candidates.size() > 0) { - Random.element(candidates).drop(new CorpseDust()); - given = true; - } else { - int pos = Dungeon.level.randomRespawnCell(); - while (Dungeon.level.heaps.get(pos) != null) { - pos = Dungeon.level.randomRespawnCell(); - } - - if (pos != -1) { - Heap heap = Dungeon.level.drop(new CorpseDust(), pos); - heap.type = Heap.Type.SKELETON; - heap.sprite.link(); - given = true; - } - } - - } else { - - int shrubPos = Dungeon.level.randomRespawnCell(); - while (Dungeon.level.heaps.get(shrubPos) != null) { - shrubPos = Dungeon.level.randomRespawnCell(); - } - - if (shrubPos != -1) { - Dungeon.level.plant(new Rotberry.Seed(), shrubPos); - given = true; - } - - } - } - - public static void complete() { - wand1 = null; - wand2 = null; - - Journal.remove(Journal.Feature.WANDMAKER); - } - } -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/npcs/Watabou.java b/java/com/hmdzl/spspd/change/actors/mobs/npcs/Watabou.java deleted file mode 100644 index 1a19e1fc..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/npcs/Watabou.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs.npcs; - - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.sprites.WatabouSprite; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.utils.Random; - -public class Watabou extends NPC { - - { - //name = "Watabou"; - spriteClass = WatabouSprite.class; - properties.add(Property.DEMONIC); - } - - @Override - protected boolean act() { - throwItem(); - return super.act(); - } - - @Override - public int evadeSkill(Char enemy) { - return 1000; - } - - - @Override - protected Char chooseEnemy() { - return null; - } - - @Override - public void damage(int dmg, Object src) { - } - - @Override - public void add(Buff buff) { - } - - @Override - public boolean reset() { - return true; - } - - - - @Override - public boolean interact() { - - sprite.turnTo(pos, Dungeon.hero.pos); - switch (Random.Int (2)) { - case 0: - yell(Messages.get(this, "yell1")); - break; - case 1: - yell(Messages.get(this, "yell2")); - break; - } - return true; - } -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/npcs/WhiteGhost.java b/java/com/hmdzl/spspd/change/actors/mobs/npcs/WhiteGhost.java deleted file mode 100644 index 90991af0..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/npcs/WhiteGhost.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs.npcs; - - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.sprites.CoconutSprite; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.WhiteGhostSprite; -import com.watabou.utils.Random; - -public class WhiteGhost extends NPC { - - { - spriteClass = WhiteGhostSprite.class; - properties.add(Property.UNKNOW); - - } - - @Override - protected boolean act() { - throwItem(); - return super.act(); - } - - @Override - public int evadeSkill(Char enemy) { - return 1000; - } - - - @Override - protected Char chooseEnemy() { - return null; - } - - @Override - public void damage(int dmg, Object src) { - } - - @Override - public void add(Buff buff) { - } - - @Override - public boolean reset() { - return true; - } - - - - @Override - public boolean interact() { - - sprite.turnTo(pos, Dungeon.hero.pos); - yell(Messages.get(this, "yell1")); - return true; - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/actors/mobs/npcs/XixiZero.java b/java/com/hmdzl/spspd/change/actors/mobs/npcs/XixiZero.java deleted file mode 100644 index d9aae9e0..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/npcs/XixiZero.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs.npcs; - - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.XixiZeroSprite; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.windows.WndEgoalInfo; -import com.hmdzl.spspd.change.windows.WndONS; -import com.watabou.utils.Random; - -public class XixiZero extends NPC { - - { - //name = "XixiZero"; - spriteClass = XixiZeroSprite.class; - //state = WANDERING; - properties.add(Property.BEAST); - } - - /*@Override - protected boolean act() { - throwItem(); - return super.act(); - } */ - - @Override - public int evadeSkill(Char enemy) { - return 1000; - } - - - @Override - protected Char chooseEnemy() { - return null; - } - - @Override - public void damage(int dmg, Object src) { - } - - @Override - public void add(Buff buff) { - } - - @Override - public boolean reset() { - return true; - } - - - - @Override - public boolean interact() { - - sprite.turnTo(pos, Dungeon.hero.pos); - switch (Random.Int (2)) { - case 0: - yell(Messages.get(this, "yell1")); - break; - case 1: - GameScene.show(new WndEgoalInfo(null)); - break; - } - return true; - } - -} diff --git a/java/com/hmdzl/spspd/change/actors/mobs/pets/BlueDragon.java b/java/com/hmdzl/spspd/change/actors/mobs/pets/BlueDragon.java deleted file mode 100644 index 0c557d71..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/pets/BlueDragon.java +++ /dev/null @@ -1,150 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs.pets; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Frost; -import com.hmdzl.spspd.change.actors.buffs.MagicalSleep; -import com.hmdzl.spspd.change.actors.buffs.Paralysis; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.particles.SnowParticle; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.mechanics.Ballistica; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.BlueDragonSprite; -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.utils.Callback; -import com.watabou.utils.Random; - -public class BlueDragon extends PET implements Callback{ - - { - //name = "blue dragon"; - spriteClass = BlueDragonSprite.class; - //flying=true; - state = HUNTING; - level = 1; - type = 7; - cooldown=500; - - properties.add(Property.DRAGON); - - } - private static final float TIME_TO_ZAP = 1f; - - //Frames 1-4 are idle, 5-8 are moving, 9-12 are attack and the last are for death - - //flame on! - //spits fire - //feed meat - - @Override - public void adjustStats(int level) { - this.level = level; - HT = 70 + level*10; - evadeSkill = 5 + level; - } - - - - - @Override - public int damageRoll() { - return Random.NormalIntRange((5+level), (5+level*3)); - } - - @Override - protected boolean act() { - - if (cooldown>0){ - cooldown=Math.max(cooldown-(1+9*((level-1)/19)),0); - if (cooldown==0) { - GLog.w(Messages.get(this,"ready")); - } - } - - - - return super.act(); - } - - - @Override - protected boolean canAttack(Char enemy) { - if (cooldown>0){ - return Level.adjacent(pos, enemy.pos); - } else { - return new Ballistica( pos, enemy.pos, Ballistica.MAGIC_BOLT).collisionPos == enemy.pos; - } - } - - @Override - protected boolean doAttack(Char enemy) { - - if (Level.adjacent(pos, enemy.pos)) { - - return super.doAttack(enemy); - - } else { - - boolean visible = Level.fieldOfView[pos] - || Level.fieldOfView[enemy.pos]; - if (visible) { - ((BlueDragonSprite) sprite).zap(enemy.pos); - } else { - zap(); - } - - return !visible; - } - } - - - private void zap() { - spend(TIME_TO_ZAP); - - cooldown=500; - - if (hit(this, enemy, true)) { - - int dmg = damageRoll()*2; - enemy.damage(dmg, this); - - Buff.prolong(enemy, Frost.class, Frost.duration(enemy)* Random.Float(1f, 1.5f)); - CellEmitter.get(enemy.pos).start(SnowParticle.FACTORY, 0.2f, 6); - - } else { - enemy.sprite.showStatus(CharSprite.NEUTRAL, enemy.defenseVerb()); - } - - } - - public void onZapComplete() { - zap(); - next(); - } - - @Override - public void call() { - next(); - } - -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/actors/mobs/pets/BugDragon.java b/java/com/hmdzl/spspd/change/actors/mobs/pets/BugDragon.java deleted file mode 100644 index 06f9cb40..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/pets/BugDragon.java +++ /dev/null @@ -1,147 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs.pets; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Frost; -import com.hmdzl.spspd.change.actors.buffs.MagicalSleep; -import com.hmdzl.spspd.change.actors.buffs.Paralysis; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.particles.SnowParticle; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.mechanics.Ballistica; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.BugDragonSprite; -import com.hmdzl.spspd.change.sprites.GoldDragonSprite; -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.utils.Callback; -import com.watabou.utils.Random; - -public class BugDragon extends PET implements Callback{ - - { - //name = "bug dragon"; - spriteClass = BugDragonSprite.class; - //flying=true; - state = HUNTING; - level = 1; - type = 11; - cooldown=500; - - properties.add(Property.DRAGON); - } - private static final float TIME_TO_ZAP = 1f; - - //Frames 1-4 are idle, 5-8 are moving, 9-12 are attack and the last are for death - - //flame on! - //spits fire - //feed meat - - @Override - public void adjustStats(int level) { - this.level = level; - HT = 200 + level*20; - evadeSkill = 20 + level; - } - - - - - @Override - public int damageRoll() { - return Random.NormalIntRange((20+level), (20+level*5)); - } - - @Override - protected boolean act() { - - if (cooldown>0){ - cooldown=Math.max(cooldown-(1+9*((level-1)/19)),0); - if (cooldown==0) { - GLog.w(Messages.get(this,"ready")); - } - } - - - - return super.act(); - } - - - @Override - protected boolean canAttack(Char enemy) { - if (cooldown>0){ - return Level.adjacent(pos, enemy.pos); - } else { - return new Ballistica( pos, enemy.pos, Ballistica.MAGIC_BOLT).collisionPos == enemy.pos; - } - } - - @Override - protected boolean doAttack(Char enemy) { - - if (Level.adjacent(pos, enemy.pos)) { - - return super.doAttack(enemy); - - } else { - - boolean visible = Level.fieldOfView[pos] - || Level.fieldOfView[enemy.pos]; - if (visible) { - ((BugDragonSprite) sprite).zap(enemy.pos); - } else { - zap(); - } - - return !visible; - } - } - - - private void zap() { - spend(TIME_TO_ZAP); - - cooldown=500; - - if (hit(this, enemy, true)) { - - int dmg = damageRoll()*5; - enemy.damage(dmg, this); - - } else { - enemy.sprite.showStatus(CharSprite.NEUTRAL, enemy.defenseVerb()); - } - - } - - public void onZapComplete() { - zap(); - next(); - } - - @Override - public void call() { - next(); - } - -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/actors/mobs/pets/Bunny.java b/java/com/hmdzl/spspd/change/actors/mobs/pets/Bunny.java deleted file mode 100644 index bd43ecf0..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/pets/Bunny.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs.pets; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.ResultDescriptions; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.MagicalSleep; -import com.hmdzl.spspd.change.actors.buffs.Paralysis; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.effects.particles.SparkParticle; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.traps.LightningTrap; -import com.hmdzl.spspd.change.mechanics.Ballistica; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.BunnySprite; -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.hmdzl.spspd.change.sprites.FairySprite; -import com.hmdzl.spspd.change.utils.GLog; - -import com.watabou.noosa.Camera; -import com.watabou.utils.Callback; -import com.watabou.utils.Random; - -public class Bunny extends PET{ - - { - //name = "bunny"; - spriteClass = BunnySprite.class; - state = HUNTING; - level = 1; - type = 9; - cooldown=500; - - properties.add(Property.BEAST); - } - - - @Override - public void adjustStats(int level) { - this.level = level; - HT = 70 + level*10; - evadeSkill = 5 + level; - } - - @Override - public int damageRoll() { - - int dmg=0; - if (cooldown==0){ - dmg=Random.NormalIntRange((5+level)*5, (5+level*3)*4); - cooldown=500; - } else { - dmg=Random.NormalIntRange((5+level), (5+level*3)) ; - } - return dmg; - - } - - @Override - protected boolean act() { - - if (cooldown>0){ - cooldown=Math.max(cooldown-(1+9*((level-1)/19)),0); - if (cooldown==0) {GLog.w(Messages.get(this,"ready"));} - } - - - - return super.act(); - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/actors/mobs/pets/CocoCat.java b/java/com/hmdzl/spspd/change/actors/mobs/pets/CocoCat.java deleted file mode 100644 index 7874e400..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/pets/CocoCat.java +++ /dev/null @@ -1,154 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs.pets; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.MagicalSleep; -import com.hmdzl.spspd.change.actors.buffs.Paralysis; -import com.hmdzl.spspd.change.items.bombs.BuildBomb; -import com.hmdzl.spspd.change.sprites.CoconutSprite; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.utils.Random; - -import java.util.HashSet; - -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.actors.blobs.ToxicGas; -import com.hmdzl.spspd.change.actors.buffs.Amok; -import com.hmdzl.spspd.change.actors.buffs.Burning; -import com.hmdzl.spspd.change.actors.buffs.Charm; -import com.hmdzl.spspd.change.actors.buffs.Ooze; -import com.hmdzl.spspd.change.actors.buffs.Poison; -import com.hmdzl.spspd.change.actors.buffs.Sleep; -import com.hmdzl.spspd.change.actors.buffs.Terror; -import com.hmdzl.spspd.change.actors.buffs.Vertigo; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfPsionicBlast; -import com.hmdzl.spspd.change.items.weapon.enchantments.EnchantmentDark; - -import com.hmdzl.spspd.change.actors.blobs.CorruptGas; -import com.hmdzl.spspd.change.actors.buffs.Bleeding; - -public class CocoCat extends PET { - - { - //name = "scorpion"; - spriteClass = CoconutSprite.class; - //flying=false; - state = HUNTING; - level = 1; - type = 13; - cooldown=500; - - properties.add(Property.BEAST); - - } - - - - - @Override - public void adjustStats(int level) { - this.level = level; - HT = 10000; - evadeSkill = 5 + level; - } - - - - - @Override - public int damageRoll() { - return Random.NormalIntRange((5+level), (5+level*3)) ; - } - - @Override - protected boolean act() { - - if (cooldown>0){ - cooldown=Math.max(cooldown-(1+9*((level-1)/19)),0); - if (cooldown==0) {GLog.w(Messages.get(this,"ready"));} - } - - - - if (level > 5){ - yell(Messages.get(this,"thanks")); - destroy(); - //sprite.killAndErase(); - //CellEmitter.get(pos).burst(ElmoParticle.FACTORY, 6); - Dungeon.hero.haspet=false; - } - - return super.act(); - - } - - @Override - protected boolean canAttack(Char enemy) { - - return Dungeon.level.distance( pos, enemy.pos ) <= 4 ; - - } - - @Override - public int attackProc(Char enemy, int damage) { - if (cooldown==0) { - BuildBomb bomb = new BuildBomb(); - bomb.explode(enemy.pos); - cooldown=500; - } - - return damage; - } - - /*private static final HashSet> RESISTANCES = new HashSet>(); - private static final HashSet> IMMUNITIES = new HashSet>(); - static { - RESISTANCES.add(ToxicGas.class); - RESISTANCES.add(Poison.class); - RESISTANCES.add(EnchantmentDark.class); - IMMUNITIES.add(EnchantmentDark.class); - IMMUNITIES.add(Ooze.class); - IMMUNITIES.add(Terror.class); - IMMUNITIES.add(Amok.class); - IMMUNITIES.add(Charm.class); - IMMUNITIES.add(Sleep.class); - IMMUNITIES.add(Burning.class); - IMMUNITIES.add(ToxicGas.class); - IMMUNITIES.add(ScrollOfPsionicBlast.class); - IMMUNITIES.add(Vertigo.class); - IMMUNITIES.add(Paralysis.class); - IMMUNITIES.add(Bleeding.class); - IMMUNITIES.add(CorruptGas.class); - - } - - @Override - public HashSet> immunities() { - return IMMUNITIES; - } - - @Override - public HashSet> resistances() { - return RESISTANCES; - }*/ - - -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/actors/mobs/pets/Fairy.java b/java/com/hmdzl/spspd/change/actors/mobs/pets/Fairy.java deleted file mode 100644 index 514cd9b3..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/pets/Fairy.java +++ /dev/null @@ -1,163 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs.pets; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.ResultDescriptions; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.MagicalSleep; -import com.hmdzl.spspd.change.actors.buffs.Paralysis; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.effects.particles.SparkParticle; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.traps.LightningTrap; -import com.hmdzl.spspd.change.mechanics.Ballistica; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.hmdzl.spspd.change.sprites.FairySprite; -import com.hmdzl.spspd.change.utils.GLog; - -import com.watabou.noosa.Camera; -import com.watabou.utils.Callback; -import com.watabou.utils.Random; - -public class Fairy extends PET implements Callback{ - - { - //name = "fairy"; - spriteClass = FairySprite.class; - //flying=true; - state = HUNTING; - level = 1; - type = 10; - cooldown=500; - - properties.add(Property.UNKNOW); - } - private static final float TIME_TO_ZAP = 2f; - private static final String TXT_LIGHTNING_KILLED = "%s's lightning bolt killed you..."; - - @Override - protected float attackDelay() { - return 0.5f; - } - - //Frames 0,2 are idle, 0,1,2 are moving, 0,3,4,1 are attack and 5,6,7 are for death - - @Override - public void adjustStats(int level) { - this.level = level; - HT = 70 + level*10; - evadeSkill = 5 + level; - } - - - - - @Override - public int damageRoll() { - return Random.NormalIntRange((5+level), (5+level*3)); - } - - @Override - protected boolean act() { - - if (cooldown>0){ - cooldown=Math.max(cooldown-(1+9*((level-1)/19)),0); - if (cooldown==0) {GLog.w(Messages.get(this,"ready"));} - } - - if (cooldown==0 && Level.adjacent(pos, Dungeon.hero.pos) && Random.Int(2)==0){ - - int bless = Random.Int(1+9*((level-1)/19)); - - Dungeon.hero.sprite.emitter().start(Speck.factory(Speck.HEALING), 0.4f, 1); - Dungeon.hero.sprite.showStatus(CharSprite.POSITIVE,Integer.toString(bless)); - - Dungeon.hero.HP = Math.min(Dungeon.hero.HT, Dungeon.hero.HP+bless); - } - - - - return super.act(); - } - - - @Override - protected boolean canAttack(Char enemy) { - return new Ballistica( pos, enemy.pos, Ballistica.MAGIC_BOLT).collisionPos == enemy.pos; - - } - - - - @Override - protected boolean doAttack(Char enemy) { - - if (Level.adjacent(pos, enemy.pos)) { - - return super.doAttack(enemy); - - } else { - - boolean visible = Level.fieldOfView[pos] - || Level.fieldOfView[enemy.pos]; - if (visible) { - ((FairySprite) sprite).zap(enemy.pos); - } - - spend(TIME_TO_ZAP); - cooldown=500; - - if (hit(this, enemy, true)) { - int dmg = damageRoll()*2; - if (Level.water[enemy.pos] && !enemy.flying) { - dmg *= 1.5f; - } - enemy.damage(dmg, this); - - enemy.sprite.centerEmitter().burst(SparkParticle.FACTORY, 3); - enemy.sprite.flash(); - - if (enemy == Dungeon.hero) { - - Camera.main.shake(2, 0.3f); - - if (!enemy.isAlive()) { - Dungeon.fail( Messages.format(ResultDescriptions.NAMED)); - //GLog.n(TXT_LIGHTNING_KILLED, name); - } - } - } else { - enemy.sprite - .showStatus(CharSprite.NEUTRAL, enemy.defenseVerb()); - } - - return !visible; - } - } - - - - @Override - public void call() { - next(); - } - -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/actors/mobs/pets/Fly.java b/java/com/hmdzl/spspd/change/actors/mobs/pets/Fly.java deleted file mode 100644 index 31855bd7..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/pets/Fly.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs.pets; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Blindness; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Charm; -import com.hmdzl.spspd.change.actors.buffs.Cripple; -import com.hmdzl.spspd.change.actors.buffs.MagicalSleep; -import com.hmdzl.spspd.change.actors.buffs.Paralysis; -import com.hmdzl.spspd.change.actors.buffs.Slow; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.FlySprite; -import com.hmdzl.spspd.change.sprites.SteelBeeSprite; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -public class Fly extends PET { - - { - //name = "Fly"; - spriteClass = FlySprite.class; - //flying=true; - state = HUNTING; - level = 1; - type = 17; - - properties.add(Property.BEAST); - - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - adjustStats(level); - } - - @Override - public void adjustStats(int level) { - this.level = level; - evadeSkill = 5 + level; - HT = 90 + level*5; - } - - - - - @Override - public int damageRoll() { - return Random.NormalIntRange(10, (10+level*2)); - } - - @Override - protected boolean act() { - - - return super.act(); - } - - @Override - public int attackProc(Char enemy, int damage) { - if (Random.Int(10) == 0) { - Buff.affect(enemy, Slow.class, 5f); - } - - return damage; - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/actors/mobs/pets/GentleCrab.java b/java/com/hmdzl/spspd/change/actors/mobs/pets/GentleCrab.java deleted file mode 100644 index f3b9e883..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/pets/GentleCrab.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs.pets; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.ArmorBreak; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Charm; -import com.hmdzl.spspd.change.actors.buffs.MagicalSleep; -import com.hmdzl.spspd.change.actors.buffs.Paralysis; -import com.hmdzl.spspd.change.actors.buffs.Poison; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.GentleCrabSprite; -import com.hmdzl.spspd.change.sprites.SnakeSprite; -import com.hmdzl.spspd.change.sprites.SteelBeeSprite; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -public class GentleCrab extends PET { - - { - //name = "GentleCrab"; - spriteClass = GentleCrabSprite.class; - //flying=true; - state = HUNTING; - level = 1; - type = 20; - baseSpeed = 3/2; - properties.add(Property.BEAST); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - adjustStats(level); - } - - @Override - public void adjustStats(int level) { - this.level = level; - evadeSkill = 5 + level; - HT = 90 + level*5; - } - - - - - @Override - public int damageRoll() { - return Random.NormalIntRange(10, (10+level*2)); - } - - @Override - protected boolean act() { - - - return super.act(); - } - - @Override - public int attackProc(Char enemy, int damage) { - if (Random.Int(10) == 0) { - Buff.prolong(enemy, ArmorBreak.class,5f).level(10); - } - - return damage; - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/actors/mobs/pets/GoldDragon.java b/java/com/hmdzl/spspd/change/actors/mobs/pets/GoldDragon.java deleted file mode 100644 index ff2dd370..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/pets/GoldDragon.java +++ /dev/null @@ -1,146 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs.pets; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Frost; -import com.hmdzl.spspd.change.actors.buffs.MagicalSleep; -import com.hmdzl.spspd.change.actors.buffs.Paralysis; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.particles.SnowParticle; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.mechanics.Ballistica; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.GoldDragonSprite; -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.utils.Callback; -import com.watabou.utils.Random; - -public class GoldDragon extends PET implements Callback{ - - { - //name = "gold dragon"; - spriteClass = GoldDragonSprite.class; - //flying=true; - state = HUNTING; - level = 1; - type = 15; - cooldown=500; - - properties.add(Property.DRAGON); - } - private static final float TIME_TO_ZAP = 1f; - - //Frames 1-4 are idle, 5-8 are moving, 9-12 are attack and the last are for death - - //flame on! - //spits fire - //feed meat - - @Override - public void adjustStats(int level) { - this.level = level; - HT = 100 + level*10; - evadeSkill = 10 + level; - } - - - - - @Override - public int damageRoll() { - return Random.NormalIntRange((10+level), (10+level*5)); - } - - @Override - protected boolean act() { - - if (cooldown>0){ - cooldown=Math.max(cooldown-(1+9*((level-1)/19)),0); - if (cooldown==0) { - GLog.w(Messages.get(this,"ready")); - } - } - - - - return super.act(); - } - - - @Override - protected boolean canAttack(Char enemy) { - if (cooldown>0){ - return Level.adjacent(pos, enemy.pos); - } else { - return new Ballistica( pos, enemy.pos, Ballistica.MAGIC_BOLT).collisionPos == enemy.pos; - } - } - - @Override - protected boolean doAttack(Char enemy) { - - if (Level.adjacent(pos, enemy.pos)) { - - return super.doAttack(enemy); - - } else { - - boolean visible = Level.fieldOfView[pos] - || Level.fieldOfView[enemy.pos]; - if (visible) { - ((GoldDragonSprite) sprite).zap(enemy.pos); - } else { - zap(); - } - - return !visible; - } - } - - - private void zap() { - spend(TIME_TO_ZAP); - - cooldown=500; - - if (hit(this, enemy, true)) { - - int dmg = damageRoll()*5; - enemy.damage(dmg, this); - - } else { - enemy.sprite.showStatus(CharSprite.NEUTRAL, enemy.defenseVerb()); - } - - } - - public void onZapComplete() { - zap(); - next(); - } - - @Override - public void call() { - next(); - } - -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/actors/mobs/pets/GreenDragon.java b/java/com/hmdzl/spspd/change/actors/mobs/pets/GreenDragon.java deleted file mode 100644 index b71301d9..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/pets/GreenDragon.java +++ /dev/null @@ -1,159 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs.pets; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.ResultDescriptions; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.MagicalSleep; -import com.hmdzl.spspd.change.actors.buffs.Paralysis; -import com.hmdzl.spspd.change.effects.particles.SparkParticle; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.traps.LightningTrap; -import com.hmdzl.spspd.change.mechanics.Ballistica; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.hmdzl.spspd.change.sprites.GreenDragonSprite; -import com.hmdzl.spspd.change.utils.GLog; - -import com.watabou.noosa.Camera; -import com.watabou.utils.Callback; -import com.watabou.utils.Random; - -public class GreenDragon extends PET implements Callback{ - - { - //name = "green dragon"; - spriteClass = GreenDragonSprite.class; - //flying=true; - state = HUNTING; - level = 1; - type = 5; - cooldown=500; - - properties.add(Property.DRAGON); - } - private static final float TIME_TO_ZAP = 2f; - private static final String TXT_LIGHTNING_KILLED = "%s's lightning bolt killed you..."; - - @Override - protected float attackDelay() { - return 0.8f; - } - - //Frames 1-4 are idle, 5-8 are moving, 9-12 are attack and the last are for death - - //flame on! - //spits fire - //feed meat - - @Override - public void adjustStats(int level) { - this.level = level; - HT = 70 + level*10; - evadeSkill = 5 + level; - } - - - - - @Override - public int damageRoll() { - return Random.NormalIntRange((5+level), (5+level*3)); - } - - @Override - protected boolean act() { - - if (cooldown>0){ - cooldown=Math.max(cooldown-(1+9*((level-1)/19)),0); - if (cooldown==0) {GLog.w(Messages.get(this,"ready"));} - } - - - - return super.act(); - } - - - @Override - protected boolean canAttack(Char enemy) { - if (cooldown>0){ - return Level.adjacent(pos, enemy.pos); - } else { - return new Ballistica( pos, enemy.pos, Ballistica.MAGIC_BOLT).collisionPos == enemy.pos; - } - } - - - - @Override - protected boolean doAttack(Char enemy) { - - if (Level.adjacent(pos, enemy.pos)) { - - return super.doAttack(enemy); - - } else { - - boolean visible = Level.fieldOfView[pos] - || Level.fieldOfView[enemy.pos]; - if (visible) { - ((GreenDragonSprite) sprite).zap(enemy.pos); - } - - spend(TIME_TO_ZAP); - cooldown=500; - - if (hit(this, enemy, true)) { - int dmg = damageRoll()*2; - if (Level.water[enemy.pos] && !enemy.flying) { - dmg *= 1.5f; - } - enemy.damage(dmg, this); - - enemy.sprite.centerEmitter().burst(SparkParticle.FACTORY, 3); - enemy.sprite.flash(); - - if (enemy == Dungeon.hero) { - - Camera.main.shake(2, 0.3f); - - if (!enemy.isAlive()) { - Dungeon.fail(Messages.format(ResultDescriptions.NAMED)); - //GLog.n(TXT_LIGHTNING_KILLED, name); - } - } - } else { - enemy.sprite - .showStatus(CharSprite.NEUTRAL, enemy.defenseVerb()); - } - - return !visible; - } - } - - - - @Override - public void call() { - next(); - } - -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/actors/mobs/pets/LeryFire.java b/java/com/hmdzl/spspd/change/actors/mobs/pets/LeryFire.java deleted file mode 100644 index df327f3b..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/pets/LeryFire.java +++ /dev/null @@ -1,212 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs.pets; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.ResultDescriptions; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.Blob; -import com.hmdzl.spspd.change.actors.blobs.Fire; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Frost; -import com.hmdzl.spspd.change.actors.buffs.MagicalSleep; -import com.hmdzl.spspd.change.actors.buffs.Paralysis; -import com.hmdzl.spspd.change.actors.buffs.Poison; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.particles.SnowParticle; -import com.hmdzl.spspd.change.effects.particles.SparkParticle; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.traps.LightningTrap; -import com.hmdzl.spspd.change.mechanics.Ballistica; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.LerySprite; -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.Camera; -import com.watabou.utils.Callback; -import com.watabou.utils.Random; - -public class LeryFire extends PET implements Callback{ - - { - //name = "blue dragon"; - spriteClass = LerySprite.class; - //flying=true; - state = HUNTING; - level = 1; - type = 14; - cooldown=500; - - properties.add(Property.ELEMENT); - - } - private static final float TIME_TO_ZAP = 1f; - - - - @Override - public void adjustStats(int level) { - this.level = level; - HT = 70 + level*10; - evadeSkill = 5 + level; - } - - - - - @Override - public int damageRoll() { - return Random.NormalIntRange((5+level), (5+level*3)); - } - - @Override - protected boolean act() { - - if (cooldown>0){ - cooldown=Math.max(cooldown-(1+9*((level-1)/19)),0); - if (cooldown==0) { - GLog.w(Messages.get(this,"ready")); - } - } - - - - return super.act(); - } - - - @Override - protected boolean canAttack(Char enemy) { - if (cooldown>0){ - return Level.adjacent(pos, enemy.pos); - } else { - return new Ballistica( pos, enemy.pos, Ballistica.MAGIC_BOLT).collisionPos == enemy.pos; - } - } - - @Override - protected boolean doAttack(Char enemy) { - - if (Level.adjacent(pos, enemy.pos)) { - - return super.doAttack(enemy); - - } else { - - boolean visible = Level.fieldOfView[pos] - || Level.fieldOfView[enemy.pos]; - if (visible) { - ((LerySprite) sprite).zap(enemy.pos); - } else { - zap(); - } - - return !visible; - } - } - - - private void zap() { - spend(TIME_TO_ZAP); - - cooldown=500; - switch (Random.Int (5)) { - case 0: - if (hit(this, enemy, true)) { - int dmg = damageRoll()*2; - enemy.damage(dmg, this); - Buff.prolong(enemy, Frost.class, Frost.duration(enemy)* Random.Float(1f, 1.5f)); - CellEmitter.get(enemy.pos).start(SnowParticle.FACTORY, 0.2f, 6); - } else { - enemy.sprite.showStatus(CharSprite.NEUTRAL, enemy.defenseVerb()); - } - return; - case 1: - if (hit(this, enemy, true)) { - - int dmg = damageRoll()*2; - enemy.damage(dmg, this); - - Buff.affect(enemy,Poison.class).set(Poison.durationFactor(enemy) * (level + 1)); - - } else { - enemy.sprite.showStatus(CharSprite.NEUTRAL, enemy.defenseVerb()); - } - return; - case 2: - if (hit(this, enemy, true)) { - - int dmg = damageRoll()*2; - enemy.damage(dmg, this); - - if (Random.Int(dmg) - */ -package com.hmdzl.spspd.change.actors.mobs.pets; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.ResultDescriptions; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Blindness; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.MagicalSleep; -import com.hmdzl.spspd.change.actors.buffs.Paralysis; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.effects.particles.SparkParticle; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.traps.LightningTrap; -import com.hmdzl.spspd.change.mechanics.Ballistica; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.hmdzl.spspd.change.sprites.FairySprite; -import com.hmdzl.spspd.change.sprites.LightDragonSprite; -import com.hmdzl.spspd.change.utils.GLog; - -import com.watabou.noosa.Camera; -import com.watabou.utils.Callback; -import com.watabou.utils.Random; - -public class LightDragon extends PET{ - - { - //name = "LightDragon"; - spriteClass = LightDragonSprite.class; - //flying=true; - state = HUNTING; - level = 1; - type = 10; - cooldown=500; - - properties.add(Property.DRAGON); - } - private static final float TIME_TO_ZAP = 2f; - - @Override - protected float attackDelay() { - return 1f; - } - - //Frames 0,2 are idle, 0,1,2 are moving, 0,3,4,1 are attack and 5,6,7 are for death - - @Override - public void adjustStats(int level) { - this.level = level; - HT = 70 + level*10; - evadeSkill = 5 + level; - } - - - - - @Override - public int damageRoll() { - return Random.NormalIntRange((5+level), (5+level*3)); - } - - @Override - protected boolean act() { - - if (cooldown>0){ - cooldown=Math.max(cooldown-(1+9*((level-1)/19)),0); - if (cooldown==0) {GLog.w(Messages.get(this,"ready"));} - } - - return super.act(); - } - - - @Override - protected boolean canAttack(Char enemy) { - if (cooldown>0){ - return Level.adjacent(pos, enemy.pos); - } else { - return new Ballistica( pos, enemy.pos, Ballistica.MAGIC_BOLT).collisionPos == enemy.pos; - } - - } - - @Override - public int attackProc(Char enemy, int damage) { - if (cooldown == 0) { - cooldown=500; - enemy.damage((int)(enemy.HP/4),this); - Buff.affect(enemy, Blindness.class, 10f); - } - return damage; - } - -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/actors/mobs/pets/Monkey.java b/java/com/hmdzl/spspd/change/actors/mobs/pets/Monkey.java deleted file mode 100644 index 658ab989..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/pets/Monkey.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs.pets; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Charm; -import com.hmdzl.spspd.change.actors.buffs.MagicalSleep; -import com.hmdzl.spspd.change.actors.buffs.Paralysis; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.Generator; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.MonkeySprite; -import com.hmdzl.spspd.change.sprites.SteelBeeSprite; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -public class Monkey extends PET { - - { - //name = "Monkey"; - spriteClass = MonkeySprite.class; - //flying=true; - state = HUNTING; - level = 1; - type = 19; - - properties.add(Property.ELEMENT); - - } - - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - adjustStats(level); - } - - @Override - public void adjustStats(int level) { - this.level = level; - evadeSkill = 5 + level; - HT = 90 + level*5; - } - - - - - @Override - public int damageRoll() { - return Random.NormalIntRange(10, (10+level*2)); - } - - @Override - protected boolean act() { - - - return super.act(); - } - - @Override - public int attackProc(Char enemy, int damage) { - if (Random.Int(100) == 0) { - Dungeon.level.drop(Generator.random(), pos).sprite.drop(); - } - - return damage; - } - -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/actors/mobs/pets/PET.java b/java/com/hmdzl/spspd/change/actors/mobs/pets/PET.java deleted file mode 100644 index 195cac3f..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/pets/PET.java +++ /dev/null @@ -1,388 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs.pets; - -import java.util.ArrayList; -import java.util.HashSet; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.Statistics; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.CorruptGas; -import com.hmdzl.spspd.change.actors.blobs.ToxicGas; -import com.hmdzl.spspd.change.actors.blobs.VenomGas; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Burning; -import com.hmdzl.spspd.change.actors.buffs.MagicalSleep; -import com.hmdzl.spspd.change.actors.buffs.Paralysis; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.hero.HeroSubClass; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.actors.mobs.npcs.NPC; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.particles.ElmoParticle; -import com.hmdzl.spspd.change.items.Heap; -import com.hmdzl.spspd.change.items.rings.RingOfHaste; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfPsionicBlast; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.HeroSprite; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -public abstract class PET extends NPC { - - { - HP = HT = 1; - EXP = 0; - - //WANDERING = new Wandering(); - //HUNTING = new Hunting(); - - - flying = true; - hostile = false; - state = HUNTING; - enemy = null; - ally=true; - - properties.add(Property.MINIBOSS); - properties.add(Property.IMMOVABLE); - } - - @Override - public int drRoll(){ - return level; - } - - @Override - public int hitSkill(Char target) { - return level + 10; - } - - public int level; - public int type; - public int experience; - public int cooldown; - public boolean callback = false; - public boolean stay = false; - /* - type - 1 = - 2 = bee - 3 = - 4 = - 5 = - - */ - - private static final String LEVEL = "level"; - private static final String TYPE = "type"; - private static final String EXPERIENCE = "experience"; - private static final String COOLDOWN = "cooldown"; - private static final String CALLBACK = "callback"; - private static final String STAY = "stay"; - - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(LEVEL, level); - bundle.put(TYPE, type); - bundle.put(EXPERIENCE, experience); - bundle.put(COOLDOWN, cooldown); - bundle.put(CALLBACK, callback); - bundle.put(STAY, stay); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - level = bundle.getInt(LEVEL); - type = bundle.getInt(TYPE); - experience = bundle.getInt(EXPERIENCE); - cooldown = bundle.getInt(COOLDOWN); - callback = bundle.getBoolean(CALLBACK); - stay = bundle.getBoolean(STAY); - adjustStats(level); - } - - protected void throwItem() { - Heap heap = Dungeon.level.heaps.get(pos); - if (heap != null) { - int n; - do { - n = pos + Level.NEIGHBOURS8[Random.Int(8)]; - } while (!Level.passable[n] && !Level.avoid[n]); - Dungeon.level.drop(heap.pickUp(), n).sprite.drop(pos); - } - } - - public void adjustStats(int level) { - } - - public void spawn(int level) { - this.level = level; - adjustStats(level); - } - - @Override - protected boolean act() { - - assignPet(this); - - if (experience >= level*(level+1) && level < 30){ - experience-=level*(level+1); - level++; - GLog.p(Messages.get(this,"levelup")); - adjustStats(level); - - } - - if ( HP 8 - || state == WANDERING) { - - HashSet enemies = new HashSet<>(); - for (Mob mob : Dungeon.level.mobs) { - if (mob.hostile - && Level.fieldOfView[mob.pos] - && Dungeon.level.distance(mob.pos, Dungeon.hero.pos) <= 8 - && mob.state != mob.PASSIVE) { - enemies.add(mob); - } - } - - //go for closest enemy - Char closest = null; - for (Char curr : enemies){ - if (closest == null - || Dungeon.level.distance(pos, curr.pos) < Dungeon.level.distance(pos, closest.pos)){ - closest = curr; - } - } - return closest; - } - return enemy; -} - - @Override - protected boolean getCloser(int target) { - if (stay) { - return false; - } else if (state == WANDERING - || Level.distance(target, Dungeon.hero.pos) > 6) - this.target = target = Dungeon.hero.pos; - return super.getCloser(target); - } - - public int wanderLocation(){ - int newPos = -1; - ArrayList candidates = new ArrayList(); - boolean[] passable = Level.passable; - - for (int n : Level.NEIGHBOURS8) { - int c = pos + n; - if (passable[c] && Actor.findChar(c) == null) { - candidates.add(c); - } - } - - newPos = candidates.size() > 0 ? Random.element(candidates) : -1; - - return newPos; - } - - @Override - public void aggro(Char ch) { - } - - @Override - public void beckon(int cell) { - } - - - private void assignPet(PET pet){ - - Dungeon.hero.petType=pet.type; - Dungeon.hero.petLevel=pet.level; - - Dungeon.hero.petHP=pet.HP; - Dungeon.hero.petExperience=pet.experience; - Dungeon.hero.petCooldown=pet.cooldown; - } - - @Override - public void add( Buff buff ) { - //in other words, can't be directly affected by buffs/debuffs. - } - - - @Override - public boolean interact() { - //int curPos = pos; - //moveSprite( pos, Dungeon.hero.pos ); - //move( Dungeon.hero.pos ); - //Dungeon.hero.sprite.move( Dungeon.hero.pos, curPos ); - //Dungeon.hero.move( curPos ); - //Dungeon.hero.spend( 1 / Dungeon.hero.speed() ); - //Dungeon.hero.busy(); - - - - if (!Dungeon.level.passable[pos]){ - return true; - } - - if (state == SLEEPING) { - state = HUNTING; - } - int curPos = pos; - - moveSprite( pos, Dungeon.hero.pos ); - move( Dungeon.hero.pos ); - - Dungeon.hero.sprite.move( Dungeon.hero.pos, curPos ); - Dungeon.hero.move( curPos ); - - Dungeon.hero.spend( 1 / Dungeon.hero.speed() ); - Dungeon.hero.busy(); - return true; - - } - - private static final HashSet> IMMUNITIES = new HashSet>(); - static { - IMMUNITIES.add( ToxicGas.class ); - IMMUNITIES.add( VenomGas.class ); - IMMUNITIES.add( Burning.class ); - IMMUNITIES.add( ScrollOfPsionicBlast.class ); - IMMUNITIES.add( CorruptGas.class ); - } - - @Override - public HashSet> immunities() { - return IMMUNITIES; - } - - /*private class Wandering extends Mob.Wandering { - - @Override - public boolean act( boolean enemyInFOV, boolean justAlerted ) { - if ( enemyInFOV ) { - - enemySeen = true; - - notice(); - state = HUNTING; - target = enemy.pos; - - } else { - - enemySeen = false; - - int oldPos = pos; - //always move towards the hero when wandering - if (getCloser( target = Dungeon.hero.pos )) { - //moves 2 tiles at a time when returning to the hero from a distance - if (!Dungeon.level.adjacent(Dungeon.hero.pos, pos)){ - getCloser( target = Dungeon.hero.pos ); - } - spend( 1 / speed() ); - return moveSprite( oldPos, pos ); - } else { - spend( TICK ); - } - - } - return true; - } - - } - - private class Hunting extends Mob.Hunting { - - @Override - public boolean act( boolean enemyInFOV, boolean justAlerted ) { - - enemySeen = enemyInFOV; - if (enemyInFOV && !isCharmedBy( enemy ) && canAttack( enemy )) { - - return doAttack( enemy ); - - } else { - - if (enemyInFOV) { - target = enemy.pos; - } - - int oldPos = pos; - if (enemyInFOV && getCloser( target )) { - - spend( 1 / speed() ); - return moveSprite( oldPos, pos ); - - } else { - - //don't lose a turn due to the transition, immediately act instead - state = WANDERING; - return state.act( false, justAlerted ); - - } - } - } - - }*/ -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/actors/mobs/pets/RedDragon.java b/java/com/hmdzl/spspd/change/actors/mobs/pets/RedDragon.java deleted file mode 100644 index 805bdcdd..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/pets/RedDragon.java +++ /dev/null @@ -1,144 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs.pets; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.Blob; -import com.hmdzl.spspd.change.actors.blobs.Fire; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.MagicalSleep; -import com.hmdzl.spspd.change.actors.buffs.Paralysis; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.mechanics.Ballistica; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.hmdzl.spspd.change.sprites.RedDragonSprite; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.utils.Callback; -import com.watabou.utils.Random; - -public class RedDragon extends PET implements Callback{ - - { - //name = "red dragon"; - spriteClass = RedDragonSprite.class; - //flying=true; - state = HUNTING; - level = 1; - type = 4; - cooldown=500; - - properties.add(Property.DRAGON); - - } - private static final float TIME_TO_ZAP = 1f; - - //Frames 1-4 are idle, 5-8 are moving, 9-12 are attack and the last are for death - - //flame on! - //spits fire - //feed meat - - @Override - public void adjustStats(int level) { - this.level = level; - HT = 70 + level*10; - evadeSkill = 5 + level; - } - - - - - @Override - public int damageRoll() { - return Random.NormalIntRange((5+level), (5+level*3)); - } - - @Override - protected boolean act() { - - if (cooldown>0){ - cooldown=Math.max(cooldown-(1+9*((level-1)/19)),0); - if (cooldown==0) {GLog.w(Messages.get(this,"ready"));} - } - - return super.act(); - } - - - @Override - protected boolean canAttack(Char enemy) { - if (cooldown>0){ - return Level.adjacent(pos, enemy.pos); - } else { - return new Ballistica( pos, enemy.pos, Ballistica.MAGIC_BOLT).collisionPos == enemy.pos; - } - } - - @Override - protected boolean doAttack(Char enemy) { - - if (Level.adjacent(pos, enemy.pos)) { - - return super.doAttack(enemy); - - } else { - - boolean visible = Level.fieldOfView[pos] - || Level.fieldOfView[enemy.pos]; - if (visible) { - ((RedDragonSprite) sprite).zap(enemy.pos); - } else { - zap(); - } - - return !visible; - } - } - - - private void zap() { - spend(TIME_TO_ZAP); - - cooldown=500; - - if (hit(this, enemy, true)) { - - int dmg = damageRoll()*2; - enemy.damage(dmg, this); - - if (Random.Int(dmg) - */ -package com.hmdzl.spspd.change.actors.mobs.pets; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Charm; -import com.hmdzl.spspd.change.actors.buffs.MagicalSleep; -import com.hmdzl.spspd.change.actors.buffs.Paralysis; -import com.hmdzl.spspd.change.actors.buffs.Poison; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.GreyRatSprite; -import com.hmdzl.spspd.change.sprites.SnakeSprite; -import com.hmdzl.spspd.change.sprites.SteelBeeSprite; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -public class RibbonRat extends PET { - - { - //name = "RibbonRat"; - spriteClass = GreyRatSprite.class; - //flying=true; - state = HUNTING; - level = 1; - type = 21; - - properties.add(Property.BEAST); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - adjustStats(level); - } - - @Override - public void adjustStats(int level) { - this.level = level; - evadeSkill = 5 + level; - HT = 90 + level*5; - } - - - - @Override - public int damageRoll() { - return Random.NormalIntRange(10, (10+level*2)); - } - - @Override - protected boolean act() { - - - return super.act(); - } - - @Override - public int attackProc(Char enemy, int damage) { - if (Random.Int(10) == 0) { - HP= Math.min(HT, HP+damage/10); - } - return damage; - } - -/* - @Override - protected Char chooseEnemy() { - - if(enemy != null && !enemy.isAlive()){ - kills++; - } - - if (enemy == null || !enemy.isAlive()) { - HashSet enemies = new HashSet(); - for (Mob mob : Dungeon.level.mobs) { - if (!(mob instanceof PET) && mob.hostile && Level.fieldOfView[mob.pos]) { - enemies.add(mob); - } - } - - enemy = enemies.size() > 0 ? Random.element(enemies) : null; - } - - return enemy; -} -*/ -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/actors/mobs/pets/Scorpion.java b/java/com/hmdzl/spspd/change/actors/mobs/pets/Scorpion.java deleted file mode 100644 index 45e0f43d..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/pets/Scorpion.java +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs.pets; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.MagicalSleep; -import com.hmdzl.spspd.change.actors.buffs.Paralysis; -import com.hmdzl.spspd.change.actors.buffs.Ooze; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.hmdzl.spspd.change.sprites.ScorpionSprite; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.utils.Random; - -public class Scorpion extends PET { - - { - //name = "scorpion"; - spriteClass = ScorpionSprite.class; - //flying=false; - state = HUNTING; - level = 1; - type = 8; - cooldown=500; - - properties.add(Property.BEAST); - } - - @Override - public void adjustStats(int level) { - this.level = level; - HT = 70 + level*10; - evadeSkill = 5 + level; - } - - - - - @Override - public int damageRoll() { - return Random.NormalIntRange((5+level), (5+level*3)) ; - } - - @Override - protected boolean act() { - - if (cooldown>0){ - cooldown=Math.max(cooldown-(1+9*((level-1)/19)),0); - if (cooldown==0) {GLog.w(Messages.get(this,"ready"));} - } - - - - return super.act(); - } - - @Override - public int attackProc(Char enemy, int damage) { - if (cooldown>0 && Random.Int(10) == 0) { - Buff.affect(enemy, Ooze.class); - } - if (cooldown==0) { - Buff.affect(enemy, Ooze.class); - - sprite.emitter().start(Speck.factory(Speck.HEALING), 0.4f, 1); - sprite.showStatus(CharSprite.POSITIVE,Integer.toString(damage)); - - HP = Math.min(HT, HP+damage); - - Dungeon.hero.sprite.emitter().start(Speck.factory(Speck.HEALING), 0.4f, 1); - Dungeon.hero.sprite.showStatus(CharSprite.POSITIVE,Integer.toString(damage)); - - Dungeon.hero.HP = Math.min(Dungeon.hero.HT, Dungeon.hero.HP+damage); - - damage+=damage; - cooldown=500; - } - - return damage; - } - -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/actors/mobs/pets/ShadowDragon.java b/java/com/hmdzl/spspd/change/actors/mobs/pets/ShadowDragon.java deleted file mode 100644 index de0d187c..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/pets/ShadowDragon.java +++ /dev/null @@ -1,150 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs.pets; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Frost; -import com.hmdzl.spspd.change.actors.buffs.MagicalSleep; -import com.hmdzl.spspd.change.actors.buffs.Paralysis; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.particles.SnowParticle; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.mechanics.Ballistica; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.ShadowDragonSprite; -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.utils.Callback; -import com.watabou.utils.Random; - -public class ShadowDragon extends PET implements Callback{ - - { - //name = "shadow dragon"; - spriteClass = ShadowDragonSprite.class; - //flying=true; - state = HUNTING; - level = 1; - type = 12; - cooldown=500; - - properties.add(Property.DRAGON); - - } - private static final float TIME_TO_ZAP = 1f; - - //Frames 1-4 are idle, 5-8 are moving, 9-12 are attack and the last are for death - - //flame on! - //spits fire - //feed meat - - @Override - public void adjustStats(int level) { - this.level = level; - HT = 70 + level*10; - evadeSkill = 5 + level; - } - - - - - @Override - public int damageRoll() { - return Random.NormalIntRange((5+level), (5+level*3)); - } - - @Override - protected boolean act() { - - if (cooldown>0){ - cooldown=Math.max(cooldown-(1+9*((level-1)/19)),0); - if (cooldown==0) { - GLog.w(Messages.get(this,"ready")); - } - } - - - - return super.act(); - } - - - @Override - protected boolean canAttack(Char enemy) { - if (cooldown>0){ - return Level.adjacent(pos, enemy.pos); - } else { - return new Ballistica( pos, enemy.pos, Ballistica.MAGIC_BOLT).collisionPos == enemy.pos; - } - } - - @Override - protected boolean doAttack(Char enemy) { - - if (Level.adjacent(pos, enemy.pos)) { - - return super.doAttack(enemy); - - } else { - - boolean visible = Level.fieldOfView[pos] - || Level.fieldOfView[enemy.pos]; - if (visible) { - ((ShadowDragonSprite) sprite).zap(enemy.pos); - } else { - zap(); - } - - return !visible; - } - } - - - private void zap() { - spend(TIME_TO_ZAP); - - cooldown=500; - - if (hit(this, enemy, true)) { - - int dmg = damageRoll()*3; - enemy.damage(dmg, this); - - } else { - enemy.sprite.showStatus(CharSprite.NEUTRAL, enemy.defenseVerb()); - } - - } - - public void onZapComplete() { - zap(); - next(); - } - - @Override - public void call() { - next(); - } - - - - -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/actors/mobs/pets/Snake.java b/java/com/hmdzl/spspd/change/actors/mobs/pets/Snake.java deleted file mode 100644 index ea5374c6..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/pets/Snake.java +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs.pets; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Charm; -import com.hmdzl.spspd.change.actors.buffs.MagicalSleep; -import com.hmdzl.spspd.change.actors.buffs.Paralysis; -import com.hmdzl.spspd.change.actors.buffs.Poison; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.SnakeSprite; -import com.hmdzl.spspd.change.sprites.SteelBeeSprite; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -public class Snake extends PET { - - { - //name = "Snake"; - spriteClass = SnakeSprite.class; - //flying=true; - state = HUNTING; - level = 1; - type = 16; - - properties.add(Property.BEAST); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - adjustStats(level); - } - - @Override - public void adjustStats(int level) { - this.level = level; - evadeSkill = 5 + level; - HT = 90 + level*5; - } - - - - - @Override - public int damageRoll() { - return Random.NormalIntRange(10, (10+level*2)); - } - - @Override - protected boolean act() { - - - return super.act(); - } - - @Override - public int attackProc(Char enemy, int damage) { - if (Random.Int(10) == 0) { - Buff.affect(enemy, Poison.class).set( - Random.Int(5, 7) * Poison.durationFactor(enemy)); - } - - return damage; - } - -/* - @Override - protected Char chooseEnemy() { - - if(enemy != null && !enemy.isAlive()){ - kills++; - } - - if (enemy == null || !enemy.isAlive()) { - HashSet enemies = new HashSet(); - for (Mob mob : Dungeon.level.mobs) { - if (!(mob instanceof PET) && mob.hostile && Level.fieldOfView[mob.pos]) { - enemies.add(mob); - } - } - - enemy = enemies.size() > 0 ? Random.element(enemies) : null; - } - - return enemy; -} -*/ -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/actors/mobs/pets/Spider.java b/java/com/hmdzl/spspd/change/actors/mobs/pets/Spider.java deleted file mode 100644 index 3cc0ccc6..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/pets/Spider.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs.pets; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.Blob; -import com.hmdzl.spspd.change.actors.blobs.Web; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.MagicalSleep; -import com.hmdzl.spspd.change.actors.buffs.Paralysis; -import com.hmdzl.spspd.change.actors.buffs.Poison; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.SpiderSprite; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.utils.Random; - -public class Spider extends PET { - - { - //name = "spider"; - spriteClass = SpiderSprite.class; - //flying=false; - state = HUNTING; - level = 1; - type = 1; - cooldown=500; - - properties.add(Property.BEAST); - - } - - @Override - public void adjustStats(int level) { - this.level = level; - HT = 70 + level*10; - evadeSkill = 5 + level; - } - - - - - @Override - public int damageRoll() { - return Random.NormalIntRange((5+level), (5+level*3)) ; - } - - @Override - protected boolean act() { - - if (cooldown>0){ - cooldown=Math.max(cooldown-(1+9*((level-1)/19)),0); - if (cooldown==0) {GLog.w(Messages.get(this,"ready"));} - } - - - - return super.act(); - } - - @Override - public int attackProc(Char enemy, int damage) { - if (cooldown>0 && Random.Int(10) == 0) { - Buff.affect(enemy, Poison.class).set(Random.Int(7, 9) * Poison.durationFactor(enemy)); - GameScene.add(Blob.seed(enemy.pos, Random.Int(5, 7), Web.class)); - } - if (cooldown==0) { - Buff.affect(enemy, Poison.class).set(Random.Int(10, 25) * Poison.durationFactor(enemy)); - GameScene.add(Blob.seed(enemy.pos, Random.Int(8, 9), Web.class)); - damage+=damage; - cooldown=500; - } - - return damage; - } - -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/actors/mobs/pets/Stone.java b/java/com/hmdzl/spspd/change/actors/mobs/pets/Stone.java deleted file mode 100644 index 0db214e2..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/pets/Stone.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs.pets; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Charm; -import com.hmdzl.spspd.change.actors.buffs.MagicalSleep; -import com.hmdzl.spspd.change.actors.buffs.Paralysis; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.SteelBeeSprite; -import com.hmdzl.spspd.change.sprites.StoneSprite; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -public class Stone extends PET { - - { - //name = "Stone"; - spriteClass = StoneSprite.class; - //flying=true; - state = HUNTING; - level = 1; - type = 18; - - properties.add(Property.ELEMENT); - } - - - - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - adjustStats(level); - } - - @Override - public void adjustStats(int level) { - this.level = level; - evadeSkill = 5 + level; - HT = 90 + level*5; - } - - - - - @Override - public int damageRoll() { - return Random.NormalIntRange(10, (10+level*2)); - } - - @Override - protected boolean act() { - - - return super.act(); - } - - @Override - public int attackProc(Char enemy, int damage) { - if (Random.Int(20) == 0) { - Buff.affect(enemy, Paralysis.class, 3f); - } - - return damage; - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/actors/mobs/pets/SugarplumFairy.java b/java/com/hmdzl/spspd/change/actors/mobs/pets/SugarplumFairy.java deleted file mode 100644 index e69a6061..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/pets/SugarplumFairy.java +++ /dev/null @@ -1,171 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs.pets; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.ResultDescriptions; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.MagicalSleep; -import com.hmdzl.spspd.change.actors.buffs.Paralysis; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.effects.particles.SparkParticle; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.traps.LightningTrap; -import com.hmdzl.spspd.change.mechanics.Ballistica; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.hmdzl.spspd.change.sprites.SugarplumFairySprite; -import com.hmdzl.spspd.change.utils.GLog; - -import com.watabou.noosa.Camera; -import com.watabou.utils.Callback; -import com.watabou.utils.Random; - -public class SugarplumFairy extends PET implements Callback{ - - { - //name = "sugarplum fairy"; - spriteClass = SugarplumFairySprite.class; - //flying=true; - state = HUNTING; - level = 1; - type = 11; - cooldown=500; - - properties.add(Property.UNKNOW); - } - private static final float TIME_TO_ZAP = 2f; - - @Override - protected float attackDelay() { - return 0.5f; - } - - //Frames 0,2 are idle, 0,1,2 are moving, 0,3,4,1 are attack and 5,6,7 are for death - - - - - - @Override - public void adjustStats(int level) { - this.level = level; - HT = 70 + level*10; - evadeSkill = 5 + level; - } - - - - - @Override - public int damageRoll() { - return Random.NormalIntRange(evadeSkill/2, evadeSkill); - } - - @Override - protected boolean act() { - - if (cooldown>0){ - cooldown=Math.max(cooldown-(1+9*((level-1)/19)),0); - if (cooldown==0) {GLog.w(Messages.get(this,"ready"));} - } - - if (cooldown==0 && Level.adjacent(pos, Dungeon.hero.pos) && Random.Int(1)==0){ - - int bless = Random.Int(1+9*((level-1)/19)); - - Dungeon.hero.sprite.emitter().start(Speck.factory(Speck.HEALING), 0.4f, 1); - Dungeon.hero.sprite.showStatus(CharSprite.POSITIVE,Integer.toString(bless)); - - Dungeon.hero.HP = Math.min(Dungeon.hero.HT, Dungeon.hero.HP+bless); - - if (Random.Int(20)==0){ - Dungeon.hero.HT += 1; - Dungeon.hero.sprite.showStatus(CharSprite.POSITIVE, Messages.get(this,"ht")); - cooldown=500; - } - } - - - - return super.act(); - } - - - @Override - protected boolean canAttack(Char enemy) { - return new Ballistica( pos, enemy.pos, Ballistica.MAGIC_BOLT).collisionPos == enemy.pos; - - } - - - - @Override - protected boolean doAttack(Char enemy) { - - if (Level.adjacent(pos, enemy.pos)) { - - return super.doAttack(enemy); - - } else { - - boolean visible = Level.fieldOfView[pos] - || Level.fieldOfView[enemy.pos]; - if (visible) { - ((SugarplumFairySprite) sprite).zap(enemy.pos); - } - - spend(TIME_TO_ZAP); - cooldown=500; - - if (hit(this, enemy, true)) { - int dmg = damageRoll()*2; - if (Level.water[enemy.pos] && !enemy.flying) { - dmg *= 1.5f; - } - enemy.damage(dmg, this); - - enemy.sprite.centerEmitter().burst(SparkParticle.FACTORY, 3); - enemy.sprite.flash(); - - if (enemy == Dungeon.hero) { - - Camera.main.shake(2, 0.3f); - - if (!enemy.isAlive()) { - Dungeon.fail( Messages.format(ResultDescriptions.NAMED)); - //GLog.n(TXT_LIGHTNING_KILLED, name); - } - } - } else { - enemy.sprite - .showStatus(CharSprite.NEUTRAL, enemy.defenseVerb()); - } - - return !visible; - } - } - - - - @Override - public void call() { - next(); - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/actors/mobs/pets/Velocirooster.java b/java/com/hmdzl/spspd/change/actors/mobs/pets/Velocirooster.java deleted file mode 100644 index be7f51ee..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/pets/Velocirooster.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs.pets; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.MagicalSleep; -import com.hmdzl.spspd.change.actors.buffs.Paralysis; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.VelociroosterSprite; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.utils.Random; - -public class Velocirooster extends PET { - - { - //name = "velocirooster"; - spriteClass = VelociroosterSprite.class; - //flying=false; - state = HUNTING; - level = 1; - type = 3; - cooldown=500; - - properties.add(Property.BEAST); - - } - - @Override - public void adjustStats(int level) { - this.level = level; - HT = 70 + level*10; - evadeSkill = 5 + level; - } - - - - @Override - public int damageRoll() { - - int dmg=0; - if (cooldown==0){ - dmg=Random.NormalIntRange((5+level)*5/2, (5+level*3)*2); - cooldown=500; - } else { - dmg=Random.NormalIntRange((5+level), (5+level*3)) ; - } - return dmg; - - } - - @Override - protected boolean act() { - - if (cooldown>0){ - cooldown=Math.max(cooldown-(1+9*((level-1)/19)),0); - if (cooldown==0) {GLog.w(Messages.get(this,"ready"));} - } - - - - return super.act(); - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/actors/mobs/pets/VioletDragon.java b/java/com/hmdzl/spspd/change/actors/mobs/pets/VioletDragon.java deleted file mode 100644 index 31b733be..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/pets/VioletDragon.java +++ /dev/null @@ -1,149 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs.pets; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.MagicalSleep; -import com.hmdzl.spspd.change.actors.buffs.Paralysis; -import com.hmdzl.spspd.change.actors.buffs.Poison; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.mechanics.Ballistica; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.hmdzl.spspd.change.sprites.VioletDragonSprite; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.utils.Callback; -import com.watabou.utils.Random; - -public class VioletDragon extends PET implements Callback{ - - { - //name = "violet dragon"; - spriteClass = VioletDragonSprite.class; - //flying=true; - state = HUNTING; - level = 1; - type = 6; - cooldown=500; - - properties.add(Property.DRAGON); - - } - private static final float TIME_TO_ZAP = 1f; - - //Frames 1-4 are idle, 5-8 are moving, 9-12 are attack and the last are for death - - //flame on! - //spits fire - //feed meat - - @Override - protected float attackDelay() { - return 0.8f; - } - - @Override - public void adjustStats(int level) { - this.level = level; - HT = 70 + level*10; - evadeSkill = 5 + level; - } - - - - - @Override - public int damageRoll() { - return Random.NormalIntRange((5+level), (5+level*3)); - } - - @Override - protected boolean act() { - - if (cooldown>0){ - cooldown=Math.max(cooldown-(1+9*((level-1)/19)),0); - if (cooldown==0) {GLog.w(Messages.get(this,"ready"));} - } - - - - return super.act(); - } - - - @Override - protected boolean canAttack(Char enemy) { - if (cooldown>0){ - return Level.adjacent(pos, enemy.pos); - } else { - return new Ballistica( pos, enemy.pos, Ballistica.MAGIC_BOLT).collisionPos == enemy.pos; - } - } - - @Override - protected boolean doAttack(Char enemy) { - - if (Level.adjacent(pos, enemy.pos)) { - - return super.doAttack(enemy); - - } else { - - boolean visible = Level.fieldOfView[pos] - || Level.fieldOfView[enemy.pos]; - if (visible) { - ((VioletDragonSprite) sprite).zap(enemy.pos); - } else { - zap(); - } - - return !visible; - } - } - - - private void zap() { - spend(TIME_TO_ZAP); - - cooldown=500; - - if (hit(this, enemy, true)) { - - int dmg = damageRoll()*2; - enemy.damage(dmg, this); - - Buff.affect(enemy,Poison.class).set(Poison.durationFactor(enemy) * (level + 1)); - - } else { - enemy.sprite.showStatus(CharSprite.NEUTRAL, enemy.defenseVerb()); - } - - } - - public void onZapComplete() { - zap(); - next(); - } - - @Override - public void call() { - next(); - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/actors/mobs/pets/YearPet.java b/java/com/hmdzl/spspd/change/actors/mobs/pets/YearPet.java deleted file mode 100644 index 0b113194..00000000 --- a/java/com/hmdzl/spspd/change/actors/mobs/pets/YearPet.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.actors.mobs.pets; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Charm; -import com.hmdzl.spspd.change.actors.buffs.MagicalSleep; -import com.hmdzl.spspd.change.actors.buffs.Paralysis; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.Generator; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.BeastYearSprite; -import com.hmdzl.spspd.change.sprites.MonkeySprite; -import com.hmdzl.spspd.change.sprites.SteelBeeSprite; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -public class YearPet extends PET { - - { - //name = "year"; - spriteClass = BeastYearSprite.class; - //flying=true; - state = HUNTING; - level = 1; - type = 22; - - properties.add(Property.BEAST); - - } - - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - adjustStats(level); - } - - @Override - public void adjustStats(int level) { - this.level = level; - evadeSkill = 50; - HT = 1000; - } - - - - - @Override - public int damageRoll() { - return Random.NormalIntRange(10, (10+level*2)); - } - - @Override - protected boolean act() { - - - return super.act(); - } - - @Override - public int attackProc(Char enemy, int damage) { - return damage; - } - -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/effects/BadgeBanner.java b/java/com/hmdzl/spspd/change/effects/BadgeBanner.java deleted file mode 100644 index 384dd418..00000000 --- a/java/com/hmdzl/spspd/change/effects/BadgeBanner.java +++ /dev/null @@ -1,287 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.effects; - -import com.hmdzl.spspd.change.Assets; -import com.watabou.noosa.Game; -import com.watabou.noosa.Image; -import com.watabou.noosa.TextureFilm; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.PointF; - -public class BadgeBanner extends Image { - - private enum State { - FADE_IN, STATIC, FADE_OUT - }; - - private State state; - - private static final float DEFAULT_SCALE = 3; - - private static final float FADE_IN_TIME = 0.2f; - private static final float STATIC_TIME = 1f; - private static final float FADE_OUT_TIME = 1.0f; - - private int index; - private float time; - - private static TextureFilm atlas; - - private static BadgeBanner current; - - private BadgeBanner(int index) { - - super(Assets.BADGES); - - if (atlas == null) { - atlas = new TextureFilm(texture, 16, 16); - } - - this.index = index; - - frame(atlas.get(index)); - origin.set(width / 2, height / 2); - - alpha(0); - scale.set(2 * DEFAULT_SCALE); - - state = State.FADE_IN; - time = FADE_IN_TIME; - - Sample.INSTANCE.play(Assets.SND_BADGE); - } - - @Override - public void update() { - super.update(); - - time -= Game.elapsed; - if (time >= 0) { - - switch (state) { - case FADE_IN: - float p = time / FADE_IN_TIME; - scale.set((1 + p) * DEFAULT_SCALE); - alpha(1 - p); - break; - case STATIC: - break; - case FADE_OUT: - alpha(time / FADE_OUT_TIME); - break; - } - - } else { - - switch (state) { - case FADE_IN: - time = STATIC_TIME; - state = State.STATIC; - scale.set(DEFAULT_SCALE); - alpha(1); - highlight(this, index); - break; - case STATIC: - time = FADE_OUT_TIME; - state = State.FADE_OUT; - break; - case FADE_OUT: - killAndErase(); - break; - } - - } - } - - @Override - public void kill() { - if (current == this) { - current = null; - } - super.kill(); - } - - public static void highlight(Image image, int index) { - - PointF p = new PointF(); - - switch (index) { - case 0: - case 1: - case 2: - case 3: - p.offset(7, 3); - break; - case 4: - case 5: - case 6: - case 7: - p.offset(6, 5); - break; - case 8: - case 9: - case 10: - case 11: - p.offset(6, 3); - break; - case 12: - case 13: - case 14: - case 15: - p.offset(7, 4); - break; - case 16: - p.offset(6, 3); - break; - case 17: - p.offset(5, 4); - break; - case 18: - p.offset(7, 3); - break; - case 20: - p.offset(7, 3); - break; - case 21: - p.offset(7, 3); - break; - case 22: - p.offset(6, 4); - break; - case 23: - p.offset(4, 5); - break; - case 24: - p.offset(6, 4); - break; - case 25: - p.offset(6, 5); - break; - case 26: - p.offset(5, 5); - break; - case 27: - p.offset(6, 4); - break; - case 28: - p.offset(3, 5); - break; - case 29: - p.offset(5, 4); - break; - case 30: - p.offset(5, 4); - break; - case 31: - p.offset(5, 5); - break; - case 32: - case 33: - p.offset(7, 4); - break; - case 34: - p.offset(6, 4); - break; - case 35: - p.offset(6, 4); - break; - case 36: - p.offset(6, 5); - break; - case 37: - p.offset(4, 4); - break; - case 38: - p.offset(5, 5); - break; - case 39: - p.offset(5, 4); - break; - case 40: - case 41: - case 42: - case 43: - p.offset(5, 4); - break; - case 44: - case 45: - case 46: - case 47: - p.offset(5, 5); - break; - case 48: - case 49: - case 50: - case 51: - p.offset(7, 4); - break; - case 52: - case 53: - case 54: - case 55: - p.offset(4, 4); - break; - case 56: - p.offset(3, 7); - break; - case 57: - p.offset(4, 5); - break; - case 58: - p.offset(6, 4); - break; - case 59: - p.offset(7, 4); - break; - case 60: - case 61: - case 62: - case 63: - p.offset(4, 4); - break; - } - - p.x *= image.scale.x; - p.y *= image.scale.y; - p.offset(-image.origin.x * (image.scale.x - 1), -image.origin.y - * (image.scale.y - 1)); - p.offset(image.point()); - - Speck star = new Speck(); - star.reset(0, p.x, p.y, Speck.DISCOVER); - star.camera = image.camera(); - image.parent.add(star); - } - - public static BadgeBanner show(int image) { - if (current != null) { - current.killAndErase(); - } - return (current = new BadgeBanner(image)); - } - - public static Image image(int index) { - Image image = new Image(Assets.BADGES); - if (atlas == null) { - atlas = new TextureFilm(image.texture, 16, 16); - } - image.frame(atlas.get(index)); - return image; - } -} diff --git a/java/com/hmdzl/spspd/change/effects/BannerSprites.java b/java/com/hmdzl/spspd/change/effects/BannerSprites.java deleted file mode 100644 index cb64272c..00000000 --- a/java/com/hmdzl/spspd/change/effects/BannerSprites.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.effects; - -import com.hmdzl.spspd.change.Assets; -import com.watabou.noosa.Image; - -public class BannerSprites { - - public enum Type { - PIXEL_DUNGEON, BOSS_SLAIN, GAME_OVER, SELECT_YOUR_HERO, PIXEL_DUNGEON_SIGNS, CLEARED - }; - - public static Image get(Type type) { - Image icon = new Image(Assets.BANNERS); - switch (type) { - case PIXEL_DUNGEON: - icon.frame(icon.texture.uvRect(0, 0, 128, 70)); - break; - case BOSS_SLAIN: - icon.frame(icon.texture.uvRect(0, 70, 128, 105)); - break; - case GAME_OVER: - icon.frame(icon.texture.uvRect(0, 105, 128, 140)); - break; - case SELECT_YOUR_HERO: - icon.frame(icon.texture.uvRect(0, 140, 128, 161)); - break; - case PIXEL_DUNGEON_SIGNS: - icon.frame(icon.texture.uvRect(0, 161, 128, 218)); - break; - case CLEARED: - icon.frame(icon.texture.uvRect(0, 230, 128, 250)); - break; - } - return icon; - } -} diff --git a/java/com/hmdzl/spspd/change/effects/Beam.java b/java/com/hmdzl/spspd/change/effects/Beam.java deleted file mode 100644 index 5cd188c8..00000000 --- a/java/com/hmdzl/spspd/change/effects/Beam.java +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * Shattered Pixel Dungeon - * Copyright (C) 2014-2015 Evan Debenham - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.effects; - -import javax.microedition.khronos.opengles.GL10; - -import android.opengl.GLES20; - -import com.watabou.noosa.Game; -import com.watabou.noosa.Image; -import com.watabou.noosa.audio.Sample; -import com.hmdzl.spspd.change.Assets; -import com.watabou.utils.PointF; - -public class Beam extends Image { - - private static final double A = 180 / Math.PI; - - private float duration; - - private float timeLeft; - - private Beam(PointF s, PointF e, Effects.Type asset, float duration) { - super( Effects.get( asset ) ); - - origin.set( 0, height / 2 ); - - x = s.x - origin.x; - y = s.y - origin.y; - - float dx = e.x - s.x; - float dy = e.y - s.y; - angle = (float)(Math.atan2( dy, dx ) * A); - scale.x = (float)Math.sqrt( dx * dx + dy * dy ) / width; - - Sample.INSTANCE.play( Assets.SND_RAY ); - - timeLeft = this.duration = duration; - } - - public static class DeathRay extends Beam{ - public DeathRay(PointF s, PointF e){ - super(s, e, Effects.Type.DEATH_RAY, 0.5f); - } - } - - public static class LightRay extends Beam{ - public LightRay(PointF s, PointF e){ - super(s, e, Effects.Type.LIGHT_RAY, 1f); - } - } - - public static class HealthRay extends Beam{ - public HealthRay(PointF s, PointF e){ - super(s, e, Effects.Type.HEALTH_RAY, 0.75f); - } - } - - public static class WaterRay extends Beam{ - public WaterRay(PointF s, PointF e){ - super(s, e, Effects.Type.WATER_RAY, 0.75f); - } - } - - @Override - public void update() { - super.update(); - - float p = timeLeft / duration; - alpha( p ); - scale.set( scale.x, p ); - - if ((timeLeft -= Game.elapsed) <= 0) { - killAndErase(); - } - } - - @Override - public void draw() { - GLES20.glBlendFunc( GL10.GL_SRC_ALPHA, GL10.GL_ONE ); - super.draw(); - GLES20.glBlendFunc( GL10.GL_SRC_ALPHA, GL10.GL_ONE_MINUS_SRC_ALPHA ); - } -} diff --git a/java/com/hmdzl/spspd/change/effects/BlobEmitter.java b/java/com/hmdzl/spspd/change/effects/BlobEmitter.java deleted file mode 100644 index 0e0214e2..00000000 --- a/java/com/hmdzl/spspd/change/effects/BlobEmitter.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.effects; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.DungeonTilemap; -import com.hmdzl.spspd.change.actors.blobs.Blob; -import com.watabou.noosa.particles.Emitter; -import com.watabou.utils.Random; - -public class BlobEmitter extends Emitter { - - private static final int WIDTH = Blob.WIDTH; - private static final int LENGTH = Blob.LENGTH; - - private Blob blob; - - public BlobEmitter(Blob blob) { - - super(); - - this.blob = blob; - blob.use(this); - } - - @Override - protected void emit(int index) { - - if (blob.volume <= 0) { - return; - } - - int[] map = blob.cur; - float size = DungeonTilemap.SIZE; - - for (int i = 0; i < LENGTH; i++) { - if (map[i] > 0 && Dungeon.visible[i]) { - float x = ((i % WIDTH) + Random.Float()) * size; - float y = ((i / WIDTH) + Random.Float()) * size; - factory.emit(this, index, x, y); - } - } - } -} diff --git a/java/com/hmdzl/spspd/change/effects/CellEmitter.java b/java/com/hmdzl/spspd/change/effects/CellEmitter.java deleted file mode 100644 index 1b51dff3..00000000 --- a/java/com/hmdzl/spspd/change/effects/CellEmitter.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.effects; - -import com.hmdzl.spspd.change.DungeonTilemap; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.watabou.noosa.particles.Emitter; -import com.watabou.utils.PointF; - -public class CellEmitter { - - public static Emitter get(int cell) { - - PointF p = DungeonTilemap.tileToWorld(cell); - - Emitter emitter = GameScene.emitter(); - emitter.pos(p.x, p.y, DungeonTilemap.SIZE, DungeonTilemap.SIZE); - - return emitter; - } - - public static Emitter center(int cell) { - - PointF p = DungeonTilemap.tileToWorld(cell); - - Emitter emitter = GameScene.emitter(); - emitter.pos(p.x + DungeonTilemap.SIZE / 2, p.y + DungeonTilemap.SIZE - / 2); - - return emitter; - } - - public static Emitter bottom(int cell) { - - PointF p = DungeonTilemap.tileToWorld(cell); - - Emitter emitter = GameScene.emitter(); - emitter.pos(p.x, p.y + DungeonTilemap.SIZE, DungeonTilemap.SIZE, 0); - - return emitter; - } -} diff --git a/java/com/hmdzl/spspd/change/effects/Chains.java b/java/com/hmdzl/spspd/change/effects/Chains.java deleted file mode 100644 index 2d98f6ef..00000000 --- a/java/com/hmdzl/spspd/change/effects/Chains.java +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * Shattered Pixel Dungeon - * Copyright (C) 2014-2015 Evan Debenham - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.effects; - -import com.hmdzl.spspd.change.DungeonTilemap; -import com.watabou.noosa.Game; -import com.watabou.noosa.Group; -import com.watabou.noosa.Image; -import com.watabou.utils.Callback; -import com.watabou.utils.PointF; - -public class Chains extends Group { - - private static final double A = 180 / Math.PI; - - private float spent = 0f; - private float duration; - - private Callback callback; - - private Image[] chains; - private int numChains; - private float distance; - private float rotation = 0; - - private PointF from, to; - - public Chains(int from, int to, Callback callback){ - this(DungeonTilemap.tileCenterToWorld(from), - DungeonTilemap.tileCenterToWorld(to), - callback); - } - - public Chains(PointF from, PointF to, Callback callback){ - super(); - - this.callback = callback; - - this.from = from; - this.to = to; - - float dx = to.x - from.x; - float dy = to.y - from.y; - distance = (float)Math.hypot(dx, dy); - - - duration = distance/300f + 0.1f; - - rotation = (float)(Math.atan2( dy, dx ) * A) + 90f; - - numChains = Math.round(distance/6f)+1; - - chains = new Image[numChains]; - for (int i = 0; i < chains.length; i++){ - chains[i] = new Image(Effects.get(Effects.Type.CHAIN)); - chains[i].angle = rotation; - chains[i].origin.set( chains[i].width()/ 2, chains[i].height() ); - add(chains[i]); - } - } - - @Override - public void update() { - if ((spent += Game.elapsed) > duration) { - - killAndErase(); - if (callback != null) { - callback.call(); - } - - } else { - float dx = to.x - from.x; - float dy = to.y - from.y; - for (int i = 0; i < chains.length; i++) { - chains[i].center(new PointF( - from.x + ((dx * (i / (float)chains.length)) * (spent/duration)), - from.y + ((dy * (i / (float)chains.length)) * (spent/duration)) - )); - } - } - } - -} diff --git a/java/com/hmdzl/spspd/change/effects/CheckedCell.java b/java/com/hmdzl/spspd/change/effects/CheckedCell.java deleted file mode 100644 index 23c44d33..00000000 --- a/java/com/hmdzl/spspd/change/effects/CheckedCell.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.effects; - -import com.hmdzl.spspd.change.DungeonTilemap; -import com.watabou.gltextures.TextureCache; -import com.watabou.noosa.Game; -import com.watabou.noosa.Image; - -public class CheckedCell extends Image { - - private float alpha; - - public CheckedCell(int pos) { - super(TextureCache.createSolid(0xFF55AAFF)); - - origin.set(0.5f); - - point(DungeonTilemap.tileToWorld(pos).offset(DungeonTilemap.SIZE / 2, - DungeonTilemap.SIZE / 2)); - - alpha = 0.8f; - } - - @Override - public void update() { - if ((alpha -= Game.elapsed) > 0) { - alpha(alpha); - scale.set(DungeonTilemap.SIZE * alpha); - } else { - killAndErase(); - } - } -} diff --git a/java/com/hmdzl/spspd/change/effects/CircleArc.java b/java/com/hmdzl/spspd/change/effects/CircleArc.java deleted file mode 100644 index 18e4e6fc..00000000 --- a/java/com/hmdzl/spspd/change/effects/CircleArc.java +++ /dev/null @@ -1,191 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * Shattered Pixel Dungeon - * Copyright (C) 2014-2018 Evan Debenham - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ - -package com.hmdzl.spspd.change.effects; - -import com.watabou.gltextures.SmartTexture; -import com.watabou.gltextures.TextureCache; -import com.watabou.glwrap.Blending; -import com.watabou.noosa.Game; -import com.watabou.noosa.Group; -import com.watabou.noosa.NoosaScript; -import com.watabou.noosa.Visual; -import com.watabou.utils.PointF; - -import java.nio.ByteBuffer; -import java.nio.ByteOrder; -import java.nio.FloatBuffer; -import java.nio.ShortBuffer; - -public class CircleArc extends Visual { - - private float duration = 0; - private float lifespan; - - //1f is an entire 360 degree sweep - private float sweep; - private boolean dirty; - - private boolean lightMode = true; - - private SmartTexture texture; - - private FloatBuffer vertices; - private ShortBuffer indices; - - private int nTris; - private float rad; - - //more triangles means a more precise visual - public CircleArc( int triangles, float radius ) { - - super( 0, 0, 0, 0 ); - - texture = TextureCache.createSolid( 0xFFFFFFFF ); - - this.nTris = triangles; - this.rad = radius; - - vertices = ByteBuffer. - allocateDirect( (nTris * 2 + 1) * 4 * (Float.SIZE / 8) ). - order( ByteOrder.nativeOrder() ). - asFloatBuffer(); - - indices = ByteBuffer. - allocateDirect( nTris * 3 * Short.SIZE / 8 ). - order( ByteOrder.nativeOrder() ). - asShortBuffer(); - - sweep = 1f; - updateTriangles(); - } - - public CircleArc color( int color, boolean lightMode ) { - this.lightMode = lightMode; - hardlight( color ); - - return this; - } - - public CircleArc show( Visual visual, float duration ) { - point( visual.center() ); - visual.parent.addToBack( this ); - - lifespan = this.duration = duration; - - return this; - } - - public CircleArc show(Group parent, PointF pos, float duration ) { - point( pos ); - parent.add( this ); - - lifespan = this.duration = duration; - - return this; - } - - public void setSweep( float sweep ){ - this.sweep = sweep; - dirty = true; - } - - private void updateTriangles(){ - - dirty = false; - float v[] = new float[4]; - - indices.position( 0 ); - vertices.position( 0 ); - - v[0] = 0; - v[1] = 0; - v[2] = 0.25f; - v[3] = 0; - vertices.put( v ); - - v[2] = 0.75f; - v[3] = 0; - - //starting position is very top by default, use angle to adjust this. - double start = 2 * (Math.PI - Math.PI*sweep) - Math.PI/2.0; - - for (int i = 0; i < nTris; i++) { - - double a = start + i * Math.PI * 2 / nTris * sweep; - v[0] = (float)Math.cos( a ) * rad; - v[1] = (float)Math.sin( a ) * rad; - vertices.put( v ); - - a += 3.1415926f * 2 / nTris * sweep; - v[0] = (float)Math.cos( a ) * rad; - v[1] = (float)Math.sin( a ) * rad; - vertices.put( v ); - - indices.put( (short)0 ); - indices.put( (short)(1 + i * 2) ); - indices.put( (short)(2 + i * 2) ); - } - - indices.position( 0 ); - } - - @Override - public void update() { - super.update(); - - if (duration > 0) { - if ((lifespan -= Game.elapsed) > 0) { - sweep = lifespan/duration; - dirty = true; - - } else { - killAndErase(); - } - } - } - - @Override - public void draw() { - - super.draw(); - - if (dirty) { - updateTriangles(); - } - - if (lightMode) Blending.setLightMode(); - - NoosaScript script = NoosaScript.get(); - - texture.bind(); - - script.uModel.valueM4( matrix ); - script.lighting( - rm, gm, bm, am, - ra, ga, ba, aa ); - - script.camera( camera ); - script.drawElements( vertices, indices, nTris * 3 ); - - if (lightMode) Blending.setNormalMode(); - } -} diff --git a/java/com/hmdzl/spspd/change/effects/DarkBlock.java b/java/com/hmdzl/spspd/change/effects/DarkBlock.java deleted file mode 100644 index 7b36553d..00000000 --- a/java/com/hmdzl/spspd/change/effects/DarkBlock.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * Shattered Pixel Dungeon - * Copyright (C) 2014-2015 Evan Debenham - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.effects; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.watabou.noosa.Game; -import com.watabou.noosa.Gizmo; -import com.watabou.noosa.audio.Sample; - -public class DarkBlock extends Gizmo{ - private float phase; - private CharSprite target; - - public DarkBlock( CharSprite target ) { - super(); - - this.target = target; - } - - @Override - public void update() { - super.update(); - - //target.brightness(0.4f); - - if ((phase += Game.elapsed * 2) < 1) { - target.tint(0.83f, 1.17f, 1.33f, phase * 0.4f); - } else { - target.tint(0.83f, 1.17f, 1.33f, 0.4f); - } - - } - - public void lighten() { - - target.resetColor(); - killAndErase(); - - } - - public static DarkBlock darken( CharSprite sprite ) { - - DarkBlock darkBlock = new DarkBlock( sprite ); - if (sprite.parent != null) - sprite.parent.add( darkBlock ); - - return darkBlock; - } - -} diff --git a/java/com/hmdzl/spspd/change/effects/DeathRay.java b/java/com/hmdzl/spspd/change/effects/DeathRay.java deleted file mode 100644 index 0a65aa55..00000000 --- a/java/com/hmdzl/spspd/change/effects/DeathRay.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.effects; - -import javax.microedition.khronos.opengles.GL10; - -import android.opengl.GLES20; - -import com.hmdzl.spspd.change.Assets; -import com.watabou.noosa.Game; -import com.watabou.noosa.Image; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.PointF; - -public class DeathRay extends Image { - - private static final double A = 180 / Math.PI; - - private static final float DURATION = 0.5f; - - private float timeLeft; - - public DeathRay(PointF s, PointF e) { - super(Effects.get(Effects.Type.DEATH_RAY)); - - origin.set(0, height / 2); - - x = s.x - origin.x; - y = s.y - origin.y; - - float dx = e.x - s.x; - float dy = e.y - s.y; - angle = (float) (Math.atan2(dy, dx) * A); - scale.x = (float) Math.sqrt(dx * dx + dy * dy) / width; - - Sample.INSTANCE.play(Assets.SND_RAY); - - timeLeft = DURATION; - } - - @Override - public void update() { - super.update(); - - float p = timeLeft / DURATION; - alpha(p); - scale.set(scale.x, p); - - if ((timeLeft -= Game.elapsed) <= 0) { - killAndErase(); - } - } - - @Override - public void draw() { - GLES20.glBlendFunc(GL10.GL_SRC_ALPHA, GL10.GL_ONE); - super.draw(); - GLES20.glBlendFunc(GL10.GL_SRC_ALPHA, GL10.GL_ONE_MINUS_SRC_ALPHA); - } -} diff --git a/java/com/hmdzl/spspd/change/effects/Degradation.java b/java/com/hmdzl/spspd/change/effects/Degradation.java deleted file mode 100644 index 9fe9951d..00000000 --- a/java/com/hmdzl/spspd/change/effects/Degradation.java +++ /dev/null @@ -1,119 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.effects; - -import javax.microedition.khronos.opengles.GL10; - -import android.opengl.GLES20; - -import com.watabou.noosa.Group; -import com.watabou.noosa.particles.PixelParticle; -import com.watabou.utils.PointF; -import com.watabou.utils.Random; - -public class Degradation extends Group { - - private static int[] WEAPON = { +2, -2, +1, -1, 0, 0, -1, +1, -2, +2, -2, - 0, 0, +2 }; - - private static int[] ARMOR = { -2, -1, -1, -1, +1, -1, +2, -1, -2, 0, -1, - 0, 0, 0, +1, 0, +2, 0, -1, +1, +1, +1, -1, +2, 0, +2, +1, +2 }; - - private static int[] RING = { 0, -1, -1, 0, 0, 0, +1, 0, -1, +1, +1, +1, - -1, +2, 0, +2, +1, +2 }; - - private static int[] WAND = { +2, -2, +1, -1, 0, 0, -1, +1, -2, +2, +1, -2, - +2, -1 }; - - public static Degradation weapon(PointF p) { - return new Degradation(p, WEAPON); - } - - public static Degradation armor(PointF p) { - return new Degradation(p, ARMOR); - } - - public static Degradation ring(PointF p) { - return new Degradation(p, RING); - } - - public static Degradation wand(PointF p) { - return new Degradation(p, WAND); - } - - private Degradation(PointF p, int[] matrix) { - - for (int i = 0; i < matrix.length; i += 2) { - add(new Speck(p.x, p.y, matrix[i], matrix[i + 1])); - add(new Speck(p.x, p.y, matrix[i], matrix[i + 1])); - } - } - - @Override - public void update() { - super.update(); - if (countLiving() == 0) { - killAndErase(); - } - } - - @Override - public void draw() { - GLES20.glBlendFunc(GL10.GL_SRC_ALPHA, GL10.GL_ONE); - super.draw(); - GLES20.glBlendFunc(GL10.GL_SRC_ALPHA, GL10.GL_ONE_MINUS_SRC_ALPHA); - } - - public static class Speck extends PixelParticle { - - private static final int COLOR = 0xFF4422; - private static final int SIZE = 3; - - public Speck(float x0, float y0, int mx, int my) { - - super(); - color(COLOR); - - float x1 = x0 + mx * SIZE; - float y1 = y0 + my * SIZE; - - PointF p = new PointF().polar(Random.Float(2 * PointF.PI), 8); - x0 += p.x; - y0 += p.y; - - float dx = x1 - x0; - float dy = y1 - y0; - - x = x0; - y = y0; - speed.set(dx, dy); - acc.set(-dx / 4, -dy / 4); - - left = lifespan = 2f; - } - - @Override - public void update() { - super.update(); - - am = 1 - Math.abs(left / lifespan - 0.5f) * 2; - am *= am; - size(am * SIZE); - } - } -} diff --git a/java/com/hmdzl/spspd/change/effects/Effects.java b/java/com/hmdzl/spspd/change/effects/Effects.java deleted file mode 100644 index 629c53d1..00000000 --- a/java/com/hmdzl/spspd/change/effects/Effects.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.effects; - -import com.hmdzl.spspd.change.Assets; -import com.watabou.noosa.Image; - -public class Effects { - - public enum Type { - RIPPLE, - LIGHTNING, - WOUND, - EXCLAMATION, - CHAIN, - DEATH_RAY, - LIGHT_RAY, - HEALTH_RAY, - WATER_RAY - }; - - public static Image get( Type type ) { - Image icon = new Image( Assets.EFFECTS ); - switch (type) { - case RIPPLE: - icon.frame(icon.texture.uvRect(0, 0, 16, 16)); - break; - case LIGHTNING: - icon.frame(icon.texture.uvRect(16, 0, 32, 8)); - break; - case WOUND: - icon.frame(icon.texture.uvRect(16, 8, 32, 16)); - break; - case EXCLAMATION: - icon.frame(icon.texture.uvRect(0, 16, 6, 25)); - break; - case CHAIN: - icon.frame(icon.texture.uvRect(6, 16, 11, 22)); - break; - case DEATH_RAY: - icon.frame(icon.texture.uvRect(16, 16, 32, 24)); - break; - case LIGHT_RAY: - icon.frame(icon.texture.uvRect(16, 23, 32, 31)); - break; - case HEALTH_RAY: - icon.frame(icon.texture.uvRect(16, 30, 32, 38)); - break; - case WATER_RAY: - icon.frame(icon.texture.uvRect(16, 37, 32, 45)); - break; - } - return icon; - } -} diff --git a/java/com/hmdzl/spspd/change/effects/EmoIcon.java b/java/com/hmdzl/spspd/change/effects/EmoIcon.java deleted file mode 100644 index 5978900f..00000000 --- a/java/com/hmdzl/spspd/change/effects/EmoIcon.java +++ /dev/null @@ -1,116 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.effects; - -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.hmdzl.spspd.change.ui.Icons; -import com.watabou.noosa.Game; -import com.watabou.noosa.Image; -import com.watabou.utils.Random; - -public class EmoIcon extends Image { - - protected float maxSize = 2; - protected float timeScale = 1; - - protected boolean growing = true; - - protected CharSprite owner; - - public EmoIcon(CharSprite owner) { - super(); - - this.owner = owner; - GameScene.add(this); - } - - @Override - public void update() { - super.update(); - - if (visible) { - if (growing) { - scale.set(Math.min(scale.x + Game.elapsed * timeScale, maxSize)); - if (scale.x >= maxSize) { - growing = false; - } - } else { - scale.set(Math.max(scale.x - Game.elapsed * timeScale, 1f)); - if (scale.x <= 1) { - growing = true; - } - } - - x = owner.x + owner.width - width / 2; - y = owner.y - height; - } - } - - public static class Sleep extends EmoIcon { - - public Sleep(CharSprite owner) { - - super(owner); - - copy(Icons.get(Icons.SLEEP)); - - maxSize = 1.2f; - timeScale = 0.5f; - - origin.set(width / 2, height / 2); - scale.set(Random.Float(1, maxSize)); - } - } - - public static class Alert extends EmoIcon { - - public Alert(CharSprite owner) { - - super(owner); - - copy(Icons.get(Icons.ALERT)); - - maxSize = 1.3f; - timeScale = 2; - - origin.set(2.5f, height - 2.5f); - scale.set(Random.Float(1, maxSize)); - } - } - - public static class Lost extends EmoIcon { - - public Lost( CharSprite owner ){ - super( owner ); - - copy( Icons.get( Icons.LOST ) ); - - maxSize = 1.25f; - timeScale = 1; - - origin.set( 2.5f, height - 2.5f ); - scale.set( Random.Float( 1, maxSize ) ); - - x = owner.x + owner.width - width / 2; - y = owner.y - height; - } - - } - -} diff --git a/java/com/hmdzl/spspd/change/effects/Fireball.java b/java/com/hmdzl/spspd/change/effects/Fireball.java deleted file mode 100644 index ac858451..00000000 --- a/java/com/hmdzl/spspd/change/effects/Fireball.java +++ /dev/null @@ -1,161 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.effects; - -import javax.microedition.khronos.opengles.GL10; - -import android.graphics.RectF; -import android.opengl.GLES20; - -import com.hmdzl.spspd.change.Assets; -import com.watabou.glwrap.Texture; -import com.watabou.noosa.Game; -import com.watabou.noosa.Group; -import com.watabou.noosa.Image; -import com.watabou.noosa.particles.Emitter; -import com.watabou.noosa.particles.PixelParticle; -import com.watabou.noosa.ui.Component; -import com.watabou.utils.ColorMath; -import com.watabou.utils.Random; - -public class Fireball extends Component { - - private static final RectF BLIGHT = new RectF(0, 0, 0.25f, 1); - private static final RectF FLIGHT = new RectF(0.25f, 0, 0.5f, 1); - private static final RectF FLAME1 = new RectF(0.50f, 0, 0.75f, 1); - private static final RectF FLAME2 = new RectF(0.75f, 0, 1.00f, 1); - - private static final int COLOR = 0xFF66FF; - - private Image bLight; - private Image fLight; - private Emitter emitter; - private Group sparks; - - @Override - protected void createChildren() { - - sparks = new Group(); - add(sparks); - - bLight = new Image(Assets.FIREBALL); - bLight.frame(BLIGHT); - bLight.origin.set(bLight.width / 2); - bLight.angularSpeed = -90; - add(bLight); - - emitter = new Emitter(); - emitter.pour(new Emitter.Factory() { - @Override - public void emit(Emitter emitter, int index, float x, float y) { - Flame p = (Flame) emitter.recycle(Flame.class); - p.reset(); - p.x = x - p.width / 2; - p.y = y - p.height / 2; - } - }, 0.1f); - add(emitter); - - fLight = new Image(Assets.FIREBALL); - fLight.frame(FLIGHT); - fLight.origin.set(fLight.width / 2); - fLight.angularSpeed = 360; - add(fLight); - - bLight.texture.filter(Texture.LINEAR, Texture.LINEAR); - } - - @Override - protected void layout() { - - bLight.x = x - bLight.width / 2; - bLight.y = y - bLight.height / 2; - - emitter.pos(x - bLight.width / 4, y - bLight.height / 4, - bLight.width / 2, bLight.height / 2); - - fLight.x = x - fLight.width / 2; - fLight.y = y - fLight.height / 2; - } - - @Override - public void update() { - - super.update(); - - if (Random.Float() < Game.elapsed) { - PixelParticle spark = (PixelParticle) sparks - .recycle(PixelParticle.Shrinking.class); - spark.reset(x, y, ColorMath.random(COLOR, 0x66FF66), 2, - Random.Float(0.5f, 1.0f)); - spark.speed.set(Random.Float(-40, +40), Random.Float(-60, +20)); - spark.acc.set(0, +80); - sparks.add(spark); - } - } - - @Override - public void draw() { - GLES20.glBlendFunc(GL10.GL_SRC_ALPHA, GL10.GL_ONE); - super.draw(); - GLES20.glBlendFunc(GL10.GL_SRC_ALPHA, GL10.GL_ONE_MINUS_SRC_ALPHA); - } - - public static class Flame extends Image { - - private static float LIFESPAN = 1f; - - private static float SPEED = -40f; - private static float ACC = -20f; - - private float timeLeft; - - public Flame() { - - super(Assets.FIREBALL); - - frame(Random.Int(2) == 0 ? FLAME1 : FLAME2); - origin.set(width / 2, height / 2); - acc.set(0, ACC); - } - - public void reset() { - revive(); - timeLeft = LIFESPAN; - speed.set(0, SPEED); - } - - @Override - public void update() { - - super.update(); - - if ((timeLeft -= Game.elapsed) <= 0) { - - kill(); - - } else { - - float p = timeLeft / LIFESPAN; - scale.set(p); - alpha(p > 0.8f ? (1 - p) * 5f : p * 1.25f); - - } - } - } -} diff --git a/java/com/hmdzl/spspd/change/effects/Flare.java b/java/com/hmdzl/spspd/change/effects/Flare.java deleted file mode 100644 index 65288946..00000000 --- a/java/com/hmdzl/spspd/change/effects/Flare.java +++ /dev/null @@ -1,162 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.effects; - -import java.nio.ByteBuffer; -import java.nio.ByteOrder; -import java.nio.FloatBuffer; -import java.nio.ShortBuffer; - -import javax.microedition.khronos.opengles.GL10; - -import android.annotation.SuppressLint; -import android.opengl.GLES20; -import android.util.FloatMath; - -import com.watabou.gltextures.Gradient; -import com.watabou.gltextures.SmartTexture; -import com.watabou.noosa.Game; -import com.watabou.noosa.NoosaScript; -import com.watabou.noosa.Visual; - -public class Flare extends Visual { - - private float duration = 0; - private float lifespan; - - private boolean lightMode = true; - - private SmartTexture texture; - - private FloatBuffer vertices; - private ShortBuffer indices; - - private int nRays; - - @SuppressLint("FloatMath") - public Flare(int nRays, float radius) { - - super(0, 0, 0, 0); - - int gradient[] = { 0xFFFFFFFF, 0x00FFFFFF }; - texture = new Gradient(gradient); - - this.nRays = nRays; - - angle = 45; - angularSpeed = 180; - - vertices = ByteBuffer - .allocateDirect((nRays * 2 + 1) * 4 * (Float.SIZE / 8)) - .order(ByteOrder.nativeOrder()).asFloatBuffer(); - - indices = ByteBuffer.allocateDirect(nRays * 3 * Short.SIZE / 8) - .order(ByteOrder.nativeOrder()).asShortBuffer(); - - float v[] = new float[4]; - - v[0] = 0; - v[1] = 0; - v[2] = 0.25f; - v[3] = 0; - vertices.put(v); - - v[2] = 0.75f; - v[3] = 0; - - for (int i = 0; i < nRays; i++) { - - float a = i * 3.1415926f * 2 / nRays; - v[0] = (float)Math.cos(a) * radius; - v[1] = (float)Math.sin(a) * radius; - vertices.put(v); - - a += 3.1415926f * 2 / nRays / 2; - v[0] = (float)Math.cos(a) * radius; - v[1] = (float)Math.sin(a) * radius; - vertices.put(v); - - indices.put((short) 0); - indices.put((short) (1 + i * 2)); - indices.put((short) (2 + i * 2)); - } - - indices.position(0); - } - - public Flare color(int color, boolean lightMode) { - this.lightMode = lightMode; - hardlight(color); - - return this; - } - - public Flare show(Visual visual, float duration) { - point(visual.center()); - visual.parent.addToBack(this); - - lifespan = this.duration = duration; - - return this; - } - - @Override - public void update() { - super.update(); - - if (duration > 0) { - if ((lifespan -= Game.elapsed) > 0) { - - float p = 1 - lifespan / duration; // 0 -> 1 - p = p < 0.25f ? p * 4 : (1 - p) * 1.333f; - scale.set(p); - alpha(p); - - } else { - killAndErase(); - } - } - } - - @Override - public void draw() { - - super.draw(); - - if (lightMode) { - GLES20.glBlendFunc(GL10.GL_SRC_ALPHA, GL10.GL_ONE); - drawRays(); - GLES20.glBlendFunc(GL10.GL_SRC_ALPHA, GL10.GL_ONE_MINUS_SRC_ALPHA); - } else { - drawRays(); - } - } - - private void drawRays() { - - NoosaScript script = NoosaScript.get(); - - texture.bind(); - - script.uModel.valueM4(matrix); - script.lighting(rm, gm, bm, am, ra, ga, ba, aa); - - script.camera(camera); - script.drawElements(vertices, indices, nRays * 3); - } -} diff --git a/java/com/hmdzl/spspd/change/effects/FloatingText.java b/java/com/hmdzl/spspd/change/effects/FloatingText.java deleted file mode 100644 index fbe3dc22..00000000 --- a/java/com/hmdzl/spspd/change/effects/FloatingText.java +++ /dev/null @@ -1,138 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.effects; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.DungeonTilemap; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.scenes.PixelScene; -import com.watabou.noosa.RenderedText; -import com.watabou.noosa.Camera; -import com.watabou.noosa.Game; -import com.watabou.utils.SparseArray; - -public class FloatingText extends RenderedText { - - private static final float LIFESPAN = 1f; - private static final float DISTANCE = DungeonTilemap.SIZE; - - private float timeLeft; - - private int key = -1; - - private float cameraZoom = -1; - - private static SparseArray> stacks = new SparseArray>(); - - public FloatingText() { - super(); - speed.y = -DISTANCE / LIFESPAN; - } - - @Override - public void update() { - super.update(); - - if (timeLeft > 0) { - if ((timeLeft -= Game.elapsed) <= 0) { - kill(); - } else { - float p = timeLeft / LIFESPAN; - alpha(p > 0.5f ? 1 : p * 2); - } - } - } - - @Override - public void kill() { - if (key != -1) { - stacks.get(key).remove(this); - key = -1; - } - super.kill(); - } - - @Override - public void destroy() { - kill(); - super.destroy(); - } - - public void reset(float x, float y, String text, int color) { - - revive(); - - if (cameraZoom != Camera.main.zoom) { - cameraZoom = Camera.main.zoom; - PixelScene.chooseFont(9, cameraZoom); - size( 9 * (int)cameraZoom); - scale.set( 1 /cameraZoom ); - } - - text(text); - hardlight(color); - - //measure(); - this.x = PixelScene.align(x - width() / 2); - this.y = y - height(); - - timeLeft = LIFESPAN; - } - - /* STATIC METHODS */ - - public static void show(float x, float y, String text, int color) { - GameScene.status().reset(x, y, text, color); - } - - public static void show(float x, float y, int key, String text, int color) { - FloatingText txt = GameScene.status(); - txt.reset(x, y, text, color); - push(txt, key); - } - - private static void push(FloatingText txt, int key) { - - txt.key = key; - - ArrayList stack = stacks.get(key); - if (stack == null) { - stack = new ArrayList(); - stacks.put(key, stack); - } - - if (stack.size() > 0) { - FloatingText below = txt; - int aboveIndex = stack.size() - 1; - while (aboveIndex >= 0) { - FloatingText above = stack.get(aboveIndex); - if (above.y + above.height() > below.y) { - above.y = below.y - above.height(); - - below = above; - aboveIndex--; - } else { - break; - } - } - } - - stack.add(txt); - } -} diff --git a/java/com/hmdzl/spspd/change/effects/Halo.java b/java/com/hmdzl/spspd/change/effects/Halo.java deleted file mode 100644 index 5378921d..00000000 --- a/java/com/hmdzl/spspd/change/effects/Halo.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.effects; - -import android.graphics.Bitmap; -import android.graphics.Canvas; -import android.graphics.Paint; - -import com.watabou.gltextures.SmartTexture; -import com.watabou.gltextures.TextureCache; -import com.watabou.noosa.Image; - -public class Halo extends Image { - - private static final Object CACHE_KEY = Halo.class; - - protected static final int RADIUS = 64; - - protected float radius = RADIUS; - protected float brightness = 1; - - public Halo() { - super(); - - if (!TextureCache.contains(CACHE_KEY)) { - Bitmap bmp = Bitmap.createBitmap(RADIUS * 2, RADIUS * 2, - Bitmap.Config.ARGB_8888); - Canvas canvas = new Canvas(bmp); - Paint paint = new Paint(); - paint.setColor(0xFFFFFFFF); - canvas.drawCircle(RADIUS, RADIUS, RADIUS * 0.75f, paint); - paint.setColor(0x88FFFFFF); - canvas.drawCircle(RADIUS, RADIUS, RADIUS, paint); - TextureCache.add(CACHE_KEY, new SmartTexture(bmp)); - } - - texture(CACHE_KEY); - - origin.set(RADIUS); - } - - public Halo(float radius, int color, float brightness) { - - this(); - - hardlight(color); - alpha(this.brightness = brightness); - radius(radius); - } - - public Halo point(float x, float y) { - this.x = x - RADIUS; - this.y = y - RADIUS; - return this; - } - - public void radius(float value) { - scale.set((this.radius = value) / RADIUS); - } -} diff --git a/java/com/hmdzl/spspd/change/effects/IceBlock.java b/java/com/hmdzl/spspd/change/effects/IceBlock.java deleted file mode 100644 index 4cc41db9..00000000 --- a/java/com/hmdzl/spspd/change/effects/IceBlock.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.effects; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.watabou.noosa.Game; -import com.watabou.noosa.Gizmo; -import com.watabou.noosa.audio.Sample; - -public class IceBlock extends Gizmo { - - private float phase; - - private CharSprite target; - - public IceBlock(CharSprite target) { - super(); - - this.target = target; - phase = 0; - } - - @Override - public void update() { - super.update(); - - if ((phase += Game.elapsed * 2) < 1) { - target.tint(0.83f, 1.17f, 1.33f, phase * 0.6f); - } else { - target.tint(0.83f, 1.17f, 1.33f, 0.6f); - } - } - - public void melt() { - - target.resetColor(); - killAndErase(); - - if (visible) { - Splash.at(target.center(), 0xFFB2D6FF, 5); - Sample.INSTANCE.play(Assets.SND_SHATTER); - } - } - - public static IceBlock freeze(CharSprite sprite) { - - IceBlock iceBlock = new IceBlock(sprite); - sprite.parent.add(iceBlock); - - return iceBlock; - } -} diff --git a/java/com/hmdzl/spspd/change/effects/Identification.java b/java/com/hmdzl/spspd/change/effects/Identification.java deleted file mode 100644 index e2a73943..00000000 --- a/java/com/hmdzl/spspd/change/effects/Identification.java +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.effects; - -import javax.microedition.khronos.opengles.GL10; - -import android.opengl.GLES20; - -import com.watabou.noosa.Group; -import com.watabou.noosa.particles.PixelParticle; -import com.watabou.utils.PointF; -import com.watabou.utils.Random; - -public class Identification extends Group { - - private static int[] DOTS = { -1, -3, 0, -3, +1, -3, -1, -2, +1, -2, +1, - -1, 0, 0, +1, 0, 0, +1, 0, +3 }; - - public Identification(PointF p) { - - for (int i = 0; i < DOTS.length; i += 2) { - add(new Speck(p.x, p.y, DOTS[i], DOTS[i + 1])); - add(new Speck(p.x, p.y, DOTS[i], DOTS[i + 1])); - } - } - - @Override - public void update() { - super.update(); - if (countLiving() == 0) { - killAndErase(); - } - } - - @Override - public void draw() { - GLES20.glBlendFunc(GL10.GL_SRC_ALPHA, GL10.GL_ONE); - super.draw(); - GLES20.glBlendFunc(GL10.GL_SRC_ALPHA, GL10.GL_ONE_MINUS_SRC_ALPHA); - } - - public static class Speck extends PixelParticle { - - private static final int COLOR = 0x4488CC; - private static final int SIZE = 3; - - public Speck(float x0, float y0, int mx, int my) { - - super(); - color(COLOR); - - float x1 = x0 + mx * SIZE; - float y1 = y0 + my * SIZE; - - PointF p = new PointF().polar(Random.Float(2 * PointF.PI), 8); - x0 += p.x; - y0 += p.y; - - float dx = x1 - x0; - float dy = y1 - y0; - - x = x0; - y = y0; - speed.set(dx, dy); - acc.set(-dx / 4, -dy / 4); - - left = lifespan = 2f; - } - - @Override - public void update() { - super.update(); - - am = 1 - Math.abs(left / lifespan - 0.5f) * 2; - am *= am; - size(am * SIZE); - } - } -} diff --git a/java/com/hmdzl/spspd/change/effects/Lightning.java b/java/com/hmdzl/spspd/change/effects/Lightning.java deleted file mode 100644 index e1164268..00000000 --- a/java/com/hmdzl/spspd/change/effects/Lightning.java +++ /dev/null @@ -1,144 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.effects; - -import javax.microedition.khronos.opengles.GL10; - -import android.opengl.GLES20; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.DungeonTilemap; -import com.hmdzl.spspd.change.levels.Level; -import com.watabou.noosa.Game; -import com.watabou.noosa.Group; -import com.watabou.noosa.Image; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Callback; -import com.watabou.utils.PointF; -import com.watabou.utils.Random; - -import java.util.Arrays; -import java.util.List; - -public class Lightning extends Group { - - private static final float DURATION = 0.3f; - - private float life; - - private List arcs; - - private Callback callback; - - public Lightning(int from, int to, Callback callback){ - this(Arrays.asList(new Arc(from, to)), callback); - } - - public Lightning( List arcs, Callback callback ) { - - super(); - - this.arcs = arcs; - for (Arc arc : this.arcs) - add(arc); - - this.callback = callback; - - life = DURATION; - - Sample.INSTANCE.play( Assets.SND_LIGHTNING ); - } - - private static final double A = 180 / Math.PI; - - @Override - public void update() { - if ((life -= Game.elapsed) < 0) { - - killAndErase(); - if (callback != null) { - callback.call(); - } - - } else { - - float alpha = life / DURATION; - - for (Arc arc : arcs) { - arc.alpha(alpha); - } - - super.update(); - } - } - - @Override - public void draw() { - GLES20.glBlendFunc( GL10.GL_SRC_ALPHA, GL10.GL_ONE ); - super.draw(); - GLES20.glBlendFunc( GL10.GL_SRC_ALPHA, GL10.GL_ONE_MINUS_SRC_ALPHA ); - } - - //A lightning object is meant to be loaded up with arcs. - //these act as a means of easily expressing lighting between two points. - public static class Arc extends Group { - - private Image arc1, arc2; - - //starting and ending x/y values - private PointF start, end; - - public Arc(int from, int to){ - start = DungeonTilemap.tileCenterToWorld(from); - end = DungeonTilemap.tileCenterToWorld(to); - - arc1 = new Image(Effects.get(Effects.Type.LIGHTNING)); - arc1.x = start.x - arc1.origin.x; - arc1.y = start.y - arc1.origin.y; - arc1.origin.set( 0, arc1.height()/2 ); - add( arc1 ); - - arc2 = new Image(Effects.get(Effects.Type.LIGHTNING)); - arc2.origin.set( 0, arc2.height()/2 ); - add( arc2 ); - - } - - public void alpha(float alpha) { - arc1.am = arc2.am = alpha; - } - - @Override - public void update() { - float x2 = (start.x + end.x) / 2 + Random.Float( -4, +4 ); - float y2 = (start.y + end.y) / 2 + Random.Float( -4, +4 ); - - float dx = x2 - start.x; - float dy = y2 - start.y; - arc1.angle = (float)(Math.atan2( dy, dx ) * A); - arc1.scale.x = (float)Math.sqrt( dx * dx + dy * dy ) / arc1.width; - - dx = end.x - x2; - dy = end.y - y2; - arc2.angle = (float)(Math.atan2( dy, dx ) * A); - arc2.scale.x = (float)Math.sqrt( dx * dx + dy * dy ) / arc2.width; - arc2.x = x2 - arc2.origin.x; - arc2.y = y2 - arc2.origin.x; - } - } -} diff --git a/java/com/hmdzl/spspd/change/effects/MagicMissile.java b/java/com/hmdzl/spspd/change/effects/MagicMissile.java deleted file mode 100644 index 8aa40733..00000000 --- a/java/com/hmdzl/spspd/change/effects/MagicMissile.java +++ /dev/null @@ -1,449 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.effects; - -import com.hmdzl.spspd.change.DungeonTilemap; -import com.hmdzl.spspd.change.effects.particles.FlameParticle; -import com.hmdzl.spspd.change.effects.particles.LeafParticle; -import com.hmdzl.spspd.change.effects.particles.PoisonParticle; -import com.hmdzl.spspd.change.effects.particles.PurpleParticle; -import com.hmdzl.spspd.change.effects.particles.RainbowParticle; -import com.hmdzl.spspd.change.effects.particles.ShadowParticle; -import com.hmdzl.spspd.change.effects.particles.WoolParticle; -import com.watabou.noosa.Game; -import com.watabou.noosa.Group; -import com.watabou.noosa.particles.Emitter; -import com.watabou.noosa.particles.PixelParticle; -import com.watabou.utils.Callback; -import com.watabou.utils.ColorMath; -import com.watabou.utils.PointF; -import com.watabou.utils.Random; - -public class MagicMissile extends Emitter { - - private static final float SPEED = 200f; - - private Callback callback; - - private float sx; - private float sy; - private float time; - - public void reset(int from, int to, Callback callback) { - this.callback = callback; - - revive(); - - PointF pf = DungeonTilemap.tileCenterToWorld(from); - PointF pt = DungeonTilemap.tileCenterToWorld(to); - - x = pf.x; - y = pf.y; - width = 0; - height = 0; - - PointF d = PointF.diff(pt, pf); - PointF speed = new PointF(d).normalize().scale(SPEED); - sx = speed.x; - sy = speed.y; - time = d.length() / SPEED; - } - - public void size(float size) { - x -= size / 2; - y -= size / 2; - width = height = size; - } - - public static void coldLight(Group group, int from, int to, - Callback callback) { - MagicMissile missile = ((MagicMissile) group - .recycle(MagicMissile.class)); - missile.reset(from, to, callback); - missile.pour(MagicParticle.FACTORY, 0.01f); - } - - public static void fire(Group group, int from, int to, Callback callback) { - MagicMissile missile = ((MagicMissile) group - .recycle(MagicMissile.class)); - missile.reset(from, to, callback); - missile.size(4); - missile.pour(FlameParticle.FACTORY, 0.01f); - } - - public static void firesmall(Group group, int from, int to, Callback callback) { - MagicMissile missile = ((MagicMissile) group - .recycle(MagicMissile.class)); - missile.reset(from, to, callback); - missile.size(2); - missile.pour(FlameParticle.FACTORY, 0.01f); - } - - public static void firelarge(Group group, int from, int to, Callback callback) { - MagicMissile missile = ((MagicMissile) group - .recycle(MagicMissile.class)); - missile.reset(from, to, callback); - missile.size(8); - missile.pour(FlameParticle.FACTORY, 0.01f); - } - - public static void earth(Group group, int from, int to, Callback callback) { - MagicMissile missile = ((MagicMissile) group - .recycle(MagicMissile.class)); - missile.reset(from, to, callback); - missile.size(2); - missile.pour(EarthParticle.FACTORY, 0.01f); - } - - public static void purpleLight(Group group, int from, int to, - Callback callback) { - MagicMissile missile = ((MagicMissile) group - .recycle(MagicMissile.class)); - missile.reset(from, to, callback); - missile.size(2); - missile.pour(PurpleParticle.MISSILE, 0.01f); - } - - public static void whiteLight(Group group, int from, int to, - Callback callback) { - MagicMissile missile = ((MagicMissile) group - .recycle(MagicMissile.class)); - missile.reset(from, to, callback); - missile.size(4); - missile.pour(WhiteParticle.FACTORY, 0.01f); - } - - public static void wool(Group group, int from, int to, Callback callback) { - MagicMissile missile = ((MagicMissile) group - .recycle(MagicMissile.class)); - missile.reset(from, to, callback); - missile.size(3); - missile.pour(WoolParticle.FACTORY, 0.01f); - } - - public static void poison(Group group, int from, int to, Callback callback) { - MagicMissile missile = ((MagicMissile) group - .recycle(MagicMissile.class)); - missile.reset(from, to, callback); - missile.size(3); - missile.pour(PoisonParticle.MISSILE, 0.01f); - } - - public static void foliage(Group group, int from, int to, Callback callback) { - MagicMissile missile = ((MagicMissile) group - .recycle(MagicMissile.class)); - missile.reset(from, to, callback); - missile.size(4); - missile.pour(LeafParticle.GENERAL, 0.01f); - } - - public static void slowness(Group group, int from, int to, Callback callback) { - MagicMissile missile = ((MagicMissile) group - .recycle(MagicMissile.class)); - missile.reset(from, to, callback); - missile.pour(SlowParticle.FACTORY, 0.01f); - } - - public static void force(Group group, int from, int to, Callback callback) { - MagicMissile missile = ((MagicMissile) group - .recycle(MagicMissile.class)); - missile.reset(from, to, callback); - missile.size(4); - missile.pour(ForceParticle.FACTORY, 0.01f); - } - - public static void blueLight(Group group, int from, int to, - Callback callback) { - MagicMissile missile = ((MagicMissile) group - .recycle(MagicMissile.class)); - missile.reset(from, to, callback); - missile.size(4); - missile.pour(ColdParticle.FACTORY, 0.01f); - } - - public static void shadow(Group group, int from, int to, Callback callback) { - MagicMissile missile = ((MagicMissile) group - .recycle(MagicMissile.class)); - missile.reset(from, to, callback); - missile.size(4); - missile.pour(ShadowParticle.MISSILE, 0.01f); - } - - public static void rainbow( Group group, int from, int to, Callback callback ) { - MagicMissile missile = ((MagicMissile)group.recycle( MagicMissile.class )); - missile.reset( from, to, callback ); - missile.size( 4 ); - missile.pour( RainbowParticle.BURST, 0.01f ); - } - - @Override - public void update() { - super.update(); - if (on) { - float d = Game.elapsed; - x += sx * d; - y += sy * d; - if ((time -= d) <= 0) { - on = false; - callback.call(); - } - } - } - - public static class MagicParticle extends PixelParticle { - - public static final Emitter.Factory FACTORY = new Factory() { - @Override - public void emit(Emitter emitter, int index, float x, float y) { - ((MagicParticle) emitter.recycle(MagicParticle.class)).reset(x, - y); - } - - @Override - public boolean lightMode() { - return true; - }; - }; - - public MagicParticle() { - super(); - - color(0x88CCFF); - lifespan = 0.5f; - - speed.set(Random.Float(-10, +10), Random.Float(-10, +10)); - } - - public void reset(float x, float y) { - revive(); - - this.x = x; - this.y = y; - - left = lifespan; - } - - @Override - public void update() { - super.update(); - // alpha: 1 -> 0; size: 1 -> 4 - size(4 - (am = left / lifespan) * 3); - } - } - - public static class EarthParticle extends PixelParticle.Shrinking { - - public static final Emitter.Factory FACTORY = new Factory() { - @Override - public void emit(Emitter emitter, int index, float x, float y) { - ((EarthParticle) emitter.recycle(EarthParticle.class)).reset(x, - y); - } - }; - - public EarthParticle() { - super(); - - lifespan = 0.5f; - - color(ColorMath.random(0x555555, 0x777766)); - - acc.set(0, +40); - } - - public void reset(float x, float y) { - revive(); - - this.x = x; - this.y = y; - - left = lifespan; - size = 4; - - speed.set(Random.Float(-10, +10), Random.Float(-10, +10)); - } - } - - public static class WhiteParticle extends PixelParticle { - - public static final Emitter.Factory FACTORY = new Factory() { - @Override - public void emit(Emitter emitter, int index, float x, float y) { - ((WhiteParticle) emitter.recycle(WhiteParticle.class)).reset(x, - y); - } - - @Override - public boolean lightMode() { - return true; - }; - }; - - public WhiteParticle() { - super(); - - lifespan = 0.4f; - - am = 0.5f; - } - - public void reset(float x, float y) { - revive(); - - this.x = x; - this.y = y; - - left = lifespan; - } - - @Override - public void update() { - super.update(); - // size: 3 -> 0 - size((left / lifespan) * 3); - } - } - - public static class SlowParticle extends PixelParticle { - - private Emitter emitter; - - public static final Emitter.Factory FACTORY = new Factory() { - @Override - public void emit(Emitter emitter, int index, float x, float y) { - ((SlowParticle) emitter.recycle(SlowParticle.class)).reset(x, - y, emitter); - } - - @Override - public boolean lightMode() { - return true; - }; - }; - - public SlowParticle() { - super(); - - lifespan = 0.6f; - - color(0x664422); - size(2); - } - - public void reset(float x, float y, Emitter emitter) { - revive(); - - this.x = x; - this.y = y; - this.emitter = emitter; - - left = lifespan; - - acc.set(0); - speed.set(Random.Float(-20, +20), Random.Float(-20, +20)); - } - - @Override - public void update() { - super.update(); - - am = left / lifespan; - acc.set((emitter.x - x) * 10, (emitter.y - y) * 10); - } - } - - public static class ForceParticle extends PixelParticle { - - public static final Emitter.Factory FACTORY = new Factory() { - @Override - public void emit(Emitter emitter, int index, float x, float y) { - ((ForceParticle) emitter.recycle(ForceParticle.class)).reset(x, - y); - } - }; - - public ForceParticle() { - super(); - - lifespan = 0.6f; - - size(4); - } - - public void reset(float x, float y) { - revive(); - - this.x = x; - this.y = y; - - left = lifespan; - - acc.set(0); - speed.set(Random.Float(-40, +40), Random.Float(-40, +40)); - } - - @Override - public void update() { - super.update(); - - am = (left / lifespan) / 2; - acc.set(-speed.x * 10, -speed.y * 10); - } - } - - public static class ColdParticle extends PixelParticle.Shrinking { - - public static final Emitter.Factory FACTORY = new Factory() { - @Override - public void emit(Emitter emitter, int index, float x, float y) { - ((ColdParticle) emitter.recycle(ColdParticle.class)) - .reset(x, y); - } - - @Override - public boolean lightMode() { - return true; - }; - }; - - public ColdParticle() { - super(); - - lifespan = 0.6f; - - color(0x2244FF); - } - - public void reset(float x, float y) { - revive(); - - this.x = x; - this.y = y; - - left = lifespan; - size = 8; - } - - @Override - public void update() { - super.update(); - - am = 1 - left / lifespan; - } - } -} diff --git a/java/com/hmdzl/spspd/change/effects/Pushing.java b/java/com/hmdzl/spspd/change/effects/Pushing.java deleted file mode 100644 index 61f84128..00000000 --- a/java/com/hmdzl/spspd/change/effects/Pushing.java +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.effects; - -import com.watabou.noosa.Game; -import com.watabou.noosa.Visual; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.watabou.utils.Callback; -import com.watabou.utils.PointF; - -public class Pushing extends Actor { - - private CharSprite sprite; - private int from; - private int to; - - private Effect effect; - - private Callback callback; - - public Pushing( Char ch, int from, int to ) { - sprite = ch.sprite; - this.from = from; - this.to = to; - this.callback = null; - } - - public Pushing( Char ch, int from, int to, Callback callback ) { - this(ch, from, to); - this.callback = callback; - } - - @Override - protected boolean act() { - if (sprite != null) { - - if (effect == null) { - new Effect(); - } - } - - Actor.remove( Pushing.this ); - - //so that all pushing effects at the same time go simultaneously - for ( Actor actor : Actor.all() ){ - if (actor instanceof Pushing && ((Pushing) actor).cooldown() == 0) - return true; - } - return false; - - } - - public class Effect extends Visual { - - private static final float DELAY = 0.15f; - - private PointF end; - - private float delay; - - public Effect() { - super( 0, 0, 0, 0 ); - - point( sprite.worldToCamera( from ) ); - end = sprite.worldToCamera( to ); - - speed.set( 2 * (end.x - x) / DELAY, 2 * (end.y - y) / DELAY ); - acc.set( -speed.x / DELAY, -speed.y / DELAY ); - - delay = 0; - - if (sprite.parent != null) - sprite.parent.add( this ); - } - - @Override - public void update() { - super.update(); - - if ((delay += Game.elapsed) < DELAY) { - - sprite.x = x; - sprite.y = y; - - } else { - - sprite.point(end); - - killAndErase(); - Actor.remove(Pushing.this); - if (callback != null) callback.call(); - - next(); - } - } - } - -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/effects/Ripple.java b/java/com/hmdzl/spspd/change/effects/Ripple.java deleted file mode 100644 index 01398bb3..00000000 --- a/java/com/hmdzl/spspd/change/effects/Ripple.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.effects; - -import com.hmdzl.spspd.change.DungeonTilemap; -import com.hmdzl.spspd.change.levels.Level; -import com.watabou.noosa.Game; -import com.watabou.noosa.Image; - -public class Ripple extends Image { - - private static final float TIME_TO_FADE = 0.5f; - - private float time; - - public Ripple() { - super(Effects.get(Effects.Type.RIPPLE)); - } - - public void reset(int p) { - revive(); - - x = (p % Level.getWidth()) * DungeonTilemap.SIZE; - y = (p / Level.getWidth()) * DungeonTilemap.SIZE; - - origin.set(width / 2, height / 2); - scale.set(0); - - time = TIME_TO_FADE; - } - - @Override - public void update() { - super.update(); - - if ((time -= Game.elapsed) <= 0) { - kill(); - } else { - float p = time / TIME_TO_FADE; - scale.set(1 - p); - alpha(p); - } - } -} diff --git a/java/com/hmdzl/spspd/change/effects/ShadowBox.java b/java/com/hmdzl/spspd/change/effects/ShadowBox.java deleted file mode 100644 index 6e405c41..00000000 --- a/java/com/hmdzl/spspd/change/effects/ShadowBox.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.effects; - -import com.hmdzl.spspd.change.Assets; -import com.watabou.glwrap.Texture; -import com.watabou.noosa.NinePatch; - -public class ShadowBox extends NinePatch { - - public static final float SIZE = 16; - - public ShadowBox() { - super(Assets.SHADOW, 1); - - texture.filter(Texture.LINEAR, Texture.LINEAR); - - scale.set(SIZE, SIZE); - } - - @Override - public void size(float width, float height) { - super.size(width / SIZE, height / SIZE); - } - - public void boxRect(float x, float y, float width, float height) { - this.x = x - SIZE; - this.y = y - SIZE; - size(width + SIZE * 2, height + SIZE * 2); - } -} diff --git a/java/com/hmdzl/spspd/change/effects/ShieldHalo.java b/java/com/hmdzl/spspd/change/effects/ShieldHalo.java deleted file mode 100644 index 22364a2c..00000000 --- a/java/com/hmdzl/spspd/change/effects/ShieldHalo.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * Shattered Pixel Dungeon - * Copyright (C) 2014-2019 Evan Debenham - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ - -package com.hmdzl.spspd.change.effects; - -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.watabou.glwrap.Blending; -import com.watabou.noosa.Game; -import com.watabou.noosa.Halo; -import com.watabou.utils.PointF; - -public class ShieldHalo extends Halo { - - private CharSprite target; - - private float phase; - - public ShieldHalo( CharSprite sprite ) { - - //rectangular sprite to circular radius. Pythagorean theorem - super( (float)Math.sqrt(Math.pow(sprite.width()/2f, 2) + Math.pow(sprite.height()/2f, 2)), 0xBBAACC, 1f ); - - am = -0.33f; - aa = +0.33f; - - target = sprite; - - phase = 1; - } - - @Override - public void update() { - super.update(); - - if (phase < 1) { - if ((phase -= Game.elapsed) <= 0) { - killAndErase(); - } else { - scale.set( (2 - phase) * radius / RADIUS ); - am = phase * (-1); - aa = phase * (+1); - } - } - - if (visible = target.visible) { - PointF p = target.center(); - point( p.x, p.y ); - } - } - - @Override - public void draw() { - Blending.setLightMode(); - super.draw(); - Blending.setNormalMode(); - } - - public void putOut() { - phase = 0.999f; - } - -} diff --git a/java/com/hmdzl/spspd/change/effects/Speck.java b/java/com/hmdzl/spspd/change/effects/Speck.java deleted file mode 100644 index 210bbb9a..00000000 --- a/java/com/hmdzl/spspd/change/effects/Speck.java +++ /dev/null @@ -1,521 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.effects; - -import android.annotation.SuppressLint; -import android.util.FloatMath; -import android.util.SparseArray; - -import com.hmdzl.spspd.change.Assets; -import com.watabou.noosa.Game; -import com.watabou.noosa.Image; -import com.watabou.noosa.TextureFilm; -import com.watabou.noosa.particles.Emitter; -import com.watabou.utils.ColorMath; -import com.watabou.utils.PointF; -import com.watabou.utils.Random; - -public class Speck extends Image { - - public static final int HEALING = 0; - public static final int STAR = 1; - public static final int LIGHT = 2; - public static final int QUESTION = 3; - public static final int UP = 4; - public static final int SCREAM = 5; - public static final int BONE = 6; - public static final int WOOL = 7; - public static final int ROCK = 8; - public static final int NOTE = 9; - public static final int CHANGE = 10; - public static final int HEART = 11; - public static final int BUBBLE = 12; - public static final int STEAM = 13; - public static final int COIN = 14; - public static final int COBWEB = 15; - - public static final int DISCOVER = 101; - public static final int EVOKE = 102; - public static final int MASTERY = 103; - public static final int KIT = 104; - public static final int RATTLE = 105; - public static final int JET = 106; - public static final int TOXIC = 107; - public static final int PARALYSIS = 108; - public static final int DUST = 109; - public static final int STENCH = 110; - public static final int FORGE = 111; - public static final int CONFUSION = 112; - public static final int FROST = 113; - public static final int TARGAS = 114; - public static final int DARKNESS = 115; - public static final int CORRUPT = 116; - public static final int VENOM = 117; - - private static final int SIZE = 7; - - private int type; - private float lifespan; - private float left; - - private static TextureFilm film; - - private static SparseArray factories = new SparseArray(); - - public Speck() { - super(); - - texture(Assets.SPECKS); - if (film == null) { - film = new TextureFilm(texture, SIZE, SIZE); - } - - origin.set(SIZE / 2f); - } - - public void reset(int index, float x, float y, int type) { - revive(); - - this.type = type; - switch (type) { - case DISCOVER: - frame(film.get(LIGHT)); - break; - case EVOKE: - case MASTERY: - case KIT: - case FORGE: - frame(film.get(STAR)); - break; - case RATTLE: - frame(film.get(BONE)); - break; - case JET: - case TOXIC: - case PARALYSIS: - case STENCH: - case CONFUSION: - case DUST: - case CORRUPT: - case FROST: - case TARGAS: - case DARKNESS: - case VENOM: - frame(film.get(STEAM)); - break; - default: - frame(film.get(type)); - } - - this.x = x - origin.x; - this.y = y - origin.y; - - resetColor(); - scale.set(1); - speed.set(0); - acc.set(0); - angle = 0; - angularSpeed = 0; - - switch (type) { - - case HEALING: - speed.set(0, -20); - lifespan = 1f; - break; - - case STAR: - speed.polar(Random.Float(2 * 3.1415926f), Random.Float(128)); - acc.set(0, 128); - angle = Random.Float(360); - angularSpeed = Random.Float(-360, +360); - lifespan = 1f; - break; - - case FORGE: - speed.polar(Random.Float(-3.1415926f), Random.Float(64)); - acc.set(0, 128); - angle = Random.Float(360); - angularSpeed = Random.Float(-360, +360); - lifespan = 0.51f; - break; - - case EVOKE: - speed.polar(Random.Float(-3.1415926f), 50); - acc.set(0, 50); - angle = Random.Float(360); - angularSpeed = Random.Float(-180, +180); - lifespan = 1f; - break; - - case KIT: - speed.polar(index * 3.1415926f / 5, 50); - acc.set(-speed.x, -speed.y); - angle = index * 36; - angularSpeed = 360; - lifespan = 1f; - break; - - case MASTERY: - speed.set( - Random.Int(2) == 0 ? Random.Float(-128, -64) : Random - .Float(+64, +128), 0); - angularSpeed = speed.x < 0 ? -180 : +180; - acc.set(-speed.x, 0); - lifespan = 0.5f; - break; - - case LIGHT: - angle = Random.Float(360); - angularSpeed = 90; - lifespan = 1f; - break; - - case DISCOVER: - angle = Random.Float(360); - angularSpeed = 90; - lifespan = 0.5f; - am = 0; - break; - - case QUESTION: - lifespan = 0.8f; - break; - - case UP: - speed.set(0, -20); - lifespan = 1f; - break; - - case SCREAM: - lifespan = 0.9f; - break; - - case BONE: - lifespan = 0.2f; - speed.polar(Random.Float(2 * 3.1415926f), 24 / lifespan); - acc.set(0, 128); - angle = Random.Float(360); - angularSpeed = 360; - break; - - case RATTLE: - lifespan = 0.5f; - speed.set(0, -200); - acc.set(0, -2 * speed.y / lifespan); - angle = Random.Float(360); - angularSpeed = 360; - break; - - case WOOL: - lifespan = 0.5f; - speed.set(0, -50); - angle = Random.Float(360); - angularSpeed = Random.Float(-360, +360); - break; - - case ROCK: - angle = Random.Float(360); - angularSpeed = Random.Float(-360, +360); - scale.set(Random.Float(1, 2)); - speed.set(0, 64); - lifespan = 0.2f; - y -= speed.y * lifespan; - break; - - case NOTE: - angularSpeed = Random.Float(-30, +30); - speed.polar((angularSpeed - 90) * PointF.G2R, 30); - lifespan = 1f; - break; - - case CHANGE: - angle = Random.Float(360); - speed.polar((angle - 90) * PointF.G2R, Random.Float(4, 12)); - lifespan = 1.5f; - break; - - case HEART: - speed.set(Random.Int(-10, +10), -40); - angularSpeed = Random.Float(-45, +45); - lifespan = 1f; - break; - - case BUBBLE: - speed.set(0, -15); - scale.set(Random.Float(0.8f, 1)); - lifespan = Random.Float(0.8f, 1.5f); - break; - - case STEAM: - speed.y = -Random.Float(20, 30); - angularSpeed = Random.Float(+180); - angle = Random.Float(360); - lifespan = 1f; - break; - - case JET: - speed.y = +32; - acc.y = -64; - angularSpeed = Random.Float(180, 360); - angle = Random.Float(360); - lifespan = 0.5f; - break; - - case TOXIC: - hardlight(0x50FF60); - angularSpeed = 30; - angle = Random.Float(360); - lifespan = Random.Float(1f, 3f); - break; - - case CORRUPT: - hardlight(0xFF0000); - angularSpeed = 30; - angle = Random.Float(360); - lifespan = Random.Float(1f, 3f); - break; - - case VENOM: - hardlight( 0x8844FF ); - angularSpeed = 30; - angle = Random.Float( 360 ); - lifespan = Random.Float( 1f, 3f ); - break; - - case FROST: - hardlight(0x99FFFF); - angularSpeed = 30; - angle = Random.Float(360); - lifespan = Random.Float(1f, 3f); - break; - - case TARGAS: - hardlight(0x996600); - angularSpeed = 30; - angle = Random.Float(360); - lifespan = Random.Float(1f, 3f); - break; - - case DARKNESS: - hardlight(0x22); - angularSpeed = 30; - angle = Random.Float(360); - lifespan = Random.Float(1f, 3f); - break; - - case PARALYSIS: - hardlight(0xFFFF66); - angularSpeed = -30; - angle = Random.Float(360); - lifespan = Random.Float(1f, 3f); - break; - - case STENCH: - hardlight(0x003300); - angularSpeed = -30; - angle = Random.Float(360); - lifespan = Random.Float(1f, 3f); - break; - - case CONFUSION: - hardlight(Random.Int(0x1000000) | 0x000080); - angularSpeed = Random.Float(-20, +20); - angle = Random.Float(360); - lifespan = Random.Float(1f, 3f); - break; - - case DUST: - hardlight(0xFFFF66); - angle = Random.Float(360); - speed.polar(Random.Float(2 * 3.1415926f), Random.Float(16, 48)); - lifespan = 0.5f; - break; - - case COIN: - speed.polar(-PointF.PI * Random.Float(0.3f, 0.7f), - Random.Float(48, 96)); - acc.y = 256; - lifespan = -speed.y / acc.y * 2; - break; - - case COBWEB: - angularSpeed = 0; - angle = Random.Float(360); - lifespan = Random.Float(1f, 3f); - break; - } - - left = lifespan; - } - - @SuppressLint("FloatMath") - @Override - public void update() { - super.update(); - - left -= Game.elapsed; - if (left <= 0) { - - kill(); - - } else { - - float p = 1 - left / lifespan; // 0 -> 1 - - switch (type) { - - case STAR: - case FORGE: - scale.set(1 - p); - am = p < 0.2f ? p * 5f : (1 - p) * 1.25f; - break; - - case KIT: - case MASTERY: - am = 1 - p * p; - break; - - case EVOKE: - - case HEALING: - am = p < 0.5f ? 1 : 2 - p * 2; - break; - - case LIGHT: - am = scale.set(p < 0.2f ? p * 5f : (1 - p) * 1.25f).x; - break; - - case DISCOVER: - am = 1 - p; - scale.set((p < 0.5f ? p : 1 - p) * 2); - break; - - case QUESTION: - scale.set((float) (Math.sqrt(p < 0.5f ? p : 1 - p) * 3)); - break; - - case UP: - scale.set((float) (Math.sqrt(p < 0.5f ? p : 1 - p) * 2)); - break; - - case SCREAM: - am = (float) Math.sqrt((p < 0.5f ? p : 1 - p) * 2f); - scale.set(p * 7); - break; - - case BONE: - case RATTLE: - am = p < 0.9f ? 1 : (1 - p) * 10; - break; - - case ROCK: - am = p < 0.2f ? p * 5 : 1; - break; - - case NOTE: - am = 1 - p * p; - break; - - case WOOL: - scale.set(1 - p); - break; - - case CHANGE: - am = (float)Math.sqrt((p < 0.5f ? p : 1 - p) * 2); - scale.y = (1 + p) * 0.5f; - scale.x = scale.y * (float)Math.cos(left * 15); - break; - - case HEART: - scale.set(1 - p); - am = 1 - p * p; - break; - - case BUBBLE: - am = p < 0.2f ? p * 5 : 1; - break; - - case STEAM: - case TOXIC: - case PARALYSIS: - case CONFUSION: - case CORRUPT: - case FROST: - case TARGAS: - case DARKNESS: - case DUST: - am = p < 0.5f ? p : 1 - p; - scale.set(1 + p * 2); - break; - - case VENOM: - hardlight( ColorMath.interpolate( 0x8844FF, 0x00FF00 , p )); - - case STENCH: - am = (p < 0.5f ? p : 1 - p) * 2; - scale.set(1 + p * 2); - break; - - case COBWEB: - am = p < 0.5f ? p : 1 - p; - scale.set( 1 + p ); - break; - - case JET: - am = (p < 0.5f ? p : 1 - p) * 2; - scale.set(p * 1.5f); - break; - - case COIN: - scale.x = (float)Math.cos(left * 5); - rm = gm = bm = (Math.abs(scale.x) + 1) * 0.5f; - am = p < 0.9f ? 1 : (1 - p) * 10; - break; - } - } - } - - public static Emitter.Factory factory(final int type) { - return factory(type, false); - } - - public static Emitter.Factory factory(final int type, - final boolean lightMode) { - - Emitter.Factory factory = factories.get(type); - - if (factory == null) { - factory = new Emitter.Factory() { - @Override - public void emit(Emitter emitter, int index, float x, float y) { - Speck p = (Speck) emitter.recycle(Speck.class); - p.reset(index, x, y, type); - } - - @Override - public boolean lightMode() { - return lightMode; - } - }; - factories.put(type, factory); - } - - return factory; - } -} diff --git a/java/com/hmdzl/spspd/change/effects/SpellSprite.java b/java/com/hmdzl/spspd/change/effects/SpellSprite.java deleted file mode 100644 index 02a68d0c..00000000 --- a/java/com/hmdzl/spspd/change/effects/SpellSprite.java +++ /dev/null @@ -1,135 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.effects; - -import java.util.HashMap; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.watabou.noosa.Game; -import com.watabou.noosa.Image; -import com.watabou.noosa.TextureFilm; - -public class SpellSprite extends Image { - - public static final int FOOD = 0; - public static final int MAP = 1; - public static final int CHARGE = 2; - public static final int MASTERY = 3; - - private static final int SIZE = 16; - - private enum Phase { - FADE_IN, STATIC, FADE_OUT - }; - - private static final float FADE_IN_TIME = 0.2f; - private static final float STATIC_TIME = 0.8f; - private static final float FADE_OUT_TIME = 0.4f; - - private static TextureFilm film; - - private Char target; - - private Phase phase; - private float duration; - private float passed; - - private static HashMap all = new HashMap(); - - public SpellSprite() { - super(Assets.SPELL_ICONS); - - if (film == null) { - film = new TextureFilm(texture, SIZE); - } - } - - public void reset(int index) { - frame(film.get(index)); - origin.set(width / 2, height / 2); - - phase = Phase.FADE_IN; - - duration = FADE_IN_TIME; - passed = 0; - } - - @Override - public void update() { - super.update(); - - x = target.sprite.center().x - SIZE / 2; - y = target.sprite.y - SIZE; - - switch (phase) { - case FADE_IN: - alpha(passed / duration); - scale.set(passed / duration); - break; - case STATIC: - break; - case FADE_OUT: - alpha(1 - passed / duration); - break; - } - - if ((passed += Game.elapsed) > duration) { - switch (phase) { - case FADE_IN: - phase = Phase.STATIC; - duration = STATIC_TIME; - break; - case STATIC: - phase = Phase.FADE_OUT; - duration = FADE_OUT_TIME; - break; - case FADE_OUT: - kill(); - break; - } - - passed = 0; - } - } - - @Override - public void kill() { - super.kill(); - all.remove(target); - } - - public static void show(Char ch, int index) { - - if (!ch.sprite.visible) { - return; - } - - SpellSprite old = all.get(ch); - if (old != null) { - old.kill(); - } - - SpellSprite sprite = GameScene.spellSprite(); - sprite.revive(); - sprite.reset(index); - sprite.target = ch; - all.put(ch, sprite); - } -} diff --git a/java/com/hmdzl/spspd/change/effects/Splash.java b/java/com/hmdzl/spspd/change/effects/Splash.java deleted file mode 100644 index a6fdd5e7..00000000 --- a/java/com/hmdzl/spspd/change/effects/Splash.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.effects; - -import com.hmdzl.spspd.change.DungeonTilemap; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.watabou.noosa.particles.Emitter; -import com.watabou.noosa.particles.PixelParticle; -import com.watabou.utils.PointF; -import com.watabou.utils.Random; - -public class Splash { - - public static void at(int cell, final int color, int n) { - at(DungeonTilemap.tileCenterToWorld(cell), color, n); - } - - public static void at(PointF p, final int color, int n) { - - if (n <= 0) { - return; - } - - Emitter emitter = GameScene.emitter(); - emitter.pos(p); - - FACTORY.color = color; - FACTORY.dir = -3.1415926f / 2; - FACTORY.cone = 3.1415926f; - emitter.burst(FACTORY, n); - } - - public static void at(PointF p, final float dir, final float cone, - final int color, int n) { - - if (n <= 0) { - return; - } - - Emitter emitter = GameScene.emitter(); - emitter.pos(p); - - FACTORY.color = color; - FACTORY.dir = dir; - FACTORY.cone = cone; - emitter.burst(FACTORY, n); - } - - private static final SplashFactory FACTORY = new SplashFactory(); - - private static class SplashFactory extends Emitter.Factory { - - public int color; - public float dir; - public float cone; - - @Override - public void emit(Emitter emitter, int index, float x, float y) { - PixelParticle p = (PixelParticle) emitter - .recycle(PixelParticle.Shrinking.class); - - p.reset(x, y, color, 4, Random.Float(0.5f, 1.0f)); - p.speed.polar(Random.Float(dir - cone / 2, dir + cone / 2), - Random.Float(40, 80)); - p.acc.set(0, +100); - } - } -} diff --git a/java/com/hmdzl/spspd/change/effects/Surprise.java b/java/com/hmdzl/spspd/change/effects/Surprise.java deleted file mode 100644 index 78ed5d3d..00000000 --- a/java/com/hmdzl/spspd/change/effects/Surprise.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.effects; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.DungeonTilemap; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.levels.Level; -import com.watabou.noosa.Game; -import com.watabou.noosa.Group; -import com.watabou.noosa.Image; - -public class Surprise extends Image { - - -private static final float TIME_TO_FADE = 0.8f; - - private float time; - - public Surprise() { - super(Effects.get(Effects.Type.EXCLAMATION)); - origin.set(width / 2, height / 2); - } - - public void reset(int p) { - revive(); - - x = (p % Level.getWidth()) * DungeonTilemap.SIZE + (DungeonTilemap.SIZE - width) / 2; - y = (p / Level.getWidth()) * DungeonTilemap.SIZE + (DungeonTilemap.SIZE - height) / 2; - - time = TIME_TO_FADE; - } - - @Override - public void update() { - super.update(); - - if ((time -= Game.elapsed) <= 0) { - kill(); - } else { - float p = time / TIME_TO_FADE; - alpha(p); - scale.y = 1 + p/2; - } - } - - public static void hit(Char ch) { - hit(ch, 0); - } - - public static void hit(Char ch, float angle) { - if (ch.sprite.parent != null) { - Surprise s = (Surprise) ch.sprite.parent.recycle(Surprise.class); - ch.sprite.parent.bringToFront(s); - s.reset(ch.pos); - s.angle = angle; - } - } - - public static void hit(int pos) { - hit(pos, 0); - } - - public static void hit(int pos, float angle) { - Group parent = Dungeon.hero.sprite.parent; - Wound w = (Wound) parent.recycle(Wound.class); - parent.bringToFront(w); - w.reset(pos); - w.angle = angle; - } -} diff --git a/java/com/hmdzl/spspd/change/effects/TorchHalo.java b/java/com/hmdzl/spspd/change/effects/TorchHalo.java deleted file mode 100644 index accecd95..00000000 --- a/java/com/hmdzl/spspd/change/effects/TorchHalo.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.effects; - -import javax.microedition.khronos.opengles.GL10; - -import android.opengl.GLES20; - -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.watabou.noosa.Game; - -public class TorchHalo extends Halo { - - private CharSprite target; - - private float phase = 0; - - public TorchHalo(CharSprite sprite) { - super(24, 0xFFDDCC, 0.15f); - target = sprite; - am = 0; - } - - @Override - public void update() { - super.update(); - - if (phase < 0) { - if ((phase += Game.elapsed) >= 0) { - killAndErase(); - } else { - scale.set((2 + phase) * radius / RADIUS); - am = -phase * brightness; - } - } else if (phase < 1) { - if ((phase += Game.elapsed) >= 1) { - phase = 1; - } - scale.set(phase * radius / RADIUS); - am = phase * brightness; - } - - point(target.x + target.width / 2, target.y + target.height / 2); - } - - @Override - public void draw() { - GLES20.glBlendFunc(GL10.GL_SRC_ALPHA, GL10.GL_ONE); - super.draw(); - GLES20.glBlendFunc(GL10.GL_SRC_ALPHA, GL10.GL_ONE_MINUS_SRC_ALPHA); - } - - public void putOut() { - phase = -1; - } -} diff --git a/java/com/hmdzl/spspd/change/effects/Wound.java b/java/com/hmdzl/spspd/change/effects/Wound.java deleted file mode 100644 index aadc894e..00000000 --- a/java/com/hmdzl/spspd/change/effects/Wound.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.effects; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.DungeonTilemap; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.levels.Level; -import com.watabou.noosa.Game; -import com.watabou.noosa.Group; -import com.watabou.noosa.Image; - -public class Wound extends Image { - - private static final float TIME_TO_FADE = 0.8f; - - private float time; - - public Wound() { - super(Effects.get(Effects.Type.WOUND)); - origin.set(width / 2, height / 2); - } - - public void reset(int p) { - revive(); - - x = (p % Level.getWidth()) * DungeonTilemap.SIZE - + (DungeonTilemap.SIZE - width) / 2; - y = (p / Level.getWidth()) * DungeonTilemap.SIZE - + (DungeonTilemap.SIZE - height) / 2; - - time = TIME_TO_FADE; - } - - @Override - public void update() { - super.update(); - - if ((time -= Game.elapsed) <= 0) { - kill(); - } else { - float p = time / TIME_TO_FADE; - alpha(p); - scale.x = 1 + p; - } - } - - public static void hit(Char ch) { - hit(ch, 0); - } - - public static void hit(Char ch, float angle) { - if (ch.sprite.parent != null) { - Wound w = (Wound) ch.sprite.parent.recycle(Wound.class); - ch.sprite.parent.bringToFront(w); - w.reset(ch.pos); - w.angle = angle; - } - } - - public static void hit(int pos) { - hit(pos, 0); - } - - public static void hit(int pos, float angle) { - Group parent = Dungeon.hero.sprite.parent; - Wound w = (Wound) parent.recycle(Wound.class); - parent.bringToFront(w); - w.reset(pos); - w.angle = angle; - } -} diff --git a/java/com/hmdzl/spspd/change/effects/particles/BlastParticle.java b/java/com/hmdzl/spspd/change/effects/particles/BlastParticle.java deleted file mode 100644 index d209f1c6..00000000 --- a/java/com/hmdzl/spspd/change/effects/particles/BlastParticle.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.effects.particles; - -import com.watabou.noosa.particles.Emitter; -import com.watabou.noosa.particles.Emitter.Factory; -import com.watabou.noosa.particles.PixelParticle; -import com.watabou.utils.Random; - -public class BlastParticle extends PixelParticle.Shrinking { - - public static final Factory FACTORY = new Factory() { - @Override - public void emit(Emitter emitter, int index, float x, float y) { - ((BlastParticle) emitter.recycle(BlastParticle.class)).reset(x, y); - } - - @Override - public boolean lightMode() { - return true; - }; - }; - - public BlastParticle() { - super(); - - color(0xEE7722); - acc.set(0, +50); - } - - public void reset(float x, float y) { - revive(); - - this.x = x; - this.y = y; - - left = lifespan = Random.Float(); - - size = 8; - speed.polar(-Random.Float(3.1415926f), Random.Float(32, 64)); - } - - @Override - public void update() { - super.update(); - am = left > 0.8f ? (1 - left) * 5 : 1; - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/effects/particles/BloodParticle.java b/java/com/hmdzl/spspd/change/effects/particles/BloodParticle.java deleted file mode 100644 index f17a6f5b..00000000 --- a/java/com/hmdzl/spspd/change/effects/particles/BloodParticle.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.effects.particles; - -import com.watabou.noosa.particles.Emitter; -import com.watabou.noosa.particles.Emitter.Factory; -import com.watabou.noosa.particles.PixelParticle; - -public class BloodParticle extends PixelParticle.Shrinking { - - public static final Emitter.Factory FACTORY = new Factory() { - @Override - public void emit(Emitter emitter, int index, float x, float y) { - ((BloodParticle) emitter.recycle(BloodParticle.class)).reset(x, y); - } - }; - - public BloodParticle() { - super(); - - color(0xFFFFFF); - lifespan = 0.8f; - - acc.set(0, +40); - } - - public void reset(float x, float y) { - revive(); - - this.x = x; - this.y = y; - - left = lifespan; - - size = 4; - speed.set(0); - } - - @Override - public void update() { - super.update(); - float p = left / lifespan; - am = p > 0.6f ? (1 - p) * 2.5f : 1; - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/effects/particles/DeadParticle.java b/java/com/hmdzl/spspd/change/effects/particles/DeadParticle.java deleted file mode 100644 index 45ebbab2..00000000 --- a/java/com/hmdzl/spspd/change/effects/particles/DeadParticle.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * Yet Another Pixel Dungeon - * Copyright (C) 2015-2016 Considered Hamster - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.effects.particles; - -import com.watabou.noosa.particles.Emitter; -import com.watabou.noosa.particles.Emitter.Factory; -import com.watabou.noosa.particles.PixelParticle; -import com.watabou.utils.Random; - -public class DeadParticle extends PixelParticle { - - public static final Factory FACTORY = new Factory() { - @Override - public void emit( Emitter emitter, int index, float x, float y ) { - ((DeadParticle)emitter.recycle( DeadParticle.class )).reset( x, y ); - } - @Override - public boolean lightMode() { - return true; - } - }; - - public DeadParticle() { - super(); - color(0x222222); - lifespan = 1f; - speed.set( 0, 8 ); - } - - private float offs; - - public void reset( float x, float y ) { - revive(); - - this.x = x; - this.y = y; - - offs = -Random.Float( lifespan ); - left = lifespan - offs; - } - - @Override - public void update() { - super.update(); - - float p = left / lifespan; - am = p < 0.5f ? p : 1 - p; - scale.x = (1 - p) * 2; - scale.y = 16 + (1 - p) * 16; - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/effects/particles/EarthParticle.java b/java/com/hmdzl/spspd/change/effects/particles/EarthParticle.java deleted file mode 100644 index 243cdb7e..00000000 --- a/java/com/hmdzl/spspd/change/effects/particles/EarthParticle.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.effects.particles; - -import com.watabou.noosa.particles.Emitter; -import com.watabou.noosa.particles.Emitter.Factory; -import com.watabou.noosa.particles.PixelParticle; -import com.watabou.utils.ColorMath; -import com.watabou.utils.Random; - -public class EarthParticle extends PixelParticle { - - public static final Emitter.Factory FACTORY = new Factory() { - @Override - public void emit(Emitter emitter, int index, float x, float y) { - ((EarthParticle) emitter.recycle(EarthParticle.class)).reset(x, y); - } - }; - - public EarthParticle() { - super(); - - color(ColorMath.random(0x444444, 0x777766)); - angle = Random.Float(-30, 30); - - lifespan = 0.5f; - } - - public void reset(float x, float y) { - revive(); - - this.x = x; - this.y = y; - - left = lifespan; - } - - @Override - public void update() { - super.update(); - - float p = left / lifespan; - size((p < 0.5f ? p : 1 - p) * 16); - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/effects/particles/ElmoParticle.java b/java/com/hmdzl/spspd/change/effects/particles/ElmoParticle.java deleted file mode 100644 index b0881238..00000000 --- a/java/com/hmdzl/spspd/change/effects/particles/ElmoParticle.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.effects.particles; - -import com.watabou.noosa.particles.Emitter; -import com.watabou.noosa.particles.Emitter.Factory; -import com.watabou.noosa.particles.PixelParticle; - -public class ElmoParticle extends PixelParticle.Shrinking { - - public static final Emitter.Factory FACTORY = new Factory() { - @Override - public void emit(Emitter emitter, int index, float x, float y) { - ((ElmoParticle) emitter.recycle(ElmoParticle.class)).reset(x, y); - } - - @Override - public boolean lightMode() { - return true; - }; - }; - - public ElmoParticle() { - super(); - - color(0x22EE66); - lifespan = 0.6f; - - acc.set(0, -80); - } - - public void reset(float x, float y) { - revive(); - - this.x = x; - this.y = y; - - left = lifespan; - - size = 4; - speed.set(0); - } - - @Override - public void update() { - super.update(); - float p = left / lifespan; - am = p > 0.8f ? (1 - p) * 5 : 1; - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/effects/particles/EnergyParticle.java b/java/com/hmdzl/spspd/change/effects/particles/EnergyParticle.java deleted file mode 100644 index 1d47c5b3..00000000 --- a/java/com/hmdzl/spspd/change/effects/particles/EnergyParticle.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.effects.particles; - -import com.watabou.noosa.particles.Emitter; -import com.watabou.noosa.particles.Emitter.Factory; -import com.watabou.noosa.particles.PixelParticle; -import com.watabou.utils.PointF; -import com.watabou.utils.Random; - -public class EnergyParticle extends PixelParticle { - - public static final Emitter.Factory FACTORY = new Factory() { - @Override - public void emit(Emitter emitter, int index, float x, float y) { - ((EnergyParticle) emitter.recycle(EnergyParticle.class)) - .reset(x, y); - } - - @Override - public boolean lightMode() { - return true; - }; - }; - - public EnergyParticle() { - super(); - - lifespan = 1f; - color(0xFFFFAA); - - speed.polar(Random.Float(PointF.PI2), Random.Float(24, 32)); - } - - public void reset(float x, float y) { - revive(); - - left = lifespan; - - this.x = x - speed.x * lifespan; - this.y = y - speed.y * lifespan; - } - - @Override - public void update() { - super.update(); - - float p = left / lifespan; - am = p < 0.5f ? p * p * 4 : (1 - p) * 2; - size(Random.Float(5 * left / lifespan)); - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/effects/particles/FlameParticle.java b/java/com/hmdzl/spspd/change/effects/particles/FlameParticle.java deleted file mode 100644 index fd390e0f..00000000 --- a/java/com/hmdzl/spspd/change/effects/particles/FlameParticle.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.effects.particles; - -import com.watabou.noosa.particles.Emitter; -import com.watabou.noosa.particles.Emitter.Factory; -import com.watabou.noosa.particles.PixelParticle; - -public class FlameParticle extends PixelParticle.Shrinking { - - public static final Emitter.Factory FACTORY = new Factory() { - @Override - public void emit(Emitter emitter, int index, float x, float y) { - ((FlameParticle) emitter.recycle(FlameParticle.class)).reset(x, y); - } - - @Override - public boolean lightMode() { - return true; - }; - }; - - public FlameParticle() { - super(); - - color(0xEE7722); - lifespan = 0.6f; - - acc.set(0, -80); - } - - public void reset(float x, float y) { - revive(); - - this.x = x; - this.y = y; - - left = lifespan; - - size = 4; - speed.set(0); - } - - @Override - public void update() { - super.update(); - float p = left / lifespan; - am = p > 0.8f ? (1 - p) * 5 : 1; - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/effects/particles/FlowParticle.java b/java/com/hmdzl/spspd/change/effects/particles/FlowParticle.java deleted file mode 100644 index 13330146..00000000 --- a/java/com/hmdzl/spspd/change/effects/particles/FlowParticle.java +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.effects.particles; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.DungeonTilemap; -import com.watabou.noosa.Game; -import com.watabou.noosa.Group; -import com.watabou.noosa.particles.Emitter; -import com.watabou.noosa.particles.Emitter.Factory; -import com.watabou.noosa.particles.PixelParticle; -import com.watabou.utils.PointF; -import com.watabou.utils.Random; - -public class FlowParticle extends PixelParticle { - - public static final Emitter.Factory FACTORY = new Factory() { - @Override - public void emit(Emitter emitter, int index, float x, float y) { - ((FlowParticle) emitter.recycle(FlowParticle.class)).reset(x, y); - } - }; - - public FlowParticle() { - super(); - - lifespan = 0.6f; - acc.set(0, 32); - angularSpeed = Random.Float(-360, +360); - } - - public void reset(float x, float y) { - revive(); - - left = lifespan; - - this.x = x; - this.y = y; - - am = 0; - size(0); - speed.set(0); - } - - @Override - public void update() { - super.update(); - - float p = left / lifespan; - am = (p < 0.5f ? p : 1 - p) * 0.6f; - size((1 - p) * 4); - } - - public static class Flow extends Group { - - private static final float DELAY = 0.1f; - - private int pos; - - private float x; - private float y; - - private float delay; - - public Flow(int pos) { - super(); - - this.pos = pos; - - PointF p = DungeonTilemap.tileToWorld(pos); - x = p.x; - y = p.y + DungeonTilemap.SIZE - 1; - - delay = Random.Float(DELAY); - } - - @Override - public void update() { - - if (visible = Dungeon.visible[pos]) { - - super.update(); - - if ((delay -= Game.elapsed) <= 0) { - - delay = Random.Float(DELAY); - - ((FlowParticle) recycle(FlowParticle.class)).reset(x - + Random.Float(DungeonTilemap.SIZE), y); - } - } - } - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/effects/particles/LeafParticle.java b/java/com/hmdzl/spspd/change/effects/particles/LeafParticle.java deleted file mode 100644 index 8a1c417e..00000000 --- a/java/com/hmdzl/spspd/change/effects/particles/LeafParticle.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.effects.particles; - -import com.hmdzl.spspd.change.Dungeon; -import com.watabou.noosa.particles.Emitter; -import com.watabou.noosa.particles.Emitter.Factory; -import com.watabou.noosa.particles.PixelParticle; -import com.watabou.utils.ColorMath; -import com.watabou.utils.Random; - -public class LeafParticle extends PixelParticle.Shrinking { - - public static int color1; - public static int color2; - - public static final Emitter.Factory GENERAL = new Factory() { - @Override - public void emit(Emitter emitter, int index, float x, float y) { - LeafParticle p = ((LeafParticle) emitter - .recycle(LeafParticle.class)); - p.color(ColorMath.random(0x004400, 0x88CC44)); - p.reset(x, y); - } - }; - - public static final Emitter.Factory LEVEL_SPECIFIC = new Factory() { - @Override - public void emit(Emitter emitter, int index, float x, float y) { - LeafParticle p = ((LeafParticle) emitter - .recycle(LeafParticle.class)); - p.color(ColorMath - .random(Dungeon.level.color1, Dungeon.level.color2)); - p.reset(x, y); - } - }; - - public LeafParticle() { - super(); - - lifespan = 1.2f; - acc.set(0, 25); - } - - public void reset(float x, float y) { - revive(); - - this.x = x; - this.y = y; - - speed.set(Random.Float(-8, +8), -20); - - left = lifespan; - size = Random.Float(2, 3); - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/effects/particles/MemoryParticle.java b/java/com/hmdzl/spspd/change/effects/particles/MemoryParticle.java deleted file mode 100644 index bbf37d22..00000000 --- a/java/com/hmdzl/spspd/change/effects/particles/MemoryParticle.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.effects.particles; - -import com.watabou.noosa.particles.Emitter; -import com.watabou.noosa.particles.PixelParticle; -import com.watabou.noosa.particles.Emitter.Factory; - -public class MemoryParticle extends PixelParticle.Shrinking { - - public static final Emitter.Factory FACTORY = new Factory() { - @Override - public void emit( Emitter emitter, int index, float x, float y ) { - ((MemoryParticle)emitter.recycle( MemoryParticle.class )).reset( x, y ); - } - @Override - public boolean lightMode() { - return true; - }; - }; - - public MemoryParticle() { - super(); - - //color( 0x4488EE ); - color( 0x22CC44 ); - lifespan = 0.6f; - - acc.set( 0, -100 ); - } - - public void reset( float x, float y ) { - revive(); - - this.x = x; - this.y = y - 4; - - left = lifespan; - - size = 4; - speed.set( 0 ); - } - - @Override - public void update() { - super.update(); - float p = left / lifespan; - am = p > 0.75f ? (1 - p) * 4 : 1; - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/effects/particles/PoisonParticle.java b/java/com/hmdzl/spspd/change/effects/particles/PoisonParticle.java deleted file mode 100644 index 4cef0494..00000000 --- a/java/com/hmdzl/spspd/change/effects/particles/PoisonParticle.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.effects.particles; - -import com.watabou.noosa.particles.Emitter; -import com.watabou.noosa.particles.Emitter.Factory; -import com.watabou.noosa.particles.PixelParticle; -import com.watabou.utils.ColorMath; -import com.watabou.utils.Random; - -public class PoisonParticle extends PixelParticle { - - public static final Emitter.Factory MISSILE = new Factory() { - @Override - public void emit(Emitter emitter, int index, float x, float y) { - ((PoisonParticle) emitter.recycle(PoisonParticle.class)) - .resetMissile(x, y); - } - - @Override - public boolean lightMode() { - return true; - }; - }; - - public static final Emitter.Factory SPLASH = new Factory() { - @Override - public void emit(Emitter emitter, int index, float x, float y) { - ((PoisonParticle) emitter.recycle(PoisonParticle.class)) - .resetSplash(x, y); - } - - @Override - public boolean lightMode() { - return true; - }; - }; - - public PoisonParticle() { - super(); - - lifespan = 0.6f; - - acc.set(0, +30); - } - - public void resetMissile(float x, float y) { - revive(); - - this.x = x; - this.y = y; - - left = lifespan; - - speed.polar(-Random.Float(3.1415926f), Random.Float(6)); - } - - public void resetSplash(float x, float y) { - revive(); - - this.x = x; - this.y = y; - - left = lifespan; - - speed.polar(Random.Float(3.1415926f), Random.Float(10, 20)); - } - - @Override - public void update() { - super.update(); - // alpha: 1 -> 0; size: 1 -> 4 - size(4 - (am = left / lifespan) * 3); - // color: 0x8844FF -> 0x00FF00 - color(ColorMath.interpolate(0x00FF00, 0x8844FF, am)); - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/effects/particles/PurpleParticle.java b/java/com/hmdzl/spspd/change/effects/particles/PurpleParticle.java deleted file mode 100644 index 69a55209..00000000 --- a/java/com/hmdzl/spspd/change/effects/particles/PurpleParticle.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.effects.particles; - -import com.watabou.noosa.particles.Emitter; -import com.watabou.noosa.particles.Emitter.Factory; -import com.watabou.noosa.particles.PixelParticle; -import com.watabou.utils.ColorMath; -import com.watabou.utils.PointF; -import com.watabou.utils.Random; - -public class PurpleParticle extends PixelParticle { - - public static final Emitter.Factory MISSILE = new Factory() { - @Override - public void emit(Emitter emitter, int index, float x, float y) { - ((PurpleParticle) emitter.recycle(PurpleParticle.class)) - .reset(x, y); - } - }; - - public static final Emitter.Factory BURST = new Factory() { - @Override - public void emit(Emitter emitter, int index, float x, float y) { - ((PurpleParticle) emitter.recycle(PurpleParticle.class)) - .resetBurst(x, y); - } - - @Override - public boolean lightMode() { - return true; - } - }; - - public PurpleParticle() { - super(); - - lifespan = 0.5f; - } - - public void reset(float x, float y) { - revive(); - - this.x = x; - this.y = y; - - speed.set(Random.Float(-5, +5), Random.Float(-5, +5)); - - left = lifespan; - } - - public void resetBurst(float x, float y) { - revive(); - - this.x = x; - this.y = y; - - speed.polar(Random.Float(PointF.PI2), Random.Float(16, 32)); - - left = lifespan; - } - - @Override - public void update() { - super.update(); - // alpha: 1 -> 0; size: 1 -> 5 - size(5 - (am = left / lifespan) * 4); - // color: 0xFF0044 -> 0x220066 - color(ColorMath.interpolate(0x220066, 0xFF0044, am)); - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/effects/particles/RainParticle.java b/java/com/hmdzl/spspd/change/effects/particles/RainParticle.java deleted file mode 100644 index c6a1e843..00000000 --- a/java/com/hmdzl/spspd/change/effects/particles/RainParticle.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * Yet Another Pixel Dungeon - * Copyright (C) 2015-2016 Considered Hamster - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.effects.particles; - -import com.watabou.noosa.particles.Emitter; -import com.watabou.noosa.particles.Emitter.Factory; -import com.watabou.noosa.particles.PixelParticle; -import com.watabou.utils.Random; - -public class RainParticle extends PixelParticle { - - public static final Factory FACTORY = new Factory() { - @Override - public void emit( Emitter emitter, int index, float x, float y ) { - ((RainParticle)emitter.recycle( RainParticle.class )).reset( x, y ); - } - @Override - public boolean lightMode() { - return true; - } - }; - - public RainParticle() { - super(); - color(0x0088AA); - lifespan = 1f; - speed.set( 0, 8 ); - } - - private float offs; - - public void reset( float x, float y ) { - revive(); - - this.x = x; - this.y = y; - - offs = -Random.Float( lifespan ); - left = lifespan - offs; - } - - @Override - public void update() { - super.update(); - - float p = left / lifespan; - am = p < 0.5f ? p : 1 - p; - scale.x = (1 - p) * 2; - scale.y = 16 + (1 - p) * 16; - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/effects/particles/RainbowParticle.java b/java/com/hmdzl/spspd/change/effects/particles/RainbowParticle.java deleted file mode 100644 index 891b140f..00000000 --- a/java/com/hmdzl/spspd/change/effects/particles/RainbowParticle.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * Shattered Pixel Dungeon - * Copyright (C) 2014-2015 Evan Debenham - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.effects.particles; - -import com.watabou.noosa.particles.Emitter; -import com.watabou.noosa.particles.PixelParticle; -import com.watabou.utils.PointF; -import com.watabou.utils.Random; - -public class RainbowParticle extends PixelParticle { - - public static final Emitter.Factory BURST = new Emitter.Factory() { - @Override - public void emit( Emitter emitter, int index, float x, float y ) { - ((RainbowParticle)emitter.recycle( RainbowParticle.class )).resetBurst( x, y ); - } - @Override - public boolean lightMode() { - return true; - } - }; - - - public RainbowParticle() { - super(); - color( Random.Int( 0x1000000 ) ); - lifespan = 0.5f; - } - - - public void reset( float x, float y ) { - revive(); - - this.x = x; - this.y = y; - - speed.set( Random.Float(-5, +5), Random.Float( -5, +5 ) ); - - left = lifespan; - } - - public void resetBurst( float x, float y ) { - revive(); - - this.x = x; - this.y = y; - - speed.polar( Random.Float( PointF.PI2 ), Random.Float( 16, 32 ) ); - - left = lifespan; - } - - @Override - public void update() { - super.update(); - // alpha: 1 -> 0; size: 1 -> 5 - size( 5 - (am = left / lifespan) * 4 ); - } -} diff --git a/java/com/hmdzl/spspd/change/effects/particles/SandParticle.java b/java/com/hmdzl/spspd/change/effects/particles/SandParticle.java deleted file mode 100644 index d9a6aeca..00000000 --- a/java/com/hmdzl/spspd/change/effects/particles/SandParticle.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.effects.particles; - -import com.watabou.noosa.particles.Emitter; -import com.watabou.noosa.particles.Emitter.Factory; -import com.watabou.noosa.particles.PixelParticle; -import com.watabou.utils.Random; - -public class SandParticle extends PixelParticle { - - public static final Emitter.Factory FACTORY = new Factory() { - @Override - public void emit(Emitter emitter, int index, float x, float y) { - ((SandParticle) emitter.recycle(SandParticle.class)).reset(x, y); - } - }; - - public SandParticle() { - super(); - color(0xFFCC00); - speed.set(0, Random.Float(5, 8)); - lifespan = 1.2f; - } - - public void reset(float x, float y) { - revive(); - - this.x = x; - this.y = y - speed.y * lifespan; - - left = lifespan; - } - - @Override - public void update() { - super.update(); - float p = left / lifespan; - am = (p < 0.5f ? p : 1 - p) * 1.5f; - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/effects/particles/ShadowParticle.java b/java/com/hmdzl/spspd/change/effects/particles/ShadowParticle.java deleted file mode 100644 index 8f2f98ce..00000000 --- a/java/com/hmdzl/spspd/change/effects/particles/ShadowParticle.java +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.effects.particles; - -import com.watabou.noosa.particles.Emitter; -import com.watabou.noosa.particles.Emitter.Factory; -import com.watabou.noosa.particles.PixelParticle; -import com.watabou.utils.ColorMath; -import com.watabou.utils.PointF; -import com.watabou.utils.Random; - -public class ShadowParticle extends PixelParticle.Shrinking { - - public static final Emitter.Factory MISSILE = new Factory() { - @Override - public void emit(Emitter emitter, int index, float x, float y) { - ((ShadowParticle) emitter.recycle(ShadowParticle.class)) - .reset(x, y); - } - }; - - public static final Emitter.Factory CURSE = new Factory() { - @Override - public void emit(Emitter emitter, int index, float x, float y) { - ((ShadowParticle) emitter.recycle(ShadowParticle.class)) - .resetCurse(x, y); - } - }; - - public static final Emitter.Factory UP = new Factory() { - @Override - public void emit(Emitter emitter, int index, float x, float y) { - ((ShadowParticle) emitter.recycle(ShadowParticle.class)).resetUp(x, - y); - } - }; - - public void reset(float x, float y) { - revive(); - - this.x = x; - this.y = y; - - speed.set(Random.Float(-5, +5), Random.Float(-5, +5)); - - size = 6; - left = lifespan = 0.5f; - } - - public void resetCurse(float x, float y) { - revive(); - - size = 8; - left = lifespan = 0.5f; - - speed.polar(Random.Float(PointF.PI2), Random.Float(16, 32)); - this.x = x - speed.x * lifespan; - this.y = y - speed.y * lifespan; - } - - public void resetUp(float x, float y) { - revive(); - - speed.set(Random.Float(-8, +8), Random.Float(-32, -48)); - this.x = x; - this.y = y; - - size = 6; - left = lifespan = 1f; - } - - @Override - public void update() { - super.update(); - - float p = left / lifespan; - // alpha: 0 -> 1 -> 0; size: 6 -> 0; color: 0x660044 -> 0x000000 - color(ColorMath.interpolate(0x000000, 0x440044, p)); - am = p < 0.5f ? p * p * 4 : (1 - p) * 2; - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/effects/particles/ShaftParticle.java b/java/com/hmdzl/spspd/change/effects/particles/ShaftParticle.java deleted file mode 100644 index a0967895..00000000 --- a/java/com/hmdzl/spspd/change/effects/particles/ShaftParticle.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.effects.particles; - -import com.watabou.noosa.particles.Emitter; -import com.watabou.noosa.particles.Emitter.Factory; -import com.watabou.noosa.particles.PixelParticle; -import com.watabou.utils.Random; - -public class ShaftParticle extends PixelParticle { - - public static final Emitter.Factory FACTORY = new Factory() { - @Override - public void emit(Emitter emitter, int index, float x, float y) { - ((ShaftParticle) emitter.recycle(ShaftParticle.class)).reset(x, y); - } - - @Override - public boolean lightMode() { - return true; - } - }; - - public ShaftParticle() { - super(); - - lifespan = 1.2f; - speed.set(0, -6); - } - - private float offs; - - public void reset(float x, float y) { - revive(); - - this.x = x; - this.y = y; - - offs = -Random.Float(lifespan); - left = lifespan - offs; - } - - @Override - public void update() { - super.update(); - - float p = left / lifespan; - am = p < 0.5f ? p : 1 - p; - scale.x = (1 - p) * 4; - scale.y = 16 + (1 - p) * 16; - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/effects/particles/ShockWebParticle.java b/java/com/hmdzl/spspd/change/effects/particles/ShockWebParticle.java deleted file mode 100644 index f23073a9..00000000 --- a/java/com/hmdzl/spspd/change/effects/particles/ShockWebParticle.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.effects.particles; - -import com.watabou.noosa.particles.Emitter; -import com.watabou.noosa.particles.Emitter.Factory; -import com.watabou.noosa.particles.PixelParticle; -import com.watabou.utils.Random; -import com.hmdzl.spspd.change.effects.Speck; - -public class ShockWebParticle extends PixelParticle { - - public static final Emitter.Factory FACTORY = new Factory() { - @Override - public void emit ( Emitter emitter, int index, float x, float y ) { - ((Speck)emitter.recycle( Speck.class )).reset( index, x, y, Speck.COBWEB ); - } - }; - - public ShockWebParticle() { - super(); - - color( 0x000CC ); - lifespan = 5f; - } - - public void reset( float x, float y ) { - revive(); - - this.x = x; - this.y = y; - - left = lifespan; - angle = Random.Float( 360 ); - } - - -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/effects/particles/SmokeParticle.java b/java/com/hmdzl/spspd/change/effects/particles/SmokeParticle.java deleted file mode 100644 index 55408f50..00000000 --- a/java/com/hmdzl/spspd/change/effects/particles/SmokeParticle.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.effects.particles; - -import com.watabou.noosa.particles.Emitter; -import com.watabou.noosa.particles.Emitter.Factory; -import com.watabou.noosa.particles.PixelParticle; -import com.watabou.utils.Random; - -public class SmokeParticle extends PixelParticle { - - public static final Factory FACTORY = new Factory() { - @Override - public void emit(Emitter emitter, int index, float x, float y) { - ((SmokeParticle) emitter.recycle(SmokeParticle.class)).reset(x, y); - } - }; - - public SmokeParticle() { - super(); - - color(0x222222); - - acc.set(0, -40); - } - - public void reset(float x, float y) { - revive(); - - this.x = x; - this.y = y; - - left = lifespan = Random.Float(0.6f, 1f); - speed.set(Random.Float(-4, +4), Random.Float(-8, +8)); - } - - @Override - public void update() { - super.update(); - - float p = left / lifespan; - am = p > 0.8f ? 2 - 2 * p : p * 0.5f; - size(16 - p * 8); - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/effects/particles/SnowParticle.java b/java/com/hmdzl/spspd/change/effects/particles/SnowParticle.java deleted file mode 100644 index 3ca81332..00000000 --- a/java/com/hmdzl/spspd/change/effects/particles/SnowParticle.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.effects.particles; - -import com.watabou.noosa.particles.Emitter; -import com.watabou.noosa.particles.Emitter.Factory; -import com.watabou.noosa.particles.PixelParticle; -import com.watabou.utils.Random; - -public class SnowParticle extends PixelParticle { - - public static final Emitter.Factory FACTORY = new Factory() { - @Override - public void emit(Emitter emitter, int index, float x, float y) { - ((SnowParticle) emitter.recycle(SnowParticle.class)).reset(x, y); - } - }; - - public SnowParticle() { - super(); - speed.set(0, Random.Float(5, 8)); - lifespan = 1.2f; - } - - public void reset(float x, float y) { - revive(); - - this.x = x; - this.y = y - speed.y * lifespan; - - left = lifespan; - } - - @Override - public void update() { - super.update(); - float p = left / lifespan; - am = (p < 0.5f ? p : 1 - p) * 1.5f; - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/effects/particles/SparkParticle.java b/java/com/hmdzl/spspd/change/effects/particles/SparkParticle.java deleted file mode 100644 index 383bad49..00000000 --- a/java/com/hmdzl/spspd/change/effects/particles/SparkParticle.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.effects.particles; - -import com.watabou.noosa.particles.Emitter; -import com.watabou.noosa.particles.Emitter.Factory; -import com.watabou.noosa.particles.PixelParticle; -import com.watabou.utils.Random; - -public class SparkParticle extends PixelParticle { - - public static final Emitter.Factory FACTORY = new Factory() { - @Override - public void emit(Emitter emitter, int index, float x, float y) { - ((SparkParticle) emitter.recycle(SparkParticle.class)).reset(x, y); - } - - @Override - public boolean lightMode() { - return true; - }; - }; - - public SparkParticle() { - super(); - - size(2); - - acc.set(0, +50); - } - - public void reset(float x, float y) { - revive(); - - this.x = x; - this.y = y; - - left = lifespan = Random.Float(0.5f, 1.0f); - - speed.polar(-Random.Float(3.1415926f), Random.Float(20, 40)); - } - - @Override - public void update() { - super.update(); - size(Random.Float(5 * left / lifespan)); - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/effects/particles/WebParticle.java b/java/com/hmdzl/spspd/change/effects/particles/WebParticle.java deleted file mode 100644 index 0a851751..00000000 --- a/java/com/hmdzl/spspd/change/effects/particles/WebParticle.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.effects.particles; - -import com.watabou.noosa.particles.Emitter; -import com.watabou.noosa.particles.Emitter.Factory; -import com.watabou.noosa.particles.PixelParticle; -import com.watabou.utils.Random; -import com.hmdzl.spspd.change.effects.Speck; - -public class WebParticle extends PixelParticle { - - /*public static final Emitter.Factory FACTORY = new Factory() { - @Override - public void emit(Emitter emitter, int index, float x, float y) { - for (int i = 0; i < 3; i++) { - ((WebParticle) emitter.recycle(WebParticle.class)).reset(x, y); - } - } - };*/ - - public static final Emitter.Factory FACTORY = new Factory() { - @Override - public void emit ( Emitter emitter, int index, float x, float y ) { - ((Speck)emitter.recycle( Speck.class )).reset( index, x, y, Speck.COBWEB ); - } - }; - - public WebParticle() { - super(); - - color( 0xFFFFF ); - lifespan = 5f; - } - - public void reset( float x, float y ) { - revive(); - - this.x = x; - this.y = y; - - left = lifespan; - angle = Random.Float( 360 ); - } - - /*@Override - public void update() { - super.update(); - - float p = left / lifespan; - am = p < 0.5f ? p : 1 - p; - scale.y = 16 + p * 8; - }*/ -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/effects/particles/WindParticle.java b/java/com/hmdzl/spspd/change/effects/particles/WindParticle.java deleted file mode 100644 index d499a91a..00000000 --- a/java/com/hmdzl/spspd/change/effects/particles/WindParticle.java +++ /dev/null @@ -1,112 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.effects.particles; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.DungeonTilemap; -import com.watabou.noosa.Game; -import com.watabou.noosa.Group; -import com.watabou.noosa.particles.Emitter; -import com.watabou.noosa.particles.Emitter.Factory; -import com.watabou.noosa.particles.PixelParticle; -import com.watabou.utils.PointF; -import com.watabou.utils.Random; - -public class WindParticle extends PixelParticle { - - public static final Emitter.Factory FACTORY = new Factory() { - @Override - public void emit(Emitter emitter, int index, float x, float y) { - ((WindParticle) emitter.recycle(WindParticle.class)).reset(x, y); - } - }; - - private static float angle = Random.Float(PointF.PI2); - private static PointF speed = new PointF().polar(angle, 5); - - public WindParticle() { - super(); - - lifespan = Random.Float(1, 2); - scale.set(size = Random.Float(3)); - } - - public void reset(float x, float y) { - revive(); - - left = lifespan; - - super.speed.set(WindParticle.speed); - super.speed.scale(size); - - this.x = x - super.speed.x * lifespan / 2; - this.y = y - super.speed.y * lifespan / 2; - - angle += Random.Float(-0.1f, +0.1f); - speed = new PointF().polar(angle, 5); - - am = 0; - } - - @Override - public void update() { - super.update(); - - float p = left / lifespan; - am = (p < 0.5f ? p : 1 - p) * size * 0.2f; - } - - public static class Wind extends Group { - - private int pos; - - private float x; - private float y; - - private float delay; - - public Wind(int pos) { - super(); - - this.pos = pos; - PointF p = DungeonTilemap.tileToWorld(pos); - x = p.x; - y = p.y; - - delay = Random.Float(5); - } - - @Override - public void update() { - - if (visible = Dungeon.visible[pos]) { - - super.update(); - - if ((delay -= Game.elapsed) <= 0) { - - delay = Random.Float(5); - - ((WindParticle) recycle(WindParticle.class)).reset(x - + Random.Float(DungeonTilemap.SIZE), - y + Random.Float(DungeonTilemap.SIZE)); - } - } - } - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/effects/particles/WoolParticle.java b/java/com/hmdzl/spspd/change/effects/particles/WoolParticle.java deleted file mode 100644 index b2c86836..00000000 --- a/java/com/hmdzl/spspd/change/effects/particles/WoolParticle.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.effects.particles; - -import com.watabou.noosa.particles.Emitter; -import com.watabou.noosa.particles.Emitter.Factory; -import com.watabou.noosa.particles.PixelParticle; -import com.watabou.utils.ColorMath; -import com.watabou.utils.Random; - -public class WoolParticle extends PixelParticle.Shrinking { - - public static final Emitter.Factory FACTORY = new Factory() { - @Override - public void emit(Emitter emitter, int index, float x, float y) { - ((WoolParticle) emitter.recycle(WoolParticle.class)).reset(x, y); - } - }; - - public WoolParticle() { - super(); - - color(ColorMath.random(0x999999, 0xEEEEE0)); - - acc.set(0, -40); - } - - public void reset(float x, float y) { - revive(); - - this.x = x; - this.y = y; - - left = lifespan = Random.Float(0.6f, 1f); - size = 5; - - speed.set(Random.Float(-10, +10), Random.Float(-10, +10)); - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/items/AdamantArmor.java b/java/com/hmdzl/spspd/change/items/AdamantArmor.java deleted file mode 100644 index a2513708..00000000 --- a/java/com/hmdzl/spspd/change/items/AdamantArmor.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items; - -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; - -public class AdamantArmor extends Item { - - { - //name = "adamantite armor"; - image = ItemSpriteSheet.ARMOR_ADAMANT; - - unique = true; - } - - - - @Override - public boolean isUpgradable() { - return false; - } - - @Override - public boolean isIdentified() { - return true; - } - - @Override - public int price() { - return 300 * quantity; - } - -} diff --git a/java/com/hmdzl/spspd/change/items/AdamantRing.java b/java/com/hmdzl/spspd/change/items/AdamantRing.java deleted file mode 100644 index f69fcb9c..00000000 --- a/java/com/hmdzl/spspd/change/items/AdamantRing.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items; - -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; - -public class AdamantRing extends Item { - - { - //name = "adamantite ring"; - image = ItemSpriteSheet.RING_ADAMANT; - - unique = true; - } - - - - @Override - public boolean isUpgradable() { - return false; - } - - @Override - public boolean isIdentified() { - return true; - } - - @Override - public int price() { - return 200 * quantity; - } - -} diff --git a/java/com/hmdzl/spspd/change/items/AdamantWand.java b/java/com/hmdzl/spspd/change/items/AdamantWand.java deleted file mode 100644 index cf04acb3..00000000 --- a/java/com/hmdzl/spspd/change/items/AdamantWand.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items; - -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; - -public class AdamantWand extends Item { - - { - //name = "adamantite wand"; - image = ItemSpriteSheet.WAND_ADAMANT; - - unique = true; - } - - - - @Override - public boolean isUpgradable() { - return false; - } - - @Override - public boolean isIdentified() { - return true; - } - - @Override - public int price() { - return 150 * quantity; - } - -} diff --git a/java/com/hmdzl/spspd/change/items/AdamantWeapon.java b/java/com/hmdzl/spspd/change/items/AdamantWeapon.java deleted file mode 100644 index bc597fa6..00000000 --- a/java/com/hmdzl/spspd/change/items/AdamantWeapon.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items; - -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; - -public class AdamantWeapon extends Item { - - { - //name = "adamantite weapon"; - image = ItemSpriteSheet.ADAMANT_WEAPON; - - unique = true; - } - - - - @Override - public boolean isUpgradable() { - return false; - } - - @Override - public boolean isIdentified() { - return true; - } - - @Override - public int price() { - return 250 * quantity; - } -} diff --git a/java/com/hmdzl/spspd/change/items/Amulet.java b/java/com/hmdzl/spspd/change/items/Amulet.java deleted file mode 100644 index 9582e659..00000000 --- a/java/com/hmdzl/spspd/change/items/Amulet.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items; - -import java.io.IOException; -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.Statistics; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.scenes.AmuletScene; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.watabou.noosa.Game; - -public class Amulet extends Item { - - private static final String AC_END = "END"; - - { - //name = "Amulet of Yendor"; - image = ItemSpriteSheet.AMULET; - - unique = true; - } - - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions(hero); - actions.add(AC_END); - return actions; - } - - @Override - public void execute(Hero hero, String action) { - if (action == AC_END) { - - showAmuletScene(); - - } else { - - super.execute(hero, action); - - } - } - - @Override - public boolean doPickUp(Hero hero) { - if (super.doPickUp(hero)) { - showAmuletScene(); - if (!Statistics.amuletObtained) { - Statistics.amuletObtained = true; - Badges.validateVictory(); - } - return true; - } else { - return false; - } - } - - private void showAmuletScene() { - try { - Dungeon.saveAll(); - Game.switchScene(AmuletScene.class); - } catch (IOException e) { - } - } - - @Override - public boolean isIdentified() { - return true; - } - - @Override - public boolean isUpgradable() { - return false; - } -} diff --git a/java/com/hmdzl/spspd/change/items/AncientCoin.java b/java/com/hmdzl/spspd/change/items/AncientCoin.java deleted file mode 100644 index 282f2ae3..00000000 --- a/java/com/hmdzl/spspd/change/items/AncientCoin.java +++ /dev/null @@ -1,154 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.actors.mobs.pets.PET; -import com.hmdzl.spspd.change.items.artifacts.DriedRose; -import com.hmdzl.spspd.change.items.artifacts.TimekeepersHourglass; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.InterlevelScene; -import com.hmdzl.spspd.change.sprites.ItemSprite.Glowing; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.Game; -import com.watabou.utils.Bundle; - -public class AncientCoin extends Item { - - public static final float TIME_TO_USE = 1; - - public static final String AC_PORT = "PORT"; - - private int specialLevel = 40; - private int returnDepth = -1; - private int returnPos; - - { - //name = "ancient coin"; - image = ItemSpriteSheet.COIN; - - stackable = false; - unique = true; - } - - private static final String DEPTH = "depth"; - private static final String POS = "pos"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(DEPTH, returnDepth); - if (returnDepth != -1) { - bundle.put(POS, returnPos); - } - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - returnDepth = bundle.getInt(DEPTH); - returnPos = bundle.getInt(POS); - } - - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions(hero); - actions.add(AC_PORT); - - return actions; - } - - @Override - public void execute(Hero hero, String action) { - - if (action == AC_PORT) { - - if ((Dungeon.bossLevel() || Dungeon.depth==1 || Dungeon.depth>25 || hero.petfollow) && Dungeon.depth!=specialLevel) { - hero.spend(TIME_TO_USE); - GLog.w(Messages.get(Item.class, "not_here")); - return; - } - - if (Dungeon.depth==specialLevel && !Dungeon.banditkingkilled && !Dungeon.level.reset) { - hero.spend(TIME_TO_USE); - GLog.w(Messages.get(Item.class, "boss_first")); - return; - } - - } - - if (action == AC_PORT) { - - - hero.spend(TIME_TO_USE); - - Buff buff = Dungeon.hero - .buff(TimekeepersHourglass.timeFreeze.class); - if (buff != null) - buff.detach(); - - if (Dungeon.depth<25 && !Dungeon.bossLevel()){ - - returnDepth = Dungeon.depth; - returnPos = hero.pos; - InterlevelScene.mode = InterlevelScene.Mode.PORTCOIN; - } else { - this.doDrop(hero); - InterlevelScene.mode = InterlevelScene.Mode.RETURN; - } - InterlevelScene.returnDepth = returnDepth; - InterlevelScene.returnPos = returnPos; - Game.switchScene(InterlevelScene.class); - - } else { - - super.execute(hero, action); - - } - } - - public void reset() { - returnDepth = -1; - } - - @Override - public boolean isUpgradable() { - return false; - } - - @Override - public boolean isIdentified() { - return true; - } - - - private static final Glowing BLACK = new Glowing(0x00000); - - @Override - public Glowing glowing() { - return BLACK; - } -} diff --git a/java/com/hmdzl/spspd/change/items/Ankh.java b/java/com/hmdzl/spspd/change/items/Ankh.java deleted file mode 100644 index 6f8bc0c5..00000000 --- a/java/com/hmdzl/spspd/change/items/Ankh.java +++ /dev/null @@ -1,131 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.sprites.ItemSprite.Glowing; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundle; - -public class Ankh extends Item { - - public static final String AC_BLESS = "BLESS"; - - { - //name = "Ankh"; - image = ItemSpriteSheet.ANKH; - stackable = true; - - // You tell the ankh no, don't revive me, and then it comes back to - // revive you again in another run. - // I'm not sure if that's enthusiasm or passive-aggression. - - } - - private Boolean blessed = true; - - @Override - public boolean isUpgradable() { - return false; - } - - @Override - public boolean isIdentified() { - return true; - } - - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions(hero); - DewVial vial = hero.belongings.getItem(DewVial.class); - if (vial != null && vial.isFullBless() && !blessed) - actions.add(AC_BLESS); - return actions; - } - - @Override - public void execute(final Hero hero, String action) { - if (action.equals(AC_BLESS)) { - - DewVial vial = hero.belongings.getItem(DewVial.class); - if (vial != null) { - blessed = true; - vial.empty(); - GLog.p(Messages.get(this, "bless")); - hero.spend(1f); - hero.busy(); - - Sample.INSTANCE.play(Assets.SND_DRINK); - CellEmitter.get(hero.pos).start(Speck.factory(Speck.LIGHT), - 0.2f, 3); - hero.sprite.operate(hero.pos); - } - } else { - - super.execute(hero, action); - - } - - } - - @Override - public String desc() { - if (blessed) - return Messages.get(this, "desc_blessed"); - else - return super.desc(); - } - - public Boolean isBlessed() { - return blessed; - } - - private static final Glowing WHITE = new Glowing(0xFFFFCC); - - @Override - public Glowing glowing() { - return isBlessed() ? WHITE : null; - } - - private static final String BLESSED = "blessed"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(BLESSED, blessed); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - blessed = bundle.getBoolean(BLESSED); - } - - @Override - public int price() { - return 50 * quantity; - } -} diff --git a/java/com/hmdzl/spspd/change/items/ArmorKit.java b/java/com/hmdzl/spspd/change/items/ArmorKit.java deleted file mode 100644 index d594fdc4..00000000 --- a/java/com/hmdzl/spspd/change/items/ArmorKit.java +++ /dev/null @@ -1,134 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.armor.Armor; -import com.hmdzl.spspd.change.items.skills.ClassSkill; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.HeroSprite; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.hmdzl.spspd.change.windows.WndBag; -import com.watabou.noosa.audio.Sample; - -public class ArmorKit extends Item { - - private static final float TIME_TO_UPGRADE = 2; - - private static final String AC_APPLY = "APPLY"; - - { - //name = "armor kit"; - image = ItemSpriteSheet.KIT; - - unique = true; - } - - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions(hero); - actions.add(AC_APPLY); - return actions; - } - - @Override - public void execute(Hero hero, String action) { - if (action == AC_APPLY) { - - curUser = hero; - //GameScene.selectItem(itemSelector, WndBag.Mode.ARMOR, - //Messages.get(this,"prompt")); - detach(curUser.belongings.backpack); - - curUser.sprite.centerEmitter().start(Speck.factory(Speck.KIT), 0.05f, - 10); - curUser.spend(TIME_TO_UPGRADE); - curUser.busy(); - - //GLog.w(Messages.get(this,"upgraded", armor.name())); - ClassSkill classSkill = ClassSkill.upgrade(curUser); - classSkill.collect(curUser.belongings.backpack); - - curUser.sprite.operate(curUser.pos); - Sample.INSTANCE.play(Assets.SND_EVOKE); - - } else { - - super.execute(hero, action); - - } - } - - @Override - public boolean isUpgradable() { - return false; - } - - @Override - public boolean isIdentified() { - return true; - } - - /*private void upgrade(Armor armor) { - - detach(curUser.belongings.backpack); - - curUser.sprite.centerEmitter().start(Speck.factory(Speck.KIT), 0.05f, - 10); - curUser.spend(TIME_TO_UPGRADE); - curUser.busy(); - - GLog.w(Messages.get(this,"upgraded", armor.name())); - - //ClassArmor classArmor = ClassArmor.upgrade(curUser, armor); - if (curUser.belongings.armor == armor) { - - curUser.belongings.armor = classArmor; - ((HeroSprite) curUser.sprite).updateArmor(); - - } else { - - armor.detach(curUser.belongings.backpack); - classArmor.collect(curUser.belongings.backpack); - - } - - curUser.sprite.operate(curUser.pos); - Sample.INSTANCE.play(Assets.SND_EVOKE); - } - - private final WndBag.Listener itemSelector = new WndBag.Listener() { - @Override - public void onSelect(Item item) { - if (item != null) { - ArmorKit.this.upgrade((Armor) item); - } - } - };*/ - - @Override - public int price() { - return 200 * quantity; - } -} diff --git a/java/com/hmdzl/spspd/change/items/Bone.java b/java/com/hmdzl/spspd/change/items/Bone.java deleted file mode 100644 index 891270b8..00000000 --- a/java/com/hmdzl/spspd/change/items/Bone.java +++ /dev/null @@ -1,152 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.actors.mobs.pets.PET; -import com.hmdzl.spspd.change.items.artifacts.DriedRose; -import com.hmdzl.spspd.change.items.artifacts.TimekeepersHourglass; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.InterlevelScene; -import com.hmdzl.spspd.change.sprites.ItemSprite.Glowing; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.Game; -import com.watabou.utils.Bundle; - -public class Bone extends Item { - - public static final float TIME_TO_USE = 1; - - public static final String AC_PORT = "PORT"; - - private int specialLevel = 37; - private int returnDepth = -1; - private int returnPos; - - { - //name = "inscribed bone"; - image = ItemSpriteSheet.BONE; - - stackable = false; - unique = true; - } - - private static final String DEPTH = "depth"; - private static final String POS = "pos"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(DEPTH, returnDepth); - if (returnDepth != -1) { - bundle.put(POS, returnPos); - } - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - returnDepth = bundle.getInt(DEPTH); - returnPos = bundle.getInt(POS); - } - - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions(hero); - actions.add(AC_PORT); - - return actions; - } - - @Override - public void execute(Hero hero, String action) { - - if (action == AC_PORT) { - - if ((Dungeon.bossLevel() || Dungeon.depth==1 || Dungeon.depth>25 || hero.petfollow) && Dungeon.depth!=specialLevel) { - hero.spend(TIME_TO_USE); - GLog.w(Messages.get(Item.class, "not_here")); - return; - } - - if (Dungeon.depth==specialLevel && !Dungeon.skeletonkingkilled && !Dungeon.level.reset) { - hero.spend(TIME_TO_USE); - GLog.w(Messages.get(Item.class, "boss_first")); - return; - } - - } - - if (action == AC_PORT) { - - hero.spend(TIME_TO_USE); - - Buff buff = Dungeon.hero - .buff(TimekeepersHourglass.timeFreeze.class); - if (buff != null) - buff.detach(); - - if (Dungeon.depth<25 && !Dungeon.bossLevel()){ - returnDepth = Dungeon.depth; - returnPos = hero.pos; - InterlevelScene.mode = InterlevelScene.Mode.PORTBONE; - } else { - InterlevelScene.mode = InterlevelScene.Mode.RETURN; - detach(hero.belongings.backpack); - } - InterlevelScene.returnDepth = returnDepth; - InterlevelScene.returnPos = returnPos; - Game.switchScene(InterlevelScene.class); - - } else { - - super.execute(hero, action); - - } - } - - public void reset() { - returnDepth = -1; - } - - @Override - public boolean isUpgradable() { - return false; - } - - @Override - public boolean isIdentified() { - return true; - } - - - private static final Glowing BLACK = new Glowing(0x00000); - - @Override - public Glowing glowing() { - return BLACK; - } -} diff --git a/java/com/hmdzl/spspd/change/items/BossRush.java b/java/com/hmdzl/spspd/change/items/BossRush.java deleted file mode 100644 index 7c54da75..00000000 --- a/java/com/hmdzl/spspd/change/items/BossRush.java +++ /dev/null @@ -1,141 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.Statistics; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.items.artifacts.DriedRose; -import com.hmdzl.spspd.change.items.artifacts.TimekeepersHourglass; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.InterlevelScene; -import com.hmdzl.spspd.change.sprites.ItemSprite.Glowing; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.Game; -import com.watabou.utils.Bundle; - -public class BossRush extends Item { - - public static final float TIME_TO_USE = 1; - - public static final String AC_PORT = "READ"; - - private int specialLevel = 71; - private int returnDepth = -1; - private int returnPos; - - { - //name = "Book of Bosses"; - image = ItemSpriteSheet.BOSSRUSH; - - unique = true; - } - - - private static final String DEPTH = "depth"; - private static final String POS = "pos"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(DEPTH, returnDepth); - if (returnDepth != -1) { - bundle.put(POS, returnPos); - } - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - returnDepth = bundle.getInt(DEPTH); - returnPos = bundle.getInt(POS); - } - - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions(hero); - actions.add(AC_PORT); - - return actions; - } - - @Override - public void execute(Hero hero, String action) { - - if (action == AC_PORT) { - - if ((Dungeon.bossLevel() || Dungeon.depth==1 || Dungeon.depth>25 || hero.petfollow) && Dungeon.depth!=specialLevel) { - hero.spend(TIME_TO_USE); - GLog.w(Messages.get(Item.class, "not_here")); - return; - } - } - - if (action == AC_PORT) { - - hero.spend(TIME_TO_USE); - - if (Dungeon.depth==specialLevel){ - this.doDrop(hero); - } - Buff buff = Dungeon.hero - .buff(TimekeepersHourglass.timeFreeze.class); - if (buff != null) - buff.detach(); - - if (Dungeon.depth<25 && !Dungeon.bossLevel()){ - returnDepth = Dungeon.depth; - returnPos = hero.pos; - InterlevelScene.mode = InterlevelScene.Mode.BOSSRUSH; - } else { - - InterlevelScene.mode = InterlevelScene.Mode.RETURN; - } - - InterlevelScene.returnDepth = returnDepth; - InterlevelScene.returnPos = returnPos; - Game.switchScene(InterlevelScene.class); - - } else { - - super.execute(hero, action); - - } - } - - public void reset() { - returnDepth = -1; - } - - @Override - public boolean isUpgradable() { - return false; - } - - @Override - public boolean isIdentified() { - return true; - } -} diff --git a/java/com/hmdzl/spspd/change/items/ChallengeBook.java b/java/com/hmdzl/spspd/change/items/ChallengeBook.java deleted file mode 100644 index 41099f94..00000000 --- a/java/com/hmdzl/spspd/change/items/ChallengeBook.java +++ /dev/null @@ -1,205 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Haste; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.actors.mobs.pets.PET; -import com.hmdzl.spspd.change.effects.particles.ElmoParticle; -import com.hmdzl.spspd.change.items.challengelists.ChallengeList; -import com.hmdzl.spspd.change.items.journalpages.JournalPage; -import com.hmdzl.spspd.change.items.keys.IronKey; -import com.hmdzl.spspd.change.items.misc.Spectacles.MagicSight; -import com.hmdzl.spspd.change.items.rings.RingOfForce; -import com.hmdzl.spspd.change.items.scrolls.Scroll; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.scenes.InterlevelScene; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.hmdzl.spspd.change.windows.WndBag; -import com.hmdzl.spspd.change.windows.WndChallengeBook; -import com.hmdzl.spspd.change.windows.WndOtiluke; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.noosa.Game; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundle; - -public class ChallengeBook extends Item { - - public final float TIME_TO_USE = 1; - - public static final String AC_RETURN = "RETURN"; - public static final String AC_ADD = "ADD"; - public static final String AC_PORT = "READ"; - - protected WndBag.Mode mode = WndBag.Mode.CHALLENGELIST; - - - public int returnDepth = -1; - public int returnPos; - - - public boolean[] rooms = new boolean[10]; - public boolean[] firsts = new boolean[10]; - - { - //name = "Otiluke's journal"; - image = ItemSpriteSheet.CHALLENGE_BOOK; - - unique = true; - - //rooms[0] = true; - //firsts[0] = true; - } - - private static final String DEPTH = "depth"; - private static final String POS = "pos"; - private static final String ROOMS = "rooms"; - private static final String FIRSTS = "firsts"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(DEPTH, returnDepth); - bundle.put(ROOMS, rooms); - bundle.put(FIRSTS, firsts); - if (returnDepth != -1) { - bundle.put(POS, returnPos); - } - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - returnDepth = bundle.getInt(DEPTH); - returnPos = bundle.getInt(POS); - rooms = bundle.getBooleanArray(ROOMS); - firsts = bundle.getBooleanArray(FIRSTS); - } - - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions(hero); - - actions.add(AC_ADD); - - if (returnDepth > 0 && ( Dungeon.depth<35 && Dungeon.depth > 26) && !hero.petfollow){ - actions.add(AC_RETURN); - } - //charge >= reqCharges() && - if (Dungeon.depth<26 && !hero.petfollow /*&& (rooms[0])*/){ - actions.add(AC_PORT); - } - - return actions; - } - - @Override - public void execute(Hero hero, String action) { - - if (action == AC_PORT) { - if (Dungeon.bossLevel()) { - hero.spend(TIME_TO_USE); - GLog.w(Messages.get(Item.class, "not_here")); - return; - } - } - - if (action == AC_PORT) { - GameScene.show(new WndChallengeBook(rooms, this)); - } - - if (action == AC_RETURN) { - hero.spend(TIME_TO_USE); - updateQuickslot(); - InterlevelScene.mode = InterlevelScene.Mode.RETURN; - InterlevelScene.returnDepth = returnDepth; - InterlevelScene.returnPos = returnPos; - Game.switchScene(InterlevelScene.class); - returnDepth=-1; - } - - if (action == AC_ADD) { - - GameScene.selectItem(itemSelector, mode, Messages.get(this, "prompt")); - - } - - else { - - super.execute(hero, action); - - } - } - - @Override - public int price() { - return 0; - } - - public void reset() { - returnDepth = -1; - } - - @Override - public boolean isUpgradable() { - return false; - } - - @Override - public boolean isIdentified() { - return true; - } - - @Override - public String info() { - String info = desc(); - return info; - } - - protected WndBag.Listener itemSelector = new WndBag.Listener() { - @Override - public void onSelect(Item item) { - if (item != null && item instanceof ChallengeList) { - Hero hero = Dungeon.hero; - int room = ((ChallengeList) item).room; - - hero.sprite.operate(hero.pos); - hero.busy(); - hero.spend(2f); - Sample.INSTANCE.play(Assets.SND_BURNING); - hero.sprite.emitter().burst(ElmoParticle.FACTORY, 12); - - item.detach(hero.belongings.backpack); - GLog.h(Messages.get(ChallengeBook.class,"add_page")); - - rooms[room] = true; - firsts[room] = true; - - } - } - }; -} diff --git a/java/com/hmdzl/spspd/change/items/ConchShell.java b/java/com/hmdzl/spspd/change/items/ConchShell.java deleted file mode 100644 index c45af40f..00000000 --- a/java/com/hmdzl/spspd/change/items/ConchShell.java +++ /dev/null @@ -1,151 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.actors.mobs.pets.PET; -import com.hmdzl.spspd.change.items.artifacts.DriedRose; -import com.hmdzl.spspd.change.items.artifacts.TimekeepersHourglass; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.InterlevelScene; -import com.hmdzl.spspd.change.sprites.ItemSprite.Glowing; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.Game; -import com.watabou.utils.Bundle; - -public class ConchShell extends Item { - - public static final float TIME_TO_USE = 1; - - public static final String AC_PORT = "PORT"; - - private int specialLevel = 38; - private int returnDepth = -1; - private int returnPos; - - { - //name = "conch shell"; - image = ItemSpriteSheet.SHELL; - - stackable = false; - unique = true; - } - - private static final String DEPTH = "depth"; - private static final String POS = "pos"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(DEPTH, returnDepth); - if (returnDepth != -1) { - bundle.put(POS, returnPos); - } - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - returnDepth = bundle.getInt(DEPTH); - returnPos = bundle.getInt(POS); - } - - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions(hero); - actions.add(AC_PORT); - - return actions; - } - - @Override - public void execute(Hero hero, String action) { - - if (action == AC_PORT) { - - if ((Dungeon.bossLevel() || Dungeon.depth==1 || Dungeon.depth>25 || hero.petfollow) && Dungeon.depth!=specialLevel) { - hero.spend(TIME_TO_USE); - GLog.w(Messages.get(Item.class, "not_here")); - return; - } - - if (Dungeon.depth==specialLevel && !Dungeon.crabkingkilled && !Dungeon.level.reset) { - hero.spend(TIME_TO_USE); - GLog.w(Messages.get(Item.class, "boss_first")); - return; - } - - } - - if (action == AC_PORT) { - - Buff buff = Dungeon.hero - .buff(TimekeepersHourglass.timeFreeze.class); - if (buff != null) - buff.detach(); - - if (Dungeon.depth<25 && !Dungeon.bossLevel()){ - - returnDepth = Dungeon.depth; - returnPos = hero.pos; - InterlevelScene.mode = InterlevelScene.Mode.PORTCRAB; - } else { - InterlevelScene.mode = InterlevelScene.Mode.RETURN; - detach(hero.belongings.backpack); - } - InterlevelScene.returnDepth = returnDepth; - InterlevelScene.returnPos = returnPos; - Game.switchScene(InterlevelScene.class); - - } else { - - super.execute(hero, action); - - } - } - - public void reset() { - returnDepth = -1; - } - - @Override - public boolean isUpgradable() { - return false; - } - - @Override - public boolean isIdentified() { - return true; - } - - - private static final Glowing BLACK = new Glowing(0x00000); - - @Override - public Glowing glowing() { - return BLACK; - } -} diff --git a/java/com/hmdzl/spspd/change/items/DewVial.java b/java/com/hmdzl/spspd/change/items/DewVial.java deleted file mode 100644 index f8c59b0e..00000000 --- a/java/com/hmdzl/spspd/change/items/DewVial.java +++ /dev/null @@ -1,622 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.Challenges; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.ResultDescriptions; -import com.hmdzl.spspd.change.Statistics; -import com.hmdzl.spspd.change.actors.blobs.Blob; -import com.hmdzl.spspd.change.actors.blobs.Water; -import com.hmdzl.spspd.change.actors.buffs.Bless; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Burning; -import com.hmdzl.spspd.change.actors.buffs.ExitFind; -import com.hmdzl.spspd.change.actors.buffs.Haste; -import com.hmdzl.spspd.change.actors.buffs.Invisibility; -import com.hmdzl.spspd.change.actors.buffs.Levitation; -import com.hmdzl.spspd.change.actors.buffs.Light; -import com.hmdzl.spspd.change.actors.buffs.MindVision; -import com.hmdzl.spspd.change.actors.buffs.Ooze; -import com.hmdzl.spspd.change.actors.buffs.Tar; -import com.hmdzl.spspd.change.actors.buffs.Vertigo; -import com.hmdzl.spspd.change.actors.buffs.Weakness; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.hero.HeroClass; -import com.hmdzl.spspd.change.actors.hero.HeroSubClass; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.effects.particles.ShadowParticle; -import com.hmdzl.spspd.change.items.bags.Bag; -import com.hmdzl.spspd.change.items.food.WaterItem; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.Terrain; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.utils.GLog; - -import com.hmdzl.spspd.change.windows.WndBag; -import com.hmdzl.spspd.change.windows.WndItem; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundle; -import com.watabou.utils.GameMath; -import com.watabou.utils.Random; - -public class DewVial extends Item { - - private static final int MAX_VOLUME = 120; - private static final int EXT_VOLUME = 350; - private static final int BLESS_VOLUME = 20; - - - private static final int MAX_VOLUME(){ - return Dungeon.wings ? EXT_VOLUME : MAX_VOLUME; - } - - - private static final String AC_DRINK = "DRINK"; - private static final String AC_WATER = "WATER"; - private static final String AC_SPLASH = "SPLASH"; - private static final String AC_BLESS = "BLESS"; - private static final String AC_LIGHT = "LIGHT"; - private static final String AC_POUR = "POUR"; - private static final String AC_PEEK = "PEEK"; - private static final String AC_REFINE = "REFINE"; - private static final String AC_CHOOSE = "CHOOSE"; - - private static final float TIME_TO_LIGHT = 1f; - private static final float TIME_TO_DRINK = 2f; - private static final float TIME_TO_WATER = 3f; - - private static final String TXT_STATUS = "%d"; - private static final String TXT_STATUS2 = "%d/%d"; - - { - //name = "dew vial"; - image = ItemSpriteSheet.VIAL; - - defaultAction = AC_CHOOSE; - unique = true; - } - - private int volume = 0; - - private int rejection = Dungeon.isChallenged(Challenges.DEW_REJECTION)? 10 : 0 ; - - public int checkVol () { - return volume; - } - - public void setVol (int vol) { - volume=vol; - } - - private static final String VOLUME = "volume"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(VOLUME, volume); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - volume = bundle.getInt(VOLUME); - } - - - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions(hero); - if (volume > 99) { - actions.add(AC_DRINK); - - if (Dungeon.dewWater || Dungeon.dewDraw){ - actions.add(AC_WATER); - actions.add(AC_BLESS); - } - if (Dungeon.dewNorn){ - actions.add(AC_POUR); - actions.add(AC_SPLASH); - } - actions.add(AC_LIGHT); - actions.add(AC_PEEK); - actions.add(AC_REFINE); - //actions.add(AC_ESCAPE); - } - else if (volume > 49) { - actions.add(AC_DRINK); - if (Dungeon.dewWater || Dungeon.dewDraw){ - actions.add(AC_WATER); - } - if (Dungeon.dewNorn){ - actions.add(AC_POUR); - actions.add(AC_SPLASH); - } - actions.add(AC_LIGHT); - actions.add(AC_PEEK); - actions.add(AC_REFINE); - } - - else if (volume > 29) { - actions.add(AC_DRINK); - if (Dungeon.dewNorn){ - actions.add(AC_SPLASH); - actions.add(AC_POUR); - } - actions.add(AC_LIGHT); - actions.add(AC_PEEK); - actions.add(AC_REFINE); - } - else if (volume > 1) { - actions.add(AC_DRINK); - } - return actions; - } - - @Override - public void execute(final Hero hero, String action) { - if (action.equals( AC_CHOOSE )) { - - GameScene.show(new WndItem(null, this, true)); - - } else if (action.equals(AC_DRINK)) { - if (volume > 350 ){ - hero.damage(hero.HT,this); - if (!hero.isAlive()) { - Dungeon.fail(Messages.format(ResultDescriptions.CHEAT)); - } - } - if (volume > 0) { - - //20 drops for a full heal normally, 15 for the warden - float dropHealPercent = hero.subClass == HeroSubClass.WARDEN ? 0.04f : 0.025f; - float missingHealthPercent = 1f - (hero.HP / (float)hero.HT); - - //trimming off 0.01 drops helps with floating point errors - int dropsNeeded = (int)Math.ceil((missingHealthPercent / dropHealPercent) - 0.01f); - dropsNeeded = (int) GameMath.gate(1, dropsNeeded, volume); - - int heal = Math.round( hero.HT * dropHealPercent * dropsNeeded ); - - int effect = Math.min( hero.HT - hero.HP, heal ); - if (effect > 0) { - if (Dungeon.hero.subClass == HeroSubClass.PASTOR) { - hero.HP += (int)(effect*1.5); - } else hero.HP += effect; - hero.sprite.emitter().burst( Speck.factory( Speck.HEALING ), 1 + dropsNeeded/5 ); - hero.sprite.showStatus( CharSprite.POSITIVE, Messages.get(this, "value", effect) ); - } - - volume -= dropsNeeded; - - hero.spend(TIME_TO_DRINK); - hero.busy(); - - Sample.INSTANCE.play(Assets.SND_DRINK); - hero.sprite.operate(hero.pos); - - updateQuickslot(); - - } else { - GLog.w(Messages.get(this, "empty")); - } - - } else if (action.equals(AC_WATER)) { - if (volume > 350 ){ - hero.damage(hero.HT,this); - if (!hero.isAlive()) { - Dungeon.fail(Messages.format(ResultDescriptions.CHEAT)); - } - } - Statistics.waters++; - int positive = 0; - int negative = 0; - - int distance = 1 + positive + negative; - - if (distance <= 0) { - level /= 2 - distance; - distance = 1; - } - - int cx = hero.pos % Level.getWidth(); - int cy = hero.pos / Level.getWidth(); - int ax = cx - distance; - if (ax < 0) { - ax = 0; - } - int bx = cx + distance; - if (bx >= Level.getWidth()) { - bx = Level.getWidth() - 1; - } - int ay = cy - distance; - if (ay < 0) { - ay = 0; - } - int by = cy + distance; - if (by >= Level.HEIGHT) { - by = Level.HEIGHT - 1; - } - - - for (int y = ay; y <= by; y++) { - for (int x = ax, p = ax + y * Level.getWidth(); x <= bx; x++, p++) { - - if (Dungeon.visible[p]) { - int c = Dungeon.level.map[p]; - - if (c == Terrain.GRASS) { - GameScene.add(Blob.seed(p, (2) * 20, Water.class)); - } - } - } - } - volume = volume - 15 - rejection; - GLog.i(Messages.get(this, "watered")); - hero.sprite.operate(hero.pos); - hero.busy(); - hero.spend(TIME_TO_WATER); - updateQuickslot(); - - } else if (action.equals(AC_SPLASH)) { - if (volume > 350 ){ - hero.damage(hero.HT,this); - if (!hero.isAlive()) { - Dungeon.fail(Messages.format(ResultDescriptions.CHEAT)); - } - } - Buff.affect(hero, Haste.class, Haste.DURATION); - //Buff.affect(hero, Invisibility.class, Invisibility.DURATION); - if(Dungeon.wings && Dungeon.depth<51 ){ - Buff.affect(hero, Levitation.class, Levitation.DURATION); - GLog.i(Messages.get(this, "fly")); - } - //GLog.i(Messages.get(this, "invisible")); - GLog.i(Messages.get(this, "fast")); - volume = volume - 15 - rejection; - updateQuickslot(); - - } else if (action.equals(AC_BLESS) && !Dungeon.dewDraw) { - if (volume > 350 ){ - hero.damage(hero.HT,this); - if (!hero.isAlive()) { - Dungeon.fail(Messages.format(ResultDescriptions.CHEAT)); - } - } - boolean procced = uncurse(hero, hero.belongings.backpack.items.toArray(new Item[0])); - procced = uncurse(hero, hero.belongings.weapon, - hero.belongings.armor, hero.belongings.misc1, - hero.belongings.misc2, hero.belongings.misc3) - || procced; - - if (procced) { - GLog.p(Messages.get(this, "remove_curse")); - } else { - GLog.i(Messages.get(this, "curse")); - } - - volume = volume - 70 - rejection; - updateQuickslot(); - - } else if (action.equals(AC_BLESS) && Dungeon.dewDraw) { - if (volume > 350 ){ - hero.damage(hero.HT,this); - if (!hero.isAlive()) { - Dungeon.fail(Messages.format(ResultDescriptions.CHEAT)); - } - } - curUser = hero; - GameScene.selectItem(itemSelector, WndBag.Mode.UPGRADEDEW, Messages.get(DewVial.class, "select")); - //updateQuickslot(); - - } else if (action.equals(AC_LIGHT)) { - if (volume > 350 ){ - hero.damage(hero.HT,this); - if (!hero.isAlive()) { - Dungeon.fail(Messages.format(ResultDescriptions.CHEAT)); - } - } - Buff.affect(hero, Light.class, 80f); - Buff.affect(hero, Invisibility.class, 20f); - GLog.i(Messages.get(this, "light")); - hero.spend(TIME_TO_LIGHT); - volume = volume - 10 - rejection; - updateQuickslot(); - - } else if (action.equals(AC_POUR)) { - if (volume > 350 ){ - hero.damage(hero.HT,this); - if (!hero.isAlive()) { - Dungeon.fail(Messages.format(ResultDescriptions.CHEAT)); - } - } - Buff.detach(hero, Burning.class); - Buff.detach(hero, Ooze.class); - Buff.detach(hero, Tar.class); - Buff.detach(hero, Weakness.class); - Buff.detach(hero, Vertigo.class); - - if (Random.Int(8) == 0) { - volume = volume - 20 - rejection; - Buff.affect(hero, Bless.class, 30f); - hero.sprite.operate(hero.pos); - hero.busy(); - hero.spend(TIME_TO_WATER); - } else { volume = volume - 5 - rejection; - hero.sprite.operate(hero.pos); - hero.busy(); - hero.spend(TIME_TO_WATER);} - - updateQuickslot(); - - } else if (action.equals(AC_PEEK)) { - if (volume > 350 ){ - hero.damage(hero.HT,this); - if (!hero.isAlive()) { - Dungeon.fail(Messages.format(ResultDescriptions.CHEAT)); - } - } - Buff.affect(hero, MindVision.class, 2f); - Buff.affect(hero, ExitFind.class, 2f); - volume = volume - 5 - rejection; - hero.sprite.operate(hero.pos); - hero.busy(); - hero.spend(TIME_TO_LIGHT); - updateQuickslot(); - } else if (action.equals(AC_REFINE)) { - if (volume > 350 ){ - hero.damage(hero.HT,this); - if (!hero.isAlive()) { - Dungeon.fail(Messages.format(ResultDescriptions.CHEAT)); - } - } - volume = volume - 10 - rejection; - hero.sprite.operate(hero.pos); - hero.busy(); - hero.spend(TIME_TO_DRINK); - WaterItem wateritem = new WaterItem(); - if (wateritem.doPickUp(Dungeon.hero)) { - GLog.i( Messages.get(Dungeon.hero, "you_now_have", wateritem.name())); - } else { - Dungeon.level.drop(wateritem, hero.pos).sprite - .drop(); - } - updateQuickslot(); - // } else if (action.equals(AC_ESCAPE)) { - //if (Dungeon.depth < 26){ - //GLog.n(Messages.get(this,"not_escape")); - //} else { - //volume = volume - volume; - //InterlevelScene.mode = InterlevelScene.Mode.SOKOBANFAIL; - //Game.switchScene(InterlevelScene.class);} - }else { - super.execute(hero, action); - } - } - - public static boolean uncurse(Hero hero, Item... items) { - - - int levelLimit = Math.max(2, 2+Math.round(Statistics.deepestFloor/3)); - if (hero.heroClass == HeroClass.MAGE){levelLimit++;} - - float lvlchance = 0.33f; - if (hero.heroClass == HeroClass.MAGE){lvlchance = 0.38f;} - - boolean procced = false; - boolean proccedUp = false; - for (int i = 0; i < items.length; i++) { - Item item = items[i]; - if (item != null && item.cursed) { - item.uncurse(); - if(item.level<0){item.upgrade(-item.level);} //upgrade to even - if (item.cursed==false) {procced = true;} - hero.sprite.emitter().start(ShadowParticle.UP, 0.05f, 10); - } - - if (item != null && Random.Float()= BLESS_VOLUME; - } - - - public boolean isFull() { - return volume >= MAX_VOLUME(); - } - - public void collectDew(Dewdrop dew) { - - //GLog.i(Messages.get(DewVial.class, "collected")); - volume += dew.quantity; - if (volume >= MAX_VOLUME()) { - volume = MAX_VOLUME(); - GLog.p(Messages.get(DewVial.class, "full")); - } - - updateQuickslot(); - } - - public void collectDew(RedDewdrop dew) { - - //GLog.i(Messages.get(DewVial.class, "collect")); - volume += (dew.quantity*10); - if (volume >= MAX_VOLUME()) { - volume = MAX_VOLUME(); - GLog.p(Messages.get(DewVial.class, "full")); - } - - updateQuickslot(); - } - - public void collectDew(YellowDewdrop dew) { - - //GLog.i(Messages.get(DewVial.class, "collect")); - volume += (dew.quantity*5); - if (volume >= MAX_VOLUME()) { - volume = MAX_VOLUME(); - GLog.p(Messages.get(DewVial.class, "full")); - } - - updateQuickslot(); - } - - public void collectDew(VioletDewdrop dew) { - - //GLog.i(Messages.get(DewVial.class, "collect")); - volume += (dew.quantity*50); - if (volume >= MAX_VOLUME()) { - volume = MAX_VOLUME(); - GLog.p(Messages.get(DewVial.class, "full")); - } - - updateQuickslot(); - } - - - public void fill() { - volume = MAX_VOLUME(); - updateQuickslot(); - } - - // removed as people need a bigger distinction to realize the dew vial - // doesn't revive. - /* - * private static final Glowing WHITE = new Glowing( 0xFFFFCC ); - * - * @Override public Glowing glowing() { return isFull() ? WHITE : null; } - */ - - @Override - public String status() { - return Messages.format(TXT_STATUS, volume); - } - - public String status2() { - return Messages.format(TXT_STATUS2, volume, MAX_VOLUME()); - } - @Override - public String toString() { - return super.toString() + " (" + status2() + ")"; - } - - @Override - public String info() { - - String desc = desc(); - - if (Dungeon.dewWater || Dungeon.dewDraw) - desc += "\n" + Messages.get(this, "desc_v1"); - - if(Dungeon.dewNorn) - desc += "\n" + Messages.get(this, "desc_v2"); - - if(Dungeon.wings) - desc += "\n" + Messages.get(this, "desc_v3"); - - return desc; - - } - -} diff --git a/java/com/hmdzl/spspd/change/items/Dewdrop.java b/java/com/hmdzl/spspd/change/items/Dewdrop.java deleted file mode 100644 index 7ca2f50d..00000000 --- a/java/com/hmdzl/spspd/change/items/Dewdrop.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.hero.HeroClass; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.watabou.noosa.audio.Sample; - -public class Dewdrop extends Item { - - private static final String TXT_VALUE = "%+dHP"; - - { - //name = "dewdrop"; - image = ItemSpriteSheet.DEWDROP; - - stackable = true; - } - - @Override - public boolean doPickUp(Hero hero) { - - DewVial vial = hero.belongings.getItem(DewVial.class); - - if (vial == null || vial.isFull()) { - - int value = 1 + (Dungeon.depth - 1) / 5; - if (hero.heroClass == HeroClass.HUNTRESS) { - value++; - } - - int effect = Math.min(hero.HT - hero.HP, value * quantity); - if (effect > 0) { - hero.HP += effect; - hero.sprite.emitter().burst(Speck.factory(Speck.HEALING), 1); - hero.sprite.showStatus(CharSprite.POSITIVE, Messages.get(this, "value", effect)); - } - - } else if (vial != null) { - - vial.collectDew(this); - - } - - Sample.INSTANCE.play(Assets.SND_DEWDROP); - hero.spendAndNext(TIME_TO_PICK_UP); - - return true; - } -} diff --git a/java/com/hmdzl/spspd/change/items/DolyaSlate.java b/java/com/hmdzl/spspd/change/items/DolyaSlate.java deleted file mode 100644 index 10d59f88..00000000 --- a/java/com/hmdzl/spspd/change/items/DolyaSlate.java +++ /dev/null @@ -1,244 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.actors.mobs.pets.PET; -import com.hmdzl.spspd.change.effects.particles.ElmoParticle; -import com.hmdzl.spspd.change.items.journalpages.JournalPage; -import com.hmdzl.spspd.change.items.keys.IronKey; -import com.hmdzl.spspd.change.items.misc.Spectacles.MagicSight; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.scenes.InterlevelScene; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.hmdzl.spspd.change.windows.WndBag; -import com.hmdzl.spspd.change.windows.WndOtiluke; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.noosa.Game; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundle; - -public class DolyaSlate extends Item { - - public final float TIME_TO_USE = 1; - public final int fullCharge = 1000; - - - public static final String AC_RETURN = "RETURN"; - public static final String AC_ADD = "ADD"; - public static final String AC_PORT = "READ"; - - protected WndBag.Mode mode = WndBag.Mode.JOURNALPAGES; - - - public int returnDepth = -1; - public int returnPos; - - public int charge = 0; - public int level = 1; - - public int checkReading(){ - int lvl=1; - if (Dungeon.hero.buff(MagicSight.class) != null){ - lvl+=1; - } - return lvl; - } - - public int reqCharges(){ - - int calcCharges = Math.round(fullCharge); - return calcCharges; - - } - - - public boolean[] rooms = new boolean[10]; - public boolean[] firsts = new boolean[10]; - - { - //name = "Otiluke's journal"; - image = ItemSpriteSheet.OTILUKES_JOURNAL; - - unique = true; - - //rooms[0] = true; - //firsts[0] = true; - } - - private static final String DEPTH = "depth"; - private static final String POS = "pos"; - private static final String ROOMS = "rooms"; - private static final String FIRSTS = "firsts"; - private static final String CHARGE = "charge"; - private static final String LEVEL = "level"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(DEPTH, returnDepth); - bundle.put(ROOMS, rooms); - bundle.put(CHARGE, charge); - bundle.put(FIRSTS, firsts); - bundle.put(LEVEL, level); - if (returnDepth != -1) { - bundle.put(POS, returnPos); - } - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - returnDepth = bundle.getInt(DEPTH); - returnPos = bundle.getInt(POS); - charge = bundle.getInt(CHARGE); - level = bundle.getInt(LEVEL); - rooms = bundle.getBooleanArray(ROOMS); - firsts = bundle.getBooleanArray(FIRSTS); - } - - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions(hero); - - actions.add(AC_ADD); - - if (returnDepth > 0 && (Dungeon.depth<56 || Dungeon.depth==66 || Dungeon.depth==67) && Dungeon.depth>49 && !hero.petfollow){ - actions.add(AC_RETURN); - } - //charge >= reqCharges() && - if ((charge >= 500 || Badges.checkOtilukeRescued() )&& Dungeon.depth<26 && !hero.petfollow && (level>1 || rooms[0])){ - actions.add(AC_PORT); - } - - return actions; - } - - @Override - public void execute(Hero hero, String action) { - - if (action == AC_PORT) { - if (Dungeon.bossLevel()) { - hero.spend(TIME_TO_USE); - GLog.w(Messages.get(Item.class, "not_here")); - return; - } - } - - if (action == AC_PORT) { - GameScene.show(new WndOtiluke(rooms, this)); - } - - if (action == AC_RETURN) { - hero.spend(TIME_TO_USE); - IronKey key = hero.belongings.getKey(IronKey.class, Dungeon.depth); - if (key!=null){key.detachAll(Dungeon.hero.belongings.backpack);} - updateQuickslot(); - - InterlevelScene.mode = InterlevelScene.Mode.RETURN; - InterlevelScene.returnDepth = returnDepth; - InterlevelScene.returnPos = returnPos; - Game.switchScene(InterlevelScene.class); - returnDepth=-1; - } - - if (action == AC_ADD) { - - GameScene.selectItem(itemSelector, mode, Messages.get(this, "prompt")); - - } - - else { - - super.execute(hero, action); - - } - } - - @Override - public int price() { - return 300*quantity; - } - - public void reset() { - returnDepth = -1; - } - - @Override - public boolean isUpgradable() { - return false; - } - - @Override - public boolean isIdentified() { - return true; - } - - @Override - public String info() { - String info = desc(); - info += "\n\n" + Messages.get(this, "charge",charge,reqCharges()); - return info; - } - - protected WndBag.Listener itemSelector = new WndBag.Listener() { - @Override - public void onSelect(Item item) { - if (item != null && item instanceof JournalPage) { - Hero hero = Dungeon.hero; - int room = ((JournalPage) item).room; - - hero.sprite.operate(hero.pos); - hero.busy(); - hero.spend(2f); - Sample.INSTANCE.play(Assets.SND_BURNING); - hero.sprite.emitter().burst(ElmoParticle.FACTORY, 12); - - item.detach(hero.belongings.backpack); - GLog.h(Messages.get(DolyaSlate.class,"add_page")); - level++; - - if(charge<(fullCharge-500)){ - charge=fullCharge; - } else { - charge+=500; - } - - rooms[room] = true; - firsts[room] = true; - - } - } - }; - - @Override - public String status() { - return Messages.format("%d%%", charge/10); - } - - -} diff --git a/java/com/hmdzl/spspd/change/items/DwarfHammer.java b/java/com/hmdzl/spspd/change/items/DwarfHammer.java deleted file mode 100644 index d736d8a2..00000000 --- a/java/com/hmdzl/spspd/change/items/DwarfHammer.java +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.levels.Terrain; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; - -public class DwarfHammer extends Item { - - public static final float TIME_TO_USE = 1; - - public static final String AC_BREAK = "BREAK"; - - { - //name = "dwarf demon hammer"; - image = ItemSpriteSheet.DWARFHAMMER; - unique = true; - - } - - - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions(hero); - actions.add(AC_BREAK); - - return actions; - } - - @Override - public void execute(Hero hero, String action) { - - if (action == AC_BREAK) { - - if (Dungeon.bossLevel() || Dungeon.depth > 25 || Dungeon.depth < 22) { - hero.spend(DwarfHammer.TIME_TO_USE); - GLog.w(Messages.get(this, "prevent")); - return; - } - - if (!Dungeon.visible[Dungeon.level.exit]) { - hero.spend(DwarfHammer.TIME_TO_USE); - GLog.w(Messages.get(this, "prevent")); - return; - } - - - } - - if (action == AC_BREAK) { - - if (hero.pos != Dungeon.level.exit) { - detach(Dungeon.hero.belongings.backpack); - - Dungeon.level.sealedlevel=false; - - //Dungeon.level.map[Dungeon.level.exit]=Terrain.EMPTY; - //GameScene.updateMap(Dungeon.level.exit); - //Dungeon.observe(); - - Dungeon.level.map[Dungeon.level.exit]=Terrain.EXIT; - GameScene.updateMap(Dungeon.level.exit); - Dungeon.observe(); - - GLog.w(Messages.get(this,"unseal")); - - } - - } else { - GLog.w(Messages.get(this, "prevent")); - super.execute(hero, action); - } - } - - @Override - public boolean isUpgradable() { - return false; - } - - @Override - public boolean isIdentified() { - return true; - } -} diff --git a/java/com/hmdzl/spspd/change/items/Elevator.java b/java/com/hmdzl/spspd/change/items/Elevator.java deleted file mode 100644 index f41cf9e4..00000000 --- a/java/com/hmdzl/spspd/change/items/Elevator.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.items.artifacts.DriedRose; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.scenes.InterlevelScene; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.windows.WndAlchemy; -import com.watabou.noosa.Game; - -import java.util.ArrayList; - -public class Elevator extends Item { - - public static final String AC_UP = "UP"; - - public static final String AC_DOWN = "DOWN"; - - - { - //name = "Elevator"; - image = ItemSpriteSheet.ELEVATOR; - - stackable = true; - - } - - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions(hero); - if (Dungeon.depth < 26 && Dungeon.depth > 1 ){ - actions.add(AC_UP); - actions.add(AC_DOWN);} - return actions; - } - - @Override - public void execute(Hero hero, String action) { - - if (action.equals(AC_UP)) { - InterlevelScene.mode = InterlevelScene.Mode.ASCEND; - Game.switchScene(InterlevelScene.class); - } else if (action.equals(AC_DOWN)) { - InterlevelScene.mode = InterlevelScene.Mode.DESCEND; - Game.switchScene(InterlevelScene.class); - } else { - super.execute(hero, action); - - } - } - - @Override - public boolean isUpgradable() { - return false; - } - - @Override - public boolean isIdentified() { - return true; - } - -} diff --git a/java/com/hmdzl/spspd/change/items/EquipableItem.java b/java/com/hmdzl/spspd/change/items/EquipableItem.java deleted file mode 100644 index 3292ec22..00000000 --- a/java/com/hmdzl/spspd/change/items/EquipableItem.java +++ /dev/null @@ -1,112 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.particles.ShadowParticle; -import com.hmdzl.spspd.change.items.armor.glyphs.Iceglyph; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.audio.Sample; - -public abstract class EquipableItem extends Item { - - public static final String AC_EQUIP = "EQUIP"; - public static final String AC_UNEQUIP = "UNEQUIP"; - - { - - } - - @Override - public void execute(Hero hero, String action) { - if (action.equals(AC_EQUIP)) { - // In addition to equipping itself, item reassigns itself to the - // quickslot - // This is a special case as the item is being removed from - // inventory, but is staying with the hero. - int slot = Dungeon.quickslot.getSlot(this); - doEquip(hero); - if (slot != -1) { - Dungeon.quickslot.setSlot(slot, this); - updateQuickslot(); - } - } else if (action.equals(AC_UNEQUIP)) { - doUnequip(hero, true); - } else { - super.execute(hero, action); - } - } - - @Override - public void doDrop(Hero hero) { - if (!isEquipped(hero) || doUnequip(hero, false, false)) { - super.doDrop(hero); - } - } - - @Override - public void cast(final Hero user, int dst) { - - if (isEquipped(user)) { - if (quantity == 1 && !this.doUnequip(user, false, false)) { - return; - } - } - - super.cast(user, dst); - } - - public static void equipCursed(Hero hero) { - hero.sprite.emitter().burst(ShadowParticle.CURSE, 6); - Sample.INSTANCE.play(Assets.SND_CURSED); - } - - protected float time2equip(Hero hero) { - return 1; - } - - public abstract boolean doEquip(Hero hero); - - public boolean doUnequip(Hero hero, boolean collect, boolean single) { - - if (cursed) { - GLog.w(Messages.get(this,"unequip_cursed", name())); - return false; - } - - if (single) { - hero.spendAndNext(time2equip(hero)); - } else { - hero.spend(time2equip(hero)); - } - - if (collect && !collect(hero.belongings.backpack)) { - Dungeon.level.drop(this, hero.pos); - } - - return true; - } - - final public boolean doUnequip(Hero hero, boolean collect) { - return doUnequip(hero, collect, true); - } - -} diff --git a/java/com/hmdzl/spspd/change/items/ExpOre.java b/java/com/hmdzl/spspd/change/items/ExpOre.java deleted file mode 100644 index ae9939c5..00000000 --- a/java/com/hmdzl/spspd/change/items/ExpOre.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.hero.HeroClass; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.sprites.ItemSprite.Glowing; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -public class ExpOre extends Item { - - public static final String AC_USE = "USE"; - { - //name = "exp ore"; - image = ItemSpriteSheet.STONE; - - stackable=true; - defaultAction = AC_USE; - } - - @Override - public boolean isUpgradable() { - return false; - } - - @Override - public boolean isIdentified() { - return true; - } - - - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions(hero); - actions.add(AC_USE); - return actions; - } - - @Override - public void execute(Hero hero, String action) { - - if (action.equals(AC_USE)) { - curUser = hero; - hero.earnExp(hero.maxExp()); - if (!(Dungeon.hero.heroClass == HeroClass.FOLLOWER ) || (Dungeon.hero.heroClass == HeroClass.FOLLOWER && Random.Int(10)>=1 )) - detach(curUser.belongings.backpack); - } else { - super.execute(hero, action); - - } - } - - @Override - public int price() { - return 100 * quantity; - } -} diff --git a/java/com/hmdzl/spspd/change/items/Flag.java b/java/com/hmdzl/spspd/change/items/Flag.java deleted file mode 100644 index b9dc0e2e..00000000 --- a/java/com/hmdzl/spspd/change/items/Flag.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.HighLight; -import com.hmdzl.spspd.change.actors.buffs.Light; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.particles.FlameParticle; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.watabou.noosa.particles.Emitter; - -public class Flag extends Item { - - { - //name = "flag"; - image = ItemSpriteSheet.FLAG; - - stackable = false; - unique = true; - } - - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions(hero); - actions.remove(AC_DROP); - actions.remove(AC_THROW); - return actions; - } - - @Override - public void execute(Hero hero, String action) { - super.execute(hero, action); - - } - - @Override - public boolean isUpgradable() { - return false; - } - - @Override - public boolean isIdentified() { - return true; - } -} diff --git a/java/com/hmdzl/spspd/change/items/Generator.java b/java/com/hmdzl/spspd/change/items/Generator.java deleted file mode 100644 index 6a5007ed..00000000 --- a/java/com/hmdzl/spspd/change/items/Generator.java +++ /dev/null @@ -1,738 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items; - -import java.util.HashMap; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.blobs.Freezing; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.items.armor.normalarmor.BulletArmor; -import com.hmdzl.spspd.change.items.armor.normalarmor.CDArmor; -import com.hmdzl.spspd.change.items.armor.normalarmor.CeramicsArmor; -import com.hmdzl.spspd.change.items.armor.normalarmor.MachineArmor; -import com.hmdzl.spspd.change.items.armor.normalarmor.MultiplelayerArmor; -import com.hmdzl.spspd.change.items.armor.normalarmor.PhantomArmor; -import com.hmdzl.spspd.change.items.armor.normalarmor.ProtectiveclothingArmor; -import com.hmdzl.spspd.change.items.armor.normalarmor.RubberArmor; -import com.hmdzl.spspd.change.items.armor.normalarmor.StoneArmor; -import com.hmdzl.spspd.change.items.armor.normalarmor.StyrofoamArmor; -import com.hmdzl.spspd.change.items.armor.normalarmor.VestArmor; -import com.hmdzl.spspd.change.items.armor.normalarmor.WoodenArmor; -import com.hmdzl.spspd.change.items.artifacts.AlienBag; -import com.hmdzl.spspd.change.items.artifacts.EtherealChains; -import com.hmdzl.spspd.change.items.artifacts.GlassTotem; -import com.hmdzl.spspd.change.items.artifacts.RobotDMT; -import com.hmdzl.spspd.change.items.bombs.Bomb; -import com.hmdzl.spspd.change.items.bombs.BuildBomb; -import com.hmdzl.spspd.change.items.bombs.DarkBomb; -import com.hmdzl.spspd.change.items.bombs.DungeonBomb; -import com.hmdzl.spspd.change.items.bombs.EarthBomb; -import com.hmdzl.spspd.change.items.bombs.FireBomb; -import com.hmdzl.spspd.change.items.bombs.FishingBomb; -import com.hmdzl.spspd.change.items.bombs.HugeBomb; -import com.hmdzl.spspd.change.items.bombs.IceBomb; -import com.hmdzl.spspd.change.items.bombs.LightBomb; -import com.hmdzl.spspd.change.items.bombs.MiniBomb; -import com.hmdzl.spspd.change.items.bombs.StormBomb; -import com.hmdzl.spspd.change.items.eggs.BlueDragonEgg; -import com.hmdzl.spspd.change.items.eggs.CocoCatEgg; -import com.hmdzl.spspd.change.items.eggs.EasterEgg; -import com.hmdzl.spspd.change.items.eggs.Egg; -import com.hmdzl.spspd.change.items.eggs.GoldDragonEgg; -import com.hmdzl.spspd.change.items.eggs.GreenDragonEgg; -import com.hmdzl.spspd.change.items.eggs.LeryFireEgg; -import com.hmdzl.spspd.change.items.eggs.LightDragonEgg; -import com.hmdzl.spspd.change.items.eggs.RandomEgg; -import com.hmdzl.spspd.change.items.eggs.RedDragonEgg; -import com.hmdzl.spspd.change.items.eggs.ScorpionEgg; -import com.hmdzl.spspd.change.items.eggs.ShadowDragonEgg; -import com.hmdzl.spspd.change.items.eggs.SpiderEgg; -import com.hmdzl.spspd.change.items.eggs.VelociroosterEgg; -import com.hmdzl.spspd.change.items.eggs.VioletDragonEgg; -import com.hmdzl.spspd.change.items.food.completefood.Chickennugget; -import com.hmdzl.spspd.change.items.food.completefood.Chocolate; -import com.hmdzl.spspd.change.items.food.completefood.Foamedbeverage; -import com.hmdzl.spspd.change.items.food.completefood.FoodFans; -import com.hmdzl.spspd.change.items.food.completefood.Frenchfries; -import com.hmdzl.spspd.change.items.food.completefood.Fruitsalad; -import com.hmdzl.spspd.change.items.food.completefood.Gel; -import com.hmdzl.spspd.change.items.food.completefood.Hamburger; -import com.hmdzl.spspd.change.items.food.completefood.Herbmeat; -import com.hmdzl.spspd.change.items.food.completefood.HoneyGel; -import com.hmdzl.spspd.change.items.food.completefood.HoneyWater; -import com.hmdzl.spspd.change.items.food.completefood.Honeymeat; -import com.hmdzl.spspd.change.items.food.completefood.Honeyrice; -import com.hmdzl.spspd.change.items.food.completefood.Icecream; -import com.hmdzl.spspd.change.items.food.completefood.Kebab; -import com.hmdzl.spspd.change.items.food.completefood.Meatroll; -import com.hmdzl.spspd.change.items.food.completefood.PerfectFood; -import com.hmdzl.spspd.change.items.food.completefood.Porksoup; -import com.hmdzl.spspd.change.items.food.completefood.Ricefood; -import com.hmdzl.spspd.change.items.food.completefood.Vegetablekebab; -import com.hmdzl.spspd.change.items.food.completefood.Vegetableroll; -import com.hmdzl.spspd.change.items.food.completefood.Vegetablesoup; -import com.hmdzl.spspd.change.items.food.staplefood.NormalRation; -import com.hmdzl.spspd.change.items.medicine.Hardpill; -import com.hmdzl.spspd.change.items.medicine.Magicpill; -import com.hmdzl.spspd.change.items.medicine.Musicpill; -import com.hmdzl.spspd.change.items.medicine.Pill; -import com.hmdzl.spspd.change.items.medicine.Powerpill; -import com.hmdzl.spspd.change.items.medicine.Shootpill; -import com.hmdzl.spspd.change.items.medicine.Smashpill; -import com.hmdzl.spspd.change.items.medicine.PixieParasol; -import com.hmdzl.spspd.change.items.medicine.GreenSpore; -import com.hmdzl.spspd.change.items.medicine.GoldenJelly; -import com.hmdzl.spspd.change.items.medicine.Earthstar; -import com.hmdzl.spspd.change.items.medicine.DeathCap; -import com.hmdzl.spspd.change.items.medicine.JackOLantern; -import com.hmdzl.spspd.change.items.medicine.BlueMilk; -import com.hmdzl.spspd.change.items.rings.RingOfEnergy; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfSacrifice; -import com.hmdzl.spspd.change.items.summon.ActiveMrDestructo; -import com.hmdzl.spspd.change.items.summon.FairyCard; -import com.hmdzl.spspd.change.items.summon.Mobile; -import com.hmdzl.spspd.change.items.wands.WandOfFlow; -import com.hmdzl.spspd.change.items.wands.WandOfLight; -import com.hmdzl.spspd.change.items.wands.WandOfMeteorite; -import com.hmdzl.spspd.change.items.wands.WandOfTCloud; -import com.hmdzl.spspd.change.items.weapon.guns.GunA; -import com.hmdzl.spspd.change.items.weapon.guns.GunB; -import com.hmdzl.spspd.change.items.weapon.guns.GunC; -import com.hmdzl.spspd.change.items.weapon.guns.GunD; -import com.hmdzl.spspd.change.items.weapon.guns.GunE; -import com.hmdzl.spspd.change.items.weapon.melee.Club; -import com.hmdzl.spspd.change.items.weapon.melee.FightGloves; -import com.hmdzl.spspd.change.items.weapon.melee.Flute; -import com.hmdzl.spspd.change.items.weapon.melee.Harp; -import com.hmdzl.spspd.change.items.weapon.melee.HolyWater; -import com.hmdzl.spspd.change.items.weapon.melee.Lance; -import com.hmdzl.spspd.change.items.weapon.melee.Mace; -import com.hmdzl.spspd.change.items.weapon.melee.PrayerWheel; -import com.hmdzl.spspd.change.items.weapon.melee.Rapier; -import com.hmdzl.spspd.change.items.weapon.melee.StoneCross; -import com.hmdzl.spspd.change.items.weapon.melee.Triangolo; -import com.hmdzl.spspd.change.items.weapon.melee.Trumpet; -import com.hmdzl.spspd.change.items.weapon.melee.Wardurm; -import com.hmdzl.spspd.change.items.weapon.melee.WoodenStaff; -import com.hmdzl.spspd.change.items.weapon.melee.special.Handcannon; -import com.hmdzl.spspd.change.items.weapon.melee.special.Pumpkin; -import com.hmdzl.spspd.change.items.weapon.melee.special.RunicBlade; -import com.hmdzl.spspd.change.items.weapon.missiles.EmpBola; -import com.hmdzl.spspd.change.items.weapon.missiles.EscapeKnive; -import com.hmdzl.spspd.change.items.weapon.missiles.HugeShuriken; -import com.hmdzl.spspd.change.items.weapon.missiles.NormalBomb; -import com.hmdzl.spspd.change.items.weapon.missiles.RiceBall; -import com.hmdzl.spspd.change.items.weapon.missiles.ShatteredAmmo; -import com.hmdzl.spspd.change.items.weapon.missiles.Skull; -import com.hmdzl.spspd.change.items.weapon.missiles.Smoke; -import com.hmdzl.spspd.change.items.weapon.missiles.Wave; -import com.hmdzl.spspd.change.plants.Rotberry; -import com.hmdzl.spspd.change.items.armor.Armor; -import com.hmdzl.spspd.change.items.armor.normalarmor.ClothArmor; -import com.hmdzl.spspd.change.items.armor.normalarmor.LeatherArmor; -import com.hmdzl.spspd.change.items.armor.normalarmor.MailArmor; -import com.hmdzl.spspd.change.items.armor.normalarmor.PlateArmor; -import com.hmdzl.spspd.change.items.armor.normalarmor.DiscArmor; -import com.hmdzl.spspd.change.items.armor.normalarmor.ScaleArmor; -import com.hmdzl.spspd.change.items.armor.normalarmor.ErrorArmor; -import com.hmdzl.spspd.change.items.artifacts.AlchemistsToolkit; -import com.hmdzl.spspd.change.items.artifacts.Artifact; -import com.hmdzl.spspd.change.items.artifacts.CapeOfThorns; -import com.hmdzl.spspd.change.items.artifacts.ChaliceOfBlood; -import com.hmdzl.spspd.change.items.artifacts.CloakOfShadows; -import com.hmdzl.spspd.change.items.artifacts.DriedRose; -import com.hmdzl.spspd.change.items.artifacts.HornOfPlenty; -import com.hmdzl.spspd.change.items.artifacts.MasterThievesArmband; -import com.hmdzl.spspd.change.items.artifacts.EyeOfSkadi; -import com.hmdzl.spspd.change.items.artifacts.SandalsOfNature; -import com.hmdzl.spspd.change.items.artifacts.TalismanOfForesight; -import com.hmdzl.spspd.change.items.artifacts.TimekeepersHourglass; -import com.hmdzl.spspd.change.items.artifacts.UnstableSpellbook; -import com.hmdzl.spspd.change.items.bags.Bag; -import com.hmdzl.spspd.change.items.food.fruit.Blackberry; -import com.hmdzl.spspd.change.items.food.fruit.Blueberry; -import com.hmdzl.spspd.change.items.food.fruit.Cloudberry; -import com.hmdzl.spspd.change.items.food.Food; -import com.hmdzl.spspd.change.items.food.fruit.Moonberry; -import com.hmdzl.spspd.change.items.food.staplefood.Pasty; -import com.hmdzl.spspd.change.items.food.staplefood.OverpricedRation; -import com.hmdzl.spspd.change.items.nornstone.BlueNornStone; -import com.hmdzl.spspd.change.items.nornstone.GreenNornStone; -import com.hmdzl.spspd.change.items.nornstone.NornStone; -import com.hmdzl.spspd.change.items.nornstone.OrangeNornStone; -import com.hmdzl.spspd.change.items.nornstone.PurpleNornStone; -import com.hmdzl.spspd.change.items.nornstone.YellowNornStone; -import com.hmdzl.spspd.change.items.potions.Potion; -import com.hmdzl.spspd.change.items.potions.PotionOfExperience; -import com.hmdzl.spspd.change.items.potions.PotionOfFrost; -import com.hmdzl.spspd.change.items.potions.PotionOfHealing; -import com.hmdzl.spspd.change.items.potions.PotionOfInvisibility; -import com.hmdzl.spspd.change.items.potions.PotionOfLevitation; -import com.hmdzl.spspd.change.items.potions.PotionOfLiquidFlame; -import com.hmdzl.spspd.change.items.potions.PotionOfMending; -import com.hmdzl.spspd.change.items.potions.PotionOfMight; -import com.hmdzl.spspd.change.items.potions.PotionOfMindVision; -import com.hmdzl.spspd.change.items.potions.PotionOfOverHealing; -import com.hmdzl.spspd.change.items.potions.PotionOfParalyticGas; -import com.hmdzl.spspd.change.items.potions.PotionOfPurity; -import com.hmdzl.spspd.change.items.potions.PotionOfStrength; -import com.hmdzl.spspd.change.items.potions.PotionOfToxicGas; -import com.hmdzl.spspd.change.items.rings.Ring; -import com.hmdzl.spspd.change.items.rings.RingOfAccuracy; -import com.hmdzl.spspd.change.items.rings.RingOfElements; -import com.hmdzl.spspd.change.items.rings.RingOfEvasion; -import com.hmdzl.spspd.change.items.rings.RingOfForce; -import com.hmdzl.spspd.change.items.rings.RingOfFuror; -import com.hmdzl.spspd.change.items.rings.RingOfHaste; -import com.hmdzl.spspd.change.items.rings.RingOfMagic; -import com.hmdzl.spspd.change.items.rings.RingOfMight; -import com.hmdzl.spspd.change.items.rings.RingOfSharpshooting; -import com.hmdzl.spspd.change.items.rings.RingOfTenacity; -import com.hmdzl.spspd.change.items.scrolls.Scroll; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfIdentify; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfLullaby; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfMagicMapping; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfMagicalInfusion; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfMirrorImage; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfPsionicBlast; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfRage; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfRecharging; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfRegrowth; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfRemoveCurse; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfTeleportation; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfTerror; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfUpgrade; -import com.hmdzl.spspd.change.items.wands.Wand; -import com.hmdzl.spspd.change.items.wands.WandOfCharm; -import com.hmdzl.spspd.change.items.wands.WandOfBlood; -import com.hmdzl.spspd.change.items.wands.WandOfDisintegration; -import com.hmdzl.spspd.change.items.wands.WandOfFirebolt; -import com.hmdzl.spspd.change.items.wands.WandOfFlock; -import com.hmdzl.spspd.change.items.wands.WandOfLightning; -import com.hmdzl.spspd.change.items.wands.WandOfMagicMissile; -import com.hmdzl.spspd.change.items.wands.WandOfPoison; -import com.hmdzl.spspd.change.items.wands.WandOfFreeze; -import com.hmdzl.spspd.change.items.wands.WandOfAcid; -import com.hmdzl.spspd.change.items.wands.WandOfError; -import com.hmdzl.spspd.change.items.weapon.Weapon; -import com.hmdzl.spspd.change.items.weapon.melee.BattleAxe; -import com.hmdzl.spspd.change.items.weapon.melee.Dualknive; -import com.hmdzl.spspd.change.items.weapon.melee.MageBook; -import com.hmdzl.spspd.change.items.weapon.melee.Nunchakus; -import com.hmdzl.spspd.change.items.weapon.melee.Dagger; -import com.hmdzl.spspd.change.items.weapon.melee.Glaive; -import com.hmdzl.spspd.change.items.weapon.melee.Knuckles; -import com.hmdzl.spspd.change.items.weapon.melee.AssassinsBlade; -import com.hmdzl.spspd.change.items.weapon.melee.Scimitar; -import com.hmdzl.spspd.change.items.weapon.melee.Handaxe; -import com.hmdzl.spspd.change.items.weapon.melee.ShortSword; -import com.hmdzl.spspd.change.items.weapon.melee.Spear; -import com.hmdzl.spspd.change.items.weapon.melee.special.Spork; -import com.hmdzl.spspd.change.items.weapon.melee.Whip; -import com.hmdzl.spspd.change.items.weapon.melee.WarHammer; -import com.hmdzl.spspd.change.items.weapon.melee.Gsword; -import com.hmdzl.spspd.change.items.weapon.melee.Halberd; -import com.hmdzl.spspd.change.items.weapon.melee.special.ErrorW; -import com.hmdzl.spspd.change.items.weapon.melee.special.TekkoKagi; -import com.hmdzl.spspd.change.items.weapon.melee.special.WraithBreath; -import com.hmdzl.spspd.change.items.weapon.missiles.Boomerang; -import com.hmdzl.spspd.change.items.weapon.missiles.PoisonDart; -import com.hmdzl.spspd.change.items.weapon.missiles.IncendiaryDart; -import com.hmdzl.spspd.change.items.weapon.missiles.Tamahawk; -import com.hmdzl.spspd.change.plants.BlandfruitBush; -import com.hmdzl.spspd.change.plants.Blindweed; -import com.hmdzl.spspd.change.plants.Dewcatcher; -import com.hmdzl.spspd.change.plants.Dreamfoil; -import com.hmdzl.spspd.change.plants.Earthroot; -import com.hmdzl.spspd.change.plants.Fadeleaf; -import com.hmdzl.spspd.change.plants.Firebloom; -import com.hmdzl.spspd.change.plants.Flytrap; -import com.hmdzl.spspd.change.plants.Icecap; -import com.hmdzl.spspd.change.plants.Phaseshift; -import com.hmdzl.spspd.change.plants.Seedpod; -import com.hmdzl.spspd.change.plants.Plant; -import com.hmdzl.spspd.change.plants.Sorrowmoss; -import com.hmdzl.spspd.change.plants.Starflower; -import com.hmdzl.spspd.change.plants.Stormvine; -import com.hmdzl.spspd.change.plants.Sungrass; -import com.watabou.utils.Random; - -public class Generator { - - public static enum Category { - WEAPON(150, Weapon.class), MELEEWEAPON( 20,Weapon.class),OLDWEAPON(0,Weapon.class),RANGEWEAPON(20,Weapon.class),GUNWEAPON(0,Weapon.class),ARMOR(100, Armor.class), - POTION(500, Potion.class), SCROLL(400, Scroll.class), WAND(40, Wand.class), RING(15, Ring.class), - ARTIFACT(20, Artifact.class), SEED(5, Plant.Seed.class), SEED2(0, Plant.Seed.class),SEED3(0, Plant.Seed.class), - FOOD(10, Food.class), GOLD(500, Gold.class), BERRY(50, Food.class), MUSHROOM(50, Food.class), BOMBS(20, Bomb.class), - NORNSTONE(0,NornStone.class), EGGS(0, Egg.class), HIGHFOOD(0,Food.class), SUMMONED(1,Item.class), PILL(1, Pill.class),LINKDROP(0, Item.class),MUSICWEAPON(0,Weapon.class); - - public Class[] classes; - public float[] probs; - - public float prob; - public Class superClass; - - private Category(float prob, Class superClass) { - this.prob = prob; - this.superClass = superClass; - } - - public static int order(Item item) { - for (int i = 0; i < values().length; i++) { - if (values()[i].superClass.isInstance(item)) { - return i; - } - } - - return item instanceof Bag ? Integer.MAX_VALUE - : Integer.MAX_VALUE - 1; - } - }; - - private static HashMap categoryProbs = new HashMap(); - - //private static final float[] INITIAL_ARTIFACT_PROBS = new float[]{ 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}; - - static { - - Category.GOLD.classes = new Class[] { Gold.class }; - Category.GOLD.probs = new float[] { 1 }; - - Category.SCROLL.classes = new Class[] { ScrollOfIdentify.class, - ScrollOfTeleportation.class, ScrollOfRemoveCurse.class, - ScrollOfUpgrade.class, ScrollOfRecharging.class, - ScrollOfMagicMapping.class, ScrollOfRage.class, - ScrollOfTerror.class, ScrollOfLullaby.class, - ScrollOfMagicalInfusion.class, ScrollOfPsionicBlast.class, - ScrollOfMirrorImage.class, ScrollOfRegrowth.class, ScrollOfSacrifice.class}; - Category.SCROLL.probs = new float[] { 30, 10, 15, 0, 10, 20, 10, 8, 8, - 0, 3, 6, 0, 0 }; - - Category.POTION.classes = new Class[] { PotionOfHealing.class, - PotionOfExperience.class, PotionOfToxicGas.class, - PotionOfParalyticGas.class, PotionOfLiquidFlame.class, - PotionOfLevitation.class, PotionOfStrength.class, - PotionOfMindVision.class, PotionOfPurity.class, - PotionOfInvisibility.class, PotionOfMight.class, - PotionOfFrost.class, PotionOfMending.class, - PotionOfOverHealing.class, Egg.class}; - Category.POTION.probs = new float[] { 10, 4, 15, 10, 15, 10, 0, 20, 12, - 10, 0, 10, 45, 4, 10}; - - Category.WAND.classes = new Class[] { WandOfAcid.class, - WandOfFreeze.class, WandOfFirebolt.class, - WandOfLight.class, WandOfPoison.class, WandOfBlood.class, - WandOfLightning.class, WandOfCharm.class, - WandOfFlow.class, WandOfFlock.class, - WandOfMagicMissile.class, WandOfDisintegration.class, - WandOfMeteorite.class, WandOfError.class, WandOfTCloud.class}; - Category.WAND.probs = new float[] { 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 0, 5 }; - - Category.WEAPON.classes = new Class[] { ErrorW.class,Pumpkin.class,TekkoKagi.class, - Dagger.class, Knuckles.class, ShortSword.class, MageBook.class, - Handaxe.class, Spear.class, Dualknive.class,WraithBreath.class, FightGloves.class, - Nunchakus.class, Scimitar.class,Whip.class,Spork.class, Rapier.class, - AssassinsBlade.class,BattleAxe.class,Glaive.class,Handcannon.class,Club.class, - Gsword.class, Halberd.class, WarHammer.class, RunicBlade.class, Lance.class, - Triangolo.class, Flute.class, Wardurm.class, Trumpet.class, Harp.class, - WoodenStaff.class, Mace.class, HolyWater.class, PrayerWheel.class, StoneCross.class - }; - Category.WEAPON.probs = new float[] { - 0,0,0, - 1,1,1,1, - 1,1,1,0,1, - 1,1,1,0,1, - 1,1,1,0,1, - 1,1,1,0,1, - 1,1,1,1,1, - 1,1,1,1,1, - }; - - Category.RANGEWEAPON.classes = new Class[] { - EmpBola.class ,EscapeKnive.class,PoisonDart.class,Smoke.class,IncendiaryDart.class,Tamahawk.class, - Skull.class, RiceBall.class, Wave.class, ShatteredAmmo.class, HugeShuriken.class, NormalBomb.class, - Boomerang.class}; - Category.RANGEWEAPON.probs = new float[] { - 1,1,1,1,1,1, - 1,1,1,1,1,1, - 0 - }; - - Category.MELEEWEAPON.classes = new Class[] { - Dagger.class, Knuckles.class, ShortSword.class, MageBook.class, - Handaxe.class, Spear.class, Dualknive.class, FightGloves.class, - Nunchakus.class, Scimitar.class,Whip.class, Rapier.class, - AssassinsBlade.class,BattleAxe.class,Glaive.class,Club.class, - Gsword.class, Halberd.class, WarHammer.class, Lance.class, - Triangolo.class, Flute.class, Wardurm.class, Trumpet.class, Harp.class, - WoodenStaff.class, Mace.class, HolyWater.class, PrayerWheel.class, StoneCross.class}; - Category.MELEEWEAPON.probs = new float[] { - 1,1,1,1, - 1,1,1,1, - 1,1,1,1, - 1,1,1,1, - 1,1,1,1, - 1,1,1,1,1, - 1,1,1,1,1, - }; - - Category.OLDWEAPON.classes = new Class[] { - Dagger.class, Knuckles.class, ShortSword.class, MageBook.class, - Handaxe.class, Spear.class, Dualknive.class, FightGloves.class, - Nunchakus.class, Scimitar.class,Whip.class, Rapier.class, - AssassinsBlade.class,BattleAxe.class,Glaive.class,Club.class, - Gsword.class, Halberd.class, WarHammer.class, Lance.class,}; - Category.OLDWEAPON.probs = new float[] { - 1,1,1,1, - 1,1,1,1, - 1,1,1,1, - 1,1,1,1, - 1,1,1,1, - }; - - Category.GUNWEAPON.classes = new Class[] { - GunA.class, GunB.class, GunC.class, GunD.class, GunE.class}; - Category.GUNWEAPON.probs = new float[] { - 1,1,1,1,1, - }; - - Category.MUSICWEAPON.classes = new Class[] { - Triangolo.class, Flute.class, Wardurm.class, Trumpet.class, Harp.class}; - Category.MUSICWEAPON.probs = new float[] { - 1,1,1,1,1, - }; - - Category.ARMOR.classes = new Class[] { - ClothArmor.class, WoodenArmor.class, VestArmor.class, - LeatherArmor.class, CeramicsArmor.class, RubberArmor.class, - DiscArmor.class, StoneArmor.class, CDArmor.class, - MailArmor.class, MultiplelayerArmor.class, StyrofoamArmor.class, - ScaleArmor.class, BulletArmor.class, ProtectiveclothingArmor.class, - PlateArmor.class, MachineArmor.class, PhantomArmor.class, - ErrorArmor.class }; - Category.ARMOR.probs = new float[] { - 1, 1, 1, - 1, 1, 1, - 1, 1, 1, - 1, 1, 1, - 1, 1, 1, - 1, 1, 1, - 0 }; - - Category.FOOD.classes = new Class[] { NormalRation.class, Pasty.class, OverpricedRation.class}; - Category.FOOD.probs = new float[] { 8, 2, 5 }; - - Category.RING.classes = new Class[] { RingOfAccuracy.class, - RingOfEvasion.class, RingOfElements.class, RingOfForce.class, - RingOfFuror.class, RingOfHaste.class, RingOfMagic.class, - RingOfMight.class, RingOfSharpshooting.class, - RingOfTenacity.class, RingOfEnergy.class }; - Category.RING.probs = new float[] { 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10 }; - - Category.ARTIFACT.classes = new Class[] { CapeOfThorns.class, - ChaliceOfBlood.class, CloakOfShadows.class, HornOfPlenty.class, - MasterThievesArmband.class, SandalsOfNature.class, - TalismanOfForesight.class, TimekeepersHourglass.class, - UnstableSpellbook.class, AlchemistsToolkit.class, RobotDMT.class, - EyeOfSkadi.class, EtherealChains.class, - DriedRose.class, GlassTotem.class, AlienBag.class - }; - Category.ARTIFACT.probs = new float[]{ 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}; - - Category.SEED.classes = new Class[] { - Firebloom.Seed.class, Icecap.Seed.class, Sorrowmoss.Seed.class, Blindweed.Seed.class, Sungrass.Seed.class, - Earthroot.Seed.class, Fadeleaf.Seed.class, Rotberry.Seed.class, BlandfruitBush.Seed.class, Dreamfoil.Seed.class, - Stormvine.Seed.class, /*Nut.class, Vegetable.class,Blackberry.class, Blueberry.class, Cloudberry.class, - Moonberry.class,*/ Starflower.Seed.class, Phaseshift.Seed.class, Flytrap.Seed.class, Dewcatcher.Seed.class, Seedpod.Seed.class}; - - Category.SEED.probs = new float[] { 12, 12, 12, 12, 12, - 12, 12, 0, 4, 12, - 12,/* 48, 36, 20, 4, 16, - 4,*/ 3, 3, 4, 8, 2}; - - - Category.SEED2.classes = new Class[] { Firebloom.Seed.class, - Icecap.Seed.class, Sorrowmoss.Seed.class, Blindweed.Seed.class, - Stormvine.Seed.class, Starflower.Seed.class}; - - Category.SEED2.probs = new float[] { 8, 4, 6, 4, 3, 1 }; - - Category.SEED3.classes = new Class[] {Sungrass.Seed.class, Earthroot.Seed.class, BlandfruitBush.Seed.class, Dreamfoil.Seed.class, - Starflower.Seed.class, Dewcatcher.Seed.class, Seedpod.Seed.class}; - - Category.SEED3.probs = new float[] { 8, 4, 3, 4, 3, 1 , 1 }; - - - Category.BERRY.classes = new Class[] {Blackberry.class, Blueberry.class, Cloudberry.class, Moonberry.class}; - Category.BERRY.probs = new float[] {6,3,2,1}; - - Category.MUSHROOM.classes = new Class[] {BlueMilk.class, DeathCap.class, Earthstar.class, JackOLantern.class, PixieParasol.class, GoldenJelly.class, GreenSpore.class}; - Category.MUSHROOM.probs = new float[] {4,3,3,3,3,3,2}; - - Category.NORNSTONE.classes = new Class[] {BlueNornStone.class, GreenNornStone.class, OrangeNornStone.class, PurpleNornStone.class, YellowNornStone.class}; - Category.NORNSTONE.probs = new float[] {2,2,2,2,2}; - - Category.EGGS.classes = new Class[] { BlueDragonEgg.class, CocoCatEgg.class, EasterEgg.class,Egg.class, - LightDragonEgg.class, GreenDragonEgg.class, LeryFireEgg.class, RedDragonEgg.class, ScorpionEgg.class, - ShadowDragonEgg.class, SpiderEgg.class, VelociroosterEgg.class, VioletDragonEgg.class, - GoldDragonEgg.class, RandomEgg.class }; - Category.EGGS.probs = new float[] {1,0,1,1,1,1,1,1,1,1,1,1,1,1,1}; - - Category.HIGHFOOD.classes = new Class[] { Chickennugget.class,Foamedbeverage.class,Fruitsalad.class, - Hamburger.class,Herbmeat.class,Honeymeat.class,Honeyrice.class, - Icecream.class,Kebab.class,PerfectFood.class,Porksoup.class, - Ricefood.class,Vegetablekebab.class,Vegetablesoup.class, - Meatroll.class,Vegetableroll.class,HoneyGel.class,Gel.class,HoneyWater.class, - Chocolate.class, FoodFans.class,Frenchfries.class}; - Category.HIGHFOOD.probs = new float[] { 1,1,1,1, - 1,1,1,1, - 1,1,1,1, - 1,1,1, - 1,1,1,1,1, - 1,1,1}; - Category.BOMBS.classes = new Class[] { BuildBomb.class,DungeonBomb.class, - HugeBomb.class,MiniBomb.class, - FireBomb.class,IceBomb.class,EarthBomb.class,StormBomb.class, - LightBomb.class,DarkBomb.class,FishingBomb.class - }; - Category.BOMBS.probs = new float[] { 0,3, - 0,1, - 1,1,1,1, - 1,1,1}; - Category.SUMMONED.classes = new Class[] {ActiveMrDestructo.class,Mobile.class,FairyCard.class - - }; - Category.SUMMONED.probs = new float[] { 1,1,1}; - - Category.PILL.classes = new Class[] {Hardpill.class, Magicpill.class,Musicpill.class, - Powerpill.class, Shootpill.class, Smashpill.class - }; - Category.PILL.probs = new float[] { 1,1,1,1,1,1}; - - Category.LINKDROP.classes = new Class[] { - BuildBomb.class,DungeonBomb.class, - HugeBomb.class,MiniBomb.class, FireBomb.class,IceBomb.class,EarthBomb.class,StormBomb.class, - LightBomb.class,DarkBomb.class,FishingBomb.class, - EmpBola.class ,EscapeKnive.class,PoisonDart.class,Smoke.class,IncendiaryDart.class,Tamahawk.class, - Skull.class, RiceBall.class, Wave.class, ShatteredAmmo.class, HugeShuriken.class, NormalBomb.class, - }; - Category.LINKDROP.probs = new float[] { 3,1, - 1,1,1,1,1,1, - 1,1,1, - 2,2,2,2,2,2, - 2,2,2,2,2,2}; - } - - public static void reset() { - for (Category cat : Category.values()) { - categoryProbs.put(cat, cat.prob); - } - } - - public static Item random() { - return random(Random.chances(categoryProbs)); - } - - public static Item random(Category cat) { - try { - - categoryProbs.put(cat, categoryProbs.get(cat) / 2); - - switch (cat) { - case ARMOR: - return randomArmor(); - case WEAPON: - return randomWeapon(); - case ARTIFACT: - return randomArtifact(); - case RING: - return randomRing(); - default: - return ((Item) cat.classes[Random.chances(cat.probs)] - .newInstance()).random(); - } - - } catch (Exception e) { - - return null; - - } - } - - public static Item random(Class cl) { - try { - - return ((Item) cl.newInstance()).random(); - - } catch (Exception e) { - - return null; - - } - } - - public static Armor randomArmor() { - int curStr = Hero.STARTING_STR - + Dungeon.limitedDrops.strengthPotions.count; - - return randomArmor(curStr); - } - - public static Armor randomArmor(int targetStr) { - - Category cat = Category.ARMOR; - - try { - Armor a1 = (Armor) cat.classes[Random.chances(cat.probs)] - .newInstance(); - Armor a2 = (Armor) cat.classes[Random.chances(cat.probs)] - .newInstance(); - - a1.random(); - a2.random(); - - return Math.abs(targetStr - a1.STR) < Math.abs(targetStr - a2.STR) ? a1 - : a2; - } catch (Exception e) { - return null; - } - } - - public static Weapon randomWeapon() { - int curStr = Hero.STARTING_STR - + Dungeon.limitedDrops.strengthPotions.count; - - return randomWeapon(curStr); - } - - public static Weapon randomWeapon(int targetStr) { - - try { - Category cat = Category.WEAPON; - - Weapon w1 = (Weapon) cat.classes[Random.chances(cat.probs)] - .newInstance(); - Weapon w2 = (Weapon) cat.classes[Random.chances(cat.probs)] - .newInstance(); - - w1.random(); - w2.random(); - - return Math.abs(targetStr - w1.STR) < Math.abs(targetStr - w2.STR) ? w1 - : w2; - } catch (Exception e) { - return null; - } - } - - // enforces uniqueness of artifacts throughout a run. - public static Artifact randomArtifact() { - - try { - Category cat = Category.ARTIFACT; - - Artifact t1 = (Artifact) cat.classes[Random.chances(cat.probs)] - .newInstance(); - Artifact t2 = (Artifact) cat.classes[Random.chances(cat.probs)] - .newInstance(); - - t1.random(); - t2.random(); - - return Random.Int(6) > 2 ? t1 : t2; - - } catch (Exception e) { - //Log.e("PD", Log.getStackTraceString(e)); - return null; - } - } - - public static Ring randomRing() { - - try { - Category cat = Category.RING; - - Ring r1 = (Ring) cat.classes[Random.chances(cat.probs)] - .newInstance(); - Ring r2 = (Ring) cat.classes[Random.chances(cat.probs)] - .newInstance(); - - r1.random(); - r2.random(); - - return Random.Int(6) > 2 ? r1 : r2; - - } catch (Exception e) { - //Log.e("PD", Log.getStackTraceString(e)); - return null; - } - } - - /*public static boolean removeArtifact(Artifact artifact) { - if (spawnedArtifacts.contains(artifact.getClass().getSimpleName())) - return false; - - Category cat = Category.ARTIFACT; - for (int i = 0; i < cat.classes.length; i++) - if (cat.classes[i].equals(artifact.getClass())) { - if (cat.probs[i] > 0) { - cat.probs[i] = 0; - spawnedArtifacts.add(artifact.getClass().getSimpleName()); - return true; - } else - return false; - } - - return false; - }*/ - - // resets artifact probabilities, for new dungeons - /*public static void initArtifacts() { - spawnedArtifacts.clear(); - Category.ARTIFACT.probs = INITIAL_ARTIFACT_PROBS; - //checks for dried rose quest completion, adds the rose in accordingly. - if (Ghost.Quest.processed) Category.ARTIFACT.probs[12] = 1; - }*/ - - //private static ArrayList spawnedArtifacts = new ArrayList(); - - //private static final String ARTIFACTS = "artifacts"; - - // used to store information on which artifacts have been spawned. -/* public static void storeInBundle(Bundle bundle) { - bundle.put(ARTIFACTS, - spawnedArtifacts.toArray(new String[spawnedArtifacts.size()])); - }*/ - - /*public static void restoreFromBundle(Bundle bundle) { - initArtifacts(); - - if (bundle.contains(ARTIFACTS)) { - Category cat = Category.ARTIFACT; - - for (String artifact : spawnedArtifacts) - for (int i = 0; i < cat.classes.length; i++) - if ((cat.classes[i].getSimpleName().equals(artifact)) && (cat.probs[i] > 0)) { - cat.probs[i] = 0; - spawnedArtifacts.add(artifact); - } - } - }*/ -} diff --git a/java/com/hmdzl/spspd/change/items/Gold.java b/java/com/hmdzl/spspd/change/items/Gold.java deleted file mode 100644 index 42f135a2..00000000 --- a/java/com/hmdzl/spspd/change/items/Gold.java +++ /dev/null @@ -1,117 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.Statistics; -import com.hmdzl.spspd.change.actors.buffs.GoldTouch; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.items.artifacts.MasterThievesArmband; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.messages.Messages; - -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -public class Gold extends Item { - - private static final String TXT_COLLECT = "Collect gold coins to spend them later in a shop."; - private static final String TXT_INFO = "A pile of %d gold coins. " - + TXT_COLLECT; - private static final String TXT_INFO_1 = "One gold coin. " + TXT_COLLECT; - private static final String TXT_VALUE = "%+d"; - - { - //name = "gold"; - image = ItemSpriteSheet.GOLD; - stackable = true; - } - - public Gold() { - this(1); - } - - public Gold(int value) { - this.quantity = value; - } - - @Override - public ArrayList actions(Hero hero) { - return new ArrayList(); - } - - @Override - public boolean doPickUp(Hero hero) { - - Dungeon.gold += quantity; - Statistics.goldCollected += quantity; - Badges.validateGoldCollected(); - - MasterThievesArmband.Thievery thievery = hero - .buff(MasterThievesArmband.Thievery.class); - GoldTouch goldtouch = hero - .buff(GoldTouch.class); - if (thievery != null && goldtouch == null) - thievery.collect(quantity); - - GameScene.pickUp(this); - hero.sprite.showStatus(CharSprite.NEUTRAL, TXT_VALUE, quantity); - hero.spendAndNext(TIME_TO_PICK_UP); - - Sample.INSTANCE.play(Assets.SND_GOLD, 1, 1, Random.Float(0.9f, 1.1f)); - - return true; - } - - @Override - public boolean isUpgradable() { - return false; - } - - @Override - public boolean isIdentified() { - return true; - } - - @Override - public Item random() { - quantity = Random.Int(30 + Dungeon.depth * 10, 60 + Dungeon.depth * 20); - return this; - } - - private static final String VALUE = "value"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(VALUE, quantity); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - quantity = bundle.getInt(VALUE); - } -} diff --git a/java/com/hmdzl/spspd/change/items/GreaterStylus.java b/java/com/hmdzl/spspd/change/items/GreaterStylus.java deleted file mode 100644 index 2840f4f4..00000000 --- a/java/com/hmdzl/spspd/change/items/GreaterStylus.java +++ /dev/null @@ -1,118 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.particles.PurpleParticle; -import com.hmdzl.spspd.change.items.armor.Armor; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.hmdzl.spspd.change.windows.WndBag; -import com.watabou.noosa.audio.Sample; - -public class GreaterStylus extends Item { - - private static final String TXT_SELECT_ARMOR = "Select an armor to inscribe on"; - private static final String TXT_INSCRIBED = "you inscribed your %s with the stylus"; - - private static final float TIME_TO_INSCRIBE = 2; - - private static final String AC_INSCRIBE = "INSCRIBE"; - - { - name = "greater arcane stylus"; - image = ItemSpriteSheet.STYLUS; - - stackable = true; - - - } - - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions(hero); - actions.add(AC_INSCRIBE); - return actions; - } - - @Override - public void execute(Hero hero, String action) { - if (action == AC_INSCRIBE) { - - curUser = hero; - GameScene.selectItem(itemSelector, WndBag.Mode.ARMOR, - TXT_SELECT_ARMOR); - - } else { - - super.execute(hero, action); - - } - } - - @Override - public boolean isUpgradable() { - return false; - } - - @Override - public boolean isIdentified() { - return true; - } - - private void inscribe(Armor armor) { - - detach(curUser.belongings.backpack); - - GLog.w(TXT_INSCRIBED, armor.name()); - - armor.hasglyph(); - - curUser.sprite.operate(curUser.pos); - curUser.sprite.centerEmitter().start(PurpleParticle.BURST, 0.05f, 10); - Sample.INSTANCE.play(Assets.SND_BURNING); - - curUser.spend(TIME_TO_INSCRIBE); - curUser.busy(); - } - - @Override - public int price() { - return 30 * quantity; - } - - @Override - public String info() { - return "This arcane stylus is made of some dark, very hard stone. Using it you can inscribe " - + "a magical glyph on your armor, but you have no power over choosing what glyph it will be, " - + "the stylus will decide it for you."; - } - - private final WndBag.Listener itemSelector = new WndBag.Listener() { - @Override - public void onSelect(Item item) { - if (item != null) { - GreaterStylus.this.inscribe((Armor) item); - } - } - }; -} diff --git a/java/com/hmdzl/spspd/change/items/Heap.java b/java/com/hmdzl/spspd/change/items/Heap.java deleted file mode 100644 index ed38b1ea..00000000 --- a/java/com/hmdzl/spspd/change/items/Heap.java +++ /dev/null @@ -1,677 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items; - -import java.util.Collection; -import java.util.Collections; -import java.util.LinkedList; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.Statistics; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Burning; -import com.hmdzl.spspd.change.actors.buffs.Frost; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.mobs.Mimic; -import com.hmdzl.spspd.change.actors.mobs.RedWraith; -import com.hmdzl.spspd.change.actors.mobs.Wraith; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.effects.Splash; -import com.hmdzl.spspd.change.effects.particles.ElmoParticle; -import com.hmdzl.spspd.change.effects.particles.FlameParticle; -import com.hmdzl.spspd.change.effects.particles.ShadowParticle; -import com.hmdzl.spspd.change.items.artifacts.AlchemistsToolkit; -import com.hmdzl.spspd.change.items.bombs.Bomb; -import com.hmdzl.spspd.change.items.eggs.Egg; -import com.hmdzl.spspd.change.items.food.fruit.Blandfruit; -import com.hmdzl.spspd.change.items.food.meatfood.ChargrilledMeat; -import com.hmdzl.spspd.change.items.food.meatfood.FrozenCarpaccio; -import com.hmdzl.spspd.change.items.food.meatfood.Meat; -import com.hmdzl.spspd.change.items.food.meatfood.MysteryMeat; -import com.hmdzl.spspd.change.items.nornstone.NornStone; -import com.hmdzl.spspd.change.items.potions.Potion; -import com.hmdzl.spspd.change.items.potions.PotionOfExperience; -import com.hmdzl.spspd.change.items.potions.PotionOfMight; -import com.hmdzl.spspd.change.items.potions.PotionOfStrength; -import com.hmdzl.spspd.change.items.scrolls.Scroll; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfUpgrade; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfMagicalInfusion; -import com.hmdzl.spspd.change.items.weapon.Weapon; -import com.hmdzl.spspd.change.items.weapon.melee.relic.AresSword; -import com.hmdzl.spspd.change.items.weapon.melee.relic.CromCruachAxe; -import com.hmdzl.spspd.change.items.weapon.melee.relic.LokisFlail; -import com.hmdzl.spspd.change.items.weapon.melee.relic.NeptunusTrident; -import com.hmdzl.spspd.change.items.weapon.melee.relic.JupitersWraith; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.plants.Plant.Seed; -import com.hmdzl.spspd.change.sprites.ItemSprite; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundlable; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -public class Heap implements Bundlable { - - private static final int SEEDS_TO_POTION = 3; - - public enum Type { - HEAP, FOR_SALE, CHEST, LOCKED_CHEST, CRYSTAL_CHEST, TOMB, SKELETON, REMAINS, MIMIC //,MONSTERBOX - } - - public Type type = Type.HEAP; - - public int pos = 0; - - public ItemSprite sprite; - public boolean seen = false; - - public LinkedList items = new LinkedList(); - - public int image() { - switch (type) { - case HEAP: - case FOR_SALE: - return size() > 0 ? items.peek().image() : 0; - case CHEST: - case MIMIC: - return ItemSpriteSheet.CHEST; - case LOCKED_CHEST: - return ItemSpriteSheet.LOCKED_CHEST; - case CRYSTAL_CHEST: - return ItemSpriteSheet.CRYSTAL_CHEST; - case TOMB: - return ItemSpriteSheet.TOMB; - case SKELETON: - return ItemSpriteSheet.BONES; - case REMAINS: - return ItemSpriteSheet.REMAINS; - //case MONSTERBOX: - // return ItemSpriteSheet.LOCKED_CHEST; - default: - return 0; - } - } - - - public boolean chestCheck() { - switch (type) { - case HEAP: - case FOR_SALE: - case TOMB: - case SKELETON: - case REMAINS: - return false; - case CRYSTAL_CHEST: - case LOCKED_CHEST: - case MIMIC: - case CHEST: - return true; - default: - return false; - } - } - - - public ItemSprite.Glowing glowing() { - return (type == Type.HEAP || type == Type.FOR_SALE) && items.size() > 0 ? items - .peek().glowing() : null; - } - - public void open(Hero hero) { - switch (type) { - //case MONSTERBOX: - // if (MonsterBox.spawnAt(pos, items) != null) { - // GLog.n(TXT_MONSTERBOX); - // destroy(); - // } else { - // type = Type.CHEST; - // } - case MIMIC: - if (Mimic.spawnAt(pos, items) != null) { - GLog.n(Messages.get(this,"mimic")); - destroy(); - } else { - type = Type.CHEST; - } - break; - case TOMB: - Wraith.spawnAround(hero.pos); - break; - case SKELETON: - case REMAINS: - CellEmitter.center(pos).start(Speck.factory(Speck.RATTLE), 0.1f, 3); - for (Item item : items) { - - if (RedWraith.spawnAt(pos) == null) { - hero.sprite.emitter().burst(ShadowParticle.CURSE, 6); - hero.damage(hero.HP / 2, this); - } - Sample.INSTANCE.play(Assets.SND_CURSED); - break; - } - - break; - default: - } - - //if (type != Type.MIMIC && type != Type.MONSTERBOX) { - if (type != Type.MIMIC) { - type = Type.HEAP; - sprite.link(); - sprite.drop(); - } - } - - public int size() { - return items.size(); - } - - public Item pickUp() { - - Item item = items.removeFirst(); - if (items.isEmpty()) { - destroy(); - } else if (sprite != null) { - sprite.view(image(), glowing()); - } - - return item; - } - - public Item peek() { - return items.peek(); - } - - public void drop(Item item) { - - if (item.stackable && type != Type.FOR_SALE) { - - for (Item i : items) { - if (i.isSimilar(item)) { - i.quantity += item.quantity; - item = i; - break; - } - } - items.remove(item); - - } - - if ((item instanceof Dewdrop || item instanceof YellowDewdrop || item instanceof RedDewdrop || item instanceof VioletDewdrop) && type != Type.FOR_SALE ) { - items.add(item); - } else { - items.addFirst(item); - } - - if (sprite != null) { - sprite.view(image(), glowing()); - } - } - - public void spdrop(Item item) { - - items.add(item); - - if (sprite != null) { - sprite.view(image(), glowing()); - } - } - - - - public void replace(Item a, Item b) { - int index = items.indexOf(a); - if (index != -1) { - items.remove(index); - items.add(index, b); - } - } - - public void burn() { - - if (type == Type.MIMIC) { - Mimic m = Mimic.spawnAt(pos, items); - if (m != null) { - Buff.affect(m, Burning.class).reignite(m); - m.sprite.emitter().burst(FlameParticle.FACTORY, 5); - destroy(); - } - } - - if (type != Type.HEAP) { - return; - } - - boolean burnt = false; - boolean evaporated = false; - - for (Item item : items.toArray(new Item[0])) { - if (item instanceof Scroll - && !(item instanceof ScrollOfUpgrade || item instanceof ScrollOfMagicalInfusion)) { - items.remove(item); - burnt = true; - } else if (item instanceof Egg) { - ((Egg) item).burns++; - burnt = true; - } else if (item instanceof MysteryMeat) { - replace(item, ChargrilledMeat.cook((MysteryMeat) item)); - burnt = true; - } else if (item instanceof Meat) { - replace(item, ChargrilledMeat.cook((Meat) item)); - burnt = true; - //} else if (item instanceof Nut) { - //replace(item, ToastedNut.cook((Nut) item)); - //burnt = true; - //} else if (item instanceof Bomb) { - //items.remove(item); - //((Bomb) item).explode(pos); - // stop processing the burning, it will be replaced by the - // explosion. - //return; - } - } - - if (burnt || evaporated) { - - if (Dungeon.visible[pos]) { - if (burnt) { - burnFX(pos); - } else { - evaporateFX(pos); - } - } - - if (isEmpty()) { - destroy(); - } else if (sprite != null) { - sprite.view(image(), glowing()); - } - - } - } - - // Note: should not be called to initiate an explosion, but rather by an - // explosion that is happening. - public void explode() { - - // breaks open most standard containers, mimics die. - if (type == Type.MIMIC || type == Type.CHEST || type == Type.SKELETON) { - type = Type.HEAP; - sprite.link(); - sprite.drop(); - return; - } - - if (type != Type.HEAP) { - - return; - - } else { - - for (Item item : items.toArray(new Item[0])) { - - if (item instanceof Bomb) { - - items.remove(item); - ((Bomb) item).explode(pos); - - if (((Bomb) item).explodesDestructively()) { - //stop processing current explosion, it will be replaced by the new one. - return; - } - // unique and upgraded items can endure the blast - } else if (!(item.level > 0 || item.unique)) - items.remove(item); - - } - - if (items.isEmpty()) - destroy(); - } - - } - - /* - public void dewcollect() { - - - for (Item item : items.toArray(new Item[0])) { - - if (item instanceof Dewdrop || - item instanceof YellowDewdrop || - item instanceof RedDewdrop) { - - item.doPickUp(Dungeon.hero); - } - } - } - */ - public int dewdrops(){ - - if (type != Type.HEAP) { - return 0; - } - - int drops=0; - - for (Item item : items.toArray(new Item[0])) { - if (item instanceof Dewdrop) { - drops++; - } else if (item instanceof VioletDewdrop) { - drops++; - } else if (item instanceof RedDewdrop) { - drops++; - } else if (item instanceof YellowDewdrop) { - drops++; - } - } - - return drops; - } - - - public void lit() { - if (type != Type.HEAP) { - return; - } - for (Item item : items.toArray(new Item[0])) { - if (item instanceof Egg) { - ((Egg) item).lits++; - } - } - } - - - public void summon() { - if (type != Type.HEAP) { - return; - } - for (Item item : items.toArray(new Item[0])) { - if (item instanceof Egg) { - ((Egg) item).summons++; - } - } - } - - public void poison() { - if (type != Type.HEAP) { - return; - } - for (Item item : items.toArray(new Item[0])) { - if (item instanceof Egg) { - ((Egg) item).poisons++; - } - } - } - - public void light() { - if (type != Type.HEAP) { - return; - } - for (Item item : items.toArray(new Item[0])) { - if (item instanceof Egg) { - ((Egg) item).light++; - } - } - } - - public void freeze() { - - if (type == Type.MIMIC) { - Mimic m = Mimic.spawnAt(pos, items); - if (m != null) { - Buff.prolong(m, Frost.class, - Frost.duration(m) * Random.Float(1.0f, 1.5f)); - destroy(); - } - } - - - if (type != Type.HEAP) { - return; - } - - boolean frozen = false; - for (Item item : items.toArray(new Item[0])) { - if (item instanceof MysteryMeat) { - replace(item, FrozenCarpaccio.cook((MysteryMeat) item)); - frozen = true; - } else if (item instanceof Potion - && !(item instanceof PotionOfStrength || item instanceof PotionOfMight)) { - items.remove(item); - ((Potion) item).shatter(pos); - frozen = true; - }else if (item instanceof Egg) { - ((Egg) item).freezes++; - frozen = true; - } else if (item instanceof Bomb) { - ((Bomb) item).fuse = null; - frozen = true; - } else if (item instanceof Meat) { - replace(item, FrozenCarpaccio.cook((Meat) item)); - frozen = true; - } - } - - if (frozen) { - if (isEmpty()) { - destroy(); - } else if (sprite != null) { - sprite.view(image(), glowing()); - } - } - } - - public Item transmute() { - - CellEmitter.get(pos).burst(Speck.factory(Speck.BUBBLE), 3); - Splash.at(pos, 0xFFFFFF, 3); - - float chances[] = new float[items.size()]; - int count = 0; - - if (items.size() == 2 && items.get(0) instanceof Seed - && items.get(1) instanceof Blandfruit) { - - Sample.INSTANCE.play(Assets.SND_PUFF); - CellEmitter.center(pos).burst(Speck.factory(Speck.EVOKE), 3); - - Blandfruit result = new Blandfruit(); - result.cook((Seed) items.get(0)); - - destroy(); - - return result; - - } - - int index = 0; - for (Item item : items) { - if (item instanceof Seed) { - count += item.quantity; - chances[index++] = item.quantity; - } else { - count = 0; - break; - } - } - - // alchemists toolkit gives a chance to cook a potion in two or even one - // seeds - AlchemistsToolkit.alchemy alchemy = Dungeon.hero - .buff(AlchemistsToolkit.alchemy.class); - int bonus = alchemy != null ? alchemy.level() : -1; - - if (bonus != -1 ? alchemy.tryCook(count) : count >= SEEDS_TO_POTION) { - - CellEmitter.get(pos).burst(Speck.factory(Speck.WOOL), 6); - Sample.INSTANCE.play(Assets.SND_PUFF); - - Item potion; - - if (Random.Int(count + bonus) == 0) { - - CellEmitter.center(pos).burst(Speck.factory(Speck.EVOKE), 3); - - destroy(); - - Statistics.potionsCooked++; - Badges.validatePotionsCooked(); - - potion = Generator.random(Generator.Category.POTION); - - } else { - - Seed proto = (Seed) items.get(Random.chances(chances)); - Class itemClass = proto.alchemyClass; - - destroy(); - - Statistics.potionsCooked++; - Badges.validatePotionsCooked(); - - if (itemClass == null) { - potion = Generator.random(Generator.Category.POTION); - } else { - try { - potion = itemClass.newInstance(); - } catch (Exception e) { - return null; - } - } - } - - // not a buff per-se, meant to cancel out higher potion accuracy - // when ppl are farming for potions of exp. - if (bonus > 0) - if (Random.Int(1000 / bonus) == 0) - return new PotionOfExperience(); - - return potion; - - } else { - return null; - } - } - - public Weapon consecrate() { - - CellEmitter.get(pos).burst(Speck.factory(Speck.FORGE), 3); - Splash.at(pos, 0xFFFFFF, 3); - - int count=0; - int type=0; - - for (Item item : items) { - if (item instanceof NornStone) { - count += item.quantity; - if(type==0){ - type=((NornStone) item).type; - } else if (Random.Int(3)= SEEDS_TO_POTION) { - - CellEmitter.get(pos).burst(Speck.factory(Speck.WOOL), 6); - Sample.INSTANCE.play(Assets.SND_PUFF); - - destroy(); - - switch (type) { - case 1: weapon = new LokisFlail().enchantLoki(); - break; - case 2: weapon = new NeptunusTrident(); weapon.enchantNeptune(); - break; - case 3: weapon = new CromCruachAxe(); weapon.enchantLuck(); - break; - case 4: weapon = new AresSword(); weapon.enchantAres(); - break; - case 5: weapon = new JupitersWraith(); weapon.enchantJupiter(); - break; - default: weapon = new AresSword(); weapon.enchantAres(); - break; - } - - return weapon; - - } else { - return null; - } - } - - - public static void burnFX(int pos) { - CellEmitter.get(pos).burst(ElmoParticle.FACTORY, 6); - Sample.INSTANCE.play(Assets.SND_BURNING); - } - - public static void evaporateFX(int pos) { - CellEmitter.get(pos).burst(Speck.factory(Speck.STEAM), 5); - } - - public boolean isEmpty() { - return items == null || items.size() == 0; - } - - public void destroy() { - Dungeon.level.heaps.remove(this.pos); - if (sprite != null) { - sprite.kill(); - } - items.clear(); - items = null; - } - - private static final String POS = "pos"; - private static final String SEEN = "seen"; - private static final String TYPE = "type"; - private static final String ITEMS = "items"; - - @SuppressWarnings("unchecked") - @Override - public void restoreFromBundle(Bundle bundle) { - pos = bundle.getInt(POS); - seen = bundle.getBoolean( SEEN ); - type = Type.valueOf(bundle.getString(TYPE)); - items = new LinkedList( - (Collection) ((Collection) bundle.getCollection(ITEMS))); - items.removeAll(Collections.singleton(null)); - } - - @Override - public void storeInBundle(Bundle bundle) { - bundle.put(POS, pos); - bundle.put( SEEN, seen ); - bundle.put(TYPE, type.toString()); - bundle.put(ITEMS, items); - } - -} diff --git a/java/com/hmdzl/spspd/change/items/Item.java b/java/com/hmdzl/spspd/change/items/Item.java deleted file mode 100644 index b8954e16..00000000 --- a/java/com/hmdzl/spspd/change/items/Item.java +++ /dev/null @@ -1,602 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.Comparator; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.SnipersMark; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.hero.HeroClass; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.bags.Bag; -import com.hmdzl.spspd.change.items.weapon.missiles.Boomerang; -import com.hmdzl.spspd.change.items.weapon.melee.relic.JupitersWraith; -import com.hmdzl.spspd.change.items.misc.MissileShield; -import com.hmdzl.spspd.change.items.weapon.missiles.MissileWeapon; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.mechanics.Ballistica; -import com.hmdzl.spspd.change.scenes.CellSelector; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ItemSprite; -import com.hmdzl.spspd.change.sprites.MissileSprite; -import com.hmdzl.spspd.change.ui.QuickSlotButton; -import com.hmdzl.spspd.change.utils.GLog; - -import com.watabou.noosa.audio.Sample; -import com.watabou.noosa.particles.Emitter; -import com.watabou.utils.Bundlable; -import com.watabou.utils.Bundle; -import com.watabou.utils.Callback; - -public class Item implements Bundlable { - - private static final String TXT_PACK_FULL = "Your pack is too full for the %s"; - - private static final String TXT_TO_STRING = "%s"; - private static final String TXT_TO_STRING_X = "%s x%d"; - private static final String TXT_TO_STRING_LVL = "%s%+d"; - private static final String TXT_TO_STRING_LVL_X = "%s%+d x%d"; - - protected static final float TIME_TO_THROW = 1.0f; - protected static final float TIME_TO_PICK_UP = 1.0f; - protected static final float TIME_TO_DROP = 0.5f; - - public static final String AC_DROP = "DROP"; - public static final String AC_THROW = "THROW"; - - public String defaultAction; - public boolean usesTargeting; - - protected String name = Messages.get(this, "name"); - public int image = 0; - - public boolean stackable = false; - public boolean breakable = true; - protected int quantity = 1; - - public int level = 0; - public int consumedValue = 0; - public boolean levelKnown = false; - - public boolean cursed; - public boolean cursedKnown; - public boolean reinforced; - - // Unique items persist through revival - public boolean unique = false; - - private static Comparator itemComparator = new Comparator() { - @Override - public int compare(Item lhs, Item rhs) { - return Generator.Category.order(lhs) - - Generator.Category.order(rhs); - } - }; - - public ArrayList actions(Hero hero) { - ArrayList actions = new ArrayList(); - actions.add(AC_DROP); - actions.add(AC_THROW); - return actions; - } - - public boolean doPickUp(Hero hero) { - if (collect(hero.belongings.backpack)) { - - GameScene.pickUp(this); - Sample.INSTANCE.play(Assets.SND_ITEM); - if (hero.heroClass == HeroClass.SOLDIER){ - hero.belongings.observeS(); - } - hero.spendAndNext(TIME_TO_PICK_UP); - - return true; - - } else { - return false; - } - } - - public void doDrop(Hero hero) { - hero.spendAndNext(TIME_TO_DROP); - Dungeon.level.drop(detachAll(hero.belongings.backpack), hero.pos).sprite - .drop(hero.pos); - } - - public void sync() { - name = Messages.get(this, "name"); - } - - - public void doThrow(Hero hero) { - GameScene.selectCell(thrower); - } - - public void execute(Hero hero, String action) { - - curUser = hero; - curItem = this; - - if (action.equals(AC_DROP)) { - - doDrop(hero); - - } else if (action.equals(AC_THROW)) { - - doThrow(hero); - - } - } - - public void execute(Hero hero) { - execute(hero, defaultAction); - } - - protected void onThrow(int cell) { - Heap heap = Dungeon.level.drop(this, cell); - if (!heap.isEmpty()) { - heap.sprite.drop(cell); - } - } - - public boolean collect(Bag container) { - - ArrayList items = container.items; - - if (items.contains(this)) { - return true; - } - - for (Item item : items) { - if (item instanceof Bag && ((Bag) item).grab(this)) { - return collect((Bag) item); - } - } - - if (stackable) { - for (Item item : items) { - if (isSimilar(item)) { - item.quantity += quantity; - item.updateQuickslot(); - return true; - } - } - } - - if (items.size() < container.size) { - - if (Dungeon.hero != null && Dungeon.hero.isAlive()) { - Badges.validateItemLevelAquired(this); - } - - items.add(this); - if (stackable || this instanceof Boomerang) - Dungeon.quickslot.replaceSimilar(this); - updateQuickslot(); - Collections.sort(items, itemComparator); - return true; - - } else { - - GLog.n(Messages.get(Item.class, "pack_full", name())); - return false; - - } - } - - public boolean collect() { - return collect(Dungeon.hero.belongings.backpack); - } - - public final Item detach(Bag container) { - - if (quantity <= 0) { - - return null; - - } else if (quantity == 1) { - - if (stackable || this instanceof Boomerang ) { - Dungeon.quickslot.convertToPlaceholder(this); - } - - return detachAll(container); - - } else { - - quantity--; - updateQuickslot(); - - try { - - // pssh, who needs copy constructors? - Item detached = getClass().newInstance(); - Bundle copy = new Bundle(); - this.storeInBundle(copy); - detached.restoreFromBundle(copy); - detached.quantity(1); - - detached.onDetach(); - return detached; - } catch (Exception e) { - return null; - } - } - } - - /*public final Item detachAll( Bag container ) { - Dungeon.quickslot.clearItem( this ); - updateQuickslot(); - - for (Item item : container.items) { - if (item == this) { - container.items.remove(this); - item.onDetach(); - return this; - } else if (item instanceof Bag) { - Bag bag = (Bag)item; - if (bag.contains( this )) { - return detachAll( bag ); - } - } - } - - return this; - }*/ - - public final Item detach(Bag container, Integer quant) { - - if (quantity <= 0) { - - return null; - - } else if (quantity == 1) { - - if (stackable || this instanceof Boomerang) { - Dungeon.quickslot.convertToPlaceholder(this); - } - - return detachAll(container); - - } else { - - quantity-=quant; - updateQuickslot(); - - try { - - // pssh, who needs copy constructors? - Item detached = getClass().newInstance(); - Bundle copy = new Bundle(); - this.storeInBundle(copy); - detached.restoreFromBundle(copy); - detached.quantity(quant); - - detached.onDetach(); - return detached; - } catch (Exception e) { - return null; - } - } - } - - public final Item detachAll(Bag container) { - Dungeon.quickslot.clearItem(this); - updateQuickslot(); - - for (Item item : container.items) { - if (item == this) { - container.items.remove(this); - item.onDetach(); - return this; - } else if (item instanceof Bag) { - Bag bag = (Bag) item; - if (bag.contains(this)) { - return detachAll(bag); - } - } - } - - return this; - } - - public boolean isSimilar(Item item) { - return getClass() == item.getClass(); - } - - protected void onDetach() { - } - - public Item uncurse(){ - cursed=false; - return this; - } - - public Item reinforce(){ - reinforced=true; - return this; - } - - - public Item upgrade() { - - cursedKnown = true; - this.level++; - - updateQuickslot(); - - return this; - } - - final public Item upgrade(int n) { - for (int i = 0; i < n; i++) { - upgrade(); - } - - return this; - } - - public Item degrade() { - - this.level--; - - return this; - } - - final public Item degrade(int n) { - for (int i = 0; i < n; i++) { - degrade(); - } - - return this; - } - - public int visiblyUpgraded() { - return levelKnown ? level : 0; - } - - public boolean visiblyCursed() { - return cursed && cursedKnown; - } - - public boolean isUpgradable() { - return true; - } - - public boolean isReinforced() { - return reinforced; - } - - public boolean isIdentified() { - return levelKnown && cursedKnown; - } - - public boolean isEquipped(Hero hero) { - return false; - } - - public Item identify() { - - levelKnown = true; - cursedKnown = true; - - return this; - } - - public static void evoke(Hero hero) { - hero.sprite.emitter().burst(Speck.factory(Speck.EVOKE), 5); - } - - @Override - public String toString() { - - if (levelKnown && level != 0) { - if (quantity > 1) { - return Messages.format( TXT_TO_STRING_LVL_X, name(), level, quantity ); - } else { - return Messages.format( TXT_TO_STRING_LVL, name(), level ); - } - } else { - if (quantity > 1) { - return Messages.format( TXT_TO_STRING_X, name(), quantity ); - } else { - return Messages.format( TXT_TO_STRING, name() ); - } - } - } - - public String name() { - return name; - } - - public final String trueName() { - return name; - } - - public int image() { - return image; - } - - public ItemSprite.Glowing glowing() { - return null; - } - - public Emitter emitter() { return null; } - - public String info() { - return desc(); - } - - public String desc() { - return Messages.get(this, "desc"); - } - - public int quantity() { - return quantity; - } - - public Item quantity(int value) { - quantity = value; - return this; - } - - public int price() { - return 0; - } - - public static Item virtual(Class cl) { - try { - - Item item = cl.newInstance(); - item.quantity = 0; - return item; - - } catch (Exception e) { - return null; - } - } - - public Item random() { - return this; - } - - public String status() { - return quantity != 1 ? Integer.toString(quantity) : null; - } - - public void updateQuickslot() { - QuickSlotButton.refresh(); - } - - private static final String QUANTITY = "quantity"; - private static final String LEVEL = "level"; - private static final String LEVEL_KNOWN = "levelKnown"; - private static final String CURSED = "cursed"; - private static final String REINFORCED = "reinforced"; - private static final String CURSED_KNOWN = "cursedKnown"; - private static final String OLDSLOT = "quickslot"; - private static final String QUICKSLOT = "quickslotpos"; - - @Override - public void storeInBundle(Bundle bundle) { - bundle.put(QUANTITY, quantity); - bundle.put(LEVEL, level); - bundle.put(LEVEL_KNOWN, levelKnown); - bundle.put(CURSED, cursed); - bundle.put(REINFORCED, reinforced); - bundle.put(CURSED_KNOWN, cursedKnown); - if (Dungeon.quickslot.contains(this)) { - bundle.put(QUICKSLOT, Dungeon.quickslot.getSlot(this)); - } - } - - @Override - public void restoreFromBundle(Bundle bundle) { - quantity = bundle.getInt(QUANTITY); - levelKnown = bundle.getBoolean(LEVEL_KNOWN); - cursedKnown = bundle.getBoolean(CURSED_KNOWN); - - int level = bundle.getInt(LEVEL); - if (level > 0) { - upgrade(level); - } else if (level < 0) { - degrade(-level); - } - - cursed = bundle.getBoolean(CURSED); - reinforced = bundle.getBoolean(REINFORCED); - - // only want to populate slot on first load. - if (Dungeon.hero == null) { - // support for pre-0.2.3 saves and rankings - if (bundle.contains(OLDSLOT)) { - Dungeon.quickslot.setSlot(0, this); - } else if (bundle.contains(QUICKSLOT)) { - Dungeon.quickslot.setSlot(bundle.getInt(QUICKSLOT), this); - } - } - } - - public int throwPos( Hero user, int dst){ - return new Ballistica( user.pos, dst, Ballistica.PROJECTILE ).collisionPos; - } - - public void cast(final Hero user, int dst) { - - final int cell = throwPos( user, dst ); - //final int cell = new Ballistica( user.pos, dst, Ballistica.PROJECTILE ).collisionPos; - user.sprite.zap(cell); - user.busy(); - - Sample.INSTANCE.play(Assets.SND_MISS, 0.6f, 0.6f, 1.5f); - - Char enemy = Actor.findChar(cell); - QuickSlotButton.target(enemy); - - // FIXME!!! - float delay = TIME_TO_THROW; - if (this instanceof MissileWeapon) { - delay *= ((MissileWeapon) this).speedFactor(user); - if (enemy != null) { - SnipersMark mark = user.buff(SnipersMark.class); - if (mark != null) { - if (mark.object == enemy.id()) { - delay *= 0.5f; - } - user.remove(mark); - } - } - } - final float finalDelay = delay; - - ((MissileSprite) user.sprite.parent.recycle(MissileSprite.class)) - .reset(user.pos, cell, this, new Callback() { - @Override - public void call() { - Item.this.detach(user.belongings.backpack) - .onThrow(cell); - user.spendAndNext(finalDelay); - } - }); - } - - protected static Hero curUser = null; - protected static Item curItem = null; - protected static CellSelector.Listener thrower = new CellSelector.Listener() { - @Override - public void onSelect(Integer target) { - if (target != null) { - curItem.cast(curUser, target); - } - } - - @Override - public String prompt() { - return Messages.get(Item.class, "prompt"); - } - }; - - -} diff --git a/java/com/hmdzl/spspd/change/items/ItemStatusHandler.java b/java/com/hmdzl/spspd/change/items/ItemStatusHandler.java deleted file mode 100644 index fe6b80d4..00000000 --- a/java/com/hmdzl/spspd/change/items/ItemStatusHandler.java +++ /dev/null @@ -1,176 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.HashSet; - -import com.hmdzl.spspd.change.Dungeon; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -public class ItemStatusHandler { - - private Class[] items; - - private HashMap, Integer> images; - private HashMap, String> labels; - private HashSet> known; - - public ItemStatusHandler(Class[] items, String[] allLabels, - Integer[] allImages) { - - this.items = items; - - this.images = new HashMap, Integer>(); - this.labels = new HashMap, String>(); - known = new HashSet>(); - - ArrayList labelsLeft = new ArrayList( - Arrays.asList(allLabels)); - ArrayList imagesLeft = new ArrayList( - Arrays.asList(allImages)); - - for (int i = 0; i < items.length; i++) { - - Class item = (items[i]); - - int index = Random.Int(labelsLeft.size()); - - labels.put(item, labelsLeft.get(index)); - labelsLeft.remove(index); - - images.put(item, imagesLeft.get(index)); - imagesLeft.remove(index); - } - } - - public ItemStatusHandler(Class[] items, String[] labels, - Integer[] images, Bundle bundle) { - - this.items = items; - - this.images = new HashMap, Integer>(); - this.labels = new HashMap, String>(); - known = new HashSet>(); - - restore(bundle, labels, images); - } - - private static final String PFX_IMAGE = "_image"; - private static final String PFX_LABEL = "_label"; - private static final String PFX_KNOWN = "_known"; - - public void save(Bundle bundle) { - for (int i = 0; i < items.length; i++) { - String itemName = items[i].toString(); - bundle.put(itemName + PFX_IMAGE, images.get(items[i])); - bundle.put(itemName + PFX_LABEL, labels.get(items[i])); - bundle.put(itemName + PFX_KNOWN, known.contains(items[i])); - } - } - - private void restore(Bundle bundle, String[] allLabels, Integer[] allImages) { - - ArrayList labelsLeft = new ArrayList( - Arrays.asList(allLabels)); - ArrayList imagesLeft = new ArrayList( - Arrays.asList(allImages)); - - for (int i = 0; i < items.length; i++) { - - Class item = (items[i]); - String itemName = item.toString(); - - if (bundle.contains(itemName + PFX_LABEL) && Dungeon.version > 4) { - - String label = bundle.getString(itemName + PFX_LABEL); - labels.put(item, label); - labelsLeft.remove(label); - - Integer image = bundle.getInt(itemName + PFX_IMAGE); - images.put(item, image); - imagesLeft.remove(image); - - if (bundle.getBoolean(itemName + PFX_KNOWN)) { - known.add(item); - } - - // if there's a new item, give it a random image - // or.. if we're loading from an untrusted version, randomize - // the image to be safe. - } else { - - int index = Random.Int(labelsLeft.size()); - - labels.put(item, labelsLeft.get(index)); - labelsLeft.remove(index); - - images.put(item, imagesLeft.get(index)); - imagesLeft.remove(index); - - if (bundle.contains(itemName + PFX_KNOWN) - && bundle.getBoolean(itemName + PFX_KNOWN)) { - known.add(item); - } - } - } - } - - public int image(T item) { - return images.get(item.getClass()); - } - - public String label(T item) { - return labels.get(item.getClass()); - } - - public boolean isKnown(T item) { - return known.contains(item.getClass()); - } - - @SuppressWarnings("unchecked") - public void know(T item) { - known.add((Class) item.getClass()); - - if (known.size() == items.length - 1) { - for (int i = 0; i < items.length; i++) { - if (!known.contains(items[i])) { - known.add(items[i]); - break; - } - } - } - } - - public HashSet> known() { - return known; - } - - public HashSet> unknown() { - HashSet> result = new HashSet>(); - for (Class i : items) { - if (!known.contains(i)) { - result.add(i); - } - } - return result; - } -} diff --git a/java/com/hmdzl/spspd/change/items/KindOfArmor.java b/java/com/hmdzl/spspd/change/items/KindOfArmor.java deleted file mode 100644 index bdef895a..00000000 --- a/java/com/hmdzl/spspd/change/items/KindOfArmor.java +++ /dev/null @@ -1,134 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.hero.HeroClass; -import com.hmdzl.spspd.change.items.armor.Armor; -import com.hmdzl.spspd.change.items.weapon.melee.MeleeWeapon; -import com.hmdzl.spspd.change.items.weapon.melee.relic.RelicMeleeWeapon; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.HeroSprite; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.utils.Random; - -public class KindOfArmor extends EquipableItem { - - protected static final float TIME_TO_EQUIP = 1f; - - public int MIN = 0; - public int MAX = 1; - public int tier; - - //public KindOfArmor( int tier ) { - //this.tier = tier; - //} - - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions(hero); - actions.add(isEquipped(hero) ? AC_UNEQUIP : AC_EQUIP); - return actions; - } - - @Override - public boolean isEquipped(Hero hero) { - return hero.belongings.armor == this; - } - - //@Override - public boolean doEquip(Hero hero) { - - detachAll(hero.belongings.backpack); - - if (hero.belongings.armor == null - || hero.belongings.armor.doUnequip(hero, true)) { - - hero.belongings.armor = this; - activate(hero); - - cursedKnown = true; - if (cursed) { - equipCursed(hero); - GLog.n(Messages.get(KindOfArmor.class, "cursed", name())); - - } - - ((HeroSprite) hero.sprite).updateArmor(); - - hero.spendAndNext(TIME_TO_EQUIP); - return true; - - } else { - - collect(hero.belongings.backpack); - return false; - } - } - - //@Override - //public void activate(Char ch) { - //buff = buff(); - //buff.attachTo(ch); -// } - - @Override - public boolean doUnequip(Hero hero, boolean collect, boolean single) { - if (super.doUnequip(hero, collect, single)) { - - hero.belongings.armor = null; - ((HeroSprite) hero.sprite).updateArmor(); - - //hero.remove(buff); - //buff = null; - - return true; - - } else { - - return false; - - } - } - - public void activate(Hero hero) { - } - - public int drRoll(Hero owner) { - return Random.NormalIntRange(MIN, MAX); - } - - public float dexterityFactor(Hero hero) { - return 1f; - } - - public float stealthFactor(Hero hero) { - return 1f; - } - - public int energyFactor( Hero hero ){ - return 1; - } - - public void proc(Char attacker, Char defender, int damage) { - } -} diff --git a/java/com/hmdzl/spspd/change/items/KindOfWeapon.java b/java/com/hmdzl/spspd/change/items/KindOfWeapon.java deleted file mode 100644 index aa3ecf12..00000000 --- a/java/com/hmdzl/spspd/change/items/KindOfWeapon.java +++ /dev/null @@ -1,119 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Challenges; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.utils.Random; - -public class KindOfWeapon extends EquipableItem { - - protected static final float TIME_TO_EQUIP = 1f; - - public int MIN = 0; - public int MAX = 1; - // public int durable = 10; - - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions(hero); - actions.add(isEquipped(hero) ? AC_UNEQUIP : AC_EQUIP); - return actions; - } - - @Override - public boolean isEquipped(Hero hero) { - return hero.belongings.weapon == this; - } - - @Override - public boolean doEquip(Hero hero) { - - detachAll(hero.belongings.backpack); - - if (hero.belongings.weapon == null - || hero.belongings.weapon.doUnequip(hero, true)) { - - hero.belongings.weapon = this; - activate(hero); - - updateQuickslot(); - - cursedKnown = true; - if (cursed) { - equipCursed(hero); - GLog.n(Messages.get(KindOfWeapon.class, "cursed", name())); - } - - hero.spendAndNext(TIME_TO_EQUIP); - return true; - - } else { - - collect(hero.belongings.backpack); - return false; - } - } - - @Override - public boolean doUnequip(Hero hero, boolean collect, boolean single) { - if (super.doUnequip(hero, collect, single)) { - - hero.belongings.weapon = null; - return true; - - } else { - - return false; - - } - } - - public void activate(Hero hero) { - } - - public int damageRoll(Hero owner) { - return Random.NormalIntRange(MIN, MAX); - } - - public float acuracyFactor(Hero hero) { - return 1f; - } - - public float speedFactor(Hero hero) { - return 1f; - } - - public int reachFactor( Hero hero ){ - return 1; - } - - //public int durableFactor( Hero hero ){ - //return durable; - //} - - public void proc(Char attacker, Char defender, int damage) { - } - -} diff --git a/java/com/hmdzl/spspd/change/items/KindofMisc.java b/java/com/hmdzl/spspd/change/items/KindofMisc.java deleted file mode 100644 index 8e8aa703..00000000 --- a/java/com/hmdzl/spspd/change/items/KindofMisc.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.hmdzl.spspd.change.items; - -import com.hmdzl.spspd.change.actors.Char; - -/** - * Created by Evan on 24/08/2014. - */ -public abstract class KindofMisc extends EquipableItem { - - public abstract void activate(Char ch); -} diff --git a/java/com/hmdzl/spspd/change/items/LloydsBeacon.java b/java/com/hmdzl/spspd/change/items/LloydsBeacon.java deleted file mode 100644 index c40b27d1..00000000 --- a/java/com/hmdzl/spspd/change/items/LloydsBeacon.java +++ /dev/null @@ -1,183 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.items.artifacts.DriedRose; -import com.hmdzl.spspd.change.items.artifacts.TimekeepersHourglass; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfTeleportation; -import com.hmdzl.spspd.change.items.wands.WandOfBlood; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.scenes.InterlevelScene; -import com.hmdzl.spspd.change.sprites.ItemSprite.Glowing; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.hmdzl.spspd.change.messages.Messages; - -import com.watabou.noosa.Game; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundle; - -public class LloydsBeacon extends Item { - - private static final String TXT_PREVENTING = "Strong magic aura of this place prevents you from using the lloyd's beacon!"; - - private static final String TXT_CREATURES = "Psychic aura of neighbouring creatures doesn't allow you to use the lloyd's beacon at this moment."; - - private static final String TXT_RETURN = "The lloyd's beacon is successfully set at your current location, now you can return here anytime."; - - private static final String TXT_INFO = "Lloyd's beacon is an intricate magic device, that allows you to return to a place you have already been."; - - private static final String TXT_SET = "\n\nThis beacon was set somewhere on the level %d of Pixel Dungeon."; - - public static final float TIME_TO_USE = 1; - - public static final String AC_SET = "SET"; - public static final String AC_RETURN = "RETURN"; - - private int returnDepth = -1; - private int returnPos; - - { - name = "lloyd's beacon"; - image = ItemSpriteSheet.BEACON; - - unique = true; - } - - private static final String DEPTH = "depth"; - private static final String POS = "pos"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(DEPTH, returnDepth); - if (returnDepth != -1) { - bundle.put(POS, returnPos); - } - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - returnDepth = bundle.getInt(DEPTH); - returnPos = bundle.getInt(POS); - } - - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions(hero); - actions.add(AC_SET); - if (returnDepth != -1) { - actions.add(AC_RETURN); - } - return actions; - } - - @Override - public void execute(Hero hero, String action) { - - if (action == AC_SET || action == AC_RETURN) { - - if (Dungeon.bossLevel() || Dungeon.depth>24) { - hero.spend(LloydsBeacon.TIME_TO_USE); - GLog.w(TXT_PREVENTING); - return; - } - - for (int i = 0; i < Level.NEIGHBOURS8.length; i++) { - if (Actor.findChar(hero.pos + Level.NEIGHBOURS8[i]) != null) { - GLog.w(TXT_CREATURES); - return; - } - } - } - - if (action == AC_SET) { - - returnDepth = Dungeon.depth; - returnPos = hero.pos; - - hero.spend(LloydsBeacon.TIME_TO_USE); - hero.busy(); - - hero.sprite.operate(hero.pos); - Sample.INSTANCE.play(Assets.SND_BEACON); - - GLog.i(TXT_RETURN); - - } else if (action == AC_RETURN) { - - if (returnDepth == Dungeon.depth) { - ScrollOfTeleportation.appear(hero, returnPos); - Dungeon.level.press(returnPos, hero); - Dungeon.observe(); - } else { - - Buff buff = Dungeon.hero - .buff(TimekeepersHourglass.timeFreeze.class); - if (buff != null) - buff.detach(); - - InterlevelScene.mode = InterlevelScene.Mode.RETURN; - InterlevelScene.returnDepth = returnDepth; - InterlevelScene.returnPos = returnPos; - Game.switchScene(InterlevelScene.class); - } - - } else { - - super.execute(hero, action); - - } - } - - public void reset() { - returnDepth = -1; - } - - @Override - public boolean isUpgradable() { - return false; - } - - @Override - public boolean isIdentified() { - return true; - } - - private static final Glowing WHITE = new Glowing(0xFFFFFF); - - @Override - public Glowing glowing() { - return returnDepth != -1 ? WHITE : null; - } - - @Override - public String info() { - return TXT_INFO - + (returnDepth == -1 ? "" : Messages.format(TXT_SET, returnDepth)); - } -} diff --git a/java/com/hmdzl/spspd/change/items/OrbOfZot.java b/java/com/hmdzl/spspd/change/items/OrbOfZot.java deleted file mode 100644 index 65b869da..00000000 --- a/java/com/hmdzl/spspd/change/items/OrbOfZot.java +++ /dev/null @@ -1,162 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.Statistics; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.mobs.OrbOfZotMob; -import com.hmdzl.spspd.change.effects.particles.ElmoParticle; -import com.hmdzl.spspd.change.items.journalpages.EnergyCore; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; -import com.hmdzl.spspd.change.messages.Messages; - -public class OrbOfZot extends Item { - - //private static final String AC_END = "END THE GAME"; - - { - //name = "Orb Of Zot"; - image = ItemSpriteSheet.ORBOFZOT; - defaultAction = AC_ACTIVATETHROW; - unique = true; - } - - private static boolean activate = false; - public final int fullCharge = 500; - public int charge = 0; - private static final String CHARGE = "charge"; - - private static final String AC_ACTIVATETHROW = "ACTIVATETHROW"; - private static final String AC_BREAK = "BREAK"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(CHARGE, charge); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - charge = bundle.getInt(CHARGE); - } - - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions(hero); - if (charge >= 500){ - actions.add(AC_ACTIVATETHROW); - } - actions.add(AC_BREAK); - return actions; - } - - @Override - public void execute(Hero hero, String action) { - - if (action.equals(AC_ACTIVATETHROW)) { - if (charge < 500) - GLog.i(Messages.get(this, "rest")); - else { - activate = true; - action = AC_THROW; - } - } else { - activate = false; - } - - if (action.equals(AC_BREAK)){ - Dungeon.level.drop(new EnergyCore(), Dungeon.hero.pos).sprite.drop(Dungeon.hero.pos); - this.detachAll(Dungeon.hero.belongings.backpack); - Sample.INSTANCE.play(Assets.SND_BLAST); - hero.sprite.emitter().burst(ElmoParticle.FACTORY, 12); - } - - super.execute(hero, action); - } - - @Override - protected void onThrow(int cell) { - - if (Actor.findChar(cell) != null) { - ArrayList candidates = new ArrayList<>(); - for (int i : Level.NEIGHBOURS8) - if (Level.passable[cell + i]) - candidates.add(cell + i); - int newCell = candidates.isEmpty() ? cell : Random - .element(candidates); - - if (!Level.pit[newCell] && activate) { - OrbOfZotMob.spawnAt(newCell); - } else { - Dungeon.level.drop(this, newCell).sprite.drop(cell); - } - - } else if (!Level.pit[cell] && activate) { - OrbOfZotMob.spawnAt(cell); - } else { - - super.onThrow(cell); - } - - } - - @Override - public boolean doPickUp(Hero hero) { - if (super.doPickUp(hero)) { - - if (!Statistics.orbObtained) { - Statistics.orbObtained = true; - Badges.validateOrbObtained(); - //showAmuletScene(true); - } - - return true; - } else { - return false; - } - } - - @Override - public boolean isIdentified() { - return true; - } - - @Override - public boolean isUpgradable() { - return false; - } - - @Override - public String info() { - String info = desc(); - info += "\n\n" + Messages.get(this,"charge",charge,fullCharge); - return info; - } -} diff --git a/java/com/hmdzl/spspd/change/items/Palantir.java b/java/com/hmdzl/spspd/change/items/Palantir.java deleted file mode 100644 index 0bf48e3d..00000000 --- a/java/com/hmdzl/spspd/change/items/Palantir.java +++ /dev/null @@ -1,152 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items; - -import java.io.IOException; -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.Statistics; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.actors.mobs.pets.PET; -import com.hmdzl.spspd.change.items.artifacts.DriedRose; -import com.hmdzl.spspd.change.items.artifacts.TimekeepersHourglass; -import com.hmdzl.spspd.change.items.keys.SkeletonKey; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.AmuletScene; -import com.hmdzl.spspd.change.scenes.InterlevelScene; -import com.hmdzl.spspd.change.sprites.ItemSprite; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.sprites.ItemSprite.Glowing; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.Game; -import com.watabou.utils.Bundle; - -public class Palantir extends Item { - - public static final float TIME_TO_USE = 1; - - public static final String AC_PORT = "PORT"; - - private int specialLevel = 99; - private int returnDepth = 1; - private int returnPos; - private boolean used = false; - - { - //name = "palantir"; - image = ItemSpriteSheet.PALANTIR; - - stackable = false; - unique = true; - } - - private static final String DEPTH = "depth"; - private static final String POS = "pos"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(DEPTH, returnDepth); - if (returnDepth != -1) { - bundle.put(POS, returnPos); - } - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - returnDepth = bundle.getInt(DEPTH); - returnPos = bundle.getInt(POS); - } - - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions(hero); - actions.add(AC_PORT); - - return actions; - } - - @Override - public void execute(Hero hero, String action) { - - if (action == AC_PORT) { - - if ((Dungeon.bossLevel() || Dungeon.depth==1 || Dungeon.depth>25 || hero.petfollow) && Dungeon.depth!=specialLevel) { - hero.spend(TIME_TO_USE); - GLog.w(Messages.get(Item.class, "not_here")); - return; - } - - if (Dungeon.depth>26 && !Dungeon.zotkilled) { - hero.spend(TIME_TO_USE); - GLog.w(Messages.get(Item.class, "boss_first")); - return; - } - - - } - - if (action == AC_PORT) { - - hero.spend(TIME_TO_USE); - - Buff buff = Dungeon.hero - .buff(TimekeepersHourglass.timeFreeze.class); - if (buff != null) - buff.detach(); - - if (Dungeon.depth<25 && !Dungeon.bossLevel()){ - returnDepth = Dungeon.depth; - returnPos = hero.pos; - InterlevelScene.mode = InterlevelScene.Mode.PALANTIR; - } else { - InterlevelScene.mode = InterlevelScene.Mode.RETURN; - detach(hero.belongings.backpack); - } - InterlevelScene.returnDepth = returnDepth; - InterlevelScene.returnPos = returnPos; - Game.switchScene(InterlevelScene.class); - } else { - - super.execute(hero, action); - - } - } - - public void reset() { - returnDepth = -1; - } - - @Override - public boolean isUpgradable() { - return false; - } - - @Override - public boolean isIdentified() { - return true; - } - -} diff --git a/java/com/hmdzl/spspd/change/items/Playericon.java b/java/com/hmdzl/spspd/change/items/Playericon.java deleted file mode 100644 index e688d187..00000000 --- a/java/com/hmdzl/spspd/change/items/Playericon.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items; - - -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; - -public class Playericon extends Item { - - - { - //name = "Player Icon"; - image = ItemSpriteSheet.PLAYERICON; - - stackable = true; - } - - @Override - public boolean doPickUp(Hero hero) { - - GLog.p(Messages.get(this,"thank4play")); - - return super.doPickUp(hero); - } - - public boolean isUpgradable() { - return false; - } - - @Override - public boolean isIdentified() { - return true; - } -} diff --git a/java/com/hmdzl/spspd/change/items/PocketBallFull.java b/java/com/hmdzl/spspd/change/items/PocketBallFull.java deleted file mode 100644 index 981adbf4..00000000 --- a/java/com/hmdzl/spspd/change/items/PocketBallFull.java +++ /dev/null @@ -1,328 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.actors.mobs.pets.BlueDragon; -import com.hmdzl.spspd.change.actors.mobs.pets.BugDragon; -import com.hmdzl.spspd.change.actors.mobs.pets.Bunny; -import com.hmdzl.spspd.change.actors.mobs.pets.CocoCat; - -import com.hmdzl.spspd.change.actors.mobs.pets.Fly; -import com.hmdzl.spspd.change.actors.mobs.pets.GentleCrab; -import com.hmdzl.spspd.change.actors.mobs.pets.GoldDragon; -import com.hmdzl.spspd.change.actors.mobs.pets.GreenDragon; -import com.hmdzl.spspd.change.actors.mobs.pets.LeryFire; -import com.hmdzl.spspd.change.actors.mobs.pets.LightDragon; -import com.hmdzl.spspd.change.actors.mobs.pets.Monkey; -import com.hmdzl.spspd.change.actors.mobs.pets.PET; -import com.hmdzl.spspd.change.actors.mobs.pets.RedDragon; -import com.hmdzl.spspd.change.actors.mobs.pets.RibbonRat; -import com.hmdzl.spspd.change.actors.mobs.pets.Scorpion; -import com.hmdzl.spspd.change.actors.mobs.pets.ShadowDragon; -import com.hmdzl.spspd.change.actors.mobs.pets.Snake; -import com.hmdzl.spspd.change.actors.mobs.pets.Spider; -import com.hmdzl.spspd.change.actors.mobs.pets.Stone; - -import com.hmdzl.spspd.change.actors.mobs.pets.Velocirooster; -import com.hmdzl.spspd.change.actors.mobs.pets.VioletDragon; - -import com.hmdzl.spspd.change.actors.mobs.pets.YearPet; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.watabou.utils.Bundle; -import com.watabou.utils.PathFinder; -import com.watabou.utils.Random; - -import java.io.FileNotFoundException; -import java.io.IOException; -import java.util.ArrayList; - -public class PocketBallFull extends Item { - - { - //name = "pocket ball"; - image = ItemSpriteSheet.PALANTIR; - unique = true; - stackable = false; - } - - public static final String AC_USE = "USE"; - - public int pet_type = 0; - public int pet_ht = 0; - public int pet_level = 0; - public int pet_exp = 0; - - private static final String PET_TYPE = "pet_type"; - private static final String PET_HT = "pet_ht"; - private static final String PET_LEVEL = "pet_level"; - private static final String PET_EXP = "pet_exp"; - - public PocketBallFull() { - this( 1, 5, 1, 0 ); - } - - public PocketBallFull(int type,int ht ,int level, int exp) { - super(); - this.pet_type = type; - this.pet_ht = ht; - this.pet_level = level; - this.pet_exp = exp; - } - - @Override - public void storeInBundle( Bundle bundle ) { - super.storeInBundle( bundle ); - bundle.put( PET_TYPE,pet_type ); - bundle.put( PET_HT ,pet_ht ); - bundle.put( PET_LEVEL, pet_level ); - bundle.put( PET_EXP,pet_exp ); - } - - @Override - public void restoreFromBundle( Bundle bundle ) { - //super.restoreFromBundle( bundle ); - //pet_type = bundle.getInt(PET_TYPE); - pet_ht = bundle.getInt(PET_HT); - pet_level = bundle.getInt(PET_LEVEL); - pet_exp = bundle.getInt(PET_EXP); - try { - pet_type = bundle.getInt(PET_TYPE); - } - catch (Exception ex) - { - pet_type = 1; - } - } - - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions(hero); - if (Dungeon.hero.haspet == false & Dungeon.depth < 26){ - actions.add(AC_USE);} - return actions; - } - - - @Override - public void execute(Hero hero, String action) { - - if (action.equals(AC_USE)) { - ArrayList spawnPoints = new ArrayList(); - for (int i = 0; i < PathFinder.NEIGHBOURS8.length; i++) { - int p = hero.pos + PathFinder.NEIGHBOURS8[i]; - if (Actor.findChar(p) == null && (Level.passable[p] || Level.avoid[p])) { - spawnPoints.add(p); - } - } - if (spawnPoints.size() > 0) { - Dungeon.hero.petType = pet_type; - if (Dungeon.hero.petType==1){ - Spider pet = new Spider(); - pet.pos = Random.element(spawnPoints);GameScene.add(pet); - pet.HP = pet.HT = pet_ht; - pet.level = pet_level; - pet.experience = pet_exp; - } - if (Dungeon.hero.petType==2){ - CocoCat pet = new CocoCat(); - pet.pos = Random.element(spawnPoints);GameScene.add(pet); - pet.HP = pet.HT = pet_ht; - pet.level = pet_level; - pet.experience = pet_exp; - } - if (Dungeon.hero.petType==4){ - RedDragon pet = new RedDragon(); - pet.pos = Random.element(spawnPoints);GameScene.add(pet); - pet.HP = pet.HT = pet_ht; - pet.level = pet_level; - pet.experience = pet_exp; - } - if (Dungeon.hero.petType==3){ - Velocirooster pet = new Velocirooster(); - pet.pos = Random.element(spawnPoints);GameScene.add(pet); - pet.level = pet_level; - pet.experience = pet_exp; - } - if (Dungeon.hero.petType==5){ - GreenDragon pet = new GreenDragon(); - pet.pos = Random.element(spawnPoints);GameScene.add(pet); - pet.HP = pet.HT = pet_ht; - pet.level = pet_level; - pet.experience = pet_exp; - } - if (Dungeon.hero.petType==6){ - VioletDragon pet = new VioletDragon(); - pet.pos = Random.element(spawnPoints);GameScene.add(pet); - pet.HP = pet.HT = pet_ht; - pet.level = pet_level; - pet.experience = pet_exp; - } - if (Dungeon.hero.petType==7){ - BlueDragon pet = new BlueDragon(); - pet.pos = Random.element(spawnPoints);GameScene.add(pet); - pet.HP = pet.HT = pet_ht; - pet.level = pet_level; - pet.experience = pet_exp; - } - if (Dungeon.hero.petType==8){ - Scorpion pet = new Scorpion(); - pet.pos = Random.element(spawnPoints);GameScene.add(pet); - pet.HP = pet.HT = pet_ht; - pet.level = pet_level; - pet.experience = pet_exp; - } - if (Dungeon.hero.petType==9){ - Bunny pet = new Bunny(); - pet.pos = Random.element(spawnPoints);GameScene.add(pet); - pet.HP = pet.HT = pet_ht; - pet.level = pet_level; - pet.experience = pet_exp; - } - if (Dungeon.hero.petType==10){ - LightDragon pet = new LightDragon(); - pet.pos = Random.element(spawnPoints);GameScene.add(pet); - pet.HP = pet.HT = pet_ht; - pet.level = pet_level; - pet.experience = pet_exp; - } - if (Dungeon.hero.petType==11){ - BugDragon pet = new BugDragon(); - pet.pos = Random.element(spawnPoints);GameScene.add(pet); - pet.HP = pet.HT = pet_ht; - pet.level = pet_level; - pet.experience = pet_exp; - } - if (Dungeon.hero.petType==12){ - ShadowDragon pet = new ShadowDragon(); - pet.pos = Random.element(spawnPoints);GameScene.add(pet); - pet.HP = pet.HT = pet_ht; - pet.level = pet_level; - pet.experience = pet_exp; - } - if (Dungeon.hero.petType==13){ - CocoCat pet = new CocoCat(); - pet.pos = Random.element(spawnPoints);GameScene.add(pet); - pet.HP = pet.HT = pet_ht; - pet.level = pet_level; - pet.experience = pet_exp; - } - if (Dungeon.hero.petType==14){ - LeryFire pet = new LeryFire(); - pet.pos = Random.element(spawnPoints);GameScene.add(pet); - pet.HP = pet.HT = pet_ht; - pet.level = pet_level; - pet.experience = pet_exp; - } - if (Dungeon.hero.petType==15){ - GoldDragon pet = new GoldDragon(); - pet.pos = Random.element(spawnPoints);GameScene.add(pet); - pet.HP = pet.HT = pet_ht; - pet.level = pet_level; - pet.experience = pet_exp; - } - if (Dungeon.hero.petType==16){ - Snake pet = new Snake(); - pet.pos = Random.element(spawnPoints);GameScene.add(pet); - pet.HP = pet.HT = pet_ht; - pet.level = pet_level; - pet.experience = pet_exp; - } - if (Dungeon.hero.petType==17){ - Fly pet = new Fly(); - pet.pos = Random.element(spawnPoints);GameScene.add(pet); - pet.HP = pet.HT = pet_ht; - pet.level = pet_level; - pet.experience = pet_exp; - } - if (Dungeon.hero.petType==18){ - Stone pet = new Stone(); - pet.pos = Random.element(spawnPoints);GameScene.add(pet); - pet.HP = pet.HT = pet_ht; - pet.level = pet_level; - pet.experience = pet_exp; - } - if (Dungeon.hero.petType==19){ - Monkey pet = new Monkey(); - pet.pos = Random.element(spawnPoints);GameScene.add(pet); - pet.HP = pet.HT = pet_ht; - pet.level = pet_level; - pet.experience = pet_exp; - } - if (Dungeon.hero.petType==20){ - GentleCrab pet = new GentleCrab(); - pet.pos = Random.element(spawnPoints);GameScene.add(pet); - pet.HP = pet.HT = pet_ht; - pet.level = pet_level; - pet.experience = pet_exp; - } - if (Dungeon.hero.petType==21){ - RibbonRat pet = new RibbonRat(); - pet.pos = Random.element(spawnPoints);GameScene.add(pet); - pet.HP = pet.HT = pet_ht; - pet.level = pet_level; - pet.experience = pet_exp; - } - if (Dungeon.hero.petType==22){ - YearPet pet = new YearPet(); - pet.pos = Random.element(spawnPoints);GameScene.add(pet); - pet.HP = pet.HT = pet_ht; - pet.level = pet_level; - pet.experience = pet_exp; - } - //pet.pos = Random.element(spawnPoints); - // GameScene.add(pet); - - hero.spend(1f); - hero.busy(); - hero.sprite.operate(hero.pos); - hero.next(); - - Dungeon.hero.haspet=true; - detach(hero.belongings.backpack); - - } else { - - super.execute(hero, action); - - } - } - } - - @Override - public boolean isUpgradable() { - return false; - } - - @Override - public boolean isIdentified() { - return true; - } - - @Override - public int price() { - return 1000 * quantity; - } - -} diff --git a/java/com/hmdzl/spspd/change/items/PowerHand.java b/java/com/hmdzl/spspd/change/items/PowerHand.java deleted file mode 100644 index 9ac4556e..00000000 --- a/java/com/hmdzl/spspd/change/items/PowerHand.java +++ /dev/null @@ -1,209 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.ResultDescriptions; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.particles.ElmoParticle; -import com.hmdzl.spspd.change.items.artifacts.DriedRose; -import com.hmdzl.spspd.change.items.artifacts.SandalsOfNature; -import com.hmdzl.spspd.change.items.artifacts.UnstableSpellbook; -import com.hmdzl.spspd.change.items.bags.Bag; -import com.hmdzl.spspd.change.items.nornstone.NornStone; -import com.hmdzl.spspd.change.items.skills.ClassSkill; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.AmuletScene; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.scenes.InterlevelScene; -import com.hmdzl.spspd.change.scenes.PowerHandScene; -import com.hmdzl.spspd.change.scenes.RankingsScene; -import com.hmdzl.spspd.change.scenes.TitleScene; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.hmdzl.spspd.change.windows.WndAlchemy; -import com.hmdzl.spspd.change.windows.WndBag; -import com.watabou.noosa.Game; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.Collections; - -import static com.hmdzl.spspd.change.Dungeon.hero; - -public class PowerHand extends Item { - - public static final String AC_ADD = "ADD"; - - public static final String AC_USE = "USE"; - protected HandCharger handcharger; - - { - //name = "PowerHand"; - image = ItemSpriteSheet.POWER_HAND; - - } - - protected WndBag.Mode mode = WndBag.Mode.STONE; - - public ArrayList stones = new ArrayList(); - - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions(hero); - actions.add(AC_ADD); - actions.add(AC_USE); - return actions; - } - - @Override - public boolean collect( Bag container ) { - if (super.collect( container )) { - if (container.owner != null) { - charge( container.owner ); - } - return true; - } else { - return false; - } - } - - public void charge( Char owner ) { - if (handcharger == null) handcharger = new HandCharger(); - handcharger.attachTo( owner ); - } - - @Override - public void onDetach( ) { - stopCharging(); - } - - public void stopCharging() { - if (handcharger != null) { - handcharger.detach(); - handcharger = null; - } - } - - @Override - public void execute(Hero hero, String action) { - if (action.equals( AC_USE )) { - if (stones.size() >= 5){ - showPowerHandScene(); - } else { - GLog.i(Messages.get(PowerHand.class, "nothing")); - } - } else if (action.equals( AC_ADD )) { - GameScene.selectItem(itemSelector, mode, Messages.get(this, "prompt")); - } else { - super.execute(hero, action); - - } - } - - @Override - public String desc() { - String desc = super.desc(); - - - if (stones.size() > 0) { - - desc += "\n\n" + Messages.get(this, "desc_stones", stones.size()); - } - - return desc; - } - - private void showPowerHandScene() { - try { - stones.clear(); - Dungeon.saveAll(); - Game.switchScene(PowerHandScene.class); - } catch (IOException e) { - } - } - - private static final String STONES = "stones"; - - //@Override - //public void storeInBundle( Bundle bundle ) { - // super.storeInBundle(bundle); - // bundle.put( STONES, stones.toArray(new Class[stones.size()]) ); - //} - - //@Override - //public void restoreFromBundle( Bundle bundle ) { - // super.restoreFromBundle(bundle); - // if (bundle.contains(STONES)) - // Collections.addAll(stones, bundle.getStringArray(STONES)); - //} - - @Override - public boolean isUpgradable() { - return false; - } - - @Override - public boolean isIdentified() { - return true; - } - - protected WndBag.Listener itemSelector = new WndBag.Listener() { - @Override - public void onSelect(Item item) { - if (item != null && item instanceof NornStone) { - if (stones.contains(item.name()) || item instanceof StoneOre) { - GLog.w(Messages.get(PowerHand.class, "already_fed")); - } else { - stones.add(item.name()); - - Hero hero = Dungeon.hero; - hero.sprite.operate(hero.pos); - Sample.INSTANCE.play(Assets.SND_PLANT); - hero.busy(); - hero.spend(2f); - GLog.i(Messages.get(PowerHand.class, "absorb_stone")); - item.detach(hero.belongings.backpack); - } - - } - } - }; - - protected class HandCharger extends Buff { - - @Override - public boolean attachTo( Char target ) { - super.attachTo( target ); - - return true; - } - - @Override - public boolean act() { - spend( TICK ); - return true; - } - } -} diff --git a/java/com/hmdzl/spspd/change/items/PuddingCup.java b/java/com/hmdzl/spspd/change/items/PuddingCup.java deleted file mode 100644 index 7f4cc59e..00000000 --- a/java/com/hmdzl/spspd/change/items/PuddingCup.java +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items; - -import java.io.IOException; -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.ShatteredPixelDungeon; -import com.hmdzl.spspd.change.Statistics; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.scenes.LoadSaveScene; -import com.hmdzl.spspd.change.scenes.Pudding_CupScene; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.watabou.noosa.Game; - -public class PuddingCup extends Item { - - private static final String AC_SAVE = "SAVE" ; - - { - //name = "pudding cup"; - image = ItemSpriteSheet.PUDDING_CUP; - - unique = true; - } - - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions(hero); - actions.add(AC_SAVE); - return actions; - } - - @Override - public void execute(Hero hero, String action) { - if (action == AC_SAVE) { - //showPudding_cupScene(); - curUser = hero; - detach(curUser.belongings.backpack); - try { - Dungeon.saveAll(); - } catch (IOException e) { - // - } - Dungeon.canSave=true; - Game.switchScene(LoadSaveScene.class); - - } else { - - super.execute(hero, action); - - } - } - - - @Override - public boolean doPickUp(Hero hero) { - if (super.doPickUp(hero)) { - - //if (!Statistics.amuletObtained) { - // Statistics.amuletObtained = true; - //Badges.validateVictory(); - - showPudding_cupScene(); - - //} - - return true; - } else { - return false; - } - } - - private void showPudding_cupScene() { - try { - Dungeon.saveAll(); - Game.switchScene(Pudding_CupScene.class); - } catch (IOException e) { - } - } - - public boolean isUpgradable() { - return false; - } - - @Override - public boolean isIdentified() { - return true; - } -} diff --git a/java/com/hmdzl/spspd/change/items/RedDewdrop.java b/java/com/hmdzl/spspd/change/items/RedDewdrop.java deleted file mode 100644 index e0f4f1ce..00000000 --- a/java/com/hmdzl/spspd/change/items/RedDewdrop.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.hero.HeroClass; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.watabou.noosa.audio.Sample; - -public class RedDewdrop extends Item { - - private static final String TXT_VALUE = "%+dHP"; - - { - //name = "red dewdrop"; - image = ItemSpriteSheet.REDDEWDROP; - - stackable = true; - } - - @Override - public boolean doPickUp(Hero hero) { - - DewVial vial = hero.belongings.getItem(DewVial.class); - - if (vial == null || vial.isFull()) { - - int value = 5 + (Dungeon.depth - 1) / 5; - if (hero.heroClass == HeroClass.HUNTRESS) { - value++; - } - - int effect = Math.min(hero.HT - hero.HP, value * quantity); - if (effect > 0) { - hero.HP += effect; - hero.sprite.emitter().burst(Speck.factory(Speck.HEALING), 1); - hero.sprite.showStatus(CharSprite.POSITIVE, Messages.get(this, "value", effect)); - } - - } else if (vial != null) { - - vial.collectDew(this); - - } - - Sample.INSTANCE.play(Assets.SND_DEWDROP); - hero.spendAndNext(TIME_TO_PICK_UP); - - return true; - } -} diff --git a/java/com/hmdzl/spspd/change/items/ReturnBeacon.java b/java/com/hmdzl/spspd/change/items/ReturnBeacon.java deleted file mode 100644 index 65ea3e53..00000000 --- a/java/com/hmdzl/spspd/change/items/ReturnBeacon.java +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.items.artifacts.DriedRose; -import com.hmdzl.spspd.change.items.artifacts.TimekeepersHourglass; -import com.hmdzl.spspd.change.scenes.InterlevelScene; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.watabou.noosa.Game; - -public class ReturnBeacon extends Item { - - - private static final String TXT_INFO = "Return beacon is an intricate magic device, that allows you to return to a place you have already been."; - - public static final float TIME_TO_USE = 1; - - //public static final String AC_SET = "SET"; - public static final String AC_RETURN = "RETURN"; - - //private int returnDepth = -1; - //private int returnPos; - - { - name = "return beacon"; - image = ItemSpriteSheet.BEACON; - - unique = true; - } - - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions(hero); - actions.add(AC_RETURN); - return actions; - } - - @Override - public void execute(Hero hero, String action) { - - if (action == AC_RETURN) { - - - Buff buff = Dungeon.hero - .buff(TimekeepersHourglass.timeFreeze.class); - if (buff != null) - buff.detach(); - - InterlevelScene.mode = InterlevelScene.Mode.RETURNSAVE; - InterlevelScene.returnDepth = 1; - InterlevelScene.returnPos = 1; - Game.switchScene(InterlevelScene.class); - - - } else { - - super.execute(hero, action); - - } - } - - - - @Override - public boolean isUpgradable() { - return false; - } - - @Override - public boolean isIdentified() { - return true; - } - - - @Override - public String info() { - return TXT_INFO; - } -} diff --git a/java/com/hmdzl/spspd/change/items/SaveYourLife.java b/java/com/hmdzl/spspd/change/items/SaveYourLife.java deleted file mode 100644 index c0cb1690..00000000 --- a/java/com/hmdzl/spspd/change/items/SaveYourLife.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items; - -import java.io.IOException; -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.ShatteredPixelDungeon; -import com.hmdzl.spspd.change.Statistics; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.scenes.LoadSaveScene; -import com.hmdzl.spspd.change.scenes.Pudding_CupScene; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.watabou.noosa.Game; - -public class SaveYourLife extends Item { - - private static final String AC_SAVE = "SAVE" ; - - { - //name = "pudding cup"、 - - - - - - image = ItemSpriteSheet.TPTRAP; - - unique = true; - } - - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions(hero); - actions.add(AC_SAVE); - return actions; - } - - @Override - public void execute(Hero hero, String action) { - if (action == AC_SAVE) { - curUser = hero; - try { - Dungeon.saveAll(); - } catch (IOException e) { - // - } - Dungeon.canSave=true; - Game.switchScene(LoadSaveScene.class); - - } else { - - super.execute(hero, action); - - } - } - - - public boolean isUpgradable() { - return false; - } - - @Override - public boolean isIdentified() { - return true; - } -} diff --git a/java/com/hmdzl/spspd/change/items/ShoesKit.java b/java/com/hmdzl/spspd/change/items/ShoesKit.java deleted file mode 100644 index b8be53b0..00000000 --- a/java/com/hmdzl/spspd/change/items/ShoesKit.java +++ /dev/null @@ -1,128 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.armor.Armor; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.HeroSprite; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.hmdzl.spspd.change.windows.WndBag; -import com.watabou.noosa.audio.Sample; - -public class ShoesKit extends Item { - - private static final String TXT_SELECT_SHOES = "Select an shoes to upgrade"; - private static final String TXT_UPGRADED = "you applied the armor kit to upgrade your %s"; - - private static final float TIME_TO_UPGRADE = 2; - - private static final String AC_APPLY = "APPLY"; - - { - //name = "armor kit"; - image = ItemSpriteSheet.SHOESKIT; - - unique = true; - } - - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions(hero); - actions.add(AC_APPLY); - return actions; - } - - @Override - public void execute(Hero hero, String action) { - if (action == AC_APPLY) { - - curUser = hero; - //GameScene.selectItem(itemSelector, WndBag.Mode.SHOES, - //TXT_SELECT_SHOES); - - } else { - - super.execute(hero, action); - - } - } - - @Override - public boolean isUpgradable() { - return false; - } - - @Override - public boolean isIdentified() { - return true; - } - - /*private void upgrade(Shoes shoes) { - - detach(curUser.belongings.backpack); - - curUser.sprite.centerEmitter().start(Speck.factory(Speck.KIT), 0.05f, - 10); - curUser.spend(TIME_TO_UPGRADE); - curUser.busy(); - - GLog.w(TXT_UPGRADED, shoes.name()); - - switch (owner.heroClass) { - case WARRIOR: - classShoes = new JumpW(); - break; - case ROGUE: - classShoes = new JumpR(); - break; - case MAGE: - classShoes = new JumpM(); - break; - case HUNTRESS: - classShoes = new JumpH(); - break; - } - - shoes.detach(curUser.belongings.backpack); - classShoes.collect(curUser.belongings.backpack); - - - curUser.sprite.operate(curUser.pos); - Sample.INSTANCE.play(Assets.SND_EVOKE); - }*/ - - /*private final WndBag.Listener itemSelector = new WndBag.Listener() { - @Override - public void onSelect(Item item) { - if (item != null) { - ShoesKit.this.upgrade((Shoes) item); - } - } - };*/ - - @Override - public int price() { - return 200 * quantity; - } -} diff --git a/java/com/hmdzl/spspd/change/items/SoulCollect.java b/java/com/hmdzl/spspd/change/items/SoulCollect.java deleted file mode 100644 index cb05f1aa..00000000 --- a/java/com/hmdzl/spspd/change/items/SoulCollect.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.Statistics; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.Item; - -import com.hmdzl.spspd.change.items.weapon.missiles.RiceBall; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.audio.Sample; - -public class SoulCollect extends Item { - - { - //name = "Soul collect"; - image = ItemSpriteSheet.SOUL_COLLECT; - stackable = false; - } - - - public static final String AC_BREAK = "BREAK"; - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions(hero); - if (Dungeon.depth<26) { - actions.add(AC_BREAK); - } - return actions; - } - - @Override - public void execute(Hero hero, String action) { - - if (action.equals(AC_BREAK)) { - curUser = hero; - GLog.w(Messages.get(this, "win")); - //Statistics.archersKilled += 51; - //Statistics.skeletonsKilled += 51; - //Statistics.piranhasKilled += 51; - //Statistics.goldThievesKilled += 51; - Badges.validateOtilukeRescued(); - curUser.sprite.operate(curUser.pos); - detach(hero.belongings.backpack); - curUser.spendAndNext(1f); - curUser.busy(); - - } else { - super.execute(hero, action); - - } - } - - @Override - public boolean isUpgradable() { - return false; - } - - @Override - public boolean isIdentified() { - return true; - } -} diff --git a/java/com/hmdzl/spspd/change/items/StoneOre.java b/java/com/hmdzl/spspd/change/items/StoneOre.java deleted file mode 100644 index e770ade4..00000000 --- a/java/com/hmdzl/spspd/change/items/StoneOre.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.sprites.ItemSprite.Glowing; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundle; - -public class StoneOre extends Item { - - - { - //name = "stone ore"; - image = ItemSpriteSheet.STONE; - - stackable=true; - } - - @Override - public boolean isUpgradable() { - return false; - } - - @Override - public boolean isIdentified() { - return true; - } - - - @Override - public int price() { - return 100 * quantity; - } - - public StoneOre() { this(1); } - public StoneOre(int value) { this.quantity = value; } - -} diff --git a/java/com/hmdzl/spspd/change/items/Stylus.java b/java/com/hmdzl/spspd/change/items/Stylus.java deleted file mode 100644 index bfe3fe26..00000000 --- a/java/com/hmdzl/spspd/change/items/Stylus.java +++ /dev/null @@ -1,112 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.hero.HeroClass; -import com.hmdzl.spspd.change.effects.particles.PurpleParticle; -import com.hmdzl.spspd.change.items.armor.Armor; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.hmdzl.spspd.change.windows.WndBag; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Random; - -public class Stylus extends Item { - - private static final float TIME_TO_INSCRIBE = 2; - - private static final String AC_INSCRIBE = "INSCRIBE"; - - { - //name = "arcane stylus"; - image = ItemSpriteSheet.STYLUS; - - stackable = true; - - - } - - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions(hero); - actions.add(AC_INSCRIBE); - return actions; - } - - @Override - public void execute(Hero hero, String action) { - if (action == AC_INSCRIBE) { - - curUser = hero; - GameScene.selectItem(itemSelector, WndBag.Mode.ARMOR, - Messages.get(this,"prompt")); - - } else { - - super.execute(hero, action); - - } - } - - @Override - public boolean isUpgradable() { - return false; - } - - @Override - public boolean isIdentified() { - return true; - } - - private void inscribe(Armor armor) { - if (!(Dungeon.hero.heroClass == HeroClass.FOLLOWER ) || (Dungeon.hero.heroClass == HeroClass.FOLLOWER && Random.Int(10)>=1 )) - detach(curUser.belongings.backpack); - - GLog.w(Messages.get(this,"inscribed")); - - armor.hasglyph(); - - curUser.sprite.operate(curUser.pos); - curUser.sprite.centerEmitter().start(PurpleParticle.BURST, 0.05f, 10); - Sample.INSTANCE.play(Assets.SND_BURNING); - - curUser.spend(TIME_TO_INSCRIBE); - curUser.busy(); - } - - @Override - public int price() { - return 30 * quantity; - } - - private final WndBag.Listener itemSelector = new WndBag.Listener() { - @Override - public void onSelect(Item item) { - if (item != null) { - Stylus.this.inscribe((Armor) item); - } - } - }; -} diff --git a/java/com/hmdzl/spspd/change/items/TenguKey.java b/java/com/hmdzl/spspd/change/items/TenguKey.java deleted file mode 100644 index 5cb11961..00000000 --- a/java/com/hmdzl/spspd/change/items/TenguKey.java +++ /dev/null @@ -1,152 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.actors.mobs.pets.PET; -import com.hmdzl.spspd.change.items.artifacts.DriedRose; -import com.hmdzl.spspd.change.items.artifacts.TimekeepersHourglass; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.InterlevelScene; -import com.hmdzl.spspd.change.sprites.ItemSprite.Glowing; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.Game; -import com.watabou.utils.Bundle; - -public class TenguKey extends Item { - - public static final float TIME_TO_USE = 1; - - public static final String AC_PORT = "PORT"; - - private int specialLevel = 36; - private int returnDepth = -1; - private int returnPos; - - { - //name = "hideout key"; - image = ItemSpriteSheet.TENGUKEY; - - stackable = false; - unique = true; - } - - private static final String DEPTH = "depth"; - private static final String POS = "pos"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(DEPTH, returnDepth); - if (returnDepth != -1) { - bundle.put(POS, returnPos); - } - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - returnDepth = bundle.getInt(DEPTH); - returnPos = bundle.getInt(POS); - } - - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions(hero); - actions.add(AC_PORT); - - return actions; - } - - @Override - public void execute(Hero hero, String action) { - - if (action == AC_PORT) { - - if ((Dungeon.bossLevel() || Dungeon.depth==1 || Dungeon.depth>25 || hero.petfollow) && Dungeon.depth!=specialLevel) { - hero.spend(TIME_TO_USE); - GLog.w(Messages.get(Item.class, "not_here")); - return; - } - - if (Dungeon.depth==specialLevel && !Dungeon.tengudenkilled && !Dungeon.level.reset) { - hero.spend(TIME_TO_USE); - GLog.w(Messages.get(Item.class, "boss_first")); - return; - } - } - - if (action == AC_PORT) { - - hero.spend(TIME_TO_USE); - - Buff buff = Dungeon.hero - .buff(TimekeepersHourglass.timeFreeze.class); - if (buff != null) - buff.detach(); - - if (Dungeon.depth<25 && !Dungeon.bossLevel()){ - - returnDepth = Dungeon.depth; - returnPos = hero.pos; - InterlevelScene.mode = InterlevelScene.Mode.PORTTENGU; - } else { - InterlevelScene.mode = InterlevelScene.Mode.RETURN; - detach(hero.belongings.backpack); - } - InterlevelScene.returnDepth = returnDepth; - InterlevelScene.returnPos = returnPos; - Game.switchScene(InterlevelScene.class); - - } else { - - super.execute(hero, action); - - } - } - - public void reset() { - returnDepth = -1; - } - - @Override - public boolean isUpgradable() { - return false; - } - - @Override - public boolean isIdentified() { - return true; - } - - - private static final Glowing BLACK = new Glowing(0x00000); - - @Override - public Glowing glowing() { - return BLACK; - } -} diff --git a/java/com/hmdzl/spspd/change/items/TomeOfMastery.java b/java/com/hmdzl/spspd/change/items/TomeOfMastery.java deleted file mode 100644 index c525ca25..00000000 --- a/java/com/hmdzl/spspd/change/items/TomeOfMastery.java +++ /dev/null @@ -1,149 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.actors.buffs.Blindness; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Fury; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.hero.HeroSubClass; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.effects.SpellSprite; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.utils.GLog; - -import com.hmdzl.spspd.change.windows.WndChooseWay; -import com.watabou.noosa.audio.Sample; - -public class TomeOfMastery extends Item { - - public static final float TIME_TO_READ = 10; - - public static final String AC_READ = "READ"; - - { - stackable = false; - //name = "Tome of Mastery"; - image = ItemSpriteSheet.MASTERY; - - unique = true; - } - - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions(hero); - actions.add(AC_READ); - return actions; - } - - @Override - public void execute(Hero hero, String action) { - if (action.equals(AC_READ)) { - - if (hero.buff(Blindness.class) != null) { - GLog.w(Messages.get(this,"blind")); - return; - } - - curUser = hero; - - HeroSubClass way1 = null; - HeroSubClass way2 = null; - switch (hero.heroClass) { - case WARRIOR: - way1 = HeroSubClass.GLADIATOR; - way2 = HeroSubClass.BERSERKER; - break; - case MAGE: - way1 = HeroSubClass.BATTLEMAGE; - way2 = HeroSubClass.WARLOCK; - break; - case ROGUE: - way1 = HeroSubClass.FREERUNNER; - way2 = HeroSubClass.ASSASSIN; - break; - case HUNTRESS: - way1 = HeroSubClass.SNIPER; - way2 = HeroSubClass.WARDEN; - break; - case PERFORMER: - way1 = HeroSubClass.SUPERSTAR; - way2 = HeroSubClass.JOKER; - break; - case SOLDIER: - way1 = HeroSubClass.AGENT; - way2 = HeroSubClass.LEADER; - break; - case FOLLOWER: - way1 = HeroSubClass.PASTOR; - way2 = HeroSubClass.ARTISAN; - break; - } - GameScene.show(new WndChooseWay(this, way1, way2)); - - } else { - - super.execute(hero, action); - - } - } - - @Override - public boolean doPickUp(Hero hero) { - Badges.validateMastery(); - return super.doPickUp(hero); - } - - @Override - public boolean isUpgradable() { - return false; - } - - @Override - public boolean isIdentified() { - return true; - } - - public void choose(HeroSubClass way) { - - detach(curUser.belongings.backpack); - - curUser.spend(TomeOfMastery.TIME_TO_READ); - curUser.busy(); - - curUser.subClass = way; - - curUser.sprite.operate(curUser.pos); - Sample.INSTANCE.play(Assets.SND_MASTERY); - - SpellSprite.show(curUser, SpellSprite.MASTERY); - curUser.sprite.emitter().burst(Speck.factory(Speck.MASTERY), 12); - GLog.w(Messages.get(this, "way", way.title()) ); - - if (way == HeroSubClass.BERSERKER - && curUser.HP <= curUser.HT * Fury.LEVEL) { - Buff.affect(curUser, Fury.class); - } - } -} diff --git a/java/com/hmdzl/spspd/change/items/Torch.java b/java/com/hmdzl/spspd/change/items/Torch.java deleted file mode 100644 index 4fb588ab..00000000 --- a/java/com/hmdzl/spspd/change/items/Torch.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.HighLight; -import com.hmdzl.spspd.change.actors.buffs.Light; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.particles.FlameParticle; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.watabou.noosa.particles.Emitter; - -public class Torch extends Item { - - public static final String AC_LIGHT = "LIGHT"; - - public static final float TIME_TO_LIGHT = 1; - - { - //name = "torch"; - image = ItemSpriteSheet.TORCH; - - stackable = true; - - defaultAction = AC_LIGHT; - } - - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions(hero); - actions.add(AC_LIGHT); - return actions; - } - - @Override - public void execute(Hero hero, String action) { - - if (action.equals(AC_LIGHT)) { - - hero.spend(TIME_TO_LIGHT); - hero.busy(); - - hero.sprite.operate(hero.pos); - - detach(hero.belongings.backpack); - Buff.affect(hero, HighLight.class, 300); - - Emitter emitter = hero.sprite.centerEmitter(); - emitter.start(FlameParticle.FACTORY, 0.2f, 3); - - } else { - - super.execute(hero, action); - - } - } - - @Override - public boolean isUpgradable() { - return false; - } - - @Override - public boolean isIdentified() { - return true; - } - - @Override - public int price() { - return 10 * quantity; - } -} diff --git a/java/com/hmdzl/spspd/change/items/Towel.java b/java/com/hmdzl/spspd/change/items/Towel.java deleted file mode 100644 index 04897ca7..00000000 --- a/java/com/hmdzl/spspd/change/items/Towel.java +++ /dev/null @@ -1,154 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.buffs.Bleeding; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Cold; -import com.hmdzl.spspd.change.actors.buffs.CountDown; -import com.hmdzl.spspd.change.actors.buffs.Dry; -import com.hmdzl.spspd.change.actors.buffs.Hot; -import com.hmdzl.spspd.change.actors.buffs.Ooze; -import com.hmdzl.spspd.change.actors.buffs.Wet; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.actors.mobs.pets.PET; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.Terrain; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; - -public class Towel extends Item { - - public static final float TIME_TO_USE = 1; - - public static final String AC_TOWEL = "TOWEL"; - public static final String AC_TOWEL_PET = "TOWEL_PET"; - - { - //name = "towel"; - image = ItemSpriteSheet.TOWEL; - unique = true; - level = 20; - - } - - - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions(hero); - - actions.add(AC_TOWEL); - - if(checkpet()!=null && checkpetNear()){ - actions.add(AC_TOWEL_PET); - } - - return actions; - } - - private PET checkpet(){ - for (Mob mob : Dungeon.level.mobs) { - if(mob instanceof PET) { - return (PET) mob; - } - } - return null; - } - - private boolean checkpetNear(){ - Hero hero = Dungeon.hero; - for (int n : Level.NEIGHBOURS8) { - int c = hero.pos + n; - if (Actor.findChar(c) instanceof PET) { - return true; - } - } - return false; - } - - - @Override - public void execute(Hero hero, String action) { - - - if (action == AC_TOWEL) { - - Buff.detach(hero, Bleeding.class); - Buff.detach(hero, Ooze.class); - Buff.detach(hero,Hot.class); - Buff.detach(hero,Cold.class); - Buff.detach(hero,Wet.class); - Buff.detach(hero,Dry.class); - Buff.detach(hero,CountDown.class); - - Dungeon.observe(); - - GLog.w(Messages.get(this,"apply")); - - level -= 1; - if (level==0){ - detach(Dungeon.hero.belongings.backpack); - GLog.w(Messages.get(this,"end")); - } - - - } else if (action == AC_TOWEL_PET) { - - PET pet = checkpet(); - pet.HP=pet.HT; - Dungeon.observe(); - - GLog.w(Messages.get(this,"apply")); - - level -= 1; - if (level==0){ - detach(Dungeon.hero.belongings.backpack); - GLog.w(Messages.get(this,"end")); - } - - - } else { - - super.execute(hero, action); - } - } - - @Override - public int price() { - return 500 * quantity; - } - - - @Override - public boolean isUpgradable() { - return false; - } - - @Override - public boolean isIdentified() { - return true; - } - -} diff --git a/java/com/hmdzl/spspd/change/items/TownReturnBeacon.java b/java/com/hmdzl/spspd/change/items/TownReturnBeacon.java deleted file mode 100644 index 247eef53..00000000 --- a/java/com/hmdzl/spspd/change/items/TownReturnBeacon.java +++ /dev/null @@ -1,169 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.items.artifacts.DriedRose; -import com.hmdzl.spspd.change.items.artifacts.TimekeepersHourglass; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.scenes.InterlevelScene; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.Game; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundle; - -public class TownReturnBeacon extends Item { - - - private static final String TXT_INFO = "Return beacon is an intricate magic device, that allows you to return to a place you have already been."; - private static final String TXT_CREATURES = "Psychic aura of neighbouring creatures doesn't allow you to use the lloyd's beacon at this moment."; - - public static final float TIME_TO_USE = 1; - - //public static final String AC_SET = "SET"; - public static final String AC_RETURN = "RETURN"; - public static final String AC_RETURNTOWN = "RETURNTOWN"; - public static final String FAIL = "Strong magic aura of this place prevents you from using the beacon!"; - - private int returnDepth = -1; - private int returnPos; - - { - name = "dolyahaven return beacon"; - image = ItemSpriteSheet.BEACON; - - unique = true; - } - - private static final String DEPTH = "depth"; - private static final String POS = "pos"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(DEPTH, returnDepth); - if (returnDepth != -1) { - bundle.put(POS, returnPos); - } - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - returnDepth = bundle.getInt(DEPTH); - returnPos = bundle.getInt(POS); - } - - - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions(hero); - if (Dungeon.depth==55 && returnDepth>55 && !Badges.checkOtilukeRescued()){ - actions.add(AC_RETURN); - } - if(Dungeon.depth>55){ - actions.add(AC_RETURNTOWN); - } - return actions; - } - - @Override - public void execute(Hero hero, String action) { - - if (action == AC_RETURNTOWN) { - - if (Dungeon.bossLevel() || Dungeon.level.locked || hero.petfollow) { - hero.spend(TIME_TO_USE); - GLog.w(FAIL); - return; - } - - for (int i = 0; i < Level.NEIGHBOURS8.length; i++) { - if (Actor.findChar(hero.pos + Level.NEIGHBOURS8[i]) != null) { - GLog.w(TXT_CREATURES); - return; - } - } - - } - - if (action == AC_RETURNTOWN) { - - hero.spend(TIME_TO_USE); - - returnDepth = Dungeon.depth; - returnPos = hero.pos; - - Buff buff = Dungeon.hero - .buff(TimekeepersHourglass.timeFreeze.class); - if (buff != null) - buff.detach(); - - InterlevelScene.mode = InterlevelScene.Mode.RETURN; - InterlevelScene.returnDepth = 55; - InterlevelScene.returnPos = 1925; - Game.switchScene(InterlevelScene.class); - - } else if (action == AC_RETURN) { - - hero.spend(TIME_TO_USE); - - Buff buff = Dungeon.hero - .buff(TimekeepersHourglass.timeFreeze.class); - if (buff != null) - buff.detach(); - - InterlevelScene.mode = InterlevelScene.Mode.RETURN; - InterlevelScene.returnDepth = returnDepth; - InterlevelScene.returnPos = returnPos; - Game.switchScene(InterlevelScene.class); - - } else { - - super.execute(hero, action); - - } - } - - - - @Override - public boolean isUpgradable() { - return false; - } - - @Override - public boolean isIdentified() { - return true; - } - - - @Override - public String info() { - return TXT_INFO; - } -} diff --git a/java/com/hmdzl/spspd/change/items/TransmutationBall.java b/java/com/hmdzl/spspd/change/items/TransmutationBall.java deleted file mode 100644 index 8a3ee09b..00000000 --- a/java/com/hmdzl/spspd/change/items/TransmutationBall.java +++ /dev/null @@ -1,249 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * Shattered Pixel Dungeon - * Copyright (C) 2014-2019 Evan Debenham - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ - -package com.hmdzl.spspd.change.items; - -import com.hmdzl.spspd.change.Challenges; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.ShatteredPixelDungeon; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.hero.HeroClass; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.EquipableItem; -import com.hmdzl.spspd.change.items.Generator; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.armor.Armor; -import com.hmdzl.spspd.change.items.artifacts.Artifact; -import com.hmdzl.spspd.change.items.potions.Potion; - -import com.hmdzl.spspd.change.items.rings.Ring; -import com.hmdzl.spspd.change.items.scrolls.Scroll; -import com.hmdzl.spspd.change.items.skills.PerformerSkill; -import com.hmdzl.spspd.change.items.wands.Wand; -import com.hmdzl.spspd.change.items.weapon.Weapon; -import com.hmdzl.spspd.change.items.weapon.melee.MeleeWeapon; -import com.hmdzl.spspd.change.items.weapon.missiles.MissileWeapon; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.plants.Plant; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.hmdzl.spspd.change.windows.WndBag; -import com.watabou.utils.Random; - -import java.util.ArrayList; - -public class TransmutationBall extends Item { - - private static final String AC_USE = "USE"; - - { - image = ItemSpriteSheet.TRAN_BALL; - - stackable = true; - } - - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions(hero); - actions.add(AC_USE); - return actions; - } - - @Override - public void execute(Hero hero, String action) { - if (action == AC_USE) { - - curUser = hero; - GameScene.selectItem(itemSelector, - WndBag.Mode.TRANMSUTABLE, - Messages.get(TransmutationBall.class, "prompt")); - - } else { - - super.execute(hero, action); - - } - } - - private void use(Item item) { - if (!(Dungeon.hero.heroClass == HeroClass.FOLLOWER ) || (Dungeon.hero.heroClass == HeroClass.FOLLOWER && Random.Int(10)>=1 )) - detach(curUser.belongings.backpack); - - curUser.sprite.operate(curUser.pos); - //curUser.sprite.emitter().start(Speck.factory(Speck.CHANGE), 0.2f, 0); - - curUser.spend(1f); - curUser.busy(); - - } - - - private final WndBag.Listener itemSelector = new WndBag.Listener() { - @Override - public void onSelect(Item item) { - curUser = Dungeon.hero; - Item result; - if (item != null) { - if (item instanceof MeleeWeapon) { - result = changeWeapon((MeleeWeapon) item); - } else if (item instanceof Armor) { - result = changeArmor((Armor) item); - } else if (item instanceof Ring) { - result = changeRing((Ring) item); - } else if (item instanceof Wand) { - result = changeWand((Wand) item); - } else if (item instanceof Artifact) { - result = changeArtifact((Artifact) item); - } else { - result = null; - } - item.detach(Dungeon.hero.belongings.backpack); - Dungeon.level.drop(result, Dungeon.hero.pos).sprite.drop(); - TransmutationBall.this.use(item); - } - } - }; - - - private MeleeWeapon changeWeapon(MeleeWeapon w) { - - MeleeWeapon n; - do { - n = (MeleeWeapon) Generator.random(Generator.Category.MELEEWEAPON); - } while (n.getClass() == w.getClass()); - - n.level = 0; - - int level = w.level; - if (level > 0) { - n.upgrade(level); - } else if (level < 0) { - n.degrade(-level); - } - - n.enchantment = w.enchantment; - n.reinforced = w.reinforced; - n.levelKnown = w.levelKnown; - n.cursedKnown = w.cursedKnown; - n.cursed = w.cursed; - - return n; - - } - - private Armor changeArmor(Armor r) { - Armor n; - do { - n = (Armor) Generator.random(Generator.Category.ARMOR); - } while (n.getClass() == r.getClass()); - - n.level = 0; - - int level = r.level; - if (level > 0) { - n.upgrade(level); - } else if (level < 0) { - n.degrade(-level); - } - n.glyph = r.glyph; - n.reinforced = r.reinforced; - n.levelKnown = r.levelKnown; - n.cursedKnown = r.cursedKnown; - n.cursed = r.cursed; - - return n; - } - - - private Ring changeRing(Ring r) { - Ring n; - do { - n = (Ring) Generator.random(Generator.Category.RING); - } while (n.getClass() == r.getClass()); - - n.level = 0; - - int level = r.level; - if (level > 0) { - n.upgrade(level); - } else if (level < 0) { - n.degrade(-level); - } - n.reinforced = r.reinforced; - n.levelKnown = r.levelKnown; - n.cursedKnown = r.cursedKnown; - n.cursed = r.cursed; - - return n; - } - - private Artifact changeArtifact(Artifact a) { - Artifact n; - do { - n = (Artifact) Generator.random(Generator.Category.ARTIFACT); - } while (n.getClass() == a.getClass()); - - if (n != null) { - n.cursedKnown = a.cursedKnown; - n.cursed = a.cursed; - n.levelKnown = a.levelKnown; - n.transferUpgrade(a.visiblyUpgraded()); - } - - return n; - } - - private Wand changeWand(Wand w) { - - Wand n; - do { - n = (Wand) Generator.random(Generator.Category.WAND); - } while (n.getClass() == w.getClass()); - - n.level = 0; - n.updateLevel(); - n.upgrade(w.level); - - n.reinforced = w.reinforced; - n.levelKnown = w.levelKnown; - n.cursedKnown = w.cursedKnown; - n.cursed = w.cursed; - - return n; - } - - - @Override - public int price() { - return 50; - } - - @Override - public boolean isUpgradable() { - return false; - } - - @Override - public boolean isIdentified() { - return true; - } -} diff --git a/java/com/hmdzl/spspd/change/items/TreasureMap.java b/java/com/hmdzl/spspd/change/items/TreasureMap.java deleted file mode 100644 index 946d3a7d..00000000 --- a/java/com/hmdzl/spspd/change/items/TreasureMap.java +++ /dev/null @@ -1,172 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.actors.mobs.pets.PET; -import com.hmdzl.spspd.change.items.artifacts.DriedRose; -import com.hmdzl.spspd.change.items.artifacts.TimekeepersHourglass; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.InterlevelScene; -import com.hmdzl.spspd.change.sprites.ItemSprite.Glowing; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.Game; -import com.watabou.utils.Bundle; - -public class TreasureMap extends Item { - - public static final float TIME_TO_USE = 1; - - public static final String AC_PORT = "PORT"; - - private int specialLevel = 43; - private int returnDepth = -1; - private int returnPos; - - { - //name = "treasure map"; - image = ItemSpriteSheet.MAP; - - stackable = false; - unique = true; - } - - private static final String DEPTH = "depth"; - private static final String POS = "pos"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(DEPTH, returnDepth); - if (returnDepth != -1) { - bundle.put(POS, returnPos); - } - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - returnDepth = bundle.getInt(DEPTH); - returnPos = bundle.getInt(POS); - } - - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions(hero); - actions.add(AC_PORT); - - return actions; - } - - @Override - public void execute(Hero hero, String action) { - - if (action == AC_PORT) { - - if ((Dungeon.bossLevel() || Dungeon.depth==1 || Dungeon.depth>25 || hero.petfollow) && Dungeon.depth!=specialLevel) { - hero.spend(TIME_TO_USE); - GLog.w(Messages.get(Item.class, "not_here")); - return; - } - - if (Dungeon.depth==specialLevel && !Dungeon.gnollkingkilled && !Dungeon.level.reset) { - hero.spend(TIME_TO_USE); - GLog.w(Messages.get(Item.class, "boss_first")); - return; - } - } - - if (action == AC_PORT) { - - Buff buff = Dungeon.hero - .buff(TimekeepersHourglass.timeFreeze.class); - if (buff != null) - buff.detach(); - - if (Dungeon.depth<25 && !Dungeon.bossLevel()){ - - returnDepth = Dungeon.depth; - returnPos = hero.pos; - InterlevelScene.mode = InterlevelScene.Mode.PORTMAP; - } else { - InterlevelScene.mode = InterlevelScene.Mode.RETURN; - detach(hero.belongings.backpack); - } - InterlevelScene.returnDepth = returnDepth; - InterlevelScene.returnPos = returnPos; - Game.switchScene(InterlevelScene.class); - - } else { - - super.execute(hero, action); - - } - } - - - private PET checkpet(){ - for (Mob mob : Dungeon.level.mobs) { - if(mob instanceof PET) { - return (PET) mob; - } - } - return null; - } - - private boolean checkpetNear(){ - for (int n : Level.NEIGHBOURS8) { - int c = Dungeon.hero.pos + n; - if (Actor.findChar(c) instanceof PET) { - return true; - } - } - return false; - } - - public void reset() { - returnDepth = -1; - } - - @Override - public boolean isUpgradable() { - return false; - } - - @Override - public boolean isIdentified() { - return true; - } - - - private static final Glowing WHITE = new Glowing(0xFFFFCC); - - - @Override - public Glowing glowing() { - return WHITE; - } - -} diff --git a/java/com/hmdzl/spspd/change/items/TriForce.java b/java/com/hmdzl/spspd/change/items/TriForce.java deleted file mode 100644 index f3ac078d..00000000 --- a/java/com/hmdzl/spspd/change/items/TriForce.java +++ /dev/null @@ -1,154 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.actors.mobs.pets.PET; -import com.hmdzl.spspd.change.items.artifacts.DriedRose; -import com.hmdzl.spspd.change.items.artifacts.TimekeepersHourglass; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.InterlevelScene; -import com.hmdzl.spspd.change.sprites.ItemSprite.Glowing; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.Game; -import com.watabou.utils.Bundle; - -public class TriForce extends Item { - - public static final float TIME_TO_USE = 1; - - public static final String AC_PORT = "PORT"; - - private int returnDepth = -1; - private int returnPos; - - { - //name = "Triforce"; - image = ItemSpriteSheet.TRIFORCE; - - stackable = false; - unique = true; - } - - private static final String DEPTH = "depth"; - private static final String POS = "pos"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(DEPTH, returnDepth); - if (returnDepth != -1) { - bundle.put(POS, returnPos); - } - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - returnDepth = bundle.getInt(DEPTH); - returnPos = bundle.getInt(POS); - } - - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions(hero); - actions.add(AC_PORT); - - return actions; - } - - @Override - public void execute(Hero hero, String action) { - - if (action == AC_PORT) { - - if (Dungeon.bossLevel()) { - hero.spend(TIME_TO_USE); - GLog.w(Messages.get(Item.class, "not_here")); - return; - } - - if (Dungeon.depth>26 && !Dungeon.shadowyogkilled) { - hero.spend(TIME_TO_USE); - GLog.w(Messages.get(Item.class, "boss_first")); - return; - } - - - } - - if (action == AC_PORT) { - - hero.spend(TIME_TO_USE); - - Buff buff = Dungeon.hero - .buff(TimekeepersHourglass.timeFreeze.class); - if (buff != null) - buff.detach(); - - if (Dungeon.depth<25 && !Dungeon.bossLevel()){ - returnDepth = Dungeon.depth; - returnPos = hero.pos; - InterlevelScene.mode = InterlevelScene.Mode.PORT4; - } else { - InterlevelScene.mode = InterlevelScene.Mode.RETURN; - detach(hero.belongings.backpack); - } - - - InterlevelScene.returnDepth = returnDepth; - InterlevelScene.returnPos = returnPos; - Game.switchScene(InterlevelScene.class); - - } else { - - super.execute(hero, action); - - } - } - - public void reset() { - returnDepth = -1; - } - - @Override - public boolean isUpgradable() { - return false; - } - - @Override - public boolean isIdentified() { - return true; - } - - - private static final Glowing WHITE = new Glowing(0xFFFFCC); - - @Override - public Glowing glowing() { - return WHITE; - } -} diff --git a/java/com/hmdzl/spspd/change/items/TriforceOfCourage.java b/java/com/hmdzl/spspd/change/items/TriforceOfCourage.java deleted file mode 100644 index 0da1f81a..00000000 --- a/java/com/hmdzl/spspd/change/items/TriforceOfCourage.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; - -public class TriforceOfCourage extends Item { - - { - //name = "Triforce of Courage"; - image = ItemSpriteSheet.ATRIFORCE; - - stackable = false; - unique = true; - } - - @Override - public boolean isUpgradable() { - return false; - } - - @Override - public boolean isIdentified() { - return true; - } - - @Override - public boolean doPickUp(Hero hero) { - if (super.doPickUp(hero)) { - - if (Dungeon.level != null && Dungeon.depth==31) { - Dungeon.triforceofcourage = true; - } - - return true; - } else { - return false; - } - } - - @Override - public int price() { - return 10 * quantity; - } -} diff --git a/java/com/hmdzl/spspd/change/items/TriforceOfPower.java b/java/com/hmdzl/spspd/change/items/TriforceOfPower.java deleted file mode 100644 index d81d979c..00000000 --- a/java/com/hmdzl/spspd/change/items/TriforceOfPower.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; - -public class TriforceOfPower extends Item { - - { - //name = "Triforce of Power"; - image = ItemSpriteSheet.ATRIFORCE; - - stackable = false; - unique = true; - } - - @Override - public boolean isUpgradable() { - return false; - } - - @Override - public boolean isIdentified() { - return true; - } - - - @Override - public boolean doPickUp(Hero hero) { - if (super.doPickUp(hero)) { - - if (Dungeon.level != null && Dungeon.depth==32) { - Dungeon.triforceofpower= true; - } - - return true; - } else { - return false; - } - } - - @Override - public int price() { - return 10 * quantity; - } -} diff --git a/java/com/hmdzl/spspd/change/items/TriforceOfWisdom.java b/java/com/hmdzl/spspd/change/items/TriforceOfWisdom.java deleted file mode 100644 index 6f14bc58..00000000 --- a/java/com/hmdzl/spspd/change/items/TriforceOfWisdom.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; - -public class TriforceOfWisdom extends Item { - - { - //name = "Triforce of Wisdom"; - image = ItemSpriteSheet.ATRIFORCE; - - stackable = false; - unique = true; - } - - @Override - public boolean isUpgradable() { - return false; - } - - @Override - public boolean isIdentified() { - return true; - } - - - @Override - public boolean doPickUp(Hero hero) { - if (super.doPickUp(hero)) { - - if (Dungeon.level != null && Dungeon.depth==33) { - Dungeon.triforceofwisdom= true; - } - - return true; - } else { - return false; - } - } - - @Override - public void doDrop(Hero hero) { - - if (Dungeon.level != null && Dungeon.depth==33) { - Dungeon.triforceofwisdom= false; - } - - super.doDrop(hero); - } - - @Override - public int price() { - return 10 * quantity; - } -} diff --git a/java/com/hmdzl/spspd/change/items/UpgradeBlobRed.java b/java/com/hmdzl/spspd/change/items/UpgradeBlobRed.java deleted file mode 100644 index daec6996..00000000 --- a/java/com/hmdzl/spspd/change/items/UpgradeBlobRed.java +++ /dev/null @@ -1,122 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.hero.HeroClass; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfUpgrade; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.hmdzl.spspd.change.windows.WndBag; -import com.watabou.utils.Random; - -public class UpgradeBlobRed extends Item { - - private static final String TXT_SELECT = "Select an item to upgrade"; - private static final String TXT_UPGRADED = "your %s certainly looks better"; - - private static final float TIME_TO_INSCRIBE = 2; - - private static final int upgrades = 3; - - - private static final String AC_INSCRIBE = "INSCRIBE"; - - { - //name = "red upgrade goo"; - image = ItemSpriteSheet.UPGRADEGOO_RED; - - stackable = true; - - - } - - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions(hero); - actions.add(AC_INSCRIBE); - return actions; - } - - @Override - public void execute(Hero hero, String action) { - if (action == AC_INSCRIBE) { - - curUser = hero; - GameScene.selectItem(itemSelector, WndBag.Mode.UPGRADEABLE, - Messages.get(ScrollOfUpgrade.class,"prompt")); - - } else { - - super.execute(hero, action); - - } - } - - @Override - public boolean isUpgradable() { - return false; - } - - @Override - public boolean isIdentified() { - return true; - } - - private void upgrade(Item item) { - if (!(Dungeon.hero.heroClass == HeroClass.FOLLOWER ) || (Dungeon.hero.heroClass == HeroClass.FOLLOWER && Random.Int(10)>=1 )) - detach(curUser.belongings.backpack); - - GLog.w(Messages.get(ScrollOfUpgrade.class,"looks_better", item.name())); - - if (item.reinforced){ - item.upgrade(upgrades); - } else { - item.upgrade(Math.min(upgrades, 15-item.level)); - } - - curUser.sprite.operate(curUser.pos); - curUser.sprite.emitter().start(Speck.factory(Speck.UP), 0.2f, 3); - Badges.validateItemLevelAquired(item); - - curUser.spend(TIME_TO_INSCRIBE); - curUser.busy(); - - } - - @Override - public int price() { - return 30 * quantity; - } - - private final WndBag.Listener itemSelector = new WndBag.Listener() { - @Override - public void onSelect(Item item) { - if (item != null) { - UpgradeBlobRed.this.upgrade(item); - } - } - }; -} diff --git a/java/com/hmdzl/spspd/change/items/UpgradeBlobViolet.java b/java/com/hmdzl/spspd/change/items/UpgradeBlobViolet.java deleted file mode 100644 index 6db7e0d7..00000000 --- a/java/com/hmdzl/spspd/change/items/UpgradeBlobViolet.java +++ /dev/null @@ -1,118 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.hero.HeroClass; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfUpgrade; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.hmdzl.spspd.change.windows.WndBag; -import com.watabou.utils.Random; - -public class UpgradeBlobViolet extends Item { - - private static final float TIME_TO_INSCRIBE = 2; - - private static final String AC_INSCRIBE = "INSCRIBE"; - - private static final int upgrades = 5; - - { - //name = "violet upgrade goo"; - image = ItemSpriteSheet.UPGRADEGOO_VIOLET; - - stackable = true; - - - } - - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions(hero); - actions.add(AC_INSCRIBE); - return actions; - } - - @Override - public void execute(Hero hero, String action) { - if (action == AC_INSCRIBE) { - - curUser = hero; - GameScene.selectItem(itemSelector, WndBag.Mode.UPGRADEABLE, - Messages.get(ScrollOfUpgrade.class,"prompt")); - - } else { - - super.execute(hero, action); - - } - } - - @Override - public boolean isUpgradable() { - return false; - } - - @Override - public boolean isIdentified() { - return true; - } - - private void upgrade(Item item) { -if (!(Dungeon.hero.heroClass == HeroClass.FOLLOWER ) || (Dungeon.hero.heroClass == HeroClass.FOLLOWER && Random.Int(10)>=1 )) - detach(curUser.belongings.backpack); - - GLog.w(Messages.get(ScrollOfUpgrade.class,"looks_better", item.name())); - - if (item.reinforced){ - item.upgrade(upgrades); - } else { - item.upgrade(Math.min(upgrades, 15-item.level)); - } - - curUser.sprite.operate(curUser.pos); - curUser.sprite.emitter().start(Speck.factory(Speck.UP), 0.2f, 3); - Badges.validateItemLevelAquired(item); - - curUser.spend(TIME_TO_INSCRIBE); - curUser.busy(); - - } - - @Override - public int price() { - return 30 * quantity; - } - - private final WndBag.Listener itemSelector = new WndBag.Listener() { - @Override - public void onSelect(Item item) { - if (item != null) { - UpgradeBlobViolet.this.upgrade(item); - } - } - }; -} diff --git a/java/com/hmdzl/spspd/change/items/UpgradeBlobYellow.java b/java/com/hmdzl/spspd/change/items/UpgradeBlobYellow.java deleted file mode 100644 index 610b2ad1..00000000 --- a/java/com/hmdzl/spspd/change/items/UpgradeBlobYellow.java +++ /dev/null @@ -1,120 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.hero.HeroClass; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfUpgrade; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.hmdzl.spspd.change.windows.WndBag; -import com.watabou.utils.Random; - -public class UpgradeBlobYellow extends Item { - - private static final String TXT_SELECT = "Select an item to upgrade"; - private static final String TXT_UPGRADED = "your %s certainly looks better"; - - private static final float TIME_TO_INSCRIBE = 2; - - private static final String AC_INSCRIBE = "INSCRIBE"; - - private static final int upgrades = 1; - - { - //name = "yellow upgrade goo"; - image = ItemSpriteSheet.UPGRADEGOO_YELLOW; - - stackable = true; - - - } - - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions(hero); - actions.add(AC_INSCRIBE); - return actions; - } - - @Override - public void execute(Hero hero, String action) { - if (action == AC_INSCRIBE) { - - curUser = hero; - GameScene.selectItem(itemSelector, WndBag.Mode.UPGRADEABLE, - Messages.get(ScrollOfUpgrade.class,"prompt")); - - } else { - - super.execute(hero, action); - - } - } - - @Override - public boolean isUpgradable() { - return false; - } - - @Override - public boolean isIdentified() { - return true; - } - - private void upgrade(Item item) { -if (!(Dungeon.hero.heroClass == HeroClass.FOLLOWER ) || (Dungeon.hero.heroClass == HeroClass.FOLLOWER && Random.Int(10)>=1 )) - detach(curUser.belongings.backpack); - - GLog.w(Messages.get(ScrollOfUpgrade.class,"looks_better", item.name())); - - if (item.reinforced){ - item.upgrade(upgrades); - } else { - item.upgrade(Math.min(upgrades, 15-item.level)); - } - - curUser.sprite.operate(curUser.pos); - curUser.sprite.emitter().start(Speck.factory(Speck.UP), 0.2f, 3); - Badges.validateItemLevelAquired(item); - - curUser.spend(TIME_TO_INSCRIBE); - curUser.busy(); - } - - @Override - public int price() { - return 30 * quantity; - } - - private final WndBag.Listener itemSelector = new WndBag.Listener() { - @Override - public void onSelect(Item item) { - if (item != null) { - UpgradeBlobYellow.this.upgrade(item); - } - } - }; -} diff --git a/java/com/hmdzl/spspd/change/items/UpgradeEatBall.java b/java/com/hmdzl/spspd/change/items/UpgradeEatBall.java deleted file mode 100644 index 29789a42..00000000 --- a/java/com/hmdzl/spspd/change/items/UpgradeEatBall.java +++ /dev/null @@ -1,176 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * Shattered Pixel Dungeon - * Copyright (C) 2014-2019 Evan Debenham - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ - -package com.hmdzl.spspd.change.items; - -import com.hmdzl.spspd.change.Challenges; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.ShatteredPixelDungeon; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.hero.HeroClass; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.EquipableItem; -import com.hmdzl.spspd.change.items.Generator; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.armor.Armor; -import com.hmdzl.spspd.change.items.artifacts.Artifact; -import com.hmdzl.spspd.change.items.potions.Potion; - -import com.hmdzl.spspd.change.items.rings.Ring; -import com.hmdzl.spspd.change.items.scrolls.Scroll; -import com.hmdzl.spspd.change.items.skills.PerformerSkill; -import com.hmdzl.spspd.change.items.wands.Wand; -import com.hmdzl.spspd.change.items.weapon.Weapon; -import com.hmdzl.spspd.change.items.weapon.melee.MeleeWeapon; -import com.hmdzl.spspd.change.items.weapon.missiles.MissileWeapon; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.plants.Plant; -import com.hmdzl.spspd.change.plants.Seedpod; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.hmdzl.spspd.change.windows.WndBag; -import com.watabou.utils.Random; - -import java.util.ArrayList; - -public class UpgradeEatBall extends Item { - - private static final String AC_USE = "USE"; - - { - image = ItemSpriteSheet.UP_EATER; - - stackable = true; - } - - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions(hero); - actions.add(AC_USE); - return actions; - } - - @Override - public void execute(Hero hero, String action) { - if (action == AC_USE) { - curUser = hero; - GameScene.selectItem(itemSelector, - WndBag.Mode.EATABLE, - Messages.get(UpgradeEatBall.class, "prompt")); - - } else { - - super.execute(hero, action); - - } - } - - private void use(Item item) { -if (!(Dungeon.hero.heroClass == HeroClass.FOLLOWER ) || (Dungeon.hero.heroClass == HeroClass.FOLLOWER && Random.Int(10)>=1 )) - detach(curUser.belongings.backpack); - - curUser.sprite.operate(curUser.pos); - //curUser.sprite.emitter().start(Speck.factory(Speck.CHANGE), 0.2f, 0); - - curUser.spend(1f); - curUser.busy(); - - } - - - private final WndBag.Listener itemSelector = new WndBag.Listener() { - @Override - public void onSelect(Item item) { - curUser = Dungeon.hero; - Item result; - if (item != null) { - if (item.isUpgradable()) { - result = eatUpgradable((Item) item); - } else if (item instanceof Scroll - || item instanceof Potion - || item instanceof Stylus) { - result = eatStandard((Item) item); - } else { - result = null; - } - item.detach(Dungeon.hero.belongings.backpack); - Dungeon.level.drop(result, Dungeon.hero.pos).sprite.drop(); - UpgradeEatBall.this.use(item); - } - } - }; - - private Item eatUpgradable(Item w) { - - int ups = w.level; - - Item n = null; - - if (Random.Float()<(ups/10)){ - - n = new UpgradeBlobViolet(); - - } else if (Random.Float()<(ups/5)) { - - n = new UpgradeBlobRed(); - - } else if (Random.Float()<(ups/3)) { - - n = new UpgradeBlobYellow(); - - } else { - - n =new Seedpod.Seed() ; - } - - return n; - } - - private Item eatStandard(Item w) { - - Item n = null; - - if (Random.Float()<0.1f){ - n = new UpgradeBlobYellow(); - } else { - n = new Seedpod.Seed() ; - } - - return n; - } - - - @Override - public int price() { - return 50; - } - - @Override - public boolean isUpgradable() { - return false; - } - - @Override - public boolean isIdentified() { - return true; - } -} diff --git a/java/com/hmdzl/spspd/change/items/VioletDewdrop.java b/java/com/hmdzl/spspd/change/items/VioletDewdrop.java deleted file mode 100644 index 2f9916a4..00000000 --- a/java/com/hmdzl/spspd/change/items/VioletDewdrop.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.hero.HeroClass; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.watabou.noosa.audio.Sample; - -public class VioletDewdrop extends Item { - - private static final String TXT_VALUE = "%+dHP"; - - { - //name = "violet dewdrop"; - image = ItemSpriteSheet.VIOLETDEWDROP; - - stackable = true; - } - - @Override - public boolean doPickUp(Hero hero) { - - DewVial vial = hero.belongings.getItem(DewVial.class); - - if (vial == null || vial.isFull()) { - - int value = 2 + (Dungeon.depth - 1) / 5; - if (hero.heroClass == HeroClass.HUNTRESS) { - value++; - } - - int effect = Math.min(hero.HT - hero.HP, value * quantity); - if (effect > 0) { - hero.HP += effect; - hero.sprite.emitter().burst(Speck.factory(Speck.HEALING), 1); - hero.sprite.showStatus(CharSprite.POSITIVE, Messages.get(this, "value", effect)); - } - - } else if (vial != null) { - - vial.collectDew(this); - - } - - Sample.INSTANCE.play(Assets.SND_DEWDROP); - hero.spendAndNext(TIME_TO_PICK_UP); - - return true; - } - -} diff --git a/java/com/hmdzl/spspd/change/items/WaterItem2.java b/java/com/hmdzl/spspd/change/items/WaterItem2.java deleted file mode 100644 index 76b4aabb..00000000 --- a/java/com/hmdzl/spspd/change/items/WaterItem2.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.Statistics; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Speck; - -import com.hmdzl.spspd.change.items.weapon.missiles.RiceBall; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.Terrain; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.audio.Sample; - -public class WaterItem2 extends Item { - - public static final String AC_POUR = "POUR"; - - { - //name = "water"; - image = ItemSpriteSheet.DEWDROP; - - stackable = true; - } - - @Override - public ArrayList actions( Hero hero ) { - ArrayList actions = super.actions( hero ); - - actions.add( AC_POUR ); - - return actions; - } - - @Override - public void execute( final Hero hero, String action ) { - if( action.equals( AC_POUR ) ){ - - curUser = hero; - curItem = this; - - Level.set(curUser.pos, Terrain.WATER); - GameScene.updateMap(curUser.pos); - - detach(curUser.belongings.backpack); - - } else { - super.execute(hero, action); - } - } - - - @Override - public boolean isUpgradable() { - return false; - } - - @Override - public boolean isIdentified() { - return true; - } - - @Override - public int price() { - return 10 * quantity; - } - -} diff --git a/java/com/hmdzl/spspd/change/items/Weightstone.java b/java/com/hmdzl/spspd/change/items/Weightstone.java deleted file mode 100644 index 133d3d61..00000000 --- a/java/com/hmdzl/spspd/change/items/Weightstone.java +++ /dev/null @@ -1,186 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.hero.HeroClass; -import com.hmdzl.spspd.change.effects.particles.PurpleParticle; -import com.hmdzl.spspd.change.items.weapon.Weapon; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.scenes.PixelScene; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.ui.RedButton; -import com.hmdzl.spspd.change.ui.RenderedTextMultiline; -import com.hmdzl.spspd.change.ui.Window; -import com.hmdzl.spspd.change.utils.GLog; -import com.hmdzl.spspd.change.windows.IconTitle; -import com.hmdzl.spspd.change.windows.WndBag; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Random; - -public class Weightstone extends Item { - - private static final float TIME_TO_APPLY = 2; - - private static final String AC_APPLY = "APPLY"; - - { - - image = ItemSpriteSheet.WEIGHT; - - stackable = true; - - - } - - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions(hero); - actions.add(AC_APPLY); - return actions; - } - - @Override - public void execute(Hero hero, String action) { - if (action == AC_APPLY) { - - curUser = hero; - GameScene.selectItem(itemSelector, WndBag.Mode.WEAPON, - Messages.get(this, "select")); - - } else { - - super.execute(hero, action); - - } - } - - @Override - public boolean isUpgradable() { - return false; - } - - @Override - public boolean isIdentified() { - return true; - } - - private void apply(Weapon weapon) { - - if (!(Dungeon.hero.heroClass == HeroClass.FOLLOWER ) || (Dungeon.hero.heroClass == HeroClass.FOLLOWER && Random.Int(10)>=1 )) - detach(curUser.belongings.backpack); - - GLog.w(Messages.get(this,"apply")); - - weapon.enchant(); - - curUser.sprite.operate(curUser.pos); - curUser.sprite.centerEmitter().start(PurpleParticle.BURST, 0.05f, 10); - Sample.INSTANCE.play(Assets.SND_MISS); - - curUser.spend(TIME_TO_APPLY); - curUser.busy(); - } - - @Override - public int price() { - return 40 * quantity; - } - - private final WndBag.Listener itemSelector = new WndBag.Listener() { - @Override - public void onSelect(Item item) { - if (item != null) { - Weightstone.this.apply((Weapon) item);; - } - } - }; - - /*public class WndBalance extends Window { - - private static final int WIDTH = 120; - private static final int MARGIN = 2; - private static final int BUTTON_WIDTH = WIDTH - MARGIN * 2; - private static final int BUTTON_HEIGHT = 20; - - public WndBalance(final Weapon weapon) { - super(); - - IconTitle titlebar = new IconTitle(weapon); - titlebar.setRect(0, 0, WIDTH, 0); - add(titlebar); - - RenderedTextMultiline tfMesage = PixelScene.renderMultiline( Messages.get(this, "choice"), 8 ); - tfMesage.maxWidth(WIDTH - MARGIN * 2); - tfMesage.setPos(MARGIN, titlebar.bottom() + MARGIN); - add( tfMesage ); - - float pos = tfMesage.top() + tfMesage.height(); - - if (weapon.imbue != Weapon.Imbue.LIGHT) { - RedButton btnSpeed = new RedButton(Messages.get(this, "light")) { - @Override - protected void onClick() { - hide(); - Weightstone.this.apply(weapon, true); - } - }; - btnSpeed.setRect(MARGIN, pos + MARGIN, BUTTON_WIDTH, - BUTTON_HEIGHT); - add(btnSpeed); - - pos = btnSpeed.bottom(); - } - - if (weapon.imbue != Weapon.Imbue.HEAVY) { - RedButton btnAccuracy = new RedButton(Messages.get(this, "heavy")) { - @Override - protected void onClick() { - hide(); - Weightstone.this.apply(weapon, false); - } - }; - btnAccuracy.setRect(MARGIN, pos + MARGIN, BUTTON_WIDTH, - BUTTON_HEIGHT); - add(btnAccuracy); - - pos = btnAccuracy.bottom(); - } - - RedButton btnCancel = new RedButton(Messages.get(this, "cancel")) { - @Override - protected void onClick() { - hide(); - } - }; - btnCancel - .setRect(MARGIN, pos + MARGIN, BUTTON_WIDTH, BUTTON_HEIGHT); - add(btnCancel); - - resize(WIDTH, (int) btnCancel.bottom() + MARGIN); - } - - protected void onSelect(int index) { - } - }*/ -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/items/Whistle.java b/java/com/hmdzl/spspd/change/items/Whistle.java deleted file mode 100644 index f35011ca..00000000 --- a/java/com/hmdzl/spspd/change/items/Whistle.java +++ /dev/null @@ -1,137 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.actors.mobs.pets.BlueDragon; -import com.hmdzl.spspd.change.actors.mobs.pets.BugDragon; -import com.hmdzl.spspd.change.actors.mobs.pets.Bunny; -import com.hmdzl.spspd.change.actors.mobs.pets.CocoCat; -import com.hmdzl.spspd.change.actors.mobs.pets.Fly; -import com.hmdzl.spspd.change.actors.mobs.pets.GentleCrab; -import com.hmdzl.spspd.change.actors.mobs.pets.GoldDragon; -import com.hmdzl.spspd.change.actors.mobs.pets.GreenDragon; -import com.hmdzl.spspd.change.actors.mobs.pets.LeryFire; -import com.hmdzl.spspd.change.actors.mobs.pets.LightDragon; -import com.hmdzl.spspd.change.actors.mobs.pets.Monkey; -import com.hmdzl.spspd.change.actors.mobs.pets.PET; -import com.hmdzl.spspd.change.actors.mobs.pets.RedDragon; -import com.hmdzl.spspd.change.actors.mobs.pets.RibbonRat; -import com.hmdzl.spspd.change.actors.mobs.pets.Scorpion; -import com.hmdzl.spspd.change.actors.mobs.pets.ShadowDragon; -import com.hmdzl.spspd.change.actors.mobs.pets.Snake; -import com.hmdzl.spspd.change.actors.mobs.pets.Spider; -import com.hmdzl.spspd.change.actors.mobs.pets.Stone; -import com.hmdzl.spspd.change.actors.mobs.pets.Velocirooster; -import com.hmdzl.spspd.change.actors.mobs.pets.VioletDragon; - -import com.hmdzl.spspd.change.effects.Pushing; -import com.hmdzl.spspd.change.effects.particles.SparkParticle; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.traps.LightningTrap; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.scenes.PixelScene; -import com.hmdzl.spspd.change.sprites.ItemSprite; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.ui.RenderedTextMultiline; -import com.hmdzl.spspd.change.ui.Window; -import com.hmdzl.spspd.change.utils.GLog; -import com.hmdzl.spspd.change.windows.IconTitle; -import com.watabou.noosa.tweeners.AlphaTweener; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -public class Whistle extends Item { - - - public static final float TIME_TO_USE = 1; - - public static final String AC_CALL = "CALL"; - - { - //name = "whistle"; - image = ItemSpriteSheet.POCKET_BALL; - unique = true; - stackable = false; - } - - - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions(hero); - if (Dungeon.depth < 26) actions.add(AC_CALL); - return actions; - } - - @Override - public void execute(Hero hero, String action) { - - - if (action == AC_CALL) { - GameScene.show( new WndWhistle(this) ); - } else { - - super.execute(hero, action); - - } - - } - - - @Override - public boolean isUpgradable() { - return false; - } - - @Override - public boolean isIdentified() { - return true; - } - private static class WndWhistle extends Window { - - private static final int BTN_SIZE = 32; - private static final float GAP = 2; - private static final float BTN_GAP = 12; - private static final int WIDTH = 116; - - WndWhistle(final Whistle whis){ - - IconTitle titlebar = new IconTitle(); - titlebar.icon( new ItemSprite(whis) ); - titlebar.label( Messages.get(this, "title") ); - titlebar.setRect( 0, 0, WIDTH, 0 ); - add( titlebar ); - - RenderedTextMultiline message = - PixelScene.renderMultiline(Messages.get(this, "desc"),6); - message.maxWidth( WIDTH ); - message.setPos(0, titlebar.bottom() + GAP); - add( message ); - - - resize(WIDTH, (int)(message.bottom() + GAP)); - } - - } -} diff --git a/java/com/hmdzl/spspd/change/items/YellowDewdrop.java b/java/com/hmdzl/spspd/change/items/YellowDewdrop.java deleted file mode 100644 index 83bb3dcc..00000000 --- a/java/com/hmdzl/spspd/change/items/YellowDewdrop.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.hero.HeroClass; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.watabou.noosa.audio.Sample; - -public class YellowDewdrop extends Item { - - private static final String TXT_VALUE = "%+dHP"; - - { - //name = "yellow dewdrop"; - image = ItemSpriteSheet.YELLOWDEWDROP; - - stackable = true; - } - - @Override - public boolean doPickUp(Hero hero) { - - DewVial vial = hero.belongings.getItem(DewVial.class); - - if (vial == null || vial.isFull()) { - - int value = 2 + (Dungeon.depth - 1) / 5; - if (hero.heroClass == HeroClass.HUNTRESS) { - value++; - } - - int effect = Math.min(hero.HT - hero.HP, value * quantity); - if (effect > 0) { - hero.HP += effect; - hero.sprite.emitter().burst(Speck.factory(Speck.HEALING), 1); - hero.sprite.showStatus(CharSprite.POSITIVE, Messages.get(this, "value", effect)); - } - - } else if (vial != null) { - - vial.collectDew(this); - - } - - Sample.INSTANCE.play(Assets.SND_DEWDROP); - hero.spendAndNext(TIME_TO_PICK_UP); - - return true; - } -} diff --git a/java/com/hmdzl/spspd/change/items/armor/Armor.java b/java/com/hmdzl/spspd/change/items/armor/Armor.java deleted file mode 100644 index 115c31fb..00000000 --- a/java/com/hmdzl/spspd/change/items/armor/Armor.java +++ /dev/null @@ -1,343 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.armor; - -import java.text.DecimalFormat; -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.ResultDescriptions; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.hero.HeroClass; -import com.hmdzl.spspd.change.actors.hero.HeroSubClass; -import com.hmdzl.spspd.change.items.KindOfArmor; -import com.hmdzl.spspd.change.items.armor.glyphs.AdaptGlyph; -import com.hmdzl.spspd.change.items.armor.glyphs.Changeglyph; -import com.hmdzl.spspd.change.items.armor.glyphs.Crystalglyph; -import com.hmdzl.spspd.change.items.armor.glyphs.Darkglyph; -import com.hmdzl.spspd.change.items.armor.glyphs.Earthglyph; -import com.hmdzl.spspd.change.items.armor.glyphs.Electricityglyph; -import com.hmdzl.spspd.change.items.armor.glyphs.Fireglyph; -import com.hmdzl.spspd.change.items.armor.glyphs.Iceglyph; -import com.hmdzl.spspd.change.items.armor.glyphs.Lightglyph; -import com.hmdzl.spspd.change.items.armor.glyphs.RecoilGlyph; -import com.hmdzl.spspd.change.items.armor.glyphs.Revivalglyph; -import com.hmdzl.spspd.change.items.armor.glyphs.Testglyph; -import com.hmdzl.spspd.change.items.rings.Ring; -import com.hmdzl.spspd.change.items.rings.RingOfEvasion; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.items.EquipableItem; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.sprites.HeroSprite; -import com.hmdzl.spspd.change.sprites.ItemSprite; -import com.hmdzl.spspd.change.utils.GLog; -import com.hmdzl.spspd.change.messages.Messages; - -import com.watabou.utils.Bundlable; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -public class Armor extends KindOfArmor { - - private static final String TXT_TO_STRING = "%s :%d"; - - public int tier; - - public int STR = 10; - public float DEX = 1f; // dexterity modifier - public float STE = 1f; // stealth modifier - public int ENG = 1; // energy modifier - - public Glyph glyph; - - @Override - public boolean doEquip(Hero hero) { - - detachAll(hero.belongings.backpack); - if (hero.belongings.armor == null - || hero.belongings.armor.doUnequip(hero, true)) { - - hero.belongings.armor = this; - activate(hero); - ((HeroSprite) hero.sprite).updateArmor(); - hero.spendAndNext(TIME_TO_EQUIP); - return true; - - } else { - - collect(hero.belongings.backpack); - return false; - } - - } - - @Override - public boolean doUnequip(Hero hero, boolean collect, boolean single) { - if (super.doUnequip(hero, collect, single)) { - hero.belongings.armor = null; - ((HeroSprite) hero.sprite).updateArmor(); - return true; - } else { - return false; - } - } - - @Override - public void proc(Char attacker, Char defender, int damage) { - - if (glyph != null) { - glyph.proc(this, attacker, defender, damage); - } - - } - - private static final String GLYPH = "glyph"; - - public int STR() - { - if(Dungeon.hero != null && Dungeon.hero.belongings.armor == this && STR > 2 && - ( Dungeon.hero.heroClass == HeroClass.WARRIOR || Dungeon.hero.subClass == HeroSubClass.ARTISAN )) - return STR - 2; - else return STR; - } - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(GLYPH, glyph); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - //glyph = (Glyph) bundle.get(GLYPH); - glyph = ((Glyph) bundle.get(GLYPH)); - } - - @Override - public float dexterityFactor(Hero hero) { - - int encumbrance = STR() - hero.STR(); - - float DEX = this.DEX; - - int bonus = 0; - for (Buff buff : hero.buffs(RingOfEvasion.Evasion.class)) { - bonus += ((RingOfEvasion.Evasion) buff).level; - } - - DEX+= (float) (Math.min(2,bonus/15)); - - return encumbrance > 0 ? (float) (DEX / Math.pow(1.5, encumbrance)) : DEX; - } - - - @Override - public float stealthFactor(Hero hero) { - - int encumbrance = STR() - hero.STR(); - - float STE = this.STE; - - int bonus = 0; - for (Buff buff : hero.buffs(RingOfEvasion.Evasion.class)) { - bonus += ((RingOfEvasion.Evasion) buff).level; - } - - STE+= (float) (Math.min(6,bonus/5)); - - return encumbrance > 0 ? (float) (STE / Math.pow(1.5, encumbrance)) : STE; - } - - - @Override - public int energyFactor(Hero hero) { - int ENG = this.ENG; - return ENG; - } - - /*public int tier() { - int tier = this.tier(); - return tier; - }*/ - - @Override - public int drRoll(Hero hero) { - int encumbrance = STR() - hero.STR(); - int dr = super.drRoll(hero); - return encumbrance > 0 ? Math.max((int)(Math.round(dr)*(1-encumbrance/3)),0) :Math.round(dr); - } - - - public Item upgrade(boolean hasglyph) { - - if (hasglyph) { - if (glyph != null) { - hasglyphAdv(); - } else { - hasglyph(); - } - - } - - return super.upgrade(); - } - - @Override - public String toString() { - return levelKnown ? Messages.format(TXT_TO_STRING, super.toString(), STR()) - : super.toString(); - } - - @Override - public String name() { - return glyph == null ? super.name() : glyph.name(super.name()); - } - - @Override - public Item random() { - if (Random.Float() < 0.4) { - int n = 1; - if (Random.Int(3) == 0) { - n++; - if (Random.Int(3) == 0) { - n++; - } - } - if (Random.Int(2) == 0) { - upgrade(n); - } else { - degrade(n); - cursed = true; - } - } - - return this; - } - - public Armor hasglyph( Glyph gph ) { - glyph = gph; - return this; - } - - public Armor hasglyph() { - - Class oldGlyphClass = glyph != null ? glyph.getClass() - : null; - Glyph gph = Glyph.random(); - while (gph.getClass() == oldGlyphClass) { - gph = Glyph.random(); - } - - return hasglyph(gph); - } - - public Armor hasglyphAdv() { - - Class oldGlyphClass = glyph != null ? glyph.getClass() - : null; - Glyph gph = Glyph.randomAdv(); - while (gph.getClass() == oldGlyphClass) { - gph = Glyph.randomAdv(); - } - - return hasglyph(gph); - } - - public boolean isGlyphed() { - return glyph != null; - } - - @Override - public ItemSprite.Glowing glowing() { - return glyph != null ? glyph.glowing() : null; - } - - public static abstract class Glyph implements Bundlable { - - private static final Class[] glyphs = new Class[] { Changeglyph.class, - Crystalglyph.class, Darkglyph.class, Earthglyph.class, - Electricityglyph.class, Fireglyph.class, Iceglyph.class, - Lightglyph.class, Revivalglyph.class, Testglyph.class, - AdaptGlyph.class, RecoilGlyph.class}; - - private static final float[] chances = new float[] { 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1,1,1 }; - - private static final float[] chancesAdv = new float[] { 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1,1,1 }; - - public abstract int proc(Armor armor, Char attacker, Char defender, - int damage); - - public String name(String armorName) { - return Messages.get(this, "name", armorName); - } - - public String desc() { - return Messages.get(this, "desc"); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - } - - @Override - public void storeInBundle(Bundle bundle) { - } - - public ItemSprite.Glowing glowing() { - return ItemSprite.Glowing.WHITE; - } - - public boolean checkOwner(Char owner) { - if (!owner.isAlive() && owner instanceof Hero) { - - Badges.validateDeathFromGlyph(); - return true; - - } else { - return false; - } - } - - @SuppressWarnings("unchecked") - public static Glyph random() { - try { - return ((Class) glyphs[Random.chances(chances)]) - .newInstance(); - } catch (Exception e) { - return null; - } - } - - @SuppressWarnings("unchecked") - public static Glyph randomAdv() { - try { - return ((Class) glyphs[Random.chances(chancesAdv)]) - .newInstance(); - } catch (Exception e) { - return null; - } - } - - } -} diff --git a/java/com/hmdzl/spspd/change/items/armor/glyphs/AdaptGlyph.java b/java/com/hmdzl/spspd/change/items/armor/glyphs/AdaptGlyph.java deleted file mode 100644 index a24ac22b..00000000 --- a/java/com/hmdzl/spspd/change/items/armor/glyphs/AdaptGlyph.java +++ /dev/null @@ -1,114 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.armor.glyphs; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.Blob; -import com.hmdzl.spspd.change.actors.blobs.ConfusionGas; -import com.hmdzl.spspd.change.actors.blobs.DarkGas; -import com.hmdzl.spspd.change.actors.blobs.ParalyticGas; -import com.hmdzl.spspd.change.actors.blobs.StenchGas; -import com.hmdzl.spspd.change.actors.blobs.TarGas; -import com.hmdzl.spspd.change.actors.blobs.ToxicGas; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.EarthImbue; -import com.hmdzl.spspd.change.actors.buffs.FireImbue; -import com.hmdzl.spspd.change.actors.buffs.GasesImmunity; -import com.hmdzl.spspd.change.actors.buffs.Haste; -import com.hmdzl.spspd.change.actors.buffs.Invisibility; -import com.hmdzl.spspd.change.actors.buffs.Levitation; -import com.hmdzl.spspd.change.actors.buffs.Recharging; -import com.hmdzl.spspd.change.items.armor.Armor; -import com.hmdzl.spspd.change.items.armor.Armor.Glyph; -import com.hmdzl.spspd.change.items.misc.FourClover; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.Terrain; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ItemSprite; -import com.hmdzl.spspd.change.sprites.ItemSprite.Glowing; -import com.hmdzl.spspd.change.actors.buffs.armorbuff.GlyphDark; -import com.hmdzl.spspd.change.actors.buffs.armorbuff.GlyphEarth; -import com.hmdzl.spspd.change.actors.buffs.armorbuff.GlyphElectricity; -import com.hmdzl.spspd.change.actors.buffs.armorbuff.GlyphFire; -import com.hmdzl.spspd.change.actors.buffs.armorbuff.GlyphIce; -import com.hmdzl.spspd.change.actors.buffs.armorbuff.GlyphLight; -import com.watabou.utils.Random; - -public class AdaptGlyph extends Glyph { - - private static ItemSprite.Glowing DEEPGREEN = new ItemSprite.Glowing(0x006633); - - @Override - public int proc(Armor armor, Char attacker, Char defender, int damage) { - - GlyphDark gdark = defender.buff(GlyphDark.class); - GlyphIce gice = defender.buff(GlyphIce.class); - GlyphLight glight = defender.buff(GlyphLight.class); - GlyphFire gfire = defender.buff(GlyphFire.class); - GlyphEarth gearth = defender.buff(GlyphEarth.class); - GlyphElectricity gelect = defender.buff(GlyphElectricity.class); - FourClover.FourCloverBless fcb = defender.buff(FourClover.FourCloverBless.class); - - if (defender.isAlive() && (gdark != null || gice != null || glight != null || gfire != null || gearth != null || gelect != null )) - { - Buff.detach(defender,GlyphIce.class); - Buff.detach(defender,GlyphLight.class); - Buff.detach(defender,GlyphFire.class); - Buff.detach(defender,GlyphEarth.class); - Buff.detach(defender,GlyphElectricity.class); - Buff.detach(defender,GlyphDark.class); - } - - int level = Math.max(0, armor.level); - - if (Random.Int(level + 5) >= 4 || (fcb != null && Random.Int(level + 5) >= 2)) { - - if (Dungeon.level.map[defender.pos] == Terrain.GRASS) { - Buff.prolong(defender, EarthImbue.class,5f); - } - - if (Dungeon.level.map[defender.pos] == Terrain.WATER) { - Buff.prolong(defender, Haste.class,5f); - } - - if (Dungeon.level.map[defender.pos] == Terrain.HIGH_GRASS) { - Buff.prolong(defender, Invisibility.class,5f); - } - - if (Dungeon.level.map[defender.pos] == Terrain.CHASM) { - Buff.affect(defender, Levitation.class,10f); - } - - if (Dungeon.level.map[defender.pos] == Terrain.INACTIVE_TRAP) { - Buff.prolong(defender, Recharging.class,5f); - } - - if (Dungeon.level.map[defender.pos] == Terrain.EMBERS) { - Buff.affect(defender, FireImbue.class).set(5f); - } - } - return damage; - } - - @Override - public Glowing glowing() { - return DEEPGREEN; - } - -} diff --git a/java/com/hmdzl/spspd/change/items/armor/glyphs/Changeglyph.java b/java/com/hmdzl/spspd/change/items/armor/glyphs/Changeglyph.java deleted file mode 100644 index f49ccf9d..00000000 --- a/java/com/hmdzl/spspd/change/items/armor/glyphs/Changeglyph.java +++ /dev/null @@ -1,118 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.armor.glyphs; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Invisibility; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.mobs.npcs.MirrorImage; -import com.hmdzl.spspd.change.items.armor.Armor; -import com.hmdzl.spspd.change.items.armor.Armor.Glyph; -import com.hmdzl.spspd.change.items.misc.FourClover; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfTeleportation; -import com.hmdzl.spspd.change.items.wands.WandOfBlood; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ItemSprite; -import com.hmdzl.spspd.change.sprites.ItemSprite.Glowing; -import com.hmdzl.spspd.change.actors.buffs.armorbuff.GlyphDark; -import com.hmdzl.spspd.change.actors.buffs.armorbuff.GlyphEarth; -import com.hmdzl.spspd.change.actors.buffs.armorbuff.GlyphElectricity; -import com.hmdzl.spspd.change.actors.buffs.armorbuff.GlyphFire; -import com.hmdzl.spspd.change.actors.buffs.armorbuff.GlyphIce; -import com.hmdzl.spspd.change.actors.buffs.armorbuff.GlyphLight; - -import com.watabou.utils.Random; - -import java.util.ArrayList; - -public class Changeglyph extends Glyph { - - private static ItemSprite.Glowing PURPLE = new ItemSprite.Glowing(0x8844CC); - - @Override - public int proc(Armor armor, Char attacker, Char defender, int damage) { - GlyphDark gdark = defender.buff(GlyphDark.class); - GlyphIce gice = defender.buff(GlyphIce.class); - GlyphLight glight = defender.buff(GlyphLight.class); - GlyphFire gfire = defender.buff(GlyphFire.class); - GlyphEarth gearth = defender.buff(GlyphEarth.class); - GlyphElectricity gelect = defender.buff(GlyphElectricity.class); - FourClover.FourCloverBless fcb = defender.buff(FourClover.FourCloverBless.class); - if (defender.isAlive() && (gdark != null || gice != null || glight != null || gfire != null || gearth != null || gelect != null )) - { - Buff.detach(defender,GlyphIce.class); - Buff.detach(defender,GlyphLight.class); - Buff.detach(defender,GlyphFire.class); - Buff.detach(defender,GlyphEarth.class); - Buff.detach(defender,GlyphElectricity.class); - Buff.detach(defender,GlyphDark.class); - } - - int level = Math.max(0, armor.level); - - if (Random.Int(level / 2 + 6) >= 5 || (fcb != null && Random.Int(level / 2 + 6) >= 3)) { - - ArrayList respawnPoints = new ArrayList(); - - for (int i = 0; i < Level.NEIGHBOURS8.length; i++) { - int p = defender.pos + Level.NEIGHBOURS8[i]; - if (Actor.findChar(p) == null - && (Level.passable[p] || Level.avoid[p])) { - respawnPoints.add(p); - } - } - - if (respawnPoints.size() > 0) { - MirrorImage mob = new MirrorImage(); - mob.duplicate((Hero) defender); - GameScene.add(mob); - ScrollOfTeleportation.appear(mob, Random.element(respawnPoints)); - checkOwner(defender); - } - - } - - if (Dungeon.bossLevel()) { - return damage; - } - - int nTries = (armor.level < 0 ? 1 : armor.level + 1) * 5; - for (int i=0; i < nTries; i++) { - int pos = Random.Int( Level.LENGTH ); - if (Dungeon.visible[pos] && Level.passable[pos] && Actor.findChar( pos ) == null) { - - ScrollOfTeleportation.appear( defender, pos ); - Dungeon.level.press( pos, defender ); - Buff.affect(defender, Invisibility.class, 5f); - Dungeon.observe(); - break; - } - } - - return damage; - } - - @Override - public Glowing glowing() { - return PURPLE; - } -} diff --git a/java/com/hmdzl/spspd/change/items/armor/glyphs/Crystalglyph.java b/java/com/hmdzl/spspd/change/items/armor/glyphs/Crystalglyph.java deleted file mode 100644 index 230439b2..00000000 --- a/java/com/hmdzl/spspd/change/items/armor/glyphs/Crystalglyph.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.armor.glyphs; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.GlassShield; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.mobs.npcs.MirrorImage; -import com.hmdzl.spspd.change.items.armor.Armor; -import com.hmdzl.spspd.change.items.armor.Armor.Glyph; -import com.hmdzl.spspd.change.items.misc.FourClover; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfTeleportation; -import com.hmdzl.spspd.change.items.wands.WandOfBlood; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ItemSprite; -import com.hmdzl.spspd.change.sprites.ItemSprite.Glowing; -import com.hmdzl.spspd.change.actors.buffs.armorbuff.GlyphDark; -import com.hmdzl.spspd.change.actors.buffs.armorbuff.GlyphEarth; -import com.hmdzl.spspd.change.actors.buffs.armorbuff.GlyphElectricity; -import com.hmdzl.spspd.change.actors.buffs.armorbuff.GlyphFire; -import com.hmdzl.spspd.change.actors.buffs.armorbuff.GlyphIce; -import com.hmdzl.spspd.change.actors.buffs.armorbuff.GlyphLight; - -import com.watabou.utils.Random; - -public class Crystalglyph extends Glyph { - - private static ItemSprite.Glowing PINK = new ItemSprite.Glowing(0xCCAA88); - - @Override - public int proc(Armor armor, Char attacker, Char defender, int damage) { - GlyphDark gdark = defender.buff(GlyphDark.class); - GlyphIce gice = defender.buff(GlyphIce.class); - GlyphLight glight = defender.buff(GlyphLight.class); - GlyphFire gfire = defender.buff(GlyphFire.class); - GlyphEarth gearth = defender.buff(GlyphEarth.class); - GlyphElectricity gelect = defender.buff(GlyphElectricity.class); - FourClover.FourCloverBless fcb = defender.buff(FourClover.FourCloverBless.class); - if (defender.isAlive() && (gdark != null || gice != null || glight != null || gfire != null || gearth != null || gelect != null )) - { - Buff.detach(defender,GlyphIce.class); - Buff.detach(defender,GlyphLight.class); - Buff.detach(defender,GlyphFire.class); - Buff.detach(defender,GlyphEarth.class); - Buff.detach(defender,GlyphElectricity.class); - Buff.detach(defender,GlyphDark.class); - } - - int level = Math.max(0, armor.level); - if (Random.Int(level / 2 + 6) >= 5 && (damage > 30 || (fcb != null && damage > 15))) { - Buff.affect(defender, GlassShield.class).turns(1); - } - return damage; - } - @Override - public Glowing glowing() { - return PINK; - } -} diff --git a/java/com/hmdzl/spspd/change/items/armor/glyphs/Darkglyph.java b/java/com/hmdzl/spspd/change/items/armor/glyphs/Darkglyph.java deleted file mode 100644 index f6cd4dcc..00000000 --- a/java/com/hmdzl/spspd/change/items/armor/glyphs/Darkglyph.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.armor.glyphs; - -import android.icu.util.Calendar; - -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Hunger; -import com.hmdzl.spspd.change.actors.buffs.Weakness; -import com.hmdzl.spspd.change.actors.buffs.armorbuff.GlyphDark; -import com.hmdzl.spspd.change.actors.buffs.armorbuff.GlyphEarth; -import com.hmdzl.spspd.change.actors.buffs.armorbuff.GlyphElectricity; -import com.hmdzl.spspd.change.actors.buffs.armorbuff.GlyphFire; -import com.hmdzl.spspd.change.actors.buffs.armorbuff.GlyphIce; -import com.hmdzl.spspd.change.actors.buffs.armorbuff.GlyphLight; -import com.hmdzl.spspd.change.actors.mobs.DwarfLich; -import com.hmdzl.spspd.change.actors.mobs.Fiend; -import com.hmdzl.spspd.change.actors.mobs.Warlock; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.armor.Armor; -import com.hmdzl.spspd.change.items.armor.Armor.Glyph; -import com.hmdzl.spspd.change.items.misc.FourClover; -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.hmdzl.spspd.change.sprites.ItemSprite; -import com.hmdzl.spspd.change.sprites.ItemSprite.Glowing; -import com.hmdzl.spspd.change.ui.BuffIndicator; -import com.watabou.utils.Random; - -import java.util.HashSet; - -public class Darkglyph extends Glyph { - - private static ItemSprite.Glowing BLACK = new ItemSprite.Glowing( 0x000000 ); - - @Override - public int proc(Armor armor, Char attacker, Char defender, int damage) { - - GlyphDark gdark = defender.buff(GlyphDark.class); - GlyphIce gice = defender.buff(GlyphIce.class); - GlyphLight glight = defender.buff(GlyphLight.class); - GlyphFire gfire = defender.buff(GlyphFire.class); - GlyphEarth gearth = defender.buff(GlyphEarth.class); - GlyphElectricity gelect = defender.buff(GlyphElectricity.class); - FourClover.FourCloverBless fcb = defender.buff(FourClover.FourCloverBless.class); - - if (defender.isAlive() && gdark == null) - { - Buff.detach(defender,GlyphIce.class); - Buff.detach(defender,GlyphLight.class); - Buff.detach(defender,GlyphFire.class); - Buff.detach(defender,GlyphEarth.class); - Buff.detach(defender,GlyphElectricity.class); - Buff.affect(defender,GlyphDark.class); - } - - int level = Math.max(0, armor.level); - if (Random.Int(level / 2 + 5) >= 8 || (fcb != null && Random.Int(level/2 + 5) >= 6)) { - - int healing = Random.Int(attacker.HP/10); - - if (healing > 0) { - defender.HP += Random.Int(Math.min(healing, defender.HT - defender.HP)/2); - defender.sprite.emitter().burst(Speck.factory(Speck.HEALING), 1); - //defender.sprite.showStatus(CharSprite.POSITIVE,Integer.toString(healing)); - attacker.damage(healing, this); - } - } - - return damage; - } - - @Override - public Glowing glowing() { - return BLACK; - } - -} diff --git a/java/com/hmdzl/spspd/change/items/armor/glyphs/Earthglyph.java b/java/com/hmdzl/spspd/change/items/armor/glyphs/Earthglyph.java deleted file mode 100644 index 106171f6..00000000 --- a/java/com/hmdzl/spspd/change/items/armor/glyphs/Earthglyph.java +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.armor.glyphs; - -import android.provider.DocumentsContract; - -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.weather.WeatherOfSand; -import com.hmdzl.spspd.change.actors.blobs.weather.WeatherOfSnow; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.DefenceUp; -import com.hmdzl.spspd.change.actors.buffs.Ooze; -import com.hmdzl.spspd.change.actors.buffs.Poison; -import com.hmdzl.spspd.change.actors.buffs.Roots; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.particles.EarthParticle; -import com.hmdzl.spspd.change.items.armor.Armor; -import com.hmdzl.spspd.change.items.armor.Armor.Glyph; -import com.hmdzl.spspd.change.items.misc.FourClover; -import com.hmdzl.spspd.change.plants.Earthroot; -import com.hmdzl.spspd.change.sprites.ItemSprite; -import com.hmdzl.spspd.change.sprites.ItemSprite.Glowing; - -import com.hmdzl.spspd.change.actors.buffs.armorbuff.GlyphDark; -import com.hmdzl.spspd.change.actors.buffs.armorbuff.GlyphEarth; -import com.hmdzl.spspd.change.actors.buffs.armorbuff.GlyphElectricity; -import com.hmdzl.spspd.change.actors.buffs.armorbuff.GlyphFire; -import com.hmdzl.spspd.change.actors.buffs.armorbuff.GlyphIce; -import com.hmdzl.spspd.change.actors.buffs.armorbuff.GlyphLight; - -import com.watabou.noosa.Camera; -import com.watabou.utils.Random; - -import java.util.HashSet; - -public class Earthglyph extends Glyph { - - private static ItemSprite.Glowing GERY = new ItemSprite.Glowing( 0xCCCCCC); - - @Override - public int proc(Armor armor, Char attacker, Char defender, int damage) { - - GlyphDark gdark = defender.buff(GlyphDark.class); - GlyphIce gice = defender.buff(GlyphIce.class); - GlyphLight glight = defender.buff(GlyphLight.class); - GlyphFire gfire = defender.buff(GlyphFire.class); - GlyphEarth gearth = defender.buff(GlyphEarth.class); - GlyphElectricity gelect = defender.buff(GlyphElectricity.class); - FourClover.FourCloverBless fcb = defender.buff(FourClover.FourCloverBless.class); - - if (defender.isAlive() && gearth == null) - { - Buff.detach(defender,GlyphIce.class); - Buff.detach(defender,GlyphLight.class); - Buff.detach(defender,GlyphFire.class); - Buff.detach(defender,GlyphDark.class); - Buff.detach(defender,GlyphElectricity.class); - Buff.affect(defender,GlyphEarth.class); - } - - int level = Math.max(0, armor.level); - int levelRoots = Math.min(4, armor.level); - - if (Random.Int(4) == 0 ) { - - Buff.affect(defender, Earthroot.Armor.class).level(5 * (level + 1)); - CellEmitter.bottom(defender.pos).start(EarthParticle.FACTORY, - 0.05f, 8); - Camera.main.shake(1, 0.4f); - - } - - if (Random.Int(level + 6) >= 5 || (fcb != null && Random.Int(level + 6) >= 3)) { - Buff.prolong(defender, DefenceUp.class,5f).level(20); - } - - return damage; - - } - - @Override - public Glowing glowing() { - return GERY; - } - -} diff --git a/java/com/hmdzl/spspd/change/items/armor/glyphs/Electricityglyph.java b/java/com/hmdzl/spspd/change/items/armor/glyphs/Electricityglyph.java deleted file mode 100644 index 01cbcef3..00000000 --- a/java/com/hmdzl/spspd/change/items/armor/glyphs/Electricityglyph.java +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.armor.glyphs; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.ElectriShock; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Paralysis; -import com.hmdzl.spspd.change.actors.buffs.Recharging; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.mobs.GnollShaman; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.actors.mobs.Shell; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Pushing; -import com.hmdzl.spspd.change.effects.particles.EnergyParticle; -import com.hmdzl.spspd.change.items.armor.Armor; -import com.hmdzl.spspd.change.items.armor.Armor.Glyph; -import com.hmdzl.spspd.change.items.misc.FourClover; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfRecharging; -import com.hmdzl.spspd.change.items.wands.WandOfLight; -import com.hmdzl.spspd.change.items.wands.WandOfLightning; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.traps.LightningTrap; -import com.hmdzl.spspd.change.sprites.ItemSprite; -import com.hmdzl.spspd.change.sprites.ItemSprite.Glowing; - -import com.hmdzl.spspd.change.actors.buffs.armorbuff.GlyphDark; -import com.hmdzl.spspd.change.actors.buffs.armorbuff.GlyphEarth; -import com.hmdzl.spspd.change.actors.buffs.armorbuff.GlyphElectricity; -import com.hmdzl.spspd.change.actors.buffs.armorbuff.GlyphFire; -import com.hmdzl.spspd.change.actors.buffs.armorbuff.GlyphIce; -import com.hmdzl.spspd.change.actors.buffs.armorbuff.GlyphLight; - -import com.watabou.utils.Random; - -import java.util.HashSet; - -public class Electricityglyph extends Glyph { - - private static ItemSprite.Glowing WHITE = new ItemSprite.Glowing( 0xFFFFFF); - - @Override - public int proc(Armor armor, Char attacker, Char defender, int damage) { - - GlyphDark gdark = defender.buff(GlyphDark.class); - GlyphIce gice = defender.buff(GlyphIce.class); - GlyphLight glight = defender.buff(GlyphLight.class); - GlyphFire gfire = defender.buff(GlyphFire.class); - GlyphEarth gearth = defender.buff(GlyphEarth.class); - GlyphElectricity gelect = defender.buff(GlyphElectricity.class); - FourClover.FourCloverBless fcb = defender.buff(FourClover.FourCloverBless.class); - - if (defender.isAlive() && gelect == null) - { - Buff.detach(defender,GlyphIce.class); - Buff.detach(defender,GlyphLight.class); - Buff.detach(defender,GlyphFire.class); - Buff.detach(defender,GlyphEarth.class); - Buff.detach(defender,GlyphDark.class); - Buff.affect(defender,GlyphElectricity.class); - } - - int level = Math.max(0, armor.level); - - - if (Random.Int(level) >= 5) { - if (defender instanceof Hero) { - Buff.prolong(defender, Recharging.class, Math.min(level,30)); - } - } - - if (Random.Int(level + 6) >= 5 || (fcb != null && Random.Int(level + 6) >= 3)) { - Buff.prolong(attacker, Paralysis.class, 2f); - CellEmitter.get(attacker.pos).start(EnergyParticle.FACTORY, 0.2f, 6); - } - - return damage; - } - - @Override - public Glowing glowing() { - return WHITE; - } - -} diff --git a/java/com/hmdzl/spspd/change/items/armor/glyphs/Fireglyph.java b/java/com/hmdzl/spspd/change/items/armor/glyphs/Fireglyph.java deleted file mode 100644 index a782b7f0..00000000 --- a/java/com/hmdzl/spspd/change/items/armor/glyphs/Fireglyph.java +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.armor.glyphs; - -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.Fire; -import com.hmdzl.spspd.change.actors.blobs.TarGas; -import com.hmdzl.spspd.change.actors.buffs.AttackUp; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Burning; -import com.hmdzl.spspd.change.actors.buffs.Charm; -import com.hmdzl.spspd.change.actors.buffs.Hot; -import com.hmdzl.spspd.change.actors.buffs.Tar; -import com.hmdzl.spspd.change.actors.mobs.FireElemental; -import com.hmdzl.spspd.change.actors.mobs.Yog; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.effects.particles.FlameParticle; -import com.hmdzl.spspd.change.items.armor.Armor; -import com.hmdzl.spspd.change.items.armor.Armor.Glyph; -import com.hmdzl.spspd.change.items.misc.FourClover; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.sprites.ItemSprite; -import com.hmdzl.spspd.change.sprites.ItemSprite.Glowing; -import com.hmdzl.spspd.change.actors.buffs.armorbuff.GlyphDark; -import com.hmdzl.spspd.change.actors.buffs.armorbuff.GlyphEarth; -import com.hmdzl.spspd.change.actors.buffs.armorbuff.GlyphElectricity; -import com.hmdzl.spspd.change.actors.buffs.armorbuff.GlyphFire; -import com.hmdzl.spspd.change.actors.buffs.armorbuff.GlyphIce; -import com.hmdzl.spspd.change.actors.buffs.armorbuff.GlyphLight; - -import com.watabou.utils.GameMath; -import com.watabou.utils.Random; - -import java.util.HashSet; - -public class Fireglyph extends Glyph { - - private static ItemSprite.Glowing ORANGE = new ItemSprite.Glowing( 0xFF4400 ); - - @Override - public int proc(Armor armor, Char attacker, Char defender, int damage) { - - GlyphDark gdark = defender.buff(GlyphDark.class); - GlyphIce gice = defender.buff(GlyphIce.class); - GlyphLight glight = defender.buff(GlyphLight.class); - GlyphFire gfire = defender.buff(GlyphFire.class); - GlyphEarth gearth = defender.buff(GlyphEarth.class); - GlyphElectricity gelect = defender.buff(GlyphElectricity.class); - FourClover.FourCloverBless fcb = defender.buff(FourClover.FourCloverBless.class); - - if (defender.isAlive() && gfire == null) - { - Buff.detach(defender,GlyphIce.class); - Buff.detach(defender,GlyphLight.class); - Buff.detach(defender,GlyphDark.class); - Buff.detach(defender,GlyphEarth.class); - Buff.detach(defender,GlyphElectricity.class); - Buff.affect(defender,GlyphFire.class); - } - - int level = Math.max(0, armor.level); - - if (Random.Int(level + 6) >= 5 || (fcb != null && Random.Int(level + 6) >= 3)) { - Buff.affect(attacker, Burning.class).reignite( attacker ); - defender.sprite.emitter().burst(FlameParticle.FACTORY, 5); - } - - if (Random.Int(level + 7) >= 6) { - Buff.prolong(defender, AttackUp.class,5f).level(25); - } - - return damage; - } - - @Override - public Glowing glowing() { - return ORANGE; - } - -} diff --git a/java/com/hmdzl/spspd/change/items/armor/glyphs/Iceglyph.java b/java/com/hmdzl/spspd/change/items/armor/glyphs/Iceglyph.java deleted file mode 100644 index ccd283aa..00000000 --- a/java/com/hmdzl/spspd/change/items/armor/glyphs/Iceglyph.java +++ /dev/null @@ -1,210 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.armor.glyphs; - -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.ResultDescriptions; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.weather.WeatherOfSnow; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Chill; -import com.hmdzl.spspd.change.actors.buffs.Cold; -import com.hmdzl.spspd.change.actors.buffs.Frost; -import com.hmdzl.spspd.change.actors.buffs.Paralysis; -import com.hmdzl.spspd.change.actors.buffs.Roots; -import com.hmdzl.spspd.change.actors.buffs.Slow; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.particles.SnowParticle; -import com.hmdzl.spspd.change.items.armor.Armor; -import com.hmdzl.spspd.change.items.armor.Armor.Glyph; -import com.hmdzl.spspd.change.items.misc.FourClover; -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.hmdzl.spspd.change.sprites.ItemSprite; -import com.hmdzl.spspd.change.sprites.ItemSprite.Glowing; -import com.hmdzl.spspd.change.ui.BuffIndicator; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.utils.GLog; -import com.hmdzl.spspd.change.actors.buffs.armorbuff.GlyphDark; -import com.hmdzl.spspd.change.actors.buffs.armorbuff.GlyphEarth; -import com.hmdzl.spspd.change.actors.buffs.armorbuff.GlyphElectricity; -import com.hmdzl.spspd.change.actors.buffs.armorbuff.GlyphFire; -import com.hmdzl.spspd.change.actors.buffs.armorbuff.GlyphIce; -import com.hmdzl.spspd.change.actors.buffs.armorbuff.GlyphLight; - -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -import java.util.HashSet; - -public class Iceglyph extends Glyph { - - private static ItemSprite.Glowing BLUE = new ItemSprite.Glowing(0x0000FF); - - @Override - public int proc(Armor armor, Char attacker, Char defender, int damage) { - - GlyphDark gdark = defender.buff(GlyphDark.class); - GlyphIce gice = defender.buff(GlyphIce.class); - GlyphLight glight = defender.buff(GlyphLight.class); - GlyphFire gfire = defender.buff(GlyphFire.class); - GlyphEarth gearth = defender.buff(GlyphEarth.class); - GlyphElectricity gelect = defender.buff(GlyphElectricity.class); - FourClover.FourCloverBless fcb = defender.buff(FourClover.FourCloverBless.class); - - if (defender.isAlive() && gice == null) - { - Buff.detach(defender,GlyphDark.class); - Buff.detach(defender,GlyphLight.class); - Buff.detach(defender,GlyphFire.class); - Buff.detach(defender,GlyphEarth.class); - Buff.detach(defender,GlyphElectricity.class); - Buff.affect(defender,GlyphIce.class); - } - - if (damage == 0) { - return 0; - } - - int level = Math.max(0, armor.level); - - if (Random.Int(level + 6) >= 5 || (fcb != null && Random.Int(level + 6) >= 3)) { - Buff.prolong(attacker, Frost.class, Frost.duration(attacker)* Random.Float(1f, 1.5f)); - CellEmitter.get(attacker.pos).start(SnowParticle.FACTORY, 0.2f, 6); - } - - if (Random.Int(level + 7) >= 6) { - DeferedDamage debuff = defender.buff(DeferedDamage.class); - if (debuff == null) { - debuff = new DeferedDamage(); - debuff.attachTo(defender); - } - debuff.prolong(damage); - - defender.sprite.showStatus(CharSprite.WARNING, Messages.get(this, "deferred", damage)); - - return 0; - - } else { - return damage; - } - - } - - //private static final HashSet> RESISTANCES = new HashSet>(); - //private static final HashSet> IMMUNITIES = new HashSet>(); - //static { - //RESISTANCES.add( Frost.class ); - //RESISTANCES.add( Cold.class ); - //RESISTANCES.add( Chill.class ); - //IMMUNITIES.add(WeatherOfSnow.class ); - - //RESISTS.add( DisintegrationTrap.class ); - //RESISTS.add( GrimTrap.class ); - - //RESISTS.add( Shaman.class ); - //RESISTS.add( Warlock.class ); - //RESISTS.add( Eye.class ); - //RESISTS.add( Yog.BurningFist.class ); - //} - - - @Override - public Glowing glowing() { - return BLUE; - } - - public static class DeferedDamage extends Buff { - - protected int damage = 0; - - private static final String DAMAGE = "damage"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(DAMAGE, damage); - - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - damage = bundle.getInt(DAMAGE); - } - - @Override - public boolean attachTo(Char target) { - if (super.attachTo(target)) { - postpone(TICK); - return true; - } else { - return false; - } - } - - public void prolong(int damage) { - this.damage += damage; - }; - - @Override - public int icon() { - return BuffIndicator.DEFERRED; - } - - @Override - public String toString() { - return Messages.get(this, "name"); - } - - @Override - public boolean act() { - if (target.isAlive()) { - - int damageThisTick = Math.max(1, (int)(damage*0.1f)); - target.damage( damageThisTick, this ); - if (target == Dungeon.hero && !target.isAlive()) { - - Glyph glyph = new Iceglyph(); - Dungeon.fail(Messages.format(ResultDescriptions.GLYPH)); - //GLog.n("%s killed you...", glyph.name()); - - Badges.validateDeathFromGlyph(); - } - spend(TICK); - - damage -= damageThisTick; - if (--damage <= 0) { - detach(); - } - - } else { - - detach(); - - } - - return true; - } - @Override - public String desc() { - return Messages.get(this, "desc", damage); - } - - } -} diff --git a/java/com/hmdzl/spspd/change/items/armor/glyphs/Lightglyph.java b/java/com/hmdzl/spspd/change/items/armor/glyphs/Lightglyph.java deleted file mode 100644 index 471ea37b..00000000 --- a/java/com/hmdzl/spspd/change/items/armor/glyphs/Lightglyph.java +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.armor.glyphs; - -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Amok; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Charm; -import com.hmdzl.spspd.change.actors.buffs.Frost; -import com.hmdzl.spspd.change.actors.buffs.Terror; -import com.hmdzl.spspd.change.actors.mobs.SewerHeart; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.effects.particles.SnowParticle; -import com.hmdzl.spspd.change.items.armor.Armor; -import com.hmdzl.spspd.change.items.armor.Armor.Glyph; -import com.hmdzl.spspd.change.items.misc.FourClover; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.sprites.ItemSprite; -import com.hmdzl.spspd.change.sprites.ItemSprite.Glowing; -import com.hmdzl.spspd.change.actors.buffs.armorbuff.GlyphDark; -import com.hmdzl.spspd.change.actors.buffs.armorbuff.GlyphEarth; -import com.hmdzl.spspd.change.actors.buffs.armorbuff.GlyphElectricity; -import com.hmdzl.spspd.change.actors.buffs.armorbuff.GlyphFire; -import com.hmdzl.spspd.change.actors.buffs.armorbuff.GlyphIce; -import com.hmdzl.spspd.change.actors.buffs.armorbuff.GlyphLight; -import com.watabou.utils.GameMath; -import com.watabou.utils.Random; - -import java.util.HashSet; - -public class Lightglyph extends Glyph { - - private static ItemSprite.Glowing YELLOW = new ItemSprite.Glowing( 0xFFFF44 ); - - @Override - public int proc(Armor armor, Char attacker, Char defender, int damage) { - - GlyphDark gdark = defender.buff(GlyphDark.class); - GlyphIce gice = defender.buff(GlyphIce.class); - GlyphLight glight = defender.buff(GlyphLight.class); - GlyphFire gfire = defender.buff(GlyphFire.class); - GlyphEarth gearth = defender.buff(GlyphEarth.class); - GlyphElectricity gelect = defender.buff(GlyphElectricity.class); - FourClover.FourCloverBless fcb = defender.buff(FourClover.FourCloverBless.class); - - if (defender.isAlive() && glight == null) - { - Buff.detach(defender,GlyphIce.class); - Buff.detach(defender,GlyphDark.class); - Buff.detach(defender,GlyphFire.class); - Buff.detach(defender,GlyphEarth.class); - Buff.detach(defender,GlyphElectricity.class); - Buff.affect(defender,GlyphLight.class); - } - - int level = (int) GameMath.gate(0, armor.level, 6); - - if (Random.Int(level / 2 + 5) >= 4) { - - int duration = Random.IntRange(4, 7); - Buff.affect(attacker, Charm.class, Charm.durationFactor(attacker) - * duration).object = defender.id(); - Buff.affect(attacker, Amok.class,10f); - attacker.sprite.centerEmitter().start(Speck.factory(Speck.HEART),0.2f, 5); - } - - else if (Random.Int(level / 2 + 5) >= 3 || (fcb != null && Random.Int(level/2 + 5) >= 1)) { - Buff.affect(attacker, Terror.class, 10f).object = defender.id(); - } - - return damage; - } - - @Override - public Glowing glowing() { - return YELLOW; - } - -} diff --git a/java/com/hmdzl/spspd/change/items/armor/glyphs/RecoilGlyph.java b/java/com/hmdzl/spspd/change/items/armor/glyphs/RecoilGlyph.java deleted file mode 100644 index b3acb6bf..00000000 --- a/java/com/hmdzl/spspd/change/items/armor/glyphs/RecoilGlyph.java +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.armor.glyphs; - -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.Blob; -import com.hmdzl.spspd.change.actors.blobs.ConfusionGas; -import com.hmdzl.spspd.change.actors.blobs.DarkGas; -import com.hmdzl.spspd.change.actors.blobs.ParalyticGas; -import com.hmdzl.spspd.change.actors.blobs.StenchGas; -import com.hmdzl.spspd.change.actors.blobs.TarGas; -import com.hmdzl.spspd.change.actors.blobs.ToxicGas; -import com.hmdzl.spspd.change.actors.buffs.Bleeding; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.GasesImmunity; -import com.hmdzl.spspd.change.items.armor.Armor; -import com.hmdzl.spspd.change.items.armor.Armor.Glyph; -import com.hmdzl.spspd.change.items.misc.FourClover; -import com.hmdzl.spspd.change.items.wands.WandOfFlow; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.mechanics.Ballistica; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ItemSprite; -import com.hmdzl.spspd.change.sprites.ItemSprite.Glowing; -import com.hmdzl.spspd.change.actors.buffs.armorbuff.GlyphDark; -import com.hmdzl.spspd.change.actors.buffs.armorbuff.GlyphEarth; -import com.hmdzl.spspd.change.actors.buffs.armorbuff.GlyphElectricity; -import com.hmdzl.spspd.change.actors.buffs.armorbuff.GlyphFire; -import com.hmdzl.spspd.change.actors.buffs.armorbuff.GlyphIce; -import com.hmdzl.spspd.change.actors.buffs.armorbuff.GlyphLight; -import com.watabou.utils.Random; - -public class RecoilGlyph extends Glyph { - - private static ItemSprite.Glowing BROWN = new ItemSprite.Glowing(0xCC6600); - - @Override - public int proc(Armor armor, Char attacker, Char defender, int damage) { - - GlyphDark gdark = defender.buff(GlyphDark.class); - GlyphIce gice = defender.buff(GlyphIce.class); - GlyphLight glight = defender.buff(GlyphLight.class); - GlyphFire gfire = defender.buff(GlyphFire.class); - GlyphEarth gearth = defender.buff(GlyphEarth.class); - GlyphElectricity gelect = defender.buff(GlyphElectricity.class); - FourClover.FourCloverBless fcb = defender.buff(FourClover.FourCloverBless.class); - - if (defender.isAlive() && (gdark != null || gice != null || glight != null || gfire != null || gearth != null || gelect != null )) - { - Buff.detach(defender,GlyphIce.class); - Buff.detach(defender,GlyphLight.class); - Buff.detach(defender,GlyphFire.class); - Buff.detach(defender,GlyphEarth.class); - Buff.detach(defender,GlyphElectricity.class); - Buff.detach(defender,GlyphDark.class); - } - - int level = Math.max(0, armor.level); - - if (Random.Int( level + 5 ) >= 4 || (fcb != null && Random.Int(level + 5) >= 2)){ - int oppositeHero = attacker.pos + (attacker.pos - defender.pos); - Ballistica trajectory = new Ballistica(attacker.pos, oppositeHero, Ballistica.MAGIC_BOLT); - WandOfFlow.throwChar(attacker, trajectory, 2); - } - - if ( Random.Int( level/2 + 5) >= 4) { - - Buff.affect( attacker, Bleeding.class).set( Math.max( level/2, damage)); - - } - - return damage; - } - - @Override - public Glowing glowing() { - return BROWN; - } - -} diff --git a/java/com/hmdzl/spspd/change/items/armor/glyphs/Revivalglyph.java b/java/com/hmdzl/spspd/change/items/armor/glyphs/Revivalglyph.java deleted file mode 100644 index e8932d6c..00000000 --- a/java/com/hmdzl/spspd/change/items/armor/glyphs/Revivalglyph.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.armor.glyphs; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Lightning; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.armor.Armor; -import com.hmdzl.spspd.change.items.armor.Armor.Glyph; -import com.hmdzl.spspd.change.items.misc.FourClover; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.traps.LightningTrap; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.ItemSprite; -import com.hmdzl.spspd.change.sprites.ItemSprite.Glowing; -import com.hmdzl.spspd.change.utils.GLog; -import com.hmdzl.spspd.change.actors.buffs.armorbuff.GlyphDark; -import com.hmdzl.spspd.change.actors.buffs.armorbuff.GlyphEarth; -import com.hmdzl.spspd.change.actors.buffs.armorbuff.GlyphElectricity; -import com.hmdzl.spspd.change.actors.buffs.armorbuff.GlyphFire; -import com.hmdzl.spspd.change.actors.buffs.armorbuff.GlyphIce; -import com.hmdzl.spspd.change.actors.buffs.armorbuff.GlyphLight; -import com.watabou.noosa.Camera; -import com.watabou.utils.Random; - -import static com.hmdzl.spspd.change.Dungeon.hero; - -public class Revivalglyph extends Glyph { - - private static ItemSprite.Glowing RED = new ItemSprite.Glowing(0xCC0000); - - @Override - public int proc(Armor armor, Char attacker, Char defender, int damage) { - - GlyphDark gdark = defender.buff(GlyphDark.class); - GlyphIce gice = defender.buff(GlyphIce.class); - GlyphLight glight = defender.buff(GlyphLight.class); - GlyphFire gfire = defender.buff(GlyphFire.class); - GlyphEarth gearth = defender.buff(GlyphEarth.class); - GlyphElectricity gelect = defender.buff(GlyphElectricity.class); - FourClover.FourCloverBless fcb = defender.buff(FourClover.FourCloverBless.class); - - if (defender.isAlive() && (gdark != null || gice != null || glight != null || gfire != null || gearth != null || gelect != null )) - { - Buff.detach(defender,GlyphIce.class); - Buff.detach(defender,GlyphLight.class); - Buff.detach(defender,GlyphFire.class); - Buff.detach(defender,GlyphEarth.class); - Buff.detach(defender,GlyphElectricity.class); - Buff.detach(defender,GlyphDark.class); - } - - int level = Math.max(0, armor.level); - if (damage > defender.HP && (Math.min(level*1.5,45) > Random.Int(100) || (fcb != null && Math.min(level*1.5,45) > Random.Int(90)))){ - defender.HP = defender.HT; - CellEmitter.get(defender.pos).start(Speck.factory(Speck.LIGHT), 0.2f, 3); - GLog.w(Messages.get(this, "revive")); - return 0; - } - return damage; - } - - @Override - public Glowing glowing() { - return RED; - } -} diff --git a/java/com/hmdzl/spspd/change/items/armor/glyphs/Testglyph.java b/java/com/hmdzl/spspd/change/items/armor/glyphs/Testglyph.java deleted file mode 100644 index 2d78c3b3..00000000 --- a/java/com/hmdzl/spspd/change/items/armor/glyphs/Testglyph.java +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.armor.glyphs; - -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.Blob; -import com.hmdzl.spspd.change.actors.blobs.ConfusionGas; -import com.hmdzl.spspd.change.actors.blobs.DarkGas; -import com.hmdzl.spspd.change.actors.blobs.ParalyticGas; -import com.hmdzl.spspd.change.actors.blobs.StenchGas; -import com.hmdzl.spspd.change.actors.blobs.TarGas; -import com.hmdzl.spspd.change.actors.blobs.ToxicGas; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.GasesImmunity; -import com.hmdzl.spspd.change.items.armor.Armor; -import com.hmdzl.spspd.change.items.armor.Armor.Glyph; -import com.hmdzl.spspd.change.items.misc.FourClover; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ItemSprite; -import com.hmdzl.spspd.change.sprites.ItemSprite.Glowing; -import com.hmdzl.spspd.change.actors.buffs.armorbuff.GlyphDark; -import com.hmdzl.spspd.change.actors.buffs.armorbuff.GlyphEarth; -import com.hmdzl.spspd.change.actors.buffs.armorbuff.GlyphElectricity; -import com.hmdzl.spspd.change.actors.buffs.armorbuff.GlyphFire; -import com.hmdzl.spspd.change.actors.buffs.armorbuff.GlyphIce; -import com.hmdzl.spspd.change.actors.buffs.armorbuff.GlyphLight; -import com.watabou.utils.Random; - -public class Testglyph extends Glyph { - - private static ItemSprite.Glowing GREEN = new ItemSprite.Glowing(0x22CC44); - - @Override - public int proc(Armor armor, Char attacker, Char defender, int damage) { - - GlyphDark gdark = defender.buff(GlyphDark.class); - GlyphIce gice = defender.buff(GlyphIce.class); - GlyphLight glight = defender.buff(GlyphLight.class); - GlyphFire gfire = defender.buff(GlyphFire.class); - GlyphEarth gearth = defender.buff(GlyphEarth.class); - GlyphElectricity gelect = defender.buff(GlyphElectricity.class); - FourClover.FourCloverBless fcb = defender.buff(FourClover.FourCloverBless.class); - - if (defender.isAlive() && (gdark != null || gice != null || glight != null || gfire != null || gearth != null || gelect != null )) - { - Buff.detach(defender,GlyphIce.class); - Buff.detach(defender,GlyphLight.class); - Buff.detach(defender,GlyphFire.class); - Buff.detach(defender,GlyphEarth.class); - Buff.detach(defender,GlyphElectricity.class); - Buff.detach(defender,GlyphDark.class); - } - - int level = Math.max(0, armor.level); - - if (Random.Int(level + 5) >= 4 || (fcb != null && Random.Int(level + 5) >= 2)) { - Buff.prolong(defender, GasesImmunity.class, GasesImmunity.DURATION); - - switch (Random.Int (6)) { - case 0: - GameScene.add(Blob.seed(attacker.pos, 25, ToxicGas.class)); - break; - case 1: - GameScene.add(Blob.seed(attacker.pos, 25, ConfusionGas.class)); - break; - case 2: - GameScene.add(Blob.seed(attacker.pos, 25, ParalyticGas.class)); - break; - case 3: - GameScene.add(Blob.seed(attacker.pos, 25, DarkGas.class)); - break; - case 4: - GameScene.add(Blob.seed(attacker.pos, 25, TarGas.class)); - break; - case 5: - GameScene.add(Blob.seed(attacker.pos, 25, StenchGas.class)); - break; - default: - break; - } - } - return damage; - } - - @Override - public Glowing glowing() { - return GREEN; - } - -} diff --git a/java/com/hmdzl/spspd/change/items/armor/normalarmor/BaseArmor.java b/java/com/hmdzl/spspd/change/items/armor/normalarmor/BaseArmor.java deleted file mode 100644 index 67c7e160..00000000 --- a/java/com/hmdzl/spspd/change/items/armor/normalarmor/BaseArmor.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.armor.normalarmor; - -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Bleeding; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Ooze; -import com.hmdzl.spspd.change.actors.buffs.Terror; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.effects.particles.ShadowParticle; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.utils.Random; - -public class BaseArmor extends NormalArmor { - - { - //name = "base armor"; - image = ItemSpriteSheet.ERROR_ARMOR; - MAX = 0; - MIN = 0; - } - - public BaseArmor() { - super(0,1f,1f,4); - } - - @Override - public Item upgrade(boolean hasglyph) { - MIN --; - MAX-=3; - - return super.upgrade(hasglyph); - } - - /*@Override - public int proc(Char attacker, Char defender, int damage) { - - if (glyph != null) { - glyph.proc(this, attacker, defender, damage); - } ; - return damage; - };*/ -} diff --git a/java/com/hmdzl/spspd/change/items/armor/normalarmor/BulletArmor.java b/java/com/hmdzl/spspd/change/items/armor/normalarmor/BulletArmor.java deleted file mode 100644 index 6b6b2f4a..00000000 --- a/java/com/hmdzl/spspd/change/items/armor/normalarmor/BulletArmor.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.armor.normalarmor; - -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Bleeding; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Ooze; -import com.hmdzl.spspd.change.actors.buffs.Terror; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.effects.particles.ShadowParticle; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.utils.Random; - -public class BulletArmor extends NormalArmor { - - { - //name = "bulletproof armor"; - image = ItemSpriteSheet.BULLET_ARMOR; - STR += 1; - MAX = 46; - MIN = 10; - } - - public BulletArmor() { - super(5,0.2f,-1f,2); - } - - @Override - public Item upgrade(boolean hasglyph) { - MIN += 1; - MAX += 2; - return super.upgrade(hasglyph); - } -} diff --git a/java/com/hmdzl/spspd/change/items/armor/normalarmor/CDArmor.java b/java/com/hmdzl/spspd/change/items/armor/normalarmor/CDArmor.java deleted file mode 100644 index 65858c34..00000000 --- a/java/com/hmdzl/spspd/change/items/armor/normalarmor/CDArmor.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.armor.normalarmor; - -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Bleeding; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Ooze; -import com.hmdzl.spspd.change.actors.buffs.Terror; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.effects.particles.ShadowParticle; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.utils.Random; - -public class CDArmor extends NormalArmor { - - { - //name = "cd armor"; - image = ItemSpriteSheet.CD_ARMOR; - STR -= 1; - MAX = 15; - MIN = 0; - } - - public CDArmor() { - super(3,3.2f,8f,3); - } - - @Override - public Item upgrade(boolean hasglyph) { - MIN -= 1; - MAX -= 1; - return super.upgrade(hasglyph); - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/items/armor/normalarmor/CeramicsArmor.java b/java/com/hmdzl/spspd/change/items/armor/normalarmor/CeramicsArmor.java deleted file mode 100644 index 4f504549..00000000 --- a/java/com/hmdzl/spspd/change/items/armor/normalarmor/CeramicsArmor.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.armor.normalarmor; - -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Bleeding; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Ooze; -import com.hmdzl.spspd.change.actors.buffs.Terror; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.effects.particles.ShadowParticle; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.utils.Random; - -public class CeramicsArmor extends NormalArmor { - - { - //name = "ceramics armor"; - image = ItemSpriteSheet.CERAMICS_ARMOR; - STR += 1; - MAX = 18; - MIN = 4; - } - - public CeramicsArmor() { - super(2,0.8f,0.5f,3); - } - - @Override - public Item upgrade(boolean hasglyph) { - MIN += 1; - //MAX += 0; - return super.upgrade(hasglyph); - } -} diff --git a/java/com/hmdzl/spspd/change/items/armor/normalarmor/ClothArmor.java b/java/com/hmdzl/spspd/change/items/armor/normalarmor/ClothArmor.java deleted file mode 100644 index 7d99c0cb..00000000 --- a/java/com/hmdzl/spspd/change/items/armor/normalarmor/ClothArmor.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.armor.normalarmor; - -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Bleeding; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Ooze; -import com.hmdzl.spspd.change.actors.buffs.Terror; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.effects.particles.ShadowParticle; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.utils.Random; - -public class ClothArmor extends NormalArmor { - - { - //name = "cloth armor"; - image = ItemSpriteSheet.ARMOR_CLOTH; - } - - public ClothArmor() { - super(1,2f,6f,3); - } - /*@Override - public int proc(Char attacker, Char defender, int damage) { - - if (glyph != null) { - glyph.proc(this, attacker, defender, damage); - } ; - return damage; - };*/ -} diff --git a/java/com/hmdzl/spspd/change/items/armor/normalarmor/DiscArmor.java b/java/com/hmdzl/spspd/change/items/armor/normalarmor/DiscArmor.java deleted file mode 100644 index 6a30c686..00000000 --- a/java/com/hmdzl/spspd/change/items/armor/normalarmor/DiscArmor.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.armor.normalarmor; - -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.messages.Messages; - -public class DiscArmor extends NormalArmor { - - { - //name = "disc armor"; - image = ItemSpriteSheet.ARMOR_DISC; - } - - public DiscArmor() { - super(3,1.6f,4f,4); - } - -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/items/armor/normalarmor/ErrorArmor.java b/java/com/hmdzl/spspd/change/items/armor/normalarmor/ErrorArmor.java deleted file mode 100644 index 935a7953..00000000 --- a/java/com/hmdzl/spspd/change/items/armor/normalarmor/ErrorArmor.java +++ /dev/null @@ -1,118 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.armor.normalarmor; - -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.ArmorBreak; -import com.hmdzl.spspd.change.actors.buffs.AttackDown; -import com.hmdzl.spspd.change.actors.buffs.Bleeding; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Charm; -import com.hmdzl.spspd.change.actors.buffs.Cripple; -import com.hmdzl.spspd.change.actors.buffs.GrowSeed; -import com.hmdzl.spspd.change.actors.buffs.Ooze; -import com.hmdzl.spspd.change.actors.buffs.Paralysis; -import com.hmdzl.spspd.change.actors.buffs.Roots; -import com.hmdzl.spspd.change.actors.buffs.Shocked; -import com.hmdzl.spspd.change.actors.buffs.Terror; -import com.hmdzl.spspd.change.actors.buffs.Vertigo; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.effects.Pushing; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.effects.particles.ShadowParticle; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.utils.Random; - -public class ErrorArmor extends NormalArmor { - - { - //name = "error armor"; - image = ItemSpriteSheet.ERROR_ARMOR; - STR = 0; - MAX = 0; - MIN = 0; - } - - public ErrorArmor() { - super(0,1f,1f,10); - } - - @Override - public Item upgrade(boolean hasglyph) { - MIN --; - MAX-=3; - - return super.upgrade(hasglyph); - } - - - @Override - public void proc(Char attacker, Char defender, int damage) { - - switch (Random.Int (10)) { - case 0 : - if (attacker.properties().contains(Char.Property.BOSS) || attacker.properties().contains(Char.Property.MINIBOSS)){ - attacker.damage(Random.Int(attacker.HT/8, attacker.HT/4), this);} - else attacker.damage(Random.Int(attacker.HT, attacker.HT * 2), this); - attacker.sprite.emitter().burst(ShadowParticle.UP, 5); - if (!defender.isAlive() && attacker instanceof Hero) { - Badges.validateGrimWeapon(); - } - break; - case 1 : - Buff.affect(attacker, Bleeding.class).set(5); - break; - case 2 : - Buff.affect(attacker, Ooze.class); - break; - case 3 : - Buff.affect(attacker, Terror.class, Terror.DURATION).object = defender.id(); - break; - case 4 : - if (defender.HP < defender.HT){ - defender.HP += (int)((defender.HT)/10); - defender.sprite.emitter().start(Speck.factory(Speck.HEALING), 0.4f,1);} - break; - case 5 : - Buff.prolong(attacker, AttackDown.class, 5f).level(35); - break; - case 6 : - Buff.prolong(attacker, ArmorBreak.class, 5f).level(35); - break; - case 7 : - Buff.affect(attacker, GrowSeed.class).reignite(attacker); - break; - case 8 : - Buff.affect(attacker, Shocked.class); - break; - default: - break; - } - - if (glyph != null) { - glyph.proc(this, attacker, defender, damage); - } ; - }; -} diff --git a/java/com/hmdzl/spspd/change/items/armor/normalarmor/LeatherArmor.java b/java/com/hmdzl/spspd/change/items/armor/normalarmor/LeatherArmor.java deleted file mode 100644 index fb81d688..00000000 --- a/java/com/hmdzl/spspd/change/items/armor/normalarmor/LeatherArmor.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.armor.normalarmor; - -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.messages.Messages; - -public class LeatherArmor extends NormalArmor { - - { - //name = "leather armor"; - image = ItemSpriteSheet.ARMOR_LEATHER; - } - - public LeatherArmor() { - super(2,1.8f,5f,3); - } -} diff --git a/java/com/hmdzl/spspd/change/items/armor/normalarmor/MachineArmor.java b/java/com/hmdzl/spspd/change/items/armor/normalarmor/MachineArmor.java deleted file mode 100644 index 262a6b88..00000000 --- a/java/com/hmdzl/spspd/change/items/armor/normalarmor/MachineArmor.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.armor.normalarmor; - -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Bleeding; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Ooze; -import com.hmdzl.spspd.change.actors.buffs.Terror; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.effects.particles.ShadowParticle; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.utils.Random; - -public class MachineArmor extends NormalArmor { - - { - //name = "machine armor"; - image = ItemSpriteSheet.MECH_ARMOR; - STR += 1; - MAX = 60; - MIN = 15; - } - - public MachineArmor() { - super(6,0,-2,1); - } - - @Override - public Item upgrade(boolean hasglyph) { - MIN += 2; - MAX += 2; - return super.upgrade(hasglyph); - } -} diff --git a/java/com/hmdzl/spspd/change/items/armor/normalarmor/MailArmor.java b/java/com/hmdzl/spspd/change/items/armor/normalarmor/MailArmor.java deleted file mode 100644 index cdedc326..00000000 --- a/java/com/hmdzl/spspd/change/items/armor/normalarmor/MailArmor.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.armor.normalarmor; - -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.messages.Messages; - -public class MailArmor extends NormalArmor { - - { - //name = "mail armor"; - image = ItemSpriteSheet.ARMOR_MAIL; - } - - public MailArmor() { - super(4,1.4f,3f,4); - } - -} diff --git a/java/com/hmdzl/spspd/change/items/armor/normalarmor/MultiplelayerArmor.java b/java/com/hmdzl/spspd/change/items/armor/normalarmor/MultiplelayerArmor.java deleted file mode 100644 index a9a4c6d2..00000000 --- a/java/com/hmdzl/spspd/change/items/armor/normalarmor/MultiplelayerArmor.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.armor.normalarmor; - -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Bleeding; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Ooze; -import com.hmdzl.spspd.change.actors.buffs.Terror; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.effects.particles.ShadowParticle; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.utils.Random; - -public class MultiplelayerArmor extends NormalArmor { - - { - //name = "Multiplelayer Armor"; - image = ItemSpriteSheet.MUL_ARMOR; - STR += 1; - MAX = 36; - MIN = 8; - } - - public MultiplelayerArmor() { - super(4,0.4f,-0.5f,3); - } - - @Override - public Item upgrade(boolean hasglyph) { - MIN += 1; - MAX += 1; - return super.upgrade(hasglyph); - } -} diff --git a/java/com/hmdzl/spspd/change/items/armor/normalarmor/NormalArmor.java b/java/com/hmdzl/spspd/change/items/armor/normalarmor/NormalArmor.java deleted file mode 100644 index 1f85cd54..00000000 --- a/java/com/hmdzl/spspd/change/items/armor/normalarmor/NormalArmor.java +++ /dev/null @@ -1,171 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.armor.normalarmor; - -import java.text.DecimalFormat; -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.ResultDescriptions; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.hero.HeroClass; -import com.hmdzl.spspd.change.items.KindOfArmor; -import com.hmdzl.spspd.change.items.armor.Armor; -import com.hmdzl.spspd.change.items.armor.glyphs.Changeglyph; -import com.hmdzl.spspd.change.items.armor.glyphs.Crystalglyph; -import com.hmdzl.spspd.change.items.armor.glyphs.Darkglyph; -import com.hmdzl.spspd.change.items.armor.glyphs.Earthglyph; -import com.hmdzl.spspd.change.items.armor.glyphs.Electricityglyph; -import com.hmdzl.spspd.change.items.armor.glyphs.Fireglyph; -import com.hmdzl.spspd.change.items.armor.glyphs.Iceglyph; -import com.hmdzl.spspd.change.items.armor.glyphs.Lightglyph; -import com.hmdzl.spspd.change.items.armor.glyphs.Revivalglyph; -import com.hmdzl.spspd.change.items.armor.glyphs.Testglyph; -import com.hmdzl.spspd.change.items.rings.Ring; -import com.hmdzl.spspd.change.items.rings.RingOfEvasion; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.items.EquipableItem; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.sprites.HeroSprite; -import com.hmdzl.spspd.change.sprites.ItemSprite; -import com.hmdzl.spspd.change.utils.GLog; -import com.hmdzl.spspd.change.messages.Messages; - -import com.watabou.utils.Bundlable; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - - - public class NormalArmor extends Armor { - - private int tier; - public NormalArmor(int tier, float dex, float ste, int eng) { - super(); - - this.tier = tier; - - DEX = dex; - STE = ste; - ENG = eng; - - STR = typicalSTR(); - - MIN = min(); - MAX = max(); - } - - private int min() { - return 0; - } - - private int max() { - return (int) ( 8*tier - 4 ); - } - - - - @Override - public Item upgrade() { - return upgrade(false); - } - - @Override - public Item upgrade(boolean hasglyph) { - MIN +=1; - MAX +=3; - return super.upgrade(hasglyph); - } - - public Item safeUpgrade() { - return upgrade(glyph != null); - } - - - @Override - public Item degrade() { - return super.degrade(); - } - - public int typicalSTR() { - return 8 + tier * 2; - } - - @Override - public String info() { - String name = name(); - - String info = desc(); - - if (levelKnown) { - info += "\n\n" + Messages.get(NormalArmor.class, "stats_known", tier, MIN, MAX, STR); - info += "\n\n" + Messages.get(NormalArmor.class, "stats_known2",new DecimalFormat("#.##").format(DEX), new DecimalFormat("#.##").format(STE), ENG); - } else { - info += "\n\n" + Messages.get(NormalArmor.class, "stats_unknown", tier, min(), max(), typicalSTR()); - } - - String stats_desc = Messages.get(this, "stats_desc"); - if (!stats_desc.equals("")) info+= "\n\n" + stats_desc; - - if (glyph != null) { - info += "\n\n" + Messages.get(NormalArmor.class, "inscribed",glyph.desc()); - } - - if (reinforced) { - info += "\n\n" + Messages.get(Item.class, "reinforced"); - } - - if (levelKnown && STR() > Dungeon.hero.STR()) { - info += "\n\n" + Messages.get(NormalArmor.class, "too_heavy"); - } - - if (cursed && isEquipped( Dungeon.hero )) { - info += "\n\n" + Messages.get(NormalArmor.class, "cursed_worn"); - } else if (cursedKnown && cursed) { - info += "\n\n" + Messages.get(NormalArmor.class, "cursed"); - } - - return info; - } - - @Override - public int price() { - int price = 100; - if (glyph != null) { - price *= 1.5; - } - if (cursed && cursedKnown) { - price /= 2; - } - if (levelKnown) { - if (level > 0) { - price *= (level + 1); - } else if (level < 0) { - price /= (1 - level); - } - } - if (price < 1) { - price = 1; - } - return price; - - } - - } \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/items/armor/normalarmor/PhantomArmor.java b/java/com/hmdzl/spspd/change/items/armor/normalarmor/PhantomArmor.java deleted file mode 100644 index 33861ec3..00000000 --- a/java/com/hmdzl/spspd/change/items/armor/normalarmor/PhantomArmor.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.armor.normalarmor; - -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Bleeding; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Ooze; -import com.hmdzl.spspd.change.actors.buffs.Terror; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.effects.particles.ShadowParticle; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.utils.Random; - -public class PhantomArmor extends NormalArmor { - - { - //name = "phantom armor"; - image = ItemSpriteSheet.PHANTOM_ARMOR; - STR -= 1; - MAX = 35; - MIN = 0; - } - - public PhantomArmor() { - super(6,2f,2f,2); - } - - @Override - public Item upgrade(boolean hasglyph) { - MIN -= 1; - return super.upgrade(hasglyph); - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/items/armor/normalarmor/PlateArmor.java b/java/com/hmdzl/spspd/change/items/armor/normalarmor/PlateArmor.java deleted file mode 100644 index 7e3b3d82..00000000 --- a/java/com/hmdzl/spspd/change/items/armor/normalarmor/PlateArmor.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.armor.normalarmor; - -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.messages.Messages; - -public class PlateArmor extends NormalArmor { - - { - //name = "plate armor"; - image = ItemSpriteSheet.ARMOR_PLATE; - } - - public PlateArmor() { - super(6,1.2f,1f,3); - } - -} diff --git a/java/com/hmdzl/spspd/change/items/armor/normalarmor/ProtectiveclothingArmor.java b/java/com/hmdzl/spspd/change/items/armor/normalarmor/ProtectiveclothingArmor.java deleted file mode 100644 index ea12f6a8..00000000 --- a/java/com/hmdzl/spspd/change/items/armor/normalarmor/ProtectiveclothingArmor.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.armor.normalarmor; - -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Bleeding; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Ooze; -import com.hmdzl.spspd.change.actors.buffs.Terror; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.effects.particles.ShadowParticle; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.utils.Random; - -public class ProtectiveclothingArmor extends NormalArmor { - - { - //name = "protectiveclothing armor"; - image = ItemSpriteSheet.PRO_ARMOR; - STR -= 1; - MAX = 30; - MIN = 0; - } - - public ProtectiveclothingArmor() { - super(5,2.4f,4f,3); - } - - @Override - public Item upgrade(boolean hasglyph) { - MIN -= 1; - return super.upgrade(hasglyph); - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/items/armor/normalarmor/RubberArmor.java b/java/com/hmdzl/spspd/change/items/armor/normalarmor/RubberArmor.java deleted file mode 100644 index 655ff258..00000000 --- a/java/com/hmdzl/spspd/change/items/armor/normalarmor/RubberArmor.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.armor.normalarmor; - -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Bleeding; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Ooze; -import com.hmdzl.spspd.change.actors.buffs.Terror; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.effects.particles.ShadowParticle; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.utils.Random; - -public class RubberArmor extends NormalArmor { - - { - //name = "rubber armor"; - image = ItemSpriteSheet.RUBBER_ARMOR; - STR -= 1; - MAX = 8; - MIN = 0; - } - - public RubberArmor() { - super(2,3.6f,10f,2); - } - - @Override - public Item upgrade(boolean hasglyph) { - MIN -= 1; - MAX -= 2; - return super.upgrade(hasglyph); - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/items/armor/normalarmor/ScaleArmor.java b/java/com/hmdzl/spspd/change/items/armor/normalarmor/ScaleArmor.java deleted file mode 100644 index db6463eb..00000000 --- a/java/com/hmdzl/spspd/change/items/armor/normalarmor/ScaleArmor.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.armor.normalarmor; - -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.messages.Messages; - -public class ScaleArmor extends NormalArmor { - - { - //name = "scale armor"; - image = ItemSpriteSheet.ARMOR_SCALE; - } - - public ScaleArmor() { - super(5,1f,2f,3); - } -} diff --git a/java/com/hmdzl/spspd/change/items/armor/normalarmor/StoneArmor.java b/java/com/hmdzl/spspd/change/items/armor/normalarmor/StoneArmor.java deleted file mode 100644 index 805eda83..00000000 --- a/java/com/hmdzl/spspd/change/items/armor/normalarmor/StoneArmor.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.armor.normalarmor; - -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Bleeding; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Ooze; -import com.hmdzl.spspd.change.actors.buffs.Terror; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.effects.particles.ShadowParticle; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.armor.Armor; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.utils.Random; - -public class StoneArmor extends NormalArmor { - - { - //name = "Stone Armor"; - image = ItemSpriteSheet.STONE_ARMOR; - STR += 1; - MAX = 26; - MIN = 6; - } - - public StoneArmor() { - super(3,0.6f,0,4); - } - - @Override - public Item upgrade(boolean hasglyph) { - MIN += 1; - MAX += 1; - return super.upgrade(hasglyph); - } -} diff --git a/java/com/hmdzl/spspd/change/items/armor/normalarmor/StyrofoamArmor.java b/java/com/hmdzl/spspd/change/items/armor/normalarmor/StyrofoamArmor.java deleted file mode 100644 index fb89b372..00000000 --- a/java/com/hmdzl/spspd/change/items/armor/normalarmor/StyrofoamArmor.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.armor.normalarmor; - -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Bleeding; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Ooze; -import com.hmdzl.spspd.change.actors.buffs.Terror; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.effects.particles.ShadowParticle; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.armor.Armor; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.utils.Random; - -public class StyrofoamArmor extends NormalArmor { - - { - //name = "styrofoam armor"; - image = ItemSpriteSheet.STY_ARMOR; - STR -= 1; - MAX = 22; - MIN = 0; - } - - public StyrofoamArmor() { - super(4,2.8f,6f,4); - } - - @Override - public Item upgrade(boolean hasglyph) { - MIN -= 1; - MAX -= 1; - return super.upgrade(hasglyph); - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/items/armor/normalarmor/VestArmor.java b/java/com/hmdzl/spspd/change/items/armor/normalarmor/VestArmor.java deleted file mode 100644 index d4b4c328..00000000 --- a/java/com/hmdzl/spspd/change/items/armor/normalarmor/VestArmor.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.armor.normalarmor; - -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Bleeding; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Ooze; -import com.hmdzl.spspd.change.actors.buffs.Terror; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.effects.particles.ShadowParticle; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.armor.Armor; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.utils.Random; - -public class VestArmor extends NormalArmor { - - { - //name = "vest armor"; - image = ItemSpriteSheet.VEST_ARMOR; - STR -= 1; - MAX = 2; - MIN = 0; - } - - public VestArmor() { - super(1,4f,12f,1); - } - - @Override - public Item upgrade(boolean hasglyph) { - MIN -= 1; - MAX -= 2; - return super.upgrade(hasglyph); - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/items/armor/normalarmor/WoodenArmor.java b/java/com/hmdzl/spspd/change/items/armor/normalarmor/WoodenArmor.java deleted file mode 100644 index f08ba2a2..00000000 --- a/java/com/hmdzl/spspd/change/items/armor/normalarmor/WoodenArmor.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.armor.normalarmor; - -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Bleeding; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Ooze; -import com.hmdzl.spspd.change.actors.buffs.Terror; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.effects.particles.ShadowParticle; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.armor.Armor; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.utils.Random; - -public class WoodenArmor extends NormalArmor { - - { - //name = "wooden armor"; - image = ItemSpriteSheet.WOODEN_ARMOR; - STR += 1; - MAX = 6; - MIN = 2; - } - - public WoodenArmor() { - super(1,1f,1f,2); - } - - @Override - public Item upgrade(boolean hasglyph) { - MIN += 1; - //MAX += 0; - return super.upgrade(hasglyph); - } -} diff --git a/java/com/hmdzl/spspd/change/items/artifacts/AlchemistsToolkit.java b/java/com/hmdzl/spspd/change/items/artifacts/AlchemistsToolkit.java deleted file mode 100644 index 51bdd5cf..00000000 --- a/java/com/hmdzl/spspd/change/items/artifacts/AlchemistsToolkit.java +++ /dev/null @@ -1,287 +0,0 @@ -package com.hmdzl.spspd.change.items.artifacts; - -import java.util.ArrayList; -import java.util.Collections; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.particles.ElmoParticle; -import com.hmdzl.spspd.change.items.Generator; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.potions.Potion; -import com.hmdzl.spspd.change.items.potions.PotionOfExperience; -import com.hmdzl.spspd.change.items.potions.PotionOfMight; -import com.hmdzl.spspd.change.items.potions.PotionOfOverHealing; -import com.hmdzl.spspd.change.items.potions.PotionOfStrength; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.hmdzl.spspd.change.windows.WndBag; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -/** - * Created by debenhame on 24/11/2014. - */ -public class AlchemistsToolkit extends Artifact { - - { - //name = "Alchemists Toolkit"; - image = ItemSpriteSheet.ARTIFACT_TOOLKIT; - - level = 0; - levelCap = 10; - defaultAction = AC_BREW; - } - - public static final String AC_BREW = "BREW"; - public static final String AC_CREATE = "CREATE"; - - // arrays used in containing potion collections for mix logic. - public final ArrayList combination = new ArrayList<>(); - public ArrayList curGuess = new ArrayList<>(); - public ArrayList bstGuess = new ArrayList<>(); - - public int numWrongPlace = 0; - public int numRight = 0; - - private int seedsToPotion = 0; - - //protected String inventoryTitle = "Select a potion"; - protected WndBag.Mode mode = WndBag.Mode.POTION; - - public AlchemistsToolkit() { - super(); - - Generator.Category cat = Generator.Category.POTION; - for (int i = 1; i <= 3; i++) { - Class potion; - do { - potion = cat.classes[Random.chances(cat.probs)]; - // forcing the player to use experience potions would be - // completely unfair. - } while (combination.contains(potion) - || potion == PotionOfExperience.class || potion == PotionOfOverHealing.class - || potion == PotionOfStrength.class || potion == PotionOfMight.class - ); - combination.add(potion); - } - } - - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions(hero); - if (isEquipped(hero) && level < levelCap && !cursed) - actions.add(AC_BREW); - if (level > 0 && !isEquipped(hero) ) - actions.add(AC_CREATE); - return actions; - } - - @Override - public void execute(Hero hero, String action) { - if (action.equals(AC_BREW)) { - GameScene.selectItem(itemSelector, mode, Messages.get(this, "prompt")); - } else if (action.equals(AC_CREATE)) { - curUser = hero; - Sample.INSTANCE.play(Assets.SND_BURNING); - curUser.sprite.emitter().burst(ElmoParticle.FACTORY, 12); - curUser.spendAndNext(1f); - for(int i=0; i level) { - - level = score; - seedsToPotion = 0; - bstGuess = curGuess; - this.numRight = numRight; - this.numWrongPlace = numWrongPlace; - - if (level == 10) { - bstGuess = new ArrayList<>(); - GLog.p(Messages.get(this,"prefect")); - } else { - GLog.w(brewDesc(numWrongPlace, numRight) - + Messages.get(this, "bestbrew")); - } - - } else { - - GLog.w(brewDesc(numWrongPlace, numRight) - + Messages.get(this, "waste")); - } - curGuess = new ArrayList<>(); - - } - - private String brewDesc(int numWrongPlace, int numRight) { - String result = ""; - if (numWrongPlace > 0) { - result += numWrongPlace + Messages.get(this, "bdorder"); - } if (numRight > 0) { - result += numRight + Messages.get(this, "right"); - } - return result; - } - - @Override - protected ArtifactBuff passiveBuff() { - return new alchemy(); - } - - @Override - public String desc() { - String result = Messages.get(this, "desc"); - if (isEquipped(Dungeon.hero)) - if (cursed) - result += "\n\n" + Messages.get(this, "desc_cursed"); - if (level == 0) { - result += "\n\n" + Messages.get(this, "level_zero"); - } else if (level == 10) { - result += "\n\n" + Messages.get(this, "level_ten"); - } else if (!bstGuess.isEmpty()) { - result += "\n\n" + Messages.get(this, "make_from") - + Messages.get(bstGuess.get(0), "name") + ", " + Messages.get(bstGuess.get(1), "name") + ", " - + Messages.get(bstGuess.get(2), "name") + ", " - + brewDesc(numWrongPlace, numRight); - - // would only trigger if an upgraded toolkit was gained through - // transmutation or bones. - } else { - result += Messages.get(this, "need_fix");; - } - return result; - } - - private static final String COMBINATION = "combination"; - private static final String CURGUESS = "curguess"; - private static final String BSTGUESS = "bstguess"; - - private static final String NUMWRONGPLACE = "numwrongplace"; - private static final String NUMRIGHT = "numright"; - - private static final String SEEDSTOPOTION = "seedstopotion"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(NUMWRONGPLACE, numWrongPlace); - bundle.put(NUMRIGHT, numRight); - - bundle.put(SEEDSTOPOTION, seedsToPotion); - - bundle.put(COMBINATION, - combination.toArray(new Class[combination.size()])); - bundle.put(CURGUESS, curGuess.toArray(new Class[curGuess.size()])); - bundle.put(BSTGUESS, bstGuess.toArray(new Class[bstGuess.size()])); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - numWrongPlace = bundle.getInt(NUMWRONGPLACE); - numRight = bundle.getInt(NUMRIGHT); - - seedsToPotion = bundle.getInt(SEEDSTOPOTION); - - combination.clear(); - Collections.addAll(combination, bundle.getClassArray(COMBINATION)); - Collections.addAll(curGuess, bundle.getClassArray(CURGUESS)); - Collections.addAll(bstGuess, bundle.getClassArray(BSTGUESS)); - } - - public class alchemy extends ArtifactBuff { - - public boolean tryCook(int count) { - - // this logic is handled inside the class with a variable so that it - // may be stored. - // to prevent manipulation where a player could keep throwing in 1-2 - // seeds until they get lucky. - if (seedsToPotion == 0) { - if (Random.Int(20) < 10 + level) { - if (Random.Int(20) < level) { - seedsToPotion = 1; - } else - seedsToPotion = 2; - } else - seedsToPotion = 3; - } - - if (count >= seedsToPotion) { - seedsToPotion = 0; - return true; - } else - return false; - - } - - } - - protected WndBag.Listener itemSelector = new WndBag.Listener() { - @Override - public void onSelect(Item item) { - if (item != null && item instanceof Potion && item.isIdentified()) { - if (!curGuess.contains(item.getClass())) { - - Hero hero = Dungeon.hero; - hero.sprite.operate(hero.pos); - hero.busy(); - hero.spend(1f); - Sample.INSTANCE.play(Assets.SND_DRINK); - - //item.detach(hero.belongings.backpack); - - curGuess.add(item.getClass()); - if (curGuess.size() == 3) { - guessBrew(); - } else { - GLog.i(Messages.get(AlchemistsToolkit.class, "addpotion")); - } - } else { - GLog.w(Messages.get(AlchemistsToolkit.class, "have_add")); - } - } else if (item != null) { - GLog.w(Messages.get(AlchemistsToolkit.class, "know_first")); - } - } - }; - -} - diff --git a/java/com/hmdzl/spspd/change/items/artifacts/AlienBag.java b/java/com/hmdzl/spspd/change/items/artifacts/AlienBag.java deleted file mode 100644 index 67d667d7..00000000 --- a/java/com/hmdzl/spspd/change/items/artifacts/AlienBag.java +++ /dev/null @@ -1,181 +0,0 @@ -package com.hmdzl.spspd.change.items.artifacts; - -import java.io.IOException; -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.buffs.AttackUp; -import com.hmdzl.spspd.change.actors.buffs.BerryRegeneration; -import com.hmdzl.spspd.change.actors.buffs.Bless; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.DefenceUp; -import com.hmdzl.spspd.change.actors.buffs.Dewcharge; -import com.hmdzl.spspd.change.actors.buffs.Invisibility; -import com.hmdzl.spspd.change.actors.buffs.Levitation; -import com.hmdzl.spspd.change.actors.buffs.MindVision; -import com.hmdzl.spspd.change.actors.buffs.ShieldArmor; -import com.hmdzl.spspd.change.actors.buffs.Strength; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.particles.ElmoParticle; -import com.hmdzl.spspd.change.items.Generator; -import com.hmdzl.spspd.change.items.armor.normalarmor.ErrorArmor; -import com.hmdzl.spspd.change.items.wands.WandOfError; -import com.hmdzl.spspd.change.items.weapon.melee.special.ErrorW; -import com.hmdzl.spspd.change.items.weapon.missiles.ErrorAmmo; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.LoadSaveScene; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.Game; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -/** - * Created by dachhack on 10/15/2015. - */ -public class AlienBag extends Artifact { - - { - //name = "AlienBag"; - image = ItemSpriteSheet.ALIEN_BAG; - - level = 0; - exp = 0; - levelCap = 10; - - charge = 0; - partialCharge = 0; - chargeCap = 100; - - - defaultAction = AC_SHIELD; - } - - public static final String AC_SHIELD = "SHIELD"; - public static final String AC_BOMB = "BOMB"; - public static final String AC_FLY = "FLY"; - public static final String AC_ETC = "ETC"; - - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions(hero); - if (isEquipped(hero) && charge == 100 && !cursed) { - actions.add(AC_SHIELD); - actions.add(AC_FLY); - } - if (level > 1) actions.add(AC_BOMB); - //if (level > 2 && !isEquipped(hero) ) - //actions.add(AC_ETC); - return actions; - } - - @Override - public void execute(Hero hero, String action) { - super.execute(hero, action); - if (action.equals(AC_SHIELD)) { - - if (!isEquipped(hero)) - GLog.i(Messages.get(Artifact.class, "need_to_equip") ); - else if (charge != chargeCap) - GLog.i(Messages.get(this, "no_charge")); - else { - charge = 0; - Buff.affect(hero,ShieldArmor.class).level(level * 20); - hero.spend(1f); - updateQuickslot(); - } - - } else if (action.equals(AC_BOMB)) { - level--; - for(int i=0; i<2; i++) { - Dungeon.level.drop(Generator.random(Generator.Category.BOMBS), hero.pos).sprite.drop(); - } - hero.spend(1f); - updateQuickslot(); - - } else if (action.equals(AC_FLY)) { - charge = 0; - Buff.affect(hero, Invisibility.class, level * 5f); - Buff.affect(hero, Levitation.class, level * 5f); - Buff.affect(hero, DefenceUp.class, level * 5f).level(level * 5); - hero.spend(1f); - updateQuickslot(); - } else if (action.equals(AC_ETC)) { - hero.spend(1f); - } - } - - public int level(){ - return level; - } - - - @Override - protected ArtifactBuff passiveBuff() { - return new bagRecharge(); - } - - @Override - public String desc() { - String desc = super.desc(); - if (isEquipped(Dungeon.hero)) { - if (charge == 100) - desc += "\n\n" + Messages.get(this,"full_charge"); - } - return desc; - } - - public class bagRecharge extends ArtifactBuff { - @Override - public boolean act() { - if (charge < chargeCap) { - partialCharge += 1f + level * 1f; - if (partialCharge >= 10) { - charge++; - partialCharge = 0; - if (charge == chargeCap) { - partialCharge = 0; - } - - } - } else - partialCharge = 0; - - - updateQuickslot(); - - spend(TICK); - - return true; - } - public void gainExp( float levelPortion ) { - if (cursed) return; - exp += Math.round(levelPortion*100); - if (exp > 100+level()*50 && level() < levelCap){ - exp -= 100+level()*50; - GLog.p( Messages.get(this, "levelup") ); - upgrade(); - } - - } - } - - private static final String PARTIALCHARGE = "partialCharge"; - private static final String CHARGE = "charge"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(PARTIALCHARGE, partialCharge); - bundle.put(CHARGE, charge); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - partialCharge = bundle.getInt(PARTIALCHARGE); - charge = bundle.getInt(CHARGE); - } -} diff --git a/java/com/hmdzl/spspd/change/items/artifacts/Artifact.java b/java/com/hmdzl/spspd/change/items/artifacts/Artifact.java deleted file mode 100644 index abd73ff5..00000000 --- a/java/com/hmdzl/spspd/change/items/artifacts/Artifact.java +++ /dev/null @@ -1,306 +0,0 @@ -package com.hmdzl.spspd.change.items.artifacts; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.KindofMisc; -import com.hmdzl.spspd.change.utils.GLog; -import com.hmdzl.spspd.change.messages.Messages; - -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -/** - * Created by Evan on 24/08/2014. - */ -public class Artifact extends KindofMisc { - - private static final float TIME_TO_EQUIP = 1f; - - private static final String TXT_TO_STRING = "%s"; - private static final String TXT_TO_STRING_CHARGE = "%s (%d/%d)"; - private static final String TXT_TO_STRING_LVL = "%s%+d"; - private static final String TXT_TO_STRING_LVL_CHARGE = "%s%+d (%d/%d)"; - - protected Buff passiveBuff; - protected Buff activeBuff; - - // level is used internally to track upgrades to artifacts, size/logic - // varies per artifact. - // already inherited from item superclass - // exp is used to count progress towards levels for some artifacts - protected int exp = 0; - // levelCap is the artifact's maximum level - protected int levelCap = 0; - - // the current artifact charge - protected int charge = 0; - // the build towards next charge, usually rolls over at 1. - // better to keep charge as an int and use a separate float than casting. - protected float partialCharge = 0; - // the maximum charge, varies per artifact, not all artifacts use this. - protected int chargeCap = 0; - - // used by some artifacts to keep track of duration of effects or cooldowns - // to use. - protected int cooldown = 0; - - public Artifact() { - super(); - } - - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions(hero); - actions.add(isEquipped(hero) ? AC_UNEQUIP : AC_EQUIP); - return actions; - } - - @Override - public boolean doEquip(Hero hero) { - - if (hero.belongings.misc1 != null && hero.belongings.misc2 != null && hero.belongings.misc3 != null) { - - GLog.w(Messages.get(Artifact.class, "onlythree")); - return false; - - } else if ((hero.belongings.misc1 != null && hero.belongings.misc1.getClass() == this.getClass()) - || (hero.belongings.misc2 != null && hero.belongings.misc2.getClass() == this.getClass()) - || (hero.belongings.misc3 != null && hero.belongings.misc3.getClass() == this.getClass())) { - - GLog.w( Messages.get(Artifact.class, "cannot_wear_two")); - return false; - - } else { - - if (hero.belongings.misc1 == null) { - hero.belongings.misc1 = this; - } else if (hero.belongings.misc2 == null){ - hero.belongings.misc2 = this; - } else { - hero.belongings.misc3 = this; - } - - detach(hero.belongings.backpack); - - activate(hero); - - cursedKnown = true; - identify(); - if (cursed) { - equipCursed(hero); - GLog.n(Messages.get(Artifact.class, "cursed_worn") ); - } - - hero.spendAndNext(TIME_TO_EQUIP); - return true; - - } - - } - - @Override - public void activate(Char ch) { - passiveBuff = passiveBuff(); - passiveBuff.attachTo(ch); - } - - @Override - public boolean doUnequip(Hero hero, boolean collect, boolean single) { - if (super.doUnequip(hero, collect, single)) { - - if (hero.belongings.misc1 == this) { - hero.belongings.misc1 = null; - } else if (hero.belongings.misc2 == this) { - hero.belongings.misc2 = null; - } else { - hero.belongings.misc3 = null; - } - - passiveBuff.detach(); - passiveBuff = null; - - if (activeBuff != null) { - activeBuff.detach(); - activeBuff = null; - } - - return true; - - } else { - - return false; - - } - } - - @Override - public boolean isEquipped(Hero hero) { - return hero.belongings.misc1 == this || hero.belongings.misc2 == this || hero.belongings.misc3 == this; - } - - @Override - public boolean isUpgradable() { - return false; - } - - @Override - public int visiblyUpgraded() { - return ((level * 10) / levelCap); - } - - // transfers upgrades from another artifact, transfer level will equal the - // displayed level - public void transferUpgrade(int transferLvl) { - upgrade(Math.round((float) (transferLvl * levelCap) / 10)); - if (level > levelCap) { - level = levelCap; - } - updateArtifact(); - } - - @Override - public String info() { - if (cursed && cursedKnown && !isEquipped(Dungeon.hero)) { - - return desc() + "\n\n" + Messages.get(Artifact.class, "curse_known"); - - } else { - - return desc(); - - } - } - - @Override - public String toString() { - - if (levelKnown && level / levelCap != 0) { - if (chargeCap > 0) { - return Messages.format(TXT_TO_STRING_LVL_CHARGE, name(), - visiblyUpgraded(), charge, chargeCap); - } else { - return Messages.format(TXT_TO_STRING_LVL, name(), - visiblyUpgraded()); - } - } else { - if (chargeCap > 0) { - return Messages.format(TXT_TO_STRING_CHARGE, name(), charge, - chargeCap); - } else { - return Messages.format(TXT_TO_STRING, name()); - } - } - } - - @Override - public String status() { - - // display the current cooldown - if (cooldown != 0) - return Messages.format("%d", cooldown); - - // display as percent - if (chargeCap == 100) - return Messages.format("%d%%", charge); - - // display as #/# - if (chargeCap > 0) - return Messages.format("%d/%d", charge, chargeCap); - - // if there's no cap - - // - but there is charge anyway, display that charge - if (charge != 0) - return Messages.format("%d", charge); - - // otherwise, if there's no charge, return null. - return null; - } - - // converts class names to be more concise and readable. - protected String convertName(String className) { - // removes known redundant parts of names. - className = className.replaceFirst("ScrollOf|PotionOf", ""); - - // inserts a space infront of every uppercase character - className = className.replaceAll("(\\p{Ll})(\\p{Lu})", "$1 $2"); - - return className; - }; - - @Override - public Item random() { - if (Random.Float() < 0.3f) { - cursed = true; - } - return this; - } - - @Override - public int price() { - int price = 100; - if (level > 0) - price += 50 * ((level * 10) / levelCap); - if (cursed && cursedKnown) { - price /= 2; - } - if (price < 1) { - price = 1; - } - return price; - } - - protected ArtifactBuff passiveBuff() { - return null; - } - - protected ArtifactBuff activeBuff() { - return null; - } - - public class ArtifactBuff extends Buff { - - public int level() { - return level; - } - - public boolean isCursed() { - return cursed; - } - - } - - private static final String IMAGE = "image"; - private static final String EXP = "exp"; - private static final String CHARGE = "charge"; - private static final String PARTIALCHARGE = "partialcharge"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(IMAGE, image); - bundle.put(EXP, exp); - bundle.put(CHARGE, charge); - bundle.put(PARTIALCHARGE, partialCharge); - - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - image = bundle.getInt(IMAGE); - exp = bundle.getInt(EXP); - charge = bundle.getInt(CHARGE); - partialCharge = bundle.getFloat(PARTIALCHARGE); - updateArtifact(); - } - - public void updateArtifact() { - // in case any artifacts have special computations between levels - // to be overriden and used when we restore from saves or transfer upgrades - } -} diff --git a/java/com/hmdzl/spspd/change/items/artifacts/CapeOfThorns.java b/java/com/hmdzl/spspd/change/items/artifacts/CapeOfThorns.java deleted file mode 100644 index f268e511..00000000 --- a/java/com/hmdzl/spspd/change/items/artifacts/CapeOfThorns.java +++ /dev/null @@ -1,160 +0,0 @@ -package com.hmdzl.spspd.change.items.artifacts; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Needling; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.particles.ElmoParticle; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.ui.BuffIndicator; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Random; - -import java.util.ArrayList; - -/** - * Created by debenhame on 03/09/2014. - */ -public class CapeOfThorns extends Artifact { - - { - //name = "Cape of Thorns"; - image = ItemSpriteSheet.ARTIFACT_CAPE; - - level = 0; - levelCap = 10; - - charge = 0; - chargeCap = 100; - cooldown = 0; - - defaultAction = AC_NEEDLING; - } - - public static final String AC_NEEDLING = "NEEDLING"; - - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions(hero); - if (isEquipped(hero) && level > 1 && !cursed) - actions.add(AC_NEEDLING); - return actions; - } - - @Override - public void execute(Hero hero, String action) { - super.execute(hero, action); - if (action.equals(AC_NEEDLING)) { - if (!isEquipped(hero)) - GLog.i(Messages.get(Artifact.class, "need_to_equip")); - else if (cursed) - GLog.i(Messages.get(Artifact.class, "cursed")); - else { - if (level > 1) level--; - Sample.INSTANCE.play(Assets.SND_BURNING); - hero.sprite.emitter().burst(ElmoParticle.FACTORY, 12); - Buff.affect(hero, Needling.class, (level + 1) * 10f); - hero.spend(1f); - hero.busy(); - hero.sprite.operate(hero.pos); - updateQuickslot(); - } - } - } - @Override - protected ArtifactBuff passiveBuff() { - return new Thorns(); - } - - @Override - public String desc() { - String desc = Messages.get(this, "desc"); - if (isEquipped( Dungeon.hero )) { - desc += "\n\n"; - if (cooldown == 0) - desc += Messages.get(this, "desc_inactive"); - else - desc += Messages.get(this, "desc_active"); - } - - return desc; - } - - public class Thorns extends ArtifactBuff { - - @Override - public boolean act() { - if (cooldown > 0) { - cooldown--; - if (cooldown == 0) { - BuffIndicator.refreshHero(); - GLog.w(Messages.get(this, "inert") ); - } - updateQuickslot(); - } - spend(TICK); - return true; - } - - public int proc(int damage, Char attacker) { - if (cooldown == 0) { - charge += damage * (0.7 + level * 0.1); - if (charge >= chargeCap) { - charge = 0; - cooldown = 10 + level; - GLog.p(Messages.get(this, "radiating")); - BuffIndicator.refreshHero(); - } - } - - if (cooldown != 0) { - int deflected = Random.NormalIntRange(0, damage); - damage -= deflected; - - attacker.damage(deflected, this); - - exp += deflected; - - if (exp >= (level + 1) * 5 && level < levelCap) { - exp -= (level + 1) * 5; - upgrade(); - GLog.p(Messages.get(this, "levelup") ); - } - - } - updateQuickslot(); - return damage; - } - - @Override - public String toString() { - return Messages.get(this, "name"); - } - - @Override - public String desc() { - return Messages.get(this, "desc", dispTurns(cooldown)); - } - - @Override - public int icon() { - if (cooldown == 0) - return BuffIndicator.NONE; - else - return BuffIndicator.THORNS; - } - - @Override - public void detach() { - cooldown = 0; - charge = 0; - super.detach(); - } - - } - -} diff --git a/java/com/hmdzl/spspd/change/items/artifacts/ChaliceOfBlood.java b/java/com/hmdzl/spspd/change/items/artifacts/ChaliceOfBlood.java deleted file mode 100644 index a494ec57..00000000 --- a/java/com/hmdzl/spspd/change/items/artifacts/ChaliceOfBlood.java +++ /dev/null @@ -1,166 +0,0 @@ -package com.hmdzl.spspd.change.items.artifacts; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.ResultDescriptions; -import com.hmdzl.spspd.change.actors.buffs.BloodAngry; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.particles.ElmoParticle; -import com.hmdzl.spspd.change.effects.particles.ShadowParticle; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.plants.Earthroot; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.utils.GLog; - -import com.hmdzl.spspd.change.windows.WndOptions; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Random; - -/** - * Created by debenhame on 27/08/2014. - */ -public class ChaliceOfBlood extends Artifact { - - private static final String TXT_CHALICE = "Chalice of Blood"; - private static final String TXT_YES = "Yes, I know what I'm doing"; - private static final String TXT_NO = "No, I changed my mind"; - private static final String TXT_PRICK = "Each time you use the chalice it will drain more life energy, " - + "if you are not careful this draining effect can easily kill you.\n\n" - + "Are you sure you want to offer it more life energy?"; - - { - //name = "Chalice of Blood"; - image = ItemSpriteSheet.ARTIFACT_CHALICE1; - - level = 0; - levelCap = 10; - - defaultAction = AC_BLOODANGRY; - } - - public static final String AC_PRICK = "PRICK"; - public static final String AC_BLOODANGRY = "BLOODANGRY"; - - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions(hero); - if (isEquipped(hero) && level < levelCap && !cursed) - actions.add(AC_PRICK); - if (isEquipped(hero) && level > 3 && !cursed) - actions.add(AC_BLOODANGRY); - return actions; - } - - @Override - public void execute(Hero hero, String action) { - super.execute(hero, action); - if (action.equals(AC_PRICK)) { - - int damage = 3 * (level * level); - - if (damage > hero.HP * 0.75) { - - GameScene.show(new WndOptions(Messages.get(this, "name"), - Messages.get(this, "prick_warn"), - Messages.get(this, "yes"), - Messages.get(this, "no")) { - @Override - protected void onSelect(int index) { - if (index == 0) - prick(Dungeon.hero); - }; - }); - - } else { - prick(hero); - } - } else if (action.equals(AC_BLOODANGRY)) { - if (!isEquipped(hero) || level < 4) - GLog.i(Messages.get(Artifact.class, "need_to_equip") ); - else { - if (level > 3 )level-=3; - Sample.INSTANCE.play(Assets.SND_BURNING); - hero.sprite.emitter().burst(ElmoParticle.FACTORY, 12); - Buff.affect(hero, BloodAngry.class).set(100); - hero.spend(1f); - hero.busy(); - hero.sprite.operate(hero.pos); - updateQuickslot(); - } - } - } - - private void prick(Hero hero) { - int damage = 3 * (level * level); - - Earthroot.Armor armor = hero.buff(Earthroot.Armor.class); - if (armor != null) { - damage = armor.absorb(damage); - } - - damage -= Random.IntRange(0, hero.drRoll()); - - hero.sprite.operate(hero.pos); - hero.busy(); - hero.spend(3f); - GLog.w( Messages.get(this, "onprick") ); - if (damage <= 0){ - damage = 1; - } else { - Sample.INSTANCE.play(Assets.SND_CURSED); - hero.sprite.emitter().burst( ShadowParticle.CURSE, 4+(damage/10) ); - } - - hero.damage(damage, this); - - if (!hero.isAlive()) { - Dungeon.fail(Messages.format(ResultDescriptions.ITEM)); - //GLog.n("The Chalice sucks your life essence dry..."); - } else { - upgrade(); - } - } - - @Override - public Item upgrade() { - if (level >= 6) - image = ItemSpriteSheet.ARTIFACT_CHALICE3; - else if (level >= 2) - image = ItemSpriteSheet.ARTIFACT_CHALICE2; - return super.upgrade(); - } - - @Override - protected ArtifactBuff passiveBuff() { - return new chaliceRegen(); - } - - @Override - public String desc() { - String desc = super.desc(); - - if (isEquipped (Dungeon.hero)){ - desc += "\n\n"; - if (cursed) - desc += Messages.get(this, "desc_cursed"); - else if (level == 0) - desc += Messages.get(this, "desc_1"); - else if (level < levelCap) - desc += Messages.get(this, "desc_2"); - else - desc += Messages.get(this, "desc_3"); - } - - return desc; - } - - public class chaliceRegen extends ArtifactBuff { - - } - -} diff --git a/java/com/hmdzl/spspd/change/items/artifacts/CloakOfShadows.java b/java/com/hmdzl/spspd/change/items/artifacts/CloakOfShadows.java deleted file mode 100644 index c742b622..00000000 --- a/java/com/hmdzl/spspd/change/items/artifacts/CloakOfShadows.java +++ /dev/null @@ -1,284 +0,0 @@ -package com.hmdzl.spspd.change.items.artifacts; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.ForeverShadow; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.particles.ElmoParticle; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.ui.BuffIndicator; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.audio.Sample; -import com.watabou.noosa.tweeners.AlphaTweener; -import com.watabou.utils.Bundle; - -/** - * Created by debenhame on 25/08/2014. - */ -public class CloakOfShadows extends Artifact { - - { - //name = "Cloak of Shadows"; - image = ItemSpriteSheet.ARTIFACT_CLOAK; - - level = 0; - exp = 0; - levelCap = 10; - - charge = Math.min(level+3, 10); - partialCharge = 0; - chargeCap = Math.min(level+3, 10); - - defaultAction = AC_STEALTH; - - - } - - private boolean stealthed = false; - - public static final String AC_STEALTH = "STEALTH"; - public static final String AC_SHADOW = "SHADOW"; - - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions(hero); - if (isEquipped(hero) && charge > 1) - actions.add(AC_STEALTH); - if (isEquipped(hero) && level > 3 && !cursed) - actions.add(AC_SHADOW); - return actions; - } - - @Override - public void execute(Hero hero, String action) { - if (action.equals(AC_STEALTH)) { - - if (!stealthed) { - if (!isEquipped(hero)) - GLog.i(Messages.get(Artifact.class, "need_to_equip")); - else if (cooldown > 0) - GLog.i(Messages.get(this, "cooldown", cooldown) ); - else if (charge <= 1) - GLog.i( Messages.get(this, "no_charge") ); - else { - stealthed = true; - hero.spend(1f); - hero.busy(); - Sample.INSTANCE.play(Assets.SND_MELD); - activeBuff = activeBuff(); - activeBuff.attachTo(hero); - if (hero.sprite.parent != null) { - hero.sprite.parent.add(new AlphaTweener(hero.sprite, - 0.4f, 0.4f)); - } else { - hero.sprite.alpha(0.4f); - } - hero.sprite.operate(hero.pos); - } - } else { - stealthed = false; - activeBuff.detach(); - activeBuff = null; - hero.spend( 1f ); - hero.sprite.operate(hero.pos); - } - } else if (action.equals(AC_SHADOW)) { - if (!isEquipped(hero)) - GLog.i(Messages.get(Artifact.class, "need_to_equip") ); - else { - if (level > 3 )level-=3; - Sample.INSTANCE.play(Assets.SND_BURNING); - hero.sprite.emitter().burst(ElmoParticle.FACTORY, 12); - Buff.affect(hero, ForeverShadow.class,(level+3)*10f); - hero.spend(1f); - hero.busy(); - hero.sprite.operate(hero.pos); - updateQuickslot(); - } - } else - super.execute(hero, action); - } - - @Override - public void activate(Char ch) { - super.activate(ch); - if (stealthed) { - activeBuff = activeBuff(); - activeBuff.attachTo(ch); - } - } - - @Override - public boolean doUnequip(Hero hero, boolean collect, boolean single) { - if (super.doUnequip(hero, collect, single)) { - stealthed = false; - return true; - } else - return false; - } - - @Override - protected ArtifactBuff passiveBuff() { - return new cloakRecharge(); - } - - @Override - protected ArtifactBuff activeBuff() { - return new cloakStealth(); - } - - @Override - public Item upgrade() { - chargeCap = Math.min(chargeCap + 1, 10); - return super.upgrade(); - } - - private static final String STEALTHED = "stealthed"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(STEALTHED, stealthed); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - stealthed = bundle.getBoolean(STEALTHED); - if (bundle.contains("cooldown")){ - exp = 0; - level=(int)Math.ceil(level*0.7f); - charge = chargeCap = Math.min(3 + level, 10); - } - } - - public class cloakRecharge extends ArtifactBuff { - @Override - public boolean act() { - if (charge < chargeCap) { - if (!stealthed ) { - float turnsToCharge = (50 - (chargeCap - charge)); - if (level() > 7) turnsToCharge -= 10*(level() - 7)/3f; - partialCharge += (1f / turnsToCharge); - } - - if (partialCharge >= 1) { - charge++; - partialCharge -= 1; - if (charge == chargeCap){ - partialCharge = 0; - } - - } - } else - partialCharge = 0; - - if (cooldown > 0) - cooldown --; - - updateQuickslot(); - - spend( TICK ); - - return true; - } - - - } - - - public class cloakStealth extends ArtifactBuff { - int turnsToCost = 0; - @Override - public int icon() { - return BuffIndicator.INVISIBLE; - } - - @Override - public boolean attachTo( Char target ) { - if (super.attachTo( target )) { - target.invisible++; - return true; - } else { - return false; - } - } - - @Override - public boolean act(){ - turnsToCost--; - - if (turnsToCost <= 0){ - charge--; - if (charge < 0) { - charge = 0; - detach(); - GLog.w(Messages.get(this, "no_charge")); - ((Hero) target).interrupt(); - } else { - //target hero level is 1 + 2*cloak level - int lvlDiffFromTarget = ((Hero) target).lvl - (1+level()*2); - //plus an extra one for each level after 6 - if (level() >= 7){ - lvlDiffFromTarget -= level()-6; - } - if (lvlDiffFromTarget >= 0){ - exp += Math.round(10f * Math.pow(1.1f, lvlDiffFromTarget)); - } else { - exp += Math.round(10f * Math.pow(0.75f, -lvlDiffFromTarget)); - } - - if (exp >= (level() + 1) * 50 && level() < levelCap) { - upgrade(); - exp -= level() * 50; - GLog.p(Messages.get(this, "levelup")); - - } - turnsToCost = 5; - } - updateQuickslot(); - } - - spend( TICK ); - - return true; - } - - public void dispel(){ - updateQuickslot(); - detach(); - } - - @Override - public void fx(boolean on) { - if (on) target.sprite.add( CharSprite.State.INVISIBLE ); - else if (target.invisible == 0) target.sprite.remove( CharSprite.State.INVISIBLE ); - } - - @Override - public String toString() { - return Messages.get(this, "name"); - } - - @Override - public String desc() { - return Messages.get(this, "desc"); - } - - @Override - public void detach() { - if (target.invisible > 0) - target.invisible--; - stealthed = false; - updateQuickslot(); - super.detach(); - } - } -} diff --git a/java/com/hmdzl/spspd/change/items/artifacts/DriedRose.java b/java/com/hmdzl/spspd/change/items/artifacts/DriedRose.java deleted file mode 100644 index edbbf313..00000000 --- a/java/com/hmdzl/spspd/change/items/artifacts/DriedRose.java +++ /dev/null @@ -1,856 +0,0 @@ -package com.hmdzl.spspd.change.items.artifacts; - -import java.util.ArrayList; -import java.util.HashSet; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.ToxicGas; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Burning; -import com.hmdzl.spspd.change.actors.buffs.Dewcharge; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.actors.mobs.RedWraith; -import com.hmdzl.spspd.change.actors.mobs.npcs.Ghost; -import com.hmdzl.spspd.change.actors.mobs.npcs.NPC; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.effects.particles.ElmoParticle; -import com.hmdzl.spspd.change.effects.particles.ShaftParticle; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.armor.Armor; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfPsionicBlast; -import com.hmdzl.spspd.change.items.weapon.melee.MeleeWeapon; -import com.hmdzl.spspd.change.items.weapon.melee.special.WraithBreath; -import com.hmdzl.spspd.change.items.weapon.missiles.Boomerang; -import com.hmdzl.spspd.change.items.weapon.missiles.ManyKnive; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.messages.Languages; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.scenes.PixelScene; -import com.hmdzl.spspd.change.sprites.BeeSprite; -import com.hmdzl.spspd.change.sprites.GhostSprite; -import com.hmdzl.spspd.change.sprites.ItemSprite; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.ui.RenderedTextMultiline; -import com.hmdzl.spspd.change.ui.Window; -import com.hmdzl.spspd.change.utils.GLog; -import com.hmdzl.spspd.change.windows.IconTitle; -import com.hmdzl.spspd.change.windows.WndBag; -import com.hmdzl.spspd.change.windows.WndBlacksmith; -import com.hmdzl.spspd.change.windows.WndQuest; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundle; -import com.watabou.utils.PathFinder; -import com.watabou.utils.Random; - -/** - * Created by debenhame on 21/11/2014. - */ -public class DriedRose extends Artifact { - - { - //name = "Dried Rose"; - image = ItemSpriteSheet.ARTIFACT_ROSE1; - - level = 0; - levelCap = 10; - - charge = 100; - chargeCap = 100; - - defaultAction = AC_SUMMON; - } - - protected static boolean talkedTo = false; - protected static boolean firstSummon = false; - - private GhostHero ghost = null; - private int ghostID = 0; - - private MeleeWeapon weapon = null; - private Armor armor = null; - - public int droppedPetals = 0; - - public static final String AC_SUMMON = "SUMMON"; - public static final String AC_OUTFIT = "OUTFIT"; - public static final String AC_SOULBLESS = "SOULBLESS"; - - public DriedRose() { - super(); - talkedTo = firstSummon = false; - } - - @Override - public ArrayList actions( Hero hero ) { - ArrayList actions = super.actions( hero ); - if (!Ghost.Quest.completed()){ - actions.remove(AC_EQUIP); - return actions; - } - if (isEquipped( hero ) && charge == chargeCap && !cursed) { - actions.add(AC_SUMMON); - } - if (isIdentified() && !cursed){ - actions.add(AC_OUTFIT); - } - if (level > 0 && !isEquipped(hero) ) - actions.add(AC_SOULBLESS); - - return actions; - } - - @Override - public void execute( Hero hero, String action ) { - - super.execute(hero, action); - - if (action.equals(AC_SUMMON)) { - - if (ghost != null) GLog.i( Messages.get(this, "spawned") ); - else if (!isEquipped( hero )) GLog.i( Messages.get(Artifact.class, "need_to_equip") ); - else if (charge != chargeCap) GLog.i( Messages.get(this, "no_charge") ); - else if (cursed) GLog.i( Messages.get(this, "cursed") ); - else { - ArrayList spawnPoints = new ArrayList(); - for (int i = 0; i < PathFinder.NEIGHBOURS8.length; i++) { - int p = hero.pos + PathFinder.NEIGHBOURS8[i]; - if (Actor.findChar(p) == null && (Level.passable[p] || Level.avoid[p])) { - spawnPoints.add(p); - } - } - - if (spawnPoints.size() > 0) { - ghost = new GhostHero( this ); - ghostID = ghost.id(); - ghost.pos = Random.element(spawnPoints); - - GameScene.add(ghost, 1f); - CellEmitter.get(ghost.pos).start( ShaftParticle.FACTORY, 0.3f, 4 ); - CellEmitter.get(ghost.pos).start( Speck.factory(Speck.LIGHT), 0.2f, 3 ); - - hero.spend(1f); - hero.busy(); - hero.sprite.operate(hero.pos); - - if (!firstSummon) { - ghost.yell( Messages.get(GhostHero.class, "hello", Dungeon.hero.givenName()) ); - Sample.INSTANCE.play( Assets.SND_GHOST ); - firstSummon = true; - } else - ghost.saySpawned(); - - charge = 0; - updateQuickslot(); - - } else - GLog.i( Messages.get(this, "no_space") ); - } - - } else if (action.equals(AC_OUTFIT)){ - GameScene.show( new WndGhostHero(this) ); - } else if (action.equals(AC_SOULBLESS)) { - curUser = hero; - Sample.INSTANCE.play(Assets.SND_BURNING); - curUser.sprite.emitter().burst(ElmoParticle.FACTORY, 12); - Buff.affect(curUser, Dewcharge.class,level*100f); - curUser.spendAndNext(1f); - detach(curUser.belongings.backpack); - } - - } - - public int ghostStrength(){ - return 13 + level/2; - } - - @Override - public String desc() { - if (!Ghost.Quest.completed() && !isIdentified()){ - return Messages.get(this, "desc_no_quest"); - } - - String desc = super.desc(); - - if (isEquipped( Dungeon.hero )){ - if (!cursed){ - - if (level < levelCap) - desc+= "\n\n" + Messages.get(this, "desc_hint"); - - } else - desc += "\n\n" + Messages.get(this, "desc_cursed"); - } - - return desc; - } - - @Override - protected ArtifactBuff passiveBuff() { - return new roseRecharge(); - } - - @Override - public Item upgrade() { - if (level >= 9) - image = ItemSpriteSheet.ARTIFACT_ROSE3; - else if (level >= 4) - image = ItemSpriteSheet.ARTIFACT_ROSE2; - - // For upgrade transferring via well of transmutation - droppedPetals = Math.max(level, droppedPetals); - - return super.upgrade(); - } - - private static final String TALKEDTO = "talkedto"; - private static final String FIRSTSUMMON = "firstsummon"; - private static final String GHOSTID = "ghostID"; - private static final String PETALS = "petals"; - - private static final String WEAPON = "weapon"; - private static final String ARMOR = "armor"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - - bundle.put(TALKEDTO, talkedTo); - bundle.put(FIRSTSUMMON, firstSummon); - bundle.put( GHOSTID, ghostID ); - bundle.put( PETALS, droppedPetals ); - - if (weapon != null) bundle.put( WEAPON, weapon ); - if (armor != null) bundle.put( ARMOR, armor ); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - - talkedTo = bundle.getBoolean(TALKEDTO); - firstSummon = bundle.getBoolean(FIRSTSUMMON); - ghostID = bundle.getInt( GHOSTID ); - droppedPetals = bundle.getInt( PETALS ); - - if (bundle.contains(WEAPON)) weapon = (MeleeWeapon)bundle.get( WEAPON ); - if (bundle.contains(ARMOR)) armor = (Armor)bundle.get( ARMOR ); - } - - private static GhostHero heldGhost; - - public static void holdGhostHero( Level level ){ - for (Mob mob : level.mobs.toArray( new Mob[0] )) { - if (mob instanceof DriedRose.GhostHero) { - level.mobs.remove( mob ); - heldGhost = (GhostHero) mob; - break; - } - } - } - - public static void restoreGhostHero( Level level, int pos ){ - if (heldGhost != null){ - level.mobs.add( heldGhost ); - - int ghostPos; - do { - ghostPos = pos + PathFinder.NEIGHBOURS8[Random.Int(8)]; - } while (Level.solid[ghostPos] || level.findMob(ghostPos) != null); - - heldGhost.pos = ghostPos; - heldGhost = null; - } - } - - public static void clearHeldGhostHero(){ - heldGhost = null; - } - - public class roseRecharge extends ArtifactBuff { - - @Override - public boolean act() { - - spend( TICK ); - - if (ghost == null && ghostID != 0){ - Actor a = Actor.findById(ghostID); - if (a != null){ - ghost = (GhostHero)a; - } else { - ghostID = 0; - } - } - - //rose does not charge while ghost hero is alive - if (ghost != null){ - return true; - } - - if (charge < chargeCap && !cursed ) { - partialCharge += 2/5f; //250 turns to a full charge - if (partialCharge > 1){ - charge++; - partialCharge--; - if (charge == chargeCap){ - partialCharge = 0f; - GLog.p( Messages.get(DriedRose.class, "charged") ); - } - } - } else if (cursed && Random.Int(100) == 0) { - - ArrayList spawnPoints = new ArrayList(); - - for (int i = 0; i < PathFinder.NEIGHBOURS8.length; i++) { - int p = target.pos + PathFinder.NEIGHBOURS8[i]; - if (Actor.findChar(p) == null && (Level.passable[p] || Level.avoid[p])) { - spawnPoints.add(p); - } - } - - if (spawnPoints.size() > 0) { - RedWraith.spawnAt(Random.element(spawnPoints)); - Sample.INSTANCE.play(Assets.SND_CURSED); - } - - } - - updateQuickslot(); - - return true; - } - } - public static class Petal extends Item { - - { - //name = "dried petal"; - stackable = true; - image = ItemSpriteSheet.PETAL; - } - - @Override - public boolean doPickUp(Hero hero) { - DriedRose rose = hero.belongings.getItem(DriedRose.class); - - if (rose == null) { - GLog.w( Messages.get(this, "no_rose")); - return false; - } - if (rose.level >= rose.levelCap) { - GLog.i(Messages.get(this, "no_room")); - hero.spendAndNext(TIME_TO_PICK_UP); - return true; - } else { - - rose.upgrade(); - if (rose.level == rose.levelCap) { - GLog.p(Messages.get(this, "maxlevel")); - } else - GLog.i(Messages.get(this, "levelup")); - - Sample.INSTANCE.play(Assets.SND_DEWDROP); - hero.spendAndNext(TIME_TO_PICK_UP); - return true; - - } - } - } - - public static class GhostHero extends NPC { - - { - //name = "sad ghost"; - spriteClass = GhostSprite.class; - - flying = true; - - state = WANDERING; - enemy = null; - - ally = true; - - loot = new WraithBreath(); - lootChance = 0.3f; - } - - private DriedRose rose = null; - - public GhostHero() { - super(); - } - - public GhostHero(DriedRose rose) { - this(); - this.rose = rose; - updateRose(); - HP = HT; - } - - private void updateRose(){ - if (rose == null) { - rose = Dungeon.hero.belongings.getItem(DriedRose.class); - } - - evadeSkill = (Dungeon.hero.lvl+4)*2; - if (rose == null) return; - HT = 50 + 20*rose.level; - } - - public void saySpawned(){ - if (Messages.lang() != Languages.ENGLISH) return; //don't say anything if not on english - int i = (Dungeon.depth - 1) / 5; - if (chooseEnemy() == null) - yell( Random.element( VOICE_AMBIENT[i] ) ); - else - yell( Random.element( VOICE_ENEMIES[i][ Dungeon.bossLevel() ? 1 : 0 ] ) ); - Sample.INSTANCE.play( Assets.SND_GHOST ); - } - - public void sayAnhk(){ - yell( Random.element( VOICE_BLESSEDANKH ) ); - Sample.INSTANCE.play( Assets.SND_GHOST ); - } - - public void sayDefeated(){ - if (Messages.lang() != Languages.ENGLISH) return; //don't say anything if not on english - yell( Random.element( VOICE_DEFEATED[ Dungeon.bossLevel() ? 1 : 0 ] ) ); - Sample.INSTANCE.play( Assets.SND_GHOST ); - } - - public void sayHeroKilled(){ - if (Messages.lang() != Languages.ENGLISH) return; //don't say anything if not on english - yell(Random.element(VOICE_HEROKILLED)); - Sample.INSTANCE.play( Assets.SND_GHOST ); - } - - public void sayBossBeaten(){ - yell( Random.element( VOICE_BOSSBEATEN[ Dungeon.depth==25 ? 1 : 0 ] ) ); - Sample.INSTANCE.play( Assets.SND_GHOST ); - } - - @Override - protected boolean act() { - updateRose(); - if (rose == null || !rose.isEquipped(Dungeon.hero)){ - damage(1, this); - } - if (!isAlive()) - return true; - if (!Dungeon.hero.isAlive()) { - sayHeroKilled(); - sprite.die(); - destroy(); - return true; - } - return super.act(); - } - - @Override - public int hitSkill(Char target) { - //same accuracy as the hero. - int acc = Dungeon.hero.lvl + 9; - - if (rose != null && rose.weapon != null){ - acc *= rose.weapon.ACU; - } - - return acc; - } - - @Override - protected float attackDelay() { - if (rose != null && rose.weapon != null){ - return rose.weapon.DLY; - } else { - return super.attackDelay(); - } - } - - @Override - protected boolean canAttack(Char enemy) { - if (rose != null && rose.weapon != null) { - return Dungeon.level.distance(pos, enemy.pos) <= rose.weapon.RCH; - } else { - return super.canAttack(enemy); - } - } - - @Override - public int damageRoll() { - int dmg = 0; - if (rose != null && rose.weapon != null){ - dmg += Random.NormalIntRange(rose.weapon.MIN, rose.weapon.MAX); - } else { - dmg += Random.NormalIntRange(0, 5); - } - - return dmg; - } - - @Override - public int attackProc(Char enemy, int damage) { - if (rose != null && rose.weapon != null) { - rose.weapon.proc(this, enemy, damage); - return damage; - } else { - return super.attackProc(enemy, damage); - } - } - - @Override - public int defenseProc(Char enemy, int damage) { - return super.defenseProc(enemy, damage); - } - - @Override - public void damage(int dmg, Object src) { - //TODO improve this when I have proper damage source logic - super.damage( dmg, src ); - } - - @Override - public float speed() { - float speed = super.speed(); - return speed; - } - - @Override - public int evadeSkill(Char enemy) { - - int eva = Dungeon.hero.lvl + 4; - - if (rose != null && rose.armor != null){ - eva *= rose.armor.DEX; - } - //int defense = super.evadeSkill(enemy); - return eva; - } - - @Override - public int drRoll() { - int block = 0; - if (rose != null && rose.armor != null){ - block += Random.NormalIntRange( rose.armor.MIN, rose.armor.MAX); - } - return block; - } - - @Override - protected boolean getCloser(int target) { - if (state == WANDERING - || Level.distance(target, Dungeon.hero.pos) > 6) - this.target = target = Dungeon.hero.pos; - return super.getCloser(target); - } - - @Override - protected Char chooseEnemy() { - if (enemy == null || !enemy.isAlive() || state == WANDERING) { - - HashSet enemies = new HashSet(); - for (Mob mob : Dungeon.level.mobs) { - if (mob.hostile && Level.fieldOfView[mob.pos] - && mob.state != mob.PASSIVE) { - enemies.add(mob); - } - } - enemy = enemies.size() > 0 ? Random.element(enemies) : null; - } - return enemy; - } - - @Override - public void add(Buff buff) { - // in other words, can't be directly affected by buffs/debuffs. - } - - @Override - public boolean interact() { - if (!DriedRose.talkedTo){ - DriedRose.talkedTo = true; - GameScene.show(new WndQuest(this, Messages.get(this, "introduce") )); - return false; - } else if (Dungeon.level.passable[pos] || Dungeon.hero.flying) { - int curPos = pos; - - moveSprite( pos, Dungeon.hero.pos ); - move( Dungeon.hero.pos ); - - Dungeon.hero.sprite.move( Dungeon.hero.pos, curPos ); - Dungeon.hero.move( curPos ); - - Dungeon.hero.spend( 1 / Dungeon.hero.speed() ); - Dungeon.hero.busy(); - return true; - } else { - return false; - } - } - - @Override - public void die(Object cause) { - sayDefeated(); - super.die(cause); - } - - @Override - public void destroy() { - updateRose(); - if (rose != null) { - rose.ghost = null; - rose.ghostID = -1; - } - super.destroy(); - } - - private static final HashSet> IMMUNITIES = new HashSet>(); - static { - IMMUNITIES.add(ToxicGas.class); - IMMUNITIES.add( Burning.class ); - IMMUNITIES.add(ScrollOfPsionicBlast.class); - } - - @Override - public HashSet> immunities() { - return IMMUNITIES; - } - - // ************************************************************************************ - // This is a bunch strings & string arrays, used in all of the sad - // ghost's voice lines. - // ************************************************************************************ - - public static final String VOICE_HELLO = "Hello again "; - - private static final String VOICE_INTRODUCE = "My spirit is bound to this rose, it was very precious to me, a " - + "gift from my love whom I left on the surface.\n\nI cannot return to him, but thanks to you I have a " - + "second chance to complete my journey. When I am able I will respond to your call and fight with you.\n\n" - + "hopefully you may succeed where I failed..."; - - // 1st index - depth type, 2nd index - specific line. - public static final String[][] VOICE_AMBIENT = { - { - "These sewers were once safe, some even lived here in the winter...", - "I wonder what happened to the guard patrols, did they give up?...", - "I had family on the surface, I hope they are safe..." }, - { - "I've heard stories about this place, nothing good...", - "This place was always more of a dungeon than a prison...", - "I can't imagine what went on when this place was abandoned..." }, - { - "No human or dwarf has been here for a very long time...", - "Something must have gone very wrong, for the dwarves to abandon a gold mine...", - "I feel great evil lurking below..." }, - { "The dwarves were industrious, but greedy...", - "I hope the surface never ends up like this place...", - "So the dwarvern metropolis really has fallen..." }, - { - "What is this place?...", - "So the stories are true, we have to fight a demon god...", - "I feel a great evil in this place..." }, - { "... I don't like this place... We should leave as soon as possible..." } }; - - // 1st index - depth type, 2nd index - boss or not, 3rd index - specific - // line. - public static final String[][][] VOICE_ENEMIES = { - { - { - "Let's make the sewers safe again...", - "If the guards couldn't defeat them, perhaps we can...", - "These crabs are extremely annoying..." }, - { - "Beware Goo!...", - "Many of my friends died to this thing, time for vengeance...", - "Such an abomination cannot be allowed to live..." } }, - { - { - "What dark magic happened here?...", - "To think the captives of this place are now its guardians...", - "They were criminals before, now they are monsters..." }, - { - "If only he would see reason, he doesn't seem insane...", - "He assumes we are hostile, if only he would stop to talk...", - "The one prisoner left sane is a deadly assassin. Of course..." } }, - { - { - "The creatures here are twisted, just like the sewers... ", - "more gnolls, I hate gnolls...", - "Even the bats are bloodthirsty here..." }, - { - "Only dwarves would build a mining machine that kills looters...", - "That thing is huge...", - "How has it survived here for so long?..." } }, - { - { - "Dwarves aren't supposed to look that pale...", - "I don't know what's worse, the dwarves, or their creations...", - "They all obey their master without question, even now..." }, - { - "When people say power corrupts, this is what they mean...", - "He's more a Lich than a King now...", - "Looks like he's more demon than dwarf now..." } }, - { - { "What the heck is that thing?...", - "This place is terrifying...", - "What were the dwarves thinking, toying with power like this?..." }, - { "Oh.... this doesn't look good...", - "So that's what a god looks like?...", - "This is going to hurt..." } }, - { - { "I don't like this place... we should leave as soon as we can..." }, - { "Hello source viewer, I'm writing this here as this line should never trigger. Have a nice day!" } } }; - - // 1st index - Yog or not, 2nd index - specific line. - public static final String[][] VOICE_BOSSBEATEN = { - { "Yes!", "Victory!" }, - { "It's over... we won...", - "I can't believe it... We just killed a god..." } }; - - // 1st index - boss or not, 2nd index - specific line. - public static final String[][] VOICE_DEFEATED = { - { "Good luck...", "I will return...", "Tired... for now..." }, - { "No... I can't....", "I'm sorry.. good luck..", - "Finish it off... without me..." } }; - - public static final String[] VOICE_HEROKILLED = { "nooo...", "no...", - "I couldn't help them..." }; - - public static final String[] VOICE_BLESSEDANKH = { "Incredible!...", - "Wish I had one of those...", "How did you survive that?..." }; - } - private static class WndGhostHero extends Window { - - private static final int BTN_SIZE = 32; - private static final float GAP = 2; - private static final float BTN_GAP = 12; - private static final int WIDTH = 116; - - private WndBlacksmith.ItemButton btnWeapon; - private WndBlacksmith.ItemButton btnArmor; - - WndGhostHero(final DriedRose rose){ - - IconTitle titlebar = new IconTitle(); - titlebar.icon( new ItemSprite(rose) ); - titlebar.label( Messages.get(this, "title") ); - titlebar.setRect( 0, 0, WIDTH, 0 ); - add( titlebar ); - - RenderedTextMultiline message = - PixelScene.renderMultiline(Messages.get(this, "desc", rose.ghostStrength()), 6); - message.maxWidth( WIDTH ); - message.setPos(0, titlebar.bottom() + GAP); - add( message ); - - btnWeapon = new WndBlacksmith.ItemButton(){ - @Override - protected void onClick() { - if (rose.weapon != null){ - item(new WndBag.Placeholder(ItemSpriteSheet.WEAPON_HOLDER)); - if (!rose.weapon.doPickUp(Dungeon.hero)){ - Dungeon.level.drop( rose.weapon, Dungeon.hero.pos); - } - rose.weapon = null; - } else { - GameScene.selectItem(new WndBag.Listener() { - @Override - public void onSelect(Item item) { - if (!(item instanceof MeleeWeapon || item instanceof Boomerang || item instanceof ManyKnive)) { - //do nothing, should only happen when window is cancelled - } else if (item.unique || item instanceof Boomerang) { - GLog.w( Messages.get(WndGhostHero.class, "cant_unique")); - hide(); - } else if (!item.isIdentified()) { - GLog.w( Messages.get(WndGhostHero.class, "cant_unidentified")); - hide(); - } else if (item.cursed) { - GLog.w( Messages.get(WndGhostHero.class, "cant_cursed")); - hide(); - } else if (((MeleeWeapon)item).STR > rose.ghostStrength()) { - GLog.w( Messages.get(WndGhostHero.class, "cant_strength")); - hide(); - } else { - if (item.isEquipped(Dungeon.hero)){ - ((MeleeWeapon) item).doUnequip(Dungeon.hero, false, false); - } else { - item.detach(Dungeon.hero.belongings.backpack); - } - rose.weapon = (MeleeWeapon) item; - item(rose.weapon); - } - - } - }, WndBag.Mode.WEAPON, Messages.get(WndGhostHero.class, "weapon_prompt")); - } - } - }; - btnWeapon.setRect( (WIDTH - BTN_GAP) / 2 - BTN_SIZE, message.top() + message.height() + GAP, BTN_SIZE, BTN_SIZE ); - if (rose.weapon != null) { - btnWeapon.item(rose.weapon); - } else { - btnWeapon.item(new WndBag.Placeholder(ItemSpriteSheet.WEAPON_HOLDER)); - } - add( btnWeapon ); - - btnArmor = new WndBlacksmith.ItemButton(){ - @Override - protected void onClick() { - if (rose.armor != null){ - item(new WndBag.Placeholder(ItemSpriteSheet.ARMOR_HOLDER)); - if (!rose.armor.doPickUp(Dungeon.hero)){ - Dungeon.level.drop( rose.armor, Dungeon.hero.pos); - } - rose.armor = null; - } else { - GameScene.selectItem(new WndBag.Listener() { - @Override - public void onSelect(Item item) { - if (!(item instanceof Armor)) { - //do nothing, should only happen when window is cancelled - } else if (item.unique ) { - GLog.w( Messages.get(WndGhostHero.class, "cant_unique")); - hide(); - } else if (!item.isIdentified()) { - GLog.w( Messages.get(WndGhostHero.class, "cant_unidentified")); - hide(); - } else if (item.cursed) { - GLog.w( Messages.get(WndGhostHero.class, "cant_cursed")); - hide(); - } else if (((Armor)item).STR > rose.ghostStrength()) { - GLog.w( Messages.get(WndGhostHero.class, "cant_strength")); - hide(); - } else { - if (item.isEquipped(Dungeon.hero)){ - ((Armor) item).doUnequip(Dungeon.hero, false, false); - } else { - item.detach(Dungeon.hero.belongings.backpack); - } - rose.armor = (Armor) item; - item(rose.armor); - } - - } - }, WndBag.Mode.ARMOR, Messages.get(WndGhostHero.class, "armor_prompt")); - } - } - }; - btnArmor.setRect( btnWeapon.right() + BTN_GAP, btnWeapon.top(), BTN_SIZE, BTN_SIZE ); - if (rose.armor != null) { - btnArmor.item(rose.armor); - } else { - btnArmor.item(new WndBag.Placeholder(ItemSpriteSheet.ARMOR_HOLDER)); - } - add( btnArmor ); - - resize(WIDTH, (int)(btnArmor.bottom() + GAP)); - } - - } - -} diff --git a/java/com/hmdzl/spspd/change/items/artifacts/EtherealChains.java b/java/com/hmdzl/spspd/change/items/artifacts/EtherealChains.java deleted file mode 100644 index fdb2a4d5..00000000 --- a/java/com/hmdzl/spspd/change/items/artifacts/EtherealChains.java +++ /dev/null @@ -1,300 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * Shattered Pixel Dungeon - * Copyright (C) 2014-2015 Evan Debenham - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.artifacts; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.AttackDown; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Cripple; -import com.hmdzl.spspd.change.actors.buffs.Locked; -import com.hmdzl.spspd.change.actors.buffs.Silent; -import com.hmdzl.spspd.change.actors.buffs.Slow; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.Chains; -import com.hmdzl.spspd.change.effects.Pushing; -import com.hmdzl.spspd.change.effects.particles.ElmoParticle; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.mechanics.Ballistica; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.CellSelector; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Callback; -import com.watabou.utils.Random; - -import java.util.ArrayList; - -public class EtherealChains extends Artifact { - - public static final String AC_CAST = "CAST"; - public static final String AC_LOCKED = "LOCKED"; - - { - image = ItemSpriteSheet.ARTIFACT_CHAINS; - - levelCap = 5; - exp = 0; - - charge = 5; - - defaultAction = AC_CAST; - usesTargeting = true; - } - - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions( hero ); - if (isEquipped(hero) && charge > 0 && !cursed) - actions.add(AC_CAST); - if (isEquipped(hero) && level > 1 && !cursed) - actions.add(AC_LOCKED); - return actions; - } - - @Override - public void execute(Hero hero, String action) { - if (action.equals(AC_CAST)){ - - curUser = hero; - - if (!isEquipped( hero )) GLog.i( Messages.get(Artifact.class, "need_to_equip") ); - else if (charge < 1) GLog.i( Messages.get(this, "no_charge") ); - else if (cursed) GLog.w( Messages.get(this, "cursed") ); - else { - GameScene.selectCell(caster); - } - - } else if (action.equals(AC_LOCKED)){ - - curUser = hero; - - if (!isEquipped( hero )) GLog.i( Messages.get(Artifact.class, "need_to_equip") ); - else if (charge < 1) GLog.i( Messages.get(this, "no_charge") ); - else if (cursed) GLog.w( Messages.get(this, "cursed") ); - else { - GameScene.selectCell(locker); - } - - } else - super.execute(hero, action); - } - - private CellSelector.Listener caster = new CellSelector.Listener(){ - - @Override - public void onSelect(Integer target) { - if (target != null && (Dungeon.level.visited[target] || Dungeon.level.mapped[target])){ - - //ballistica does not go through walls on pre-rework boss arenas - int missileProperties = (Dungeon.depth == 10 || Dungeon.depth == 15 || Dungeon.depth == 20 || Dungeon.depth == 25) ? - Ballistica.PROJECTILE : Ballistica.STOP_CHARS | Ballistica.STOP_TARGET; - - final Ballistica chain = new Ballistica(curUser.pos, target, missileProperties); - - //determine if we're grabbing an enemy, pulling to a location, or doing nothing. - if (Actor.findChar( chain.collisionPos ) != null){ - int newPos = -1; - for (int i : chain.subPath(1, chain.dist)){ - if (!Level.solid[i] && Actor.findChar(i) == null){ - newPos = i; - break; - } - } - if (newPos == -1){ - GLog.w( Messages.get(EtherealChains.class, "does_nothing") ); - } else { - final int newMobPos = newPos; - final Char affected = Actor.findChar( chain.collisionPos ); - int chargeUse = Level.distance(affected.pos, newMobPos); - if (chargeUse > charge) { - GLog.w( Messages.get(EtherealChains.class, "no_charge") ); - return; - } else if (affected.properties().contains(Char.Property.IMMOVABLE)) { - GLog.w( Messages.get(EtherealChains.class, "cant_pull") ); - return; - } else { - charge -= chargeUse; - updateQuickslot(); - } - curUser.busy(); - curUser.sprite.parent.add(new Chains(curUser.pos, affected.pos, new Callback() { - public void call() { - Actor.add(new Pushing(affected, affected.pos, newMobPos, new Callback() { - public void call() { - Dungeon.level.press(newMobPos, affected); - } - })); - affected.pos = newMobPos; - Dungeon.observe(); - curUser.spendAndNext(1f); - } - })); - } - - } else if (Level.solid[chain.path.get(chain.dist)] - || (chain.dist > 0 && Level.solid[chain.path.get(chain.dist-1)]) - || (chain.path.size() > chain.dist+1 && Level.solid[chain.path.get(chain.dist+1)]) - //if the player is trying to grapple the edge of the map, let them. - || (chain.path.size() == chain.dist+1)) { - int newPos = -1; - for (int i : chain.subPath(1, chain.dist)){ - if (!Level.solid[i] && Actor.findChar(i) == null) newPos = i; - } - if (newPos == -1) { - GLog.w( Messages.get(EtherealChains.class, "does_nothing") ); - } else { - final int newHeroPos = newPos; - int chargeUse = Level.distance(curUser.pos, newHeroPos); - if (chargeUse > charge){ - GLog.w( Messages.get(EtherealChains.class, "no_charge") ); - return; - } else { - charge -= chargeUse; - updateQuickslot(); - } - curUser.busy(); - curUser.sprite.parent.add(new Chains(curUser.pos, target, new Callback() { - public void call() { - Actor.add(new Pushing(curUser, curUser.pos, newHeroPos, new Callback() { - public void call() { - Dungeon.level.press(newHeroPos, curUser); - } - })); - curUser.spendAndNext(1f); - curUser.pos = newHeroPos; - Dungeon.observe(); - } - })); - } - - } else { - GLog.i( Messages.get(EtherealChains.class, "nothing_to_grab") ); - } - - } - - } - - @Override - public String prompt() { - return Messages.get(EtherealChains.class, "prompt"); - } - }; - - private CellSelector.Listener locker = new CellSelector.Listener(){ - - @Override - public void onSelect(Integer target) { - if (target != null && (Dungeon.level.visited[target] || Dungeon.level.mapped[target])){ - - if (Actor.findChar( target ) != null){ - Char mob = Actor.findChar(target); - Buff.affect(mob,Locked.class,level*4f); - Buff.affect(mob,Silent.class,level*4f); - Buff.affect(mob,AttackDown.class,level*4f).level(90); - Buff.affect(mob,Slow.class,level*4f); - level--; - Sample.INSTANCE.play(Assets.SND_BURNING); - curUser.sprite.emitter().burst(ElmoParticle.FACTORY, 12); - curUser.spendAndNext(1f); - updateQuickslot(); - - } else { - GLog.i( Messages.get(EtherealChains.class, "nothing_to_grab") ); - } - - } - - } - - @Override - public String prompt() { - return Messages.get(EtherealChains.class, "prompt"); - } - }; - - @Override - protected ArtifactBuff passiveBuff() { - return new chainsRecharge(); - } - - @Override - public String desc() { - String desc = super.desc(); - - if (isEquipped( Dungeon.hero )){ - desc += "\n\n"; - if (cursed) - desc += Messages.get(this, "desc_cursed"); - else - desc += Messages.get(this, "desc_equipped"); - } - return desc; - } - - public class chainsRecharge extends ArtifactBuff{ - - @Override - public boolean act() { - int chargeTarget = 5+(level()*2); - if (charge < chargeTarget && !cursed ) { - partialCharge += 1 / (40f - (chargeTarget - charge)*2f); - } else if (cursed && Random.Int(100) == 0){ - Buff.prolong( target, Cripple.class, 10f); - } - - if (partialCharge >= 1) { - partialCharge --; - charge ++; - } - - updateQuickslot(); - - spend( TICK ); - - return true; - } - - public void gainExp( float levelPortion ) { - if (cursed) return; - - exp += Math.round(levelPortion*100); - - //past the soft charge cap, gaining charge from leveling is slowed. - if (charge > 5+(level()*2)){ - levelPortion *= (5+((float)level()*2))/charge; - } - partialCharge += levelPortion*10f; - - if (exp > 100+level()*50 && level() < levelCap){ - exp -= 100+level()*50; - GLog.p( Messages.get(this, "levelup") ); - upgrade(); - } - - } - } -} diff --git a/java/com/hmdzl/spspd/change/items/artifacts/EyeOfSkadi.java b/java/com/hmdzl/spspd/change/items/artifacts/EyeOfSkadi.java deleted file mode 100644 index 7a6765e6..00000000 --- a/java/com/hmdzl/spspd/change/items/artifacts/EyeOfSkadi.java +++ /dev/null @@ -1,280 +0,0 @@ -package com.hmdzl.spspd.change.items.artifacts; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.DungeonTilemap; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.ArmorBreak; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Chill; -import com.hmdzl.spspd.change.actors.buffs.Cripple; -import com.hmdzl.spspd.change.actors.buffs.Frost; -import com.hmdzl.spspd.change.actors.buffs.Poison; -import com.hmdzl.spspd.change.actors.buffs.Strength; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.DeathRay; -import com.hmdzl.spspd.change.effects.particles.ElmoParticle; -import com.hmdzl.spspd.change.effects.particles.PurpleParticle; -import com.hmdzl.spspd.change.effects.particles.SnowParticle; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.StoneOre; -import com.hmdzl.spspd.change.items.nornstone.NornStone; -import com.hmdzl.spspd.change.items.scrolls.Scroll; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.Terrain; -import com.hmdzl.spspd.change.mechanics.Ballistica; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.CellSelector; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.hmdzl.spspd.change.windows.WndBag; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundle; -import com.watabou.utils.Callback; -import com.watabou.utils.Random; - -/** - * Created by dachhack on 10/15/2015. - */ -public class EyeOfSkadi extends Artifact { - - { - //name = "Eye of Skadi"; - image = ItemSpriteSheet.RING_FROST; - - level = 0; - exp = 0; - levelCap = 10; - - charge = 0; - partialCharge = 0; - chargeCap = 100; - - - defaultAction = AC_CURSE; - } - - protected WndBag.Mode mode = WndBag.Mode.STONE; - - public static int consumedpts = 0; - - public static final String AC_BLAST = "BLAST"; - public static final String AC_ADD = "ADD"; - public static final String AC_CURSE = "CURSE"; - - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions(hero); - if (isEquipped(hero) && charge == 100 && !cursed) - actions.add(AC_CURSE); - if (isEquipped(hero) && level < levelCap && !cursed) - actions.add(AC_ADD); - if (isEquipped(hero) && level > 1 && !cursed) - actions.add(AC_BLAST); - return actions; - } - - @Override - public void execute(Hero hero, String action) { - super.execute(hero, action); - if (action.equals(AC_BLAST)) { - curUser = hero; - if (!isEquipped(hero)) - GLog.i(Messages.get(Artifact.class, "need_to_equip") ); - else { - - blast(hero.pos); - level--; - exp -=level; - Sample.INSTANCE.play(Assets.SND_BURNING); - updateQuickslot(); - //GLog.p("Blast!"); - CellEmitter.get(hero.pos).start(SnowParticle.FACTORY, 0.2f, 6); - - } - - } else if (action.equals(AC_ADD)) { - GameScene.selectItem(itemSelector, mode,Messages.get(this, "prompt")); - } else if (action.equals(AC_CURSE)) { - curUser = hero; - if (charge != chargeCap) {GLog.i(Messages.get(this, "no_charge"));} - else GameScene.selectCell(curser); - } - } - - private CellSelector.Listener curser = new CellSelector.Listener(){ - - @Override - public void onSelect(Integer target) { - if (target != null && (Dungeon.level.visited[target] || Dungeon.level.mapped[target])){ - - if (Actor.findChar( target ) != null){ - Char mob = Actor.findChar(target); - Buff.affect(mob,Poison.class).set(level*2f); - Buff.affect(mob,Frost.class,level*4f); - Buff.affect(mob,ArmorBreak.class,level*4f).level(80); - Buff.affect(mob,Chill.class,level*4f); - charge = 0; - curUser.sprite.emitter().burst(ElmoParticle.FACTORY, 12); - curUser.spendAndNext(1f); - updateQuickslot(); - - } else { - GLog.i( Messages.get(EtherealChains.class, "nothing_to_grab") ); - } - - } - - } - - @Override - public String prompt() { - return Messages.get(EtherealChains.class, "prompt"); - } - }; - - public int level(){ - return level; - } - - public void blast(int cell) { - for (Mob mob : Dungeon.level.mobs.toArray(new Mob[0])) { - - mob.damage(Random.Int(mob.HP/4,mob.HP/2 ), this); - Buff.prolong(mob, Frost.class, Frost.duration(mob)* Random.Float(1f*level(), 1.5f*level())); - CellEmitter.get(mob.pos).start(SnowParticle.FACTORY, 0.2f, 6); - - } - eyeUsed(); - } - - - - protected void eyeUsed() { - - updateQuickslot(); - - } - - - - - @Override - protected ArtifactBuff passiveBuff() { - return new eyeRecharge(); - } - - @Override - public String desc() { - String desc = super.desc(); - if (isEquipped(Dungeon.hero)) { - if (charge < 100) - desc += "\n\n" + Messages.get(this,"need_charge"); - else - desc += "\n\n" + Messages.get(this,"full_charge"); - } - - return desc; - } - - public class eyeRecharge extends ArtifactBuff { - @Override - public boolean act() { - if (charge < chargeCap && !cursed ) { - - partialCharge += 1+level; - - if (partialCharge >= 10) { - charge++; - partialCharge = 0; - if (charge == chargeCap) { - partialCharge = 0; - } - - } - } else if (cursed && Random.Int(100) == 0){ - Buff.prolong( target, Frost.class, 5f); - } else - partialCharge = 0; - - - updateQuickslot(); - - spend(TICK); - - return true; - } - - } - - private static final String PARTIALCHARGE = "partialCharge"; - private static final String CHARGE = "charge"; - private static final String CONSUMED = "consumedpts"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(PARTIALCHARGE, partialCharge); - bundle.put(CHARGE, charge); - bundle.put(CONSUMED, consumedpts); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - partialCharge = bundle.getInt(PARTIALCHARGE); - charge = bundle.getInt(CHARGE); - consumedpts = bundle.getInt(CONSUMED); - } - - protected static WndBag.Listener itemSelector = new WndBag.Listener() { - @Override - public void onSelect(Item item) { - if (item != null && item instanceof StoneOre) { - Hero hero = Dungeon.hero; - consumedpts += 1; - - hero.sprite.operate(hero.pos); - hero.busy(); - hero.spend(2f); - Sample.INSTANCE.play(Assets.SND_BURNING); - hero.sprite.emitter().burst(ElmoParticle.FACTORY, 12); - item.detach(hero.belongings.backpack); - GLog.h(Messages.get(EyeOfSkadi.class, "exp",consumedpts)); - - int levelChk = curItem.level*2 + 1 ; - - if (consumedpts > levelChk && curItem.level<10) { - curItem.upgrade(); - GLog.p(Messages.get(EyeOfSkadi.class, "infuse_ore")); - } - - } else if (item != null && item instanceof NornStone) { - Hero hero = Dungeon.hero; - consumedpts += 5; - - hero.sprite.operate(hero.pos); - hero.busy(); - hero.spend(2f); - Sample.INSTANCE.play(Assets.SND_BURNING); - hero.sprite.emitter().burst(ElmoParticle.FACTORY, 12); - item.detach(hero.belongings.backpack); - GLog.h(Messages.get(EyeOfSkadi.class, "exp", consumedpts)); - - int levelChk = curItem.level * 2 + 1; - - if (consumedpts > levelChk && curItem.level < 10) { - curItem.upgrade(); - GLog.p(Messages.get(EyeOfSkadi.class, "infuse_ore")); - } - } - } - }; - -} diff --git a/java/com/hmdzl/spspd/change/items/artifacts/GlassTotem.java b/java/com/hmdzl/spspd/change/items/artifacts/GlassTotem.java deleted file mode 100644 index 61eb1a3f..00000000 --- a/java/com/hmdzl/spspd/change/items/artifacts/GlassTotem.java +++ /dev/null @@ -1,129 +0,0 @@ -package com.hmdzl.spspd.change.items.artifacts; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.actors.buffs.ArmorBreak; -import com.hmdzl.spspd.change.actors.buffs.AttackUp; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Cripple; -import com.hmdzl.spspd.change.actors.buffs.DefenceUp; -import com.hmdzl.spspd.change.actors.buffs.GlassShield; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.particles.ElmoParticle; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Random; - -/** - * Created by dachhack on 10/15/2015. - */ -public class GlassTotem extends Artifact { - - { - //name = "Glass Totem"; - image = ItemSpriteSheet.GLASSTOTEM; - - level = 0; - levelCap = 10; - - defaultAction = AC_ATK; - } - - public static final String AC_ATK = "ATK"; - public static final String AC_DEF = "DEF"; - - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions(hero); - if (isEquipped(hero)&& !cursed){ - actions.add(AC_ATK);} - if (isEquipped(hero) && level > 1 && !cursed) - actions.add(AC_DEF); - return actions; - } - - @Override - public void execute(Hero hero, String action) { - super.execute(hero, action); - if (action.equals(AC_ATK)) { - if (!isEquipped(hero)) - GLog.i(Messages.get(Artifact.class, "need_to_equip") ); - else if (cursed) - GLog.i( Messages.get(Artifact.class, "cursed") ); - else { - if (level<10)level++; - Buff.affect(hero, AttackUp.class,200).level(75); - Buff.affect(hero, ArmorBreak.class,200).level(75); - hero.spend(1f); - hero.busy(); - hero.sprite.operate(hero.pos); - updateQuickslot(); - } - - } else if (action.equals(AC_DEF)) { - if (!isEquipped(hero)) - GLog.i(Messages.get(Artifact.class, "need_to_equip") ); - else { - if (level > 1 )level--; - Sample.INSTANCE.play(Assets.SND_BURNING); - hero.sprite.emitter().burst(ElmoParticle.FACTORY, 12); - Buff.detach(hero, AttackUp.class); - Buff.affect(hero, GlassShield.class).turns(2); - hero.spend(3f); - hero.busy(); - hero.sprite.operate(hero.pos); - updateQuickslot(); - } - } - } - - //public int level(){ - //return level; - //} - - - @Override - protected ArtifactBuff passiveBuff() { - return new glassRecharge(); - } - - @Override - public String desc() { - String desc = super.desc(); - return desc; - } - - public class glassRecharge extends ArtifactBuff { - @Override - public boolean act() { - if (cursed && Random.Int(100) == 0){ - Buff.affect( target, ArmorBreak.class, 10f).level(100); - } else if (Random.Int(1000/(level+1)) == 0){ - Buff.affect( target, AttackUp.class, 5f).level(20); - Buff.affect( target, DefenceUp.class, 5f).level(20); - } - spend( TICK ); - return true; - } - } - - /*private static final String PARTIALCHARGE = "partialCharge"; - private static final String CHARGE = "charge"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(PARTIALCHARGE, partialCharge); - bundle.put(CHARGE, charge); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - partialCharge = bundle.getInt(PARTIALCHARGE); - charge = bundle.getInt(CHARGE); - }*/ -} diff --git a/java/com/hmdzl/spspd/change/items/artifacts/HornOfPlenty.java b/java/com/hmdzl/spspd/change/items/artifacts/HornOfPlenty.java deleted file mode 100644 index b5f0e455..00000000 --- a/java/com/hmdzl/spspd/change/items/artifacts/HornOfPlenty.java +++ /dev/null @@ -1,231 +0,0 @@ -package com.hmdzl.spspd.change.items.artifacts; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.Statistics; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Feed; -import com.hmdzl.spspd.change.actors.buffs.Recharging; -import com.hmdzl.spspd.change.actors.buffs.Hunger; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.effects.SpellSprite; -import com.hmdzl.spspd.change.effects.particles.ElmoParticle; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.food.fruit.Blandfruit; -import com.hmdzl.spspd.change.items.food.Food; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfRecharging; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.hmdzl.spspd.change.windows.WndBag; -import com.watabou.noosa.audio.Sample; - -/** - * Created by debenhame on 26/08/2014. - */ -public class HornOfPlenty extends Artifact { - - { - //name = "Horn of Plenty"; - image = ItemSpriteSheet.ARTIFACT_HORN1; - - level = 0; - levelCap = 30; - - charge = 0; - partialCharge = 0; - chargeCap = 10; - - defaultAction = AC_EAT; - } - - private static final float TIME_TO_EAT = 3f; - - private float energy = 36f; - - public static final String AC_EAT = "EAT"; - public static final String AC_STORE = "STORE"; - public static final String AC_FEED = "FEED"; - - protected String inventoryTitle = "Select a piece of food"; - protected WndBag.Mode mode = WndBag.Mode.FOOD; - - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions(hero); - if (isEquipped(hero) && charge > 0) - actions.add(AC_EAT); - if (isEquipped(hero) && level < 30 && !cursed) - actions.add(AC_STORE); - if (isEquipped(hero) && level > 0 && !cursed) - actions.add(AC_FEED); - return actions; - } - - @Override - public void execute(Hero hero, String action) { - super.execute(hero, action); - - if (action.equals(AC_EAT)) { - - if (!isEquipped(hero)) - GLog.i( Messages.get(Artifact.class, "need_to_equip")); - else if (charge == 0) - GLog.i( Messages.get(this, "no_food") ); - else { - hero.buff(Hunger.class).satisfy(energy * charge); - - // if you get at least 100 food energy from the horn - if (charge >= 3) { - switch (hero.heroClass) { - case WARRIOR: - if (hero.HP < hero.HT) { - hero.HP = Math.min(hero.HP + 5, hero.HT); - hero.sprite.emitter().burst( - Speck.factory(Speck.HEALING), 1); - } - break; - case MAGE: - Buff.affect( hero, Recharging.class, 4f ); - ScrollOfRecharging.charge(hero); - break; - case ROGUE: - case HUNTRESS: - case PERFORMER: - case SOLDIER: - case FOLLOWER: - break; - } - - Statistics.foodEaten++; - } - charge = 0; - - hero.sprite.operate(hero.pos); - hero.busy(); - SpellSprite.show(hero, SpellSprite.FOOD); - Sample.INSTANCE.play(Assets.SND_EAT); - GLog.i( Messages.get(this, "eat")); - - hero.spend(TIME_TO_EAT); - - Badges.validateFoodEaten(); - - image = ItemSpriteSheet.ARTIFACT_HORN1; - - updateQuickslot(); - } - - } else if (action.equals(AC_STORE)) { - - GameScene.selectItem(itemSelector, mode,Messages.get(this, "prompt")); - } else if (action.equals(AC_FEED)) { - if (!isEquipped(hero)) - GLog.i(Messages.get(Artifact.class, "need_to_equip") ); - else { - Buff.affect(hero, Feed.class,level*3f); - hero.spend(1f); - hero.busy(); - hero.sprite.operate(hero.pos); - Sample.INSTANCE.play(Assets.SND_BURNING); - hero.sprite.emitter().burst(ElmoParticle.FACTORY, 12); - level = 0; - updateQuickslot(); - } - } - } - - @Override - protected ArtifactBuff passiveBuff() { - return new hornRecharge(); - } - - @Override - public String desc() { - String desc = super.desc(); - - if ( isEquipped( Dungeon.hero ) ){ - if (!cursed) { - if (level < levelCap) - desc += "\n\n" +Messages.get(this, "desc_hint"); - } else { - desc += "\n\n" +Messages.get(this, "desc_cursed"); - } - } - - return desc; - } - - public class hornRecharge extends ArtifactBuff { - - @Override - public boolean act() { - if (charge < chargeCap && !cursed) { - - // generates 0.25 food value every round, +0.015 value per level - // to a max of 0.70 food value per round (0.25+0.5, at level 30) - partialCharge += 0.25f + (0.015f * level); - - // charge is in increments of 36 food value. - if (partialCharge >= 80) { - charge++; - partialCharge -= 80; - - if (charge == chargeCap) - image = ItemSpriteSheet.ARTIFACT_HORN4; - else if (charge >= 7) - image = ItemSpriteSheet.ARTIFACT_HORN3; - else if (charge >= 3) - image = ItemSpriteSheet.ARTIFACT_HORN2; - else - image = ItemSpriteSheet.ARTIFACT_HORN1; - - if (charge == chargeCap) { - GLog.p(Messages.get(HornOfPlenty.class, "full")); - partialCharge = 0; - } - - updateQuickslot(); - } - } else - partialCharge = 0; - - spend(TICK); - - return true; - } - - } - - protected static WndBag.Listener itemSelector = new WndBag.Listener() { - @Override - public void onSelect(Item item) { - if (item != null && item instanceof Food) { - if (item instanceof Blandfruit - && ((Blandfruit) item).potionAttrib == null) { - GLog.w(Messages.get(HornOfPlenty.class, "reject") ); - } else { - Hero hero = Dungeon.hero; - hero.sprite.operate(hero.pos); - hero.busy(); - hero.spend(TIME_TO_EAT); - - curItem.upgrade(((Food) item).hornValue); - if (curItem.level >= 30) { - curItem.level = 30; - GLog.p( Messages.get(HornOfPlenty.class, "maxlevel") ); - } else - GLog.p(Messages.get(HornOfPlenty.class, "levelup")); - item.detach(hero.belongings.backpack); - } - - } - } - }; - -} diff --git a/java/com/hmdzl/spspd/change/items/artifacts/MasterThievesArmband.java b/java/com/hmdzl/spspd/change/items/artifacts/MasterThievesArmband.java deleted file mode 100644 index 7d419ed9..00000000 --- a/java/com/hmdzl/spspd/change/items/artifacts/MasterThievesArmband.java +++ /dev/null @@ -1,139 +0,0 @@ -package com.hmdzl.spspd.change.items.artifacts; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.GoldTouch; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.particles.ElmoParticle; -import com.hmdzl.spspd.change.effects.particles.MemoryParticle; -import com.hmdzl.spspd.change.effects.particles.ShadowParticle; -import com.hmdzl.spspd.change.items.Generator; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Random; - -import java.util.ArrayList; - -/** - * Created by debenhame on 03/09/2014. - */ -public class MasterThievesArmband extends Artifact { - - { - //name = "Master Thieves' Armband"; - image = ItemSpriteSheet.ARTIFACT_ARMBAND; - - level = 0; - levelCap = 10; - - charge = 0; - } - - private int exp = 0; - public static final String AC_GOLDTOUCH = "GOLDTOUCH"; - - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions(hero); - if (!isEquipped(hero) && level > 1 && !cursed ) - actions.add(AC_GOLDTOUCH); - return actions; - } - - @Override - public void execute(Hero hero, String action) { - super.execute(hero, action); - if (action.equals(AC_GOLDTOUCH)) { - - Buff.affect(hero, GoldTouch.class,level*10f); - Sample.INSTANCE.play(Assets.SND_BURNING); - hero.sprite.emitter().burst(ElmoParticle.FACTORY, 12); - hero.spend(1f); - hero.busy(); - hero.sprite.operate(hero.pos); - detach(curUser.belongings.backpack); - Dungeon.level.drop(Generator.random(Generator.Category.ARTIFACT),hero.pos); - - } - } - - @Override - protected ArtifactBuff passiveBuff() { - return new Thievery(); - } - - @Override - public String desc() { - String desc = super.desc(); - - if ( isEquipped (Dungeon.hero) ) - desc += "\n\n" + Messages.get(this, "desc_worn"); - - return desc; - } - - public class Thievery extends ArtifactBuff { - public void collect(int gold) { - if (!cursed) { - charge += gold/2; - } - } - - @Override - public void detach() { - charge *= 0.95; - super.detach(); - } - - @Override - public boolean act() { - if (cursed) { - - if (Dungeon.gold > 0 && Random.Int(6) == 0){ - Dungeon.gold--; - } - - spend(TICK); - return true; - } else { - return super.act(); - } - } - - public boolean steal(int value) { - if (value <= charge) { - charge -= value; - exp += value; - } else { - float chance = stealChance(value); - //if (Random.Float() > chance) - //return false; - //else { - if (chance <= 1) - charge = 0; - else - // removes the charge it took you to reach 100% - charge -= charge / chance; - exp += value; - //} - } - while (exp >= 1000 && level < levelCap) { - exp -= 1000; - upgrade(); - } - return true; - } - - public float stealChance(int value) { - // get lvl*100 gold or lvl*5% item value of free charge, whichever - // is less. - //int chargeBonus = Math.min(level * 100, (value * level) / 20); - int chargeBonus = Math.min(level * 100, (value * level) / 20); - return (((float) charge + chargeBonus) / value); - } - } -} diff --git a/java/com/hmdzl/spspd/change/items/artifacts/Pylon.java b/java/com/hmdzl/spspd/change/items/artifacts/Pylon.java deleted file mode 100644 index cb9b56da..00000000 --- a/java/com/hmdzl/spspd/change/items/artifacts/Pylon.java +++ /dev/null @@ -1,324 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * Shattered Pixel Dungeon - * Copyright (C) 2014-2015 Evan Debenham - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.artifacts; -//If it weren't super obvious, this is going to become an artifact soon. - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Invisibility; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.effects.MagicMissile; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfTeleportation; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.mechanics.Ballistica; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.CellSelector; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.scenes.InterlevelScene; -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.hmdzl.spspd.change.sprites.ItemSprite.Glowing; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.Game; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundle; -import com.watabou.utils.Callback; - -import java.util.ArrayList; - -public class Pylon extends Artifact { - - public static final float TIME_TO_USE = 1; - - public static final String AC_ZAP = "ZAP"; - public static final String AC_SET = "SET"; - public static final String AC_RETURN = "RETURN"; - public static final String AC_RANKUP = "RANKUP"; - - private int returnDepth = -1; - private int returnPos; - - { - image = ItemSpriteSheet.ARTIFACT_BEACON; - - levelCap = 3; - - charge = 0; - chargeCap = 3; - - defaultAction = AC_ZAP; - usesTargeting = true; - } - - private static final String DEPTH = "depth"; - private static final String POS = "pos"; - - @Override - public void storeInBundle( Bundle bundle ) { - super.storeInBundle( bundle ); - bundle.put( DEPTH, returnDepth ); - if (returnDepth != -1) { - bundle.put( POS, returnPos ); - } - } - - @Override - public void restoreFromBundle( Bundle bundle ) { - super.restoreFromBundle(bundle); - returnDepth = bundle.getInt( DEPTH ); - returnPos = bundle.getInt( POS ); - } - - @Override - public ArrayList actions( Hero hero ) { - ArrayList actions = super.actions( hero ); - actions.add( AC_ZAP ); - actions.add( AC_SET ); - if (returnDepth != -1) { - actions.add( AC_RETURN ); - } - if (level == 3) { - actions.add( AC_RANKUP ); - } - return actions; - } - - @Override - public void execute( Hero hero, String action ) { - - if (action == AC_SET || action == AC_RETURN) { - - if (Dungeon.bossLevel() || Dungeon.depth > 25) { - hero.spend( 1f ); - GLog.w( Messages.get(this, "preventing") ); - return; - } - - for (int i=0; i < Level.NEIGHBOURS8.length; i++) { - if (Actor.findChar( hero.pos + Level.NEIGHBOURS8[i] ) != null) { - GLog.w( Messages.get(this, "creatures") ); - return; - } - } - } - - if (action == AC_ZAP ){ - - curUser = hero; - int chargesToUse = 1; - - if (!isEquipped( hero )) GLog.i( Messages.get(Artifact.class, "need_to_equip") ); - else if (charge < chargesToUse) GLog.i( Messages.get(this, "no_charge") ); - else { - GameScene.selectCell(zapper); - } - - } else if (action == AC_SET) { - - returnDepth = Dungeon.depth; - returnPos = hero.pos; - - hero.spend( 1f ); - hero.busy(); - - hero.sprite.operate( hero.pos ); - Sample.INSTANCE.play( Assets.SND_BEACON ); - - GLog.i( Messages.get(this, "return") ); - - } else if (action == AC_RETURN) { - - if (returnDepth == Dungeon.depth) { - ScrollOfTeleportation.appear( hero, returnPos ); - Dungeon.level.press( returnPos, hero ); - Dungeon.observe(); - } else { - - Buff buff = Dungeon.hero.buff(TimekeepersHourglass.timeFreeze.class); - if (buff != null) buff.detach(); - - for (Mob mob : Dungeon.level.mobs.toArray( new Mob[0] )) - if (mob instanceof DriedRose.GhostHero) mob.destroy(); - - InterlevelScene.mode = InterlevelScene.Mode.RETURN; - InterlevelScene.returnDepth = returnDepth; - InterlevelScene.returnPos = returnPos; - Game.switchScene( InterlevelScene.class ); - } - - - } else if (action == AC_RANKUP) { - hero.HT +=5; - hero.hitSkill++; - hero.evadeSkill++; - hero.magicSkill++; - level = 0; - hero.sprite.showStatus(CharSprite.POSITIVE, Messages.get(this, "rankup")); - }else { - - super.execute( hero, action ); - - } - } - - protected CellSelector.Listener zapper = new CellSelector.Listener() { - - @Override - public void onSelect(Integer target) { - - if (target == null) return; - - Invisibility.dispel(); - charge -= 1; - updateQuickslot(); - - if (Actor.findChar(target) == curUser){ - ScrollOfTeleportation.teleportHero(curUser); - curUser.spendAndNext(1f); - } else { - final Ballistica bolt = new Ballistica( curUser.pos, target, Ballistica.MAGIC_BOLT ); - final Char ch = Actor.findChar(bolt.collisionPos); - - if (ch == curUser){ - ScrollOfTeleportation.teleportHero(curUser); - curUser.spendAndNext( 1f ); - } else { - Sample.INSTANCE.play( Assets.SND_ZAP ); - curUser.sprite.zap(bolt.collisionPos); - curUser.busy(); - - MagicMissile.force(curUser.sprite.parent, bolt.sourcePos, bolt.collisionPos, new Callback() { - @Override - public void call() { - if (ch != null) { - - int count = 10; - int pos; - do { - pos = Dungeon.level.randomRespawnCell(); - if (count-- <= 0) { - break; - } - } while (pos == -1); - - - if (pos == -1 || Dungeon.bossLevel()) { - - GLog.w( Messages.get(ScrollOfTeleportation.class, "no_tele") ); - - } else if (ch.properties().contains(Char.Property.IMMOVABLE)) { - - GLog.w( Messages.get(Pylon.class, "tele_fail") ); - - } else { - - ch.pos = pos; - ch.sprite.place(ch.pos); - ch.sprite.visible = Dungeon.visible[pos]; - - } - } - curUser.spendAndNext(1f); - } - }); - - } - - - } - - } - - @Override - public String prompt() { - return Messages.get(Pylon.class, "prompt"); - } - }; - - @Override - protected ArtifactBuff passiveBuff() { - return new beaconRecharge(); - } - - @Override - public Item upgrade() { - if (level == levelCap) return this; - if (charge < chargeCap) charge ++; - GLog.p( Messages.get(this, "levelup") ); - return super.upgrade(); - } - - @Override - public String desc() { - String desc = super.desc(); - if (returnDepth != -1){ - desc += "\n\n" + Messages.get(this, "desc_set", returnDepth); - } - return desc; - } - - public void reset() { - returnDepth = -1; - } - - private static final Glowing WHITE = new Glowing( 0xFFFFFF ); - - @Override - public Glowing glowing() { - return returnDepth != -1 ? WHITE : null; - } - - public class beaconRecharge extends ArtifactBuff{ - @Override - public boolean act() { - if (charge < chargeCap && !cursed ) { - partialCharge += 1 / (100f - (chargeCap - charge)*10f); - - if (partialCharge >= 1) { - partialCharge --; - charge ++; - - if (charge == chargeCap){ - partialCharge = 0; - } - } - } - - updateQuickslot(); - spend( TICK ); - return true; - } - public void gainExp( float levelPortion ) { - if (cursed) return; - exp += Math.round(levelPortion*100); - if (exp > 300 && level() < levelCap){ - exp -= 300; - upgrade(); - } - - } - } -} diff --git a/java/com/hmdzl/spspd/change/items/artifacts/RobotDMT.java b/java/com/hmdzl/spspd/change/items/artifacts/RobotDMT.java deleted file mode 100644 index d6adc959..00000000 --- a/java/com/hmdzl/spspd/change/items/artifacts/RobotDMT.java +++ /dev/null @@ -1,227 +0,0 @@ -package com.hmdzl.spspd.change.items.artifacts; - -import java.io.IOException; -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.buffs.AttackUp; -import com.hmdzl.spspd.change.actors.buffs.BerryRegeneration; -import com.hmdzl.spspd.change.actors.buffs.Bless; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.DefenceUp; -import com.hmdzl.spspd.change.actors.buffs.Dewcharge; -import com.hmdzl.spspd.change.actors.buffs.Invisibility; -import com.hmdzl.spspd.change.actors.buffs.MindVision; -import com.hmdzl.spspd.change.actors.buffs.Strength; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.particles.ElmoParticle; -import com.hmdzl.spspd.change.items.armor.normalarmor.ErrorArmor; -import com.hmdzl.spspd.change.items.wands.WandOfError; -import com.hmdzl.spspd.change.items.weapon.melee.special.ErrorW; -import com.hmdzl.spspd.change.items.weapon.missiles.ErrorAmmo; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.LoadSaveScene; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.Game; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -/** - * Created by dachhack on 10/15/2015. - */ -public class RobotDMT extends Artifact { - - { - //name = "Robot Determination"; - image = ItemSpriteSheet.RING_DISINTEGRATION; - - level = 0; - exp = 0; - levelCap = 10; - - charge = 0; - partialCharge = 0; - chargeCap = 100; - - - defaultAction = AC_HEART; - } - - public static final String AC_HEART = "HEART"; - public static final String AC_MEMORY = "MEMORY"; - public static final String AC_ERROR = "ERROR"; - - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions(hero); - if (isEquipped(hero) && charge == 100 && !cursed) - actions.add(AC_HEART); - if (level > 9 && !isEquipped(hero) ) - actions.add(AC_MEMORY); - if (Dungeon.error == true && !isEquipped(hero)) - actions.add(AC_ERROR); - return actions; - } - - @Override - public void execute(Hero hero, String action) { - super.execute(hero, action); - if (action.equals(AC_HEART)) { - - if (!isEquipped(hero)) - GLog.i(Messages.get(Artifact.class, "need_to_equip") ); - else if (charge != chargeCap) - GLog.i(Messages.get(this, "no_charge")); - else { - charge = 0; - if (level < 10 )level++; - switch (Random.Int(level)){ - case 0: - Buff.affect(hero, Invisibility.class,50); - GLog.w(Messages.get(this,"patience")); - break; - case 1: - Buff.affect(hero, AttackUp.class,100).level(20); - Buff.affect(hero, DefenceUp.class,100).level(20); - GLog.w(Messages.get(this,"bravery")); - break; - case 2: - Buff.affect(hero, MindVision.class,80); - GLog.w(Messages.get(this,"integrity")); - break; - case 3: - Buff.affect(hero, Bless.class,50); - GLog.w(Messages.get(this,"preseverance")); - break; - case 4: - Buff.affect(hero, BerryRegeneration.class).level(20); - GLog.w(Messages.get(this,"kindness")); - break; - case 5: - Buff.affect(hero,Strength.class); - GLog.w(Messages.get(this,"justice")); - break; - case 6: - Buff.affect(hero,Dewcharge.class, 100f); - GLog.w(Messages.get(this,"soul")); - break; - case 7: - //Buff.affect(hero,Dewcharge.class, 100f); - GLog.w(Messages.get(this,"friendship")); - break; - case 8: - // - GLog.w(Messages.get(this,"chaos")); - Dungeon.error = true; - break; - default: - // - GLog.w(Messages.get(this,"determination")); - break; - } - hero.spend(1f); - updateQuickslot(); - } - - } else if (action.equals(AC_MEMORY)) { - //showPudding_cupScene(false); - curUser = hero; - detach(curUser.belongings.backpack); - try { - Dungeon.saveAll(); - } catch (IOException e) { - // - } - Dungeon.canSave=true; - Game.switchScene(LoadSaveScene.class); - } else if (action.equals(AC_ERROR)) { - curUser = hero; - curUser.spendAndNext(1f); - detach(curUser.belongings.backpack); - Dungeon.error = false; - Sample.INSTANCE.play(Assets.SND_BURNING); - hero.sprite.emitter().burst(ElmoParticle.FACTORY, 12); - switch (Random.Int(4)){ - case 0: - Dungeon.level.drop(new ErrorW() ,Dungeon.hero.pos).sprite.drop(); - break; - case 1: - Dungeon.level.drop(new WandOfError(),Dungeon.hero.pos).sprite.drop(); - break; - case 2: - Dungeon.level.drop(new ErrorArmor(),Dungeon.hero.pos).sprite.drop(); - break; - case 3: - Dungeon.level.drop(new ErrorAmmo(3),Dungeon.hero.pos).sprite.drop(); - break; - - } - } - } - - public int level(){ - return level; - } - - - @Override - protected ArtifactBuff passiveBuff() { - return new dmtRecharge(); - } - - @Override - public String desc() { - String desc = super.desc(); - if (isEquipped(Dungeon.hero)) { - if (charge == 100) - desc += "\n\n" + Messages.get(this,"full_charge"); - } - return desc; - } - - public class dmtRecharge extends ArtifactBuff { - @Override - public boolean act() { - if (charge < chargeCap) { - partialCharge += 1f; - if (partialCharge >= 5) { - charge++; - partialCharge = 0; - if (charge == chargeCap) { - partialCharge = 0; - } - - } - } else - partialCharge = 0; - - - updateQuickslot(); - - spend(TICK); - - return true; - } - - } - - private static final String PARTIALCHARGE = "partialCharge"; - private static final String CHARGE = "charge"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(PARTIALCHARGE, partialCharge); - bundle.put(CHARGE, charge); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - partialCharge = bundle.getInt(PARTIALCHARGE); - charge = bundle.getInt(CHARGE); - } -} diff --git a/java/com/hmdzl/spspd/change/items/artifacts/SandalsOfNature.java b/java/com/hmdzl/spspd/change/items/artifacts/SandalsOfNature.java deleted file mode 100644 index 2c4b8a43..00000000 --- a/java/com/hmdzl/spspd/change/items/artifacts/SandalsOfNature.java +++ /dev/null @@ -1,204 +0,0 @@ -package com.hmdzl.spspd.change.items.artifacts; - -import java.util.ArrayList; -import java.util.Collections; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.blobs.Blob; -import com.hmdzl.spspd.change.actors.blobs.Water; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Roots; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.particles.EarthParticle; -import com.hmdzl.spspd.change.effects.particles.ElmoParticle; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.plants.Earthroot; -import com.hmdzl.spspd.change.plants.Plant; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.hmdzl.spspd.change.windows.WndBag; -import com.watabou.noosa.Camera; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundle; - -/** - * Created by debenhame on 08/09/2014. - */ -public class SandalsOfNature extends Artifact { - - { - //name = "Sandals of Nature"; - image = ItemSpriteSheet.ARTIFACT_SANDALS; - - level = 0; - levelCap = 3; - - charge = 0; - - defaultAction = AC_ROOT; - } - - public static final String AC_FEED = "FEED"; - public static final String AC_ROOT = "ROOT"; - public static final String AC_SPROUT = "SPROUT"; - - //protected String inventoryTitle = "Select a seed"; - protected WndBag.Mode mode = WndBag.Mode.SEED; - - public ArrayList seeds = new ArrayList(); - - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions(hero); - if (isEquipped(hero) && level < 3 && !cursed) - actions.add(AC_FEED); - if (isEquipped(hero) && charge > 0) - actions.add(AC_ROOT); - if (level > 0 && !isEquipped(hero) ) - actions.add(AC_SPROUT); - return actions; - } - - @Override - public void execute(Hero hero, String action) { - super.execute(hero, action); - if (action.equals(AC_FEED)) { - GameScene.selectItem(itemSelector, mode, Messages.get(this, "prompt")); - } else if (action.equals(AC_ROOT) && level > 0) { - - if (!isEquipped(hero)) - GLog.i(Messages.get(Artifact.class, "need_to_equip")); - else if (charge == 0) - GLog.i(Messages.get(this, "no_charge")); - else { - Buff.prolong(hero, Roots.class, 5); - Buff.affect(hero, Earthroot.Armor.class).level(charge); - CellEmitter.bottom(hero.pos).start(EarthParticle.FACTORY, - 0.05f, 8); - Camera.main.shake(1, 0.4f); - charge = 0; - updateQuickslot(); - } - } else if (action.equals(AC_SPROUT)) { - curUser = hero; - int length = Level.getLength(); - - for (int i = 0; i < length; i++) { - - GameScene.add(Blob.seed(i, (2) * 20 * level, Water.class)); - - } - detach(curUser.belongings.backpack); - Sample.INSTANCE.play(Assets.SND_BURNING); - curUser.sprite.emitter().burst(ElmoParticle.FACTORY, 12); - curUser.spendAndNext(2f); - } - } - - @Override - protected ArtifactBuff passiveBuff() { - return new Naturalism(); - } - - @Override - public String desc() { - String desc = Messages.get(this, "desc_" + (level+1)); - - if (isEquipped(Dungeon.hero)) { - desc += "\n\n"; - if (!cursed) - desc += Messages.get(this, "desc_hint"); - else - desc += Messages.get(this, "desc_cursed"); - - if (level > 0) - desc += "\n\n" + Messages.get(this, "desc_ability"); - } - - if (!seeds.isEmpty()) { - desc += "\n\n" + Messages.get(this, "desc_seeds", seeds.size()); - } - - return desc; - } - - @Override - public Item upgrade() { - if (level < 0) - image = ItemSpriteSheet.ARTIFACT_SANDALS; - else if (level == 0) - image = ItemSpriteSheet.ARTIFACT_SHOES; - else if (level == 1) - image = ItemSpriteSheet.ARTIFACT_BOOTS; - else if (level >= 2) - image = ItemSpriteSheet.ARTIFACT_GREAVES; - name = Messages.get(this, "name_" + (level+1)); - return super.upgrade(); - } - - private static final String SEEDS = "seeds"; - //private static final String NAME = "name"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - //bundle.put(NAME, name); - bundle.put(SEEDS, seeds.toArray(new String[seeds.size()])); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - if (level > 0) name = Messages.get(this, "name_" + level); - if (bundle.contains(SEEDS)) - Collections.addAll(seeds, bundle.getStringArray(SEEDS)); - } - - public class Naturalism extends ArtifactBuff { - public void charge() { - if (charge < target.HT) { - // gain 1+(1*level)% of the difference between current charge - // and max HP. - charge += (Math.round((target.HT - charge) - * (.01 + level * 0.01))); - updateQuickslot(); - } - } - } - - protected WndBag.Listener itemSelector = new WndBag.Listener() { - @Override - public void onSelect(Item item) { - if (item != null && item instanceof Plant.Seed) { - if (seeds.contains(item.name())) { - GLog.w(Messages.get(SandalsOfNature.class, "already_fed")); - } else { - seeds.add(item.name()); - - Hero hero = Dungeon.hero; - hero.sprite.operate(hero.pos); - Sample.INSTANCE.play(Assets.SND_PLANT); - hero.busy(); - hero.spend(2f); - if (seeds.size() >= 3 + (level * 3)) { - seeds.clear(); - upgrade(); - if (level >= 1 && level <= 3) { - GLog.p(Messages.get(SandalsOfNature.class, "levelup")); - } - - } else { - GLog.i(Messages.get(SandalsOfNature.class, "absorb_seed")); - } - item.detach(hero.belongings.backpack); - } - } - } - }; - -} diff --git a/java/com/hmdzl/spspd/change/items/artifacts/TalismanOfForesight.java b/java/com/hmdzl/spspd/change/items/artifacts/TalismanOfForesight.java deleted file mode 100644 index 8f390b52..00000000 --- a/java/com/hmdzl/spspd/change/items/artifacts/TalismanOfForesight.java +++ /dev/null @@ -1,222 +0,0 @@ -package com.hmdzl.spspd.change.items.artifacts; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.buffs.Awareness; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Notice; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.particles.ElmoParticle; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.Terrain; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.ui.BuffIndicator; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.audio.Sample; - -/** - * Created by debenhame on 08/09/2014. - */ -public class TalismanOfForesight extends Artifact { - - { - //name = "Talisman of Foresight"; - image = ItemSpriteSheet.ARTIFACT_TALISMAN; - - level = 0; - exp = 0; - levelCap = 10; - - charge = 0; - partialCharge = 0; - chargeCap = 100; - - defaultAction = AC_SCRY; - } - - public static final String AC_SCRY = "SCRY"; - public static final String AC_NOTICE = "NOTICE"; - - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions(hero); - if (isEquipped(hero) && charge == 100 && !cursed && !Dungeon.sokobanLevel(Dungeon.depth)) - actions.add(AC_SCRY); - if (isEquipped(hero) && level > 2 && !cursed) - actions.add(AC_NOTICE); - return actions; - } - - @Override - public void execute(Hero hero, String action) { - super.execute(hero, action); - if (action.equals(AC_SCRY)) { - - if (!isEquipped(hero)) - GLog.i(Messages.get(Artifact.class, "need_to_equip") ); - else if (charge != chargeCap) - GLog.i(Messages.get(this, "no_charge")); - else { - hero.sprite.operate(hero.pos); - hero.busy(); - Sample.INSTANCE.play(Assets.SND_BEACON); - charge = 0; - for (int i = 0; i < Level.getLength(); i++) { - - int terr = Dungeon.level.map[i]; - if ((Terrain.flags[terr] & Terrain.SECRET) != 0) { - - GameScene.updateMap(i); - - if (Dungeon.visible[i]) { - GameScene.discoverTile(i, terr); - } - } - } - - GLog.p(Messages.get(this, "scry")); - - Buff.affect(hero, Awareness.class, Awareness.DURATION); - Dungeon.observe(); - } - } else if (action.equals(AC_NOTICE)) { - if (!isEquipped(hero)) - GLog.i(Messages.get(Artifact.class, "need_to_equip") ); - else { - if (level > 2 )level-=2; - Sample.INSTANCE.play(Assets.SND_BURNING); - hero.sprite.emitter().burst(ElmoParticle.FACTORY, 12); - Buff.affect(hero, Notice.class,(level+2)*10f); - hero.spend(1f); - hero.busy(); - hero.sprite.operate(hero.pos); - updateQuickslot(); - } - } - } - - @Override - protected ArtifactBuff passiveBuff() { - return new Foresight(); - } - - @Override - public String desc() { - String desc = super.desc(); - - if ( isEquipped( Dungeon.hero ) ){ - if (!cursed) { - desc += "\n\n" + Messages.get(this, "desc_worn"); - - } else { - desc += "\n\n" + Messages.get(this, "desc_cursed"); - } - } - - return desc; - } - - public class Foresight extends ArtifactBuff { - private int warn = 0; - - @Override - public boolean act() { - spend(TICK); - - boolean smthFound = false; - - int distance = 3; - - int cx = target.pos % Level.getWidth(); - int cy = target.pos / Level.getWidth(); - int ax = cx - distance; - if (ax < 0) { - ax = 0; - } - int bx = cx + distance; - if (bx >= Level.getWidth()) { - bx = Level.getWidth() - 1; - } - int ay = cy - distance; - if (ay < 0) { - ay = 0; - } - int by = cy + distance; - if (by >= Level.HEIGHT) { - by = Level.HEIGHT - 1; - } - - for (int y = ay; y <= by; y++) { - for (int x = ax, p = ax + y * Level.getWidth(); x <= bx; x++, p++) { - - if (Dungeon.visible[p] && Level.secret[p] - && Dungeon.level.map[p] != Terrain.SECRET_DOOR) - smthFound = true; - } - } - - if (smthFound == true && !cursed) { - if (warn == 0) { - GLog.w(Messages.get(this, "uneasy")); - if (target instanceof Hero) { - ((Hero) target).interrupt(); - } - } - warn = 3; - } else { - if (warn > 0) { - warn--; - } - } - BuffIndicator.refreshHero(); - - // fully charges in 2500 turns at lvl=0, scaling to 1000 turns at - // lvl = 10. - if (charge < 100 && !cursed) { - partialCharge += 0.04 + (level * 0.006); - - if (partialCharge > 1 && charge < 100) { - partialCharge--; - charge++; - } else if (charge >= 100) { - partialCharge = 0; - GLog.p(Messages.get(this, "full_charge")); - } - } - - return true; - } - - public void charge() { - charge = Math.min(charge + (2 + (level / 3)), chargeCap); - exp++; - if (exp >= 4 && level < levelCap) { - upgrade(); - GLog.p(Messages.get(this, "levelup") ); - exp -= 4; - } - } - - @Override - public String toString() { - return Messages.get(this, "name"); - } - - @Override - public String desc() { - return Messages.get(this, "desc"); - } - - @Override - public int icon() { - if (warn == 0) - return BuffIndicator.NONE; - else - return BuffIndicator.FORESIGHT; - } - } -} diff --git a/java/com/hmdzl/spspd/change/items/artifacts/TimekeepersHourglass.java b/java/com/hmdzl/spspd/change/items/artifacts/TimekeepersHourglass.java deleted file mode 100644 index d9d59d16..00000000 --- a/java/com/hmdzl/spspd/change/items/artifacts/TimekeepersHourglass.java +++ /dev/null @@ -1,392 +0,0 @@ -package com.hmdzl.spspd.change.items.artifacts; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.AttackUp; -import com.hmdzl.spspd.change.actors.buffs.Bless; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.DefenceUp; -import com.hmdzl.spspd.change.actors.buffs.Hunger; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.effects.particles.ElmoParticle; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.hmdzl.spspd.change.windows.WndOptions; -import com.watabou.noosa.Group; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -import static com.hmdzl.spspd.change.items.scrolls.ScrollOfRecharging.charge; - -/** - * Created by debenhame on 01/12/2014. - */ -public class TimekeepersHourglass extends Artifact { - - private static final String TXT_HGLASS = "Timekeeper's Hourglass"; - private static final String TXT_STASIS = "Put myself in stasis"; - private static final String TXT_FREEZE = "Freeze time around me"; - private static final String TXT_DESC = "How would you like to use the hourglass's magic?\n\n" - + "While in stasis, time will move normally while you are frozen and completely invulnerable.\n\n" - + "When time is frozen, you can move as if your actions take no time. Note that attacking will break this."; - - { - //name = "Timekeeper's Hourglass"; - image = ItemSpriteSheet.ARTIFACT_HOURGLASS; - - level = 0; - levelCap = 5; - - charge = 10 + level * 2; - partialCharge = 0; - chargeCap = 10 + level * 2; - - defaultAction = AC_ACTIVATE; - } - - public static final String AC_ACTIVATE = "ACTIVATE"; - public static final String AC_RESTART = "RESTART"; - - // keeps track of generated sandbags. - public int sandBags = 0; - - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions(hero); - if (isEquipped(hero) && charge > 0 && !cursed) - actions.add(AC_ACTIVATE); - if (isEquipped(hero) && level > 1 && !cursed) - actions.add(AC_RESTART); - return actions; - } - - @Override - public void execute(Hero hero, String action) { - if (action.equals(AC_ACTIVATE)) { - - if (!isEquipped(hero)) - GLog.i(Messages.get(Artifact.class, "need_to_equip")); - else if (activeBuff != null) - GLog.i(Messages.get(this, "in_use")); - else if (charge <= 1) - GLog.i(Messages.get(this, "no_charge") ); - else if (cursed) - GLog.i(Messages.get(this, "cursed")); - else - GameScene.show(new WndOptions(Messages.get(this, "name"), - Messages.get(this, "prompt"), - Messages.get(this, "stasis"), - Messages.get(this, "freeze")) { - @Override - protected void onSelect(int index) { - if (index == 0) { - GLog.i(Messages.get(TimekeepersHourglass.class, "onstasis")); - GameScene.flash(0xFFFFFF); - Sample.INSTANCE.play(Assets.SND_TELEPORT); - - activeBuff = new timeStasis(); - activeBuff.attachTo(Dungeon.hero); - } else if (index == 1) { - GLog.i(Messages.get(TimekeepersHourglass.class, "onfreeze")); - GameScene.flash(0xFFFFFF); - Sample.INSTANCE.play(Assets.SND_TELEPORT); - - activeBuff = new timeFreeze(); - activeBuff.attachTo(Dungeon.hero); - } - }; - }); - } else if (action.equals(AC_RESTART)){ - - level--; - curUser = hero; - curUser.HP = curUser.HT; - Buff.affect(curUser,AttackUp.class,50f).level(20); - Buff.affect(curUser,DefenceUp.class,50f).level(20); - Buff.affect(curUser,Bless.class,50f); - curUser.belongings.charge( true ); - Sample.INSTANCE.play(Assets.SND_BURNING); - curUser.sprite.emitter().burst(ElmoParticle.FACTORY, 12); - curUser.spendAndNext(1f); - - } else - super.execute(hero, action); - } - - @Override - public void activate(Char ch) { - super.activate(ch); - if (activeBuff != null) - activeBuff.attachTo(ch); - } - - @Override - public boolean doUnequip(Hero hero, boolean collect, boolean single) { - if (super.doUnequip(hero, collect, single)) { - if (activeBuff != null) { - activeBuff.detach(); - activeBuff = null; - } - return true; - } else - return false; - } - - @Override - protected ArtifactBuff passiveBuff() { - return new hourglassRecharge(); - } - - @Override - public Item upgrade() { - chargeCap += 2; - - // for artifact transmutation. - while (level + 1 > sandBags) - sandBags++; - - return super.upgrade(); - } - - @Override - public String desc() { - String desc = super.desc(); - - if (isEquipped( Dungeon.hero )){ - if (!cursed) { - if (level < levelCap ) - desc += "\n\n" + Messages.get(this, "desc_hint"); - - } else - desc += "\n\n" + Messages.get(this, "desc_cursed"); - } - return desc; - } - - @Override - public void updateArtifact() { - chargeCap = 10 + level*2; - } - - private static final String SANDBAGS = "sandbags"; - private static final String BUFF = "buff"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(SANDBAGS, sandBags); - - if (activeBuff != null) - bundle.put(BUFF, activeBuff); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - sandBags = bundle.getInt(SANDBAGS); - - // these buffs belong to hourglass, need to handle unbundling within the - // hourglass class. - if (bundle.contains(BUFF)) { - Bundle buffBundle = bundle.getBundle(BUFF); - - if (buffBundle.contains(timeFreeze.PARTIALTIME)) - activeBuff = new timeFreeze(); - else - activeBuff = new timeStasis(); - - activeBuff.restoreFromBundle(buffBundle); - } - } - - public class hourglassRecharge extends ArtifactBuff { - @Override - public boolean act() { - if (charge < chargeCap && !cursed) { - partialCharge += 1 / (60f - (chargeCap - charge) * 2f); - - if (partialCharge >= 1) { - partialCharge--; - charge++; - - if (charge == chargeCap) { - partialCharge = 0; - } - } - } else if (cursed && Random.Int(10) == 0) - ((Hero) target).spend(TICK); - - updateQuickslot(); - - spend(TICK); - - return true; - } - } - - public class timeStasis extends ArtifactBuff { - - @Override - public boolean attachTo(Char target) { - spend(charge); - ((Hero) target).spendAndNext(charge); - - // shouldn't punish the player for going into stasis frequently - Hunger hunger = target.buff(Hunger.class); - if (hunger != null && !hunger.isStarving()) - hunger.satisfy(charge); - - charge = 0; - - target.invisible++; - - updateQuickslot(); - - Dungeon.observe(); - - return super.attachTo(target); - } - - @Override - public boolean act() { - detach(); - return true; - } - - @Override - public void detach() { - if (target.invisible > 0) - target.invisible--; - super.detach(); - activeBuff = null; - Dungeon.observe(); - } - } - - public class timeFreeze extends ArtifactBuff { - - float partialTime = 0f; - - ArrayList presses = new ArrayList(); - - public boolean processTime(float time) { - partialTime += time; - - while (partialTime >= 1f) { - partialTime--; - charge--; - } - - updateQuickslot(); - - if (charge <= 0) { - detach(); - return false; - } else - return true; - - } - - public void setDelayedPress(int cell) { - if (!presses.contains(cell)) - presses.add(cell); - } - - public void triggerPresses() { - for (int cell : presses) - Dungeon.level.press(cell, null); - - presses = new ArrayList(); - } - - @Override - public boolean attachTo(Char target) { - if (Dungeon.level != null) - for (Mob mob : Dungeon.level.mobs.toArray(new Mob[0])) - mob.sprite.add(CharSprite.State.PARALYSED); - Group.freezeEmitters = true; - return super.attachTo(target); - } - - @Override - public void detach() { - triggerPresses(); - for (Mob mob : Dungeon.level.mobs.toArray(new Mob[0])) - mob.sprite.remove(CharSprite.State.PARALYSED); - Group.freezeEmitters = false; - - charge = 0; - updateQuickslot(); - super.detach(); - activeBuff = null; - } - - private static final String PRESSES = "presses"; - private static final String PARTIALTIME = "partialtime"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - - int[] values = new int[presses.size()]; - for (int i = 0; i < values.length; i++) - values[i] = presses.get(i); - bundle.put(PRESSES, values); - - bundle.put(PARTIALTIME, partialTime); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - - int[] values = bundle.getIntArray(PRESSES); - for (int value : values) - presses.add(value); - - partialTime = bundle.getFloat(PARTIALTIME); - } - } - - public static class sandBag extends Item { - - { - //name = "bag of magic sand"; - image = ItemSpriteSheet.SANDBAG; - } - - @Override - public boolean doPickUp(Hero hero) { - TimekeepersHourglass hourglass = hero.belongings - .getItem(TimekeepersHourglass.class); - if (hourglass != null && !hourglass.cursed) { - hourglass.upgrade(); - Sample.INSTANCE.play(Assets.SND_DEWDROP); - if (hourglass.level == hourglass.levelCap) - GLog.p(Messages.get(this, "maxlevel")); - else - GLog.i(Messages.get(this, "levelup")); - hero.spendAndNext(TIME_TO_PICK_UP); - return true; - } else { - GLog.w( Messages.get(this, "no_hourglass")); - return false; - } - } - - @Override - public int price() { - return 10; - } - } - -} diff --git a/java/com/hmdzl/spspd/change/items/artifacts/UnstableSpellbook.java b/java/com/hmdzl/spspd/change/items/artifacts/UnstableSpellbook.java deleted file mode 100644 index 531c3f4b..00000000 --- a/java/com/hmdzl/spspd/change/items/artifacts/UnstableSpellbook.java +++ /dev/null @@ -1,268 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * Shattered Pixel Dungeon - * Copyright (C) 2014-2015 Evan Debenham - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.artifacts; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.buffs.Blindness; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.particles.ElmoParticle; -import com.hmdzl.spspd.change.items.Generator; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.misc.SkillOfAtk; -import com.hmdzl.spspd.change.items.misc.SkillOfDef; -import com.hmdzl.spspd.change.items.misc.SkillOfMig; -import com.hmdzl.spspd.change.items.scrolls.Scroll; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfIdentify; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfMagicMapping; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfRemoveCurse; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfTeleportation; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.hmdzl.spspd.change.windows.WndBag; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -import java.util.ArrayList; -import java.util.Collections; - -/** - * Created by debenhame on 26/11/2014. - */ -public class UnstableSpellbook extends Artifact { - - { - image = ItemSpriteSheet.ARTIFACT_SPELLBOOK; - - levelCap = 10; - - charge = ((level/2)+2); - partialCharge = 0; - chargeCap = ((level/2)+2); - - defaultAction = AC_READ; - } - - public static final String AC_READ = "READ"; - public static final String AC_ADD = "ADD"; - public static final String AC_SONG = "SONG"; - public static int consumedpts = 0; - - private final ArrayList scrolls = new ArrayList<>(); - - protected WndBag.Mode mode = WndBag.Mode.SCROLL; - - /*public UnstableSpellbook() { - super(); - - Class[] scrollClasses = Generator.Category.SCROLL.classes; - float[] probs = Generator.Category.SCROLL.probs.clone(); //array of primitives, clone gives deep copy. - int i = Random.chances(probs); - - while (i != -1){ - scrolls.add(scrollClasses[i]); - probs[i] = 0; - - i = Random.chances(probs); - }; - }*/ - - @Override - public ArrayList actions( Hero hero ) { - ArrayList actions = super.actions( hero ); - if (isEquipped( hero ) && charge > 0 && !cursed) - actions.add(AC_READ); - if (isEquipped( hero ) && level< levelCap && !cursed) - actions.add(AC_ADD); - if (isEquipped(hero) && level > 3 && !cursed) - actions.add(AC_SONG); - return actions; - } - - @Override - public void execute( Hero hero, String action ) { - if (action.equals( AC_READ )) { - - if (hero.buff( Blindness.class ) != null) GLog.w( Messages.get(this, "blinded") ); - else if (!isEquipped( hero )) GLog.i( Messages.get(Artifact.class, "need_to_equip") ); - else if (charge == 0) GLog.i( Messages.get(this, "no_charge") ); - else if (cursed) GLog.i( Messages.get(this, "cursed") ); - else { - charge--; - - Scroll scroll; - do { - scroll = (Scroll) Generator.random(Generator.Category.SCROLL); - } while (scroll == null || - //gotta reduce the rate on these scrolls or that'll be all the item does. - ((scroll instanceof ScrollOfIdentify || - scroll instanceof ScrollOfRemoveCurse || - scroll instanceof ScrollOfMagicMapping) && Random.Int(2) == 0) - || (scroll instanceof ScrollOfTeleportation && Dungeon.bossLevel())); - - scroll.ownedByBook = true; - curItem = scroll; - curUser = hero; - if (Random.Int(20)> level) { - scroll.doRead(); - } else { - scroll.empoweredRead(); - } - updateQuickslot(); - } - - } else if (action.equals( AC_ADD )) { - GameScene.selectItem(itemSelector, mode, Messages.get(this, "prompt")); - } else if (action.equals( AC_SONG )) { - curUser = hero; - level-=4; - exp-=100; - switch (Random.Int(3)){ - case 0: - Dungeon.hero.hitSkill++; - GLog.w(Messages.get(SkillOfAtk.class, "skillup")); - break; - case 1: - Dungeon.hero.evadeSkill++; - GLog.w(Messages.get(SkillOfDef.class, "skillup")); - break; - case 2: - Dungeon.hero.magicSkill++; - GLog.w(Messages.get(SkillOfMig.class, "skillup")); - break; - } - curUser.spendAndNext(1f); - updateQuickslot(); - Sample.INSTANCE.play(Assets.SND_BURNING); - curUser.sprite.emitter().burst(ElmoParticle.FACTORY, 12); - } else - super.execute( hero, action ); - } - - @Override - protected ArtifactBuff passiveBuff() { - return new bookRecharge(); - } - - @Override - public Item upgrade() { - chargeCap = (((level+1)/2)+3); - return super.upgrade(); - } - - @Override - public String desc() { - String desc = super.desc(); - - if (cursed && isEquipped (Dungeon.hero)){ - desc += "\n\n" + Messages.get(this, "desc_cursed"); - } - - if (level < levelCap) { - desc += "\n\n" + Messages.get(this, "desc_index",consumedpts); - } - - return desc; - } - - private static final String SCROLLS = "scrolls"; - private static final String PARTIALCHARGE = "partialCharge"; - private static final String CHARGE = "charge"; - private static final String CONSUMED = "consumedpts"; - - @Override - public void storeInBundle( Bundle bundle ) { - super.storeInBundle(bundle); - bundle.put( SCROLLS, scrolls.toArray(new Class[scrolls.size()]) ); - bundle.put(PARTIALCHARGE, partialCharge); - bundle.put(CHARGE, charge); - bundle.put(CONSUMED, consumedpts); - } - - @Override - public void restoreFromBundle( Bundle bundle ) { - super.restoreFromBundle(bundle); - partialCharge = bundle.getInt(PARTIALCHARGE); - charge = bundle.getInt(CHARGE); - consumedpts = bundle.getInt(CONSUMED); - - } - - public class bookRecharge extends ArtifactBuff{ - @Override - public boolean act() { - if (charge < chargeCap && !cursed) { - partialCharge += 1 / (150f - (chargeCap - charge)*15f); - - if (partialCharge >= 1) { - partialCharge --; - charge ++; - - if (charge == chargeCap){ - partialCharge = 0; - } - } - } - - updateQuickslot(); - - spend( TICK ); - - return true; - } - } - - protected WndBag.Listener itemSelector = new WndBag.Listener() { - @Override - public void onSelect(Item item) { - if (item != null && item instanceof Scroll && item.isIdentified()) { - Hero hero = Dungeon.hero; - int scrollWorth = item.consumedValue; - consumedpts += scrollWorth; - - hero.sprite.operate(hero.pos); - hero.busy(); - hero.spend(2f); - Sample.INSTANCE.play(Assets.SND_BURNING); - hero.sprite.emitter().burst(ElmoParticle.FACTORY, 12); - - item.detach(hero.belongings.backpack); - GLog.h(Messages.get(UnstableSpellbook.class, "exp",consumedpts)); - - int levelChk = ((level*2)+1)*10; - - if (consumedpts > levelChk && level<10) { - upgrade(); - GLog.p(Messages.get(UnstableSpellbook.class, "infuse_scroll")); - } - - - } else if (item instanceof Scroll && !item.isIdentified()){ - GLog.w(Messages.get(UnstableSpellbook.class, "unknown_scroll")); - } else if (item != null){ - GLog.w(Messages.get(UnstableSpellbook.class, "unable_scroll")); - } - } - }; - } diff --git a/java/com/hmdzl/spspd/change/items/bags/Bag.java b/java/com/hmdzl/spspd/change/items/bags/Bag.java deleted file mode 100644 index 67f4d290..00000000 --- a/java/com/hmdzl/spspd/change/items/bags/Bag.java +++ /dev/null @@ -1,200 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.bags; - -import java.util.ArrayList; -import java.util.Iterator; - -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.windows.WndBag; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.utils.Bundlable; -import com.watabou.utils.Bundle; - -public class Bag extends Item implements Iterable { - - public static final String AC_OPEN = "OPEN"; - - { - image = 11; - unique = true; - defaultAction = AC_OPEN; - } - - public Char owner; - - public ArrayList items = new ArrayList(); - - public int size = 1; - - @Override - public void execute(Hero hero, String action) { - super.execute(hero, action); - - if (action.equals(AC_OPEN)) { - - GameScene.show(new WndBag(this, null, WndBag.Mode.ALL, null)); - - } - } - - @Override - public boolean collect(Bag container) { - - for (Item item : container.items.toArray( new Item[0] )) { - if (grab( item )) { - int slot = Dungeon.quickslot.getSlot(item); - item.detachAll(container); - if (!item.collect(this)) { - item.collect(container); - } - if (slot != -1) { - Dungeon.quickslot.setSlot(slot, item); - } - } - } - - if (super.collect(container)) { - - owner = container.owner; - - /*for (Item item : container.items.toArray(new Item[0])) { - if (grab(item)) { - item.detachAll(container); - item.collect(this); - } - }*/ - - Badges.validateAllBagsBought(this); - - return true; - } else { - return false; - } - } - - @Override - public void onDetach() { - this.owner = null; - for (Item item : items) - Dungeon.quickslot.clearItem(item); - updateQuickslot(); - } - - @Override - public boolean isUpgradable() { - return false; - } - - @Override - public boolean isIdentified() { - return true; - } - - public void clear() { - items.clear(); - } - - //private static final String ITEMS = Messages.get(Bag.class,"inventory"); - - private static final String ITEMS = "inventory"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(ITEMS, items); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - for (Bundlable item : bundle.getCollection(ITEMS)) { - if (item != null) - ((Item) item).collect(this); - } - ; - } - - public boolean contains(Item item) { - for (Item i : items) { - if (i == item) { - return true; - } else if (i instanceof Bag && ((Bag) i).contains(item)) { - return true; - } - } - return false; - } - - public boolean grab(Item item) { - return false; - } - - @Override - public Iterator iterator() { - return new ItemIterator(); - } - - private class ItemIterator implements Iterator { - - private int index = 0; - private Iterator nested = null; - - @Override - public boolean hasNext() { - if (nested != null) { - return nested.hasNext() || index < items.size(); - } else { - return index < items.size(); - } - } - - @Override - public Item next() { - if (nested != null && nested.hasNext()) { - - return nested.next(); - - } else { - - nested = null; - - Item item = items.get(index++); - if (item instanceof Bag) { - nested = ((Bag) item).iterator(); - } - - return item; - } - } - - @Override - public void remove() { - if (nested != null) { - nested.remove(); - } else { - items.remove(index); - } - } - } -} diff --git a/java/com/hmdzl/spspd/change/items/bags/HeartOfScarecrow.java b/java/com/hmdzl/spspd/change/items/bags/HeartOfScarecrow.java deleted file mode 100644 index 9e3fcdc0..00000000 --- a/java/com/hmdzl/spspd/change/items/bags/HeartOfScarecrow.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.bags; - - -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.armor.Armor; -import com.hmdzl.spspd.change.items.weapon.Weapon; -import com.hmdzl.spspd.change.items.weapon.melee.MeleeWeapon; -import com.hmdzl.spspd.change.items.weapon.melee.relic.RelicMeleeWeapon; -import com.hmdzl.spspd.change.items.weapon.missiles.MissileWeapon; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; - -public class HeartOfScarecrow extends Bag { - - { - //name = "HeartOfScarecrow"; - image = ItemSpriteSheet.H_O_SCARECROW; - - size = 25; - } - - - @Override - public boolean grab(Item item) { - if (item instanceof MeleeWeapon - ||item instanceof MissileWeapon - ||item instanceof RelicMeleeWeapon - || item instanceof Armor){ - return true; - } else { - return false; - } - } - - @Override - public int price() { - return 50 * quantity; - } - - @Override - public boolean doPickUp( Hero hero ) { - - return hero.belongings.getItem( HeartOfScarecrow.class ) == null && super.doPickUp( hero ) ; - - } - -} - diff --git a/java/com/hmdzl/spspd/change/items/bags/KeyRing.java b/java/com/hmdzl/spspd/change/items/bags/KeyRing.java deleted file mode 100644 index 6a3cb5c4..00000000 --- a/java/com/hmdzl/spspd/change/items/bags/KeyRing.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.bags; - -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.items.ChallengeBook; -import com.hmdzl.spspd.change.items.DolyaSlate; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.TenguKey; -import com.hmdzl.spspd.change.items.keys.Key; -import com.hmdzl.spspd.change.items.AncientCoin; -import com.hmdzl.spspd.change.items.ConchShell; -import com.hmdzl.spspd.change.items.Bone; -import com.hmdzl.spspd.change.items.TriForce; -import com.hmdzl.spspd.change.items.TreasureMap; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.items.rings.Ring; - -public class KeyRing extends Bag { - - { - //name = "key ring"; - image = ItemSpriteSheet.KEYRING; - - size = 25; - } - - @Override - public boolean grab(Item item) { - if (item instanceof Key - || item instanceof TenguKey - || item instanceof AncientCoin - || item instanceof ConchShell - || item instanceof Bone - || item instanceof TriForce - || item instanceof DolyaSlate - || item instanceof Ring - || item instanceof TreasureMap - || item instanceof ChallengeBook - ){ - return true; - } else { - return false; - } - } - - @Override - public int price() { - return 50 * quantity; - } - - @Override - public boolean doPickUp( Hero hero ) { - - return hero.belongings.getItem( KeyRing.class ) == null && super.doPickUp( hero ) ; - - } - -} - diff --git a/java/com/hmdzl/spspd/change/items/bags/PotionBandolier.java b/java/com/hmdzl/spspd/change/items/bags/PotionBandolier.java deleted file mode 100644 index efc26d36..00000000 --- a/java/com/hmdzl/spspd/change/items/bags/PotionBandolier.java +++ /dev/null @@ -1,46 +0,0 @@ -package com.hmdzl.spspd.change.items.bags; - -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.bombs.Bomb; -import com.hmdzl.spspd.change.items.medicine.Pill; -import com.hmdzl.spspd.change.items.potions.Potion; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; - -/** - * Created by debenhame on 05/02/2015. - */ -public class PotionBandolier extends Bag { - - { - //name = "potion bandolier"; - image = ItemSpriteSheet.BANDOLIER; - - size = 25; - } - - @Override - public boolean grab(Item item) { - if (item instanceof Potion || - item instanceof Pill || - item instanceof Bomb - ){ - return true; - } else { - return false; - } - } - - @Override - public int price() { - return 50 * quantity; - } - - @Override - public boolean doPickUp( Hero hero ) { - - return hero.belongings.getItem( PotionBandolier.class ) == null && super.doPickUp( hero ) ; - - } - -} diff --git a/java/com/hmdzl/spspd/change/items/bags/ScrollHolder.java b/java/com/hmdzl/spspd/change/items/bags/ScrollHolder.java deleted file mode 100644 index 5d8743f3..00000000 --- a/java/com/hmdzl/spspd/change/items/bags/ScrollHolder.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.bags; - -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.items.summon.ActiveMrDestructo; -import com.hmdzl.spspd.change.items.bombs.Bomb; - - -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.OrbOfZot; - - - -import com.hmdzl.spspd.change.items.challengelists.ChallengeList; -import com.hmdzl.spspd.change.items.journalpages.JournalPage; -import com.hmdzl.spspd.change.items.scrolls.Scroll; -import com.hmdzl.spspd.change.items.summon.CallCoconut; -import com.hmdzl.spspd.change.items.summon.FairyCard; -import com.hmdzl.spspd.change.items.summon.Mobile; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; - -public class ScrollHolder extends Bag { - - { - //name = "scroll holder"; - image = ItemSpriteSheet.HOLDER; - - size = 25; - } - - @Override - public boolean grab(Item item) { - if (item instanceof Scroll - || item instanceof ActiveMrDestructo - || item instanceof CallCoconut - || item instanceof Mobile - || item instanceof FairyCard - || item instanceof OrbOfZot - || item instanceof JournalPage - || item instanceof ChallengeList - ){ - return true; - } else { - return false; - } - } - - @Override - public int price() { - return 50 * quantity; - } - - @Override - public boolean doPickUp( Hero hero ) { - - return hero.belongings.getItem( ScrollHolder.class ) == null && super.doPickUp( hero ) ; - - } -} diff --git a/java/com/hmdzl/spspd/change/items/bags/SeedPouch.java b/java/com/hmdzl/spspd/change/items/bags/SeedPouch.java deleted file mode 100644 index 2728c58d..00000000 --- a/java/com/hmdzl/spspd/change/items/bags/SeedPouch.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.bags; - -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.items.Item; - -import com.hmdzl.spspd.change.items.StoneOre; -import com.hmdzl.spspd.change.items.nornstone.NornStone; -import com.hmdzl.spspd.change.items.weapon.spammo.SpAmmo; -import com.hmdzl.spspd.change.plants.Plant; -import com.hmdzl.spspd.change.items.TriforceOfCourage; -import com.hmdzl.spspd.change.items.TriforceOfPower; -import com.hmdzl.spspd.change.items.TriforceOfWisdom; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.messages.Messages; - -public class SeedPouch extends Bag { - - { - //name = "seed pouch"; - image = ItemSpriteSheet.POUCH; - - size = 25; - } - - @Override - public boolean grab(Item item) { - if (item instanceof Plant.Seed - || item instanceof StoneOre - || item instanceof NornStone){ - return true; - } else { - return false; - } - } - - @Override - public int price() { - - return 50 * quantity; - } - - @Override - public boolean doPickUp( Hero hero ) { - - return hero.belongings.getItem( SeedPouch.class ) == null && super.doPickUp( hero ) ; - - } -} diff --git a/java/com/hmdzl/spspd/change/items/bags/ShoppingCart.java b/java/com/hmdzl/spspd/change/items/bags/ShoppingCart.java deleted file mode 100644 index d03eeae3..00000000 --- a/java/com/hmdzl/spspd/change/items/bags/ShoppingCart.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.bags; - - -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.food.Food; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; - -public class ShoppingCart extends Bag { - - { - //name = "shopping cart"; - image = ItemSpriteSheet.SHOPCART; - - size = 25; - } - - - @Override - public boolean grab(Item item) { - return item instanceof Food ; - } - - @Override - public int price() { - return 50 * quantity; - } - - @Override - public boolean doPickUp( Hero hero ) { - - return hero.belongings.getItem( ShoppingCart.class ) == null && super.doPickUp( hero ) ; - - } - -} - diff --git a/java/com/hmdzl/spspd/change/items/bags/WandHolster.java b/java/com/hmdzl/spspd/change/items/bags/WandHolster.java deleted file mode 100644 index 06911da7..00000000 --- a/java/com/hmdzl/spspd/change/items/bags/WandHolster.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.bags; - -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.TriforceOfCourage; -import com.hmdzl.spspd.change.items.TriforceOfPower; -import com.hmdzl.spspd.change.items.TriforceOfWisdom; -import com.hmdzl.spspd.change.items.wands.Wand; -import com.hmdzl.spspd.change.items.weapon.guns.GunWeapon; -import com.hmdzl.spspd.change.items.weapon.spammo.SpAmmo; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.messages.Messages; - -public class WandHolster extends Bag { - - { - //name = "wand holster"; - image = ItemSpriteSheet.HOLSTER; - - size = 25; - } - - @Override - public boolean grab(Item item) { - if (item instanceof Wand - || item instanceof TriforceOfCourage - || item instanceof TriforceOfPower - || item instanceof TriforceOfWisdom - || item instanceof SpAmmo - || item instanceof GunWeapon){ - return true; - } else { - return false; - } - - } - - @Override - public boolean collect(Bag container) { - if (super.collect(container)) { - if (owner != null) { - for (Item item : items) { - if (item instanceof Wand){ - ((Wand) item).charge(owner); - } - } - } - return true; - } else { - return false; - } - } - - @Override - public void onDetach() { - super.onDetach(); - for (Item item : items) { - if (item instanceof Wand){ - ((Wand) item).stopCharging(); - } - } - } - - @Override - public int price() { - return 50 * quantity; - } - - @Override - public boolean doPickUp( Hero hero ) { - - return hero.belongings.getItem( WandHolster.class ) == null && super.doPickUp( hero ) ; - - } - -} diff --git a/java/com/hmdzl/spspd/change/items/bombs/Bomb.java b/java/com/hmdzl/spspd/change/items/bombs/Bomb.java deleted file mode 100644 index f54e0382..00000000 --- a/java/com/hmdzl/spspd/change/items/bombs/Bomb.java +++ /dev/null @@ -1,262 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.bombs; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.ResultDescriptions; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.hero.HeroClass; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.particles.BlastParticle; -import com.hmdzl.spspd.change.effects.particles.SmokeParticle; -import com.hmdzl.spspd.change.items.Heap; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.Terrain; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.hmdzl.spspd.change.sprites.ItemSprite; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; - -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundle; -import com.watabou.utils.PathFinder; -import com.watabou.utils.Random; - -public class Bomb extends Item { - - { - //name = "bomb"; - image = ItemSpriteSheet.BOMB; - - defaultAction = AC_LIGHTTHROW; - usesTargeting = true; - - stackable = true; - } - - public Fuse fuse; - - // FIXME using a static variable for this is kinda gross, should be a better - // way - private static boolean lightingFuse = false; - - private static final String AC_LIGHTTHROW = "LIGHTTHROW"; - - - @Override - public boolean isSimilar(Item item) { - return super.isSimilar(item) && this.fuse == ((Bomb) item).fuse; - } - - public boolean explodesDestructively(){ - return true; - } - - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions(hero); - actions.add(AC_LIGHTTHROW); - return actions; - } - - @Override - public void execute(Hero hero, String action) { - if (action.equals(AC_LIGHTTHROW)) { - lightingFuse = true; - action = AC_THROW; - } else { - lightingFuse = false; - } - - super.execute(hero, action); - } - - @Override - protected void onThrow( int cell ) { - if (!Dungeon.level.pit[ cell ] && lightingFuse) { - Actor.addDelayed(fuse = new Fuse().ignite(this), 2); - } - if (Actor.findChar( cell ) != null && !(Actor.findChar( cell ) instanceof Hero) ){ - ArrayList candidates = new ArrayList<>(); - //for (int i : PathFinder.NEIGHBOURS8) - //if (Dungeon.level.passable[cell + i]) - //candidates.add(cell + i); - //int newCell = candidates.isEmpty() ? cell : Random.element(candidates); - int newCell = cell; - Dungeon.level.drop( this, newCell ).sprite.drop( cell ); - } else - super.onThrow( cell ); - } - - @Override - public boolean doPickUp(Hero hero) { - if (fuse != null) { - GLog.w( Messages.get(this, "snuff_fuse")); - fuse = null; - } - return super.doPickUp(hero); - } - - public void explode(int cell) { - this.fuse = null; - - Sample.INSTANCE.play(Assets.SND_BLAST); - - if (Dungeon.visible[cell]) { - CellEmitter.center(cell).burst(BlastParticle.FACTORY, 30); - } - - // boolean terrainAffected = false; - // for (int n : Level.NEIGHBOURS9) { - // int c = cell + n; - // if (c >= 0 && c < Level.getLength()) { - // if (Dungeon.visible[c]) { - // CellEmitter.get(c).burst(SmokeParticle.FACTORY, 4); - // } - - // if (Level.flamable[c]) { - // Level.set(c, Terrain.EMBERS); - // GameScene.updateMap(c); - // terrainAffected = true; - // } - - // Heap heap = Dungeon.level.heaps.get(c); - // if (heap != null) heap.explode(); - - - // Char ch = Actor.findChar(c); - // if (ch != null) { - // those not at the center of the blast take damage less - // consistently. - // int minDamage = c == cell ? Dungeon.depth + 5 : 1; - // int maxDamage = 10 + Dungeon.depth * 2; - - // int dmg = Random.NormalIntRange(minDamage, maxDamage) - // - Math.max(ch.drRoll(),0); - //if (dmg > 0) { - // ch.damage(dmg, this); - // } - - // if (ch == Dungeon.hero && !ch.isAlive()) - // constant is used here in the rare instance a player - // is killed by a double bomb. - //Dungeon.fail(ResultDescriptions.ITEM); - //} - //} - //} - - //if (terrainAffected) { - //Dungeon.observe(); - // } - - } - - @Override - public boolean isUpgradable() { - return false; - } - - @Override - public boolean isIdentified() { - return true; - } - - @Override - public ItemSprite.Glowing glowing() { - return fuse != null ? new ItemSprite.Glowing(0xFF0000, 0.6f) : null; - } - - @Override - public int price() { - return 20 * quantity; - } - - @Override - public String info() { - if (fuse == null) - return super.desc(); - else - return Messages.get(this, "desc_burning"); - } - - private static final String FUSE = "fuse"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(FUSE, fuse); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - if (bundle.contains(FUSE)) - Actor.add(fuse = ((Fuse) bundle.get(FUSE)).ignite(this)); - } - - public static class Fuse extends Actor { - - private Bomb bomb; - - public Fuse ignite(Bomb bomb) { - this.bomb = bomb; - return this; - } - - @Override - protected boolean act() { - - // something caused our bomb to explode early, or be defused. Do - // nothing. - if (bomb.fuse != this) { - Actor.remove(this); - return true; - } - - // look for our bomb, remove it from its heap, and blow it up. - for (Heap heap : Dungeon.level.heaps.values()) { - if (heap.items.contains(bomb)) { - heap.items.remove(bomb); - - if (heap.items.isEmpty()){ - heap.destroy(); - } - - bomb.explode(heap.pos); - - Actor.remove(this); - return true; - } - } - - // can't find our bomb, this should never happen, throw an - // exception. - bomb.fuse = null; - Actor.remove( this ); - return true; - } - } -} diff --git a/java/com/hmdzl/spspd/change/items/bombs/BuildBomb.java b/java/com/hmdzl/spspd/change/items/bombs/BuildBomb.java deleted file mode 100644 index b87abd86..00000000 --- a/java/com/hmdzl/spspd/change/items/bombs/BuildBomb.java +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.bombs; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.hero.HeroClass; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.particles.BlastParticle; -import com.hmdzl.spspd.change.effects.particles.SmokeParticle; -import com.hmdzl.spspd.change.items.Heap; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.Terrain; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.hmdzl.spspd.change.sprites.ItemSprite; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; - -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -import static com.hmdzl.spspd.change.actors.hero.HeroClass.PERFORMER; - -public class BuildBomb extends Bomb { - - { - //name = "bomb"; - image = ItemSpriteSheet.BOMB; - } - - @Override - public void explode(int cell) { - super.explode(cell); - boolean terrainAffected = false; - for (int n : Level.NEIGHBOURS9) { - int c = cell + n; - if (c >= 0 && c < Level.getLength()) { - if (Dungeon.visible[c]) { - CellEmitter.get(c).burst(SmokeParticle.FACTORY, 4); - } - - if (Level.flamable[c]) { - Level.set(c, Terrain.EMBERS); - GameScene.updateMap(c); - terrainAffected = true; - } - - Char ch = Actor.findChar(c); - if (ch != null) { - // those not at the center of the blast take damage less - // consistently. - int minDamage = ch.HT/12; - int maxDamage = ch.HT/5; - - int dmg = Random.NormalIntRange(minDamage, maxDamage) - - Math.max(ch.drRoll(),0); - if (dmg > 0) { - ch.damage(dmg, this); - } - } - } - } - - if (terrainAffected) { - Dungeon.observe(); - } - - } - - @Override - public int price() { - return 10 * quantity; - } -} diff --git a/java/com/hmdzl/spspd/change/items/bombs/DangerousBomb.java b/java/com/hmdzl/spspd/change/items/bombs/DangerousBomb.java deleted file mode 100644 index 0c8aff9d..00000000 --- a/java/com/hmdzl/spspd/change/items/bombs/DangerousBomb.java +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.bombs; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.ResultDescriptions; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.particles.BlastParticle; -import com.hmdzl.spspd.change.effects.particles.SmokeParticle; -import com.hmdzl.spspd.change.items.Heap; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.Terrain; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.hmdzl.spspd.change.sprites.ItemSprite; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; - -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -public class DangerousBomb extends Bomb { - - { - //name = "cluster bomb"; - image = ItemSpriteSheet.HUGE_BOMB; - } - - @Override - public void explode(int cell) { - super.explode(cell); - boolean terrainAffected = false; - for (int n : Level.NEIGHBOURS9DIST2) { - int c = cell + n; - if (c >= 0 && c < Level.getLength()) { - if (Dungeon.visible[c]) { - CellEmitter.get(c).burst(SmokeParticle.FACTORY, 4); - } - - if (Level.flamable[c]) { - Level.set(c, Terrain.EMBERS); - GameScene.updateMap(c); - terrainAffected = true; - } - - if (Dungeon.level.map[c] == Terrain.WALL && Level.insideMap(c)){ - Level.set(c, Terrain.EMPTY); - GameScene.updateMap(c); - terrainAffected = true; - } - - // destroys items / triggers bombs caught in the blast. - Heap heap = Dungeon.level.heaps.get(c); - if (heap != null) - heap.explode(); - - Char ch = Actor.findChar(c); - if (ch != null) { - // those not at the center of the blast take damage less - // consistently. - if ( ch == Dungeon.hero){ - - int minDamage = ch.HT/8; - int maxDamage = ch.HT/4; - - int dmg = Random.NormalIntRange(minDamage, maxDamage) - - Math.max(ch.drRoll(),0); - if (dmg > 0) { - ch.damage(dmg, this); - } - if (ch == Dungeon.hero && !ch.isAlive()) - // constant is used here in the rare instance a player - // is killed by a double bomb. - Dungeon.fail(Messages.format(ResultDescriptions.ITEM)); - } - } - } - } - - if (terrainAffected) { - Dungeon.observe(); - } - - } - - @Override - public int price() { - return 20 * quantity; - } - -} diff --git a/java/com/hmdzl/spspd/change/items/bombs/DarkBomb.java b/java/com/hmdzl/spspd/change/items/bombs/DarkBomb.java deleted file mode 100644 index 514bba9d..00000000 --- a/java/com/hmdzl/spspd/change/items/bombs/DarkBomb.java +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.bombs; - -import java.util.ArrayList; - - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Terror; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.mobs.BlueWraith; -import com.hmdzl.spspd.change.actors.mobs.DwarfLich; -import com.hmdzl.spspd.change.actors.mobs.King; -import com.hmdzl.spspd.change.actors.mobs.King.Undead; -import com.hmdzl.spspd.change.actors.mobs.MossySkeleton; -import com.hmdzl.spspd.change.actors.mobs.RedWraith; -import com.hmdzl.spspd.change.actors.mobs.Skeleton; -import com.hmdzl.spspd.change.actors.mobs.Fiend; -import com.hmdzl.spspd.change.actors.mobs.Warlock; -import com.hmdzl.spspd.change.actors.mobs.Wraith; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.effects.particles.BlastParticle; -import com.hmdzl.spspd.change.effects.particles.SmokeParticle; -import com.hmdzl.spspd.change.items.Heap; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.sprites.ItemSprite; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -public class DarkBomb extends Bomb { - - { - //name = "seeking bomb"; - image = ItemSpriteSheet.DARK_BOMB; - } - - - @Override - public void explode(int cell) { - super.explode(cell); - curUser = Dungeon.hero; - for (int n: Level.NEIGHBOURS9) { - int c = cell + n; - if (c >= 0 && c < Level.getLength()) { - if (Dungeon.visible[c]) { - CellEmitter.get(c).burst(SmokeParticle.FACTORY, 4); - } - Char ch = Actor.findChar(c); - if (ch != null){ - Buff.affect(ch, Terror.class, Terror.DURATION).object = curUser.id(); - if (ch.properties().contains(Char.Property.HUMAN) - || ch.properties().contains(Char.Property.PLANT) - || ch.properties().contains(Char.Property.ORC) - || ch.properties().contains(Char.Property.TROLL) - || ch.properties().contains(Char.Property.DWARF) - || ch.properties().contains(Char.Property.BEAST) - || ch.properties().contains(Char.Property.ELF) - || ch.properties().contains(Char.Property.GOBLIN) - || ch.properties().contains(Char.Property.BOSS) - || ch.properties().contains(Char.Property.MINIBOSS) - ) { - int dmg = Random.NormalIntRange(200, 400); - ch.damage(dmg, this); - - } else { - int dmg = Random.NormalIntRange(50, 100); - ch.damage(dmg, this); - } - }} - } - - Dungeon.observe(); - } - - @Override - public int price() { - return 20 * quantity; - } -} diff --git a/java/com/hmdzl/spspd/change/items/bombs/DungeonBomb.java b/java/com/hmdzl/spspd/change/items/bombs/DungeonBomb.java deleted file mode 100644 index c34267d4..00000000 --- a/java/com/hmdzl/spspd/change/items/bombs/DungeonBomb.java +++ /dev/null @@ -1,153 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.bombs; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.hero.HeroClass; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.particles.BlastParticle; -import com.hmdzl.spspd.change.effects.particles.SmokeParticle; -import com.hmdzl.spspd.change.items.Heap; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.Terrain; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.hmdzl.spspd.change.sprites.ItemSprite; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; - -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -import static com.hmdzl.spspd.change.actors.hero.HeroClass.PERFORMER; - -public class DungeonBomb extends Bomb { - - { - //name = "bomb"; - image = ItemSpriteSheet.BOMB; - } - - @Override - public void explode(int cell) { - super.explode(cell); - - boolean terrainAffected = false; - for (int n : Level.NEIGHBOURS9) { - int c = cell + n; - if (c >= 0 && c < Level.getLength()) { - if (Dungeon.visible[c]) { - CellEmitter.get(c).burst(SmokeParticle.FACTORY, 4); - } - - if (Level.flamable[c]) { - Level.set(c, Terrain.EMBERS); - GameScene.updateMap(c); - terrainAffected = true; - } - - if (Dungeon.level.map[c] == Terrain.WALL && Level.insideMap(c)){ - Level.set(c, Terrain.EMPTY); - GameScene.updateMap(c); - terrainAffected = true; - } - - Char ch = Actor.findChar(c); - if (ch != null) { - // those not at the center of the blast take damage less - // consistently. - if (ch.properties().contains(Char.Property.BOSS) || ch.properties().contains(Char.Property.MINIBOSS)){ - int minDamage = ch.HT/10; - int maxDamage = ch.HT/5; - - int dmg = Random.NormalIntRange(minDamage, maxDamage) - - Math.max(ch.drRoll(),0); - if (dmg > 0) { - ch.damage(dmg, this); - } - - } else { - - - int minDamage = ch.HT/5; - int maxDamage = ch.HT/4; - - int dmg = Random.NormalIntRange(minDamage, maxDamage); - //- Math.max(ch.drRoll(),0); - if (dmg > 0) { - ch.damage(dmg, this); - } - } - } - } - } - - if (terrainAffected) { - Dungeon.observe(); - } - - } - - - @Override - public Item random() { - switch (Random.Int(2)) { - case 0: - default: - return this; - case 1: - return new DoubleBomb(); - } - } - - - @Override - public int price() { - return 10 * quantity; - } - - public static class DoubleBomb extends DungeonBomb { - - { - //name = "two bombs"; - image = ItemSpriteSheet.DBL_BOMB; - stackable = false; - } - - @Override - public boolean doPickUp(Hero hero) { - DungeonBomb bomb = new DungeonBomb(); - bomb.quantity(2); - if (bomb.doPickUp(hero)) { - // isaaaaac.... - hero.sprite.showStatus(CharSprite.NEUTRAL, "1+1 free!"); - return true; - } - return false; - } - } -} diff --git a/java/com/hmdzl/spspd/change/items/bombs/EarthBomb.java b/java/com/hmdzl/spspd/change/items/bombs/EarthBomb.java deleted file mode 100644 index d91b9be7..00000000 --- a/java/com/hmdzl/spspd/change/items/bombs/EarthBomb.java +++ /dev/null @@ -1,101 +0,0 @@ - -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.bombs; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.Blob; -import com.hmdzl.spspd.change.actors.blobs.Regrowth; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Drowsy; -import com.hmdzl.spspd.change.actors.buffs.Ooze; -import com.hmdzl.spspd.change.actors.buffs.Roots; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.mobs.BlueWraith; -import com.hmdzl.spspd.change.actors.mobs.DwarfLich; -import com.hmdzl.spspd.change.actors.mobs.FlyingProtector; -import com.hmdzl.spspd.change.actors.mobs.Golem; -import com.hmdzl.spspd.change.actors.mobs.RedWraith; -import com.hmdzl.spspd.change.actors.mobs.Sentinel; -import com.hmdzl.spspd.change.actors.mobs.ShadowYog; -import com.hmdzl.spspd.change.actors.mobs.Skeleton; -import com.hmdzl.spspd.change.actors.mobs.Fiend; -import com.hmdzl.spspd.change.actors.mobs.Statue; -import com.hmdzl.spspd.change.actors.mobs.Wraith; -import com.hmdzl.spspd.change.actors.mobs.Yog; -import com.hmdzl.spspd.change.actors.mobs.npcs.NPC; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.effects.particles.BlastParticle; -import com.hmdzl.spspd.change.effects.particles.SmokeParticle; -import com.hmdzl.spspd.change.items.Generator; -import com.hmdzl.spspd.change.items.Heap; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfTeleportation; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.Terrain; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.plants.Plant; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ItemSprite; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.BArray; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundle; -import com.watabou.utils.PathFinder; -import com.watabou.utils.Random; - -public class EarthBomb extends Bomb { - - { - image = ItemSpriteSheet.EARTH_BOMB; - } - - - @Override - public void explode(int cell) { - super.explode(cell); - ArrayList plantCandidates = new ArrayList<>(); - - PathFinder.buildDistanceMap( cell, BArray.not( Dungeon.level.solid, null ), 2 ); - for (int i = 0; i < PathFinder.distance.length; i++) { - if (PathFinder.distance[i] < Integer.MAX_VALUE) { - Char ch = Actor.findChar(i); - if (ch != null){ - Buff.prolong(ch, Roots.class,5f); - Buff.affect(ch, Ooze.class); - } - } - } - } - - - - - @Override - public int price() { - return 20 * quantity; - } - -} diff --git a/java/com/hmdzl/spspd/change/items/bombs/FireBomb.java b/java/com/hmdzl/spspd/change/items/bombs/FireBomb.java deleted file mode 100644 index c95cb7ae..00000000 --- a/java/com/hmdzl/spspd/change/items/bombs/FireBomb.java +++ /dev/null @@ -1,133 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.bombs; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.Blob; -import com.hmdzl.spspd.change.actors.blobs.Fire; -import com.hmdzl.spspd.change.actors.blobs.TarGas; -import com.hmdzl.spspd.change.items.Heap; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.particles.BlastParticle; -import com.hmdzl.spspd.change.effects.particles.SmokeParticle; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.Terrain; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ItemSprite; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; - -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -public class FireBomb extends Bomb { - - { - //name = "smart bomb"; - image = ItemSpriteSheet.FIRE_BOMB; - } - - @Override - public void explode(int cell) { - super.explode(cell); - boolean terrainAffected = false; - for (int n : Level.NEIGHBOURS9) { - int c = cell + n; - if (c >= 0 && c < Level.getLength()) { - if (Dungeon.visible[c]) { - CellEmitter.get(c).burst(SmokeParticle.FACTORY, 4); - } - - GameScene.add(Blob.seed(c,10, Fire.class)); - GameScene.add(Blob.seed(c,10, TarGas.class)); - - // destroys items / triggers bombs caught in the blast. - - Char ch = Actor.findChar(c); - if (ch != null) { - // those not at the center of the blast take damage less - // consistently. - int minDamage = ch.HT/12; - int maxDamage = ch.HT/7; - - int dmg = Random.NormalIntRange(minDamage, maxDamage) - - Math.max(ch.drRoll(),0); - if (dmg > 0) { - ch.damage(dmg, this); - - } - } - } - } - } - - - @Override - public boolean isUpgradable() { - return false; - } - - @Override - public boolean isIdentified() { - return true; - } - - - @Override - public ItemSprite.Glowing glowing() { - return fuse != null ? new ItemSprite.Glowing(0xFF0000, 0.6f) : null; - } - - @Override - public int price() { - return 20 * quantity; - } - - @Override - public String desc() { - if (fuse == null) - return super.desc(); - else - return Messages.get(this, "desc_burning"); - } - - private static final String FUSE = "fuse"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(FUSE, fuse); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - if (bundle.contains(FUSE)) - Actor.add(fuse = ((Fuse) bundle.get(FUSE)).ignite(this)); - } - -} diff --git a/java/com/hmdzl/spspd/change/items/bombs/FishingBomb.java b/java/com/hmdzl/spspd/change/items/bombs/FishingBomb.java deleted file mode 100644 index f6f769bd..00000000 --- a/java/com/hmdzl/spspd/change/items/bombs/FishingBomb.java +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.bombs; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.mobs.AlbinoPiranha; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.actors.mobs.npcs.NPC; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.particles.BlastParticle; -import com.hmdzl.spspd.change.effects.particles.SmokeParticle; -import com.hmdzl.spspd.change.items.Heap; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.sprites.ItemSprite; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -public class FishingBomb extends Bomb { - - { - //name = "Fishing bomb"; - image = ItemSpriteSheet.FISH_BOMB; - } - - @Override - public void explode(int cell) { - super.explode(cell); - - for (int n: Level.NEIGHBOURS9DIST2) { - int c = cell + n; - if (c >= 0 && c < Level.getLength()) { - if (Dungeon.visible[c]) { - CellEmitter.get(c).burst(SmokeParticle.FACTORY, 4); - } - - Char ch = Actor.findChar(c); - if (ch != null) { - if ( ch instanceof Mob && !(ch instanceof Hero || ch instanceof NPC) ) { - - int count = 20; - int pos; - do { - pos = Dungeon.level.randomRespawnCellFish(); - if (count-- <= 0) { - break; - } - } while (pos == -1); - - if (pos == -1) { - - GLog.w(Messages.get(this,"no_tp")); - - } else { - - ch.pos = pos; - ch.sprite.place(ch.pos); - ch.sprite.visible = Dungeon.visible[pos]; - GLog.i(Messages.get(this,"tp")); - - } - - } - } - }} - - } - - - @Override - public int price() { - return 20 * quantity; - } - - public FishingBomb() { - this(1); - } - - public FishingBomb(int value) { - this.quantity = value; - } -} diff --git a/java/com/hmdzl/spspd/change/items/bombs/HugeBomb.java b/java/com/hmdzl/spspd/change/items/bombs/HugeBomb.java deleted file mode 100644 index 5ed6f3c4..00000000 --- a/java/com/hmdzl/spspd/change/items/bombs/HugeBomb.java +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.bombs; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.particles.BlastParticle; -import com.hmdzl.spspd.change.effects.particles.SmokeParticle; -import com.hmdzl.spspd.change.items.Heap; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.Terrain; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.hmdzl.spspd.change.sprites.ItemSprite; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; - -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -public class HugeBomb extends Bomb { - - { - //name = "cluster bomb"; - image = ItemSpriteSheet.HUGE_BOMB; - } - - @Override - public void explode(int cell) { - super.explode(cell); - boolean terrainAffected = false; - for (int n : Level.NEIGHBOURS9DIST2) { - int c = cell + n; - if (c >= 0 && c < Level.getLength()) { - if (Dungeon.visible[c]) { - CellEmitter.get(c).burst(SmokeParticle.FACTORY, 4); - } - - if (Level.flamable[c]) { - Level.set(c, Terrain.EMBERS); - GameScene.updateMap(c); - terrainAffected = true; - } - - if (Dungeon.level.map[c] == Terrain.WALL && Level.insideMap(c)){ - Level.set(c, Terrain.EMPTY); - GameScene.updateMap(c); - terrainAffected = true; - } - - // destroys items / triggers bombs caught in the blast. - Heap heap = Dungeon.level.heaps.get(c); - if (heap != null) - heap.explode(); - - Char ch = Actor.findChar(c); - if (ch != null) { - // those not at the center of the blast take damage less - // consistently. - int minDamage = ch.HT/8; - int maxDamage = ch.HT/4; - - int dmg = Random.NormalIntRange(minDamage, maxDamage) - - Math.max(ch.drRoll(),0); - if (dmg > 0) { - ch.damage(dmg, this); - } - } - } - } - - if (terrainAffected) { - Dungeon.observe(); - } - - } - - @Override - public int price() { - return 20 * quantity; - } - -} diff --git a/java/com/hmdzl/spspd/change/items/bombs/IceBomb.java b/java/com/hmdzl/spspd/change/items/bombs/IceBomb.java deleted file mode 100644 index 397cc216..00000000 --- a/java/com/hmdzl/spspd/change/items/bombs/IceBomb.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.bombs; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.Blob; -import com.hmdzl.spspd.change.actors.blobs.ConfusionGas; -import com.hmdzl.spspd.change.actors.blobs.Freezing; -import com.hmdzl.spspd.change.actors.blobs.FrostGas; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Vertigo; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.mobs.npcs.NPC; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.particles.BlastParticle; -import com.hmdzl.spspd.change.effects.particles.SmokeParticle; -import com.hmdzl.spspd.change.items.Heap; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.Terrain; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ItemSprite; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.hmdzl.spspd.change.messages.Messages; - -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -public class IceBomb extends Bomb { - - { - //name = "dizzy bomb"; - image = ItemSpriteSheet.ICE_BOMB; - } - - @Override - public void explode(int cell) { - super.explode(cell); - for (int n : Level.NEIGHBOURS9) { - int c = cell + n; - if (c >= 0 && c < Level.getLength()) { - if (Dungeon.visible[c]) { - CellEmitter.get(c).burst(SmokeParticle.FACTORY, 4); - } - GameScene.add(Blob.seed(c, 10, FrostGas.class)); - - - Char ch = Actor.findChar(c); - if (ch != null) { - // those not at the center of the blast take damage less - // consistently. - int minDamage = ch.HT/20; - int maxDamage = ch.HT/10; - - int dmg = Random.NormalIntRange(minDamage, maxDamage) - - Math.max(ch.drRoll(),0); - if (dmg > 0) { - ch.damage(dmg, this); - - } - } - } - } - } - - @Override - public int price() { - return 20 * quantity; - } -} diff --git a/java/com/hmdzl/spspd/change/items/bombs/LightBomb.java b/java/com/hmdzl/spspd/change/items/bombs/LightBomb.java deleted file mode 100644 index 6a5a1411..00000000 --- a/java/com/hmdzl/spspd/change/items/bombs/LightBomb.java +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.bombs; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Blindness; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Terror; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.mobs.BlueWraith; -import com.hmdzl.spspd.change.actors.mobs.DwarfLich; -import com.hmdzl.spspd.change.actors.mobs.King; -import com.hmdzl.spspd.change.actors.mobs.King.Undead; -import com.hmdzl.spspd.change.actors.mobs.MossySkeleton; -import com.hmdzl.spspd.change.actors.mobs.RedWraith; -import com.hmdzl.spspd.change.actors.mobs.Skeleton; -import com.hmdzl.spspd.change.actors.mobs.Fiend; -import com.hmdzl.spspd.change.actors.mobs.Warlock; -import com.hmdzl.spspd.change.actors.mobs.Wraith; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.effects.particles.BlastParticle; -import com.hmdzl.spspd.change.effects.particles.SmokeParticle; -import com.hmdzl.spspd.change.items.Heap; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.sprites.ItemSprite; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -public class LightBomb extends Bomb { - - { - //name = "holy hand grenade"; - image = ItemSpriteSheet.LIGHT_BOMB; - } - - @Override - public void explode(int cell) { - super.explode(cell); - for (int n: Level.NEIGHBOURS9) { - int c = cell + n; - if (c >= 0 && c < Level.getLength()) { - if (Dungeon.visible[c]) { - CellEmitter.get(c).burst(SmokeParticle.FACTORY, 4); - } - - Char ch = Actor.findChar(c); - if (ch != null){ - Buff.affect(ch, Blindness.class,10f ); - if ( ch.properties().contains(Char.Property.UNDEAD) - || ch.properties().contains(Char.Property.UNKNOW) - || ch.properties().contains(Char.Property.MECH) - || ch.properties().contains(Char.Property.ELEMENT) - || ch.properties().contains(Char.Property.DEMONIC) - || ch.properties().contains(Char.Property.DRAGON) - || ch.properties().contains(Char.Property.BOSS) - || ch.properties().contains(Char.Property.MINIBOSS) - ) { - int dmg = Random.NormalIntRange(200, 400); - ch.damage(dmg, this); - } else { - int dmg = Random.NormalIntRange(50, 100); - ch.damage(dmg, this); - } - } - }} - - Dungeon.observe(); - } - - @Override - public int price() { - return 20 * quantity; - } - - public LightBomb() { - this(1); - } - - public LightBomb(int value) { - this.quantity = value; - } - -} diff --git a/java/com/hmdzl/spspd/change/items/bombs/MiniBomb.java b/java/com/hmdzl/spspd/change/items/bombs/MiniBomb.java deleted file mode 100644 index 652250a9..00000000 --- a/java/com/hmdzl/spspd/change/items/bombs/MiniBomb.java +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.bombs; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.particles.BlastParticle; -import com.hmdzl.spspd.change.effects.particles.SmokeParticle; -import com.hmdzl.spspd.change.items.Heap; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.Terrain; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.hmdzl.spspd.change.sprites.ItemSprite; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; - -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -public class MiniBomb extends Bomb { - - { - //name = "mini bomb"; - image = ItemSpriteSheet.MINI_BOMB; - } - - - @Override - public void explode(int cell) { - super.explode(cell); - boolean terrainAffected = false;{ - int c = cell; - - if (Dungeon.visible[c]) { - CellEmitter.get(c).burst(SmokeParticle.FACTORY, 4); - } - - if (Level.flamable[c]) { - Level.set(c, Terrain.EMBERS); - GameScene.updateMap(c); - terrainAffected = true; - } - - Char ch = Actor.findChar(c); - if (ch != null) { - // those not at the center of the blast take damage less - // consistently. - int minDamage = ch.HT/15; - int maxDamage = ch.HT/6; - - int dmg = Random.NormalIntRange(minDamage, maxDamage) - Math.max(ch.drRoll(),0); - if (dmg > 0) { - ch.damage(dmg, this); - } - } - - } - - if (terrainAffected) { - Dungeon.observe(); - } - - } - - @Override - public int price() { - return 10 * quantity; - } - -} diff --git a/java/com/hmdzl/spspd/change/items/bombs/StormBomb.java b/java/com/hmdzl/spspd/change/items/bombs/StormBomb.java deleted file mode 100644 index b1aaf0bf..00000000 --- a/java/com/hmdzl/spspd/change/items/bombs/StormBomb.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.bombs; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.blobs.Blob; -import com.hmdzl.spspd.change.actors.blobs.ElectriShock; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.particles.BlastParticle; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.traps.LightningTrap; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.BArray; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.PathFinder; -import com.watabou.utils.Random; - -public class StormBomb extends Bomb { - - { - image = ItemSpriteSheet.STORM_BOMB; - - } - - - @Override - public void explode(int cell) { - super.explode(cell); - PathFinder.buildDistanceMap( cell, BArray.not( Dungeon.level.solid, null ), 2 ); - for (int i = 0; i < PathFinder.distance.length; i++) { - if (PathFinder.distance[i] < Integer.MAX_VALUE) { - GameScene.add(Blob.seed(i, 20, ElectriShock.class)); - } - } - Sample.INSTANCE.play(Assets.SND_LIGHTNING); - } - - @Override - public int price() { - return 20 * quantity; - } - -} diff --git a/java/com/hmdzl/spspd/change/items/challengelists/CaveChallenge.java b/java/com/hmdzl/spspd/change/items/challengelists/CaveChallenge.java deleted file mode 100644 index e24fb0f5..00000000 --- a/java/com/hmdzl/spspd/change/items/challengelists/CaveChallenge.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.challengelists; - -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; - -public class CaveChallenge extends ChallengeList { - - { - //name = "journal page sokoban practice"; - image = ItemSpriteSheet.CAVEKEY; - room=3; - - stackable = false; - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/items/challengelists/ChallengeList.java b/java/com/hmdzl/spspd/change/items/challengelists/ChallengeList.java deleted file mode 100644 index 8dcb082a..00000000 --- a/java/com/hmdzl/spspd/change/items/challengelists/ChallengeList.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.challengelists; - -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; - -public class ChallengeList extends Item { - - private static final String TXT_VALUE = "Journal Page"; - public int room; - - { - //name = "Challenge list"; - image = ItemSpriteSheet.JOURNAL_PAGE; - - stackable = false; - unique = true; - } - - @Override - public boolean isUpgradable() { - return false; - } - - @Override - public boolean isIdentified() { - return true; - } - -} diff --git a/java/com/hmdzl/spspd/change/items/challengelists/CityChallenge.java b/java/com/hmdzl/spspd/change/items/challengelists/CityChallenge.java deleted file mode 100644 index 3313a0ca..00000000 --- a/java/com/hmdzl/spspd/change/items/challengelists/CityChallenge.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.challengelists; - -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; - -public class CityChallenge extends ChallengeList { - - { - //name = "journal page sokoban practice"; - image = ItemSpriteSheet.CITYKEY; - room=4; - - stackable = false; - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/items/challengelists/CourageChallenge.java b/java/com/hmdzl/spspd/change/items/challengelists/CourageChallenge.java deleted file mode 100644 index dd2c1d0a..00000000 --- a/java/com/hmdzl/spspd/change/items/challengelists/CourageChallenge.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.challengelists; - -import com.hmdzl.spspd.change.Statistics; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; - -public class CourageChallenge extends ChallengeList { - - { - //name = "journal page sokoban practice"; - image = ItemSpriteSheet.COURAGETRIAL; - room=5; - - stackable = false; - } - - @Override - public int price() { - if (Statistics.deepestFloor < 26){return 9000 * quantity;} - else {return 300*quantity;} - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/items/challengelists/PowerChallenge.java b/java/com/hmdzl/spspd/change/items/challengelists/PowerChallenge.java deleted file mode 100644 index f282e421..00000000 --- a/java/com/hmdzl/spspd/change/items/challengelists/PowerChallenge.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.challengelists; - -import com.hmdzl.spspd.change.Statistics; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; - -public class PowerChallenge extends ChallengeList { - - { - //name = "journal page sokoban practice"; - image = ItemSpriteSheet.POWERTRIAL; - room=6; - - stackable = false; - } - - @Override - public int price() { - if (Statistics.deepestFloor < 26){return 9000 * quantity;} - else {return 500*quantity;} - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/items/challengelists/PrisonChallenge.java b/java/com/hmdzl/spspd/change/items/challengelists/PrisonChallenge.java deleted file mode 100644 index b925e58b..00000000 --- a/java/com/hmdzl/spspd/change/items/challengelists/PrisonChallenge.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.challengelists; - -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; - -public class PrisonChallenge extends ChallengeList { - - { - //name = "journal page sokoban practice"; - image = ItemSpriteSheet.PRISONKEY; - room=2; - - stackable = false; - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/items/challengelists/SewerChallenge.java b/java/com/hmdzl/spspd/change/items/challengelists/SewerChallenge.java deleted file mode 100644 index 35c79e79..00000000 --- a/java/com/hmdzl/spspd/change/items/challengelists/SewerChallenge.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.challengelists; - -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; - -public class SewerChallenge extends ChallengeList { - - { - //name = "journal page sokoban practice"; - image = ItemSpriteSheet.SEWERSKEY; - room=1; - - stackable = false; - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/items/challengelists/WisdomChallenge.java b/java/com/hmdzl/spspd/change/items/challengelists/WisdomChallenge.java deleted file mode 100644 index c2173719..00000000 --- a/java/com/hmdzl/spspd/change/items/challengelists/WisdomChallenge.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.challengelists; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.Statistics; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; - -public class WisdomChallenge extends ChallengeList { - - { - //name = "journal page sokoban practice"; - image = ItemSpriteSheet.WISDOMTRIAL; - room=7; - - stackable = false; - } - - @Override - public int price() { - if (Statistics.deepestFloor < 26){return 9000 * quantity;} - else {return 600*quantity;} - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/items/eggs/BlueDragonEgg.java b/java/com/hmdzl/spspd/change/items/eggs/BlueDragonEgg.java deleted file mode 100644 index 3ff1092c..00000000 --- a/java/com/hmdzl/spspd/change/items/eggs/BlueDragonEgg.java +++ /dev/null @@ -1,141 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.eggs; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.mobs.pets.BlueDragon; -import com.hmdzl.spspd.change.actors.mobs.pets.Bunny; - -import com.hmdzl.spspd.change.actors.mobs.pets.GreenDragon; -import com.hmdzl.spspd.change.actors.mobs.pets.LeryFire; -import com.hmdzl.spspd.change.actors.mobs.pets.PET; -import com.hmdzl.spspd.change.actors.mobs.pets.RedDragon; -import com.hmdzl.spspd.change.actors.mobs.pets.Scorpion; -import com.hmdzl.spspd.change.actors.mobs.pets.ShadowDragon; -import com.hmdzl.spspd.change.actors.mobs.pets.Spider; - -import com.hmdzl.spspd.change.actors.mobs.pets.Velocirooster; -import com.hmdzl.spspd.change.actors.mobs.pets.VioletDragon; -import com.hmdzl.spspd.change.effects.Pushing; -import com.hmdzl.spspd.change.effects.particles.SparkParticle; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.traps.LightningTrap; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.tweeners.AlphaTweener; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -public class BlueDragonEgg extends Egg { - - public static final float TIME_TO_USE = 1; - - public static final int LERY_FIRE = 10; - - - { - //name = "shadow dragon egg"; - image = ItemSpriteSheet.BLUE_DRAGONEGG; - unique = true; - stackable = false; - } - - public int startMoves = 0; - public int moves = 0; - public int burns = 0; - public int freezes = 20; - public int poisons = 0; - public int lits = 0; - public int summons = 0; - public int light = 0; - - @Override - public void execute(Hero hero, String action) { - if (action.equals(AC_BREAK)) { - - BlueDragon pet = new BlueDragon(); - eggHatch(pet); - - hero.next(); - - } - - else if (action.equals(AC_SHAKE)) { - - GLog.w(Messages.get(Egg.class,"kick")); - - } else { - - super.execute(hero, action); - - } - - } - - public void eggHatch (PET pet) { - - int spawnPos = getSpawnPos(); - if (spawnPos != -1 && !Dungeon.hero.haspet) { - - pet.spawn(1); - pet.HP = pet.HT; - pet.pos = spawnPos; - pet.state = pet.HUNTING; - - GameScene.add(pet); - Actor.addDelayed(new Pushing(pet, Dungeon.hero.pos, spawnPos), -1f); - - pet.sprite.alpha(0); - pet.sprite.parent.add(new AlphaTweener(pet.sprite, 1, 0.15f)); - - detach(Dungeon.hero.belongings.backpack); - GLog.w(Messages.get(Egg.class,"hatch")); - Dungeon.hero.haspet=true; - - assignPet(pet); - - } else { - - Dungeon.hero.spend(LeryFireEgg.TIME_TO_USE); - GLog.w(Messages.get(Egg.class,"notready")); - - } - } - - private void assignPet(PET pet){ - - Dungeon.hero.petType=pet.type; - Dungeon.hero.petLevel=pet.level; - - Dungeon.hero.petHP=pet.HP; - Dungeon.hero.petExperience=pet.experience; - Dungeon.hero.petCooldown=pet.cooldown; - } - - @Override - public int price() { - return 500 * quantity; - } - -} diff --git a/java/com/hmdzl/spspd/change/items/eggs/CocoCatEgg.java b/java/com/hmdzl/spspd/change/items/eggs/CocoCatEgg.java deleted file mode 100644 index 8df449c7..00000000 --- a/java/com/hmdzl/spspd/change/items/eggs/CocoCatEgg.java +++ /dev/null @@ -1,150 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.eggs; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.mobs.pets.BlueDragon; -import com.hmdzl.spspd.change.actors.mobs.pets.Bunny; -import com.hmdzl.spspd.change.actors.mobs.pets.CocoCat; -import com.hmdzl.spspd.change.actors.mobs.pets.GreenDragon; -import com.hmdzl.spspd.change.actors.mobs.pets.PET; -import com.hmdzl.spspd.change.actors.mobs.pets.RedDragon; -import com.hmdzl.spspd.change.actors.mobs.pets.Scorpion; -import com.hmdzl.spspd.change.actors.mobs.pets.ShadowDragon; -import com.hmdzl.spspd.change.actors.mobs.pets.Spider; - -import com.hmdzl.spspd.change.actors.mobs.pets.Velocirooster; -import com.hmdzl.spspd.change.actors.mobs.pets.VioletDragon; -import com.hmdzl.spspd.change.effects.Pushing; -import com.hmdzl.spspd.change.effects.particles.SparkParticle; -import com.hmdzl.spspd.change.items.eggs.Egg; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.traps.LightningTrap; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.tweeners.AlphaTweener; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -public class CocoCatEgg extends Egg { - - public static final float TIME_TO_USE = 1; - - { - image = ItemSpriteSheet.RANDOWNEGG; - unique = true; - stackable = false; - } - - @Override - public void execute(Hero hero, String action) { - - if (action.equals(AC_BREAK)) { - - CocoCat pet = new CocoCat(); - eggHatch(pet); - - hero.next(); - - } - - else if (action.equals(AC_SHAKE)) { - - GLog.w(Messages.get(Egg.class,"kick")); - - } else { - - super.execute(hero, action); - - } - - - - } - - public int getSpawnPos(){ - int newPos = -1; - int pos = Dungeon.hero.pos; - ArrayList candidates = new ArrayList(); - boolean[] passable = Level.passable; - - for (int n : Level.NEIGHBOURS8) { - int c = pos + n; - if (passable[c] && Actor.findChar(c) == null) { - candidates.add(c); - } - } - - newPos = candidates.size() > 0 ? Random.element(candidates) : -1; - - return newPos; - } - - - public void eggHatch (PET pet) { - - int spawnPos = getSpawnPos(); - if (spawnPos != -1 && !Dungeon.hero.haspet) { - - pet.spawn(1); - pet.HP = pet.HT; - pet.pos = spawnPos; - pet.state = pet.HUNTING; - - GameScene.add(pet); - Actor.addDelayed(new Pushing(pet, Dungeon.hero.pos, spawnPos), -1f); - - pet.sprite.alpha(0); - pet.sprite.parent.add(new AlphaTweener(pet.sprite, 1, 0.15f)); - - detach(Dungeon.hero.belongings.backpack); - GLog.w(Messages.get(Egg.class,"hatch")); - Dungeon.hero.haspet=true; - - assignPet(pet); - - } else { - - Dungeon.hero.spend(CocoCatEgg.TIME_TO_USE); - GLog.w(Messages.get(Egg.class,"notready")); - - } - } - - private void assignPet(PET pet){ - - Dungeon.hero.petType=pet.type; - Dungeon.hero.petLevel=pet.level; - - Dungeon.hero.petHP=pet.HP; - Dungeon.hero.petExperience=pet.experience; - Dungeon.hero.petCooldown=pet.cooldown; - } - - @Override - public int price() { - return 500 * quantity; - } - -} diff --git a/java/com/hmdzl/spspd/change/items/eggs/EasterEgg.java b/java/com/hmdzl/spspd/change/items/eggs/EasterEgg.java deleted file mode 100644 index c560885a..00000000 --- a/java/com/hmdzl/spspd/change/items/eggs/EasterEgg.java +++ /dev/null @@ -1,152 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.eggs; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.mobs.pets.BlueDragon; -import com.hmdzl.spspd.change.actors.mobs.pets.Bunny; - -import com.hmdzl.spspd.change.actors.mobs.pets.GreenDragon; -import com.hmdzl.spspd.change.actors.mobs.pets.PET; -import com.hmdzl.spspd.change.actors.mobs.pets.RedDragon; -import com.hmdzl.spspd.change.actors.mobs.pets.Scorpion; -import com.hmdzl.spspd.change.actors.mobs.pets.Spider; - -import com.hmdzl.spspd.change.actors.mobs.pets.Velocirooster; -import com.hmdzl.spspd.change.actors.mobs.pets.VioletDragon; -import com.hmdzl.spspd.change.effects.Pushing; -import com.hmdzl.spspd.change.effects.particles.SparkParticle; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.traps.LightningTrap; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.tweeners.AlphaTweener; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -public class EasterEgg extends Egg { - - public static final float TIME_TO_USE = 1; - - public static final int BUNNY = 10; - - - { - //name = "egg"; - image = ItemSpriteSheet.RABBITEGG; - unique = true; - stackable = false; - } - - @Override - public void execute(Hero hero, String action) { - - if (action.equals(AC_BREAK)) { - - Bunny pet = new Bunny(); - eggHatch(pet); - - hero.next(); - - } - - else if (action.equals(AC_SHAKE)) { - - GLog.w(Messages.get(Egg.class,"kick")); - - - } else { - - super.execute(hero, action); - - } - - - - } - - /*public int getSpawnPos(){ - int newPos = -1; - int pos = Dungeon.hero.pos; - ArrayList candidates = new ArrayList(); - boolean[] passable = Level.passable; - - for (int n : Level.NEIGHBOURS8) { - int c = pos + n; - if (passable[c] && Actor.findChar(c) == null) { - candidates.add(c); - } - } - - newPos = candidates.size() > 0 ? Random.element(candidates) : -1; - - return newPos; - }*/ - - - public void eggHatch (PET pet) { - - int spawnPos = getSpawnPos(); - if (spawnPos != -1 && !Dungeon.hero.haspet) { - - pet.spawn(1); - pet.HP = pet.HT; - pet.pos = spawnPos; - pet.state = pet.HUNTING; - - GameScene.add(pet); - Actor.addDelayed(new Pushing(pet, Dungeon.hero.pos, spawnPos), -1f); - - pet.sprite.alpha(0); - pet.sprite.parent.add(new AlphaTweener(pet.sprite, 1, 0.15f)); - - detach(Dungeon.hero.belongings.backpack); - GLog.w(Messages.get(Egg.class,"hatch")); - Dungeon.hero.haspet=true; - assignPet(pet); - - } else { - - Dungeon.hero.spend(EasterEgg.TIME_TO_USE); - GLog.w(Messages.get(Egg.class,"notready")); - - } - } - - private void assignPet(PET pet){ - - Dungeon.hero.petType=pet.type; - Dungeon.hero.petLevel=pet.level; - - Dungeon.hero.petHP=pet.HP; - Dungeon.hero.petExperience=pet.experience; - Dungeon.hero.petCooldown=pet.cooldown; - } - - @Override - public int price() { - return 500 * quantity; - } - -} diff --git a/java/com/hmdzl/spspd/change/items/eggs/Egg.java b/java/com/hmdzl/spspd/change/items/eggs/Egg.java deleted file mode 100644 index ff3ddac6..00000000 --- a/java/com/hmdzl/spspd/change/items/eggs/Egg.java +++ /dev/null @@ -1,403 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.eggs; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.Statistics; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.mobs.GoldThief; -import com.hmdzl.spspd.change.actors.mobs.pets.BlueDragon; -import com.hmdzl.spspd.change.actors.mobs.pets.BugDragon; -import com.hmdzl.spspd.change.actors.mobs.pets.GoldDragon; -import com.hmdzl.spspd.change.actors.mobs.pets.GreenDragon; -import com.hmdzl.spspd.change.actors.mobs.pets.LeryFire; -import com.hmdzl.spspd.change.actors.mobs.pets.LightDragon; -import com.hmdzl.spspd.change.actors.mobs.pets.PET; -import com.hmdzl.spspd.change.actors.mobs.pets.RedDragon; -import com.hmdzl.spspd.change.actors.mobs.pets.Scorpion; -import com.hmdzl.spspd.change.actors.mobs.pets.ShadowDragon; -import com.hmdzl.spspd.change.actors.mobs.pets.Spider; - -import com.hmdzl.spspd.change.actors.mobs.pets.Velocirooster; -import com.hmdzl.spspd.change.actors.mobs.pets.VioletDragon; -import com.hmdzl.spspd.change.effects.Pushing; -import com.hmdzl.spspd.change.effects.particles.SparkParticle; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.traps.LightningTrap; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.tweeners.AlphaTweener; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -public class Egg extends Item { - - private static final String TXT_PREVENTING = "This is not the best place to try that."; - private static final String TXT_NOTREADY = "Something tells you it's not ready yet."; - private static final String TXT_YOLK = "Ewww. Gross, uncooked egg of a random creature."; - private static final String TXT_HATCH = "Something hatches!"; - private static final String TXT_SCRATCH = "Something scratches back!"; - private static final String TXT_SLITHERS = "Something squirms inside!"; - private static final String TXT_KICKS = "Something powerful kicks back!"; - private static final String TXT_SLOSH = "Just some sloshing around."; - private static final String TXT_ZAP = "Ouch! Something zaps you back!."; - - public static final float TIME_TO_USE = 1; - - public static final String AC_BREAK = "BREAK"; - public static final String AC_SHAKE = "SHAKE"; - - public static final int RED_DRAGON = 20; - public static final int GREEN_DRAGON = 20; - public static final int BLUE_DRAGON = Dungeon.getMonth()==11 ? 10 : 20; - public static final int VIOLET_DRAGON = 20; - public static final int SPIDER = 1000; - public static final int SCORPION = 2000; - public static final int VELOCIROOSTER = 5; - public static final int LIGHT_DRAGON = 20; - public static final int SHADOW_DRAGON = 20; - - - { - //name = "egg"; - image = ItemSpriteSheet.EGG; - unique = true; - stackable = false; - } - - public int startMoves = 0; - public int moves = 0; - public int burns = 0; - public int freezes = 0; - public int poisons = 0; - public int lits = 0; - public int summons = 0; - public int light = 0; - - private static final String STARTMOVES = "startMoves"; - private static final String MOVES = "moves"; - private static final String BURNS = "burns"; - private static final String FREEZES = "freezes"; - private static final String POISONS = "poisons"; - private static final String LITS = "lits"; - private static final String SUMMONS = "summons"; - private static final String LIGHT = "light"; - - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(STARTMOVES, startMoves); - bundle.put(MOVES, moves); - bundle.put(BURNS, burns); - bundle.put(FREEZES, freezes); - bundle.put(POISONS, poisons); - bundle.put(LITS, lits); - bundle.put(SUMMONS, summons); - bundle.put(LIGHT, light); - - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - startMoves = bundle.getInt(STARTMOVES); - moves = bundle.getInt(MOVES); - burns = bundle.getInt(BURNS); - freezes = bundle.getInt(FREEZES); - poisons = bundle.getInt(POISONS); - lits = bundle.getInt(LITS); - summons = bundle.getInt(SUMMONS); - light = bundle.getInt(LIGHT); - - } - - public int checkMoves () { - return moves; - } - public int checkBurns () { - return burns; - } - public int checkFreezes () { - return freezes; - } - public int checkPoisons () { - return poisons; - } - public int checkLits () { - return lits; - } - public int checkSummons () { - return summons; - } - - public int checkLight () { - return light; - } - - @Override - public boolean doPickUp(Hero hero) { - - GLog.w(Messages.get(Egg.class,"warmhome")); - - Egg egg = hero.belongings.getItem(Egg.class); - if (egg!=null){ - GLog.w(Messages.get(Egg.class,"onlyone")); - } - - return super.doPickUp(hero); - } - - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions(hero); - if (Dungeon.hero.haspet == false & Dungeon.depth < 26) actions.add(AC_BREAK); - actions.add(AC_SHAKE); - - return actions; - } - - @Override - public void execute(Hero hero, String action) { - - if (action.equals(AC_BREAK)) { - - boolean hatch = false; - if (checkFreezes()>=BLUE_DRAGON && checkPoisons()>=VIOLET_DRAGON && checkBurns()>=RED_DRAGON && checkLits()>=GREEN_DRAGON - && checkLight()>=SHADOW_DRAGON && checkSummons()>=LIGHT_DRAGON && checkMoves()>=SCORPION){ - if (Dungeon.getMonth()==9 || Random.Int(50) == 0){ - BugDragon pet = new BugDragon(); - eggHatch(pet); - hatch=true; - } else { - GoldDragon pet = new GoldDragon(); - eggHatch(pet); - hatch=true; - } - } else if (checkLight()>= 20 ){ - ShadowDragon pet = new ShadowDragon(); - eggHatch(pet); - hatch=true; - //spawn ShadowDragon - - } else if (checkFreezes()>=5 && checkPoisons()>=5 && checkBurns()>=5 && checkLits()>=5 && checkMoves()>=50){ - LeryFire pet = new LeryFire(); - eggHatch(pet); - hatch=true; - //spawn leryfire - } else if (checkFreezes()>=BLUE_DRAGON) { - BlueDragon pet = new BlueDragon(); - eggHatch(pet); - hatch=true; - //spawn ice dragon - } else if (checkSummons()>=LIGHT_DRAGON) { - LightDragon pet = new LightDragon(); - eggHatch(pet); - hatch=true; - } else if (checkPoisons()>=VIOLET_DRAGON) { - VioletDragon pet = new VioletDragon(); - eggHatch(pet); - hatch=true; - //spawn green dragon - } else if (checkLits()>=GREEN_DRAGON) { - GreenDragon pet = new GreenDragon(); - eggHatch(pet); - hatch=true; - //spawn lit dragon - } else if (checkBurns()>=RED_DRAGON) { - RedDragon pet = new RedDragon(); - eggHatch(pet); - hatch=true; - //spawn red dragon - } else if (checkBurns()>=VELOCIROOSTER) { - Velocirooster pet = new Velocirooster(); - eggHatch(pet); - hatch=true; - //spawn velocirooster - } else if (checkMoves()>=SCORPION) { - Scorpion pet = new Scorpion(); - eggHatch(pet); - hatch=true; - //spawn spider - } else if (checkMoves()>=SPIDER) { - Spider pet = new Spider(); - eggHatch(pet); - hatch=true; - //spawn bat - } else if (checkMoves()>=100) { - Dungeon.level.drop(new RandomEgg(),hero.pos).sprite.drop(); - - } - - if (!hatch) { - detach(Dungeon.hero.belongings.backpack); - GLog.w(Messages.get(Egg.class,"yolk")); - } - - Statistics.eggBreak++; - Badges.validateEggBreak(); - hero.next(); - - } - - else if (action.equals(AC_SHAKE)) { - - boolean alive = false; - - - - if (checkFreezes()>=BLUE_DRAGON && checkPoisons()>=VIOLET_DRAGON && checkBurns()>=RED_DRAGON && checkLits()>=GREEN_DRAGON - && checkLight()>=SHADOW_DRAGON && checkSummons()>=LIGHT_DRAGON && checkMoves()>=SCORPION) { - GLog.w(Messages.get(Egg.class,"zap")); - Dungeon.hero.sprite.centerEmitter().burst(SparkParticle.FACTORY, 3); - Dungeon.hero.sprite.flash(); - Dungeon.hero.damage(1, this); - alive = true; - - } else if (checkSummons()>=SHADOW_DRAGON || checkLight()>=LIGHT_DRAGON || checkFreezes()>=BLUE_DRAGON - || checkPoisons()>=VIOLET_DRAGON || checkLits()>=GREEN_DRAGON || checkBurns()>=RED_DRAGON) { - GLog.w(Messages.get(Egg.class,"kick")); - alive = true; - - } else if (checkBurns()>=VELOCIROOSTER) { - GLog.w(Messages.get(Egg.class,"scratch")); - alive = true; - //spawn velocirooster - } else if (checkMoves()>=SCORPION) { - GLog.w(Messages.get(Egg.class,"slithers")); - alive = true; - //spawn spider - } else if (checkMoves()>=SPIDER) { - GLog.w(Messages.get(Egg.class,"slithers")); - alive = true; - //spawn scorpion - } - - if (!alive) { - GLog.w(Messages.get(Egg.class,"slosh")); - } - - } else { - - super.execute(hero, action); - - } - - - - } - - public int getSpawnPos(){ - int newPos = -1; - int pos = Dungeon.hero.pos; - ArrayList candidates = new ArrayList(); - boolean[] passable = Level.passable; - - for (int n : Level.NEIGHBOURS8) { - int c = pos + n; - if (passable[c] && Actor.findChar(c) == null) { - candidates.add(c); - } - } - - newPos = candidates.size() > 0 ? Random.element(candidates) : -1; - - return newPos; - } - - - public void eggHatch (PET pet) { - - int spawnPos = getSpawnPos(); - if (spawnPos != -1 && !Dungeon.hero.haspet) { - - pet.spawn(1); - pet.HP = pet.HT; - pet.pos = spawnPos; - pet.state = pet.HUNTING; - - GameScene.add(pet); - Actor.addDelayed(new Pushing(pet, Dungeon.hero.pos, spawnPos), -1f); - - pet.sprite.alpha(0); - pet.sprite.parent.add(new AlphaTweener(pet.sprite, 1, 0.15f)); - - detach(Dungeon.hero.belongings.backpack); - GLog.w(Messages.get(Egg.class,"hatch")); - Dungeon.hero.haspet=true; - - assignPet(pet); - - } else { - - Dungeon.hero.spend(Egg.TIME_TO_USE); - GLog.w(Messages.get(Egg.class,"notready")); - Statistics.eggBreak--; - Badges.validateEggBreak(); - - } - } - - - private void assignPet(PET pet){ - - Dungeon.hero.petType=pet.type; - Dungeon.hero.petLevel=pet.level; - - Dungeon.hero.petHP=pet.HP; - Dungeon.hero.petExperience=pet.experience; - Dungeon.hero.petCooldown=pet.cooldown; - } - - @Override - public int price() { - return 50 * quantity; - } - - - @Override - public boolean isUpgradable() { - return false; - } - - @Override - public boolean isIdentified() { - return true; - } - - @Override - public String info() { - String info = desc(); - info += "\n\n" + Messages.get(this, "moves",moves); - info += "\n" + Messages.get(this, "burns",burns); - info += "\n" + Messages.get(this, "freezes",freezes); - info += "\n" + Messages.get(this, "poisons",poisons); - info += "\n" + Messages.get(this, "lits",lits); - info += "\n" + Messages.get(this, "summons",summons); - info += "\n" + Messages.get(this, "light",light); - - return info; - } -} diff --git a/java/com/hmdzl/spspd/change/items/eggs/GoldDragonEgg.java b/java/com/hmdzl/spspd/change/items/eggs/GoldDragonEgg.java deleted file mode 100644 index 37e688de..00000000 --- a/java/com/hmdzl/spspd/change/items/eggs/GoldDragonEgg.java +++ /dev/null @@ -1,142 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.eggs; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.mobs.pets.BlueDragon; -import com.hmdzl.spspd.change.actors.mobs.pets.BugDragon; -import com.hmdzl.spspd.change.actors.mobs.pets.Bunny; -import com.hmdzl.spspd.change.actors.mobs.pets.GoldDragon; -import com.hmdzl.spspd.change.actors.mobs.pets.GreenDragon; -import com.hmdzl.spspd.change.actors.mobs.pets.LeryFire; -import com.hmdzl.spspd.change.actors.mobs.pets.PET; -import com.hmdzl.spspd.change.actors.mobs.pets.RedDragon; -import com.hmdzl.spspd.change.actors.mobs.pets.Scorpion; -import com.hmdzl.spspd.change.actors.mobs.pets.ShadowDragon; -import com.hmdzl.spspd.change.actors.mobs.pets.Spider; - -import com.hmdzl.spspd.change.actors.mobs.pets.Velocirooster; -import com.hmdzl.spspd.change.actors.mobs.pets.VioletDragon; -import com.hmdzl.spspd.change.effects.Pushing; -import com.hmdzl.spspd.change.effects.particles.SparkParticle; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.traps.LightningTrap; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.tweeners.AlphaTweener; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -public class GoldDragonEgg extends Egg { - - public static final float TIME_TO_USE = 1; - { - //name = "GoldDragon egg"; - image = ItemSpriteSheet.GOLD_DRAGONEGG; - unique = true; - stackable = false; - } - - public int moves = 5000; - public int burns = 20; - public int freezes = 20; - public int poisons = 20; - public int lits = 20; - public int summons = 20; - public int light = 20; - - @Override - public void execute(Hero hero, String action) { - if (action.equals(AC_BREAK)) { - if (Dungeon.getMonth()==9 || Random.Int(50) == 0){ - BugDragon pet = new BugDragon(); - eggHatch(pet); - } else { - GoldDragon pet = new GoldDragon(); - eggHatch(pet); - } - hero.next(); - - } - - else if (action.equals(AC_SHAKE)) { - - GLog.w(Messages.get(Egg.class,"kick")); - - } else { - - super.execute(hero, action); - - } - - - - } - - public void eggHatch (PET pet) { - - int spawnPos = getSpawnPos(); - if (spawnPos != -1 && !Dungeon.hero.haspet) { - - pet.spawn(1); - pet.HP = pet.HT; - pet.pos = spawnPos; - pet.state = pet.HUNTING; - - GameScene.add(pet); - Actor.addDelayed(new Pushing(pet, Dungeon.hero.pos, spawnPos), -1f); - - pet.sprite.alpha(0); - pet.sprite.parent.add(new AlphaTweener(pet.sprite, 1, 0.15f)); - - detach(Dungeon.hero.belongings.backpack); - GLog.w(Messages.get(Egg.class,"hatch")); - Dungeon.hero.haspet=true; - - assignPet(pet); - - } else { - - Dungeon.hero.spend(LeryFireEgg.TIME_TO_USE); - GLog.w(Messages.get(Egg.class,"notready")); - - } - } - - private void assignPet(PET pet){ - - Dungeon.hero.petType=pet.type; - Dungeon.hero.petLevel=pet.level; - - Dungeon.hero.petHP=pet.HP; - Dungeon.hero.petExperience=pet.experience; - Dungeon.hero.petCooldown=pet.cooldown; - } - - @Override - public int price() { - return 500 * quantity; - } - -} diff --git a/java/com/hmdzl/spspd/change/items/eggs/GreenDragonEgg.java b/java/com/hmdzl/spspd/change/items/eggs/GreenDragonEgg.java deleted file mode 100644 index 1581fc91..00000000 --- a/java/com/hmdzl/spspd/change/items/eggs/GreenDragonEgg.java +++ /dev/null @@ -1,257 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.eggs; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.mobs.pets.BlueDragon; -import com.hmdzl.spspd.change.actors.mobs.pets.Bunny; - -import com.hmdzl.spspd.change.actors.mobs.pets.GreenDragon; -import com.hmdzl.spspd.change.actors.mobs.pets.LeryFire; -import com.hmdzl.spspd.change.actors.mobs.pets.PET; -import com.hmdzl.spspd.change.actors.mobs.pets.RedDragon; -import com.hmdzl.spspd.change.actors.mobs.pets.Scorpion; -import com.hmdzl.spspd.change.actors.mobs.pets.ShadowDragon; -import com.hmdzl.spspd.change.actors.mobs.pets.Spider; - -import com.hmdzl.spspd.change.actors.mobs.pets.Velocirooster; -import com.hmdzl.spspd.change.actors.mobs.pets.VioletDragon; -import com.hmdzl.spspd.change.effects.Pushing; -import com.hmdzl.spspd.change.effects.particles.SparkParticle; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.traps.LightningTrap; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.tweeners.AlphaTweener; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -public class GreenDragonEgg extends Egg { - - public static final float TIME_TO_USE = 1; - - public static final int LERY_FIRE = 10; - - - { - //name = "shadow dragon egg"; - image = ItemSpriteSheet.GREEN_DRAGONEGG; - unique = true; - stackable = false; - } - - public int startMoves = 0; - public int moves = 0; - public int burns = 0; - public int freezes = 0; - public int poisons = 0; - public int lits = 20; - public int summons = 0; - public int light = 0; - - private static final String STARTMOVES = "startMoves"; - private static final String MOVES = "moves"; - private static final String BURNS = "burns"; - private static final String FREEZES = "freezes"; - private static final String POISONS = "poisons"; - private static final String LITS = "lits"; - private static final String SUMMONS = "summons"; - private static final String LIGHT = "light"; - - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(STARTMOVES, startMoves); - bundle.put(MOVES, moves); - bundle.put(BURNS, burns); - bundle.put(FREEZES, freezes); - bundle.put(POISONS, poisons); - bundle.put(LITS, lits); - bundle.put(SUMMONS, summons); - bundle.put(LIGHT, light); - - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - startMoves = bundle.getInt(STARTMOVES); - moves = bundle.getInt(MOVES); - burns = bundle.getInt(BURNS); - freezes = bundle.getInt(FREEZES); - poisons = bundle.getInt(POISONS); - lits = bundle.getInt(LITS); - summons = bundle.getInt(SUMMONS); - light = bundle.getInt(LIGHT); - - } - - public int checkMoves () { - return moves; - } - public int checkBurns () { - return burns; - } - public int checkFreezes () { - return freezes; - } - public int checkPoisons () { - return poisons; - } - public int checkLits () { - return lits; - } - public int checkSummons () { - return summons; - } - - public int checkLight () { - return light; - } - - /*@Override - public boolean doPickUp(Hero hero) { - - GLog.w("The egg likes to be warm in your pack."); - - Egg egg = hero.belongings.getItem(Egg.class); - if (egg!=null){ - GLog.w("You can probably only keep one egg warm at a time."); - } - - return super.doPickUp(hero); - } */ - - /*@Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions(hero); - actions.add(AC_BREAK); - actions.add(AC_SHAKE); - - return actions; - }*/ - - @Override - public void execute(Hero hero, String action) { - - /* - if (action == AC_BREAK) { - - if (Dungeon.depth>26) { - hero.spend(EasterEgg.TIME_TO_USE); - GLog.w(TXT_PREVENTING); - return; - } - } - */ - - if (action.equals(AC_BREAK)) { - - GreenDragon pet = new GreenDragon(); - eggHatch(pet); - - hero.next(); - - } - - else if (action.equals(AC_SHAKE)) { - - GLog.w(Messages.get(Egg.class,"kick")); - - } else { - - super.execute(hero, action); - - } - - - - } - - /*public int getSpawnPos(){ - int newPos = -1; - int pos = Dungeon.hero.pos; - ArrayList candidates = new ArrayList(); - boolean[] passable = Level.passable; - - for (int n : Level.NEIGHBOURS8) { - int c = pos + n; - if (passable[c] && Actor.findChar(c) == null) { - candidates.add(c); - } - } - - newPos = candidates.size() > 0 ? Random.element(candidates) : -1; - - return newPos; - }*/ - - - public void eggHatch (PET pet) { - - int spawnPos = getSpawnPos(); - if (spawnPos != -1 && !Dungeon.hero.haspet) { - - pet.spawn(1); - pet.HP = pet.HT; - pet.pos = spawnPos; - pet.state = pet.HUNTING; - - GameScene.add(pet); - Actor.addDelayed(new Pushing(pet, Dungeon.hero.pos, spawnPos), -1f); - - pet.sprite.alpha(0); - pet.sprite.parent.add(new AlphaTweener(pet.sprite, 1, 0.15f)); - - detach(Dungeon.hero.belongings.backpack); - GLog.w(Messages.get(Egg.class,"hatch")); - Dungeon.hero.haspet=true; - - assignPet(pet); - - } else { - - Dungeon.hero.spend(LeryFireEgg.TIME_TO_USE); - GLog.w(Messages.get(Egg.class,"notready")); - - } - } - - private void assignPet(PET pet){ - - Dungeon.hero.petType=pet.type; - Dungeon.hero.petLevel=pet.level; - - Dungeon.hero.petHP=pet.HP; - Dungeon.hero.petExperience=pet.experience; - Dungeon.hero.petCooldown=pet.cooldown; - } - - @Override - public int price() { - return 500 * quantity; - } - -} diff --git a/java/com/hmdzl/spspd/change/items/eggs/LeryFireEgg.java b/java/com/hmdzl/spspd/change/items/eggs/LeryFireEgg.java deleted file mode 100644 index 4a1789b3..00000000 --- a/java/com/hmdzl/spspd/change/items/eggs/LeryFireEgg.java +++ /dev/null @@ -1,137 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.eggs; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.mobs.pets.BlueDragon; -import com.hmdzl.spspd.change.actors.mobs.pets.Bunny; - -import com.hmdzl.spspd.change.actors.mobs.pets.GreenDragon; -import com.hmdzl.spspd.change.actors.mobs.pets.LeryFire; -import com.hmdzl.spspd.change.actors.mobs.pets.PET; -import com.hmdzl.spspd.change.actors.mobs.pets.RedDragon; -import com.hmdzl.spspd.change.actors.mobs.pets.Scorpion; -import com.hmdzl.spspd.change.actors.mobs.pets.ShadowDragon; -import com.hmdzl.spspd.change.actors.mobs.pets.Spider; - -import com.hmdzl.spspd.change.actors.mobs.pets.Velocirooster; -import com.hmdzl.spspd.change.actors.mobs.pets.VioletDragon; -import com.hmdzl.spspd.change.effects.Pushing; -import com.hmdzl.spspd.change.effects.particles.SparkParticle; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.traps.LightningTrap; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.tweeners.AlphaTweener; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -public class LeryFireEgg extends Egg { - - public static final float TIME_TO_USE = 1; - { - image = ItemSpriteSheet.FIREEGG; - unique = true; - stackable = false; - } - - public int startMoves = 0; - public int moves = 0; - public int burns = 1; - public int freezes = 1; - public int poisons = 1; - public int lits = 1; - public int summons = 0; - public int light = 0; - - @Override - public void execute(Hero hero, String action) { - - if (action.equals(AC_BREAK)) { - - LeryFire pet = new LeryFire(); - eggHatch(pet); - - hero.next(); - - } - - else if (action.equals(AC_SHAKE)) { - - GLog.w(Messages.get(Egg.class,"kick")); - - } else { - - super.execute(hero, action); - - } - - } - - public void eggHatch (PET pet) { - - int spawnPos = getSpawnPos(); - if (spawnPos != -1 && !Dungeon.hero.haspet) { - - pet.spawn(1); - pet.HP = pet.HT; - pet.pos = spawnPos; - pet.state = pet.HUNTING; - - GameScene.add(pet); - Actor.addDelayed(new Pushing(pet, Dungeon.hero.pos, spawnPos), -1f); - - pet.sprite.alpha(0); - pet.sprite.parent.add(new AlphaTweener(pet.sprite, 1, 0.15f)); - - detach(Dungeon.hero.belongings.backpack); - GLog.w(Messages.get(Egg.class,"hatch")); - Dungeon.hero.haspet=true; - - assignPet(pet); - - } else { - - Dungeon.hero.spend(LeryFireEgg.TIME_TO_USE); - GLog.w(Messages.get(Egg.class,"notready")); - - } - } - - private void assignPet(PET pet){ - - Dungeon.hero.petType=pet.type; - Dungeon.hero.petLevel=pet.level; - - Dungeon.hero.petHP=pet.HP; - Dungeon.hero.petExperience=pet.experience; - Dungeon.hero.petCooldown=pet.cooldown; - } - - @Override - public int price() { - return 500 * quantity; - } - -} diff --git a/java/com/hmdzl/spspd/change/items/eggs/LightDragonEgg.java b/java/com/hmdzl/spspd/change/items/eggs/LightDragonEgg.java deleted file mode 100644 index 29ab0475..00000000 --- a/java/com/hmdzl/spspd/change/items/eggs/LightDragonEgg.java +++ /dev/null @@ -1,140 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.eggs; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.mobs.pets.BlueDragon; -import com.hmdzl.spspd.change.actors.mobs.pets.Bunny; -import com.hmdzl.spspd.change.actors.mobs.pets.GreenDragon; -import com.hmdzl.spspd.change.actors.mobs.pets.LeryFire; -import com.hmdzl.spspd.change.actors.mobs.pets.LightDragon; -import com.hmdzl.spspd.change.actors.mobs.pets.PET; -import com.hmdzl.spspd.change.actors.mobs.pets.RedDragon; -import com.hmdzl.spspd.change.actors.mobs.pets.Scorpion; -import com.hmdzl.spspd.change.actors.mobs.pets.ShadowDragon; -import com.hmdzl.spspd.change.actors.mobs.pets.Spider; - -import com.hmdzl.spspd.change.actors.mobs.pets.Velocirooster; -import com.hmdzl.spspd.change.actors.mobs.pets.VioletDragon; -import com.hmdzl.spspd.change.effects.Pushing; -import com.hmdzl.spspd.change.effects.particles.SparkParticle; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.traps.LightningTrap; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.tweeners.AlphaTweener; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -public class LightDragonEgg extends Egg { - - public static final float TIME_TO_USE = 1; - - { - image = ItemSpriteSheet.LIGHT_DRAGONEGG; - unique = true; - stackable = false; - } - - public int startMoves = 0; - public int moves = 0; - public int burns = 0; - public int freezes = 0; - public int poisons = 0; - public int lits = 0; - public int summons = 20; - public int light = 0; - - @Override - public void execute(Hero hero, String action) { - - if (action.equals(AC_BREAK)) { - - LightDragon pet = new LightDragon(); - eggHatch(pet); - - hero.next(); - - } - - else if (action.equals(AC_SHAKE)) { - - GLog.w(Messages.get(Egg.class,"kick")); - - } else { - - super.execute(hero, action); - - } - - - - } - - public void eggHatch (PET pet) { - - int spawnPos = getSpawnPos(); - if (spawnPos != -1 && !Dungeon.hero.haspet) { - - pet.spawn(1); - pet.HP = pet.HT; - pet.pos = spawnPos; - pet.state = pet.HUNTING; - - GameScene.add(pet); - Actor.addDelayed(new Pushing(pet, Dungeon.hero.pos, spawnPos), -1f); - - pet.sprite.alpha(0); - pet.sprite.parent.add(new AlphaTweener(pet.sprite, 1, 0.15f)); - - detach(Dungeon.hero.belongings.backpack); - GLog.w(Messages.get(Egg.class,"hatch")); - Dungeon.hero.haspet=true; - - assignPet(pet); - - } else { - - Dungeon.hero.spend(LeryFireEgg.TIME_TO_USE); - GLog.w(Messages.get(Egg.class,"notready")); - - } - } - - private void assignPet(PET pet){ - - Dungeon.hero.petType=pet.type; - Dungeon.hero.petLevel=pet.level; - - Dungeon.hero.petHP=pet.HP; - Dungeon.hero.petExperience=pet.experience; - Dungeon.hero.petCooldown=pet.cooldown; - } - - @Override - public int price() { - return 500 * quantity; - } - -} diff --git a/java/com/hmdzl/spspd/change/items/eggs/RandomEgg.java b/java/com/hmdzl/spspd/change/items/eggs/RandomEgg.java deleted file mode 100644 index 037f1ebe..00000000 --- a/java/com/hmdzl/spspd/change/items/eggs/RandomEgg.java +++ /dev/null @@ -1,175 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.eggs; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.Statistics; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.mobs.pets.BlueDragon; -import com.hmdzl.spspd.change.actors.mobs.pets.Bunny; -import com.hmdzl.spspd.change.actors.mobs.pets.CocoCat; - -import com.hmdzl.spspd.change.actors.mobs.pets.Fly; -import com.hmdzl.spspd.change.actors.mobs.pets.GentleCrab; -import com.hmdzl.spspd.change.actors.mobs.pets.GreenDragon; -import com.hmdzl.spspd.change.actors.mobs.pets.Monkey; -import com.hmdzl.spspd.change.actors.mobs.pets.PET; -import com.hmdzl.spspd.change.actors.mobs.pets.RedDragon; -import com.hmdzl.spspd.change.actors.mobs.pets.RibbonRat; -import com.hmdzl.spspd.change.actors.mobs.pets.Scorpion; -import com.hmdzl.spspd.change.actors.mobs.pets.ShadowDragon; -import com.hmdzl.spspd.change.actors.mobs.pets.Snake; -import com.hmdzl.spspd.change.actors.mobs.pets.Spider; -import com.hmdzl.spspd.change.actors.mobs.pets.Stone; - -import com.hmdzl.spspd.change.actors.mobs.pets.Velocirooster; -import com.hmdzl.spspd.change.actors.mobs.pets.VioletDragon; - -import com.hmdzl.spspd.change.effects.Pushing; -import com.hmdzl.spspd.change.effects.particles.SparkParticle; -import com.hmdzl.spspd.change.items.eggs.Egg; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.traps.LightningTrap; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.tweeners.AlphaTweener; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -public class RandomEgg extends Egg { - - public static final float TIME_TO_USE = 1; - - { - image = ItemSpriteSheet.RANDOWNEGG; - unique = true; - stackable = false; - } - - @Override - public void execute(Hero hero, String action) { - if (action.equals(AC_BREAK)) { - if (Random.Int(120)<20){ - Snake pet = new Snake(); - eggHatch(pet); - } else if (Random.Int(100)< 20) { - Fly pet = new Fly(); - eggHatch(pet); - } else if (Random.Int(80)<20) { - RibbonRat pet = new RibbonRat(); - eggHatch(pet); - } else if (Random.Int(60)<20) { - GentleCrab pet = new GentleCrab(); - eggHatch(pet); - } else if (Random.Int(40)<20) { - Stone pet = new Stone(); - eggHatch(pet); - } else { - Monkey pet = new Monkey(); - eggHatch(pet); - } - Statistics.eggBreak++; - Badges.validateEggBreak(); - hero.next(); - } - - else if (action.equals(AC_SHAKE)) { - - GLog.w(Messages.get(Egg.class,"kick")); - - } else { - - super.execute(hero, action); - - } - - - - } - - public int getSpawnPos(){ - int newPos = -1; - int pos = Dungeon.hero.pos; - ArrayList candidates = new ArrayList(); - boolean[] passable = Level.passable; - - for (int n : Level.NEIGHBOURS8) { - int c = pos + n; - if (passable[c] && Actor.findChar(c) == null) { - candidates.add(c); - } - } - - newPos = candidates.size() > 0 ? Random.element(candidates) : -1; - - return newPos; - } - - - public void eggHatch (PET pet) { - - int spawnPos = getSpawnPos(); - if (spawnPos != -1 && !Dungeon.hero.haspet) { - - pet.spawn(1); - pet.HP = pet.HT; - pet.pos = spawnPos; - pet.state = pet.HUNTING; - - GameScene.add(pet); - Actor.addDelayed(new Pushing(pet, Dungeon.hero.pos, spawnPos), -1f); - - pet.sprite.alpha(0); - pet.sprite.parent.add(new AlphaTweener(pet.sprite, 1, 0.15f)); - - detach(Dungeon.hero.belongings.backpack); - GLog.w(Messages.get(Egg.class,"hatch")); - Dungeon.hero.haspet=true; - - assignPet(pet); - - } else { - - Dungeon.hero.spend(CocoCatEgg.TIME_TO_USE); - GLog.w(Messages.get(Egg.class,"notready")); - - } - } - - private void assignPet(PET pet){ - - Dungeon.hero.petType=pet.type; - Dungeon.hero.petLevel=pet.level; - - Dungeon.hero.petHP=pet.HP; - Dungeon.hero.petExperience=pet.experience; - Dungeon.hero.petCooldown=pet.cooldown; - } - - @Override - public int price() { - return 500 * quantity; - } - -} diff --git a/java/com/hmdzl/spspd/change/items/eggs/RedDragonEgg.java b/java/com/hmdzl/spspd/change/items/eggs/RedDragonEgg.java deleted file mode 100644 index 6d46e27c..00000000 --- a/java/com/hmdzl/spspd/change/items/eggs/RedDragonEgg.java +++ /dev/null @@ -1,138 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.eggs; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.mobs.pets.BlueDragon; -import com.hmdzl.spspd.change.actors.mobs.pets.Bunny; - -import com.hmdzl.spspd.change.actors.mobs.pets.GreenDragon; -import com.hmdzl.spspd.change.actors.mobs.pets.LeryFire; -import com.hmdzl.spspd.change.actors.mobs.pets.PET; -import com.hmdzl.spspd.change.actors.mobs.pets.RedDragon; -import com.hmdzl.spspd.change.actors.mobs.pets.Scorpion; -import com.hmdzl.spspd.change.actors.mobs.pets.ShadowDragon; -import com.hmdzl.spspd.change.actors.mobs.pets.Spider; - -import com.hmdzl.spspd.change.actors.mobs.pets.Velocirooster; -import com.hmdzl.spspd.change.actors.mobs.pets.VioletDragon; -import com.hmdzl.spspd.change.effects.Pushing; -import com.hmdzl.spspd.change.effects.particles.SparkParticle; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.traps.LightningTrap; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.tweeners.AlphaTweener; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -public class RedDragonEgg extends Egg { - - public static final float TIME_TO_USE = 1; - - { - image = ItemSpriteSheet.RED_DRAGONEGG; - unique = true; - stackable = false; - } - - public int startMoves = 0; - public int moves = 0; - public int burns = 20; - public int freezes = 0; - public int poisons = 0; - public int lits = 0; - public int summons = 0; - public int light = 0; - - @Override - public void execute(Hero hero, String action) { - - if (action.equals(AC_BREAK)) { - - RedDragon pet = new RedDragon(); - eggHatch(pet); - - hero.next(); - - } - - else if (action.equals(AC_SHAKE)) { - - GLog.w(Messages.get(Egg.class,"kick")); - - } else { - - super.execute(hero, action); - - } - - } - - public void eggHatch (PET pet) { - - int spawnPos = getSpawnPos(); - if (spawnPos != -1 && !Dungeon.hero.haspet) { - - pet.spawn(1); - pet.HP = pet.HT; - pet.pos = spawnPos; - pet.state = pet.HUNTING; - - GameScene.add(pet); - Actor.addDelayed(new Pushing(pet, Dungeon.hero.pos, spawnPos), -1f); - - pet.sprite.alpha(0); - pet.sprite.parent.add(new AlphaTweener(pet.sprite, 1, 0.15f)); - - detach(Dungeon.hero.belongings.backpack); - GLog.w(Messages.get(Egg.class,"hatch")); - Dungeon.hero.haspet=true; - - assignPet(pet); - - } else { - - Dungeon.hero.spend(LeryFireEgg.TIME_TO_USE); - GLog.w(Messages.get(Egg.class,"notready")); - - } - } - - private void assignPet(PET pet){ - - Dungeon.hero.petType=pet.type; - Dungeon.hero.petLevel=pet.level; - - Dungeon.hero.petHP=pet.HP; - Dungeon.hero.petExperience=pet.experience; - Dungeon.hero.petCooldown=pet.cooldown; - } - - @Override - public int price() { - return 500 * quantity; - } - -} diff --git a/java/com/hmdzl/spspd/change/items/eggs/ScorpionEgg.java b/java/com/hmdzl/spspd/change/items/eggs/ScorpionEgg.java deleted file mode 100644 index 9a787e25..00000000 --- a/java/com/hmdzl/spspd/change/items/eggs/ScorpionEgg.java +++ /dev/null @@ -1,132 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.eggs; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.mobs.pets.BlueDragon; -import com.hmdzl.spspd.change.actors.mobs.pets.Bunny; - -import com.hmdzl.spspd.change.actors.mobs.pets.GreenDragon; -import com.hmdzl.spspd.change.actors.mobs.pets.LeryFire; -import com.hmdzl.spspd.change.actors.mobs.pets.PET; -import com.hmdzl.spspd.change.actors.mobs.pets.RedDragon; -import com.hmdzl.spspd.change.actors.mobs.pets.Scorpion; -import com.hmdzl.spspd.change.actors.mobs.pets.ShadowDragon; -import com.hmdzl.spspd.change.actors.mobs.pets.Spider; - -import com.hmdzl.spspd.change.actors.mobs.pets.Velocirooster; -import com.hmdzl.spspd.change.actors.mobs.pets.VioletDragon; -import com.hmdzl.spspd.change.effects.Pushing; -import com.hmdzl.spspd.change.effects.particles.SparkParticle; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.traps.LightningTrap; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.tweeners.AlphaTweener; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -public class ScorpionEgg extends Egg { - - public static final float TIME_TO_USE = 1; - { - image = ItemSpriteSheet.SCORPIONEGG; - unique = true; - stackable = false; - } - - public int startMoves = 5000; - public int moves = 0; - public int burns = 0; - public int freezes = 0; - public int poisons = 0; - public int lits = 0; - public int summons = 0; - public int light = 0; - - @Override - public void execute(Hero hero, String action) { - - if (action.equals(AC_BREAK)) { - - Scorpion pet = new Scorpion(); - eggHatch(pet); - - hero.next(); - - } - - else if (action.equals(AC_SHAKE)) { - GLog.w(Messages.get(Egg.class,"kick")); - } else { - super.execute(hero, action); - } - } - - public void eggHatch (PET pet) { - - int spawnPos = getSpawnPos(); - if (spawnPos != -1 && !Dungeon.hero.haspet) { - - pet.spawn(1); - pet.HP = pet.HT; - pet.pos = spawnPos; - pet.state = pet.HUNTING; - - GameScene.add(pet); - Actor.addDelayed(new Pushing(pet, Dungeon.hero.pos, spawnPos), -1f); - - pet.sprite.alpha(0); - pet.sprite.parent.add(new AlphaTweener(pet.sprite, 1, 0.15f)); - - detach(Dungeon.hero.belongings.backpack); - GLog.w(Messages.get(Egg.class,"hatch")); - Dungeon.hero.haspet=true; - - assignPet(pet); - - } else { - - Dungeon.hero.spend(LeryFireEgg.TIME_TO_USE); - GLog.w(Messages.get(Egg.class,"notready")); - - } - } - - private void assignPet(PET pet){ - - Dungeon.hero.petType=pet.type; - Dungeon.hero.petLevel=pet.level; - - Dungeon.hero.petHP=pet.HP; - Dungeon.hero.petExperience=pet.experience; - Dungeon.hero.petCooldown=pet.cooldown; - } - - @Override - public int price() { - return 500 * quantity; - } - -} diff --git a/java/com/hmdzl/spspd/change/items/eggs/ShadowDragonEgg.java b/java/com/hmdzl/spspd/change/items/eggs/ShadowDragonEgg.java deleted file mode 100644 index ff03a04a..00000000 --- a/java/com/hmdzl/spspd/change/items/eggs/ShadowDragonEgg.java +++ /dev/null @@ -1,116 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.eggs; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.mobs.pets.PET; -import com.hmdzl.spspd.change.actors.mobs.pets.ShadowDragon; -import com.hmdzl.spspd.change.effects.Pushing; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.tweeners.AlphaTweener; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -public class ShadowDragonEgg extends Egg { - - public static final float TIME_TO_USE = 1; - { - //name = "shadow dragon egg"; - image = ItemSpriteSheet.SHADOWEGG; - unique = true; - stackable = false; - } - - public int startMoves = 0; - public int moves = 0; - public int burns = 0; - public int freezes = 0; - public int poisons = 0; - public int lits = 0; - public int summons = 0; - public int light = 20; - - @Override - public void execute(Hero hero, String action) { - - if (action.equals(AC_BREAK)) { - ShadowDragon pet = new ShadowDragon(); - eggHatch(pet); - hero.next(); - } - else if (action.equals(AC_SHAKE)) { - GLog.w(Messages.get(Egg.class,"kick")); - } else { - super.execute(hero, action); - } - } - - public void eggHatch (PET pet) { - - int spawnPos = getSpawnPos(); - if (spawnPos != -1 && !Dungeon.hero.haspet) { - - pet.spawn(1); - pet.HP = pet.HT; - pet.pos = spawnPos; - pet.state = pet.HUNTING; - - GameScene.add(pet); - Actor.addDelayed(new Pushing(pet, Dungeon.hero.pos, spawnPos), -1f); - - pet.sprite.alpha(0); - pet.sprite.parent.add(new AlphaTweener(pet.sprite, 1, 0.15f)); - - detach(Dungeon.hero.belongings.backpack); - GLog.w(Messages.get(Egg.class,"hatch")); - Dungeon.hero.haspet=true; - - assignPet(pet); - - } else { - - Dungeon.hero.spend(ShadowDragonEgg.TIME_TO_USE); - GLog.w(Messages.get(Egg.class,"notready")); - - } - } - - private void assignPet(PET pet){ - - Dungeon.hero.petType=pet.type; - Dungeon.hero.petLevel=pet.level; - - Dungeon.hero.petHP=pet.HP; - Dungeon.hero.petExperience=pet.experience; - Dungeon.hero.petCooldown=pet.cooldown; - } - - @Override - public int price() { - return 500 * quantity; - } - -} diff --git a/java/com/hmdzl/spspd/change/items/eggs/SpiderEgg.java b/java/com/hmdzl/spspd/change/items/eggs/SpiderEgg.java deleted file mode 100644 index df7d15e2..00000000 --- a/java/com/hmdzl/spspd/change/items/eggs/SpiderEgg.java +++ /dev/null @@ -1,150 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.eggs; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.mobs.pets.BlueDragon; -import com.hmdzl.spspd.change.actors.mobs.pets.Bunny; - -import com.hmdzl.spspd.change.actors.mobs.pets.GreenDragon; -import com.hmdzl.spspd.change.actors.mobs.pets.LeryFire; -import com.hmdzl.spspd.change.actors.mobs.pets.PET; -import com.hmdzl.spspd.change.actors.mobs.pets.RedDragon; -import com.hmdzl.spspd.change.actors.mobs.pets.Scorpion; -import com.hmdzl.spspd.change.actors.mobs.pets.ShadowDragon; -import com.hmdzl.spspd.change.actors.mobs.pets.Spider; - -import com.hmdzl.spspd.change.actors.mobs.pets.Velocirooster; -import com.hmdzl.spspd.change.actors.mobs.pets.VioletDragon; -import com.hmdzl.spspd.change.effects.Pushing; -import com.hmdzl.spspd.change.effects.particles.SparkParticle; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.traps.LightningTrap; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.tweeners.AlphaTweener; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -public class SpiderEgg extends Egg { - - public static final float TIME_TO_USE = 1; - { - image = ItemSpriteSheet.SPIDEREGG; - unique = true; - stackable = false; - } - - public int startMoves = 1000; - public int moves = 0; - public int burns = 0; - public int freezes = 0; - public int poisons = 0; - public int lits = 0; - public int summons = 0; - public int light = 0; - - @Override - public void execute(Hero hero, String action) { - - /* - if (action == AC_BREAK) { - - if (Dungeon.depth>26) { - hero.spend(EasterEgg.TIME_TO_USE); - GLog.w(TXT_PREVENTING); - return; - } - } - */ - - if (action.equals(AC_BREAK)) { - - Spider pet = new Spider(); - eggHatch(pet); - - hero.next(); - - } - - else if (action.equals(AC_SHAKE)) { - - GLog.w(Messages.get(Egg.class,"kick")); - - } else { - - super.execute(hero, action); - - } - - - - } - - public void eggHatch (PET pet) { - - int spawnPos = getSpawnPos(); - if (spawnPos != -1 && !Dungeon.hero.haspet) { - - pet.spawn(1); - pet.HP = pet.HT; - pet.pos = spawnPos; - pet.state = pet.HUNTING; - - GameScene.add(pet); - Actor.addDelayed(new Pushing(pet, Dungeon.hero.pos, spawnPos), -1f); - - pet.sprite.alpha(0); - pet.sprite.parent.add(new AlphaTweener(pet.sprite, 1, 0.15f)); - - detach(Dungeon.hero.belongings.backpack); - GLog.w(Messages.get(Egg.class,"hatch")); - Dungeon.hero.haspet=true; - - assignPet(pet); - - } else { - - Dungeon.hero.spend(LeryFireEgg.TIME_TO_USE); - GLog.w(Messages.get(Egg.class,"notready")); - - } - } - - private void assignPet(PET pet){ - - Dungeon.hero.petType=pet.type; - Dungeon.hero.petLevel=pet.level; - - Dungeon.hero.petHP=pet.HP; - Dungeon.hero.petExperience=pet.experience; - Dungeon.hero.petCooldown=pet.cooldown; - } - - @Override - public int price() { - return 500 * quantity; - } - -} diff --git a/java/com/hmdzl/spspd/change/items/eggs/VelociroosterEgg.java b/java/com/hmdzl/spspd/change/items/eggs/VelociroosterEgg.java deleted file mode 100644 index 1fad0327..00000000 --- a/java/com/hmdzl/spspd/change/items/eggs/VelociroosterEgg.java +++ /dev/null @@ -1,137 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.eggs; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.mobs.pets.BlueDragon; -import com.hmdzl.spspd.change.actors.mobs.pets.Bunny; - -import com.hmdzl.spspd.change.actors.mobs.pets.GreenDragon; -import com.hmdzl.spspd.change.actors.mobs.pets.LeryFire; -import com.hmdzl.spspd.change.actors.mobs.pets.PET; -import com.hmdzl.spspd.change.actors.mobs.pets.RedDragon; -import com.hmdzl.spspd.change.actors.mobs.pets.Scorpion; -import com.hmdzl.spspd.change.actors.mobs.pets.ShadowDragon; -import com.hmdzl.spspd.change.actors.mobs.pets.Spider; - -import com.hmdzl.spspd.change.actors.mobs.pets.Velocirooster; -import com.hmdzl.spspd.change.actors.mobs.pets.VioletDragon; -import com.hmdzl.spspd.change.effects.Pushing; -import com.hmdzl.spspd.change.effects.particles.SparkParticle; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.traps.LightningTrap; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.tweeners.AlphaTweener; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -public class VelociroosterEgg extends Egg { - - public static final float TIME_TO_USE = 1; - - { - image = ItemSpriteSheet.VELOCIROOSTEREGG; - unique = true; - stackable = false; - } - - public int startMoves = 0; - public int moves = 0; - public int burns = 5; - public int freezes = 0; - public int poisons = 0; - public int lits = 0; - public int summons = 0; - public int light = 0; - - @Override - public void execute(Hero hero, String action) { - - if (action.equals(AC_BREAK)) { - - Velocirooster pet = new Velocirooster(); - eggHatch(pet); - - hero.next(); - - } - - else if (action.equals(AC_SHAKE)) { - - GLog.w(Messages.get(Egg.class,"kick")); - - } else { - - super.execute(hero, action); - - } - } - - public void eggHatch (PET pet) { - - int spawnPos = getSpawnPos(); - if (spawnPos != -1 && !Dungeon.hero.haspet) { - - pet.spawn(1); - pet.HP = pet.HT; - pet.pos = spawnPos; - pet.state = pet.HUNTING; - - GameScene.add(pet); - Actor.addDelayed(new Pushing(pet, Dungeon.hero.pos, spawnPos), -1f); - - pet.sprite.alpha(0); - pet.sprite.parent.add(new AlphaTweener(pet.sprite, 1, 0.15f)); - - detach(Dungeon.hero.belongings.backpack); - GLog.w(Messages.get(Egg.class,"hatch")); - Dungeon.hero.haspet=true; - - assignPet(pet); - - } else { - - Dungeon.hero.spend(LeryFireEgg.TIME_TO_USE); - GLog.w(Messages.get(Egg.class,"notready")); - - } - } - - private void assignPet(PET pet){ - - Dungeon.hero.petType=pet.type; - Dungeon.hero.petLevel=pet.level; - - Dungeon.hero.petHP=pet.HP; - Dungeon.hero.petExperience=pet.experience; - Dungeon.hero.petCooldown=pet.cooldown; - } - - @Override - public int price() { - return 500 * quantity; - } - -} diff --git a/java/com/hmdzl/spspd/change/items/eggs/VioletDragonEgg.java b/java/com/hmdzl/spspd/change/items/eggs/VioletDragonEgg.java deleted file mode 100644 index 19e4b8a6..00000000 --- a/java/com/hmdzl/spspd/change/items/eggs/VioletDragonEgg.java +++ /dev/null @@ -1,142 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.eggs; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.mobs.pets.BlueDragon; -import com.hmdzl.spspd.change.actors.mobs.pets.Bunny; - -import com.hmdzl.spspd.change.actors.mobs.pets.GreenDragon; -import com.hmdzl.spspd.change.actors.mobs.pets.LeryFire; -import com.hmdzl.spspd.change.actors.mobs.pets.PET; -import com.hmdzl.spspd.change.actors.mobs.pets.RedDragon; -import com.hmdzl.spspd.change.actors.mobs.pets.Scorpion; -import com.hmdzl.spspd.change.actors.mobs.pets.ShadowDragon; -import com.hmdzl.spspd.change.actors.mobs.pets.Spider; - -import com.hmdzl.spspd.change.actors.mobs.pets.Velocirooster; -import com.hmdzl.spspd.change.actors.mobs.pets.VioletDragon; -import com.hmdzl.spspd.change.effects.Pushing; -import com.hmdzl.spspd.change.effects.particles.SparkParticle; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.traps.LightningTrap; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.tweeners.AlphaTweener; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -public class VioletDragonEgg extends Egg { - - public static final float TIME_TO_USE = 1; - - public static final int LERY_FIRE = 10; - - - { - //name = "shadow dragon egg"; - image = ItemSpriteSheet.VIOLET_DRAGONEGG; - unique = true; - stackable = false; - } - - public int startMoves = 0; - public int moves = 0; - public int burns = 0; - public int freezes = 0; - public int poisons = 20; - public int lits = 0; - public int summons = 0; - public int light = 0; - - @Override - public void execute(Hero hero, String action) { - - if (action.equals(AC_BREAK)) { - - VioletDragon pet = new VioletDragon(); - eggHatch(pet); - - hero.next(); - - } - - else if (action.equals(AC_SHAKE)) { - - GLog.w(Messages.get(Egg.class,"kick")); - - } else { - - super.execute(hero, action); - - } - - } - - public void eggHatch (PET pet) { - - int spawnPos = getSpawnPos(); - if (spawnPos != -1 && !Dungeon.hero.haspet) { - - pet.spawn(1); - pet.HP = pet.HT; - pet.pos = spawnPos; - pet.state = pet.HUNTING; - - GameScene.add(pet); - Actor.addDelayed(new Pushing(pet, Dungeon.hero.pos, spawnPos), -1f); - - pet.sprite.alpha(0); - pet.sprite.parent.add(new AlphaTweener(pet.sprite, 1, 0.15f)); - - detach(Dungeon.hero.belongings.backpack); - GLog.w(Messages.get(Egg.class,"hatch")); - Dungeon.hero.haspet=true; - - assignPet(pet); - - } else { - - Dungeon.hero.spend(LeryFireEgg.TIME_TO_USE); - GLog.w(Messages.get(Egg.class,"notready")); - - } - } - - private void assignPet(PET pet){ - - Dungeon.hero.petType=pet.type; - Dungeon.hero.petLevel=pet.level; - - Dungeon.hero.petHP=pet.HP; - Dungeon.hero.petExperience=pet.experience; - Dungeon.hero.petCooldown=pet.cooldown; - } - - @Override - public int price() { - return 500 * quantity; - } - -} diff --git a/java/com/hmdzl/spspd/change/items/eggs/YearPetEgg.java b/java/com/hmdzl/spspd/change/items/eggs/YearPetEgg.java deleted file mode 100644 index ca2b2c6d..00000000 --- a/java/com/hmdzl/spspd/change/items/eggs/YearPetEgg.java +++ /dev/null @@ -1,135 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.eggs; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.mobs.pets.BlueDragon; -import com.hmdzl.spspd.change.actors.mobs.pets.Bunny; - -import com.hmdzl.spspd.change.actors.mobs.pets.GreenDragon; -import com.hmdzl.spspd.change.actors.mobs.pets.LeryFire; -import com.hmdzl.spspd.change.actors.mobs.pets.PET; -import com.hmdzl.spspd.change.actors.mobs.pets.RedDragon; -import com.hmdzl.spspd.change.actors.mobs.pets.Scorpion; -import com.hmdzl.spspd.change.actors.mobs.pets.ShadowDragon; -import com.hmdzl.spspd.change.actors.mobs.pets.Spider; - -import com.hmdzl.spspd.change.actors.mobs.pets.Velocirooster; -import com.hmdzl.spspd.change.actors.mobs.pets.VioletDragon; -import com.hmdzl.spspd.change.actors.mobs.pets.YearPet; -import com.hmdzl.spspd.change.effects.Pushing; -import com.hmdzl.spspd.change.effects.particles.SparkParticle; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.traps.LightningTrap; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.tweeners.AlphaTweener; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -public class YearPetEgg extends Egg { - - public static final float TIME_TO_USE = 1; - - - { - //name = "year egg"; - image = ItemSpriteSheet.RANDOWNEGG; - unique = true; - stackable = false; - } - - - @Override - public void execute(Hero hero, String action) { - - if (action.equals(AC_BREAK)) { - - YearPet pet = new YearPet(); - eggHatch(pet); - - hero.next(); - - } - - else if (action.equals(AC_SHAKE)) { - - GLog.w(Messages.get(Egg.class,"kick")); - - } else { - - super.execute(hero, action); - - } - - - - } - - public void eggHatch (PET pet) { - - int spawnPos = getSpawnPos(); - if (spawnPos != -1 && !Dungeon.hero.haspet) { - - pet.spawn(1); - pet.HP = pet.HT; - pet.pos = spawnPos; - pet.state = pet.HUNTING; - - GameScene.add(pet); - Actor.addDelayed(new Pushing(pet, Dungeon.hero.pos, spawnPos), -1f); - - pet.sprite.alpha(0); - pet.sprite.parent.add(new AlphaTweener(pet.sprite, 1, 0.15f)); - - detach(Dungeon.hero.belongings.backpack); - GLog.w(Messages.get(Egg.class,"hatch")); - Dungeon.hero.haspet=true; - - assignPet(pet); - - } else { - - Dungeon.hero.spend(TIME_TO_USE); - GLog.w(Messages.get(Egg.class,"notready")); - - } - } - - private void assignPet(PET pet){ - - Dungeon.hero.petType=pet.type; - Dungeon.hero.petLevel=pet.level; - - Dungeon.hero.petHP=pet.HP; - Dungeon.hero.petExperience=pet.experience; - Dungeon.hero.petCooldown=pet.cooldown; - } - - @Override - public int price() { - return 500 * quantity; - } - -} diff --git a/java/com/hmdzl/spspd/change/items/food/Food.java b/java/com/hmdzl/spspd/change/items/food/Food.java deleted file mode 100644 index 5c930fa1..00000000 --- a/java/com/hmdzl/spspd/change/items/food/Food.java +++ /dev/null @@ -1,150 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.food; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.Statistics; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Locked; -import com.hmdzl.spspd.change.actors.buffs.Recharging; -import com.hmdzl.spspd.change.actors.buffs.Hunger; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.hero.HeroClass; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.effects.SpellSprite; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfRecharging; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Random; - -public class Food extends Item { - - private static final float TIME_TO_EAT = 3f; - - public static final String AC_EAT = "EAT"; - - public float energy = Hunger.HUNGRY; - - public int hornValue = 3; - - { - stackable = true; - //name = "ration of food"; - image = ItemSpriteSheet.RATION; - defaultAction = AC_EAT; - } - - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions(hero); - if (hero.buff(Locked.class) == null){ - actions.add(AC_EAT); - } - return actions; - } - - @Override - public void execute(Hero hero, String action) { - if (action.equals(AC_EAT)) { - - if (hero.buff(Locked.class) != null ) { - GLog.w(Messages.get(Food.class, "locked")); - } else { - if (!(Dungeon.hero.heroClass == HeroClass.FOLLOWER ) || (Dungeon.hero.heroClass == HeroClass.FOLLOWER && Random.Int(10)>=1 )) - detach(hero.belongings.backpack); - - hero.buff(Hunger.class).satisfy(energy); - int healEnergy = Math.max(7, Math.round(energy / 40)); - switch (hero.heroClass) { - case WARRIOR: - if (hero.HP < hero.HT) { - hero.HP = Math.min(hero.HP + Random.Int(3, healEnergy), hero.HT); - hero.sprite.emitter() - .burst(Speck.factory(Speck.HEALING), 1); - } - break; - case MAGE: - Buff.affect(hero, Recharging.class, 4f); - ScrollOfRecharging.charge(hero); - if (hero.HP < hero.HT) { - hero.HP = Math.min((hero.HP + Random.Int(1, 3)), hero.HT); - hero.sprite.emitter() - .burst(Speck.factory(Speck.HEALING), 1); - } - break; - case ROGUE: - if (hero.HP < hero.HT) { - hero.HP = Math.min((hero.HP + Random.Int(1, 3)), hero.HT); - hero.sprite.emitter() - .burst(Speck.factory(Speck.HEALING), 1); - } - case HUNTRESS: - if (hero.HP < hero.HT) { - hero.HP = Math.min((hero.HP + Random.Int(1, 3)), hero.HT); - hero.sprite.emitter() - .burst(Speck.factory(Speck.HEALING), 1); - } - break; - case PERFORMER: - if (hero.HP < hero.HT) { - hero.HP = Math.min((hero.HP + Random.Int(1, 3)), hero.HT); - hero.sprite.emitter() - .burst(Speck.factory(Speck.HEALING), 1); - } - break; - } - - hero.sprite.operate(hero.pos); - hero.busy(); - SpellSprite.show(hero, SpellSprite.FOOD); - Sample.INSTANCE.play(Assets.SND_EAT); - - hero.spend(TIME_TO_EAT); - - Statistics.foodEaten++; - Badges.validateFoodEaten(); - } - } else { - - super.execute(hero, action); - - } - } - - @Override - public boolean isUpgradable() { - return false; - } - - @Override - public boolean isIdentified() { - return true; - } - - @Override - public int price() { - return 5 * quantity; - } -} diff --git a/java/com/hmdzl/spspd/change/items/food/Honey.java b/java/com/hmdzl/spspd/change/items/food/Honey.java deleted file mode 100644 index 86190bbd..00000000 --- a/java/com/hmdzl/spspd/change/items/food/Honey.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.food; - -import com.hmdzl.spspd.change.actors.buffs.Bleeding; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Cripple; -import com.hmdzl.spspd.change.actors.buffs.Poison; -import com.hmdzl.spspd.change.actors.buffs.Weakness; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.food.Food; -import com.hmdzl.spspd.change.items.food.completefood.CompleteFood; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.watabou.utils.Random; - -public class Honey extends Food { - - { - //name = "Honey"; - image = ItemSpriteSheet.POTION_HONEY; - - energy = 50; - hornValue = 0; - } - - @Override - public void execute(Hero hero, String action) { - - super.execute(hero, action); - - if (action.equals(AC_EAT)) { - hero.HT = hero.HT + (Random.Int(4, 8)); - //hero.HP = hero.HP+Math.min(((hero.HT-hero.HP)/2), hero.HT-hero.HP); - //Buff.detach(hero, Poison.class); - //Buff.detach(hero, Cripple.class); - //Buff.detach(hero, Weakness.class); - //Buff.detach(hero, Bleeding.class); - - //hero.sprite.emitter().start(Speck.factory(Speck.HEALING), 0.4f, 4); - - } - } - - @Override - public int price() { - return 500 * quantity; - } -} diff --git a/java/com/hmdzl/spspd/change/items/food/Nut.java b/java/com/hmdzl/spspd/change/items/food/Nut.java deleted file mode 100644 index 6cf8c00d..00000000 --- a/java/com/hmdzl/spspd/change/items/food/Nut.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.food; - -import com.hmdzl.spspd.change.actors.buffs.Barkskin; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.items.food.Food; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.watabou.utils.Random; - -public class Nut extends Food { - - { - //name = "dungeon nut"; - image = ItemSpriteSheet.SEED_TOASTEDDUNGEONNUT; - energy = 10; - //message = "Crunch Crunch."; - hornValue = 1; - - } - - @Override - public void execute(Hero hero, String action) { - - super.execute(hero, action); - - if (action.equals(AC_EAT)) { - - hero.HP += 1; - switch (Random.Int(10)) { - case 0: - Buff.affect(hero, Barkskin.class).level(hero.HT / 4); - break; - } - } - } - - - @Override - public int price() { - return 1 * quantity; - } -} diff --git a/java/com/hmdzl/spspd/change/items/food/ToastedNut.java b/java/com/hmdzl/spspd/change/items/food/ToastedNut.java deleted file mode 100644 index c605db6a..00000000 --- a/java/com/hmdzl/spspd/change/items/food/ToastedNut.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.food; - -import com.hmdzl.spspd.change.actors.buffs.Barkskin; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.watabou.utils.Random; - -public class ToastedNut extends Nut { - - { - //name = "toasted dungeon nut"; - image = ItemSpriteSheet.SEED_TOASTEDDUNGEONNUT; - energy = 20; - hornValue = 2; - } - - @Override - public void execute(Hero hero, String action) { - - super.execute(hero, action); - - if (action.equals(AC_EAT)) { - - switch (Random.Int(2)) { - case 0: - Buff.affect(hero, Barkskin.class).level(hero.HT); - break; - case 1: - Buff.affect(hero, Barkskin.class).level(hero.HT*2); - break; - } - } - } - - @Override - public int price() { - return 1 * quantity; - } - public static Food cook(Nut ingredient) { - ToastedNut result = new ToastedNut(); - result.quantity = ingredient.quantity(); - return result; - } -} - - diff --git a/java/com/hmdzl/spspd/change/items/food/Vegetable.java b/java/com/hmdzl/spspd/change/items/food/Vegetable.java deleted file mode 100644 index ccbe473f..00000000 --- a/java/com/hmdzl/spspd/change/items/food/Vegetable.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.food; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.Statistics; -import com.hmdzl.spspd.change.actors.buffs.Bleeding; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Cripple; -import com.hmdzl.spspd.change.actors.buffs.Locked; -import com.hmdzl.spspd.change.actors.buffs.Poison; -import com.hmdzl.spspd.change.actors.buffs.Recharging; -import com.hmdzl.spspd.change.actors.buffs.Hunger; -import com.hmdzl.spspd.change.actors.buffs.Weakness; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.effects.SpellSprite; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.food.Food; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfRecharging; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Random; - -public class Vegetable extends Food { - - { - stackable = true; - //name = "ration of food"; - image = ItemSpriteSheet.EAT_GRASS; - energy = 20; - hornValue = 1; - - } - - @Override - public void execute(Hero hero, String action) { - super.execute(hero, action); - - if (action.equals(AC_EAT)){ - Buff.detach(hero, Poison.class); - Buff.detach(hero, Cripple.class); - Buff.detach(hero, Weakness.class); - Buff.detach(hero, Bleeding.class); - } - } - - @Override - public int price() { - return 1 * quantity; - } -} diff --git a/java/com/hmdzl/spspd/change/items/food/WaterItem.java b/java/com/hmdzl/spspd/change/items/food/WaterItem.java deleted file mode 100644 index 648edd3c..00000000 --- a/java/com/hmdzl/spspd/change/items/food/WaterItem.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.food; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.Statistics; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Speck; - -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.weapon.missiles.RiceBall; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.audio.Sample; - -public class WaterItem extends Food { - - { - //name = "water"; - image = ItemSpriteSheet.DEWDROP; - energy = 1; - //message = "Crunch Crunch."; - hornValue = 0; - - } - - @Override - public boolean isUpgradable() { - return false; - } - - @Override - public boolean isIdentified() { - return true; - } - - @Override - public int price() { - return 1 * quantity; - } - -} diff --git a/java/com/hmdzl/spspd/change/items/food/completefood/AflyFood.java b/java/com/hmdzl/spspd/change/items/food/completefood/AflyFood.java deleted file mode 100644 index e61705ac..00000000 --- a/java/com/hmdzl/spspd/change/items/food/completefood/AflyFood.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.food.completefood; - -import com.hmdzl.spspd.change.actors.buffs.AflyBless; -import com.hmdzl.spspd.change.actors.buffs.Bleeding; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Cripple; -import com.hmdzl.spspd.change.actors.buffs.Poison; -import com.hmdzl.spspd.change.actors.buffs.Weakness; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.items.food.Food; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; - -public class AflyFood extends CompleteFood { - - { - //name = "AflyFood"; - image = ItemSpriteSheet.AFLY_FOOD; - energy = 200; - hornValue = 3; - - } - - @Override - public int price() { - return 2 * quantity; - } - - @Override - public void execute(Hero hero, String action) { - super.execute(hero, action); - if (action.equals(AC_EAT)){ - Buff.affect(hero, AflyBless.class,150f); - hero.belongings.observeS(); - } - } - -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/items/food/completefood/Chickennugget.java b/java/com/hmdzl/spspd/change/items/food/completefood/Chickennugget.java deleted file mode 100644 index 0e184748..00000000 --- a/java/com/hmdzl/spspd/change/items/food/completefood/Chickennugget.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.food.completefood; - -import com.hmdzl.spspd.change.items.food.Food; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; - -public class Chickennugget extends CompleteFood { - - { - //name = "chickennugget"; - image = ItemSpriteSheet.CHICKENNUGGET; - energy = 170; - hornValue = 3; - } - - @Override - public int price() { - return 2 * quantity; - } - -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/items/food/completefood/CompleteFood.java b/java/com/hmdzl/spspd/change/items/food/completefood/CompleteFood.java deleted file mode 100644 index 52626a13..00000000 --- a/java/com/hmdzl/spspd/change/items/food/completefood/CompleteFood.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.food.completefood; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.Statistics; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Locked; -import com.hmdzl.spspd.change.actors.buffs.Recharging; -import com.hmdzl.spspd.change.actors.buffs.Hunger; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.effects.SpellSprite; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.food.Food; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfRecharging; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Random; - -public class CompleteFood extends Food { - - { - stackable = true; - //name = "ration of food"; - image = ItemSpriteSheet.RATION; - - - } - - -} diff --git a/java/com/hmdzl/spspd/change/items/food/completefood/Crystalnucleus.java b/java/com/hmdzl/spspd/change/items/food/completefood/Crystalnucleus.java deleted file mode 100644 index c1966285..00000000 --- a/java/com/hmdzl/spspd/change/items/food/completefood/Crystalnucleus.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.food.completefood; - -import com.hmdzl.spspd.change.items.food.Food; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; - -public class Crystalnucleus extends CompleteFood { - - { - //name = "crystalnucleus"; - image = ItemSpriteSheet.NORNORANGE; - energy = 1; - hornValue = 1; - - } - - @Override - public int price() { - return 1000 * quantity; - } - -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/items/food/completefood/Foamedbeverage.java b/java/com/hmdzl/spspd/change/items/food/completefood/Foamedbeverage.java deleted file mode 100644 index 7961932d..00000000 --- a/java/com/hmdzl/spspd/change/items/food/completefood/Foamedbeverage.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.food.completefood; - -import com.hmdzl.spspd.change.actors.buffs.Bleeding; -import com.hmdzl.spspd.change.actors.buffs.Bless; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Cripple; -import com.hmdzl.spspd.change.actors.buffs.Poison; -import com.hmdzl.spspd.change.actors.buffs.Weakness; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.food.Food; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; - -public class Foamedbeverage extends CompleteFood { - - { - //name = "foamedbeverage"; - image = ItemSpriteSheet.FOAMED; - energy = 20; - hornValue = 1; - - } - - @Override - public int price() { - return 5 * quantity; - } - - @Override - public void execute(Hero hero, String action) { - super.execute(hero, action); - - if (action.equals(AC_EAT)){ - Buff.detach(hero, Poison.class); - Buff.detach(hero, Cripple.class); - Buff.detach(hero, Weakness.class); - Buff.detach(hero, Bleeding.class); - Buff.affect(hero, Bless.class, 50f); - } -} - -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/items/food/completefood/FoodFans.java b/java/com/hmdzl/spspd/change/items/food/completefood/FoodFans.java deleted file mode 100644 index bea6401f..00000000 --- a/java/com/hmdzl/spspd/change/items/food/completefood/FoodFans.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.food.completefood; - -import com.hmdzl.spspd.change.actors.buffs.Bless; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.ShieldArmor; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.food.Food; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; - -public class FoodFans extends CompleteFood { - - { - //name = "FoodFans"; - image = ItemSpriteSheet.FOODFANS; - energy = 150; - hornValue = 2; - - } - - @Override - public int price() { - return 20 * quantity; - } - - @Override - public void execute(Hero hero, String action) { - super.execute(hero, action); - - if (action.equals(AC_EAT)){ - Buff.affect(hero, ShieldArmor.class).level(75); - Buff.affect(hero, Bless.class,50f); - } - } - -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/items/food/completefood/Frenchfries.java b/java/com/hmdzl/spspd/change/items/food/completefood/Frenchfries.java deleted file mode 100644 index 77e6329a..00000000 --- a/java/com/hmdzl/spspd/change/items/food/completefood/Frenchfries.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.food.completefood; - -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Haste; -import com.hmdzl.spspd.change.actors.buffs.ShieldArmor; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.food.Food; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; - -public class Frenchfries extends CompleteFood { - - { - //name = "Frenchfries"; - image = ItemSpriteSheet.FRENCHFRIES; - energy = 150; - hornValue = 2; - - } - - @Override - public int price() { - return 20 * quantity; - } - - @Override - public void execute(Hero hero, String action) { - super.execute(hero, action); - - if (action.equals(AC_EAT)){ - Buff.affect(hero, ShieldArmor.class).level(75); - Buff.affect(hero, Haste.class,50f); - } - } - -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/items/food/completefood/Fruitsalad.java b/java/com/hmdzl/spspd/change/items/food/completefood/Fruitsalad.java deleted file mode 100644 index ed791258..00000000 --- a/java/com/hmdzl/spspd/change/items/food/completefood/Fruitsalad.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.food.completefood; - -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.food.Food; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; - -public class Fruitsalad extends CompleteFood { - - { - //name = "fruitsalad"; - image = ItemSpriteSheet.FRUITSALAD; - energy = 130; - hornValue = 3; - - } - - @Override - public int price() { - return 2 * quantity; - } - - @Override - public void execute(Hero hero, String action) { - super.execute(hero, action); - - if (action.equals(AC_EAT)){ - hero.HP+= hero.HT/3; - hero.sprite.emitter().start(Speck.factory(Speck.HEALING), 0.4f, 5); - } - } - -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/items/food/completefood/Garbage.java b/java/com/hmdzl/spspd/change/items/food/completefood/Garbage.java deleted file mode 100644 index 922152dd..00000000 --- a/java/com/hmdzl/spspd/change/items/food/completefood/Garbage.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.food.completefood; - -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.food.Food; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; - -public class Garbage extends CompleteFood { - - { - //name = "Garbage"; - image = ItemSpriteSheet.ERROR_FOOD; - energy = 1; - hornValue = 0; - - } - @Override - public int price() { - return 10 * quantity; - } - @Override - public void execute(Hero hero, String action) { - super.execute(hero, action); - - if (action.equals(AC_EAT)){ - int damage = hero.HT/5; - hero.damage(damage, this); - hero.sprite.emitter().start(Speck.factory(Speck.ROCK), 0.07f, 5); - - } - } - -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/items/food/completefood/Gel.java b/java/com/hmdzl/spspd/change/items/food/completefood/Gel.java deleted file mode 100644 index d8ff99a2..00000000 --- a/java/com/hmdzl/spspd/change/items/food/completefood/Gel.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.food.completefood; - -import com.hmdzl.spspd.change.actors.buffs.Bleeding; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Cripple; -import com.hmdzl.spspd.change.actors.buffs.Poison; -import com.hmdzl.spspd.change.actors.buffs.Weakness; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.food.Food; -import com.hmdzl.spspd.change.sprites.ItemSprite; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.watabou.utils.Random; - -public class Gel extends CompleteFood { - - { - //name = "Gel"; - image = ItemSpriteSheet.UPGRADEGOO_VIOLET; - - energy = 10; - hornValue = 0; - } - - private static ItemSprite.Glowing BLUE = new ItemSprite.Glowing(0x0000FF); - - @Override - public ItemSprite.Glowing glowing() { - return BLUE; - } - @Override - public int price() { - return 50 * quantity; - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/items/food/completefood/GoldenNut.java b/java/com/hmdzl/spspd/change/items/food/completefood/GoldenNut.java deleted file mode 100644 index 02a770f1..00000000 --- a/java/com/hmdzl/spspd/change/items/food/completefood/GoldenNut.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.food.completefood; - -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.items.food.completefood.CompleteFood; -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.watabou.utils.Random; - -public class GoldenNut extends CompleteFood { - - { - //name = "golden dungeon nut"; - image = ItemSpriteSheet.SEED_GOLDENDUNGEONNUT; - energy = 100; - hornValue = 2; - } - - @Override - public void execute(Hero hero, String action) { - - super.execute(hero, action); - - if (action.equals(AC_EAT)) { - - switch (Random.Int(2)) { - case 0: - hero.HT+=60; - hero.STR+=1; - hero.sprite.showStatus(CharSprite.POSITIVE, "+1 str, +60 ht"); - - Badges.validateStrengthAttained(); - break; - case 1: - hero.HT+=30; - hero.STR+=2; - hero.sprite.showStatus(CharSprite.POSITIVE, "+2 str, +30 ht"); - - Badges.validateStrengthAttained(); - break; - } - } - } - -} - - diff --git a/java/com/hmdzl/spspd/change/items/food/completefood/Hamburger.java b/java/com/hmdzl/spspd/change/items/food/completefood/Hamburger.java deleted file mode 100644 index 8167917b..00000000 --- a/java/com/hmdzl/spspd/change/items/food/completefood/Hamburger.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.food.completefood; - -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.DefenceUp; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.food.Food; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; - -public class Hamburger extends CompleteFood { - - { - //name = "hamburger"; - image = ItemSpriteSheet.HAMBURGER; - energy = 770; - hornValue = 6; - - } - - @Override - public int price() { - return 10 * quantity; - } - - @Override - public void execute(Hero hero, String action) { - super.execute(hero, action); - - if (action.equals(AC_EAT)){ - hero.HP+= hero.HT/5; - hero.sprite.emitter().start(Speck.factory(Speck.HEART), 0.2f, 5); - } - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/items/food/completefood/Herbmeat.java b/java/com/hmdzl/spspd/change/items/food/completefood/Herbmeat.java deleted file mode 100644 index 5e6c9015..00000000 --- a/java/com/hmdzl/spspd/change/items/food/completefood/Herbmeat.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.food.completefood; - -import com.hmdzl.spspd.change.actors.buffs.Bleeding; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Cripple; -import com.hmdzl.spspd.change.actors.buffs.Poison; -import com.hmdzl.spspd.change.actors.buffs.Weakness; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.items.food.Food; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; - -public class Herbmeat extends CompleteFood { - - { - //name = "Herbmeat"; - image = ItemSpriteSheet.HERB_MEAT; - energy = 180; - hornValue = 3; - - } - - @Override - public int price() { - return 2 * quantity; - } - - @Override - public void execute(Hero hero, String action) { - super.execute(hero, action); - if (action.equals(AC_EAT)){ - Buff.detach(hero, Poison.class); - Buff.detach(hero, Cripple.class); - Buff.detach(hero, Weakness.class); - Buff.detach(hero, Bleeding.class); - } - } - -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/items/food/completefood/Honey.java b/java/com/hmdzl/spspd/change/items/food/completefood/Honey.java deleted file mode 100644 index 60af42c2..00000000 --- a/java/com/hmdzl/spspd/change/items/food/completefood/Honey.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.food.completefood; - -import com.hmdzl.spspd.change.actors.buffs.Bleeding; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Cripple; -import com.hmdzl.spspd.change.actors.buffs.Poison; -import com.hmdzl.spspd.change.actors.buffs.Weakness; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.food.Food; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.watabou.utils.Random; - -public class Honey extends CompleteFood { - - { - //name = "Honey"; - image = ItemSpriteSheet.POTION_HONEY; - energy = 50; - hornValue = 0; - } - - @Override - public void execute(Hero hero, String action) { - - super.execute(hero, action); - - if (action.equals(AC_EAT)) { - hero.HT = hero.HT + (Random.Int(4, 8)); - //hero.HP = hero.HP+Math.min(((hero.HT-hero.HP)/2), hero.HT-hero.HP); - //Buff.detach(hero, Poison.class); - //Buff.detach(hero, Cripple.class); - //Buff.detach(hero, Weakness.class); - //Buff.detach(hero, Bleeding.class); - - //hero.sprite.emitter().start(Speck.factory(Speck.HEALING), 0.4f, 4); - - } - } - - @Override - public int price() { - return 500 * quantity; - } -} diff --git a/java/com/hmdzl/spspd/change/items/food/completefood/HoneyGel.java b/java/com/hmdzl/spspd/change/items/food/completefood/HoneyGel.java deleted file mode 100644 index a23cb139..00000000 --- a/java/com/hmdzl/spspd/change/items/food/completefood/HoneyGel.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.food.completefood; - -import com.hmdzl.spspd.change.actors.buffs.Bleeding; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Cripple; -import com.hmdzl.spspd.change.actors.buffs.Poison; -import com.hmdzl.spspd.change.actors.buffs.Weakness; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.food.Food; -import com.hmdzl.spspd.change.sprites.ItemSprite; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.watabou.utils.Random; - -public class HoneyGel extends CompleteFood { - - { - //name = "HoneyGel"; - image = ItemSpriteSheet.UPGRADEGOO_YELLOW; - - energy = 20; - hornValue = 2; - } - - private static ItemSprite.Glowing YELLOW = new ItemSprite.Glowing( 0xFFFF44 ); - - @Override - public ItemSprite.Glowing glowing() { - return YELLOW; - } - - @Override - public void execute(Hero hero, String action) { - - super.execute(hero, action); - - if (action.equals(AC_EAT)) { - hero.HT = hero.HT + (Random.Int(4, 8)); - //hero.HP = hero.HP+Math.min(((hero.HT-hero.HP)/2), hero.HT-hero.HP); - //Buff.detach(hero, Poison.class); - //Buff.detach(hero, Cripple.class); - //Buff.detach(hero, Weakness.class); - //Buff.detach(hero, Bleeding.class); - - //hero.sprite.emitter().start(Speck.factory(Speck.HEALING), 0.4f, 4); - - } - } - - @Override - public int price() { - return 500 * quantity; - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/items/food/completefood/HoneyWater.java b/java/com/hmdzl/spspd/change/items/food/completefood/HoneyWater.java deleted file mode 100644 index df20a6e3..00000000 --- a/java/com/hmdzl/spspd/change/items/food/completefood/HoneyWater.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.food.completefood; - -import com.hmdzl.spspd.change.actors.buffs.Bleeding; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Cripple; -import com.hmdzl.spspd.change.actors.buffs.Poison; -import com.hmdzl.spspd.change.actors.buffs.Weakness; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.food.Food; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.watabou.utils.Random; - -public class HoneyWater extends CompleteFood { - - { - //name = "HoneyWater"; - image = ItemSpriteSheet.HONEYWATER; - - energy = 10; - hornValue = 2; - } - - @Override - public void execute(Hero hero, String action) { - - super.execute(hero, action); - - if (action.equals(AC_EAT)) { - hero.HT = hero.HT + (Random.Int(4, 8)); - //hero.HP = hero.HP+Math.min(((hero.HT-hero.HP)/2), hero.HT-hero.HP); - Buff.detach(hero, Poison.class); - Buff.detach(hero, Cripple.class); - Buff.detach(hero, Weakness.class); - Buff.detach(hero, Bleeding.class); - hero.sprite.emitter().start(Speck.factory(Speck.HEALING), 0.4f, 4); - - } - } - - @Override - public int price() { - return 100 * quantity; - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/items/food/completefood/Honeymeat.java b/java/com/hmdzl/spspd/change/items/food/completefood/Honeymeat.java deleted file mode 100644 index 37587b3d..00000000 --- a/java/com/hmdzl/spspd/change/items/food/completefood/Honeymeat.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.food.completefood; - -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.items.food.Food; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.watabou.utils.Random; - -public class Honeymeat extends CompleteFood { - - { - //name = "honeymeat"; - image = ItemSpriteSheet.HONEYMEAT; - energy = 150; - hornValue = 3; - - } - - public void execute(Hero hero, String action) { - - super.execute(hero, action); - - if (action.equals(AC_EAT)) { - hero.HT = hero.HT + (Random.Int(5, 10)); - //hero.HP = hero.HP+Math.min(((hero.HT-hero.HP)/2), hero.HT-hero.HP); - //Buff.detach(hero, Poison.class); - //Buff.detach(hero, Cripple.class); - //Buff.detach(hero, Weakness.class); - //Buff.detach(hero, Bleeding.class); - - //hero.sprite.emitter().start(Speck.factory(Speck.HEALING), 0.4f, 4); - - } - } - - @Override - public int price() { - return 2 * quantity; - } - -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/items/food/completefood/Honeyrice.java b/java/com/hmdzl/spspd/change/items/food/completefood/Honeyrice.java deleted file mode 100644 index 07d7af01..00000000 --- a/java/com/hmdzl/spspd/change/items/food/completefood/Honeyrice.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.food.completefood; - -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.items.food.Food; -import com.hmdzl.spspd.change.sprites.ItemSprite; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.watabou.utils.Random; - -public class Honeyrice extends CompleteFood { - - { - //name = "honeyrice"; - image = ItemSpriteSheet.RICE; - energy = 400; - hornValue = 3; - - } - - - private static ItemSprite.Glowing YELLOW = new ItemSprite.Glowing( 0xFFFF44 ); - - @Override - public ItemSprite.Glowing glowing() { - return YELLOW; - } - - public void execute(Hero hero, String action) { - - super.execute(hero, action); - - if (action.equals(AC_EAT)) { - hero.HT = hero.HT + (Random.Int(5, 10)); - //hero.HP = hero.HP+Math.min(((hero.HT-hero.HP)/2), hero.HT-hero.HP); - //Buff.detach(hero, Poison.class); - //Buff.detach(hero, Cripple.class); - //Buff.detach(hero, Weakness.class); - //Buff.detach(hero, Bleeding.class); - - //hero.sprite.emitter().start(Speck.factory(Speck.HEALING), 0.4f, 4); - - } - } - - @Override - public int price() { - return 4 * quantity; - } - -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/items/food/completefood/Icecream.java b/java/com/hmdzl/spspd/change/items/food/completefood/Icecream.java deleted file mode 100644 index 6491ba01..00000000 --- a/java/com/hmdzl/spspd/change/items/food/completefood/Icecream.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.food.completefood; - -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Burning; -import com.hmdzl.spspd.change.actors.buffs.Poison; -import com.hmdzl.spspd.change.actors.buffs.Weakness; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.food.Food; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.watabou.utils.Random; - -public class Icecream extends CompleteFood { - - { - //name = "icecream"; - image = ItemSpriteSheet.ICECREAM; - energy = 90; - hornValue = 3; - - } - - public void execute(Hero hero, String action) { - - super.execute(hero, action); - - if (action.equals(AC_EAT)) { - hero.HT = hero.HT + (Random.Int(5, 12)); - hero.HP = hero.HP+Math.min(((hero.HT-hero.HP)/2), hero.HT-hero.HP); - Buff.detach(hero, Poison.class); - Buff.detach(hero, Burning.class); - Buff.detach(hero, Weakness.class); - //Buff.detach(hero, Bleeding.class); - - hero.sprite.emitter().start(Speck.factory(Speck.HEALING), 0.4f, 4); - - } - } - - @Override - public int price() { - return 1 * quantity; - } - -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/items/food/completefood/Kebab.java b/java/com/hmdzl/spspd/change/items/food/completefood/Kebab.java deleted file mode 100644 index a50f0f3a..00000000 --- a/java/com/hmdzl/spspd/change/items/food/completefood/Kebab.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.food.completefood; - -import com.hmdzl.spspd.change.items.food.Food; -import com.hmdzl.spspd.change.sprites.ItemSprite; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; - -public class Kebab extends CompleteFood { - - { - //name = "kebab"; - image = ItemSpriteSheet.KEBAB; - energy = 330; - hornValue = 3; - - } - private static ItemSprite.Glowing BROWN = new ItemSprite.Glowing(0xCC6600); - - @Override - public ItemSprite.Glowing glowing() { - return BROWN; - } - @Override - public int price() { - return 5 * quantity; - } - -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/items/food/completefood/Meatroll.java b/java/com/hmdzl/spspd/change/items/food/completefood/Meatroll.java deleted file mode 100644 index 1141848b..00000000 --- a/java/com/hmdzl/spspd/change/items/food/completefood/Meatroll.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.food.completefood; - -import com.hmdzl.spspd.change.actors.buffs.Bleeding; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Cripple; -import com.hmdzl.spspd.change.actors.buffs.Poison; -import com.hmdzl.spspd.change.actors.buffs.Weakness; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.food.Food; -import com.hmdzl.spspd.change.sprites.ItemSprite; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.watabou.utils.Random; - -public class Meatroll extends CompleteFood { - - { - //name = "meatroll"; - image = ItemSpriteSheet.HOTDOG; - - energy = 250; - hornValue = 2; - } - - private static ItemSprite.Glowing BROWN = new ItemSprite.Glowing(0xCC6600); - - @Override - public ItemSprite.Glowing glowing() { - return BROWN; - } - - @Override - public int price() { - return 3 * quantity; - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/items/food/completefood/PerfectFood.java b/java/com/hmdzl/spspd/change/items/food/completefood/PerfectFood.java deleted file mode 100644 index d370dbec..00000000 --- a/java/com/hmdzl/spspd/change/items/food/completefood/PerfectFood.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.food.completefood; - -import com.hmdzl.spspd.change.actors.buffs.BerryRegeneration; -import com.hmdzl.spspd.change.actors.buffs.Bless; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Haste; -import com.hmdzl.spspd.change.actors.buffs.Levitation; -import com.hmdzl.spspd.change.actors.buffs.Light; -import com.hmdzl.spspd.change.actors.buffs.Recharging; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.food.Food; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfRecharging; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.watabou.utils.Random; - -public class PerfectFood extends CompleteFood { - - { - //name = "perfect food"; - image = ItemSpriteSheet.PERFECT_FOOD; - energy = 600; - hornValue = 10; - } - - @Override - public void execute(Hero hero, String action) { - super.execute(hero, action); - - if (action.equals(AC_EAT)){ - hero.HT = hero.HT + (Random.Int(4, 8)); - Buff.affect(hero, BerryRegeneration.class).level(10); - Buff.affect(hero, Bless.class,10f); - Buff.affect(hero, Light.class,50f); - hero.HP = Math.min(hero.HP + hero.HT/10, hero.HT); - Buff.affect(hero, Haste.class,5f); - Buff.affect(hero, Levitation.class,5f); - Buff.affect( hero, Recharging.class, 2f ); //half of a charge - ScrollOfRecharging.charge( hero ); - hero.sprite.emitter().start(Speck.factory(Speck.HEALING), 0.4f, 4); - } - } - - @Override - public int price() { - return 50 * quantity; - } - -} diff --git a/java/com/hmdzl/spspd/change/items/food/completefood/PetFood.java b/java/com/hmdzl/spspd/change/items/food/completefood/PetFood.java deleted file mode 100644 index 38c37b6e..00000000 --- a/java/com/hmdzl/spspd/change/items/food/completefood/PetFood.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.food.completefood; - -import com.hmdzl.spspd.change.items.food.Food; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; - -public class PetFood extends CompleteFood { - - { - //name = "PetFood"; - image = ItemSpriteSheet.PETFOOD; - energy = 10; - hornValue = 1; - - } - - @Override - public int price() { - return 1 * quantity; - } - -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/items/food/completefood/Porksoup.java b/java/com/hmdzl/spspd/change/items/food/completefood/Porksoup.java deleted file mode 100644 index ab0a1679..00000000 --- a/java/com/hmdzl/spspd/change/items/food/completefood/Porksoup.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.food.completefood; - -import com.hmdzl.spspd.change.actors.buffs.Bleeding; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Cripple; -import com.hmdzl.spspd.change.actors.buffs.Poison; -import com.hmdzl.spspd.change.actors.buffs.Weakness; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.items.food.Food; -import com.hmdzl.spspd.change.sprites.ItemSprite; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; - -public class Porksoup extends CompleteFood { - - { - //name = "porksoup"; - image = ItemSpriteSheet.MEATSOUP; - energy = 200; - hornValue = 3; - - } - private static ItemSprite.Glowing BROWN = new ItemSprite.Glowing(0xCC6600); - - @Override - public ItemSprite.Glowing glowing() { - return BROWN; - } - @Override - public int price() { - return 3 * quantity; - } - - public void execute(Hero hero, String action) { - super.execute(hero, action); - if (action.equals(AC_EAT)){ - Buff.detach(hero, Poison.class); - Buff.detach(hero, Cripple.class); - Buff.detach(hero, Weakness.class); - Buff.detach(hero, Bleeding.class); - } - } - -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/items/food/completefood/Ricefood.java b/java/com/hmdzl/spspd/change/items/food/completefood/Ricefood.java deleted file mode 100644 index 14ed66ee..00000000 --- a/java/com/hmdzl/spspd/change/items/food/completefood/Ricefood.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.food.completefood; - -import com.hmdzl.spspd.change.items.food.Food; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; - -public class Ricefood extends CompleteFood { - - { - //name = "rice"; - image = ItemSpriteSheet.RICE; - energy = 450; - hornValue = 3; - - } - - @Override - public int price() { - return 3 * quantity; - } - -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/items/food/completefood/Vegetablekebab.java b/java/com/hmdzl/spspd/change/items/food/completefood/Vegetablekebab.java deleted file mode 100644 index 427ef922..00000000 --- a/java/com/hmdzl/spspd/change/items/food/completefood/Vegetablekebab.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.food.completefood; - -import com.hmdzl.spspd.change.actors.buffs.Bleeding; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Cripple; -import com.hmdzl.spspd.change.actors.buffs.Poison; -import com.hmdzl.spspd.change.actors.buffs.Weakness; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.items.food.Food; -import com.hmdzl.spspd.change.sprites.ItemSprite; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; - -public class Vegetablekebab extends CompleteFood { - - { - //name = "vegetablekebab"; - image = ItemSpriteSheet.KEBAB; - energy = 150; - hornValue = 2; - - } - private static ItemSprite.Glowing GREEN = new ItemSprite.Glowing(0x22CC44); - @Override - public ItemSprite.Glowing glowing() { - return GREEN; - } - - @Override - public int price() { - return 2 * quantity; - } - - public void execute(Hero hero, String action) { - super.execute(hero, action); - if (action.equals(AC_EAT)){ - Buff.detach(hero, Poison.class); - Buff.detach(hero, Cripple.class); - Buff.detach(hero, Weakness.class); - Buff.detach(hero, Bleeding.class); - } - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/items/food/completefood/Vegetableroll.java b/java/com/hmdzl/spspd/change/items/food/completefood/Vegetableroll.java deleted file mode 100644 index c60ceaa4..00000000 --- a/java/com/hmdzl/spspd/change/items/food/completefood/Vegetableroll.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.food.completefood; - -import com.hmdzl.spspd.change.actors.buffs.Bleeding; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Cripple; -import com.hmdzl.spspd.change.actors.buffs.Poison; -import com.hmdzl.spspd.change.actors.buffs.Weakness; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.food.Food; -import com.hmdzl.spspd.change.sprites.ItemSprite; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.watabou.utils.Random; - -public class Vegetableroll extends CompleteFood { - - { - //name = "vegetableroll"; - image = ItemSpriteSheet.HOTDOG; - - energy = 170; - hornValue = 2; - } - private static ItemSprite.Glowing GREEN = new ItemSprite.Glowing(0x22CC44); - @Override - public ItemSprite.Glowing glowing() { - return GREEN; - } - - @Override - public int price() { - return 6 * quantity; - } - public void execute(Hero hero, String action) { - super.execute(hero, action); - if (action.equals(AC_EAT)){ - Buff.detach(hero, Poison.class); - Buff.detach(hero, Cripple.class); - Buff.detach(hero, Weakness.class); - Buff.detach(hero, Bleeding.class); - } - } - -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/items/food/completefood/Vegetablesoup.java b/java/com/hmdzl/spspd/change/items/food/completefood/Vegetablesoup.java deleted file mode 100644 index c7d62ca4..00000000 --- a/java/com/hmdzl/spspd/change/items/food/completefood/Vegetablesoup.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.food.completefood; - -import com.hmdzl.spspd.change.actors.buffs.Bleeding; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Cripple; -import com.hmdzl.spspd.change.actors.buffs.Poison; -import com.hmdzl.spspd.change.actors.buffs.Weakness; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.items.food.Food; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; - -public class Vegetablesoup extends CompleteFood { - - { - //name = "vegetablesoup"; - image = ItemSpriteSheet.VEGETABLESOUP; - energy = 90; - hornValue = 3; - - } - - @Override - public int price() { - return 1 * quantity; - } - - public void execute(Hero hero, String action) { - super.execute(hero, action); - if (action.equals(AC_EAT)){ - Buff.detach(hero, Poison.class); - Buff.detach(hero, Cripple.class); - Buff.detach(hero, Weakness.class); - Buff.detach(hero, Bleeding.class); - } - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/items/food/fruit/Blackberry.java b/java/com/hmdzl/spspd/change/items/food/fruit/Blackberry.java deleted file mode 100644 index c6379006..00000000 --- a/java/com/hmdzl/spspd/change/items/food/fruit/Blackberry.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.food.fruit; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.buffs.BerryRegeneration; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.MindVision; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.items.food.Food; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.utils.Random; - -public class Blackberry extends Fruit { - - { - //name = "dungeon black berry"; - image = ItemSpriteSheet.SEED_BLACKBERRY; - energy = 50; - hornValue = 1; - - } - - @Override - public void execute(Hero hero, String action) { - - super.execute(hero, action); - - if (action.equals(AC_EAT)) { - - switch (Random.Int(10)) { - case 1: - Buff.affect(hero, MindVision.class, MindVision.DURATION); - Dungeon.observe(); - Buff.affect(hero, BerryRegeneration.class).level(hero.HT); - GLog.w("The berry releases energy your body!"); - break; - case 0: case 2: case 3: case 4: case 5: - case 6: case 7: case 8: case 9: case 10: - GLog.w("The berry releases energy into your body!"); - Buff.affect(hero, BerryRegeneration.class).level(hero.HT/2); - break; - } - } - } - - @Override - public int price() { - return 10 * quantity; - } - - public Blackberry() { - this(1); - } - - public Blackberry(int value) { - this.quantity = value; - } -} diff --git a/java/com/hmdzl/spspd/change/items/food/fruit/Blandfruit.java b/java/com/hmdzl/spspd/change/items/food/fruit/Blandfruit.java deleted file mode 100644 index 89327f1d..00000000 --- a/java/com/hmdzl/spspd/change/items/food/fruit/Blandfruit.java +++ /dev/null @@ -1,255 +0,0 @@ -package com.hmdzl.spspd.change.items.food.fruit; - - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.FrostImbue; -import com.hmdzl.spspd.change.actors.buffs.Recharging; -import com.hmdzl.spspd.change.actors.buffs.EarthImbue; -import com.hmdzl.spspd.change.actors.buffs.FireImbue; -import com.hmdzl.spspd.change.actors.buffs.Hunger; -import com.hmdzl.spspd.change.actors.buffs.ToxicImbue; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.effects.SpellSprite; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.food.Food; -import com.hmdzl.spspd.change.items.food.meatfood.FrozenCarpaccio; -import com.hmdzl.spspd.change.items.potions.Potion; -import com.hmdzl.spspd.change.items.potions.PotionOfExperience; -import com.hmdzl.spspd.change.items.potions.PotionOfFrost; -import com.hmdzl.spspd.change.items.potions.PotionOfHealing; -import com.hmdzl.spspd.change.items.potions.PotionOfInvisibility; -import com.hmdzl.spspd.change.items.potions.PotionOfLevitation; -import com.hmdzl.spspd.change.items.potions.PotionOfLiquidFlame; -import com.hmdzl.spspd.change.items.potions.PotionOfMight; -import com.hmdzl.spspd.change.items.potions.PotionOfMindVision; -import com.hmdzl.spspd.change.items.potions.PotionOfOverHealing; -import com.hmdzl.spspd.change.items.potions.PotionOfParalyticGas; -import com.hmdzl.spspd.change.items.potions.PotionOfPurity; -import com.hmdzl.spspd.change.items.potions.PotionOfStrength; -import com.hmdzl.spspd.change.items.potions.PotionOfToxicGas; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfRecharging; -import com.hmdzl.spspd.change.plants.Blindweed; -import com.hmdzl.spspd.change.plants.Dreamfoil; -import com.hmdzl.spspd.change.plants.Earthroot; -import com.hmdzl.spspd.change.plants.Fadeleaf; -import com.hmdzl.spspd.change.plants.Firebloom; -import com.hmdzl.spspd.change.plants.Flytrap; -import com.hmdzl.spspd.change.plants.Icecap; -import com.hmdzl.spspd.change.plants.Phaseshift; -import com.hmdzl.spspd.change.plants.Plant.Seed; -import com.hmdzl.spspd.change.plants.Sorrowmoss; -import com.hmdzl.spspd.change.plants.Stormvine; -import com.hmdzl.spspd.change.plants.Sungrass; -import com.hmdzl.spspd.change.plants.Rotberry; -import com.hmdzl.spspd.change.sprites.ItemSprite; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundle; - -/** - * Created by debenhame on 12/08/2014. - */ -public class Blandfruit extends Fruit { - - public Potion potionAttrib = null; - public ItemSprite.Glowing potionGlow = null; - - { - //name = "Blandfruit"; - stackable = true; - image = ItemSpriteSheet.BLANDFRUIT; - energy = 50; - hornValue = 6; // only applies when blandfruit is cooked - - } - - @Override - public boolean isSimilar(Item item) { - if (item instanceof Blandfruit) { - if (potionAttrib == null) { - if (((Blandfruit) item).potionAttrib == null) - return true; - } else if (((Blandfruit) item).potionAttrib != null) { - if (((Blandfruit) item).potionAttrib.getClass() == potionAttrib - .getClass()) - return true; - } - } - return false; - } - - @Override - public void execute(Hero hero, String action) { - if (action.equals(AC_EAT)) { - - if (potionAttrib == null) { - - GLog.w( Messages.get(this, "raw")); - - } else { - - hero.buff(Hunger.class).satisfy(150); - - detach(hero.belongings.backpack); - - hero.spend(1f); - hero.busy(); - - if (potionAttrib instanceof PotionOfLiquidFlame) { - GLog.i(Messages.get(this, "fire_msg")); - Buff.affect(hero, FireImbue.class).set(FireImbue.DURATION); - } else if (potionAttrib instanceof PotionOfToxicGas) { - GLog.i(Messages.get(this, "toxic_msg")); - Buff.affect(hero, ToxicImbue.class) - .set(ToxicImbue.DURATION); - } else if (potionAttrib instanceof PotionOfParalyticGas) { - GLog.i(Messages.get(this, "para_msg")); - Buff.affect(hero, EarthImbue.class, EarthImbue.DURATION); - } else if (potionAttrib instanceof PotionOfFrost) { - GLog.i(Messages.get(this, "frost_msg")); - Buff.affect(hero, FrostImbue.class, FrostImbue.DURATION); - } else - potionAttrib.apply(hero); - - Sample.INSTANCE.play(Assets.SND_EAT); - SpellSprite.show(hero, SpellSprite.FOOD); - hero.sprite.operate(hero.pos); - - switch (hero.heroClass) { - case WARRIOR: - if (hero.HP < hero.HT) { - hero.HP = Math.min(hero.HP + 5, hero.HT); - hero.sprite.emitter().burst( - Speck.factory(Speck.HEALING), 1); - } - break; - case MAGE: - Buff.affect( hero, Recharging.class, 4f ); - ScrollOfRecharging.charge(hero); - break; - case ROGUE: - case HUNTRESS: - case PERFORMER: - case SOLDIER: - case FOLLOWER: - break; - } - } - } else { - super.execute(hero, action); - } - } - - @Override - public String desc() { - if (potionAttrib== null) return super.desc(); - else return Messages.get(this, "desc_cooked"); - } - - @Override - public int price() { - return 20 * quantity; - } - - public Item cook(Seed seed) { - - try { - return imbuePotion((Potion) seed.alchemyClass.newInstance()); - } catch (Exception e) { - return null; - } - - } - - public Item imbuePotion(Potion potion) { - - potionAttrib = potion; - potionAttrib.ownedByFruit = true; - - potionAttrib.image = ItemSpriteSheet.BLANDFRUIT; - - if (potionAttrib instanceof PotionOfHealing){ - name = Messages.get(this, "sunfruit"); - potionGlow = new ItemSprite.Glowing( 0x2EE62E ); - } else if (potionAttrib instanceof PotionOfStrength){ - name = Messages.get(this, "rotfruit"); - potionGlow = new ItemSprite.Glowing( 0xCC0022 ); - } else if (potionAttrib instanceof PotionOfParalyticGas){ - name = Messages.get(this, "earthfruit"); - potionGlow = new ItemSprite.Glowing( 0x67583D ); - } else if (potionAttrib instanceof PotionOfInvisibility){ - name = Messages.get(this, "blindfruit"); - potionGlow = new ItemSprite.Glowing( 0xE5D273 ); - } else if (potionAttrib instanceof PotionOfLiquidFlame){ - name = Messages.get(this, "firefruit"); - potionGlow = new ItemSprite.Glowing( 0xFF7F00 ); - } else if (potionAttrib instanceof PotionOfFrost){ - name = Messages.get(this, "icefruit"); - potionGlow = new ItemSprite.Glowing( 0x66B3FF ); - } else if (potionAttrib instanceof PotionOfMindVision){ - name = Messages.get(this, "fadefruit"); - potionGlow = new ItemSprite.Glowing( 0xB8E6CF ); - } else if (potionAttrib instanceof PotionOfToxicGas){ - name = Messages.get(this, "sorrowfruit"); - potionGlow = new ItemSprite.Glowing( 0xA15CE5 ); - } else if (potionAttrib instanceof PotionOfLevitation) { - name = Messages.get(this, "stormfruit"); - potionGlow = new ItemSprite.Glowing( 0x1C3A57 ); - } else if (potionAttrib instanceof PotionOfPurity) { - name = Messages.get(this, "dreamfruit"); - potionGlow = new ItemSprite.Glowing( 0x8E2975 ); - } else if (potionAttrib instanceof PotionOfExperience) { - name = Messages.get(this, "starfruit"); - potionGlow = new ItemSprite.Glowing( 0xA79400 ); - }else if (potionAttrib instanceof PotionOfOverHealing) { - name = Messages.get(this, "heartfruit"); - potionGlow = new ItemSprite.Glowing( 0xB20000 ); - - } - - return this; - } - - public static final String POTIONATTRIB = "potionattrib"; - - @Override - public void cast(final Hero user, int dst) { - if (potionAttrib instanceof PotionOfLiquidFlame - || potionAttrib instanceof PotionOfToxicGas - || potionAttrib instanceof PotionOfParalyticGas - || potionAttrib instanceof PotionOfFrost - || potionAttrib instanceof PotionOfLevitation - || potionAttrib instanceof PotionOfPurity) { - potionAttrib.cast(user, dst); - detach(user.belongings.backpack); - } else { - super.cast(user, dst); - } - - } - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(POTIONATTRIB, potionAttrib); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - if (bundle.contains(POTIONATTRIB)) { - imbuePotion((Potion) bundle.get(POTIONATTRIB)); - - } - } - - @Override - public ItemSprite.Glowing glowing() { - return potionGlow; - } - -} diff --git a/java/com/hmdzl/spspd/change/items/food/fruit/Blueberry.java b/java/com/hmdzl/spspd/change/items/food/fruit/Blueberry.java deleted file mode 100644 index c58d4c30..00000000 --- a/java/com/hmdzl/spspd/change/items/food/fruit/Blueberry.java +++ /dev/null @@ -1,159 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.food.fruit; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.buffs.Awareness; -import com.hmdzl.spspd.change.actors.buffs.BerryRegeneration; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.food.Food; -import com.hmdzl.spspd.change.items.misc.Spectacles.MagicSight; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.Terrain; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Random; - -public class Blueberry extends Fruit { - - { - //name = "dungeon blue berry"; - image = ItemSpriteSheet.SEED_BLUEBERRY; - energy = 50; - hornValue = 1; - - } - - - private static final String TXT_PREVENTING = Messages.get(Blueberry.class,"stop"); - - @Override - public void execute(Hero hero, String action) { - - super.execute(hero, action); - - if (action.equals(AC_EAT)) { - - if (Random.Float()<0.75f) { - - int length = Level.getLength(); - //int[] map = Dungeon.level.map; - boolean[] mapped = Dungeon.level.mapped; - boolean[] discoverable = Level.discoverable; - - //boolean noticed = false; - - for (int i = 0; i < length; i++) { - - //int terr = map[i]; - - if (discoverable[i]) { - - mapped[i] = true; - //if ((Terrain.flags[terr] & Terrain.SECRET) != 0) { - - //Level.set(i, Terrain.discover(terr)); - //GameScene.updateMap(i); - //Dungeon.level.discover( i ); - - //if (Dungeon.visible[i]) { - //GameScene.discoverTile(i, terr); - //discover(i); - - //noticed = true; - //} - //} - } - } - Dungeon.observe(); - - //if (noticed) { - //Sample.INSTANCE.play(Assets.SND_SECRET); - //} - - Buff.affect(hero, Awareness.class, 10f); - - } else { - - Buff.affect(hero, BerryRegeneration.class).level(hero.HT+hero.HT); - - int length = Level.getLength(); - int[] map = Dungeon.level.map; - boolean[] mapped = Dungeon.level.mapped; - boolean[] discoverable = Level.discoverable; - - boolean noticed = false; - - for (int i = 0; i < length; i++) { - - int terr = map[i]; - - if (discoverable[i]) { - - mapped[i] = true; - if ((Terrain.flags[terr] & Terrain.SECRET) != 0) { - - Dungeon.level.discover( i ); - - if (Dungeon.visible[i]) { - GameScene.discoverTile(i, terr); - discover(i); - - noticed = true; - } - } - } - } - Dungeon.observe(); - - if (noticed) { - Sample.INSTANCE.play(Assets.SND_SECRET); - } - - Buff.affect(hero, Awareness.class, 10f); - Dungeon.observe(); - - } - } - } - - public static void discover(int cell) { - CellEmitter.get(cell).start(Speck.factory(Speck.DISCOVER), 0.1f, 4); - } - - @Override - public int price() { - return 10 * quantity; - } - - public Blueberry() { - this(1); - } - - public Blueberry(int value) { - this.quantity = value; - } - -} diff --git a/java/com/hmdzl/spspd/change/items/food/fruit/Cloudberry.java b/java/com/hmdzl/spspd/change/items/food/fruit/Cloudberry.java deleted file mode 100644 index 97b39abb..00000000 --- a/java/com/hmdzl/spspd/change/items/food/fruit/Cloudberry.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.food.fruit; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.buffs.BerryRegeneration; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Haste; -import com.hmdzl.spspd.change.actors.buffs.Levitation; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.items.food.Food; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.watabou.utils.Random; - -public class Cloudberry extends Fruit { - - { - //name = "dungeon cloud berry"; - image = ItemSpriteSheet.SEED_CLOUDBERRY; - energy = 50; - hornValue = 1; - - } - - private int duration = 10; - @Override - public void execute(Hero hero, String action) { - - super.execute(hero, action); - - if (action.equals(AC_EAT)) { - - switch (Random.Int(10)) { - case 0: case 1: case 2: case 3: case 4: case 5: - Buff.affect(hero, Haste.class, Haste.DURATION); - break; - case 6: case 7: case 8: - Buff.affect(hero, Haste.class, Haste.DURATION); - if(Dungeon.depth<51){Buff.affect(hero, Levitation.class, duration); - } - - break; - case 9: case 10: - Buff.affect(hero, Haste.class, Haste.DURATION); - if(Dungeon.depth<51){Buff.affect(hero, Levitation.class, duration*2); - } - - Buff.affect(hero, BerryRegeneration.class).level(hero.HT); - break; - } - } - } - - @Override - public int price() { - return 5 * quantity; - } - - public Cloudberry() { - this(1); - } - - public Cloudberry(int value) { - this.quantity = value; - } -} diff --git a/java/com/hmdzl/spspd/change/items/food/fruit/Fruit.java b/java/com/hmdzl/spspd/change/items/food/fruit/Fruit.java deleted file mode 100644 index 584f756b..00000000 --- a/java/com/hmdzl/spspd/change/items/food/fruit/Fruit.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.food.fruit; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.Statistics; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Locked; -import com.hmdzl.spspd.change.actors.buffs.Recharging; -import com.hmdzl.spspd.change.actors.buffs.Hunger; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.effects.SpellSprite; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.food.Food; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfRecharging; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Random; - -public class Fruit extends Food { - - { - stackable = true; - //name = "ration of food"; - image = ItemSpriteSheet.RATION; - - - } - - -} diff --git a/java/com/hmdzl/spspd/change/items/food/fruit/FullMoonberry.java b/java/com/hmdzl/spspd/change/items/food/fruit/FullMoonberry.java deleted file mode 100644 index cab59831..00000000 --- a/java/com/hmdzl/spspd/change/items/food/fruit/FullMoonberry.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.food.fruit; - -import com.hmdzl.spspd.change.actors.buffs.Barkskin; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.FullMoonStrength; -import com.hmdzl.spspd.change.actors.buffs.Light; -import com.hmdzl.spspd.change.actors.buffs.Strength; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.items.food.Food; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.watabou.utils.Random; - -public class FullMoonberry extends Fruit { - - { - //name = "dungeon full moon berry"; - image = ItemSpriteSheet.SEED_FULLMOONBERRY; - energy = 50; - hornValue = 1; - - } - - @Override - public void execute(Hero hero, String action) { - - super.execute(hero, action); - - if (action.equals(AC_EAT)) { - - switch (Random.Int(2)) { - case 0: - Buff.affect(hero, Strength.class); - Buff.affect(hero, FullMoonStrength.class); - Buff.affect(hero, Light.class, Light.DURATION); - break; - case 1: - Buff.affect(hero, Strength.class); - Buff.affect(hero, FullMoonStrength.class); - Buff.affect(hero, Barkskin.class).level(hero.HT*2); - Buff.affect(hero, Light.class, Light.DURATION); - break; - } - } - } - - - @Override - public int price() { - return 5 * quantity; - } - - public FullMoonberry() { - this(1); - } - - public FullMoonberry(int value) { - this.quantity = value; - } -} diff --git a/java/com/hmdzl/spspd/change/items/food/fruit/Moonberry.java b/java/com/hmdzl/spspd/change/items/food/fruit/Moonberry.java deleted file mode 100644 index ea8e4ed5..00000000 --- a/java/com/hmdzl/spspd/change/items/food/fruit/Moonberry.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.food.fruit; - -import com.hmdzl.spspd.change.actors.buffs.Barkskin; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Strength; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.items.food.Food; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.watabou.utils.Random; - -public class Moonberry extends Fruit { - - { - //name = "dungeon moon berry"; - image = ItemSpriteSheet.SEED_MOONBERRY; - energy = 50; - hornValue = 1; - - } - - @Override - public void execute(Hero hero, String action) { - - super.execute(hero, action); - - if (action.equals(AC_EAT)) { - - switch (Random.Int(2)) { - case 0: - Buff.affect(hero, Strength.class); - break; - case 1: - Buff.affect(hero, Strength.class); - Buff.affect(hero, Barkskin.class).level(hero.HT*2); - break; - } - } - } - - @Override - public int price() { - return 10 * quantity; - } - - public Moonberry() { - this(1); - } - - public Moonberry(int value) { - this.quantity = value; - } -} diff --git a/java/com/hmdzl/spspd/change/items/food/meatfood/ChargrilledMeat.java b/java/com/hmdzl/spspd/change/items/food/meatfood/ChargrilledMeat.java deleted file mode 100644 index bc3f778e..00000000 --- a/java/com/hmdzl/spspd/change/items/food/meatfood/ChargrilledMeat.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.food.meatfood; - -import com.hmdzl.spspd.change.items.food.Food; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; - -public class ChargrilledMeat extends MeatFood { - - { - //name = "chargrilled meat"; - image = ItemSpriteSheet.STEAK; - energy = 100; - hornValue = 1; - - } - - @Override - public int price() { - return 2 * quantity; - } - - public static Food cook(MysteryMeat ingredient) { - ChargrilledMeat result = new ChargrilledMeat(); - result.quantity = ingredient.quantity(); - return result; - } - - public static Food cook(Meat ingredient) { - ChargrilledMeat result = new ChargrilledMeat(); - result.quantity = ingredient.quantity(); - return result; - } -} diff --git a/java/com/hmdzl/spspd/change/items/food/meatfood/FrozenCarpaccio.java b/java/com/hmdzl/spspd/change/items/food/meatfood/FrozenCarpaccio.java deleted file mode 100644 index 98a13eaa..00000000 --- a/java/com/hmdzl/spspd/change/items/food/meatfood/FrozenCarpaccio.java +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.food.meatfood; - -import com.hmdzl.spspd.change.actors.buffs.Barkskin; -import com.hmdzl.spspd.change.actors.buffs.Bleeding; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Cripple; -import com.hmdzl.spspd.change.actors.buffs.Drowsy; -import com.hmdzl.spspd.change.actors.buffs.Invisibility; -import com.hmdzl.spspd.change.actors.buffs.Poison; -import com.hmdzl.spspd.change.actors.buffs.Slow; -import com.hmdzl.spspd.change.actors.buffs.Vertigo; -import com.hmdzl.spspd.change.actors.buffs.Weakness; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.food.Food; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.utils.Random; - -public class FrozenCarpaccio extends MeatFood { - - { - //name = "frozen carpaccio"; - image = ItemSpriteSheet.CARPACCIO; - energy = 85; - hornValue = 1; - } - - @Override - public void execute(Hero hero, String action) { - - super.execute(hero, action); - - if (action.equals(AC_EAT)) { - effect(hero); - } - } - - @Override - public int price() { - return 3 * quantity; - }; - - public static void effect(Hero hero){ - switch (Random.Int( 5 )) { - case 0: - GLog.i( Messages.get(FrozenCarpaccio.class, "invisbility") ); - Buff.affect( hero, Invisibility.class, Invisibility.DURATION ); - break; - case 1: - GLog.i( Messages.get(FrozenCarpaccio.class, "hard") ); - Buff.affect( hero, Barkskin.class ).level( hero.HT / 4 ); - break; - case 2: - GLog.i( Messages.get(FrozenCarpaccio.class, "refresh") ); - Buff.detach( hero, Poison.class ); - Buff.detach( hero, Cripple.class ); - Buff.detach( hero, Weakness.class ); - Buff.detach( hero, Bleeding.class ); - Buff.detach( hero, Drowsy.class ); - Buff.detach( hero, Slow.class ); - Buff.detach( hero, Vertigo.class); - break; - case 3: - GLog.i( Messages.get(FrozenCarpaccio.class, "better") ); - if (hero.HP < hero.HT) { - hero.HP = Math.min( hero.HP + hero.HT / 4, hero.HT ); - hero.sprite.emitter().burst( Speck.factory( Speck.HEALING ), 1 ); - } - break; - } - } - - public static Food cook(MysteryMeat ingredient) { - FrozenCarpaccio result = new FrozenCarpaccio(); - result.quantity = ingredient.quantity(); - return result; - } - public static Food cook(Meat ingredient) { - FrozenCarpaccio result = new FrozenCarpaccio(); - result.quantity = ingredient.quantity(); - return result; - } -} diff --git a/java/com/hmdzl/spspd/change/items/food/meatfood/Meat.java b/java/com/hmdzl/spspd/change/items/food/meatfood/Meat.java deleted file mode 100644 index 27dd2aa5..00000000 --- a/java/com/hmdzl/spspd/change/items/food/meatfood/Meat.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.food.meatfood; - -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Poison; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.items.food.Food; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.utils.Random; - -public class Meat extends MeatFood { - - { - //name = "monster meat"; - image = ItemSpriteSheet.MEAT; - energy = 100; - hornValue = 1; - - } - - @Override - public void execute(Hero hero, String action) { - - super.execute(hero, action); - - if (action.equals(AC_EAT)) { - - switch (Random.Int(15)) { - case 0: - GLog.w(Messages.get(this,"bad")); - Buff.affect(hero, Poison.class).set( - Poison.durationFactor(hero) * hero.HT / 5); - break; - } - } - } - - @Override - public int price() { - return 2 * quantity; - } - -} diff --git a/java/com/hmdzl/spspd/change/items/food/meatfood/MeatFood.java b/java/com/hmdzl/spspd/change/items/food/meatfood/MeatFood.java deleted file mode 100644 index 8a74d8a8..00000000 --- a/java/com/hmdzl/spspd/change/items/food/meatfood/MeatFood.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.food.meatfood; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.Statistics; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Locked; -import com.hmdzl.spspd.change.actors.buffs.Recharging; -import com.hmdzl.spspd.change.actors.buffs.Hunger; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.effects.SpellSprite; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.food.Food; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfRecharging; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Random; - -public class MeatFood extends Food { - - { - stackable = true; - //name = "ration of food"; - image = ItemSpriteSheet.RATION; - - - } - - -} diff --git a/java/com/hmdzl/spspd/change/items/food/meatfood/MysteryMeat.java b/java/com/hmdzl/spspd/change/items/food/meatfood/MysteryMeat.java deleted file mode 100644 index 15c33b86..00000000 --- a/java/com/hmdzl/spspd/change/items/food/meatfood/MysteryMeat.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.food.meatfood; - -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Burning; -import com.hmdzl.spspd.change.actors.buffs.Paralysis; -import com.hmdzl.spspd.change.actors.buffs.Poison; -import com.hmdzl.spspd.change.actors.buffs.Roots; -import com.hmdzl.spspd.change.actors.buffs.Slow; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.items.food.Food; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.utils.Random; - -public class MysteryMeat extends MeatFood { - - { - //name = "mystery meat"; - image = ItemSpriteSheet.MYSTERYMEAT; - energy = 75; - hornValue = 1; - } - - @Override - public void execute(Hero hero, String action) { - - super.execute(hero, action); - - if (action.equals(AC_EAT)) { - - switch (Random.Int(5)) { - case 0: - GLog.w(Messages.get(this,"hot")); - Buff.affect(hero, Burning.class).reignite(hero); - break; - case 1: - GLog.w(Messages.get(this,"legs")); - Buff.prolong(hero, Roots.class, Paralysis.duration(hero)); - break; - case 2: - GLog.w(Messages.get(this,"bad")); - Buff.affect(hero, Poison.class).set( - Poison.durationFactor(hero) * hero.HT / 5); - break; - case 3: - GLog.w(Messages.get(this,"stuffed")); - Buff.prolong(hero, Slow.class, Slow.duration(hero)); - break; - } - } - } - - @Override - public int price() { - return 2 * quantity; - }; -} diff --git a/java/com/hmdzl/spspd/change/items/food/staplefood/NormalRation.java b/java/com/hmdzl/spspd/change/items/food/staplefood/NormalRation.java deleted file mode 100644 index c7e1f9ee..00000000 --- a/java/com/hmdzl/spspd/change/items/food/staplefood/NormalRation.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.food.staplefood; - -import com.hmdzl.spspd.change.items.food.Food; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; - -public class NormalRation extends StapleFood { - - { - //name = "ration food "; - image = ItemSpriteSheet.RATION; - energy = 300; - hornValue = 3; - } - - - @Override - public int price() { - return 5 * quantity; - } -} diff --git a/java/com/hmdzl/spspd/change/items/food/staplefood/OverpricedRation.java b/java/com/hmdzl/spspd/change/items/food/staplefood/OverpricedRation.java deleted file mode 100644 index 7855935f..00000000 --- a/java/com/hmdzl/spspd/change/items/food/staplefood/OverpricedRation.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.food.staplefood; - -import com.hmdzl.spspd.change.items.food.Food; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; - -public class OverpricedRation extends StapleFood { - - { - //name = "overpriced food ration"; - image = ItemSpriteSheet.OVERPRICED; - energy = 200; - hornValue = 2; - } - - - @Override - public int price() { - return 3 * quantity; - } -} diff --git a/java/com/hmdzl/spspd/change/items/food/staplefood/Pasty.java b/java/com/hmdzl/spspd/change/items/food/staplefood/Pasty.java deleted file mode 100644 index 20b0b6a7..00000000 --- a/java/com/hmdzl/spspd/change/items/food/staplefood/Pasty.java +++ /dev/null @@ -1,236 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.food.staplefood; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.buffs.BerryRegeneration; -import com.hmdzl.spspd.change.actors.buffs.Bless; -import com.hmdzl.spspd.change.actors.buffs.Blindness; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Haste; -import com.hmdzl.spspd.change.actors.buffs.Hunger; -import com.hmdzl.spspd.change.actors.buffs.Levitation; -import com.hmdzl.spspd.change.actors.buffs.Light; -import com.hmdzl.spspd.change.actors.buffs.MindVision; -import com.hmdzl.spspd.change.actors.buffs.Recharging; -import com.hmdzl.spspd.change.actors.buffs.Regeneration; -import com.hmdzl.spspd.change.actors.buffs.Vertigo; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.effects.particles.FlameParticle; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfRecharging; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.particles.Emitter; - -import java.util.Calendar; - -import static com.hmdzl.spspd.change.Dungeon.hero; - -public class Pasty extends StapleFood { - - //TODO: implement fun stuff for other holidays - //TODO: probably should externalize this if I want to add any more festive stuff. - private enum Holiday{ - NONE, - SPRING, - STUDENT, - EASTER, //TBD - HWEEN,//2nd week of october though first day of november - THANK, - XMAS, //3rd week of december through first week of january - CHILD, - WORKER - } - - private static Holiday holiday; - - static{ - - holiday = Holiday.NONE; - - final Calendar calendar = Calendar.getInstance(); - switch(calendar.get(Calendar.MONTH)){ - case Calendar.JANUARY: - if (calendar.get(Calendar.WEEK_OF_MONTH) == 1) - holiday = Holiday.XMAS; - if (calendar.get(Calendar.DAY_OF_MONTH) >=18) - holiday = Holiday.SPRING; - break; - case Calendar.FEBRUARY: - if(calendar.get(Calendar.DAY_OF_MONTH)<=28) - holiday = Holiday.SPRING; - break; - case Calendar.APRIL: - holiday = Holiday.EASTER; - break; - case Calendar.MAY: - if(calendar.get(Calendar.DAY_OF_MONTH)<=7) - holiday = Holiday.WORKER; - break; - case Calendar.JUNE: - if(calendar.get(Calendar.DAY_OF_MONTH)<=3) - holiday = Holiday.CHILD; - break; - case Calendar.JULY: - case Calendar.AUGUST: - holiday = Holiday.STUDENT; - break; - case Calendar.OCTOBER: - if (calendar.get(Calendar.WEEK_OF_MONTH) >= 2) - holiday = Holiday.HWEEN; - break; - case Calendar.NOVEMBER: - if (calendar.get(Calendar.DAY_OF_MONTH) == 1) - holiday = Holiday.HWEEN; - if (calendar.get(Calendar.WEEK_OF_MONTH) >= 2) - holiday = Holiday.THANK; - break; - case Calendar.DECEMBER: - if (calendar.get(Calendar.WEEK_OF_MONTH) <= 1) - holiday = Holiday.THANK; - if (calendar.get(Calendar.WEEK_OF_MONTH) >= 3) - holiday = Holiday.XMAS; - break; - } - } - - { - switch(holiday){ - case NONE: - name = Messages.get(this, "pasty"); - image = ItemSpriteSheet.PASTY; - break; - case SPRING: - name = Messages.get(this,"assorted"); - image = ItemSpriteSheet.SPRING_ASSORTED; - break; - case EASTER: - name = Messages.get(this,"egg"); - image = ItemSpriteSheet.EASTER_EGG; - break; - case STUDENT: - name = Messages.get(this,"book"); - image = ItemSpriteSheet.KNOWNLADGE_FOOD; - break; - case HWEEN: - name = Messages.get(this, "pie"); - image = ItemSpriteSheet.PUMPKIN_PIE; - break; - case THANK: - name = Messages.get(this, "turkey"); - image = ItemSpriteSheet.TURKEY_MEAT; - break; - case XMAS: - name = Messages.get(this, "cane"); - image = ItemSpriteSheet.CANDY_CANE; - break; - case WORKER: - name = Messages.get(this, "bread"); - image = ItemSpriteSheet.BRICK; - break; - case CHILD: - name = Messages.get(this, "jelly"); - image = ItemSpriteSheet.JELLY_SWORD; - break; - } - - energy = 400; - - - } - - @Override - public void execute(Hero hero, String action) { - super.execute(hero, action); - - if (action.equals(AC_EAT)){ - switch(holiday){ - case NONE: - break; //do nothing extra - case SPRING: - Buff.affect(hero, BerryRegeneration.class).level(5); - hero.sprite.emitter().burst( Speck.factory( Speck.HEALING ), 1 ); - break; - case EASTER: - Buff.affect(hero, Bless.class,5f); - hero.sprite.emitter().start(Speck.factory(Speck.UP), 0.2f, 3); - break; - case STUDENT: - Buff.affect(hero, Light.class,50f); - Buff.affect(hero, MindVision.class,50f); - hero.sprite.emitter().start(FlameParticle.FACTORY, 0.2f, 3); - break; - case HWEEN: - //heals for 10% max hp - hero.HP = Math.min(hero.HP + hero.HT/10, hero.HT); - hero.sprite.emitter().burst( Speck.factory( Speck.HEALING ), 1 ); - break; - case THANK: - Buff.affect(hero, Haste.class,5f); - Buff.affect(hero, Levitation.class,5f); - break; - case XMAS: - Buff.affect( hero, Recharging.class, 2f ); //half of a charge - ScrollOfRecharging.charge( hero ); - break; - case WORKER: - Dungeon.gold +=500; - GLog.p(Messages.get(Pasty.class,"worker")); - break; - case CHILD: - hero.HP = hero.HT; - hero.HT +=3; - Buff.affect(hero,Blindness.class, 20f); - Buff.affect(hero,Vertigo.class, 20f); - break; - } - } - } - - @Override - public String info() { - switch(holiday){ - case NONE: default: - return Messages.get(this, "pasty_desc"); - case SPRING: - return Messages.get(this, "assorted_desc"); - case EASTER: - return Messages.get(this, "egg_desc"); - case STUDENT: - return Messages.get(this, "book_desc"); - case HWEEN: - return Messages.get(this, "pie_desc"); - case THANK: - return Messages.get(this, "turkey_desc"); - case XMAS: - return Messages.get(this, "cane_desc"); - case WORKER: - return Messages.get(this, "bread_desc"); - case CHILD: - return Messages.get(this, "jelly_desc"); - } - } - - @Override - public int price() { - return 100 * quantity; - } -} diff --git a/java/com/hmdzl/spspd/change/items/food/staplefood/StapleFood.java b/java/com/hmdzl/spspd/change/items/food/staplefood/StapleFood.java deleted file mode 100644 index da248e09..00000000 --- a/java/com/hmdzl/spspd/change/items/food/staplefood/StapleFood.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.food.staplefood; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.Statistics; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Locked; -import com.hmdzl.spspd.change.actors.buffs.Recharging; -import com.hmdzl.spspd.change.actors.buffs.Hunger; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.effects.SpellSprite; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.food.Food; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfRecharging; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Random; - -public class StapleFood extends Food { - - { - stackable = true; - //name = "ration of food"; - image = ItemSpriteSheet.RATION; - - - } - - -} diff --git a/java/com/hmdzl/spspd/change/items/food/vegetable/BattleFlower.java b/java/com/hmdzl/spspd/change/items/food/vegetable/BattleFlower.java deleted file mode 100644 index d3514b03..00000000 --- a/java/com/hmdzl/spspd/change/items/food/vegetable/BattleFlower.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.food.vegetable; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.Statistics; -import com.hmdzl.spspd.change.actors.buffs.Arcane; -import com.hmdzl.spspd.change.actors.buffs.AttackUp; -import com.hmdzl.spspd.change.actors.buffs.Bleeding; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Cripple; -import com.hmdzl.spspd.change.actors.buffs.DefenceUp; -import com.hmdzl.spspd.change.actors.buffs.Locked; -import com.hmdzl.spspd.change.actors.buffs.Poison; -import com.hmdzl.spspd.change.actors.buffs.Recharging; -import com.hmdzl.spspd.change.actors.buffs.Hunger; -import com.hmdzl.spspd.change.actors.buffs.TargetShoot; -import com.hmdzl.spspd.change.actors.buffs.Weakness; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.effects.SpellSprite; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.food.Food; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfRecharging; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Random; - -public class BattleFlower extends Vegetable { - - { - stackable = true; - //name = "ration of food"; - image = ItemSpriteSheet.STAR_FLOWER; - energy = 20; - hornValue = 1; - - } - - @Override - public void execute(Hero hero, String action) { - super.execute(hero, action); - - if (action.equals(AC_EAT)){ - Buff.affect(hero, AttackUp.class,30f).level(25); - Buff.affect(hero, DefenceUp.class,30f).level(25); - Buff.affect(hero, Arcane.class,30f); - Buff.affect(hero, TargetShoot.class,30f); - } - } - - @Override - public int price() { - return 1 * quantity; - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/items/food/vegetable/DreamLeaf.java b/java/com/hmdzl/spspd/change/items/food/vegetable/DreamLeaf.java deleted file mode 100644 index 99b659f1..00000000 --- a/java/com/hmdzl/spspd/change/items/food/vegetable/DreamLeaf.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.food.vegetable; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.Statistics; -import com.hmdzl.spspd.change.actors.buffs.ArmorBreak; -import com.hmdzl.spspd.change.actors.buffs.AttackDown; -import com.hmdzl.spspd.change.actors.buffs.Bleeding; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Cripple; -import com.hmdzl.spspd.change.actors.buffs.Locked; -import com.hmdzl.spspd.change.actors.buffs.Poison; -import com.hmdzl.spspd.change.actors.buffs.Recharging; -import com.hmdzl.spspd.change.actors.buffs.Hunger; -import com.hmdzl.spspd.change.actors.buffs.Weakness; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.effects.SpellSprite; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.food.Food; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfRecharging; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Random; - -public class DreamLeaf extends Vegetable { - - { - stackable = true; - //name = "ration of food"; - image = ItemSpriteSheet.DREAM_L; - energy = 20; - hornValue = 1; - - } - - @Override - public void execute(Hero hero, String action) { - super.execute(hero, action); - - if (action.equals(AC_EAT)){ - Buff.detach(hero, Poison.class); - Buff.detach(hero, Cripple.class); - Buff.detach(hero, Weakness.class); - Buff.detach(hero, Bleeding.class); - Buff.detach(hero, AttackDown.class); - Buff.detach(hero, ArmorBreak.class); - } - } - - @Override - public int price() { - return 1 * quantity; - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/items/food/vegetable/HealGrass.java b/java/com/hmdzl/spspd/change/items/food/vegetable/HealGrass.java deleted file mode 100644 index a2d07b9f..00000000 --- a/java/com/hmdzl/spspd/change/items/food/vegetable/HealGrass.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.food.vegetable; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.Statistics; -import com.hmdzl.spspd.change.actors.buffs.BerryRegeneration; -import com.hmdzl.spspd.change.actors.buffs.Bleeding; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Cripple; -import com.hmdzl.spspd.change.actors.buffs.Locked; -import com.hmdzl.spspd.change.actors.buffs.Poison; -import com.hmdzl.spspd.change.actors.buffs.Recharging; -import com.hmdzl.spspd.change.actors.buffs.Hunger; -import com.hmdzl.spspd.change.actors.buffs.Weakness; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.effects.SpellSprite; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.food.Food; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfRecharging; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Random; - -public class HealGrass extends Vegetable { - - { - stackable = true; - //name = "ration of food"; - image = ItemSpriteSheet.HEAL_L; - energy = 20; - hornValue = 1; - - } - - @Override - public void execute(Hero hero, String action) { - super.execute(hero, action); - - if (action.equals(AC_EAT)){ - hero.HP = Math.min(hero.HP + hero.HT/5, hero.HT); - Buff.affect(hero, BerryRegeneration.class).level(20); - } - } - - @Override - public int price() { - return 1 * quantity; - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/items/food/vegetable/NutVegetable.java b/java/com/hmdzl/spspd/change/items/food/vegetable/NutVegetable.java deleted file mode 100644 index 4cb908c3..00000000 --- a/java/com/hmdzl/spspd/change/items/food/vegetable/NutVegetable.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.food.vegetable; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.Statistics; -import com.hmdzl.spspd.change.actors.buffs.Barkskin; -import com.hmdzl.spspd.change.actors.buffs.Bleeding; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Cripple; -import com.hmdzl.spspd.change.actors.buffs.Locked; -import com.hmdzl.spspd.change.actors.buffs.Poison; -import com.hmdzl.spspd.change.actors.buffs.Recharging; -import com.hmdzl.spspd.change.actors.buffs.Hunger; -import com.hmdzl.spspd.change.actors.buffs.Weakness; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.effects.SpellSprite; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.food.Food; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfRecharging; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Random; - -public class NutVegetable extends Vegetable { - - { - stackable = true; - //name = "ration of food"; - image = ItemSpriteSheet.EAT_GRASS; - energy = 20; - hornValue = 1; - - } - - @Override - public void execute(Hero hero, String action) { - super.execute(hero, action); - - if (action.equals(AC_EAT)){ - Buff.affect(hero, Barkskin.class).level(hero.HT ); - } - } - - @Override - public int price() { - return 1 * quantity; - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/items/food/vegetable/Vegetable.java b/java/com/hmdzl/spspd/change/items/food/vegetable/Vegetable.java deleted file mode 100644 index 0f1440cd..00000000 --- a/java/com/hmdzl/spspd/change/items/food/vegetable/Vegetable.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.food.vegetable; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.Statistics; -import com.hmdzl.spspd.change.actors.buffs.Bleeding; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Cripple; -import com.hmdzl.spspd.change.actors.buffs.Locked; -import com.hmdzl.spspd.change.actors.buffs.Poison; -import com.hmdzl.spspd.change.actors.buffs.Recharging; -import com.hmdzl.spspd.change.actors.buffs.Hunger; -import com.hmdzl.spspd.change.actors.buffs.Weakness; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.effects.SpellSprite; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.food.Food; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfRecharging; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Random; - -public class Vegetable extends Food { - - { - stackable = true; - //name = "ration of food"; - image = ItemSpriteSheet.EAT_GRASS; - - } - -} diff --git a/java/com/hmdzl/spspd/change/items/journalpages/EnergyCore.java b/java/com/hmdzl/spspd/change/items/journalpages/EnergyCore.java deleted file mode 100644 index 9ef35d71..00000000 --- a/java/com/hmdzl/spspd/change/items/journalpages/EnergyCore.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.journalpages; - -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; - -public class EnergyCore extends JournalPage { - - - { - //name = "journal page Otiluke"; - image = ItemSpriteSheet.JOURNAL_PAGE; - room=7; - - stackable = false; - } -} diff --git a/java/com/hmdzl/spspd/change/items/journalpages/JournalPage.java b/java/com/hmdzl/spspd/change/items/journalpages/JournalPage.java deleted file mode 100644 index 328e69c9..00000000 --- a/java/com/hmdzl/spspd/change/items/journalpages/JournalPage.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.journalpages; - -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; - -public class JournalPage extends Item { - - private static final String TXT_VALUE = "Journal Page"; - public int room; - - { - //name = "journal page"; - image = ItemSpriteSheet.JOURNAL_PAGE; - - stackable = false; - unique = true; - } - - @Override - public boolean isUpgradable() { - return false; - } - - @Override - public boolean isIdentified() { - return true; - } - - @Override - public int price() { - return 150 * quantity; - } - -} diff --git a/java/com/hmdzl/spspd/change/items/journalpages/SafeSpotPage.java b/java/com/hmdzl/spspd/change/items/journalpages/SafeSpotPage.java deleted file mode 100644 index 93ae618d..00000000 --- a/java/com/hmdzl/spspd/change/items/journalpages/SafeSpotPage.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.journalpages; - -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; - -public class SafeSpotPage extends JournalPage { - - { - //name = "safe spot"; - image = ItemSpriteSheet.JOURNAL_PAGE; - room=0; - - stackable = false; - } -} diff --git a/java/com/hmdzl/spspd/change/items/journalpages/Sokoban1.java b/java/com/hmdzl/spspd/change/items/journalpages/Sokoban1.java deleted file mode 100644 index 4969a206..00000000 --- a/java/com/hmdzl/spspd/change/items/journalpages/Sokoban1.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.journalpages; - -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; - -public class Sokoban1 extends JournalPage { - - { - //name = "journal page sokoban practice"; - image = ItemSpriteSheet.JOURNAL_PAGE; - room=1; - - stackable = false; - } -} diff --git a/java/com/hmdzl/spspd/change/items/journalpages/Sokoban2.java b/java/com/hmdzl/spspd/change/items/journalpages/Sokoban2.java deleted file mode 100644 index 852e07f5..00000000 --- a/java/com/hmdzl/spspd/change/items/journalpages/Sokoban2.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.journalpages; - -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; - -public class Sokoban2 extends JournalPage { - - { - //name = "journal page sokoban castle"; - image = ItemSpriteSheet.JOURNAL_PAGE; - room=2; - - stackable = false; - } -} diff --git a/java/com/hmdzl/spspd/change/items/journalpages/Sokoban3.java b/java/com/hmdzl/spspd/change/items/journalpages/Sokoban3.java deleted file mode 100644 index e97277ad..00000000 --- a/java/com/hmdzl/spspd/change/items/journalpages/Sokoban3.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.journalpages; - -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; - -public class Sokoban3 extends JournalPage { - - - { - //name = "journal page sokoban portals"; - image = ItemSpriteSheet.JOURNAL_PAGE; - room=3; - - stackable = false; - } -} diff --git a/java/com/hmdzl/spspd/change/items/journalpages/Sokoban4.java b/java/com/hmdzl/spspd/change/items/journalpages/Sokoban4.java deleted file mode 100644 index eb2ae2d6..00000000 --- a/java/com/hmdzl/spspd/change/items/journalpages/Sokoban4.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.journalpages; - -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; - -public class Sokoban4 extends JournalPage { - - - { - //name = "journal page sokoban puzzles"; - image = ItemSpriteSheet.JOURNAL_PAGE; - room=4; - - stackable = false; - } -} diff --git a/java/com/hmdzl/spspd/change/items/journalpages/Town.java b/java/com/hmdzl/spspd/change/items/journalpages/Town.java deleted file mode 100644 index c4569c5e..00000000 --- a/java/com/hmdzl/spspd/change/items/journalpages/Town.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.journalpages; - -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; - -public class Town extends JournalPage { - - { - //name = "journal page Dolyahaven"; - image = ItemSpriteSheet.JOURNAL_PAGE; - room=5; - - stackable = false; - } - -} diff --git a/java/com/hmdzl/spspd/change/items/journalpages/Vault.java b/java/com/hmdzl/spspd/change/items/journalpages/Vault.java deleted file mode 100644 index a023bd7d..00000000 --- a/java/com/hmdzl/spspd/change/items/journalpages/Vault.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.journalpages; - -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; - -public class Vault extends JournalPage { - - { - //name = "journal page vault"; - image = ItemSpriteSheet.JOURNAL_PAGE; - room=6; - - stackable = false; - } - - -} diff --git a/java/com/hmdzl/spspd/change/items/keys/GoldenKey.java b/java/com/hmdzl/spspd/change/items/keys/GoldenKey.java deleted file mode 100644 index bf75750f..00000000 --- a/java/com/hmdzl/spspd/change/items/keys/GoldenKey.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.keys; - -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; - -public class GoldenKey extends Key { - - { - image = ItemSpriteSheet.GOLDEN_KEY; - } - - public GoldenKey() { - this(0); - } - - public GoldenKey(int depth) { - super(); - this.depth = depth; - } -} diff --git a/java/com/hmdzl/spspd/change/items/keys/GoldenSkeletonKey.java b/java/com/hmdzl/spspd/change/items/keys/GoldenSkeletonKey.java deleted file mode 100644 index bc4396b5..00000000 --- a/java/com/hmdzl/spspd/change/items/keys/GoldenSkeletonKey.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.keys; - -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.sprites.ItemSprite.Glowing; - -public class GoldenSkeletonKey extends Key { - - { - //name = "golden skeleton key"; - image = ItemSpriteSheet.SPKEY; - } - - public GoldenSkeletonKey() { - this(0); - } - - public GoldenSkeletonKey(int depth) { - super(); - this.depth = depth; - } - - private static final Glowing WHITE = new Glowing(0xFFFFCC); - - @Override - public Glowing glowing() { - return WHITE; - } -} diff --git a/java/com/hmdzl/spspd/change/items/keys/IronKey.java b/java/com/hmdzl/spspd/change/items/keys/IronKey.java deleted file mode 100644 index 6e93fb11..00000000 --- a/java/com/hmdzl/spspd/change/items/keys/IronKey.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.keys; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.items.bags.Bag; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.messages.Messages; - - -public class IronKey extends Key { - - public static int curDepthQuantity = 0; - - { - //name = "iron key"; - image = ItemSpriteSheet.IRON_KEY; - } - - public IronKey() { - this(0); - } - - public IronKey(int depth) { - super(); - this.depth = depth; - } - - @Override - public boolean collect(Bag bag) { - boolean result = super.collect(bag); - if (result && depth == Dungeon.depth && Dungeon.hero != null) { - Dungeon.hero.belongings.countIronKeys(); - } - return result; - } - - @Override - public void onDetach() { - if (depth == Dungeon.depth) { - Dungeon.hero.belongings.countIronKeys(); - } - } -} diff --git a/java/com/hmdzl/spspd/change/items/keys/Key.java b/java/com/hmdzl/spspd/change/items/keys/Key.java deleted file mode 100644 index b6a92c2e..00000000 --- a/java/com/hmdzl/spspd/change/items/keys/Key.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.keys; - -import com.hmdzl.spspd.change.items.Item; -import com.watabou.utils.Bundle; - -public class Key extends Item { - - public static final float TIME_TO_UNLOCK = 1f; - - { - stackable = true; - unique = true; - } - - public int depth; - - @Override - public boolean isSimilar(Item item) { - return item.getClass() == getClass() && ((Key) item).depth == depth; - } - - private static final String DEPTH = "depth"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(DEPTH, depth); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - depth = bundle.getInt(DEPTH); - } - - @Override - public boolean isUpgradable() { - return false; - } - - @Override - public boolean isIdentified() { - return true; - } - -} diff --git a/java/com/hmdzl/spspd/change/items/keys/SkeletonKey.java b/java/com/hmdzl/spspd/change/items/keys/SkeletonKey.java deleted file mode 100644 index a57e046a..00000000 --- a/java/com/hmdzl/spspd/change/items/keys/SkeletonKey.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.keys; - -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; - -public class SkeletonKey extends Key { - - { - image = ItemSpriteSheet.SKELETON_KEY; - stackable = false; - } - - public SkeletonKey() { - this(0); - } - - public SkeletonKey(int depth) { - super(); - this.depth = depth; - } - - @Override - public boolean isSimilar(Item item) { - return false; - } - -} diff --git a/java/com/hmdzl/spspd/change/items/medicine/BlueMilk.java b/java/com/hmdzl/spspd/change/items/medicine/BlueMilk.java deleted file mode 100644 index 670773c5..00000000 --- a/java/com/hmdzl/spspd/change/items/medicine/BlueMilk.java +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.medicine; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.buffs.BerryRegeneration; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Haste; -import com.hmdzl.spspd.change.actors.buffs.Slow; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.items.food.Food; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.utils.Random; - -public class BlueMilk extends Pill { - - { - //name = "blue milk mushroom"; - image = ItemSpriteSheet.MUSHROOM_BLUEMILK; - - } - - @Override - public void execute(Hero hero, String action) { - - if (action.equals(AC_EAT)) { - - if (Dungeon.bossLevel()){ - GLog.w(Messages.get(Food.class,"bosslevel")); - return; - } - - } - - if (action.equals(AC_EAT)) { - - switch (Random.Int(10)) { - case 1: - for (Mob mob : Dungeon.level.mobs.toArray(new Mob[0])) { - Buff.affect(mob, Slow.class, Slow.duration(mob)); - } - Buff.affect(hero, Haste.class, 20f); - Buff.affect(hero, BerryRegeneration.class).level(hero.HP/2); - break; - case 0: case 2: case 3: case 4: case 5: - case 6: case 7: case 8: case 9: case 10: - for (Mob mob : Dungeon.level.mobs.toArray(new Mob[0])) { - Buff.affect(mob, Slow.class, Slow.duration(mob)); - Buff.affect(mob, BerryRegeneration.class).level(mob.HP/2); - } - Buff.affect(hero, Haste.class, 20f); - Buff.affect(hero, BerryRegeneration.class).level(hero.HP/2); - break; - } - } - - super.execute(hero, action); - } - - @Override - public int price() { - return 5 * quantity; - } - - public BlueMilk() { - this(1); - } - - public BlueMilk(int value) { - this.quantity = value; - } -} diff --git a/java/com/hmdzl/spspd/change/items/medicine/DeathCap.java b/java/com/hmdzl/spspd/change/items/medicine/DeathCap.java deleted file mode 100644 index 8e8d861a..00000000 --- a/java/com/hmdzl/spspd/change/items/medicine/DeathCap.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.medicine; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.buffs.Blindness; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.items.food.Food; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.utils.Random; - -public class DeathCap extends Pill { - - { - //name = "death cap mushroom"; - image = ItemSpriteSheet.MUSHROOM_DEATHCAP; - - } - - @Override - public void execute(Hero hero, String action) { - - if (action.equals(AC_EAT)) { - - if (Dungeon.bossLevel()){ - GLog.w(Messages.get(Food.class,"bosslevel")); - return; - } - - } - - if (action.equals(AC_EAT)) { - switch (Random.Int(10)) { - case 1: - for (Mob mob : Dungeon.level.mobs.toArray(new Mob[0])) { - mob.damage(Math.max(5,Math.round(mob.HP/2)), this); - } - hero.damage(Math.max(1,Math.round(hero.HP/4)), this); - Buff.prolong(hero, Blindness.class, Random.Int(5, 7)); - break; - case 0: case 2: case 3: case 4: case 5: - case 6: case 7: case 8: case 9: case 10: - for (Mob mob : Dungeon.level.mobs.toArray(new Mob[0])) { - mob.damage(Math.max(3,Math.round(mob.HP/2)), this); - mob.aggro(hero); - } - hero.damage(Math.max(1,Math.round(hero.HP/4)), this); - Buff.prolong(hero, Blindness.class, Random.Int(6, 9)); - break; - } - } - - super.execute(hero, action); - } - - @Override - public int price() { - return 5 * quantity; - } - - public DeathCap() { - this(1); - } - - public DeathCap(int value) { - this.quantity = value; - } -} diff --git a/java/com/hmdzl/spspd/change/items/medicine/Earthstar.java b/java/com/hmdzl/spspd/change/items/medicine/Earthstar.java deleted file mode 100644 index bbab4495..00000000 --- a/java/com/hmdzl/spspd/change/items/medicine/Earthstar.java +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.medicine; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.buffs.Bleeding; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Cripple; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.items.food.Food; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.utils.Random; - -public class Earthstar extends Pill { - - { - //name = "earthstar mushroom"; - image = ItemSpriteSheet.MUSHROOM_EARTHSTAR; - - } - - @Override - public void execute(Hero hero, String action) { - - if (action.equals(AC_EAT)) { - - if (Dungeon.bossLevel()){ - GLog.w(Messages.get(Food.class,"bosslevel")); - return; - } - - } - - if (action.equals(AC_EAT)) { - - switch (Random.Int(10)) { - case 1: - for (Mob mob : Dungeon.level.mobs.toArray(new Mob[0])) { - int damage = Math.max(0,(Dungeon.depth + 3) - Random.IntRange(0, mob.drRoll() / 2)); - Buff.affect(mob, Bleeding.class).set(damage); - Buff.prolong(mob, Cripple.class, Cripple.DURATION*2); - } - int damage = Math.max(0,(Dungeon.depth) - Random.IntRange(0, hero.drRoll())); - hero.damage(Math.max(1,Math.round(hero.HP/2)), this); - Buff.affect(hero, Bleeding.class).set(damage); - Buff.prolong(hero, Cripple.class, Cripple.DURATION); - break; - case 0: case 2: case 3: case 4: case 5: - case 6: case 7: case 8: case 9: case 10: - for (Mob mob : Dungeon.level.mobs.toArray(new Mob[0])) { - int mobdamage = Math.max(0,(Dungeon.depth + 3) - Random.IntRange(0, mob.drRoll() / 2)); - Buff.affect(mob, Bleeding.class).set(mobdamage); - Buff.prolong(mob, Cripple.class, Cripple.DURATION*2); - } - int herodamage = Math.max(0,(Dungeon.depth) - Random.IntRange(0, hero.drRoll()/2)); - hero.damage(Math.max(1,Math.round(hero.HP/2)), this); - Buff.affect(hero, Bleeding.class).set(herodamage); - Buff.prolong(hero, Cripple.class, Cripple.DURATION); - break; - } - } - - super.execute(hero, action); - } - - @Override - public int price() { - return 5 * quantity; - } - - public Earthstar() { - this(1); - } - - public Earthstar(int value) { - this.quantity = value; - } -} diff --git a/java/com/hmdzl/spspd/change/items/medicine/GoldenJelly.java b/java/com/hmdzl/spspd/change/items/medicine/GoldenJelly.java deleted file mode 100644 index c30f39e8..00000000 --- a/java/com/hmdzl/spspd/change/items/medicine/GoldenJelly.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.medicine; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Roots; -import com.hmdzl.spspd.change.actors.buffs.Vertigo; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.items.food.Food; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.utils.Random; - -public class GoldenJelly extends Pill { - - { - //name = "golden jelly mushroom"; - image = ItemSpriteSheet.MUSHROOM_GOLDENJELLY; - - } - - @Override - public void execute(Hero hero, String action) { - - if (action.equals(AC_EAT)) { - - if (Dungeon.bossLevel()){ - GLog.w(Messages.get(Food.class,"bosslevel")); - return; - } - - } - - if (action.equals(AC_EAT)) { - - switch (Random.Int(10)) { - case 1: - for (Mob mob : Dungeon.level.mobs.toArray(new Mob[0])) { - Buff.prolong(mob, Roots.class, 20); - } - Buff.affect(hero, Vertigo.class, 1f); - break; - case 0: case 2: case 3: case 4: case 5: - case 6: case 7: case 8: case 9: case 10: - for (Mob mob : Dungeon.level.mobs.toArray(new Mob[0])) { - Buff.prolong(mob, Roots.class, 10); - } - Buff.affect(hero, Vertigo.class, 3f); - break; - } - } - super.execute(hero, action); - } - - @Override - public int price() { - return 5 * quantity; - } - - public GoldenJelly() { - this(1); - } - - public GoldenJelly(int value) { - this.quantity = value; - } -} diff --git a/java/com/hmdzl/spspd/change/items/medicine/GreenSpore.java b/java/com/hmdzl/spspd/change/items/medicine/GreenSpore.java deleted file mode 100644 index 04855045..00000000 --- a/java/com/hmdzl/spspd/change/items/medicine/GreenSpore.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.medicine; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Dewcharge; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.utils.GLog; - -public class GreenSpore extends Pill { - { - //name = "Green Sporre"; - image = ItemSpriteSheet.MUSHROOM_LICHEN; - - } - - @Override - public void execute(Hero hero, String action) { - - super.execute(hero, action); - - if (action.equals(AC_EAT)) { - if (!Dungeon.dewWater && !Dungeon.dewDraw){ - GLog.w(Messages.get(this,"not_time")); - return; - } - else Buff.affect(hero, Dewcharge.class, 100f); - } - } - - @Override - public int price() { - return 20 * quantity; - }; - -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/items/medicine/Hardpill.java b/java/com/hmdzl/spspd/change/items/medicine/Hardpill.java deleted file mode 100644 index bd3d2ad3..00000000 --- a/java/com/hmdzl/spspd/change/items/medicine/Hardpill.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.medicine; - -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.DefenceUp; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; - -public class Hardpill extends Pill { - - { - //name = "hardpill"; - image = ItemSpriteSheet.PILL_DEF; - - } - - @Override - public void execute(Hero hero, String action) { - super.execute(hero, action); - - if (action.equals(AC_EAT)){ - Buff.affect(hero, DefenceUp.class,200f).level(50); - hero.sprite.emitter().start(Speck.factory(Speck.UP), 0.4f, 4); - } - } - - @Override - public int price() { - return 50 * quantity; - } - -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/items/medicine/JackOLantern.java b/java/com/hmdzl/spspd/change/items/medicine/JackOLantern.java deleted file mode 100644 index 3f02c567..00000000 --- a/java/com/hmdzl/spspd/change/items/medicine/JackOLantern.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.medicine; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.blobs.Blob; -import com.hmdzl.spspd.change.actors.blobs.Fire; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.items.food.Food; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.utils.Random; - -public class JackOLantern extends Pill { - - { - //name = "jack o lantern mushroom"; - image = ItemSpriteSheet.MUSHROOM_LANTERN; - - } - - @Override - public void execute(Hero hero, String action) { - - if (action.equals(AC_EAT)) { - - if (Dungeon.bossLevel()){ - GLog.w(Messages.get(Food.class,"bosslevel")); - return; - } - - } - - if (action.equals(AC_EAT)) { - switch (Random.Int(10)) { - case 1: - for (Mob mob : Dungeon.level.mobs.toArray(new Mob[0])) { - GameScene.add(Blob.seed(mob.pos, 3, Fire.class)); - } - break; - case 0: case 2: case 3: case 4: case 5: - case 6: case 7: case 8: case 9: case 10: - for (Mob mob : Dungeon.level.mobs.toArray(new Mob[0])) { - if(Random.Int(2)==0){GameScene.add(Blob.seed(mob.pos, 3, Fire.class));} - } - if(Random.Int(5)==0){GameScene.add(Blob.seed(hero.pos, 2, Fire.class));} - break; - } - } - - super.execute(hero, action); - } - - @Override - public int price() { - return 5 * quantity; - } - - public JackOLantern() { - this(1); - } - - public JackOLantern(int value) { - this.quantity = value; - } -} diff --git a/java/com/hmdzl/spspd/change/items/medicine/Magicpill.java b/java/com/hmdzl/spspd/change/items/medicine/Magicpill.java deleted file mode 100644 index 4cea4aaa..00000000 --- a/java/com/hmdzl/spspd/change/items/medicine/Magicpill.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.medicine; - -import com.hmdzl.spspd.change.actors.buffs.Arcane; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; - -public class Magicpill extends Pill { - - { - //name = "magicpill"; - image = ItemSpriteSheet.PILL_MIG; - - } - - @Override - public void execute(Hero hero, String action) { - super.execute(hero, action); - - if (action.equals(AC_EAT)){ - Buff.affect(hero, Arcane.class,200f); - hero.sprite.emitter().start(Speck.factory(Speck.UP), 0.4f, 4); - } - } - - @Override - public int price() { - return 50 * quantity; - } - -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/items/medicine/Musicpill.java b/java/com/hmdzl/spspd/change/items/medicine/Musicpill.java deleted file mode 100644 index cbbf6258..00000000 --- a/java/com/hmdzl/spspd/change/items/medicine/Musicpill.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.medicine; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Rhythm; -import com.hmdzl.spspd.change.actors.buffs.Rhythm2; -import com.hmdzl.spspd.change.actors.buffs.WarGroove; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.hero.HeroClass; -import com.hmdzl.spspd.change.actors.hero.HeroSubClass; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; - -public class Musicpill extends Pill { - - { - //name = "speedpill"; - image = ItemSpriteSheet.PILL_MUC; - - } - - @Override - public void execute(Hero hero, String action) { - super.execute(hero, action); - - if (action.equals(AC_EAT)){ - Buff.affect(hero, Rhythm.class,200f); - if (Dungeon.hero.heroClass == HeroClass.PERFORMER) - Buff.affect(hero, WarGroove.class); - if (Dungeon.hero.subClass == HeroSubClass.SUPERSTAR) - Buff.affect(hero, Rhythm2.class,200f); - hero.sprite.emitter().start(Speck.factory(Speck.UP), 0.4f, 4); - } - } - - @Override - public int price() { - return 50 * quantity; - } - -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/items/medicine/Pill.java b/java/com/hmdzl/spspd/change/items/medicine/Pill.java deleted file mode 100644 index 2bcf47b9..00000000 --- a/java/com/hmdzl/spspd/change/items/medicine/Pill.java +++ /dev/null @@ -1,141 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.medicine; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.Statistics; -import com.hmdzl.spspd.change.actors.buffs.Locked; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.hero.HeroClass; -import com.hmdzl.spspd.change.effects.SpellSprite; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.food.Food; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Random; - -public class Pill extends Item { - - private static final float TIME_TO_EAT = 1f; - - public static final String AC_EAT = "EAT"; - - { - stackable = true; - //name = "pill"; - image = ItemSpriteSheet.NULLWARN; - defaultAction = AC_EAT; - - } - - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions(hero); - if (hero.buff(Locked.class) == null){ - actions.add(AC_EAT); - } - return actions; - } - - @Override - public void execute(Hero hero, String action) { - if (action.equals(AC_EAT)) { - - if (hero.buff(Locked.class) != null ) { - GLog.w(Messages.get(Food.class, "locked")); - } else { - if (!(Dungeon.hero.heroClass == HeroClass.FOLLOWER ) || (Dungeon.hero.heroClass == HeroClass.FOLLOWER && Random.Int(10)>=1 )) - detach(hero.belongings.backpack); - /*int healEnergy = Math.max(7, Math.round(energy / 40)); - switch (hero.heroClass) { - case WARRIOR: - if (hero.HP < hero.HT) { - hero.HP = Math.min(hero.HP + Random.Int(3, healEnergy), hero.HT); - hero.sprite.emitter() - .burst(Speck.factory(Speck.HEALING), 1); - } - break; - case MAGE: - Buff.affect(hero, Recharging.class, 4f); - ScrollOfRecharging.charge(hero); - if (hero.HP < hero.HT) { - hero.HP = Math.min((hero.HP + Random.Int(1, 3)), hero.HT); - hero.sprite.emitter() - .burst(Speck.factory(Speck.HEALING), 1); - } - break; - case ROGUE: - if (hero.HP < hero.HT) { - hero.HP = Math.min((hero.HP + Random.Int(1, 3)), hero.HT); - hero.sprite.emitter() - .burst(Speck.factory(Speck.HEALING), 1); - } - case HUNTRESS: - if (hero.HP < hero.HT) { - hero.HP = Math.min((hero.HP + Random.Int(1, 3)), hero.HT); - hero.sprite.emitter() - .burst(Speck.factory(Speck.HEALING), 1); - } - break; - case PERFORMER: - if (hero.HP < hero.HT) { - hero.HP = Math.min((hero.HP + Random.Int(1, 3)), hero.HT); - hero.sprite.emitter() - .burst(Speck.factory(Speck.HEALING), 1); - } - break; - } -*/ - hero.sprite.operate(hero.pos); - hero.busy(); - SpellSprite.show(hero, SpellSprite.FOOD); - Sample.INSTANCE.play(Assets.SND_EAT); - - hero.spend(TIME_TO_EAT); - - Statistics.foodEaten++; - Badges.validateFoodEaten(); - } - } else { - - super.execute(hero, action); - - } - } - - @Override - public boolean isUpgradable() { - return false; - } - - @Override - public boolean isIdentified() { - return true; - } - - @Override - public int price() { - return 5 * quantity; - } -} diff --git a/java/com/hmdzl/spspd/change/items/medicine/PixieParasol.java b/java/com/hmdzl/spspd/change/items/medicine/PixieParasol.java deleted file mode 100644 index 90222cdb..00000000 --- a/java/com/hmdzl/spspd/change/items/medicine/PixieParasol.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.medicine; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.buffs.BerryRegeneration; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Drowsy; -import com.hmdzl.spspd.change.actors.buffs.Paralysis; -import com.hmdzl.spspd.change.actors.buffs.Vertigo; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.food.Food; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.utils.Random; - -public class PixieParasol extends Pill { - - { - //name = "pixie parasol mushroom"; - image = ItemSpriteSheet.MUSHROOM_PIXIEPARASOL; - - } - - @Override - public void execute(Hero hero, String action) { - - if (action.equals(AC_EAT)) { - - if (Dungeon.bossLevel()){ - GLog.w(Messages.get(Food.class,"bosslevel")); - return; - } - - } - - if (action.equals(AC_EAT)) { - switch (Random.Int(10)) { - case 1: - for (Mob mob : Dungeon.level.mobs.toArray(new Mob[0])) { - Buff.affect(mob, Drowsy.class); - Buff.prolong(mob, Paralysis.class, Random.IntRange(10, 16)); - mob.sprite.centerEmitter().start(Speck.factory(Speck.NOTE), 0.3f, 5); - } - Buff.affect(hero, BerryRegeneration.class).level(hero.HP/2); - break; - case 0: case 2: case 3: case 4: case 5: - case 6: case 7: case 8: case 9: case 10: - for (Mob mob : Dungeon.level.mobs.toArray(new Mob[0])) { - Buff.affect(mob, Drowsy.class); - Buff.prolong(mob, Paralysis.class, Random.IntRange(10, 16)); - mob.sprite.centerEmitter().start(Speck.factory(Speck.NOTE), 0.3f, 5); - } - Buff.affect(hero, Vertigo.class, 5f); - Buff.affect(hero, BerryRegeneration.class).level(hero.HP/2); - break; - } - } - - super.execute(hero, action); - } - - @Override - public int price() { - return 5 * quantity; - } - - public PixieParasol() { - this(1); - } - - public PixieParasol(int value) { - this.quantity = value; - } -} diff --git a/java/com/hmdzl/spspd/change/items/medicine/Powerpill.java b/java/com/hmdzl/spspd/change/items/medicine/Powerpill.java deleted file mode 100644 index b16e9e3e..00000000 --- a/java/com/hmdzl/spspd/change/items/medicine/Powerpill.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.medicine; - -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Muscle; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; - -public class Powerpill extends Pill { - - { - //name = "powerpill"; - image = ItemSpriteSheet.PILL_STR; - - } - - @Override - public void execute(Hero hero, String action) { - super.execute(hero, action); - - if (action.equals(AC_EAT)){ - Buff.affect(hero, Muscle.class,200f); - hero.sprite.emitter().start(Speck.factory(Speck.UP), 0.4f, 4); - } - } - @Override - public int price() { - return 50 * quantity; - } - -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/items/medicine/Shootpill.java b/java/com/hmdzl/spspd/change/items/medicine/Shootpill.java deleted file mode 100644 index d537634a..00000000 --- a/java/com/hmdzl/spspd/change/items/medicine/Shootpill.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.medicine; - -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.TargetShoot; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; - -public class Shootpill extends Pill { - - { - //name = "shootpill"; - image = ItemSpriteSheet.PILL_SOT; - - } - - @Override - public void execute(Hero hero, String action) { - super.execute(hero, action); - - if (action.equals(AC_EAT)){ - Buff.affect(hero, TargetShoot.class,200f); - hero.sprite.emitter().start(Speck.factory(Speck.UP), 0.4f, 4); - } - } - - @Override - public int price() { - return 50 * quantity; - } - -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/items/misc/Ankhshield.java b/java/com/hmdzl/spspd/change/items/misc/Ankhshield.java deleted file mode 100644 index 7d07b049..00000000 --- a/java/com/hmdzl/spspd/change/items/misc/Ankhshield.java +++ /dev/null @@ -1,131 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.misc; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Shieldblock; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.utils.Bundle; -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.watabou.noosa.audio.Sample; - - - - - public class Ankhshield extends Item { - { - //name = "Ankh Shield"; - image = ItemSpriteSheet.SHIELD; - defaultAction = AC_DEFENCE; - unique = true; - - } - - private static final String AC_DEFENCE = "DEFENCE"; - public final int fullCharge = 250; - public int charge = 0; - private static final String CHARGE = "charge"; - - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(CHARGE, charge); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - charge = bundle.getInt(CHARGE); - } - - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions(hero); - if (charge >= 120){ - actions.add(AC_DEFENCE); - } - actions.remove(AC_DROP); - actions.remove(AC_THROW); - return actions; - } - - - @Override - public void execute(final Hero hero, String action) { - if (action.equals(AC_DEFENCE)) { - if (charge < 120) - GLog.i(Messages.get(this, "rest")); - else { - - curUser = hero; - GameScene.flash(0x009900); - Sample.INSTANCE.play(Assets.SND_TELEPORT); - - for (Mob mob : Dungeon.level.mobs.toArray(new Mob[0])) { - if (Level.fieldOfView[mob.pos]) { - mob.damage(5, this); - Buff.prolong(mob, Shieldblock.class, 3); - } - } - - charge -= 120; - updateQuickslot(); - } - } else { - - super.execute(hero, action); - } - } - - @Override - public boolean isUpgradable() { - return false; - } - - @Override - public boolean isIdentified() { - return true; - } - - - @Override - public String info() { - String info = desc(); - info += "\n\n" + Messages.get(this,"charge",charge,fullCharge); - return info; - } - - @Override - public String status() { - return Messages.format("%d", (int)charge/120); - } - -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/items/misc/AttackShield.java b/java/com/hmdzl/spspd/change/items/misc/AttackShield.java deleted file mode 100644 index 1b1e34e2..00000000 --- a/java/com/hmdzl/spspd/change/items/misc/AttackShield.java +++ /dev/null @@ -1,234 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.misc; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.ArmorBreak; -import com.hmdzl.spspd.change.actors.buffs.AttackUp; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.DefenceUp; -import com.hmdzl.spspd.change.actors.buffs.Paralysis; -import com.hmdzl.spspd.change.actors.buffs.Vertigo; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.mobs.npcs.NPC; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.effects.Splash; -import com.hmdzl.spspd.change.effects.particles.ElmoParticle; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.weapon.missiles.MissileWeapon; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.CellSelector; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.sprites.MissileSprite; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -import java.util.ArrayList; - -import static com.hmdzl.spspd.change.Dungeon.hero; - -public class AttackShield extends Item { - - { - //name = "AttackShield"; - image = ItemSpriteSheet.ATTACKSHIELD; - - stackable = false; - unique = true; - defaultAction = AC_CAST; - - } - - private static final String AC_CAST = "CAST"; - private static final String AC_BlAST = "BLAST"; - public final int fullCharge = 20; - public int charge = 0; - private static final String CHARGE = "charge"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(CHARGE, charge); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - charge = bundle.getInt(CHARGE); - } - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions( hero ); - if (charge >= 10){ - actions.add(AC_CAST); - } - if (charge >= 20){ - actions.add(AC_BlAST); - } - actions.remove( AC_THROW ); - actions.remove( AC_DROP ); - return actions; - } - - @Override - public void execute(final Hero hero, String action) { - super.execute(hero, action); - if (action.equals(AC_CAST)) { - curUser = hero; - if (charge < 10) { - GLog.i(Messages.get(this, "rest")); - } else GameScene.selectCell(shooter); - } else if (action.equals(AC_BlAST)) { - curUser = hero; - if (charge < 20) { - GLog.i(Messages.get(this, "rest")); - return; - } else { - if (curUser.buff(LongBuff.class) == null) Buff.affect(curUser,LongBuff.class); - Buff.prolong(hero, ArmorBreak.class, 100f).level(50); - Buff.prolong(hero, AttackUp.class, 50f).level(100); - charge -= 20; - } - } - - } - - @Override - public String desc() { - String info = super.desc(); - info += "\n\n" + Messages.get(AttackShield.class, "damage",min(),max()); - info += "\n\n" + Messages.get(AttackShield.class, "charge",charge,fullCharge); - return info; - } - - public int level() { - return Dungeon.hero == null ? 0 : Dungeon.hero.lvl/5; - } - - @Override - public int visiblyUpgraded() { - return level(); - } - - @Override - public boolean isUpgradable() { - return false; - } - - @Override - public boolean isIdentified() { - return true; - } - - public int min() { - return 1 + Dungeon.hero.lvl; - } - - public int max() { - return 3 + Dungeon.hero.lvl*2; - } - - public int damageRoll(Hero owner) { - int damage = Random.Int(min(), max()); - return Math.round(damage); - } - - private int targetPos; - - public AttackShieldAmmo Ammo(){ - return new AttackShieldAmmo(); - } - - public class AttackShieldAmmo extends MissileWeapon { - - { - image = ItemSpriteSheet.DUST; - ACU = 1000; - } - - public int damageRoll(Hero owner) { - return AttackShield.this.damageRoll(owner); - } - - @Override - protected void onThrow( int cell ) { - Char enemy = Actor.findChar( cell ); - if (enemy == null || enemy == curUser) { - parent = null; - Splash.at( cell, 0xCC99FFFF, 1 ); - } else { - if (!curUser.shoot( enemy, this )) { - Splash.at(cell, 0xCC99FFFF, 1); - } - } - } - - @Override - public void proc(Char attacker, Char defender, int damage) { - - if (defender.properties().contains(Char.Property.BOSS) || defender.properties().contains(Char.Property.MINIBOSS)){ - defender.damage((int)(0.25* defender.HT * (defender.HP/defender.HT)) ,this); - } else { - defender.damage((int) (0.5 * defender.HT * (defender.HP / defender.HT)), this); - Buff.prolong(defender, Vertigo.class, 5f); - } - super.proc(attacker, defender, damage); - } - - @Override - public void cast(final Hero user, final int dst) { - final int cell = throwPos( user, dst ); - AttackShield.this.targetPos = cell; - charge-=10; - super.cast(user, dst); - } - - } - private CellSelector.Listener shooter = new CellSelector.Listener() { - @Override - public void onSelect( Integer target ) { - if (target != null) { - Ammo().cast(curUser, target); - } - } - @Override - public String prompt() { - return Messages.get(AttackShield.class, "prompt"); - } - }; - - public static class LongBuff extends Buff { - - @Override - public boolean act() { - spend(TICK); - return true; - } - - public void dispel(){ - detach(); - } - } - -} - diff --git a/java/com/hmdzl/spspd/change/items/misc/AttackShoes.java b/java/com/hmdzl/spspd/change/items/misc/AttackShoes.java deleted file mode 100644 index 50477d1d..00000000 --- a/java/com/hmdzl/spspd/change/items/misc/AttackShoes.java +++ /dev/null @@ -1,136 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.misc; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.mechanics.Ballistica; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.scenes.CellSelector; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.utils.Callback; -import com.watabou.utils.Bundle; - - - public class AttackShoes extends Item { - { - //name = "AttackShoes"; - image = ItemSpriteSheet.JUMP; - defaultAction = AC_JUMP; - unique = true; - - } - - private static int JUMP_TIME = 2; - private static final String AC_JUMP = "JUMP"; - - - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions(hero); - actions.add(AC_JUMP); - actions.remove(AC_DROP); - actions.remove(AC_THROW); - return actions; - } - - protected CellSelector.Listener jumper = new CellSelector.Listener() { - - @Override - public void onSelect(Integer target) { - if (target != null && target != curUser.pos) { - - Ballistica route = new Ballistica(curUser.pos, target, Ballistica.PROJECTILE); - int cell = route.collisionPos; - int dist = Level.distance(curUser.pos, cell); - int range = 3; - //if (Actor.findChar(cell) != null && cell != curUser.pos) - // cell = route.path.get(route.dist - 1); - - if (dist > 3) { - range = dist - 3; - cell = route.path.get(route.dist - range); - } - - final int dest = cell; - curUser.busy(); - curUser.sprite.jump(curUser.pos, cell, new Callback() { - @Override - public void call() { - curUser.move(dest); - Dungeon.level.press(dest, curUser); - Dungeon.observe(); - for (int i = 0; i < Level.NEIGHBOURS8.length; i++) { - Char mob = Actor.findChar(curUser.pos - + Level.NEIGHBOURS8[i]); - if (mob != null && mob != curUser && mob.isAlive()) { - mob.damage(30 + Dungeon.hero.lvl * 3, this); - } - } - - CellEmitter.center(dest).burst( - Speck.factory(Speck.DUST), 10); - curUser.spendAndNext(JUMP_TIME); - updateQuickslot(); - } - }); - } - } - public String prompt() { - return Messages.get(Jumpshoes.class, "prompt"); - } - }; - - @Override - public void execute(final Hero hero, String action) { - if (action.equals(AC_JUMP)) { - curUser = hero; - GameScene.selectCell(jumper); - } else { - super.execute(hero, action); - } - } - - @Override - public boolean isUpgradable() { - return false; - } - - @Override - public boolean isIdentified() { - return true; - } - - @Override - public String info() { - String info = desc(); - return info; - } - - -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/items/misc/AutoPotion.java b/java/com/hmdzl/spspd/change/items/misc/AutoPotion.java deleted file mode 100644 index 1c9b92eb..00000000 --- a/java/com/hmdzl/spspd/change/items/misc/AutoPotion.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.misc; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.hero.HeroClass; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.ItemStatusHandler; -import com.hmdzl.spspd.change.items.KindofMisc; -import com.hmdzl.spspd.change.items.rings.Ring.RingBuff; -import com.hmdzl.spspd.change.items.rings.RingOfAccuracy.Accuracy; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -public class AutoPotion extends MiscEquippable { - - { - image = ItemSpriteSheet.ARTIFACT; - unique = true; - } - - @Override - protected MiscBuff buff() { - return new AutoHealPotion(); - } - - public class AutoHealPotion extends MiscBuff { - } - - @Override - public boolean isIdentified() { - return true; - } - - @Override - public boolean isUpgradable() { - return false; - } - - @Override - public int price() { - return 500 * quantity; - } -} diff --git a/java/com/hmdzl/spspd/change/items/misc/BShovel.java b/java/com/hmdzl/spspd/change/items/misc/BShovel.java deleted file mode 100644 index 92091dd5..00000000 --- a/java/com/hmdzl/spspd/change/items/misc/BShovel.java +++ /dev/null @@ -1,183 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * Yet Another Pixel Dungeon - * Copyright (C) 2015-2016 Considered Hamster - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.misc; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.buffs.Awareness; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Haste; -import com.hmdzl.spspd.change.actors.buffs.Hunger; -import com.hmdzl.spspd.change.actors.buffs.Invisibility; -import com.hmdzl.spspd.change.actors.buffs.MechArmor; -import com.hmdzl.spspd.change.actors.buffs.MindVision; -import com.hmdzl.spspd.change.actors.buffs.WarGroove; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.Terrain; -import com.hmdzl.spspd.change.mechanics.Ballistica; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.CellSelector; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.ui.BuffIndicator; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundle; -import com.watabou.utils.Callback; -import com.watabou.utils.Random; - -import java.util.ArrayList; - -public class BShovel extends Item { - - public static final String AC_USE = "USE"; - - private static final float TIME_TO_DIG = 1f; - - { - //name = "Shovel"; - image = ItemSpriteSheet.BSHOVEL; - defaultAction = AC_USE; - unique = true; - - } - - public final int fullCharge = 150; - public int charge = 0; - private static final String CHARGE = "charge"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(CHARGE, charge); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - charge = bundle.getInt(CHARGE); - } - - @Override - public ArrayList actions(Hero hero ) { - ArrayList actions = super.actions( hero ); - if (charge >= 75){ - actions.add(AC_USE); - } - actions.remove( AC_THROW ); - actions.remove( AC_DROP ); - return actions; - } - - @Override - public void execute( final Hero hero, String action ) { - if( action.equals( AC_USE ) ){ - if(charge < 75){ - GLog.i(Messages.get(BShovel.class, "break")); - return; - } else { - for (int n : Level.NEIGHBOURS4) { - int c = hero.pos + n; - - if (c >= 0 && c < Level.getLength()) { - if (Dungeon.level.map[c] == Terrain.WALL && Level.insideMap(c)) { - Level.set(c, Terrain.EMBERS); - GameScene.updateMap(c); - Dungeon.observe(); - } - } - } - hero.spend(TIME_TO_DIG); - hero.busy(); - Hunger hunger = hero.buff(Hunger.class); - if (hunger != null && !hunger.isStarving()) { - hunger.satisfy(-10); - BuffIndicator.refreshHero(); - } - charge-=75; - - switch (Random.Int (6)) { - case 0 : - Buff.affect(hero,MindVision.class,5f); - GLog.p(Messages.get(BShovel.class,"mob")); - break; - case 1 : - Buff.affect(hero,Haste.class,5f); - GLog.p(Messages.get(BShovel.class,"haste")); - break; - case 2 : - Buff.affect(hero,Awareness.class,5f); - GLog.p(Messages.get(BShovel.class,"item")); - break; - case 3 : - Dungeon.gold+=Dungeon.hero.lvl*10; - GLog.p(Messages.get(BShovel.class,"gold")); - break; - case 4 : - Dungeon.hero.HP=Dungeon.hero.HT; - GLog.p(Messages.get(BShovel.class,"heal")); - break; - case 5 : - Buff.affect(hero,MechArmor.class).level(30); - GLog.p(Messages.get(BShovel.class,"mech")); - break; - default: - break; - } - updateQuickslot(); - hero.onOperateComplete(); - - return; - } - } else { - super.execute(hero, action); - } - } - - @Override - public String status() { - return Messages.format("%d", (int)charge/75); - } - - @Override - public String info() { - String info = desc(); - info += "\n\n" + Messages.get(BShovel.class, "charge",charge,fullCharge); - return info; - } - - @Override - public boolean isUpgradable() { - return false; - } - - @Override - public boolean isIdentified() { - return true; - } - - -} diff --git a/java/com/hmdzl/spspd/change/items/misc/CopyBall.java b/java/com/hmdzl/spspd/change/items/misc/CopyBall.java deleted file mode 100644 index 19a823e3..00000000 --- a/java/com/hmdzl/spspd/change/items/misc/CopyBall.java +++ /dev/null @@ -1,221 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * Yet Another Pixel Dungeon - * Copyright (C) 2015-2016 Considered Hamster - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.misc; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.Blob; -import com.hmdzl.spspd.change.actors.blobs.ConfusionGas; -import com.hmdzl.spspd.change.actors.blobs.DarkGas; -import com.hmdzl.spspd.change.actors.blobs.ParalyticGas; -import com.hmdzl.spspd.change.actors.blobs.StenchGas; -import com.hmdzl.spspd.change.actors.blobs.TarGas; -import com.hmdzl.spspd.change.actors.blobs.ToxicGas; -import com.hmdzl.spspd.change.actors.buffs.Arcane; -import com.hmdzl.spspd.change.actors.buffs.ArmorBreak; -import com.hmdzl.spspd.change.actors.buffs.AttackDown; -import com.hmdzl.spspd.change.actors.buffs.AttackUp; -import com.hmdzl.spspd.change.actors.buffs.BerryRegeneration; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Burning; -import com.hmdzl.spspd.change.actors.buffs.Chill; -import com.hmdzl.spspd.change.actors.buffs.Corruption; -import com.hmdzl.spspd.change.actors.buffs.DefenceUp; -import com.hmdzl.spspd.change.actors.buffs.Frost; -import com.hmdzl.spspd.change.actors.buffs.HighLight; -import com.hmdzl.spspd.change.actors.buffs.Hot; -import com.hmdzl.spspd.change.actors.buffs.Hunger; -import com.hmdzl.spspd.change.actors.buffs.Invisibility; -import com.hmdzl.spspd.change.actors.buffs.Recharging; -import com.hmdzl.spspd.change.actors.buffs.Rhythm; -import com.hmdzl.spspd.change.actors.buffs.Roots; -import com.hmdzl.spspd.change.actors.buffs.Shocked; -import com.hmdzl.spspd.change.actors.buffs.Slow; -import com.hmdzl.spspd.change.actors.buffs.Vertigo; -import com.hmdzl.spspd.change.actors.buffs.WarGroove; -import com.hmdzl.spspd.change.actors.buffs.Wet; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.effects.Splash; -import com.hmdzl.spspd.change.effects.particles.ElmoParticle; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.artifacts.EtherealChains; -import com.hmdzl.spspd.change.items.weapon.missiles.MissileWeapon; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.Terrain; -import com.hmdzl.spspd.change.mechanics.Ballistica; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.CellSelector; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.ui.BuffIndicator; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundle; -import com.watabou.utils.Callback; -import com.watabou.utils.Random; - -import java.util.ArrayList; - -public class CopyBall extends Item { - - public static final String AC_USE = "USE"; - private static final float TIME_TO_DIG = 1f; - - { - image = ItemSpriteSheet.COPY_BALL; - defaultAction = AC_USE; - - unique = true; - - } - - public final int fullCharge = 50; - public int charge = 0; - private static final String CHARGE = "charge"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(CHARGE, charge); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - charge = bundle.getInt(CHARGE); - } - - @Override - public ArrayList actions(Hero hero ) { - ArrayList actions = super.actions( hero ); - if (charge >= 10) { - actions.add(AC_USE); - } - actions.remove( AC_THROW ); - actions.remove( AC_DROP ); - return actions; - } - - @Override - public void execute( final Hero hero, String action ) { - if( action.equals( AC_USE ) ) { - curUser = hero; - if (charge < 10) { - GLog.i(Messages.get(CopyBall.class, "break")); - } else GameScene.selectCell(shooter); - } else super.execute(hero, action); - - - } - - @Override - public String status() { - return Messages.format("%d", (int)charge/10); - } - - @Override - public String info() { - String info = desc(); - info += "\n\n" + Messages.get(CopyBall.class, "charge",charge,fullCharge); - return info; - } - - @Override - public boolean isUpgradable() { - return false; - } - - @Override - public boolean isIdentified() { - return true; - } - - - private int targetPos; - - public CopyBallAmmo Ammo(){ - return new CopyBallAmmo(); - } - - public class CopyBallAmmo extends MissileWeapon { - - { - image = ItemSpriteSheet.COPY_BALL; - ACU = 1000; - } - - public int damageRoll(Hero owner) { - return 0; - } - - @Override - protected void onThrow( int cell ) { - Char enemy = Actor.findChar( cell ); - if (enemy == null || enemy == curUser) { - parent = null; - Splash.at( cell, 0xCC99FFFF, 1 ); - } else { - if (!curUser.shoot( enemy, this )) { - Splash.at(cell, 0xCC99FFFF, 1); - } - } - } - - @Override - public void proc(Char attacker, Char defender, int damage) { - if (defender.properties().contains(Char.Property.BOSS) || defender.properties().contains(Char.Property.MINIBOSS)){ - Buff.affect(defender, AttackDown.class, 10f).level(35); - Buff.affect(defender, ArmorBreak.class, 10f).level(35); - Buff.prolong(defender, Vertigo.class, 5f); - } else { - Buff.affect(defender,Corruption.class); - } - super.proc(attacker, defender, damage); - } - - @Override - public void cast(final Hero user, final int dst) { - final int cell = throwPos( user, dst ); - CopyBall.this.targetPos = cell; - charge-=10; - super.cast(user, dst); - } - - } - private CellSelector.Listener shooter = new CellSelector.Listener() { - @Override - public void onSelect( Integer target ) { - if (target != null) { - Ammo().cast(curUser, target); - } - } - @Override - public String prompt() { - return Messages.get(CopyBall.class, "prompt"); - } - }; -} diff --git a/java/com/hmdzl/spspd/change/items/misc/DanceLion.java b/java/com/hmdzl/spspd/change/items/misc/DanceLion.java deleted file mode 100644 index d6f81de0..00000000 --- a/java/com/hmdzl/spspd/change/items/misc/DanceLion.java +++ /dev/null @@ -1,177 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.misc; - -import java.util.ArrayList; -import java.util.logging.Level; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.Statistics; -import com.hmdzl.spspd.change.actors.buffs.Arcane; -import com.hmdzl.spspd.change.actors.buffs.AttackUp; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.DefenceUp; -import com.hmdzl.spspd.change.actors.buffs.GlassShield; -import com.hmdzl.spspd.change.actors.buffs.Haste; -import com.hmdzl.spspd.change.actors.buffs.Invisibility; -import com.hmdzl.spspd.change.actors.buffs.Levitation; -import com.hmdzl.spspd.change.actors.buffs.Recharging; -import com.hmdzl.spspd.change.actors.buffs.Rhythm; -import com.hmdzl.spspd.change.actors.buffs.Rhythm2; -import com.hmdzl.spspd.change.actors.buffs.ShieldArmor; -import com.hmdzl.spspd.change.actors.buffs.faithbuff.BalanceFaith; -import com.hmdzl.spspd.change.actors.buffs.faithbuff.DemonFaith; -import com.hmdzl.spspd.change.actors.buffs.faithbuff.HumanFaith; -import com.hmdzl.spspd.change.actors.buffs.faithbuff.LifeFaith; -import com.hmdzl.spspd.change.actors.buffs.faithbuff.MechFaith; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.hero.HeroSubClass; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.Item; - -import com.hmdzl.spspd.change.items.weapon.missiles.RiceBall; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.hmdzl.spspd.change.windows.WndItem; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundle; - -public class DanceLion extends Item { - - { - //name = "DanceLion"; - image = ItemSpriteSheet.DANCE_LION; - unique = true; - defaultAction = AC_CHOOSE; - } - - public final int fullCharge = 100; - public int charge = 0; - - public static final String AC_CHOOSE = "CHOOSE"; - - public static final String AC_SPIN = "SPIN"; - public static final String AC_STAND = "STAND"; - public static final String AC_BACK = "BACK"; - public static final String AC_RUSH = "RUSH"; - public static final String AC_JUMP = "JUMP"; - - private static final String CHARGE = "charge"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(CHARGE, charge); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - charge = bundle.getInt(CHARGE); - } - - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions(hero); - actions.remove(AC_DROP); - actions.remove(AC_THROW); - if (charge > 40) { - actions.add(AC_SPIN); - actions.add(AC_STAND); - actions.add(AC_BACK); - actions.add(AC_RUSH); - actions.add(AC_JUMP); - } - return actions; - } - - @Override - public void execute(Hero hero, String action) { - - curUser = Dungeon.hero; - - if (action.equals( AC_CHOOSE )){ - - GameScene.show(new WndItem(null, this, true)); - - } else if (action.equals(AC_SPIN)) { - Buff.affect(curUser, Rhythm.class,20f); - if(hero.subClass == HeroSubClass.SUPERSTAR){ - Buff.affect(curUser,Rhythm2.class,20f); - } - charge -= 40; - hero.spendAndNext(1f); - } else if (action.equals(AC_STAND)) { - Buff.affect(curUser,DefenceUp.class,20f).level(30); - if(hero.subClass == HeroSubClass.SUPERSTAR){ - Buff.affect(curUser,ShieldArmor.class).level(Dungeon.hero.lvl*2); - } - charge -= 40; - hero.spendAndNext(1f); - } else if (action.equals(AC_BACK)) { - Buff.affect(curUser, Recharging.class,10f); - if(hero.subClass == HeroSubClass.SUPERSTAR){ - Buff.affect(curUser,Arcane.class,20f); - } - charge -= 40; - hero.spendAndNext(1f); - } else if (action.equals(AC_RUSH)) { - Buff.affect(curUser, AttackUp.class,20f).level(30); - if(hero.subClass == HeroSubClass.SUPERSTAR){ - Buff.affect(curUser,Invisibility.class,20f); - } - charge -= 40; - hero.spendAndNext(1f); - } else if (action.equals(AC_JUMP)) { - Buff.affect(curUser, Levitation.class,20f); - if(hero.subClass == HeroSubClass.SUPERSTAR){ - Buff.affect(curUser,GlassShield.class).turns(2); - } - charge -= 40; - hero.spendAndNext(1f); - } else { - super.execute(hero, action); - } - } - - @Override - public boolean isUpgradable() { - return false; - } - - @Override - public boolean isIdentified() { - return true; - } - - @Override - public String desc() { - String info = super.desc(); - info += "\n\n" + Messages.get(AttackShield.class, "charge",charge,fullCharge); - return info; - } - @Override - public String status() { - return Messages.format("%d", (int)charge/40); - } -} diff --git a/java/com/hmdzl/spspd/change/items/misc/DemoScroll.java b/java/com/hmdzl/spspd/change/items/misc/DemoScroll.java deleted file mode 100644 index b93ebbba..00000000 --- a/java/com/hmdzl/spspd/change/items/misc/DemoScroll.java +++ /dev/null @@ -1,132 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.misc; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.ResultDescriptions; -import com.hmdzl.spspd.change.Statistics; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.Item; - -import com.hmdzl.spspd.change.items.weapon.missiles.RiceBall; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -public class DemoScroll extends Item { - - public static final String AC_READ = "READ"; - { - //name = "DemoScroll"; - image = ItemSpriteSheet.DEMO_SCROLL; - - stackable = false; - charge = 0; - //defaultAction = AC_READ; - } - - public static int charge; - private static final String CHARGE = "charge"; - - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions(hero); - if (charge < hero.lvl && hero.HT > hero.lvl) actions.add(AC_READ); - return actions; - } - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(CHARGE, charge); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - charge = bundle.getInt(CHARGE); - } - - @Override - public void execute(Hero hero, String action) { - - if (action.equals(AC_READ)) { - - switch (Random.Int (4)) { - case 0 : - hero.hitSkill++; - GLog.w(Messages.get(this, "hitup")); - break; - case 1 : - hero.evadeSkill++; - GLog.w(Messages.get(this, "evaup")); - break; - case 2 : - hero.magicSkill++; - GLog.w(Messages.get(this, "migup")); - break; - case 3 : - hero.STR++; - GLog.w(Messages.get(this, "strup")); - break; - default: - - break; - } - charge ++; - hero.sprite.operate(hero.pos); - hero.busy(); - hero.spend(2f); - int dmg = Random.Int(6,Dungeon.hero.lvl); - hero.damage(dmg,this); - if (!hero.isAlive()) { - Dungeon.fail(Messages.format(ResultDescriptions.ITEM)); - //GLog.n("The Chalice sucks your life essence dry..."); - } - Dungeon.hero.HT-= Math.min(dmg,hero.HT-1); - GLog.w(Messages.get(this, "htdown")); - //hero.hitSkill++; - //hero.evadeSkill++; - //hero.magicSkill++; - - //detach(hero.belongings.backpack); - } else { - super.execute(hero, action); - - } - } - - @Override - public boolean isUpgradable() { - return false; - } - - @Override - public boolean isIdentified() { - return true; - } -} diff --git a/java/com/hmdzl/spspd/change/items/misc/FaithSign.java b/java/com/hmdzl/spspd/change/items/misc/FaithSign.java deleted file mode 100644 index f6bbcaca..00000000 --- a/java/com/hmdzl/spspd/change/items/misc/FaithSign.java +++ /dev/null @@ -1,141 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.misc; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.Statistics; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.faithbuff.BalanceFaith; -import com.hmdzl.spspd.change.actors.buffs.faithbuff.DemonFaith; -import com.hmdzl.spspd.change.actors.buffs.faithbuff.HumanFaith; -import com.hmdzl.spspd.change.actors.buffs.faithbuff.LifeFaith; -import com.hmdzl.spspd.change.actors.buffs.faithbuff.MechFaith; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.Item; - -import com.hmdzl.spspd.change.items.weapon.missiles.RiceBall; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.hmdzl.spspd.change.windows.WndItem; -import com.watabou.noosa.audio.Sample; - -public class FaithSign extends Item { - - { - //name = "faithsign"; - image = ItemSpriteSheet.FAITH_SIGN; - unique = true; - defaultAction = AC_CHOOSE; - } - - public static final String AC_CHOOSE = "CHOOSE"; - - public static final String AC_DEMON = "DEMON"; - public static final String AC_HUMAN = "HUMAN"; - public static final String AC_MECH = "MECH"; - public static final String AC_LIFE = "LIFE"; - public static final String AC_BALANCE = "BALANCE"; - - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions(hero); - actions.remove(AC_DROP); - actions.remove(AC_THROW); - actions.add(AC_DEMON); - actions.add(AC_HUMAN); - actions.add(AC_MECH); - actions.add(AC_LIFE); - actions.add(AC_BALANCE); - return actions; - } - - @Override - public void execute(Hero hero, String action) { - - if (action.equals( AC_CHOOSE )){ - - GameScene.show(new WndItem(null, this, true)); - - } else if (action.equals(AC_DEMON)) { - Buff.detach(hero,DemonFaith.class); - Buff.detach(hero,HumanFaith.class); - Buff.detach(hero,MechFaith.class); - Buff.detach(hero,LifeFaith.class); - Buff.detach(hero,BalanceFaith.class); - Buff.affect(hero,DemonFaith.class); - hero.spendAndNext(1f); - - } else if (action.equals(AC_HUMAN)) { - Buff.detach(hero,DemonFaith.class); - Buff.detach(hero,HumanFaith.class); - Buff.detach(hero,MechFaith.class); - Buff.detach(hero,LifeFaith.class); - Buff.detach(hero,BalanceFaith.class); - Buff.affect(hero,HumanFaith.class); - hero.spendAndNext(1f); - - } else if (action.equals(AC_MECH)) { - Buff.detach(hero,DemonFaith.class); - Buff.detach(hero,HumanFaith.class); - Buff.detach(hero,MechFaith.class); - Buff.detach(hero,LifeFaith.class); - Buff.detach(hero,BalanceFaith.class); - Buff.affect(hero,MechFaith.class); - hero.spendAndNext(1f); - - } else if (action.equals(AC_LIFE)) { - Buff.detach(hero,DemonFaith.class); - Buff.detach(hero,HumanFaith.class); - Buff.detach(hero,MechFaith.class); - Buff.detach(hero,LifeFaith.class); - Buff.detach(hero,BalanceFaith.class); - Buff.affect(hero,LifeFaith.class); - hero.spendAndNext(1f); - - } else if (action.equals(AC_BALANCE)) { - Buff.detach(hero,DemonFaith.class); - Buff.detach(hero,HumanFaith.class); - Buff.detach(hero,MechFaith.class); - Buff.detach(hero,LifeFaith.class); - Buff.detach(hero,BalanceFaith.class); - Buff.affect(hero,BalanceFaith.class); - hero.spendAndNext(1f); - } else { - super.execute(hero, action); - } - } - - @Override - public boolean isUpgradable() { - return false; - } - - @Override - public boolean isIdentified() { - return true; - } - -} diff --git a/java/com/hmdzl/spspd/change/items/misc/FourClover.java b/java/com/hmdzl/spspd/change/items/misc/FourClover.java deleted file mode 100644 index 8c2882de..00000000 --- a/java/com/hmdzl/spspd/change/items/misc/FourClover.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.misc; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.sprites.ItemSprite.Glowing; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundle; - -public class FourClover extends MiscEquippable { - - { - image = ItemSpriteSheet.FOURCLOVER; - unique = true; - - } - - @Override - protected MiscBuff buff() { - return new FourCloverBless(); - } - - public class FourCloverBless extends MiscBuff { - } - - - @Override - public boolean isUpgradable() { - return false; - } - - @Override - public boolean isIdentified() { - return true; - } - - - @Override - public int price() { - return 500 * quantity; - } - -} diff --git a/java/com/hmdzl/spspd/change/items/misc/GnollMark.java b/java/com/hmdzl/spspd/change/items/misc/GnollMark.java deleted file mode 100644 index d345b46a..00000000 --- a/java/com/hmdzl/spspd/change/items/misc/GnollMark.java +++ /dev/null @@ -1,205 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * Yet Another Pixel Dungeon - * Copyright (C) 2015-2016 Considered Hamster - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.misc; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.Blob; -import com.hmdzl.spspd.change.actors.blobs.ConfusionGas; -import com.hmdzl.spspd.change.actors.blobs.DarkGas; -import com.hmdzl.spspd.change.actors.blobs.ParalyticGas; -import com.hmdzl.spspd.change.actors.blobs.StenchGas; -import com.hmdzl.spspd.change.actors.blobs.TarGas; -import com.hmdzl.spspd.change.actors.blobs.ToxicGas; -import com.hmdzl.spspd.change.actors.buffs.Arcane; -import com.hmdzl.spspd.change.actors.buffs.ArmorBreak; -import com.hmdzl.spspd.change.actors.buffs.AttackDown; -import com.hmdzl.spspd.change.actors.buffs.AttackUp; -import com.hmdzl.spspd.change.actors.buffs.BerryRegeneration; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Burning; -import com.hmdzl.spspd.change.actors.buffs.Chill; -import com.hmdzl.spspd.change.actors.buffs.DefenceUp; -import com.hmdzl.spspd.change.actors.buffs.Disarm; -import com.hmdzl.spspd.change.actors.buffs.Frost; -import com.hmdzl.spspd.change.actors.buffs.HighLight; -import com.hmdzl.spspd.change.actors.buffs.Hot; -import com.hmdzl.spspd.change.actors.buffs.Hunger; -import com.hmdzl.spspd.change.actors.buffs.Invisibility; -import com.hmdzl.spspd.change.actors.buffs.Locked; -import com.hmdzl.spspd.change.actors.buffs.Recharging; -import com.hmdzl.spspd.change.actors.buffs.Rhythm; -import com.hmdzl.spspd.change.actors.buffs.Roots; -import com.hmdzl.spspd.change.actors.buffs.ShieldArmor; -import com.hmdzl.spspd.change.actors.buffs.Shocked; -import com.hmdzl.spspd.change.actors.buffs.Silent; -import com.hmdzl.spspd.change.actors.buffs.Slow; -import com.hmdzl.spspd.change.actors.buffs.WarGroove; -import com.hmdzl.spspd.change.actors.buffs.Weakness; -import com.hmdzl.spspd.change.actors.buffs.Wet; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.effects.Splash; -import com.hmdzl.spspd.change.effects.particles.ElmoParticle; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.artifacts.EtherealChains; -import com.hmdzl.spspd.change.items.weapon.missiles.MissileWeapon; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.Terrain; -import com.hmdzl.spspd.change.mechanics.Ballistica; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.CellSelector; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.ui.BuffIndicator; -import com.hmdzl.spspd.change.utils.GLog; -import com.hmdzl.spspd.change.windows.WndItem; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundle; -import com.watabou.utils.Callback; -import com.watabou.utils.Random; - -import java.util.ArrayList; - -public class GnollMark extends Item { - - public static final String AC_LIGHT = "LIGHT"; - public static final String AC_DARK = "DARK"; - public static final String AC_EARTH = "EARTH"; - private static final String AC_CHOOSE = "CHOOSE"; - private static final float TIME_TO_DIG = 1f; - - { - image = ItemSpriteSheet.GNOLL_MARK; - defaultAction = AC_CHOOSE; - - unique = true; - - } - - public final int fullCharge = 40; - public int charge = 0; - private static final String CHARGE = "charge"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(CHARGE, charge); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - charge = bundle.getInt(CHARGE); - } - - @Override - public ArrayList actions(Hero hero ) { - ArrayList actions = super.actions( hero ); - if (charge >= 20) { - actions.add(AC_LIGHT); - actions.add(AC_DARK); - actions.add(AC_EARTH); - } - actions.remove( AC_THROW ); - actions.remove( AC_DROP ); - return actions; - } - - @Override - public void execute( final Hero hero, String action ) { - if (action.equals( AC_CHOOSE )) { - - GameScene.show(new WndItem(null, this, true)); - - } else if( action.equals( AC_LIGHT ) ) { - curUser = hero; - Buff.affect(hero, HighLight.class, 40f); - Buff.affect(hero, AttackUp.class, 40f).level(80); - Buff.affect(hero, DefenceUp.class, 40f).level(80); - Buff.affect(hero, Silent.class, 40f); - Buff.affect(hero, Locked.class, 40f); - hero.sprite.emitter().burst(ElmoParticle.FACTORY, 12); - Sample.INSTANCE.play(Assets.SND_BURNING); - hero.spendAndNext(1f); - updateQuickslot(); - charge-=20; - - } else if( action.equals( AC_DARK ) ) { - curUser = hero; - Buff.affect(hero, Recharging.class, 40f); - Buff.affect(hero, Arcane.class, 40f); - Buff.affect(hero, Weakness.class, 40f); - Buff.affect(hero, Disarm.class, 40f); - - hero.sprite.emitter().burst(ElmoParticle.FACTORY, 12); - Sample.INSTANCE.play(Assets.SND_BURNING); - hero.spendAndNext(1f); - updateQuickslot(); - charge-=20; - - } else if (action.equals( AC_EARTH )){ - curUser = hero; - - curUser.HP += curUser.HT/5; - Buff.affect(hero, ShieldArmor.class).level(hero.HT/5); - Buff.affect(hero, BerryRegeneration.class).level(hero.HT / 5); - Buff.affect(hero, Rhythm.class, 40f); - - - hero.sprite.emitter().burst(ElmoParticle.FACTORY, 12); - Sample.INSTANCE.play(Assets.SND_BURNING); - hero.spendAndNext(1f); - updateQuickslot(); - charge-=20; - - } else super.execute(hero, action); - - - } - - @Override - public String status() { - return Messages.format("%d", (int)charge/25); - } - - @Override - public String info() { - String info = desc(); - info += "\n\n" + Messages.get(this, "charge",charge,fullCharge); - return info; - } - - @Override - public boolean isUpgradable() { - return false; - } - - @Override - public boolean isIdentified() { - return true; - } - - -} diff --git a/java/com/hmdzl/spspd/change/items/misc/GunOfSoldier.java b/java/com/hmdzl/spspd/change/items/misc/GunOfSoldier.java deleted file mode 100644 index bbf16e15..00000000 --- a/java/com/hmdzl/spspd/change/items/misc/GunOfSoldier.java +++ /dev/null @@ -1,191 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * Yet Another Pixel Dungeon - * Copyright (C) 2015-2016 Considered Hamster - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.misc; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Hunger; -import com.hmdzl.spspd.change.actors.buffs.Invisibility; -import com.hmdzl.spspd.change.actors.buffs.WarGroove; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.mobs.npcs.NPC; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.effects.Splash; -import com.hmdzl.spspd.change.effects.particles.ElmoParticle; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.weapon.missiles.MissileWeapon; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.Terrain; -import com.hmdzl.spspd.change.mechanics.Ballistica; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.CellSelector; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.ui.BuffIndicator; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundle; -import com.watabou.utils.Callback; - -import java.util.ArrayList; - -public class GunOfSoldier extends Item { - - public static final String AC_USE = "USE"; - - private static final float TIME_TO_DIG = 1f; - - { - image = ItemSpriteSheet.GUN_S; - defaultAction = AC_USE; - unique = true; - usesTargeting = true; - } - - public final int fullCharge = 225; - public int charge = 0; - private static final String CHARGE = "charge"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(CHARGE, charge); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - charge = bundle.getInt(CHARGE); - } - - @Override - public ArrayList actions(Hero hero ) { - ArrayList actions = super.actions( hero ); - if (charge >= 75){ - actions.add(AC_USE); - } - actions.remove( AC_THROW ); - actions.remove( AC_DROP ); - return actions; - } - - @Override - public void execute( final Hero hero, String action ) { - if( action.equals( AC_USE ) ){ - curUser = hero; - if (charge < 75) { - GLog.i(Messages.get(GunOfSoldier.class, "break")); - } else GameScene.selectCell( shooter ); - } else { - super.execute(hero, action); - - } - } - - @Override - public String status() { - return Messages.format("%d", (int)charge/75); - } - - @Override - public String info() { - String info = desc(); - info += "\n\n" + Messages.get(GunOfSoldier.class, "charge",charge,fullCharge); - return info; - } - - @Override - public boolean isUpgradable() { - return false; - } - - @Override - public boolean isIdentified() { - return true; - } - - private int targetPos; - - public SoldierAmmo Ammo(){ - return new SoldierAmmo(); - } - - public class SoldierAmmo extends MissileWeapon { - - { - image = ItemSpriteSheet.BOLA; - ACU = 1000; - } - - public int damageRoll(Hero owner) { - return 0; - } - - @Override - protected void onThrow( int cell ) { - Char enemy = Actor.findChar( cell ); - if (enemy == null || enemy == curUser) { - parent = null; - Splash.at( cell, 0xCC99FFFF, 1 ); - } else { - if (!curUser.shoot( enemy, this )) { - Splash.at(cell, 0xCC99FFFF, 1); - } - } - } - - @Override - public void proc(Char attacker, Char defender, int damage) { - - if (defender.properties().contains(Char.Property.BOSS) || defender.properties().contains(Char.Property.MINIBOSS)){ - defender.damage(Math.min(defender.HT - defender.HP,defender.HT/6),this); - } else { - defender.damage(Math.min(defender.HT - defender.HP,defender.HT/3),this); - } - super.proc(attacker, defender, damage); - } - - @Override - public void cast(final Hero user, final int dst) { - final int cell = throwPos( user, dst ); - GunOfSoldier.this.targetPos = cell; - charge-=75; - super.cast(user, dst); - } - - } - private CellSelector.Listener shooter = new CellSelector.Listener() { - @Override - public void onSelect( Integer target ) { - if (target != null) { - Ammo().cast(curUser, target); - } - } - @Override - public String prompt() { - return Messages.get(GunOfSoldier.class, "prompt"); - } - }; -} diff --git a/java/com/hmdzl/spspd/change/items/misc/HealBag.java b/java/com/hmdzl/spspd/change/items/misc/HealBag.java deleted file mode 100644 index 0435bf77..00000000 --- a/java/com/hmdzl/spspd/change/items/misc/HealBag.java +++ /dev/null @@ -1,168 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.misc; - -import java.util.ArrayList; -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.Statistics; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Arcane; -import com.hmdzl.spspd.change.actors.buffs.AttackUp; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.DefenceUp; -import com.hmdzl.spspd.change.actors.buffs.GlassShield; -import com.hmdzl.spspd.change.actors.buffs.Haste; -import com.hmdzl.spspd.change.actors.buffs.Invisibility; -import com.hmdzl.spspd.change.actors.buffs.Levitation; -import com.hmdzl.spspd.change.actors.buffs.Recharging; -import com.hmdzl.spspd.change.actors.buffs.Rhythm; -import com.hmdzl.spspd.change.actors.buffs.Rhythm2; -import com.hmdzl.spspd.change.actors.buffs.ShieldArmor; -import com.hmdzl.spspd.change.actors.buffs.faithbuff.BalanceFaith; -import com.hmdzl.spspd.change.actors.buffs.faithbuff.DemonFaith; -import com.hmdzl.spspd.change.actors.buffs.faithbuff.HumanFaith; -import com.hmdzl.spspd.change.actors.buffs.faithbuff.LifeFaith; -import com.hmdzl.spspd.change.actors.buffs.faithbuff.MechFaith; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.hero.HeroSubClass; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.Generator; -import com.hmdzl.spspd.change.items.Item; - -import com.hmdzl.spspd.change.items.weapon.missiles.RiceBall; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.hmdzl.spspd.change.windows.WndItem; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; -import com.hmdzl.spspd.change.items.weapon.missiles.RiceBall; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.hmdzl.spspd.change.windows.WndItem; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -public class HealBag extends Item { - - { - //name = "healbag"; - image = ItemSpriteSheet.HEAL_BAG; - unique = true; - defaultAction = AC_COOK; - } - - public final int fullCharge = 100; - public int charge = 0; - - public static final String AC_HEAL = "HEAL"; - public static final String AC_COOK = "COOK"; - - private static final String CHARGE = "charge"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(CHARGE, charge); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - charge = bundle.getInt(CHARGE); - } - - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions(hero); - actions.remove(AC_DROP); - actions.remove(AC_THROW); - if (charge > 50) { - actions.add(AC_HEAL); - actions.add(AC_COOK); - } - return actions; - } - - @Override - public void execute(Hero hero, String action) { - - curUser = Dungeon.hero; - - if (action.equals(AC_HEAL)) { - - for (int i = 0; i < Level.NEIGHBOURS8.length; i++) { - Char mob = Actor.findChar(curUser.pos + Level.NEIGHBOURS8[i]); - if (mob != null && mob.HP < mob.HT*1.5) { - mob.HP +=(int)(mob.HT/2); - } - } - charge -= 50; - hero.spendAndNext(1f); - } else if (action.equals(AC_COOK)) { - if (charge < 50) { - GLog.p(Messages.get(this, "need_charge")); - } else { - if (Random.Int(2) == 0) { - Dungeon.level.drop(Generator.random(Generator.Category.POTION), Dungeon.hero.pos).sprite.drop(Dungeon.hero.pos); - } else if (Random.Int(5) == 0) { - Dungeon.level.drop(Generator.random(Generator.Category.HIGHFOOD), Dungeon.hero.pos).sprite.drop(Dungeon.hero.pos); - } else if (Random.Int(2) == 0) { - Dungeon.level.drop(Generator.random(Generator.Category.MUSHROOM), Dungeon.hero.pos).sprite.drop(Dungeon.hero.pos); - } else { - Dungeon.level.drop(Generator.random(Generator.Category.PILL), Dungeon.hero.pos).sprite.drop(Dungeon.hero.pos); - } - charge -= 50; - hero.spendAndNext(1f); - } - } else { - super.execute(hero, action); - } - } - - @Override - public boolean isUpgradable() { - return false; - } - - @Override - public boolean isIdentified() { - return true; - } - - @Override - public String desc() { - String info = super.desc(); - info += "\n\n" + Messages.get(AttackShield.class, "charge",charge,fullCharge); - return info; - } - @Override - public String status() { - return Messages.format("%d", (int)charge/40); - } -} diff --git a/java/com/hmdzl/spspd/change/items/misc/HorseTotem.java b/java/com/hmdzl/spspd/change/items/misc/HorseTotem.java deleted file mode 100644 index c0c2dd14..00000000 --- a/java/com/hmdzl/spspd/change/items/misc/HorseTotem.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.misc; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.DamageUp; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.sprites.ItemSprite.Glowing; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -public class HorseTotem extends MiscEquippable { - - { - image = ItemSpriteSheet.HORSE_TOTEM; - unique = true; - - } - - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions(hero); - actions.remove(AC_DROP); - actions.remove(AC_THROW); - return actions; - } - - @Override - protected MiscBuff buff() { - return new HorseTotemBless(); - } - - public class HorseTotemBless extends MiscBuff { - - } - - @Override - public boolean isUpgradable() { - return false; - } - - @Override - public boolean isIdentified() { - return true; - } - -} diff --git a/java/com/hmdzl/spspd/change/items/misc/JumpF.java b/java/com/hmdzl/spspd/change/items/misc/JumpF.java deleted file mode 100644 index 1f1be0e3..00000000 --- a/java/com/hmdzl/spspd/change/items/misc/JumpF.java +++ /dev/null @@ -1,185 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.misc; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Arcane; -import com.hmdzl.spspd.change.actors.buffs.TargetShoot; -import com.hmdzl.spspd.change.actors.buffs.WarGroove; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Recharging; -import com.hmdzl.spspd.change.items.Generator; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfTeleportation; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.Terrain; -import com.hmdzl.spspd.change.mechanics.Ballistica; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.plants.Plant; -import com.hmdzl.spspd.change.scenes.CellSelector; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Callback; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - - -public class JumpF extends Item { - { - //name = "Jump Shoes"; - image = ItemSpriteSheet.JUMP; - defaultAction = AC_JUMP; - unique = true; - - } - - private static int JUMP_TIME = 1; - private static final String AC_JUMP = "JUMP"; - private static final String TXT_ERROR = "Too far away"; - public final int fullCharge = 25; - public int charge = 0; - private static final String CHARGE = "charge"; - - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(CHARGE, charge); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - charge = bundle.getInt(CHARGE); - } - - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions(hero); - if (charge >= 8){ - actions.add(AC_JUMP); - } - actions.remove(AC_DROP); - actions.remove(AC_THROW); - return actions; - } - - protected CellSelector.Listener jumper = new CellSelector.Listener() { - - @Override - public void onSelect(Integer target) { - if (target != null && target != curUser.pos) { - Ballistica route = new Ballistica(curUser.pos, target, (Ballistica.STOP_TARGET | Ballistica.STOP_TERRAIN)); - int cell = route.collisionPos; - int dist = Level.distance(curUser.pos, cell); - int range = 3; - //if (Actor.findChar( cell ) != null && cell != curUser.pos) - //cell = route.path.get(route.dist-1); - - if (dist > 3) { - range = dist - 3; - cell = route.path.get(route.dist - range); - } - - final int dest = cell; - curUser.busy(); - curUser.sprite.jump(curUser.pos, cell, new Callback() { - @Override - public void call() { - Level.set(curUser.pos, Terrain.HIGH_GRASS); - GameScene.updateMap(curUser.pos); - curUser.move(dest); - //Dungeon.level.press(dest, curUser); - //Dungeon.observe(); - - //for (int i = 0; i < Level.NEIGHBOURS8.length; i++) { - //Char mob = Actor.findChar(curUser.pos - //+ Level.NEIGHBOURS8[i]); - //} - - //CellEmitter.center(dest).burst( - //Speck.factory(Speck.DUST), 10); - curUser.spendAndNext(JUMP_TIME); - - if (Random.Int(10) > 8 ){ - Plant.Seed seed = (Plant.Seed) Generator.random(Generator.Category.SEED3); - Dungeon.level.plant(seed, dest); - } - charge -= 8; - Dungeon.observe(); - updateQuickslot(); - } - }); - } - } - - - public String prompt() { - return Messages.get(Jumpshoes.class, "prompt"); - } - }; - - @Override - public void execute(final Hero hero, String action) { - if (action.equals(AC_JUMP)) { - if (charge < 8) - GLog.i(Messages.get(Jumpshoes.class, "rest")); - else { - curUser = hero; - GameScene.selectCell(jumper); - } - } else { - - super.execute(hero, action); - } - } - - @Override - public boolean isUpgradable() { - return false; - } - - @Override - public boolean isIdentified() { - return true; - } - - - @Override - public String info() { - String info = desc(); - info += "\n\n" + Messages.get(Jumpshoes.class, "charge",charge,fullCharge); - return info; - } - - @Override - public String status() { - return Messages.format("%d", (int)charge/8); - } - -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/items/misc/JumpH.java b/java/com/hmdzl/spspd/change/items/misc/JumpH.java deleted file mode 100644 index 85066e7a..00000000 --- a/java/com/hmdzl/spspd/change/items/misc/JumpH.java +++ /dev/null @@ -1,198 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.misc; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.weapon.missiles.EscapeKnive; -import com.hmdzl.spspd.change.items.weapon.missiles.Smoke; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.mechanics.Ballistica; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.scenes.CellSelector; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.utils.Callback; -import com.watabou.utils.Bundle; -import java.util.HashMap; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.sprites.MissileSprite; -import com.watabou.utils.Random; - - - - public class JumpH extends Item { - { - //name = "Jump Shoes"; - image = ItemSpriteSheet.JUMP; - defaultAction = AC_JUMP; -unique = true; - - } - - private static int JUMP_TIME = 1; - private static final String AC_JUMP = "JUMP"; - public final int fullCharge = 50; - public int charge = 0; - private static final String CHARGE = "charge"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(CHARGE, charge); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - charge = bundle.getInt(CHARGE); - } - - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions(hero); - if (charge >= 15){ - actions.add(AC_JUMP); - } - actions.remove(AC_DROP); - actions.remove(AC_THROW); - return actions; - } - - protected CellSelector.Listener jumper = new CellSelector.Listener() { - - private HashMap targets = new HashMap(); - - @Override - public void onSelect(Integer target) { - if (target != null && target != curUser.pos) { - - Ballistica route = new Ballistica(curUser.pos, target, Ballistica.PROJECTILE); - int cell = route.collisionPos; - int dist = Level.distance(curUser.pos, cell); - int range = 3; - if (Actor.findChar( cell ) != null && cell != curUser.pos) - cell = route.path.get(route.dist-1); - - if (dist > 3) { - range = dist - 3; - cell = route.path.get(route.dist - range); - } - - final int dest = cell; - curUser.busy(); - curUser.sprite.jump(curUser.pos, cell, new Callback() { - @Override - public void call() { - curUser.move(dest); - Dungeon.level.press(dest, curUser); - Dungeon.observe(); - - //for (int i = 0; i < Level.NEIGHBOURS8.length; i++) { - //Char mob = Actor.findChar(curUser.pos - //+ Level.NEIGHBOURS8[i]); - //} - if (Random.Int(10) > 3 ){ - Item proto = new EscapeKnive(); - - for (Mob mob : Dungeon.level.mobs) { - if (Level.fieldOfView[mob.pos] && (Dungeon.level.distance(curUser.pos, mob.pos) <= 7) && mob.isAlive()) { - Callback callback = new Callback() { - @Override - public void call() { - curUser.attack(targets.get(this)); - targets.remove(this); - if (targets.isEmpty()) { - //curUser.spendAndNext(curUser.attackDelay()); - curUser.spendAndNext(0.1f); - } - } - }; - - ((MissileSprite) curUser.sprite.parent.recycle(MissileSprite.class)).reset(curUser.pos, mob.pos, proto, callback); - - targets.put(callback, mob); - } - } - } - CellEmitter.center(dest).burst( - Speck.factory(Speck.DUST), 10); - curUser.spendAndNext(JUMP_TIME); - charge -= 15; - updateQuickslot(); - - } - - - }); - } - } - - - public String prompt() { - return Messages.get(Jumpshoes.class, "prompt"); - } - }; - - @Override - public void execute(final Hero hero, String action) { - if (action.equals(AC_JUMP)) { - if (charge < 15) - GLog.i(Messages.get(Jumpshoes.class, "rest")); - else { - curUser = hero; - GameScene.selectCell(jumper); - } - } else { - - super.execute(hero, action); - } - } - - @Override - public boolean isUpgradable() { - return false; - } - - @Override - public boolean isIdentified() { - return true; - } - - - @Override - public String info() { - String info = desc(); - info += "\n\n" + Messages.get(Jumpshoes.class, "charge",charge,fullCharge); - return info; - } - - @Override - public String status() { - return Messages.format("%d", (int)charge/15); - } - -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/items/misc/JumpM.java b/java/com/hmdzl/spspd/change/items/misc/JumpM.java deleted file mode 100644 index ad1befe4..00000000 --- a/java/com/hmdzl/spspd/change/items/misc/JumpM.java +++ /dev/null @@ -1,178 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.misc; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.buffs.Arcane; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Recharging; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfTeleportation; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.mechanics.Ballistica; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.scenes.CellSelector; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Callback; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - - -public class JumpM extends Item { - { - //name = "Jump Shoes"; - image = ItemSpriteSheet.JUMP; - defaultAction = AC_JUMP; - unique = true; - - } - - private static int JUMP_TIME = 1; - private static final String AC_JUMP = "JUMP"; - private static final String TXT_ERROR = "Too far away"; - public final int fullCharge = 50; - public int charge = 0; - private static final String CHARGE = "charge"; - - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(CHARGE, charge); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - charge = bundle.getInt(CHARGE); - } - - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions(hero); - if (charge >= 15){ - actions.add(AC_JUMP); - } - actions.remove(AC_DROP); - actions.remove(AC_THROW); - return actions; - } - - protected CellSelector.Listener jumper = new CellSelector.Listener() { - - @Override - public void onSelect(Integer target) { - if (target != null && target != curUser.pos) { - Ballistica route = new Ballistica(curUser.pos, target, (Ballistica.STOP_TARGET | Ballistica.STOP_TERRAIN)); - int cell = route.collisionPos; - int dist = Level.distance(curUser.pos, cell); - int range = 3; - //if (Actor.findChar( cell ) != null && cell != curUser.pos) - //cell = route.path.get(route.dist-1); - - if (dist > 3) { - range = dist - 3; - cell = route.path.get(route.dist - range); - } - - final int dest = cell; - ScrollOfTeleportation.appear( curUser, dest ); - CellEmitter.get(dest).burst(Speck.factory(Speck.WOOL), 10); - Sample.INSTANCE.play(Assets.SND_PUFF); - Dungeon.level.press( dest, curUser ); - Dungeon.observe(); - curUser.spendAndNext(JUMP_TIME); - if (Random.Int(10) > 3 ){ - Buff.affect(curUser, Arcane.class, 10f);} - charge -= 15; - updateQuickslot(); - - /*curUser.busy(); - curUser.sprite.jump(curUser.pos, cell, new Callback() { - @Override - public void call() { - curUser.move(dest); - Dungeon.level.press(dest, curUser); - Dungeon.observe(); - CellEmitter.center(dest).burst( - Speck.factory(Speck.DUST), 10); - curUser.spendAndNext(JUMP_TIME); - if (Random.Int(10) > 3 ){ - Buff.affect(curUser, Recharging.class, 4f);} - charge -= 15; - updateQuickslot(); - } - });*/ - } - } - - - public String prompt() { - return Messages.get(Jumpshoes.class, "prompt"); - } - }; - - @Override - public void execute(final Hero hero, String action) { - if (action.equals(AC_JUMP)) { - if (charge < 15) - GLog.i(Messages.get(Jumpshoes.class, "rest")); - else { - curUser = hero; - GameScene.selectCell(jumper); - } - } else { - - super.execute(hero, action); - } - } - - @Override - public boolean isUpgradable() { - return false; - } - - @Override - public boolean isIdentified() { - return true; - } - - - @Override - public String info() { - String info = desc(); - info += "\n\n" + Messages.get(Jumpshoes.class, "charge",charge,fullCharge); - return info; - } - - @Override - public String status() { - return Messages.format("%d", (int)charge/15); - } - -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/items/misc/JumpP.java b/java/com/hmdzl/spspd/change/items/misc/JumpP.java deleted file mode 100644 index eb506e66..00000000 --- a/java/com/hmdzl/spspd/change/items/misc/JumpP.java +++ /dev/null @@ -1,180 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.misc; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.AttackUp; -import com.hmdzl.spspd.change.actors.buffs.GlassShield; -import com.hmdzl.spspd.change.actors.buffs.Recharging; -import com.hmdzl.spspd.change.actors.buffs.Rhythm; -import com.hmdzl.spspd.change.actors.buffs.Rhythm2; -import com.hmdzl.spspd.change.actors.hero.Belongings; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Paralysis; -import com.hmdzl.spspd.change.actors.hero.HeroSubClass; -import com.hmdzl.spspd.change.items.Heap; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.mechanics.Ballistica; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.scenes.CellSelector; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.utils.Callback; -import com.watabou.utils.Random; -import com.watabou.utils.Bundle; - -import static com.hmdzl.spspd.change.Dungeon.hero; - - -public class JumpP extends Item { - { - //name = "Jump Shoes"; - image = ItemSpriteSheet.JUMP; - defaultAction = AC_JUMP; - unique = true; - - } - - private static int JUMP_TIME = 1; - private static final String AC_JUMP = "JUMP"; - public final int fullCharge = 20; - public int charge = 0; - private static final String CHARGE = "charge"; - - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(CHARGE, charge); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - charge = bundle.getInt(CHARGE); - } - - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions(hero); - if (charge >= 10){ - actions.add(AC_JUMP); - } - actions.remove(AC_DROP); - actions.remove(AC_THROW); - return actions; - } - - protected CellSelector.Listener jumper = new CellSelector.Listener() { - @Override - public void onSelect(Integer target) { - if (target != null && target != curUser.pos) { - - Ballistica route = new Ballistica(curUser.pos, target, Ballistica.PROJECTILE); - int cell = route.collisionPos; - int dist = Level.distance(curUser.pos, cell); - int range = 3; - if (Actor.findChar( cell ) != null && cell != curUser.pos) - cell = route.path.get(route.dist-1); - - if (dist > 3) { - range = dist - 3; - cell = route.path.get(route.dist - range); - } - - final int dest = cell; - curUser.busy(); - curUser.sprite.jump(curUser.pos, cell, new Callback() { - @Override - public void call() { - curUser.move(dest); - Dungeon.level.press(dest, curUser); - Dungeon.observe(); - - //CellEmitter.center(dest).burst( - //Speck.factory(Speck.DUST), 10); - curUser.spendAndNext(JUMP_TIME); - Buff.affect(curUser, GlassShield.class).turns(1); - Buff.affect(curUser, Rhythm.class,5f); - if(hero.subClass == HeroSubClass.SUPERSTAR){ - //Buff.affect(curUser,Rhythm.class,50); - Buff.affect(curUser,Rhythm2.class,5); - } - //Buff.affect(curUser, Rhythm2.class,10f); - charge -= 10; - updateQuickslot(); - } - }); - - - } - } - - public String prompt() { - return Messages.get(Jumpshoes.class, "prompt"); - } - }; - - @Override - public void execute(final Hero hero, String action) { - if (action.equals(AC_JUMP)) { - if (charge < 10) - GLog.i(Messages.get(Jumpshoes.class, "rest")); - else { - curUser = hero; - GameScene.selectCell(jumper); - } - } else { - - super.execute(hero, action); - } - } - - @Override - public boolean isUpgradable() { - return false; - } - - @Override - public boolean isIdentified() { - return true; - } - - - @Override - public String info() { - String info = desc(); - info += "\n\n" + Messages.get(Jumpshoes.class, "charge",charge,fullCharge); - return info; - } - - @Override - public String status() { - return Messages.format("%d", (int)charge/10); - } - -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/items/misc/JumpR.java b/java/com/hmdzl/spspd/change/items/misc/JumpR.java deleted file mode 100644 index 44ddc6ff..00000000 --- a/java/com/hmdzl/spspd/change/items/misc/JumpR.java +++ /dev/null @@ -1,173 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.misc; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Levitation; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Invisibility; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.mechanics.Ballistica; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.scenes.CellSelector; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.utils.Callback; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - - -public class JumpR extends Item { - { - //name = "Jump Shoes"; - image = ItemSpriteSheet.JUMP; - defaultAction = AC_JUMP; - unique = true; - - } - - private static int JUMP_TIME = 1; - private static final String AC_JUMP = "JUMP"; - public final int fullCharge = 40; - public int charge = 0; - private static final String CHARGE = "charge"; - - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(CHARGE, charge); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - charge = bundle.getInt(CHARGE); - } - - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions(hero); - if (charge >= 10){ - actions.add(AC_JUMP); - } - actions.remove(AC_DROP); - actions.remove(AC_THROW); - return actions; - } - - protected CellSelector.Listener jumper = new CellSelector.Listener() { - - @Override - public void onSelect(Integer target) { - if (target != null && target != curUser.pos) { - - Ballistica route = new Ballistica(curUser.pos, target,Ballistica.PROJECTILE); - int cell = route.collisionPos; - int dist = Level.distance(curUser.pos, cell); - int range = 2; - if (Actor.findChar( cell ) != null && cell != curUser.pos) - cell = route.path.get(route.dist-1); - - if (dist > 2) { - range = dist - 2; - cell = route.path.get(route.dist - range); - } - - final int dest = cell; - Buff.prolong(curUser, Levitation.class,2f); - curUser.busy(); - curUser.sprite.jump(curUser.pos, cell, new Callback() { - @Override - public void call() { - curUser.move(dest); - //Dungeon.level.press(dest, curUser); - //Dungeon.observe(); - - for (int i = 0; i < Level.NEIGHBOURS8.length; i++) { - Char mob = Actor.findChar(curUser.pos - + Level.NEIGHBOURS8[i]); - } - - //CellEmitter.center(dest).burst( - //Speck.factory(Speck.DUST), 10); - curUser.spendAndNext(JUMP_TIME); - if (Random.Int(10) > 3 ){ - Buff.prolong(curUser, Invisibility.class,5);} - charge -= 10; - updateQuickslot(); - } - }); - } - } - - - public String prompt() { - return Messages.get(Jumpshoes.class, "prompt"); - } - }; - - @Override - public void execute(final Hero hero, String action) { - if (action.equals(AC_JUMP)) { - if (charge < 10) - GLog.i(Messages.get(Jumpshoes.class, "rest")); - else { - curUser = hero; - GameScene.selectCell(jumper); - } - } else { - - super.execute(hero, action); - } - } - - @Override - public boolean isUpgradable() { - return false; - } - - @Override - public boolean isIdentified() { - return true; - } - - - @Override - public String info() { - String info = desc(); - info += "\n\n" + Messages.get(Jumpshoes.class, "charge",charge,fullCharge); - return info; - } - - @Override - public String status() { - return Messages.format("%d", (int)charge/10); - } - - -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/items/misc/JumpS.java b/java/com/hmdzl/spspd/change/items/misc/JumpS.java deleted file mode 100644 index 055eaad8..00000000 --- a/java/com/hmdzl/spspd/change/items/misc/JumpS.java +++ /dev/null @@ -1,180 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.misc; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Arcane; -import com.hmdzl.spspd.change.actors.buffs.TargetShoot; -import com.hmdzl.spspd.change.actors.buffs.WarGroove; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Recharging; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfTeleportation; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.mechanics.Ballistica; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.scenes.CellSelector; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Callback; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - - -public class JumpS extends Item { - { - //name = "Jump Shoes"; - image = ItemSpriteSheet.JUMP; - defaultAction = AC_JUMP; - unique = true; - - } - - private static int JUMP_TIME = 1; - private static final String AC_JUMP = "JUMP"; - private static final String TXT_ERROR = "Too far away"; - public final int fullCharge = 30; - public int charge = 0; - private static final String CHARGE = "charge"; - - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(CHARGE, charge); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - charge = bundle.getInt(CHARGE); - } - - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions(hero); - if (charge >= 15){ - actions.add(AC_JUMP); - } - actions.remove(AC_DROP); - actions.remove(AC_THROW); - return actions; - } - - protected CellSelector.Listener jumper = new CellSelector.Listener() { - - @Override - public void onSelect(Integer target) { - if (target != null && target != curUser.pos) { - Ballistica route = new Ballistica(curUser.pos, target, (Ballistica.STOP_TARGET | Ballistica.STOP_TERRAIN)); - int cell = route.collisionPos; - int dist = Level.distance(curUser.pos, cell); - int range = 3; - //if (Actor.findChar( cell ) != null && cell != curUser.pos) - //cell = route.path.get(route.dist-1); - - if (dist > 3) { - range = dist - 3; - cell = route.path.get(route.dist - range); - } - - final int dest = cell; - curUser.belongings.relord(); - curUser.busy(); - curUser.sprite.jump(curUser.pos, cell, new Callback() { - @Override - public void call() { - curUser.move(dest); - //Dungeon.level.press(dest, curUser); - //Dungeon.observe(); - - //for (int i = 0; i < Level.NEIGHBOURS8.length; i++) { - //Char mob = Actor.findChar(curUser.pos - //+ Level.NEIGHBOURS8[i]); - //} - - //CellEmitter.center(dest).burst( - //Speck.factory(Speck.DUST), 10); - curUser.spendAndNext(JUMP_TIME); - - if (Random.Int(10) > 3 ){ - curUser.belongings.relord(); - Buff.affect(curUser, TargetShoot.class, 10f); - } - charge -= 10; - updateQuickslot(); - } - }); - } - } - - - public String prompt() { - return Messages.get(Jumpshoes.class, "prompt"); - } - }; - - @Override - public void execute(final Hero hero, String action) { - if (action.equals(AC_JUMP)) { - if (charge < 10) - GLog.i(Messages.get(Jumpshoes.class, "rest")); - else { - curUser = hero; - GameScene.selectCell(jumper); - } - } else { - - super.execute(hero, action); - } - } - - @Override - public boolean isUpgradable() { - return false; - } - - @Override - public boolean isIdentified() { - return true; - } - - - @Override - public String info() { - String info = desc(); - info += "\n\n" + Messages.get(Jumpshoes.class, "charge",charge,fullCharge); - return info; - } - - @Override - public String status() { - return Messages.format("%d", (int)charge/10); - } - -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/items/misc/JumpW.java b/java/com/hmdzl/spspd/change/items/misc/JumpW.java deleted file mode 100644 index 293180b6..00000000 --- a/java/com/hmdzl/spspd/change/items/misc/JumpW.java +++ /dev/null @@ -1,176 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.misc; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.AttackUp; -import com.hmdzl.spspd.change.actors.buffs.Recharging; -import com.hmdzl.spspd.change.actors.hero.Belongings; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Paralysis; -import com.hmdzl.spspd.change.items.Heap; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.mechanics.Ballistica; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.scenes.CellSelector; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.utils.Callback; -import com.watabou.utils.Random; -import com.watabou.utils.Bundle; - - - public class JumpW extends Item { - { - //name = "Jump Shoes"; - image = ItemSpriteSheet.JUMP; - defaultAction = AC_JUMP; - unique = true; - - } - - private static int JUMP_TIME = 1; - private static final String AC_JUMP = "JUMP"; - public final int fullCharge = 55; - public int charge = 0; - private static final String CHARGE = "charge"; - - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(CHARGE, charge); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - charge = bundle.getInt(CHARGE); - } - - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions(hero); - if (charge >= 25){ - actions.add(AC_JUMP); - } - actions.remove(AC_DROP); - actions.remove(AC_THROW); - return actions; - } - - protected CellSelector.Listener jumper = new CellSelector.Listener() { - @Override - public void onSelect(Integer target) { - if (target != null && target != curUser.pos) { - - Ballistica route = new Ballistica(curUser.pos, target, Ballistica.PROJECTILE); - int cell = route.collisionPos; - int dist = Level.distance(curUser.pos, cell); - int range = 5; - if (Actor.findChar( cell ) != null && cell != curUser.pos) - cell = route.path.get(route.dist-1); - - if (dist > 5) { - range = dist - 5; - cell = route.path.get(route.dist - range); - } - - final int dest = cell; - curUser.busy(); - curUser.sprite.jump(curUser.pos, cell, new Callback() { - @Override - public void call() { - curUser.move(dest); - Dungeon.level.press(dest, curUser); - Dungeon.observe(); - - for (int i = 0; i < Level.NEIGHBOURS8.length; i++) { - Char mob = Actor.findChar(curUser.pos - + Level.NEIGHBOURS8[i]); - if (mob != null && mob != curUser && Random.Int(10)>2 ) { - Buff.prolong(mob, Paralysis.class, 3); - } - } - - CellEmitter.center(dest).burst( - Speck.factory(Speck.DUST), 10); - curUser.spendAndNext(JUMP_TIME); - //Buff.affect(curUser, AttackUp.class, 10f).level(50); - charge -= 25; - updateQuickslot(); - } - }); - - - } - } - - public String prompt() { - return Messages.get(Jumpshoes.class, "prompt"); - } - }; - - @Override - public void execute(final Hero hero, String action) { - if (action.equals(AC_JUMP)) { - if (charge < 25) - GLog.i(Messages.get(Jumpshoes.class, "rest")); - else { - curUser = hero; - GameScene.selectCell(jumper); - } - } else { - - super.execute(hero, action); - } - } - - @Override - public boolean isUpgradable() { - return false; - } - - @Override - public boolean isIdentified() { - return true; - } - - - @Override - public String info() { - String info = desc(); - info += "\n\n" + Messages.get(Jumpshoes.class, "charge",charge,fullCharge); - return info; - } - - @Override - public String status() { - return Messages.format("%d", (int)charge/25); - } - -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/items/misc/Jumpshoes.java b/java/com/hmdzl/spspd/change/items/misc/Jumpshoes.java deleted file mode 100644 index 9afbf891..00000000 --- a/java/com/hmdzl/spspd/change/items/misc/Jumpshoes.java +++ /dev/null @@ -1,170 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.misc; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.mechanics.Ballistica; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.scenes.CellSelector; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.utils.Callback; -import com.watabou.utils.Bundle; - - - public class Jumpshoes extends Item { - { - //name = "Jump Shoes"; - image = ItemSpriteSheet.JUMP; - defaultAction = AC_JUMP; - unique = true; - - } - - private static int JUMP_TIME = 1; - private static final String AC_JUMP = "JUMP"; - public final int fullCharge = 50; - public int charge = 0; - private static final String CHARGE = "charge"; - - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(CHARGE, charge); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - charge = bundle.getInt(CHARGE); - } - - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions(hero); - if (charge >= 10){ - actions.add(AC_JUMP); - } - actions.remove(AC_DROP); - actions.remove(AC_THROW); - return actions; - } - - protected CellSelector.Listener jumper = new CellSelector.Listener() { - - @Override - public void onSelect(Integer target) { - if (target != null && target != curUser.pos) { - - Ballistica route = new Ballistica(curUser.pos, target, Ballistica.PROJECTILE); - int cell = route.collisionPos; - int dist = Level.distance(curUser.pos, cell); - int range = 3; - if (Actor.findChar( cell ) != null && cell != curUser.pos) - cell = route.path.get(route.dist-1); - - if (dist > 3) { - range = dist - 3; - cell = route.path.get(route.dist - range); - } - - final int dest = cell; - - if (Ballistica.distance > 4){ - GLog.w(Messages.get(Jumpshoes.class, "error")); - return; - } else { - curUser.busy(); - curUser.sprite.jump(curUser.pos, cell, new Callback() { - @Override - public void call() { - curUser.move(dest); - Dungeon.level.press(dest, curUser); - Dungeon.observe(); - - for (int i = 0; i < Level.NEIGHBOURS8.length; i++) { - Char mob = Actor.findChar(curUser.pos - + Level.NEIGHBOURS8[i]); - } - - CellEmitter.center(dest).burst( - Speck.factory(Speck.DUST), 10); - curUser.spendAndNext(JUMP_TIME); - charge -= 10; - updateQuickslot(); - } - }); - } - } - } - - public String prompt() { - return Messages.get(Jumpshoes.class, "prompt"); - } - }; - - @Override - public void execute(final Hero hero, String action) { - if (action.equals(AC_JUMP)) { - if (charge < 10) - GLog.i(Messages.get(this, "rest")); - else { - curUser = hero; - GameScene.selectCell(jumper); - } - } else { - - super.execute(hero, action); - } - } - - @Override - public boolean isUpgradable() { - return false; - } - - @Override - public boolean isIdentified() { - return true; - } - - - @Override - public String info() { - String info = desc(); - info += "\n\n" + Messages.get(this, "charge",charge,fullCharge); - return info; - } - - @Override - public String status() { - return Messages.format("%d", (int)charge/10); - } - -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/items/misc/LuckyBadge.java b/java/com/hmdzl/spspd/change/items/misc/LuckyBadge.java deleted file mode 100644 index 2e52a413..00000000 --- a/java/com/hmdzl/spspd/change/items/misc/LuckyBadge.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.misc; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.hero.HeroClass; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.ItemStatusHandler; -import com.hmdzl.spspd.change.items.KindofMisc; -import com.hmdzl.spspd.change.items.rings.Ring.RingBuff; -import com.hmdzl.spspd.change.items.rings.RingOfAccuracy.Accuracy; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -public class LuckyBadge extends MiscEquippable { - - { - //name = "LuckyBadge"; - image = ItemSpriteSheet.LUCKY_BADGE; - - unique = true; - - } - - @Override - protected MiscBuff buff() { - return new GreatLucky(); - } - - public class GreatLucky extends MiscBuff { - } - - @Override - public boolean isIdentified() { - return true; - } - - @Override - public boolean isUpgradable() { - return true; - } -} diff --git a/java/com/hmdzl/spspd/change/items/misc/MKbox.java b/java/com/hmdzl/spspd/change/items/misc/MKbox.java deleted file mode 100644 index e065645f..00000000 --- a/java/com/hmdzl/spspd/change/items/misc/MKbox.java +++ /dev/null @@ -1,121 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.misc; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.Statistics; -import com.hmdzl.spspd.change.actors.buffs.BoxStar; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.FireImbue; -import com.hmdzl.spspd.change.actors.buffs.FrostImbue; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.Ankh; -import com.hmdzl.spspd.change.items.Generator; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.StoneOre; - -import com.hmdzl.spspd.change.items.weapon.melee.zero.WoodenHammer; -import com.hmdzl.spspd.change.items.weapon.missiles.RiceBall; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.ItemSprite; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Random; - -public class MKbox extends Item { - - public static final String AC_USE = "USE"; - - public static final float TIME_TO_USE = 1; - - { - //name = "MKbox"; - image = ItemSpriteSheet.MK_BOX; - defaultAction = AC_USE; - unique = true; - stackable = false; - } - - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions(hero); - actions.add(AC_USE); - return actions; - } - - @Override - public void execute(Hero hero, String action) { - - if (action.equals(AC_USE)) { - if (Dungeon.gold < 100){ - GLog.p(Messages.get(MKbox.class, "need_gold")); - } else { - Dungeon.gold -= 100; - hero.spend(TIME_TO_USE); - hero.busy(); - - hero.sprite.operate(hero.pos); - if (Random.Int(50) == 0) { - Buff.affect(hero,BoxStar.class,30f); - GLog.p(Messages.get(MKbox.class, "star")); - } else if (Random.Int(49) == 0) { - Dungeon.gold += 500; - GLog.p(Messages.get(MKbox.class, "coin")); - //GLog.p(Messages.get(MKbox.class,"mbox")); - } else if (Random.Int(48) < 3) { - Dungeon.level.drop(new Ankh(), Dungeon.hero.pos).sprite.drop(Dungeon.hero.pos); - GLog.p(Messages.get(MKbox.class, "1up")); - } else if (Random.Int(45) < 20) { - WoodenHammer wh = new WoodenHammer(); - Dungeon.level.drop(wh, Dungeon.hero.pos).sprite.drop(Dungeon.hero.pos); - GLog.p(Messages.get(MKbox.class, "hammer")); - } else if (Random.Int(25) < 20) { - Dungeon.level.drop(Generator.random(Generator.Category.MUSHROOM), Dungeon.hero.pos).sprite.drop(Dungeon.hero.pos); - GLog.p(Messages.get(MKbox.class, "mushroom")); - } else if (Random.Int(2) == 1) { - Buff.affect(hero,FireImbue.class).set(FireImbue.DURATION); - GLog.p(Messages.get(MKbox.class, "flowerf")); - } else { - Buff.affect(hero, FrostImbue.class, FrostImbue.DURATION); - GLog.p(Messages.get(MKbox.class, "floweri")); - } - } - } else { - super.execute(hero, action); - - } - } - - @Override - public boolean isUpgradable() { - return false; - } - - @Override - public boolean isIdentified() { - return true; - } - -} diff --git a/java/com/hmdzl/spspd/change/items/misc/MechPocket.java b/java/com/hmdzl/spspd/change/items/misc/MechPocket.java deleted file mode 100644 index 67ea8c51..00000000 --- a/java/com/hmdzl/spspd/change/items/misc/MechPocket.java +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.misc; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.Statistics; -import com.hmdzl.spspd.change.actors.buffs.BoxStar; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.FireImbue; -import com.hmdzl.spspd.change.actors.buffs.FrostImbue; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.effects.particles.ElmoParticle; -import com.hmdzl.spspd.change.items.Ankh; -import com.hmdzl.spspd.change.items.Generator; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.StoneOre; - -import com.hmdzl.spspd.change.items.weapon.melee.zero.WoodenHammer; -import com.hmdzl.spspd.change.items.weapon.missiles.RiceBall; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.ItemSprite; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Random; - -public class MechPocket extends Item { - - public static final String AC_USE = "USE"; - - public static final float TIME_TO_USE = 1; - - { - //name = "MechPocket"; - image = ItemSpriteSheet.MECH_POCKET; - defaultAction = AC_USE; - unique = true; - stackable = false; - } - - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions(hero); - actions.add(AC_USE); - return actions; - } - - @Override - public void execute(Hero hero, String action) { - - if (action.equals(AC_USE)) { - curUser = hero; - Sample.INSTANCE.play(Assets.SND_BURNING); - curUser.sprite.emitter().burst(ElmoParticle.FACTORY, 12); - curUser.spendAndNext(1f); - for(int i=0; i<20; i++) { - Dungeon.level.drop(Generator.random(), hero.pos).sprite.drop(); - } - detach(curUser.belongings.backpack); - } else { - super.execute(hero, action); - - } - } - - @Override - public boolean isUpgradable() { - return false; - } - - @Override - public boolean isIdentified() { - return true; - } - -} diff --git a/java/com/hmdzl/spspd/change/items/misc/MiscEquippable.java b/java/com/hmdzl/spspd/change/items/misc/MiscEquippable.java deleted file mode 100644 index 6eccd542..00000000 --- a/java/com/hmdzl/spspd/change/items/misc/MiscEquippable.java +++ /dev/null @@ -1,216 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.misc; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.hero.HeroClass; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.ItemStatusHandler; -import com.hmdzl.spspd.change.items.KindofMisc; -import com.hmdzl.spspd.change.items.artifacts.Artifact; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -public class MiscEquippable extends KindofMisc { - - - private static final float TIME_TO_EQUIP = 1f; - private static final String TXT_TO_STRING = "%s"; - private static final String TXT_TO_STRING_LVL = "%s%+d"; - protected Buff buff; - - public MiscEquippable() { - super(); - } - - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions(hero); - actions.add(isEquipped(hero) ? AC_UNEQUIP : AC_EQUIP); - return actions; - } - - @Override - public boolean doEquip(Hero hero) { - - if (hero.belongings.misc1 != null && hero.belongings.misc2 != null && hero.belongings.misc3 != null) { - - GLog.w(Messages.get(Artifact.class, "onlythree")); - return false; - - } else { - - if (hero.belongings.misc1 == null) { - hero.belongings.misc1 = this; - } else if (hero.belongings.misc2 == null){ - hero.belongings.misc2 = this; - } else { - hero.belongings.misc3 = this; - } - - detach(hero.belongings.backpack); - - activate(hero); - - cursedKnown = true; - if (cursed) { - equipCursed(hero); - GLog.n(Messages.get(Artifact.class, "cursed_worn")); - } - - hero.spendAndNext(TIME_TO_EQUIP); - return true; - - } - - } - - @Override - public void activate(Char ch) { - buff = buff(); - buff.attachTo(ch); - } - - @Override - public boolean doUnequip(Hero hero, boolean collect, boolean single) { - if (super.doUnequip(hero, collect, single)) { - - if (hero.belongings.misc1 == this) { - hero.belongings.misc1 = null; - } else if (hero.belongings.misc2 == this){ - hero.belongings.misc2 = null; - } else { - hero.belongings.misc3 = null; - } - - hero.remove(buff); - buff = null; - - return true; - - } else { - - return false; - - } - } - - @Override - public boolean isEquipped(Hero hero) { - return hero.belongings.misc1 == this || hero.belongings.misc2 == this || hero.belongings.misc3 == this ; - } - - @Override - public boolean isUpgradable() { - return true; - } - - @Override - public Item upgrade() { - - super.upgrade(); - - if (buff != null) { - - Char owner = buff.target; - buff.detach(); - if ((buff = buff()) != null) { - buff.attachTo(owner); - } - } - - return this; - } - - @Override - public int visiblyUpgraded() { - return level; - } - - @Override - public String info() { - if (cursed && cursedKnown && !isEquipped(Dungeon.hero)) { - - return desc() + "\n\n" + Messages.get(Artifact.class, "curse_known"); - - } else { - - return desc(); - } - } - - @Override - public String toString() { - if (levelKnown && level != 0) { - return Messages.format(TXT_TO_STRING_LVL, name(), - visiblyUpgraded()); - } else { - return Messages.format(TXT_TO_STRING, name()); - } - } - - @Override - public String status() { - return null; - } - - - protected MiscBuff buff() { - return null; - } - - public static int getBonus(Char target, Class type){ - int bonus = 0; - for (MiscBuff buff : target.buffs(type)) { - bonus += buff.level; - } - return bonus; - } - - public class MiscBuff extends Buff { - - public int level; - - public MiscBuff() { - level = MiscEquippable.this.level; - } - - @Override - public boolean attachTo(Char target) { - - return super.attachTo(target); - } - - @Override - public boolean act() { - - spend(TICK); - - return true; - } - } -} diff --git a/java/com/hmdzl/spspd/change/items/misc/MissileShield.java b/java/com/hmdzl/spspd/change/items/misc/MissileShield.java deleted file mode 100644 index 51a13701..00000000 --- a/java/com/hmdzl/spspd/change/items/misc/MissileShield.java +++ /dev/null @@ -1,216 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.misc; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.DefenceUp; -import com.hmdzl.spspd.change.actors.buffs.Paralysis; -import com.hmdzl.spspd.change.actors.buffs.ShieldArmor; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.mobs.npcs.NPC; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.effects.Splash; -import com.hmdzl.spspd.change.effects.particles.ElmoParticle; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.bags.Bag; -import com.hmdzl.spspd.change.items.weapon.missiles.MissileWeapon; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.CellSelector; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.sprites.MissileSprite; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -import java.util.ArrayList; - -import static com.hmdzl.spspd.change.Dungeon.hero; - -public class MissileShield extends Item { - - { - //name = "MissileShield"; - image = ItemSpriteSheet.WARRIORSHIELD; - - stackable = false; - unique = true; - defaultAction = AC_CAST; - } - - private static final String AC_CAST = "CAST"; - private static final String AC_SHIELD = "SHIELD"; - public final int fullCharge = 10; - public int charge = 0; - private static final String CHARGE = "charge"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(CHARGE, charge); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - charge = bundle.getInt(CHARGE); - } - - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions( hero ); - if (charge > 9){ - actions.add(AC_CAST); - } - if (charge > 5){ - actions.add(AC_SHIELD); - } - actions.remove( AC_THROW ); - actions.remove( AC_DROP ); - return actions; - } - - @Override - public void execute(final Hero hero, String action) { - super.execute(hero, action); - if (action.equals(AC_CAST)) { - curUser = hero; - if (charge < 10) { - GLog.i(Messages.get(this, "rest")); - } else GameScene.selectCell(shooter); - } else if (action.equals(AC_SHIELD)) { - curUser = hero; - if (charge < 5) { - GLog.i(Messages.get(this, "rest")); - return; - } else { - Buff.prolong(hero, DefenceUp.class, 3f).level(50); - Buff.affect(hero, ShieldArmor.class).level(hero.lvl); - charge -= 5; - } - } - - } - - @Override - public String desc() { - String info = super.desc(); - info += "\n\n" + Messages.get(MissileShield.class, "damage",min(),max()); - info += "\n\n" + Messages.get(MissileShield.class, "charge",charge,fullCharge); - return info; - } - - public int level() { - return Dungeon.hero == null ? 0 : Dungeon.hero.lvl/5; - } - - @Override - public int visiblyUpgraded() { - return level(); - } - - @Override - public boolean isUpgradable() { - return false; - } - - @Override - public boolean isIdentified() { - return true; - } - - public int min() { - return 1 + Dungeon.hero.lvl/5; - } - - public int max() { - return 1 + Dungeon.hero.lvl/2; - } - - public int damageRoll(Hero owner) { - int damage = Random.Int(min(), max()); - return Math.round(damage); - } - - private int targetPos; - - public MissileShieldAmmo Ammo(){ - return new MissileShieldAmmo(); - } - - public class MissileShieldAmmo extends MissileWeapon { - - { - image = ItemSpriteSheet.WARRIORSHIELD; - ACU = 1000; - } - - public int damageRoll(Hero owner) { - return MissileShield.this.damageRoll(owner); - } - - @Override - protected void onThrow( int cell ) { - Char enemy = Actor.findChar( cell ); - if (enemy == null || enemy == curUser) { - parent = null; - Splash.at( cell, 0xCC99FFFF, 1 ); - } else { - if (!curUser.shoot( enemy, this )) { - Splash.at(cell, 0xCC99FFFF, 1); - } - } - } - - @Override - public void proc(Char attacker, Char defender, int damage) { - - if (defender.properties().contains(Char.Property.BOSS) || defender.properties().contains(Char.Property.MINIBOSS)){ - defender.damage(damage,this); - } - Buff.prolong(defender, Paralysis.class, 3); - super.proc(attacker, defender, damage); - } - - @Override - public void cast(final Hero user, final int dst) { - final int cell = throwPos( user, dst ); - MissileShield.this.targetPos = cell; - charge-=10; - super.cast(user, dst); - } - - } - private CellSelector.Listener shooter = new CellSelector.Listener() { - @Override - public void onSelect( Integer target ) { - if (target != null) { - Ammo().cast(curUser, target); - } - } - @Override - public String prompt() { - return Messages.get(MissileShield.class, "prompt"); - } - }; -} - diff --git a/java/com/hmdzl/spspd/change/items/misc/PotionOfMage.java b/java/com/hmdzl/spspd/change/items/misc/PotionOfMage.java deleted file mode 100644 index 976658c2..00000000 --- a/java/com/hmdzl/spspd/change/items/misc/PotionOfMage.java +++ /dev/null @@ -1,295 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * Yet Another Pixel Dungeon - * Copyright (C) 2015-2016 Considered Hamster - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.misc; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.Blob; -import com.hmdzl.spspd.change.actors.blobs.ConfusionGas; -import com.hmdzl.spspd.change.actors.blobs.DarkGas; -import com.hmdzl.spspd.change.actors.blobs.ParalyticGas; -import com.hmdzl.spspd.change.actors.blobs.StenchGas; -import com.hmdzl.spspd.change.actors.blobs.TarGas; -import com.hmdzl.spspd.change.actors.blobs.ToxicGas; -import com.hmdzl.spspd.change.actors.buffs.Arcane; -import com.hmdzl.spspd.change.actors.buffs.ArmorBreak; -import com.hmdzl.spspd.change.actors.buffs.AttackDown; -import com.hmdzl.spspd.change.actors.buffs.AttackUp; -import com.hmdzl.spspd.change.actors.buffs.BerryRegeneration; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Burning; -import com.hmdzl.spspd.change.actors.buffs.Chill; -import com.hmdzl.spspd.change.actors.buffs.DefenceUp; -import com.hmdzl.spspd.change.actors.buffs.Frost; -import com.hmdzl.spspd.change.actors.buffs.HighLight; -import com.hmdzl.spspd.change.actors.buffs.Hot; -import com.hmdzl.spspd.change.actors.buffs.Hunger; -import com.hmdzl.spspd.change.actors.buffs.Invisibility; -import com.hmdzl.spspd.change.actors.buffs.Recharging; -import com.hmdzl.spspd.change.actors.buffs.Rhythm; -import com.hmdzl.spspd.change.actors.buffs.Roots; -import com.hmdzl.spspd.change.actors.buffs.Shocked; -import com.hmdzl.spspd.change.actors.buffs.Slow; -import com.hmdzl.spspd.change.actors.buffs.WarGroove; -import com.hmdzl.spspd.change.actors.buffs.Wet; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.effects.Splash; -import com.hmdzl.spspd.change.effects.particles.ElmoParticle; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.artifacts.EtherealChains; -import com.hmdzl.spspd.change.items.weapon.missiles.MissileWeapon; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.Terrain; -import com.hmdzl.spspd.change.mechanics.Ballistica; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.CellSelector; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.ui.BuffIndicator; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundle; -import com.watabou.utils.Callback; -import com.watabou.utils.Random; - -import java.util.ArrayList; - -public class PotionOfMage extends Item { - - public static final String AC_USE = "USE"; - public static final String AC_DRINK = "DRINK"; - public static final String AC_SHATTERED = "SHATTERED"; - private static final float TIME_TO_DIG = 1f; - - { - image = ItemSpriteSheet.POTION_OF_MAGE; - defaultAction = AC_USE; - - unique = true; - - } - - public final int fullCharge = 100; - public int charge = 0; - private static final String CHARGE = "charge"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(CHARGE, charge); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - charge = bundle.getInt(CHARGE); - } - - @Override - public ArrayList actions(Hero hero ) { - ArrayList actions = super.actions( hero ); - if (charge >= 70) { - actions.add(AC_USE); - actions.add(AC_SHATTERED); - } - if (charge >= 50){ - actions.add(AC_DRINK); - } - actions.remove( AC_THROW ); - actions.remove( AC_DROP ); - return actions; - } - - @Override - public void execute( final Hero hero, String action ) { - if( action.equals( AC_USE ) ) { - curUser = hero; - if (charge < 70) { - GLog.i(Messages.get(PotionOfMage.class, "break")); - } else GameScene.selectCell(shooter); - - } else if( action.equals( AC_SHATTERED ) ) { - curUser = hero; - if (charge < 70) { - GLog.i(Messages.get(PotionOfMage.class, "break")); - } else GameScene.selectCell(Shattered); - - } else if (action.equals( AC_DRINK )){ - curUser = hero; - if (charge < 50) { - GLog.i(Messages.get(PotionOfMage.class, "break")); - } else { - switch (Random.Int(7)) { - case 0: - Buff.affect(hero, HighLight.class, 10f); - break; - case 1: - Buff.affect(hero, AttackUp.class, 10f).level(35); - break; - case 2: - Buff.affect(hero, DefenceUp.class, 10f).level(35); - break; - case 3: - Buff.affect(hero, Recharging.class, 10f); - break; - case 4: - Buff.affect(hero, Arcane.class, 10f); - break; - case 5: - Buff.affect(hero, BerryRegeneration.class).level(hero.HP / 2); - break; - case 6: - Buff.affect(hero, Rhythm.class, 10f); - break; - default: - break; - } - hero.sprite.emitter().burst(ElmoParticle.FACTORY, 12); - Sample.INSTANCE.play(Assets.SND_BURNING); - hero.spendAndNext(1f); - updateQuickslot(); - charge-=50; - } - } else super.execute(hero, action); - - - } - - @Override - public String status() { - return Messages.format("%d", (int)charge/70); - } - - @Override - public String info() { - String info = desc(); - info += "\n\n" + Messages.get(PotionOfMage.class, "charge",charge,fullCharge); - return info; - } - - @Override - public boolean isUpgradable() { - return false; - } - - @Override - public boolean isIdentified() { - return true; - } - - private CellSelector.Listener Shattered = new CellSelector.Listener(){ - @Override - public void onSelect(Integer target) { - if (target != null && (Dungeon.level.visited[target] || Dungeon.level.mapped[target])){ - GameScene.add(Blob.seed(target, 15, ToxicGas.class)); - GameScene.add(Blob.seed(target, 15, ConfusionGas.class)); - GameScene.add(Blob.seed(target, 15, ParalyticGas.class)); - GameScene.add(Blob.seed(target, 15, DarkGas.class)); - GameScene.add(Blob.seed(target, 15, TarGas.class)); - GameScene.add(Blob.seed(target, 15, StenchGas.class)); - charge-= 70; - Dungeon.hero.spendAndNext(1f); - updateQuickslot(); - } - } - @Override - public String prompt() { - return Messages.get(PotionOfMage.class, "prompt"); - } - }; - - private int targetPos; - - public MageAmmo Ammo(){ - return new MageAmmo(); - } - - public class MageAmmo extends MissileWeapon { - - { - image = ItemSpriteSheet.POTION_OF_MAGE; - ACU = 1000; - } - - public int damageRoll(Hero owner) { - return 0; - } - - @Override - protected void onThrow( int cell ) { - Char enemy = Actor.findChar( cell ); - if (enemy == curUser || enemy == null) { - parent = null; - Splash.at(cell, 0xCC99FFFF, 1); - //} else if (enemy == null){ - //GameScene.add(Blob.seed(cell, 10, ToxicGas.class)); - //GameScene.add(Blob.seed(cell, 10, ConfusionGas.class)); - //GameScene.add(Blob.seed(cell, 15, ParalyticGas.class)); - //GameScene.add(Blob.seed(cell, 15, DarkGas.class)); - //GameScene.add(Blob.seed(cell, 10, TarGas.class)); - //GameScene.add(Blob.seed(cell, 10, StenchGas.class)); - } else { - if (!curUser.shoot( enemy, this )) { - Splash.at(cell, 0xCC99FFFF, 1); - } - } - } - - @Override - public void proc(Char attacker, Char defender, int damage) { - - Buff.affect(defender, AttackDown.class, 10f).level(35); - Buff.affect(defender, ArmorBreak.class, 10f).level(35); - Buff.affect(defender, Slow.class, 10f); - Buff.affect(defender, Hot.class,10f); - Buff.affect(defender, Wet.class, 10f); - Buff.affect(defender, Shocked.class, 10f); - Buff.affect(defender, Roots.class, 10f); - - super.proc(attacker, defender, damage); - } - - @Override - public void cast(final Hero user, final int dst) { - final int cell = throwPos( user, dst ); - PotionOfMage.this.targetPos = cell; - charge-=70; - super.cast(user, dst); - } - - } - private CellSelector.Listener shooter = new CellSelector.Listener() { - @Override - public void onSelect( Integer target ) { - if (target != null) { - Ammo().cast(curUser, target); - } - } - @Override - public String prompt() { - return Messages.get(PotionOfMage.class, "prompt"); - } - }; -} diff --git a/java/com/hmdzl/spspd/change/items/misc/RangeBag.java b/java/com/hmdzl/spspd/change/items/misc/RangeBag.java deleted file mode 100644 index cb677050..00000000 --- a/java/com/hmdzl/spspd/change/items/misc/RangeBag.java +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.misc; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.DamageUp; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.Generator; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.ItemSprite.Glowing; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -public class RangeBag extends MiscEquippable { - - { - image = ItemSpriteSheet.RANGE_BAG; - unique = true; - defaultAction = AC_BUY; - } - - public static final String AC_BUY = "BUY"; - - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions(hero); - actions.remove(AC_DROP); - actions.remove(AC_THROW); - actions.add(AC_BUY); - return actions; - } - - @Override - public void execute(Hero hero, String action) { - - curUser = Dungeon.hero; - - if (action.equals( AC_BUY )){ - if (Dungeon.gold < 500 ) { - GLog.p(Messages.get(this, "need_gold")); - } else { - Dungeon.gold -= 500; - hero.spend(1f); - hero.busy(); - - hero.sprite.operate(hero.pos); - Dungeon.level.drop(Generator.random(Generator.Category.LINKDROP), Dungeon.hero.pos).sprite.drop(Dungeon.hero.pos); - - } - } else { - super.execute(hero, action); - } - } - - @Override - protected MiscBuff buff() { - return new RangeBagBless(); - } - - public class RangeBagBless extends MiscBuff { - - } - - @Override - public boolean isUpgradable() { - return false; - } - - @Override - public boolean isIdentified() { - return true; - } - -} diff --git a/java/com/hmdzl/spspd/change/items/misc/SavageHelmet.java b/java/com/hmdzl/spspd/change/items/misc/SavageHelmet.java deleted file mode 100644 index 1ad239d6..00000000 --- a/java/com/hmdzl/spspd/change/items/misc/SavageHelmet.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.misc; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.DamageUp; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.sprites.ItemSprite.Glowing; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -public class SavageHelmet extends MiscEquippable { - - { - image = ItemSpriteSheet.HELMET; - unique = true; - - } - - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions(hero); - actions.remove(AC_DROP); - actions.remove(AC_THROW); - return actions; - } - - @Override - protected MiscBuff buff() { - return new SavageHelmetBless(); - } - - public class SavageHelmetBless extends MiscBuff { - - public int absorb(int damage) { - int x = Random.Int(1,damage/2); - damage -=x; - Buff.affect(target, DamageUp.class).level(x); - return damage; - } - - } - - - @Override - public boolean isUpgradable() { - return false; - } - - @Override - public boolean isIdentified() { - return true; - } - -} diff --git a/java/com/hmdzl/spspd/change/items/misc/Shovel.java b/java/com/hmdzl/spspd/change/items/misc/Shovel.java deleted file mode 100644 index 008d36d7..00000000 --- a/java/com/hmdzl/spspd/change/items/misc/Shovel.java +++ /dev/null @@ -1,183 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * Yet Another Pixel Dungeon - * Copyright (C) 2015-2016 Considered Hamster - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.misc; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Hunger; -import com.hmdzl.spspd.change.actors.buffs.Invisibility; -import com.hmdzl.spspd.change.actors.buffs.WarGroove; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.Terrain; -import com.hmdzl.spspd.change.mechanics.Ballistica; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.CellSelector; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.ui.BuffIndicator; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundle; -import com.watabou.utils.Callback; - -import java.util.ArrayList; - -public class Shovel extends Item { - - public static final String AC_USE = "USE"; - public static final String AC_BUILD = "BUILD"; - - private static final float TIME_TO_DIG = 1f; - - { - //name = "Shovel"; - image = ItemSpriteSheet.SHOVEL; - defaultAction = AC_USE; - unique = true; - - } - - public final int fullCharge = 120; - public int charge = 0; - private static final String CHARGE = "charge"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(CHARGE, charge); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - charge = bundle.getInt(CHARGE); - } - - @Override - public ArrayList actions(Hero hero ) { - ArrayList actions = super.actions( hero ); - if (charge >= 40){ - actions.add(AC_USE); - } - if (charge >= 100){ - actions.add(AC_BUILD); - } - actions.remove( AC_THROW ); - actions.remove( AC_DROP ); - return actions; - } - - @Override - public void execute( final Hero hero, String action ) { - if( action.equals( AC_USE ) ){ - for (int i = 0; i < Level.NEIGHBOURS4.length; i++) { - - final int pos = hero.pos + Level.NEIGHBOURS4[i]; - if(charge < 40){ - GLog.i(Messages.get(Shovel.class, "break")); - return; - } else if (Dungeon.level.map[pos] == Terrain.WALL && Level.insideMap(pos)) { - hero.spend(TIME_TO_DIG); - hero.busy(); - hero.sprite.attack(pos, new Callback() { - @Override - public void call() { - CellEmitter.center(pos).burst( - Speck.factory(Speck.STAR), 7); - Sample.INSTANCE.play(Assets.SND_EVOKE); - Level.set(pos, Terrain.EMBERS); - GameScene.updateMap(pos); - - Hunger hunger = hero.buff(Hunger.class); - if (hunger != null && !hunger.isStarving()) { - hunger.satisfy(-10); - BuffIndicator.refreshHero(); - } - Buff.affect(hero,WarGroove.class); - charge-=50; - updateQuickslot(); - hero.onOperateComplete(); - } - }); - return; - } - } - } else if ( action.equals( AC_BUILD )){ - for (int n : Level.NEIGHBOURS4) { - int c = hero.pos + n; - if (c >= 0 && c < Level.getLength()) { - if ((Dungeon.level.map[c] == Terrain.EMPTY || - Dungeon.level.map[c] == Terrain.EMPTY_DECO || - Dungeon.level.map[c] == Terrain.EMPTY_SP || - Dungeon.level.map[c] == Terrain.GRASS )&& Level.insideMap(c)) { - Level.set(c, Terrain.WALL); - GameScene.updateMap(c); - Dungeon.observe(); - } - } - } - hero.spend(TIME_TO_DIG); - hero.busy(); - Hunger hunger = hero.buff(Hunger.class); - if (hunger != null && !hunger.isStarving()) { - hunger.satisfy(-10); - BuffIndicator.refreshHero(); - } - charge-=100; - updateQuickslot(); - hero.onOperateComplete(); - return; - } else { - super.execute(hero, action); - - } - } - - @Override - public String status() { - return Messages.format("%d", (int)charge/40); - } - - @Override - public String info() { - String info = desc(); - info += "\n\n" + Messages.get(Shovel.class, "charge",charge,fullCharge); - return info; - } - - @Override - public boolean isUpgradable() { - return false; - } - - @Override - public boolean isIdentified() { - return true; - } - - -} diff --git a/java/com/hmdzl/spspd/change/items/misc/SkillOfAtk.java b/java/com/hmdzl/spspd/change/items/misc/SkillOfAtk.java deleted file mode 100644 index 477fcf7a..00000000 --- a/java/com/hmdzl/spspd/change/items/misc/SkillOfAtk.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.misc; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.Statistics; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.Item; - -import com.hmdzl.spspd.change.items.weapon.missiles.RiceBall; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.audio.Sample; - -public class SkillOfAtk extends Item { - - { - //name = "Skill of atk"; - image = ItemSpriteSheet.SKILL_ATK; - - stackable = false; - - defaultAction = AC_READ; - } - - - public static final String AC_READ = "READ"; - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions(hero); - actions.add(AC_READ); - return actions; - } - - @Override - public void execute(Hero hero, String action) { - - if (action.equals(AC_READ)) { - - hero.hitSkill++; - //hero.evadeSkill++; - //hero.magicSkill++; - GLog.w(Messages.get(this, "skillup")); - detach(hero.belongings.backpack); - } else { - super.execute(hero, action); - - } - } - - @Override - public boolean isUpgradable() { - return false; - } - - @Override - public boolean isIdentified() { - return true; - } - - @Override - public int price() { - return 50 * quantity; - } - -} diff --git a/java/com/hmdzl/spspd/change/items/misc/SkillOfDef.java b/java/com/hmdzl/spspd/change/items/misc/SkillOfDef.java deleted file mode 100644 index ac762545..00000000 --- a/java/com/hmdzl/spspd/change/items/misc/SkillOfDef.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.misc; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.Statistics; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.Item; - -import com.hmdzl.spspd.change.items.weapon.missiles.RiceBall; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.audio.Sample; - -public class SkillOfDef extends Item { - - { - //name = "Skill of def"; - image = ItemSpriteSheet.SKILL_DEF; - - stackable = false; - - defaultAction = AC_READ; - } - - - public static final String AC_READ = "READ"; - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions(hero); - actions.add(AC_READ); - return actions; - } - - @Override - public void execute(Hero hero, String action) { - - if (action.equals(AC_READ)) { - - //hero.hitSkill++; - hero.evadeSkill++; - //hero.magicSkill++; - GLog.w(Messages.get(this, "skillup")); - detach(hero.belongings.backpack); - } else { - super.execute(hero, action); - - } - } - - @Override - public boolean isUpgradable() { - return false; - } - - @Override - public boolean isIdentified() { - return true; - } - - @Override - public int price() { - return 100 * quantity; - } - -} diff --git a/java/com/hmdzl/spspd/change/items/misc/SkillOfMig.java b/java/com/hmdzl/spspd/change/items/misc/SkillOfMig.java deleted file mode 100644 index 53d35e7d..00000000 --- a/java/com/hmdzl/spspd/change/items/misc/SkillOfMig.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.misc; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.Statistics; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.Item; - -import com.hmdzl.spspd.change.items.weapon.missiles.RiceBall; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.audio.Sample; - -public class SkillOfMig extends Item { - - { - //name = "Skill of mig"; - image = ItemSpriteSheet.SKILL_MIG; - - stackable = false; - - defaultAction = AC_READ; - } - - - public static final String AC_READ = "READ"; - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions(hero); - actions.add(AC_READ); - return actions; - } - - @Override - public void execute(Hero hero, String action) { - - if (action.equals(AC_READ)) { - - //hero.hitSkill++; - //hero.evadeSkill++; - hero.magicSkill++; - GLog.w(Messages.get(this, "skillup")); - detach(hero.belongings.backpack); - } else { - super.execute(hero, action); - - } - } - - @Override - public boolean isUpgradable() { - return false; - } - - @Override - public boolean isIdentified() { - return true; - } - - @Override - public int price() { - return 200 * quantity; - } - -} diff --git a/java/com/hmdzl/spspd/change/items/misc/Spectacles.java b/java/com/hmdzl/spspd/change/items/misc/Spectacles.java deleted file mode 100644 index a9b77d2a..00000000 --- a/java/com/hmdzl/spspd/change/items/misc/Spectacles.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.misc; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.hero.HeroClass; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.ItemStatusHandler; -import com.hmdzl.spspd.change.items.KindofMisc; -import com.hmdzl.spspd.change.items.rings.Ring.RingBuff; -import com.hmdzl.spspd.change.items.rings.RingOfAccuracy.Accuracy; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -public class Spectacles extends MiscEquippable { - - { - image = ItemSpriteSheet.OTILUKES_SPECS; - unique = true; - } - - @Override - protected MiscBuff buff() { - return new MagicSight(); - } - - public class MagicSight extends MiscBuff { - } - - @Override - public boolean isIdentified() { - return true; - } - - @Override - public boolean isUpgradable() { - return false; - } - -} diff --git a/java/com/hmdzl/spspd/change/items/misc/UndeadBook.java b/java/com/hmdzl/spspd/change/items/misc/UndeadBook.java deleted file mode 100644 index 9d0fd888..00000000 --- a/java/com/hmdzl/spspd/change/items/misc/UndeadBook.java +++ /dev/null @@ -1,114 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.misc; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.Statistics; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Dewcharge; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.Ankh; -import com.hmdzl.spspd.change.items.Item; - -import com.hmdzl.spspd.change.items.weapon.missiles.RiceBall; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundle; - -public class UndeadBook extends Item { - - public static final String AC_READ = "READ"; - - public static final String AC_BLESS = "BLESS"; - - { - //name = "UndeadBook"; - image = ItemSpriteSheet.UNDEAD_BOOK; - - stackable = false; - charge = 0; - //defaultAction = AC_READ; - } - - public static int charge; - private static final String CHARGE = "charge"; - - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions(hero); - if (hero.HT > 10) actions.add(AC_READ); - if (charge < hero.lvl) actions.add(AC_BLESS); - return actions; - } - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(CHARGE, charge); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - charge = bundle.getInt(CHARGE); - } - - - @Override - public void execute(Hero hero, String action) { - - if (action.equals(AC_READ)) { - hero.HT -= 5; - Buff.affect(hero, Dewcharge.class, 100f); - GLog.p(Messages.get(this, "bless")); - } - - if (action.equals(AC_BLESS)) { - charge ++; - Dungeon.level.drop(new Ankh(), Dungeon.hero.pos).sprite.drop(Dungeon.hero.pos); - GLog.p(Messages.get(this, "1up")); - } else { - super.execute(hero, action); - - } - } - - @Override - public boolean isUpgradable() { - return false; - } - - @Override - public boolean isIdentified() { - return true; - } - - @Override - public int price() { - return 50 * quantity; - } - -} diff --git a/java/com/hmdzl/spspd/change/items/nornstone/BlueNornStone.java b/java/com/hmdzl/spspd/change/items/nornstone/BlueNornStone.java deleted file mode 100644 index 03bc77e3..00000000 --- a/java/com/hmdzl/spspd/change/items/nornstone/BlueNornStone.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.nornstone; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.Statistics; -import com.hmdzl.spspd.change.actors.buffs.Hunger; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.effects.SpellSprite; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfRecharging; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Random; - -public class BlueNornStone extends NornStone { - - - { - type = 2; - //name = "norn stone"; - image = ItemSpriteSheet.NORNBLUE; - } - - @Override - public boolean isUpgradable() { - return false; - } - - @Override - public boolean isIdentified() { - return true; - } - - @Override - public int price() { - return 50 * quantity; - } -} diff --git a/java/com/hmdzl/spspd/change/items/nornstone/GreenNornStone.java b/java/com/hmdzl/spspd/change/items/nornstone/GreenNornStone.java deleted file mode 100644 index 7a459ed0..00000000 --- a/java/com/hmdzl/spspd/change/items/nornstone/GreenNornStone.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.nornstone; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.Statistics; -import com.hmdzl.spspd.change.actors.buffs.Hunger; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.effects.SpellSprite; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfRecharging; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Random; - -public class GreenNornStone extends NornStone { - - - { - type=1; - //name = "norn stone"; - image = ItemSpriteSheet.NORNGREEN; - } - - - @Override - public boolean isUpgradable() { - return false; - } - - @Override - public boolean isIdentified() { - return true; - } - - @Override - public int price() { - return 50 * quantity; - } -} diff --git a/java/com/hmdzl/spspd/change/items/nornstone/NornStone.java b/java/com/hmdzl/spspd/change/items/nornstone/NornStone.java deleted file mode 100644 index 4717542f..00000000 --- a/java/com/hmdzl/spspd/change/items/nornstone/NornStone.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.nornstone; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.Statistics; -import com.hmdzl.spspd.change.actors.buffs.Hunger; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.effects.SpellSprite; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfRecharging; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Random; - -public class NornStone extends Item { - - public int type=0; - - { - stackable = true; - //name = "norn stone"; - image = ItemSpriteSheet.NORNGREEN; - - } - - @Override - public boolean isUpgradable() { - return false; - } - - @Override - public boolean isIdentified() { - return true; - } - - @Override - public int price() { - return 100 * quantity; - } -} diff --git a/java/com/hmdzl/spspd/change/items/nornstone/OrangeNornStone.java b/java/com/hmdzl/spspd/change/items/nornstone/OrangeNornStone.java deleted file mode 100644 index 8ea09802..00000000 --- a/java/com/hmdzl/spspd/change/items/nornstone/OrangeNornStone.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.nornstone; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.Statistics; -import com.hmdzl.spspd.change.actors.buffs.Hunger; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.effects.SpellSprite; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfRecharging; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Random; - -public class OrangeNornStone extends NornStone { - - - { - type=3; - //name = "norn stone"; - image = ItemSpriteSheet.NORNORANGE; - } - - - @Override - public boolean isUpgradable() { - return false; - } - - @Override - public boolean isIdentified() { - return true; - } - - @Override - public int price() { - return 50 * quantity; - } -} diff --git a/java/com/hmdzl/spspd/change/items/nornstone/PurpleNornStone.java b/java/com/hmdzl/spspd/change/items/nornstone/PurpleNornStone.java deleted file mode 100644 index dacf6772..00000000 --- a/java/com/hmdzl/spspd/change/items/nornstone/PurpleNornStone.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.nornstone; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.Statistics; -import com.hmdzl.spspd.change.actors.buffs.Hunger; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.effects.SpellSprite; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfRecharging; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Random; - -public class PurpleNornStone extends NornStone { - - - { - type=4; - //name = "norn stone"; - image = ItemSpriteSheet.NORNPURPLE; - } - - @Override - public boolean isUpgradable() { - return false; - } - - @Override - public boolean isIdentified() { - return true; - } - - @Override - public int price() { - return 50 * quantity; - } -} diff --git a/java/com/hmdzl/spspd/change/items/nornstone/YellowNornStone.java b/java/com/hmdzl/spspd/change/items/nornstone/YellowNornStone.java deleted file mode 100644 index 2e67f7fd..00000000 --- a/java/com/hmdzl/spspd/change/items/nornstone/YellowNornStone.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.nornstone; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.Statistics; -import com.hmdzl.spspd.change.actors.buffs.Hunger; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.effects.SpellSprite; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfRecharging; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Random; - -public class YellowNornStone extends NornStone { - - - { - type=5; - //name = "norn stone"; - image = ItemSpriteSheet.NORNYELLOW; - } - - @Override - public boolean isUpgradable() { - return false; - } - - @Override - public boolean isIdentified() { - return true; - } - - @Override - public int price() { - return 50 * quantity; - } -} diff --git a/java/com/hmdzl/spspd/change/items/potions/Potion.java b/java/com/hmdzl/spspd/change/items/potions/Potion.java deleted file mode 100644 index dcdafd10..00000000 --- a/java/com/hmdzl/spspd/change/items/potions/Potion.java +++ /dev/null @@ -1,313 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.potions; - -import java.util.ArrayList; -import java.util.HashSet; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.Challenges; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.Fire; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Burning; -import com.hmdzl.spspd.change.actors.buffs.Locked; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.hero.HeroClass; -import com.hmdzl.spspd.change.effects.Splash; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.ItemStatusHandler; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.Terrain; -import com.hmdzl.spspd.change.plants.Plant; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ItemSprite; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.hmdzl.spspd.change.windows.WndOptions; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -public class Potion extends Item { - - public static final String AC_DRINK = "DRINK"; - - private static final float TIME_TO_DRINK = Dungeon.isChallenged(Challenges.ITEM_PHOBIA)? 5f : 1f; - - protected Integer initials; - - private static final Class[] potions = { PotionOfHealing.class, - PotionOfExperience.class, PotionOfToxicGas.class, - PotionOfLiquidFlame.class, PotionOfStrength.class, - PotionOfParalyticGas.class, PotionOfLevitation.class, - PotionOfMindVision.class, PotionOfPurity.class, - PotionOfInvisibility.class, PotionOfMight.class, - PotionOfFrost.class, PotionOfMending.class, - PotionOfOverHealing.class}; - - private static final String[] colors = { "turquoise", "crimson", "azure", - "jade", "golden", "magenta", "charcoal", "ivory", "amber", - "bistre", "indigo", "silver", "aqua", "violet"}; - private static final Integer[] images = { ItemSpriteSheet.POTION_TURQUOISE, - ItemSpriteSheet.POTION_CRIMSON, ItemSpriteSheet.POTION_AZURE, - ItemSpriteSheet.POTION_JADE, ItemSpriteSheet.POTION_GOLDEN, - ItemSpriteSheet.POTION_MAGENTA, ItemSpriteSheet.POTION_CHARCOAL, - ItemSpriteSheet.POTION_IVORY, ItemSpriteSheet.POTION_AMBER, - ItemSpriteSheet.POTION_BISTRE, ItemSpriteSheet.POTION_INDIGO, - ItemSpriteSheet.POTION_SILVER, ItemSpriteSheet.POTION_AQUA, - ItemSpriteSheet.POTION_VIOLET}; - - private static ItemStatusHandler handler; - - private String color; - - public boolean ownedByFruit = false; - - { - stackable = true; - defaultAction = AC_DRINK; - } - - @SuppressWarnings("unchecked") - public static void initColors() { - handler = new ItemStatusHandler( - (Class[]) potions, colors, images); - } - - public static void save(Bundle bundle) { - handler.save(bundle); - } - - @SuppressWarnings("unchecked") - public static void restore(Bundle bundle) { - handler = new ItemStatusHandler( - (Class[]) potions, colors, images, bundle); - } - - public Potion() { - super(); - sync(); - } - - @Override - public void sync() { - super.sync(); - image = handler.image(this); - color = handler.label(this); - }; - - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions(hero); - actions.add(AC_DRINK); - return actions; - } - - @Override - public void execute(final Hero hero, String action) { - if (action.equals(AC_DRINK)) { - - if (hero.buff(Locked.class) != null) { - GLog.w(Messages.get(Potion.class, "locked")); - } else if (isKnown() - && (this instanceof PotionOfLiquidFlame - || this instanceof PotionOfToxicGas - || this instanceof PotionOfParalyticGas)) { - - GameScene.show(new WndOptions(Messages.get(Potion.class, "harmful"), - Messages.get(Potion.class, "sure_drink"), - Messages.get(Potion.class, "yes"), Messages.get(Potion.class, "no")) { - @Override - protected void onSelect(int index) { - if (index == 0) { - drink(hero); - } - } - - ; - }); - - } else { - drink(hero); - } - - } else { - - super.execute(hero, action); - - } - } - - @Override - public void doThrow(final Hero hero) { - - if (isKnown() - && (this instanceof PotionOfExperience - || this instanceof PotionOfHealing - || this instanceof PotionOfMindVision - || this instanceof PotionOfStrength - || this instanceof PotionOfInvisibility - || this instanceof PotionOfMight - || this instanceof PotionOfOverHealing - || this instanceof PotionOfMending)) { - - GameScene.show(new WndOptions( Messages.get(Potion.class, "beneficial"), - Messages.get(Potion.class, "sure_throw"), - Messages.get(Potion.class, "yes"), Messages.get(Potion.class, "no")) { - @Override - protected void onSelect(int index) { - if (index == 0) { - Potion.super.doThrow(hero); - } - }; - }); - - } else { - super.doThrow(hero); - } - } - - protected void drink(Hero hero) { - if (!(Dungeon.hero.heroClass == HeroClass.FOLLOWER ) || (Dungeon.hero.heroClass == HeroClass.FOLLOWER && Random.Int(10)>=1 )) - detach(hero.belongings.backpack); - - hero.spend(TIME_TO_DRINK); - hero.busy(); - apply(hero); - - Sample.INSTANCE.play(Assets.SND_DRINK); - - hero.sprite.operate(hero.pos); - } - - @Override - protected void onThrow(int cell) { - if (Dungeon.level.map[cell] == Terrain.WELL || Level.pit[cell] || Plant.checkPhase(cell)) { - - super.onThrow(cell); - - } else { - - shatter(cell); - - } - } - - public void apply(Hero hero) { - shatter(hero.pos); - } - - public void shatter(int cell) { - if (Dungeon.visible[cell]) { - GLog.i(Messages.get(Potion.class, "shatter", color())); - Sample.INSTANCE.play(Assets.SND_SHATTER); - splash(cell); - } - } - - @Override - public void cast(final Hero user, int dst) { - super.cast(user, dst); - } - - public boolean isKnown() { - return handler.isKnown(this); - } - - public void setKnown() { - if (!ownedByFruit) { - if (!isKnown()) { - handler.know(this); - } - - Badges.validateAllPotionsIdentified(); - } - } - - public Integer initials(){ - return isKnown() ? initials : null; - } - - protected String color() { - return Messages.get(Potion.class, color); - } - - @Override - public Item identify() { - - setKnown(); - return this; - } - - @Override - public String name() { - return isKnown() ? super.name() : Messages.get(Potion.class, "unknown_name", color()); - } - - @Override - public String info() { - return isKnown() ? - desc() : - Messages.get(Potion.class, "unknown_desc", color()); - } - - @Override - public boolean isIdentified() { - return isKnown(); - } - - @Override - public boolean isUpgradable() { - return false; - } - - public static HashSet> getKnown() { - return handler.known(); - } - - public static HashSet> getUnknown() { - return handler.unknown(); - } - - public static boolean allKnown() { - return handler.known().size() == potions.length; - } - - protected void splash(int cell) { - final int color = ItemSprite.pick(image, 8, 10); - Splash.at(cell, color, 5); - - Fire fire = (Fire) Dungeon.level.blobs.get(Fire.class); - if (fire != null) - fire.clear(cell); - - Char ch = Actor.findChar(cell); - if (ch != null) - Buff.detach(ch, Burning.class); - } - - @Override - public int price() { - return 20 * quantity; - } -} diff --git a/java/com/hmdzl/spspd/change/items/potions/PotionOfExperience.java b/java/com/hmdzl/spspd/change/items/potions/PotionOfExperience.java deleted file mode 100644 index ab5423a2..00000000 --- a/java/com/hmdzl/spspd/change/items/potions/PotionOfExperience.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.potions; - -import com.hmdzl.spspd.change.actors.buffs.Bless; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Haste; -import com.hmdzl.spspd.change.actors.buffs.Strength; -import com.hmdzl.spspd.change.actors.buffs.WarGroove; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.watabou.utils.Random; - -public class PotionOfExperience extends Potion { - - { - //name = "Potion of Experience"; - - initials = 0; - - - } - - @Override - public void apply(Hero hero) { - setKnown(); - //hero.earnExp(Random.Int(hero.maxExp()/2,hero.maxExp() - hero.exp)); - Buff.affect(hero, Bless.class, 50f); - Buff.affect(hero, Haste.class, 50f); - Buff.affect(hero,Strength.class); - } - - @Override - public int price() { - return isKnown() ? 80 * quantity : super.price(); - } -} diff --git a/java/com/hmdzl/spspd/change/items/potions/PotionOfFrost.java b/java/com/hmdzl/spspd/change/items/potions/PotionOfFrost.java deleted file mode 100644 index 7ea8268e..00000000 --- a/java/com/hmdzl/spspd/change/items/potions/PotionOfFrost.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.potions; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.blobs.Fire; -import com.hmdzl.spspd.change.actors.blobs.Freezing; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.utils.BArray; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.PathFinder; - -public class PotionOfFrost extends Potion { - - private static final int DISTANCE = 2; - - { - //name = "Potion of Frost"; - initials = 1; - } - - @Override - public void shatter(int cell) { - - PathFinder.buildDistanceMap(cell, BArray.not(Level.losBlockLow, null), - DISTANCE); - - Fire fire = (Fire) Dungeon.level.blobs.get(Fire.class); - - boolean visible = false; - for (int i = 0; i < Level.getLength(); i++) { - if (PathFinder.distance[i] < Integer.MAX_VALUE) { - visible = Freezing.affect(i, fire) || visible; - } - } - - if (visible) { - splash(cell); - Sample.INSTANCE.play(Assets.SND_SHATTER); - - setKnown(); - } - } - - @Override - public int price() { - return isKnown() ? 50 * quantity : super.price(); - } -} diff --git a/java/com/hmdzl/spspd/change/items/potions/PotionOfHaste.java b/java/com/hmdzl/spspd/change/items/potions/PotionOfHaste.java deleted file mode 100644 index f9bb19cf..00000000 --- a/java/com/hmdzl/spspd/change/items/potions/PotionOfHaste.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.potions; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Haste; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.audio.Sample; -import com.watabou.noosa.tweeners.AlphaTweener; - -public class PotionOfHaste extends Potion { - - private static final float ALPHA = 0.4f; - - { - //name = "Potion of Haste"; - initials = 2; - } - - @Override - public void apply(Hero hero) { - setKnown(); - Buff.affect(hero, Haste.class, Haste.DURATION); - //GLog.i("You are moving much faster!"); - Sample.INSTANCE.play(Assets.SND_MELD); - } - - /*@Override - public String desc() { - return "Drinking this potion will temporarily speed up your actions."; - }*/ - - @Override - public int price() { - return isKnown() ? 40 * quantity : super.price(); - } - - public static void melt(Char ch) { - if (ch.sprite.parent != null) { - ch.sprite.parent.add(new AlphaTweener(ch.sprite, ALPHA, 0.4f)); - } else { - ch.sprite.alpha(ALPHA); - } - } -} diff --git a/java/com/hmdzl/spspd/change/items/potions/PotionOfHealing.java b/java/com/hmdzl/spspd/change/items/potions/PotionOfHealing.java deleted file mode 100644 index 339e9895..00000000 --- a/java/com/hmdzl/spspd/change/items/potions/PotionOfHealing.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.potions; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.buffs.Bleeding; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Cripple; -import com.hmdzl.spspd.change.actors.buffs.Poison; -import com.hmdzl.spspd.change.actors.buffs.Weakness; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.hero.HeroSubClass; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.utils.GLog; - -public class PotionOfHealing extends Potion { - - { - //name = "Potion of Healing"; - - initials = 3; - - - } - - @Override - public void apply(Hero hero) { - setKnown(); - heal(Dungeon.hero); - } - - public static void heal(Hero hero) { - - if (Dungeon.hero.subClass == HeroSubClass.PASTOR){ - hero.HP = hero.HP+Math.min(hero.HT, (int)(hero.HT*1.5-hero.HP)); - } - hero.HP = hero.HP+Math.min(hero.HT, hero.HT-hero.HP); - Buff.detach(hero, Poison.class); - Buff.detach(hero, Cripple.class); - Buff.detach(hero, Weakness.class); - Buff.detach(hero, Bleeding.class); - - hero.sprite.emitter().start(Speck.factory(Speck.HEALING), 0.4f, 4); - } - - @Override - public int price() { - return isKnown() ? 30 * quantity : super.price(); - } -} diff --git a/java/com/hmdzl/spspd/change/items/potions/PotionOfInvisibility.java b/java/com/hmdzl/spspd/change/items/potions/PotionOfInvisibility.java deleted file mode 100644 index bfcd12eb..00000000 --- a/java/com/hmdzl/spspd/change/items/potions/PotionOfInvisibility.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.potions; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.AttackUp; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Invisibility; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.items.misc.AutoPotion.AutoHealPotion; -import com.hmdzl.spspd.change.utils.GLog; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.noosa.audio.Sample; -import com.watabou.noosa.tweeners.AlphaTweener; - -public class PotionOfInvisibility extends Potion { - - private static final float ALPHA = 0.4f; - - { - //name = "Potion of Invisibility"; - initials = 4; - } - - @Override - public void apply(Hero hero) { - setKnown(); - Buff.affect(hero, Invisibility.class, Dungeon.hero.buff(AutoHealPotion.class) != null ? Invisibility.DURATION*2 : Invisibility.DURATION); - Buff.affect(hero,AttackUp.class, 10f).level(20); - GLog.i(Messages.get(this, "invisible")); - Sample.INSTANCE.play(Assets.SND_MELD); - } - - @Override - public void execute(final Hero hero, String action) { - super.execute(hero, action); - } - - @Override - public int price() { - return isKnown() ? 40 * quantity : super.price(); - } - - public static void melt(Char ch) { - if (ch.sprite.parent != null) { - ch.sprite.parent.add(new AlphaTweener(ch.sprite, ALPHA, 0.4f)); - } else { - ch.sprite.alpha(ALPHA); - } - } -} diff --git a/java/com/hmdzl/spspd/change/items/potions/PotionOfLevitation.java b/java/com/hmdzl/spspd/change/items/potions/PotionOfLevitation.java deleted file mode 100644 index 95336b27..00000000 --- a/java/com/hmdzl/spspd/change/items/potions/PotionOfLevitation.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.potions; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.blobs.Blob; -import com.hmdzl.spspd.change.actors.blobs.ConfusionGas; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.DefenceUp; -import com.hmdzl.spspd.change.actors.buffs.Levitation; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.audio.Sample; - -public class PotionOfLevitation extends Potion { - - { - //name = "Potion of Levitation"; - initials = 5; - } - - @Override - public void shatter(int cell) { - - if (Dungeon.visible[cell]) { - setKnown(); - - splash(cell); - Sample.INSTANCE.play(Assets.SND_SHATTER); - } - - GameScene.add(Blob.seed(cell, 1000, ConfusionGas.class)); - } - - @Override - public void apply(Hero hero) { - setKnown(); - Buff.affect(hero, Levitation.class, Levitation.DURATION); - Buff.affect(hero, DefenceUp.class, 10f).level(20); - GLog.i(Messages.get(this, "float")); - } - - @Override - public int price() { - return isKnown() ? 35 * quantity : super.price(); - } -} diff --git a/java/com/hmdzl/spspd/change/items/potions/PotionOfLiquidFlame.java b/java/com/hmdzl/spspd/change/items/potions/PotionOfLiquidFlame.java deleted file mode 100644 index faf5514c..00000000 --- a/java/com/hmdzl/spspd/change/items/potions/PotionOfLiquidFlame.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.potions; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.blobs.Blob; -import com.hmdzl.spspd.change.actors.blobs.Fire; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.particles.FlameParticle; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.watabou.noosa.audio.Sample; - -public class PotionOfLiquidFlame extends Potion { - - { - //name = "Potion of Liquid Flame"; - initials = 6; - } - - @Override - public void shatter(int cell) { - - if (Dungeon.visible[cell]) { - setKnown(); - - splash(cell); - Sample.INSTANCE.play(Assets.SND_SHATTER); - } - - for (int offset : Level.NEIGHBOURS9) { - if (Level.flamable[cell + offset] - || Actor.findChar(cell + offset) != null - || Dungeon.level.heaps.get(cell + offset) != null) { - - GameScene.add(Blob.seed(cell + offset, 2, Fire.class)); - - } else { - - CellEmitter.get(cell + offset).burst(FlameParticle.FACTORY, 2); - - } - } - } - - @Override - public int price() { - return isKnown() ? 40 * quantity : super.price(); - } -} diff --git a/java/com/hmdzl/spspd/change/items/potions/PotionOfMending.java b/java/com/hmdzl/spspd/change/items/potions/PotionOfMending.java deleted file mode 100644 index e52f35bf..00000000 --- a/java/com/hmdzl/spspd/change/items/potions/PotionOfMending.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.potions; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.blobs.Blob; -import com.hmdzl.spspd.change.actors.blobs.HealLight; -import com.hmdzl.spspd.change.actors.buffs.BerryRegeneration; -import com.hmdzl.spspd.change.actors.buffs.Bleeding; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Cripple; -import com.hmdzl.spspd.change.actors.buffs.Poison; -import com.hmdzl.spspd.change.actors.buffs.Weakness; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.audio.Sample; - -public class PotionOfMending extends Potion { - - { - //name = "Potion of Mending"; - initials = 7; - - } - - @Override - public void apply(Hero hero) { - setKnown(); - heal(Dungeon.hero); - } - - public static void heal(Hero hero) { - - Buff.affect(hero, BerryRegeneration.class).level(Math.max(0,hero.HT - hero.HP)); - Buff.detach(hero, Poison.class); - Buff.detach(hero, Cripple.class); - Buff.detach(hero, Weakness.class); - Buff.detach(hero, Bleeding.class); - - hero.sprite.emitter().start(Speck.factory(Speck.HEALING), 0.4f, 4); - } - - @Override - public void shatter(int cell) { - - if (Dungeon.visible[cell]) { - setKnown(); - - splash(cell); - Sample.INSTANCE.play(Assets.SND_SHATTER); - } - - GameScene.add(Blob.seed(cell, 500, HealLight.class)); - } - - @Override - public int price() { - return isKnown() ? 20 * quantity : super.price(); - } -} diff --git a/java/com/hmdzl/spspd/change/items/potions/PotionOfMight.java b/java/com/hmdzl/spspd/change/items/potions/PotionOfMight.java deleted file mode 100644 index 13e2b0fd..00000000 --- a/java/com/hmdzl/spspd/change/items/potions/PotionOfMight.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.potions; - -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.utils.Random; - -public class PotionOfMight extends Potion { - - { - //name = "Potion of Might"; - initials = 8; - - } - - @Override - public void apply(Hero hero) { - setKnown(); - - hero.HT += 15; - hero.HP += 15; - - hero.sprite.showStatus(CharSprite.POSITIVE, Messages.get(this, "msg_1")); - } - - - @Override - public int price() { - return isKnown() ? 200 * quantity : super.price(); - } -} diff --git a/java/com/hmdzl/spspd/change/items/potions/PotionOfMindVision.java b/java/com/hmdzl/spspd/change/items/potions/PotionOfMindVision.java deleted file mode 100644 index 772c2f8e..00000000 --- a/java/com/hmdzl/spspd/change/items/potions/PotionOfMindVision.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.potions; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.buffs.Awareness; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Invisibility; -import com.hmdzl.spspd.change.actors.buffs.MindVision; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.SpellSprite; -import com.hmdzl.spspd.change.items.misc.Spectacles.MagicSight; -import com.hmdzl.spspd.change.utils.GLog; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Random; - -public class PotionOfMindVision extends Potion { - - { - //name = "Potion of Mind Vision"; - initials = 9; - } - - @Override - public void apply(Hero hero) { - setKnown(); - - Buff.affect(hero, MindVision.class, Dungeon.hero.buff(MagicSight.class) != null ? MindVision.DURATION*4 : MindVision.DURATION); - Buff.affect(hero, Awareness.class, Dungeon.hero.buff(MagicSight.class) != null ? 20f : 5f); - Dungeon.observe(); - - if (Dungeon.level.mobs.size() > 0) { - GLog.i( Messages.get(this, "see_mobs")); - } else { - GLog.i( Messages.get(this, "see_none")); - } - } - - @Override - public int price() { - return isKnown() ? 35 * quantity : super.price(); - } -} diff --git a/java/com/hmdzl/spspd/change/items/potions/PotionOfOverHealing.java b/java/com/hmdzl/spspd/change/items/potions/PotionOfOverHealing.java deleted file mode 100644 index f6c0d64c..00000000 --- a/java/com/hmdzl/spspd/change/items/potions/PotionOfOverHealing.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.potions; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.buffs.Bleeding; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Cripple; -import com.hmdzl.spspd.change.actors.buffs.Poison; -import com.hmdzl.spspd.change.actors.buffs.Weakness; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.utils.GLog; - -public class PotionOfOverHealing extends Potion { - - { - //name = "Potion of Life"; - initials = 10; - - } - - @Override - public void apply(Hero hero) { - setKnown(); - heal(Dungeon.hero); - //GLog.p("Your wounds heal completely."); - } - - public static void heal(Hero hero) { - - hero.HP = hero.HT+(hero.lvl*2); - Buff.detach(hero, Poison.class); - Buff.detach(hero, Cripple.class); - Buff.detach(hero, Weakness.class); - Buff.detach(hero, Bleeding.class); - hero.sprite.emitter().start(Speck.factory(Speck.HEALING), 0.4f, 4); - } - - @Override - public int price() { - return isKnown() ? 30 * quantity : super.price(); - } -} diff --git a/java/com/hmdzl/spspd/change/items/potions/PotionOfParalyticGas.java b/java/com/hmdzl/spspd/change/items/potions/PotionOfParalyticGas.java deleted file mode 100644 index d0b2872c..00000000 --- a/java/com/hmdzl/spspd/change/items/potions/PotionOfParalyticGas.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.potions; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.blobs.Blob; -import com.hmdzl.spspd.change.actors.blobs.ParalyticGas; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.watabou.noosa.audio.Sample; - -public class PotionOfParalyticGas extends Potion { - - { - //name = "Potion of Paralytic Gas"; - initials = 11; - } - - @Override - public void shatter(int cell) { - - if (Dungeon.visible[cell]) { - setKnown(); - - splash(cell); - Sample.INSTANCE.play(Assets.SND_SHATTER); - } - - GameScene.add(Blob.seed(cell, 1000, ParalyticGas.class)); - } - - @Override - public int price() { - return isKnown() ? 40 * quantity : super.price(); - } -} diff --git a/java/com/hmdzl/spspd/change/items/potions/PotionOfPurity.java b/java/com/hmdzl/spspd/change/items/potions/PotionOfPurity.java deleted file mode 100644 index 21a0ab79..00000000 --- a/java/com/hmdzl/spspd/change/items/potions/PotionOfPurity.java +++ /dev/null @@ -1,128 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.potions; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.blobs.Blob; -import com.hmdzl.spspd.change.actors.blobs.ConfusionGas; -import com.hmdzl.spspd.change.actors.blobs.ParalyticGas; -import com.hmdzl.spspd.change.actors.blobs.StenchGas; -import com.hmdzl.spspd.change.actors.blobs.ToxicGas; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.GasesImmunity; -import com.hmdzl.spspd.change.actors.buffs.HighLight; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.utils.BArray; -import com.hmdzl.spspd.change.utils.GLog; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.PathFinder; - -public class PotionOfPurity extends Potion { - - private static final int DISTANCE = 5; - - { - //name = "Potion of Purification"; - initials = 12; - } - - @Override - public void shatter(int cell) { - - PathFinder.buildDistanceMap(cell, BArray.not(Level.losBlockLow, null), - DISTANCE); - - boolean procd = false; - - Blob[] blobs = { Dungeon.level.blobs.get(ToxicGas.class), - Dungeon.level.blobs.get(ParalyticGas.class), - Dungeon.level.blobs.get(ConfusionGas.class), - Dungeon.level.blobs.get(StenchGas.class) }; - - for (int j = 0; j < blobs.length; j++) { - - Blob blob = blobs[j]; - if (blob == null) { - continue; - } - - for (int i = 0; i < Level.getLength(); i++) { - if (PathFinder.distance[i] < Integer.MAX_VALUE) { - - int value = blob.cur[i]; - if (value > 0) { - - blob.cur[i] = 0; - blob.volume -= value; - procd = true; - - if (Dungeon.visible[i]) { - CellEmitter.get(i).burst( - Speck.factory(Speck.DISCOVER), 1); - } - } - - } - } - } - - boolean heroAffected = PathFinder.distance[Dungeon.hero.pos] < Integer.MAX_VALUE; - - if (procd) { - - if (Dungeon.visible[cell]) { - splash(cell); - Sample.INSTANCE.play(Assets.SND_SHATTER); - } - - setKnown(); - - if (heroAffected) { - GLog.p(Messages.get(this, "freshness")); - } - - } else { - - super.shatter(cell); - - if (heroAffected) { - GLog.i(Messages.get(this, "freshness") ); - setKnown(); - } - - } - } - - @Override - public void apply(Hero hero) { - GLog.w(Messages.get(this, "no_smell")); - Buff.prolong(hero, GasesImmunity.class, GasesImmunity.DURATION); - Buff.prolong(hero, HighLight.class, 10f); - setKnown(); - } - - @Override - public int price() { - return isKnown() ? 50 * quantity : super.price(); - } -} diff --git a/java/com/hmdzl/spspd/change/items/potions/PotionOfStrength.java b/java/com/hmdzl/spspd/change/items/potions/PotionOfStrength.java deleted file mode 100644 index 41b5f59e..00000000 --- a/java/com/hmdzl/spspd/change/items/potions/PotionOfStrength.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.potions; - -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.actors.buffs.Bleeding; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Cripple; -import com.hmdzl.spspd.change.actors.buffs.Poison; -import com.hmdzl.spspd.change.actors.buffs.Weakness; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.hmdzl.spspd.change.utils.GLog; - -public class PotionOfStrength extends Potion { - - { - //name = "Potion of Strength"; - initials = 13; - - } - - @Override - public void apply(Hero hero) { - setKnown(); - - hero.STR++; - hero.HP += (hero.HT - hero.HP); - hero.sprite.showStatus(CharSprite.POSITIVE, Messages.get(this, "msg_1")); - Badges.validateStrengthAttained(); - } - - @Override - public int price() { - return isKnown() ? 100 * quantity : super.price(); - } -} diff --git a/java/com/hmdzl/spspd/change/items/potions/PotionOfToxicGas.java b/java/com/hmdzl/spspd/change/items/potions/PotionOfToxicGas.java deleted file mode 100644 index 11547d3f..00000000 --- a/java/com/hmdzl/spspd/change/items/potions/PotionOfToxicGas.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.potions; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.blobs.Blob; -import com.hmdzl.spspd.change.actors.blobs.ToxicGas; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.watabou.noosa.audio.Sample; - -public class PotionOfToxicGas extends Potion { - - { - //name = "Potion of Toxic Gas"; - initials = 14; - } - - @Override - public void shatter(int cell) { - - if (Dungeon.visible[cell]) { - setKnown(); - - splash(cell); - Sample.INSTANCE.play(Assets.SND_SHATTER); - } - - GameScene.add(Blob.seed(cell, 1000, ToxicGas.class)); - } - - @Override - public int price() { - return isKnown() ? 40 * quantity : super.price(); - } -} diff --git a/java/com/hmdzl/spspd/change/items/quest/CorpseDust.java b/java/com/hmdzl/spspd/change/items/quest/CorpseDust.java deleted file mode 100644 index c917455d..00000000 --- a/java/com/hmdzl/spspd/change/items/quest/CorpseDust.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.quest; - -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; - -public class CorpseDust extends Item { - - { - //name = "corpse dust"; - image = ItemSpriteSheet.DUST; - - cursed = true; - cursedKnown = true; - - unique = true; - } - - @Override - public boolean isUpgradable() { - return false; - } - - @Override - public boolean isIdentified() { - return true; - } - - /*@Override - public String info() { - return "The ball of corpse dust doesn't differ outwardly from a regular dust ball. However, " - + "you know somehow that it's better to get rid of it as soon as possible."; - }*/ -} diff --git a/java/com/hmdzl/spspd/change/items/quest/DarkGold.java b/java/com/hmdzl/spspd/change/items/quest/DarkGold.java deleted file mode 100644 index e766f5d0..00000000 --- a/java/com/hmdzl/spspd/change/items/quest/DarkGold.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.quest; - -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; - -public class DarkGold extends Item { - - { - //name = "dark gold ore"; - image = ItemSpriteSheet.ORE; - - stackable = true; - unique = true; - } - - @Override - public boolean isUpgradable() { - return false; - } - - @Override - public boolean isIdentified() { - return true; - } - - /*@Override - public String info() { - return "This metal is called dark not because of its color (it doesn't differ from the normal gold), " - + "but because it melts under the daylight, making it useless on the surface."; - }*/ - - @Override - public int price() { - return quantity; - } -} diff --git a/java/com/hmdzl/spspd/change/items/quest/DwarfToken.java b/java/com/hmdzl/spspd/change/items/quest/DwarfToken.java deleted file mode 100644 index fe9f074d..00000000 --- a/java/com/hmdzl/spspd/change/items/quest/DwarfToken.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.quest; - -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; - -public class DwarfToken extends Item { - - { - //name = "dwarf token"; - image = ItemSpriteSheet.TOKEN; - - stackable = true; - unique = true; - } - - @Override - public boolean isUpgradable() { - return false; - } - - @Override - public boolean isIdentified() { - return true; - } - - /*@Override - public String info() { - return "Many dwarves and some of their larger creations carry these small pieces of metal of unknown purpose. " - + "Maybe they are jewelry or maybe some kind of ID. Dwarves are strange folk."; - }*/ - - @Override - public int price() { - return quantity * 100; - } -} diff --git a/java/com/hmdzl/spspd/change/items/quest/GnollClothes.java b/java/com/hmdzl/spspd/change/items/quest/GnollClothes.java deleted file mode 100644 index 58dfe7a1..00000000 --- a/java/com/hmdzl/spspd/change/items/quest/GnollClothes.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.quest; - -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; - -public class GnollClothes extends Item { - - { - //name = "GnollClothes"; - image = ItemSpriteSheet.GNOLL_ARMOR; - - stackable = true; - unique = true; - } - - @Override - public boolean isUpgradable() { - return false; - } - - @Override - public boolean isIdentified() { - return true; - } - - /*@Override - public String info() { - return "Many dwarves and some of their larger creations carry these small pieces of metal of unknown purpose. " - + "Maybe they are jewelry or maybe some kind of ID. Dwarves are strange folk."; - }*/ - -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/items/quest/Mushroom.java b/java/com/hmdzl/spspd/change/items/quest/Mushroom.java deleted file mode 100644 index f87d4727..00000000 --- a/java/com/hmdzl/spspd/change/items/quest/Mushroom.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.quest; - -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; - -public class Mushroom extends Item { - - //private static final String AC_END = "END THE GAME"; - - { - //name = "toadstool mushroom"; - image = ItemSpriteSheet.MUSHROOM; - - unique = true; - } - - /* - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions(hero); - actions.add(AC_END); - return actions; - } - - @Override - public void execute(Hero hero, String action) { - if (action == AC_END) { - - showAmuletScene(false); - - } else { - - super.execute(hero, action); - - } - } - - -*/ - @Override - public boolean isIdentified() { - return true; - } - - @Override - public boolean isUpgradable() { - return false; - } -} diff --git a/java/com/hmdzl/spspd/change/items/quest/Pickaxe.java b/java/com/hmdzl/spspd/change/items/quest/Pickaxe.java deleted file mode 100644 index aba2ccb4..00000000 --- a/java/com/hmdzl/spspd/change/items/quest/Pickaxe.java +++ /dev/null @@ -1,232 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.quest; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Hunger; -import com.hmdzl.spspd.change.actors.buffs.Poison; -import com.hmdzl.spspd.change.actors.buffs.Ooze; -import com.hmdzl.spspd.change.actors.buffs.Bleeding; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.mobs.Bat; -import com.hmdzl.spspd.change.actors.mobs.ElderAvatar; -import com.hmdzl.spspd.change.actors.mobs.King; -import com.hmdzl.spspd.change.actors.mobs.LichDancer; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.weapon.Weapon; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.Terrain; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ItemSprite.Glowing; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.ui.BuffIndicator; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundle; -import com.watabou.utils.Callback; -import com.watabou.utils.Random; - -public class Pickaxe extends Weapon { - - public static final String AC_MINE = "MINE"; - - public static final float TIME_TO_MINE = 2; - - private static final String TXT_NO_VEIN = "There is no dark gold vein near you to mine"; - - private static final Glowing BLOODY = new Glowing(0x550000); - - { - //name = "pickaxe"; - image = ItemSpriteSheet.PICKAXE; - - unique = true; - - defaultAction = AC_MINE; - - STR = 14; - MIN = 10; - MAX = 22; - } - - public boolean bloodStained = false; - - - - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions(hero); - actions.add(AC_MINE); - return actions; - } - - @Override - public void execute(final Hero hero, String action) { - - if (action == AC_MINE) { - - if ((Dungeon.depth < 11 || Dungeon.depth > 15) && !(Dungeon.depth==32)) { - GLog.w(Messages.get(this,"no_vein")); - return; - } - - for (int i = 0; i < Level.NEIGHBOURS8.length; i++) { - - final int pos = hero.pos + Level.NEIGHBOURS8[i]; - if (Dungeon.level.map[pos] == Terrain.WALL_DECO) { - - hero.spend(TIME_TO_MINE); - hero.busy(); - - hero.sprite.attack(pos, new Callback() { - - @Override - public void call() { - - CellEmitter.center(pos).burst( - Speck.factory(Speck.STAR), 7); - Sample.INSTANCE.play(Assets.SND_EVOKE); - - Level.set(pos, Terrain.WALL); - GameScene.updateMap(pos); - - DarkGold gold = new DarkGold(); - if (gold.doPickUp(Dungeon.hero)) { - GLog.i( Messages.get(Dungeon.hero, "you_now_have", gold.name())); - } else { - Dungeon.level.drop(gold, hero.pos).sprite - .drop(); - } - - Hunger hunger = hero.buff(Hunger.class); - if (hunger != null && !hunger.isStarving()) { - hunger.satisfy(-10); - BuffIndicator.refreshHero(); - } - - hero.onOperateComplete(); - } - }); - - return; - } - } - - GLog.w(Messages.get(this,"no_vein")); - - } else { - - super.execute(hero, action); - - } - } - - @Override - public boolean isUpgradable() { - return true; - } - - @Override - public Item upgrade() { - return upgrade(false); - } - - @Override - public Item upgrade(boolean enchant) { - - MIN += 3; - MAX += 3; - super.upgrade(enchant); - updateQuickslot(); - return this; - } - - @Override - public Item degrade() { - return super.degrade(); - } - - @Override - public boolean isIdentified() { - return true; - } - - @Override - public void proc(Char attacker, Char defender, int damage) { - if (!bloodStained && defender instanceof Bat ) { - bloodStained = true; - updateQuickslot(); - } - if (defender instanceof King.DwarfKingTomb || defender instanceof ElderAvatar.Obelisk || defender instanceof LichDancer.BatteryTomb){ - defender.damage(Random.Int(100,200), this); - } - - switch (Random.Int (10)) { - case 1 : - Buff.affect(defender, Bleeding.class).set(10); - break; - case 2 : - Buff.affect(defender, Ooze.class); - break; - case 3 : - Buff.affect(defender, Poison.class).set( - Random.Int(7, 10) * Poison.durationFactor(defender) ); - break; - default: - break; - } - - if (enchantment != null) { - enchantment.proc(this, attacker, defender, damage); - } - } - - private static final String BLOODSTAINED = "bloodStained"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - - bundle.put(BLOODSTAINED, bloodStained); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - - bloodStained = bundle.getBoolean(BLOODSTAINED); - } - - @Override - public Glowing glowing() { - return bloodStained ? BLOODY : null; - } - - /*@Override - public String info() { - return "This is a large and sturdy tool for breaking rocks. Probably it can be used as a weapon."; - }*/ -} diff --git a/java/com/hmdzl/spspd/change/items/quest/RatSkull.java b/java/com/hmdzl/spspd/change/items/quest/RatSkull.java deleted file mode 100644 index dc3d933a..00000000 --- a/java/com/hmdzl/spspd/change/items/quest/RatSkull.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.quest; - -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; - -//this one's still hanging around to support quests from old saves -//TODO: remove this when saves from v0.2.1 are no longer supported -public class RatSkull extends Item { - - { - //name = "giant rat skull"; - image = ItemSpriteSheet.SKULL; - - unique = true; - } - - @Override - public boolean isUpgradable() { - return false; - } - - @Override - public boolean isIdentified() { - return true; - } - - /*@Override - public String info() { - return "It could be a nice hunting trophy, but it smells too bad to place it on a wall."; - }*/ - - @Override - public int price() { - return 100; - } -} diff --git a/java/com/hmdzl/spspd/change/items/reward/CaveReward.java b/java/com/hmdzl/spspd/change/items/reward/CaveReward.java deleted file mode 100644 index 936edcac..00000000 --- a/java/com/hmdzl/spspd/change/items/reward/CaveReward.java +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.reward; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.Statistics; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.StoneOre; - -import com.hmdzl.spspd.change.items.food.fruit.Blackberry; -import com.hmdzl.spspd.change.items.food.fruit.Blueberry; -import com.hmdzl.spspd.change.items.food.fruit.Cloudberry; -import com.hmdzl.spspd.change.items.food.fruit.Moonberry; -import com.hmdzl.spspd.change.items.weapon.missiles.RiceBall; -import com.hmdzl.spspd.change.sprites.ItemSprite; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.audio.Sample; - -public class CaveReward extends Item { - - public static final String AC_USE = "USE"; - - public static final float TIME_TO_USE = 1; - private static ItemSprite.Glowing WHITE = new ItemSprite.Glowing(0xFFFFFF); - - @Override - public ItemSprite.Glowing glowing() { - return WHITE; - } - { - //name = "reward"; - image = ItemSpriteSheet.PETFOOD; - - stackable = false; - } - - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions(hero); - actions.add(AC_USE); - return actions; - } - - @Override - public void execute(Hero hero, String action) { - - if (action.equals(AC_USE)) { - - hero.spend(TIME_TO_USE); - hero.busy(); - - hero.sprite.operate(hero.pos); - - Moonberry berry1 = new Moonberry(10); - Dungeon.level.drop(berry1, Dungeon.hero.pos).sprite.drop(Dungeon.hero.pos); - Cloudberry berry2 = new Cloudberry(10); - Dungeon.level.drop(berry2, Dungeon.hero.pos).sprite.drop(Dungeon.hero.pos); - Blueberry berry3 = new Blueberry(10); - Dungeon.level.drop(berry3, Dungeon.hero.pos).sprite.drop(Dungeon.hero.pos); - Blackberry berry4 = new Blackberry(10); - Dungeon.level.drop(berry4, Dungeon.hero.pos).sprite.drop(Dungeon.hero.pos); - - detach(hero.belongings.backpack); - - } else { - super.execute(hero, action); - - } - } - - @Override - public boolean isUpgradable() { - return false; - } - - @Override - public boolean isIdentified() { - return true; - } - - @Override - public int price() { - return 10 * quantity; - } -} diff --git a/java/com/hmdzl/spspd/change/items/reward/CityReward.java b/java/com/hmdzl/spspd/change/items/reward/CityReward.java deleted file mode 100644 index 954bb120..00000000 --- a/java/com/hmdzl/spspd/change/items/reward/CityReward.java +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.reward; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.Statistics; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.StoneOre; - -import com.hmdzl.spspd.change.items.food.completefood.Crystalnucleus; -import com.hmdzl.spspd.change.items.weapon.missiles.RiceBall; -import com.hmdzl.spspd.change.sprites.ItemSprite; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.audio.Sample; - -public class CityReward extends Item { - - public static final String AC_USE = "USE"; - - public static final float TIME_TO_USE = 1; - private static ItemSprite.Glowing YELLOW = new ItemSprite.Glowing( 0xFFFF44 ); - - @Override - public ItemSprite.Glowing glowing() { - return YELLOW; - } - { - //name = "reward"; - image = ItemSpriteSheet.PETFOOD; - - stackable = false; - } - - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions(hero); - actions.add(AC_USE); - return actions; - } - - @Override - public void execute(Hero hero, String action) { - - if (action.equals(AC_USE)) { - - hero.spend(TIME_TO_USE); - hero.busy(); - - hero.sprite.operate(hero.pos); - - Crystalnucleus cry = new Crystalnucleus(); - Dungeon.level.drop(cry, Dungeon.hero.pos).sprite.drop(Dungeon.hero.pos); - Dungeon.level.drop(cry, Dungeon.hero.pos).sprite.drop(Dungeon.hero.pos); - Dungeon.level.drop(cry, Dungeon.hero.pos).sprite.drop(Dungeon.hero.pos); - Dungeon.level.drop(cry, Dungeon.hero.pos).sprite.drop(Dungeon.hero.pos); - Dungeon.level.drop(cry, Dungeon.hero.pos).sprite.drop(Dungeon.hero.pos); - - detach(hero.belongings.backpack); - - } else { - super.execute(hero, action); - - } - } - - @Override - public boolean isUpgradable() { - return false; - } - - @Override - public boolean isIdentified() { - return true; - } - - @Override - public int price() { - return 10 * quantity; - } -} diff --git a/java/com/hmdzl/spspd/change/items/reward/PrisonReward.java b/java/com/hmdzl/spspd/change/items/reward/PrisonReward.java deleted file mode 100644 index 20eaac96..00000000 --- a/java/com/hmdzl/spspd/change/items/reward/PrisonReward.java +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.reward; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.Statistics; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.StoneOre; - -import com.hmdzl.spspd.change.items.food.fruit.FullMoonberry; -import com.hmdzl.spspd.change.items.weapon.missiles.RiceBall; -import com.hmdzl.spspd.change.sprites.ItemSprite; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.audio.Sample; - -public class PrisonReward extends Item { - - public static final String AC_USE = "USE"; - - public static final float TIME_TO_USE = 1; - private static ItemSprite.Glowing BLUE = new ItemSprite.Glowing(0x0000FF); - - @Override - public ItemSprite.Glowing glowing() { - return BLUE; - } - - { - //name = "reward"; - image = ItemSpriteSheet.PETFOOD; - - stackable = false; - } - - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions(hero); - actions.add(AC_USE); - return actions; - } - - @Override - public void execute(Hero hero, String action) { - - if (action.equals(AC_USE)) { - - hero.spend(TIME_TO_USE); - hero.busy(); - - hero.sprite.operate(hero.pos); - - FullMoonberry berry = new FullMoonberry(); - Dungeon.level.drop(berry, Dungeon.hero.pos).sprite.drop(Dungeon.hero.pos); - - detach(hero.belongings.backpack); - } else { - super.execute(hero, action); - - } - } - - @Override - public boolean isUpgradable() { - return false; - } - - @Override - public boolean isIdentified() { - return true; - } - - @Override - public int price() { - return 10 * quantity; - } -} diff --git a/java/com/hmdzl/spspd/change/items/reward/SewerReward.java b/java/com/hmdzl/spspd/change/items/reward/SewerReward.java deleted file mode 100644 index a41575e0..00000000 --- a/java/com/hmdzl/spspd/change/items/reward/SewerReward.java +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.reward; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.Statistics; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.StoneOre; - -import com.hmdzl.spspd.change.items.weapon.missiles.RiceBall; -import com.hmdzl.spspd.change.sprites.ItemSprite; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.audio.Sample; - -public class SewerReward extends Item { - - public static final String AC_USE = "USE"; - - public static final float TIME_TO_USE = 1; - private static final ItemSprite.Glowing BLACK = new ItemSprite.Glowing(0x00000); - - @Override - public ItemSprite.Glowing glowing() { - return BLACK; - } - { - //name = "reward"; - image = ItemSpriteSheet.PETFOOD; - - stackable = false; - } - - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions(hero); - actions.add(AC_USE); - return actions; - } - - @Override - public void execute(Hero hero, String action) { - - if (action.equals(AC_USE)) { - - hero.spend(TIME_TO_USE); - hero.busy(); - - hero.sprite.operate(hero.pos); - - StoneOre ore = new StoneOre(20); - Dungeon.level.drop(ore, Dungeon.hero.pos).sprite.drop(Dungeon.hero.pos); - - detach(hero.belongings.backpack); - - } else { - super.execute(hero, action); - - } - } - - @Override - public boolean isUpgradable() { - return false; - } - - @Override - public boolean isIdentified() { - return true; - } - - @Override - public int price() { - return 10 * quantity; - } -} diff --git a/java/com/hmdzl/spspd/change/items/rings/Ring.java b/java/com/hmdzl/spspd/change/items/rings/Ring.java deleted file mode 100644 index 2610c522..00000000 --- a/java/com/hmdzl/spspd/change/items/rings/Ring.java +++ /dev/null @@ -1,357 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.rings; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.hero.HeroClass; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.ItemStatusHandler; -import com.hmdzl.spspd.change.items.KindofMisc; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -public class Ring extends KindofMisc { - - private static final int TICKS_TO_KNOW = 200; - - private static final float TIME_TO_EQUIP = 1f; - - protected Buff buff; - - protected Integer initials; - - private static final Class[] rings = { RingOfAccuracy.class, - RingOfEvasion.class, RingOfElements.class, RingOfForce.class, - RingOfFuror.class, RingOfHaste.class, RingOfMagic.class, - RingOfMight.class, RingOfSharpshooting.class, RingOfTenacity.class, - RingOfEnergy.class, }; - private static final String[] gems = { "diamond", "opal", "garnet", "ruby", - "amethyst", "topaz", "onyx", "tourmaline", "emerald", "sapphire", - "quartz", "agate" }; - private static final Integer[] images = { ItemSpriteSheet.RING_DIAMOND, - ItemSpriteSheet.RING_OPAL, ItemSpriteSheet.RING_GARNET, - ItemSpriteSheet.RING_RUBY, ItemSpriteSheet.RING_AMETHYST, - ItemSpriteSheet.RING_TOPAZ, ItemSpriteSheet.RING_ONYX, - ItemSpriteSheet.RING_TOURMALINE, ItemSpriteSheet.RING_EMERALD, - ItemSpriteSheet.RING_SAPPHIRE, ItemSpriteSheet.RING_QUARTZ, - ItemSpriteSheet.RING_AGATE }; - - private static ItemStatusHandler handler; - - private String gem; - - private int ticksToKnow = TICKS_TO_KNOW; - - @SuppressWarnings("unchecked") - public static void initGems() { - handler = new ItemStatusHandler((Class[]) rings, - gems, images); - } - - public static void save(Bundle bundle) { - handler.save(bundle); - } - - @SuppressWarnings("unchecked") - public static void restore(Bundle bundle) { - handler = new ItemStatusHandler((Class[]) rings, - gems, images, bundle); - } - - public Ring() { - super(); - sync(); - } - - @Override - public void sync() { - super.sync(); - image = handler.image(this); - gem = handler.label(this); - } - - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions(hero); - actions.add(isEquipped(hero) ? AC_UNEQUIP : AC_EQUIP); - return actions; - } - - @Override - public boolean doEquip(Hero hero) { - - if (hero.belongings.misc1 != null && hero.belongings.misc2 != null && hero.belongings.misc3 != null) { - - GLog.w(Messages.get(Ring.class, "toomany")); - return false; - - } else { - - if (hero.belongings.misc1 == null) { - hero.belongings.misc1 = this; - } else if (hero.belongings.misc2 == null){ - hero.belongings.misc2 = this; - } else { - hero.belongings.misc3 = this; - } - - detach(hero.belongings.backpack); - - activate(hero); - - cursedKnown = true; - if (cursed) { - equipCursed(hero); - GLog.n(Messages.get(this, "cursed", this)); - } - - hero.spendAndNext(TIME_TO_EQUIP); - return true; - - } - - } - - @Override - public void activate(Char ch) { - buff = buff(); - buff.attachTo(ch); - } - - @Override - public boolean doUnequip(Hero hero, boolean collect, boolean single) { - if (super.doUnequip(hero, collect, single)) { - - if (hero.belongings.misc1 == this) { - hero.belongings.misc1 = null; - } else if (hero.belongings.misc2 == this) { - hero.belongings.misc2 = null; - } else { - hero.belongings.misc3 = null; - } - - hero.remove(buff); - buff = null; - - return true; - - } else { - - return false; - - } - } - - @Override - public boolean isEquipped(Hero hero) { - return hero.belongings.misc1 == this || hero.belongings.misc2 == this || hero.belongings.misc3 == this ; - } - - @Override - public Item upgrade() { - - super.upgrade(); - - if (buff != null) { - - Char owner = buff.target; - buff.detach(); - if ((buff = buff()) != null) { - buff.attachTo(owner); - } - } - - return this; - } - - public boolean isKnown() { - return handler.isKnown(this); - } - - protected void setKnown() { - if (!isKnown()) { - handler.know(this); - } - - Badges.validateAllRingsIdentified(); - } - - public String gem() { - return Messages.get(Ring.class, gem); - } - - @Override - public String name() { - return isKnown() ? super.name() : Messages.get(this, "unknown_name", gem()); - } - - @Override - public String info() { - - String desc = isKnown()? desc() : Messages.get(this, "unknown_desc", gem()); - - if (cursed && isEquipped( Dungeon.hero )) { - - desc += "\n\n" + Messages.get(Ring.class, "cursed_worn"); - - } else if (cursed && cursedKnown) { - - desc += "\n\n" + Messages.get(Ring.class, "curse_known", name()); - - } - - if (reinforced) { - desc += "\n\n" + Messages.get(Item.class, "reinforced"); - } - - if (isKnown()) { - desc += "\n\n" + statsInfo(); - } - - return desc; - } - - public Integer initials(){ - return isKnown() ? initials : null; - } - - protected String statsInfo(){ - return ""; - } - - @Override - public boolean isIdentified() { - return super.isIdentified() && isKnown(); - } - - @Override - public Item identify() { - setKnown(); - return super.identify(); - } - - @Override - public Item random() { - if (Random.Float() < 0.3f) { - level = -Random.Int(1, 3); - cursed = true; - } else - level = Random.Int(1, 2); - return this; - } - - public static boolean allKnown() { - return handler.known().size() == rings.length - 2; - } - - @Override - public int price() { - int price = 75; - if (cursed && cursedKnown) { - price /= 2; - } - if (levelKnown) { - if (level > 0) { - price *= (level + 1); - } else if (level < 0) { - price /= (1 - level); - } - } - if (price < 1) { - price = 1; - } - return price; - } - - protected RingBuff buff() { - return null; - } - - private static final String UNFAMILIRIARITY = "unfamiliarity"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(UNFAMILIRIARITY, ticksToKnow); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - if ((ticksToKnow = bundle.getInt(UNFAMILIRIARITY)) == 0) { - ticksToKnow = TICKS_TO_KNOW; - } - } - - public static int getBonus(Char target, Class type){ - int bonus = 0; - for (RingBuff buff : target.buffs(type)) { - bonus += buff.level; - } - return bonus; - } - - public class RingBuff extends Buff { - - //private static final String TXT_KNOWN = "This is a %s"; - - public int level; - - public RingBuff() { - level = Ring.this.level; - } - - @Override - public boolean attachTo(Char target) { - - /*if (target instanceof Hero - && ((Hero) target).heroClass == HeroClass.ROGUE - && !isKnown()) { - setKnown(); - GLog.i(Messages.get(Ring.class, "known", name())); - Badges.validateItemLevelAquired(Ring.this); - }*/ - - return super.attachTo(target); - } - - @Override - public boolean act() { - - //if (!isIdentified() && --ticksToKnow <= 0) { - //String gemName = name(); - //identify(); - //GLog.w(Messages.get(Ring.class, "identify", gemName, Ring.this.toString())); - //Badges.validateItemLevelAquired(Ring.this); - //} - - spend(TICK); - - return true; - } - } -} diff --git a/java/com/hmdzl/spspd/change/items/rings/RingOfAccuracy.java b/java/com/hmdzl/spspd/change/items/rings/RingOfAccuracy.java deleted file mode 100644 index 16da25b4..00000000 --- a/java/com/hmdzl/spspd/change/items/rings/RingOfAccuracy.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.rings; - -import com.hmdzl.spspd.change.messages.Messages; - -import java.text.DecimalFormat; - -public class RingOfAccuracy extends Ring { - - { - //name = "Ring of Accuracy"; - initials = 0; - } - - public String statsInfo() { - if (isIdentified()){ - return Messages.get(this, "stats",level,level/10); - } else { - return "???"; - } - } - - - @Override - protected RingBuff buff() { - return new Accuracy(); - } - - public class Accuracy extends RingBuff { - } -} diff --git a/java/com/hmdzl/spspd/change/items/rings/RingOfElements.java b/java/com/hmdzl/spspd/change/items/rings/RingOfElements.java deleted file mode 100644 index b156abc5..00000000 --- a/java/com/hmdzl/spspd/change/items/rings/RingOfElements.java +++ /dev/null @@ -1,132 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.rings; - -import java.util.HashSet; - -import com.hmdzl.spspd.change.actors.blobs.ConfusionGas; -import com.hmdzl.spspd.change.actors.blobs.CorruptGas; -import com.hmdzl.spspd.change.actors.blobs.DarkGas; -import com.hmdzl.spspd.change.actors.blobs.ElectriShock; -import com.hmdzl.spspd.change.actors.blobs.FrostGas; -import com.hmdzl.spspd.change.actors.blobs.ParalyticGas; -import com.hmdzl.spspd.change.actors.blobs.ShockWeb; -import com.hmdzl.spspd.change.actors.blobs.SlowWeb; -import com.hmdzl.spspd.change.actors.blobs.ToxicGas; -import com.hmdzl.spspd.change.actors.blobs.VenomGas; -import com.hmdzl.spspd.change.actors.blobs.Web; -import com.hmdzl.spspd.change.actors.blobs.weather.WeatherOfRain; -import com.hmdzl.spspd.change.actors.blobs.weather.WeatherOfSand; -import com.hmdzl.spspd.change.actors.blobs.weather.WeatherOfSnow; -import com.hmdzl.spspd.change.actors.blobs.weather.WeatherOfSun; -import com.hmdzl.spspd.change.actors.buffs.Blindness; -import com.hmdzl.spspd.change.actors.buffs.Burning; -import com.hmdzl.spspd.change.actors.buffs.Disarm; -import com.hmdzl.spspd.change.actors.buffs.Locked; -import com.hmdzl.spspd.change.actors.buffs.Poison; -import com.hmdzl.spspd.change.actors.buffs.Silent; -import com.hmdzl.spspd.change.actors.mobs.BrokenRobot; -import com.hmdzl.spspd.change.actors.mobs.DM300; -import com.hmdzl.spspd.change.actors.mobs.Eye; -import com.hmdzl.spspd.change.actors.mobs.LitTower; -import com.hmdzl.spspd.change.actors.mobs.Otiluke; -import com.hmdzl.spspd.change.actors.mobs.GnollShaman; -import com.hmdzl.spspd.change.actors.mobs.Shell; -import com.hmdzl.spspd.change.actors.mobs.Warlock; -import com.hmdzl.spspd.change.actors.mobs.Yog; -import com.hmdzl.spspd.change.levels.traps.LightningTrap; -import com.hmdzl.spspd.change.levels.traps.SpearTrap; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.utils.Random; - -public class RingOfElements extends Ring { - - { - //name = "Ring of Elements"; - initials = 1; - } - - public String statsInfo() { - if (isIdentified()){ - return Messages.get(this, "stats"); - } else { - return "???"; - } - } - - - @Override - protected RingBuff buff() { - return new Resistance(); - } - - private static final HashSet> EMPTY = new HashSet>(); - private static final HashSet> FULL; - static { - FULL = new HashSet>(); - FULL.add(Burning.class); - FULL.add(ToxicGas.class); - FULL.add(VenomGas.class); - FULL.add(SpearTrap.class); - FULL.add(ParalyticGas.class); - FULL.add(CorruptGas.class); - FULL.add(DarkGas.class); - FULL.add(ElectriShock.class); - FULL.add(FrostGas.class); - FULL.add(ConfusionGas.class); - FULL.add(ShockWeb.class); - FULL.add(SlowWeb.class); - FULL.add(Web.class); - FULL.add(Blindness.class); - FULL.add(Disarm.class); - FULL.add(Locked.class); - FULL.add(Silent.class); - FULL.add(WeatherOfRain.class); - FULL.add(WeatherOfSand.class); - FULL.add(WeatherOfSnow.class); - FULL.add(WeatherOfSun.class); - FULL.add(Poison.class); - FULL.add(LightningTrap.Electricity.class); - FULL.add(Warlock.class); - FULL.add(GnollShaman.class); - FULL.add(BrokenRobot.class); - FULL.add(DM300.class); - FULL.add(Eye.class); - FULL.add(Otiluke.class); - FULL.add(LitTower.class); - FULL.add(Shell.class); - FULL.add(Yog.BurningFist.class); - FULL.add(Yog.PinningFist.class); - - } - - public class Resistance extends RingBuff { - - public HashSet> resistances() { - if (Random.Int(level + 2) >= 2) { - return FULL; - } else { - return EMPTY; - } - } - - public float durationFactor() { - return level < 0 ? 1 : (1 + 0.5f * level) / (1 + level); - } - } -} diff --git a/java/com/hmdzl/spspd/change/items/rings/RingOfEnergy.java b/java/com/hmdzl/spspd/change/items/rings/RingOfEnergy.java deleted file mode 100644 index b96db3fd..00000000 --- a/java/com/hmdzl/spspd/change/items/rings/RingOfEnergy.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.hmdzl.spspd.change.items.rings; - -import com.hmdzl.spspd.change.messages.Messages; - -import java.text.DecimalFormat; - -/** - * Created by debenhame on 10/09/2014. - */ -public class RingOfEnergy extends Ring { - // TODO: monitor this one as it goes, super hard to balance so you'll need - // some feedback. - { - //name = "Ring of Energy"; - initials = 11; - } - - public String statsInfo() { - if (isIdentified()){ - return Messages.get(this, "stats", new DecimalFormat("#.##").format(100f * (Math.pow(1.05f, level) - 1f))); - } else { - return "???"; - } - } - - @Override - protected RingBuff buff() { - return new Energy(); - } - - public class Energy extends RingBuff { - } -} diff --git a/java/com/hmdzl/spspd/change/items/rings/RingOfEvasion.java b/java/com/hmdzl/spspd/change/items/rings/RingOfEvasion.java deleted file mode 100644 index eafe7a1c..00000000 --- a/java/com/hmdzl/spspd/change/items/rings/RingOfEvasion.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.rings; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.messages.Messages; - -public class RingOfEvasion extends Ring { - - { - //name = "Ring of Evasion"; - initials = 2; - } - - public String statsInfo() { - if (isIdentified()){ - return Messages.get(this, "stats",level,level/5); - } else { - return "???"; - } - } - - - @Override - protected RingBuff buff() { - return new Evasion(); - } - - public class Evasion extends RingBuff { - } -} diff --git a/java/com/hmdzl/spspd/change/items/rings/RingOfForce.java b/java/com/hmdzl/spspd/change/items/rings/RingOfForce.java deleted file mode 100644 index 21aeea8c..00000000 --- a/java/com/hmdzl/spspd/change/items/rings/RingOfForce.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.hmdzl.spspd.change.items.rings; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.messages.Messages; - -import java.text.DecimalFormat; - -/** - * Created by debenhame on 10/09/2014. - */ -public class RingOfForce extends Ring { - - { - //name = "Ring of Force"; - initials = 3; - } - - public String statsInfo() { - if (isIdentified()){ - return Messages.get(this, "stats", new DecimalFormat("#.##").format(100 * Math.min(3f,((level*1.00/10)*1f))), 3 + level, 3 * level + 12); - } else { - return "???"; - } - } - - - @Override - protected RingBuff buff() { - return new Force(); - } - - public class Force extends RingBuff { - } -} diff --git a/java/com/hmdzl/spspd/change/items/rings/RingOfFuror.java b/java/com/hmdzl/spspd/change/items/rings/RingOfFuror.java deleted file mode 100644 index 23646425..00000000 --- a/java/com/hmdzl/spspd/change/items/rings/RingOfFuror.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.hmdzl.spspd.change.items.rings; - -import com.hmdzl.spspd.change.messages.Messages; - -import java.text.DecimalFormat; - -/** - * Created by debenhame on 10/09/2014. - */ -public class RingOfFuror extends Ring { - - { - //name = "Ring of Furor"; - initials = 4; - } - - public String statsInfo() { - if (isIdentified()){ - return Messages.get(this, "stats",new DecimalFormat("#.##").format( Math.min(300f, level * 10f))); - } else { - return "???"; - } - } - - - @Override - protected RingBuff buff() { - return new Furor(); - } - - - public class Furor extends RingBuff { - } -} diff --git a/java/com/hmdzl/spspd/change/items/rings/RingOfHaste.java b/java/com/hmdzl/spspd/change/items/rings/RingOfHaste.java deleted file mode 100644 index d15cca8c..00000000 --- a/java/com/hmdzl/spspd/change/items/rings/RingOfHaste.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.rings; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.actors.mobs.pets.PET; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.utils.GLog; - -import java.text.DecimalFormat; - -public class RingOfHaste extends Ring { - - { - //name = "Ring of Haste"; - initials = 5; - } - - public String statsInfo() { - if (isIdentified()){ - return Messages.get(this, "stats",new DecimalFormat("#.##").format(100f * Math.min(3,0.1*level))); - } else { - return "???"; - } - } - - - @Override - protected RingBuff buff() { - return new Haste(); - } - - - public class Haste extends RingBuff { - } - - - -} diff --git a/java/com/hmdzl/spspd/change/items/rings/RingOfMagic.java b/java/com/hmdzl/spspd/change/items/rings/RingOfMagic.java deleted file mode 100644 index d8d40047..00000000 --- a/java/com/hmdzl/spspd/change/items/rings/RingOfMagic.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.rings; - -import com.hmdzl.spspd.change.messages.Messages; - -public class RingOfMagic extends Ring { - - { - //name = "Ring of Magic"; - initials = 6; - } - - public String statsInfo() { - if (isIdentified()){ - return Messages.get(this, "stats", Math.min(30,level)); - } else { - return "???"; - } - } - - - @Override - protected RingBuff buff() { - return new Magic(); - } - - public class Magic extends RingBuff { - } -} diff --git a/java/com/hmdzl/spspd/change/items/rings/RingOfMight.java b/java/com/hmdzl/spspd/change/items/rings/RingOfMight.java deleted file mode 100644 index 1d74c0b3..00000000 --- a/java/com/hmdzl/spspd/change/items/rings/RingOfMight.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.hmdzl.spspd.change.items.rings; - -import com.hmdzl.spspd.change.messages.Messages; - -/** - * Created by debenhame on 10/09/2014. - */ -public class RingOfMight extends Ring { - - { - //name = "Ring of Might"; - initials = 7; - } - - public String statsInfo() { - if (isIdentified()){ - return Messages.get(this, "stats",level/5,level*10); - } else { - return "???"; - } - } - - - - @Override - protected RingBuff buff() { - return new Might(); - } - - - public class Might extends RingBuff { - } -} diff --git a/java/com/hmdzl/spspd/change/items/rings/RingOfSharpshooting.java b/java/com/hmdzl/spspd/change/items/rings/RingOfSharpshooting.java deleted file mode 100644 index cbd2a832..00000000 --- a/java/com/hmdzl/spspd/change/items/rings/RingOfSharpshooting.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.hmdzl.spspd.change.items.rings; - -import com.hmdzl.spspd.change.messages.Messages; - -import java.text.DecimalFormat; - -/** - * Created by debenhame on 10/09/2014. - */ -public class RingOfSharpshooting extends Ring { - - { - //name = "Ring of Sharpshooting"; - initials = 8; - } - - public String statsInfo() { - if (isIdentified()){ - return Messages.get(this, "stats", level, new DecimalFormat("#.##").format(100f * (0.05*level))); - } else { - return "???"; - } - } - - - @Override - protected RingBuff buff() { - return new Aim(); - } - - - public class Aim extends RingBuff { - } -} diff --git a/java/com/hmdzl/spspd/change/items/rings/RingOfTenacity.java b/java/com/hmdzl/spspd/change/items/rings/RingOfTenacity.java deleted file mode 100644 index 9c1d4fe4..00000000 --- a/java/com/hmdzl/spspd/change/items/rings/RingOfTenacity.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.hmdzl.spspd.change.items.rings; - -import com.hmdzl.spspd.change.messages.Messages; - -import java.text.DecimalFormat; - -/** - * Created by debenhame on 10/09/2014. - */ -public class RingOfTenacity extends Ring { - - { - //name = "Ring of Tenacity"; - initials = 9; - } - - public String statsInfo() { - if (isIdentified()){ - return Messages.get(this, "stats", new DecimalFormat("#.##").format(100f * Math.min(0.40, 1.00*level/75))); - } else { - return "???"; - } - } - - @Override - protected RingBuff buff() { - return new Tenacity(); - } - - public class Tenacity extends RingBuff { - } -} diff --git a/java/com/hmdzl/spspd/change/items/scrolls/InventoryScroll.java b/java/com/hmdzl/spspd/change/items/scrolls/InventoryScroll.java deleted file mode 100644 index 64199168..00000000 --- a/java/com/hmdzl/spspd/change/items/scrolls/InventoryScroll.java +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.scrolls; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.actors.buffs.Invisibility; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.windows.WndBag; -import com.hmdzl.spspd.change.windows.WndOptions; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.noosa.audio.Sample; - -public abstract class InventoryScroll extends Scroll { - - protected String inventoryTitle = Messages.get(this, "inv_title"); - protected WndBag.Mode mode = WndBag.Mode.ALL; - - @Override - public void doRead() { - - if (!isKnown()) { - setKnown(); - identifiedByUse = true; - } else { - identifiedByUse = false; - } - - GameScene.selectItem( itemSelector, mode, inventoryTitle ); - } - - private void confirmCancelation() { - GameScene.show( new WndOptions( name(), Messages.get(this, "warning"), - Messages.get(this, "yes"), Messages.get(this, "no") ) { - @Override - protected void onSelect( int index ) { - switch (index) { - case 0: - curUser.spendAndNext( TIME_TO_READ ); - identifiedByUse = false; - break; - case 1: - GameScene.selectItem( itemSelector, mode, inventoryTitle ); - break; - } - } - public void onBackPressed() {}; - } ); - } - - protected abstract void onItemSelected( Item item ); - - protected static boolean identifiedByUse = false; - protected static WndBag.Listener itemSelector = new WndBag.Listener() { - @Override - public void onSelect( Item item ) { - - if (!(curItem instanceof InventoryScroll)){ - return; - } - - if (item != null) { - - ((InventoryScroll)curItem).onItemSelected( item ); - ((InventoryScroll)curItem).readAnimation(); - - Sample.INSTANCE.play( Assets.SND_READ ); - Invisibility.dispel(); - - } else if (identifiedByUse && !((Scroll)curItem).ownedByBook) { - - ((InventoryScroll)curItem).confirmCancelation(); - - } else if (!((Scroll)curItem).ownedByBook) { - - curItem.collect( curUser.belongings.backpack ); - - } - } - }; -} diff --git a/java/com/hmdzl/spspd/change/items/scrolls/Scroll.java b/java/com/hmdzl/spspd/change/items/scrolls/Scroll.java deleted file mode 100644 index a10176e3..00000000 --- a/java/com/hmdzl/spspd/change/items/scrolls/Scroll.java +++ /dev/null @@ -1,224 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.scrolls; - -import java.util.ArrayList; -import java.util.HashSet; - -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.Challenges; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.buffs.Blindness; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Locked; -import com.hmdzl.spspd.change.actors.buffs.Silent; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.hero.HeroClass; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.ItemStatusHandler; -import com.hmdzl.spspd.change.items.artifacts.UnstableSpellbook; -import com.hmdzl.spspd.change.items.artifacts.UnstableSpellbook; -import com.hmdzl.spspd.change.sprites.HeroSprite; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -public abstract class Scroll extends Item { - - public static final String AC_READ = "READ"; - - protected static final float TIME_TO_READ = 1f; - - protected int initials; - - private static final Class[] scrolls = { ScrollOfIdentify.class, - ScrollOfMagicMapping.class, ScrollOfRecharging.class, - ScrollOfRemoveCurse.class, ScrollOfTeleportation.class, - ScrollOfUpgrade.class, ScrollOfRage.class, ScrollOfTerror.class, - ScrollOfLullaby.class, ScrollOfMagicalInfusion.class, - ScrollOfPsionicBlast.class, ScrollOfMirrorImage.class, ScrollOfRegrowth.class, ScrollOfSacrifice.class }; - private static final String[] runes = { "KAUNAN", "SOWILO", "LAGUZ", - "YNGVI", "GYFU", "RAIDO", "ISAZ", "MANNAZ", "NAUDIZ", "BERKANAN", - "NCOSRANE", "TIWAZ", "NENDIL", "LIBRA" }; - private static final Integer[] images = { ItemSpriteSheet.SCROLL_KAUNAN, - ItemSpriteSheet.SCROLL_SOWILO, ItemSpriteSheet.SCROLL_LAGUZ, - ItemSpriteSheet.SCROLL_YNGVI, ItemSpriteSheet.SCROLL_GYFU, - ItemSpriteSheet.SCROLL_RAIDO, ItemSpriteSheet.SCROLL_ISAZ, - ItemSpriteSheet.SCROLL_MANNAZ, ItemSpriteSheet.SCROLL_NAUDIZ, - ItemSpriteSheet.SCROLL_BERKANAN, ItemSpriteSheet.SCROLL_NCOSRANE, - ItemSpriteSheet.SCROLL_TIWAZ, ItemSpriteSheet.SCROLL_NENDIL, ItemSpriteSheet.SCROLL_LIBRA }; - - private static ItemStatusHandler handler; - - private String rune; - - public boolean ownedByBook = false; - - { - stackable = true; - defaultAction = AC_READ; - } - - @SuppressWarnings("unchecked") - public static void initLabels() { - handler = new ItemStatusHandler( - (Class[]) scrolls, runes, images); - } - - public static void save(Bundle bundle) { - handler.save(bundle); - } - - @SuppressWarnings("unchecked") - public static void restore(Bundle bundle) { - handler = new ItemStatusHandler( - (Class[]) scrolls, runes, images, bundle); - } - - public Scroll() { - super(); - sync(); - } - - @Override - public void sync() { - super.sync(); - image = handler.image(this); - rune = handler.label(this); - }; - - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions(hero); - actions.add(AC_READ); - return actions; - } - - @Override - public void execute(Hero hero, String action) { - if (action.equals(AC_READ)) { - - if (hero.buff(Blindness.class) != null ) { - GLog.w(Messages.get(this, "blinded")); - } else if (hero.buff(Locked.class) != null ) { - GLog.w(Messages.get(this, "locked")); - } else if (hero.buff(Silent.class) != null ) { - GLog.w(Messages.get(this, "silent")); - } else if (hero.buff(UnstableSpellbook.bookRecharge.class) != null - && hero.buff(UnstableSpellbook.bookRecharge.class) - .isCursed() - && !(this instanceof ScrollOfRemoveCurse)) { - GLog.n(Messages.get(this, "cursed") ); - } else { - curUser = hero; - if (!(Dungeon.hero.heroClass == HeroClass.FOLLOWER ) || (Dungeon.hero.heroClass == HeroClass.FOLLOWER && Random.Int(10)>=1 )) - curItem = detach(hero.belongings.backpack); - doRead(); - //readAnimation(); - } - - } else { - - super.execute(hero, action); - - } - } - - public abstract void doRead(); - - //currently only used in scrolls owned by the unstable spellbook - public abstract void empoweredRead(); - - protected void readAnimation() { - curUser.spend( TIME_TO_READ ); - curUser.busy(); - ((HeroSprite)curUser.sprite).read(); - if (Dungeon.isChallenged(Challenges.ITEM_PHOBIA)){ - Buff.affect(curUser, Silent.class, 5f); - int damage = curUser.HT/10; - curUser.damage(damage, this); - } - } - - public boolean isKnown() { - return handler.isKnown(this); - } - - public void setKnown() { - if (!isKnown() && !ownedByBook) { - handler.know(this); - } - - Badges.validateAllScrollsIdentified(); - } - - @Override - public Item identify() { - setKnown(); - return super.identify(); - } - - public String rune() { - return Messages.get(Scroll.class, rune); - } - - @Override - public String name() { - return isKnown() ? name : Messages.get(this, "unknown_name", rune()); - } - - @Override - public String info() { - return isKnown() ? - desc() : - Messages.get(this, "unknown_desc", rune()); - } - - public Integer initials(){ - return isKnown() ? initials : null; - } - - @Override - public boolean isUpgradable() { - return false; - } - - @Override - public boolean isIdentified() { - return isKnown(); - } - - public static HashSet> getKnown() { - return handler.known(); - } - - public static HashSet> getUnknown() { - return handler.unknown(); - } - - public static boolean allKnown() { - return handler.known().size() == scrolls.length; - } - - @Override - public int price() { - return 20 * quantity; - } -} diff --git a/java/com/hmdzl/spspd/change/items/scrolls/ScrollOfIdentify.java b/java/com/hmdzl/spspd/change/items/scrolls/ScrollOfIdentify.java deleted file mode 100644 index eb5cf4d7..00000000 --- a/java/com/hmdzl/spspd/change/items/scrolls/ScrollOfIdentify.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.scrolls; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.effects.Identification; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.utils.GLog; -import com.hmdzl.spspd.change.windows.WndBag; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Random; - -import java.util.ArrayList; - -public class ScrollOfIdentify extends InventoryScroll { - - { - //name = "Scroll of Identify"; - //inventoryTitle = "Select an item to identify"; - mode = WndBag.Mode.UNIDENTIFED; - consumedValue = 10; - initials = 1; - - } - - @Override - public void empoweredRead() { - ArrayList unIDed = new ArrayList<>(); - - for( Item i : curUser.belongings){ - if (!i.isIdentified()){ - unIDed.add(i); - } - } - - if (unIDed.size() > 1) { - Random.element(unIDed).identify(); - Sample.INSTANCE.play( Assets.SND_TELEPORT ); - } - - doRead(); - } - - @Override - protected void onItemSelected(Item item) { - - curUser.sprite.parent.add(new Identification(curUser.sprite.center() - .offset(0, -16))); - - item.identify(); - GLog.i(Messages.get(this, "it_is", item)); - readAnimation(); - Badges.validateItemLevelAquired(item); - } - - - - @Override - public int price() { - return isKnown() ? 30 * quantity : super.price(); - } -} diff --git a/java/com/hmdzl/spspd/change/items/scrolls/ScrollOfLullaby.java b/java/com/hmdzl/spspd/change/items/scrolls/ScrollOfLullaby.java deleted file mode 100644 index bbd805ef..00000000 --- a/java/com/hmdzl/spspd/change/items/scrolls/ScrollOfLullaby.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.scrolls; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.buffs.ArmorBreak; -import com.hmdzl.spspd.change.actors.buffs.AttackDown; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Drowsy; -import com.hmdzl.spspd.change.actors.buffs.Invisibility; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.utils.GLog; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.noosa.audio.Sample; - -public class ScrollOfLullaby extends Scroll { - - { - //name = "Scroll of Lullaby"; - consumedValue = 5; - initials = 2; - } - - @Override - public void doRead() { - - curUser.sprite.centerEmitter() - .start(Speck.factory(Speck.NOTE), 0.3f, 5); - Sample.INSTANCE.play(Assets.SND_LULLABY); - Invisibility.dispel(); - - for (Mob mob : Dungeon.level.mobs.toArray(new Mob[0])) { - if (Level.fieldOfView[mob.pos]) { - Buff.affect(mob, Drowsy.class); - Buff.affect(mob, AttackDown.class,10f).level(50); - Buff.affect(mob, ArmorBreak.class,10f).level(50); - mob.sprite.centerEmitter().start(Speck.factory(Speck.NOTE), - 0.3f, 5); - } - } - - Buff.affect(curUser, Drowsy.class); - Buff.affect(curUser, AttackDown.class,10f).level(20); - Buff.affect(curUser, ArmorBreak.class,10f).level(20); - - GLog.i(Messages.get(this, "sooth")); - - setKnown(); - - readAnimation(); - } - - @Override - public void empoweredRead() { - doRead(); - for (Mob mob : Dungeon.level.mobs.toArray( new Mob[0] )) { - if (Level.fieldOfView[mob.pos]) { - Buff drowsy = mob.buff(Drowsy.class); - if (drowsy != null) drowsy.act(); - } - } - } - - @Override - public int price() { - return isKnown() ? 40 * quantity : super.price(); - } -} diff --git a/java/com/hmdzl/spspd/change/items/scrolls/ScrollOfMagicMapping.java b/java/com/hmdzl/spspd/change/items/scrolls/ScrollOfMagicMapping.java deleted file mode 100644 index 5b357068..00000000 --- a/java/com/hmdzl/spspd/change/items/scrolls/ScrollOfMagicMapping.java +++ /dev/null @@ -1,147 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.scrolls; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.buffs.Invisibility; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.effects.SpellSprite; -import com.hmdzl.spspd.change.items.misc.Spectacles.MagicSight; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.Terrain; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.audio.Sample; - -public class ScrollOfMagicMapping extends Scroll { - - { - //name = "Scroll of Magic Mapping"; - consumedValue = 10; - initials = 4; - } - - @Override - public void doRead() { - - int length = Level.LENGTH; - //int[] map = Dungeon.level.map; - boolean[] mapped = Dungeon.level.mapped; - boolean[] discoverable = Level.discoverable; - - //boolean noticed = false; - - for (int i = 0; i < length; i++) { - - //int terr = map[i]; - - if (discoverable[i]) { - - mapped[i] = true; - //if ((Terrain.flags[terr] & Terrain.SECRET) != 0) { - - //Level.set(i, Terrain.discover(terr)); - //GameScene.updateMap(i); - //Dungeon.level.discover( i ); - - //if (Dungeon.visible[i]) { - //GameScene.discoverTile(i, terr); - //discover(i); - - //noticed = true; - //} - //} - } - } - Dungeon.observe(); - - GLog.i(Messages.get(this, "layout")); - //if (noticed) { - //Sample.INSTANCE.play(Assets.SND_SECRET); - //} - - //SpellSprite.show(curUser, SpellSprite.MAP); - //Sample.INSTANCE.play(Assets.SND_READ); - Invisibility.dispel(); - - setKnown(); - - readAnimation(); - } - - @Override - public void empoweredRead() { - doRead(); - int length = Level.LENGTH; - int[] map = Dungeon.level.map; - boolean[] mapped = Dungeon.level.mapped; - boolean[] discoverable = Level.discoverable; - - boolean noticed = false; - - for (int i = 0; i < length; i++) { - - int terr = map[i]; - - if (discoverable[i]) { - - mapped[i] = true; - if ((Terrain.flags[terr] & Terrain.SECRET) != 0) { - - //Level.set(i, Terrain.discover(terr)); - //GameScene.updateMap(i); - Dungeon.level.discover( i ); - - if (Dungeon.visible[i]) { - GameScene.discoverTile(i, terr); - discover(i); - - noticed = true; - } - } - } - } - Dungeon.observe(); - - GLog.i(Messages.get(this, "layout")); - if (noticed) { - Sample.INSTANCE.play(Assets.SND_SECRET); - } - - SpellSprite.show(curUser, SpellSprite.MAP); - Sample.INSTANCE.play(Assets.SND_READ); - Invisibility.dispel(); - - setKnown(); - - curUser.spendAndNext(TIME_TO_READ); - Dungeon.observe(); - } - - @Override - public int price() { - return isKnown() ? 50 * quantity : super.price(); - } - - public static void discover(int cell) { - CellEmitter.get(cell).start(Speck.factory(Speck.DISCOVER), 0.1f, 4); - } -} diff --git a/java/com/hmdzl/spspd/change/items/scrolls/ScrollOfMagicalInfusion.java b/java/com/hmdzl/spspd/change/items/scrolls/ScrollOfMagicalInfusion.java deleted file mode 100644 index 13f2d7ae..00000000 --- a/java/com/hmdzl/spspd/change/items/scrolls/ScrollOfMagicalInfusion.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.scrolls; - -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.armor.Armor; -import com.hmdzl.spspd.change.items.weapon.Weapon; -import com.hmdzl.spspd.change.utils.GLog; -import com.hmdzl.spspd.change.windows.WndBag; -import com.hmdzl.spspd.change.messages.Messages; - -public class ScrollOfMagicalInfusion extends InventoryScroll { - - { - //name = "Scroll of Magical Infusion"; - //inventoryTitle = "Select an item to infuse"; - mode = WndBag.Mode.ENCHANTABLE; - consumedValue = 15; - initials = 3; - - - } - - @Override - protected void onItemSelected(Item item) { - - ScrollOfRemoveCurse.uncurse(Dungeon.hero, item); - if (item instanceof Weapon) - ((Weapon) item).upgrade(true); - else - ((Armor) item).upgrade(true); - - GLog.p(Messages.get(this, "infuse", item.name())); - - Badges.validateItemLevelAquired(item); - - curUser.sprite.emitter().start(Speck.factory(Speck.UP), 0.2f, 3); - readAnimation(); - } - - @Override - public void empoweredRead() { - //does nothing for now, this should never happen. - } - - @Override - public int price() { - return isKnown() ? 100 * quantity : super.price(); - } -} diff --git a/java/com/hmdzl/spspd/change/items/scrolls/ScrollOfMirrorImage.java b/java/com/hmdzl/spspd/change/items/scrolls/ScrollOfMirrorImage.java deleted file mode 100644 index 4a822e3a..00000000 --- a/java/com/hmdzl/spspd/change/items/scrolls/ScrollOfMirrorImage.java +++ /dev/null @@ -1,209 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.scrolls; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Invisibility; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.mobs.npcs.MirrorImage; -import com.hmdzl.spspd.change.effects.SpellSprite; -import com.hmdzl.spspd.change.items.wands.WandOfBlood; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.utils.GLog; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundle; -import com.watabou.utils.PathFinder; -import com.watabou.utils.Random; - -public class ScrollOfMirrorImage extends Scroll { - - private static final int NIMAGES = 3; - - { - //name = "Scroll of Mirror Image"; - consumedValue = 5; - initials = 5; - } - - private static final String TXT_PREVENTING = "Something scrambles the illusion magic! "; - - @Override - public void doRead() { - - if (Dungeon.depth>50){ - GLog.w( Messages.get(Scroll.class, "prevent")); - Sample.INSTANCE.play(Assets.SND_READ); - Invisibility.dispel(); - - setKnown(); - - curUser.spendAndNext(TIME_TO_READ); - return; - } - - ArrayList respawnPoints = new ArrayList(); - - for (int i = 0; i < Level.NEIGHBOURS8.length; i++) { - int p = curUser.pos + Level.NEIGHBOURS8[i]; - if (Actor.findChar(p) == null - && (Level.passable[p] || Level.avoid[p])) { - respawnPoints.add(p); - } - } - - int nImages = NIMAGES; - while (nImages > 0 && respawnPoints.size() > 0) { - int index = Random.index(respawnPoints); - - MirrorImage mob = new MirrorImage(); - mob.duplicate(curUser); - GameScene.add(mob); - ScrollOfTeleportation.appear(mob, respawnPoints.get(index)); - - respawnPoints.remove(index); - nImages--; - } - - if (nImages < NIMAGES) { - setKnown(); - } - - Sample.INSTANCE.play(Assets.SND_READ); - Invisibility.dispel(); - readAnimation(); - } - - @Override - public void empoweredRead() { - //spawns 2 images right away, delays 4 of them, 6 total. - new DelayedImageSpawner(6 - spawnImages(curUser, 2), 2, 3).attachTo(curUser); - - setKnown(); - - Sample.INSTANCE.play( Assets.SND_READ ); - Invisibility.dispel(); - - curUser.spendAndNext(TIME_TO_READ); - } - - //returns the number of images spawned - public static int spawnImages(Hero hero, int nImages ){ - - ArrayList respawnPoints = new ArrayList(); - - for (int i = 0; i < PathFinder.NEIGHBOURS8.length; i++) { - int p = hero.pos + PathFinder.NEIGHBOURS8[i]; - if (Actor.findChar( p ) == null && (Dungeon.level.passable[p] || Dungeon.level.avoid[p])) { - respawnPoints.add( p ); - } - } - - int spawned = 0; - while (nImages > 0 && respawnPoints.size() > 0) { - int index = Random.index( respawnPoints ); - - MirrorImage mob = new MirrorImage(); - mob.duplicate( hero ); - GameScene.add( mob ); - ScrollOfTeleportation.appear( mob, respawnPoints.get( index ) ); - - respawnPoints.remove( index ); - nImages--; - spawned++; - } - - return spawned; - } - - public static class DelayedImageSpawner extends Buff { - - public DelayedImageSpawner(){ - this(NIMAGES, NIMAGES, 1); - } - - public DelayedImageSpawner( int total, int perRound, float delay){ - super(); - totImages = total; - imPerRound = perRound; - this.delay = delay; - } - - private int totImages; - private int imPerRound; - private float delay; - - @Override - public boolean attachTo(Char target) { - if (super.attachTo(target)){ - spend(delay); - return true; - } else { - return false; - } - } - - @Override - public boolean act() { - - int spawned = spawnImages((Hero)target, Math.min(totImages, imPerRound)); - - totImages -= spawned; - - if (totImages <0){ - detach(); - } else { - spend( delay ); - } - - return true; - } - - private static final String TOTAL = "images"; - private static final String PER_ROUND = "per_round"; - private static final String DELAY = "delay"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put( TOTAL, totImages ); - bundle.put( PER_ROUND, imPerRound ); - bundle.put( DELAY, delay ); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - totImages = bundle.getInt( TOTAL ); - imPerRound = bundle.getInt( PER_ROUND ); - delay = bundle.getFloat( DELAY ); - } - } - - @Override - public int price() { - return isKnown() ? 30 * quantity : super.price(); - } -} diff --git a/java/com/hmdzl/spspd/change/items/scrolls/ScrollOfMultiUpgrade.java b/java/com/hmdzl/spspd/change/items/scrolls/ScrollOfMultiUpgrade.java deleted file mode 100644 index fc08b253..00000000 --- a/java/com/hmdzl/spspd/change/items/scrolls/ScrollOfMultiUpgrade.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.scrolls; - -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.utils.GLog; -import com.hmdzl.spspd.change.windows.WndBag; -import com.hmdzl.spspd.change.messages.Messages; - -public class ScrollOfMultiUpgrade extends InventoryScroll { - - private static final String TXT_LOOKS_BETTER = "your %s certainly looks better now"; - - { - name = "Scroll of Multi Upgrade"; - inventoryTitle = "Select an item to upgrade"; - mode = WndBag.Mode.UPGRADEABLE; - consumedValue = 10; - initials = 6; - - - } - - @Override - protected void onItemSelected(Item item) { - - ScrollOfRemoveCurse.uncurse(Dungeon.hero, item); - item.upgrade(); - - for(int i=1; i<6; i++){ - upgrade(curUser); - } - GLog.p(TXT_LOOKS_BETTER, item.name()); - - Badges.validateItemLevelAquired(item); - } - - @Override - public void empoweredRead() { - //does nothing for now, this should never happen. - } - - public static void upgrade(Hero hero) { - hero.sprite.emitter().start(Speck.factory(Speck.UP), 0.2f, 3); - } - - - - @Override - public String desc() { - return "This scroll will upgrade a single item five times, improving its quality. A wand will " - + "increase in power and in number of charges; a weapon will inflict more damage " - + "or find its mark more frequently; a suit of armor will deflect additional blows; " - + "the effect of a ring on its wearer will intensify. Weapons and armor will also " - + "require less strength to use, and any curses on the item will be lifted."; - } -} diff --git a/java/com/hmdzl/spspd/change/items/scrolls/ScrollOfPsionicBlast.java b/java/com/hmdzl/spspd/change/items/scrolls/ScrollOfPsionicBlast.java deleted file mode 100644 index 7123ed53..00000000 --- a/java/com/hmdzl/spspd/change/items/scrolls/ScrollOfPsionicBlast.java +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.scrolls; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.ResultDescriptions; -import com.hmdzl.spspd.change.Statistics; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Blindness; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Invisibility; -import com.hmdzl.spspd.change.actors.buffs.MindVision; -import com.hmdzl.spspd.change.actors.buffs.Paralysis; -import com.hmdzl.spspd.change.actors.buffs.Strength; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.utils.GLog; -import com.hmdzl.spspd.change.messages.Messages; - -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Random; - -public class ScrollOfPsionicBlast extends Scroll { - - { - //name = "Scroll of Psionic Blast"; - consumedValue = 10; - initials = 7; - - - } - - @Override - public void doRead() { - - GameScene.flash(0xFFFFFF); - - Sample.INSTANCE.play(Assets.SND_BLAST); - Invisibility.dispel(); - - for (Mob mob : Dungeon.level.mobs.toArray(new Mob[0])) { - if (Level.fieldOfView[mob.pos] && !mob.properties().contains(Char.Property.BOSS)) { - mob.damage(mob.HT, this); - } else mob.damage(1, this); - } - - curUser.damage(Math.max(curUser.HT / 5, curUser.HP / 2), this); - Buff.prolong(curUser, Paralysis.class, Random.Int(4, 6)); - Buff.prolong(curUser, Blindness.class, Random.Int(6, 9)); - Dungeon.observe(); - - setKnown(); - - readAnimation(); - - } - - @Override - public void empoweredRead() { - GameScene.flash( 0xFFFFFF ); - - Sample.INSTANCE.play( Assets.SND_BLAST ); - Invisibility.dispel(); - - for (Mob mob : Dungeon.level.mobs.toArray( new Mob[0] )) { - if (Level.fieldOfView[mob.pos]) { - mob.damage(mob.HT, this ); - } - } - - setKnown(); - - curUser.spendAndNext(TIME_TO_READ); - } - - public boolean checkOriginalGenMobs (){ - for (Mob mob : Dungeon.level.mobs.toArray(new Mob[0])) { - if (mob.originalgen){return true;} - } - return false; - } - - @Override - public int price() { - return isKnown() ? 80 * quantity : super.price(); - } -} diff --git a/java/com/hmdzl/spspd/change/items/scrolls/ScrollOfRage.java b/java/com/hmdzl/spspd/change/items/scrolls/ScrollOfRage.java deleted file mode 100644 index b0517836..00000000 --- a/java/com/hmdzl/spspd/change/items/scrolls/ScrollOfRage.java +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.scrolls; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.buffs.Amok; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Invisibility; -import com.hmdzl.spspd.change.actors.buffs.Silent; -import com.hmdzl.spspd.change.actors.mobs.Mimic; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.Heap; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.utils.GLog; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.noosa.audio.Sample; - -public class ScrollOfRage extends Scroll { - - { - //name = "Scroll of Rage"; - consumedValue = 5; - initials = 8; - } - - @Override - public void doRead() { - - for (Mob mob : Dungeon.level.mobs.toArray(new Mob[0])) { - mob.beckon(curUser.pos); - if (Level.fieldOfView[mob.pos]) { - Buff.prolong(mob, Amok.class, 5f); - Buff.affect(mob, Silent.class, 20f); - } - } - - for (Heap heap : Dungeon.level.heaps.values()) { - if (heap.type == Heap.Type.MIMIC) { - Mimic m = Mimic.spawnAt(heap.pos, heap.items); - if (m != null) { - m.beckon(curUser.pos); - heap.destroy(); - } - } - } - - GLog.w( Messages.get(this, "roar")); - setKnown(); - - curUser.sprite.centerEmitter().start(Speck.factory(Speck.SCREAM), 0.3f, - 3); - Sample.INSTANCE.play(Assets.SND_CHALLENGE); - Invisibility.dispel(); - - readAnimation(); - } - - @Override - public void empoweredRead() { - for (Mob mob : Dungeon.level.mobs.toArray( new Mob[0] )) { - if (Level.fieldOfView[mob.pos]) { - Buff.prolong(mob, Amok.class, 10f); - Buff.affect(mob, Silent.class, 40f); - } - } - - setKnown(); - - curUser.sprite.centerEmitter().start( Speck.factory( Speck.SCREAM ), 0.3f, 3 ); - Sample.INSTANCE.play( Assets.SND_READ ); - Invisibility.dispel(); - - curUser.spendAndNext(TIME_TO_READ); - } - - @Override - public int price() { - return isKnown() ? 30 * quantity : super.price(); - } - -} diff --git a/java/com/hmdzl/spspd/change/items/scrolls/ScrollOfRecharging.java b/java/com/hmdzl/spspd/change/items/scrolls/ScrollOfRecharging.java deleted file mode 100644 index 9c4e00e4..00000000 --- a/java/com/hmdzl/spspd/change/items/scrolls/ScrollOfRecharging.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.scrolls; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.actors.buffs.Arcane; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Recharging; -import com.hmdzl.spspd.change.actors.buffs.Invisibility; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.SpellSprite; -import com.hmdzl.spspd.change.effects.particles.EnergyParticle; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.audio.Sample; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.FlavourBuff; -import com.hmdzl.spspd.change.ui.BuffIndicator; -import com.watabou.noosa.audio.Sample; -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.actors.buffs.Invisibility; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.SpellSprite; -import com.hmdzl.spspd.change.effects.particles.EnergyParticle; -import com.hmdzl.spspd.change.utils.GLog; -import com.hmdzl.spspd.change.messages.Messages; - -public class ScrollOfRecharging extends Scroll { - - public static final float BUFF_DURATION = 30f; - { - //name = "Scroll of Recharging"; - consumedValue = 10; - initials = 10; - } - - @Override - public void doRead() { - - Buff.affect(curUser, Recharging.class, BUFF_DURATION); - Buff.affect(curUser, Arcane.class, BUFF_DURATION); - charge(curUser); - - Sample.INSTANCE.play( Assets.SND_READ ); - Invisibility.dispel(); - - GLog.i(Messages.get(this, "surge")); - SpellSprite.show( curUser, SpellSprite.CHARGE ); - setKnown(); - - readAnimation(); - } - - @Override - public void empoweredRead() { - doRead(); - Buff.append(curUser, Recharging.class, BUFF_DURATION/3f); - } - - public static void charge( Hero hero ) { - hero.sprite.centerEmitter().burst( EnergyParticle.FACTORY, 15 ); - } - - @Override - public int price() { - return isKnown() ? 40 * quantity : super.price(); - } - -} diff --git a/java/com/hmdzl/spspd/change/items/scrolls/ScrollOfRegrowth.java b/java/com/hmdzl/spspd/change/items/scrolls/ScrollOfRegrowth.java deleted file mode 100644 index 2e74da72..00000000 --- a/java/com/hmdzl/spspd/change/items/scrolls/ScrollOfRegrowth.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.scrolls; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.blobs.Blob; -import com.hmdzl.spspd.change.actors.blobs.Water; -import com.hmdzl.spspd.change.actors.buffs.Invisibility; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.effects.SpellSprite; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.Terrain; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.utils.GLog; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.noosa.audio.Sample; - -public class ScrollOfRegrowth extends Scroll { - - { - //name = "Scroll of Regrowth"; - consumedValue = 15; - initials = 9; - } - - @Override - public void doRead() { - int length = Level.getLength(); - - for (int i = 0; i < length; i++) { - - GameScene.add(Blob.seed(i, (2) * 20, Water.class)); - - } - - Sample.INSTANCE.play(Assets.SND_READ); - Invisibility.dispel(); - - setKnown(); - - readAnimation(); - } - - @Override - public void empoweredRead() { - //does nothing for now, this should never happen. - } - - @Override - public int price() { - return isKnown() ? 100 * quantity : super.price(); - } - -} diff --git a/java/com/hmdzl/spspd/change/items/scrolls/ScrollOfRemoveCurse.java b/java/com/hmdzl/spspd/change/items/scrolls/ScrollOfRemoveCurse.java deleted file mode 100644 index 8dae3ded..00000000 --- a/java/com/hmdzl/spspd/change/items/scrolls/ScrollOfRemoveCurse.java +++ /dev/null @@ -1,112 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.scrolls; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Invisibility; -import com.hmdzl.spspd.change.actors.buffs.Weakness; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.Flare; -import com.hmdzl.spspd.change.effects.particles.ShadowParticle; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.bags.Bag; -import com.hmdzl.spspd.change.utils.GLog; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.noosa.audio.Sample; - -public class ScrollOfRemoveCurse extends Scroll { - - { - //name = "Scroll of Remove Curse"; - consumedValue = 15; - initials = 11; - } - - @Override - public void doRead() { - - new Flare(6, 32).show(curUser.sprite, 2f); - Sample.INSTANCE.play(Assets.SND_READ); - Invisibility.dispel(); - - boolean procced = uncurse(curUser, - curUser.belongings.backpack.items.toArray(new Item[0])); - procced = uncurse(curUser, curUser.belongings.weapon, - curUser.belongings.armor, curUser.belongings.misc1, - curUser.belongings.misc2, curUser.belongings.misc3 ) - || procced; - - Buff.detach(curUser, Weakness.class); - - if (procced) { - GLog.p(Messages.get(this, "cleansed") ); - } else { - GLog.i(Messages.get(this, "not_cleansed")); - } - - setKnown(); - - readAnimation(); - } - - public static boolean uncurse(Hero hero, Item... items) { - - boolean procced = false; - for (int i = 0; i < items.length; i++) { - Item item = items[i]; - if (item != null && item.cursed) { - item.uncurse(); - if(item.level<0){item.upgrade((-item.level)*2);} //upgrade to reverse of negatives - if (item.cursed==false) {procced = true;} - } - if (item instanceof Bag) { - for (Item bagItem: ((Bag)item).items){ - if (bagItem != null && bagItem.cursed) { - bagItem.uncurse(); - if(bagItem.level<0){bagItem.upgrade((-bagItem.level)*2);} - if (bagItem.cursed==false) {procced = true;} - } - } - } - } - - if (procced) { - hero.sprite.emitter().start(ShadowParticle.UP, 0.05f, 10); - } - - return procced; - } - - @Override - public void empoweredRead() { - for (Item item : curUser.belongings){ - if (item.cursed){ - item.cursedKnown = true; - } - } - Sample.INSTANCE.play( Assets.SND_READ ); - Invisibility.dispel(); - doRead(); - } - - @Override - public int price() { - return isKnown() ? 30 * quantity : super.price(); - } -} diff --git a/java/com/hmdzl/spspd/change/items/scrolls/ScrollOfSacrifice.java b/java/com/hmdzl/spspd/change/items/scrolls/ScrollOfSacrifice.java deleted file mode 100644 index 4bf19960..00000000 --- a/java/com/hmdzl/spspd/change/items/scrolls/ScrollOfSacrifice.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.scrolls; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.utils.Random; - -public class ScrollOfSacrifice extends Scroll { - - { - //name = "Scroll of Sacrifice"; - consumedValue = 15; - initials = 15; - } - - @Override - public void doRead() { - - if(Dungeon.sacrifice==0){Dungeon.hero.HT +=5; - Dungeon.hero.sprite.showStatus(CharSprite.POSITIVE, Messages.get(this, "use_1")); - } - else if(Dungeon.sacrifice > 0){Dungeon.hero.STR++; - Dungeon.hero.sprite.showStatus(CharSprite.POSITIVE, Messages.get(this, "use_2")); - } - if(Dungeon.sacrifice > 1) {Dungeon.hero.HT-= Random.Int(5*Dungeon.sacrifice,Dungeon.hero.HT/5); - GLog.w(Messages.get(this, "use_lot")); - } - - if(Dungeon.hero.HP > Dungeon.hero.HT) - {Dungeon.hero.HP = Dungeon.hero.HT;} - - setKnown(); - - readAnimation(); - - Dungeon.sacrifice++; - } - - @Override - public void empoweredRead() { - //does nothing for now, this should never happen. - } - -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/items/scrolls/ScrollOfTeleportation.java b/java/com/hmdzl/spspd/change/items/scrolls/ScrollOfTeleportation.java deleted file mode 100644 index c5285483..00000000 --- a/java/com/hmdzl/spspd/change/items/scrolls/ScrollOfTeleportation.java +++ /dev/null @@ -1,205 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.scrolls; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Invisibility; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.mobs.npcs.SheepSokoban; -import com.hmdzl.spspd.change.actors.mobs.npcs.SheepSokobanCorner; -import com.hmdzl.spspd.change.actors.mobs.npcs.SheepSokobanSwitch; -import com.hmdzl.spspd.change.effects.particles.ShadowParticle; -import com.hmdzl.spspd.change.items.wands.WandOfBlood; -import com.hmdzl.spspd.change.actors.mobs.npcs.Sheep; -import com.hmdzl.spspd.change.items.wands.WandOfFlock; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.Terrain; -import com.hmdzl.spspd.change.scenes.CellSelector; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.HeroSprite; -import com.hmdzl.spspd.change.utils.GLog; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.noosa.Camera; -import com.watabou.noosa.audio.Sample; -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.effects.MagicMissile; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.audio.Sample; -import com.watabou.noosa.tweeners.AlphaTweener; -import com.watabou.utils.Callback; -import com.watabou.utils.Random; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Strength; - -public class ScrollOfTeleportation extends Scroll { - - { - //name = "Scroll of Teleportation"; - consumedValue = 10; - initials = 12; - } - - @Override - public void doRead() { - - Sample.INSTANCE.play(Assets.SND_READ); - Invisibility.dispel(); - - teleportHero(curUser); - setKnown(); - - readAnimation(); - } - - @Override - public void empoweredRead() { - - if (Dungeon.bossLevel()){ - GLog.w( Messages.get(this, "no_tele") ); - return; - } - - GameScene.selectCell(new CellSelector.Listener() { - @Override - public void onSelect(Integer target) { - if (target != null) { - //time isn't spent - //((HeroSprite)curUser.sprite).read(); - teleportHeroLocation(curUser, target); - } - } - - @Override - public String prompt() { - return Messages.get(ScrollOfTeleportation.class, "prompt"); - } - }); - } - - public static void teleportHero(Hero hero) { - - int count = 10; - int pos; - do { - pos = Dungeon.level.randomRespawnCell(); - if (count-- <= 0) { - break; - } - } while (pos == -1); - - if (pos == -1 || Dungeon.bossLevel()) { - - GLog.w( Messages.get(ScrollOfTeleportation.class, "no_tele")); - - } else { - - ScrollOfTeleportation.appear(hero, pos); - Dungeon.level.press(pos, hero); - Dungeon.observe(); - - GLog.i(Messages.get(ScrollOfTeleportation.class, "tele")); - - } - } - - public static void teleportHeroLocation(Hero hero, int spot) { - - Char ch = Actor.findChar(spot); - boolean sheepchk = false; - - if (ch!=null && (ch instanceof SheepSokoban || ch instanceof SheepSokobanSwitch || ch instanceof SheepSokobanCorner || ch instanceof Sheep || ch instanceof WandOfFlock.MagicSheep)){ - sheepchk = true; - } - - if (Level.passable[spot] && (Actor.findChar(spot) == null || sheepchk)) { - - //GLog.i("clear"); - - if (Actor.findChar(spot) != null && sheepchk){ - Camera.main.shake(2, 0.3f); - ch.destroy(); - ch.sprite.killAndErase(); - ch.sprite.emitter().burst(ShadowParticle.UP, 5); - Level.set(spot, Terrain.WOOL_RUG); - GameScene.updateMap(spot); - } - - ScrollOfTeleportation.appear(hero, spot); - Dungeon.level.press(spot, hero); - Dungeon.observe(); - - GLog.i(Messages.get(ScrollOfTeleportation.class, "tele")); - } - - - else { - - int count = 10; - int pos; - do { - pos = Dungeon.level.randomRespawnCell(); - if (count-- <= 0) { - break; - } - } while (pos == -1); - - if (pos == -1) { - - GLog.w(Messages.get(Scroll.class, "deact")); - - } else { - - ScrollOfTeleportation.appear(hero, pos); - Dungeon.level.press(pos, hero); - Dungeon.observe(); - - GLog.i(Messages.get(ScrollOfTeleportation.class, "tele")); - - } - } - } - - public static void appear( Char ch, int pos ) { - - ch.sprite.interruptMotion(); - - ch.move( pos ); - ch.sprite.place( pos ); - - if (ch.invisible == 0) { - ch.sprite.alpha( 0 ); - ch.sprite.parent.add( new AlphaTweener( ch.sprite, 1, 0.4f ) ); - } - - ch.sprite.emitter().start( Speck.factory(Speck.LIGHT), 0.2f, 3 ); - Sample.INSTANCE.play( Assets.SND_TELEPORT ); - } - - @Override - public int price() { - return isKnown() ? 30 * quantity : super.price(); - } -} diff --git a/java/com/hmdzl/spspd/change/items/scrolls/ScrollOfTerror.java b/java/com/hmdzl/spspd/change/items/scrolls/ScrollOfTerror.java deleted file mode 100644 index 4b2c31ef..00000000 --- a/java/com/hmdzl/spspd/change/items/scrolls/ScrollOfTerror.java +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.scrolls; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Haste; -import com.hmdzl.spspd.change.actors.buffs.Invisibility; -import com.hmdzl.spspd.change.actors.buffs.Paralysis; -import com.hmdzl.spspd.change.actors.buffs.Terror; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.effects.Flare; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.utils.GLog; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.noosa.audio.Sample; - -public class ScrollOfTerror extends Scroll { - - { - //name = "Scroll of Terror"; - consumedValue = 5; - initials = 13; - } - - @Override - public void doRead() { - - new Flare(5, 32).color(0xFF0000, true).show(curUser.sprite, 2f); - Sample.INSTANCE.play(Assets.SND_READ); - Invisibility.dispel(); - - int count = 0; - Mob affected = null; - for (Mob mob : Dungeon.level.mobs.toArray(new Mob[0])) { - if (Level.fieldOfView[mob.pos]) { - Buff.affect(mob, Terror.class, Terror.DURATION).object = curUser - .id(); - Buff.affect(mob, Haste.class, Terror.DURATION*.5f); - - count++; - affected = mob; - } - } - - switch (count) { - case 0: - GLog.i(Messages.get(this, "none")); - break; - case 1: - GLog.i(Messages.get(this, "one", affected.name)); - break; - default: - GLog.i(Messages.get(this, "many") ); - } - setKnown(); - - readAnimation(); - } - - @Override - public void empoweredRead() { - doRead(); - for (Mob mob : Dungeon.level.mobs.toArray( new Mob[0] )) { - if (Level.fieldOfView[mob.pos]) { - Terror t = mob.buff(Terror.class); - if (t != null){ - Buff.prolong(mob, Terror.class, Terror.DURATION*1.5f); - Buff.affect(mob, Paralysis.class, Terror.DURATION*.5f); - Buff.affect(mob, Haste.class, Terror.DURATION*.5f); - } - } - } - } - - @Override - public int price() { - return isKnown() ? 30 * quantity : super.price(); - } -} diff --git a/java/com/hmdzl/spspd/change/items/scrolls/ScrollOfUpgrade.java b/java/com/hmdzl/spspd/change/items/scrolls/ScrollOfUpgrade.java deleted file mode 100644 index 9509009a..00000000 --- a/java/com/hmdzl/spspd/change/items/scrolls/ScrollOfUpgrade.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.scrolls; - -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.utils.GLog; -import com.hmdzl.spspd.change.windows.WndBag; -import com.hmdzl.spspd.change.messages.Messages; - -public class ScrollOfUpgrade extends InventoryScroll { - - { - //name = "Scroll of Upgrade"; - //inventoryTitle = "Select an item to upgrade"; - mode = WndBag.Mode.UPGRADEABLE; - consumedValue = 15; - initials = 14; - - - } - - @Override - protected void onItemSelected(Item item) { - - ScrollOfRemoveCurse.uncurse(Dungeon.hero, item); - item.upgrade(); - - upgrade(curUser); - //GLog.p(Messages.get(this, "looks_better", item.name())); - readAnimation(); - Badges.validateItemLevelAquired(item); - } - - public static void upgrade(Hero hero) { - hero.sprite.emitter().start(Speck.factory(Speck.UP), 0.2f, 3); - } - - @Override - public void empoweredRead() { - //does nothing for now, this should never happen. - } - - @Override - public int price() { - return 100 * quantity; - } -} diff --git a/java/com/hmdzl/spspd/change/items/skills/ClassSkill.java b/java/com/hmdzl/spspd/change/items/skills/ClassSkill.java deleted file mode 100644 index 6ee1b573..00000000 --- a/java/com/hmdzl/spspd/change/items/skills/ClassSkill.java +++ /dev/null @@ -1,242 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.skills; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Invisibility; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.KindOfArmor; -import com.hmdzl.spspd.change.items.bags.Bag; -import com.hmdzl.spspd.change.items.misc.Jumpshoes; -import com.hmdzl.spspd.change.items.wands.Wand; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.utils.GLog; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.windows.WndBag; -import com.hmdzl.spspd.change.windows.WndItem; -import com.watabou.utils.Bundle; - -import static com.hmdzl.spspd.change.Dungeon.hero; - -abstract public class ClassSkill extends Item { - - private static final String AC_CHOOSE = "CHOOSE"; - - private static final String AC_SPECIAL = "SPECIAL"; - private static final String AC_SPECIAL_TWO = "SPECIAL_TWO"; - private static final String AC_SPECIAL_THREE = "SPECIAL_THREE"; - private static final String AC_SPECIAL_FOUR = "SPECIAL_FOUR"; - //private static int SKILL_TIME = 1; - public float colddown = 0f; - public static int charge = 0; - protected SkillCharger skillcharger; - - { - defaultAction = AC_CHOOSE; - unique = true; - } - - public static ClassSkill upgrade(Hero owner) { - - ClassSkill classSkill = null; - - switch (owner.heroClass) { - case WARRIOR: - classSkill = new WarriorSkill(); - break; - case ROGUE: - classSkill = new RogueSkill(); - break; - case MAGE: - classSkill = new MageSkill(); - break; - case HUNTRESS: - classSkill = new HuntressSkill(); - break; - case PERFORMER: - classSkill = new PerformerSkill(); - break; - case SOLDIER: - classSkill = new SoldierSkill(); - break; - case FOLLOWER: - classSkill = new FollowerSkill(); - break; - } - classSkill.charge = 0; - return classSkill; - } - - @Override - public boolean collect( Bag container ) { - if (super.collect( container )) { - if (container.owner != null) { - charge( container.owner ); - } - return true; - } else { - return false; - } - } - - public void charge( Char owner ) { - if (skillcharger == null) skillcharger = new SkillCharger(); - skillcharger.attachTo( owner ); - } - - @Override - public void onDetach( ) { - stopCharging(); - } - - public void stopCharging() { - if (skillcharger != null) { - skillcharger.detach(); - skillcharger = null; - } - } - - private static final String COLDDOWN = "colddown"; - private static final String CHARGE = "charge"; - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(COLDDOWN, colddown); - bundle.put(CHARGE, charge); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - colddown = bundle.getInt(COLDDOWN); - charge = bundle.getInt(CHARGE); - } - - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions(hero); - actions.remove(AC_DROP); - actions.remove(AC_THROW); - if (colddown < 1){ - actions.add(AC_SPECIAL); - actions.add(AC_SPECIAL_TWO); - actions.add(AC_SPECIAL_THREE); - actions.add(AC_SPECIAL_FOUR); - } - - return actions; - } - - @Override - public void execute(Hero hero, String action) { - - if (action.equals( AC_CHOOSE )){ - - GameScene.show(new WndItem(null, this, true)); - - } else if (action.equals(AC_SPECIAL)) { - curUser = hero; - Invisibility.dispel(); - doSpecial(); - } else if (action.equals(AC_SPECIAL_TWO)) { - curUser = hero; - Invisibility.dispel(); - doSpecial2(); - } else if (action.equals(AC_SPECIAL_THREE)) { - curUser = hero; - Invisibility.dispel(); - doSpecial3(); - } else if (action.equals(AC_SPECIAL_FOUR)) { - curUser = hero; - Invisibility.dispel(); - doSpecial4(); - } else { - super.execute(hero, action); - } - } - - abstract public void doSpecial(); - - abstract public void doSpecial2(); - - abstract public void doSpecial3(); - - abstract public void doSpecial4(); - - @Override - public boolean isUpgradable() { - return false; - } - - @Override - public boolean isIdentified() { - return true; - } - - @Override - public int price() { - return 0; - } - - @Override - public String info() { - String info = desc(); - info += "\n\n" + Messages.get(ClassSkill.class, "charge",charge); - return info; - } - - @Override - public String status() { - return Messages.format("%d", charge); - } - - protected class SkillCharger extends Buff { - - @Override - public boolean attachTo( Char target ) { - super.attachTo( target ); - return true; - } - - @Override - public boolean act() { - if (charge > 0) - gainCharge(); - - if (colddown >= 20 && charge > 0) { - colddown=0; - charge--; - updateQuickslot(); - } - spend( TICK ); - - return true; - } - - private void gainCharge(){ - colddown+= hero.energybase(); - } - - } - -} diff --git a/java/com/hmdzl/spspd/change/items/skills/FollowerSkill.java b/java/com/hmdzl/spspd/change/items/skills/FollowerSkill.java deleted file mode 100644 index c1efa4f6..00000000 --- a/java/com/hmdzl/spspd/change/items/skills/FollowerSkill.java +++ /dev/null @@ -1,157 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.skills; - -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.AttackUp; -import com.hmdzl.spspd.change.actors.buffs.Blindness; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.DefenceUp; -import com.hmdzl.spspd.change.actors.buffs.Disarm; -import com.hmdzl.spspd.change.actors.buffs.Fury; -import com.hmdzl.spspd.change.actors.buffs.BloodImbue; -import com.hmdzl.spspd.change.actors.buffs.Haste; -import com.hmdzl.spspd.change.actors.buffs.Paralysis; -import com.hmdzl.spspd.change.actors.buffs.ParyAttack; -import com.hmdzl.spspd.change.actors.buffs.Silent; -import com.hmdzl.spspd.change.actors.buffs.SpAttack; -import com.hmdzl.spspd.change.actors.buffs.Terror; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.hero.HeroClass; -import com.hmdzl.spspd.change.actors.hero.HeroSubClass; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.actors.mobs.npcs.NPC; -import com.hmdzl.spspd.change.actors.mobs.pets.PET; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfUpgrade; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.mechanics.Ballistica; -import com.hmdzl.spspd.change.scenes.CellSelector; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.windows.WndBag; -import com.watabou.noosa.Camera; -import com.watabou.utils.Callback; -import com.watabou.noosa.audio.Sample; -import com.hmdzl.spspd.change.effects.particles.ElmoParticle; -import com.watabou.utils.PathFinder; -import com.watabou.utils.Random; - -import java.util.HashMap; - - -public class FollowerSkill extends ClassSkill { - private static final String TXT_VALUE = "%+d"; - private static int SKILL_TIME = 1; - { - //name = "follower cape"; - image = ItemSpriteSheet.ARMOR_FOLLOWER; - } - - private HashMap targets = new HashMap(); - - @Override - public void doSpecial() { - curUser.spend(SKILL_TIME); - curUser.sprite.operate(curUser.pos); - curUser.busy(); - curUser.sprite.centerEmitter().start(ElmoParticle.FACTORY, 0.15f, 4); - Sample.INSTANCE.play(Assets.SND_READ); - FollowerSkill.charge += 15; - Buff.affect(curUser, ParyAttack.class); - } - - @Override - public void doSpecial2() { - - curUser.spend(SKILL_TIME); - curUser.sprite.operate(curUser.pos); - curUser.busy(); - curUser.sprite.centerEmitter().start(ElmoParticle.FACTORY, 0.15f, 4); - Sample.INSTANCE.play(Assets.SND_READ); - FollowerSkill.charge += 20; - int people = 0; - for (Mob mob : Dungeon.level.mobs) { - mob.beckon(curUser.pos); - if (mob instanceof Mob && !(mob instanceof NPC)){ - people++; - } - } - int goldearn = (int)(people*(Dungeon.hero.lvl/10+100)); - Dungeon.gold+= goldearn; - Dungeon.hero.sprite.showStatus(CharSprite.NEUTRAL, TXT_VALUE, goldearn); - } - - @Override - public void doSpecial3() { - - for (Mob mob : Dungeon.level.mobs) { - if (Level.fieldOfView[mob.pos] && (Dungeon.level.distance(curUser.pos, mob.pos) <= 10)) { - Buff.affect(mob, Terror.class, 10f).object = curUser.id(); - Buff.prolong(mob, Blindness.class, 10f); - } - } - Buff.affect(curUser, Haste.class,20f); - curUser.spend(SKILL_TIME); - curUser.sprite.operate(curUser.pos); - curUser.busy(); - curUser.sprite.centerEmitter().start(ElmoParticle.FACTORY, 0.15f, 4); - Sample.INSTANCE.play(Assets.SND_READ); - FollowerSkill.charge += 10; - } - - @Override - public void doSpecial4() { - GameScene.selectItem(itemSelector, WndBag.Mode.UPGRADEABLE, Messages.get(ScrollOfUpgrade.class,"prompt")); - - } - - private final WndBag.Listener itemSelector = new WndBag.Listener() { - @Override - public void onSelect(Item item) { - if (item != null) { - FollowerSkill.this.upgrade(item); - FollowerSkill.charge += 15; - } - } - }; - private void upgrade(Item item) { - - GLog.w(Messages.get(ScrollOfUpgrade.class,"looks_better", item.name())); - - item.upgrade(1); - item.uncurse(); - - curUser.sprite.operate(curUser.pos); - curUser.sprite.emitter().start(Speck.factory(Speck.UP), 0.2f, 3); - Badges.validateItemLevelAquired(item); - - curUser.spend(1f); - curUser.busy(); - - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/items/skills/HuntressSkill.java b/java/com/hmdzl/spspd/change/items/skills/HuntressSkill.java deleted file mode 100644 index 6fde96f6..00000000 --- a/java/com/hmdzl/spspd/change/items/skills/HuntressSkill.java +++ /dev/null @@ -1,197 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.skills; - -import java.util.ArrayList; -import java.util.HashMap; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.buffs.FireImbue; -import com.hmdzl.spspd.change.actors.buffs.Frost; -import com.hmdzl.spspd.change.actors.buffs.GrowSeed; -import com.hmdzl.spspd.change.actors.buffs.Needling; -import com.hmdzl.spspd.change.actors.buffs.Roots; -import com.hmdzl.spspd.change.actors.buffs.TargetShoot; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.hero.HeroClass; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.MindVision; -import com.hmdzl.spspd.change.actors.buffs.EarthImbue; -import com.hmdzl.spspd.change.actors.buffs.Awareness; -import com.hmdzl.spspd.change.actors.buffs.BerryRegeneration; -import com.hmdzl.spspd.change.actors.hero.HeroSubClass; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.actors.mobs.npcs.Mtree; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.artifacts.DriedRose; -import com.hmdzl.spspd.change.items.summon.FairyCard; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.sprites.MissileSprite; -import com.hmdzl.spspd.change.utils.GLog; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.utils.Callback; -import com.hmdzl.spspd.change.effects.particles.ElmoParticle; -import com.watabou.utils.PathFinder; -import com.watabou.utils.Random; -import com.watabou.noosa.audio.Sample; - -public class HuntressSkill extends ClassSkill { - private static int SKILL_TIME = 1; - { - //name = "huntress cloak"; - image = ItemSpriteSheet.ARMOR_HUNTRESS; - } - - @Override - public void doSpecial() { - - /*Item proto = new Shuriken(); - - for (Mob mob : Dungeon.level.mobs) { - if (Level.fieldOfView[mob.pos]) { - - Callback callback = new Callback() { - @Override - public void call() { - curUser.attack(targets.get(this)); - targets.remove(this); - if (targets.isEmpty()) { - curUser.spendAndNext(curUser.attackDelay()); - } - } - }; - - ((MissileSprite) curUser.sprite.parent - .recycle(MissileSprite.class)).reset(curUser.pos, - mob.pos, proto, callback); - - targets.put(callback, mob); - } - } - - if (targets.size() == 0) { - GLog.w(TXT_NO_ENEMIES); - return; - }*/ - - //curUser.HP -= (curUser.HP / 2); - - HuntressSkill.charge +=10; - - curUser.spend(SKILL_TIME); - curUser.sprite.operate(curUser.pos); - curUser.busy(); - - curUser.sprite.centerEmitter().start(ElmoParticle.FACTORY, 0.15f, 4); - Sample.INSTANCE.play(Assets.SND_READ); - - switch(Random.Int(4)){ - case 0: - Buff.affect(curUser, FireImbue.class).set(30f); - break; - case 1: - Buff.affect(curUser, EarthImbue.class,30); - break; - case 2: - Buff.affect(curUser, Awareness.class,10); - break; - case 3: - Buff.affect(curUser, BerryRegeneration.class).level(curUser.HP/2); - break; - } - } - - @Override - public void doSpecial2() { - - HuntressSkill.charge +=10; - - curUser.spend(SKILL_TIME); - curUser.sprite.operate(curUser.pos); - curUser.busy(); - - curUser.sprite.centerEmitter().start(ElmoParticle.FACTORY, 0.15f, 4); - Sample.INSTANCE.play(Assets.SND_READ); - - Buff.affect(curUser, TargetShoot.class,20f); - - Buff.affect(curUser, Needling.class,20f); - - } - - @Override - public void doSpecial3() { - - curUser.spend(SKILL_TIME); - curUser.sprite.operate(curUser.pos); - curUser.busy(); - - curUser.sprite.centerEmitter().start(ElmoParticle.FACTORY, 0.15f, 4); - Sample.INSTANCE.play(Assets.SND_READ); - - ArrayList spawnPoints = new ArrayList(); - for (int i = 0; i < PathFinder.NEIGHBOURS8.length; i++) { - int p = curUser.pos + PathFinder.NEIGHBOURS8[i]; - if (Actor.findChar(p) == null && (Level.passable[p] || Level.avoid[p])) { - spawnPoints.add(p); - } - } - - if (spawnPoints.size() > 0) { - FairyCard.Fairy fairy = new FairyCard.Fairy(); - fairy.pos = Random.element(spawnPoints); - GameScene.add(fairy); - HuntressSkill.charge +=15; - } else { - GLog.i( Messages.get(this, "no_space") ); - } - } - @Override - public void doSpecial4() { - - for (Mob mob : Dungeon.level.mobs) { - if (Level.fieldOfView[mob.pos] && (Dungeon.level.distance(curUser.pos, mob.pos) <= 10)) { - Buff.prolong(mob, Roots.class, 8); - Buff.affect(mob, GrowSeed.class); - } - } - for (int i = 0; i < (Dungeon.hero.lvl)/15; i++){ - Mtree tree = new Mtree(); - tree.state = tree.WANDERING; - tree.pos = Dungeon.level.randomRespawnCellFish(); - GameScene.add(tree); - tree.beckon(Dungeon.hero.pos); - } - - - HuntressSkill.charge += 15; - - curUser.spend(SKILL_TIME); - curUser.sprite.operate(curUser.pos); - curUser.busy(); - - curUser.sprite.centerEmitter().start(ElmoParticle.FACTORY, 0.15f, 4); - Sample.INSTANCE.play(Assets.SND_READ); - - } - -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/items/skills/MageSkill.java b/java/com/hmdzl/spspd/change/items/skills/MageSkill.java deleted file mode 100644 index 53a550d1..00000000 --- a/java/com/hmdzl/spspd/change/items/skills/MageSkill.java +++ /dev/null @@ -1,158 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.skills; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.ResultDescriptions; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Burning; -import com.hmdzl.spspd.change.actors.buffs.CountDown; -import com.hmdzl.spspd.change.actors.buffs.Disarm; -import com.hmdzl.spspd.change.actors.buffs.Frost; -import com.hmdzl.spspd.change.actors.buffs.Recharging; -import com.hmdzl.spspd.change.actors.buffs.Shocked; -import com.hmdzl.spspd.change.actors.buffs.Slow; -import com.hmdzl.spspd.change.actors.buffs.Ooze; -import com.hmdzl.spspd.change.actors.buffs.Roots; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.hero.HeroClass; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.particles.ElmoParticle; -import com.hmdzl.spspd.change.effects.particles.EnergyParticle; -import com.hmdzl.spspd.change.effects.particles.SmokeParticle; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.Terrain; -import com.hmdzl.spspd.change.scenes.CellSelector; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.ui.QuickSlotButton; -import com.hmdzl.spspd.change.utils.GLog; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Random; - -public class MageSkill extends ClassSkill { - private static int SKILL_TIME = 1; - { - //name = "mage robe"; - image = ItemSpriteSheet.ARMOR_MAGE; - } - - @Override - public void doSpecial() { - - for (Mob mob : Dungeon.level.mobs) { - if (Level.fieldOfView[mob.pos] && (Dungeon.level.distance(curUser.pos, mob.pos) <= 10)) { - Buff.affect(mob, Burning.class).reignite(mob); - Buff.affect(mob, Ooze.class); - Buff.affect(mob, Slow.class, 8); - Buff.prolong(mob, Roots.class, 3); - } - } - - MageSkill.charge += 15; - - curUser.spend(SKILL_TIME); - curUser.sprite.operate(curUser.pos); - curUser.busy(); - - curUser.sprite.centerEmitter().start(ElmoParticle.FACTORY, 0.15f, 4); - Sample.INSTANCE.play(Assets.SND_READ); - - } - - @Override - public void doSpecial2() { - for (Mob mob : Dungeon.level.mobs) { - if (Level.fieldOfView[mob.pos] && (Dungeon.level.distance(curUser.pos, mob.pos) <= 10)) { - Buff.affect(mob, CountDown.class); - for (int n : Level.NEIGHBOURS4) { - int c = mob.pos + n; - if (c >= 0 && c < Level.getLength()) { - if (Dungeon.visible[c]) { - CellEmitter.get(c).burst(SmokeParticle.FACTORY, 2); - } - if (Dungeon.level.map[c] == Terrain.WALL && Level.insideMap(c)) { - Level.set(c, Terrain.EMPTY); - GameScene.updateMap(c); - Dungeon.observe(); - } - } - } - } - } - - MageSkill.charge += 15; - - curUser.spend(SKILL_TIME); - curUser.sprite.operate(curUser.pos); - curUser.busy(); - - curUser.sprite.centerEmitter().start(ElmoParticle.FACTORY, 0.15f, 4); - Sample.INSTANCE.play(Assets.SND_READ); - - } - - @Override - public void doSpecial3() { - - for (Mob mob : Dungeon.level.mobs) { - if (Level.fieldOfView[mob.pos] && (Dungeon.level.distance(curUser.pos, mob.pos) <= 10)) { - int dmg = (int) (Dungeon.hero.lvl * (1 + 0.1 * Dungeon.hero.magicSkill())) ; - mob.damage(Math.min(mob.HP-10,mob.HT/10 + dmg), this ); - Buff.prolong(mob, Frost.class, 8); - } - } - - MageSkill.charge += 15; - - curUser.spend(SKILL_TIME); - curUser.sprite.operate(curUser.pos); - curUser.busy(); - - curUser.sprite.centerEmitter().start(ElmoParticle.FACTORY, 0.15f, 4); - Sample.INSTANCE.play(Assets.SND_READ); - - } - - @Override - public void doSpecial4() { - for (Mob mob : Dungeon.level.mobs) { - if (Level.fieldOfView[mob.pos] && (Dungeon.level.distance(curUser.pos, mob.pos) <= 4)) { - Buff.prolong(mob, Shocked.class, 8); - } - } - - Buff.affect(curUser, Recharging.class, 30); - MageSkill.charge += 9; - - curUser.spend(SKILL_TIME); - curUser.sprite.operate(curUser.pos); - curUser.busy(); - - curUser.sprite.centerEmitter().start(ElmoParticle.FACTORY, 0.15f, 4); - Sample.INSTANCE.play(Assets.SND_READ); - - } - - -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/items/skills/PerformerSkill.java b/java/com/hmdzl/spspd/change/items/skills/PerformerSkill.java deleted file mode 100644 index 15715c84..00000000 --- a/java/com/hmdzl/spspd/change/items/skills/PerformerSkill.java +++ /dev/null @@ -1,268 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.skills; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.buffs.Amok; -import com.hmdzl.spspd.change.actors.buffs.ArmorBreak; -import com.hmdzl.spspd.change.actors.buffs.AttackUp; -import com.hmdzl.spspd.change.actors.buffs.Blindness; -import com.hmdzl.spspd.change.actors.buffs.Charm; -import com.hmdzl.spspd.change.actors.buffs.DefenceUp; -import com.hmdzl.spspd.change.actors.buffs.Haste; -import com.hmdzl.spspd.change.actors.buffs.HighVoice; -import com.hmdzl.spspd.change.actors.buffs.Rhythm; -import com.hmdzl.spspd.change.actors.buffs.Rhythm2; -import com.hmdzl.spspd.change.actors.buffs.WarGroove; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.Generator; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.armor.Armor; -import com.hmdzl.spspd.change.items.artifacts.Artifact; -import com.hmdzl.spspd.change.items.rings.Ring; -import com.hmdzl.spspd.change.items.wands.Wand; -import com.hmdzl.spspd.change.items.weapon.melee.MeleeWeapon; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.windows.WndBag; -import com.hmdzl.spspd.change.effects.particles.ElmoParticle; -import com.watabou.noosa.audio.Sample; - -public class PerformerSkill extends ClassSkill { - private static int SKILL_TIME = 1; - { - //name = "performer cloak"; - image = ItemSpriteSheet.ARMOR_PERFORMER; - } - - @Override - public void doSpecial() { - - for (Mob mob : Dungeon.level.mobs) { - if (Level.fieldOfView[mob.pos]) { - Buff.affect(mob, Charm.class,Charm.durationFactor(mob)*5f).object = curUser.id(); - mob.sprite.centerEmitter().start(Speck.factory(Speck.HEART),0.2f, 5); - Buff.affect(mob, Amok.class, 10f); - Buff.prolong(mob, Haste.class, 5f); - Buff.prolong(mob, ArmorBreak.class, 20f).level(50); - } - } - PerformerSkill.charge += 20; - Buff.affect(curUser, DefenceUp.class,10).level(25); - Buff.affect(curUser, AttackUp.class,10).level(25); - curUser.spend(SKILL_TIME); - curUser.sprite.operate(curUser.pos); - curUser.busy(); - - curUser.sprite.centerEmitter().start(ElmoParticle.FACTORY, 0.15f, 4); - Sample.INSTANCE.play(Assets.SND_READ); - } - - @Override - public void doSpecial2() { - - int DMG = Dungeon.hero.lvl; - - if (curUser.buff(Rhythm.class) != null) { - DMG = (int)(DMG*1.5); - Buff.detach(curUser, Rhythm.class); - } - if (curUser.buff(Rhythm2.class) != null) { - DMG = (int)(DMG*1.5); - Buff.detach(curUser, Rhythm2.class); - } - if (curUser.buff(WarGroove.class) != null) { - DMG = (int)(DMG*1.5); - Buff.detach(curUser, WarGroove.class); - } - - for (Mob mob : Dungeon.level.mobs) { - if (Level.fieldOfView[mob.pos]) { - mob.sprite.centerEmitter().start(Speck.factory(Speck.HEART),0.2f, 5); - mob.damage(Math.min(DMG,mob.HP - 10),this); - Buff.prolong(mob, Blindness.class, 10f); - } - } - PerformerSkill.charge += 20; - - curUser.spend(SKILL_TIME); - curUser.sprite.operate(curUser.pos); - curUser.busy(); - curUser.sprite.centerEmitter().start(ElmoParticle.FACTORY, 0.15f, 4); - Sample.INSTANCE.play(Assets.SND_READ); - } - - @Override - public void doSpecial3() { - GameScene.selectItem(itemSelector, WndBag.Mode.TRANMSUTABLE, Messages.get(PerformerSkill.class, "prompt")); - } - - @Override - public void doSpecial4() { - - PerformerSkill.charge +=10; - - Buff.affect(curUser, HighVoice.class,100); - curUser.spend(SKILL_TIME); - curUser.sprite.operate(curUser.pos); - curUser.busy(); - - curUser.sprite.centerEmitter().start(ElmoParticle.FACTORY, 0.15f, 4); - Sample.INSTANCE.play(Assets.SND_READ); - } - - private final WndBag.Listener itemSelector = new WndBag.Listener() { - @Override - public void onSelect(Item item) { - curUser = Dungeon.hero; - Item result; - if (item != null) { - if (item instanceof MeleeWeapon) { - result = changeWeapon((MeleeWeapon) item); - } else if (item instanceof Armor) { - result = changeArmor((Armor) item); - } else if (item instanceof Ring) { - result = changeRing((Ring) item); - } else if (item instanceof Wand) { - result = changeWand((Wand) item); - } else if (item instanceof Artifact) { - result = changeArtifact((Artifact) item); - } else { - result = null; - } - item.detach(Dungeon.hero.belongings.backpack); - Dungeon.level.drop(result, Dungeon.hero.pos).sprite.drop(); - PerformerSkill.charge += 20; - } - } - }; - private MeleeWeapon changeWeapon(MeleeWeapon w) { - - MeleeWeapon n; - do { - n = (MeleeWeapon) Generator.random(Generator.Category.MELEEWEAPON); - } while (n.getClass() == w.getClass()); - - n.level = 0; - - int level = w.level; - if (level > 0) { - n.upgrade(level); - } else if (level < 0) { - n.degrade(-level); - } - - n.enchantment = w.enchantment; - n.reinforced = w.reinforced; - n.levelKnown = w.levelKnown; - n.cursedKnown = w.cursedKnown; - n.cursed = w.cursed; - - return n; - - } - - private Armor changeArmor(Armor r) { - Armor n; - do { - n = (Armor) Generator.random(Generator.Category.ARMOR); - } while (n.getClass() == r.getClass()); - - n.level = 0; - - int level = r.level; - if (level > 0) { - n.upgrade(level); - } else if (level < 0) { - n.degrade(-level); - } - n.glyph = r.glyph; - n.reinforced = r.reinforced; - n.levelKnown = r.levelKnown; - n.cursedKnown = r.cursedKnown; - n.cursed = r.cursed; - - return n; - } - - - private Ring changeRing(Ring r) { - Ring n; - do { - n = (Ring) Generator.random(Generator.Category.RING); - } while (n.getClass() == r.getClass()); - - n.level = 0; - - int level = r.level; - if (level > 0) { - n.upgrade(level); - } else if (level < 0) { - n.degrade(-level); - } - n.reinforced = r.reinforced; - n.levelKnown = r.levelKnown; - n.cursedKnown = r.cursedKnown; - n.cursed = r.cursed; - - return n; - } - - private Artifact changeArtifact(Artifact a) { - Artifact n; - do { - n = (Artifact) Generator.random(Generator.Category.ARTIFACT); - } while (n.getClass() == a.getClass()); - - if (n != null) { - n.cursedKnown = a.cursedKnown; - n.cursed = a.cursed; - n.levelKnown = a.levelKnown; - n.transferUpgrade(a.visiblyUpgraded()); - } - - return n; - } - - private Wand changeWand(Wand w) { - - Wand n; - do { - n = (Wand) Generator.random(Generator.Category.WAND); - } while (n.getClass() == w.getClass()); - - n.level = 0; - n.updateLevel(); - n.upgrade(w.level); - - n.reinforced = w.reinforced; - n.levelKnown = w.levelKnown; - n.cursedKnown = w.cursedKnown; - n.cursed = w.cursed; - - return n; - } - -} - diff --git a/java/com/hmdzl/spspd/change/items/skills/RogueSkill.java b/java/com/hmdzl/spspd/change/items/skills/RogueSkill.java deleted file mode 100644 index a33b8858..00000000 --- a/java/com/hmdzl/spspd/change/items/skills/RogueSkill.java +++ /dev/null @@ -1,168 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.skills; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.buffs.ArmorBreak; -import com.hmdzl.spspd.change.actors.buffs.AttackUp; -import com.hmdzl.spspd.change.actors.buffs.Blindness; -import com.hmdzl.spspd.change.actors.buffs.Burning; -import com.hmdzl.spspd.change.actors.buffs.Disarm; -import com.hmdzl.spspd.change.actors.buffs.GoldTouch; -import com.hmdzl.spspd.change.actors.buffs.HighAttack; -import com.hmdzl.spspd.change.actors.buffs.Ooze; -import com.hmdzl.spspd.change.actors.buffs.Roots; -import com.hmdzl.spspd.change.actors.buffs.Silent; -import com.hmdzl.spspd.change.actors.buffs.Slow; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.hero.HeroClass; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Strength; -import com.hmdzl.spspd.change.actors.buffs.Haste; -import com.hmdzl.spspd.change.actors.buffs.Invisibility; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.wands.WandOfBlood; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.scenes.CellSelector; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.audio.Sample; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.effects.particles.ElmoParticle; -import com.watabou.utils.Random; - -public class RogueSkill extends ClassSkill { - private static int SKILL_TIME = 1; - { - //name = "rogue garb"; - image = ItemSpriteSheet.ARMOR_ROGUE; - } - - @Override - public void doSpecial() { - //GameScene.selectCell(teleporter); - RogueSkill.charge += 10; - - curUser.spend(SKILL_TIME); - curUser.sprite.operate(curUser.pos); - curUser.busy(); - - curUser.sprite.centerEmitter().start(ElmoParticle.FACTORY, 0.15f, 4); - Sample.INSTANCE.play(Assets.SND_READ); - Buff.affect(curUser, Invisibility.class,20); - - switch (Random.Int(3)){ - case 0: - Buff.affect(curUser, Strength.class); - break; - case 1: - Buff.affect(curUser, Haste.class,15); - break; - case 2: - Buff.affect(curUser, AttackUp.class,15).level(50); - break; - case 3: - break; - } - } - - @Override - public void doSpecial2() { - RogueSkill.charge += 20; - - curUser.spend(SKILL_TIME); - curUser.sprite.operate(curUser.pos); - curUser.busy(); - - curUser.sprite.centerEmitter().start(ElmoParticle.FACTORY, 0.15f, 4); - Sample.INSTANCE.play(Assets.SND_READ); - Buff.affect(curUser, GoldTouch.class,15f); - } - - @Override - public void doSpecial3() { - - for (Mob mob : Dungeon.level.mobs) { - if (Level.fieldOfView[mob.pos] && (Dungeon.level.distance(curUser.pos, mob.pos) <= 10)) { - Buff.affect(mob, Silent.class,9999f); - Buff.affect(mob, Disarm.class,5f); - Buff.affect(mob, ArmorBreak.class, 10f).level(50); - Buff.prolong(mob, Blindness.class, 3f); - } - } - - RogueSkill.charge += 20; - - curUser.spend(SKILL_TIME); - curUser.sprite.operate(curUser.pos); - curUser.busy(); - - curUser.sprite.centerEmitter().start(ElmoParticle.FACTORY, 0.15f, 4); - Sample.INSTANCE.play(Assets.SND_READ); - } - - @Override - public void doSpecial4() { - RogueSkill.charge += 20; - - curUser.spend(SKILL_TIME); - curUser.sprite.operate(curUser.pos); - curUser.busy(); - - curUser.sprite.centerEmitter().start(ElmoParticle.FACTORY, 0.15f, 4); - Sample.INSTANCE.play(Assets.SND_READ); - Buff.affect(curUser, HighAttack.class); - } - - /*protected static CellSelector.Listener teleporter = new CellSelector.Listener() { - - @Override - public void onSelect(Integer target) { - if (target != null) { - - if (!Level.fieldOfView[target] - || !(Level.passable[target] || Level.avoid[target]) - || Actor.findChar(target) != null) { - - GLog.w(TXT_FOV); - return; - } - - curUser.HP -= (curUser.HP / 5); - - ScrollOfTeleportation.appear(curUser, target); - CellEmitter.get(target).burst(Speck.factory(Speck.WOOL), 10); - Sample.INSTANCE.play(Assets.SND_PUFF); - Dungeon.level.press(target, curUser); - Dungeon.observe(); - - curUser.spendAndNext(SKILL_TIME); - } - } - - @Override - public String prompt() { - return "Choose a location to jump to"; - } - };*/ -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/items/skills/SoldierSkill.java b/java/com/hmdzl/spspd/change/items/skills/SoldierSkill.java deleted file mode 100644 index aa2b4759..00000000 --- a/java/com/hmdzl/spspd/change/items/skills/SoldierSkill.java +++ /dev/null @@ -1,339 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.skills; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.HashSet; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.ToxicGas; -import com.hmdzl.spspd.change.actors.buffs.Amok; -import com.hmdzl.spspd.change.actors.buffs.ArmorBreak; -import com.hmdzl.spspd.change.actors.buffs.AttackUp; -import com.hmdzl.spspd.change.actors.buffs.Bless; -import com.hmdzl.spspd.change.actors.buffs.Burning; -import com.hmdzl.spspd.change.actors.buffs.Charm; -import com.hmdzl.spspd.change.actors.buffs.Chill; -import com.hmdzl.spspd.change.actors.buffs.Cripple; -import com.hmdzl.spspd.change.actors.buffs.DefenceUp; -import com.hmdzl.spspd.change.actors.buffs.FireImbue; -import com.hmdzl.spspd.change.actors.buffs.Haste; -import com.hmdzl.spspd.change.actors.buffs.MechArmor; -import com.hmdzl.spspd.change.actors.buffs.Ooze; -import com.hmdzl.spspd.change.actors.buffs.Poison; -import com.hmdzl.spspd.change.actors.buffs.Roots; -import com.hmdzl.spspd.change.actors.buffs.ShieldArmor; -import com.hmdzl.spspd.change.actors.buffs.Slow; -import com.hmdzl.spspd.change.actors.buffs.Terror; -import com.hmdzl.spspd.change.actors.buffs.Weakness; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.hero.HeroAction; -import com.hmdzl.spspd.change.actors.hero.HeroClass; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.MindVision; -import com.hmdzl.spspd.change.actors.buffs.EarthImbue; -import com.hmdzl.spspd.change.actors.buffs.Awareness; -import com.hmdzl.spspd.change.actors.buffs.BerryRegeneration; -import com.hmdzl.spspd.change.actors.hero.HeroSubClass; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.actors.mobs.npcs.MirrorImage; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.Generator; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.bombs.DungeonBomb; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfTeleportation; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.sprites.MissileSprite; -import com.hmdzl.spspd.change.sprites.SeekingBombSprite; -import com.hmdzl.spspd.change.sprites.SeekingClusterBombSprite; -import com.hmdzl.spspd.change.utils.GLog; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.utils.Callback; -import com.hmdzl.spspd.change.effects.particles.ElmoParticle; -import com.watabou.utils.Random; -import com.watabou.noosa.audio.Sample; - -public class SoldierSkill extends ClassSkill { - private static int SKILL_TIME = 1; - { - image = ItemSpriteSheet.ARMOR_SOLDIER; - } - - @Override - public void doSpecial() { - - ArrayList respawnPoints = new ArrayList(); - - for (int i = 0; i < Level.NEIGHBOURS8.length; i++) { - int p = curUser.pos + Level.NEIGHBOURS8[i]; - if (Actor.findChar(p) == null - && (Level.passable[p] || Level.avoid[p])) { - respawnPoints.add(p); - } - } - - int nImages = 4; - while (nImages > 0 && respawnPoints.size() > 0) { - int index = Random.index(respawnPoints); - - MirrorImage mob = new MirrorImage(); - mob.duplicate(curUser); - GameScene.add(mob); - ScrollOfTeleportation.appear(mob, respawnPoints.get(index)); - - respawnPoints.remove(index); - nImages--; - } - SoldierSkill.charge += 12; - Buff.detach(curUser, Poison.class); - Buff.detach(curUser, Cripple.class); - Buff.detach(curUser, Weakness.class); - Buff.detach(curUser, Burning.class); - Buff.detach(curUser, Ooze.class); - Buff.detach(curUser, Chill.class); - Buff.affect(curUser, Bless.class, 5f); - curUser.spend(SKILL_TIME); - curUser.sprite.operate(curUser.pos); - curUser.busy(); - - curUser.sprite.centerEmitter().start(ElmoParticle.FACTORY, 0.15f, 4); - Sample.INSTANCE.play(Assets.SND_READ); - } - - @Override - public void doSpecial2() { - SoldierSkill.charge += 25; - Buff.affect(curUser, MechArmor.class).level(250); - Buff.affect(curUser, ShieldArmor.class).level(Dungeon.hero.lvl*3); - curUser.spend(SKILL_TIME); - curUser.sprite.operate(curUser.pos); - curUser.busy(); - - curUser.sprite.centerEmitter().start(ElmoParticle.FACTORY, 0.15f, 4); - Sample.INSTANCE.play(Assets.SND_READ); - } - @Override - public void doSpecial3() { - - ArrayList respawnPoints = new ArrayList(); - - for (int i = 0; i < Level.NEIGHBOURS8.length; i++) { - int p = curUser.pos + Level.NEIGHBOURS8[i]; - if (Actor.findChar(p) == null - && (Level.passable[p] || Level.avoid[p])) { - respawnPoints.add(p); - } - } - - int nImages = 2; - while (nImages > 0 && respawnPoints.size() > 0) { - int index = Random.index(respawnPoints); - SeekingBomb mob = new SeekingBomb(); - SeekingHugeBomb mob2 = new SeekingHugeBomb(); - if (Dungeon.hero.subClass == HeroSubClass.LEADER) { - GameScene.add(mob2); - ScrollOfTeleportation.appear(mob2, respawnPoints.get(index)); - respawnPoints.remove(index); - nImages--; - }else { - GameScene.add(mob); - ScrollOfTeleportation.appear(mob, respawnPoints.get(index)); - respawnPoints.remove(index); - nImages--; - } - } - SoldierSkill.charge += 5; - curUser.spend(SKILL_TIME); - curUser.sprite.operate(curUser.pos); - curUser.busy(); - curUser.sprite.centerEmitter().start(ElmoParticle.FACTORY, 0.15f, 4); - Sample.INSTANCE.play(Assets.SND_READ); - } - - @Override - public void doSpecial4() { - SoldierSkill.charge += 20; - - int cell = Dungeon.level.randomRespawnCell(); - - if (cell != -1) { - Dungeon.level.spdrop(Generator.random(Generator.Category.HIGHFOOD), cell); - Dungeon.level.spdrop(Generator.random(Generator.Category.RANGEWEAPON), cell); - } else { - Dungeon.level.spdrop(Generator.random(Generator.Category.HIGHFOOD), curUser.pos); - Dungeon.level.spdrop(Generator.random(Generator.Category.RANGEWEAPON), curUser.pos); - } - Buff.affect( curUser, Awareness.class, 2f); - curUser.spend(SKILL_TIME); - curUser.sprite.operate(curUser.pos); - curUser.busy(); - curUser.sprite.centerEmitter().start(ElmoParticle.FACTORY, 0.15f, 4); - Sample.INSTANCE.play(Assets.SND_READ); - } - - public static class SeekingBomb extends Mob { - { - spriteClass = SeekingBombSprite.class; - hostile = false; - state = HUNTING; - HP = HT = 1; - evadeSkill = 20; - ally=true; - - properties.add(Property.MECH); - } - @Override - public int attackProc(Char enemy, int damage) { - int dmg = super.attackProc(enemy, damage); - DungeonBomb bomb = new DungeonBomb(); - bomb.explode(pos); - yell("KA-BOOM!!!"); - destroy(); - sprite.die(); - return dmg; - } - - @Override - protected Char chooseEnemy() { - - if (enemy == null || !enemy.isAlive()) { - HashSet enemies = new HashSet(); - for (Mob mob : Dungeon.level.mobs) { - if (mob.hostile && Level.fieldOfView[mob.pos]) { - enemies.add(mob); - } - } - - enemy = enemies.size() > 0 ? Random.element(enemies) : null; - } - - return enemy; - } - - public static SeekingBomb spawnAt(int pos) { - - SeekingBomb b = new SeekingBomb(); - - b.pos = pos; - b.state = b.HUNTING; - GameScene.add(b, 1f); - - return b; - - } - - - @Override - public void die(Object cause) { - DungeonBomb bomb = new DungeonBomb(); - bomb.explode(pos); - super.die(cause); - } - - private static final HashSet> IMMUNITIES = new HashSet>(); - static { - IMMUNITIES.add(Terror.class); - IMMUNITIES.add(ToxicGas.class); - } - - @Override - public HashSet> immunities() { - return IMMUNITIES; - } - } - public static class SeekingHugeBomb extends Mob { - { - spriteClass = SeekingClusterBombSprite.class; - hostile = false; - state = HUNTING; - HP = HT = 1; - evadeSkill = 20; - ally=true; - - properties.add(Property.MECH); - } - @Override - public int attackProc(Char enemy, int damage) { - int dmg = super.attackProc(enemy, damage); - DungeonBomb bomb = new DungeonBomb(); - bomb.explode(pos); - bomb.explode(pos); - yell("KA-BOOM!!!"); - destroy(); - sprite.die(); - return dmg; - } - - @Override - protected Char chooseEnemy() { - - if (enemy == null || !enemy.isAlive()) { - HashSet enemies = new HashSet(); - for (Mob mob : Dungeon.level.mobs) { - if (mob.hostile && Level.fieldOfView[mob.pos]) { - enemies.add(mob); - } - } - - enemy = enemies.size() > 0 ? Random.element(enemies) : null; - } - - return enemy; - } - - public static SeekingHugeBomb spawnAt(int pos) { - - SeekingHugeBomb b = new SeekingHugeBomb(); - - b.pos = pos; - b.state = b.HUNTING; - GameScene.add(b, 1f); - - return b; - - } - - - @Override - public void die(Object cause) { - DungeonBomb bomb = new DungeonBomb(); - bomb.explode(pos); - bomb.explode(pos); - super.die(cause); - } - - private static final HashSet> IMMUNITIES = new HashSet>(); - static { - IMMUNITIES.add(Terror.class); - IMMUNITIES.add(ToxicGas.class); - } - - @Override - public HashSet> immunities() { - return IMMUNITIES; - } - } -} - diff --git a/java/com/hmdzl/spspd/change/items/skills/WarriorSkill.java b/java/com/hmdzl/spspd/change/items/skills/WarriorSkill.java deleted file mode 100644 index fa404d20..00000000 --- a/java/com/hmdzl/spspd/change/items/skills/WarriorSkill.java +++ /dev/null @@ -1,187 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.skills; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.AttackUp; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.DefenceUp; -import com.hmdzl.spspd.change.actors.buffs.Disarm; -import com.hmdzl.spspd.change.actors.buffs.Fury; -import com.hmdzl.spspd.change.actors.buffs.BloodImbue; -import com.hmdzl.spspd.change.actors.buffs.Paralysis; -import com.hmdzl.spspd.change.actors.buffs.ShieldArmor; -import com.hmdzl.spspd.change.actors.buffs.Silent; -import com.hmdzl.spspd.change.actors.buffs.SpAttack; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.hero.HeroClass; -import com.hmdzl.spspd.change.actors.hero.HeroSubClass; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.actors.mobs.pets.PET; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.mechanics.Ballistica; -import com.hmdzl.spspd.change.scenes.CellSelector; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.noosa.Camera; -import com.watabou.utils.Callback; -import com.watabou.noosa.audio.Sample; -import com.hmdzl.spspd.change.effects.particles.ElmoParticle; -import com.watabou.utils.PathFinder; -import com.watabou.utils.Random; - -import java.util.HashMap; - - -public class WarriorSkill extends ClassSkill { - private static int SKILL_TIME = 1; - { - //name = "warrior suit of armor"; - image = ItemSpriteSheet.ARMOR_WARRIOR; - } - - private HashMap targets = new HashMap(); - - @Override - public void doSpecial() { - curUser.spend(SKILL_TIME); - curUser.sprite.operate(curUser.pos); - curUser.busy(); - curUser.sprite.centerEmitter().start(ElmoParticle.FACTORY, 0.15f, 4); - Sample.INSTANCE.play(Assets.SND_READ); - Buff.prolong(curUser, BloodImbue.class,30f); - WarriorSkill.charge += 10; - } - - @Override - public void doSpecial2() { - - for (Mob mob : Dungeon.level.mobs) { - if (Level.fieldOfView[mob.pos]) { - if (Dungeon.level.distance(curUser.pos, mob.pos) <= 3){ - Buff.affect(mob, AttackUp.class).level(10); - } else { - Buff.affect(mob, Disarm.class, curUser.STR); - Buff.affect(mob, Silent.class, curUser.STR); - } - } - } - WarriorSkill.charge += 15; - curUser.spend(SKILL_TIME); - curUser.sprite.operate(curUser.pos); - curUser.busy(); - curUser.sprite.centerEmitter().start(ElmoParticle.FACTORY, 0.15f, 4); - Sample.INSTANCE.play(Assets.SND_READ); - Buff.prolong(curUser, DefenceUp.class,targets.size()*5f).level(50); - } - - @Override - public void doSpecial3() { - - for (Mob mob : Dungeon.level.mobs) { - if (mob instanceof PET) { - mob.HP += (int)mob.HT/2; - } - } - Buff.affect(curUser,ShieldArmor.class).level(curUser.HT/2); - for (int i = 0; i < PathFinder.NEIGHBOURS8.length; i++) { - Char mob = Actor.findChar(curUser.pos - + Level.NEIGHBOURS8[i]); - if (mob != null && mob != curUser && !(mob instanceof PET ) ) { - mob.damage((int)curUser.HT/2, this); - } - - } - - WarriorSkill.charge += 25; - curUser.spend(SKILL_TIME); - curUser.sprite.operate(curUser.pos); - curUser.busy(); - curUser.sprite.centerEmitter().start(ElmoParticle.FACTORY, 0.15f, 4); - Sample.INSTANCE.play(Assets.SND_READ); - Buff.prolong(curUser, DefenceUp.class,targets.size()*5f).level(50); - } - - @Override - public void doSpecial4() { - curUser.spend(SKILL_TIME); - curUser.sprite.operate(curUser.pos); - curUser.busy(); - curUser.sprite.centerEmitter().start(ElmoParticle.FACTORY, 0.15f, 4); - Sample.INSTANCE.play(Assets.SND_READ); - Buff.prolong(curUser, SpAttack.class,30f); - WarriorSkill.charge += 8; - } - - /*protected static CellSelector.Listener leaper = new CellSelector.Listener() { - - @Override - public void onSelect(Integer target) { - if (target != null && target != curUser.pos) { - - int cell = Ballistica.cast(curUser.pos, target, false, true); - if (Actor.findChar(cell) != null && cell != curUser.pos) { - cell = Ballistica.trace[Ballistica.distance - 2]; - } - - curUser.HP -= (curUser.HP / 3); - if (curUser.subClass == HeroSubClass.BERSERKER - && curUser.HP <= curUser.HT * Fury.LEVEL) { - Buff.affect(curUser, Fury.class); - } - - final int dest = cell; - curUser.busy(); - curUser.sprite.jump(curUser.pos, cell, new Callback() { - @Override - public void call() { - curUser.move(dest); - Dungeon.level.press(dest, curUser); - Dungeon.observe(); - - for (int i = 0; i < Level.NEIGHBOURS8.length; i++) { - Char mob = Actor.findChar(curUser.pos - + Level.NEIGHBOURS8[i]); - if (mob != null && mob != curUser) { - Buff.prolong(mob, EnchantmentEnergy.class, SHOCK_TIME); - } - } - - CellEmitter.center(dest).burst( - Speck.factory(Speck.DUST), 10); - Camera.main.shake(2, 0.5f); - - curUser.spendAndNext(LEAP_TIME); - } - }); - } - } - - @Override - public String prompt() { - return "Choose direction to leap"; - } - };*/ -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/items/summon/ActiveMrDestructo.java b/java/com/hmdzl/spspd/change/items/summon/ActiveMrDestructo.java deleted file mode 100644 index 22359299..00000000 --- a/java/com/hmdzl/spspd/change/items/summon/ActiveMrDestructo.java +++ /dev/null @@ -1,464 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.summon; - -import java.util.ArrayList; -import java.util.HashSet; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.ResultDescriptions; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.ToxicGas; -import com.hmdzl.spspd.change.actors.buffs.Terror; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.hero.HeroSubClass; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.particles.PurpleParticle; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.weapon.enchantments.EnchantmentDark; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.mechanics.Ballistica; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.sprites.MrDestructo2dot0Sprite; -import com.hmdzl.spspd.change.sprites.MrDestructoSprite; -import com.watabou.utils.Random; - -public class ActiveMrDestructo extends Item { - - { - //name = "mr destructo"; - image = ItemSpriteSheet.ACTIVEMRD; - defaultAction = AC_ACTIVE; - stackable = true; - } - - - private static boolean activate = false; - - private static final String AC_ACTIVE = "ACTIVE"; - - - - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions(hero); - actions.add(AC_ACTIVE); - return actions; - } - - @Override - public void execute(Hero hero, String action) { - if (action.equals(AC_ACTIVE)) { - activate = true; - action = AC_THROW; - } else - activate = false; - - super.execute(hero, action); - } - - @Override - protected void onThrow(int cell) { - - if (Actor.findChar(cell) != null) { - ArrayList candidates = new ArrayList<>(); - for (int i : Level.NEIGHBOURS8) - if (Level.passable[cell + i]) - candidates.add(cell + i); - int newCell = candidates.isEmpty() ? cell : Random - .element(candidates); - - if (!Level.pit[newCell] && activate) { - if (Dungeon.hero.subClass == HeroSubClass.LEADER){ - MrDestructo2dot0.spawnAt(newCell); - } else MrDestructo.spawnAt(newCell); - } else { - Dungeon.level.drop(this, newCell).sprite.drop(cell); - } - - } else if (!Level.pit[cell] && activate) { - if (Dungeon.hero.subClass == HeroSubClass.LEADER){ - MrDestructo2dot0.spawnAt(cell); - } else - MrDestructo.spawnAt(cell); - } else { - - super.onThrow(cell); - } - - } - - - @Override - public boolean isUpgradable() { - return false; - } - - @Override - public boolean isIdentified() { - return true; - } - - @Override - public int price() { - return 100 * quantity; - } - - public static class MrDestructo extends Mob { - - { - spriteClass = MrDestructoSprite.class; - hostile = false; - state = HUNTING; - HP = HT= 100; - evadeSkill = 3; - ally=true; - - properties.add(Property.MECH); - } - - private Ballistica beam; - - private static final float SPAWN_DELAY = 0.1f; - - @Override - public int drRoll() { - return 0; - } - - - @Override - protected boolean act() { - - for (int n : Level.NEIGHBOURS8DIST2) { - int c = pos + n; - if (c0){ - Char ch = Actor.findChar(c); - } - } - //Level.fieldOfView[Dungeon.hero.pos] && - - boolean result = super.act(); - return result; - } - - @Override - public void move(int step) { - } - - @Override - protected Char chooseEnemy() { - - if (enemy == null || !enemy.isAlive()) { - HashSet enemies = new HashSet(); - for (Mob mob : Dungeon.level.mobs) { - if (mob.hostile && Level.fieldOfView[mob.pos]) { - enemies.add(mob); - } - } - - enemy = enemies.size() > 0 ? Random.element(enemies) : null; - } - - return enemy; - } - - - - public static MrDestructo spawnAt(int pos) { - - MrDestructo b = new MrDestructo(); - - b.pos = pos; - b.state = b.HUNTING; - GameScene.add(b, SPAWN_DELAY); - - return b; - - } - - private int hitCell; - - @Override - protected boolean canAttack(Char enemy) { - - beam = new Ballistica( pos, enemy.pos, Ballistica.STOP_TERRAIN); - - return beam.subPath(1, beam.dist).contains(enemy.pos); - } - - @Override - public int hitSkill(Char target) { - return 20+(Dungeon.depth); - } - - @Override - protected boolean doAttack(Char enemy) { - - spend(attackDelay()); - - boolean rayVisible = false; - - for (int i : beam.subPath(0, beam.dist)) { - if (Dungeon.visible[i]) { - rayVisible = true; - } - } - - if (rayVisible) { - sprite.attack(beam.collisionPos ); - return false; - } else { - attack(enemy); - return true; - } - } - - @Override - public boolean attack(Char enemy) { - - for (int pos : beam.subPath(1, beam.dist)) { - - Char ch = Actor.findChar(pos); - if (ch == null) { - continue; - } - - if (hit(this, ch, true)) { - ch.damage(Random.NormalIntRange(Dungeon.depth, Dungeon.depth+12), this); - damage(Random.NormalIntRange(5, 10), this); - - if (Dungeon.visible[pos]) { - ch.sprite.flash(); - CellEmitter.center(pos).burst(PurpleParticle.BURST, - Random.IntRange(1, 2)); - } - - if (!ch.isAlive() && ch == Dungeon.hero) { - Dungeon.fail(Messages.format(ResultDescriptions.MOB)); - //GLog.n(Messages.get(this, "kill")); - } - } else { - ch.sprite.showStatus(CharSprite.NEUTRAL, ch.defenseVerb()); - } - } - - return true; - } - - @Override - public void beckon(int cell) { - } - - private static final HashSet> RESISTANCES = new HashSet>(); - static { - RESISTANCES.add(EnchantmentDark.class); - - } - - @Override - public HashSet> resistances() { - return RESISTANCES; - } - - private static final HashSet> IMMUNITIES = new HashSet>(); - static { - IMMUNITIES.add(Terror.class); - IMMUNITIES.add(ToxicGas.class); - } - - @Override - public HashSet> immunities() { - return IMMUNITIES; - } - } - public static class MrDestructo2dot0 extends Mob { - - { - spriteClass = MrDestructo2dot0Sprite.class; - hostile = false; - state = HUNTING; - HP = HT= 200; - evadeSkill = 35; - ally=true; - - properties.add(Property.MECH); - } - - private Ballistica beam; - - private static final float SPAWN_DELAY = 1f; - - @Override - public int drRoll() { - return 0; - } - - - @Override - protected boolean act() { - - for (int n : Level.NEIGHBOURS8DIST2) { - int c = pos + n; - if (c0){ - Char ch = Actor.findChar(c); - } - } - //Level.fieldOfView[Dungeon.hero.pos] && - - boolean result = super.act(); - return result; - } - - @Override - public void move(int step) { - } - - @Override - protected Char chooseEnemy() { - - if (enemy == null || !enemy.isAlive()) { - HashSet enemies = new HashSet(); - for (Mob mob : Dungeon.level.mobs) { - if (mob.hostile && Level.fieldOfView[mob.pos]) { - enemies.add(mob); - } - } - - enemy = enemies.size() > 0 ? Random.element(enemies) : null; - } - - return enemy; - } - - - - public static MrDestructo2dot0 spawnAt(int pos) { - - MrDestructo2dot0 b = new MrDestructo2dot0(); - - b.pos = pos; - b.state = b.HUNTING; - GameScene.add(b, SPAWN_DELAY); - - return b; - - } - - private int hitCell; - - @Override - protected boolean canAttack(Char enemy) { - - beam = new Ballistica( pos, enemy.pos, Ballistica.STOP_TERRAIN); - - return beam.subPath(1, beam.dist).contains(enemy.pos); - } - - @Override - public int hitSkill(Char target) { - return 30+(Dungeon.depth); - } - - @Override - protected boolean doAttack(Char enemy) { - - spend(attackDelay()); - - boolean rayVisible = false; - - for (int i : beam.subPath(0, beam.dist)) { - if (Dungeon.visible[i]) { - rayVisible = true; - } - } - - if (rayVisible) { - sprite.attack( beam.collisionPos ); - return false; - } else { - attack(enemy); - return true; - } - } - - @Override - public boolean attack(Char enemy) { - - for (int pos : beam.subPath(1, beam.dist)) { - - Char ch = Actor.findChar( pos ); - if (ch == null) { - continue; - } - - if (hit(this, ch, true)) { - ch.damage(Random.NormalIntRange(Dungeon.depth+20, Dungeon.depth+32), this); - damage(Random.NormalIntRange(5, 10), this); - - if (Dungeon.visible[pos]) { - ch.sprite.flash(); - CellEmitter.center(pos).burst(PurpleParticle.BURST, - Random.IntRange(1, 2)); - } - - if (!ch.isAlive() && ch == Dungeon.hero) { - Dungeon.fail(Messages.format(ResultDescriptions.MOB)); - //GLog.n(Messages.get(this, "kill")); - } - } else { - ch.sprite.showStatus(CharSprite.NEUTRAL, ch.defenseVerb()); - } - } - - return true; - } - - @Override - public void beckon(int cell) { - } - - private static final HashSet> RESISTANCES = new HashSet>(); - static { - RESISTANCES.add(EnchantmentDark.class); - - } - - @Override - public HashSet> resistances() { - return RESISTANCES; - } - - private static final HashSet> IMMUNITIES = new HashSet>(); - static { - IMMUNITIES.add(Terror.class); - IMMUNITIES.add(ToxicGas.class); - } - - @Override - public HashSet> immunities() { - return IMMUNITIES; - } - } - -} diff --git a/java/com/hmdzl/spspd/change/items/summon/CallCoconut.java b/java/com/hmdzl/spspd/change/items/summon/CallCoconut.java deleted file mode 100644 index 3c599ba4..00000000 --- a/java/com/hmdzl/spspd/change/items/summon/CallCoconut.java +++ /dev/null @@ -1,309 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.summon; - -import java.util.ArrayList; -import java.util.HashSet; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.ResultDescriptions; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.ToxicGas; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Terror; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.hero.HeroSubClass; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.particles.PurpleParticle; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.bombs.BuildBomb; -import com.hmdzl.spspd.change.items.weapon.enchantments.EnchantmentDark; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.mechanics.Ballistica; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.hmdzl.spspd.change.sprites.CoconutSprite; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.sprites.MrDestructo2dot0Sprite; -import com.hmdzl.spspd.change.sprites.MrDestructoSprite; -import com.watabou.utils.Random; - -public class CallCoconut extends Item { - - { - //name = "call coconut"; - image = ItemSpriteSheet.ANCIENTKEY; - defaultAction = AC_ACTIVE; - stackable = true; - } - - - private static boolean activate = false; - - private static final String AC_ACTIVE = "ACTIVE"; - - - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions(hero); - actions.add(AC_ACTIVE); - return actions; - } - - @Override - public void execute(Hero hero, String action) { - if (action.equals(AC_ACTIVE)) { - activate = true; - action = AC_THROW; - } else - activate = false; - - super.execute(hero, action); - } - - @Override - protected void onThrow(int cell) { - - if (Actor.findChar(cell) != null) { - ArrayList candidates = new ArrayList<>(); - for (int i : Level.NEIGHBOURS8) - if (Level.passable[cell + i]) - candidates.add(cell + i); - int newCell = candidates.isEmpty() ? cell : Random - .element(candidates); - - if (!Level.pit[newCell] && activate) { - if (Dungeon.hero.subClass == HeroSubClass.LEADER) { - EXcococat.spawnAt(newCell); - } else Scococat.spawnAt(newCell); - } else { - Dungeon.level.drop(this, newCell).sprite.drop(cell); - } - - } else if (!Level.pit[cell] && activate) { - if (Dungeon.hero.subClass == HeroSubClass.LEADER) { - EXcococat.spawnAt(cell); - } else - Scococat.spawnAt(cell); - } else { - - super.onThrow(cell); - } - - } - - - @Override - public boolean isUpgradable() { - return false; - } - - @Override - public boolean isIdentified() { - return true; - } - - @Override - public int price() { - return 100 * quantity; - } - - public static class Scococat extends Mob { - - { - spriteClass = CoconutSprite.class; - hostile = false; - state = HUNTING; - HP = HT = 200; - evadeSkill = 0; - ally=true; - properties.add(Property.BEAST); - } - - private static final float SPAWN_DELAY = 1f; - - @Override - public int drRoll() { - return 0; - } - - @Override - protected boolean act() { - damage(1, this); - - return super.act(); - } - - @Override - protected Char chooseEnemy() { - - if (enemy == null || !enemy.isAlive()) { - HashSet enemies = new HashSet(); - for (Mob mob : Dungeon.level.mobs) { - if (mob.hostile && Level.fieldOfView[mob.pos]) { - enemies.add(mob); - } - } - - enemy = enemies.size() > 0 ? Random.element(enemies) : null; - } - - return enemy; - } - - - public static Scococat spawnAt(int pos) { - - Scococat b = new Scococat(); - - b.pos = pos; - b.state = b.HUNTING; - GameScene.add(b, SPAWN_DELAY); - - return b; - - } - - @Override - protected boolean canAttack(Char enemy) { - - return Dungeon.level.distance(pos, enemy.pos) <= 4; - - } - - @Override - public int hitSkill(Char target) { - return 40 + (Dungeon.depth); - } - - @Override - public int damageRoll() { - return Random.NormalIntRange(Dungeon.depth + 10, Dungeon.depth + 16); - } - - @Override - public int attackProc(Char enemy, int damage) { - if (Random.Int(10) == 1) { - BuildBomb bomb = new BuildBomb(); - bomb.explode(enemy.pos); - } - - return damage; - } - - @Override - public void add(Buff buff) { - //in other words, can't be directly affected by buffs/debuffs. - } - - } - - public static class EXcococat extends Mob { - - { - spriteClass = CoconutSprite.class; - hostile = false; - state = HUNTING; - HP = HT = 400; - evadeSkill = 20; - ally=true; - - properties.add(Property.BEAST); - } - - private static final float SPAWN_DELAY = 1f; - - @Override - public int drRoll() { - return 0; - } - - @Override - protected boolean act() { - damage(1, this); - - return super.act(); - } - - @Override - protected Char chooseEnemy() { - - if (enemy == null || !enemy.isAlive()) { - HashSet enemies = new HashSet(); - for (Mob mob : Dungeon.level.mobs) { - if (mob.hostile && Level.fieldOfView[mob.pos]) { - enemies.add(mob); - } - } - - enemy = enemies.size() > 0 ? Random.element(enemies) : null; - } - - return enemy; - } - - - public static EXcococat spawnAt(int pos) { - - EXcococat b = new EXcococat(); - - b.pos = pos; - b.state = b.HUNTING; - GameScene.add(b, SPAWN_DELAY); - - return b; - - } - - @Override - protected boolean canAttack(Char enemy) { - - return Dungeon.level.distance(pos, enemy.pos) <= 4; - - } - - @Override - public int hitSkill(Char target) { - return 60 + (Dungeon.depth); - } - - @Override - public int damageRoll() { - return Random.NormalIntRange(Dungeon.depth + 20, Dungeon.depth + 32); - } - - - @Override - public int attackProc(Char enemy, int damage) { - if (Random.Int(5) == 1) { - BuildBomb bomb = new BuildBomb(); - bomb.explode(enemy.pos); - } - - return damage; - } - - @Override - public void add(Buff buff) { - //in other words, can't be directly affected by buffs/debuffs. - } - } -} diff --git a/java/com/hmdzl/spspd/change/items/summon/FairyCard.java b/java/com/hmdzl/spspd/change/items/summon/FairyCard.java deleted file mode 100644 index 0b72ebaf..00000000 --- a/java/com/hmdzl/spspd/change/items/summon/FairyCard.java +++ /dev/null @@ -1,293 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.summon; - -import java.util.ArrayList; -import java.util.HashSet; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.ResultDescriptions; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.ToxicGas; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Terror; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.hero.HeroSubClass; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.effects.particles.PurpleParticle; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.bombs.BuildBomb; -import com.hmdzl.spspd.change.items.weapon.enchantments.EnchantmentDark; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.mechanics.Ballistica; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.hmdzl.spspd.change.sprites.CoconutSprite; -import com.hmdzl.spspd.change.sprites.FairySprite; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.sprites.MrDestructo2dot0Sprite; -import com.hmdzl.spspd.change.sprites.MrDestructoSprite; -import com.hmdzl.spspd.change.sprites.SugarplumFairySprite; -import com.watabou.utils.Random; - -public class FairyCard extends Item { - - { - //name = "FairyCard"; - image = ItemSpriteSheet.FAIRYCARD; - defaultAction = AC_ACTIVE; - stackable = true; - } - - - private static boolean activate = false; - - private static final String AC_ACTIVE = "ACTIVE"; - - - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions(hero); - actions.add(AC_ACTIVE); - return actions; - } - - @Override - public void execute(Hero hero, String action) { - if (action.equals(AC_ACTIVE)) { - activate = true; - action = AC_THROW; - } else - activate = false; - - super.execute(hero, action); - } - - @Override - protected void onThrow(int cell) { - - if (Actor.findChar(cell) != null) { - ArrayList candidates = new ArrayList<>(); - for (int i : Level.NEIGHBOURS8) - if (Level.passable[cell + i]) - candidates.add(cell + i); - int newCell = candidates.isEmpty() ? cell : Random - .element(candidates); - - if (!Level.pit[newCell] && activate) { - if (Dungeon.hero.subClass == HeroSubClass.LEADER) { - SugarplumFairy.spawnAt(newCell); - } else Fairy.spawnAt(newCell); - } else { - Dungeon.level.drop(this, newCell).sprite.drop(cell); - } - - } else if (!Level.pit[cell] && activate) { - if (Dungeon.hero.subClass == HeroSubClass.LEADER) { - SugarplumFairy.spawnAt(cell); - } else - Fairy.spawnAt(cell); - } else { - - super.onThrow(cell); - } - - } - - - @Override - public boolean isUpgradable() { - return false; - } - - @Override - public boolean isIdentified() { - return true; - } - - @Override - public int price() { - return 100 * quantity; - } - - public static class Fairy extends Mob { - - { - spriteClass = FairySprite.class; - hostile = false; - state = HUNTING; - HP = HT = 200; - evadeSkill = 0; - ally=true; - properties.add(Property.BEAST); - } - - private static final float SPAWN_DELAY = 1f; - - @Override - public int drRoll() { - return 0; - } - - @Override - protected boolean act() { - damage(1, this); - - if (Level.adjacent(pos, Dungeon.hero.pos)){ - - int bless = 5; - - Dungeon.hero.sprite.emitter().start(Speck.factory(Speck.HEALING), 0.4f, 1); - Dungeon.hero.sprite.showStatus(CharSprite.POSITIVE,Integer.toString(bless)); - - Dungeon.hero.HP = Math.min(Dungeon.hero.HT, Dungeon.hero.HP+bless); - } - - return super.act(); - } - - @Override - protected boolean getCloser(int target) { - return super.getCloser(Dungeon.hero.pos); - } - - @Override - protected Char chooseEnemy() { - return null; - } - - - public static Fairy spawnAt(int pos) { - - Fairy b = new Fairy(); - - b.pos = pos; - b.state = b.HUNTING; - GameScene.add(b, SPAWN_DELAY); - - return b; - - } - - @Override - public void add(Buff buff) { - //in other words, can't be directly affected by buffs/debuffs. - } - - } - - public static class SugarplumFairy extends Mob { - - { - spriteClass = SugarplumFairySprite.class; - hostile = false; - state = HUNTING; - HP = HT = 400; - evadeSkill = 20; - ally=true; - - properties.add(Property.BEAST); - } - - private static final float SPAWN_DELAY = 1f; - - @Override - public int drRoll() { - return 0; - } - - @Override - protected boolean act() { - damage(1, this); - if (Level.adjacent(pos, Dungeon.hero.pos)){ - - int bless = 5; - - Dungeon.hero.sprite.emitter().start(Speck.factory(Speck.HEALING), 0.4f, 1); - Dungeon.hero.sprite.showStatus(CharSprite.POSITIVE,Integer.toString(bless)); - - Dungeon.hero.HP = Math.min(Dungeon.hero.HT*2, Dungeon.hero.HP+bless); - } - return super.act(); - } - - @Override - protected boolean getCloser(int target) { - if (state == WANDERING - || Level.distance(target, Dungeon.hero.pos) > 6) - this.target = target = Dungeon.hero.pos; - return super.getCloser(target); - } - - @Override - protected Char chooseEnemy() { - - if (enemy == null || !enemy.isAlive()) { - HashSet enemies = new HashSet(); - for (Mob mob : Dungeon.level.mobs) { - if (mob.hostile && Level.fieldOfView[mob.pos]) { - enemies.add(mob); - } - } - - enemy = enemies.size() > 0 ? Random.element(enemies) : null; - } - - return enemy; - } - - - public static SugarplumFairy spawnAt(int pos) { - - SugarplumFairy b = new SugarplumFairy(); - - b.pos = pos; - b.state = b.HUNTING; - GameScene.add(b, SPAWN_DELAY); - - return b; - - } - - @Override - protected boolean canAttack(Char enemy) { - - return Dungeon.level.distance(pos, enemy.pos) <= 4; - - } - - @Override - public int hitSkill(Char target) { - return 60 + (Dungeon.depth); - } - - @Override - public int damageRoll() { - return Random.NormalIntRange(Dungeon.depth + 12, Dungeon.depth + 25); - } - - @Override - public void add(Buff buff) { - //in other words, can't be directly affected by buffs/debuffs. - } - } -} diff --git a/java/com/hmdzl/spspd/change/items/summon/Honeypot.java b/java/com/hmdzl/spspd/change/items/summon/Honeypot.java deleted file mode 100644 index 18d94bb1..00000000 --- a/java/com/hmdzl/spspd/change/items/summon/Honeypot.java +++ /dev/null @@ -1,483 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.summon; - -import java.util.ArrayList; -import java.util.HashSet; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.Statistics; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Amok; -import com.hmdzl.spspd.change.actors.buffs.Poison; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.hero.HeroClass; -import com.hmdzl.spspd.change.actors.hero.HeroSubClass; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.actors.mobs.npcs.NPC; -import com.hmdzl.spspd.change.effects.Pushing; -import com.hmdzl.spspd.change.effects.Splash; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.BeeSprite; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.sprites.SteelBeeSprite; -import com.watabou.noosa.audio.Sample; -import com.watabou.noosa.tweeners.AlphaTweener; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -public class Honeypot extends Item { - - public static final String AC_SHATTER = "SHATTER"; - - { - //name = "honeypot"; - image = ItemSpriteSheet.HONEYPOT; - defaultAction = AC_THROW; - stackable = true; - } - - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions(hero); - actions.add(AC_SHATTER); - return actions; - } - - @Override - public void execute(final Hero hero, String action) { - if (action.equals(AC_SHATTER)) { - - hero.sprite.zap(hero.pos); - - detach(hero.belongings.backpack); - - shatter(hero, hero.pos).collect(); - - hero.next(); - - } else { - super.execute(hero, action); - } - } - - @Override - protected void onThrow(int cell) { - if (Level.pit[cell]) { - super.onThrow(cell); - } else { - Dungeon.level.drop(shatter(null, cell), cell); - } - } - - public Item shatter(Char owner, int pos) { - - if (Dungeon.visible[pos]) { - Sample.INSTANCE.play(Assets.SND_SHATTER); - Splash.at(pos, 0xffd500, 5); - } - - int newPos = pos; - if (Actor.findChar(pos) != null) { - ArrayList candidates = new ArrayList(); - boolean[] passable = Level.passable; - - for (int n : Level.NEIGHBOURS4) { - int c = pos + n; - if (passable[c] && Actor.findChar(c) == null) { - candidates.add(c); - } - } - - newPos = candidates.size() > 0 ? Random.element(candidates) : -1; - } - - if (newPos != -1 ) { - if (Dungeon.hero.subClass == HeroSubClass.LEADER ){ - SteelBee bee = new SteelBee(); - bee.spawn(Dungeon.depth); - bee.HP = bee.HT; - bee.pos = newPos; - - GameScene.add(bee); - Actor.addDelayed(new Pushing(bee, pos, newPos), -1f); - - bee.sprite.alpha(0); - bee.sprite.parent.add(new AlphaTweener(bee.sprite, 1, 0.15f)); - - Sample.INSTANCE.play(Assets.SND_BEE); - return new ShatteredPot(); - } else { - Bee bee = new Bee(); - bee.spawn(Dungeon.depth); - bee.setPotInfo(pos, owner); - bee.HP = bee.HT; - bee.pos = newPos; - - GameScene.add(bee); - Actor.addDelayed(new Pushing(bee, pos, newPos), -1f); - - bee.sprite.alpha(0); - bee.sprite.parent.add(new AlphaTweener(bee.sprite, 1, 0.15f)); - - Sample.INSTANCE.play(Assets.SND_BEE); - return new ShatteredPot().setBee(bee); - } - } else { - return this; - } - } - - @Override - public boolean isUpgradable() { - return false; - } - - @Override - public boolean isIdentified() { - return true; - } - - @Override - public int price() { - return 30 * quantity; - } - - // The bee's broken 'home', all this item does is let its bee know where it - // is, and who owns it (if anyone). - public static class ShatteredPot extends Item { - - { - //name = "shattered honeypot"; - image = ItemSpriteSheet.SHATTPOT; - stackable = false; - } - - private int myBee; - private int beeDepth; - - public Item setBee(Char bee) { - myBee = bee.id(); - beeDepth = Dungeon.depth; - return this; - } - - @Override - public boolean doPickUp(Hero hero) { - if (super.doPickUp(hero)) { - setHolder(hero); - return true; - } else - return false; - } - - @Override - public void doDrop(Hero hero) { - super.doDrop(hero); - updateBee(hero.pos, null); - } - - @Override - protected void onThrow(int cell) { - super.onThrow(cell); - updateBee(cell, null); - } - - public void setHolder(Char holder) { - updateBee(holder.pos, holder); - } - - public void goAway() { - updateBee(-1, null); - } - - private void updateBee(int cell, Char holder) { - // important, as ids are not unique between depths. - if (Dungeon.depth != beeDepth) - return; - - Bee bee = (Bee) Actor.findById(myBee); - if (bee != null) - bee.setPotInfo(cell, holder); - } - - @Override - public boolean isUpgradable() { - return false; - } - - @Override - public boolean isIdentified() { - return true; - } - - private static final String MYBEE = "mybee"; - private static final String BEEDEPTH = "beedepth"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(MYBEE, myBee); - bundle.put(BEEDEPTH, beeDepth); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - myBee = bundle.getInt(MYBEE); - beeDepth = bundle.getInt(BEEDEPTH); - } - } - public static class Bee extends Mob { - - { - spriteClass = BeeSprite.class; - - viewDistance = 4; - - flying = true; - state = WANDERING; - - properties.add(Property.BEAST); - } - - private int level; - - // -1 refers to a pot that has gone missing. - private int potPos; - // -1 for no owner - private int potHolder; - - private static final String LEVEL = "level"; - private static final String POTPOS = "potpos"; - private static final String POTHOLDER = "potholder"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(LEVEL, level); - bundle.put(POTPOS, potPos); - bundle.put(POTHOLDER, potHolder); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - spawn(bundle.getInt(LEVEL)); - potPos = bundle.getInt(POTPOS); - potHolder = bundle.getInt(POTHOLDER); - } - - public void spawn(int level) { - this.level = Math.min(level,Statistics.deepestFloor); - - HT = (20 + level) * 4; - evadeSkill = 9 + level; - } - - public void setPotInfo(int potPos, Char potHolder) { - this.potPos = potPos; - if (potHolder == null) - this.potHolder = -1; - else - this.potHolder = potHolder.id(); - } - - @Override - public int hitSkill(Char target) { - return evadeSkill; - } - - @Override - public int damageRoll() { - return Random.NormalIntRange(HT / 10, HT / 4); - } - - @Override - public int attackProc(Char enemy, int damage) { - if (enemy instanceof Mob) { - ((Mob) enemy).aggro(this); - } - return damage; - } - - @Override - protected Char chooseEnemy() { - // if the pot is no longer present, target the hero - if (potHolder == -1 && potPos == -1) - return Dungeon.hero; - - // if something is holding the pot, target that - else if (Actor.findById(potHolder) != null) - return (Char) Actor.findById(potHolder); - - // if the pot is on the ground - else { - - // if already targeting something, and that thing is still alive and - // near the pot, keeping targeting it. - if (enemy != null && enemy.isAlive() - && Level.distance(enemy.pos, potPos) <= 3) - return enemy; - - // find all mobs near the pot - HashSet enemies = new HashSet(); - for (Mob mob : Dungeon.level.mobs) - if (!(mob instanceof Bee) - && Level.distance(mob.pos, potPos) <= 3 - && (mob.hostile || mob.ally)) - enemies.add(mob); - - // pick one, if there are none, check if the hero is near the pot, - // go for them, otherwise go for nothing. - if (enemies.size() > 0) - return Random.element(enemies); - else - return (Level.distance(Dungeon.hero.pos, potPos) <= 3) ? Dungeon.hero - : null; - } - } - - @Override - protected boolean getCloser(int target) { - if (enemy != null && Actor.findById(potHolder) == enemy) { - target = enemy.pos; - } else if (potPos != -1 - && (state == WANDERING || Level.distance(target, potPos) > 3)) - this.target = target = potPos; - return super.getCloser(target); - } - - private static final HashSet> IMMUNITIES = new HashSet>(); - static { - IMMUNITIES.add(Poison.class); - IMMUNITIES.add(Amok.class); - } - - @Override - public HashSet> immunities() { - return IMMUNITIES; - } - } - public static class SteelBee extends NPC { - - { - //name = "golden bee"; - spriteClass = SteelBeeSprite.class; - - viewDistance = 6; - ally=true; - flying = true; - state = WANDERING; - } - - private int level; - - private static final String LEVEL = "level"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(LEVEL, level); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - spawn(bundle.getInt(LEVEL)); - } - - public void spawn(int level) { - this.level = Math.min(level,Statistics.deepestFloor); - HT = (50 + level) * 4; - evadeSkill = 15 + level; - } - @Override - public int hitSkill(Char target) { - return evadeSkill*2; - } - - @Override - public int damageRoll() { - return Random.NormalIntRange(HT / 8, HT / 2); - } - - @Override - protected boolean canAttack(Char enemy) { - return super.canAttack(enemy); - } - - @Override - protected boolean getCloser(int target) { - if (state == WANDERING - || Level.distance(target, Dungeon.hero.pos) > 6) - this.target = target = Dungeon.hero.pos; - return super.getCloser(target); - } - @Override - protected Char chooseEnemy() { - if (enemy == null || !enemy.isAlive() || state == WANDERING) { - - HashSet enemies = new HashSet(); - for (Mob mob : Dungeon.level.mobs) { - if (mob.hostile && Level.fieldOfView[mob.pos] - && mob.state != mob.PASSIVE) { - enemies.add(mob); - } - } - enemy = enemies.size() > 0 ? Random.element(enemies) : null; - } - return enemy; - } - - @Override - public boolean interact() { - if (Dungeon.level.passable[pos] || Dungeon.hero.flying) { - int curPos = pos; - - moveSprite(pos, Dungeon.hero.pos); - move(Dungeon.hero.pos); - - Dungeon.hero.sprite.move(Dungeon.hero.pos, curPos); - Dungeon.hero.move(curPos); - - Dungeon.hero.spend(1 / Dungeon.hero.speed()); - Dungeon.hero.busy(); - return true; - } else { - return false; - } - } - - private static final HashSet> IMMUNITIES = new HashSet>(); - - static { - IMMUNITIES.add(Poison.class); - } - - @Override - public HashSet> immunities() { - return IMMUNITIES; - } - - } -} diff --git a/java/com/hmdzl/spspd/change/items/summon/Mobile.java b/java/com/hmdzl/spspd/change/items/summon/Mobile.java deleted file mode 100644 index 650027fb..00000000 --- a/java/com/hmdzl/spspd/change/items/summon/Mobile.java +++ /dev/null @@ -1,313 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.summon; - -import java.util.ArrayList; -import java.util.HashSet; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.ResultDescriptions; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.ToxicGas; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Terror; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.hero.HeroSubClass; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.particles.PurpleParticle; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.weapon.enchantments.EnchantmentDark; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.mechanics.Ballistica; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.hmdzl.spspd.change.sprites.ErrorSprite; -import com.hmdzl.spspd.change.sprites.ExMobileSprite; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.sprites.MobileSprite; -import com.hmdzl.spspd.change.sprites.MrDestructo2dot0Sprite; -import com.hmdzl.spspd.change.sprites.MrDestructoSprite; -import com.watabou.utils.Random; - -public class Mobile extends Item { - - { - //name = "mobile key"; - image = ItemSpriteSheet.MOBS; - defaultAction = AC_ACTIVE; - stackable = true; - } - - - private static boolean activate = false; - - private static final String AC_ACTIVE = "ACTIVE"; - - - - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions(hero); - actions.add(AC_ACTIVE); - return actions; - } - - @Override - public void execute(Hero hero, String action) { - if (action.equals(AC_ACTIVE)) { - activate = true; - action = AC_THROW; - } else - activate = false; - - super.execute(hero, action); - } - - @Override - protected void onThrow(int cell) { - - if (Actor.findChar(cell) != null) { - ArrayList candidates = new ArrayList<>(); - for (int i : Level.NEIGHBOURS8) - if (Level.passable[cell + i]) - candidates.add(cell + i); - int newCell = candidates.isEmpty() ? cell : Random - .element(candidates); - - if (!Level.pit[newCell] && activate) { - if (Dungeon.hero.subClass == HeroSubClass.LEADER){ - EXMobileSatellite.spawnAt(newCell); - } else MobileSatellite.spawnAt(newCell); - } else { - Dungeon.level.drop(this, newCell).sprite.drop(cell); - } - - } else if (!Level.pit[cell] && activate) { - if (Dungeon.hero.subClass == HeroSubClass.LEADER){ - EXMobileSatellite.spawnAt(cell); - } else MobileSatellite.spawnAt(cell); - } else { - - super.onThrow(cell); - } - - } - - - @Override - public boolean isUpgradable() { - return false; - } - - @Override - public boolean isIdentified() { - return true; - } - - @Override - public int price() { - return 100 * quantity; - } - - public static class MobileSatellite extends Mob { - - { - spriteClass = MobileSprite.class; - hostile = false; - state = HUNTING; - HP = HT= 100; - evadeSkill = 0; - ally=true; - properties.add(Property.MECH); - } - - private static final float SPAWN_DELAY = 1f; - - @Override - protected float attackDelay() { - return 0.33f; - } - - @Override - public int drRoll() { - return 0; - } - - - @Override - protected boolean act() { - damage(1, this); - return super.act(); - } - - @Override - protected boolean getCloser(int target) { - if (state == WANDERING - || Level.distance(target, Dungeon.hero.pos) > 6) - this.target = target = Dungeon.hero.pos; - return super.getCloser(target); - } - - - @Override - protected Char chooseEnemy() { - - if (enemy == null || !enemy.isAlive()) { - HashSet enemies = new HashSet(); - for (Mob mob : Dungeon.level.mobs) { - if (mob.hostile && Level.fieldOfView[mob.pos]) { - enemies.add(mob); - } - } - - enemy = enemies.size() > 0 ? Random.element(enemies) : null; - } - - return enemy; - } - - - - public static MobileSatellite spawnAt(int pos) { - - MobileSatellite b = new MobileSatellite(); - - b.pos = pos; - b.state = b.HUNTING; - GameScene.add(b, SPAWN_DELAY); - - return b; - - } - - - @Override - protected boolean canAttack(Char enemy) { - return Dungeon.level.distance( pos, enemy.pos ) <= 6 ; - } - - @Override - public int hitSkill(Char target) { - return 30+(Dungeon.depth); - } - - @Override - public int damageRoll() { - return Random.NormalIntRange(HP/8+5, HP/2+10); - } - @Override - public void add( Buff buff ) { - //in other words, can't be directly affected by buffs/debuffs. - } - } - public static class EXMobileSatellite extends Mob { - - { - spriteClass = ExMobileSprite.class; - hostile = false; - state = HUNTING; - HP = HT = 300; - evadeSkill = 35; - ally=true; - properties.add(Property.MECH); - } - - private Ballistica beam; - - private static final float SPAWN_DELAY = 1f; - - @Override - protected float attackDelay() { - return 0.25f; - } - - @Override - public int drRoll() { - return 0; - } - - - @Override - protected boolean act() { - damage(1, this); - return super.act(); - } - - @Override - protected boolean getCloser(int target) { - if (state == WANDERING - || Level.distance(target, Dungeon.hero.pos) > 6) - this.target = target = Dungeon.hero.pos; - return super.getCloser(target); - } - - @Override - protected Char chooseEnemy() { - - if (enemy == null || !enemy.isAlive()) { - HashSet enemies = new HashSet(); - for (Mob mob : Dungeon.level.mobs) { - if (mob.hostile && Level.fieldOfView[mob.pos]) { - enemies.add(mob); - } - } - - enemy = enemies.size() > 0 ? Random.element(enemies) : null; - } - - return enemy; - } - - - public static EXMobileSatellite spawnAt(int pos) { - - EXMobileSatellite b = new EXMobileSatellite(); - - b.pos = pos; - b.state = b.HUNTING; - GameScene.add(b, SPAWN_DELAY); - - return b; - - } - - @Override - protected boolean canAttack(Char enemy) { - return Dungeon.level.distance(pos, enemy.pos) <= 6; - } - - @Override - public int hitSkill(Char target) { - return 60 + (Dungeon.depth); - } - - @Override - public int damageRoll() { - return Random.NormalIntRange(HP / 6 + 10, HP / 2 + 20); - } - - @Override - public void add(Buff buff) { - //in other words, can't be directly affected by buffs/debuffs. - } - - } -} diff --git a/java/com/hmdzl/spspd/change/items/wands/CannonOfMage.java b/java/com/hmdzl/spspd/change/items/wands/CannonOfMage.java deleted file mode 100644 index 18cf44cc..00000000 --- a/java/com/hmdzl/spspd/change/items/wands/CannonOfMage.java +++ /dev/null @@ -1,135 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.wands; - -import android.provider.DocumentsContract; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.DungeonTilemap; -import com.hmdzl.spspd.change.ResultDescriptions; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.ArmorBreak; -import com.hmdzl.spspd.change.actors.buffs.AttackDown; -import com.hmdzl.spspd.change.actors.buffs.Blindness; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Burning; -import com.hmdzl.spspd.change.actors.buffs.Frost; -import com.hmdzl.spspd.change.actors.buffs.Ooze; -import com.hmdzl.spspd.change.actors.buffs.Shocked; -import com.hmdzl.spspd.change.actors.buffs.Strength; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.Beam; -import com.hmdzl.spspd.change.effects.MagicMissile; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.quest.DarkGold; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfUpgrade; -import com.hmdzl.spspd.change.mechanics.Ballistica; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; - -import com.hmdzl.spspd.change.windows.WndBag; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Callback; -import com.watabou.utils.Random; - -public class CannonOfMage extends DamageWand { - - { - image = ItemSpriteSheet.CANNON_OF_MAGE; - collisionProperties = Ballistica.MAGIC_BOLT; - reinforced = true; - } - - public int min(int lvl){ - return 1+lvl; - } - - public int max(int lvl){ - return 5+2*lvl; - } - - @Override - protected void onZap( Ballistica bolt ) { - - Char ch = Actor.findChar(bolt.collisionPos); - if (ch != null) { - - - - if (ch.isAlive()){ - switch (Random.Int(7)) { - case 0: - ch.damage((int) (damageRoll() * (1 + 0.3 * Dungeon.hero.magicSkill())), this); - break; - case 1: - Buff.affect(ch, Burning.class).reignite(ch); - break; - case 2: - Buff.affect(ch, Shocked.class, 5f); - break; - case 3: - Buff.affect(ch, Ooze.class); - break; - case 4: - Buff.affect(ch, Frost.class, 5f); - break; - case 5: - Buff.affect(ch, AttackDown.class, 10f).level(30); - Buff.affect(ch, ArmorBreak.class, 10f).level(30); - break; - case 6: - Buff.prolong(ch, Blindness.class, 5f); - break; - default: - GLog.i("nothing happened"); - break; - } - processSoulMark(ch, chargesPerCast()); - ch.damage((int) (damageRoll() * (1 + 0.5 * Dungeon.hero.magicSkill())), this); - } - } - } - - @Override - protected int initialCharges() { - return 7; - } - - @Override - public Item upgrade() { - - super.upgrade(); - maxCharges = 7; - updateQuickslot(); - return this; - } - - @Override - protected void fx(Ballistica bolt, Callback callback) { - MagicMissile.rainbow(curUser.sprite.parent, curUser.pos, bolt.collisionPos, - callback); - Sample.INSTANCE.play(Assets.SND_ZAP); - } -} diff --git a/java/com/hmdzl/spspd/change/items/wands/DamageWand.java b/java/com/hmdzl/spspd/change/items/wands/DamageWand.java deleted file mode 100644 index 9baf1bfb..00000000 --- a/java/com/hmdzl/spspd/change/items/wands/DamageWand.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * Shattered Pixel Dungeon - * Copyright (C) 2014-2017 Evan Debenham - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ - -package com.hmdzl.spspd.change.items.wands; - -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Recharging; -import com.hmdzl.spspd.change.actors.hero.HeroClass; -import com.hmdzl.spspd.change.actors.hero.HeroSubClass; -import com.hmdzl.spspd.change.items.rings.RingOfMagic; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.utils.Random; - -//for wands that directly damage a target -//wands with AOE effects count here (e.g. fireblast), but wands with indrect damage do not (e.g. venom, transfusion) -public abstract class DamageWand extends Wand{ - - //public int magicLevel = 0; - /*{ - for (Buff buff : curUser.buffs(RingOfMagic.Magic.class)) - magicLevel += Math.min(30,((RingOfMagic.Magic) buff).level); - if (curUser.subClass == HeroSubClass.BATTLEMAGE) - magicLevel += 5; - if (curUser.heroClass == HeroClass.MAGE) - magicLevel += 3; - if (curUser.buff(Recharging.class)!= null) - magicLevel += 10; - }*/ - - - public int min(){ - return min(level()); - } - - public abstract int min(int lvl); - - public int max(){ - return max(level()); - } - - public abstract int max(int lvl); - - public int damageRoll(){ - return Random.NormalIntRange(min(), max()); - } - - public int damageRoll(int lvl){ - return Random.NormalIntRange(min(lvl), max(lvl)); - } - - @Override - public String statsDesc() { - if (levelKnown) - return Messages.get(this, "stats_desc", min(), max()); - else - return Messages.get(this, "stats_desc", min(0), max(0)); - } -} diff --git a/java/com/hmdzl/spspd/change/items/wands/Wand.java b/java/com/hmdzl/spspd/change/items/wands/Wand.java deleted file mode 100644 index e44e56b0..00000000 --- a/java/com/hmdzl/spspd/change/items/wands/Wand.java +++ /dev/null @@ -1,453 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * Shattered Pixel Dungeon - * Copyright (C) 2014-2015 Evan Debenham - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.wands; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Challenges; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.buffs.Blindness; -import com.hmdzl.spspd.change.actors.buffs.Recharging; -import com.hmdzl.spspd.change.actors.buffs.Silent; -import com.hmdzl.spspd.change.actors.buffs.SoulMark; -import com.hmdzl.spspd.change.actors.hero.HeroClass; -import com.hmdzl.spspd.change.actors.hero.HeroSubClass; -import com.hmdzl.spspd.change.items.misc.GnollMark; -import com.hmdzl.spspd.change.items.rings.Ring; -import com.hmdzl.spspd.change.items.rings.RingOfEnergy; -import com.hmdzl.spspd.change.items.rings.RingOfMagic; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.noosa.audio.Sample; -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Invisibility; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.MagicMissile; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.bags.Bag; -import com.hmdzl.spspd.change.mechanics.Ballistica; -import com.hmdzl.spspd.change.scenes.CellSelector; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.ui.QuickSlotButton; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.utils.Bundle; -import com.watabou.utils.Callback; -import com.watabou.utils.Random; - -public abstract class Wand extends Item { - - private static final int USAGES_TO_KNOW = 20; - - public static final String AC_ZAP = "ZAP"; - - private static final float TIME_TO_ZAP = 1f; - - public int maxCharges = initialCharges(); - public int curCharges = maxCharges; - public float partialCharge = 0f; - - protected Charger charger; - - private boolean curChargeKnown = false; - - protected boolean hitChars = true; - - protected int usagesToKnow = USAGES_TO_KNOW; - - protected int collisionProperties = Ballistica.MAGIC_BOLT; - - { - defaultAction = AC_ZAP; - usesTargeting = true; - } - - @Override - public ArrayList actions( Hero hero ) { - ArrayList actions = super.actions( hero ); - if (curCharges > 0 || !curChargeKnown) { - actions.add( AC_ZAP ); - } - - return actions; - } - - @Override - public void execute( Hero hero, String action ) { - if (action.equals( AC_ZAP )) { - if (hero.buff(Silent.class) != null) { - GLog.w(Messages.get(Wand.class, "silent")); - } else { - curUser = hero; - curItem = this; - GameScene.selectCell( zapper ); - } - - } else { - - super.execute( hero, action ); - - } - } - - protected abstract void onZap( Ballistica attack ); - - @Override - public boolean collect( Bag container ) { - if (super.collect( container )) { - if (container.owner != null) { - charge( container.owner ); - } - return true; - } else { - return false; - } - } - - public void charge( Char owner ) { - if (charger == null) charger = new Charger(); - charger.attachTo( owner ); - } - - public void charge( Char owner, float chargeScaleFactor ){ - charge( owner ); - charger.setScaleFactor( chargeScaleFactor ); - } - - protected void processSoulMark(Char target, int chargesUsed){ - if (target != Dungeon.hero && - Dungeon.hero.subClass == HeroSubClass.WARLOCK && - Random.Float() < .15f + (level*chargesUsed*0.03f)){ - SoulMark.prolong(target, SoulMark.class, SoulMark.DURATION + level); - } - } - - @Override - public void onDetach( ) { - stopCharging(); - } - - public void stopCharging() { - if (charger != null) { - charger.detach(); - charger = null; - } - } - - public int level() { - - return level; - } - - @Override - public Item identify() { - - curChargeKnown = true; - super.identify(); - - updateQuickslot(); - - return this; - } - - @Override - public String toString() { - - StringBuilder sb = new StringBuilder( super.toString() ); - - String status = status(); - if (status != null) { - sb.append( " (" + status + ")" ); - } - - return sb.toString(); - } - - @Override - public String info() { - String desc = desc(); - - desc += "\n\n" + statsDesc(); - - if (cursed && cursedKnown) - desc += "\n\n" + Messages.get(Wand.class, "cursed"); - - if(reinforced){ - desc += "\n\n" + Messages.get(Item.class, "reinforced"); - } - - return desc; - } - - public String statsDesc(){ - return Messages.get(this, "stats_desc"); - }; - - @Override - public boolean isIdentified() { - return super.isIdentified() && curChargeKnown; - } - - @Override - public String status() { - if (levelKnown) { - return (curChargeKnown ? curCharges : "?") + "/" + maxCharges; - } else { - return null; - } - } - - @Override - public Item upgrade() { - - super.upgrade(); - - updateLevel(); - curCharges = Math.min( curCharges + 1, maxCharges ); - updateQuickslot(); - - return this; - } - - @Override - public Item degrade() { - super.degrade(); - - updateLevel(); - updateQuickslot(); - - return this; - } - - public void updateLevel() { - maxCharges = - Dungeon.isChallenged(Challenges.ENERGY_LOST)? Math.min( initialCharges() + level, 4 ) : Math.min( initialCharges() + level, 10 ); - curCharges = Math.min( curCharges, maxCharges ); - } - - protected int initialCharges() { - return 2; - } - - protected int chargesPerCast() { - return 1; - } - - protected void fx( Ballistica bolt, Callback callback ) { - MagicMissile.whiteLight( curUser.sprite.parent, bolt.sourcePos, bolt.collisionPos, callback ); - Sample.INSTANCE.play( Assets.SND_ZAP ); - } - - protected void wandUsed() { - curCharges -= chargesPerCast(); - //if (!isIdentified() && usagesToKnow <= 0) { - // identify(); - // GLog.w( Messages.get(Wand.class, "identify", name()) ); - //} else { - if (curUser.heroClass == HeroClass.MAGE) levelKnown = true; - updateQuickslot(); - // } - - if (Dungeon.hero.heroClass == HeroClass.MAGE && Dungeon.hero.subClass == HeroSubClass.BATTLEMAGE){ - curUser.spendAndNext(TIME_TO_ZAP/3); - } else if (Dungeon.hero.heroClass == HeroClass.MAGE ){ - curUser.spendAndNext(TIME_TO_ZAP*2/3); - } else curUser.spendAndNext(TIME_TO_ZAP); - - GnollMark gnollmark = curUser.belongings.getItem(GnollMark.class); - if (gnollmark!=null && gnollmark.charge 0) { - price *= (level + 1); - } else if (level < 0) { - price /= (1 - level); - } - } - if (price < 1) { - price = 1; - } - return price; - } - - private static final String UNFAMILIRIARITY = "unfamiliarity"; - private static final String CUR_CHARGES = "curCharges"; - private static final String CUR_CHARGE_KNOWN = "curChargeKnown"; - private static final String PARTIALCHARGE = "partialCharge"; - - @Override - public void storeInBundle( Bundle bundle ) { - super.storeInBundle( bundle ); - bundle.put( UNFAMILIRIARITY, usagesToKnow ); - bundle.put( CUR_CHARGES, curCharges ); - bundle.put( CUR_CHARGE_KNOWN, curChargeKnown ); - bundle.put( PARTIALCHARGE , partialCharge ); - } - - @Override - public void restoreFromBundle( Bundle bundle ) { - super.restoreFromBundle( bundle ); - if ((usagesToKnow = bundle.getInt( UNFAMILIRIARITY )) == 0) { - usagesToKnow = USAGES_TO_KNOW; - } - curCharges = bundle.getInt( CUR_CHARGES ); - curChargeKnown = bundle.getBoolean( CUR_CHARGE_KNOWN ); - partialCharge = bundle.getFloat( PARTIALCHARGE ); - } - - protected static CellSelector.Listener zapper = new CellSelector.Listener() { - - @Override - public void onSelect( Integer target ) { - - if (target != null) { - - final Wand curWand = (Wand)Wand.curItem; - - final Ballistica shot = new Ballistica( curUser.pos, target, curWand.collisionProperties); - int cell = shot.collisionPos; - - if (target == curUser.pos || cell == curUser.pos) { - GLog.i( Messages.get(Wand.class, "self_target") ); - return; - } - - curUser.sprite.zap(cell); - - //attempts to target the cell aimed at if something is there, otherwise targets the collision pos. - if (Actor.findChar(target) != null) - QuickSlotButton.target(Actor.findChar(target)); - else - QuickSlotButton.target(Actor.findChar(cell)); - - if (curWand.curCharges >= 1) { - - curUser.busy(); - - curWand.fx(shot, new Callback() { - @Override - public void call() { - curWand.onZap(shot); - curWand.wandUsed(); - } - }); - - Invisibility.dispel(); - - } else { - - GLog.w( Messages.get(Wand.class, "fizzles") ); - - } - - } - } - - @Override - public String prompt() { - return Messages.get(Wand.class, "prompt"); - } - }; - - protected class Charger extends Buff { - - private static final float BASE_CHARGE_DELAY = 10f; - private static final float SCALING_CHARGE_ADDITION = 50f; - private static final float NORMAL_SCALE_FACTOR = 0.95f; - - private static final float CHARGE_BUFF_BONUS = 0.25f; - - float scalingFactor = NORMAL_SCALE_FACTOR; - - @Override - public boolean attachTo( Char target ) { - super.attachTo( target ); - - return true; - } - - @Override - public boolean act() { - if (curCharges < maxCharges) - gainCharge(); - - if (partialCharge >= 1 && curCharges < maxCharges) { - partialCharge--; - curCharges++; - updateQuickslot(); - } - - spend( TICK ); - - return true; - } - - private void gainCharge(){ - int missingCharges = maxCharges - curCharges; - - missingCharges += Ring.getBonus(target, RingOfEnergy.Energy.class); - missingCharges = Math.max(0, missingCharges); - if (Dungeon.hero.heroClass==HeroClass.MAGE && Dungeon.skins==2){ - missingCharges+=2; - } - float turnsToCharge = (float) (BASE_CHARGE_DELAY - + (SCALING_CHARGE_ADDITION * Math.pow(scalingFactor, missingCharges))); - partialCharge += 1f/turnsToCharge; - Recharging bonus = target.buff(Recharging.class); - if (bonus != null && bonus.remainder() > 0f){ - partialCharge += CHARGE_BUFF_BONUS * bonus.remainder(); - } - } - - private void setScaleFactor(float value){ - this.scalingFactor = value; - } - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/items/wands/WandOfAcid.java b/java/com/hmdzl/spspd/change/items/wands/WandOfAcid.java deleted file mode 100644 index 5c20824e..00000000 --- a/java/com/hmdzl/spspd/change/items/wands/WandOfAcid.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.wands; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Ooze; -import com.hmdzl.spspd.change.actors.buffs.Strength; -import com.hmdzl.spspd.change.actors.mobs.npcs.NPC; -import com.hmdzl.spspd.change.effects.MagicMissile; -import com.hmdzl.spspd.change.items.Heap; -import com.hmdzl.spspd.change.mechanics.Ballistica; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfTeleportation; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Callback; -import com.watabou.utils.Random; - -import static com.hmdzl.spspd.change.Dungeon.hero; - -public class WandOfAcid extends DamageWand { - - { - image = ItemSpriteSheet.WAND_ACID; - collisionProperties = Ballistica.PROJECTILE; - } - - public int min(int lvl){ - return 2+lvl; - } - - public int max(int lvl){ - return 6+4*lvl; - } - - @Override - protected void onZap( Ballistica bolt ) { - - Heap heap = Dungeon.level.heaps.get(bolt.collisionPos); - if (heap != null) { - heap.poison(); - } - - Char ch = Actor.findChar(bolt.collisionPos); - if (ch != null) { - - processSoulMark(ch, chargesPerCast()); - if (ch.isAlive() && Random.Int(2) == 0){ - Buff.affect(ch, Ooze.class); - } - ch.damage((int)( damageRoll() * (1 + 0.1 * hero.magicSkill())), this); - - - } - } - - @Override - protected void fx(Ballistica bolt, Callback callback) { - MagicMissile.foliage(curUser.sprite.parent, curUser.pos, bolt.collisionPos, - callback); - Sample.INSTANCE.play(Assets.SND_ZAP); - } -} diff --git a/java/com/hmdzl/spspd/change/items/wands/WandOfBlood.java b/java/com/hmdzl/spspd/change/items/wands/WandOfBlood.java deleted file mode 100644 index 06434fff..00000000 --- a/java/com/hmdzl/spspd/change/items/wands/WandOfBlood.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.wands; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.effects.MagicMissile; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.mechanics.Ballistica; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.audio.Sample; -import com.watabou.noosa.tweeners.AlphaTweener; -import com.watabou.utils.Callback; -import com.watabou.utils.Random; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Strength; - -public class WandOfBlood extends DamageWand { - - { - image = ItemSpriteSheet.WAND_BLOOD; - collisionProperties = Ballistica.PROJECTILE; - } - - public int min(int lvl){ - return lvl; - } - - public int max(int lvl){ - return 6+2*lvl; - } - - @Override - protected void onZap(Ballistica bolt) { - Char ch = Actor.findChar(bolt.collisionPos); - if (ch != null) { - - processSoulMark(ch, chargesPerCast()); - - ch.damage((int)( damageRoll() * (1 + 0.1 * Dungeon.hero.magicSkill())), this); - if (curUser.HP < curUser.HT){ - curUser.HP += Math.min(Random.Int(0,damageRoll()),(curUser.HT - curUser.HP));} - } - - } - - - @Override - protected void fx(Ballistica bolt, Callback callback) { - MagicMissile.shadow(curUser.sprite.parent, curUser.pos, bolt.collisionPos, - callback); - Sample.INSTANCE.play(Assets.SND_ZAP); - } - - /*public static void appear(Char ch, int pos) { - - ch.sprite.interruptMotion(); - - ch.move(pos); - ch.sprite.place(pos); - - if (ch.invisible == 0) { - ch.sprite.alpha(0); - ch.sprite.parent.add(new AlphaTweener(ch.sprite, 1, 0.4f)); - } - - ch.sprite.emitter().start(Speck.factory(Speck.LIGHT), 0.2f, 3); - Sample.INSTANCE.play(Assets.SND_TELEPORT); - }*/ -} diff --git a/java/com/hmdzl/spspd/change/items/wands/WandOfCharm.java b/java/com/hmdzl/spspd/change/items/wands/WandOfCharm.java deleted file mode 100644 index efdd8e6a..00000000 --- a/java/com/hmdzl/spspd/change/items/wands/WandOfCharm.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.wands; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Amok; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Charm; -import com.hmdzl.spspd.change.actors.buffs.Vertigo; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.effects.MagicMissile; -import com.hmdzl.spspd.change.mechanics.Ballistica; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Callback; -import com.watabou.utils.Random; - -public class WandOfCharm extends Wand { - - { - image = ItemSpriteSheet.WAND_CHARM; - collisionProperties = Ballistica.PROJECTILE; - } - - @Override - protected void onZap(Ballistica bolt) { - Char ch = Actor.findChar(bolt.collisionPos); - if (ch != null) { - - processSoulMark(ch, chargesPerCast()); - - if (ch == Dungeon.hero) { - Buff.affect(ch, Vertigo.class, Vertigo.duration(ch)); - } else { - Buff.affect(ch, Amok.class, chargesPerCast() + level()); - Buff.affect(ch, Charm.class, Charm.durationFactor(ch) - * Random.IntRange(chargesPerCast(), 3*level())).object = curUser.id(); - ch.sprite.centerEmitter().start(Speck.factory(Speck.HEART), - 0.2f, 5); - Sample.INSTANCE.play(Assets.SND_CHARMS); - } - } - } - - @Override - protected int initialCharges() { - return 1; - } - - @Override - protected int chargesPerCast() { - return Math.max(1, (int)Math.ceil(curCharges*0.5f)); - } - - @Override - protected void fx(Ballistica bolt, Callback callback) { - MagicMissile.purpleLight(curUser.sprite.parent, curUser.pos, bolt.collisionPos, - callback); - Sample.INSTANCE.play(Assets.SND_ZAP); - } -} diff --git a/java/com/hmdzl/spspd/change/items/wands/WandOfDisintegration.java b/java/com/hmdzl/spspd/change/items/wands/WandOfDisintegration.java deleted file mode 100644 index 41b02878..00000000 --- a/java/com/hmdzl/spspd/change/items/wands/WandOfDisintegration.java +++ /dev/null @@ -1,112 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.wands; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.DungeonTilemap; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Strength; -import com.hmdzl.spspd.change.effects.Beam; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.DeathRay; -import com.hmdzl.spspd.change.effects.particles.PurpleParticle; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.Terrain; -import com.hmdzl.spspd.change.mechanics.Ballistica; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.watabou.utils.Callback; -import com.watabou.utils.Random; - -public class WandOfDisintegration extends DamageWand { - - { - - image = ItemSpriteSheet.WAND_DISINTEGRATION; - - collisionProperties = Ballistica.WONT_STOP; - } - - public int min(int lvl){ - return 2+lvl; - } - - public int max(int lvl){ - return 8+4*lvl; - } - - @Override - protected void onZap( Ballistica beam) { - - boolean terrainAffected = false; - - int level = level(); - - int maxDistance = Math.min(distance(), beam.dist); - - ArrayList chars = new ArrayList<>(); - - int terrainPassed = 2, terrainBonus = 0; - for (int c : beam.subPath(1, maxDistance)) { - - Char ch; - if ((ch = Actor.findChar( c )) != null) { - - //we don't want to count passed terrain after the last enemy hit. That would be a lot of bonus levels. - //terrainPassed starts at 2, equivalent of rounding up when /3 for integer arithmetic. - terrainBonus += terrainPassed/3; - terrainPassed = terrainPassed%3; - - chars.add( ch ); - } - - if (Level.solid[c]) - terrainPassed++; - - CellEmitter.center( c ).burst( PurpleParticle.BURST, Random.IntRange( 1, 2 ) ); - } - - if (terrainAffected) { - Dungeon.observe(); - } - - int lvl = Math.max(level - chars.size() , 1); - for (Char ch : chars) { - processSoulMark(ch, chargesPerCast()); - ch.damage( (int)( damageRoll(lvl) * (1 + 0.1 * Dungeon.hero.magicSkill())), this ); - ch.sprite.centerEmitter().burst( PurpleParticle.BURST, Random.IntRange( 1, 2 ) ); - ch.sprite.flash(); - } - } - - private int distance() { - return Math.min(8,level() + 2); - } - - @Override - protected void fx( Ballistica beam, Callback callback ) { - - int cell = beam.path.get(Math.min(beam.dist, distance())); - curUser.sprite.parent.add(new Beam.DeathRay(curUser.sprite.center(), DungeonTilemap.tileCenterToWorld( cell ))); - callback.call(); - } -} diff --git a/java/com/hmdzl/spspd/change/items/wands/WandOfError.java b/java/com/hmdzl/spspd/change/items/wands/WandOfError.java deleted file mode 100644 index 4e0b5985..00000000 --- a/java/com/hmdzl/spspd/change/items/wands/WandOfError.java +++ /dev/null @@ -1,194 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.wands; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.Blob; -import com.hmdzl.spspd.change.actors.blobs.ConfusionGas; -import com.hmdzl.spspd.change.actors.blobs.ParalyticGas; -import com.hmdzl.spspd.change.actors.blobs.Regrowth; -import com.hmdzl.spspd.change.actors.blobs.ToxicGas; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Burning; -import com.hmdzl.spspd.change.actors.buffs.Frost; -import com.hmdzl.spspd.change.actors.buffs.Recharging; -import com.hmdzl.spspd.change.actors.mobs.npcs.NPC; -import com.hmdzl.spspd.change.effects.MagicMissile; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.effects.SpellSprite; -import com.hmdzl.spspd.change.items.bombs.Bomb; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfRecharging; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfTeleportation; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.Terrain; -import com.hmdzl.spspd.change.levels.traps.LightningTrap; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.mechanics.Ballistica; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Callback; -import com.watabou.utils.Random; -import com.hmdzl.spspd.change.actors.buffs.Slow; -import com.hmdzl.spspd.change.actors.buffs.Strength; -import com.watabou.noosa.tweeners.AlphaTweener; - -public class WandOfError extends Wand { - - { - image = ItemSpriteSheet.ERROR_WAND; - - } - - protected void onZap(Ballistica bolt) { - Char ch = Actor.findChar(bolt.collisionPos); - switch (Random.Int(10)){ - case 0: - if (ch == curUser) { - ScrollOfTeleportation.teleportHero(curUser); - - } else if (ch != null && !(ch instanceof NPC)) { - - int count = 10; - int pos; - do { - pos = Dungeon.level.randomRespawnCell(); - if (count-- <= 0) { - break; - } - } while (pos == -1); - - if (pos == -1) { - - GLog.w("In a blink of an eye you were teleported to another location of the level."); - - } else { - - ch.pos = pos; - ch.sprite.place(ch.pos); - ch.sprite.visible = Dungeon.visible[pos]; - GLog.i(curUser.name + " teleported " + ch.name - + " to somewhere");} - } - break; - case 1: - if (ch != null) { - int damage = (ch.HT/4) ; - if (Dungeon.hero.buff(Strength.class) != null) - {damage *= (int) 4f; Buff.detach(Dungeon.hero, Strength.class);} - ch.damage(damage, this); - } - break; - case 2: - if (ch != null) {Buff.affect(ch, Slow.class,10);} - break; - case 3: - if (Ballistica.distance > 9) { - bolt.sourcePos = Ballistica.trace[8]; - } else if (Actor.findChar(bolt.sourcePos) != null && Ballistica.distance > 1) { - bolt.sourcePos = Ballistica.trace[Ballistica.distance - 2]; - } - curUser.sprite.visible = true; - appear(Dungeon.hero, bolt.sourcePos); - Dungeon.observe(); - break; - case 4: - for (int i = 1; i < Ballistica.distance - 1; i++) { - int p = Ballistica.trace[i]; - int c = Dungeon.level.map[p]; - if (c == Terrain.EMPTY || c == Terrain.EMBERS - || c == Terrain.EMPTY_DECO) { - - Level.set(p, Terrain.GRASS); - - } - } - int c = Dungeon.level.map[bolt.collisionPos]; - if (c == Terrain.EMPTY || c == Terrain.EMBERS - || c == Terrain.EMPTY_DECO || c == Terrain.GRASS - || c == Terrain.HIGH_GRASS) { - GameScene.add(Blob.seed(bolt.collisionPos, (level() + 2) * 20, Regrowth.class)); - } - break; - case 5: - switch (Random.Int(3)) { - case 0: - GameScene.add( Blob.seed( bolt.collisionPos, 800, ConfusionGas.class ) ); - break; - case 1: - GameScene.add( Blob.seed( bolt.collisionPos, 500, ToxicGas.class ) ); - break; - case 2: - GameScene.add( Blob.seed( bolt.collisionPos, 200, ParalyticGas.class ) ); - break; - } - break; - case 6: - new Bomb().explode(bolt.collisionPos); - break; - case 7: - new LightningTrap().set( curUser.pos ).activate(curUser); - Buff.prolong(curUser, Recharging.class, 20f); - ScrollOfRecharging.charge(curUser); - SpellSprite.show(curUser, SpellSprite.CHARGE); - break; - case 8: - switch (Random.Int(2)){ - case 0: - if (ch != null) - Buff.affect(ch, Burning.class).reignite(ch); - break; - case 1: - if (ch!= null) - Buff.affect(ch, Frost.class, Frost.duration(ch) * Random.Float(3f, 5f)); - break; - } - break; - default: - GLog.i("nothing happened"); - break; - } - } - - public static void appear(Char ch, int pos) { - - ch.sprite.interruptMotion(); - - ch.move(pos); - ch.sprite.place(pos); - - if (ch.invisible == 0) { - ch.sprite.alpha(0); - ch.sprite.parent.add(new AlphaTweener(ch.sprite, 1, 0.4f)); - } - - ch.sprite.emitter().start(Speck.factory(Speck.LIGHT), 0.2f, 3); - Sample.INSTANCE.play(Assets.SND_TELEPORT); - } - - @Override - protected void fx(Ballistica bolt, Callback callback) { - MagicMissile.rainbow(curUser.sprite.parent, bolt.sourcePos, bolt.collisionPos, callback); - Sample.INSTANCE.play(Assets.SND_ZAP); - } - -} diff --git a/java/com/hmdzl/spspd/change/items/wands/WandOfFirebolt.java b/java/com/hmdzl/spspd/change/items/wands/WandOfFirebolt.java deleted file mode 100644 index b06fdd9e..00000000 --- a/java/com/hmdzl/spspd/change/items/wands/WandOfFirebolt.java +++ /dev/null @@ -1,149 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.wands; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.ResultDescriptions; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.Blob; -import com.hmdzl.spspd.change.actors.blobs.Fire; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Burning; -import com.hmdzl.spspd.change.actors.buffs.Strength; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.MagicMissile; -import com.hmdzl.spspd.change.effects.particles.BlastParticle; -import com.hmdzl.spspd.change.effects.particles.FlameParticle; -import com.hmdzl.spspd.change.effects.particles.SmokeParticle; -import com.hmdzl.spspd.change.items.Heap; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.Terrain; -import com.hmdzl.spspd.change.mechanics.Ballistica; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.utils.GLog; - -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Callback; -import com.watabou.utils.Random; - -public class WandOfFirebolt extends DamageWand { - - { - image = ItemSpriteSheet.WAND_FIREBOLT; - collisionProperties = Ballistica.PROJECTILE; - } - - public int min(int lvl){ - return lvl; - } - - public int max(int lvl){ - return 10+6*lvl; - } - - @Override - protected void onZap( Ballistica bolt) { - - Heap heap = Dungeon.level.heaps.get(bolt.collisionPos); - if (heap != null) { - heap.burn(); - } - - Char ch = Actor.findChar(bolt.collisionPos); - if (ch != null) { - - processSoulMark(ch, chargesPerCast()); - - ch.damage((int)( damageRoll() * (1 + 0.1 * Dungeon.hero.magicSkill())), this); - - - Buff.affect(ch, Burning.class).reignite(ch); - - ch.sprite.emitter().burst(FlameParticle.FACTORY, 5); - - } - - GameScene.add( Blob.seed(bolt.collisionPos, 1, Fire.class ) ); - - - } - - /*public void explode(int cell, int damage) { - // We're blowing up, so no need for a fuse anymore. - - Sample.INSTANCE.play(Assets.SND_BLAST, 2); - - if (Dungeon.visible[cell]) { - CellEmitter.center(cell).burst(BlastParticle.FACTORY, 30); - } - - boolean terrainAffected = false; - for (int n : Level.NEIGHBOURS9) { - int c = cell + n; - if (c >= 0 && c < Level.getLength()) { - if (Dungeon.visible[c]) { - CellEmitter.get(c).burst(SmokeParticle.FACTORY, 4); - } - - if (Level.flamable[c]) { - Level.set(c, Terrain.EMBERS); - GameScene.updateMap(c); - terrainAffected = true; - } - - // destroys items / triggers bombs caught in the blast. - Heap heap = Dungeon.level.heaps.get(c); - if (heap != null) - heap.explode(); - - Char ch = Actor.findChar(c); - if (ch != null) { - // those not at the center of the blast take damage less - // consistently. - int minDamage = c == cell ? Math.round(damage/10) : 1; - int maxDamage = c == cell ? Math.round(damage/4) : Math.round(damage/10); - - int dmg = Random.NormalIntRange(minDamage, maxDamage) - - Math.max(ch.drRoll(),0); - if (dmg > 0) { - ch.damage(dmg, this); - } - - if (ch == Dungeon.hero && !ch.isAlive()) - // constant is used here in the rare instance a player - // is killed by a double bomb. - Dungeon.fail(Messages.format(ResultDescriptions.ITEM,"wand of firebolt")); - } - } - } - - if (terrainAffected) { - Dungeon.observe(); - } - }*/ - - @Override - protected void fx(Ballistica bolt, Callback callback) { - MagicMissile.fire(curUser.sprite.parent, curUser.pos, bolt.collisionPos, callback); - Sample.INSTANCE.play(Assets.SND_ZAP); - } -} diff --git a/java/com/hmdzl/spspd/change/items/wands/WandOfFlock.java b/java/com/hmdzl/spspd/change/items/wands/WandOfFlock.java deleted file mode 100644 index db5e89c1..00000000 --- a/java/com/hmdzl/spspd/change/items/wands/WandOfFlock.java +++ /dev/null @@ -1,247 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.wands; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.MagicalSleep; -import com.hmdzl.spspd.change.actors.buffs.Paralysis; -import com.hmdzl.spspd.change.actors.buffs.Strength; -import com.hmdzl.spspd.change.actors.hero.HeroSubClass; -import com.hmdzl.spspd.change.actors.mobs.FlyingProtector; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.actors.mobs.npcs.NPC; -import com.hmdzl.spspd.change.actors.mobs.npcs.Sheep; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.MagicMissile; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.Heap; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.mechanics.Ballistica; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.BaBaSprite; -import com.hmdzl.spspd.change.sprites.SheepSprite; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.BArray; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Callback; -import com.watabou.utils.PathFinder; -import com.watabou.utils.Random; - -import java.util.HashSet; - -public class WandOfFlock extends Wand { - - { - image = ItemSpriteSheet.WAND_FLOCK; - collisionProperties = Ballistica.PROJECTILE; - } - - @Override - protected void onZap(Ballistica bolt) { - - int level = level(); - - int n = 1; - - if (Actor.findChar( bolt.collisionPos) != null && Ballistica.distance > 2) { - bolt.sourcePos = Ballistica.trace[Ballistica.distance - 2]; - } - - boolean[] passable = BArray.or(Level.passable, Level.avoid, null); - for (Actor actor : Actor.all()) { - if (actor instanceof Char) { - passable[((Char) actor).pos] = false; - } - } - - PathFinder.buildDistanceMap(bolt.collisionPos, passable, n); - int dist = 0; - - if (Actor.findChar(bolt.collisionPos) != null) { - PathFinder.distance[bolt.collisionPos] = Integer.MAX_VALUE; - dist = 1; - } - - float lifespan = 2 + level; - - sheepLabel: for (int i = 0; i < n; i++) { - do { - for (int j = 0; j < Level.getLength(); j++) { - if (PathFinder.distance[j] == dist) { - - if (Dungeon.hero.subClass == HeroSubClass.LEADER && (Dungeon.depth < 51 || Dungeon.depth > 54)){ - MagicBombSheep bsheep = new MagicBombSheep(); - bsheep.pos = j; - GameScene.add(bsheep); - } else { - MagicSheep sheep = new MagicSheep(); - sheep.lifespan = lifespan; - sheep.pos = j; - GameScene.add(sheep); - Dungeon.level.mobPress(sheep); - } - - - CellEmitter.get(j).burst(Speck.factory(Speck.WOOL), 4); - - PathFinder.distance[j] = Integer.MAX_VALUE; - - continue sheepLabel; - } - } - dist++; - } while (dist < n); - } - - if (Dungeon.depth>50 && Dungeon.depth<55){ - int spawnCell = Dungeon.level.randomRespawnCellMob(); - if (spawnCell>0){ - FlyingProtector.spawnAt(spawnCell); - //GLog.w("How dare you violate the magic of this place! "); - GLog.w(Messages.get(this,"guard")); - } - } - - Heap heap = Dungeon.level.heaps.get(bolt.collisionPos); - if (heap != null) {heap.summon();} - } - - @Override - protected void fx(Ballistica bolt, Callback callback) { - MagicMissile.wool(curUser.sprite.parent, curUser.pos, bolt.collisionPos, callback); - Sample.INSTANCE.play(Assets.SND_ZAP); - } - - public static class MagicSheep extends NPC { - - { - spriteClass = SheepSprite.class; - properties.add(Property.UNKNOW); - flying = true; - ally=true; - } - - public float lifespan; - - private boolean initialized = false; - - @Override - protected boolean act() { - if (initialized) { - HP = 0; - - destroy(); - sprite.die(); - - } else { - initialized = true; - /*for (int n : Level.NEIGHBOURS8DIST2) { - Char ch = Actor.findChar(n); - if (ch != null && ch != this && ch.isAlive()) { - Buff.affect(ch, Taunt.class,2f).object = id(); - } - }*/ - spend( lifespan + Random.Float(2) ); - } - return true; - } - - @Override - public void damage( int dmg, Object src ) { - } - - @Override - public boolean interact() { - return false; - } - } - public static class MagicBombSheep extends NPC { - - { - spriteClass = BaBaSprite.class; - HP = HT = 20; - state = HUNTING; - properties.add(Property.UNKNOW); - evadeSkill = 10; - ally=true; - } - - @Override - protected boolean act() { - damage(1,this); - return super.act(); - } - - @Override - public int hitSkill(Char target) { - return 100; - } - - - @Override - public int damageRoll() { - return Random.NormalIntRange(Dungeon.depth+10, Dungeon.depth+20); - } - - @Override - protected Char chooseEnemy() { - - if (enemy == null || !enemy.isAlive()) { - HashSet enemies = new HashSet(); - for (Mob mob : Dungeon.level.mobs) { - if (mob.hostile && Level.fieldOfView[mob.pos]) { - enemies.add(mob); - } - } - - enemy = enemies.size() > 0 ? Random.element(enemies) : null; - } - - return enemy; - } - - @Override - public boolean interact() { - - if (state == SLEEPING) { - state = HUNTING; - } - - int curPos = pos; - - moveSprite(pos, Dungeon.hero.pos); - move(Dungeon.hero.pos); - - Dungeon.hero.sprite.move(Dungeon.hero.pos, curPos); - Dungeon.hero.move(curPos); - - Dungeon.hero.spend(1 / Dungeon.hero.speed()); - Dungeon.hero.busy(); - return true; - } - } - public void add( Buff buff ) { - //in other words, can't be directly affected by buffs/debuffs. - } -} diff --git a/java/com/hmdzl/spspd/change/items/wands/WandOfFlow.java b/java/com/hmdzl/spspd/change/items/wands/WandOfFlow.java deleted file mode 100644 index 48e6cbe4..00000000 --- a/java/com/hmdzl/spspd/change/items/wands/WandOfFlow.java +++ /dev/null @@ -1,238 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.wands; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.DungeonTilemap; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Blindness; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Invisibility; -import com.hmdzl.spspd.change.actors.buffs.Paralysis; -import com.hmdzl.spspd.change.actors.buffs.Wet; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.actors.mobs.npcs.NPC; -import com.hmdzl.spspd.change.actors.mobs.npcs.SheepSokoban; -import com.hmdzl.spspd.change.actors.mobs.npcs.SheepSokobanBlack; -import com.hmdzl.spspd.change.actors.mobs.npcs.SheepSokobanCorner; -import com.hmdzl.spspd.change.actors.mobs.npcs.SheepSokobanStop; -import com.hmdzl.spspd.change.actors.mobs.npcs.SheepSokobanSwitch; -import com.hmdzl.spspd.change.actors.mobs.npcs.Shopkeeper; -import com.hmdzl.spspd.change.effects.Beam; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.effects.MagicMissile; -import com.hmdzl.spspd.change.effects.Pushing; -import com.hmdzl.spspd.change.effects.SpellSprite; -import com.hmdzl.spspd.change.items.Dewdrop; -import com.hmdzl.spspd.change.items.Heap; -import com.hmdzl.spspd.change.items.Heap.Type; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.potions.PotionOfStrength; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfUpgrade; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.Terrain; -import com.hmdzl.spspd.change.mechanics.Ballistica; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Callback; -import com.watabou.utils.PathFinder; -import com.watabou.utils.Random; - -import java.util.ArrayList; - -import static com.hmdzl.spspd.change.Dungeon.hero; - -public class WandOfFlow extends DamageWand { - - { - image = ItemSpriteSheet.WAND_FLOW; - collisionProperties = Ballistica.PROJECTILE; - } - - public int min(int lvl){ - return 1+lvl; - } - - public int max(int lvl){ - return 5+3*lvl; - } - - @Override - protected void onZap(Ballistica beam) { - - ArrayList chars = new ArrayList<>(); - - int damage = (int)( damageRoll() * (1 + 0.1 * hero.magicSkill())); - - Char ch = Actor.findChar(beam.collisionPos); - if (ch != null){ - processSoulMark(ch, chargesPerCast()); - ch.damage(damage, this); - Buff.affect(ch,Wet.class,5f); - if (ch.isAlive() && beam.path.size() > beam.dist+1) { - Ballistica trajectory = new Ballistica(ch.pos, beam.path.get(beam.dist + 1), Ballistica.MAGIC_BOLT); - int strength = Math.min( level() + 3, 5 ); - throwChar(ch, trajectory, strength); - } - } - } - - public static void throwChar(final Char ch, final Ballistica trajectory, int power){ - int dist = Math.min(trajectory.dist, power); - - if (ch.properties().contains(Char.Property.BOSS)) - dist /= 2; - - if (dist == 0 ) return; - - if (Actor.findChar(trajectory.path.get(dist)) != null){ - dist--; - } - if (ch instanceof SheepSokoban || - ch instanceof SheepSokobanCorner || - ch instanceof SheepSokobanStop || - ch instanceof SheepSokobanSwitch || - ch instanceof SheepSokobanBlack) { - dist=1; - } - final int newPos = trajectory.path.get(dist); - - if (newPos == ch.pos) return; - - final int finalDist = dist; - final int initialpos = ch.pos; - - Actor.addDelayed(new Pushing(ch, ch.pos, newPos, new Callback() { - public void call() { - if (initialpos != ch.pos) { - //something cased movement before pushing resolved, cancel to be safe. - ch.sprite.place(ch.pos); - return; - } - ch.pos = newPos; - if (ch instanceof SheepSokoban || - ch instanceof SheepSokobanCorner || - ch instanceof SheepSokobanStop || - ch instanceof SheepSokobanSwitch || - ch instanceof SheepSokobanBlack) { - Dungeon.level.mobPress((NPC) ch); - } else {if (ch.pos == trajectory.collisionPos) { - ch.damage(Random.NormalIntRange((finalDist + 1) / 2, finalDist), this); - Paralysis.prolong(ch, Paralysis.class, Random.NormalIntRange((finalDist + 1) / 2, finalDist)); - } Dungeon.level.press(ch.pos, ch);} - if (ch == hero){ - Dungeon.observe(); - } - } - }), -1); - } - - /*Char ch; - - for (int i = 1; i < Ballistica.distance; i++) { - - int c = Ballistica.trace[i]; - - int before = Dungeon.level.map[c]; - - if ((ch = Actor.findChar(c)) != null) { - - if (i == Ballistica.distance - 1) { - - int level = level(); - int damage= Random.Int(level+3, 6 + level * 3); - Buff.prolong(ch, Wet.class, 5f); - if (Dungeon.hero.buff(Strength.class) != null){ damage *= (int) 4f; Buff.detach(Dungeon.hero, Strength.class);} - ch.damage(damage, this); - - } else { - - int next = Ballistica.trace[i + 1]; - if ((Level.passable[next] || Level.avoid[next]) - && Actor.findChar(next) == null - - && !(ch instanceof SheepSokoban || - ch instanceof SheepSokobanCorner || - ch instanceof SheepSokobanStop || - ch instanceof SheepSokobanSwitch || - ch instanceof SheepSokobanBlack) - - ) { - - if ((ch instanceof SheepSokoban || - ch instanceof SheepSokobanCorner || - ch instanceof SheepSokobanStop || - ch instanceof SheepSokobanSwitch || - ch instanceof SheepSokobanBlack) - && (Dungeon.level.map[next]==Terrain.FLEECING_TRAP || - Dungeon.level.map[next]==Terrain.CHANGE_SHEEP_TRAP)){ - - } else { - processSoulMark(ch, chargesPerCast()); - Buff.prolong(ch, Wet.class, 5f); - Actor.addDelayed(new Pushing(ch, ch.pos, next), -1); - } - - ch.pos = next; - Actor.freeCell(next); - - if (ch instanceof Shopkeeper) - ch.damage(0, this); - - // FIXME - - if (ch instanceof SheepSokoban || - ch instanceof SheepSokobanCorner || - ch instanceof SheepSokobanStop || - ch instanceof SheepSokobanSwitch || - ch instanceof SheepSokobanBlack){ - Dungeon.level.mobPress((NPC) ch); - } else if (ch instanceof Mob && !(ch.properties().contains(Char.Property.IMMOVABLE))){ - Dungeon.level.mobPress((Mob) ch); - - } else { - Dungeon.level.press(ch.pos, ch); - } - - } else { - int level = level(); - int damage= Random.Int(level+3, 6 + level * 3); - Buff.prolong(ch, Wet.class, 5f); - if (Dungeon.hero.buff(Strength.class) != null){ damage *= (int) 4f; Buff.detach(Dungeon.hero, Strength.class);} - ch.damage(damage, this); - - } - } - } - - } - - }*/ - - - @Override - protected void fx( Ballistica beam, Callback callback ) { - - curUser.sprite.parent.add(new Beam.WaterRay(curUser.sprite.center(), DungeonTilemap.tileCenterToWorld(beam.collisionPos ))); - callback.call(); - } - -} diff --git a/java/com/hmdzl/spspd/change/items/wands/WandOfFreeze.java b/java/com/hmdzl/spspd/change/items/wands/WandOfFreeze.java deleted file mode 100644 index 850de820..00000000 --- a/java/com/hmdzl/spspd/change/items/wands/WandOfFreeze.java +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.wands; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Chill; -import com.hmdzl.spspd.change.actors.buffs.Frost; -import com.hmdzl.spspd.change.actors.buffs.Strength; -import com.hmdzl.spspd.change.effects.MagicMissile; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.mechanics.Ballistica; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Callback; -import com.watabou.utils.Random; -import com.hmdzl.spspd.change.items.Heap; - -public class WandOfFreeze extends DamageWand { - - { - image = ItemSpriteSheet.WAND_FREEZE; - collisionProperties = Ballistica.PROJECTILE; - } - - public int min(int lvl){ - return 5+lvl*2; - } - - public int max(int lvl){ - return 10+lvl*4; - } - - @Override - protected void onZap(Ballistica bolt) { - - Char ch = Actor.findChar(bolt.collisionPos); - if (ch != null) { - - int damage = damageRoll(); - - if (ch.buff(Frost.class) != null){ - return; //do nothing, can't affect a frozen target - } - if (ch.buff(Chill.class) != null){ - float chill = ch.buff(Chill.class).cooldown(); - damage = (int)(Math.round(damage * Math.pow(0.9f, chill)) * (1 + 0.1 * Dungeon.hero.magicSkill())); - } else { - ch.sprite.burst( 0xFF99CCFF, level() / 2 + 2 ); - } - - processSoulMark(ch, chargesPerCast()); - ch.damage(damage, this); - - if (ch.isAlive()){ - if (Level.water[ch.pos]){ - //20+(10*level)% chance - if (Random.Int(10) >= 8-level() ) - Buff.affect(ch, Frost.class, Frost.duration(ch)*Random.Float(2f, 4f)); - else - Buff.prolong(ch, Chill.class, 6+level()); - } else { - Buff.prolong(ch, Chill.class, 4+level()); - } - } - - } - - Heap heap = Dungeon.level.heaps.get(bolt.collisionPos); - if (heap != null) { - heap.freeze(); - } - - } - - @Override - protected void fx(Ballistica bolt, Callback callback) { - MagicMissile.coldLight(curUser.sprite.parent, curUser.pos, bolt.collisionPos, - callback); - Sample.INSTANCE.play(Assets.SND_ZAP); - } - -} diff --git a/java/com/hmdzl/spspd/change/items/wands/WandOfLight.java b/java/com/hmdzl/spspd/change/items/wands/WandOfLight.java deleted file mode 100644 index 7268480c..00000000 --- a/java/com/hmdzl/spspd/change/items/wands/WandOfLight.java +++ /dev/null @@ -1,111 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.wands; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.DungeonTilemap; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.Blob; -import com.hmdzl.spspd.change.actors.blobs.Regrowth; -import com.hmdzl.spspd.change.actors.buffs.Blindness; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Light; -import com.hmdzl.spspd.change.actors.buffs.Strength; -import com.hmdzl.spspd.change.effects.Beam; -import com.hmdzl.spspd.change.effects.MagicMissile; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.effects.particles.RainbowParticle; -import com.hmdzl.spspd.change.effects.particles.ShadowParticle; -import com.hmdzl.spspd.change.items.Heap; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.Terrain; -import com.hmdzl.spspd.change.mechanics.Ballistica; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Callback; -import com.watabou.utils.Random; - -public class WandOfLight extends DamageWand { - - { - image = ItemSpriteSheet.WAND_REGROWTH; - collisionProperties = Ballistica.PROJECTILE; - } - - public int min(int lvl){ - return 3+lvl; - } - - public int max(int lvl){ - return 6+4*lvl; - } - - @Override - protected void onZap(Ballistica beam) { - Char ch = Actor.findChar(beam.collisionPos); - if (ch != null) { - - processSoulMark(ch, chargesPerCast()); - affectTarget(ch); - - if (Random.Int(5+level()) >= 3) { - Buff.prolong(ch, Blindness.class, 2f + (level() * 0.34f)); - ch.sprite.emitter().burst(Speck.factory(Speck.LIGHT), 6 ); - } - Buff.prolong( curUser, Light.class, 5f+level()); - } - - Heap heap = Dungeon.level.heaps.get(beam.collisionPos); - if (heap != null) {heap.light();} - } - - private void affectTarget(Char ch){ - int dmg = (int)( damageRoll() * (1 + 0.1 * Dungeon.hero.magicSkill())); - - //three in (5+lvl) chance of failing - if (Random.Int(5+level()) >= 3) { - Buff.prolong(ch, Blindness.class, 2f + (level() * 0.333f)); - ch.sprite.emitter().burst(Speck.factory(Speck.LIGHT), 6 ); - } - - if (ch.properties().contains(Char.Property.DEMONIC) || ch.properties().contains(Char.Property.UNDEAD)){ - ch.sprite.emitter().start( ShadowParticle.UP, 0.05f, 10+level() ); - Sample.INSTANCE.play(Assets.SND_BURNING); - - ch.damage(Math.round(dmg*1.333f), this); - } else { - ch.sprite.centerEmitter().burst( RainbowParticle.BURST, 10+level() ); - - ch.damage(dmg, this); - } - - } - - @Override - protected void fx(Ballistica beam, Callback callback) { - curUser.sprite.parent.add( - new Beam.LightRay(curUser.sprite.center(), DungeonTilemap.tileCenterToWorld(beam.collisionPos))); - callback.call(); - Sample.INSTANCE.play(Assets.SND_ZAP); - } - -} diff --git a/java/com/hmdzl/spspd/change/items/wands/WandOfLightning.java b/java/com/hmdzl/spspd/change/items/wands/WandOfLightning.java deleted file mode 100644 index 3ac82bbb..00000000 --- a/java/com/hmdzl/spspd/change/items/wands/WandOfLightning.java +++ /dev/null @@ -1,141 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.wands; - -import java.util.ArrayList; -import java.util.HashSet; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.ResultDescriptions; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Strength; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Lightning; -import com.hmdzl.spspd.change.effects.particles.SparkParticle; -import com.hmdzl.spspd.change.items.Heap; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.traps.LightningTrap; -import com.hmdzl.spspd.change.mechanics.Ballistica; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; - -import com.watabou.noosa.Camera; -import com.watabou.utils.Callback; -import com.watabou.utils.Random; - -public class WandOfLightning extends DamageWand { - - { - image = ItemSpriteSheet.WAND_LIGHTNING; - collisionProperties = Ballistica.PROJECTILE; - } - - private ArrayList affected = new ArrayList<>(); - - ArrayList arcs = new ArrayList<>(); - - public int min(int lvl){ - return 5+lvl; - } - - public int max(int lvl){ - return Math.round(10 + (lvl * lvl / 4f)); - } - - @Override - protected void onZap( Ballistica bolt ) { - - float multipler = 0.4f + (0.6f/affected.size()); - if (Level.water[bolt.collisionPos]) multipler *= 1.5f; - - int min = 5+level(); - int max = Math.round(10 + (level() * level() / 4f)); - - for (Char ch : affected){ - processSoulMark(ch, chargesPerCast()); - ch.damage((int)((1 + 0.1 * Dungeon.hero.magicSkill()) * Math.round(Random.NormalIntRange(min, max) * multipler)), this); - - if (ch == Dungeon.hero) Camera.main.shake( 2, 0.3f ); - ch.sprite.centerEmitter().burst( SparkParticle.FACTORY, 3 ); - ch.sprite.flash(); - } - // Everything is processed in fx() method - if (!curUser.isAlive()) { - Dungeon.fail(Messages.format(ResultDescriptions.ITEM)); - //GLog.n("You killed yourself with your own Wand of Lightning..."); - } - - - Heap heap = Dungeon.level.heaps.get(bolt.collisionPos); - if (heap != null) {heap.lit();} - } - - private void arc( Char ch ) { - - affected.add( ch ); - - for (int i : Level.NEIGHBOURS8) { - int cell = ch.pos + i; - - Char n = Actor.findChar( cell ); - if (n != null && !affected.contains( n )) { - arcs.add(new Lightning.Arc(ch.pos, n.pos)); - arc(n); - } - } - - if (Level.water[ch.pos] && !ch.flying){ - for (int i : Level.NEIGHBOURS8DIST2) { - int cell = ch.pos + i; - //player can only be hit by lightning from an adjacent enemy. - if (!Level.insideMap(cell) || Actor.findChar(cell) == Dungeon.hero) continue; - - Char n = Actor.findChar( ch.pos + i ); - if (n != null && !affected.contains( n )) { - arcs.add(new Lightning.Arc(ch.pos, n.pos)); - arc(n); - } - } - } - } - - @Override - protected void fx( Ballistica bolt, Callback callback ) { - - affected.clear(); - arcs.clear(); - arcs.add( new Lightning.Arc(bolt.sourcePos, bolt.collisionPos)); - - int cell = bolt.collisionPos; - - Char ch = Actor.findChar( cell ); - if (ch != null) { - arc(ch); - } else { - CellEmitter.center( cell ).burst( SparkParticle.FACTORY, 3 ); - } - - //don't want to wait for the effect before processing damage. - curUser.sprite.parent.add( new Lightning( arcs, null ) ); - callback.call(); - } - -} diff --git a/java/com/hmdzl/spspd/change/items/wands/WandOfMagicMissile.java b/java/com/hmdzl/spspd/change/items/wands/WandOfMagicMissile.java deleted file mode 100644 index 03e7a50b..00000000 --- a/java/com/hmdzl/spspd/change/items/wands/WandOfMagicMissile.java +++ /dev/null @@ -1,190 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.wands; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.DungeonTilemap; -import com.hmdzl.spspd.change.ResultDescriptions; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Strength; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.Beam; -import com.hmdzl.spspd.change.effects.MagicMissile; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.quest.DarkGold; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfUpgrade; -import com.hmdzl.spspd.change.mechanics.Ballistica; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; - -import com.hmdzl.spspd.change.windows.WndBag; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Callback; -import com.watabou.utils.Random; - -public class WandOfMagicMissile extends DamageWand { - - public static final String AC_DISENCHANT = "DISENCHANT"; - - private static final String TXT_SELECT_WAND = "Select a wand to upgrade"; - - private static final String TXT_DISENCHANTED = "you disenchanted the Wand of Magic Missile and used its essence to upgrade your %s"; - - private static final float TIME_TO_DISENCHANT = 2f; - - private boolean disenchantEquipped; - - private float upgradeChance = 0.5f; - - { - image = ItemSpriteSheet.WAND_MAGIC_MISSILE; - collisionProperties = Ballistica.MAGIC_BOLT; - } - - //@Override - //public ArrayList actions(Hero hero) { - // ArrayList actions = super.actions(hero); - // if (level > 0) { - // actions.add(AC_DISENCHANT); - // } - // return actions; - //} - - public int min(int lvl){ - return 2+lvl; - } - - public int max(int lvl){ - return 6+5*lvl; - } - - @Override - protected void onZap( Ballistica bolt ) { - - Char ch = Actor.findChar( bolt.collisionPos ); - if (ch != null) { - - processSoulMark(ch, chargesPerCast()); - ch.damage((int)( damageRoll() * (1 + 0.1 * Dungeon.hero.magicSkill())), this); - - ch.sprite.burst(0xFF99CCFF, 2); - - } - } - - //@Override - //public void execute(Hero hero, String action) { - // if (action.equals(AC_DISENCHANT)) { - - // if (hero.belongings.weapon == this) { - // disenchantEquipped = true; - // hero.belongings.weapon = null; - // updateQuickslot(); - // } else { - // detach(hero.belongings.backpack); - // } - - // curUser = hero; - // GameScene.selectItem(itemSelector, WndBag.Mode.WAND, - // TXT_SELECT_WAND); - - // } else { - - // super.execute(hero, action); - - // } - //} - - @Override - protected int initialCharges() { - return 3; - } - - /*@Override - public String statsDesc() { - /*if (levelKnown) - return Messages.get(this, "stats_desc", min(), max()); - else - return Messages.get(this, "stats_desc", min(0), max(0)); - return Messages.get(this,"stats_desc"); - }*/ - //private final WndBag.Listener itemSelector = new WndBag.Listener() { - // @Override - // public void onSelect(Item item) { - // if (item != null) { - - // Sample.INSTANCE.play(Assets.SND_EVOKE); - // ScrollOfUpgrade.upgrade(curUser); - // evoke(curUser); - - // GLog.w(TXT_DISENCHANTED, item.name()); - - // Dungeon.quickslot.clearItem(WandOfMagicMissile.this); - // WandOfMagicMissile.this.updateQuickslot(); - - // DarkGold gold = Dungeon.hero.belongings.getItem(DarkGold.class); - // if (gold!=null){ - // upgradeChance = (upgradeChance + (gold.quantity()*0.01f)); - // } - - // int i=0; - // while(i - */ -package com.hmdzl.spspd.change.items.wands; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.ResultDescriptions; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Paralysis; -import com.hmdzl.spspd.change.actors.buffs.Strength; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.MagicMissile; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.effects.particles.SmokeParticle; -import com.hmdzl.spspd.change.items.Heap; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.Terrain; -import com.hmdzl.spspd.change.mechanics.Ballistica; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.BArray; -import com.hmdzl.spspd.change.utils.GLog; - -import com.watabou.noosa.Camera; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Callback; -import com.watabou.utils.PathFinder; -import com.watabou.utils.Random; - -public class WandOfMeteorite extends DamageWand { - - { - image = ItemSpriteSheet.WAND_METEORITE; - collisionProperties = Ballistica.PROJECTILE; - } - - public int min(int lvl){ - return lvl; - } - - public int max(int lvl){ - return 12+6*lvl; - } - - - @Override - protected void onZap(Ballistica bolt) { - - Heap heap = Dungeon.level.heaps.get(bolt.collisionPos); - if (heap != null) { - heap.burn(); - } - - Sample.INSTANCE.play(Assets.SND_ROCKS); - - int level = level(); - - Char ch = Actor.findChar(bolt.collisionPos); - if (ch != null) { - - ch.sprite.flash(); - - processSoulMark(ch, chargesPerCast()); - - int damage = (int) (damageRoll() * (1 + 0.1 * Dungeon.hero.magicSkill())); - - ch.damage(damage, this); - - if (ch.isAlive() && Random.Int(2) == 0) { - Buff.prolong(ch, Paralysis.class, Random.IntRange(5, level)); - } - CellEmitter.get(bolt.collisionPos).start(Speck.factory(Speck.ROCK), 0.07f, 5); - Camera.main.shake(3, 0.07f * 3); - } - - - for (int n : Level.NEIGHBOURS9) { - int c = bolt.collisionPos + n; - if (c >= 0 && c < Level.getLength()) { - if (Dungeon.visible[c]) { - CellEmitter.get(c).burst(SmokeParticle.FACTORY, 2); - } - - if (Level.flamable[c]) { - Level.set(c, Terrain.EMBERS); - GameScene.updateMap(c); - } - - // destroys items / triggers bombs caught in the blast. - Char ch2 = Actor.findChar(c); - if (ch2 != null) { - int dmg = (int) (damageRoll() * (1 + 0.1 * Dungeon.hero.magicSkill())* chargesPerCast()/9) ; - if (dmg > 0) { - ch2.damage(dmg, this); - } - } - } - - - if (!curUser.isAlive()) { - Dungeon.fail(Messages.format(ResultDescriptions.ITEM)); - //GLog.n("You killed yourself with your own Wand of Avalanche..."); - } - } - } - - @Override - protected int initialCharges() { - return 1; - } - - @Override - protected int chargesPerCast() { - return Math.max(1, curCharges); - } - - @Override - protected void fx(Ballistica bolt, Callback callback) { - MagicMissile.earth(curUser.sprite.parent, curUser.pos, bolt.collisionPos, callback); - Sample.INSTANCE.play(Assets.SND_ZAP); - } -} diff --git a/java/com/hmdzl/spspd/change/items/wands/WandOfPoison.java b/java/com/hmdzl/spspd/change/items/wands/WandOfPoison.java deleted file mode 100644 index b0d40aad..00000000 --- a/java/com/hmdzl/spspd/change/items/wands/WandOfPoison.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.wands; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Poison; -import com.hmdzl.spspd.change.actors.buffs.Strength; -import com.hmdzl.spspd.change.effects.MagicMissile; -import com.hmdzl.spspd.change.items.Heap; -import com.hmdzl.spspd.change.mechanics.Ballistica; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Callback; - -public class WandOfPoison extends Wand { - - { - image = ItemSpriteSheet.WAND_POISON; - collisionProperties = Ballistica.MAGIC_BOLT; - } - - - - @Override - protected void onZap(Ballistica bolt) { - - Char ch = Actor.findChar(bolt.collisionPos); - if (ch != null) { - - processSoulMark(ch, chargesPerCast()); - - int poisonbase=5; - - Buff.affect(ch, Poison.class).set( - Poison.durationFactor(ch) * (poisonbase + level()*2)); - - } - - Heap heap = Dungeon.level.heaps.get(bolt.collisionPos); - if (heap != null) { - heap.poison(); - } - } - - @Override - protected void fx(Ballistica bolt, Callback callback) { - MagicMissile.poison(curUser.sprite.parent, curUser.pos, bolt.collisionPos, callback); - Sample.INSTANCE.play(Assets.SND_ZAP); - } - -} diff --git a/java/com/hmdzl/spspd/change/items/wands/WandOfTCloud.java b/java/com/hmdzl/spspd/change/items/wands/WandOfTCloud.java deleted file mode 100644 index dfe1019c..00000000 --- a/java/com/hmdzl/spspd/change/items/wands/WandOfTCloud.java +++ /dev/null @@ -1,515 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.wands; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.ResultDescriptions; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.Blob; -import com.hmdzl.spspd.change.actors.blobs.ElectriShock; -import com.hmdzl.spspd.change.actors.blobs.ToxicGas; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Burning; -import com.hmdzl.spspd.change.actors.buffs.MagicalSleep; -import com.hmdzl.spspd.change.actors.buffs.Paralysis; -import com.hmdzl.spspd.change.actors.buffs.Taunt; -import com.hmdzl.spspd.change.actors.hero.HeroSubClass; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.actors.mobs.npcs.NPC; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.MagicMissile; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.effects.particles.EnergyParticle; -import com.hmdzl.spspd.change.effects.particles.SparkParticle; -import com.hmdzl.spspd.change.items.Heap; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.traps.LightningTrap; -import com.hmdzl.spspd.change.mechanics.Ballistica; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.sprites.KeKeSprite; -import com.hmdzl.spspd.change.sprites.TCloudSprite; -import com.hmdzl.spspd.change.utils.BArray; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.Camera; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundle; -import com.watabou.utils.Callback; -import com.watabou.utils.PathFinder; -import com.watabou.utils.Random; - -import java.util.HashSet; - -public class WandOfTCloud extends Wand { - - { - image = ItemSpriteSheet.WAND_TCLOUD; - collisionProperties = Ballistica.PROJECTILE; - } - - @Override - protected void onZap(Ballistica bolt) { - - int level = level(); - - int n = 1; - - if (Actor.findChar(bolt.collisionPos) != null && Ballistica.distance > 2) { - bolt.sourcePos = Ballistica.trace[Ballistica.distance - 2]; - } - - boolean[] passable = BArray.or(Level.passable, Level.avoid, null); - for (Actor actor : Actor.all()) { - if (actor instanceof Char) { - passable[((Char) actor).pos] = false; - } - } - - PathFinder.buildDistanceMap(bolt.collisionPos, passable, n); - int dist = 0; - - if (Actor.findChar(bolt.collisionPos) != null) { - PathFinder.distance[bolt.collisionPos] = Integer.MAX_VALUE; - dist = 1; - } - - if ( curCharges > 9 ){ - cloudLabel: for (int i = 0; i < n; i++) { - do { - for (int j = 0; j < Level.getLength(); j++) { - if (PathFinder.distance[j] == dist) { - - if (Dungeon.hero.subClass == HeroSubClass.LEADER ){ - STCloud scloud = new STCloud(); - scloud.pos = j; - scloud.lvl = level; - GameScene.add(scloud); - } else { - - TCloud cloud = new TCloud(); - cloud.pos = j; - cloud.lvl = level; - //cloud.lifespan = chargesPerCast(); - GameScene.add(cloud); - } - CellEmitter.get(j).burst(Speck.factory(Speck.WOOL), 4); - PathFinder.distance[j] = Integer.MAX_VALUE; - continue cloudLabel; - } - } - dist++; - } while (dist < n); - } - } else { - GLog.w(Messages.get(this, "more_charge")); - for (int i : Level.NEIGHBOURS9) { - int c = bolt.collisionPos + i; - if (c >= 0 && c < Level.getLength()) { - GameScene.add(Blob.seed(c, curCharges, ElectriShock.class)); - CellEmitter.get(c).burst(EnergyParticle.FACTORY, 5); - } - } - } - Heap heap = Dungeon.level.heaps.get(bolt.collisionPos); - if (heap != null) {heap.lit();} - } - - @Override - protected int initialCharges() { - return 1; - } - - @Override - protected int chargesPerCast() { - return Math.max(1, curCharges); - } - - @Override - protected void fx(Ballistica bolt, Callback callback) { - MagicMissile.wool(curUser.sprite.parent, curUser.pos, bolt.collisionPos, callback); - Sample.INSTANCE.play(Assets.SND_ZAP); - } - - public static class TCloud extends NPC implements Callback { - - private static final float TIME_TO_ZAP = 1f; - private static final int BOMB_DELAY = 20; - private int timeToBomb = BOMB_DELAY; - - { - //name = "TCloud"; - - spriteClass = TCloudSprite.class; - HP = HT = 200; - state = HUNTING; - flying = true; - ally=true; - - viewDistance = 6; - properties.add(Property.ELEMENT); - - } - - public int lvl; - public int lifespan; - - private static final String LVL = "lvl"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(LVL, lvl); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - lvl = bundle.getInt(LVL); - } - - @Override - protected boolean act() { - timeToBomb --; - if (timeToBomb == 0){ - destroy(); - sprite.die(); - } - - return super.act(); - } - - @Override - public void move(int step) { - } - - @Override - protected Char chooseEnemy() { - - if (enemy == null || !enemy.isAlive()) { - HashSet enemies = new HashSet(); - for (Mob mob : Dungeon.level.mobs) { - if (mob.hostile && Level.fieldOfView[mob.pos]) { - enemies.add(mob); - } - } - - enemy = enemies.size() > 0 ? Random.element(enemies) : null; - } - - return enemy; - } - - @Override - public int hitSkill(Char target) { - return 500; - } - - @Override - public int damageRoll() { - return Random.NormalIntRange(10 + lvl, 15 + 3*lvl); - } - - @Override - protected float attackDelay() { - return 0.5f; - } - - @Override - protected boolean canAttack(Char enemy) { - return new Ballistica( pos, enemy.pos, Ballistica.MAGIC_BOLT).collisionPos == enemy.pos; - } - - @Override - protected boolean doAttack(Char enemy) { - - if (Level.distance(pos, enemy.pos) <= 1) { - - return super.doAttack(enemy); - - } else { - - boolean visible = Level.fieldOfView[pos] - || Level.fieldOfView[enemy.pos]; - if (visible) { - ((TCloudSprite) sprite).zap(enemy.pos); - } - - spend(TIME_TO_ZAP); - - if (hit(this, enemy, true)) { - int dmg = Random.Int(6 + lvl, 20 + 3*lvl); - if (Level.water[enemy.pos] && !enemy.flying) { - dmg *= 1.5f; - } - enemy.damage(dmg, this); - //Buff.affect(enemy, Taunt.class,2f).object = id(); - enemy.sprite.centerEmitter().burst(SparkParticle.FACTORY, 3); - enemy.sprite.flash(); - damage(Random.NormalIntRange(10 + lvl, 15 + 3*lvl), this); - if (enemy == Dungeon.hero) { - - Camera.main.shake(2, 0.3f); - - if (!enemy.isAlive()) { - Dungeon.fail( Messages.format(ResultDescriptions.MOB)); - //GLog.n(Messages.get(this, "zap_kill")); - } - } - } else { - enemy.sprite - .showStatus(CharSprite.NEUTRAL, enemy.defenseVerb()); - } - - return !visible; - } - } - - @Override - public void call() { - next(); - } - - @Override - public int attackProc(Char enemy, int damage) { - int dmg = super.attackProc(enemy, damage); - if(HP < 1){ - destroy(); - sprite.die(); - } - - return dmg; - } - - @Override - public int drRoll() { - return 0; - } - - @Override - public boolean interact() { - - if (this.buff(MagicalSleep.class) != null) { - Buff.detach(this, MagicalSleep.class); - } - - if (state == SLEEPING) { - state = HUNTING; - } - if (buff(Paralysis.class) != null) { - Buff.detach(this, Paralysis.class); - } - - int curPos = pos; - - moveSprite(pos, Dungeon.hero.pos); - move(Dungeon.hero.pos); - - Dungeon.hero.sprite.move(Dungeon.hero.pos, curPos); - Dungeon.hero.move(curPos); - - Dungeon.hero.spend(1 / Dungeon.hero.speed()); - Dungeon.hero.busy(); - return true; - } - - @Override - public void add( Buff buff ) { - //in other words, can't be directly affected by buffs/debuffs. - } - -} - - public static class STCloud extends NPC implements Callback { - - private static final float TIME_TO_ZAP = 1f; - private static final int BOMB_DELAY = 40; - private int timeToBomb = BOMB_DELAY; - - { - //name = "TCloud"; - - spriteClass = KeKeSprite.class; - HP = HT = 100; - state = HUNTING; - flying = true; - ally=true; - - viewDistance = 6; - properties.add(Property.ELEMENT); - - } - - public int lvl; - public int lifespan; - - private static final String LVL = "lvl"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(LVL, lvl); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - lvl = bundle.getInt(LVL); - } - - @Override - protected boolean act() { - timeToBomb --; - if (timeToBomb == 0){ - destroy(); - sprite.die(); - } - - return super.act(); - } - - - @Override - protected Char chooseEnemy() { - - if (enemy == null || !enemy.isAlive()) { - HashSet enemies = new HashSet(); - for (Mob mob : Dungeon.level.mobs) { - if (mob.hostile && Level.fieldOfView[mob.pos]) { - enemies.add(mob); - } - } - - enemy = enemies.size() > 0 ? Random.element(enemies) : null; - } - - return enemy; - } - - @Override - public int hitSkill(Char target) { - return 500; - } - - @Override - public int damageRoll() { - return Random.NormalIntRange(20 + lvl, 30 + 5*lvl); - } - - @Override - protected float attackDelay() { - return 0.5f; - } - - @Override - protected boolean canAttack(Char enemy) { - return new Ballistica( pos, enemy.pos, Ballistica.MAGIC_BOLT).collisionPos == enemy.pos; - } - - @Override - protected boolean doAttack(Char enemy) { - - if (Level.distance(pos, enemy.pos) <= 1) { - - return super.doAttack(enemy); - - } else { - - boolean visible = Level.fieldOfView[pos] - || Level.fieldOfView[enemy.pos]; - if (visible) { - ((KeKeSprite) sprite).zap(enemy.pos); - } - - spend(TIME_TO_ZAP); - - if (hit(this, enemy, true)) { - int dmg = Random.Int(4 + lvl, 12 + 3*lvl); - if (Level.water[enemy.pos] && !enemy.flying) { - dmg *= 1.5f; - } - enemy.damage(dmg, this); - //Buff.affect(enemy, Taunt.class,2f).object = id(); - enemy.sprite.centerEmitter().burst(SparkParticle.FACTORY, 3); - enemy.sprite.flash(); - damage(Random.NormalIntRange(20 + lvl, 30 + 5*lvl), this); - if (enemy == Dungeon.hero) { - - Camera.main.shake(2, 0.3f); - - if (!enemy.isAlive()) { - Dungeon.fail( Messages.format(ResultDescriptions.MOB)); - //GLog.n(Messages.get(this, "zap_kill")); - } - } - } else { - enemy.sprite - .showStatus(CharSprite.NEUTRAL, enemy.defenseVerb()); - } - - return !visible; - } - } - - @Override - public void call() { - next(); - } - - @Override - public int drRoll() { - return 0; - } - - @Override - public boolean interact() { - - if (this.buff(MagicalSleep.class) != null) { - Buff.detach(this, MagicalSleep.class); - } - - if (state == SLEEPING) { - state = HUNTING; - } - if (buff(Paralysis.class) != null) { - Buff.detach(this, Paralysis.class); - } - - int curPos = pos; - - moveSprite(pos, Dungeon.hero.pos); - move(Dungeon.hero.pos); - - Dungeon.hero.sprite.move(Dungeon.hero.pos, curPos); - Dungeon.hero.move(curPos); - - Dungeon.hero.spend(1 / Dungeon.hero.speed()); - Dungeon.hero.busy(); - return true; - } - - @Override - public void add( Buff buff ) { - //in other words, can't be directly affected by buffs/debuffs. - } - -} -} diff --git a/java/com/hmdzl/spspd/change/items/weapon/Weapon.java b/java/com/hmdzl/spspd/change/items/weapon/Weapon.java deleted file mode 100644 index dad8ab10..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/Weapon.java +++ /dev/null @@ -1,505 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.weapon; - -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.Challenges; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Arcane; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.MechArmor; -import com.hmdzl.spspd.change.actors.buffs.Rhythm2; -import com.hmdzl.spspd.change.actors.buffs.TargetShoot; -import com.hmdzl.spspd.change.actors.hero.HeroSubClass; -import com.hmdzl.spspd.change.items.rings.RingOfAccuracy; -import com.hmdzl.spspd.change.items.rings.RingOfElements; -import com.hmdzl.spspd.change.items.weapon.enchantments.EnchantmentDark; -import com.hmdzl.spspd.change.items.weapon.enchantments.EnchantmentDark2; -import com.hmdzl.spspd.change.items.weapon.enchantments.EnchantmentEarth; -import com.hmdzl.spspd.change.items.weapon.enchantments.EnchantmentEarth2; -import com.hmdzl.spspd.change.items.weapon.enchantments.EnchantmentEnergy; -import com.hmdzl.spspd.change.items.weapon.enchantments.EnchantmentEnergy2; -import com.hmdzl.spspd.change.items.weapon.enchantments.EnchantmentFire; -import com.hmdzl.spspd.change.items.weapon.enchantments.EnchantmentFire2; -import com.hmdzl.spspd.change.items.weapon.enchantments.EnchantmentIce; -import com.hmdzl.spspd.change.items.weapon.enchantments.EnchantmentIce2; -import com.hmdzl.spspd.change.items.weapon.enchantments.EnchantmentLight; -import com.hmdzl.spspd.change.items.weapon.enchantments.EnchantmentLight2; -import com.hmdzl.spspd.change.items.weapon.enchantments.EnchantmentShock; -import com.hmdzl.spspd.change.items.weapon.enchantments.EnchantmentShock2; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.hero.HeroClass; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.KindOfWeapon; -import com.hmdzl.spspd.change.items.rings.RingOfFuror; -import com.hmdzl.spspd.change.items.rings.RingOfSharpshooting; -import com.hmdzl.spspd.change.items.weapon.enchantments.AresLeech; -import com.hmdzl.spspd.change.items.weapon.enchantments.BuzzSaw; -import com.hmdzl.spspd.change.items.weapon.enchantments.CromLuck; -import com.hmdzl.spspd.change.items.weapon.enchantments.JupitersHorror; -import com.hmdzl.spspd.change.items.weapon.enchantments.LokisPoison; -import com.hmdzl.spspd.change.items.weapon.enchantments.NeptuneShock; -import com.hmdzl.spspd.change.items.weapon.melee.MeleeWeapon; -import com.hmdzl.spspd.change.items.weapon.melee.relic.RelicMeleeWeapon; -import com.hmdzl.spspd.change.items.weapon.missiles.MissileWeapon; -import com.hmdzl.spspd.change.sprites.ItemSprite; -import com.hmdzl.spspd.change.utils.GLog; - -import com.watabou.utils.Bundlable; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -public class Weapon extends KindOfWeapon { - - private static final String TXT_IDENTIFY = "You are now familiar enough with your %s to identify it. It is %s."; - //private static final String TXT_INCOMPATIBLE = "Interaction of different types of magic has negated the enchantment on this weapon!"; - private static final String TXT_TO_STRING = "%s :%d"; - //private static final int HITS_TO_KNOW = 5; - public int STR = 10; - public float ACU = 1f; // Accuracy modifier - public float DLY = 1f; // Speed modifier - public int RCH = 1; // Reach modifier - //public int DUR = 10; // durable modifier - - public int durable = 100; - - public Enchantment enchantment; - //private int hitsToKnow = HITS_TO_KNOW; - - //@Override - public void proc(Char attacker, Char defender, int damage) { - - - if (enchantment != null) { - enchantment.proc(this, attacker, defender, damage); - } - - /*if (!levelKnown) { - if (--hitsToKnow <= 0) { - levelKnown = true; - GLog.i( Messages.get(Weapon.class, "identify", name(), toString()) ); - Badges.validateItemLevelAquired( this ); - } - }*/ - } - - private static final String ENCHANTMENT = "enchantment"; - - public int STR() - { - if(Dungeon.hero != null && (this instanceof MeleeWeapon || this instanceof RelicMeleeWeapon ) && - Dungeon.hero.belongings.weapon == this && STR > 2 && - (Dungeon.hero.heroClass == HeroClass.ROGUE || Dungeon.hero.subClass == HeroSubClass.ARTISAN)) - return STR - 2; - else return STR; - } - - public boolean durable(){ - return Dungeon.isChallenged(Challenges.ABRASION); - } - - private static final String DURABLE= "durable"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(ENCHANTMENT, enchantment); - bundle.put(DURABLE, durable); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - enchantment = (Enchantment) bundle.get(ENCHANTMENT); - durable = bundle.getInt(DURABLE); - } - - @Override - public float acuracyFactor(Hero hero) { - - int encumbrance = STR() - hero.STR(); - - float ACU = this.ACU; - - if (this instanceof MissileWeapon) { - switch (hero.heroClass) { - //case WARRIOR: - //encumbrance += 3; - //break; - //case HUNTRESS: - //encumbrance -= 2; - // break; - default: - } - int bonus = 0; - for (Buff buff : hero.buffs(RingOfSharpshooting.Aim.class)) { - bonus += ((RingOfSharpshooting.Aim) buff).level; - } - ACU *= (float) (Math.pow(1.1, bonus)); - } - - return encumbrance > 0 ? (float) (ACU / Math.pow(1.5, encumbrance)) - : ACU; - } - - - @Override - public float speedFactor(Hero hero) { - - int encumrance = STR() - hero.STR(); - if (this instanceof MissileWeapon - && hero.heroClass == HeroClass.HUNTRESS) { - encumrance -= 2; - } - - float DLY = this.DLY; - int bonus = 0; - for (Buff buff : hero.buffs(RingOfFuror.Furor.class)) { - bonus += ((RingOfFuror.Furor) buff).level; - } - - DLY = (float)( DLY / Math.min( 4, 1 + bonus * 1.00 / 10) ); - - return (encumrance > 0 ? (float) (DLY * Math.pow(1.2, encumrance)) - : DLY); - } - - @Override - public int reachFactor(Hero hero) { - //return RCH; - - int RCH = this.RCH; - - int bonus = 0; - for (Buff buff : hero.buffs(RingOfAccuracy.Accuracy.class)) { - bonus += ((RingOfAccuracy.Accuracy) buff).level; - } - if (Dungeon.hero.subClass == HeroSubClass.JOKER){ - bonus += 10; - } - if (hero.buff(MechArmor.class) != null){ - bonus += 10; - } - RCH += (int)(bonus/10); - return RCH; - } - - @Override - public int damageRoll(Hero hero) { - - int damage = super.damageRoll(hero); - - int exStr = hero.STR() - STR(); - if (exStr > 0) { - damage += exStr; - } - - if (this instanceof MissileWeapon) { - float bonus = 0; - for (Buff buff : hero.buffs(RingOfSharpshooting.Aim.class)) { - bonus += ((RingOfSharpshooting.Aim) buff).level; - } - if (Dungeon.hero.buff(TargetShoot.class)!= null) - bonus += 10; - damage = (int)(damage*(1 + 0.05*bonus)); - } - - return Math.round(damage); - } - - public Item upgrade(boolean enchant) { - - if (enchant){ - if (enchantment != null) { - enchantAdv(); - } else { - enchant(); - } - } - - return super.upgrade(); - } - - @Override - public String toString() { - return levelKnown ? Messages.format(TXT_TO_STRING, super.toString(), STR()) - : super.toString(); - } - - @Override - public String name() { - return enchantment == null ? super.name() : enchantment.name(super.name()); - } - - @Override - public Item random() { - if (Random.Float() < 0.4) { - int n = 1; - if (Random.Int(3) == 0) { - n++; - if (Random.Int(3) == 0) { - n++; - } - } - if (Random.Int(2) == 0) { - upgrade(n); - } else { - degrade(n); - cursed = true; - } - } - return this; - } - - public Weapon enchant(Enchantment ench) { - enchantment = ench; - return this; - } - - - public Weapon enchant() { - - Class oldEnchantment = enchantment != null ? enchantment.getClass() : null; - Enchantment ench = Enchantment.random(); - while (ench.getClass() == oldEnchantment) { - ench = Enchantment.random(); - } - - return enchant(ench); - } - - public Weapon enchantAdv() { - - Class oldEnchantment = enchantment != null ? enchantment.getClass() : null; - Enchantment ench = Enchantment.randomAdv(); - while (ench.getClass() == oldEnchantment) { - ench = Enchantment.randomAdv(); - } - - return enchant(ench); - } - - public Weapon enchantLow() { - - Class oldEnchantment = enchantment != null ? enchantment.getClass() : null; - Enchantment ench = Enchantment.randomLow(); - while (ench.getClass() == oldEnchantment) { - ench = Enchantment.randomLow(); - } - - return enchant(ench); - } - - public Weapon enchantLuck() { - - Enchantment ench = Enchantment.randomLuck(); - return enchant(ench); - } - - public Weapon enchantBuzz() { - - Enchantment ench = Enchantment.randomBuzz(); - return enchant(ench); - } - - public Weapon enchantNeptune() { - - Enchantment ench = Enchantment.randomNeptune(); - return enchant(ench); - } - - public Weapon enchantAres() { - - Enchantment ench = Enchantment.Ares(); - return enchant(ench); - } - - - public Weapon enchantJupiter() { - - Enchantment ench = Enchantment.Jupiter(); - return enchant(ench); - } - public Weapon enchantLoki() { - - Enchantment ench = Enchantment.Loki(); - return enchant(ench); - } - - public boolean isEnchanted() { - return enchantment != null; - } - - @Override - public ItemSprite.Glowing glowing() { - return enchantment != null ? enchantment.glowing() : null; - } - - public static abstract class Enchantment implements Bundlable { - - private static final Class[] enchants = new Class[] { EnchantmentFire.class, - EnchantmentEarth.class, EnchantmentDark.class, EnchantmentEnergy.class, - EnchantmentIce.class, EnchantmentShock.class, EnchantmentLight.class, - EnchantmentFire2.class, - EnchantmentEarth2.class, EnchantmentDark2.class, EnchantmentEnergy2.class, - EnchantmentIce2.class, EnchantmentShock2.class, EnchantmentLight2.class, - BuzzSaw.class}; - private static final float[] chances = new float[] { 5, 5, 5, 5, 5,5, - 5, 5, 5, 5, 5, 5, - 5, 5, 0}; - - private static final float[] chancesLow = new float[] { 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, - 3, 3, 0 }; - - private static final float[] chancesAdv = new float[] { 2, 2, 2, 2, 2,2, - 2, 2, 2, 2, 2, 2, - 2, 2, 0 }; - - private static final float[] chancesBuzz = new float[] { 0, 0,0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0 , 10 }; - - private static final Class[] relicenchants = new Class[] { NeptuneShock.class, - CromLuck.class, AresLeech.class, JupitersHorror.class, LokisPoison.class}; - - private static final float[] chancesAres = new float[] { 0, 0, 1, 0, 0 }; - private static final float[] chancesNeptune = new float[] { 1, 0, 0, 0, 0 }; - private static final float[] chancesLuck = new float[] { 0, 1, 0, 0, 0 }; - private static final float[] chancesJupiter = new float[] { 0, 0, 0, 1, 0 }; - private static final float[] chancesLoki = new float[] { 0, 0, 0, 0, 1 }; - - public abstract boolean proc(Weapon weapon, Char attacker, - Char defender, int damage); - - - public abstract boolean proc(RelicMeleeWeapon weapon, Char attacker, - Char defender, int damage); - - public String name( String weaponName ) { - return Messages.get(this, "name", weaponName); - } - - public String desc() { - return Messages.get(this, "desc"); - } - - - @Override - public void restoreFromBundle(Bundle bundle) { - } - - @Override - public void storeInBundle(Bundle bundle) { - } - - public ItemSprite.Glowing glowing() { - return ItemSprite.Glowing.WHITE; - } - - @SuppressWarnings("unchecked") - public static Enchantment random() { - try { - return ((Class) enchants[Random.chances(chances)]) - .newInstance(); - } catch (Exception e) { - return null; - } - } - @SuppressWarnings("unchecked") - public static Enchantment randomAdv() { - try { - return ((Class) enchants[Random.chances(chancesAdv)]) - .newInstance(); - } catch (Exception e) { - return null; - } - } - @SuppressWarnings("unchecked") - public static Enchantment randomLow() { - try { - return ((Class) enchants[Random.chances(chancesLow)]) - .newInstance(); - } catch (Exception e) { - return null; - } - } - @SuppressWarnings("unchecked") - public static Enchantment randomBuzz() { - try { - return ((Class) enchants[Random.chances(chancesBuzz)]) - .newInstance(); - } catch (Exception e) { - return null; - } - } - - @SuppressWarnings("unchecked") - public static Enchantment randomLuck() { - try { - return ((Class) enchants[Random.chances(chancesLuck)]) - .newInstance(); - } catch (Exception e) { - return null; - } - } - - @SuppressWarnings("unchecked") - public static Enchantment Ares() { - try { - return ((Class) relicenchants[Random.chances(chancesAres)]) - .newInstance(); - } catch (Exception e) { - return null; - } - } - - @SuppressWarnings("unchecked") - public static Enchantment Jupiter() { - try { - return ((Class) relicenchants[Random.chances(chancesJupiter)]) - .newInstance(); - } catch (Exception e) { - return null; - } - } - - @SuppressWarnings("unchecked") - public static Enchantment Loki() { - try { - return ((Class) relicenchants[Random.chances(chancesLoki)]) - .newInstance(); - } catch (Exception e) { - return null; - } - } - - - @SuppressWarnings("unchecked") - public static Enchantment randomNeptune() { - try { - return ((Class) enchants[Random.chances(chancesNeptune)]) - .newInstance(); - } catch (Exception e) { - return null; - } - } - } -} diff --git a/java/com/hmdzl/spspd/change/items/weapon/enchantments/AresLeech.java b/java/com/hmdzl/spspd/change/items/weapon/enchantments/AresLeech.java deleted file mode 100644 index 91c4c986..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/enchantments/AresLeech.java +++ /dev/null @@ -1,163 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.weapon.enchantments; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.weapon.Weapon; -import com.hmdzl.spspd.change.items.weapon.melee.relic.RelicMeleeWeapon; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.traps.LightningTrap; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.hmdzl.spspd.change.sprites.ItemSprite; -import com.hmdzl.spspd.change.sprites.ItemSprite.Glowing; -import com.hmdzl.spspd.change.ui.BuffIndicator; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -public class AresLeech extends Weapon.Enchantment { - - private static ItemSprite.Glowing PURPLE = new ItemSprite.Glowing(0x660066); - - @Override - public boolean proc(Weapon weapon, Char attacker, Char defender, int damage) { - return false; - } - - @Override - public boolean proc(RelicMeleeWeapon weapon, Char attacker, Char defender, int damage) { - - int level = Math.max(0, weapon.level); - int distance = 3; - int maxValue = damage * (level + 2) / (level + 6); - int effValue = Math.min(Random.IntRange(0, maxValue), attacker.HT - attacker.HP); - - for (Mob mob : Dungeon.level.mobs) { - - if (Level.distance(attacker.pos, mob.pos) < distance && mob.isAlive() ){ - if(effValue 0) { - - HealDamage spbuff = attacker.buff(HealDamage.class); - if (spbuff == null) { - spbuff = new HealDamage(); - spbuff.attachTo(attacker); - } - spbuff.prolong(damage); - return true; - } else { - return false; - } - - - } - - @Override - public Glowing glowing() { - return PURPLE; - } - - public static class HealDamage extends Buff { - - protected int damage = 0; - - private static final String DAMAGE = "damage"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(DAMAGE, damage); - - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - damage = bundle.getInt(DAMAGE); - } - - @Override - public boolean attachTo(Char target) { - if (super.attachTo(target)) { - postpone(TICK); - return true; - } else { - return false; - } - } - - public void prolong(int damage) { - this.damage = damage; - }; - - @Override - public int icon() { - return BuffIndicator.DEFERRED; - } - - @Override - public String toString() { - return Messages.get(this, "name"); - } - - @Override - public boolean act() { - if (target.isAlive()) { - - int damageThisTick = Math.max(1, (int)(damage*0.1f)) - ; - if (target.HP= target.HT) { - detach(); - } - - } else { - - detach(); - - } - - return true; - } - @Override - public String desc() { - return Messages.get(this, "desc", damage); - } - - } -} - - - diff --git a/java/com/hmdzl/spspd/change/items/weapon/enchantments/BuzzSaw.java b/java/com/hmdzl/spspd/change/items/weapon/enchantments/BuzzSaw.java deleted file mode 100644 index 92128c1e..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/enchantments/BuzzSaw.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.weapon.enchantments; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.items.DewVial; -import com.hmdzl.spspd.change.items.weapon.Weapon; -import com.hmdzl.spspd.change.items.weapon.melee.special.Handcannon; -import com.hmdzl.spspd.change.items.weapon.melee.relic.RelicMeleeWeapon; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.ItemSprite; -import com.hmdzl.spspd.change.sprites.ItemSprite.Glowing; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.utils.Random; - -public class BuzzSaw extends Weapon.Enchantment { - - private static ItemSprite.Glowing OLIVE = new ItemSprite.Glowing(0x999900); - - @Override - public boolean proc(RelicMeleeWeapon weapon, Char attacker, Char defender, int damage) { - return false; - } - - @Override - public boolean proc(Weapon weapon, Char attacker, Char defender, int damage) { - - //int level = Math.max(0, weapon.level); - - - DewVial vial = Dungeon.hero.belongings.getItem(DewVial.class); - Handcannon saw = Dungeon.hero.belongings.getItem(Handcannon.class); - - if (vial != null) { - - int hits = Random.Int(Math.round(vial.checkVol()/10)); - int dmg; - - for (int i = 1; i <= hits + 1; i++) { - if (vial.checkVol()>0 && saw.turnedOn){ - vial.sip(); - dmg = Math.max(1, (attacker.damageRoll()- i)*2); - defender.damage(dmg, this); - GLog.h("Vrrrrrr!"); - } else if (vial.checkVol()==0 && saw.turnedOn){ - //defender.damage(Random.Int(level), this); - GLog.n(Messages.get(this, "fuel")); - break; - } else if (vial.checkVol()>0 && !saw.turnedOn){ - //defender.damage(Random.Int(level), this); - GLog.n(Messages.get(this, "off")); - break; - } else { - //defender.damage(Random.Int(level), this); - //GLog.n("Handcannon is out of fuel!"); - break; - } - if(!defender.isAlive()){break;} - } - - } - - return true; - - } - - @Override - public Glowing glowing() { - return OLIVE; - } -} diff --git a/java/com/hmdzl/spspd/change/items/weapon/enchantments/CromLuck.java b/java/com/hmdzl/spspd/change/items/weapon/enchantments/CromLuck.java deleted file mode 100644 index e469cf62..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/enchantments/CromLuck.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.weapon.enchantments; - -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.items.weapon.Weapon; -import com.hmdzl.spspd.change.items.weapon.melee.relic.RelicMeleeWeapon; -import com.hmdzl.spspd.change.sprites.ItemSprite; -import com.hmdzl.spspd.change.sprites.ItemSprite.Glowing; - -public class CromLuck extends Weapon.Enchantment { - - private static ItemSprite.Glowing RED = new ItemSprite.Glowing(0x800000); - - @Override - public boolean proc(RelicMeleeWeapon weapon, Char attacker, Char defender, int damage) { - return false; - } - - @Override - public boolean proc(Weapon weapon, Char attacker, Char defender, int damage) { - int level = Math.max(0, weapon.level); - - int dmg = damage; - for (int i = 1; i <= level + 1; i++) { - dmg = Math.max(dmg, attacker.damageRoll()); - } - - if (dmg > damage) { - defender.damage(dmg - damage, weapon); - return true; - } else { - return false; - } - } - - @Override - public Glowing glowing() { - return RED; - } -} diff --git a/java/com/hmdzl/spspd/change/items/weapon/enchantments/EnchantmentDark.java b/java/com/hmdzl/spspd/change/items/weapon/enchantments/EnchantmentDark.java deleted file mode 100644 index 7faa9673..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/enchantments/EnchantmentDark.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.weapon.enchantments; - -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.AttackDown; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Terror; -import com.hmdzl.spspd.change.actors.buffs.Weakness; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.particles.ShadowParticle; -import com.hmdzl.spspd.change.items.misc.FourClover; -import com.hmdzl.spspd.change.items.weapon.Weapon; -import com.hmdzl.spspd.change.items.weapon.melee.relic.RelicMeleeWeapon; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.ItemSprite; -import com.hmdzl.spspd.change.sprites.ItemSprite.Glowing; -import com.watabou.utils.Random; - -public class EnchantmentDark extends Weapon.Enchantment { - - private static ItemSprite.Glowing BLACK = new ItemSprite.Glowing( 0x000000 ); - - @Override - public boolean proc(RelicMeleeWeapon weapon, Char attacker, Char defender, int damage) { - return false; - } - - @Override - public boolean proc(Weapon weapon, Char attacker, Char defender, int damage) { - // lvl 0 - 8% - // lvl 1 ~ 9% - // lvl 2 ~ 10% - FourClover.FourCloverBless fcb = attacker.buff(FourClover.FourCloverBless.class); - int level = Math.max(0, weapon.level); - int dmg = damage; - defender.damage(Random.Int(dmg/6), this); - if(fcb != null && Random.Int(2) == 1){ - defender.damage(Random.Int(dmg/6), this); - } - if (Random.Int(level + 15) >= 15) { - Buff.prolong(defender, Terror.class,5f); - defender.sprite.emitter().burst(ShadowParticle.UP, 5); - return true; - } else { - return false; - } - } - - @Override - public Glowing glowing() { - return BLACK; - } -} diff --git a/java/com/hmdzl/spspd/change/items/weapon/enchantments/EnchantmentDark2.java b/java/com/hmdzl/spspd/change/items/weapon/enchantments/EnchantmentDark2.java deleted file mode 100644 index c95c34d6..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/enchantments/EnchantmentDark2.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.weapon.enchantments; - -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.AttackDown; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Weakness; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.particles.ShadowParticle; -import com.hmdzl.spspd.change.items.misc.FourClover; -import com.hmdzl.spspd.change.items.weapon.Weapon; -import com.hmdzl.spspd.change.items.weapon.melee.relic.RelicMeleeWeapon; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.ItemSprite; -import com.hmdzl.spspd.change.sprites.ItemSprite.Glowing; -import com.watabou.utils.Random; - -public class EnchantmentDark2 extends Weapon.Enchantment { - - private static ItemSprite.Glowing BLACK = new ItemSprite.Glowing( 0x000000 ); - - @Override - public boolean proc(RelicMeleeWeapon weapon, Char attacker, Char defender, int damage) { - return false; - } - - @Override - public boolean proc(Weapon weapon, Char attacker, Char defender, int damage) { - // lvl 0 - 8% - // lvl 1 ~ 9% - // lvl 2 ~ 10% - FourClover.FourCloverBless fcb = attacker.buff(FourClover.FourCloverBless.class); - int lvl = Math.max(0, weapon.level); - Buff.prolong(defender, AttackDown.class,5f).level(Math.min(50,lvl+5)); - if(fcb != null && Random.Int(2) == 1){ - defender.damage(Random.Int(damage/6), this); - } - defender.sprite.emitter().burst(ShadowParticle.UP, 5); - return true; - - } - - @Override - public Glowing glowing() { - return BLACK; - } -} diff --git a/java/com/hmdzl/spspd/change/items/weapon/enchantments/EnchantmentEarth.java b/java/com/hmdzl/spspd/change/items/weapon/enchantments/EnchantmentEarth.java deleted file mode 100644 index 8c337f76..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/enchantments/EnchantmentEarth.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.weapon.enchantments; - -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.GrowSeed; -import com.hmdzl.spspd.change.actors.buffs.Roots; -import com.hmdzl.spspd.change.actors.buffs.Weakness; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.particles.EarthParticle; -import com.hmdzl.spspd.change.effects.particles.ShadowParticle; -import com.hmdzl.spspd.change.items.misc.FourClover; -import com.hmdzl.spspd.change.items.weapon.Weapon; -import com.hmdzl.spspd.change.items.weapon.melee.relic.RelicMeleeWeapon; -import com.hmdzl.spspd.change.sprites.ItemSprite; -import com.hmdzl.spspd.change.sprites.ItemSprite.Glowing; -import com.watabou.utils.Random; - -public class EnchantmentEarth extends Weapon.Enchantment { - - private static ItemSprite.Glowing BROWN = new ItemSprite.Glowing( 0x996600 ); - - @Override - public boolean proc(RelicMeleeWeapon weapon, Char attacker, Char defender, int damage) { - return false; - } - - @Override - public boolean proc(Weapon weapon, Char attacker, Char defender, int damage) { - // lvl 0 - 33% - // lvl 1 - 50% - // lvl 2 - 60% - FourClover.FourCloverBless fcb = attacker.buff(FourClover.FourCloverBless.class); - int level = Math.max(0, weapon.level); - - int dmg = damage; - defender.damage(Random.Int(dmg/6), this); - if(fcb != null && Random.Int(2) == 1){ - defender.damage(Random.Int(dmg/6), this); - } - - if (Random.Int(level + 15) >= 30) { - Buff.affect(defender, GrowSeed.class).reignite(defender); - CellEmitter.bottom(defender.pos).start(EarthParticle.FACTORY, 0.05f, 8); - return true; - } else { - return false; - } - } - - @Override - public Glowing glowing() { - return BROWN; - } - -} diff --git a/java/com/hmdzl/spspd/change/items/weapon/enchantments/EnchantmentEarth2.java b/java/com/hmdzl/spspd/change/items/weapon/enchantments/EnchantmentEarth2.java deleted file mode 100644 index 7e73acd8..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/enchantments/EnchantmentEarth2.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.weapon.enchantments; - -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Ooze; -import com.hmdzl.spspd.change.actors.buffs.Roots; -import com.hmdzl.spspd.change.actors.buffs.Weakness; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.particles.EarthParticle; -import com.hmdzl.spspd.change.effects.particles.ShadowParticle; -import com.hmdzl.spspd.change.items.misc.FourClover; -import com.hmdzl.spspd.change.items.weapon.Weapon; -import com.hmdzl.spspd.change.items.weapon.melee.relic.RelicMeleeWeapon; -import com.hmdzl.spspd.change.sprites.ItemSprite; -import com.hmdzl.spspd.change.sprites.ItemSprite.Glowing; -import com.watabou.utils.Random; - -public class EnchantmentEarth2 extends Weapon.Enchantment { - - private static ItemSprite.Glowing BROWN = new ItemSprite.Glowing( 0x996600 ); - - @Override - public boolean proc(RelicMeleeWeapon weapon, Char attacker, Char defender, int damage) { - return false; - } - - @Override - public boolean proc(Weapon weapon, Char attacker, Char defender, int damage) { - // lvl 0 - 33% - // lvl 1 - 50% - // lvl 2 - 60% - FourClover.FourCloverBless fcb = attacker.buff(FourClover.FourCloverBless.class); - int level = Math.max(0, weapon.level); - if ((Random.Int(level + 15) >= 15 || (fcb != null && Random.Int(level + 15) >= 10) )&& defender.isAlive()) { - Buff.prolong(defender, Roots.class,5f); - Buff.affect(defender, Ooze.class); - CellEmitter.bottom(defender.pos).start(EarthParticle.FACTORY, 0.05f, 8); - return true; - } else { - return false; - } - } - - @Override - public Glowing glowing() { - return BROWN; - } - -} diff --git a/java/com/hmdzl/spspd/change/items/weapon/enchantments/EnchantmentEnergy.java b/java/com/hmdzl/spspd/change/items/weapon/enchantments/EnchantmentEnergy.java deleted file mode 100644 index 85788457..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/enchantments/EnchantmentEnergy.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.weapon.enchantments; - -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.AttackUp; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Weakness; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.effects.particles.ShadowParticle; -import com.hmdzl.spspd.change.items.misc.FourClover; -import com.hmdzl.spspd.change.items.weapon.Weapon; -import com.hmdzl.spspd.change.items.weapon.melee.relic.RelicMeleeWeapon; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.ItemSprite; -import com.hmdzl.spspd.change.sprites.ItemSprite.Glowing; -import com.watabou.utils.Random; - -public class EnchantmentEnergy extends Weapon.Enchantment { - - private static ItemSprite.Glowing GRAY = new ItemSprite.Glowing( 0x888888 ); - - @Override - public boolean proc(RelicMeleeWeapon weapon, Char attacker, Char defender, int damage) { - return false; - } - - @Override - public boolean proc(Weapon weapon, Char attacker, Char defender, int damage) { - // lvl 0 - 13% - // lvl 1 - 22% - // lvl 2 - 30% - FourClover.FourCloverBless fcb = attacker.buff(FourClover.FourCloverBless.class); - int level = Math.max(0, weapon.level); - - int dmg = damage; - defender.damage(Random.Int(dmg/6), this); - if(fcb != null && Random.Int(2) == 1){ - defender.damage(Random.Int(dmg/6), this); - } - - if (Random.Int(level + 15) >= 15) { - Buff.prolong(attacker, AttackUp.class,10f).level(15); - attacker.sprite.emitter().start(Speck.factory(Speck.UP), 0.2f, 3); - return true; - } else { - return false; - } - } - - @Override - public Glowing glowing() { - return GRAY; - } - -} diff --git a/java/com/hmdzl/spspd/change/items/weapon/enchantments/EnchantmentEnergy2.java b/java/com/hmdzl/spspd/change/items/weapon/enchantments/EnchantmentEnergy2.java deleted file mode 100644 index ded843b7..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/enchantments/EnchantmentEnergy2.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.weapon.enchantments; - -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.AttackUp; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.DefenceUp; -import com.hmdzl.spspd.change.actors.buffs.Weakness; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.effects.particles.ShadowParticle; -import com.hmdzl.spspd.change.items.misc.FourClover; -import com.hmdzl.spspd.change.items.weapon.Weapon; -import com.hmdzl.spspd.change.items.weapon.melee.relic.RelicMeleeWeapon; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.ItemSprite; -import com.hmdzl.spspd.change.sprites.ItemSprite.Glowing; -import com.watabou.utils.Random; - -public class EnchantmentEnergy2 extends Weapon.Enchantment { - - private static ItemSprite.Glowing GRAY = new ItemSprite.Glowing( 0x888888 ); - - @Override - public boolean proc(RelicMeleeWeapon weapon, Char attacker, Char defender, int damage) { - return false; - } - - @Override - public boolean proc(Weapon weapon, Char attacker, Char defender, int damage) { - // lvl 0 - 13% - // lvl 1 - 22% - // lvl 2 - 30% - FourClover.FourCloverBless fcb = attacker.buff(FourClover.FourCloverBless.class); - int lvl = Math.max(0, weapon.level); - - //int dmg = damage; - //defender.damage(Random.Int(dmg/6), this); - - //if (Random.Int(level + 15) >= 15) { - if(fcb != null && Random.Int(2) == 1){ - defender.damage(Random.Int(damage/6), this); - } - Buff.affect(attacker, DefenceUp.class,5f).level(Math.min(30,lvl+1)); - attacker.sprite.emitter().start(Speck.factory(Speck.UP), 0.2f, 3); - return true; - //} else { - //return false; - //} - } - - @Override - public Glowing glowing() { - return GRAY; - } - -} diff --git a/java/com/hmdzl/spspd/change/items/weapon/enchantments/EnchantmentFire.java b/java/com/hmdzl/spspd/change/items/weapon/enchantments/EnchantmentFire.java deleted file mode 100644 index 65e26035..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/enchantments/EnchantmentFire.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.weapon.enchantments; - -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Burning; -import com.hmdzl.spspd.change.actors.buffs.Weakness; -import com.hmdzl.spspd.change.effects.particles.FlameParticle; -import com.hmdzl.spspd.change.effects.particles.ShadowParticle; -import com.hmdzl.spspd.change.items.misc.FourClover; -import com.hmdzl.spspd.change.items.weapon.Weapon; -import com.hmdzl.spspd.change.items.weapon.melee.relic.RelicMeleeWeapon; -import com.hmdzl.spspd.change.sprites.ItemSprite; -import com.hmdzl.spspd.change.sprites.ItemSprite.Glowing; -import com.watabou.utils.Random; - -public class EnchantmentFire extends Weapon.Enchantment { - - private static ItemSprite.Glowing RED = new ItemSprite.Glowing( 0xCC0000 ); - - @Override - public boolean proc(RelicMeleeWeapon weapon, Char attacker, Char defender, int damage) { - return false; - } - - @Override - public boolean proc(Weapon weapon, Char attacker, Char defender, int damage) { - // lvl 0 - 33% - // lvl 1 - 50% - // lvl 2 - 60% - FourClover.FourCloverBless fcb = attacker.buff(FourClover.FourCloverBless.class); - int level = Math.max(0, weapon.level); - - int dmg = damage; - defender.damage(Random.Int(dmg/6), this); - if(fcb != null && Random.Int(2) == 1){ - defender.damage(Random.Int(dmg/6), this); - } - - if (Random.Int(level + 15) >= 15) { - Buff.affect(defender, Burning.class).reignite( defender ); - defender.sprite.emitter().burst(FlameParticle.FACTORY, 5); - return true; - } else { - return false; - } - } - - @Override - public Glowing glowing() { - return RED; - } -} diff --git a/java/com/hmdzl/spspd/change/items/weapon/enchantments/EnchantmentFire2.java b/java/com/hmdzl/spspd/change/items/weapon/enchantments/EnchantmentFire2.java deleted file mode 100644 index b65ba381..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/enchantments/EnchantmentFire2.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.weapon.enchantments; - -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Burning; -import com.hmdzl.spspd.change.actors.buffs.Hot; -import com.hmdzl.spspd.change.actors.buffs.Tar; -import com.hmdzl.spspd.change.actors.buffs.Weakness; -import com.hmdzl.spspd.change.effects.particles.FlameParticle; -import com.hmdzl.spspd.change.effects.particles.ShadowParticle; -import com.hmdzl.spspd.change.items.misc.FourClover; -import com.hmdzl.spspd.change.items.weapon.Weapon; -import com.hmdzl.spspd.change.items.weapon.melee.relic.RelicMeleeWeapon; -import com.hmdzl.spspd.change.sprites.ItemSprite; -import com.hmdzl.spspd.change.sprites.ItemSprite.Glowing; -import com.watabou.utils.Random; - -public class EnchantmentFire2 extends Weapon.Enchantment { - - private static ItemSprite.Glowing RED = new ItemSprite.Glowing( 0xCC0000 ); - - @Override - public boolean proc(RelicMeleeWeapon weapon, Char attacker, Char defender, int damage) { - return false; - } - - @Override - public boolean proc(Weapon weapon, Char attacker, Char defender, int damage) { - // lvl 0 - 33% - // lvl 1 - 50% - // lvl 2 - 60% - FourClover.FourCloverBless fcb = attacker.buff(FourClover.FourCloverBless.class); - int lvl = Math.max(0, weapon.level); - if(fcb != null && Random.Int(2) == 1){ - defender.damage(Random.Int(damage/6), this); - } - if (defender.isAlive()){ - Buff.prolong(defender, Hot.class,Math.min(30,lvl+1)); - Buff.affect(defender, Tar.class); - defender.sprite.emitter().burst(FlameParticle.FACTORY, 5); - return true; - } else { - return false; - } - - } - - @Override - public Glowing glowing() { - return RED; - } -} diff --git a/java/com/hmdzl/spspd/change/items/weapon/enchantments/EnchantmentIce.java b/java/com/hmdzl/spspd/change/items/weapon/enchantments/EnchantmentIce.java deleted file mode 100644 index bac71728..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/enchantments/EnchantmentIce.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.weapon.enchantments; - -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Chill; -import com.hmdzl.spspd.change.actors.buffs.Frost; -import com.hmdzl.spspd.change.actors.buffs.Weakness; -import com.hmdzl.spspd.change.effects.particles.ShadowParticle; -import com.hmdzl.spspd.change.effects.particles.SnowParticle; -import com.hmdzl.spspd.change.items.misc.FourClover; -import com.hmdzl.spspd.change.items.weapon.Weapon; -import com.hmdzl.spspd.change.items.weapon.melee.relic.RelicMeleeWeapon; -import com.hmdzl.spspd.change.sprites.ItemSprite; -import com.hmdzl.spspd.change.sprites.ItemSprite.Glowing; -import com.watabou.utils.Random; - -public class EnchantmentIce extends Weapon.Enchantment { - - private static ItemSprite.Glowing BLUE = new ItemSprite.Glowing(0x0044FF); - - @Override - public boolean proc(RelicMeleeWeapon weapon, Char attacker, Char defender, int damage) { - return false; - } - - @Override - public boolean proc(Weapon weapon, Char attacker, Char defender, int damage) { - // lvl 0 - 25% - // lvl 1 - 40% - // lvl 2 - 50% - FourClover.FourCloverBless fcb = attacker.buff(FourClover.FourCloverBless.class); - int level = Math.max(0, weapon.level); - int dmg = damage; - defender.damage(Random.Int(dmg/6), this); - if(fcb != null && Random.Int(2) == 1){ - defender.damage(Random.Int(dmg/6), this); - } - if (Random.Int(level + 15) >= 15) { - Buff.affect(defender, Frost.class, Frost.duration(defender)*Random.Float(2f, 4f)); - defender.sprite.emitter().burst(SnowParticle.FACTORY, 5); - return true; - } else { - return false; - } - } - - @Override - public Glowing glowing() { - return BLUE; - } - -} diff --git a/java/com/hmdzl/spspd/change/items/weapon/enchantments/EnchantmentIce2.java b/java/com/hmdzl/spspd/change/items/weapon/enchantments/EnchantmentIce2.java deleted file mode 100644 index a0288559..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/enchantments/EnchantmentIce2.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.weapon.enchantments; - -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Chill; -import com.hmdzl.spspd.change.actors.buffs.Cold; -import com.hmdzl.spspd.change.actors.buffs.Frost; -import com.hmdzl.spspd.change.actors.buffs.Weakness; -import com.hmdzl.spspd.change.actors.buffs.Wet; -import com.hmdzl.spspd.change.effects.particles.ShadowParticle; -import com.hmdzl.spspd.change.effects.particles.SnowParticle; -import com.hmdzl.spspd.change.items.misc.FourClover; -import com.hmdzl.spspd.change.items.weapon.Weapon; -import com.hmdzl.spspd.change.items.weapon.melee.relic.RelicMeleeWeapon; -import com.hmdzl.spspd.change.sprites.ItemSprite; -import com.hmdzl.spspd.change.sprites.ItemSprite.Glowing; -import com.watabou.utils.Random; - -public class EnchantmentIce2 extends Weapon.Enchantment { - - private static ItemSprite.Glowing BLUE = new ItemSprite.Glowing(0x0044FF); - - @Override - public boolean proc(RelicMeleeWeapon weapon, Char attacker, Char defender, int damage) { - return false; - } - - @Override - public boolean proc(Weapon weapon, Char attacker, Char defender, int damage) { - // lvl 0 - 25% - // lvl 1 - 40% - // lvl 2 - 50% - FourClover.FourCloverBless fcb = attacker.buff(FourClover.FourCloverBless.class); - int lvl = Math.max(0, weapon.level); - if(fcb != null && Random.Int(2) == 1){ - defender.damage(Random.Int(damage/6), this); - } - Buff.prolong(defender, Wet.class, Math.min(30,lvl+2)); - Buff.prolong(defender, Cold.class, Math.min(30,lvl+2)); - defender.sprite.emitter().burst(SnowParticle.FACTORY, 5); - - return true; - - } - - @Override - public Glowing glowing() { - return BLUE; - } - -} diff --git a/java/com/hmdzl/spspd/change/items/weapon/enchantments/EnchantmentLight.java b/java/com/hmdzl/spspd/change/items/weapon/enchantments/EnchantmentLight.java deleted file mode 100644 index cd89249e..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/enchantments/EnchantmentLight.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.weapon.enchantments; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Terror; -import com.hmdzl.spspd.change.actors.buffs.Vertigo; -import com.hmdzl.spspd.change.actors.buffs.Blindness; -import com.hmdzl.spspd.change.actors.buffs.Cripple; -import com.hmdzl.spspd.change.actors.buffs.Weakness; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.effects.particles.ShadowParticle; -import com.hmdzl.spspd.change.items.misc.FourClover; -import com.hmdzl.spspd.change.items.weapon.Weapon; -import com.hmdzl.spspd.change.items.weapon.melee.relic.RelicMeleeWeapon; -import com.hmdzl.spspd.change.sprites.ItemSprite; -import com.hmdzl.spspd.change.sprites.ItemSprite.Glowing; -import com.watabou.utils.Random; - -public class EnchantmentLight extends Weapon.Enchantment { - -private static ItemSprite.Glowing YELLOW = new ItemSprite.Glowing( 0xFFFF44 ); - - @Override - public boolean proc(RelicMeleeWeapon weapon, Char attacker, Char defender, int damage) { - return false; - } - - @Override - public boolean proc(Weapon weapon, Char attacker, Char defender, int damage) { - // lvl 0 - 20% - // lvl 1 - 33% - // lvl 2 - 43% - FourClover.FourCloverBless fcb = attacker.buff(FourClover.FourCloverBless.class); - int level = Math.max(0, weapon.level); - - int dmg = damage; - defender.damage(Random.Int(dmg/6), this); - if(fcb != null && Random.Int(2) == 1){ - defender.damage(Random.Int(dmg/6), this); - } - if (Random.Int(level + 15) >= 30) { - if (defender.properties().contains(Char.Property.DEMONIC) || defender.properties().contains(Char.Property.UNDEAD)){ - defender.damage((int)(damage*0.5),this); - } - } - - //if (Random.Int(level + 15) >= 15) { - //Buff.prolong(defender, Blindness.class,5f); - //defender.sprite.emitter().burst(Speck.factory(Speck.LIGHT), 6); - return true; - //} else { - //return false; - //} - } - - @Override - public Glowing glowing() { - return YELLOW; - } -} diff --git a/java/com/hmdzl/spspd/change/items/weapon/enchantments/EnchantmentLight2.java b/java/com/hmdzl/spspd/change/items/weapon/enchantments/EnchantmentLight2.java deleted file mode 100644 index 10f4bc67..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/enchantments/EnchantmentLight2.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.weapon.enchantments; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Terror; -import com.hmdzl.spspd.change.actors.buffs.Vertigo; -import com.hmdzl.spspd.change.actors.buffs.Blindness; -import com.hmdzl.spspd.change.actors.buffs.Cripple; -import com.hmdzl.spspd.change.actors.buffs.Weakness; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.effects.particles.ShadowParticle; -import com.hmdzl.spspd.change.items.misc.FourClover; -import com.hmdzl.spspd.change.items.weapon.Weapon; -import com.hmdzl.spspd.change.items.weapon.melee.relic.RelicMeleeWeapon; -import com.hmdzl.spspd.change.sprites.ItemSprite; -import com.hmdzl.spspd.change.sprites.ItemSprite.Glowing; -import com.watabou.utils.Random; - -public class EnchantmentLight2 extends Weapon.Enchantment { - -private static ItemSprite.Glowing YELLOW = new ItemSprite.Glowing( 0xFFFF44 ); - - @Override - public boolean proc(RelicMeleeWeapon weapon, Char attacker, Char defender, int damage) { - return false; - } - - @Override - public boolean proc(Weapon weapon, Char attacker, Char defender, int damage) { - // lvl 0 - 20% - // lvl 1 - 33% - // lvl 2 - 43% - FourClover.FourCloverBless fcb = attacker.buff(FourClover.FourCloverBless.class); - int lvl = Math.max(0, weapon.level); - Buff.prolong(defender, Blindness.class,Math.min(50,lvl+5)); - if(fcb != null && Random.Int(2) == 1){ - defender.damage(Random.Int(damage/6), this); - } - defender.sprite.emitter().burst(Speck.factory(Speck.LIGHT), 6); - return true; - - } - - @Override - public Glowing glowing() { - return YELLOW; - } -} diff --git a/java/com/hmdzl/spspd/change/items/weapon/enchantments/EnchantmentShock.java b/java/com/hmdzl/spspd/change/items/weapon/enchantments/EnchantmentShock.java deleted file mode 100644 index 3c3c6636..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/enchantments/EnchantmentShock.java +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.weapon.enchantments; - -import java.util.ArrayList; -import java.util.HashSet; - -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.effects.Lightning; -import com.hmdzl.spspd.change.effects.particles.SparkParticle; -import com.hmdzl.spspd.change.items.misc.FourClover; -import com.hmdzl.spspd.change.items.weapon.Weapon; -import com.hmdzl.spspd.change.items.weapon.melee.relic.RelicMeleeWeapon; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.traps.LightningTrap; -import com.hmdzl.spspd.change.sprites.ItemSprite; -import com.hmdzl.spspd.change.sprites.ItemSprite.Glowing; -import com.watabou.utils.Random; - -public class EnchantmentShock extends Weapon.Enchantment { - - private static ItemSprite.Glowing GREEN = new ItemSprite.Glowing( 0x00FF00 ); - @Override - public boolean proc(RelicMeleeWeapon weapon, Char attacker, Char defender, int damage) { - return false; - } - - @Override - public boolean proc(Weapon weapon, Char attacker, Char defender, int damage) { - // lvl 0 - 25% - // lvl 1 - 40% - // lvl 2 - 50% - FourClover.FourCloverBless fcb = attacker.buff(FourClover.FourCloverBless.class); - int level = Math.max(0, weapon.level); - - if (Random.Int(level + 4) >= 3) { - - points[0] = attacker.pos; - nPoints = 1; - - affected.clear(); - affected.add(attacker); - - hit(defender, Random.Int(1, damage / 2)); - - if(fcb != null && Random.Int(2) == 1){ - hit(defender, Random.Int(1, damage / 2)); - } - - attacker.sprite.parent.add(new Lightning( attacker.pos, defender.pos, null )); - - return true; - - } else { - - return false; - - } - } - - private ArrayList affected = new ArrayList(); - - private int[] points = new int[20]; - private int nPoints; - - private void hit(Char ch, int damage) { - - if (damage < 1) { - return; - } - - affected.add(ch); - ch.damage(Level.water[ch.pos] && !ch.flying ? (int) (damage * 2) - : damage, this); - - ch.sprite.centerEmitter().burst(SparkParticle.FACTORY, 3); - ch.sprite.flash(); - - points[nPoints++] = ch.pos; - - HashSet ns = new HashSet(); - for (int i = 0; i < Level.NEIGHBOURS8.length; i++) { - Char n = Actor.findChar(ch.pos + Level.NEIGHBOURS8[i]); - if (n != null && !affected.contains(n)) { - ns.add(n); - } - } - - if (ns.size() > 0) { - hit(Random.element(ns), Random.Int(damage / 2, damage)); - } - } - - @Override - public Glowing glowing() { - return GREEN; - } -} - diff --git a/java/com/hmdzl/spspd/change/items/weapon/enchantments/EnchantmentShock2.java b/java/com/hmdzl/spspd/change/items/weapon/enchantments/EnchantmentShock2.java deleted file mode 100644 index 66637ccf..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/enchantments/EnchantmentShock2.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.weapon.enchantments; - -import java.util.ArrayList; -import java.util.HashSet; - -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Paralysis; -import com.hmdzl.spspd.change.actors.buffs.Shocked; -import com.hmdzl.spspd.change.effects.Lightning; -import com.hmdzl.spspd.change.effects.particles.SparkParticle; -import com.hmdzl.spspd.change.items.misc.FourClover; -import com.hmdzl.spspd.change.items.weapon.Weapon; -import com.hmdzl.spspd.change.items.weapon.melee.relic.RelicMeleeWeapon; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.traps.LightningTrap; -import com.hmdzl.spspd.change.sprites.ItemSprite; -import com.hmdzl.spspd.change.sprites.ItemSprite.Glowing; -import com.watabou.utils.Random; - -public class EnchantmentShock2 extends Weapon.Enchantment { - -private static ItemSprite.Glowing GREEN = new ItemSprite.Glowing( 0x00FF00 ); - @Override - public boolean proc(RelicMeleeWeapon weapon, Char attacker, Char defender, int damage) { - return false; - } - - @Override - public boolean proc(Weapon weapon, Char attacker, Char defender, int damage) { - // lvl 0 - 25% - // lvl 1 - 40% - // lvl 2 - 50% - FourClover.FourCloverBless fcb = attacker.buff(FourClover.FourCloverBless.class); - int level = Math.max(0, weapon.level); - - if (Random.Int(level + 15) >= 15 || (fcb != null && Random.Int(level + 15) >= 10)) { - Buff.prolong(defender, Shocked.class,2f); - return true; - } else { - return false; - } - } - @Override - public Glowing glowing() { - return GREEN; - } -} - diff --git a/java/com/hmdzl/spspd/change/items/weapon/enchantments/JupitersHorror.java b/java/com/hmdzl/spspd/change/items/weapon/enchantments/JupitersHorror.java deleted file mode 100644 index a05b8dcb..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/enchantments/JupitersHorror.java +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.weapon.enchantments; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Paralysis; -import com.hmdzl.spspd.change.actors.buffs.Terror; -import com.hmdzl.spspd.change.actors.buffs.Vertigo; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.weapon.Weapon; -import com.hmdzl.spspd.change.items.weapon.melee.relic.RelicMeleeWeapon; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.sprites.ItemSprite; -import com.hmdzl.spspd.change.sprites.ItemSprite.Glowing; -import com.watabou.noosa.Camera; -import com.watabou.utils.Random; - -public class JupitersHorror extends Weapon.Enchantment { - - private static ItemSprite.Glowing GREY = new ItemSprite.Glowing(0x222222); - - @Override - public boolean proc(RelicMeleeWeapon weapon, Char attacker, Char defender, int damage) { - return false; - } - - @Override - public boolean proc(Weapon weapon, Char attacker, Char defender, int damage) { - // lvl 0 - 20% - // lvl 1 - 33% - // lvl 2 - 43% - int level = Math.max(0, weapon.level); - - if (Random.Int(level + 5) >= 4) { - - if (defender == Dungeon.hero) { - Buff.affect(defender, Vertigo.class, Vertigo.duration(defender)); - } else { - Buff.affect(defender, Terror.class, Terror.DURATION).object = attacker - .id(); - if (Random.Int(level + 11) >= 10){ - //doExplode(defender.pos); - } - } - - return true; - } else { - return false; - } - } - - public void doExplode(int cell) { - - Camera.main.shake(3, 0.7f); - - if (Dungeon.visible[cell] && Level.passable[cell]) { - CellEmitter.center(cell).start(Speck.factory(Speck.ROCK), 0.07f, 10); - } - - Char ch = Actor.findChar(cell); - if (ch != null && ch!=Dungeon.hero) { - // those not at the center of the blast take damage less - // consistently. - int minDamage = Dungeon.depth + 5; - int maxDamage = 10 + Dungeon.depth * 3; - - - int dmg = Random.NormalIntRange(minDamage, maxDamage) - Math.max(ch.drRoll(),0); - - - if (dmg > 0) { - ch.damage(dmg, this); - if(Random.Int(15)==1){Buff.prolong(ch, Paralysis.class, 1);} - } - - } - - } - - - @Override - public Glowing glowing() { - return GREY; - } -} diff --git a/java/com/hmdzl/spspd/change/items/weapon/enchantments/LokisPoison.java b/java/com/hmdzl/spspd/change/items/weapon/enchantments/LokisPoison.java deleted file mode 100644 index 48afe786..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/enchantments/LokisPoison.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.weapon.enchantments; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.items.weapon.Weapon; -import com.hmdzl.spspd.change.items.weapon.melee.relic.RelicMeleeWeapon; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.sprites.ItemSprite; -import com.hmdzl.spspd.change.sprites.ItemSprite.Glowing; -import com.watabou.utils.Random; - -public class LokisPoison extends Weapon.Enchantment { - - private static ItemSprite.Glowing PURPLE = new ItemSprite.Glowing(0x4400AA); - - @Override - public boolean proc(RelicMeleeWeapon weapon, Char attacker, Char defender, int damage) { - return false; - } - - @Override - public boolean proc(Weapon weapon, Char attacker, Char defender, int damage) { - // lvl 0 - 33% - // lvl 1 - 50% - // lvl 2 - 60% - int level = Math.max(0, weapon.level); - int distance = 1 + level*2; - - if (Random.Int(level + 3) >= 2) { - - Buff.affect( - defender, - com.hmdzl.spspd.change.actors.buffs.LokisPoison.class) - .set(com.hmdzl.spspd.change.actors.buffs.LokisPoison - .durationFactor(defender) * (level + 1)); - return true; - } else { - return false; - } - } - - @Override - public Glowing glowing() { - return PURPLE; - } -} diff --git a/java/com/hmdzl/spspd/change/items/weapon/enchantments/NeptuneShock.java b/java/com/hmdzl/spspd/change/items/weapon/enchantments/NeptuneShock.java deleted file mode 100644 index 481b5900..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/enchantments/NeptuneShock.java +++ /dev/null @@ -1,118 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.weapon.enchantments; - -import java.util.ArrayList; -import java.util.HashSet; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.actors.mobs.Shell; -import com.hmdzl.spspd.change.effects.Lightning; -import com.hmdzl.spspd.change.effects.particles.SparkParticle; -import com.hmdzl.spspd.change.items.weapon.Weapon; -import com.hmdzl.spspd.change.items.weapon.melee.relic.RelicMeleeWeapon; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.traps.LightningTrap; -import com.hmdzl.spspd.change.sprites.ShellSprite; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.Camera; -import com.watabou.utils.Random; - -public class NeptuneShock extends Weapon.Enchantment { - - private int cost = 10; - - @Override - public boolean proc(Weapon weapon, Char attacker, Char defender, int damage) { - - return false; - } - - @Override - public boolean proc(RelicMeleeWeapon weapon, Char attacker, Char defender, int damage) { - // lvl 0 - 25% - // lvl 1 - 40% - // lvl 2 - 50% - - - if (weapon.charge>=cost){ - weapon.charge-=cost; - } else { - return false; - } - - int level = Math.max(0, weapon.level); - - if (Random.Int(level + 4) >= 3) { - - points[0] = attacker.pos; - nPoints = 1; - - affected.clear(); - affected.add(attacker); - - hit(defender, Random.Int(damage / 3, damage / 2)); - - attacker.sprite.parent.add(new Lightning( attacker.pos, defender.pos, null )); - - return true; - - } else { - - return false; - - } - } - - private ArrayList affected = new ArrayList(); - - private int[] points = new int[20]; - private int nPoints; - - private void hit(Char ch, int damage) { - - if (damage < 1) { - return; - } - - affected.add(ch); - ch.damage(Level.water[ch.pos] && !ch.flying ? (int) (damage * 2) - : damage, this); - - ch.sprite.centerEmitter().burst(SparkParticle.FACTORY, 3); - ch.sprite.flash(); - - points[nPoints++] = ch.pos; - - HashSet ns = new HashSet(); - for (int i = 0; i < Level.NEIGHBOURS8.length; i++) { - Char n = Actor.findChar(ch.pos + Level.NEIGHBOURS8[i]); - if (n != null && !affected.contains(n)) { - ns.add(n); - } - } - - if (ns.size() > 0) { - hit(Random.element(ns), Random.Int(damage / 2, damage)); - } - } -} diff --git a/java/com/hmdzl/spspd/change/items/weapon/guns/GunA.java b/java/com/hmdzl/spspd/change/items/weapon/guns/GunA.java deleted file mode 100644 index cde4aa31..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/guns/GunA.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.weapon.guns; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.items.KindOfWeapon; -import com.hmdzl.spspd.change.items.weapon.Weapon; -import com.hmdzl.spspd.change.items.weapon.guns.GunWeapon; -import com.hmdzl.spspd.change.items.weapon.melee.MeleeWeapon; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.utils.Random; - -public class GunA extends GunWeapon { - - { - //name = "GunA"; - image = ItemSpriteSheet.GUN_A; - } - - public GunA() { - super(1,4); - } - -} diff --git a/java/com/hmdzl/spspd/change/items/weapon/guns/GunB.java b/java/com/hmdzl/spspd/change/items/weapon/guns/GunB.java deleted file mode 100644 index 90eb548f..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/guns/GunB.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.weapon.guns; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.items.KindOfWeapon; -import com.hmdzl.spspd.change.items.weapon.Weapon; -import com.hmdzl.spspd.change.items.weapon.guns.GunWeapon; -import com.hmdzl.spspd.change.items.weapon.melee.MeleeWeapon; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.utils.Random; - -public class GunB extends GunWeapon { - - { - //name = "GunB"; - image = ItemSpriteSheet.GUN_B; - } - - public GunB() { - super(2,4); - } - -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/items/weapon/guns/GunC.java b/java/com/hmdzl/spspd/change/items/weapon/guns/GunC.java deleted file mode 100644 index 279d2174..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/guns/GunC.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.weapon.guns; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.items.KindOfWeapon; -import com.hmdzl.spspd.change.items.weapon.Weapon; -import com.hmdzl.spspd.change.items.weapon.guns.GunWeapon; -import com.hmdzl.spspd.change.items.weapon.melee.MeleeWeapon; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.utils.Random; - -public class GunC extends GunWeapon { - - { - //name = "GunC"; - image = ItemSpriteSheet.GUN_C; - } - - public GunC() { - super(3,5); - } - -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/items/weapon/guns/GunD.java b/java/com/hmdzl/spspd/change/items/weapon/guns/GunD.java deleted file mode 100644 index 2df1df03..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/guns/GunD.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.weapon.guns; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.items.KindOfWeapon; -import com.hmdzl.spspd.change.items.weapon.Weapon; -import com.hmdzl.spspd.change.items.weapon.guns.GunWeapon; -import com.hmdzl.spspd.change.items.weapon.melee.MeleeWeapon; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.utils.Random; - -public class GunD extends GunWeapon { - - { - //name = "GunD"; - image = ItemSpriteSheet.GUN_D; - } - - public GunD() { - super(4,5); - } - -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/items/weapon/guns/GunE.java b/java/com/hmdzl/spspd/change/items/weapon/guns/GunE.java deleted file mode 100644 index d35d9733..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/guns/GunE.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.weapon.guns; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.items.KindOfWeapon; -import com.hmdzl.spspd.change.items.weapon.Weapon; -import com.hmdzl.spspd.change.items.weapon.guns.GunWeapon; -import com.hmdzl.spspd.change.items.weapon.melee.MeleeWeapon; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.utils.Random; - -public class GunE extends GunWeapon { - - { - //name = "GunE"; - image = ItemSpriteSheet.GUN_E; - } - - public GunE() { - super(5,6); - } - -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/items/weapon/guns/GunWeapon.java b/java/com/hmdzl/spspd/change/items/weapon/guns/GunWeapon.java deleted file mode 100644 index 002c212f..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/guns/GunWeapon.java +++ /dev/null @@ -1,380 +0,0 @@ -package com.hmdzl.spspd.change.items.weapon.guns; - - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.MechArmor; -import com.hmdzl.spspd.change.actors.buffs.TargetShoot; -import com.hmdzl.spspd.change.actors.buffs.Vertigo; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.hero.HeroClass; -import com.hmdzl.spspd.change.actors.hero.HeroSubClass; -import com.hmdzl.spspd.change.effects.Splash; -import com.hmdzl.spspd.change.effects.particles.ElmoParticle; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.StoneOre; -import com.hmdzl.spspd.change.items.artifacts.EyeOfSkadi; -import com.hmdzl.spspd.change.items.rings.RingOfSharpshooting; -import com.hmdzl.spspd.change.items.wands.WandOfFlow; -import com.hmdzl.spspd.change.items.weapon.Weapon; -import com.hmdzl.spspd.change.items.weapon.missiles.ShatteredAmmo; -import com.hmdzl.spspd.change.items.weapon.missiles.MissileWeapon; -import com.hmdzl.spspd.change.items.weapon.spammo.SpAmmo; -import com.hmdzl.spspd.change.mechanics.Ballistica; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.plants.Plant; -import com.hmdzl.spspd.change.scenes.CellSelector; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.scenes.PixelScene; -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.hmdzl.spspd.change.sprites.ItemSprite; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.ui.RenderedTextMultiline; -import com.hmdzl.spspd.change.ui.Window; -import com.hmdzl.spspd.change.utils.GLog; -import com.hmdzl.spspd.change.windows.IconTitle; -import com.hmdzl.spspd.change.windows.WndBag; -import com.hmdzl.spspd.change.windows.WndBlacksmith; -import com.hmdzl.spspd.change.windows.WndOptions; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -import java.util.ArrayList; - -public class GunWeapon extends Weapon { - - public static final String AC_SHOOT = "SHOOT"; - public static final String AC_RELOAD = "RELOAD"; - public static final String AC_AMMO = "AMMO"; - - private int tier; - private int fullcharge; - // private Ammo ammo = null; - - private SpAmmo spammo; - - public int charge = 0; - public int maxcharge = fullcharge; - public int maxammo = 100; - - - - public GunWeapon(int tier /*int ammo*/ ,int fullcharge) { - super(); - - this.tier = tier; - - //AMMO = ammo - spammo = null; - this.fullcharge = fullcharge; - - STR = typicalSTR(); - - MIN = min(); - MAX = max(); - } - - private static final String SPAMMO = "spammo"; - private static final String CHARGE = "charge"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - if (spammo != null) bundle.put( SPAMMO, spammo ); - bundle.put( CHARGE, charge ); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - if (bundle.contains(SPAMMO)) spammo = (SpAmmo) bundle.get( SPAMMO ); - charge = bundle.getInt( CHARGE ); - } - - public GunWeapon(SpAmmo spammo) { - this.spammo = spammo; - } - - - private int min() { - return tier + 3; - } - - private int max() { - return (int) (tier * tier - tier + 8); - } - - public int typicalSTR() { - return 8 + tier * 2; - } - - public Item upgrade() { - MIN += 2; - MAX += 2 + tier/2; - maxammo += 10; - - return super.upgrade(); - } - - @Override - public int price() { - int price = 100 ; - if (enchantment != null) { - price *= 1.5; - } - if (cursed && cursedKnown) { - price /= 2; - } - if (levelKnown) { - if (level > 0) { - price *= (level + 1); - } else if (level < 0) { - price /= (1 - level); - } - } - if (price < 1) { - price = 1; - } - return price; - } - - { - image = ItemSpriteSheet.AMMO; - - defaultAction = AC_SHOOT; - usesTargeting = true; - } - - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions(hero); - //actions.remove(AC_EQUIP); - if (isEquipped(hero) || Dungeon.hero.subClass != HeroSubClass.AGENT){ - actions.add(AC_SHOOT); - } - actions.add(AC_RELOAD); - actions.add(AC_AMMO); - return actions; - } - - @Override - public void execute(Hero hero, String action) { - super.execute(hero, action); - if (action.equals(AC_SHOOT)) { - if (!isEquipped( hero ) && Dungeon.hero.subClass != HeroSubClass.AGENT) - GLog.i( Messages.get(ToyGun.class, "need_to_equip") ); - else if (charge<1){ - if ( maxammo < 1 ){ - GLog.n(Messages.get(ToyGun.class, "empty")); - } else { - if (durable() && maxammo > 0){ - maxammo = Math.max( maxammo - ( fullcharge - charge),0); - } - charge = Math.min(fullcharge,maxammo); - hero.sprite.showStatus(CharSprite.DEFAULT, Messages.get(this, "reloading")); - if (Dungeon.hero.subClass == HeroSubClass.AGENT){ hero.spendAndNext(1/2 * 1f);} - else hero.spendAndNext(fullcharge/2 * 1f); - } - } else GameScene.selectCell( shooter ); - } else if(action.equals(AC_RELOAD)){ - if (charge == fullcharge){ - GLog.n(Messages.get(ToyGun.class,"full")); - } else if ( maxammo < 1 ){ - GLog.n(Messages.get(ToyGun.class, "empty")); - } else { - if (durable() && maxammo > 0) { - maxammo = Math.max(maxammo - (fullcharge - charge), 0); - } - float reloadtime = (Dungeon.hero.subClass == HeroSubClass.AGENT ) ? 1/2 : (fullcharge - charge) / 2; - hero.spendAndNext(reloadtime * 1f); - hero.sprite.showStatus(CharSprite.DEFAULT, Messages.get(this, "reloading")); - charge = Math.min(fullcharge, maxammo); - } - } else if (action.equals(AC_AMMO)) { - curUser = hero; - GameScene.selectItem(itemSelector, WndBag.Mode.AMMO ,Messages.get(this, "prompt2")); - } - } - - @Override - public int damageRoll(Hero owner) { - return 0; - } - - public int damageRoll2(Hero owner) { - int damage = Random.Int(MIN, MAX); - - float bonus = 0; - for (Buff buff : owner.buffs(RingOfSharpshooting.Aim.class)) { - bonus += ((RingOfSharpshooting.Aim) buff).level; - } - if (Dungeon.hero.buff(TargetShoot.class)!= null) - bonus += 10; - if (Dungeon.hero.buff(MechArmor.class)!= null) - bonus += 10; - damage = (int)(damage*(1 + 0.05*bonus)); - return Math.round(damage); - } - - @Override - public void proc(Char attacker, Char defender, int damage) { - - int oppositeDefender = defender.pos + (defender.pos - attacker.pos); - Ballistica trajectory = new Ballistica(defender.pos, oppositeDefender, Ballistica.MAGIC_BOLT); - WandOfFlow.throwChar(defender, trajectory, 1); - Buff.prolong(defender, Vertigo.class,3f); - } - - @Override - public String info() { - String info = desc(); - - - info += "\n\n" + Messages.get(ToyGun.class, "stats_known", tier, MIN, MAX, STR); - - String stats_desc = Messages.get(this, "stats_desc"); - if (!stats_desc.equals("")) info+= "\n\n" + stats_desc; - //Messages.get(MeleeWeapon.class, "stats_known", tier, MIN, MAX,STR,ACU,DLY,RCH ) - - if (spammo != null){ - info += "\n" + Messages.get(GunWeapon.class, "ammo_add") + Messages.get(spammo,"name") ; - } - - if (reinforced) { - info += "\n" + Messages.get(Item.class, "reinforced"); - } - - info += "\n " + Messages.get(ToyGun.class, "charge", charge, fullcharge); - - return info; - } - - - @Override - public String status() { - if (levelKnown) { - return charge + "/" + fullcharge; - } else { - return null; - } - } - - public Item addSpAmmo(SpAmmo spammo, Char owner){ - - this.spammo = null; - - //GLog.p( Messages.get(this, "imbue", spammo.name())); - - this.spammo= spammo; - spammo.identify(); - spammo.cursed = false; - //name = Messages.get(spammo, "spammo_name"); - - updateQuickslot(); - - return this; - } - - private final WndBag.Listener itemSelector = new WndBag.Listener() { - @Override - public void onSelect( final Item item ) { - if (item != null) { - - GameScene.show( - new WndOptions("", - Messages.get(GunWeapon.class, "warning"), - Messages.get(GunWeapon.class, "yes"), - Messages.get(GunWeapon.class, "no")) { - @Override - protected void onSelect(int index) { - if (index == 0) { - Sample.INSTANCE.play(Assets.SND_EVOKE); - item.detach(curUser.belongings.backpack); - - addSpAmmo((SpAmmo) item, curUser); - - curUser.spendAndNext(2f); - - updateQuickslot(); - } - } - } - ); - } - } - }; - - private int targetPos; - - - - @Override - public boolean isUpgradable() { - return true; - } - - public NormalAmmo Ammo(){ - return new NormalAmmo(); - } - - public class NormalAmmo extends MissileWeapon { - - { - image = ItemSpriteSheet.AMMO; - STR = Math.max(typicalSTR(),Dungeon.hero.STR); - } - - public int damageRoll(Hero owner) { - return GunWeapon.this.damageRoll2(owner); - } - - @Override - protected void onThrow( int cell ) { - Char enemy = Actor.findChar( cell ); - if (enemy == null || enemy == curUser) { - parent = null; - Splash.at( cell, 0xCC99FFFF, 1 ); - } else { - if (!curUser.shoot( enemy, this )) { - Splash.at(cell, 0xCC99FFFF, 1); - } - } - } - - @Override - public void proc(Char attacker, Char defender, int damage) { - if (spammo != null) { - spammo.onHit(GunWeapon.this, attacker, defender, damage); - } - super.proc(attacker, defender, damage); - } - - int flurryCount = -1; - - @Override - public void cast(final Hero user, final int dst) { - final int cell = throwPos( user, dst ); - GunWeapon.this.targetPos = cell; - charge--; - super.cast(user, dst); - } - - } - - private CellSelector.Listener shooter = new CellSelector.Listener() { - @Override - public void onSelect( Integer target ) { - if (target != null) { - Ammo().cast(curUser, target); - } - } - @Override - public String prompt() { - return Messages.get(GunWeapon.class, "prompt"); - } - }; -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/items/weapon/guns/Sling.java b/java/com/hmdzl/spspd/change/items/weapon/guns/Sling.java deleted file mode 100644 index fc50f0ab..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/guns/Sling.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.weapon.guns; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.Splash; -import com.hmdzl.spspd.change.items.KindOfWeapon; -import com.hmdzl.spspd.change.items.weapon.Weapon; -import com.hmdzl.spspd.change.items.weapon.guns.GunWeapon; -import com.hmdzl.spspd.change.items.weapon.melee.MeleeWeapon; -import com.hmdzl.spspd.change.items.weapon.missiles.MissileWeapon; -import com.hmdzl.spspd.change.items.weapon.spammo.SpAmmo; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.CellSelector; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.utils.Random; - -public class Sling extends GunWeapon { - - { - //name = "Sling"; - image = ItemSpriteSheet.SLING; - } - - public Sling() { - super(0, 1); - STR = 8; - MIN = 3; - MAX = 7; - } - - public Item upgrade() { - MIN++; - MAX += 2; - return super.upgrade(); - } - - @Override - public int damageRoll(Hero owner) { - return Random.Int(MIN, MAX) / 2; - } -} - - - diff --git a/java/com/hmdzl/spspd/change/items/weapon/guns/ToyGun.java b/java/com/hmdzl/spspd/change/items/weapon/guns/ToyGun.java deleted file mode 100644 index 2b6d9092..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/guns/ToyGun.java +++ /dev/null @@ -1,301 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.weapon.guns; - -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.Splash; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.wands.WandOfFlow; -import com.hmdzl.spspd.change.items.weapon.Weapon; -import com.hmdzl.spspd.change.items.weapon.guns.ToyGun; -import com.hmdzl.spspd.change.items.weapon.melee.MeleeWeapon; -import com.hmdzl.spspd.change.items.weapon.missiles.MissileWeapon; -import com.hmdzl.spspd.change.items.weapon.spammo.SpAmmo; -import com.hmdzl.spspd.change.mechanics.Ballistica; -import com.hmdzl.spspd.change.scenes.CellSelector; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Paralysis; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.KindOfWeapon; -import com.hmdzl.spspd.change.messages.Messages; - -import java.util.ArrayList; - -public class ToyGun extends Weapon { - - /*{ - //name = "ToyGun"; - - } - - public ToyGun() { - super(1); - }*/ - - public static final String AC_SHOOT = "SHOOT"; - public static final String AC_RELOAD = "RELOAD"; - - private int tier = 1; - - public int charge = 0; - public int maxammo = 100; - public int fullcharge = 10; - - public ToyGun() { - super(); - - this.tier = tier; - - //AMMO = ammo - - STR = typicalSTR(); - - MIN = min(); - MAX = max(); - - reinforced = true; - } - - - private int min() { - return 1; - } - - private int max() { - return 10; - } - - public int typicalSTR() { - return 10; - } - - public Item upgrade() { - MIN += 1; - MAX += 3; - maxammo += 10; - - return super.upgrade(); - } - - @Override - public int price() { - int price = 100 ; - if (enchantment != null) { - price *= 1.5; - } - if (cursed && cursedKnown) { - price /= 2; - } - if (levelKnown) { - if (level > 0) { - price *= (level + 1); - } else if (level < 0) { - price /= (1 - level); - } - } - if (price < 1) { - price = 1; - } - return price; - } - - { - image = ItemSpriteSheet.TOYGUN; - - defaultAction = AC_SHOOT; - usesTargeting = true; - - - } - - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions(hero); - //actions.remove(AC_EQUIP); - if (isEquipped(hero)){ - actions.add(AC_SHOOT); - actions.add(AC_RELOAD); - } - return actions; - } - - @Override - public void execute(Hero hero, String action) { - super.execute(hero, action); - if (action.equals(AC_SHOOT)) { - if (!isEquipped( hero )) - GLog.i( Messages.get(ToyGun.class, "need_to_equip") ); - else if (charge<1){ - if ( maxammo < 1 ){ - GLog.n(Messages.get(ToyGun.class, "empty")); - } else { - if (durable() && maxammo > 0){ - maxammo = Math.max( maxammo - ( fullcharge - charge),0); - } - charge = Math.min(fullcharge,maxammo); - hero.sprite.showStatus(CharSprite.DEFAULT, Messages.get(this, "reloading")); - hero.spendAndNext(3f); - } - } else GameScene.selectCell( shooter ); - } else if(action.equals(AC_RELOAD)){ - if (!isEquipped( hero )) - GLog.i( Messages.get(ToyGun.class, "need_to_equip") ); - else if (charge == fullcharge){ - GLog.n(Messages.get(ToyGun.class,"full")); - } else if ( maxammo < 1 ){ - GLog.n(Messages.get(ToyGun.class, "empty")); - } else { - if (durable() && maxammo > 0){ - maxammo = Math.max( maxammo - ( fullcharge - charge),0); - } - float reloadtime = (fullcharge - charge)/2; - hero.spendAndNext(reloadtime*1f); - hero.sprite.showStatus(CharSprite.DEFAULT, Messages.get(this, "reloading")); - charge = Math.min(fullcharge,maxammo); - - } - } - } - - private static final String CHARGE = "charge"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put( CHARGE, charge ); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - charge = bundle.getInt( CHARGE ); - } - - @Override - public int damageRoll(Hero owner) { - return 0; - } - - public int damageRoll2(Hero owner) { - return Random.Int(MAX,MIN); - } - - @Override - public void proc(Char attacker, Char defender, int damage) { - - int oppositeDefender = defender.pos + (defender.pos - attacker.pos); - Ballistica trajectory = new Ballistica(defender.pos, oppositeDefender, Ballistica.MAGIC_BOLT); - WandOfFlow.throwChar(defender, trajectory, 1); - } - - @Override - public String info() { - String info = desc(); - - - info += "\n\n" + Messages.get(ToyGun.class, "stats_known", tier, MIN, MAX, STR); - - String stats_desc = Messages.get(this, "stats_desc"); - if (!stats_desc.equals("")) info+= "\n\n" + stats_desc; - //Messages.get(MeleeWeapon.class, "stats_known", tier, MIN, MAX,STR,ACU,DLY,RCH ) - - if (reinforced) { - info += "\n" + Messages.get(Item.class, "reinforced"); - } - - info += "\n " + Messages.get(ToyGun.class, "charge", charge, fullcharge); - - return info; - } - - @Override - public String status() { - if (levelKnown) { - return charge + "/" + fullcharge; - } else { - return null; - } - } - - private int targetPos; - - @Override - public boolean isUpgradable() { - return true; - } - - public ToyAmmo Ammo(){ - return new ToyAmmo(); - } - - public class ToyAmmo extends MissileWeapon { - - { - image = ItemSpriteSheet.AMMO; - } - - public int damageRoll(Hero owner) { - return ToyGun.this.damageRoll2(owner); - } - - @Override - protected void onThrow( int cell ) { - Char enemy = Actor.findChar( cell ); - if (enemy == null || enemy == curUser) { - parent = null; - Splash.at( cell, 0xCC99FFFF, 1 ); - } else { - if (!curUser.shoot( enemy, this )) { - Splash.at(cell, 0xCC99FFFF, 1); - } - } - } - - int flurryCount = -1; - - @Override - public void cast(final Hero user, final int dst) { - final int cell = throwPos( user, dst ); - ToyGun.this.targetPos = cell; - charge--; - super.cast(user, dst); - } - } - - private CellSelector.Listener shooter = new CellSelector.Listener() { - @Override - public void onSelect( Integer target ) { - if (target != null) { - Ammo().cast(curUser, target); - } - } - @Override - public String prompt() { - return Messages.get(ToyGun.class, "prompt"); - } - }; -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/items/weapon/melee/AssassinsBlade.java b/java/com/hmdzl/spspd/change/items/weapon/melee/AssassinsBlade.java deleted file mode 100644 index 7161f948..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/melee/AssassinsBlade.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.weapon.melee; - -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.weapon.melee.MeleeWeapon; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.utils.Random; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.KindOfWeapon; -import com.hmdzl.spspd.change.messages.Messages; - -public class AssassinsBlade extends MeleeWeapon { - - { - //name = "AssassinsBlade"; - image = ItemSpriteSheet.ASSASSINSBLADE; - } - - public AssassinsBlade() { - super(4, 1f, 1f, 1); - } - - @Override - public Item upgrade(boolean enchant) { - MIN+=3; - MAX+=1; - return super.upgrade(enchant); - } - - @Override - public void proc(Char attacker, Char defender, int damage) { - int DMG = damage; - if (Random.Int(100) < 50 ){ - defender.damage(Random.Int(DMG/4,DMG/2), this); - } - if (enchantment != null) { - enchantment.proc(this, attacker, defender, damage); - } - if (durable() && attacker == Dungeon.hero){ - durable --; - if (durable == 10){ - GLog.n(Messages.get(KindOfWeapon.class,"almost_destory")); - } - if (durable == 0){ - Dungeon.hero.belongings.weapon = null; - GLog.n(Messages.get(KindOfWeapon.class,"destory")); - } - } - } -} diff --git a/java/com/hmdzl/spspd/change/items/weapon/melee/BattleAxe.java b/java/com/hmdzl/spspd/change/items/weapon/melee/BattleAxe.java deleted file mode 100644 index d8575098..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/melee/BattleAxe.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.weapon.melee; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.KindOfWeapon; -import com.hmdzl.spspd.change.items.weapon.melee.MeleeWeapon; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.utils.Random; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Bleeding; - - -public class BattleAxe extends MeleeWeapon { - - { - //name = "battle axe"; - image = ItemSpriteSheet.BATTLE_AXE; - } - - public BattleAxe() { - super(4, 1f, 1f, 1); - } - - @Override - public Item upgrade(boolean enchant) { - - if (ACU < 1.2f){ - ACU+=0.05f; - } - - if (ACU > 1.2f && DLY > 0.9f) { - DLY-=0.05f; - } - - MAX+=6; - - return super.upgrade(enchant); - } - - @Override - public void proc(Char attacker, Char defender, int damage) { - - int DMG = damage; - if (Random.Int(100) < 20) { - Buff.affect(defender, Bleeding.class).set(Random.Int(4,DMG)); - } - if (enchantment != null) { - enchantment.proc(this, attacker, defender, damage); - } - if (durable() && attacker == Dungeon.hero){ - durable --; - if (durable == 10){ - GLog.n(Messages.get(KindOfWeapon.class,"almost_destory")); - } - if (durable == 0){ - Dungeon.hero.belongings.weapon = null; - GLog.n(Messages.get(KindOfWeapon.class,"destory")); - } - } - } -} diff --git a/java/com/hmdzl/spspd/change/items/weapon/melee/Club.java b/java/com/hmdzl/spspd/change/items/weapon/melee/Club.java deleted file mode 100644 index 801a5437..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/melee/Club.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.weapon.melee; - -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.weapon.melee.MeleeWeapon; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.utils.Random; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Paralysis; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.KindOfWeapon; -import com.hmdzl.spspd.change.messages.Messages; - -public class Club extends MeleeWeapon { - - { - //name = "Club"; - image = ItemSpriteSheet.CLUB; - } - - public Club() { - super(4, 1f, 1f, 1); - } - - @Override - public Item upgrade(boolean enchant) { - - if (ACU < 1.50f){ - ACU+=0.05f; - } - - MIN+=3; - MAX+=1; - - return super.upgrade(enchant); - } - - @Override - public void proc(Char attacker, Char defender, int damage) { - - if (Random.Int(100) < 15) { - Buff.prolong(defender, Paralysis.class, 2); - } - - if (enchantment != null) { - enchantment.proc(this, attacker, defender, damage); - } - if (durable() && attacker == Dungeon.hero){ - durable --; - if (durable == 10){ - GLog.n(Messages.get(KindOfWeapon.class,"almost_destory")); - } - if (durable == 0){ - Dungeon.hero.belongings.weapon = null; - GLog.n(Messages.get(KindOfWeapon.class,"destory")); - } - } - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/items/weapon/melee/Dagger.java b/java/com/hmdzl/spspd/change/items/weapon/melee/Dagger.java deleted file mode 100644 index 906b3af8..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/melee/Dagger.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.weapon.melee; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.items.KindOfWeapon; -import com.hmdzl.spspd.change.items.weapon.Weapon; -import com.hmdzl.spspd.change.items.weapon.melee.MeleeWeapon; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.utils.Random; - -public class Dagger extends MeleeWeapon { - - { - //name = "dagger"; - image = ItemSpriteSheet.DAGGER; - } - - public Dagger() { - super(1, 1f, 1f, 1); - MIN = 1; - MAX = 10; - } - - @Override - public Item upgrade(boolean enchant) { - - if (ACU < 4f) { - ACU+=0.2f; - } - - MIN+=1; - MAX+=1; - - return super.upgrade(enchant); - } - - @Override - public void proc(Char attacker, Char defender, int damage) { - - int DMG = damage; - defender.damage(Random.Int(DMG/2,DMG/4*3), this); - if (enchantment != null) { - enchantment.proc(this, attacker, defender, damage); - } - if (durable() && attacker == Dungeon.hero){ - durable --; - if (durable == 10){ - GLog.n(Messages.get(KindOfWeapon.class,"almost_destory")); - } - if (durable == 0){ - Dungeon.hero.belongings.weapon = null; - GLog.n(Messages.get(KindOfWeapon.class,"destory")); - } - } - } -} diff --git a/java/com/hmdzl/spspd/change/items/weapon/melee/FightGloves.java b/java/com/hmdzl/spspd/change/items/weapon/melee/FightGloves.java deleted file mode 100644 index 5a490e4f..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/melee/FightGloves.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.weapon.melee; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.buffs.Paralysis; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.KindOfWeapon; -import com.hmdzl.spspd.change.items.weapon.melee.MeleeWeapon; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Cripple; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.utils.Random; - -public class FightGloves extends MeleeWeapon { - - { - //name = "FightGloves"; - image = ItemSpriteSheet.FIGHTGLOVES; - } - - public FightGloves() { - super(2, 1f, 1f, 1); - } - - @Override - public Item upgrade(boolean enchant) { - - if (ACU < 1.50f){ - ACU+=0.1f; - } - if (ACU > 1.45f && DLY> 0.55f){ - DLY-=0.1f; - } - if (DLY < 0.55f && RCH < 2){ - RCH ++; - } - MIN+=1; - MAX+=1; - - return super.upgrade(enchant); - } - - @Override - public void proc(Char attacker, Char defender, int damage) { - - if (Random.Int(100) < 40) { - Buff.prolong(defender, Paralysis.class, 2); - } - if (enchantment != null) { - enchantment.proc(this, attacker, defender, damage); - } - if (durable() && attacker == Dungeon.hero){ - durable --; - if (durable == 10){ - GLog.n(Messages.get(KindOfWeapon.class,"almost_destory")); - } - if (durable == 0){ - Dungeon.hero.belongings.weapon = null; - GLog.n(Messages.get(KindOfWeapon.class,"destory")); - } - } - } - -} diff --git a/java/com/hmdzl/spspd/change/items/weapon/melee/Flute.java b/java/com/hmdzl/spspd/change/items/weapon/melee/Flute.java deleted file mode 100644 index e9b7e94b..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/melee/Flute.java +++ /dev/null @@ -1,125 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.weapon.melee; - -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.buffs.Burning; -import com.hmdzl.spspd.change.actors.buffs.Dry; -import com.hmdzl.spspd.change.actors.buffs.Hot; -import com.hmdzl.spspd.change.actors.buffs.Light; -import com.hmdzl.spspd.change.actors.buffs.Terror; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.effects.particles.FlameParticle; -import com.hmdzl.spspd.change.items.Generator; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.KindOfWeapon; -import com.hmdzl.spspd.change.items.weapon.melee.MeleeWeapon; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Paralysis; -import com.watabou.utils.Random; -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.hero.HeroSubClass; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.bags.Bag; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfRecharging; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfUpgrade; -import com.hmdzl.spspd.change.items.wands.*; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.utils.GLog; -import com.hmdzl.spspd.change.windows.WndBag; -import com.hmdzl.spspd.change.windows.WndOptions; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundle; -import java.util.ArrayList; -import java.util.Collections; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.KindOfWeapon; -import com.hmdzl.spspd.change.messages.Messages; - -public class Flute extends MeleeWeapon { - - { - //name = "Flute"; - image = ItemSpriteSheet.FLUTE; - } - - public Flute() { - super(2, 1f, 1f, 2); - } - - - @Override - public Item upgrade(boolean enchant) { - - if (ACU < 1.1f) { - ACU+=0.05f; - } - - if (ACU > 1.1f && DLY > 0.9f){ - DLY-=0.05f; - } - - if (DLY < 0.9f && RCH < 3){ - RCH++; - } - - MAX+=4; - return super.upgrade(enchant); - } - - @Override - public void proc(Char attacker, Char defender, int damage) { - - int p = defender.pos; - for (int n : Level.NEIGHBOURS8) { - Char ch = Actor.findChar(n+p); - if (ch != null && ch != defender && ch != attacker && ch.isAlive()) { - - int dr = Random.IntRange( 0, 1 ); - int dmg = Random.Int( MIN, MAX ); - int effectiveDamage = Math.max( dmg - dr, 0 ); - - ch.damage( effectiveDamage/2, this ); - } - } - - - if (enchantment != null) { - enchantment.proc(this, attacker, defender, damage); - } - - if (durable() && attacker == Dungeon.hero){ - durable --; - if (durable == 10){ - GLog.n(Messages.get(KindOfWeapon.class,"almost_destory")); - } - if (durable == 0){ - Dungeon.hero.belongings.weapon = null; - GLog.n(Messages.get(KindOfWeapon.class,"destory")); - } - } - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/items/weapon/melee/Glaive.java b/java/com/hmdzl/spspd/change/items/weapon/melee/Glaive.java deleted file mode 100644 index 53de1598..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/melee/Glaive.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.weapon.melee; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.items.KindOfWeapon; -import com.hmdzl.spspd.change.items.weapon.melee.MeleeWeapon; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Cripple; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.utils.Random; - -public class Glaive extends MeleeWeapon { - - { - //name = "glaive"; - image = ItemSpriteSheet.GLAIVE; - } - - public Glaive() { - super(4, 1f, 1.75f, 2); - } - - @Override - public Item upgrade(boolean enchant) { - - if (DLY > 1.4f) { - DLY -=0.05f; - } - MIN += 1; - MAX += 6; - return super.upgrade(enchant); - } - - @Override - public void proc(Char attacker, Char defender, int damage) { - - if (Random.Int(100) < 20) { - Buff.affect(defender, Cripple.class, 3); - } - if (enchantment != null) { - enchantment.proc(this, attacker, defender, damage); - } - - if (durable() && attacker == Dungeon.hero){ - durable --; - if (durable == 10){ - GLog.n(Messages.get(KindOfWeapon.class,"almost_destory")); - } - if (durable == 0){ - Dungeon.hero.belongings.weapon = null; - GLog.n(Messages.get(KindOfWeapon.class,"destory")); - } - } - } -} diff --git a/java/com/hmdzl/spspd/change/items/weapon/melee/Gsword.java b/java/com/hmdzl/spspd/change/items/weapon/melee/Gsword.java deleted file mode 100644 index abf2ec42..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/melee/Gsword.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.weapon.melee; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.items.KindOfWeapon; -import com.hmdzl.spspd.change.items.weapon.melee.MeleeWeapon; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.utils.Random; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Bleeding; - - -public class Gsword extends MeleeWeapon { - - { - //name = "great sword"; - image = ItemSpriteSheet.GSWORD; - } - - public Gsword() { - super(5, 1f, 1f ,1); - } - - @Override - public Item upgrade(boolean enchant) { - MIN +=3; - MAX +=1; - return super.upgrade(enchant); - } - - @Override - public void proc(Char attacker, Char defender, int damage) { - - int DMG = damage; - if (Random.Int(100) < 10) { - Buff.affect(defender, Bleeding.class).set(Random.Int(5,DMG)); - } - if (enchantment != null) { - enchantment.proc(this, attacker, defender, damage); - } - - if (durable() && attacker == Dungeon.hero){ - durable --; - if (durable == 10){ - GLog.n(Messages.get(KindOfWeapon.class,"almost_destory")); - } - if (durable == 0){ - Dungeon.hero.belongings.weapon = null; - GLog.n(Messages.get(KindOfWeapon.class,"destory")); - } - } - } - -} diff --git a/java/com/hmdzl/spspd/change/items/weapon/melee/Halberd.java b/java/com/hmdzl/spspd/change/items/weapon/melee/Halberd.java deleted file mode 100644 index cd97e33a..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/melee/Halberd.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.weapon.melee; - -import com.hmdzl.spspd.change.items.weapon.melee.MeleeWeapon; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Cripple; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.utils.Random; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.KindOfWeapon; -import com.hmdzl.spspd.change.messages.Messages; - -public class Halberd extends MeleeWeapon { - - { - //name = "halberd"; - image = ItemSpriteSheet.HALBERD; - } - - public Halberd() { - super(5, 1f, 2f ,2); - } - - @Override - public Item upgrade(boolean enchant) { - - if (DLY > 1.50f){ - DLY-=0.05f; - } - MAX+=5; - return super.upgrade(enchant); - } - - @Override - public void proc(Char attacker, Char defender, int damage) { - - if (Random.Int(100) < 10) { - Buff.affect(defender, Cripple.class, 3); - } - if (enchantment != null) { - enchantment.proc(this, attacker, defender, damage); - } - - if (durable() && attacker == Dungeon.hero){ - durable --; - if (durable == 10){ - GLog.n(Messages.get(KindOfWeapon.class,"almost_destory")); - } - if (durable == 0){ - Dungeon.hero.belongings.weapon = null; - GLog.n(Messages.get(KindOfWeapon.class,"destory")); - } - } - - } -} diff --git a/java/com/hmdzl/spspd/change/items/weapon/melee/Handaxe.java b/java/com/hmdzl/spspd/change/items/weapon/melee/Handaxe.java deleted file mode 100644 index 14e77d6f..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/melee/Handaxe.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.weapon.melee; - -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Bleeding; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.utils.Random; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.KindOfWeapon; -import com.hmdzl.spspd.change.messages.Messages; - -public class Handaxe extends MeleeWeapon { - - { - //name = "hand axe"; - image = ItemSpriteSheet.HANDAXE; - } - - public Handaxe() { - super(2, 1f, 1f, 1); - } - - @Override - public Item upgrade(boolean enchant) { - - if (ACU < 1.5f){ - ACU+=0.1f; - } - - if (ACU > 1.4f && STR > 10) { - STR--; - } - - MIN+=2; - MAX+=3; - - return super.upgrade(enchant); - } - - @Override - public void proc(Char attacker, Char defender, int damage) { - - int DMG = damage; - if (Random.Int(100) < 40) { - Buff.affect(defender, Bleeding.class).set(Random.Int(2,DMG)); - } - if (enchantment != null) { - enchantment.proc(this, attacker, defender, damage); - } - if (durable() && attacker == Dungeon.hero){ - durable --; - if (durable == 10){ - GLog.n(Messages.get(KindOfWeapon.class,"almost_destory")); - } - if (durable == 0){ - Dungeon.hero.belongings.weapon = null; - GLog.n(Messages.get(KindOfWeapon.class,"destory")); - } - } - } -} diff --git a/java/com/hmdzl/spspd/change/items/weapon/melee/Harp.java b/java/com/hmdzl/spspd/change/items/weapon/melee/Harp.java deleted file mode 100644 index 5c8b386e..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/melee/Harp.java +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.weapon.melee; - -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.buffs.Burning; -import com.hmdzl.spspd.change.actors.buffs.Dry; -import com.hmdzl.spspd.change.actors.buffs.Hot; -import com.hmdzl.spspd.change.actors.buffs.Light; -import com.hmdzl.spspd.change.actors.buffs.Terror; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.effects.particles.FlameParticle; -import com.hmdzl.spspd.change.items.Generator; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.weapon.melee.MeleeWeapon; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Paralysis; -import com.watabou.utils.Random; -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.hero.HeroSubClass; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.bags.Bag; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfRecharging; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfUpgrade; -import com.hmdzl.spspd.change.items.wands.*; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.utils.GLog; -import com.hmdzl.spspd.change.windows.WndBag; -import com.hmdzl.spspd.change.windows.WndOptions; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundle; -import java.util.ArrayList; -import java.util.Collections; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.KindOfWeapon; -import com.hmdzl.spspd.change.messages.Messages; - -public class Harp extends MeleeWeapon { - - { - //name = "Harp"; - image = ItemSpriteSheet.HARP; - } - - public Harp() { - super(5, 1f, 1f, 2); - } - - - @Override - public Item upgrade(boolean enchant) { - MIN+=4; - return super.upgrade(enchant); - } - - @Override - public void proc(Char attacker, Char defender, int damage) { - - int p = defender.pos; - for (int n : Level.NEIGHBOURS8) { - Char ch = Actor.findChar(n+p); - if (ch != null && ch != defender && ch != attacker && ch.isAlive()) { - - int dr = Random.IntRange( 0, 1 ); - int dmg = Random.Int( MIN, MAX ); - int effectiveDamage = Math.max( dmg - dr, 0 ); - - ch.damage( effectiveDamage/4, this ); - } - } - - if (enchantment != null) { - enchantment.proc(this, attacker, defender, damage); - } - if (durable() && attacker == Dungeon.hero){ - durable --; - if (durable == 10){ - GLog.n(Messages.get(KindOfWeapon.class,"almost_destory")); - } - if (durable == 0){ - Dungeon.hero.belongings.weapon = null; - GLog.n(Messages.get(KindOfWeapon.class,"destory")); - } - } - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/items/weapon/melee/HolyWater.java b/java/com/hmdzl/spspd/change/items/weapon/melee/HolyWater.java deleted file mode 100644 index 1954bbc7..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/melee/HolyWater.java +++ /dev/null @@ -1,127 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.weapon.melee; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.quest.DarkGold; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfUpgrade; -import com.hmdzl.spspd.change.items.weapon.Weapon; -import com.hmdzl.spspd.change.items.weapon.missiles.Boomerang; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.hmdzl.spspd.change.windows.WndBag; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Bleeding; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.KindOfWeapon; -import com.hmdzl.spspd.change.messages.Messages; - -public class HolyWater extends MeleeWeapon { - - { - //name = "holywater"; - image = ItemSpriteSheet.HOLY_WATER; - - - } - - public HolyWater() { - super(3, 0.8f, 1f, 1); - } - - public static int charge = 0; - private static final String CHARGE = "charge"; - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(CHARGE, charge); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - charge = bundle.getInt(CHARGE); - } - - - - @Override - public Item upgrade(boolean enchant) { - if (ACU < 1.2f) { - ACU+=0.05f; - } - - if (ACU > 1.2f && DLY > 0.8f){ - DLY-=0.05f; - } - - MIN+=2; - MAX+=1; - - return super.upgrade(enchant); - } - - - @Override - public void proc(Char attacker, Char defender, int damage) { - - int DMG = damage; - - if (charge >= 14) { - defender.damage(5*damage ,this); - attacker.HP += damage; - charge = 0; - } - - if (enchantment != null) { - enchantment.proc(this, attacker, defender, damage); - } - - charge++; - if (durable() && attacker == Dungeon.hero){ - durable --; - if (durable == 10){ - GLog.n(Messages.get(KindOfWeapon.class,"almost_destory")); - } - if (durable == 0){ - Dungeon.hero.belongings.weapon = null; - GLog.n(Messages.get(KindOfWeapon.class,"destory")); - } - } - } - - @Override - public String desc() { - String info = super.desc(); - - info += "\n\n" + Messages.get(Weapon.class, "charge",charge,14); - return info; - } -} diff --git a/java/com/hmdzl/spspd/change/items/weapon/melee/Knuckles.java b/java/com/hmdzl/spspd/change/items/weapon/melee/Knuckles.java deleted file mode 100644 index 07598b02..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/melee/Knuckles.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.weapon.melee; - -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.weapon.melee.MeleeWeapon; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Cripple; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.utils.Random; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.KindOfWeapon; -import com.hmdzl.spspd.change.messages.Messages; - -public class Knuckles extends MeleeWeapon { - - { - //name = "knuckleduster"; - image = ItemSpriteSheet.KNUCKLEDUSTER; - } - - public Knuckles() { - super(1, 1f, 1f, 1); - } - - @Override - public Item upgrade(boolean enchant) { - - if (DLY > 0.40f){ - DLY-=0.05f; - } - if (DLY < 0.45f && RCH < 2){ - RCH ++; - } - MIN+=1; - MAX+=1; - - return super.upgrade(enchant); - } - - @Override - public void proc(Char attacker, Char defender, int damage) { - - if (Random.Int(100) < 70) { - Buff.affect(defender, Cripple.class, 3); - } - if (enchantment != null) { - enchantment.proc(this, attacker, defender, damage); - } - if (durable() && attacker == Dungeon.hero){ - durable --; - if (durable == 10){ - GLog.n(Messages.get(KindOfWeapon.class,"almost_destory")); - } - if (durable == 0){ - Dungeon.hero.belongings.weapon = null; - GLog.n(Messages.get(KindOfWeapon.class,"destory")); - } - } - } -} diff --git a/java/com/hmdzl/spspd/change/items/weapon/melee/Lance.java b/java/com/hmdzl/spspd/change/items/weapon/melee/Lance.java deleted file mode 100644 index 47365523..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/melee/Lance.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.weapon.melee; - -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.weapon.melee.MeleeWeapon; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.utils.Random; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.KindOfWeapon; -import com.hmdzl.spspd.change.messages.Messages; - -public class Lance extends MeleeWeapon { - - { - //name = "Lance"; - image = ItemSpriteSheet.LANCE; - } - - public Lance() { - super(5, 1f, 1f, 1); - } - - @Override - public Item upgrade(boolean enchant) { - MIN+=1; - MAX+=3; - return super.upgrade(enchant); - } - - @Override - public void proc(Char attacker, Char defender, int damage) { - - int DMG = damage; - if (Random.Int(4) == 0 ){ - defender.damage(Random.Int(DMG/4,DMG/2), this); - } - if (enchantment != null) { - enchantment.proc(this, attacker, defender, damage); - } - if (durable() && attacker == Dungeon.hero){ - durable --; - if (durable == 10){ - GLog.n(Messages.get(KindOfWeapon.class,"almost_destory")); - } - if (durable == 0){ - Dungeon.hero.belongings.weapon = null; - GLog.n(Messages.get(KindOfWeapon.class,"destory")); - } - } - - } -} diff --git a/java/com/hmdzl/spspd/change/items/weapon/melee/Mace.java b/java/com/hmdzl/spspd/change/items/weapon/melee/Mace.java deleted file mode 100644 index 8ea0d349..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/melee/Mace.java +++ /dev/null @@ -1,129 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.weapon.melee; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.quest.DarkGold; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfUpgrade; -import com.hmdzl.spspd.change.items.weapon.Weapon; -import com.hmdzl.spspd.change.items.weapon.missiles.Boomerang; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.hmdzl.spspd.change.windows.WndBag; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Bleeding; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.KindOfWeapon; -import com.hmdzl.spspd.change.messages.Messages; - -public class Mace extends MeleeWeapon { - - { - //name = "mace"; - image = ItemSpriteSheet.MACE; - - - } - - public Mace() { - super(2, 0.8f, 1f, 1); - } - - public static int charge = 0; - private static final String CHARGE = "charge"; - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(CHARGE, charge); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - charge = bundle.getInt(CHARGE); - } - - - - @Override - public Item upgrade(boolean enchant) { - if (ACU < 1.2f) { - ACU+=0.05f; - } - - if (ACU > 1.2f && DLY > 0.8f){ - DLY-=0.05f; - } - - if (DLY < 0.8f && RCH < 2){ - RCH++; - } - - MIN+=2; - MAX+=1; - return super.upgrade(enchant); - } - - - @Override - public void proc(Char attacker, Char defender, int damage) { - - int DMG = damage; - - if (charge >= 11) { - defender.damage(5*damage ,this); - charge = 0; - } - - if (enchantment != null) { - enchantment.proc(this, attacker, defender, damage); - } - - charge++; - if (durable() && attacker == Dungeon.hero){ - durable --; - if (durable == 10){ - GLog.n(Messages.get(KindOfWeapon.class,"almost_destory")); - } - if (durable == 0){ - Dungeon.hero.belongings.weapon = null; - GLog.n(Messages.get(KindOfWeapon.class,"destory")); - } - } - } - - @Override - public String desc() { - String info = super.desc(); - - info += "\n\n" + Messages.get(Weapon.class, "charge",charge,11); - return info; - } -} diff --git a/java/com/hmdzl/spspd/change/items/weapon/melee/MageBook.java b/java/com/hmdzl/spspd/change/items/weapon/melee/MageBook.java deleted file mode 100644 index daaba1e0..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/melee/MageBook.java +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.weapon.melee; - -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Paralysis; -import com.watabou.utils.Random; -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.hero.HeroSubClass; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.bags.Bag; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfRecharging; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfUpgrade; -import com.hmdzl.spspd.change.items.wands.*; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.utils.GLog; -import com.hmdzl.spspd.change.windows.WndBag; -import com.hmdzl.spspd.change.windows.WndOptions; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundle; -import java.util.ArrayList; -import java.util.Collections; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.KindOfWeapon; -import com.hmdzl.spspd.change.messages.Messages; - -public class MageBook extends MeleeWeapon { - - { - //name = "Mage Book"; - image = ItemSpriteSheet.MAGEBOOK; - - usesTargeting = true; - } - - public MageBook() { - super(1, 1f, 1f, 1); - MIN = 1; - MAX = 10; - } - - - @Override - public Item upgrade(boolean enchant) { - - if (STR > 1) { - STR --; - } - MIN+=1; - MAX+=1; - return super.upgrade(enchant); - } - - @Override - public void proc(Char attacker, Char defender, int damage) { - /*if (wand != null && Dungeon.hero.subClass == HeroSubClass.BATTLEMAGE) { - if (wand.curCharges < wand.maxCharges) wand.curCharge += 0.33f; - ScrollOfRecharging.charge((Hero)attacker); - wand.onHit(this, attacker, defender, damage); - }*/ - if (Random.Int(100) < 50) { - Buff.prolong(defender, Paralysis.class, 2); - } - if (enchantment != null) { - enchantment.proc(this, attacker, defender, damage); - } - if (durable() && attacker == Dungeon.hero){ - durable --; - if (durable == 10){ - GLog.n(Messages.get(KindOfWeapon.class,"almost_destory")); - } - if (durable == 0){ - Dungeon.hero.belongings.weapon = null; - GLog.n(Messages.get(KindOfWeapon.class,"destory")); - } - } - } -} diff --git a/java/com/hmdzl/spspd/change/items/weapon/melee/MeleeWeapon.java b/java/com/hmdzl/spspd/change/items/weapon/melee/MeleeWeapon.java deleted file mode 100644 index f9de91cb..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/melee/MeleeWeapon.java +++ /dev/null @@ -1,181 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.weapon.melee; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Cripple; -import com.hmdzl.spspd.change.actors.buffs.Bleeding; -import com.hmdzl.spspd.change.actors.buffs.Paralysis; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.weapon.Weapon; -import com.hmdzl.spspd.change.items.weapon.Weapon.Enchantment; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.actors.Char; - -import com.watabou.utils.Random; - -import java.text.DecimalFormat; - -public class MeleeWeapon extends Weapon { - - private int tier; - - - public MeleeWeapon(int tier, float acu, float dly, int rch /*, int dur*/) { - super(); - - this.tier = tier; - - ACU = acu; - DLY = dly; - RCH = rch; - //DUR = 10; - - STR = typicalSTR(); - - MIN = min(); - MAX = max(); - } - - private int min() { - return tier; - } - - private int max() { - return (int) (((tier * tier - tier + 10) / ACU * DLY )/ (0.8 + 0.2*RCH) ); - } - - /*@Override - public void proc(Char attacker, Char defender, int damage) { - - if (enchantment != null) { - enchantment.proc(this, attacker, defender, damage); - } - - }*/ - - @Override - public Item upgrade() { - return upgrade(false); - } - - - public Item upgrade(boolean enchant) { - MIN++; - MAX += tier; - durable += 10; - - return super.upgrade(enchant); - } - - - public Item safeUpgrade() { - return upgrade(enchantment != null); - } - - public Item destory() { - return Dungeon.hero.belongings.weapon = null; - } - - @Override - public Item degrade() { - return super.degrade(); - } - - public int typicalSTR() { - return 8 + tier * 2; - } - - @Override - public String info() { - String name = name(); - - String info = desc(); - - if (levelKnown) { - info += "\n\n" + Messages.get(MeleeWeapon.class, "stats_known", tier, MIN, MAX, STR); - info += "\n\n" + Messages.get(MeleeWeapon.class, "stats_known2",new DecimalFormat("#.##").format(ACU), new DecimalFormat("#.##").format(DLY), RCH); - if (Dungeon.hero.STR() > typicalSTR()){ - info += " " + Messages.get(MeleeWeapon.class, "excess_str", Dungeon.hero.STR() - typicalSTR()); - } - } else { - info += "\n" + Messages.get(MeleeWeapon.class, "stats_unknown", tier, min(), max(), typicalSTR()); - } - - String stats_desc = Messages.get(this, "stats_desc"); - if (!stats_desc.equals("")) info+= " " + stats_desc; - - //Messages.get(MeleeWeapon.class, "stats_known", tier, MIN, MAX,STR,ACU,DLY,RCH ) - - if (enchantment != null) { - info += "\n" + Messages.get(MeleeWeapon.class, "enchanted", enchantment.desc()); - } - - if (reinforced) { - info += "\n" + Messages.get(Item.class, "reinforced"); - } - - if (levelKnown && STR() > Dungeon.hero.STR()) { - info += "\n" + Messages.get(MeleeWeapon.class, "too_heavy"); - } - - if (cursed && isEquipped( Dungeon.hero )) { - info += "\n\n" + Messages.get(MeleeWeapon.class, "cursed_worn"); - } else if (cursedKnown && cursed) { - info += "\n\n" + Messages.get(MeleeWeapon.class, "cursed"); - } - - return info; - } - - @Override - public int price() { - int price = 100 ; - if (enchantment != null) { - price *= 1.5; - } - if (cursed && cursedKnown) { - price /= 2; - } - if (levelKnown) { - if (level > 0) { - price *= (level + 1); - } else if (level < 0) { - price /= (1 - level); - } - } - if (price < 1) { - price = 1; - } - return price; - } - - @Override - public Item random() { - super.random(); - - if (Random.Int(10 + level) == 0) { - enchant(); - } - - return this; - } -} diff --git a/java/com/hmdzl/spspd/change/items/weapon/melee/Nunchakus.java b/java/com/hmdzl/spspd/change/items/weapon/melee/Nunchakus.java deleted file mode 100644 index c033f091..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/melee/Nunchakus.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.weapon.melee; - -import com.hmdzl.spspd.change.actors.buffs.Shieldblock; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.weapon.melee.MeleeWeapon; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.utils.Random; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Paralysis; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.KindOfWeapon; -import com.hmdzl.spspd.change.messages.Messages; - -public class Nunchakus extends MeleeWeapon { - - { - //name = "Nunchakus"; - image = ItemSpriteSheet.NUNCHAKUS; - } - - public Nunchakus() { - super(3, 1f, 1f, 1); - } - - @Override - public Item upgrade(boolean enchant) { - - if (DLY > 0.75f){ - DLY-=0.05f; - } - - MIN+=3; - MAX+=1; - - return super.upgrade(enchant); - } - - @Override - public void proc(Char attacker, Char defender, int damage) { - - if (Random.Int(100) < 20) { - Buff.prolong(defender, Shieldblock.class, 2); - } - - if (enchantment != null) { - enchantment.proc(this, attacker, defender, damage); - } - if (durable() && attacker == Dungeon.hero){ - durable --; - if (durable == 10){ - GLog.n(Messages.get(KindOfWeapon.class,"almost_destory")); - } - if (durable == 0){ - Dungeon.hero.belongings.weapon = null; - GLog.n(Messages.get(KindOfWeapon.class,"destory")); - } - } - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/items/weapon/melee/PrayerWheel.java b/java/com/hmdzl/spspd/change/items/weapon/melee/PrayerWheel.java deleted file mode 100644 index c017625d..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/melee/PrayerWheel.java +++ /dev/null @@ -1,127 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.weapon.melee; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.quest.DarkGold; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfUpgrade; -import com.hmdzl.spspd.change.items.weapon.Weapon; -import com.hmdzl.spspd.change.items.weapon.missiles.Boomerang; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.hmdzl.spspd.change.windows.WndBag; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Bleeding; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.KindOfWeapon; -import com.hmdzl.spspd.change.messages.Messages; - -import static com.hmdzl.spspd.change.effects.SpellSprite.CHARGE; - -public class PrayerWheel extends MeleeWeapon { - - { - //name = "prayerwheel"; - image = ItemSpriteSheet.PRAYER_WHEEL; - - - } - - public PrayerWheel() { - super(4, 0.8f, 1f, 1); - } - - public static int charge = 0; - private static final String CHARGE = "charge"; - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(CHARGE, charge); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - charge = bundle.getInt(CHARGE); - } - - - - @Override - public Item upgrade(boolean enchant) { - if (ACU < 1.2f) { - ACU+=0.05f; - } - - if (ACU > 1.2f && DLY > 0.8f){ - DLY-=0.05f; - } - MIN+=2; - MAX+=2; - - return super.upgrade(enchant); - } - - - @Override - public void proc(Char attacker, Char defender, int damage) { - - int DMG = damage; - - if (charge >= 17) { - defender.damage(5*damage ,this); - charge = 0; - } - - if (enchantment != null) { - enchantment.proc(this, attacker, defender, damage); - } - - charge++; - if (durable() && attacker == Dungeon.hero){ - durable --; - if (durable == 10){ - GLog.n(Messages.get(KindOfWeapon.class,"almost_destory")); - } - if (durable == 0){ - Dungeon.hero.belongings.weapon = null; - GLog.n(Messages.get(KindOfWeapon.class,"destory")); - } - } - } - - @Override - public String desc() { - String info = super.desc(); - - info += "\n\n" + Messages.get(Weapon.class, "charge",charge,17); - return info; - } -} diff --git a/java/com/hmdzl/spspd/change/items/weapon/melee/Rapier.java b/java/com/hmdzl/spspd/change/items/weapon/melee/Rapier.java deleted file mode 100644 index d9594902..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/melee/Rapier.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.weapon.melee; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.effects.Pushing; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.weapon.melee.MeleeWeapon; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.mechanics.Ballistica; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.utils.Random; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.KindOfWeapon; -import com.hmdzl.spspd.change.messages.Messages; - -public class Rapier extends MeleeWeapon { - - { - //name = "Rapier"; - image = ItemSpriteSheet.RAPIER; - } - - public Rapier() { - super(3, 1f, 1f, 2); - } - - @Override - public Item upgrade(boolean enchant) { - - MAX+=4; - return super.upgrade(enchant); - } - - @Override - public void proc(Char attacker, Char defender, int damage) { - - Ballistica route = new Ballistica(attacker.pos, defender.pos, Ballistica.PROJECTILE); - int cell = route.collisionPos; - int dist = Level.distance(attacker.pos, cell); - if (dist == 2) { - cell = route.path.get(route.dist - 1); - Actor.addDelayed(new Pushing(attacker, attacker.pos, cell), -1); - attacker.pos = cell; - if (attacker instanceof Mob) { - Dungeon.level.mobPress((Mob) attacker); - } else { - Dungeon.level.press(cell, attacker); - } - defender.damage(damage,this); - } - - int DMG = damage; - if (Random.Int(100) < 75) { - defender.damage(Random.Int(DMG / 4, DMG / 2), this); - } - - if (enchantment != null) { - enchantment.proc(this, attacker, defender, damage); - } - if (durable() && attacker == Dungeon.hero){ - durable --; - if (durable == 10){ - GLog.n(Messages.get(KindOfWeapon.class,"almost_destory")); - } - if (durable == 0){ - Dungeon.hero.belongings.weapon = null; - GLog.n(Messages.get(KindOfWeapon.class,"destory")); - } - } - } -} diff --git a/java/com/hmdzl/spspd/change/items/weapon/melee/Scimitar.java b/java/com/hmdzl/spspd/change/items/weapon/melee/Scimitar.java deleted file mode 100644 index c77bb295..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/melee/Scimitar.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.weapon.melee; - -import com.hmdzl.spspd.change.actors.buffs.ArmorBreak; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Bleeding; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.utils.Random; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.KindOfWeapon; -import com.hmdzl.spspd.change.messages.Messages; - -public class Scimitar extends MeleeWeapon { - - { - //name = "Scimitar"; - image = ItemSpriteSheet.SCIMITAR; - } - - public Scimitar() { - super(3, 1f, 1f, 1); - } - - @Override - public Item upgrade(boolean enchant) { - - if (ACU < 1.5f){ - ACU+=0.025f; - } - - if (DLY > 0.8f){ - DLY-=0.05f; - } - - MIN += 1; - MAX += 4; - return super.upgrade(enchant); - } - - @Override - public void proc(Char attacker, Char defender, int damage) { - - int DMG = damage; - if (Random.Int(100) < 30) { - Buff.affect(defender, Bleeding.class).set(Random.Int(3,DMG)); - Buff.affect(defender,ArmorBreak.class, 5f).level(30); - } - if (enchantment != null) { - enchantment.proc(this, attacker, defender, damage); - } - if (durable() && attacker == Dungeon.hero){ - durable --; - if (durable == 10){ - GLog.n(Messages.get(KindOfWeapon.class,"almost_destory")); - } - if (durable == 0){ - Dungeon.hero.belongings.weapon = null; - GLog.n(Messages.get(KindOfWeapon.class,"destory")); - } - } - } -} diff --git a/java/com/hmdzl/spspd/change/items/weapon/melee/ShortSword.java b/java/com/hmdzl/spspd/change/items/weapon/melee/ShortSword.java deleted file mode 100644 index 04a2f274..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/melee/ShortSword.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.weapon.melee; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.quest.DarkGold; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfUpgrade; -import com.hmdzl.spspd.change.items.weapon.missiles.Boomerang; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.hmdzl.spspd.change.windows.WndBag; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Random; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Bleeding; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.KindOfWeapon; -import com.hmdzl.spspd.change.messages.Messages; - -public class ShortSword extends MeleeWeapon { - - { - //name = "short sword"; - image = ItemSpriteSheet.SHORT_SWORD; - - - } - - public ShortSword() { - super(1, 1f, 1f, 1); - } - - @Override - public Item upgrade(boolean enchant) { - MIN+=3; - MAX+=3; - return super.upgrade(enchant); - } - - - @Override - public void proc(Char attacker, Char defender, int damage) { - - int DMG = damage; - if (Random.Int(100) < 50) { - Buff.affect(defender, Bleeding.class).set(Random.Int(1,DMG)); - } - - if (enchantment != null) { - enchantment.proc(this, attacker, defender, damage); - } - if (durable() && attacker == Dungeon.hero){ - durable --; - if (durable == 10){ - GLog.n(Messages.get(KindOfWeapon.class,"almost_destory")); - } - if (durable == 0){ - Dungeon.hero.belongings.weapon = null; - GLog.n(Messages.get(KindOfWeapon.class,"destory")); - } - } - } -} diff --git a/java/com/hmdzl/spspd/change/items/weapon/melee/Spear.java b/java/com/hmdzl/spspd/change/items/weapon/melee/Spear.java deleted file mode 100644 index 4622c066..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/melee/Spear.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.weapon.melee; - -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Cripple; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.utils.Random; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.KindOfWeapon; -import com.hmdzl.spspd.change.messages.Messages; - -public class Spear extends MeleeWeapon { - - { - //name = "spear"; - image = ItemSpriteSheet.SPEAR; - } - - public Spear() { - super(2, 1f, 1.5f, 2); - } - - @Override - public Item upgrade(boolean enchant) { - - if (DLY > 1.2f) { - DLY -= 0.05f ; - } - - if (DLY < 1.2f && RCH < 3) { - RCH ++ ; - } - - MIN+=1; - MAX+=4; - - return super.upgrade(enchant); - } - - @Override - public void proc(Char attacker, Char defender, int damage) { - - if (Random.Int(100) < 40) { - Buff.affect(defender, Cripple.class, 3); - } - if (enchantment != null) { - enchantment.proc(this, attacker, defender, damage); - } - if (durable() && attacker == Dungeon.hero){ - durable --; - if (durable == 10){ - GLog.n(Messages.get(KindOfWeapon.class,"almost_destory")); - } - if (durable == 0){ - Dungeon.hero.belongings.weapon = null; - GLog.n(Messages.get(KindOfWeapon.class,"destory")); - } - } - } -} diff --git a/java/com/hmdzl/spspd/change/items/weapon/melee/StoneCross.java b/java/com/hmdzl/spspd/change/items/weapon/melee/StoneCross.java deleted file mode 100644 index 8bb65793..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/melee/StoneCross.java +++ /dev/null @@ -1,125 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.weapon.melee; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.quest.DarkGold; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfUpgrade; -import com.hmdzl.spspd.change.items.weapon.Weapon; -import com.hmdzl.spspd.change.items.weapon.missiles.Boomerang; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.hmdzl.spspd.change.windows.WndBag; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Bleeding; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.KindOfWeapon; -import com.hmdzl.spspd.change.messages.Messages; - -public class StoneCross extends MeleeWeapon { - - { - //name = "stonecross"; - image = ItemSpriteSheet.STONE_CROSS; - - - } - - public StoneCross() { - super(5, 0.8f, 1f, 1); - } - - public static int charge = 0; - private static final String CHARGE = "charge"; - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(CHARGE, charge); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - charge = bundle.getInt(CHARGE); - } - - - - @Override - public Item upgrade(boolean enchant) { - if (ACU < 1.2f) { - ACU+=0.05f; - } - - if (ACU > 1.2f && DLY > 0.8f){ - DLY-=0.05f; - } - MIN+=1; - MAX+=2; - - return super.upgrade(enchant); - } - - - @Override - public void proc(Char attacker, Char defender, int damage) { - - int DMG = damage; - - if (charge >= 20) { - defender.damage(5*damage ,this); - charge = 0; - } - - if (enchantment != null) { - enchantment.proc(this, attacker, defender, damage); - } - - charge++; - if (durable() && attacker == Dungeon.hero){ - durable --; - if (durable == 10){ - GLog.n(Messages.get(KindOfWeapon.class,"almost_destory")); - } - if (durable == 0){ - Dungeon.hero.belongings.weapon = null; - GLog.n(Messages.get(KindOfWeapon.class,"destory")); - } - } - } - - @Override - public String desc() { - String info = super.desc(); - - info += "\n\n" + Messages.get(Weapon.class, "charge",charge,20); - return info; - } -} diff --git a/java/com/hmdzl/spspd/change/items/weapon/melee/Triangolo.java b/java/com/hmdzl/spspd/change/items/weapon/melee/Triangolo.java deleted file mode 100644 index 0d0be4db..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/melee/Triangolo.java +++ /dev/null @@ -1,112 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.weapon.melee; - -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.buffs.Burning; -import com.hmdzl.spspd.change.actors.buffs.Dry; -import com.hmdzl.spspd.change.actors.buffs.Hot; -import com.hmdzl.spspd.change.actors.buffs.Light; -import com.hmdzl.spspd.change.actors.buffs.Terror; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.effects.particles.FlameParticle; -import com.hmdzl.spspd.change.items.Generator; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.weapon.melee.MeleeWeapon; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Paralysis; -import com.watabou.utils.Random; -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.hero.HeroSubClass; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.bags.Bag; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfRecharging; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfUpgrade; -import com.hmdzl.spspd.change.items.wands.*; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.utils.GLog; -import com.hmdzl.spspd.change.windows.WndBag; -import com.hmdzl.spspd.change.windows.WndOptions; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundle; -import java.util.ArrayList; -import java.util.Collections; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.KindOfWeapon; -import com.hmdzl.spspd.change.messages.Messages; - -public class Triangolo extends MeleeWeapon { - - { - //name = "Triangolo"; - image = ItemSpriteSheet.TRIANGOLO; - } - - public Triangolo() { - super(1, 1f, 1f, 1); - MIN = 1; - MAX = 10; - } - - - @Override - public Item upgrade(boolean enchant) { - if (RCH < 4) { - RCH ++ ; - } - MIN+=1; - MAX+=1; - return super.upgrade(enchant); - } - - @Override - public void proc(Char attacker, Char defender, int damage) { - int p = defender.pos; - for (int n : Level.NEIGHBOURS8) { - Char ch = Actor.findChar(n+p); - if (ch != null && ch != defender && ch != attacker && ch.isAlive()) { - - int dr = Random.IntRange( 0, 1 ); - int dmg = Random.Int( MIN, MAX ); - int effectiveDamage = Math.max( dmg - dr, 0 ); - - ch.damage( effectiveDamage, this ); - } - } - if (enchantment != null) { - enchantment.proc(this, attacker, defender, damage); - } - if (durable() && attacker == Dungeon.hero){ - durable --; - if (durable == 10){ - GLog.n(Messages.get(KindOfWeapon.class,"almost_destory")); - } - if (durable == 0){ - Dungeon.hero.belongings.weapon = null; - GLog.n(Messages.get(KindOfWeapon.class,"destory")); - } - } - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/items/weapon/melee/Trumpet.java b/java/com/hmdzl/spspd/change/items/weapon/melee/Trumpet.java deleted file mode 100644 index d620ab50..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/melee/Trumpet.java +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.weapon.melee; - -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.buffs.Burning; -import com.hmdzl.spspd.change.actors.buffs.Dry; -import com.hmdzl.spspd.change.actors.buffs.Hot; -import com.hmdzl.spspd.change.actors.buffs.Light; -import com.hmdzl.spspd.change.actors.buffs.Terror; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.effects.particles.FlameParticle; -import com.hmdzl.spspd.change.items.Generator; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.weapon.melee.MeleeWeapon; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Paralysis; -import com.watabou.utils.Random; -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.hero.HeroSubClass; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.bags.Bag; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfRecharging; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfUpgrade; -import com.hmdzl.spspd.change.items.wands.*; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.utils.GLog; -import com.hmdzl.spspd.change.windows.WndBag; -import com.hmdzl.spspd.change.windows.WndOptions; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundle; -import java.util.ArrayList; -import java.util.Collections; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.KindOfWeapon; - -public class Trumpet extends MeleeWeapon { - - { - //name = "Trumpet"; - image = ItemSpriteSheet.TRUMPET; - } - - public Trumpet() { - super(4, 1f, 1f, 2); - } - - - @Override - public Item upgrade(boolean enchant) { - MAX+=4; - return super.upgrade(enchant); - } - - @Override - public void proc(Char attacker, Char defender, int damage) { - - int p = defender.pos; - for (int n : Level.NEIGHBOURS8) { - Char ch = Actor.findChar(n+p); - if (ch != null && ch != defender && ch != attacker && ch.isAlive()) { - - int dr = Random.IntRange( 0, 1 ); - int dmg = Random.Int( MIN, MAX ); - int effectiveDamage = Math.max( dmg - dr, 0 ); - - ch.damage( effectiveDamage/3, this ); - } - } - - - if (enchantment != null) { - enchantment.proc(this, attacker, defender, damage); - } - if (durable() && attacker == Dungeon.hero){ - durable --; - if (durable == 10){ - GLog.n(Messages.get(KindOfWeapon.class,"almost_destory")); - } - if (durable == 0){ - Dungeon.hero.belongings.weapon = null; - GLog.n(Messages.get(KindOfWeapon.class,"destory")); - } - } - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/items/weapon/melee/WarHammer.java b/java/com/hmdzl/spspd/change/items/weapon/melee/WarHammer.java deleted file mode 100644 index b89be197..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/melee/WarHammer.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.weapon.melee; - -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Paralysis; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.utils.Random; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.KindOfWeapon; - -public class WarHammer extends MeleeWeapon { - - { - //name = "war hammer"; - image = ItemSpriteSheet.WAR_HAMMER; - } - - public WarHammer() { - super(5, 1f, 1f ,1); - } - - @Override - public Item upgrade(boolean enchant) { - - if (ACU < 2f) { - ACU+=0.10f; - } - MIN +=1; - MAX +=3; - return super.upgrade(enchant); - } - - @Override - public void proc(Char attacker, Char defender, int damage) { - - if (Random.Int(100) < 10) { - Buff.prolong(defender, Paralysis.class, 2); - } - if (enchantment != null) { - enchantment.proc(this, attacker, defender, damage); - } - if (durable() && attacker == Dungeon.hero){ - durable --; - if (durable == 10){ - GLog.n(Messages.get(KindOfWeapon.class,"almost_destory")); - } - if (durable == 0){ - Dungeon.hero.belongings.weapon = null; - GLog.n(Messages.get(KindOfWeapon.class,"destory")); - } - } - } -} diff --git a/java/com/hmdzl/spspd/change/items/weapon/melee/Wardurm.java b/java/com/hmdzl/spspd/change/items/weapon/melee/Wardurm.java deleted file mode 100644 index 0a4befcf..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/melee/Wardurm.java +++ /dev/null @@ -1,116 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.weapon.melee; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.buffs.Vertigo; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.KindOfWeapon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.buffs.Burning; -import com.hmdzl.spspd.change.actors.buffs.Dry; -import com.hmdzl.spspd.change.actors.buffs.Hot; -import com.hmdzl.spspd.change.actors.buffs.Light; -import com.hmdzl.spspd.change.actors.buffs.Terror; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.effects.particles.FlameParticle; -import com.hmdzl.spspd.change.items.Generator; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.weapon.melee.MeleeWeapon; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Paralysis; -import com.watabou.utils.Random; -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.hero.HeroSubClass; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.bags.Bag; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfRecharging; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfUpgrade; -import com.hmdzl.spspd.change.items.wands.*; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.utils.GLog; -import com.hmdzl.spspd.change.windows.WndBag; -import com.hmdzl.spspd.change.windows.WndOptions; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundle; -import java.util.ArrayList; -import java.util.Collections; - -public class Wardurm extends MeleeWeapon { - - { - //name = "Wardurm"; - image = ItemSpriteSheet.WARDURM; - } - - public Wardurm() { - super(3, 1f, 1f, 2); - } - - - @Override - public Item upgrade(boolean enchant) { - MIN+=1; - MAX+=2; - return super.upgrade(enchant); - } - - @Override - public void proc(Char attacker, Char defender, int damage) { - - - int p = defender.pos; - for (int n : Level.NEIGHBOURS8) { - Char ch = Actor.findChar(n+p); - if (ch != null && ch != defender && ch != attacker && ch.isAlive()) { - - int dr = Random.IntRange( 0, 1 ); - int dmg = Random.Int( MIN, MAX ); - int effectiveDamage = Math.max( dmg - dr, 0 ); - - ch.damage( effectiveDamage/2, this ); - - Buff.prolong(ch, Vertigo.class, 3f); - Buff.prolong(ch, Terror.class, 3f).object = attacker.id(); - } - } - - - if (enchantment != null) { - enchantment.proc(this, attacker, defender, damage); - } - - if (durable() && attacker == Dungeon.hero){ - durable --; - if (durable == 10){ - GLog.n(Messages.get(KindOfWeapon.class,"almost_destory")); - } - if (durable == 0){ - Dungeon.hero.belongings.weapon = null; - GLog.n(Messages.get(KindOfWeapon.class,"destory")); - } - } - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/items/weapon/melee/Whip.java b/java/com/hmdzl/spspd/change/items/weapon/melee/Whip.java deleted file mode 100644 index 9abc7a1f..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/melee/Whip.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.weapon.melee; - -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.utils.Random; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Roots; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.KindOfWeapon; - - -public class Whip extends MeleeWeapon { - - { - //name = "Whip"; - image = ItemSpriteSheet.WHIP; - } - - public Whip() { - super(3, 1f, 1f, 2); - } - - @Override - public Item upgrade(boolean enchant) { - if (ACU <1.3){ - ACU+= 0.05; - } - - if (RCH < 3 && ACU >1.3){ - RCH++; - } - MIN+=1; - MAX+=2; - - return super.upgrade(enchant); - } - - @Override - public void proc(Char attacker, Char defender, int damage) { - - if (Random.Int(100) < 30) { - Buff.affect(defender, Roots.class, 1); - } - if (enchantment != null) { - enchantment.proc(this, attacker, defender, damage); - } - if (durable() && attacker == Dungeon.hero){ - durable --; - if (durable == 10){ - GLog.n(Messages.get(KindOfWeapon.class,"almost_destory")); - } - if (durable == 0){ - Dungeon.hero.belongings.weapon = null; - GLog.n(Messages.get(KindOfWeapon.class,"destory")); - } - } - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/items/weapon/melee/WoodenStaff.java b/java/com/hmdzl/spspd/change/items/weapon/melee/WoodenStaff.java deleted file mode 100644 index 24698494..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/melee/WoodenStaff.java +++ /dev/null @@ -1,127 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.weapon.melee; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.quest.DarkGold; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfUpgrade; -import com.hmdzl.spspd.change.items.weapon.Weapon; -import com.hmdzl.spspd.change.items.weapon.missiles.Boomerang; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.hmdzl.spspd.change.windows.WndBag; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Bleeding; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.KindOfWeapon; -import com.hmdzl.spspd.change.messages.Messages; - -public class WoodenStaff extends MeleeWeapon { - - { - //name = "WoodenStaff"; - image = ItemSpriteSheet.WOODEN_STAFF; - - } - - public WoodenStaff() { - super(1, 0.8f, 1f, 1); - MIN = 1; - MAX = 10; - } - - public static int charge = 0; - private static final String CHARGE = "charge"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(CHARGE, charge); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - charge = bundle.getInt(CHARGE); - } - - - - @Override - public Item upgrade(boolean enchant) { - if (ACU < 1.2f) { - ACU+=0.05f; - } - - if (ACU > 1.2f && DLY > 0.8f){ - DLY-=0.05f; - } - - MIN+=1; - MAX+=1; - return super.upgrade(enchant); - } - - - @Override - public void proc(Char attacker, Char defender, int damage) { - - int DMG = damage; - - if (charge >= 8) { - defender.damage(5*damage ,this); - charge = 0; - } - - if (enchantment != null) { - enchantment.proc(this, attacker, defender, damage); - } - - charge++; - if (durable() && attacker == Dungeon.hero){ - durable --; - if (durable == 10){ - GLog.n(Messages.get(KindOfWeapon.class,"almost_destory")); - } - if (durable == 0){ - Dungeon.hero.belongings.weapon = null; - GLog.n(Messages.get(KindOfWeapon.class,"destory")); - } - } - } - - @Override - public String desc() { - String info = super.desc(); - - info += "\n\n" + Messages.get(Weapon.class, "charge",charge,8); - return info; - } -} diff --git a/java/com/hmdzl/spspd/change/items/weapon/melee/relic/AresSword.java b/java/com/hmdzl/spspd/change/items/weapon/melee/relic/AresSword.java deleted file mode 100644 index c3c6b0f6..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/melee/relic/AresSword.java +++ /dev/null @@ -1,145 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.weapon.melee.relic; - -import java.util.ArrayList; -import java.util.HashSet; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.ToxicGas; -import com.hmdzl.spspd.change.actors.buffs.BerryRegeneration; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Burning; -import com.hmdzl.spspd.change.actors.buffs.GasesImmunity; -import com.hmdzl.spspd.change.actors.buffs.MagicImmunity; -import com.hmdzl.spspd.change.actors.buffs.Poison; -import com.hmdzl.spspd.change.actors.buffs.Slow; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.mobs.Eye; -import com.hmdzl.spspd.change.actors.mobs.Warlock; -import com.hmdzl.spspd.change.actors.mobs.Yog; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.artifacts.Artifact.ArtifactBuff; -import com.hmdzl.spspd.change.items.artifacts.CloakOfShadows.cloakStealth; -import com.hmdzl.spspd.change.items.rings.Ring.RingBuff; -import com.hmdzl.spspd.change.items.weapon.Weapon; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.Terrain; -import com.hmdzl.spspd.change.levels.traps.LightningTrap; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.ui.BuffIndicator; -import com.hmdzl.spspd.change.utils.GLog; - -import com.watabou.noosa.audio.Sample; -import com.watabou.noosa.tweeners.AlphaTweener; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -public class AresSword extends RelicMeleeWeapon { - - public AresSword() { - super(6, 1f, 1f, 1); - // TODO Auto-generated constructor stub - } - - - { - //name = "Ares Sword"; - image = ItemSpriteSheet.ARESSWORD; - - level = 0; - exp = 0; - levelCap = 15; - - charge = 0; - chargeCap = 1000; - - cooldown = 0; - - - } - - public static final String AC_REGEN = "REGEN"; - - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions(hero); - if (isEquipped(hero) && charge >= chargeCap) - actions.add(AC_REGEN); - return actions; - } - - @Override - public void execute(Hero hero, String action) { - if (action.equals(AC_REGEN)) { - charge = 0; - Buff.affect(hero, BerryRegeneration.class).level(level); - } else - super.execute(hero, action); - } - - - public class RegenCounter extends WeaponBuff { - - @Override - public boolean act() { - if (charge < chargeCap) { - charge+=Math.min(level, 10); - updateQuickslot(); - } - spend(TICK); - return true; - } - - @Override - public String toString() { - return "Regen"; - } - - @Override - public int icon() { - if (cooldown == 0) - return BuffIndicator.NONE; - else - return BuffIndicator.NONE; - } - - @Override - public void detach() { - cooldown = 0; - charge = 0; - super.detach(); - } - - } - - - - - @Override - protected WeaponBuff passiveBuff() { - return new RegenCounter(); - } - -} - - diff --git a/java/com/hmdzl/spspd/change/items/weapon/melee/relic/CromCruachAxe.java b/java/com/hmdzl/spspd/change/items/weapon/melee/relic/CromCruachAxe.java deleted file mode 100644 index 148c35c3..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/melee/relic/CromCruachAxe.java +++ /dev/null @@ -1,143 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.weapon.melee.relic; - -import java.util.ArrayList; -import java.util.HashSet; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.ToxicGas; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Burning; -import com.hmdzl.spspd.change.actors.buffs.GasesImmunity; -import com.hmdzl.spspd.change.actors.buffs.MagicImmunity; -import com.hmdzl.spspd.change.actors.buffs.Poison; -import com.hmdzl.spspd.change.actors.buffs.Slow; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.mobs.Eye; -import com.hmdzl.spspd.change.actors.mobs.Warlock; -import com.hmdzl.spspd.change.actors.mobs.Yog; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.artifacts.Artifact.ArtifactBuff; -import com.hmdzl.spspd.change.items.artifacts.CloakOfShadows.cloakStealth; -import com.hmdzl.spspd.change.items.rings.Ring.RingBuff; -import com.hmdzl.spspd.change.items.weapon.Weapon; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.Terrain; -import com.hmdzl.spspd.change.levels.traps.LightningTrap; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.ui.BuffIndicator; -import com.hmdzl.spspd.change.utils.GLog; - -import com.watabou.noosa.audio.Sample; -import com.watabou.noosa.tweeners.AlphaTweener; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -public class CromCruachAxe extends RelicMeleeWeapon { - - public CromCruachAxe() { - super(6, 1.2f, 1f, 1); - // TODO Auto-generated constructor stub - } - - - { - image = ItemSpriteSheet.CROMAXE; - - level = 0; - exp = 0; - levelCap = 15; - - charge = 0; - chargeCap = 1000; - - cooldown = 0; - - - } - - public static final String AC_DISPEL = "DISPEL"; - - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions(hero); - if (isEquipped(hero) && charge >= chargeCap) - actions.add(AC_DISPEL); - return actions; - } - - @Override - public void execute(Hero hero, String action) { - if (action.equals(AC_DISPEL)) { - charge = 0; - Buff.prolong(hero, MagicImmunity.class, 2f*(level/10)); - } else - super.execute(hero, action); - } - - - public class DispelCounter extends WeaponBuff { - - @Override - public boolean act() { - if (charge < chargeCap) { - charge+=Math.min(level, 10); - updateQuickslot(); - } - spend(TICK); - return true; - } - - @Override - public String toString() { - return "Dispel"; - } - - @Override - public int icon() { - if (cooldown == 0) - return BuffIndicator.NONE; - else - return BuffIndicator.NONE; - } - - @Override - public void detach() { - cooldown = 0; - charge = 0; - super.detach(); - } - - } - - - - - @Override - protected WeaponBuff passiveBuff() { - return new DispelCounter(); - } - -} - - diff --git a/java/com/hmdzl/spspd/change/items/weapon/melee/relic/JupitersWraith.java b/java/com/hmdzl/spspd/change/items/weapon/melee/relic/JupitersWraith.java deleted file mode 100644 index ec7e280e..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/melee/relic/JupitersWraith.java +++ /dev/null @@ -1,184 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.weapon.melee.relic; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.ResultDescriptions; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Paralysis; -import com.hmdzl.spspd.change.actors.buffs.Slow; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.mobs.MineSentinel; -import com.hmdzl.spspd.change.actors.mobs.Otiluke; -import com.hmdzl.spspd.change.actors.mobs.RedWraith; -import com.hmdzl.spspd.change.actors.mobs.Zot; -import com.hmdzl.spspd.change.actors.mobs.ZotPhase; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.weapon.Weapon; -import com.hmdzl.spspd.change.items.weapon.melee.relic.NeptunusTrident.Flooding; -import com.hmdzl.spspd.change.items.weapon.melee.relic.RelicMeleeWeapon; -import com.hmdzl.spspd.change.items.weapon.melee.relic.RelicMeleeWeapon.WeaponBuff; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.Terrain; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.sprites.MissileSprite; -import com.hmdzl.spspd.change.ui.BuffIndicator; -import com.hmdzl.spspd.change.utils.GLog; - -import com.watabou.noosa.Camera; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Random; - -public class JupitersWraith extends RelicMeleeWeapon { - - public JupitersWraith() { - super(6, 1f, 1f, 4); - // TODO Auto-generated constructor stub - } - - { - //name = "jupiter's wraith"; - image = ItemSpriteSheet.JUPITERSWRAITH; - - level = 0; - exp = 0; - levelCap = 15; - - charge = 0; - chargeCap = 1000; - - cooldown = 0; - - } - - public static final String AC_EXPLODE = "EXPLODE"; - - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions(hero); - if (isEquipped(hero) && charge >= chargeCap) - actions.add(AC_EXPLODE); - return actions; - } - - @Override - public void execute(Hero hero, String action) { - if (action.equals(AC_EXPLODE)) { - int distance=distance(); - explode(distance, hero); - } else - super.execute(hero, action); - } - - - private int distance(){ - return Math.round(level/3)+1; - } - - private void explode(int distance, Hero hero) { - charge = 0; - int length = Level.getLength(); - int width = Level.getWidth(); - for (int i = width; i < length - width; i++){ - int dist = Level.distance(hero.pos, i); - if (dist 0) { - ch.damage(dmg, this); - if(Random.Int(3)==1 && ch.isAlive()){Buff.prolong(ch, Paralysis.class, 1);} - } - - } - - } - - - - public class ExplodeCharge extends WeaponBuff { - - @Override - public boolean act() { - if (charge < chargeCap) { - charge+=Math.min(level, 10); - updateQuickslot(); - } - spend(TICK); - return true; - } - - - @Override - public String toString() { - return "Explode"; - } - - @Override - public int icon() { - if (cooldown == 0) - return BuffIndicator.NONE; - else - return BuffIndicator.NONE; - } - - @Override - public void detach() { - cooldown = 0; - charge = 0; - super.detach(); - } - - } - - protected WeaponBuff passiveBuff() { - return new ExplodeCharge(); - } - -} diff --git a/java/com/hmdzl/spspd/change/items/weapon/melee/relic/LokisFlail.java b/java/com/hmdzl/spspd/change/items/weapon/melee/relic/LokisFlail.java deleted file mode 100644 index 1b7b3278..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/melee/relic/LokisFlail.java +++ /dev/null @@ -1,149 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.weapon.melee.relic; - -import java.util.ArrayList; -import java.util.HashSet; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.ToxicGas; -import com.hmdzl.spspd.change.actors.buffs.BerryRegeneration; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Burning; -import com.hmdzl.spspd.change.actors.buffs.GasesImmunity; -import com.hmdzl.spspd.change.actors.buffs.Invisibility; -import com.hmdzl.spspd.change.actors.buffs.MagicImmunity; -import com.hmdzl.spspd.change.actors.buffs.Poison; -import com.hmdzl.spspd.change.actors.buffs.Shadows; -import com.hmdzl.spspd.change.actors.buffs.Slow; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.mobs.Eye; -import com.hmdzl.spspd.change.actors.mobs.Warlock; -import com.hmdzl.spspd.change.actors.mobs.Yog; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.artifacts.Artifact.ArtifactBuff; -import com.hmdzl.spspd.change.items.artifacts.CloakOfShadows.cloakStealth; -import com.hmdzl.spspd.change.items.rings.Ring.RingBuff; -import com.hmdzl.spspd.change.items.weapon.Weapon; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.Terrain; -import com.hmdzl.spspd.change.levels.traps.LightningTrap; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.ui.BuffIndicator; -import com.hmdzl.spspd.change.utils.GLog; - -import com.watabou.noosa.audio.Sample; -import com.watabou.noosa.tweeners.AlphaTweener; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -public class LokisFlail extends RelicMeleeWeapon { - - public LokisFlail() { - super(6, 0.8f, 1.2f, 2); - // TODO Auto-generated constructor stub - } - - - { - //name = "Loki's Flail"; - image = ItemSpriteSheet.LOKISFLAIL; - - level = 0; - exp = 0; - levelCap = 15; - - charge = 0; - chargeCap = 1000; - - cooldown = 0; - - - } - - public static final String AC_STEALTH = "STEALTH"; - - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions(hero); - if (isEquipped(hero) && charge >= chargeCap) - actions.add(AC_STEALTH); - return actions; - } - - @Override - public void execute(Hero hero, String action) { - if (action.equals(AC_STEALTH)) { - charge = 0; - Buff.affect(hero, Shadows.class, 10f); - Sample.INSTANCE.play(Assets.SND_MELD); - - } else - super.execute(hero, action); - } - - - public class StealthCounter extends WeaponBuff { - - @Override - public boolean act() { - if (charge < chargeCap) { - charge+=Math.min(level, 10); - updateQuickslot(); - } - spend(TICK); - return true; - } - - @Override - public String toString() { - return "StealthCounter"; - } - - @Override - public int icon() { - if (cooldown == 0) - return BuffIndicator.NONE; - else - return BuffIndicator.NONE; - } - - @Override - public void detach() { - cooldown = 0; - charge = 0; - super.detach(); - } - - } - - - - - @Override - protected WeaponBuff passiveBuff() { - return new StealthCounter(); - } - -} - - diff --git a/java/com/hmdzl/spspd/change/items/weapon/melee/relic/NeptunusTrident.java b/java/com/hmdzl/spspd/change/items/weapon/melee/relic/NeptunusTrident.java deleted file mode 100644 index e28fa2d8..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/melee/relic/NeptunusTrident.java +++ /dev/null @@ -1,208 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.weapon.melee.relic; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Slow; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.artifacts.Artifact.ArtifactBuff; -import com.hmdzl.spspd.change.items.artifacts.CloakOfShadows.cloakStealth; -import com.hmdzl.spspd.change.items.weapon.Weapon; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.Terrain; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.ui.BuffIndicator; -import com.hmdzl.spspd.change.utils.GLog; - -import com.watabou.noosa.audio.Sample; -import com.watabou.noosa.tweeners.AlphaTweener; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -public class NeptunusTrident extends RelicMeleeWeapon { - - public NeptunusTrident() { - super(6, 1f, 1f, 2); - // TODO Auto-generated constructor stub - } - - - { - //name = "Neptunus Trident"; - image = ItemSpriteSheet.TRIDENT; - - level = 0; - exp = 0; - levelCap = 15; - - charge = 0; - chargeCap = 1000; - - cooldown = 0; - - } - - - private int distance(){ - return Math.round(2); - } - - private void flood(int distance, Hero hero) { - charge = 0; - ArrayList affected = new ArrayList(); - - int length = Level.getLength(); - int width = Level.getWidth(); - for (int i = width; i < length - width; i++){ - int dist = Level.distance(hero.pos, i); - if (dist actions(Hero hero) { - ArrayList actions = super.actions(hero); - if (isEquipped(hero) && charge >= chargeCap) - actions.add(AC_FLOOD); - return actions; - } - - @Override - public void execute(Hero hero, String action) { - if (action.equals(AC_FLOOD)) { - int distance=distance(); - flood(distance, hero); - } else - super.execute(hero, action); - } - - - public class Flooding extends WeaponBuff { - - @Override - public boolean act() { - if (charge < chargeCap) { - charge+=Math.min(level, 10); - updateQuickslot(); - } - spend(TICK); - return true; - } - - - @Override - public String toString() { - return "Flooding"; - } - - @Override - public int icon() { - if (cooldown == 0) - return BuffIndicator.NONE; - else - return BuffIndicator.NONE; - } - - @Override - public void detach() { - cooldown = 0; - charge = 0; - super.detach(); - } - - } - - @Override - protected WeaponBuff passiveBuff() { - return new Flooding(); - } - -} - - diff --git a/java/com/hmdzl/spspd/change/items/weapon/melee/relic/RelicMeleeWeapon.java b/java/com/hmdzl/spspd/change/items/weapon/melee/relic/RelicMeleeWeapon.java deleted file mode 100644 index a006566d..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/melee/relic/RelicMeleeWeapon.java +++ /dev/null @@ -1,283 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.weapon.melee.relic; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.mobs.MineSentinel; -import com.hmdzl.spspd.change.actors.mobs.Otiluke; -import com.hmdzl.spspd.change.actors.mobs.Zot; -import com.hmdzl.spspd.change.actors.mobs.ZotPhase; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.artifacts.Artifact.ArtifactBuff; -import com.hmdzl.spspd.change.items.weapon.Weapon; -import com.hmdzl.spspd.change.items.weapon.Weapon.Enchantment; -import com.hmdzl.spspd.change.items.weapon.melee.MeleeWeapon; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.utils.GLog; - -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -public class RelicMeleeWeapon extends Weapon { - - private int tier; - - private static final float TIME_TO_EQUIP = 1f; - - public Buff passiveBuff; - protected Buff activeBuff; - - // level is used internally to track upgrades to artifacts, size/logic - // varies per artifact. - // already inherited from item superclass - // exp is used to count progress towards levels for some artifacts - protected int exp = 0; - // levelCap is the artifact's maximum level - protected int levelCap = 0; - - // the current artifact charge - public int charge = 0; - - // the maximum charge, varies per artifact, not all artifacts use this. - public int chargeCap = 0; - - // used by some artifacts to keep track of duration of effects or cooldowns - // to use. - protected int cooldown = 0; - - public RelicMeleeWeapon(int tier, float acu, float dly, int rch) { - super(); - - this.tier = tier; - - ACU = acu; - DLY = dly; - RCH = rch; - - STR = typicalSTR(); - - MIN = min(); - MAX = max(); - reinforced = true; - - } - - private int min() { - return tier; - } - - private int max() { - return (int) (((tier * tier - tier + 10) / ACU * DLY)/(0.8+0.2*RCH)); - } - - @Override - public boolean doEquip(Hero hero) { - - activate(hero); - - return super.doEquip(hero); - - } - - - @Override - public void activate(Hero hero) { - passiveBuff = passiveBuff(); - passiveBuff.attachTo(hero); - } - - @Override - public boolean doUnequip(Hero hero, boolean collect, boolean single) { - - if (super.doUnequip(hero, collect, single)) { - - if (passiveBuff != null){ - passiveBuff.detach(); - passiveBuff = null; - } - - hero.belongings.weapon = null; - return true; - - } else { - - return false; - - } - } - - - protected WeaponBuff passiveBuff() { - return null; - } - - public class WeaponBuff extends Buff { - - public int level() { - return level; - } - - public boolean isCursed() { - return cursed; - } - - } - - @Override - public void proc(Char attacker, Char defender, int damage) { - - if (enchantment != null) { - enchantment.proc(this, attacker, defender, damage); - } - } - - - @Override - public Item upgrade() { - return upgrade(false); - } - - @Override - public Item upgrade(boolean enchant) { - - MIN++; - MAX += 3; - - if (enchant){ - GLog.i(Messages.get(this,"refuse")); - } - return super.upgrade(false); - - } - - public Item safeUpgrade() { - return upgrade(enchantment != null); - } - - - @Override - public Item degrade() { - MIN--; - MAX -= tier; - return super.degrade(); - } - - public int typicalSTR() { - return 8 + tier * 2; - } - - @Override - public String info() { - - String name = name(); - String info = desc(); - - if (levelKnown) { - info += "\n\n" + Messages.get(MeleeWeapon.class, "stats_known", tier, MIN, MAX, STR); - info += "\n\n" + Messages.get(MeleeWeapon.class, "stats_known2", ACU, DLY, RCH); -; if (Dungeon.hero.STR() > typicalSTR()){ - info += " " + Messages.get(MeleeWeapon.class, "excess_str", Dungeon.hero.STR() - typicalSTR()); - } - } else { - info += "\n\n" + Messages.get(MeleeWeapon.class, "stats_unknown", tier, min(), max(), typicalSTR()); - } - - String stats_desc = Messages.get(this, "stats_desc"); - if (!stats_desc.equals("")) info+= "\n\n" + stats_desc; - - //Messages.get(MeleeWeapon.class, "stats_known", tier, MIN, MAX,STR,ACU,DLY,RCH ) - - if (enchantment != null) { - info += "\n" + Messages.get(MeleeWeapon.class, "enchanted", enchantment.desc()); - } - - if (reinforced) { - info += "\n" + Messages.get(Item.class, "reinforced"); - } - - info += "\n " + Messages.get(Weapon.class, "charge", charge, chargeCap); - - if (levelKnown && STR() > Dungeon.hero.STR()) { - info += "\n" + Messages.get(MeleeWeapon.class, "too_heavy"); - } - - if (cursed && isEquipped( Dungeon.hero )) { - info += "\n\n" + Messages.get(MeleeWeapon.class, "cursed_worn"); - } else if (cursedKnown && cursed) { - info += "\n\n" + Messages.get(MeleeWeapon.class, "cursed"); - } - - return info; - } - - @Override - public int price() { - int price = 150; - if (enchantment != null) { - price *= 1.5; - } - if (cursed && cursedKnown) { - price /= 2; - } - if (levelKnown) { - if (level > 0) { - price *= (level + 1); - } else if (level < 0) { - price /= (1 - level); - } - } - if (price < 1) { - price = 1; - } - return price; - } - - @Override - public Item random() { - super.random(); - - if (Random.Int(10 + level) == 0) { - enchant(); - } - - return this; - } - - private static final String CHARGE = "charge"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(CHARGE, charge); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - charge = bundle.getInt(CHARGE); - } -} - - diff --git a/java/com/hmdzl/spspd/change/items/weapon/melee/special/Brick.java b/java/com/hmdzl/spspd/change/items/weapon/melee/special/Brick.java deleted file mode 100644 index 68c8eef0..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/melee/special/Brick.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.weapon.melee.special; - -import com.hmdzl.spspd.change.actors.buffs.Burning; -import com.hmdzl.spspd.change.actors.buffs.Light; -import com.hmdzl.spspd.change.actors.buffs.Shieldblock; -import com.hmdzl.spspd.change.actors.buffs.Terror; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.effects.particles.FlameParticle; -import com.hmdzl.spspd.change.items.Generator; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.KindOfWeapon; -import com.hmdzl.spspd.change.items.weapon.melee.MeleeWeapon; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Paralysis; -import com.watabou.utils.Random; -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.hero.HeroSubClass; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.bags.Bag; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfRecharging; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfUpgrade; -import com.hmdzl.spspd.change.items.wands.*; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.utils.GLog; -import com.hmdzl.spspd.change.windows.WndBag; -import com.hmdzl.spspd.change.windows.WndOptions; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundle; -import java.util.ArrayList; -import java.util.Collections; - -public class Brick extends MeleeWeapon { - - { - //name = "Brick"; - image = ItemSpriteSheet.W_BRICK; - - usesTargeting = true; - } - - public Brick() { - super(1, 1f, 1f, 1); - MIN = 8; - MAX = 8; - } - - - @Override - public void proc(Char attacker, Char defender, int damage) { - - if (Random.Int(100) < 40) { - Buff.prolong(defender, Shieldblock.class, 2); - } - - if (enchantment != null) { - enchantment.proc(this, attacker, defender, damage); - } - if (Random.Int(80) ==1 ){ - - Dungeon.hero.belongings.weapon = null; - GLog.n(Messages.get(KindOfWeapon.class,"destory")); - Dungeon.level.drop(Generator.random(), defender.pos).sprite.drop(); - Dungeon.level.drop(Generator.random(), defender.pos).sprite.drop(); - Dungeon.level.drop(Generator.random(), defender.pos).sprite.drop(); - } - } - -} diff --git a/java/com/hmdzl/spspd/change/items/weapon/melee/special/DiamondPickaxe.java b/java/com/hmdzl/spspd/change/items/weapon/melee/special/DiamondPickaxe.java deleted file mode 100644 index 60437e8e..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/melee/special/DiamondPickaxe.java +++ /dev/null @@ -1,295 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.weapon.melee.special; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Hunger; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.mobs.ElderAvatar; -import com.hmdzl.spspd.change.actors.mobs.King; -import com.hmdzl.spspd.change.actors.mobs.LichDancer; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.effects.particles.ShadowParticle; -import com.hmdzl.spspd.change.items.Generator; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfRage; -import com.hmdzl.spspd.change.items.weapon.melee.MeleeWeapon; -import com.hmdzl.spspd.change.items.weapon.missiles.buildblock.BookBlock; -import com.hmdzl.spspd.change.items.weapon.missiles.buildblock.DoorBlock; -import com.hmdzl.spspd.change.items.weapon.missiles.buildblock.StoneBlock; -import com.hmdzl.spspd.change.items.weapon.missiles.buildblock.WallBlock; -import com.hmdzl.spspd.change.items.weapon.missiles.buildblock.WoodenBlock; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.Terrain; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.ui.BuffIndicator; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Callback; -import com.watabou.utils.Random; - -public class DiamondPickaxe extends MeleeWeapon { - - public static final String AC_MINE = "MINE"; - - public static final float TIME_TO_MINE = 10; - - { - //name = "pickaxe"; - image = ItemSpriteSheet.DIAMOND_PICKAXE; - defaultAction = AC_MINE; - } - - public DiamondPickaxe() { - super(3, 2f, 0.5f, 2); - MIN = 2; - MAX = 8; - unique = true; - reinforced = true; - } - - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions(hero); - actions.add(AC_MINE); - return actions; - } - - @Override - public void execute(final Hero hero, String action) { - - if (action == AC_MINE) { - if (Random.Int(3) == 0) { - for (Mob mob : Dungeon.level.mobs.toArray(new Mob[0])) { - mob.beckon(hero.pos); - } - GLog.n(Messages.get(this,"noise")); - } - for (int i = 0; i < Level.NEIGHBOURS8.length; i++) { - - final int pos = hero.pos + Level.NEIGHBOURS8[i]; - if (Dungeon.level.map[pos] == Terrain.WALL && Level.insideMap(pos)) { - - hero.spend(TIME_TO_MINE); - hero.busy(); - - hero.sprite.attack(pos, new Callback() { - - @Override - public void call() { - - CellEmitter.center(pos).burst( - Speck.factory(Speck.STAR), 7); - Sample.INSTANCE.play(Assets.SND_EVOKE); - - Level.set(pos, Terrain.EMBERS); - GameScene.updateMap(pos); - - WallBlock wall = new WallBlock(); - - Dungeon.level.drop(wall, hero.pos).sprite.drop(); - - Hunger hunger = hero.buff(Hunger.class); - if (hunger != null && !hunger.isStarving()) { - hunger.satisfy(-10); - BuffIndicator.refreshHero(); - } - - hero.onOperateComplete(); - } - }); - - return; - } else if (Dungeon.level.map[pos] == Terrain.DOOR && Level.insideMap(pos)) { - - hero.spend(TIME_TO_MINE); - hero.busy(); - - hero.sprite.attack(pos, new Callback() { - - @Override - public void call() { - - CellEmitter.center(pos).burst( - Speck.factory(Speck.STAR), 7); - Sample.INSTANCE.play(Assets.SND_EVOKE); - - Level.set(pos, Terrain.EMBERS); - GameScene.updateMap(pos); - - DoorBlock door = new DoorBlock(); - - Dungeon.level.drop(door, hero.pos).sprite.drop(); - - Hunger hunger = hero.buff(Hunger.class); - if (hunger != null && !hunger.isStarving()) { - hunger.satisfy(-10); - BuffIndicator.refreshHero(); - } - - hero.onOperateComplete(); - } - }); - - return; - } else if (Dungeon.level.map[pos] == Terrain.BOOKSHELF && Level.insideMap(pos)) { - - hero.spend(TIME_TO_MINE); - hero.busy(); - - hero.sprite.attack(pos, new Callback() { - - @Override - public void call() { - - CellEmitter.center(pos).burst( - Speck.factory(Speck.STAR), 7); - Sample.INSTANCE.play(Assets.SND_EVOKE); - - Level.set(pos, Terrain.EMBERS); - GameScene.updateMap(pos); - - BookBlock book = new BookBlock(); - - Dungeon.level.drop(book, hero.pos).sprite.drop(); - - Hunger hunger = hero.buff(Hunger.class); - if (hunger != null && !hunger.isStarving()) { - hunger.satisfy(-10); - BuffIndicator.refreshHero(); - } - - hero.onOperateComplete(); - } - }); - - return; - } else if (Dungeon.level.map[pos] == Terrain.BARRICADE && Level.insideMap(pos)) { - - hero.spend(TIME_TO_MINE); - hero.busy(); - - hero.sprite.attack(pos, new Callback() { - - @Override - public void call() { - - CellEmitter.center(pos).burst( - Speck.factory(Speck.STAR), 7); - Sample.INSTANCE.play(Assets.SND_EVOKE); - - Level.set(pos, Terrain.EMBERS); - GameScene.updateMap(pos); - - WoodenBlock wooden = new WoodenBlock(); - - Dungeon.level.drop(wooden, hero.pos).sprite.drop(); - - Hunger hunger = hero.buff(Hunger.class); - if (hunger != null && !hunger.isStarving()) { - hunger.satisfy(-10); - BuffIndicator.refreshHero(); - } - - hero.onOperateComplete(); - } - }); - - return; - } else if (Dungeon.level.map[pos] == Terrain.STATUE && Level.insideMap(pos)) { - - hero.spend(TIME_TO_MINE); - hero.busy(); - - hero.sprite.attack(pos, new Callback() { - - @Override - public void call() { - - CellEmitter.center(pos).burst( - Speck.factory(Speck.STAR), 7); - Sample.INSTANCE.play(Assets.SND_EVOKE); - - Level.set(pos, Terrain.EMBERS); - GameScene.updateMap(pos); - - StoneBlock stone = new StoneBlock(); - - Dungeon.level.drop(stone, hero.pos).sprite.drop(); - - Hunger hunger = hero.buff(Hunger.class); - if (hunger != null && !hunger.isStarving()) { - hunger.satisfy(-10); - BuffIndicator.refreshHero(); - } - - hero.onOperateComplete(); - } - }); - - return; - } - } - GLog.w(Messages.get(this,"no_thing")); - } else { - - super.execute(hero, action); - - } - } - - public Item upgrade(boolean enchant) { - - MIN+=1; - MAX+=1; - super.upgrade(enchant); - return this; - } - - @Override - public void proc(Char attacker, Char defender, int damage) { - - if (Random.Int(10) < 1 && !(defender.properties().contains(Char.Property.BOSS)) && !(defender.properties().contains(Char.Property.MINIBOSS))) { - defender.damage(Random.Int(defender.HP/4, defender.HP/2), this); - defender.sprite.emitter().burst(ShadowParticle.UP, 5); - if (!defender.isAlive() && attacker instanceof Hero) { - Badges.validateGrimWeapon(); - } - } - if (enchantment != null) { - enchantment.proc(this, attacker, defender, damage); - } - if ( defender.HP <= damage && Random.Int(10) == 0) { - Dungeon.level.drop(Generator.random(), defender.pos).sprite.drop(); - } - } - - /*@Override - public String info() { - return "This is a large and sturdy tool for breaking rocks. Probably it can be used as a weapon."; - }*/ -} diff --git a/java/com/hmdzl/spspd/change/items/weapon/melee/special/ErrorW.java b/java/com/hmdzl/spspd/change/items/weapon/melee/special/ErrorW.java deleted file mode 100644 index 9b5b2c0b..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/melee/special/ErrorW.java +++ /dev/null @@ -1,121 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.weapon.melee.special; - -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.particles.ShadowParticle; -import com.hmdzl.spspd.change.items.weapon.melee.MeleeWeapon; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Cripple; -import com.hmdzl.spspd.change.actors.buffs.Bleeding; -import com.hmdzl.spspd.change.actors.buffs.Terror; -import com.hmdzl.spspd.change.actors.buffs.Vertigo; -import com.hmdzl.spspd.change.actors.buffs.Paralysis; -import com.hmdzl.spspd.change.actors.buffs.Roots; -import com.hmdzl.spspd.change.actors.buffs.Ooze; -import com.hmdzl.spspd.change.actors.buffs.Charm; -import com.watabou.utils.Random; - -public class ErrorW extends MeleeWeapon { - - { - //name = "Error Weapon"; - image = ItemSpriteSheet.ERROR_WEAPON; - - STR = 0; - MIN = 0; - MAX = 0; - } - - public ErrorW() { - super(0, 1f, 1f, 1); - } - - @Override - public Item upgrade(boolean enchant) { - MIN --; - - if (Random.Int(10) > 4 || ACU < 0.5f ){ - ACU += 0.1f; - } else{ - ACU -= 0.1f; - } - - if (Random.Int(10) > 4 || DLY < 0.5f){ - DLY += 0.05f; - } else { - DLY -= 0.05f; - } - - return super.upgrade(enchant); - } - - @Override - public void proc(Char attacker, Char defender, int damage) { - - switch (Random.Int (10)) { - case 0 : - if (defender.properties().contains(Char.Property.BOSS) || defender.properties().contains(Char.Property.MINIBOSS)){ - defender.damage(Random.Int(defender.HT/8, defender.HT/4), this);} - else defender.damage(Random.Int(defender.HT, defender.HT * 2), this); - defender.sprite.emitter().burst(ShadowParticle.UP, 5); - if (!defender.isAlive() && attacker instanceof Hero) { - Badges.validateGrimWeapon(); - } - break; - case 1 : - Buff.affect(defender, Cripple.class, 3); - break; - case 2 : - Buff.affect(defender, Bleeding.class).set(5); - break; - case 3 : - Buff.affect(defender, Vertigo.class, Vertigo.duration(defender)); - Buff.affect(defender, Terror.class, Terror.DURATION).object = attacker.id(); - break; - case 4 : - Buff.affect(defender, Paralysis.class, 3); - break; - case 5 : - Buff.affect(defender, Roots.class, 3); - break; - case 6 : - if (attacker.HP < attacker.HT){ - attacker.HP += (int)((attacker.HT)/10); - attacker.sprite.emitter().start(Speck.factory(Speck.HEALING), 0.4f,1);} - break; - case 7 : - Buff.affect(defender, Ooze.class); - break; - case 8 : - Buff.affect(defender, Charm.class, 3 ).object = attacker.id(); - break; - default: - break; - } - - if (enchantment != null) { - enchantment.proc(this, attacker, defender, damage); - } - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/items/weapon/melee/special/FireCracker.java b/java/com/hmdzl/spspd/change/items/weapon/melee/special/FireCracker.java deleted file mode 100644 index cad0e5b7..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/melee/special/FireCracker.java +++ /dev/null @@ -1,133 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.weapon.melee.special; - -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.buffs.Amok; -import com.hmdzl.spspd.change.actors.buffs.Burning; -import com.hmdzl.spspd.change.actors.buffs.Dry; -import com.hmdzl.spspd.change.actors.buffs.Hot; -import com.hmdzl.spspd.change.actors.buffs.Light; -import com.hmdzl.spspd.change.actors.buffs.Terror; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.actors.mobs.YearBeast; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.effects.particles.FlameParticle; -import com.hmdzl.spspd.change.effects.particles.SmokeParticle; -import com.hmdzl.spspd.change.items.Generator; -import com.hmdzl.spspd.change.items.Heap; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.bombs.Bomb; -import com.hmdzl.spspd.change.items.bombs.MiniBomb; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfRage; -import com.hmdzl.spspd.change.items.weapon.melee.MeleeWeapon; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.Terrain; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Paralysis; -import com.watabou.utils.Random; -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.hero.HeroSubClass; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.bags.Bag; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfRecharging; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfUpgrade; -import com.hmdzl.spspd.change.items.wands.*; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.utils.GLog; -import com.hmdzl.spspd.change.windows.WndBag; -import com.hmdzl.spspd.change.windows.WndOptions; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundle; -import java.util.ArrayList; -import java.util.Collections; - -public class FireCracker extends MeleeWeapon { - - { - //name = "FireCracker"; - image = ItemSpriteSheet.FIRECRACKER; - - usesTargeting = true; - } - - public FireCracker() { - super(1, 1f, 1f, 2); - MIN = 1; - MAX = 5; - } - - - @Override - public Item upgrade(boolean enchant) { - - return super.upgrade(enchant); - } - - @Override - public void proc(Char attacker, Char defender, int damage) { - - if (defender instanceof YearBeast) { - defender.damage(1,this); - } - - if (Random.Int(100)> 75) { - for (Mob mob : Dungeon.level.mobs.toArray(new Mob[0])) { - mob.beckon(attacker.pos); - } - } - - if (Random.Int(100)> 50 ){ - for (int n : Level.NEIGHBOURS9) { - int c = defender.pos + n; - if (c >= 0 && c < Level.getLength()) { - if (Dungeon.visible[c]) { - CellEmitter.get(c).burst(SmokeParticle.FACTORY, 4); - } - Char ch = Actor.findChar(c); - if (ch != null) { - // those not at the center of the blast take damage less - // consistently. - int minDamage = ch.HT/40; - int maxDamage = ch.HT/20; - - int dmg = Random.NormalIntRange(minDamage, maxDamage) - - Math.max(ch.drRoll(),0); - if (dmg > 0) { - ch.damage(dmg, this); - } - } - } - } - } - - if (Random.Int(100)> 70) { - Buff.affect(defender,Terror.class,5f).object = attacker.id(); - } - - if (enchantment != null) { - enchantment.proc(this, attacker, defender, damage); - } - } -} diff --git a/java/com/hmdzl/spspd/change/items/weapon/melee/special/Goei.java b/java/com/hmdzl/spspd/change/items/weapon/melee/special/Goei.java deleted file mode 100644 index 6bca3cd6..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/melee/special/Goei.java +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.weapon.melee.special; - -import com.hmdzl.spspd.change.actors.buffs.Burning; -import com.hmdzl.spspd.change.actors.buffs.Light; -import com.hmdzl.spspd.change.actors.buffs.Terror; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.effects.particles.FlameParticle; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.weapon.Weapon; -import com.hmdzl.spspd.change.items.weapon.melee.MeleeWeapon; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Paralysis; -import com.watabou.utils.Random; -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.hero.HeroSubClass; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.bags.Bag; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfRecharging; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfUpgrade; -import com.hmdzl.spspd.change.items.wands.*; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.utils.GLog; -import com.hmdzl.spspd.change.windows.WndBag; -import com.hmdzl.spspd.change.windows.WndOptions; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundle; -import java.util.ArrayList; -import java.util.Collections; - -public class Goei extends MeleeWeapon { - public Buff passiveBuff; - { - //name = "goei"; - image = ItemSpriteSheet.GOEI; - - } - public Goei() { - super(3, 1f, 1f, 2); - MIN = 4; - MAX = 15; - } - - public int charge = 0; - private static final String CHARGE = "charge"; - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(CHARGE, charge); - } - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - charge = bundle.getInt(CHARGE); - } - - @Override - public Item upgrade(boolean enchant) { - return super.upgrade(enchant); - } - @Override - public void proc(Char attacker, Char defender, int damage) { - if (charge >= 5) { - defender.damage(damage ,this); - charge = 0; - } - if (defender.properties().contains(Char.Property.DEMONIC) || defender.properties().contains(Char.Property.UNDEAD)){ - defender.damage((int)(damage*0.35),this); - } - if (enchantment != null) { - enchantment.proc(this, attacker, defender, damage); - } - charge++; - } - @Override - public String desc() { - String info = super.desc(); - - info += "\n\n" + Messages.get(Weapon.class, "charge",charge,30); - return info; - } -} diff --git a/java/com/hmdzl/spspd/change/items/weapon/melee/special/Handcannon.java b/java/com/hmdzl/spspd/change/items/weapon/melee/special/Handcannon.java deleted file mode 100644 index 62ae1643..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/melee/special/Handcannon.java +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.weapon.melee.special; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.mobs.MineSentinel; -import com.hmdzl.spspd.change.actors.mobs.Otiluke; -import com.hmdzl.spspd.change.actors.mobs.Zot; -import com.hmdzl.spspd.change.actors.mobs.ZotPhase; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.weapon.enchantments.BuzzSaw; -import com.hmdzl.spspd.change.items.weapon.melee.MeleeWeapon; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -public class Handcannon extends MeleeWeapon { - - { - //name = "Handcannon"; - image = ItemSpriteSheet.HANDCANNON; - - } - - public Boolean turnedOn = false; - public static final String AC_ON = "ON"; - public static final String AC_OFF = "OFF"; - - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions(hero); - if(turnedOn){actions.add(AC_OFF);}else{actions.add(AC_ON);} - return actions; - } - - @Override - public void execute(final Hero hero, String action) { - if (action.equals(AC_ON)) { - turnedOn=true; - GLog.i(Messages.get(this, "power_on")); - hero.next(); - - } else if (action.equals(AC_OFF)) { - turnedOn=false; - GLog.i(Messages.get(this, "power_off")); - hero.next(); - } else { - super.execute(hero, action); - } - } - - - @Override - public Item upgrade() { - return upgrade(false); - } - - @Override - public Item upgrade(boolean enchant) { - - return super.upgrade(false); - } - - public Item safeUpgrade() { - return upgrade(enchantment != null); - } - - public Handcannon() { - super(4, 0.7f, 2f, 7); - } - - private static final String TURNEDON = "turnedOn"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(TURNEDON, turnedOn); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - turnedOn = bundle.getBoolean(TURNEDON); - } - -} diff --git a/java/com/hmdzl/spspd/change/items/weapon/melee/special/HookHam.java b/java/com/hmdzl/spspd/change/items/weapon/melee/special/HookHam.java deleted file mode 100644 index 0226bd8f..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/melee/special/HookHam.java +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.weapon.melee.special; - -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.buffs.Bleeding; -import com.hmdzl.spspd.change.actors.buffs.Burning; -import com.hmdzl.spspd.change.actors.buffs.Dry; -import com.hmdzl.spspd.change.actors.buffs.Hot; -import com.hmdzl.spspd.change.actors.buffs.Light; -import com.hmdzl.spspd.change.actors.buffs.Terror; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.effects.particles.FlameParticle; -import com.hmdzl.spspd.change.items.Generator; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.weapon.melee.MeleeWeapon; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Paralysis; -import com.watabou.utils.Random; -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.hero.HeroSubClass; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.bags.Bag; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfRecharging; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfUpgrade; -import com.hmdzl.spspd.change.items.wands.*; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.utils.GLog; -import com.hmdzl.spspd.change.windows.WndBag; -import com.hmdzl.spspd.change.windows.WndOptions; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundle; -import java.util.ArrayList; -import java.util.Collections; - -public class HookHam extends MeleeWeapon { - - { - //name = "hook&ham"; - image = ItemSpriteSheet.HOOK_HAM; - - usesTargeting = true; - } - - public HookHam() { - super(1, 1f, 1f, 1); - MIN = 1; - MAX = 5; - } - - - @Override - public Item upgrade(boolean enchant) { - - return super.upgrade(enchant); - } - - @Override - public void proc(Char attacker, Char defender, int damage) { - - int DMG = damage; - if (Random.Int(100)> 40){ - Buff.affect(defender, Bleeding.class).set(Random.Int(5,DMG)); - } - - if (Random.Int(100) < 20) { - if (attacker.HP < attacker.HT){ - attacker.HP += 10; - attacker.sprite.emitter().start(Speck.factory(Speck.HEALING), 0.4f,1);} - } - - if (Random.Int(100)==98){ - Dungeon.level.drop(Generator.random(), defender.pos).sprite.drop(); - } - - if (enchantment != null) { - enchantment.proc(this, attacker, defender, damage); - } - } -} diff --git a/java/com/hmdzl/spspd/change/items/weapon/melee/special/LinkSword.java b/java/com/hmdzl/spspd/change/items/weapon/melee/special/LinkSword.java deleted file mode 100644 index bb02adb9..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/melee/special/LinkSword.java +++ /dev/null @@ -1,330 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.weapon.melee.special; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.buffs.Barkskin; -import com.hmdzl.spspd.change.actors.buffs.Cripple; -import com.hmdzl.spspd.change.actors.buffs.Invisibility; -import com.hmdzl.spspd.change.actors.buffs.MirrorShield; -import com.hmdzl.spspd.change.actors.buffs.Paralysis; -import com.hmdzl.spspd.change.actors.buffs.ShieldArmor; -import com.hmdzl.spspd.change.actors.buffs.Vertigo; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.hero.HeroClass; -import com.hmdzl.spspd.change.actors.hero.HeroSubClass; -import com.hmdzl.spspd.change.effects.MagicMissile; -import com.hmdzl.spspd.change.effects.particles.PurpleParticle; -import com.hmdzl.spspd.change.items.Generator; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.quest.DarkGold; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfUpgrade; -import com.hmdzl.spspd.change.items.wands.Wand; -import com.hmdzl.spspd.change.items.weapon.Weapon; -import com.hmdzl.spspd.change.items.weapon.melee.MeleeWeapon; -import com.hmdzl.spspd.change.items.weapon.missiles.Boomerang; -import com.hmdzl.spspd.change.items.weapon.missiles.EscapeKnive; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.mechanics.Ballistica; -import com.hmdzl.spspd.change.scenes.CellSelector; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.sprites.MissileSprite; -import com.hmdzl.spspd.change.ui.QuickSlotButton; -import com.hmdzl.spspd.change.utils.GLog; -import com.hmdzl.spspd.change.windows.WndBag; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundle; -import com.watabou.utils.Callback; -import com.watabou.utils.Random; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Bleeding; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.KindOfWeapon; -import com.hmdzl.spspd.change.messages.Messages; - -public class LinkSword extends MeleeWeapon { - public Buff passiveBuff; - { - //name = "LinkSword"; - image = ItemSpriteSheet.S_AND_S; - defaultAction = AC_COURAGE; - usesTargeting = true; - } - - public LinkSword() { - super(1, 1f, 1f, 1); - unique = true; - reinforced = true; - } - - @Override - public Item upgrade(boolean enchant) { - MIN += 1; - MAX += 3; - return super.upgrade(enchant); - } - - public final int fullCharge = 30; - public int charge = 0; - private static final String CHARGE = "charge"; - - public static final String AC_POWER = "POWER"; - public static final String AC_WISDOM = "WISDOM"; - public static final String AC_COURAGE = "COURAGE"; - - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions(hero); - - actions.add(AC_COURAGE); - - if (charge > 20) { - actions.add(AC_WISDOM); - } - if (Dungeon.hero.STR - this.STR >2) { - actions.add(AC_POWER); - } - return actions; - } - - @Override - public void execute(Hero hero, String action) { - if (action == AC_POWER) { - curUser = hero; - STR +=2; - if (ACU < 1.6f){ - ACU+=0.1f; - } - if (DLY > 0.7f){ - DLY-=0.05; - } - MIN+=1; - MAX+=STR; - GLog.w(Messages.get(LinkSword.class,"power")); - curUser.sprite.operate(curUser.pos); - curUser.sprite.centerEmitter().start(PurpleParticle.BURST, 0.05f, 10); - curUser.spendAndNext(1f); - } else if (action == AC_WISDOM) { - curUser = hero; - Buff.affect(hero, MirrorShield.class,2f); - curUser.sprite.operate(curUser.pos); - curUser.spendAndNext(1f); - charge=0; - } else if (action == AC_COURAGE) { - curUser = hero; - curItem = this; - GameScene.selectCell( zapper ); - } else { - - super.execute(hero, action); - - } - } - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(CHARGE, charge); - } - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - charge = bundle.getInt(CHARGE); - } - protected LinkBuff passiveBuff() { - return new LinkCharge(); - } - public class LinkBuff extends Buff { - public int level() { - return level; - } - public boolean isCursed() { - return cursed; - } - } - @Override - public boolean doEquip(Hero hero) { - activate(hero); - return super.doEquip(hero); - } - @Override - public void activate(Hero hero) { - passiveBuff = passiveBuff(); - passiveBuff.attachTo(hero); - } - @Override - public boolean doUnequip(Hero hero, boolean collect, boolean single) { - if (super.doUnequip(hero, collect, single)) { - if (passiveBuff != null){ - passiveBuff.detach(); - passiveBuff = null; - } - hero.belongings.weapon = null; - return true; - } else { - return false; - } - } - public class LinkCharge extends LinkBuff { - @Override - public boolean act() { - if (charge < fullCharge) { - charge+=1; - } - if (Dungeon.hero.HP>=Dungeon.hero.HT){ - LinkSword.this.RCH = 4; - } else LinkSword.this.RCH = 1; - spend(TICK); - return true; - } - @Override - public String toString() { - return "LinkCharge"; - } - @Override - public void detach() { - charge = 0; - super.detach(); - } - } - - @Override - public void proc(Char attacker, Char defender, int damage) { - - int DMG = damage; - if (Random.Int(100) > 50) { - switch (Random.Int(7)) { - case 0: - defender.damage(Random.Int(DMG / 4, DMG / 2), this); - break; - case 1: - Buff.affect(defender, Bleeding.class).set(Random.Int(3, DMG)); - break; - case 2: - Buff.prolong(defender, Paralysis.class, 2); - break; - case 3: - Buff.affect(defender, Cripple.class, 3); - break; - case 4: - int p = attacker.pos; - for (int n : Level.NEIGHBOURS8) { - Char ch = Actor.findChar(n + p); - if (ch != null && ch != defender && ch != attacker && ch.isAlive()) { - - int dr = Random.IntRange(0, 1); - int dmg = Random.Int(MIN, MAX); - int effectiveDamage = Math.max(dmg - dr, 0); - - ch.damage(effectiveDamage / 2, this); - } - } - break; - case 5: - Buff.affect(attacker, ShieldArmor.class).level(level); - break; - case 6: - if (charge > 25) { - charge -=15; - defender.damage(5*DMG, this); - } - break; - default: - break; - } - - if (enchantment != null) { - enchantment.proc(this, attacker, defender, damage); - } - if ( defender.HP <= damage && Random.Int(10) == 0) { - Dungeon.level.drop(Generator.random(Generator.Category.LINKDROP), defender.pos).sprite.drop(); - } - } - } - - @Override - public String desc() { - String info = super.desc(); - - info += "\n\n" + Messages.get(this, "charge",charge,fullCharge); - return info; - } - - protected static CellSelector.Listener zapper = new CellSelector.Listener() { - - @Override - public void onSelect(final Integer target ) { - Item proto = new Boomerang(); - if (target != null) { - - final LinkSword ls = (LinkSword) LinkSword.curItem; - - final Ballistica shot = new Ballistica( curUser.pos, target, Ballistica.MAGIC_BOLT); - int cell = shot.collisionPos; - - if (target == curUser.pos || cell == curUser.pos) { - GLog.i( Messages.get(Wand.class, "self_target") ); - return; - } - - curUser.sprite.zap(cell); - - //attempts to target the cell aimed at if something is there, otherwise targets the collision pos. - if (Actor.findChar(target) != null) - QuickSlotButton.target(Actor.findChar(target)); - else - QuickSlotButton.target(Actor.findChar(cell)); - - if (ls.charge >= 0) { - - curUser.busy(); - Callback callback = new Callback() { - @Override - public void call() { - Char ch = Actor.findChar(target); - if (ch != null) { - if (ch.isAlive() && Random.Int(2) == 0) { - Buff.affect(ch, Vertigo.class, 5f); - } - ch.damage((int) (ch.HT / 20), this); - } - } - }; - ((MissileSprite) curUser.sprite.parent.recycle(MissileSprite.class)).reset(curUser.pos, target, proto,callback); - Dungeon.hero.spendAndNext(1.5f); - } else { - GLog.w( Messages.get(Wand.class, "fizzles") ); - } - - } - } - - @Override - public String prompt() { - return Messages.get(Wand.class, "prompt"); - } - }; -} diff --git a/java/com/hmdzl/spspd/change/items/weapon/melee/special/Lollipop.java b/java/com/hmdzl/spspd/change/items/weapon/melee/special/Lollipop.java deleted file mode 100644 index 9ddc713c..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/melee/special/Lollipop.java +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.weapon.melee.special; - -import com.hmdzl.spspd.change.actors.buffs.Burning; -import com.hmdzl.spspd.change.actors.buffs.Charm; -import com.hmdzl.spspd.change.actors.buffs.Light; -import com.hmdzl.spspd.change.actors.buffs.Shieldblock; -import com.hmdzl.spspd.change.actors.buffs.Tar; -import com.hmdzl.spspd.change.actors.buffs.Terror; -import com.hmdzl.spspd.change.actors.buffs.Weakness; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.effects.particles.FlameParticle; -import com.hmdzl.spspd.change.items.Generator; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.KindOfWeapon; -import com.hmdzl.spspd.change.items.weapon.melee.MeleeWeapon; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Paralysis; -import com.watabou.utils.Random; -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.hero.HeroSubClass; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.bags.Bag; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfRecharging; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfUpgrade; -import com.hmdzl.spspd.change.items.wands.*; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.utils.GLog; -import com.hmdzl.spspd.change.windows.WndBag; -import com.hmdzl.spspd.change.windows.WndOptions; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundle; -import java.util.ArrayList; -import java.util.Collections; - -public class Lollipop extends MeleeWeapon { - - { - //name = "Lollipop"; - image = ItemSpriteSheet.LOLLIPOP; - - usesTargeting = true; - } - - public Lollipop() { - super(1, 1f, 1f, 1); - MIN = 50; - MAX = 50; - } - - - @Override - public void proc(Char attacker, Char defender, int damage) { - - if (Random.Int(100) < 40) { - Buff.affect(defender, Tar.class); - } - - if (Random.Int(100) < 60) { - Buff.affect(defender, Charm.class,5f).object = attacker.id(); - } - - if (enchantment != null) { - enchantment.proc(this, attacker, defender, damage); - } - if (Random.Int(50) == 1 ){ - Buff.prolong(attacker, Shieldblock.class, 5f); - Buff.prolong(attacker, Weakness.class, 20f); - attacker.HT -= Math.min(15,attacker.HT-1); - Dungeon.hero.belongings.weapon = null; - GLog.n(Messages.get(KindOfWeapon.class,"destory")); - } - } - -} diff --git a/java/com/hmdzl/spspd/change/items/weapon/melee/special/Pumpkin.java b/java/com/hmdzl/spspd/change/items/weapon/melee/special/Pumpkin.java deleted file mode 100644 index ef785403..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/melee/special/Pumpkin.java +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.weapon.melee.special; - -import com.hmdzl.spspd.change.actors.buffs.Burning; -import com.hmdzl.spspd.change.actors.buffs.Light; -import com.hmdzl.spspd.change.actors.buffs.Terror; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.effects.particles.FlameParticle; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.weapon.melee.MeleeWeapon; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Paralysis; -import com.watabou.utils.Random; -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.hero.HeroSubClass; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.bags.Bag; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfRecharging; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfUpgrade; -import com.hmdzl.spspd.change.items.wands.*; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.utils.GLog; -import com.hmdzl.spspd.change.windows.WndBag; -import com.hmdzl.spspd.change.windows.WndOptions; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundle; -import java.util.ArrayList; -import java.util.Collections; - -public class Pumpkin extends MeleeWeapon { - - { - //name = "Pumpkin Lamp"; - image = ItemSpriteSheet.PUMPKIN; - - usesTargeting = true; - } - - public Pumpkin() { - super(1, 1f, 1f, 1); - MIN = 1; - MAX = 5; - } - - - @Override - public Item upgrade(boolean enchant) { - - return super.upgrade(enchant); - } - - @Override - public void proc(Char attacker, Char defender, int damage) { - - if (Random.Int(100) < 20) { - Buff.affect(defender, Burning.class).reignite(defender); - defender.damage(Random.Int(1, level + 2), this); - defender.sprite.emitter().burst(FlameParticle.FACTORY, level + 1); - } - if (Random.Int(100) < 20) { - Buff.affect(defender, Terror.class, 3); - } - if (Random.Int(100) < 20) { - if (attacker.HP < attacker.HT){ - attacker.HP += 10; - attacker.sprite.emitter().start(Speck.factory(Speck.HEALING), 0.4f,1);} - } - Buff.prolong(attacker, Light.class, 50f); - if (enchantment != null) { - enchantment.proc(this, attacker, defender, damage); - } - } -} diff --git a/java/com/hmdzl/spspd/change/items/weapon/melee/special/RunicBlade.java b/java/com/hmdzl/spspd/change/items/weapon/melee/special/RunicBlade.java deleted file mode 100644 index 1db48cc1..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/melee/special/RunicBlade.java +++ /dev/null @@ -1,141 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.weapon.melee.special; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.quest.DarkGold; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfUpgrade; -import com.hmdzl.spspd.change.items.weapon.melee.MeleeWeapon; -import com.hmdzl.spspd.change.items.weapon.missiles.Boomerang; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.hmdzl.spspd.change.windows.WndBag; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Random; - -public class RunicBlade extends MeleeWeapon { - - public static final String AC_REFORGE = "REFORGE"; - - private static final String TXT_SELECT_WEAPON = "Select a weapon to upgrade"; - - private static final String TXT_REFORGED = "you reforged the short sword to upgrade your %s"; - private static final String TXT_NOT_BOOMERANG = "you can't upgrade a boomerang this way"; - - private static final float TIME_TO_REFORGE = 2f; - - private boolean equipped; - - private float upgradeChance = 0.9f; - - { - //name = "Runic Blade"; - image = ItemSpriteSheet.RUNICBLADE; - } - - public RunicBlade() { - super(5, 1f, 1f,1); - - MIN = 0; - MAX = 35; - - } - - @Override - public Item upgrade(boolean enchant) { - - if (STR > 1 ){ - STR--;} - MIN--; - MAX+=10; - - return super.upgrade(enchant); - } - - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions(hero); - if (level > 0) { - actions.add(AC_REFORGE); - } - return actions; - } - - @Override - public void execute(Hero hero, String action) { - if (action == AC_REFORGE) { - - if (hero.belongings.weapon == this) { - equipped = true; - hero.belongings.weapon = null; - } else { - equipped = false; - detach(hero.belongings.backpack); - } - - curUser = hero; - - GameScene.selectItem(itemSelector, WndBag.Mode.WEAPON, - Messages.get(RunicBlade.class, "choose")); - - } else { - - super.execute(hero, action); - - } - } - - private final WndBag.Listener itemSelector = new WndBag.Listener() { - @Override - public void onSelect(Item item) { - if (item != null && !(item instanceof Boomerang)) { - int i=0; - while(i - */ -package com.hmdzl.spspd.change.items.weapon.melee.special; - -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.buffs.Burning; -import com.hmdzl.spspd.change.actors.buffs.Charm; -import com.hmdzl.spspd.change.actors.buffs.Light; -import com.hmdzl.spspd.change.actors.buffs.Shieldblock; -import com.hmdzl.spspd.change.actors.buffs.Terror; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.effects.Pushing; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.effects.particles.FlameParticle; -import com.hmdzl.spspd.change.items.Generator; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.KindOfWeapon; -import com.hmdzl.spspd.change.items.weapon.melee.MeleeWeapon; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.mechanics.Ballistica; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Paralysis; -import com.watabou.utils.Random; -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.hero.HeroSubClass; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.bags.Bag; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfRecharging; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfUpgrade; -import com.hmdzl.spspd.change.items.wands.*; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.utils.GLog; -import com.hmdzl.spspd.change.windows.WndBag; -import com.hmdzl.spspd.change.windows.WndOptions; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundle; -import java.util.ArrayList; -import java.util.Collections; - -public class SJRBMusic extends MeleeWeapon { - - { - //name = "SJRBMusic"; - image = ItemSpriteSheet.S_J_R_B_M; - - } - - public SJRBMusic() { - super(1, 1f, 1f, 2); - MIN = 3; - MAX = 6; - } - - - @Override - public void proc(Char attacker, Char defender, int damage) { - - if (Random.Int(100) < 40) { - Buff.affect(defender, Charm.class,5f).object = attacker.id(); - } - - if (Random.Int(100)> 60) { - for (Mob mob : Dungeon.level.mobs.toArray(new Mob[0])) { - mob.beckon(attacker.pos); - } - attacker.sprite.centerEmitter().start(Speck.factory(Speck.SCREAM), 0.3f, 3); - Sample.INSTANCE.play( Assets.SND_BEACON ); - attacker.sprite.showStatus(CharSprite.NEUTRAL, Messages.get(this, "rap")); - } - - Ballistica route = new Ballistica(attacker.pos, defender.pos, Ballistica.PROJECTILE); - int cell = route.collisionPos; - int dist = Level.distance(attacker.pos, cell); - if (dist == 2) { - cell = route.path.get(route.dist - 1); - Actor.addDelayed(new Pushing(attacker, attacker.pos, cell), -1); - attacker.pos = cell; - if (attacker instanceof Mob) { - Dungeon.level.mobPress((Mob) attacker); - } else { - Dungeon.level.press(cell, attacker); - } - defender.damage(damage,this); - } - - int p = defender.pos; - for (int n : Level.NEIGHBOURS8) { - Char ch = Actor.findChar(n+p); - if (ch != null && ch != defender && ch != attacker && ch.isAlive()) { - - int dr = Random.IntRange( 0, 1 ); - int dmg = Random.Int( MIN, MAX ); - int effectiveDamage = Math.max( dmg - dr, 0 ); - - ch.damage( effectiveDamage, this ); - } - } - - - if (enchantment != null) { - enchantment.proc(this, attacker, defender, damage); - } - } - -} diff --git a/java/com/hmdzl/spspd/change/items/weapon/melee/special/Spork.java b/java/com/hmdzl/spspd/change/items/weapon/melee/special/Spork.java deleted file mode 100644 index 2f084a23..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/melee/special/Spork.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.weapon.melee.special; - -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.weapon.melee.MeleeWeapon; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.watabou.utils.Random; - -public class Spork extends MeleeWeapon { - - { - //name = "Royal Spork"; - image = ItemSpriteSheet.SPORK; - - } - - public Spork() { - super(3, 1.0f, 0.8f, 1); - } - - @Override - public Item upgrade(boolean enchant) { - MIN+=1; - return super.upgrade(enchant); - } - - - @Override - public void proc(Char attacker, Char defender, int damage) { - - if (attacker.HP < attacker.HT){ - attacker.HP += Random.Int((attacker.HT)/20); - attacker.sprite.emitter().start(Speck.factory(Speck.HEALING), 0.4f,1); - } - if (enchantment != null) { - enchantment.proc(this, attacker, defender, damage); - } - } -} diff --git a/java/com/hmdzl/spspd/change/items/weapon/melee/special/TekkoKagi.java b/java/com/hmdzl/spspd/change/items/weapon/melee/special/TekkoKagi.java deleted file mode 100644 index 5c01779c..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/melee/special/TekkoKagi.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.weapon.melee.special; - -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.items.weapon.melee.MeleeWeapon; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.effects.particles.ShadowParticle; -import com.hmdzl.spspd.change.actors.Char; -import com.watabou.utils.Random; - -public class TekkoKagi extends MeleeWeapon { - - { - //name = "Tekko-Kagi"; - image = ItemSpriteSheet.TEKKOKAGI; - } - - public TekkoKagi() { - super(1, 1f, 1f, 1); - } - - @Override - public Item upgrade(boolean enchant) { - - return super.upgrade(enchant); - } - - @Override - public void proc(Char attacker, Char defender, int damage) { - - if (Random.Int(100) < 20 ) { - defender.damage(Random.Int(defender.HT/4, defender.HT/2), this); - defender.sprite.emitter().burst(ShadowParticle.UP, 5); - if (!defender.isAlive() && attacker instanceof Hero) { - Badges.validateGrimWeapon(); - } - } - if (enchantment != null) { - enchantment.proc(this, attacker, defender, damage); - } - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/items/weapon/melee/special/TestWeapon.java b/java/com/hmdzl/spspd/change/items/weapon/melee/special/TestWeapon.java deleted file mode 100644 index 84fc3cf2..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/melee/special/TestWeapon.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.weapon.melee.special; - -import com.hmdzl.spspd.change.actors.buffs.AttackUp; -import com.hmdzl.spspd.change.actors.buffs.Burning; -import com.hmdzl.spspd.change.actors.buffs.DefenceUp; -import com.hmdzl.spspd.change.actors.buffs.Light; -import com.hmdzl.spspd.change.actors.buffs.Terror; -import com.hmdzl.spspd.change.actors.hero.HeroAction; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.effects.particles.FlameParticle; -import com.hmdzl.spspd.change.effects.particles.ShadowParticle; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.weapon.melee.MeleeWeapon; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Paralysis; -import com.watabou.utils.Random; -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.hero.HeroSubClass; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.bags.Bag; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfRecharging; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfUpgrade; -import com.hmdzl.spspd.change.items.wands.*; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.utils.GLog; -import com.hmdzl.spspd.change.windows.WndBag; -import com.hmdzl.spspd.change.windows.WndOptions; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundle; -import java.util.ArrayList; -import java.util.Collections; - -public class TestWeapon extends MeleeWeapon { - - { - //name = "TestWeapon"; - image = ItemSpriteSheet.ADAMANT_WEAPON; - - } - - public TestWeapon() { - super(1, 1f, 1f, 1); - MIN = 10; - MAX = 10; - } - - - @Override - public Item upgrade(boolean enchant) { - - return super.upgrade(enchant); - } - - /*@Override - public void proc(Char attacker, Char defender, int damage) { - - //Buff.affect(attacker,AttackUp.class,5).level(50); - //Buff.affect(attacker,DefenceUp.class,5).level(50); - - if (enchantment != null) { - enchantment.proc(this, attacker, defender, damage); - } - }*/ - -} diff --git a/java/com/hmdzl/spspd/change/items/weapon/melee/special/Tree.java b/java/com/hmdzl/spspd/change/items/weapon/melee/special/Tree.java deleted file mode 100644 index 7d62e2d1..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/melee/special/Tree.java +++ /dev/null @@ -1,111 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.weapon.melee.special; - -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.buffs.Burning; -import com.hmdzl.spspd.change.actors.buffs.Dry; -import com.hmdzl.spspd.change.actors.buffs.Hot; -import com.hmdzl.spspd.change.actors.buffs.Light; -import com.hmdzl.spspd.change.actors.buffs.Terror; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.effects.particles.FlameParticle; -import com.hmdzl.spspd.change.items.Generator; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.weapon.melee.MeleeWeapon; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Paralysis; -import com.watabou.utils.Random; -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.hero.HeroSubClass; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.bags.Bag; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfRecharging; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfUpgrade; -import com.hmdzl.spspd.change.items.wands.*; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.utils.GLog; -import com.hmdzl.spspd.change.windows.WndBag; -import com.hmdzl.spspd.change.windows.WndOptions; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundle; -import java.util.ArrayList; -import java.util.Collections; - -public class Tree extends MeleeWeapon { - - { - //name = "Christmas tree"; - image = ItemSpriteSheet.TREE; - - //usesTargeting = true; - } - - public Tree() { - super(1, 1f, 1f, 1); - MIN = 1; - MAX = 5; - } - - - @Override - public Item upgrade(boolean enchant) { - - return super.upgrade(enchant); - } - - @Override - public void proc(Char attacker, Char defender, int damage) { - - if (Random.Int(100)> 40){ - Buff.affect(defender, Dry.class,10f); - } - - if (Random.Int(100)> 40){ - Buff.affect(defender, Hot.class,10f); - } - - if (Random.Int(100)==98){ - Dungeon.level.drop(Generator.random(), defender.pos).sprite.drop(); - } - - int p = defender.pos; - for (int n : Level.NEIGHBOURS8) { - Char ch = Actor.findChar(n+p); - if (ch != null && ch != defender && ch != attacker && ch.isAlive()) { - - int dr = Random.IntRange( 0, ch.drRoll() ); - int dmg = Random.Int( MIN, MAX ); - int effectiveDamage = Math.max( dmg - dr, 0 ); - - ch.damage( effectiveDamage, this ); - } - } - - - if (enchantment != null) { - enchantment.proc(this, attacker, defender, damage); - } - } -} diff --git a/java/com/hmdzl/spspd/change/items/weapon/melee/special/WraithBreath.java b/java/com/hmdzl/spspd/change/items/weapon/melee/special/WraithBreath.java deleted file mode 100644 index 015c5d21..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/melee/special/WraithBreath.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.weapon.melee.special; - -import com.hmdzl.spspd.change.items.weapon.melee.MeleeWeapon; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Terror; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Vertigo; -import com.watabou.utils.Random; - -public class WraithBreath extends MeleeWeapon { - - { - //name = "Wraith Breath"; - image = ItemSpriteSheet.WRAITHBREATH; - } - - public WraithBreath() { - super(2, 0.75f, 1f, 4); - } - - @Override - public Item upgrade(boolean enchant) { - MAX+= 2; - MIN+= 2; - return super.upgrade(enchant); - } - - @Override - public void proc(Char attacker, Char defender, int damage) { - - if (Random.Int(100) < 50) { - Buff.affect(defender, Vertigo.class, Vertigo.duration(defender)); - Buff.affect(defender, Terror.class, Terror.DURATION).object = attacker.id(); - } - - if (enchantment != null) { - enchantment.proc(this, attacker, defender, damage); - } - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/items/weapon/melee/zero/Bamboo.java b/java/com/hmdzl/spspd/change/items/weapon/melee/zero/Bamboo.java deleted file mode 100644 index 6041d5f6..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/melee/zero/Bamboo.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.weapon.melee.zero; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.items.KindOfWeapon; -import com.hmdzl.spspd.change.items.weapon.Weapon; -import com.hmdzl.spspd.change.items.weapon.melee.MeleeWeapon; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.utils.Random; - -public class Bamboo extends MeleeWeapon { - - { - //name = "Bamboo"; - image = ItemSpriteSheet.DAGGER; - } - - public Bamboo() { - super(0, 1f, 1f, 1); - } - - @Override - public Item upgrade(boolean enchant) { - MAX+=1; - return super.upgrade(enchant); - } - - @Override - public void proc(Char attacker, Char defender, int damage) { - - int DMG = damage; - defender.damage(Random.Int(DMG,DMG/2*3), this); - if (enchantment != null) { - enchantment.proc(this, attacker, defender, damage); - } - } -} diff --git a/java/com/hmdzl/spspd/change/items/weapon/melee/zero/EmptyPotion.java b/java/com/hmdzl/spspd/change/items/weapon/melee/zero/EmptyPotion.java deleted file mode 100644 index 14dbc136..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/melee/zero/EmptyPotion.java +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.weapon.melee.zero; - -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.buffs.Burning; -import com.hmdzl.spspd.change.actors.buffs.Dry; -import com.hmdzl.spspd.change.actors.buffs.Hot; -import com.hmdzl.spspd.change.actors.buffs.Light; -import com.hmdzl.spspd.change.actors.buffs.Terror; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.effects.particles.FlameParticle; -import com.hmdzl.spspd.change.items.Generator; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.weapon.melee.MeleeWeapon; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Paralysis; -import com.watabou.utils.Random; -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.hero.HeroSubClass; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.bags.Bag; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfRecharging; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfUpgrade; -import com.hmdzl.spspd.change.items.wands.*; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.utils.GLog; -import com.hmdzl.spspd.change.windows.WndBag; -import com.hmdzl.spspd.change.windows.WndOptions; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundle; -import java.util.ArrayList; -import java.util.Collections; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.KindOfWeapon; -import com.hmdzl.spspd.change.messages.Messages; - -public class EmptyPotion extends MeleeWeapon { - - { - //name = "EmptyPotion"; - image = ItemSpriteSheet.POTION; - } - - public EmptyPotion() { - super(0, 1f, 1f, 1); - } - - - @Override - public Item upgrade(boolean enchant) { - MAX+=1; - return super.upgrade(enchant); - } - - @Override - public void proc(Char attacker, Char defender, int damage) { - int p = defender.pos; - for (int n : Level.NEIGHBOURS8) { - Char ch = Actor.findChar(n+p); - if (ch != null && ch != defender && ch != attacker && ch.isAlive()) { - - int dr = Random.IntRange( 0, 1 ); - int dmg = Random.Int( MIN, MAX ); - int effectiveDamage = Math.max( dmg - dr, 0 ); - - ch.damage( effectiveDamage, this ); - } - } - if (enchantment != null) { - enchantment.proc(this, attacker, defender, damage); - } - if (attacker == Dungeon.hero){ - durable --; - if (durable == 10){ - GLog.n(Messages.get(KindOfWeapon.class,"almost_destory")); - } - if (durable == 0){ - Dungeon.hero.belongings.weapon = null; - defender.damage(2*damage, this); - GLog.n(Messages.get(KindOfWeapon.class,"destory")); - } - } - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/items/weapon/melee/zero/GlassBlade.java b/java/com/hmdzl/spspd/change/items/weapon/melee/zero/GlassBlade.java deleted file mode 100644 index b334a510..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/melee/zero/GlassBlade.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.weapon.melee.zero; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.quest.DarkGold; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfUpgrade; -import com.hmdzl.spspd.change.items.weapon.melee.MeleeWeapon; -import com.hmdzl.spspd.change.items.weapon.missiles.Boomerang; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.hmdzl.spspd.change.windows.WndBag; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Random; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Bleeding; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.KindOfWeapon; -import com.hmdzl.spspd.change.messages.Messages; - -public class GlassBlade extends MeleeWeapon { - - { - //name = "GlassBlade"; - image = ItemSpriteSheet.SHORT_SWORD; - - - } - - public GlassBlade() { - super(0, 1f, 1f, 1); - } - - @Override - public Item upgrade(boolean enchant) { - MAX+=1; - return super.upgrade(enchant); - } - - - @Override - public void proc(Char attacker, Char defender, int damage) { - - int DMG = damage; - if (Random.Int(100) < 75) { - Buff.affect(defender, Bleeding.class).set(Random.Int(1,DMG)); - } - - if (enchantment != null) { - enchantment.proc(this, attacker, defender, damage); - } - } -} diff --git a/java/com/hmdzl/spspd/change/items/weapon/melee/zero/Punch.java b/java/com/hmdzl/spspd/change/items/weapon/melee/zero/Punch.java deleted file mode 100644 index cf4ee386..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/melee/zero/Punch.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.weapon.melee.zero; - -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.weapon.melee.MeleeWeapon; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Cripple; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.utils.Random; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.KindOfWeapon; -import com.hmdzl.spspd.change.messages.Messages; - -public class Punch extends MeleeWeapon { - - { - //name = "Punch"; - image = ItemSpriteSheet.KNUCKLEDUSTER; - } - - public Punch() { - super(0, 1f, 1f, 2); - } - - @Override - public Item upgrade(boolean enchant) { - MAX+=1; - return super.upgrade(enchant); - } - - @Override - public void proc(Char attacker, Char defender, int damage) { - Buff.affect(defender, Cripple.class, 3); - if (enchantment != null) { - enchantment.proc(this, attacker, defender, damage); - } - } -} diff --git a/java/com/hmdzl/spspd/change/items/weapon/melee/zero/WoodenHammer.java b/java/com/hmdzl/spspd/change/items/weapon/melee/zero/WoodenHammer.java deleted file mode 100644 index a670a84b..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/melee/zero/WoodenHammer.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.weapon.melee.zero; - -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.weapon.melee.MeleeWeapon; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Paralysis; -import com.watabou.utils.Random; -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.hero.HeroSubClass; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.bags.Bag; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfRecharging; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfUpgrade; -import com.hmdzl.spspd.change.items.wands.*; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.utils.GLog; -import com.hmdzl.spspd.change.windows.WndBag; -import com.hmdzl.spspd.change.windows.WndOptions; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundle; -import java.util.ArrayList; -import java.util.Collections; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.KindOfWeapon; -import com.hmdzl.spspd.change.messages.Messages; - -public class WoodenHammer extends MeleeWeapon { - - { - //name = "WoodenHammer"; - image = ItemSpriteSheet.WOODEN_H; - - } - - public WoodenHammer() { - super(0, 1f, 1f, 1); - } - - - @Override - public Item upgrade(boolean enchant) { - MAX++; - return super.upgrade(enchant); - } - - @Override - public void proc(Char attacker, Char defender, int damage) { - if (Random.Int(100) < 75) { - Buff.prolong(defender, Paralysis.class, 2); - } - if (enchantment != null) { - enchantment.proc(this, attacker, defender, damage); - } - if (attacker == Dungeon.hero){ - durable --; - if (durable == 10){ - GLog.n(Messages.get(KindOfWeapon.class,"almost_destory")); - } - if (durable == 0){ - Dungeon.hero.belongings.weapon = null; - defender.damage(2*damage, this); - GLog.n(Messages.get(KindOfWeapon.class,"destory")); - } - } - } -} diff --git a/java/com/hmdzl/spspd/change/items/weapon/missiles/Boomerang.java b/java/com/hmdzl/spspd/change/items/weapon/missiles/Boomerang.java deleted file mode 100644 index d25e5daa..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/missiles/Boomerang.java +++ /dev/null @@ -1,219 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.weapon.missiles; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.weapon.Weapon; -import com.hmdzl.spspd.change.items.weapon.guns.GunWeapon; -import com.hmdzl.spspd.change.items.weapon.spammo.SpAmmo; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.sprites.MissileSprite; -import com.hmdzl.spspd.change.windows.WndBag; -import com.hmdzl.spspd.change.windows.WndOptions; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundle; - -import java.util.ArrayList; - -public class Boomerang extends MissileWeapon { - - private SpAmmo spammo; - - public static final String AC_AMMO = "AMMO"; - { - //name = "boomerang"; - image = ItemSpriteSheet.BOOMERANG; - - STR = 10; - - MIN = 3; - MAX = 6; - - stackable = false; - unique = true; - reinforced = true; - - - } - - public Boomerang() { - spammo = null; - } - - public Boomerang(SpAmmo spammo) { - this.spammo = spammo; - } - - - - private static final String SPAMMO = "spammo"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - if (spammo != null) bundle.put( SPAMMO, spammo ); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - if (bundle.contains(SPAMMO)) spammo = (SpAmmo) bundle.get( SPAMMO ); - } - - - @Override - public boolean isUpgradable() { - return true; - } - - @Override - public Item upgrade() { - return upgrade(false); - } - - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions( hero ); - actions.add(AC_AMMO); - return actions; - } - - @Override - public void execute(Hero hero, String action) { - super.execute(hero, action); - if (action.equals(AC_AMMO)) { - curUser = hero; - GameScene.selectItem(itemSelector, WndBag.Mode.AMMO ,Messages.get(this, "prompt")); - } - } - - @Override - public Item upgrade(boolean enchant) { - - MIN += 1; - MAX += 2; - super.upgrade(enchant); - - updateQuickslot(); - - return this; - } - - @Override - public Item degrade() { - - return super.degrade(); - } - - @Override - public void proc(Char attacker, Char defender, int damage) { - if (spammo != null) { - spammo.onHit(Boomerang.this, attacker, defender, damage); - } - super.proc(attacker, defender, damage); - if (attacker instanceof Hero && ((Hero) attacker).rangedWeapon == this) { - circleBack(defender.pos, (Hero) attacker); - } - } - - @Override - protected void miss(int cell) { - circleBack(cell, curUser); - } - - private void circleBack(int from, Hero owner) { - - ((MissileSprite) curUser.sprite.parent.recycle(MissileSprite.class)) - .reset(from, curUser.pos, curItem, null); - - if (!collect(curUser.belongings.backpack)) { - Dungeon.level.drop(this, owner.pos).sprite.drop(); - } - } - - @Override - public void cast(Hero user, int dst) { - super.cast(user, dst); - } - - @Override - public String desc() { - String info = super.desc(); - - if (spammo != null){ - info += "\n" + Messages.get(GunWeapon.class, "ammo_add") + Messages.get(spammo,"name") ; - } - - if(reinforced){ - info += "\n\n" + Messages.get(Item.class, "reinforced");; - } - - return info; - } - - public Item addSpAmmo(SpAmmo spammo, Char owner){ - - this.spammo = null; - - //GLog.p( Messages.get(this, "imbue", spammo.name())); - - this.spammo= spammo; - spammo.identify(); - spammo.cursed = false; - //name = Messages.get(spammo, "spammo_name"); - - updateQuickslot(); - - return this; - } - - private final WndBag.Listener itemSelector = new WndBag.Listener() { - @Override - public void onSelect( final Item item ) { - if (item != null) { - - GameScene.show( - new WndOptions("", - Messages.get(GunWeapon.class, "warning"), - Messages.get(GunWeapon.class, "yes"), - Messages.get(GunWeapon.class, "no")) { - @Override - protected void onSelect(int index) { - if (index == 0) { - Sample.INSTANCE.play(Assets.SND_EVOKE); - item.detach(curUser.belongings.backpack); - - addSpAmmo((SpAmmo) item, curUser); - - curUser.spendAndNext(2f); - - updateQuickslot(); - } - } - } - ); - } - } - }; -} diff --git a/java/com/hmdzl/spspd/change/items/weapon/missiles/EmpBola.java b/java/com/hmdzl/spspd/change/items/weapon/missiles/EmpBola.java deleted file mode 100644 index 52a08932..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/missiles/EmpBola.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.weapon.missiles; - -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Cripple; -import com.hmdzl.spspd.change.actors.buffs.ShieldArmor; -import com.hmdzl.spspd.change.actors.buffs.Shocked; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.watabou.utils.Random; - -public class EmpBola extends MissileWeapon { - - { - //name = "bola"; - image = ItemSpriteSheet.BOLA; - - STR = 10; - - MIN = 5; - MAX = 10; - } - - public EmpBola() { - this(1); - } - - public EmpBola(int number) { - super(); - quantity = number; - } - - @Override - public void proc(Char attacker, Char defender, int damage) { - super.proc(attacker, defender, damage); - Buff.prolong(defender, Cripple.class, Cripple.DURATION); - Buff.prolong(defender, Shocked.class, 5f); - Buff.detach(defender, ShieldArmor.class); - if(defender.properties().contains(Char.Property.MECH)){ - defender.damage(defender.HT/3,this); - } - } - - @Override - public Item random() { - quantity = Random.Int(2, 5); - return this; - } - - @Override - public int price() { - return 10 * quantity; - } -} diff --git a/java/com/hmdzl/spspd/change/items/weapon/missiles/ErrorAmmo.java b/java/com/hmdzl/spspd/change/items/weapon/missiles/ErrorAmmo.java deleted file mode 100644 index 1de4679c..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/missiles/ErrorAmmo.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.weapon.missiles; - -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.watabou.utils.Random; - -public class ErrorAmmo extends MissileWeapon { - - { - //name = "error ammo"; - image = ItemSpriteSheet.ERROR_AMMO; - - STR = 0; - MIN = 10000; - MAX = 10000; - - // Finding them in bones would be semi-frequent and - // disappointing. - } - - public ErrorAmmo() { - this(1); - } - - public ErrorAmmo(int number) { - super(); - quantity = number; - } - - @Override - public Item random() { - quantity = Random.Int(5, 8); - return this; - } - @Override - public int price() { - return quantity * 0; - } -} diff --git a/java/com/hmdzl/spspd/change/items/weapon/missiles/ForestDart.java b/java/com/hmdzl/spspd/change/items/weapon/missiles/ForestDart.java deleted file mode 100644 index 23d74c6a..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/missiles/ForestDart.java +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.weapon.missiles; - -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.mobs.Assassin; -import com.hmdzl.spspd.change.actors.mobs.Bat; -import com.hmdzl.spspd.change.actors.mobs.Brute; -import com.hmdzl.spspd.change.actors.mobs.Gnoll; -import com.hmdzl.spspd.change.actors.mobs.GoldThief; -import com.hmdzl.spspd.change.actors.mobs.Rat; -import com.hmdzl.spspd.change.actors.mobs.RatBoss; -import com.hmdzl.spspd.change.actors.mobs.GnollShaman; -import com.hmdzl.spspd.change.actors.mobs.Fiend; -import com.hmdzl.spspd.change.actors.mobs.Thief; -import com.hmdzl.spspd.change.actors.mobs.GnollArcher; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.sprites.ItemSprite.Glowing; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.watabou.utils.Random; - -public class ForestDart extends MissileWeapon { - - { - //name = "lucky throwing knive"; - image = ItemSpriteSheet.KNIVE; - - MIN = 6; - MAX = 14; - - // Finding them in bones would be semi-frequent and - // disappointing. - } - - public ForestDart() { - this(1); - } - - public ForestDart(int number) { - super(); - quantity = number; - } - - @Override - public void proc(Char attacker, Char defender, int damage) { - - - if ( defender.properties().contains(Char.Property.BOSS) - || defender.properties().contains(Char.Property.HUMAN) - || defender.properties().contains(Char.Property.GNOLL) - || defender.properties().contains(Char.Property.ORC) - || defender.properties().contains(Char.Property.BEAST) - || defender.properties().contains(Char.Property.PLANT) - ){ - defender.damage(Random.Int(damage*5,damage*8), this); - } else { - defender.damage(Random.Int(damage,damage*2), this); - } - - - } - - - @Override - public Item random() { - quantity = Random.Int(5, 15); - return this; - } - - @Override - public int price() { - return quantity * 2; - } - - private static final Glowing GREEN = new Glowing(0x00FF00); - - @Override - public Glowing glowing() { - return GREEN; - } -} diff --git a/java/com/hmdzl/spspd/change/items/weapon/missiles/HugeShuriken.java b/java/com/hmdzl/spspd/change/items/weapon/missiles/HugeShuriken.java deleted file mode 100644 index 4d4d26b6..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/missiles/HugeShuriken.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.weapon.missiles; - -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.Blob; -import com.hmdzl.spspd.change.actors.blobs.Fire; -import com.hmdzl.spspd.change.actors.buffs.AttackDown; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Burning; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.watabou.utils.Random; - -public class HugeShuriken extends MissileWeapon { - - { - //name = "Huge shuriken"; - image = ItemSpriteSheet.HUGESHURIKEN; - - STR = 13; - - MIN = 2; - MAX = 6; - } - - public HugeShuriken() { - this(1); - } - - public HugeShuriken(int number) { - super(); - quantity = number; - } - - @Override - public void proc(Char attacker, Char defender, int damage) { - Buff.affect(defender, AttackDown.class,10f).level(30); - super.proc(attacker, defender, damage); - } - @Override - public Item random() { - quantity = Random.Int(3, 7); - return this; - } - - @Override - public int price() { - return 10 * quantity; - } -} diff --git a/java/com/hmdzl/spspd/change/items/weapon/missiles/IncendiaryDart.java b/java/com/hmdzl/spspd/change/items/weapon/missiles/IncendiaryDart.java deleted file mode 100644 index 2fd01daf..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/missiles/IncendiaryDart.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.weapon.missiles; - -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.Blob; -import com.hmdzl.spspd.change.actors.blobs.Fire; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Burning; -import com.hmdzl.spspd.change.actors.buffs.Tar; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.watabou.utils.Random; - -public class IncendiaryDart extends MissileWeapon { - - { - //name = "incendiary dart"; - image = ItemSpriteSheet.INCENDIARY_DART; - - STR = 10; - - MIN = 3; - MAX = 5; - } - - public IncendiaryDart() { - this(1); - } - - public IncendiaryDart(int number) { - super(); - quantity = number; - } - - @Override - protected void onThrow(int cell) { - Char enemy = Actor.findChar(cell); - if ((enemy == null || enemy == curUser) && Level.flamable[cell]) - GameScene.add(Blob.seed(cell, 4, Fire.class)); - else - super.onThrow(cell); - } - - @Override - public void proc(Char attacker, Char defender, int damage) { - Buff.affect(defender, Burning.class).reignite(defender); - Buff.affect(defender, Tar.class); - super.proc(attacker, defender, damage); - } - - @Override - public Item random() { - quantity = Random.Int(3, 6); - return this; - } - - @Override - public int price() { - return 10 * quantity; - } -} diff --git a/java/com/hmdzl/spspd/change/items/weapon/missiles/ManyKnive.java b/java/com/hmdzl/spspd/change/items/weapon/missiles/ManyKnive.java deleted file mode 100644 index 53b1f7e8..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/missiles/ManyKnive.java +++ /dev/null @@ -1,308 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.weapon.missiles; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.buffs.MechArmor; -import com.hmdzl.spspd.change.actors.buffs.TargetShoot; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.Splash; -import com.hmdzl.spspd.change.items.Generator; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.misc.MissileShield; -import com.hmdzl.spspd.change.items.rings.RingOfSharpshooting; -import com.hmdzl.spspd.change.items.wands.WandOfFlow; -import com.hmdzl.spspd.change.items.weapon.Weapon; -import com.hmdzl.spspd.change.items.weapon.guns.GunWeapon; -import com.hmdzl.spspd.change.items.weapon.guns.ToyGun; -import com.hmdzl.spspd.change.items.weapon.melee.MeleeWeapon; -import com.hmdzl.spspd.change.items.weapon.missiles.Boomerang; -import com.hmdzl.spspd.change.items.weapon.missiles.MissileWeapon; -import com.hmdzl.spspd.change.items.weapon.spammo.SpAmmo; -import com.hmdzl.spspd.change.mechanics.Ballistica; -import com.hmdzl.spspd.change.scenes.CellSelector; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.utils.GLog; -import com.hmdzl.spspd.change.windows.WndBag; -import com.hmdzl.spspd.change.windows.WndOptions; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Paralysis; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.KindOfWeapon; -import com.hmdzl.spspd.change.messages.Messages; - -import java.util.ArrayList; - -public class ManyKnive extends Weapon { - - private SpAmmo spammo; - public static final String AC_SHOOT = "SHOOT"; - public static final String AC_AMMO = "AMMO"; - - { - //name = "ManyKnive"; - image = ItemSpriteSheet.MANY_KNIVE; - - STR = 10; - - MIN = 2; - MAX = 4; - - stackable = false; - unique = true; - - defaultAction = AC_SHOOT; - usesTargeting = true; - reinforced = true; - } - - - public ManyKnive() { - spammo = null; - } - - public ManyKnive(SpAmmo spammo) { - this.spammo = spammo; - } - - - private static final String SPAMMO = "spammo"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - if (spammo != null) bundle.put( SPAMMO, spammo ); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - if (bundle.contains(SPAMMO)) spammo = (SpAmmo) bundle.get( SPAMMO ); - } - - @Override - public boolean isUpgradable() { - return true; - } - - @Override - public Item upgrade() { - return upgrade(false); - } - - - @Override - public boolean isIdentified() { - return true; - } - - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions(hero); - actions.remove(AC_EQUIP); - actions.remove(AC_DROP); - actions.remove(AC_THROW); - actions.add(AC_SHOOT); - actions.add(AC_AMMO); - - return actions; - } - - @Override - public void execute(Hero hero, String action) { - super.execute(hero, action); - if (action.equals(AC_SHOOT)) { - GameScene.selectCell( shooter ); - } - if (action.equals(AC_AMMO)) { - curUser = hero; - GameScene.selectItem(itemSelector, WndBag.Mode.AMMO ,Messages.get(this, "prompt")); - } - } - - - @Override - public Item upgrade(boolean enchant) { - - MIN += 1; - MAX += 3; - super.upgrade(enchant); - - updateQuickslot(); - - return this; - } - - @Override - public Item degrade() { - return super.degrade(); - } - - public int damageRoll(Hero owner) { - int damage = Random.Int(MIN, MAX); - - float bonus = 0; - for (Buff buff : owner.buffs(RingOfSharpshooting.Aim.class)) { - bonus += ((RingOfSharpshooting.Aim) buff).level; - } - if (Dungeon.hero.buff(TargetShoot.class)!= null) - bonus += 10; - if (Dungeon.hero.buff(MechArmor.class)!= null) - bonus += 10; - damage = (int)(damage*(1 + 0.05*bonus)); - return Math.round(damage); - } - - - @Override - public String info() { - String info = desc(); - - if (spammo != null){ - info += "\n" + Messages.get(GunWeapon.class, "ammo_add") + Messages.get(spammo,"name") ; - } - - if (reinforced) { - info += "\n" + Messages.get(Item.class, "reinforced"); - } - info += "\n\n" + Messages.get(this, "damage",MIN,MAX); - - return info; - } - - - private int targetPos; - - - public Item addSpAmmo(SpAmmo spammo, Char owner){ - - this.spammo = null; - - //GLog.p( Messages.get(this, "imbue", spammo.name())); - - this.spammo= spammo; - spammo.identify(); - spammo.cursed = false; - //name = Messages.get(spammo, "spammo_name"); - - updateQuickslot(); - - return this; - } - - private final WndBag.Listener itemSelector = new WndBag.Listener() { - @Override - public void onSelect( final Item item ) { - if (item != null) { - - GameScene.show( - new WndOptions("", - Messages.get(GunWeapon.class, "warning"), - Messages.get(GunWeapon.class, "yes"), - Messages.get(GunWeapon.class, "no")) { - @Override - protected void onSelect(int index) { - if (index == 0) { - Sample.INSTANCE.play(Assets.SND_EVOKE); - item.detach(curUser.belongings.backpack); - - addSpAmmo((SpAmmo) item, curUser); - - curUser.spendAndNext(2f); - - updateQuickslot(); - } - } - } - ); - } - } - }; - - public KniveAmmo Ammo(){ - return new KniveAmmo(); - } - - public class KniveAmmo extends MissileWeapon { - - { - image = ItemSpriteSheet.KNIVE; - enchantment = ManyKnive.this.enchantment; - DLY = 0.25f; - } - - public int damageRoll(Hero owner) { - return ManyKnive.this.damageRoll(owner); - } - - @Override - protected void onThrow( int cell ) { - Char enemy = Actor.findChar( cell ); - if (enemy == null || enemy == curUser) { - parent = null; - Splash.at( cell, 0xCC99FFFF, 1 ); - } else { - if (!curUser.shoot( enemy, this )) { - Splash.at(cell, 0xCC99FFFF, 1); - } - } - } - - @Override - public void proc(Char attacker, Char defender, int damage) { - if (spammo != null) { - spammo.onHit(ManyKnive.this, attacker, defender, damage); - } - if (enchantment != null) { - enchantment.proc(ManyKnive.this, attacker, defender, damage); - } - if (Random.Int(50)== 0){ - Dungeon.level.drop(new EscapeKnive(1), defender.pos).sprite.drop(); - } - super.proc(attacker, defender, damage); - } - - @Override - public void cast(final Hero user, final int dst) { - final int cell = throwPos( user, dst ); - ManyKnive.this.targetPos = cell; - super.cast(user, dst); - } - } - - private CellSelector.Listener shooter = new CellSelector.Listener() { - @Override - public void onSelect( Integer target ) { - if (target != null) { - Ammo().cast(curUser, target); - } - } - @Override - public String prompt() { - return Messages.get(ToyGun.class, "prompt"); - } - }; -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/items/weapon/missiles/MiniMoai.java b/java/com/hmdzl/spspd/change/items/weapon/missiles/MiniMoai.java deleted file mode 100644 index 073cac84..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/missiles/MiniMoai.java +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.weapon.missiles; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Charm; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.weapon.Weapon; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.sprites.MissileSprite; -import com.watabou.utils.Random; - -import java.util.ArrayList; - -public class MiniMoai extends MissileWeapon { - - { - //name = "MiniMoai"; - image = ItemSpriteSheet.MOAI; - - STR = 10; - - MIN = 1; - MAX = 10; - - stackable = false; - unique = true; - - - } - - @Override - public boolean isUpgradable() { - return true; - } - - @Override - public Item upgrade() { - return upgrade(false); - } - - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions( hero ); - if (!isEquipped(hero)) actions.add(AC_EQUIP); - return actions; - } - - @Override - public Item upgrade(boolean enchant) { - - MIN += 1; - MAX += 1; - super.upgrade(enchant); - - updateQuickslot(); - - return this; - } - - @Override - public Item degrade() { - - return super.degrade(); - } - - @Override - public void proc(Char attacker, Char defender, int damage) { - if (Random.Int(10)> 7){ - Buff.prolong(defender, Charm.class, 3 ).object = attacker.id();} - super.proc(attacker, defender, damage); - } - - @Override - public String desc() { - String info = super.desc(); - - if(reinforced){ - info += "\n\n" + Messages.get(Item.class, "reinforced"); - } - - return info; - } - - @Override - public int price() { - return quantity * 100; - } -} diff --git a/java/com/hmdzl/spspd/change/items/weapon/missiles/MissileWeapon.java b/java/com/hmdzl/spspd/change/items/weapon/missiles/MissileWeapon.java deleted file mode 100644 index 2e096282..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/missiles/MissileWeapon.java +++ /dev/null @@ -1,151 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.weapon.missiles; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.hero.Belongings; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.hero.HeroClass; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.KindOfWeapon; -import com.hmdzl.spspd.change.items.misc.MissileShield; -import com.hmdzl.spspd.change.items.rings.RingOfSharpshooting; -import com.hmdzl.spspd.change.items.weapon.Weapon; -import com.hmdzl.spspd.change.items.weapon.guns.GunWeapon; -import com.hmdzl.spspd.change.items.weapon.melee.MeleeWeapon; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.utils.Random; - -public class MissileWeapon extends Weapon { - - { - levelKnown = true; - defaultAction = AC_THROW; - usesTargeting = true; - stackable = true; - } - - protected boolean sticky = true; - - protected static final float MAX_DURABILITY = 100; - protected float durability = MAX_DURABILITY; - - //used to reduce durability from the source weapon stack, rather than the one being thrown. - protected MissileWeapon parent; - - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions(hero); - actions.remove(AC_EQUIP); - actions.remove(AC_UNEQUIP); - return actions; - } - - @Override - protected void onThrow(int cell) { - Char enemy = Actor.findChar(cell); - if (enemy == null || enemy == curUser) { - if (this instanceof Boomerang ) - super.onThrow(cell); - else - miss(cell); - } else { - if (!curUser.shoot(enemy, this)) { - miss(cell); - } else if (this instanceof MiniMoai){ - Dungeon.level.drop( this, enemy.pos).sprite.drop(); - } else if (!(this instanceof Boomerang )) { - int bonus = 0; - for (Buff buff : curUser.buffs(RingOfSharpshooting.Aim.class)) - bonus += ((RingOfSharpshooting.Aim) buff).level; - - if (curUser.heroClass == HeroClass.HUNTRESS) - bonus += 3; - } - } - } - - protected void miss(int cell) { - int bonus = 0; - for (Buff buff : curUser.buffs(RingOfSharpshooting.Aim.class)) { - bonus += ((RingOfSharpshooting.Aim) buff).level; - } - - // degraded ring of sharpshooting will even make missed shots break. - if (Random.Float() < Math.pow(0.6, -bonus)) - super.onThrow(cell); - } - - @Override - public void proc(Char attacker, Char defender, int damage) { - super.proc(attacker, defender, damage); - KindOfWeapon wep = Dungeon.hero.belongings.weapon; - if (Dungeon.hero.heroClass== HeroClass.HUNTRESS && wep !=null && this instanceof MissileWeapon && !( this instanceof ManyKnive.KniveAmmo) && !(this instanceof TaurcenBow.TaurcenBowArrow)&& !(this instanceof GunWeapon.NormalAmmo)) { - defender.damage(Random.Int(wep.MAX,wep.MIN),this); - } - Hero hero = (Hero) attacker; - if (hero.rangedWeapon == null && stackable) { - if (quantity == 1) { - doUnequip(hero, false, false); - } else { - detach(null); - } - } - - } - - @Override - public Item random() { - return this; - } - - @Override - public boolean isUpgradable() { - return false; - } - - @Override - public boolean isIdentified() { - return true; - } - - @Override - public String info() { - - String info = desc(); - - info += "\n\n" + Messages.get( Weapon.class, "avg_dmg",MIN,MAX); - - if (STR > Dungeon.hero.STR()) { - info += Messages.get(Weapon.class, "too_heavy"); - } else { - info += " " + Messages.get(MeleeWeapon.class, "excess_str", Dungeon.hero.STR() - STR); - } - - if (enchantment != null) { - info += "\n" + Messages.get(MeleeWeapon.class, "enchanted", enchantment.desc()); - } - - return info; - } -} diff --git a/java/com/hmdzl/spspd/change/items/weapon/missiles/MoneyPack.java b/java/com/hmdzl/spspd/change/items/weapon/missiles/MoneyPack.java deleted file mode 100644 index 50a49a0f..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/missiles/MoneyPack.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.weapon.missiles; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.ArmorBreak; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.watabou.utils.Random; - -public class MoneyPack extends MissileWeapon { - - { - image = ItemSpriteSheet.MONEY_PACK; - - STR = 10; - MIN = 1; - MAX = 1; - - } - - public MoneyPack() { - this(1); - } - - public MoneyPack(int number) { - super(); - quantity = number; - } - - @Override - public void proc(Char attacker, Char defender, int damage) { - super.proc(attacker, defender, damage); - int moneyneed = defender.HP; - if (moneyneed < Dungeon.gold){ - defender.damage(moneyneed,this); - Dungeon.gold-=moneyneed; - } else { - defender.damage(Dungeon.gold,this); - Dungeon.gold=0; - } - - } - - @Override - public Item random() { - quantity = Random.Int(5, 10); - return this; - } - - @Override - public int price() { - return quantity * 100; - } -} diff --git a/java/com/hmdzl/spspd/change/items/weapon/missiles/NormalBomb.java b/java/com/hmdzl/spspd/change/items/weapon/missiles/NormalBomb.java deleted file mode 100644 index 0b5a5f71..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/missiles/NormalBomb.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.weapon.missiles; - -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Paralysis; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.sprites.ItemSprite; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.watabou.utils.Random; - -public class NormalBomb extends MissileWeapon { - - - { - //name = "Normal Bomb"; - image = ItemSpriteSheet.EMPTY_BOMB; - - STR = 10; - - MIN = 1; - MAX = 1; - } - - public NormalBomb() { - this(1); - } - - public NormalBomb(int number) { - super(); - quantity = number; - } - - private static ItemSprite.Glowing BROWN = new ItemSprite.Glowing(0xCC6600); - - @Override - public ItemSprite.Glowing glowing() { - return BROWN; - } - - @Override - public void proc(Char attacker, Char defender, int damage) { - super.proc(attacker, defender, damage); - if(defender.properties().contains(Char.Property.BOSS)){ - defender.damage(defender.HT/2,this); - } - } - - @Override - public Item random() { - quantity = Random.Int(1, 2); - return this; - } - - @Override - public int price() { - return 20 * quantity; - } -} diff --git a/java/com/hmdzl/spspd/change/items/weapon/missiles/PocketBall.java b/java/com/hmdzl/spspd/change/items/weapon/missiles/PocketBall.java deleted file mode 100644 index e7c47c4f..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/missiles/PocketBall.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.weapon.missiles; - - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.mobs.pets.PET; -import com.hmdzl.spspd.change.items.PocketBallFull; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.audio.Sample; -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.effects.particles.ShadowParticle; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; - - -public class PocketBall extends MissileWeapon { - - { - //name = "pocket ball"; - image = ItemSpriteSheet.POCKETBALL_EMPTY; - - STR = 10; - MIN = 1; - MAX = 10; - - stackable = true; - } - - public PocketBall() { - this( 1 ); - } - - public PocketBall(int number) { - super(); - quantity = number; - } - - - @Override - protected void onThrow( int cell ) { - if(Actor.findChar(cell) != null && Actor.findChar(cell) instanceof PET) { - Actor.findChar(cell).sprite.emitter().burst(ShadowParticle.CURSE, 6); - Sample.INSTANCE.play( Assets.SND_CURSED ); - PocketBallFull pbf = new PocketBallFull( - Dungeon.hero.petType, - Dungeon.hero.petHP, - Dungeon.hero.petLevel, - Dungeon.hero.petExperience - - ); - Dungeon.level.drop( pbf, cell ).sprite.drop(); - ((PET) Actor.findChar(cell)).sprite.killAndErase(); - ((PET) Actor.findChar(cell)).destroy(); - Dungeon.hero.haspet=false; - GLog.n(Messages.get(this, "get_pet")); - } else - miss(cell); - } - - @Override - public int price() { - return 100 * quantity; - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/items/weapon/missiles/PoisonDart.java b/java/com/hmdzl/spspd/change/items/weapon/missiles/PoisonDart.java deleted file mode 100644 index b4038684..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/missiles/PoisonDart.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.weapon.missiles; - -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Paralysis; -import com.hmdzl.spspd.change.actors.buffs.Poison; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.watabou.utils.Random; - -public class PoisonDart extends MissileWeapon { - - public static final float DURATION = 3f; - - { - //name = "poison dart"; - image = ItemSpriteSheet.POSION_DART; - - STR = 10; - - MIN = 1; - MAX = 5; - } - - public PoisonDart() { - this(1); - } - - public PoisonDart(int number) { - super(); - quantity = number; - } - - @Override - public void proc(Char attacker, Char defender, int damage) { - Buff.affect(defender, Poison.class).set( - Poison.durationFactor(defender) * (10)); - super.proc(attacker, defender, damage); - } - - @Override - public Item random() { - quantity = Random.Int(2, 5); - return this; - } - - @Override - public int price() { - return 10 * quantity; - } -} diff --git a/java/com/hmdzl/spspd/change/items/weapon/missiles/RiceBall.java b/java/com/hmdzl/spspd/change/items/weapon/missiles/RiceBall.java deleted file mode 100644 index e3d93d4a..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/missiles/RiceBall.java +++ /dev/null @@ -1,131 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.weapon.missiles; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Drowsy; -import com.hmdzl.spspd.change.actors.mobs.BlueWraith; -import com.hmdzl.spspd.change.actors.mobs.DwarfLich; -import com.hmdzl.spspd.change.actors.mobs.FlyingProtector; -import com.hmdzl.spspd.change.actors.mobs.Golem; -import com.hmdzl.spspd.change.actors.mobs.RedWraith; -import com.hmdzl.spspd.change.actors.mobs.Sentinel; -import com.hmdzl.spspd.change.actors.mobs.ShadowYog; -import com.hmdzl.spspd.change.actors.mobs.Skeleton; -import com.hmdzl.spspd.change.actors.mobs.Fiend; -import com.hmdzl.spspd.change.actors.mobs.Statue; -import com.hmdzl.spspd.change.actors.mobs.Wraith; -import com.hmdzl.spspd.change.actors.mobs.Yog; -import com.hmdzl.spspd.change.actors.mobs.npcs.NPC; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfTeleportation; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.utils.Random; - -public class RiceBall extends MissileWeapon { - - public static final float DURATION = 10f; - - { - //name = "rice dumpling"; - image = ItemSpriteSheet.DUST; - - MIN = 1; - MAX = 2; - - DLY = 0.25f; - - - } - - public RiceBall() { - this(1); - } - - public RiceBall(int number) { - super(); - quantity = number; - } - - - @Override - public void proc(Char attacker, Char defender, int damage) { - - if (defender != null - && !(defender instanceof NPC) - && !defender.properties().contains(Char.Property.UNDEAD) - && !defender.properties().contains(Char.Property.BOSS) - && !defender.properties().contains(Char.Property.DEMONIC) - && !defender.properties().contains(Char.Property.UNKNOW) - && !defender.properties().contains(Char.Property.ELEMENT) - && !defender.properties().contains(Char.Property.MECH) - ) { - - Buff.affect(defender, Drowsy.class); - defender.sprite.centerEmitter().start(Speck.factory(Speck.NOTE), 0.3f, 5); - - if (defender.HP/defender.HT > 0.01f){ - int count = 20; - int pos; - do { - pos = Dungeon.level.randomRespawnCell(); - if (count-- <= 0) { - break; - } - } while (pos == -1); - - if (pos == -1) { - - GLog.w(Messages.get(ScrollOfTeleportation.class, "tele")); - - } else { - - defender.pos = pos; - defender.sprite.place(defender.pos); - defender.sprite.visible = Dungeon.visible[pos]; - GLog.i(curUser.name + " teleported " + defender.name - + " to somewhere"); - - } - - } else { - - GLog.i("nothing happened"); - - } - } - - super.proc(attacker, defender, damage); - } - - @Override - public Item random() { - quantity = Random.Int(3, 5); - return this; - } - - @Override - public int price() { - return quantity * 10; - } -} diff --git a/java/com/hmdzl/spspd/change/items/weapon/missiles/ShatteredAmmo.java b/java/com/hmdzl/spspd/change/items/weapon/missiles/ShatteredAmmo.java deleted file mode 100644 index c56070ac..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/missiles/ShatteredAmmo.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.weapon.missiles; - -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.ArmorBreak; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.watabou.utils.Random; - -public class ShatteredAmmo extends MissileWeapon { - - { - image = ItemSpriteSheet.SHATTERED_AMMO; - - STR = 10; - MIN = 10; - MAX = 30; - - // Finding them in bones would be semi-frequent and - // disappointing. - } - - public ShatteredAmmo() { - this(1); - } - - public ShatteredAmmo(int number) { - super(); - quantity = number; - } - - @Override - public void proc(Char attacker, Char defender, int damage) { - super.proc(attacker, defender, damage); - Buff.affect(defender, ArmorBreak.class,10f).level(30); - } - - @Override - public Item random() { - quantity = Random.Int(3, 5); - return this; - } - - @Override - public int price() { - return quantity * 10; - } -} diff --git a/java/com/hmdzl/spspd/change/items/weapon/missiles/Skull.java b/java/com/hmdzl/spspd/change/items/weapon/missiles/Skull.java deleted file mode 100644 index 6b266ca5..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/missiles/Skull.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.weapon.missiles; - -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.SoulMark; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.watabou.utils.Random; - -public class Skull extends MissileWeapon { - - { - //name = "skull"; - image = ItemSpriteSheet.SKULLWEP; - - MIN = 1; - MAX = 4; - - - } - - public Skull() { - this(1); - } - - public Skull(int number) { - super(); - quantity = number; - } - - @Override - public void proc(Char attacker, Char defender, int damage) { - super.proc(attacker, defender, damage); - Buff.affect(defender, SoulMark.class,10f); - } - - @Override - public Item random() { - quantity = Random.Int(3, 5); - return this; - } - - @Override - public int price() { - return quantity * 10; - } -} diff --git a/java/com/hmdzl/spspd/change/items/weapon/missiles/Smoke.java b/java/com/hmdzl/spspd/change/items/weapon/missiles/Smoke.java deleted file mode 100644 index 18382d76..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/missiles/Smoke.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.weapon.missiles; - -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.Blob; -import com.hmdzl.spspd.change.actors.blobs.DarkGas; -import com.hmdzl.spspd.change.actors.buffs.Blindness; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.watabou.utils.Random; - -public class Smoke extends MissileWeapon { - - { - //name = "shuriken"; - image = ItemSpriteSheet.SHURIKEN; - - STR = 10; - - MIN = 2; - MAX = 4; - - } - - public Smoke() { - this(1); - } - - public Smoke(int number) { - super(); - quantity = number; - } - - @Override - public Item random() { - quantity = Random.Int(3, 5); - return this; - } - - @Override - protected void onThrow(int cell) { - Char enemy = Actor.findChar(cell); - if (enemy == null || enemy == curUser) - //GameScene.add(Blob.seed(cell, 4, Fire.class)); - GameScene.add(Blob.seed(cell, 100, DarkGas.class)); - else - super.onThrow(cell); - } - - @Override - public void proc(Char attacker, Char defender, int damage) { - super.proc(attacker, defender, damage); - Buff.affect(defender, Blindness.class,3f); - GameScene.add(Blob.seed(defender.pos, 100, DarkGas.class)); - } - - @Override - public int price() { - return 10 * quantity; - } -} diff --git a/java/com/hmdzl/spspd/change/items/weapon/missiles/Tamahawk.java b/java/com/hmdzl/spspd/change/items/weapon/missiles/Tamahawk.java deleted file mode 100644 index 03284fba..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/missiles/Tamahawk.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.weapon.missiles; - -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Bleeding; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.watabou.utils.Random; - -public class Tamahawk extends MissileWeapon { - - { - //name = "tomahawk"; - image = ItemSpriteSheet.TOMAHAWK; - - STR = 16; - - MIN = 70; - MAX = 140; - } - - public Tamahawk() { - this(1); - } - - public Tamahawk(int number) { - super(); - quantity = number; - } - - @Override - public void proc(Char attacker, Char defender, int damage) { - super.proc(attacker, defender, damage); - Buff.affect(defender, Bleeding.class).set(damage); - } - - @Override - public Item random() { - quantity = Random.Int(4, 8); - return this; - } - - @Override - public int price() { - return 15 * quantity; - } -} diff --git a/java/com/hmdzl/spspd/change/items/weapon/missiles/TaurcenBow.java b/java/com/hmdzl/spspd/change/items/weapon/missiles/TaurcenBow.java deleted file mode 100644 index 3f74de12..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/missiles/TaurcenBow.java +++ /dev/null @@ -1,330 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.weapon.missiles; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.blobs.ElectriShock; -import com.hmdzl.spspd.change.actors.buffs.ArmorBreak; -import com.hmdzl.spspd.change.actors.buffs.AttackUp; -import com.hmdzl.spspd.change.actors.buffs.Burning; -import com.hmdzl.spspd.change.actors.buffs.Frost; -import com.hmdzl.spspd.change.actors.buffs.MechArmor; -import com.hmdzl.spspd.change.actors.buffs.Ooze; -import com.hmdzl.spspd.change.actors.buffs.Shocked; -import com.hmdzl.spspd.change.actors.buffs.Slow; -import com.hmdzl.spspd.change.actors.buffs.TargetShoot; -import com.hmdzl.spspd.change.actors.buffs.Wet; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.hero.HeroAction; -import com.hmdzl.spspd.change.effects.Splash; -import com.hmdzl.spspd.change.items.Generator; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.misc.MissileShield; -import com.hmdzl.spspd.change.items.rings.RingOfSharpshooting; -import com.hmdzl.spspd.change.items.wands.WandOfFlow; -import com.hmdzl.spspd.change.items.weapon.Weapon; -import com.hmdzl.spspd.change.items.weapon.guns.GunWeapon; -import com.hmdzl.spspd.change.items.weapon.guns.ToyGun; -import com.hmdzl.spspd.change.items.weapon.melee.MeleeWeapon; -import com.hmdzl.spspd.change.items.weapon.missiles.Boomerang; -import com.hmdzl.spspd.change.items.weapon.missiles.MissileWeapon; -import com.hmdzl.spspd.change.items.weapon.spammo.SpAmmo; -import com.hmdzl.spspd.change.mechanics.Ballistica; -import com.hmdzl.spspd.change.scenes.CellSelector; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.utils.GLog; -import com.hmdzl.spspd.change.windows.WndBag; -import com.hmdzl.spspd.change.windows.WndOptions; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Paralysis; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.KindOfWeapon; -import com.hmdzl.spspd.change.messages.Messages; - -import java.util.ArrayList; - -public class TaurcenBow extends Weapon { - - public static final String AC_SHOOT = "SHOOT"; - public static final String AC_BREAK = "BREAK"; - public static final String AC_FIRE = "FIRE"; - public static final String AC_ICE = "ICE"; - public static final String AC_POSION = "POSION"; - public static final String AC_ELE = "ELE"; - - { - //name = "TaurcenBow"; - image = ItemSpriteSheet.BOW; - - STR = 10; - - MIN = 4; - MAX = 8; - - stackable = false; - - unique = true; - - defaultAction = AC_SHOOT; - usesTargeting = true; - reinforced = true; - } - - public enum Arrow { - NONE, FIRE, ICE, POSION, ELE - } - - public Arrow arrow = Arrow.NONE; - - public static int charge = 0; - private static final String CHARGE = "charge"; - private static final String ARROW = "arrow"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put( ARROW, arrow ); - bundle.put(CHARGE, charge); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - arrow = bundle.getEnum( ARROW, Arrow.class ); - charge = bundle.getInt(CHARGE); - } - - @Override - public boolean isUpgradable() { - return true; - } - - @Override - public boolean isIdentified() { - return true; - } - - @Override - public Item upgrade() { - return upgrade(false); - } - - - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions(hero); - actions.remove(AC_EQUIP); - actions.remove(AC_DROP); - actions.remove(AC_THROW); - actions.add(AC_SHOOT); - actions.add(AC_BREAK); - actions.add(AC_FIRE); - actions.add(AC_ICE); - actions.add(AC_POSION); - actions.add(AC_ELE); - return actions; - } - - @Override - public void execute(Hero hero, String action) { - super.execute(hero, action); - if (action.equals(AC_SHOOT)) { - GameScene.selectCell( shooter ); - } - if (action.equals(AC_BREAK)) { - curUser = hero; - this.arrow = TaurcenBow.Arrow.NONE; - } - if (action.equals(AC_FIRE)) { - curUser = hero; - this.arrow = TaurcenBow.Arrow.FIRE; - } - if (action.equals(AC_ICE)) { - curUser = hero; - this.arrow = TaurcenBow.Arrow.ICE; - } - if (action.equals(AC_POSION)) { - curUser = hero; - this.arrow = TaurcenBow.Arrow.POSION; - } - if (action.equals(AC_ELE)) { - curUser = hero; - this.arrow = TaurcenBow.Arrow.ELE; - } - } - - - @Override - public Item upgrade(boolean enchant) { - - MIN += 3; - MAX += 5; - super.upgrade(enchant); - updateQuickslot(); - return this; - } - - @Override - public Item degrade() { - return super.degrade(); - } - - public int damageRoll(Hero owner) { - int damage = Random.Int(MIN, MAX); - - float bonus = 0; - for (Buff buff : owner.buffs(RingOfSharpshooting.Aim.class)) { - bonus += ((RingOfSharpshooting.Aim) buff).level; - } - if (Dungeon.hero.buff(TargetShoot.class)!= null) - bonus += 10; - if (Dungeon.hero.buff(MechArmor.class)!= null) - bonus += 10; - damage = (int)(damage*(1 + 0.05*bonus)); - return Math.round(damage); - } - - - @Override - public String info() { - String info = desc(); - - if (reinforced) { - info += "\n" + Messages.get(Item.class, "reinforced"); - } - info += "\n\n" + Messages.get(this, "damage",MIN,MAX); - info += "\n\n" + Messages.get(this, "charge",charge,8); - - return info; - } - - - @Override - public String status() { - if (levelKnown) { - //return charge + "/" + "8"; - return charge + "/8"; - } else { - return null; - } - } - - private int targetPos; - - public TaurcenBowArrow Arrow(){ - return new TaurcenBowArrow(); - } - - public class TaurcenBowArrow extends MissileWeapon { - - { - image = ItemSpriteSheet.POSION_DART; - enchantment = TaurcenBow.this.enchantment; - } - - - - public int damageRoll(Hero owner) { - return TaurcenBow.this.damageRoll(owner); - } - - @Override - protected void onThrow( int cell ) { - Char enemy = Actor.findChar( cell ); - if (enemy == null || enemy == curUser) { - parent = null; - Splash.at( cell, 0xCC99FFFF, 1 ); - } else { - if (!curUser.shoot( enemy, this )) { - Splash.at(cell, 0xCC99FFFF, 1); - } - } - } - - @Override - public void proc(Char attacker, Char defender, int damage) { - int DMG = damage; - if (TaurcenBow.charge > 7 ) { - if (arrow == Arrow.NONE) { - if (defender.isAlive()) Buff.affect(defender, ArmorBreak.class,5f).level(40); - defender.damage(DMG,this); - TaurcenBow.charge = 0; - } - if (arrow == Arrow.FIRE) { - if (defender.isAlive())Buff.affect(defender, Burning.class).reignite(defender); - defender.damage(DMG/2,this); - TaurcenBow.charge = 0; - } - if (arrow == Arrow.ICE) { - defender.damage(DMG/2,this); - if (defender.isAlive()) { - Buff.prolong(defender, Wet.class, 5f); - Buff.prolong(defender, Slow.class, 5f); - } - TaurcenBow.charge = 0; - } - if (arrow == Arrow.POSION) { - defender.damage(DMG/4,this); - if (defender.isAlive())Buff.affect(defender, Ooze.class); - TaurcenBow.charge = 0; - } - if (arrow == Arrow.ELE) { - if (defender.isAlive())Buff.affect(defender, Shocked.class,3f); - Buff.affect(attacker, AttackUp.class,10f).level(30); - defender.damage(DMG/3,this); - TaurcenBow.charge = 0; - } - - } - - if (enchantment != null) { - enchantment.proc(TaurcenBow.this, attacker, defender, damage); - } - TaurcenBow.charge++; - super.proc(attacker, defender, damage); - } - - @Override - public void cast(final Hero user, final int dst) { - final int cell = throwPos( user, dst ); - TaurcenBow.this.targetPos = cell; - super.cast(user, dst); - } - } - - private CellSelector.Listener shooter = new CellSelector.Listener() { - @Override - public void onSelect( Integer target ) { - if (target != null) { - Arrow().cast(curUser, target); - } - } - @Override - public String prompt() { - return Messages.get(ToyGun.class, "prompt"); - } - }; -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/items/weapon/missiles/Wave.java b/java/com/hmdzl/spspd/change/items/weapon/missiles/Wave.java deleted file mode 100644 index d29e6a2e..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/missiles/Wave.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.weapon.missiles; - -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Amok; -import com.hmdzl.spspd.change.actors.buffs.Blindness; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.watabou.utils.Random; - -public class Wave extends MissileWeapon { - - { - //name = "wave"; - image = ItemSpriteSheet.WAVE; - - STR = 10; - MIN = 1; - MAX = 3; - - // Finding them in bones would be semi-frequent and - // disappointing. - } - - public Wave() { - this(1); - } - - public Wave(int number) { - super(); - quantity = number; - } - - @Override - public void proc(Char attacker, Char defender, int damage) { - super.proc(attacker, defender, damage); - Buff.affect(defender, Amok.class,10f); - Buff.affect(defender, Blindness.class,2f); - } - - @Override - public Item random() { - quantity = Random.Int(2, 7); - return this; - } - - @Override - public int price() { - return quantity * 10; - } -} diff --git a/java/com/hmdzl/spspd/change/items/weapon/missiles/buildblock/BookBlock.java b/java/com/hmdzl/spspd/change/items/weapon/missiles/buildblock/BookBlock.java deleted file mode 100644 index 2d478d40..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/missiles/buildblock/BookBlock.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.weapon.missiles.buildblock; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.Blob; -import com.hmdzl.spspd.change.actors.blobs.Fire; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Burning; -import com.hmdzl.spspd.change.actors.buffs.Tar; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.weapon.missiles.MissileWeapon; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.Terrain; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.watabou.utils.Random; - -public class BookBlock extends MissileWeapon { - - { - //name = "BookBlock"; - image = ItemSpriteSheet.BOOK_BLOCK; - - STR = 10; - - MIN = 1; - MAX = 1; - } - - public BookBlock() { - this(1); - } - - public BookBlock(int number) { - super(); - quantity = number; - } - - @Override - protected void onThrow(int cell) { - Char enemy = Actor.findChar(cell); - if ((enemy == null || enemy == curUser) && !(Dungeon.level.map[cell] == Terrain.WELL || Dungeon.level.map[cell] == Terrain.ENTRANCE || Dungeon.level.map[cell] == Terrain.EXIT )){ - Level.set(cell, Terrain.BOOKSHELF); - GameScene.updateMap(cell); - } - else - super.onThrow(cell); - } - - @Override - public Item random() { - quantity = Random.Int(1, 2); - return this; - } - - @Override - public int price() { - return 0; - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/items/weapon/missiles/buildblock/DoorBlock.java b/java/com/hmdzl/spspd/change/items/weapon/missiles/buildblock/DoorBlock.java deleted file mode 100644 index bda56260..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/missiles/buildblock/DoorBlock.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.weapon.missiles.buildblock; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.Blob; -import com.hmdzl.spspd.change.actors.blobs.Fire; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Burning; -import com.hmdzl.spspd.change.actors.buffs.Tar; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.weapon.missiles.MissileWeapon; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.Terrain; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.watabou.utils.Random; - -public class DoorBlock extends MissileWeapon { - - { - //name = "DoorBlock"; - image = ItemSpriteSheet.DOOR_BLOCK; - - STR = 10; - - MIN = 1; - MAX = 1; - } - - public DoorBlock() { - this(1); - } - - public DoorBlock(int number) { - super(); - quantity = number; - } - - @Override - protected void onThrow(int cell) { - Char enemy = Actor.findChar(cell); - if ((enemy == null || enemy == curUser) && !(Dungeon.level.map[cell] == Terrain.WELL || Dungeon.level.map[cell] == Terrain.ENTRANCE || Dungeon.level.map[cell] == Terrain.EXIT )){ - Level.set(cell, Terrain.DOOR); - GameScene.updateMap(cell); - } - else - super.onThrow(cell); - } - - @Override - public Item random() { - quantity = Random.Int(1, 2); - return this; - } - - @Override - public int price() { - return 0; - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/items/weapon/missiles/buildblock/StoneBlock.java b/java/com/hmdzl/spspd/change/items/weapon/missiles/buildblock/StoneBlock.java deleted file mode 100644 index 4dcaf411..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/missiles/buildblock/StoneBlock.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.weapon.missiles.buildblock; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.Blob; -import com.hmdzl.spspd.change.actors.blobs.Fire; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Burning; -import com.hmdzl.spspd.change.actors.buffs.Tar; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.weapon.missiles.MissileWeapon; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.Terrain; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.watabou.utils.Random; - -public class StoneBlock extends MissileWeapon { - - { - //name = "StoneBlock"; - image = ItemSpriteSheet.STONE_BLOCK; - - STR = 10; - - MIN = 1; - MAX = 1; - } - - public StoneBlock() { - this(1); - } - - public StoneBlock(int number) { - super(); - quantity = number; - } - - @Override - protected void onThrow(int cell) { - Char enemy = Actor.findChar(cell); - if ((enemy == null || enemy == curUser) && !(Dungeon.level.map[cell] == Terrain.WELL || Dungeon.level.map[cell] == Terrain.ENTRANCE || Dungeon.level.map[cell] == Terrain.EXIT )){ - Level.set(cell, Terrain.STATUE); - GameScene.updateMap(cell); - } - else - super.onThrow(cell); - } - - @Override - public Item random() { - quantity = Random.Int(1, 2); - return this; - } - - @Override - public int price() { - return 0; - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/items/weapon/missiles/buildblock/WallBlock.java b/java/com/hmdzl/spspd/change/items/weapon/missiles/buildblock/WallBlock.java deleted file mode 100644 index f76f7e1a..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/missiles/buildblock/WallBlock.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.weapon.missiles.buildblock; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.Blob; -import com.hmdzl.spspd.change.actors.blobs.Fire; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Burning; -import com.hmdzl.spspd.change.actors.buffs.Tar; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.weapon.missiles.MissileWeapon; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.Terrain; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.watabou.utils.Random; - -public class WallBlock extends MissileWeapon { - - { - //name = "WallBlock"; - image = ItemSpriteSheet.WALL_BLOCK; - - STR = 10; - - MIN = 1; - MAX = 1; - } - - public WallBlock() { - this(1); - } - - public WallBlock(int number) { - super(); - quantity = number; - } - - @Override - protected void onThrow(int cell) { - Char enemy = Actor.findChar(cell); - if ((enemy == null || enemy == curUser) && !(Dungeon.level.map[cell] == Terrain.WELL || Dungeon.level.map[cell] == Terrain.ENTRANCE || Dungeon.level.map[cell] == Terrain.EXIT )){ - Level.set(cell, Terrain.WALL); - GameScene.updateMap(cell); - } - else - super.onThrow(cell); - } - - @Override - public Item random() { - quantity = Random.Int(1, 2); - return this; - } - - @Override - public int price() { - return 0; - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/items/weapon/missiles/buildblock/WoodenBlock.java b/java/com/hmdzl/spspd/change/items/weapon/missiles/buildblock/WoodenBlock.java deleted file mode 100644 index 14f47187..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/missiles/buildblock/WoodenBlock.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.items.weapon.missiles.buildblock; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.Blob; -import com.hmdzl.spspd.change.actors.blobs.Fire; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Burning; -import com.hmdzl.spspd.change.actors.buffs.Tar; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.weapon.missiles.MissileWeapon; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.Terrain; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.watabou.utils.Random; - -public class WoodenBlock extends MissileWeapon { - - { - //name = "WoodenBlock"; - image = ItemSpriteSheet.WOODEN_BLOCK; - - STR = 10; - - MIN = 1; - MAX = 1; - } - - public WoodenBlock() { - this(1); - } - - public WoodenBlock(int number) { - super(); - quantity = number; - } - - @Override - protected void onThrow(int cell) { - Char enemy = Actor.findChar(cell); - if ((enemy == null || enemy == curUser) && !(Dungeon.level.map[cell] == Terrain.WELL || Dungeon.level.map[cell] == Terrain.ENTRANCE || Dungeon.level.map[cell] == Terrain.EXIT )){ - Level.set(cell, Terrain.BARRICADE); - GameScene.updateMap(cell); - } - else - super.onThrow(cell); - } - - @Override - public Item random() { - quantity = Random.Int(1, 2); - return this; - } - - @Override - public int price() { - return 0; - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/items/weapon/spammo/BattleAmmo.java b/java/com/hmdzl/spspd/change/items/weapon/spammo/BattleAmmo.java deleted file mode 100644 index fb113d9a..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/spammo/BattleAmmo.java +++ /dev/null @@ -1,62 +0,0 @@ -package com.hmdzl.spspd.change.items.weapon.spammo; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.ArmorBreak; -import com.hmdzl.spspd.change.actors.buffs.AttackUp; -import com.hmdzl.spspd.change.actors.buffs.Blindness; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.DefenceUp; -import com.hmdzl.spspd.change.actors.buffs.Slow; -import com.hmdzl.spspd.change.actors.buffs.Vertigo; -import com.hmdzl.spspd.change.actors.mobs.NormalCell; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.weapon.guns.GunA; -import com.hmdzl.spspd.change.items.weapon.guns.GunB; -import com.hmdzl.spspd.change.items.weapon.guns.GunC; -import com.hmdzl.spspd.change.items.weapon.guns.GunD; -import com.hmdzl.spspd.change.items.weapon.guns.GunE; -import com.hmdzl.spspd.change.items.weapon.guns.GunWeapon; -import com.hmdzl.spspd.change.items.weapon.missiles.Boomerang; -import com.hmdzl.spspd.change.items.weapon.missiles.ManyKnive; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ItemSprite.Glowing; -import com.hmdzl.spspd.change.items.weapon.guns.Sling; -import com.hmdzl.spspd.change.sprites.ItemSprite; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.watabou.utils.Random; - - -public class BattleAmmo extends SpAmmo { - - private static Glowing DEEPGREEN = new ItemSprite.Glowing(0x006633); - - @Override - public Glowing glowing() { - return DEEPGREEN; - } - - @Override - public void onHit(GunWeapon gunweapon, Char attacker, Char defender, int damage) { - - defender.damage((int)(0.50*damage), attacker); - Buff.prolong(attacker, AttackUp.class,5f).level(35); - Buff.prolong(attacker, DefenceUp.class,5f).level(35); - } - @Override - public void onHit(Boomerang boomerang, Char attacker, Char defender, int damage) { - - defender.damage((int)(0.50*damage), attacker); - Buff.prolong(attacker, AttackUp.class,5f).level(35); - Buff.prolong(attacker, DefenceUp.class,5f).level(35); - } - @Override - public void onHit(ManyKnive manyknive, Char attacker, Char defender, int damage) { - - defender.damage((int)(0.50*damage), attacker); - Buff.prolong(attacker, AttackUp.class,5f).level(35); - Buff.prolong(attacker, DefenceUp.class,5f).level(35); - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/items/weapon/spammo/BlindAmmo.java b/java/com/hmdzl/spspd/change/items/weapon/spammo/BlindAmmo.java deleted file mode 100644 index 08347526..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/spammo/BlindAmmo.java +++ /dev/null @@ -1,63 +0,0 @@ -package com.hmdzl.spspd.change.items.weapon.spammo; - -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Blindness; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Vertigo; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.weapon.guns.GunA; -import com.hmdzl.spspd.change.items.weapon.guns.GunB; -import com.hmdzl.spspd.change.items.weapon.guns.GunC; -import com.hmdzl.spspd.change.items.weapon.guns.GunD; -import com.hmdzl.spspd.change.items.weapon.guns.GunE; -import com.hmdzl.spspd.change.items.weapon.guns.GunWeapon; -import com.hmdzl.spspd.change.items.weapon.missiles.Boomerang; -import com.hmdzl.spspd.change.items.weapon.missiles.ManyKnive; -import com.hmdzl.spspd.change.sprites.ItemSprite.Glowing; -import com.hmdzl.spspd.change.items.weapon.guns.Sling; -import com.hmdzl.spspd.change.sprites.ItemSprite; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.watabou.utils.Random; - -public class BlindAmmo extends SpAmmo { - -private static Glowing YELLOW = new ItemSprite.Glowing( 0xFFFF44 ); - - @Override - public Glowing glowing() { - return YELLOW; - } - - @Override - public void onHit(GunWeapon gunweapon, Char attacker, Char defender, int damage) { - - if (Random.Int(5) == 3) { - Buff.prolong(defender, Blindness.class,3f); - defender.sprite.emitter().burst(Speck.factory(Speck.LIGHT), 6); - } else if (Random.Int(5) == 3) { - Buff.prolong(defender, Vertigo.class, 3f); - } else defender.damage((int)(0.15*damage), attacker); - } - - @Override - public void onHit(Boomerang boomerang, Char attacker, Char defender, int damage) { - - if (Random.Int(5) == 3) { - Buff.prolong(defender, Blindness.class,3f); - defender.sprite.emitter().burst(Speck.factory(Speck.LIGHT), 6); - } else if (Random.Int(5) == 3) { - Buff.prolong(defender, Vertigo.class, 3f); - } else defender.damage((int)(0.15*damage), attacker); - } - @Override - public void onHit(ManyKnive manyknive, Char attacker, Char defender, int damage) { - - if (Random.Int(5) == 3) { - Buff.prolong(defender, Blindness.class,3f); - defender.sprite.emitter().burst(Speck.factory(Speck.LIGHT), 6); - } else if (Random.Int(5) == 3) { - Buff.prolong(defender, Vertigo.class, 3f); - } else defender.damage((int)(0.15*damage), attacker); - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/items/weapon/spammo/DewAmmo.java b/java/com/hmdzl/spspd/change/items/weapon/spammo/DewAmmo.java deleted file mode 100644 index 0e2cd72e..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/spammo/DewAmmo.java +++ /dev/null @@ -1,59 +0,0 @@ -package com.hmdzl.spspd.change.items.weapon.spammo; - -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.weapon.guns.GunA; -import com.hmdzl.spspd.change.items.weapon.guns.GunB; -import com.hmdzl.spspd.change.items.weapon.guns.GunC; -import com.hmdzl.spspd.change.items.weapon.guns.GunD; -import com.hmdzl.spspd.change.items.weapon.guns.GunE; -import com.hmdzl.spspd.change.items.weapon.guns.GunWeapon; -import com.hmdzl.spspd.change.items.weapon.missiles.Boomerang; -import com.hmdzl.spspd.change.items.weapon.missiles.ManyKnive; -import com.hmdzl.spspd.change.sprites.ItemSprite.Glowing; -import com.hmdzl.spspd.change.items.weapon.guns.Sling; -import com.hmdzl.spspd.change.sprites.ItemSprite; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.watabou.utils.Random; - -public class DewAmmo extends SpAmmo { - - //private static final Glowing BLACK = new Glowing(0x00000); - - //@Override - //public Glowing glowing() { - //return BLACK; - //} - - @Override - public void onHit(GunWeapon gunweapon, Char attacker, Char defender, int damage) { - defender.damage(Random.Int((int)(0.25*damage)), attacker); - defender.damage(Random.Int((int)(0.25*damage)), attacker); - defender.damage(Random.Int((int)(0.25*damage)), attacker); - defender.damage(Random.Int((int)(0.25*damage)), attacker); - defender.damage(Random.Int((int)(0.25*damage)), attacker); - defender.damage(Random.Int((int)(0.25*damage)), attacker); - - } - - @Override - public void onHit(Boomerang boomerang, Char attacker, Char defender, int damage) { - defender.damage(Random.Int((int)(0.25*damage)), attacker); - defender.damage(Random.Int((int)(0.25*damage)), attacker); - defender.damage(Random.Int((int)(0.25*damage)), attacker); - defender.damage(Random.Int((int)(0.25*damage)), attacker); - defender.damage(Random.Int((int)(0.25*damage)), attacker); - defender.damage(Random.Int((int)(0.25*damage)), attacker); - - } - @Override - public void onHit(ManyKnive manyknive, Char attacker, Char defender, int damage) { - defender.damage(Random.Int((int)(0.25*damage)), attacker); - defender.damage(Random.Int((int)(0.25*damage)), attacker); - defender.damage(Random.Int((int)(0.25*damage)), attacker); - defender.damage(Random.Int((int)(0.25*damage)), attacker); - defender.damage(Random.Int((int)(0.25*damage)), attacker); - defender.damage(Random.Int((int)(0.25*damage)), attacker); - - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/items/weapon/spammo/DreamAmmo.java b/java/com/hmdzl/spspd/change/items/weapon/spammo/DreamAmmo.java deleted file mode 100644 index 1082820e..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/spammo/DreamAmmo.java +++ /dev/null @@ -1,49 +0,0 @@ -package com.hmdzl.spspd.change.items.weapon.spammo; - -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.ArmorBreak; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Cripple; -import com.hmdzl.spspd.change.actors.buffs.Slow; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.weapon.guns.GunA; -import com.hmdzl.spspd.change.items.weapon.guns.GunB; -import com.hmdzl.spspd.change.items.weapon.guns.GunC; -import com.hmdzl.spspd.change.items.weapon.guns.GunD; -import com.hmdzl.spspd.change.items.weapon.guns.GunE; -import com.hmdzl.spspd.change.items.weapon.guns.GunWeapon; -import com.hmdzl.spspd.change.items.weapon.missiles.Boomerang; -import com.hmdzl.spspd.change.items.weapon.missiles.ManyKnive; -import com.hmdzl.spspd.change.sprites.ItemSprite.Glowing; -import com.hmdzl.spspd.change.items.weapon.guns.Sling; -import com.hmdzl.spspd.change.sprites.ItemSprite; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; - -public class DreamAmmo extends SpAmmo { - - private static Glowing GREEN = new ItemSprite.Glowing(0x22CC44); - - @Override - public Glowing glowing() { - return GREEN; - } - - @Override - public void onHit(GunWeapon gunweapon, Char attacker, Char defender, int damage) { - defender.damage((int)(0.20*damage), attacker); - Buff.prolong(defender, ArmorBreak.class,6f).level(25); - Buff.prolong(defender, Slow.class,3f); - } - @Override - public void onHit(Boomerang boomerang, Char attacker, Char defender, int damage) { - defender.damage((int)(0.20*damage), attacker); - Buff.prolong(defender, ArmorBreak.class,6f).level(25); - Buff.prolong(defender, Slow.class,3f); - } - @Override - public void onHit(ManyKnive manyknive, Char attacker, Char defender, int damage) { - defender.damage((int)(0.20*damage), attacker); - Buff.prolong(defender, ArmorBreak.class,6f).level(25); - Buff.prolong(defender, Slow.class,3f); - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/items/weapon/spammo/EmptyAmmo.java b/java/com/hmdzl/spspd/change/items/weapon/spammo/EmptyAmmo.java deleted file mode 100644 index 79bb176f..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/spammo/EmptyAmmo.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.hmdzl.spspd.change.items.weapon.spammo; - -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Blindness; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Vertigo; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.weapon.guns.GunA; -import com.hmdzl.spspd.change.items.weapon.guns.GunB; -import com.hmdzl.spspd.change.items.weapon.guns.GunC; -import com.hmdzl.spspd.change.items.weapon.guns.GunD; -import com.hmdzl.spspd.change.items.weapon.guns.GunE; -import com.hmdzl.spspd.change.items.weapon.guns.GunWeapon; -import com.hmdzl.spspd.change.items.weapon.missiles.Boomerang; -import com.hmdzl.spspd.change.items.weapon.missiles.ManyKnive; -import com.hmdzl.spspd.change.sprites.ItemSprite.Glowing; -import com.hmdzl.spspd.change.items.weapon.guns.Sling; -import com.hmdzl.spspd.change.sprites.ItemSprite; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.watabou.utils.Random; - -public class EmptyAmmo extends SpAmmo { - - //private static final Glowing BLACK = new Glowing(0x00000); - - //@Override - //public Glowing glowing() { - //return BLACK; - //} - - @Override - public void onHit(GunWeapon gunweapon, Char attacker, Char defender, int damage) { - - if(defender.properties().contains(Char.Property.BOSS)){ - defender.damage(Math.min(defender.HT/20,3000),this); - } - } - @Override - public void onHit(Boomerang boomerang, Char attacker, Char defender, int damage) { - - if(defender.properties().contains(Char.Property.BOSS)){ - defender.damage(Math.min(defender.HT/20,3000),this); - } - } - @Override - public void onHit(ManyKnive manyknive, Char attacker, Char defender, int damage) { - - if(defender.properties().contains(Char.Property.BOSS)){ - defender.damage(Math.min(defender.HT/20,3000),this); - } - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/items/weapon/spammo/EvolveAmmo.java b/java/com/hmdzl/spspd/change/items/weapon/spammo/EvolveAmmo.java deleted file mode 100644 index 85a43aa8..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/spammo/EvolveAmmo.java +++ /dev/null @@ -1,94 +0,0 @@ -package com.hmdzl.spspd.change.items.weapon.spammo; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Blindness; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Vertigo; -import com.hmdzl.spspd.change.actors.mobs.NormalCell; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.weapon.guns.GunA; -import com.hmdzl.spspd.change.items.weapon.guns.GunB; -import com.hmdzl.spspd.change.items.weapon.guns.GunC; -import com.hmdzl.spspd.change.items.weapon.guns.GunD; -import com.hmdzl.spspd.change.items.weapon.guns.GunE; -import com.hmdzl.spspd.change.items.weapon.guns.GunWeapon; -import com.hmdzl.spspd.change.items.weapon.missiles.Boomerang; -import com.hmdzl.spspd.change.items.weapon.missiles.ManyKnive; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ItemSprite.Glowing; -import com.hmdzl.spspd.change.items.weapon.guns.Sling; -import com.hmdzl.spspd.change.sprites.ItemSprite; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.watabou.utils.Random; - -public class EvolveAmmo extends SpAmmo { - - private static Glowing DEEPGREEN = new ItemSprite.Glowing(0x006633); - - @Override - public Glowing glowing() { - return DEEPGREEN; - } - - @Override - public void onHit(GunWeapon gunweapon, Char attacker, Char defender, int damage) { - - if (Random.Int(10) == 3) { - if (defender != null && defender != attacker - && !defender.properties().contains(Char.Property.BOSS) - && !defender.properties().contains(Char.Property.MINIBOSS)) { - NormalCell cell = new NormalCell(); - cell.HT = defender.HP; - cell.HP = cell.HT; - cell.pos = defender.pos; - defender.destroy(); - defender.sprite.killAndErase(); - Dungeon.level.mobs.remove(defender); - GameScene.add(cell); - CellEmitter.get(cell.pos).burst(Speck.factory(Speck.WOOL), 4); - } - } else defender.damage((int)(0.10*damage), attacker); - } - - @Override - public void onHit(Boomerang boomerang, Char attacker, Char defender, int damage) { - - if (Random.Int(10) == 3) { - if (defender != null && defender != attacker - && !defender.properties().contains(Char.Property.BOSS) - && !defender.properties().contains(Char.Property.MINIBOSS)) { - NormalCell cell = new NormalCell(); - cell.HT = defender.HP; - cell.HP = cell.HT; - cell.pos = defender.pos; - defender.destroy(); - defender.sprite.killAndErase(); - Dungeon.level.mobs.remove(defender); - GameScene.add(cell); - CellEmitter.get(cell.pos).burst(Speck.factory(Speck.WOOL), 4); - } - } else defender.damage((int)(0.10*damage), attacker); - } - @Override - public void onHit(ManyKnive manyknive, Char attacker, Char defender, int damage) { - - if (Random.Int(10) == 3) { - if (defender != null && defender != attacker - && !defender.properties().contains(Char.Property.BOSS) - && !defender.properties().contains(Char.Property.MINIBOSS)) { - NormalCell cell = new NormalCell(); - cell.HT = defender.HP; - cell.HP = cell.HT; - cell.pos = defender.pos; - defender.destroy(); - defender.sprite.killAndErase(); - Dungeon.level.mobs.remove(defender); - GameScene.add(cell); - CellEmitter.get(cell.pos).burst(Speck.factory(Speck.WOOL), 4); - } - } else defender.damage((int)(0.10*damage), attacker); - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/items/weapon/spammo/FireAmmo.java b/java/com/hmdzl/spspd/change/items/weapon/spammo/FireAmmo.java deleted file mode 100644 index 45f7ea86..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/spammo/FireAmmo.java +++ /dev/null @@ -1,60 +0,0 @@ -package com.hmdzl.spspd.change.items.weapon.spammo; - -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Burning; -import com.hmdzl.spspd.change.effects.particles.FlameParticle; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.weapon.guns.GunA; -import com.hmdzl.spspd.change.items.weapon.guns.GunB; -import com.hmdzl.spspd.change.items.weapon.guns.GunC; -import com.hmdzl.spspd.change.items.weapon.guns.GunD; -import com.hmdzl.spspd.change.items.weapon.guns.GunE; -import com.hmdzl.spspd.change.items.weapon.guns.GunWeapon; -import com.hmdzl.spspd.change.items.weapon.missiles.Boomerang; -import com.hmdzl.spspd.change.items.weapon.missiles.ManyKnive; -import com.hmdzl.spspd.change.sprites.ItemSprite.Glowing; -import com.hmdzl.spspd.change.items.weapon.guns.Sling; -import com.hmdzl.spspd.change.sprites.ItemSprite; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.watabou.utils.Random; - -public class FireAmmo extends SpAmmo { - - private static Glowing ORANGE = new ItemSprite.Glowing( 0xFF4400 ); - - @Override - public Glowing glowing() { - return ORANGE; - } - - @Override - public void onHit(GunWeapon gunweapon, Char attacker, Char defender, int damage) { - - defender.sprite.emitter().burst(FlameParticle.FACTORY, 5); - if (Random.Int(5) == 4 ) { - Buff.affect(defender, Burning.class).reignite( defender ); - } else defender.damage((int)(0.25*damage), attacker); - - } - - @Override - public void onHit(Boomerang boomerang, Char attacker, Char defender, int damage) { - - defender.sprite.emitter().burst(FlameParticle.FACTORY, 5); - if (Random.Int(5) == 4 ) { - Buff.affect(defender, Burning.class).reignite( defender ); - } else defender.damage((int)(0.25*damage), attacker); - - } - @Override - public void onHit(ManyKnive manyknive, Char attacker, Char defender, int damage) { - - defender.sprite.emitter().burst(FlameParticle.FACTORY, 5); - if (Random.Int(5) == 4 ) { - Buff.affect(defender, Burning.class).reignite( defender ); - } else defender.damage((int)(0.25*damage), attacker); - - } - -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/items/weapon/spammo/GoldAmmo.java b/java/com/hmdzl/spspd/change/items/weapon/spammo/GoldAmmo.java deleted file mode 100644 index b92833c0..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/spammo/GoldAmmo.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.hmdzl.spspd.change.items.weapon.spammo; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Blindness; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Vertigo; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.weapon.guns.GunA; -import com.hmdzl.spspd.change.items.weapon.guns.GunB; -import com.hmdzl.spspd.change.items.weapon.guns.GunC; -import com.hmdzl.spspd.change.items.weapon.guns.GunD; -import com.hmdzl.spspd.change.items.weapon.guns.GunE; -import com.hmdzl.spspd.change.items.weapon.guns.GunWeapon; -import com.hmdzl.spspd.change.items.weapon.missiles.Boomerang; -import com.hmdzl.spspd.change.items.weapon.missiles.ManyKnive; -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.hmdzl.spspd.change.sprites.ItemSprite.Glowing; -import com.hmdzl.spspd.change.items.weapon.guns.Sling; -import com.hmdzl.spspd.change.sprites.ItemSprite; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.watabou.utils.Random; - -public class GoldAmmo extends SpAmmo { - -private static Glowing YELLOW = new ItemSprite.Glowing( 0xFFFF44 ); - - @Override - public Glowing glowing() { - return YELLOW; - } - - @Override - public void onHit(GunWeapon gunweapon, Char attacker, Char defender, int damage) { - defender.damage((int)(Dungeon.gold*0.01*Random.Float(0.25f,2.0f)), attacker); - - Dungeon.gold -= (int)(Dungeon.gold*0.01); - } - - @Override - public void onHit(Boomerang boomerang, Char attacker, Char defender, int damage) { - defender.damage((int)(Dungeon.gold*0.01*Random.Float(0.25f,2.0f)), attacker); - - Dungeon.gold -= (int)(Dungeon.gold*0.01); - } - @Override - public void onHit(ManyKnive manyknive, Char attacker, Char defender, int damage) { - defender.damage((int)(Dungeon.gold*0.01*Random.Float(0.25f,2.0f)), attacker); - - Dungeon.gold -= (int)(Dungeon.gold*0.01); - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/items/weapon/spammo/HeavyAmmo.java b/java/com/hmdzl/spspd/change/items/weapon/spammo/HeavyAmmo.java deleted file mode 100644 index 9453533f..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/spammo/HeavyAmmo.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.hmdzl.spspd.change.items.weapon.spammo; - -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.weapon.guns.GunA; -import com.hmdzl.spspd.change.items.weapon.guns.GunB; -import com.hmdzl.spspd.change.items.weapon.guns.GunC; -import com.hmdzl.spspd.change.items.weapon.guns.GunD; -import com.hmdzl.spspd.change.items.weapon.guns.GunE; -import com.hmdzl.spspd.change.items.weapon.guns.GunWeapon; -import com.hmdzl.spspd.change.items.weapon.missiles.Boomerang; -import com.hmdzl.spspd.change.items.weapon.missiles.ManyKnive; -import com.hmdzl.spspd.change.sprites.ItemSprite.Glowing; -import com.hmdzl.spspd.change.items.weapon.guns.Sling; -import com.hmdzl.spspd.change.sprites.ItemSprite; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; - -public class HeavyAmmo extends SpAmmo { - - private static final Glowing BLACK = new Glowing(0x00000); - - @Override - public Glowing glowing() { - return BLACK; - } - - @Override - public void onHit(GunWeapon gunweapon, Char attacker, Char defender, int damage) { - defender.damage((int)(0.75*damage), attacker); - } - @Override - public void onHit(Boomerang boomerang, Char attacker, Char defender, int damage) { - defender.damage((int)(0.75*damage), attacker); - } - @Override - public void onHit(ManyKnive manyknive, Char attacker, Char defender, int damage) { - defender.damage((int)(0.75*damage), attacker); - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/items/weapon/spammo/IceAmmo.java b/java/com/hmdzl/spspd/change/items/weapon/spammo/IceAmmo.java deleted file mode 100644 index b938248a..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/spammo/IceAmmo.java +++ /dev/null @@ -1,74 +0,0 @@ -package com.hmdzl.spspd.change.items.weapon.spammo; - -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Chill; -import com.hmdzl.spspd.change.actors.buffs.Cold; -import com.hmdzl.spspd.change.actors.buffs.Frost; -import com.hmdzl.spspd.change.actors.buffs.Wet; -import com.hmdzl.spspd.change.effects.particles.SnowParticle; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.weapon.guns.GunA; -import com.hmdzl.spspd.change.items.weapon.guns.GunB; -import com.hmdzl.spspd.change.items.weapon.guns.GunC; -import com.hmdzl.spspd.change.items.weapon.guns.GunD; -import com.hmdzl.spspd.change.items.weapon.guns.GunE; -import com.hmdzl.spspd.change.items.weapon.guns.GunWeapon; -import com.hmdzl.spspd.change.items.weapon.missiles.Boomerang; -import com.hmdzl.spspd.change.items.weapon.missiles.ManyKnive; -import com.hmdzl.spspd.change.sprites.ItemSprite.Glowing; -import com.hmdzl.spspd.change.items.weapon.guns.Sling; -import com.hmdzl.spspd.change.sprites.ItemSprite; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.watabou.utils.Random; - -public class IceAmmo extends SpAmmo { - - private static Glowing BLUE = new ItemSprite.Glowing(0x0000FF); - - @Override - public Glowing glowing() { - return BLUE; - } - - @Override - public void onHit(GunWeapon gunweapon, Char attacker, Char defender, int damage) { - - defender.damage((int)(0.25*damage), attacker); - - if (Random.Int(4) == 3) { - Buff.affect(defender, Frost.class, Frost.duration(defender)*Random.Float(2f, 4f)); - defender.sprite.emitter().burst(SnowParticle.FACTORY, 5); - } else { - Buff.prolong(defender, Wet.class, 2f); - Buff.prolong(defender, Cold.class,2f); - } - } - - @Override - public void onHit(Boomerang boomerang, Char attacker, Char defender, int damage) { - - defender.damage((int)(0.25*damage), attacker); - - if (Random.Int(4) == 3) { - Buff.affect(defender, Frost.class, Frost.duration(defender)*Random.Float(2f, 4f)); - defender.sprite.emitter().burst(SnowParticle.FACTORY, 5); - } else { - Buff.prolong(defender, Wet.class, 2f); - Buff.prolong(defender, Cold.class,2f); - } - } - @Override - public void onHit(ManyKnive manyknive, Char attacker, Char defender, int damage) { - - defender.damage((int)(0.25*damage), attacker); - - if (Random.Int(4) == 3) { - Buff.affect(defender, Frost.class, Frost.duration(defender)*Random.Float(2f, 4f)); - defender.sprite.emitter().burst(SnowParticle.FACTORY, 5); - } else { - Buff.prolong(defender, Wet.class, 2f); - Buff.prolong(defender, Cold.class,2f); - } - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/items/weapon/spammo/MossAmmo.java b/java/com/hmdzl/spspd/change/items/weapon/spammo/MossAmmo.java deleted file mode 100644 index 2a5b380b..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/spammo/MossAmmo.java +++ /dev/null @@ -1,63 +0,0 @@ -package com.hmdzl.spspd.change.items.weapon.spammo; - -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Ooze; -import com.hmdzl.spspd.change.actors.buffs.Poison; -import com.hmdzl.spspd.change.effects.particles.EarthParticle; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.weapon.guns.GunA; -import com.hmdzl.spspd.change.items.weapon.guns.GunB; -import com.hmdzl.spspd.change.items.weapon.guns.GunC; -import com.hmdzl.spspd.change.items.weapon.guns.GunD; -import com.hmdzl.spspd.change.items.weapon.guns.GunE; -import com.hmdzl.spspd.change.items.weapon.guns.GunWeapon; -import com.hmdzl.spspd.change.items.weapon.missiles.Boomerang; -import com.hmdzl.spspd.change.items.weapon.missiles.ManyKnive; -import com.hmdzl.spspd.change.sprites.ItemSprite.Glowing; -import com.hmdzl.spspd.change.items.weapon.guns.Sling; -import com.hmdzl.spspd.change.sprites.ItemSprite; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.watabou.utils.Random; - -public class MossAmmo extends SpAmmo { - - private static Glowing PURPLE = new ItemSprite.Glowing(0x8844CC); - - @Override - public Glowing glowing() { - return PURPLE; - } - - @Override - public void onHit(GunWeapon gunweapon, Char attacker, Char defender, int damage) { - defender.damage((int)(0.10*damage), attacker); - if (Random.Int(4) == 3) { - Buff.affect(defender, Ooze.class); - defender.sprite.emitter().burst(EarthParticle.FACTORY, 5); - } else { - Buff.affect(defender, Poison.class).set(Random.Int(4, 5)); - } - } - - @Override - public void onHit(Boomerang boomerang, Char attacker, Char defender, int damage) { - defender.damage((int)(0.10*damage), attacker); - if (Random.Int(4) == 3) { - Buff.affect(defender, Ooze.class); - defender.sprite.emitter().burst(EarthParticle.FACTORY, 5); - } else { - Buff.affect(defender, Poison.class).set(Random.Int(4, 5)); - } - } - @Override - public void onHit(ManyKnive manyknive, Char attacker, Char defender, int damage) { - defender.damage((int)(0.10*damage), attacker); - if (Random.Int(4) == 3) { - Buff.affect(defender, Ooze.class); - defender.sprite.emitter().burst(EarthParticle.FACTORY, 5); - } else { - Buff.affect(defender, Poison.class).set(Random.Int(4, 5)); - } - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/items/weapon/spammo/RotAmmo.java b/java/com/hmdzl/spspd/change/items/weapon/spammo/RotAmmo.java deleted file mode 100644 index 83686a11..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/spammo/RotAmmo.java +++ /dev/null @@ -1,63 +0,0 @@ -package com.hmdzl.spspd.change.items.weapon.spammo; - -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Blindness; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Ooze; -import com.hmdzl.spspd.change.actors.buffs.Roots; -import com.hmdzl.spspd.change.actors.buffs.Vertigo; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.weapon.guns.GunA; -import com.hmdzl.spspd.change.items.weapon.guns.GunB; -import com.hmdzl.spspd.change.items.weapon.guns.GunC; -import com.hmdzl.spspd.change.items.weapon.guns.GunD; -import com.hmdzl.spspd.change.items.weapon.guns.GunE; -import com.hmdzl.spspd.change.items.weapon.guns.GunWeapon; -import com.hmdzl.spspd.change.items.weapon.missiles.Boomerang; -import com.hmdzl.spspd.change.items.weapon.missiles.ManyKnive; -import com.hmdzl.spspd.change.sprites.ItemSprite.Glowing; -import com.hmdzl.spspd.change.items.weapon.guns.Sling; -import com.hmdzl.spspd.change.sprites.ItemSprite; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.watabou.utils.Random; - -public class RotAmmo extends SpAmmo { - - private static Glowing RED = new ItemSprite.Glowing(0xCC0000); - - @Override - public Glowing glowing() { - return RED; - } - - @Override - public void onHit(GunWeapon gunweapon, Char attacker, Char defender, int damage) { - - if (Random.Int(7) == 3) { - Buff.prolong(defender, Roots.class,3f); - } else - Buff.affect(defender, Ooze.class); - defender.damage((int)(0.5*damage), attacker); - } - - @Override - public void onHit(Boomerang boomerang, Char attacker, Char defender, int damage) { - - if (Random.Int(7) == 3) { - Buff.prolong(defender, Roots.class,3f); - } else - Buff.affect(defender, Ooze.class); - defender.damage((int)(0.5*damage), attacker); - } - @Override - public void onHit(ManyKnive manyknive, Char attacker, Char defender, int damage) { - - if (Random.Int(7) == 3) { - Buff.prolong(defender, Roots.class,3f); - } else - Buff.affect(defender, Ooze.class); - defender.damage((int)(0.5*damage), attacker); - } - -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/items/weapon/spammo/SandAmmo.java b/java/com/hmdzl/spspd/change/items/weapon/spammo/SandAmmo.java deleted file mode 100644 index 032d111b..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/spammo/SandAmmo.java +++ /dev/null @@ -1,64 +0,0 @@ -package com.hmdzl.spspd.change.items.weapon.spammo; - -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.ArmorBreak; -import com.hmdzl.spspd.change.actors.buffs.AttackDown; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Dry; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.weapon.guns.GunA; -import com.hmdzl.spspd.change.items.weapon.guns.GunB; -import com.hmdzl.spspd.change.items.weapon.guns.GunC; -import com.hmdzl.spspd.change.items.weapon.guns.GunD; -import com.hmdzl.spspd.change.items.weapon.guns.GunE; -import com.hmdzl.spspd.change.items.weapon.guns.GunWeapon; -import com.hmdzl.spspd.change.items.weapon.missiles.Boomerang; -import com.hmdzl.spspd.change.items.weapon.missiles.ManyKnive; -import com.hmdzl.spspd.change.sprites.ItemSprite.Glowing; -import com.hmdzl.spspd.change.items.weapon.guns.Sling; -import com.hmdzl.spspd.change.sprites.ItemSprite; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.watabou.utils.Random; - -public class SandAmmo extends SpAmmo { - - private static Glowing GERY = new ItemSprite.Glowing(0xCCCCCC); - - @Override - public Glowing glowing() { - return GERY; - } - - - @Override - public void onHit(GunWeapon gunweapon, Char attacker, Char defender, int damage) { - if (Random.Int(5) == 3) { - Buff.affect(defender, AttackDown.class,3f).level(25); - Buff.affect(defender, ArmorBreak.class,3f).level(25); - defender.sprite.emitter().burst(Speck.factory(Speck.LIGHT), 6); - } else if (Random.Int(4) == 1) { - Buff.prolong(defender, Dry.class, 3f); - } else defender.damage((int)(0.15*damage), attacker); - } - @Override - public void onHit(Boomerang boomerang, Char attacker, Char defender, int damage) { - if (Random.Int(5) == 3) { - Buff.affect(defender, AttackDown.class,3f).level(25); - Buff.affect(defender, ArmorBreak.class,3f).level(25); - defender.sprite.emitter().burst(Speck.factory(Speck.LIGHT), 6); - } else if (Random.Int(4) == 1) { - Buff.prolong(defender, Dry.class, 3f); - } else defender.damage((int)(0.15*damage), attacker); - } - @Override - public void onHit(ManyKnive manyknive, Char attacker, Char defender, int damage) { - if (Random.Int(5) == 3) { - Buff.affect(defender, AttackDown.class,3f).level(25); - Buff.affect(defender, ArmorBreak.class,3f).level(25); - defender.sprite.emitter().burst(Speck.factory(Speck.LIGHT), 6); - } else if (Random.Int(4) == 1) { - Buff.prolong(defender, Dry.class, 3f); - } else defender.damage((int)(0.15*damage), attacker); - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/items/weapon/spammo/SpAmmo.java b/java/com/hmdzl/spspd/change/items/weapon/spammo/SpAmmo.java deleted file mode 100644 index ff6fabef..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/spammo/SpAmmo.java +++ /dev/null @@ -1,46 +0,0 @@ - -package com.hmdzl.spspd.change.items.weapon.spammo; - -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.weapon.guns.GunA; -import com.hmdzl.spspd.change.items.weapon.guns.GunB; -import com.hmdzl.spspd.change.items.weapon.guns.GunC; -import com.hmdzl.spspd.change.items.weapon.guns.GunD; -import com.hmdzl.spspd.change.items.weapon.guns.GunE; -import com.hmdzl.spspd.change.items.weapon.guns.GunWeapon; -import com.hmdzl.spspd.change.items.weapon.guns.Sling; -import com.hmdzl.spspd.change.items.weapon.missiles.Boomerang; -import com.hmdzl.spspd.change.items.weapon.missiles.ManyKnive; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; - -public abstract class SpAmmo extends Item { - - { - image = ItemSpriteSheet.SPAMMO; - - stackable=false; - } - - public abstract void onHit(GunWeapon gunweapon, Char attacker, Char defender, int damage); - - public abstract void onHit(Boomerang boomerang, Char attacker, Char defender, int damage); - - public abstract void onHit(ManyKnive manyknive, Char attacker, Char defender, int damage); - - @Override - public boolean isUpgradable() { - return false; - } - - @Override - public boolean isIdentified() { - return true; - } - - @Override - public int price() { - return 100 * quantity; - } - -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/items/weapon/spammo/StarAmmo.java b/java/com/hmdzl/spspd/change/items/weapon/spammo/StarAmmo.java deleted file mode 100644 index 8191719c..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/spammo/StarAmmo.java +++ /dev/null @@ -1,74 +0,0 @@ -package com.hmdzl.spspd.change.items.weapon.spammo; - -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.particles.ShadowParticle; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.weapon.guns.GunA; -import com.hmdzl.spspd.change.items.weapon.guns.GunB; -import com.hmdzl.spspd.change.items.weapon.guns.GunC; -import com.hmdzl.spspd.change.items.weapon.guns.GunD; -import com.hmdzl.spspd.change.items.weapon.guns.GunE; -import com.hmdzl.spspd.change.items.weapon.guns.GunWeapon; -import com.hmdzl.spspd.change.items.weapon.missiles.Boomerang; -import com.hmdzl.spspd.change.items.weapon.missiles.ManyKnive; -import com.hmdzl.spspd.change.sprites.ItemSprite.Glowing; -import com.hmdzl.spspd.change.items.weapon.guns.Sling; -import com.hmdzl.spspd.change.sprites.ItemSprite; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.watabou.utils.Random; - -public class StarAmmo extends SpAmmo { - - private static final Glowing BLACK = new Glowing(0x00000); - - @Override - public Glowing glowing() { - return BLACK; - } - - @Override - public void onHit(GunWeapon gunweapon, Char attacker, Char defender, int damage) { - - if (Random.Int(20) == 1) { - if (defender.properties().contains(Char.Property.BOSS) || defender.properties().contains(Char.Property.MINIBOSS)) { - defender.damage(Random.Int(defender.HT / 8, defender.HT / 4), this); - } else defender.damage(Random.Int(defender.HT, defender.HT * 2), this); - defender.sprite.emitter().burst(ShadowParticle.UP, 5); - if (!defender.isAlive() && attacker instanceof Hero) { - Badges.validateGrimWeapon(); - } - } else - defender.damage((int)(0.4*damage), attacker); - } - - @Override - public void onHit(Boomerang boomerang, Char attacker, Char defender, int damage) { - - if (Random.Int(20) == 1) { - if (defender.properties().contains(Char.Property.BOSS) || defender.properties().contains(Char.Property.MINIBOSS)) { - defender.damage(Random.Int(defender.HT / 8, defender.HT / 4), this); - } else defender.damage(Random.Int(defender.HT, defender.HT * 2), this); - defender.sprite.emitter().burst(ShadowParticle.UP, 5); - if (!defender.isAlive() && attacker instanceof Hero) { - Badges.validateGrimWeapon(); - } - } else - defender.damage((int)(0.4*damage), attacker); - } - @Override - public void onHit(ManyKnive manyknive, Char attacker, Char defender, int damage) { - - if (Random.Int(20) == 1) { - if (defender.properties().contains(Char.Property.BOSS) || defender.properties().contains(Char.Property.MINIBOSS)) { - defender.damage(Random.Int(defender.HT / 8, defender.HT / 4), this); - } else defender.damage(Random.Int(defender.HT, defender.HT * 2), this); - defender.sprite.emitter().burst(ShadowParticle.UP, 5); - if (!defender.isAlive() && attacker instanceof Hero) { - Badges.validateGrimWeapon(); - } - } else - defender.damage((int)(0.4*damage), attacker); - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/items/weapon/spammo/StormAmmo.java b/java/com/hmdzl/spspd/change/items/weapon/spammo/StormAmmo.java deleted file mode 100644 index 4ba3f857..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/spammo/StormAmmo.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.hmdzl.spspd.change.items.weapon.spammo; - -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Shocked; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.weapon.guns.GunA; -import com.hmdzl.spspd.change.items.weapon.guns.GunB; -import com.hmdzl.spspd.change.items.weapon.guns.GunC; -import com.hmdzl.spspd.change.items.weapon.guns.GunD; -import com.hmdzl.spspd.change.items.weapon.guns.GunE; -import com.hmdzl.spspd.change.items.weapon.guns.GunWeapon; -import com.hmdzl.spspd.change.items.weapon.missiles.Boomerang; -import com.hmdzl.spspd.change.items.weapon.missiles.ManyKnive; -import com.hmdzl.spspd.change.sprites.ItemSprite.Glowing; -import com.hmdzl.spspd.change.items.weapon.guns.Sling; -import com.hmdzl.spspd.change.sprites.ItemSprite; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.watabou.utils.Random; - -public class StormAmmo extends SpAmmo { - - private static Glowing WHITE = new ItemSprite.Glowing(0xFFFFFF); - - @Override - public Glowing glowing() { - return WHITE; - } - - @Override - public void onHit(GunWeapon gunweapon, Char attacker, Char defender, int damage) { - - if (Random.Int(6) == 3) { - Buff.prolong(defender, Shocked.class,2f); - - } else defender.damage((int)(0.40*damage), attacker); - - } - @Override - public void onHit(Boomerang boomerang, Char attacker, Char defender, int damage) { - - if (Random.Int(6) == 3) { - Buff.prolong(defender, Shocked.class,2f); - - } else defender.damage((int)(0.40*damage), attacker); - - } - @Override - public void onHit(ManyKnive manyknive, Char attacker, Char defender, int damage) { - - if (Random.Int(6) == 3) { - Buff.prolong(defender, Shocked.class,2f); - - } else defender.damage((int)(0.40*damage), attacker); - - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/items/weapon/spammo/SunAmmo.java b/java/com/hmdzl/spspd/change/items/weapon/spammo/SunAmmo.java deleted file mode 100644 index 31731389..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/spammo/SunAmmo.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.hmdzl.spspd.change.items.weapon.spammo; - -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.GrowSeed; -import com.hmdzl.spspd.change.effects.particles.EarthParticle; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.weapon.guns.GunA; -import com.hmdzl.spspd.change.items.weapon.guns.GunB; -import com.hmdzl.spspd.change.items.weapon.guns.GunC; -import com.hmdzl.spspd.change.items.weapon.guns.GunD; -import com.hmdzl.spspd.change.items.weapon.guns.GunE; -import com.hmdzl.spspd.change.items.weapon.guns.GunWeapon; -import com.hmdzl.spspd.change.items.weapon.missiles.Boomerang; -import com.hmdzl.spspd.change.items.weapon.missiles.ManyKnive; -import com.hmdzl.spspd.change.sprites.ItemSprite.Glowing; -import com.hmdzl.spspd.change.items.weapon.guns.Sling; -import com.hmdzl.spspd.change.sprites.ItemSprite; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.watabou.utils.Random; - -public class SunAmmo extends SpAmmo { - - private static Glowing PINK = new ItemSprite.Glowing(0xCCAA88); - - @Override - public Glowing glowing() { - return PINK; - } - - @Override - public void onHit(GunWeapon gunweapon, Char attacker, Char defender, int damage) { - if (Random.Int(7) == 3) { - Buff.affect(defender, GrowSeed.class).reignite(defender); - defender.sprite.emitter().burst(EarthParticle.FACTORY, 5); - } else defender.damage((int)(0.20*damage), attacker); - } - - @Override - public void onHit(Boomerang boomerang, Char attacker, Char defender, int damage) { - if (Random.Int(7) == 3) { - Buff.affect(defender, GrowSeed.class).reignite(defender); - defender.sprite.emitter().burst(EarthParticle.FACTORY, 5); - } else defender.damage((int)(0.20*damage), attacker); - } - - @Override - public void onHit(ManyKnive manyknive, Char attacker, Char defender, int damage) { - if (Random.Int(7) == 3) { - Buff.affect(defender, GrowSeed.class).reignite(defender); - defender.sprite.emitter().burst(EarthParticle.FACTORY, 5); - } else defender.damage((int)(0.20*damage), attacker); - } - -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/items/weapon/spammo/ThornAmmo.java b/java/com/hmdzl/spspd/change/items/weapon/spammo/ThornAmmo.java deleted file mode 100644 index cf206d9f..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/spammo/ThornAmmo.java +++ /dev/null @@ -1,62 +0,0 @@ -package com.hmdzl.spspd.change.items.weapon.spammo; - -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Bleeding; -import com.hmdzl.spspd.change.actors.buffs.Blindness; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Cripple; -import com.hmdzl.spspd.change.actors.buffs.Vertigo; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.weapon.guns.GunA; -import com.hmdzl.spspd.change.items.weapon.guns.GunB; -import com.hmdzl.spspd.change.items.weapon.guns.GunC; -import com.hmdzl.spspd.change.items.weapon.guns.GunD; -import com.hmdzl.spspd.change.items.weapon.guns.GunE; -import com.hmdzl.spspd.change.items.weapon.guns.GunWeapon; -import com.hmdzl.spspd.change.items.weapon.missiles.Boomerang; -import com.hmdzl.spspd.change.items.weapon.missiles.ManyKnive; -import com.hmdzl.spspd.change.sprites.ItemSprite.Glowing; -import com.hmdzl.spspd.change.items.weapon.guns.Sling; -import com.hmdzl.spspd.change.sprites.ItemSprite; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.watabou.utils.Random; - -public class ThornAmmo extends SpAmmo { - - private static Glowing BROWN = new ItemSprite.Glowing(0xCC6600); - - @Override - public Glowing glowing() { - return BROWN; - } - - @Override - public void onHit(GunWeapon gunweapon, Char attacker, Char defender, int damage) { - - if (Random.Int(5) == 3) { - Buff.affect(defender, Bleeding.class).set(Random.Int(5,damage)); - } else - Buff.prolong(defender, Cripple.class, 3f); - defender.damage((int)(0.20*damage), attacker); - } - - @Override - public void onHit(Boomerang boomerang, Char attacker, Char defender, int damage) { - - if (Random.Int(5) == 3) { - Buff.affect(defender, Bleeding.class).set(Random.Int(5,damage)); - } else - Buff.prolong(defender, Cripple.class, 3f); - defender.damage((int)(0.20*damage), attacker); - } - @Override - public void onHit(ManyKnive manyknive, Char attacker, Char defender, int damage) { - - if (Random.Int(5) == 3) { - Buff.affect(defender, Bleeding.class).set(Random.Int(5,damage)); - } else - Buff.prolong(defender, Cripple.class, 3f); - defender.damage((int)(0.20*damage), attacker); - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/items/weapon/spammo/WoodenAmmo.java b/java/com/hmdzl/spspd/change/items/weapon/spammo/WoodenAmmo.java deleted file mode 100644 index d77e8d5b..00000000 --- a/java/com/hmdzl/spspd/change/items/weapon/spammo/WoodenAmmo.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.hmdzl.spspd.change.items.weapon.spammo; - -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Paralysis; -import com.hmdzl.spspd.change.actors.buffs.Vertigo; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.weapon.guns.GunA; -import com.hmdzl.spspd.change.items.weapon.guns.GunB; -import com.hmdzl.spspd.change.items.weapon.guns.GunC; -import com.hmdzl.spspd.change.items.weapon.guns.GunD; -import com.hmdzl.spspd.change.items.weapon.guns.GunE; -import com.hmdzl.spspd.change.items.weapon.guns.GunWeapon; -import com.hmdzl.spspd.change.items.weapon.missiles.Boomerang; -import com.hmdzl.spspd.change.items.weapon.missiles.ManyKnive; -import com.hmdzl.spspd.change.sprites.ItemSprite.Glowing; -import com.hmdzl.spspd.change.items.weapon.guns.Sling; -import com.hmdzl.spspd.change.sprites.ItemSprite; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.watabou.utils.Random; - -public class WoodenAmmo extends SpAmmo { - - private static final Glowing BLACK = new Glowing(0x00000); - - @Override - public Glowing glowing() { - return BLACK; - } - - @Override - public void onHit(GunWeapon gunweapon, Char attacker, Char defender, int damage) { - Buff.prolong(defender,Vertigo.class,3f); - if (Random.Int(10) == 1){ - Buff.prolong(defender,Paralysis.class,3f); - } - } - @Override - public void onHit(Boomerang boomerang, Char attacker, Char defender, int damage) { - Buff.prolong(defender,Vertigo.class,3f); - if (Random.Int(8) == 1){ - Buff.prolong(defender,Paralysis.class,3f); - } - } - @Override - public void onHit(ManyKnive manyknive, Char attacker, Char defender, int damage) { - Buff.prolong(defender,Vertigo.class,3f); - if (Random.Int(8) == 1){ - Buff.prolong(defender,Paralysis.class,3f); - } - } - -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/levels/BattleLevel.java b/java/com/hmdzl/spspd/change/levels/BattleLevel.java deleted file mode 100644 index bde9b4b1..00000000 --- a/java/com/hmdzl/spspd/change/levels/BattleLevel.java +++ /dev/null @@ -1,236 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.Statistics; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.mobs.Bestiary; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.items.Heap; -import com.hmdzl.spspd.change.items.bombs.LightBomb; -import com.hmdzl.spspd.change.levels.painters.Painter; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.watabou.noosa.Scene; -import com.watabou.utils.Random; - -public class BattleLevel extends Level { - - { - color1 = 0x6a723d; - color2 = 0x88924c; - - viewDistance = 8; - } - - private static final int ROOM_LEFT = getWidth() / 2 - 2; - private static final int ROOM_RIGHT = getWidth() / 2 + 2; - private static final int ROOM_TOP = HEIGHT / 2 - 2; - private static final int ROOM_BOTTOM = HEIGHT / 2 + 2; - - @Override - public String tilesTex() { - return Assets.TILES_PRISON; - } - - @Override - public String waterTex() { - return Assets.WATER_PRISON; - } - - protected static final int REGROW_TIMER = 4; - protected static final int TIME_TO_RESPAWN = 30; - - @Override - protected boolean build() { - - int topMost = Integer.MAX_VALUE; - - for (int i = 0; i < 8; i++) { - int left, right, top, bottom; - if (Random.Int(2) == 0) { - left = Random.Int(1, ROOM_LEFT - 3); - right = ROOM_RIGHT + 3; - } else { - left = ROOM_LEFT - 3; - right = Random.Int(ROOM_RIGHT + 3, getWidth() - 1); - } - if (Random.Int(2) == 0) { - top = Random.Int(2, ROOM_TOP - 3); - bottom = ROOM_BOTTOM + 3; - } else { - top = ROOM_LEFT - 3; - bottom = Random.Int(ROOM_TOP + 3, HEIGHT - 1); - } - - Painter.fill(this, left, top, right - left + 1, bottom - top + 1, - Terrain.EMPTY); - - if (top < topMost) { - topMost = top; - exit = Random.Int(left, right) + (top - 1) * getWidth(); - } - } - - map[exit] = Terrain.WALL; - - - - Painter.fill(this, ROOM_LEFT, ROOM_TOP + 1, ROOM_RIGHT - ROOM_LEFT + 1, - ROOM_BOTTOM - ROOM_TOP, Terrain.EMPTY); - - - entrance = Random.Int(ROOM_LEFT + 1, ROOM_RIGHT - 1) - + Random.Int(ROOM_TOP + 1, ROOM_BOTTOM - 1) * getWidth(); - map[entrance] = Terrain.EMPTY; - - return true; - } - - @Override - protected void decorate() { - - for (int i = getWidth() + 1; i < getLength() - getWidth(); i++) { - if (map[i] == Terrain.EMPTY) { - int n = 0; - if (map[i + 1] == Terrain.WALL) { - n++; - } - if (map[i - 1] == Terrain.WALL) { - n++; - } - if (map[i + getWidth()] == Terrain.WALL) { - n++; - } - if (map[i - getWidth()] == Terrain.WALL) { - n++; - } - if (Random.Int(8) <= n) { - map[i] = Terrain.EMPTY_DECO; - } - } - } - - for (int i = 0; i < getLength(); i++) { - if (map[i] == Terrain.WALL && Random.Int(8) == 0) { - map[i] = Terrain.WALL_DECO; - } - if (map[i]==Terrain.ENTRANCE){map[i] = Terrain.EMPTY;} - if (map[i]==Terrain.EMPTY && heaps.get(i) == null && Random.Float()<.20){map[i] = Terrain.HIGH_GRASS;} - if (map[i]==Terrain.EMPTY && heaps.get(i) == null && Random.Float()<.25){map[i] = Terrain.GRASS;} - if (map[i]==Terrain.EMPTY && heaps.get(i) == null && Random.Float()<.30){map[i] = Terrain.SHRUB;} - } - - } - - //@Override - //protected void createMobs() { - //} - - //@Override - //public Actor respawner() { - // return null; - //} - - @Override - protected void createItems() { - - int pos = randomDestination(); - drop(new LightBomb(50), pos).type = Heap.Type.CHEST; - - } - - - - //@Override - //public int randomRespawnCell() { - // return -1; - //} - - - - - @Override - public String tileName(int tile) { - switch (tile) { - case Terrain.WATER: - return Messages.get(PrisonLevel.class, "water_name"); - default: - return super.tileName(tile); - } - } - - @Override - public String tileDesc(int tile) { - switch (tile) { - case Terrain.EMPTY_DECO: - return Messages.get(PrisonLevel.class, "empty_deco_desc"); - case Terrain.BOOKSHELF: - return Messages.get(PrisonLevel.class, "bookshelf_desc"); - default: - return super.tileDesc(tile); - } - } - - - @Override - public void addVisuals(Scene scene) { - CavesLevel.addVisuals(this, scene); - } - @Override - public int nMobs() { - return 16; - } - - @Override - protected void createMobs() { - int nMobs = nMobs(); - for (int i = 0; i < nMobs; i++) { - Mob mob = Bestiary.mob(Dungeon.depth); - do { - mob.pos = randomRespawnCellMob(); - } while (mob.pos == -1); - mobs.add(mob); - Actor.occupyCell(mob); - } - } - - @Override - public Actor respawner() { - return new Actor() { - @Override - protected boolean act() { - if (mobs.size() < nMobs()) { - - Mob mob = Bestiary.mutable(Dungeon.depth); - mob.state = mob.WANDERING; - mob.pos = randomRespawnCellMob(); - if (Dungeon.hero.isAlive() && mob.pos != -1) { - GameScene.add(mob); - } - } - spend(Dungeon.level.feeling == Feeling.DARK - || Statistics.amuletObtained ? TIME_TO_RESPAWN / 2 - : TIME_TO_RESPAWN); - return true; - } - }; - } -} diff --git a/java/com/hmdzl/spspd/change/levels/BossRushLevel.java b/java/com/hmdzl/spspd/change/levels/BossRushLevel.java deleted file mode 100644 index d2413c15..00000000 --- a/java/com/hmdzl/spspd/change/levels/BossRushLevel.java +++ /dev/null @@ -1,250 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.mobs.Dragonking; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.particles.FlameParticle; -import com.hmdzl.spspd.change.items.Heap; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.keys.SkeletonKey; -import com.hmdzl.spspd.change.levels.painters.Painter; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.watabou.noosa.Scene; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -public class BossRushLevel extends Level { - - { - color1 = 0x801500; - color2 = 0xa68521; - - viewDistance = 8; - } - - private static final int ROOM_LEFT = getWidth() / 2 - 1; - private static final int ROOM_RIGHT = getWidth() / 2 + 1; - private static final int ROOM_TOP = HEIGHT / 2 - 1; - private static final int ROOM_BOTTOM = HEIGHT / 2 + 1; - - private int stairs = -1; - private boolean enteredArena = false; - private boolean keyDropped = false; - - @Override - public String tilesTex() { - return Assets.TILES_SEAL; - } - - @Override - public String waterTex() { - return Assets.WATER_CITY; - } - - private static final String STAIRS = "stairs"; - private static final String ENTERED = "entered"; - private static final String DROPPED = "droppped"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(STAIRS, stairs); - bundle.put(ENTERED, enteredArena); - bundle.put(DROPPED, keyDropped); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - stairs = bundle.getInt(STAIRS); - enteredArena = bundle.getBoolean(ENTERED); - keyDropped = bundle.getBoolean(DROPPED); - } - - @Override - protected boolean build() { - - for (int i = 0; i < 5; i++) { - - int top = Random.IntRange(2, ROOM_TOP - 1); - int bottom = Random.IntRange(ROOM_BOTTOM + 1, 22); - Painter.fill(this, 2 + i * 4, top, 4, bottom - top + 1, - Terrain.EMPTY); - - if (i == 2) { - exit = (i * 4 + 3) + (top - 1) * getWidth(); - } - - for (int j = 0; j < 4; j++) { - if (Random.Int(2) == 0) { - int y = Random.IntRange(top + 1, bottom - 1); - map[i * 4 + j + y * getWidth()] = Terrain.WALL_DECO; - } - } - } - - map[exit] = Terrain.LOCKED_EXIT; - - Painter.fill(this, ROOM_LEFT - 1, ROOM_TOP - 1, ROOM_RIGHT - ROOM_LEFT - + 3, ROOM_BOTTOM - ROOM_TOP + 3, Terrain.WALL); - - Painter.fill(this, ROOM_LEFT, ROOM_TOP, ROOM_RIGHT - ROOM_LEFT + 1, - ROOM_BOTTOM - ROOM_TOP + 1, Terrain.EMPTY); - - entrance = Random.Int(ROOM_LEFT + 1, ROOM_RIGHT - 1) - + Random.Int(ROOM_TOP + 1, ROOM_BOTTOM - 1) * getWidth(); - map[entrance] = Terrain.PEDESTAL; - - boolean[] patch = Patch.generate(0.45f, 6); - for (int i = 0; i < getLength(); i++) { - if (map[i] == Terrain.EMPTY && patch[i]) { - map[i] = Terrain.WATER; - } - } - - return true; - } - - @Override - protected void decorate() { - - for (int i = 0; i < getLength(); i++) { - if (map[i] == Terrain.EMPTY && Random.Int(10) == 0) { - map[i] = Terrain.EMPTY_DECO; - if (map[i]==Terrain.ENTRANCE){map[i] = Terrain.PEDESTAL;} - } - } - - } - - @Override - protected void createMobs() { - } - - @Override - public Actor respawner() { - return null; - } - - @Override - protected void createItems() { - - } - - @Override - public int randomRespawnCell() { - return -1; - } - - - @Override - public void press(int cell, Char hero) { - - super.press(cell, hero); - - if (!enteredArena && hero == Dungeon.hero && cell != entrance) { - - enteredArena = true; - locked = true; - - for (int i = ROOM_LEFT - 1; i <= ROOM_RIGHT + 1; i++) { - doMagic((ROOM_TOP - 1) * getWidth() + i); - doMagic((ROOM_BOTTOM + 1) * getWidth() + i); - } - for (int i = ROOM_TOP; i < ROOM_BOTTOM + 1; i++) { - doMagic(i * getWidth() + ROOM_LEFT - 1); - doMagic(i * getWidth() + ROOM_RIGHT + 1); - } - doMagic(entrance); - GameScene.updateMap(); - - Dungeon.observe(); - - Dragonking boss = new Dragonking(); - do { - boss.pos = Random.Int(getLength()); - } while (!passable[boss.pos] || Dungeon.visible[boss.pos]); - GameScene.add(boss); - - stairs = entrance; - entrance = -1; - - } - } - - private void doMagic(int cell) { - set(cell, Terrain.EMPTY_SP); - CellEmitter.get(cell).start(FlameParticle.FACTORY, 0.1f, 3); - } - - @Override - public Heap drop(Item item, int cell) { - - if (!keyDropped && item instanceof SkeletonKey) { - keyDropped = true; - locked = false; - - entrance = stairs; - set(entrance, Terrain.PEDESTAL); - GameScene.updateMap(entrance); - } - - return super.drop(item, cell); - } - - @Override - public String tileName(int tile) { - switch (tile) { - case Terrain.WATER: - return Messages.get(BossRushLevel.class, "water_name"); - case Terrain.GRASS: - return Messages.get(BossRushLevel.class, "grass_name"); - case Terrain.HIGH_GRASS: - return Messages.get(BossRushLevel.class, "high_grass_name"); - case Terrain.STATUE: - case Terrain.STATUE_SP: - return Messages.get(BossRushLevel.class, "statue_sp_name"); - default: - return super.tileName(tile); - } - } - - @Override - public String tileDesc(int tile) { - switch (tile) { - case Terrain.WATER: - return Messages.get(BossRushLevel.class, "water_desc"); - case Terrain.STATUE: - case Terrain.STATUE_SP: - return Messages.get(BossRushLevel.class, "statue_sp_desc"); - default: - return super.tileDesc(tile); - } - } - - @Override - public void addVisuals(Scene scene) { - HallsLevel.addVisuals(this, scene); - } -} diff --git a/java/com/hmdzl/spspd/change/levels/CatacombLevel.java b/java/com/hmdzl/spspd/change/levels/CatacombLevel.java deleted file mode 100644 index d2d31881..00000000 --- a/java/com/hmdzl/spspd/change/levels/CatacombLevel.java +++ /dev/null @@ -1,247 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.DungeonTilemap; -import com.hmdzl.spspd.change.items.TriforceOfCourage; -import com.hmdzl.spspd.change.levels.Room.Type; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.watabou.noosa.Game; -import com.watabou.noosa.Scene; -import com.watabou.noosa.particles.Emitter; -import com.watabou.noosa.particles.PixelParticle; -import com.watabou.utils.ColorMath; -import com.watabou.utils.PointF; -import com.watabou.utils.Random; - -public class CatacombLevel extends RegularLevel { - - { - color1 = 0x48763c; - color2 = 0x59994a; - cleared=true; - - viewDistance = 3; - } - - - @Override - public String tilesTex() { - return Assets.TILES_SEWERS; - } - - @Override - public String waterTex() { - return Assets.WATER_SEWERS; - } - - @Override - protected boolean[] water() { - return Patch.generate(feeling == Feeling.WATER ? 0.60f : 0.45f, 5); - } - - @Override - protected boolean[] grass() { - return Patch.generate(feeling == Feeling.GRASS ? 0.60f : 0.40f, 4); - } - - @Override - protected boolean assignRoomType() { - - int count = 0; - for (Room r : rooms) { - if (r.type == Type.NULL) { - int connections = r.connected.size(); - if (connections == 0) { - - } else if (Random.Int(connections * connections) == 0) { - r.type = Type.STANDARD; - count++; - } else { - r.type = Type.TUNNEL; - } - } - } - - while (count < 4) { - Room r = randomRoom(Type.TUNNEL, 1); - if (r != null) { - r.type = Type.STANDARD; - count++; - } - } - - return true; - } - - - @Override - protected void decorate() { - - for (int i = 0; i < getWidth(); i++) { - if (map[i] == Terrain.WALL && map[i + getWidth()] == Terrain.WATER - && Random.Int(4) == 0) { - - map[i] = Terrain.WALL_DECO; - } - } - - for (int i = getWidth(); i < getLength() - getWidth(); i++) { - if (map[i] == Terrain.WALL && map[i - getWidth()] == Terrain.WALL - && map[i + getWidth()] == Terrain.WATER && Random.Int(2) == 0) { - - map[i] = Terrain.WALL_DECO; - } - } - - for (int i = getWidth() + 1; i < getLength() - getWidth() - 1; i++) { - if (map[i] == Terrain.EMPTY) { - - int count = (map[i + 1] == Terrain.WALL ? 1 : 0) - + (map[i - 1] == Terrain.WALL ? 1 : 0) - + (map[i + getWidth()] == Terrain.WALL ? 1 : 0) - + (map[i - getWidth()] == Terrain.WALL ? 1 : 0); - - if (Random.Int(16) < count * count) { - map[i] = Terrain.EMPTY_DECO; - } - } - } - - - int length = Level.getLength(); - - for (int i = 0; i < length; i++) { - - - if (map[i]==Terrain.ENTRANCE){map[i] = Terrain.PEDESTAL;} - if (map[i]==Terrain.EXIT){map[i] = Terrain.PEDESTAL; if (!Dungeon.triforceofcourage){drop(new TriforceOfCourage(), i);}} - if (map[i]==Terrain.CHASM){map[i] = Terrain.EMPTY;} - - } - } - - - @Override - public void addVisuals(Scene scene) { - super.addVisuals(scene); - addVisuals(this, scene); - } - - public static void addVisuals(Level level, Scene scene) { - for (int i = 0; i < getLength(); i++) { - if (level.map[i] == Terrain.WALL_DECO) { - scene.add(new Sink(i)); - } - } - } - - //@Override - //public int randomRespawnCell() { - // return -1; - //} - - @Override - public String tileName(int tile) { - switch (tile) { - case Terrain.WATER: - return Messages.get(SewerLevel.class, "water_name"); - default: - return super.tileName(tile); - } - } - - @Override - public String tileDesc(int tile) { - switch (tile) { - case Terrain.EMPTY_DECO: - return Messages.get(SewerLevel.class, "empty_deco_desc"); - case Terrain.BOOKSHELF: - return Messages.get(SewerLevel.class, "bookshelf_desc"); - default: - return super.tileDesc(tile); - } - } - - private static class Sink extends Emitter { - - private int pos; - private float rippleDelay = 0; - - private static final Emitter.Factory factory = new Factory() { - - @Override - public void emit(Emitter emitter, int index, float x, float y) { - WaterParticle p = (WaterParticle) emitter - .recycle(WaterParticle.class); - p.reset(x, y); - } - }; - - public Sink(int pos) { - super(); - - this.pos = pos; - - PointF p = DungeonTilemap.tileCenterToWorld(pos); - pos(p.x - 2, p.y + 1, 4, 0); - - pour(factory, 0.05f); - } - - @Override - public void update() { - if (visible = Dungeon.visible[pos]) { - - super.update(); - - if ((rippleDelay -= Game.elapsed) <= 0) { - GameScene.ripple(pos + getWidth()).y -= DungeonTilemap.SIZE / 2; - rippleDelay = Random.Float(0.2f, 0.3f); - } - } - } - } - - public static final class WaterParticle extends PixelParticle { - - public WaterParticle() { - super(); - - acc.y = 50; - am = 0.5f; - - color(ColorMath.random(0xb6ccc2, 0x3b6653)); - size(2); - } - - public void reset(float x, float y) { - revive(); - - this.x = x; - this.y = y; - - speed.set(Random.Float(-2, +2), 0); - - left = lifespan = 0.5f; - } - } -} diff --git a/java/com/hmdzl/spspd/change/levels/CavesBossLevel.java b/java/com/hmdzl/spspd/change/levels/CavesBossLevel.java deleted file mode 100644 index 2715abf5..00000000 --- a/java/com/hmdzl/spspd/change/levels/CavesBossLevel.java +++ /dev/null @@ -1,320 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.mobs.Bestiary; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.Heap; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.levels.painters.Painter; -import com.hmdzl.spspd.change.levels.traps.ToxicTrap; -import com.hmdzl.spspd.change.levels.traps.Trap; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.watabou.noosa.Camera; -import com.watabou.noosa.Scene; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -public class CavesBossLevel extends Level { - - { - color1 = 0x534f3e; - color2 = 0xb9d661; - - viewDistance = 6; - } - - private static final int ROOM_LEFT = getWidth() / 2 - 2; - private static final int ROOM_RIGHT = getWidth() / 2 + 2; - private static final int ROOM_TOP = HEIGHT / 2 - 2; - private static final int ROOM_BOTTOM = HEIGHT / 2 + 2; - - private int arenaDoor; - private int stairs = -1; - private boolean enteredArena = false; - - @Override - public String tilesTex() { - return Assets.TILES_CAVES; - } - - @Override - public String waterTex() { - return Assets.WATER_CAVES; - } - - private static final String DOOR = "door"; - private static final String ENTERED = "entered"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(DOOR, arenaDoor); - bundle.put(ENTERED, enteredArena); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - arenaDoor = bundle.getInt(DOOR); - enteredArena = bundle.getBoolean(ENTERED); - } - - @Override - protected boolean build() { - - int topMost = Integer.MAX_VALUE; - - for (int i = 0; i < 8; i++) { - int left, right, top, bottom; - if (Random.Int(2) == 0) { - left = Random.Int(1, ROOM_LEFT - 3); - right = ROOM_RIGHT + 3; - } else { - left = ROOM_LEFT - 3; - right = Random.Int(ROOM_RIGHT + 3, getWidth() - 1); - } - if (Random.Int(2) == 0) { - top = Random.Int(2, ROOM_TOP - 3); - bottom = ROOM_BOTTOM + 3; - } else { - top = ROOM_LEFT - 3; - bottom = Random.Int(ROOM_TOP + 3, HEIGHT - 1); - } - - Painter.fill(this, left, top, right - left + 1, bottom - top + 1, - Terrain.EMPTY); - - if (top < topMost) { - topMost = top; - exit = Random.Int(left, right) + (top - 1) * getWidth(); - } - } - - map[exit] = Terrain.LOCKED_EXIT; - - for (int i = 0; i < getLength(); i++) { - if (map[i] == Terrain.EMPTY && Random.Int(12) == 0) { - map[i] = Terrain.INACTIVE_TRAP; - Trap t = new ToxicTrap().reveal(); - t.active = false; - setTrap(t, i); - } - } - - Painter.fill(this, ROOM_LEFT - 1, ROOM_TOP - 1, ROOM_RIGHT - ROOM_LEFT - + 3, ROOM_BOTTOM - ROOM_TOP + 3, Terrain.WALL); - Painter.fill(this, ROOM_LEFT, ROOM_TOP + 1, ROOM_RIGHT - ROOM_LEFT + 1, - ROOM_BOTTOM - ROOM_TOP, Terrain.EMPTY); - - Painter.fill(this, ROOM_LEFT, ROOM_TOP, ROOM_RIGHT - ROOM_LEFT + 1, 1, - Terrain.INACTIVE_TRAP); - - arenaDoor = Random.Int(ROOM_LEFT, ROOM_RIGHT) + (ROOM_BOTTOM + 1) - * getWidth(); - map[arenaDoor] = Terrain.DOOR; - - entrance = Random.Int(ROOM_LEFT + 1, ROOM_RIGHT - 1) - + Random.Int(ROOM_TOP + 1, ROOM_BOTTOM - 1) * getWidth(); - map[entrance] = Terrain.ENTRANCE; - - boolean[] patch = Patch.generate(0.45f, 6); - for (int i = 0; i < getLength(); i++) { - if (map[i] == Terrain.EMPTY && patch[i]) { - map[i] = Terrain.WATER; - } - } - - return true; - } - - @Override - protected void decorate() { - - for (int i = getWidth() + 1; i < getLength() - getWidth(); i++) { - if (map[i] == Terrain.EMPTY) { - int n = 0; - if (map[i + 1] == Terrain.WALL) { - n++; - } - if (map[i - 1] == Terrain.WALL) { - n++; - } - if (map[i + getWidth()] == Terrain.WALL) { - n++; - } - if (map[i - getWidth()] == Terrain.WALL) { - n++; - } - if (Random.Int(8) <= n) { - map[i] = Terrain.EMPTY_DECO; - } - } - } - - for (int i = 0; i < getLength(); i++) { - if (map[i] == Terrain.WALL && Random.Int(8) == 0) { - map[i] = Terrain.WALL_DECO; - } - } - - int sign; - do { - sign = Random.Int(ROOM_LEFT, ROOM_RIGHT) - + Random.Int(ROOM_TOP, ROOM_BOTTOM) * getWidth(); - } while (sign == entrance); - map[sign] = Terrain.SIGN; - } - - @Override - protected void createMobs() { - } - - @Override - public Actor respawner() { - return null; - } - - @Override - protected void createItems() { - - } - - @Override - public int randomRespawnCell() { - return -1; - } - - @Override - public void press(int cell, Char hero) { - - super.press(cell, hero); - - if (!enteredArena && outsideEntraceRoom(cell) && hero == Dungeon.hero) { - - enteredArena = true; - seal(); - - Mob boss = Bestiary.mob(Dungeon.depth); - boss.state = boss.HUNTING; - do { - boss.pos = Random.Int(getLength()); - } while (!passable[boss.pos] || !outsideEntraceRoom(boss.pos) - || Dungeon.visible[boss.pos]); - GameScene.add(boss); - boss.notice(); - - - set(arenaDoor, Terrain.WALL); - GameScene.updateMap(arenaDoor); - Dungeon.observe(); - - CellEmitter.get(arenaDoor).start(Speck.factory(Speck.ROCK), 0.07f, - 10); - Camera.main.shake(3, 0.7f); - Sample.INSTANCE.play(Assets.SND_ROCKS); - } - } - - public void seal() { - if (entrance != 0) { - - locked = true; - - set(arenaDoor, Terrain.WALL); - GameScene.updateMap(arenaDoor); - Dungeon.observe(); - - CellEmitter.get(arenaDoor).start(Speck.factory(Speck.ROCK), 0.07f, - 10); - Camera.main.shake(3, 0.7f); - Sample.INSTANCE.play(Assets.SND_ROCKS); - - set(entrance, Terrain.WALL_DECO); - GameScene.updateMap(entrance); - GameScene.ripple(entrance); - - } - } - - public void unseal() { - if (stairs != 0) { - locked = false; - CellEmitter.get(arenaDoor).start(Speck.factory(Speck.ROCK), 0.07f, - 10); - set(arenaDoor, Terrain.EMPTY_DECO); - GameScene.updateMap(arenaDoor); - Dungeon.observe(); - set(entrance, Terrain.ENTRANCE); - GameScene.updateMap(entrance); - - } - } - - private boolean outsideEntraceRoom(int cell) { - int cx = cell % getWidth(); - int cy = cell / getWidth(); - return cx < ROOM_LEFT - 1 || cx > ROOM_RIGHT + 1 || cy < ROOM_TOP - 1 - || cy > ROOM_BOTTOM + 1; - } - - @Override - public String tileName(int tile) { - switch (tile) { - case Terrain.GRASS: - return Messages.get(CavesLevel.class, "grass_name"); - case Terrain.HIGH_GRASS: - return Messages.get(CavesLevel.class, "high_grass_name"); - case Terrain.WATER: - return Messages.get(CavesLevel.class, "water_name"); - default: - return super.tileName( tile ); - } - } - - @Override - public String tileDesc(int tile) { - switch (tile) { - case Terrain.ENTRANCE: - return Messages.get(CavesLevel.class, "entrance_desc"); - case Terrain.EXIT: - return Messages.get(CavesLevel.class, "exit_desc"); - case Terrain.HIGH_GRASS: - return Messages.get(CavesLevel.class, "high_grass_desc"); - case Terrain.WALL_DECO: - return Messages.get(CavesLevel.class, "wall_deco_desc"); - case Terrain.BOOKSHELF: - return Messages.get(CavesLevel.class, "bookshelf_desc"); - default: - return super.tileDesc( tile ); - } - } - - @Override - public void addVisuals(Scene scene) { - CavesLevel.addVisuals(this, scene); - } -} diff --git a/java/com/hmdzl/spspd/change/levels/CavesLevel.java b/java/com/hmdzl/spspd/change/levels/CavesLevel.java deleted file mode 100644 index 37fd42f8..00000000 --- a/java/com/hmdzl/spspd/change/levels/CavesLevel.java +++ /dev/null @@ -1,360 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.DungeonTilemap; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.hero.HeroClass; -import com.hmdzl.spspd.change.actors.mobs.npcs.Blacksmith; -import com.hmdzl.spspd.change.actors.mobs.npcs.Tinkerer2; -import com.hmdzl.spspd.change.items.bombs.Bomb; -import com.hmdzl.spspd.change.items.bombs.DungeonBomb; -import com.hmdzl.spspd.change.items.quest.Mushroom; -import com.hmdzl.spspd.change.levels.Room.Type; -import com.hmdzl.spspd.change.levels.painters.Painter; -import com.hmdzl.spspd.change.levels.traps.*; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.noosa.Game; -import com.watabou.noosa.Group; -import com.watabou.noosa.Scene; -import com.watabou.noosa.particles.PixelParticle; -import com.watabou.utils.PointF; -import com.watabou.utils.Random; -import com.watabou.utils.Rect; - -public class CavesLevel extends RegularLevel { - - { - color1 = 0x534f3e; - color2 = 0xb9d661; - - viewDistance = 6; - } - - @Override - public String tilesTex() { - return Assets.TILES_CAVES; - } - - @Override - public String waterTex() { - return Assets.WATER_CAVES; - } - - @Override - protected boolean[] water() { - return Patch.generate(feeling == Feeling.WATER ? 0.60f : 0.45f, 6); - } - - @Override - protected boolean[] grass() { - return Patch.generate(feeling == Feeling.GRASS ? 0.55f : 0.35f, 3); - } - - @Override - protected Class[] trapClasses() { - return Dungeon.depth == 14 ? - new Class[]{ FireTrap.class, FrostTrap.class, PoisonTrap.class, SpearTrap.class, VenomTrap.class, ShockTrap.class, - ExplosiveTrap.class, FlashingTrap.class, GrippingTrap.class, ParalyticTrap.class, LightningTrap.class, RockfallTrap.class, OozeTrap.class, - ConfusionTrap.class, FlockTrap.class, GuardianTrap.class, SummoningTrap.class, TeleportationTrap.class, - WarpingTrap.class, StormTrap.class}: - new Class[]{ FireTrap.class, FrostTrap.class, PoisonTrap.class, SpearTrap.class, VenomTrap.class, ShockTrap.class, - ExplosiveTrap.class, FlashingTrap.class, GrippingTrap.class, ParalyticTrap.class, LightningTrap.class, RockfallTrap.class, OozeTrap.class, - ConfusionTrap.class, FlockTrap.class, GuardianTrap.class, PitfallTrap.class, SummoningTrap.class, TeleportationTrap.class, - WarpingTrap.class, StormTrap.class}; - } - - @Override - protected float[] trapChances() { - return Dungeon.depth == 14 ? - new float[]{ 8, 8, 8, 8, 8, 8, - 4, 4, 4, 4, 4, 4, 4, - 2, 2, 2, 2, 2, - 1, 1 }: - new float[]{ 8, 8, 8, 8, 8, 8, - 4, 4, 4, 4, 4, 4, 4, - 2, 2, 2, 2, 2, 2, - 1, 1 }; - } - - @Override - protected void setPar(){ - Dungeon.pars[Dungeon.depth] = 400+(Dungeon.depth*50)+(secretDoors*20); - } - - @Override - protected void createItems() { - - if (Dungeon.depth == 12){ - Tinkerer2 npc = new Tinkerer2(); - do { - npc.pos = randomRespawnCell(); - } while (npc.pos == -1 || heaps.get(npc.pos) != null); - mobs.add(npc); - Actor.occupyCell(npc); - } - - if (Dungeon.depth == 11){ - addItemToSpawn(new Mushroom()); - } - - if (Dungeon.hero.heroClass==HeroClass.PERFORMER && Random.Int(3) == 0){addItemToSpawn(new DungeonBomb());} - super.createItems(); - } - - - @Override - protected boolean assignRoomType() { - super.assignRoomType(); - - if (!Blacksmith.Quest.spawn(rooms) && Dungeon.depth == 14) - return false; - - return true; - } - - @Override - protected void decorate() { - - for (Room room : rooms) { - if (room.type != Room.Type.STANDARD) { - continue; - } - - if (room.width() <= 3 || room.height() <= 3) { - continue; - } - - int s = room.square(); - - if (Random.Int(s) > 8) { - int corner = (room.left + 1) + (room.top + 1) * getWidth(); - if (map[corner - 1] == Terrain.WALL - && map[corner - getWidth()] == Terrain.WALL) { - map[corner] = Terrain.WALL; - } - } - - if (Random.Int(s) > 8) { - int corner = (room.right - 1) + (room.top + 1) * getWidth(); - if (map[corner + 1] == Terrain.WALL - && map[corner - getWidth()] == Terrain.WALL) { - map[corner] = Terrain.WALL; - } - } - - if (Random.Int(s) > 8) { - int corner = (room.left + 1) + (room.bottom - 1) * getWidth(); - if (map[corner - 1] == Terrain.WALL - && map[corner + getWidth()] == Terrain.WALL) { - map[corner] = Terrain.WALL; - } - } - - if (Random.Int(s) > 8) { - int corner = (room.right - 1) + (room.bottom - 1) * getWidth(); - if (map[corner + 1] == Terrain.WALL - && map[corner + getWidth()] == Terrain.WALL) { - map[corner] = Terrain.WALL; - } - } - - for (Room n : room.connected.keySet()) { - if ((n.type == Room.Type.STANDARD || n.type == Room.Type.TUNNEL) - && Random.Int(3) == 0) { - Painter.set(this, room.connected.get(n), Terrain.EMPTY_DECO); - } - } - } - - for (int i = getWidth() + 1; i < getLength() - getWidth(); i++) { - if (map[i] == Terrain.EMPTY) { - int n = 0; - if (map[i + 1] == Terrain.WALL) { - n++; - } - if (map[i - 1] == Terrain.WALL) { - n++; - } - if (map[i + getWidth()] == Terrain.WALL) { - n++; - } - if (map[i - getWidth()] == Terrain.WALL) { - n++; - } - if (Random.Int(6) <= n) { - map[i] = Terrain.EMPTY_DECO; - } - } - } - - for (int i = 0; i < getLength(); i++) { - if (map[i] == Terrain.WALL && Random.Int(8) == 0) { - map[i] = Terrain.WALL_DECO; - } - } - - while (true) { - int pos = roomEntrance.random(); - if (pos != entrance) { - map[pos] = Terrain.SIGN; - break; - } - } - - setPar(); - - if (Dungeon.bossLevel(Dungeon.depth + 1)) { - return; - } - - for (Room r : rooms) { - if (r.type == Type.STANDARD) { - for (Room n : r.neigbours) { - if (n.type == Type.STANDARD && !r.connected.containsKey(n)) { - Rect w = r.intersect(n); - if (w.left == w.right && w.bottom - w.top >= 5) { - - w.top += 2; - w.bottom -= 1; - - w.right++; - - Painter.fill(this, w.left, w.top, 1, w.height(), - Terrain.CHASM); - - } else if (w.top == w.bottom && w.right - w.left >= 5) { - - w.left += 2; - w.right -= 1; - - w.bottom++; - - Painter.fill(this, w.left, w.top, w.width(), 1, - Terrain.CHASM); - } - } - } - } - } - - - } - - @Override - public String tileName(int tile) { - switch (tile) { - case Terrain.GRASS: - return Messages.get(CavesLevel.class, "grass_name"); - case Terrain.HIGH_GRASS: - return Messages.get(CavesLevel.class, "high_grass_name"); - case Terrain.WATER: - return Messages.get(CavesLevel.class, "water_name"); - default: - return super.tileName(tile); - } - } - - @Override - public String tileDesc(int tile) { - switch (tile) { - case Terrain.ENTRANCE: - return Messages.get(CavesLevel.class, "entrance_desc"); - case Terrain.EXIT: - return Messages.get(CavesLevel.class, "exit_desc"); - case Terrain.HIGH_GRASS: - return Messages.get(CavesLevel.class, "high_grass_desc"); - case Terrain.WALL_DECO: - return Messages.get(CavesLevel.class, "wall_deco_desc"); - case Terrain.BOOKSHELF: - return Messages.get(CavesLevel.class, "bookshelf_desc"); - default: - return super.tileDesc(tile); - } - } - - @Override - public void addVisuals(Scene scene) { - super.addVisuals(scene); - addVisuals(this, scene); - } - - public static void addVisuals(Level level, Scene scene) { - for (int i = 0; i < getLength(); i++) { - if (level.map[i] == Terrain.WALL_DECO) { - scene.add(new Vein(i)); - } - } - } - - private static class Vein extends Group { - - private int pos; - - private float delay; - - public Vein(int pos) { - super(); - - this.pos = pos; - - delay = Random.Float(2); - } - - @Override - public void update() { - - if (visible = Dungeon.visible[pos]) { - - super.update(); - - if ((delay -= Game.elapsed) <= 0) { - - delay = Random.Float(); - - PointF p = DungeonTilemap.tileToWorld(pos); - ((Sparkle) recycle(Sparkle.class)).reset( - p.x + Random.Float(DungeonTilemap.SIZE), p.y - + Random.Float(DungeonTilemap.SIZE)); - } - } - } - } - - public static final class Sparkle extends PixelParticle { - - public void reset(float x, float y) { - revive(); - - this.x = x; - this.y = y; - - left = lifespan = 0.5f; - } - - @Override - public void update() { - super.update(); - - float p = left / lifespan; - size((am = p < 0.5f ? p * 2 : (1 - p) * 2) * 2); - } - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/levels/ChaosLevel.java b/java/com/hmdzl/spspd/change/levels/ChaosLevel.java deleted file mode 100644 index 496c3f86..00000000 --- a/java/com/hmdzl/spspd/change/levels/ChaosLevel.java +++ /dev/null @@ -1,217 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels; - -import javax.microedition.khronos.opengles.GL10; - -import android.opengl.GLES20; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.DungeonTilemap; -import com.hmdzl.spspd.change.actors.hero.HeroClass; -import com.hmdzl.spspd.change.actors.mobs.Sentinel; -import com.hmdzl.spspd.change.items.bombs.Bomb; -import com.hmdzl.spspd.change.items.DwarfHammer; -import com.hmdzl.spspd.change.items.Torch; -import com.hmdzl.spspd.change.levels.traps.*; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.noosa.Game; -import com.watabou.noosa.Group; -import com.watabou.noosa.Scene; -import com.watabou.noosa.particles.PixelParticle; -import com.watabou.utils.PointF; -import com.watabou.utils.Random; - -public class ChaosLevel extends RegularLevel { - - { - minRoomSize = 6; - - color1 = 0x801500; - color2 = 0xa68521; - cleared=true; - viewDistance = 6; - } - - @Override - public String tilesTex() { - return Assets.TILES_SEAL; - } - - @Override - public String waterTex() { - return Assets.WATER_CITY; - } - - @Override - protected boolean[] water() { - return Patch.generate(feeling == Feeling.WATER ? 0.55f : 0.40f, 6); - } - - @Override - protected boolean[] grass() { - return Patch.generate(feeling == Feeling.GRASS ? 0.55f : 0.30f, 3); - } - - @Override - protected Class[] trapClasses() { - return new Class[]{DistortionTrap.class}; - } - - @Override - protected float[] trapChances() { - return new float[]{10}; - } - - @Override - protected void decorate() { - - for (int i = getWidth() + 1; i < getLength() - getWidth() - 1; i++) { - if (map[i] == Terrain.EMPTY) { - - int count = 0; - for (int j = 0; j < NEIGHBOURS8.length; j++) { - if ((Terrain.flags[map[i + NEIGHBOURS8[j]]] & Terrain.PASSABLE) > 0) { - count++; - } - } - - if (Random.Int(80) < count) { - map[i] = Terrain.EMPTY_DECO; - } - - } else if (map[i] == Terrain.WALL - && map[i - 1] != Terrain.WALL_DECO - && map[i - getWidth()] != Terrain.WALL_DECO - && Random.Int(20) == 0) { - - map[i] = Terrain.WALL_DECO; - - } - } - - int length = Level.getLength(); - - for (int i = 0; i < length; i++) { - - - if (map[i]==Terrain.ENTRANCE){map[i] = Terrain.PEDESTAL;} - if (map[i]==Terrain.EXIT){map[i] = Terrain.PEDESTAL; } - if (map[i]==Terrain.CHASM){map[i] = Terrain.EMPTY;} - - } - - - } - - @Override - public void addVisuals(Scene scene) { - super.addVisuals(scene); - addVisuals(this, scene); - } - - public static void addVisuals(Level level, Scene scene) { - for (int i = 0; i < getLength(); i++) { - if (level.map[i] == 63) { - scene.add(new Stream(i)); - } - } - } - - private static class Stream extends Group { - - private int pos; - - private float delay; - - public Stream(int pos) { - super(); - - this.pos = pos; - - delay = Random.Float(2); - } - - @Override - public void update() { - - if (visible = Dungeon.visible[pos]) { - - super.update(); - - if ((delay -= Game.elapsed) <= 0) { - - delay = Random.Float(2); - - PointF p = DungeonTilemap.tileToWorld(pos); - ((FireParticle) recycle(FireParticle.class)).reset(p.x - + Random.Float(DungeonTilemap.SIZE), - p.y + Random.Float(DungeonTilemap.SIZE)); - } - } - } - - @Override - public void draw() { - GLES20.glBlendFunc(GL10.GL_SRC_ALPHA, GL10.GL_ONE); - super.draw(); - GLES20.glBlendFunc(GL10.GL_SRC_ALPHA, GL10.GL_ONE_MINUS_SRC_ALPHA); - } - } - - public static class FireParticle extends PixelParticle.Shrinking { - - public FireParticle() { - super(); - - color(0xEE7722); - lifespan = 1f; - - acc.set(0, +80); - } - - public void reset(float x, float y) { - revive(); - - this.x = x; - this.y = y; - - left = lifespan; - - speed.set(0, -40); - size = 4; - } - - @Override - public void update() { - super.update(); - float p = left / lifespan; - am = p > 0.8f ? (1 - p) * 5 : 1; - } - } - @Override - public String tileName( int tile ) { - switch (tile) { - case Terrain.WATER: - return Messages.get(ChaosLevel.class, "water_name"); - default: - return super.tileName( tile ); - } - } -} diff --git a/java/com/hmdzl/spspd/change/levels/ChasmLevel.java b/java/com/hmdzl/spspd/change/levels/ChasmLevel.java deleted file mode 100644 index 3f6840dc..00000000 --- a/java/com/hmdzl/spspd/change/levels/ChasmLevel.java +++ /dev/null @@ -1,327 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels; - -import java.util.ArrayList; -import java.util.HashSet; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Challenges; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.DungeonTilemap; -import com.hmdzl.spspd.change.actors.mobs.Sentinel; -import com.hmdzl.spspd.change.items.TriforceOfWisdom; -import com.hmdzl.spspd.change.items.potions.PotionOfLevitation; -import com.hmdzl.spspd.change.levels.Room.Type; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.plants.Phaseshift; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.watabou.noosa.Game; -import com.watabou.noosa.Scene; -import com.watabou.noosa.particles.Emitter; -import com.watabou.noosa.particles.PixelParticle; -import com.watabou.utils.ColorMath; -import com.watabou.utils.PointF; -import com.watabou.utils.Random; - -public class ChasmLevel extends RegularLevel { - - { - color1 = 0x48763c; - color2 = 0x59994a; - cleared=true; - } - - - @Override - public String tilesTex() { - return Assets.TILES_PRISON; - } - - @Override - public String waterTex() { - return Assets.WATER_PRISON; - } - - @Override - protected boolean[] water() { - return Patch.generate(feeling == Feeling.WATER ? 0.60f : 0.45f, 5); - } - - @Override - protected boolean[] grass() { - return Patch.generate(feeling == Feeling.GRASS ? 0.60f : 0.40f, 4); - } - - @Override - protected void createItems() { - super.createItems(); - - spawn(this, roomEntrance); - - } - - public static void spawn(ChasmLevel level, Room room) { - int pos; - do {pos = room.random();} - while (level.heaps.get(pos) != null); - level.drop(new PotionOfLevitation(), pos); - } - - @Override - protected boolean assignRoomType() { - - specialsc = new ArrayList(Room.SPECIALSTRANSCEND); - - //if (Dungeon.isChallenged(Challenges.NO_HERBALISM)) { - // sorry warden, no lucky sungrass or blandfruit seeds for you! - //specialsc.remove(Room.Type.GARDEN); - // } - - int specialRooms = 0; - - for (Room r : rooms) { - if (r.type == Type.NULL && r.connected.size() == 1) { - - if (specialsc.size() > 0 && r.width() > 3 && r.height() > 3 - //&& Random.Int(specialRooms * specialRooms + 2) == 0 - ) { - - - int n = specialsc.size(); - r.type = specialsc.get(Math.min(Random.Int(n),Random.Int(n))); - - Room.useType(r.type); - //specialsc.remove(r.type); - specialRooms++; - - } else if (Random.Int(2) == 0) { - - HashSet neigbours = new HashSet(); - for (Room n : r.neigbours) { - if (!r.connected.containsKey(n) - && !Room.SPECIALSTRANSCEND.contains(n.type) - && n.type != Type.PIT) { - - neigbours.add(n); - } - } - if (neigbours.size() > 1) { - r.connect(Random.element(neigbours)); - } - } - } - } - - - int count = 0; - for (Room r : rooms) { - if (r.type == Type.NULL) { - int connections = r.connected.size(); - if (connections == 0) { - - } else if (Random.Int(connections * connections) == 0) { - r.type = Type.STANDARD; - count++; - } else { - r.type = Type.TUNNEL; - } - } - } - - while (count < 4) { - Room r = randomRoom(Type.TUNNEL, 1); - if (r != null) { - r.type = Type.STANDARD; - count++; - } - } - - for (Room r : rooms) { - if (r.type == Type.TUNNEL) { - r.type = Type.PASSAGE; - } - } - - return true; - } - - - - @Override - protected void decorate() { - - for (int i = 0; i < getWidth(); i++) { - if (map[i] == Terrain.WALL && map[i + getWidth()] == Terrain.WATER - && Random.Int(4) == 0) { - - map[i] = Terrain.WALL_DECO; - } - } - - for (int i = getWidth(); i < getLength() - getWidth(); i++) { - if (map[i] == Terrain.WALL && map[i - getWidth()] == Terrain.WALL - && map[i + getWidth()] == Terrain.WATER && Random.Int(2) == 0) { - - map[i] = Terrain.WALL_DECO; - } - } - - for (int i = getWidth() + 1; i < getLength() - getWidth() - 1; i++) { - if (map[i] == Terrain.EMPTY) { - - int count = (map[i + 1] == Terrain.WALL ? 1 : 0) - + (map[i - 1] == Terrain.WALL ? 1 : 0) - + (map[i + getWidth()] == Terrain.WALL ? 1 : 0) - + (map[i - getWidth()] == Terrain.WALL ? 1 : 0); - - if (Random.Int(16) < count * count) { - map[i] = Terrain.EMPTY_DECO; - } - } - } - - - int length = Level.getLength(); - - for (int i = 0; i < length; i++) { - - - if (map[i]==Terrain.ENTRANCE){map[i] = Terrain.EMPTY;} - if (map[i]==Terrain.EXIT){map[i] = Terrain.PEDESTAL; if (!Dungeon.triforceofwisdom){drop(new TriforceOfWisdom(), i);}} - if (map[i]==Terrain.EMPTY_SP && heaps.get(i) == null && Random.Float()<.25){map[i] = Terrain.TRAP_AIR;} - if (map[i]==Terrain.EMPTY_SP && heaps.get(i) == null && Random.Float()<.05){ - Sentinel sentinel = new Sentinel(); - sentinel.pos = i; - mobs.add(sentinel); - } - if (map[i]==Terrain.EMPTY && heaps.get(i) == null && Random.Float()<.02){ - drop(new Phaseshift.Seed(), i); - } - - - } - } - - - @Override - public void addVisuals(Scene scene) { - super.addVisuals(scene); - addVisuals(this, scene); - } - - public static void addVisuals(Level level, Scene scene) { - for (int i = 0; i < getLength(); i++) { - if (level.map[i] == Terrain.WALL_DECO) { - scene.add(new Sink(i)); - } - } - } - - //@Override - //public int randomRespawnCell() { - // return -1; - //} - - @Override - public String tileName(int tile) { - switch (tile) { - case Terrain.WATER: - return Messages.get(PrisonLevel.class, "water_name"); - default: - return super.tileName(tile); - } - } - - @Override - public String tileDesc(int tile) { - switch (tile) { - case Terrain.EMPTY_DECO: - return Messages.get(PrisonLevel.class, "empty_deco_desc"); - case Terrain.BOOKSHELF: - return Messages.get(PrisonLevel.class, "bookshelf_desc"); - default: - return super.tileDesc(tile); - } - } - - private static class Sink extends Emitter { - - private int pos; - private float rippleDelay = 0; - - private static final Emitter.Factory factory = new Factory() { - - @Override - public void emit(Emitter emitter, int index, float x, float y) { - WaterParticle p = (WaterParticle) emitter - .recycle(WaterParticle.class); - p.reset(x, y); - } - }; - - public Sink(int pos) { - super(); - - this.pos = pos; - - PointF p = DungeonTilemap.tileCenterToWorld(pos); - pos(p.x - 2, p.y + 1, 4, 0); - - pour(factory, 0.05f); - } - - @Override - public void update() { - if (visible = Dungeon.visible[pos]) { - - super.update(); - - if ((rippleDelay -= Game.elapsed) <= 0) { - GameScene.ripple(pos + getWidth()).y -= DungeonTilemap.SIZE / 2; - rippleDelay = Random.Float(0.2f, 0.3f); - } - } - } - } - - public static final class WaterParticle extends PixelParticle { - - public WaterParticle() { - super(); - - acc.y = 50; - am = 0.5f; - - color(ColorMath.random(0xb6ccc2, 0x3b6653)); - size(2); - } - - public void reset(float x, float y) { - revive(); - - this.x = x; - this.y = y; - - speed.set(Random.Float(-2, +2), 0); - - left = lifespan = 0.5f; - } - } - -} diff --git a/java/com/hmdzl/spspd/change/levels/CityBossLevel.java b/java/com/hmdzl/spspd/change/levels/CityBossLevel.java deleted file mode 100644 index e652e265..00000000 --- a/java/com/hmdzl/spspd/change/levels/CityBossLevel.java +++ /dev/null @@ -1,282 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.mobs.Bestiary; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.Heap; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.levels.painters.Painter; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.watabou.noosa.Camera; -import com.watabou.noosa.Scene; -import com.watabou.noosa.audio.Sample; -import com.watabou.noosa.tweeners.AlphaTweener; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -public class CityBossLevel extends Level { - - { - color1 = 0x4b6636; - color2 = 0xf2f2f2; - } - - private static final int TOP = 2; - private static final int HALL_WIDTH = 7; - private static final int HALL_HEIGHT = 15; - private static final int CHAMBER_HEIGHT = 3; - - private static final int LEFT = (getWidth() - HALL_WIDTH) / 2; - private static final int CENTER = LEFT + HALL_WIDTH / 2; - - private int arenaDoor; - private int stairs = -1; - private boolean enteredArena = false; - - @Override - public String tilesTex() { - return Assets.TILES_CITY; - } - - @Override - public String waterTex() { - return Assets.WATER_CITY; - } - - private static final String DOOR = "door"; - private static final String ENTERED = "entered"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(DOOR, arenaDoor); - bundle.put(ENTERED, enteredArena); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - arenaDoor = bundle.getInt(DOOR); - enteredArena = bundle.getBoolean(ENTERED); - } - - @Override - protected boolean build() { - - Painter.fill(this, LEFT, TOP, HALL_WIDTH, HALL_HEIGHT, Terrain.EMPTY); - Painter.fill(this, CENTER, TOP, 1, HALL_HEIGHT, Terrain.EMPTY_SP); - - map[(TOP + 1) * getWidth() + CENTER] = Terrain.EMPTY_WELL; - - int y = TOP + 1; - while (y < TOP + HALL_HEIGHT) { - map[y * getWidth() + CENTER - 2] = Terrain.STATUE_SP; - map[y * getWidth() + CENTER + 2] = Terrain.STATUE_SP; - y += 2; - } - - int left = pedestal(true); - int right = pedestal(false); - map[left] = map[right] = Terrain.PEDESTAL; - for (int i = left + 1; i < right; i++) { - map[i] = Terrain.EMPTY_SP; - } - - exit = (TOP - 1) * getWidth() + CENTER; - map[exit] = Terrain.LOCKED_EXIT; - - arenaDoor = (TOP + HALL_HEIGHT) * getWidth() + CENTER; - map[arenaDoor] = Terrain.DOOR; - - Painter.fill(this, LEFT, TOP + HALL_HEIGHT + 1, HALL_WIDTH, - CHAMBER_HEIGHT, Terrain.EMPTY); - Painter.fill(this, LEFT, TOP + HALL_HEIGHT + 1, 1, CHAMBER_HEIGHT, - Terrain.BOOKSHELF); - Painter.fill(this, LEFT + HALL_WIDTH - 1, TOP + HALL_HEIGHT + 1, 1, - CHAMBER_HEIGHT, Terrain.BOOKSHELF); - - entrance = (TOP + HALL_HEIGHT + 2 + Random.Int(CHAMBER_HEIGHT - 1)) - * getWidth() + LEFT + (/* 1 + */Random.Int(HALL_WIDTH - 2)); - map[entrance] = Terrain.ENTRANCE; - - return true; - } - - @Override - protected void decorate() { - - for (int i = 0; i < getLength(); i++) { - if (map[i] == Terrain.EMPTY && Random.Int(10) == 0) { - map[i] = Terrain.EMPTY_DECO; - } else if (map[i] == Terrain.WALL && Random.Int(8) == 0) { - map[i] = Terrain.WALL_DECO; - } - } - - int sign = arenaDoor + getWidth() + 1; - map[sign] = Terrain.SIGN; - } - - public static int pedestal(boolean left) { - if (left) { - return (TOP + HALL_HEIGHT / 2) * getWidth() + CENTER - 2; - } else { - return (TOP + HALL_HEIGHT / 2) * getWidth() + CENTER + 2; - } - } - - @Override - protected void createMobs() { - } - - @Override - public Actor respawner() { - return null; - } - - @Override - protected void createItems() { - - } - - @Override - public int randomRespawnCell() { - return -1; - } - - @Override - public void press(int cell, Char hero) { - - super.press(cell, hero); - - if (!enteredArena && outsideEntraceRoom(cell) && hero == Dungeon.hero) { - - enteredArena = true; - seal(); - - Mob boss = Bestiary.mob(Dungeon.depth); - //Mob tomb = new DwarfKingTomb(); - boss.state = boss.HUNTING; - int count = 0; - do { - boss.pos = Random.Int(getLength()); - //tomb.pos = (TOP + 1) * getWidth() + CENTER; - } while (!passable[boss.pos] - || !outsideEntraceRoom(boss.pos) - || (Dungeon.visible[boss.pos] && count++ < 20)); - GameScene.add(boss); - //GameScene.add(tomb); - - if (Dungeon.visible[boss.pos]) { - boss.notice(); - boss.sprite.alpha(0); - boss.sprite.parent.add(new AlphaTweener(boss.sprite, 1, 0.1f)); - } - - set(arenaDoor, Terrain.WALL); - GameScene.updateMap(arenaDoor); - Dungeon.observe(); - } - } - - public void seal() { - if (entrance != 0) { - - locked = true; - - set(arenaDoor, Terrain.WALL); - GameScene.updateMap(arenaDoor); - Dungeon.observe(); - - CellEmitter.get(arenaDoor).start(Speck.factory(Speck.ROCK), 0.07f, - 10); - Camera.main.shake(3, 0.7f); - Sample.INSTANCE.play(Assets.SND_ROCKS); - - set(entrance, Terrain.WALL_DECO); - GameScene.updateMap(entrance); - GameScene.ripple(entrance); - - } - } - - public void unseal() { - if (stairs != 0) { - locked = false; - CellEmitter.get(arenaDoor).start(Speck.factory(Speck.ROCK), 0.07f, - 10); - set(arenaDoor, Terrain.EMPTY_DECO); - GameScene.updateMap(arenaDoor); - Dungeon.observe(); - set(entrance, Terrain.ENTRANCE); - GameScene.updateMap(entrance); - - } - } - - private boolean outsideEntraceRoom(int cell) { - return cell / getWidth() < arenaDoor / getWidth(); - } - - @Override - public String tileName(int tile) { - switch (tile) { - case Terrain.WATER: - return Messages.get(CityLevel.class, "water_name"); - case Terrain.HIGH_GRASS: - return Messages.get(CityLevel.class, "high_grass_name"); - default: - return super.tileName(tile); - } - } - - @Override - public String tileDesc(int tile) { - switch (tile) { - case Terrain.ENTRANCE: - return Messages.get(CityLevel.class, "entrance_desc"); - case Terrain.EXIT: - return Messages.get(CityLevel.class, "exit_desc"); - case Terrain.WALL_DECO: - case Terrain.EMPTY_DECO: - return Messages.get(CityLevel.class, "deco_desc"); - case Terrain.EMPTY_SP: - return Messages.get(CityLevel.class, "sp_desc"); - case Terrain.STATUE: - case Terrain.STATUE_SP: - return Messages.get(CityLevel.class, "statue_desc"); - case Terrain.BOOKSHELF: - return Messages.get(CityLevel.class, "bookshelf_desc"); - default: - return super.tileDesc(tile); - } - } - - @Override - public void addVisuals(Scene scene) { - CityLevel.addVisuals(this, scene); - } -} diff --git a/java/com/hmdzl/spspd/change/levels/CityLevel.java b/java/com/hmdzl/spspd/change/levels/CityLevel.java deleted file mode 100644 index c19d35d1..00000000 --- a/java/com/hmdzl/spspd/change/levels/CityLevel.java +++ /dev/null @@ -1,251 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.DungeonTilemap; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.hero.HeroClass; -import com.hmdzl.spspd.change.actors.mobs.GoldThief; -import com.hmdzl.spspd.change.actors.mobs.npcs.Imp; -import com.hmdzl.spspd.change.items.bombs.Bomb; -import com.hmdzl.spspd.change.items.bombs.DungeonBomb; -import com.hmdzl.spspd.change.levels.Room.Type; -import com.hmdzl.spspd.change.levels.traps.*; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.noosa.Scene; -import com.watabou.noosa.particles.Emitter; -import com.watabou.noosa.particles.PixelParticle; -import com.watabou.utils.PointF; -import com.watabou.utils.Random; - -public class CityLevel extends RegularLevel { - - { - color1 = 0x4b6636; - color2 = 0xf2f2f2; - } - - @Override - public String tilesTex() { - return Assets.TILES_CITY; - } - - @Override - public String waterTex() { - return Assets.WATER_CITY; - } - - @Override - protected boolean[] water() { - return Patch.generate(feeling == Feeling.WATER ? 0.65f : 0.45f, 4); - } - - @Override - protected boolean[] grass() { - return Patch.generate(feeling == Feeling.GRASS ? 0.60f : 0.40f, 3); - } - - @Override - protected void setPar(){ - Dungeon.pars[Dungeon.depth] = 300+(Dungeon.depth*50)+(secretDoors*20); - } - - @Override - protected Class[] trapClasses() { - return new Class[]{ BlazingTrap.class, FrostTrap.class, SpearTrap.class, VenomTrap.class, ShockTrap.class, - ExplosiveTrap.class, GrippingTrap.class, LightningTrap.class, RockfallTrap.class, OozeTrap.class, WeakeningTrap.class, - CursingTrap.class, FlockTrap.class, GuardianTrap.class, PitfallTrap.class, SummoningTrap.class, TeleportationTrap.class, StormTrap.class, - DisarmingTrap.class, WarpingTrap.class}; - } - - @Override - protected float[] trapChances() { - return new float[]{ 8, 8, 8, 8, 8, - 4, 4, 4, 4, 4, 4, - 2, 2, 2, 2, 2, 2, 2, - 1, 1 }; - } - - @Override - protected boolean assignRoomType() { - super.assignRoomType(); - - for (Room r : rooms) { - if (r.type == Type.TUNNEL) { - r.type = Type.PASSAGE; - } - } - - return true; - } - - @Override - protected void decorate() { - - for (int i = 0; i < getLength(); i++) { - if (map[i] == Terrain.EMPTY && Random.Int(10) == 0) { - map[i] = Terrain.EMPTY_DECO; - } else if (map[i] == Terrain.WALL && Random.Int(8) == 0) { - map[i] = Terrain.WALL_DECO; - } - } - - while (true) { - int pos = roomEntrance.random(); - if (pos != entrance) { - map[pos] = Terrain.SIGN; - break; - } - } - - setPar(); - } - - @Override - protected void createItems() { - if (Dungeon.hero.heroClass==HeroClass.PERFORMER && Random.Int(1) == 0){addItemToSpawn(new DungeonBomb());} - super.createItems(); - - Imp.Quest.spawn(this); - spawnGoldThief(this); - } - - public static void spawnGoldThief(CityLevel level) { - if (Dungeon.depth == 19 && !Dungeon.goldthiefspawned){ - - GoldThief thief = new GoldThief(); - do { - thief.pos = level.randomRespawnCell(); - } while (thief.pos == -1); - level.mobs.add(thief); - Actor.occupyCell(thief); - - Dungeon.goldthiefspawned = true; - } - } - - @Override - public String tileName(int tile) { - switch (tile) { - case Terrain.WATER: - return Messages.get(CityLevel.class, "water_name"); - case Terrain.HIGH_GRASS: - return Messages.get(CityLevel.class, "high_grass_name"); - default: - return super.tileName(tile); - } - } - - @Override - public String tileDesc(int tile) { - switch (tile) { - case Terrain.ENTRANCE: - return Messages.get(CityLevel.class, "entrance_desc"); - case Terrain.EXIT: - return Messages.get(CityLevel.class, "exit_desc"); - case Terrain.WALL_DECO: - case Terrain.EMPTY_DECO: - return Messages.get(CityLevel.class, "deco_desc"); - case Terrain.EMPTY_SP: - return Messages.get(CityLevel.class, "sp_desc"); - case Terrain.STATUE: - case Terrain.STATUE_SP: - return Messages.get(CityLevel.class, "statue_desc"); - case Terrain.BOOKSHELF: - return Messages.get(CityLevel.class, "bookshelf_desc"); - default: - return super.tileDesc(tile); - } - } - - @Override - public void addVisuals(Scene scene) { - super.addVisuals(scene); - addVisuals(this, scene); - } - - public static void addVisuals(Level level, Scene scene) { - for (int i = 0; i < getLength(); i++) { - if (level.map[i] == Terrain.WALL_DECO) { - scene.add(new Smoke(i)); - } - } - } - - private static class Smoke extends Emitter { - - private int pos; - - private static final Emitter.Factory factory = new Factory() { - - @Override - public void emit(Emitter emitter, int index, float x, float y) { - SmokeParticle p = (SmokeParticle) emitter - .recycle(SmokeParticle.class); - p.reset(x, y); - } - }; - - public Smoke(int pos) { - super(); - - this.pos = pos; - - PointF p = DungeonTilemap.tileCenterToWorld(pos); - pos(p.x - 4, p.y - 2, 4, 0); - - pour(factory, 0.2f); - } - - @Override - public void update() { - if (visible = Dungeon.visible[pos]) { - super.update(); - } - } - } - - public static final class SmokeParticle extends PixelParticle { - - public SmokeParticle() { - super(); - - color(0x000000); - speed.set(Random.Float(8), -Random.Float(8)); - } - - public void reset(float x, float y) { - revive(); - - this.x = x; - this.y = y; - - left = lifespan = 2f; - } - - @Override - public void update() { - super.update(); - float p = left / lifespan; - am = p > 0.8f ? 1 - p : p * 0.25f; - size(8 - p * 4); - } - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/levels/CrabBossLevel.java b/java/com/hmdzl/spspd/change/levels/CrabBossLevel.java deleted file mode 100644 index 04c6cdf4..00000000 --- a/java/com/hmdzl/spspd/change/levels/CrabBossLevel.java +++ /dev/null @@ -1,271 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.mobs.CrabKing; -import com.hmdzl.spspd.change.actors.mobs.HermitCrab; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.actors.mobs.Shell; -import com.hmdzl.spspd.change.items.Heap; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.keys.SkeletonKey; -import com.hmdzl.spspd.change.levels.painters.Painter; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.watabou.noosa.Scene; -import com.watabou.noosa.tweeners.AlphaTweener; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -public class CrabBossLevel extends Level { - - { - color1 = 0x4b6636; - color2 = 0xf2f2f2; - cleared=true; - } - - private static final int TOP = 2; - private static final int HALL_WIDTH = 13; - private static final int HALL_HEIGHT = 15; - private static final int CHAMBER_HEIGHT = 3; - - private static final int LEFT = (getWidth() - HALL_WIDTH) / 2; - private static final int CENTER = LEFT + HALL_WIDTH / 2; - - private int arenaDoor; - private boolean enteredArena = false; - private boolean keyDropped = false; - - @Override - public String tilesTex() { - return Assets.TILES_BEACH; - } - - @Override - public String waterTex() { - return Assets.WATER_PRISON; - } - - private static final String DOOR = "door"; - private static final String ENTERED = "entered"; - private static final String DROPPED = "droppped"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(DOOR, arenaDoor); - bundle.put(ENTERED, enteredArena); - bundle.put(DROPPED, keyDropped); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - arenaDoor = bundle.getInt(DOOR); - enteredArena = bundle.getBoolean(ENTERED); - keyDropped = bundle.getBoolean(DROPPED); - } - - @Override - protected boolean build() { - - Painter.fill(this, LEFT, TOP, HALL_WIDTH, HALL_HEIGHT, Terrain.WATER); - Painter.fill(this, CENTER, TOP, 1, HALL_HEIGHT, Terrain.WATER); - - int y = TOP + 1; - while (y < TOP + HALL_HEIGHT) { - map[y * getWidth() + CENTER - 2] = Terrain.STATUE; - map[y * getWidth() + CENTER + 2] = Terrain.STATUE; - y += 2; - } - - exit = (TOP - 1) * getWidth() + CENTER; - map[exit] = Terrain.LOCKED_EXIT; - - arenaDoor = (TOP + HALL_HEIGHT) * getWidth() + CENTER; - map[arenaDoor] = Terrain.DOOR; - - Painter.fill(this, LEFT, TOP + HALL_HEIGHT + 1, HALL_WIDTH, - CHAMBER_HEIGHT, Terrain.EMPTY); - Painter.fill(this, LEFT, TOP + HALL_HEIGHT + 1, 1, CHAMBER_HEIGHT, - Terrain.WATER); - Painter.fill(this, LEFT + HALL_WIDTH - 1, TOP + HALL_HEIGHT + 1, 1, - CHAMBER_HEIGHT, Terrain.WATER); - - entrance = (TOP + HALL_HEIGHT + 2 + Random.Int(CHAMBER_HEIGHT - 1)) - * getWidth() + LEFT + (/* 1 + */Random.Int(HALL_WIDTH - 2)); - map[entrance] = Terrain.PEDESTAL; - - map[exit] = Terrain.WALL; - - return true; - } - - @Override - protected void decorate() { - - for (int i = 0; i < getLength(); i++) { - if (map[i] == Terrain.EMPTY && Random.Int(10) == 0) { - map[i] = Terrain.EMPTY_DECO; - } else if (map[i] == Terrain.WALL && Random.Int(8) == 0) { - map[i] = Terrain.WALL_DECO; - } - } - - //int sign = arenaDoor + WIDTH + 1; - //map[sign] = Terrain.SIGN; - } - - public static int pedestal(boolean left) { - if (left) { - return (TOP + HALL_HEIGHT / 2) * getWidth() + CENTER - 2; - } else { - return (TOP + HALL_HEIGHT / 2) * getWidth() + CENTER + 2; - } - } - - @Override - protected void createMobs() { - } - - @Override - public Actor respawner() { - return null; - } - - @Override - protected void createItems() { - - } - - @Override - public int randomRespawnCell() { - return -1; - } - - @Override - public void press(int cell, Char hero) { - - super.press(cell, hero); - - if (!enteredArena && outsideEntraceRoom(cell) && hero == Dungeon.hero) { - - enteredArena = true; - //locked = true; - - Mob boss = new CrabKing(); - Mob shell = new Shell(); - Mob crab1 = new HermitCrab(); - Mob crab2 = new HermitCrab(); - Mob crab3 = new HermitCrab(); - Mob crab4 = new HermitCrab(); - boss.state = boss.HUNTING; - crab1.state = crab1.HUNTING; - crab2.state = crab2.HUNTING; - crab3.state = crab3.HUNTING; - crab4.state = crab4.HUNTING; - int count = 0; - do { - boss.pos = Random.Int(getLength()); - shell.pos = (TOP + 1) * getWidth() + CENTER; - crab1.pos = (TOP + 1) * getWidth() + CENTER+1; - crab2.pos = (TOP + 1) * getWidth() + CENTER-1; - crab3.pos = (TOP + 2) * getWidth() + CENTER; - crab4.pos = (TOP + 0) * getWidth() + CENTER; - } while (!passable[boss.pos] - || !outsideEntraceRoom(boss.pos) - || (Dungeon.visible[boss.pos] && count++ < 20)); - - GameScene.add(boss); - GameScene.add(shell); - - GameScene.add(crab1); - GameScene.add(crab2); - GameScene.add(crab3); - GameScene.add(crab4); - - if (Dungeon.visible[boss.pos]) { - boss.notice(); - boss.sprite.alpha(0); - boss.sprite.parent.add(new AlphaTweener(boss.sprite, 1, 0.1f)); - } - - //set(arenaDoor, Terrain.WALL); - //GameScene.updateMap(arenaDoor); - Dungeon.observe(); - } - } - - @Override - public Heap drop(Item item, int cell) { - - if (!keyDropped && item instanceof SkeletonKey) { - - keyDropped = true; - locked = false; - - set(arenaDoor, Terrain.DOOR); - GameScene.updateMap(arenaDoor); - Dungeon.observe(); - } - - return super.drop(item, cell); - } - - private boolean outsideEntraceRoom(int cell) { - return cell / getWidth() < arenaDoor / getWidth(); - } - - @Override - public String tileName(int tile) { - switch (tile) { - case Terrain.WATER: - return "Crystal clear pools."; - case Terrain.HIGH_GRASS: - return "Seaweed Tangles"; - default: - return super.tileName(tile); - } - } - - @Override - public String tileDesc(int tile) { - switch (tile) { - case Terrain.EMPTY_DECO: - return "Small crabs and shell fish litter the sandy floor."; - case Terrain.EMPTY_SP: - return "Thick carpet covers the floor."; - case Terrain.STATUE: - case Terrain.STATUE_SP: - return "A large sea shell is propped up in the sand."; - case Terrain.BOOKSHELF: - return "Mostly beach reads."; - default: - return super.tileDesc(tile); - } - } - - @Override - public void addVisuals(Scene scene) { - CityLevel.addVisuals(this, scene); - } -} diff --git a/java/com/hmdzl/spspd/change/levels/DeadEndLevel.java b/java/com/hmdzl/spspd/change/levels/DeadEndLevel.java deleted file mode 100644 index b938068f..00000000 --- a/java/com/hmdzl/spspd/change/levels/DeadEndLevel.java +++ /dev/null @@ -1,139 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels; - -import java.util.Arrays; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.utils.Random; - -public class DeadEndLevel extends Level { - - private static final int SIZE = 5; - - { - color1 = 0x534f3e; - color2 = 0xb9d661; - } - - @Override - public String tilesTex() { - return Assets.TILES_CAVES; - } - - @Override - public String waterTex() { - return Assets.WATER_HALLS; - } - - @Override - protected boolean build() { - - Arrays.fill(map, Terrain.WALL); - - for (int i = 2; i < SIZE; i++) { - for (int j = 2; j < SIZE; j++) { - map[i * getWidth() + j] = Terrain.EMPTY; - } - } - - for (int i = 1; i <= SIZE; i++) { - map[getWidth() + i] = map[getWidth() * SIZE + i] = map[getWidth() * i + 1] = map[getWidth() - * i + SIZE] = Terrain.WATER; - } - - entrance = SIZE * getWidth() + SIZE / 2 + 1; - map[entrance] = Terrain.ENTRANCE; - - map[(SIZE / 2 + 1) * (getWidth() + 1)] = Terrain.SIGN; - - exit = 0; - - return true; - } - - @Override - protected void decorate() { - for (int i = 0; i < getLength(); i++) { - if (map[i] == Terrain.EMPTY && Random.Int(10) == 0) { - map[i] = Terrain.EMPTY_DECO; - } else if (map[i] == Terrain.WALL && Random.Int(8) == 0) { - map[i] = Terrain.WALL_DECO; - } - } - } - - /*@Override - public String tileName(int tile) { - switch (tile) { - case Terrain.WATER: - return "Suspiciously colored water"; - case Terrain.HIGH_GRASS: - return "High blooming flowers"; - default: - return super.tileName(tile); - } - }*/ - - @Override - protected void createMobs() { - } - - @Override - protected void createItems() { - } - - @Override - public String tileName(int tile) { - switch (tile) { - case Terrain.GRASS: - return Messages.get(CavesLevel.class, "grass_name"); - case Terrain.HIGH_GRASS: - return Messages.get(CavesLevel.class, "high_grass_name"); - case Terrain.WATER: - return Messages.get(CavesLevel.class, "water_name"); - default: - return super.tileName(tile); - } - } - - @Override - public String tileDesc(int tile) { - switch (tile) { - case Terrain.ENTRANCE: - return Messages.get(CavesLevel.class, "entrance_desc"); - case Terrain.EXIT: - return Messages.get(CavesLevel.class, "exit_desc"); - case Terrain.HIGH_GRASS: - return Messages.get(CavesLevel.class, "high_grass_desc"); - case Terrain.WALL_DECO: - return Messages.get(CavesLevel.class, "wall_deco_desc"); - case Terrain.BOOKSHELF: - return Messages.get(CavesLevel.class, "bookshelf_desc"); - default: - return super.tileDesc(tile); - } - } - - @Override - public int randomRespawnCell() { - return entrance - getWidth(); - } - -} diff --git a/java/com/hmdzl/spspd/change/levels/DragonCaveLevel.java b/java/com/hmdzl/spspd/change/levels/DragonCaveLevel.java deleted file mode 100644 index 6cc69937..00000000 --- a/java/com/hmdzl/spspd/change/levels/DragonCaveLevel.java +++ /dev/null @@ -1,553 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels; - -import java.util.Collection; -import java.util.HashMap; -import java.util.HashSet; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.Alchemy; -import com.hmdzl.spspd.change.actors.blobs.Blob; -import com.hmdzl.spspd.change.actors.blobs.Fire; -import com.hmdzl.spspd.change.actors.blobs.Foliage; -import com.hmdzl.spspd.change.actors.blobs.Portal; -import com.hmdzl.spspd.change.actors.blobs.WaterOfHealth; -import com.hmdzl.spspd.change.actors.blobs.WaterOfTransmutation; -import com.hmdzl.spspd.change.actors.blobs.WellWater; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.mobs.Bestiary; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.actors.mobs.SokobanSentinel; -import com.hmdzl.spspd.change.actors.mobs.npcs.Blacksmith; -import com.hmdzl.spspd.change.actors.mobs.npcs.Sheep; -import com.hmdzl.spspd.change.actors.mobs.npcs.SheepSokoban; -import com.hmdzl.spspd.change.actors.mobs.npcs.SheepSokobanBlack; -import com.hmdzl.spspd.change.actors.mobs.npcs.SheepSokobanCorner; -import com.hmdzl.spspd.change.actors.mobs.npcs.SheepSokobanSwitch; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.eggs.Egg; -import com.hmdzl.spspd.change.items.Gold; -import com.hmdzl.spspd.change.items.Heap; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.eggs.ShadowDragonEgg; -import com.hmdzl.spspd.change.items.Towel; -import com.hmdzl.spspd.change.items.artifacts.TimekeepersHourglass; -import com.hmdzl.spspd.change.items.keys.IronKey; -import com.hmdzl.spspd.change.items.misc.Spectacles; -import com.hmdzl.spspd.change.items.potions.PotionOfLiquidFlame; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfMagicalInfusion; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfRegrowth; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfUpgrade; -import com.hmdzl.spspd.change.items.wands.WandOfFlock; -import com.hmdzl.spspd.change.levels.features.Chasm; -import com.hmdzl.spspd.change.levels.features.Door; -import com.hmdzl.spspd.change.levels.features.HighGrass; -import com.hmdzl.spspd.change.levels.traps.ActivatePortalTrap; -import com.hmdzl.spspd.change.levels.traps.AlarmTrap; -import com.hmdzl.spspd.change.levels.traps.ChangeSheepTrap; -import com.hmdzl.spspd.change.levels.traps.FireTrap; -import com.hmdzl.spspd.change.levels.traps.FleecingTrap; -import com.hmdzl.spspd.change.levels.traps.GrippingTrap; -import com.hmdzl.spspd.change.levels.traps.HeapGenTrap; -import com.hmdzl.spspd.change.levels.traps.LightningTrap; -import com.hmdzl.spspd.change.levels.traps.ParalyticTrap; -import com.hmdzl.spspd.change.levels.traps.PoisonTrap; -import com.hmdzl.spspd.change.levels.traps.SokobanPortalTrap; -import com.hmdzl.spspd.change.levels.traps.SummoningTrap; -import com.hmdzl.spspd.change.levels.traps.ToxicTrap; -import com.hmdzl.spspd.change.plants.Dewcatcher; -import com.hmdzl.spspd.change.plants.Flytrap; -import com.hmdzl.spspd.change.plants.Phaseshift; -import com.hmdzl.spspd.change.plants.Plant; -import com.hmdzl.spspd.change.plants.Starflower; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundlable; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; -import com.watabou.utils.SparseArray; - -public class DragonCaveLevel extends Level { - - - { - color1 = 0x534f3e; - color2 = 0xb9d661; - WIDTH = 48; - HEIGHT = 48; - LENGTH = HEIGHT*WIDTH; - cleared=true; - } - - - public HashSet heapstogen; - public int[] heapgenspots; - public int[] teleportspots; - public int[] portswitchspots; - public int[] teleportassign; - public int[] destinationspots; - public int[] destinationassign; - public int prizeNo; - - private static final String HEAPSTOGEN = "heapstogen"; - private static final String HEAPGENSPOTS = "heapgenspots"; - private static final String TELEPORTSPOTS = "teleportspots"; - private static final String PORTSWITCHSPOTS = "portswitchspots"; - private static final String DESTINATIONSPOTS = "destinationspots"; - private static final String TELEPORTASSIGN = "teleportassign"; - private static final String DESTINATIONASSIGN= "destinationassign"; - private static final String PRIZENO = "prizeNo"; - - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(HEAPSTOGEN, heapstogen); - bundle.put(HEAPGENSPOTS, heapgenspots); - bundle.put(TELEPORTSPOTS, teleportspots); - bundle.put(PORTSWITCHSPOTS, portswitchspots); - bundle.put(DESTINATIONSPOTS, destinationspots); - bundle.put(DESTINATIONASSIGN, destinationassign); - bundle.put(TELEPORTASSIGN, teleportassign); - bundle.put(PRIZENO, prizeNo); - } - - - - @Override - public void restoreFromBundle(Bundle bundle) { - - super.restoreFromBundle(bundle); - - heapgenspots = bundle.getIntArray(HEAPGENSPOTS); - teleportspots = bundle.getIntArray(TELEPORTSPOTS); - portswitchspots = bundle.getIntArray(PORTSWITCHSPOTS); - destinationspots = bundle.getIntArray(DESTINATIONSPOTS); - destinationassign = bundle.getIntArray(DESTINATIONASSIGN); - teleportassign = bundle.getIntArray(TELEPORTASSIGN); - prizeNo = bundle.getInt(PRIZENO); - - heapstogen = new HashSet(); - - Collection collectionheap = bundle.getCollection(HEAPSTOGEN); - for (Bundlable i : collectionheap) { - Item item = (Item) i; - if (item != null) { - heapstogen.add(item); - } - } - } - - @Override - public void create() { - heapstogen = new HashSet(); - heapgenspots = new int[10]; - teleportspots = new int[10]; - portswitchspots = new int[10]; - destinationspots = new int[10]; - destinationassign = new int[10]; - teleportassign = new int[10]; - super.create(); - } - - public void addItemToGen(Item item, int arraypos, int pos) { - if (item != null) { - heapstogen.add(item); - heapgenspots[arraypos]=pos; - } - } - - - public Item genPrizeItem() { - return genPrizeItem(null); - } - - - public Item genPrizeItem(Class match) { - - boolean keysLeft = false; - - if (heapstogen.size() == 0) - return null; - - for (Item item : heapstogen) { - if (match.isInstance(item)) { - heapstogen.remove(item); - keysLeft=true; - return item; - } - } - - if (match == null || !keysLeft) { - Item item = Random.element(heapstogen); - heapstogen.remove(item); - return item; - } - - return null; - } - - @Override - public void press(int cell, Char ch) { - - if (pit[cell] && ch == Dungeon.hero) { - Chasm.heroFall(cell); - return; - } - - TimekeepersHourglass.timeFreeze timeFreeze = null; - - if (ch != null) - timeFreeze = ch.buff(TimekeepersHourglass.timeFreeze.class); - - boolean trap = false; - boolean interrupt = false; - - switch (map[cell]) { - - case Terrain.FLEECING_TRAP: - - if (ch==null){ - interrupt=true; - } - - if (ch != null && ch==Dungeon.hero){ - trap = true; - FleecingTrap.trigger(cell, ch); - } - break; - - case Terrain.CHANGE_SHEEP_TRAP: - - if (ch instanceof SheepSokoban || ch instanceof SheepSokobanSwitch || ch instanceof SheepSokobanCorner || ch instanceof Sheep || ch instanceof WandOfFlock.MagicSheep){ - trap = true; - ChangeSheepTrap.trigger(cell, ch); - } - break; - - case Terrain.WOOL_RUG: - - break; - - case Terrain.SOKOBAN_PORT_SWITCH: - trap=false; - if (ch!=null){ - ActivatePortalTrap.trigger(cell, ch); - - - int arraypos = -1; //position in array of teleport switch - int portpos = -1; //position on map of teleporter - int portarraypos = -1; //position in array of teleporter - int destpos = -1; //destination position assigned to switch - - for(int i = 0; i < portswitchspots.length; i++) { - if(portswitchspots[i] == cell) { - arraypos = i; - break; - } - } - - portpos = teleportassign[arraypos]; - destpos = destinationassign[arraypos]; - - /* Stepping on switch deactivates the portal */ - destpos = -1; - - for(int i = 0; i < teleportspots.length; i++) { - if(teleportspots[i] == portpos) { - portarraypos = i; - break; - } - } - - if (map[portpos] == Terrain.PORT_WELL){ - destinationspots[portarraypos]=destpos; - } - - - } - break; - - - case Terrain.PORT_WELL: - - if (ch != null && ch==Dungeon.hero){ - - int portarray=-1; - int destinationspot=cell; - - for(int i = 0; i < teleportspots.length; i++) { - if(teleportspots[i] == cell) { - portarray = i; - break; - } - } - - if(portarray != -1) { - destinationspot=destinationspots[portarray]; - if (destinationspot>0){ - SokobanPortalTrap.trigger(cell, ch, destinationspot); - } - } - } - break; - - case Terrain.HIGH_GRASS: - HighGrass.trample(this, cell, ch); - break; - - case Terrain.WELL: - WellWater.affectCell(cell); - break; - - /*case Terrain.ALCHEMY: - if (ch == null) { - Alchemy.transmute(cell); - } - break;*/ - - case Terrain.DOOR: - Door.enter(cell); - break; - } - - if (trap){ - - if (Dungeon.visible[cell]) - Sample.INSTANCE.play(Assets.SND_TRAP); - - if (ch == Dungeon.hero) - Dungeon.hero.interrupt(); - - set(cell, Terrain.INACTIVE_TRAP); - GameScene.updateMap(cell); - } - - if (interrupt){ - - Dungeon.hero.interrupt(); - GameScene.updateMap(cell); - } - - Plant plant = plants.get(cell); - if (plant != null) { - plant.activate(ch); - } - } - - - - @Override - public void mobPress(Mob mob) { - - int cell = mob.pos; - - if (pit[cell] && !mob.flying) { - Chasm.mobFall(mob); - return; - } - - - } - - @Override - public String tileName(int tile) { - switch (tile) { - case Terrain.WOOL_RUG: - return "Wool rug"; - case Terrain.FLEECING_TRAP: - return "Fleecing trap"; - case Terrain.CHANGE_SHEEP_TRAP: - return "Change sheep trap"; - case Terrain.SOKOBAN_ITEM_REVEAL: - return "Item creation switch"; - case Terrain.SOKOBAN_SHEEP: - return "Floor"; - case Terrain.SWITCH_SOKOBAN_SHEEP: - return "Floor"; - case Terrain.CORNER_SOKOBAN_SHEEP: - return "Floor"; - case Terrain.BLACK_SOKOBAN_SHEEP: - return "Floor"; - case Terrain.SOKOBAN_PORT_SWITCH: - return "Portal switch"; - case Terrain.PORT_WELL: - return "Portal"; - case Terrain.WATER: - return "Dark cold water."; - default: - return super.tileName(tile); - } - } - - - @Override - public String tileDesc(int tile) { - switch (tile) { - case Terrain.SOKOBAN_SHEEP: - return ""; - case Terrain.SWITCH_SOKOBAN_SHEEP: - return ""; - case Terrain.CORNER_SOKOBAN_SHEEP: - return ""; - case Terrain.BLACK_SOKOBAN_SHEEP: - return ""; - case Terrain.FLEECING_TRAP: - return "Stepping onto a fleecing trap will destroy your armor or eject you from the level."; - case Terrain.CHANGE_SHEEP_TRAP: - return "This trap will change the form of any sheep."; - case Terrain.SOKOBAN_ITEM_REVEAL: - return "This switch creates an item somewhere on the level."; - case Terrain.SOKOBAN_PORT_SWITCH: - return "This switch turns on and off a portal somewhere."; - case Terrain.PORT_WELL: - return "This is a portal to another location on this level."; - case Terrain.WOOL_RUG: - return "A plush wool rug. Very nice!"; - case Terrain.EMPTY_DECO: - return "There are old blood stains on the floor."; - case Terrain.BOOKSHELF: - return "This is probably a vestige of a prison library. Might it burn?"; - default: - return super.tileDesc(tile); - } - } - - - @Override - public String tilesTex() { - return Assets.TILES_PUZZLE; - } - - @Override - public String waterTex() { - return Assets.WATER_PRISON; - } - - @Override - protected boolean build() { - - map = SokobanLayouts2.DRAGON_CAVE.clone(); - decorate(); - - buildFlagMaps(); - cleanWalls(); - createSwitches(); - createSheep(); - - entrance = 5 + WIDTH * 37; - exit = 0; - - - return true; - } - @Override - protected void decorate() { - /* - for (int i = 0; i < getLength(); i++) { - - } - */ - } - - @Override - protected void createMobs() { - /* - SokobanSentinel mob = new SokobanSentinel(); - mob.pos = 38 + WIDTH * 21; - mobs.add(mob); - Actor.occupyCell(mob); - - SokobanSentinel mob2 = new SokobanSentinel(); - mob2.pos = 25 + WIDTH * 36; - mobs.add(mob2); - Actor.occupyCell(mob2); - */ - } - - - - protected void createSheep() { - for (int i = 0; i < LENGTH; i++) { - if (map[i]==Terrain.SOKOBAN_SHEEP){SheepSokoban npc = new SheepSokoban(); mobs.add(npc); npc.pos = i; Actor.occupyCell(npc);} - else if (map[i]==Terrain.CORNER_SOKOBAN_SHEEP){SheepSokobanCorner npc = new SheepSokobanCorner(); mobs.add(npc); npc.pos = i; Actor.occupyCell(npc);} - else if (map[i]==Terrain.SWITCH_SOKOBAN_SHEEP){SheepSokobanSwitch npc = new SheepSokobanSwitch(); mobs.add(npc); npc.pos = i; Actor.occupyCell(npc);} - else if (map[i]==Terrain.BLACK_SOKOBAN_SHEEP){SheepSokobanBlack npc = new SheepSokobanBlack(); mobs.add(npc); npc.pos = i; Actor.occupyCell(npc);} - else if (map[i]==Terrain.PORT_WELL){ - - /* - Portal portal = new Portal(); - portal.seed(i, 1); - blobs.put(Portal.class, portal); - */ - } - - } - } - - - protected void createSwitches(){ - - //spots where your portals are - - - //spots where your portal switches are - - - //assign each switch to a portal - - - //assign each switch to a destination spot - - - //set the original destination of portals - - } - - - @Override - protected void createItems() { - int goldmin=1; int goldmax=100; - if (first){ - goldmin=400; goldmax=800; - } - for (int i = 0; i < LENGTH; i++) { - if (map[i]==Terrain.SOKOBAN_HEAP){ - if (first && Random.Int(5)==0){drop(new ScrollOfUpgrade(), i).type = Heap.Type.SKELETON;} - else {drop(new Gold(Random.Int(goldmin, goldmax)), i).type = Heap.Type.SKELETON;} - } - } - if (first){ - drop(new ShadowDragonEgg(), 43 + WIDTH * 35); - } - } - - @Override - public int randomRespawnCell() { - return -1; - } - - - -} diff --git a/java/com/hmdzl/spspd/change/levels/FieldBossLevel.java b/java/com/hmdzl/spspd/change/levels/FieldBossLevel.java deleted file mode 100644 index cf44b5e1..00000000 --- a/java/com/hmdzl/spspd/change/levels/FieldBossLevel.java +++ /dev/null @@ -1,262 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.actors.mobs.GnollKing; -import com.hmdzl.spspd.change.items.Heap; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.keys.SkeletonKey; -import com.hmdzl.spspd.change.items.potions.PotionOfLiquidFlame; -import com.hmdzl.spspd.change.levels.painters.Painter; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.watabou.noosa.Scene; -import com.watabou.noosa.tweeners.AlphaTweener; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -public class FieldBossLevel extends Level { - - { - color1 = 0x48763c; - color2 = 0x59994a; - cleared=true; - viewDistance = 8; - } - - private static final int TOP = 2; - private static final int HALL_WIDTH = 13; - private static final int HALL_HEIGHT = 15; - private static final int CHAMBER_HEIGHT = 3; - - private static final int LEFT = (getWidth() - HALL_WIDTH) / 2; - private static final int CENTER = LEFT + HALL_WIDTH / 2; - - private int arenaDoor; - private boolean enteredArena = false; - private boolean keyDropped = false; - - @Override - public String tilesTex() { - return Assets.TILES_FOREST; - } - - @Override - public String waterTex() { - return Assets.WATER_SEWERS; - } - - private static final String DOOR = "door"; - private static final String ENTERED = "entered"; - private static final String DROPPED = "droppped"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(DOOR, arenaDoor); - bundle.put(ENTERED, enteredArena); - bundle.put(DROPPED, keyDropped); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - arenaDoor = bundle.getInt(DOOR); - enteredArena = bundle.getBoolean(ENTERED); - keyDropped = bundle.getBoolean(DROPPED); - } - - @Override - protected boolean build() { - - Painter.fill(this, LEFT, TOP, HALL_WIDTH, HALL_HEIGHT, Terrain.EMPTY); - Painter.fill(this, CENTER, TOP, 1, HALL_HEIGHT, Terrain.EMPTY); - - int y = TOP + 1; - while (y < TOP + HALL_HEIGHT) { - map[y * getWidth() + CENTER - 2] = Terrain.WALL; - map[y * getWidth() + CENTER + 2] = Terrain.WALL; - y += 2; - } - - exit = (TOP - 1) * getWidth() + CENTER; - map[exit] = Terrain.LOCKED_EXIT; - - arenaDoor = (TOP + HALL_HEIGHT) * getWidth() + CENTER; - map[arenaDoor] = Terrain.DOOR; - - Painter.fill(this, LEFT, TOP + HALL_HEIGHT + 1, HALL_WIDTH, - CHAMBER_HEIGHT, Terrain.EMPTY); - Painter.fill(this, LEFT, TOP + HALL_HEIGHT + 1, 1, CHAMBER_HEIGHT, - Terrain.WATER); - Painter.fill(this, LEFT + HALL_WIDTH - 1, TOP + HALL_HEIGHT + 1, 1, - CHAMBER_HEIGHT, Terrain.WATER); - - entrance = (TOP + HALL_HEIGHT + 2 + Random.Int(CHAMBER_HEIGHT - 1)) - * getWidth() + LEFT + (/* 1 + */Random.Int(HALL_WIDTH - 2)); - map[entrance] = Terrain.PEDESTAL; - - map[exit] = Terrain.WALL; - - return true; - } - - @Override - protected void decorate() { - - for (int i = 0; i < getLength(); i++) { - if (map[i] == Terrain.EMPTY && Random.Int(10) == 0) { - map[i] = Terrain.EMPTY_DECO; - } else if (map[i] == Terrain.WALL && Random.Int(8) == 0) { - map[i] = Terrain.WALL_DECO; - } - } - - int shrub1 = arenaDoor + getWidth(); - int shrub2 = arenaDoor + getWidth() + 1; - int shrub3 = arenaDoor + getWidth() - 1; - int potionpos = arenaDoor + 2*getWidth(); - map[shrub1] = Terrain.HIGH_GRASS; - map[shrub2] = Terrain.HIGH_GRASS; - map[shrub3] = Terrain.HIGH_GRASS; - drop(new PotionOfLiquidFlame(), potionpos); - - for (int i = 0; i < getLength(); i++) { - if (map[i] == Terrain.WALL && Random.Int(8) == 0) { - map[i] = Terrain.WALL_DECO; - } - if (map[i]==Terrain.ENTRANCE){map[i] = Terrain.EMPTY;} - if (map[i]==Terrain.EMPTY && heaps.get(i) == null && Random.Float()<.20){map[i] = Terrain.HIGH_GRASS;} - if (map[i]==Terrain.EMPTY && heaps.get(i) == null && Random.Float()<.25){map[i] = Terrain.GRASS;} - if (map[i]==Terrain.EMPTY && heaps.get(i) == null && Random.Float()<.30){map[i] = Terrain.SHRUB;} - } - - //int sign = arenaDoor + WIDTH + 1; - //map[sign] = Terrain.SIGN; - } - - public static int pedestal(boolean left) { - if (left) { - return (TOP + HALL_HEIGHT / 2) * getWidth() + CENTER - 2; - } else { - return (TOP + HALL_HEIGHT / 2) * getWidth() + CENTER + 2; - } - } - - @Override - protected void createMobs() { - } - - @Override - public Actor respawner() { - return null; - } - - @Override - protected void createItems() { - - } - - @Override - public int randomRespawnCell() { - return -1; - } - - @Override - public void press(int cell, Char hero) { - - super.press(cell, hero); - - if (!enteredArena && outsideEntraceRoom(cell) && hero == Dungeon.hero) { - - enteredArena = true; - //locked = true; - - Mob boss = new GnollKing(); - boss.state = boss.HUNTING; - int count = 0; - do { - boss.pos = Random.Int(getLength()); - } while (!passable[boss.pos] - || !outsideEntraceRoom(boss.pos) - || (Dungeon.visible[boss.pos] && count++ < 20)); - - GameScene.add(boss); - - if (Dungeon.visible[boss.pos]) { - boss.notice(); - boss.sprite.alpha(0); - boss.sprite.parent.add(new AlphaTweener(boss.sprite, 1, 0.1f)); - } - - //set(arenaDoor, Terrain.WALL); - //GameScene.updateMap(arenaDoor); - Dungeon.observe(); - } - } - - @Override - public Heap drop(Item item, int cell) { - - if (!keyDropped && item instanceof SkeletonKey) { - - keyDropped = true; - locked = false; - - set(arenaDoor, Terrain.DOOR); - GameScene.updateMap(arenaDoor); - Dungeon.observe(); - } - - return super.drop(item, cell); - } - - private boolean outsideEntraceRoom(int cell) { - return cell / getWidth() < arenaDoor / getWidth(); - } - - public String tileName(int tile) { - switch (tile) { - case Terrain.WATER: - return "Murky water"; - default: - return super.tileName(tile); - } - } - - @Override - public String tileDesc(int tile) { - switch (tile) { - case Terrain.EMPTY_DECO: - return "The grass is worn away to reveal bedrock. "; - case Terrain.BOOKSHELF: - return "The bookshelf is packed with cheap useless books. Might it burn?"; - default: - return super.tileDesc(tile); - } - } - - @Override - public void addVisuals(Scene scene) { - CavesLevel.addVisuals(this, scene); - } -} diff --git a/java/com/hmdzl/spspd/change/levels/FieldLevel.java b/java/com/hmdzl/spspd/change/levels/FieldLevel.java deleted file mode 100644 index 9de65cd7..00000000 --- a/java/com/hmdzl/spspd/change/levels/FieldLevel.java +++ /dev/null @@ -1,234 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.Statistics; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.mobs.Bestiary; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.levels.painters.Painter; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.watabou.noosa.Scene; -import com.watabou.utils.Random; - -public class FieldLevel extends Level { - - { - color1 = 0x48763c; - color2 = 0x59994a; - cleared=true; - - viewDistance = 6; - } - - - - private static final int ROOM_LEFT = getWidth() / 2 - 2; - private static final int ROOM_RIGHT = getWidth() / 2 + 2; - private static final int ROOM_TOP = HEIGHT / 2 - 2; - private static final int ROOM_BOTTOM = HEIGHT / 2 + 2; - - @Override - public String tilesTex() { - return Assets.TILES_FOREST; - } - - @Override - public String waterTex() { - return Assets.WATER_SEWERS; - } - - protected static final float TIME_TO_RESPAWN = 20; - protected static final int REGROW_TIMER = 4; - - @Override - protected boolean build() { - - int topMost = Integer.MAX_VALUE; - - for (int i = 0; i < 8; i++) { - int left, right, top, bottom; - if (Random.Int(2) == 0) { - left = Random.Int(1, ROOM_LEFT - 3); - right = ROOM_RIGHT + 3; - } else { - left = ROOM_LEFT - 3; - right = Random.Int(ROOM_RIGHT + 3, getWidth() - 1); - } - if (Random.Int(2) == 0) { - top = Random.Int(2, ROOM_TOP - 3); - bottom = ROOM_BOTTOM + 3; - } else { - top = ROOM_LEFT - 3; - bottom = Random.Int(ROOM_TOP + 3, HEIGHT - 1); - } - - Painter.fill(this, left, top, right - left + 1, bottom - top + 1, - Terrain.EMPTY); - - if (top < topMost) { - topMost = top; - exit = Random.Int(left, right) + (top - 1) * getWidth(); - } - } - - map[exit] = Terrain.WALL; - - - - Painter.fill(this, ROOM_LEFT, ROOM_TOP + 1, ROOM_RIGHT - ROOM_LEFT + 1, - ROOM_BOTTOM - ROOM_TOP, Terrain.EMPTY); - - - entrance = Random.Int(ROOM_LEFT + 1, ROOM_RIGHT - 1) - + Random.Int(ROOM_TOP + 1, ROOM_BOTTOM - 1) * getWidth(); - map[entrance] = Terrain.EMPTY; - - return true; - } - - @Override - protected void decorate() { - - for (int i = getWidth() + 1; i < getLength() - getWidth(); i++) { - if (map[i] == Terrain.EMPTY) { - int n = 0; - if (map[i + 1] == Terrain.WALL) { - n++; - } - if (map[i - 1] == Terrain.WALL) { - n++; - } - if (map[i + getWidth()] == Terrain.WALL) { - n++; - } - if (map[i - getWidth()] == Terrain.WALL) { - n++; - } - if (Random.Int(8) <= n) { - map[i] = Terrain.EMPTY_DECO; - } - } - } - - for (int i = 0; i < getLength(); i++) { - if (map[i] == Terrain.WALL && Random.Int(8) == 0) { - map[i] = Terrain.WALL_DECO; - } - if (map[i]==Terrain.ENTRANCE){map[i] = Terrain.EMPTY;} - if (map[i]==Terrain.EMPTY && heaps.get(i) == null && Random.Float()<.20){map[i] = Terrain.HIGH_GRASS;} - if (map[i]==Terrain.EMPTY && heaps.get(i) == null && Random.Float()<.25){map[i] = Terrain.GRASS;} - if (map[i]==Terrain.EMPTY && heaps.get(i) == null && Random.Float()<.30){map[i] = Terrain.SHRUB;} - } - - } - - //@Override - //protected void createMobs() { - //} - - //@Override - //public Actor respawner() { - // return null; - //} - - @Override - protected void createItems() {} - - - - - //@Override - //public int randomRespawnCell() { - // return -1; - //} - - - - - @Override - public String tileName(int tile) { - switch (tile) { - case Terrain.WATER: - return "Murky water"; - default: - return super.tileName(tile); - } - } - - @Override - public String tileDesc(int tile) { - switch (tile) { - case Terrain.EMPTY_DECO: - return "The grass is worn away to reveal bedrock."; - case Terrain.BOOKSHELF: - return "The bookshelf is packed with cheap useless books. Might it burn?"; - default: - return super.tileDesc(tile); - } - } - - - @Override - public void addVisuals(Scene scene) { - CavesLevel.addVisuals(this, scene); - } - @Override - public int nMobs() { - return 10; - } - - @Override - protected void createMobs() { - int nMobs = nMobs(); - for (int i = 0; i < nMobs; i++) { - Mob mob = Bestiary.mob(Dungeon.depth); - do { - mob.pos = randomRespawnCellMob(); - } while (mob.pos == -1); - mobs.add(mob); - Actor.occupyCell(mob); - } - } - - @Override - public Actor respawner() { - return new Actor() { - @Override - protected boolean act() { - if (mobs.size() < nMobs()) { - - Mob mob = Bestiary.mutable(Dungeon.depth); - mob.state = mob.WANDERING; - mob.pos = randomRespawnCellMob(); - if (Dungeon.hero.isAlive() && mob.pos != -1) { - GameScene.add(mob); - } - } - spend(Dungeon.level.feeling == Feeling.DARK - || Statistics.amuletObtained ? TIME_TO_RESPAWN / 2 - : TIME_TO_RESPAWN); - return true; - } - }; - } - - -} diff --git a/java/com/hmdzl/spspd/change/levels/FishingBossLevel.java b/java/com/hmdzl/spspd/change/levels/FishingBossLevel.java deleted file mode 100644 index a722cade..00000000 --- a/java/com/hmdzl/spspd/change/levels/FishingBossLevel.java +++ /dev/null @@ -1,272 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.mobs.CrabKing; -import com.hmdzl.spspd.change.actors.mobs.HermitCrab; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.actors.mobs.Shell; -import com.hmdzl.spspd.change.items.Heap; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.keys.SkeletonKey; -import com.hmdzl.spspd.change.levels.painters.Painter; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.watabou.noosa.Scene; -import com.watabou.noosa.tweeners.AlphaTweener; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -public class FishingBossLevel extends Level { - - { - color1 = 0x4b6636; - color2 = 0xf2f2f2; - cleared=true; - } - - private static final int TOP = 2; - private static final int HALL_WIDTH = 13; - private static final int HALL_HEIGHT = 15; - private static final int CHAMBER_HEIGHT = 3; - - private static final int LEFT = (getWidth() - HALL_WIDTH) / 2; - private static final int CENTER = LEFT + HALL_WIDTH / 2; - - private int arenaDoor; - private boolean enteredArena = false; - private boolean keyDropped = false; - - @Override - public String tilesTex() { - return Assets.TILES_PRISON; - } - - @Override - public String waterTex() { - return Assets.WATER_PRISON; - } - - private static final String DOOR = "door"; - private static final String ENTERED = "entered"; - private static final String DROPPED = "droppped"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(DOOR, arenaDoor); - bundle.put(ENTERED, enteredArena); - bundle.put(DROPPED, keyDropped); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - arenaDoor = bundle.getInt(DOOR); - enteredArena = bundle.getBoolean(ENTERED); - keyDropped = bundle.getBoolean(DROPPED); - } - - @Override - protected boolean build() { - - Painter.fill(this, LEFT, TOP, HALL_WIDTH, HALL_HEIGHT, Terrain.EMPTY); - Painter.fill(this, CENTER, TOP, 1, HALL_HEIGHT, Terrain.EMPTY); - - int y = TOP + 1; - while (y < TOP + HALL_HEIGHT) { - map[y * getWidth() + CENTER - 2] = Terrain.STATUE_SP; - map[y * getWidth() + CENTER + 2] = Terrain.STATUE_SP; - y += 2; - } - - exit = (TOP - 1) * getWidth() + CENTER; - map[exit] = Terrain.LOCKED_EXIT; - - arenaDoor = (TOP + HALL_HEIGHT) * getWidth() + CENTER; - map[arenaDoor] = Terrain.DOOR; - - Painter.fill(this, LEFT, TOP + HALL_HEIGHT + 1, HALL_WIDTH, - CHAMBER_HEIGHT, Terrain.EMPTY); - Painter.fill(this, LEFT, TOP + HALL_HEIGHT + 1, 1, CHAMBER_HEIGHT, - Terrain.WATER); - Painter.fill(this, LEFT + HALL_WIDTH - 1, TOP + HALL_HEIGHT + 1, 1, - CHAMBER_HEIGHT, Terrain.WATER); - - entrance = (TOP + HALL_HEIGHT + 2 + Random.Int(CHAMBER_HEIGHT - 1)) - * getWidth() + LEFT + (/* 1 + */Random.Int(HALL_WIDTH - 2)); - map[entrance] = Terrain.PEDESTAL; - - map[exit] = Terrain.WALL; - - return true; - } - - @Override - protected void decorate() { - - for (int i = 0; i < getLength(); i++) { - if (map[i] == Terrain.EMPTY && Random.Int(10) == 0) { - map[i] = Terrain.EMPTY_DECO; - } else if (map[i] == Terrain.WALL && Random.Int(8) == 0) { - map[i] = Terrain.WALL_DECO; - } - } - - //int sign = arenaDoor + WIDTH + 1; - //map[sign] = Terrain.SIGN; - } - - public static int pedestal(boolean left) { - if (left) { - return (TOP + HALL_HEIGHT / 2) * getWidth() + CENTER - 2; - } else { - return (TOP + HALL_HEIGHT / 2) * getWidth() + CENTER + 2; - } - } - - @Override - protected void createMobs() { - } - - @Override - public Actor respawner() { - return null; - } - - @Override - protected void createItems() { - - } - - @Override - public int randomRespawnCell() { - return -1; - } - - @Override - public void press(int cell, Char hero) { - - super.press(cell, hero); - - if (!enteredArena && outsideEntraceRoom(cell) && hero == Dungeon.hero) { - - enteredArena = true; - //locked = true; - - Mob boss = new CrabKing(); - Mob shell = new Shell(); - Mob crab1 = new HermitCrab(); - Mob crab2 = new HermitCrab(); - Mob crab3 = new HermitCrab(); - Mob crab4 = new HermitCrab(); - boss.state = boss.HUNTING; - int count = 0; - do { - boss.pos = Random.Int(getLength()); - shell.pos = (TOP + 1) * getWidth() + CENTER; - crab1.pos = (TOP + 1) * getWidth() + CENTER+1; - crab2.pos = (TOP + 1) * getWidth() + CENTER-1; - crab3.pos = (TOP + 2) * getWidth() + CENTER; - crab4.pos = (TOP + 0) * getWidth() + CENTER; - } while (!passable[boss.pos] - || !outsideEntraceRoom(boss.pos) - || (Dungeon.visible[boss.pos] && count++ < 20)); - - GameScene.add(boss); - GameScene.add(shell); - - GameScene.add(crab1); - GameScene.add(crab2); - GameScene.add(crab3); - GameScene.add(crab4); - - if (Dungeon.visible[boss.pos]) { - boss.notice(); - boss.sprite.alpha(0); - boss.sprite.parent.add(new AlphaTweener(boss.sprite, 1, 0.1f)); - } - - set(arenaDoor, Terrain.WALL); - GameScene.updateMap(arenaDoor); - Dungeon.observe(); - } - } - - @Override - public Heap drop(Item item, int cell) { - - if (!keyDropped && item instanceof SkeletonKey) { - - keyDropped = true; - locked = false; - - set(arenaDoor, Terrain.DOOR); - GameScene.updateMap(arenaDoor); - Dungeon.observe(); - } - - return super.drop(item, cell); - } - - private boolean outsideEntraceRoom(int cell) { - return cell / getWidth() < arenaDoor / getWidth(); - } - - @Override - public String tileName(int tile) { - switch (tile) { - case Terrain.WATER: - return "Suspiciously colored water"; - case Terrain.HIGH_GRASS: - return "High blooming flowers"; - default: - return super.tileName(tile); - } - } - - @Override - public String tileDesc(int tile) { - switch (tile) { - case Terrain.ENTRANCE: - return "A ramp leads up to the upper depth."; - case Terrain.EXIT: - return "A ramp leads down to the lower depth."; - case Terrain.WALL_DECO: - case Terrain.EMPTY_DECO: - return "Several tiles are missing here."; - case Terrain.EMPTY_SP: - return "Thick carpet covers the floor."; - case Terrain.STATUE: - case Terrain.STATUE_SP: - return "The statue depicts some dwarf standing in a heroic stance."; - case Terrain.BOOKSHELF: - return "The rows of books on different disciplines fill the bookshelf."; - default: - return super.tileDesc(tile); - } - } - - @Override - public void addVisuals(Scene scene) { - CityLevel.addVisuals(this, scene); - } -} diff --git a/java/com/hmdzl/spspd/change/levels/FishingLevel.java b/java/com/hmdzl/spspd/change/levels/FishingLevel.java deleted file mode 100644 index 2babfbf9..00000000 --- a/java/com/hmdzl/spspd/change/levels/FishingLevel.java +++ /dev/null @@ -1,262 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.Statistics; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.mobs.Bestiary; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.items.bombs.FishingBomb; -import com.hmdzl.spspd.change.items.Heap; -import com.hmdzl.spspd.change.items.potions.PotionOfLevitation; -import com.hmdzl.spspd.change.levels.painters.Painter; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.watabou.noosa.Scene; -import com.watabou.utils.Random; - -public class FishingLevel extends Level { - - { - color1 = 0x534f3e; - color2 = 0xb9d661; - cleared=true; - - viewDistance = 8; - } - - private static final int ROOM_LEFT = getWidth() / 2 - 2; - private static final int ROOM_RIGHT = getWidth() / 2 + 2; - private static final int ROOM_TOP = HEIGHT / 2 - 2; - private static final int ROOM_BOTTOM = HEIGHT / 2 + 2; - - @Override - public String tilesTex() { - return Assets.TILES_BEACH; - } - - @Override - public String waterTex() { - return Assets.WATER_PRISON; - } - - - - @Override - protected boolean build() { - - int topMost = Integer.MAX_VALUE; - - for (int i = 0; i < 8; i++) { - int left, right, top, bottom; - if (Random.Int(2) == 0) { - left = Random.Int(1, ROOM_LEFT - 3); - right = ROOM_RIGHT + 3; - } else { - left = ROOM_LEFT - 3; - right = Random.Int(ROOM_RIGHT + 3, getWidth() - 1); - } - if (Random.Int(2) == 0) { - top = Random.Int(2, ROOM_TOP - 3); - bottom = ROOM_BOTTOM + 3; - } else { - top = ROOM_LEFT - 3; - bottom = Random.Int(ROOM_TOP + 3, HEIGHT - 1); - } - - Painter.fill(this, left, top, right - left + 1, bottom - top + 1, - Terrain.EMPTY); - - if (top < topMost) { - topMost = top; - exit = Random.Int(left, right) + (top - 1) * getWidth(); - } - } - - - map[exit] = Terrain.WALL; - - - Painter.fill(this, ROOM_LEFT, ROOM_TOP + 1, ROOM_RIGHT - ROOM_LEFT + 1, - ROOM_BOTTOM - ROOM_TOP, Terrain.EMPTY); - - - entrance = Random.Int(ROOM_LEFT + 1, ROOM_RIGHT - 1) - + Random.Int(ROOM_TOP + 1, ROOM_BOTTOM - 1) * getWidth(); - - for (int i = 0; i < getLength(); i++) { - - if (map[i]==Terrain.EMPTY && Random.Float()<.95){map[i] = Terrain.WATER;} - } - - boolean[] patch = Patch.generate(0.45f, 6); - for (int i = 0; i < getLength(); i++) { - if (map[i] == Terrain.WATER && patch[i]) { - map[i] = Terrain.EMPTY; - } - } - - return true; - } - - @Override - protected void decorate() { - - for (int i = getWidth() + 1; i < getLength() - getWidth(); i++) { - if (map[i] == Terrain.EMPTY) { - int n = 0; - if (map[i + 1] == Terrain.WALL) { - n++; - } - if (map[i - 1] == Terrain.WALL) { - n++; - } - if (map[i + getWidth()] == Terrain.WALL) { - n++; - } - if (map[i - getWidth()] == Terrain.WALL) { - n++; - } - if (Random.Int(8) <= n) { - map[i] = Terrain.EMPTY_DECO; - } - } - } - - for (int i = 0; i < getLength(); i++) { - if (map[i] == Terrain.WALL && Random.Int(8) == 0) { - map[i] = Terrain.WALL_DECO; - } - if (map[i]==Terrain.ENTRANCE){map[i] = Terrain.EMPTY;} - } - - } - - //@Override - //protected void createMobs() { - //} - - @Override - protected void createItems() { - - int pos = entrance + 1; - drop(new FishingBomb(50), pos).type = Heap.Type.CHEST; - drop(new PotionOfLevitation(), pos); - - } - - - - //@Override - //public int randomRespawnCell() { - // return -1; - //} - - - - - @Override - public String tileName(int tile) { - switch (tile) { - case Terrain.WATER: - return "Dark cold water."; - case Terrain.HIGH_GRASS: - return "Seaweed tangles. "; - default: - return super.tileName(tile); - } - } - - @Override - public String tileDesc(int tile) { - switch (tile) { - case Terrain.ENTRANCE: - return "A ramp leads up to the upper depth."; - case Terrain.EXIT: - return "A ramp leads down to the lower depth."; - case Terrain.WALL_DECO: - case Terrain.EMPTY_DECO: - return "Small crabs and shell fish litter the sandy floor."; - case Terrain.EMPTY_SP: - return "Thick carpet covers the floor."; - case Terrain.STATUE: - case Terrain.STATUE_SP: - return "A large sea shell is propped up in the sand."; - case Terrain.BOOKSHELF: - return "Mostly beach reads."; - default: - return super.tileDesc(tile); - } - } - - - @Override - public void addVisuals(Scene scene) { - CavesLevel.addVisuals(this, scene); - } - @Override - public int nMobs() { - return 30; - } - - @Override - protected void createMobs() { - int nMobs = nMobs(); - for (int i = 0; i < nMobs; i++) { - Mob mob = Bestiary.mob(Dungeon.depth); - do { - mob.pos = randomRespawnCellFishMob(); - } while (mob.pos == -1); - mobs.add(mob); - Actor.occupyCell(mob); - } - } - - - - public int randomRespawnCellFishMob() { - int cell; - do { - cell = Random.Int(getLength()); - } while (map[cell]!=Terrain.WATER); - return cell; - } - - @Override - public Actor respawner() { - return new Actor() { - @Override - protected boolean act() { - if (mobs.size() < nMobs()) { - - Mob mob = Bestiary.mutable(Dungeon.depth); - mob.state = mob.WANDERING; - mob.pos = randomRespawnCellFishMob(); - if (Dungeon.hero.isAlive() && mob.pos != -1) { - GameScene.add(mob); - } - } - spend(Dungeon.level.feeling == Feeling.DARK - || Statistics.amuletObtained ? TIME_TO_RESPAWN / 2 - : TIME_TO_RESPAWN); - return true; - } - }; - } -} diff --git a/java/com/hmdzl/spspd/change/levels/FortressLevel.java b/java/com/hmdzl/spspd/change/levels/FortressLevel.java deleted file mode 100644 index c6451a6b..00000000 --- a/java/com/hmdzl/spspd/change/levels/FortressLevel.java +++ /dev/null @@ -1,238 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels; - -import java.util.ArrayList; -import java.util.HashSet; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Challenges; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.mobs.npcs.Tinkerer3; -import com.hmdzl.spspd.change.items.quest.Mushroom; -import com.hmdzl.spspd.change.items.TriforceOfPower; -import com.hmdzl.spspd.change.levels.Room.Type; -import com.watabou.utils.Random; - -public class FortressLevel extends RegularLevel { - - { - color1 = 0x4b6636; - color2 = 0xf2f2f2; - cleared=true; - } - - protected static final int REGROW_TIMER = 4; - - @Override - public String tilesTex() { - return Assets.TILES_CITY; - } - - @Override - public String waterTex() { - return Assets.WATER_CITY; - } - - @Override - protected boolean[] water() { - return Patch.generate(feeling == Feeling.WATER ? 0.65f : 0.45f, 4); - } - - @Override - protected boolean[] grass() { - return Patch.generate(feeling == Feeling.GRASS ? 0.60f : 0.40f, 3); - } - - - @Override - protected boolean assignRoomType() { - - specialsf = new ArrayList(Room.SPECIALSFORT); - - //if (Dungeon.isChallenged(Challenges.NO_HERBALISM)) { - // sorry warden, no lucky sungrass or blandfruit seeds for you! - //specialsf.remove(Room.Type.GARDEN); - // } - - int specialRooms = 0; - - for (Room r : rooms) { - if (r.type == Type.NULL && r.connected.size() == 1) { - - if (specialsf.size() > 0 && r.width() > 3 && r.height() > 3 - //&& Random.Int(specialRooms * specialRooms + 2) == 0 - ) { - - - int n = specialsf.size(); - r.type = specialsf.get(Math.min(Random.Int(n),Random.Int(n))); - - Room.useType(r.type); - //specialsf.remove(r.type); - specialRooms++; - - } else if (Random.Int(2) == 0) { - - HashSet neigbours = new HashSet(); - for (Room n : r.neigbours) { - if (!r.connected.containsKey(n) - && !Room.SPECIALSFORT.contains(n.type) - && n.type != Type.PIT) { - - neigbours.add(n); - } - } - if (neigbours.size() > 1) { - r.connect(Random.element(neigbours)); - } - } - } - } - - - int count = 0; - for (Room r : rooms) { - if (r.type == Type.NULL) { - int connections = r.connected.size(); - if (connections == 0) { - - } else if (Random.Int(connections * connections) == 0) { - r.type = Type.STANDARD; - count++; - } else { - r.type = Type.STANDARD; - } - } - } - - while (count < 4) { - Room r = randomRoom(Type.TUNNEL, 1); - if (r != null) { - r.type = Type.STANDARD; - count++; - } - } - - for (Room r : rooms) { - if (r.type == Type.TUNNEL) { - r.type = Type.PASSAGE; - } - } - - return true; - } - - @Override - protected void decorate() { - - for (int i = 0; i < getLength(); i++) { - if (map[i] == Terrain.EMPTY && Random.Int(10) == 0) { - map[i] = Terrain.EMPTY_DECO; - } else if (map[i] == Terrain.WALL && Random.Int(8) == 0) { - map[i] = Terrain.WALL_DECO; - } - } - - while (true) { - int pos = roomEntrance.random(); - if (pos != entrance) { - break; - } - } - - - int length = Level.getLength(); - - for (int i = 0; i < length; i++) { - - - if (map[i]==Terrain.ENTRANCE){map[i] = Terrain.PEDESTAL;} - if (map[i]==Terrain.EXIT){map[i] = Terrain.PEDESTAL; if (!Dungeon.triforceofpower){drop(new TriforceOfPower(), i);}} - if (map[i]==Terrain.CHASM){map[i] = Terrain.EMPTY;} - - - } - } - - @Override - protected void createItems() { - - addItemToSpawn(new Mushroom()); - - Tinkerer3 npc = new Tinkerer3(); - do { - npc.pos = randomRespawnCell(); - } while (npc.pos == -1 || heaps.get(npc.pos) != null); - mobs.add(npc); - Actor.occupyCell(npc); - - - super.createItems(); - - spawn(this, roomEntrance); - - - - } - - public static void spawn(FortressLevel level, Room room) { - int pos; - do {pos = room.random();} - while (level.heaps.get(pos) != null); - //level.drop(new Rice(), pos); - } - - - @Override - public String tileName(int tile) { - switch (tile) { - case Terrain.WATER: - return "Suspiciously colored water"; - case Terrain.HIGH_GRASS: - return "High blooming flowers"; - default: - return super.tileName(tile); - } - } - - @Override - public String tileDesc(int tile) { - switch (tile) { - case Terrain.ENTRANCE: - return "A ramp leads up to the upper depth."; - case Terrain.EXIT: - return "A ramp leads down to the lower depth."; - case Terrain.WALL_DECO: - case Terrain.EMPTY_DECO: - return "Several tiles are missing here."; - case Terrain.EMPTY_SP: - return "Thick carpet covers the floor."; - case Terrain.STATUE: - case Terrain.STATUE_SP: - return "The statue depicts some dwarf standing in a heroic stance."; - case Terrain.BOOKSHELF: - return "The rows of books on different disciplines fill the bookshelf."; - default: - return super.tileDesc(tile); - } - } - - -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/levels/HallsBossLevel.java b/java/com/hmdzl/spspd/change/levels/HallsBossLevel.java deleted file mode 100644 index 06aeba95..00000000 --- a/java/com/hmdzl/spspd/change/levels/HallsBossLevel.java +++ /dev/null @@ -1,486 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.mobs.Yog; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.particles.FlameParticle; -import com.hmdzl.spspd.change.items.Heap; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.keys.SkeletonKey; -import com.hmdzl.spspd.change.levels.painters.Painter; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.watabou.noosa.Scene; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -/*public class HallsBossLevel extends Level { - - { - color1 = 0x801500; - color2 = 0xa68521; - - viewDistance = 3; - - } - private static final int ROOM_LEFT = getWidth() / 2 - 1; - private static final int ROOM_RIGHT = getWidth() / 2 + 1; - private static final int ROOM_TOP = HEIGHT / 2 - 1; - private static final int ROOM_BOTTOM = HEIGHT / 2 + 1; - - private int stairs = -1; - private boolean enteredArena = true; - private boolean keyDropped = false; - - @Override - public String tilesTex() { - return Assets.TILES_HALLS; - } - - @Override - public String waterTex() { - return Assets.WATER_HALLS; - } - - private static final String STAIRS = "stairs"; - private static final String ENTERED = "entered"; - private static final String DROPPED = "droppped"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(STAIRS, stairs); - bundle.put(DROPPED, keyDropped); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - stairs = bundle.getInt(STAIRS); - enteredArena = bundle.getBoolean(ENTERED); - keyDropped = bundle.getBoolean(DROPPED); - } - - @Override - protected boolean build() { - - for (int i = 0; i < 5; i++) { - - int top = Random.IntRange(2, ROOM_TOP - 1); - int bottom = Random.IntRange(ROOM_BOTTOM + 1, 22); - Painter.fill(this, 2 + i * 4, top, 4, bottom - top + 1, - Terrain.EMPTY); - - if (i == 2) { - exit = (i * 4 + 3) + (top - 1) * getWidth(); - } - - for (int j = 0; j < 4; j++) { - if (Random.Int(2) == 0) { - int y = Random.IntRange(top + 1, bottom - 1); - map[i * 4 + j + y * getWidth()] = Terrain.WALL_DECO; - } - } - } - - map[exit] = Terrain.LOCKED_EXIT; - - Painter.fill(this, ROOM_LEFT - 1, ROOM_TOP - 1, ROOM_RIGHT - ROOM_LEFT - + 3, ROOM_BOTTOM - ROOM_TOP + 3, Terrain.WALL); - - Painter.fill(this, ROOM_LEFT, ROOM_TOP, ROOM_RIGHT - ROOM_LEFT + 1, - ROOM_BOTTOM - ROOM_TOP + 1, Terrain.EMPTY); - - entrance = Random.Int(ROOM_LEFT + 1, ROOM_RIGHT - 1) - + Random.Int(ROOM_TOP + 1, ROOM_BOTTOM - 1) * getWidth(); - - map[entrance] = Terrain.ENTRANCE; - - boolean[] patch = Patch.generate(0.45f, 6); - for (int i = 0; i < getLength(); i++) { - if (map[i] == Terrain.EMPTY && patch[i]) { - map[i] = Terrain.WATER; - } - } - - return true; - } - - @Override - protected void decorate() { - - for (int i = 0; i < getLength(); i++) { - if (map[i] == Terrain.EMPTY && Random.Int(10) == 0) { - map[i] = Terrain.EMPTY_DECO; - //if (map[i]==Terrain.ENTRANCE){map[i] = Terrain.PEDESTAL;} - } - } - - //sealedlevel=false; - - - } - - @Override - protected void createMobs() { - } - - @Override - public Actor respawner() { - return null; - } - - @Override - protected void createItems() { - Item item = Bones.get(); - if (item != null) { - int pos; - do { - pos = Random.IntRange(ROOM_LEFT, ROOM_RIGHT) - + Random.IntRange(ROOM_TOP + 1, ROOM_BOTTOM) * getWidth(); - } while (pos == entrance || map[pos] == Terrain.SIGN); - drop(item, pos).type = Heap.Type.REMAINS; - } - } - - @Override - public int randomRespawnCell() { - if (entrance == -1) return entrance; - int cell = entrance + NEIGHBOURS8[Random.Int(8)]; - while (!passable[cell]) { - cell = entrance + NEIGHBOURS8[Random.Int(8)]; - } - return cell; - } - - - @Override - public void press(int cell, Char hero) { - - super.press(cell, hero); - - if (!enteredArena && hero == Dungeon.hero && cell != entrance) { - - enteredArena = true; - //locked = true; - seal(); - - for (int i = ROOM_LEFT - 1; i <= ROOM_RIGHT + 1; i++) { - doMagic((ROOM_TOP - 1) * getWidth() + i); - doMagic((ROOM_BOTTOM + 1) * getWidth() + i); - } - for (int i = ROOM_TOP; i < ROOM_BOTTOM + 1; i++) { - doMagic(i * getWidth() + ROOM_LEFT - 1); - doMagic(i * getWidth() + ROOM_RIGHT + 1); - } - doMagic(entrance); - GameScene.updateMap(); - - Dungeon.observe(); - - Yog boss = new Yog(); - do { - boss.pos = Random.Int(getLength()); - } while (!passable[boss.pos] || Dungeon.visible[boss.pos]); - GameScene.add(boss); - boss.spawnFists(); - - stairs = entrance; - entrance = -1; - } - } - - private void doMagic(int cell) { - set(cell, Terrain.EMPTY_SP); - CellEmitter.get(cell).start(FlameParticle.FACTORY, 0.1f, 3); - } - - @Override - public Heap drop(Item item, int cell) { - - if (!keyDropped && item instanceof SkeletonKey) { - keyDropped = true; - unseal(); - - entrance = stairs; - set(entrance, Terrain.ENTRANCE); - GameScene.updateMap(entrance); - } - - return super.drop(item, cell); - } - - @Override - public String tileName(int tile) { - switch (tile) { - case Terrain.WATER: - return Messages.get(HallsLevel.class, "water_name"); - case Terrain.GRASS: - return Messages.get(HallsLevel.class, "grass_name"); - case Terrain.HIGH_GRASS: - return Messages.get(HallsLevel.class, "high_grass_name"); - case Terrain.STATUE: - case Terrain.STATUE_SP: - return Messages.get(HallsLevel.class, "statue_name"); - default: - return super.tileName(tile); - } - } - - @Override - public String tileDesc(int tile) { - switch (tile) { - case Terrain.WATER: - return Messages.get(HallsLevel.class, "water_desc"); - case Terrain.STATUE: - case Terrain.STATUE_SP: - return Messages.get(HallsLevel.class, "statue_desc"); - case Terrain.BOOKSHELF: - return Messages.get(HallsLevel.class, "bookshelf_desc"); - default: - return super.tileDesc(tile); - } - } - - @Override - public void addVisuals(Scene scene) { - HallsLevel.addVisuals(this, scene); - } -}*/ -public class HallsBossLevel extends Level { - - { - color1 = 0x801500; - color2 = 0xa68521; - - viewDistance = 5; - } - - private static final int ROOM_LEFT = WIDTH / 2 - 1; - private static final int ROOM_RIGHT = WIDTH / 2 + 1; - private static final int ROOM_TOP = HEIGHT / 2 - 1; - private static final int ROOM_BOTTOM = HEIGHT / 2 + 1; - - private int stairs = -1; - private boolean enteredArena = false; - private boolean keyDropped = false; - - @Override - public String tilesTex() { - return Assets.TILES_HALLS; - } - - @Override - public String waterTex() { - return Assets.WATER_HALLS; - } - - private static final String STAIRS = "stairs"; - private static final String ENTERED = "entered"; - private static final String DROPPED = "droppped"; - - @Override - public void storeInBundle( Bundle bundle ) { - super.storeInBundle( bundle ); - bundle.put( STAIRS, stairs ); - bundle.put( ENTERED, enteredArena ); - bundle.put( DROPPED, keyDropped ); - } - - @Override - public void restoreFromBundle( Bundle bundle ) { - super.restoreFromBundle( bundle ); - stairs = bundle.getInt( STAIRS ); - enteredArena = bundle.getBoolean( ENTERED ); - keyDropped = bundle.getBoolean( DROPPED ); - } - - @Override - protected boolean build() { - - for (int i=0; i < 5; i++) { - - int top = Random.IntRange( 2, ROOM_TOP - 1 ); - int bottom = Random.IntRange( ROOM_BOTTOM + 1, 22 ); - Painter.fill( this, 2 + i * 4, top, 4, bottom - top + 1, Terrain.EMPTY ); - - if (i == 2) { - exit = (i * 4 + 3) + (top - 1) * WIDTH ; - } - - for (int j=0; j < 4; j++) { - if (Random.Int( 2 ) == 0) { - int y = Random.IntRange( top + 1, bottom - 1 ); - map[i*4+j + y*WIDTH] = Terrain.WALL_DECO; - } - } - } - map[exit] = Terrain.LOCKED_EXIT; - - Painter.fill( this, ROOM_LEFT - 1, ROOM_TOP - 1, - ROOM_RIGHT - ROOM_LEFT + 3, ROOM_BOTTOM - ROOM_TOP + 3, Terrain.WALL ); - Painter.fill( this, ROOM_LEFT, ROOM_TOP, - ROOM_RIGHT - ROOM_LEFT + 1, ROOM_BOTTOM - ROOM_TOP + 1, Terrain.EMPTY ); - - entrance = Random.Int( ROOM_LEFT + 1, ROOM_RIGHT - 1 ) + Random.Int( ROOM_TOP + 1, ROOM_BOTTOM - 1 ) * WIDTH; - map[entrance] = Terrain.ENTRANCE; - - boolean[] patch = Patch.generate( 0.45f, 6 ); - for (int i=0; i < LENGTH; i++) { - if (map[i] == Terrain.EMPTY && patch[i]) { - map[i] = Terrain.WATER; - } - } - - return true; - } - - @Override - protected void decorate() { - - for (int i=0; i < LENGTH; i++) { - if (map[i] == Terrain.EMPTY && Random.Int( 10 ) == 0) { - map[i] = Terrain.EMPTY_DECO; - } - } - } - - @Override - protected void createMobs() { - } - - public Actor respawner() { - return null; - } - - @Override - protected void createItems() { - - } - - @Override - public int randomRespawnCell() { - if (entrance == -1) return entrance; - int cell = entrance + NEIGHBOURS8[Random.Int(8)]; - while (!passable[cell]){ - cell = entrance + NEIGHBOURS8[Random.Int(8)]; - } - return cell; - } - - @Override - public void press( int cell, Char hero ) { - - super.press( cell, hero ); - - if (!enteredArena && hero == Dungeon.hero && cell != entrance) { - - enteredArena = true; - seal(); - - for (int i=ROOM_LEFT-1; i <= ROOM_RIGHT + 1; i++) { - doMagic( (ROOM_TOP - 1) * WIDTH + i ); - doMagic( (ROOM_BOTTOM + 1) * WIDTH + i ); - } - for (int i=ROOM_TOP; i < ROOM_BOTTOM + 1; i++) { - doMagic( i * WIDTH + ROOM_LEFT - 1 ); - doMagic( i * WIDTH + ROOM_RIGHT + 1 ); - } - doMagic( entrance ); - GameScene.updateMap(); - - Dungeon.observe(); - - Yog boss = new Yog(); - do { - boss.pos = Random.Int( LENGTH ); - } while ( - !passable[boss.pos] || - Dungeon.visible[boss.pos]); - GameScene.add( boss ); - boss.spawnFists(); - - stairs = entrance; - entrance = -1; - } - } - - private void doMagic( int cell ) { - set( cell, Terrain.EMPTY_SP ); - CellEmitter.get( cell ).start( FlameParticle.FACTORY, 0.1f, 3 ); - } - - @Override - public Heap drop( Item item, int cell ) { - - if (!keyDropped && item instanceof SkeletonKey) { - keyDropped = true; - unseal(); - - entrance = stairs; - set( entrance, Terrain.ENTRANCE ); - GameScene.updateMap( entrance ); - } - - return super.drop( item, cell ); - } - - @Override - public String tileName( int tile ) { - switch (tile) { - case Terrain.WATER: - return Messages.get(HallsLevel.class, "water_name"); - case Terrain.GRASS: - return Messages.get(HallsLevel.class, "grass_name"); - case Terrain.HIGH_GRASS: - return Messages.get(HallsLevel.class, "high_grass_name"); - case Terrain.STATUE: - case Terrain.STATUE_SP: - return Messages.get(HallsLevel.class, "statue_name"); - default: - return super.tileName( tile ); - } - } - - @Override - public String tileDesc(int tile) { - switch (tile) { - case Terrain.WATER: - return Messages.get(HallsLevel.class, "water_desc"); - case Terrain.STATUE: - case Terrain.STATUE_SP: - return Messages.get(HallsLevel.class, "statue_desc"); - case Terrain.BOOKSHELF: - return Messages.get(HallsLevel.class, "bookshelf_desc"); - default: - return super.tileDesc( tile ); - } - } - - @Override - public void addVisuals(Scene scene) { - HallsLevel.addVisuals(this, scene); - } -} - - diff --git a/java/com/hmdzl/spspd/change/levels/HallsLevel.java b/java/com/hmdzl/spspd/change/levels/HallsLevel.java deleted file mode 100644 index 8ce3d91b..00000000 --- a/java/com/hmdzl/spspd/change/levels/HallsLevel.java +++ /dev/null @@ -1,274 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels; - -import javax.microedition.khronos.opengles.GL10; - -import android.opengl.GLES20; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.DungeonTilemap; -import com.hmdzl.spspd.change.actors.hero.HeroClass; -import com.hmdzl.spspd.change.actors.mobs.Sentinel; -import com.hmdzl.spspd.change.items.bombs.Bomb; -import com.hmdzl.spspd.change.items.DwarfHammer; -import com.hmdzl.spspd.change.items.Torch; -import com.hmdzl.spspd.change.levels.traps.*; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.noosa.Game; -import com.watabou.noosa.Group; -import com.watabou.noosa.Scene; -import com.watabou.noosa.particles.PixelParticle; -import com.watabou.utils.PointF; -import com.watabou.utils.Random; - -public class HallsLevel extends RegularLevel { - - { - minRoomSize = 6; - - viewDistance = Math.max(25 - Dungeon.depth, 1); - - color1 = 0x801500; - color2 = 0xa68521; - } - - @Override - public void create() { - addItemToSpawn(new Torch()); - super.create(); - } - - @Override - public String tilesTex() { - return Assets.TILES_HALLS; - } - - @Override - public String waterTex() { - return Assets.WATER_HALLS; - } - - @Override - protected void setPar(){ - Dungeon.pars[Dungeon.depth] = 200+(Dungeon.depth*50)+(secretDoors*20); - } - - @Override - protected boolean[] water() { - return Patch.generate(feeling == Feeling.WATER ? 0.55f : 0.40f, 6); - } - - @Override - protected boolean[] grass() { - return Patch.generate(feeling == Feeling.GRASS ? 0.55f : 0.30f, 3); - } - - @Override - protected Class[] trapClasses() { - return new Class[]{ BlazingTrap.class, DisintegrationTrap.class, FrostTrap.class, SpearTrap.class, VenomTrap.class, StormTrap.class, - ExplosiveTrap.class, GrippingTrap.class, LightningTrap.class, OozeTrap.class, WeakeningTrap.class, - CursingTrap.class, FlockTrap.class, GrimTrap.class, GuardianTrap.class, SummoningTrap.class, TeleportationTrap.class, - DisarmingTrap.class}; - } - - @Override - protected float[] trapChances() { - return new float[]{ 8, 8, 8, 8, 8, 8, - 4, 4, 4, 4, 4, - 2, 2, 2, 2, 2, 2, - 1}; - } - - @Override - protected void decorate() { - - for (int i = getWidth() + 1; i < getLength() - getWidth() - 1; i++) { - if (map[i] == Terrain.EMPTY) { - - int count = 0; - for (int j = 0; j < NEIGHBOURS8.length; j++) { - if ((Terrain.flags[map[i + NEIGHBOURS8[j]]] & Terrain.PASSABLE) > 0) { - count++; - } - } - - if (Random.Int(80) < count) { - map[i] = Terrain.EMPTY_DECO; - } - - } else if (map[i] == Terrain.WALL - && map[i - 1] != Terrain.WALL_DECO - && map[i - getWidth()] != Terrain.WALL_DECO - && Random.Int(20) == 0) { - - map[i] = Terrain.WALL_DECO; - - } - } - - while (true) { - int pos = roomEntrance.random(); - if (pos != entrance) { - map[pos] = Terrain.SIGN; - break; - } - } - - for (int i = 0; i < getLength(); i++) { - - if (map[i]==Terrain.EXIT){map[i] = Terrain.PEDESTAL; - sealedlevel=true; - if(Dungeon.depth==24){ - Sentinel sentinel = new Sentinel(); - sentinel.pos = i; - mobs.add(sentinel);} - } - - } - - setPar(); - - - } - - @Override - protected void createItems() { - if (Dungeon.depth!=25){addItemToSpawn(new DwarfHammer());} - super.createItems(); - } - - @Override - public String tileName(int tile) { - switch (tile) { - case Terrain.WATER: - return Messages.get(HallsLevel.class, "water_name"); - case Terrain.GRASS: - return Messages.get(HallsLevel.class, "grass_name"); - case Terrain.HIGH_GRASS: - return Messages.get(HallsLevel.class, "high_grass_name"); - case Terrain.STATUE: - case Terrain.STATUE_SP: - return Messages.get(HallsLevel.class, "statue_name"); - default: - return super.tileName(tile); - } - } - - @Override - public String tileDesc(int tile) { - switch (tile) { - case Terrain.WATER: - return Messages.get(HallsLevel.class, "water_desc"); - case Terrain.STATUE: - case Terrain.STATUE_SP: - return Messages.get(HallsLevel.class, "statue_desc"); - case Terrain.BOOKSHELF: - return Messages.get(HallsLevel.class, "bookshelf_desc"); - default: - return super.tileDesc(tile); - } - } - - @Override - public void addVisuals(Scene scene) { - super.addVisuals(scene); - addVisuals(this, scene); - } - - public static void addVisuals(Level level, Scene scene) { - for (int i = 0; i < getLength(); i++) { - if (level.map[i] == 63) { - scene.add(new Stream(i)); - } - } - } - - private static class Stream extends Group { - - private int pos; - - private float delay; - - public Stream(int pos) { - super(); - - this.pos = pos; - - delay = Random.Float(2); - } - - @Override - public void update() { - - if (visible = Dungeon.visible[pos]) { - - super.update(); - - if ((delay -= Game.elapsed) <= 0) { - - delay = Random.Float(2); - - PointF p = DungeonTilemap.tileToWorld(pos); - ((FireParticle) recycle(FireParticle.class)).reset(p.x - + Random.Float(DungeonTilemap.SIZE), - p.y + Random.Float(DungeonTilemap.SIZE)); - } - } - } - - @Override - public void draw() { - GLES20.glBlendFunc(GL10.GL_SRC_ALPHA, GL10.GL_ONE); - super.draw(); - GLES20.glBlendFunc(GL10.GL_SRC_ALPHA, GL10.GL_ONE_MINUS_SRC_ALPHA); - } - } - - public static class FireParticle extends PixelParticle.Shrinking { - - public FireParticle() { - super(); - - color(0xEE7722); - lifespan = 1f; - - acc.set(0, +80); - } - - public void reset(float x, float y) { - revive(); - - this.x = x; - this.y = y; - - left = lifespan; - - speed.set(0, -40); - size = 4; - } - - @Override - public void update() { - super.update(); - float p = left / lifespan; - am = p > 0.8f ? (1 - p) * 5 : 1; - } - } -} diff --git a/java/com/hmdzl/spspd/change/levels/InfestBossLevel.java b/java/com/hmdzl/spspd/change/levels/InfestBossLevel.java deleted file mode 100644 index 15980c73..00000000 --- a/java/com/hmdzl/spspd/change/levels/InfestBossLevel.java +++ /dev/null @@ -1,393 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.Statistics; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.mobs.Bestiary; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.actors.mobs.ShadowYog; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.levels.painters.Painter; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.Camera; -import com.watabou.noosa.Scene; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -public class InfestBossLevel extends Level { - - { - color1 = 0x534f3e; - color2 = 0xb9d661; - cleared=true; - - viewDistance = 6; - } - - private static final int ROOM_LEFT = getWidth() / 2 - 2; - private static final int ROOM_RIGHT = getWidth() / 2 + 2; - private static final int ROOM_TOP = HEIGHT / 2 - 2; - private static final int ROOM_BOTTOM = HEIGHT / 2 + 2; - - private int arenaDoor; - private boolean enteredArena = false; - private boolean keyDropped = false; - - @Override - public String tilesTex() { - return Assets.TILES_CAVES; - } - - @Override - public String waterTex() { - return Assets.WATER_CAVES; - } - - private static final String DOOR = "door"; - private static final String ENTERED = "entered"; - private static final String DROPPED = "droppped"; - - protected static final float TIME_TO_RESPAWN = 20; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(DOOR, arenaDoor); - bundle.put(ENTERED, enteredArena); - bundle.put(DROPPED, keyDropped); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - arenaDoor = bundle.getInt(DOOR); - enteredArena = bundle.getBoolean(ENTERED); - keyDropped = bundle.getBoolean(DROPPED); - } - - @Override - protected boolean build() { - - int topMost = Integer.MAX_VALUE; - - for (int i = 0; i < 8; i++) { - int left, right, top, bottom; - if (Random.Int(2) == 0) { - left = Random.Int(1, ROOM_LEFT - 3); - right = ROOM_RIGHT + 3; - } else { - left = ROOM_LEFT - 3; - right = Random.Int(ROOM_RIGHT + 3, getWidth() - 1); - } - if (Random.Int(2) == 0) { - top = Random.Int(2, ROOM_TOP - 3); - bottom = ROOM_BOTTOM + 3; - } else { - top = ROOM_LEFT - 3; - bottom = Random.Int(ROOM_TOP + 3, HEIGHT - 1); - } - - Painter.fill(this, left, top, right - left + 1, bottom - top + 1, - Terrain.EMPTY); - - if (top < topMost) { - topMost = top; - exit = Random.Int(left, right) + (top - 1) * getWidth(); - } - } - - map[exit] = Terrain.WALL; - - for (int i = 0; i < getLength(); i++) { - if (map[i] == Terrain.EMPTY && Random.Int(20) == 0) { - map[i] = Terrain.TRAP; - } - } - - Painter.fill(this, ROOM_LEFT - 1, ROOM_TOP - 1, ROOM_RIGHT - ROOM_LEFT - + 3, ROOM_BOTTOM - ROOM_TOP + 3, Terrain.WALL); - Painter.fill(this, ROOM_LEFT, ROOM_TOP + 1, ROOM_RIGHT - ROOM_LEFT + 1, - ROOM_BOTTOM - ROOM_TOP, Terrain.EMPTY); - - Painter.fill(this, ROOM_LEFT, ROOM_TOP, ROOM_RIGHT - ROOM_LEFT + 1, 1, - Terrain.INACTIVE_TRAP); - - arenaDoor = Random.Int(ROOM_LEFT, ROOM_RIGHT) + (ROOM_BOTTOM + 1) - * getWidth(); - map[arenaDoor] = Terrain.DOOR; - - entrance = Random.Int(ROOM_LEFT + 1, ROOM_RIGHT - 1) - + Random.Int(ROOM_TOP + 1, ROOM_BOTTOM - 1) * getWidth(); - map[entrance] = Terrain.ENTRANCE; - - return true; - } - - @Override - protected void decorate() { - - for (int i = getWidth() + 1; i < getLength() - getWidth(); i++) { - if (map[i] == Terrain.EMPTY) { - int n = 0; - if (map[i + 1] == Terrain.WALL) { - n++; - } - if (map[i - 1] == Terrain.WALL) { - n++; - } - if (map[i + getWidth()] == Terrain.WALL) { - n++; - } - if (map[i - getWidth()] == Terrain.WALL) { - n++; - } - if (Random.Int(8) <= n) { - map[i] = Terrain.EMPTY_DECO; - } - } - } - - for (int i = 0; i < getLength(); i++) { - if (map[i] == Terrain.WALL && Random.Int(8) == 0) { - map[i] = Terrain.WALL_DECO; - } - if (map[i]==Terrain.ENTRANCE){map[i] = Terrain.PEDESTAL;} - } - - } - - //@Override - //protected void createMobs() { - //} - - //@Override - //public Actor respawner() { - // return null; - //} - - @Override - protected void createItems() { - } - - //@Override - //public int randomRespawnCell() { - // return -1; - //} - - @Override - public void press(int cell, Char hero) { - - super.press(cell, hero); - - if (!enteredArena && outsideEntraceRoom(cell) && hero == Dungeon.hero) { - - enteredArena = true; - //locked = true; - - ShadowYog boss = new ShadowYog(); - boss.state = boss.SLEEPING; - do { - boss.pos = Random.Int(getLength()); - } while (!passable[boss.pos] || !outsideEntraceRoom(boss.pos) - || Dungeon.visible[boss.pos]); - GameScene.add(boss); - GLog.n("we are legion"); - - ShadowYog boss2 = new ShadowYog(); - boss2.state = boss2.SLEEPING; - do { - boss2.pos = Random.Int(getLength()); - } while (!passable[boss2.pos] || !outsideEntraceRoom(boss2.pos) - || Dungeon.visible[boss2.pos]); - GameScene.add(boss2); - GLog.n("we are legion"); - - ShadowYog boss3 = new ShadowYog(); - boss3.state = boss3.SLEEPING; - do { - boss3.pos = Random.Int(getLength()); - } while (!passable[boss3.pos] || !outsideEntraceRoom(boss3.pos) - || Dungeon.visible[boss3.pos]); - GameScene.add(boss3); - GLog.n("we are legion"); - - ShadowYog boss4 = new ShadowYog(); - boss4.state = boss4.SLEEPING; - do { - boss4.pos = Random.Int(getLength()); - } while (!passable[boss4.pos] || !outsideEntraceRoom(boss4.pos) - || Dungeon.visible[boss4.pos]); - GameScene.add(boss4); - GLog.n("we are legion"); - - ShadowYog boss5 = new ShadowYog(); - boss5.state = boss5.SLEEPING; - do { - boss5.pos = Random.Int(getLength()); - } while (!passable[boss5.pos] || !outsideEntraceRoom(boss5.pos) - || Dungeon.visible[boss5.pos]); - GameScene.add(boss5); - GLog.n("we are legion"); - - ShadowYog boss6 = new ShadowYog(); - boss6.state = boss6.SLEEPING; - do { - boss6.pos = Random.Int(getLength()); - } while (!passable[boss6.pos] || !outsideEntraceRoom(boss6.pos) - || Dungeon.visible[boss6.pos]); - GameScene.add(boss6); - GLog.n("we are legion"); - - ShadowYog boss7 = new ShadowYog(); - boss7.state = boss7.SLEEPING; - do { - boss7.pos = Random.Int(getLength()); - } while (!passable[boss7.pos] || !outsideEntraceRoom(boss7.pos) - || Dungeon.visible[boss7.pos]); - GameScene.add(boss7); - GLog.n("we are legion"); - - ShadowYog boss8 = new ShadowYog(); - boss8.state = boss8.SLEEPING; - do { - boss8.pos = Random.Int(getLength()); - } while (!passable[boss8.pos] || !outsideEntraceRoom(boss8.pos) - || Dungeon.visible[boss8.pos]); - GameScene.add(boss8); - GLog.n("we are legion"); - - ShadowYog boss9 = new ShadowYog(); - boss9.state = boss9.SLEEPING; - do { - boss9.pos = Random.Int(getLength()); - } while (!passable[boss9.pos] || !outsideEntraceRoom(boss9.pos) - || Dungeon.visible[boss9.pos]); - GameScene.add(boss9); - GLog.n("we are legion"); - - ShadowYog boss10 = new ShadowYog(); - boss10.state = boss10.SLEEPING; - do { - boss10.pos = Random.Int(getLength()); - } while (!passable[boss10.pos] || !outsideEntraceRoom(boss10.pos) - || Dungeon.visible[boss10.pos]); - GameScene.add(boss10); - GLog.n("we are legion"); - - //set(arenaDoor, Terrain.WALL); - GameScene.updateMap(arenaDoor); - Dungeon.observe(); - - CellEmitter.get(arenaDoor).start(Speck.factory(Speck.ROCK), 0.07f, 10); - Camera.main.shake(3, 0.7f); - Sample.INSTANCE.play(Assets.SND_ROCKS); - } - } - - - private boolean outsideEntraceRoom(int cell) { - int cx = cell % getWidth(); - int cy = cell / getWidth(); - return cx < ROOM_LEFT - 1 || cx > ROOM_RIGHT + 1 || cy < ROOM_TOP - 1 - || cy > ROOM_BOTTOM + 1; - } - - @Override - public String tileName(int tile) { - switch (tile) { - case Terrain.GRASS: - return Messages.get(CavesLevel.class, "grass_name"); - case Terrain.HIGH_GRASS: - return Messages.get(CavesLevel.class, "high_grass_name"); - case Terrain.WATER: - return Messages.get(CavesLevel.class, "water_name"); - default: - return super.tileName( tile ); - } - } - - @Override - public String tileDesc(int tile) { - switch (tile) { - case Terrain.ENTRANCE: - return Messages.get(CavesLevel.class, "entrance_desc"); - case Terrain.EXIT: - return Messages.get(CavesLevel.class, "exit_desc"); - case Terrain.HIGH_GRASS: - return Messages.get(CavesLevel.class, "high_grass_desc"); - case Terrain.WALL_DECO: - return Messages.get(CavesLevel.class, "wall_deco_desc"); - case Terrain.BOOKSHELF: - return Messages.get(CavesLevel.class, "bookshelf_desc"); - default: - return super.tileDesc( tile ); - } - } - - @Override - public void addVisuals(Scene scene) { - CavesLevel.addVisuals(this, scene); - } - @Override - public int nMobs() { - return 20; - } - - @Override - protected void createMobs() { - int nMobs = nMobs(); - for (int i = 0; i < nMobs; i++) { - Mob mob = Bestiary.mob(Dungeon.depth); - do { - mob.pos = randomRespawnCellMob(); - } while (mob.pos == -1); - mobs.add(mob); - Actor.occupyCell(mob); - } - } - - @Override - public Actor respawner() { - return new Actor() { - @Override - protected boolean act() { - if (mobs.size() < nMobs()) { - - Mob mob = Bestiary.mutable(Dungeon.depth); - mob.state = mob.WANDERING; - mob.pos = randomRespawnCellMob(); - if (Dungeon.hero.isAlive() && mob.pos != -1) { - GameScene.add(mob); - } - } - spend(Dungeon.level.feeling == Feeling.DARK - || Statistics.amuletObtained ? TIME_TO_RESPAWN / 2 - : TIME_TO_RESPAWN); - return true; - } - }; - } -} diff --git a/java/com/hmdzl/spspd/change/levels/LastLevel.java b/java/com/hmdzl/spspd/change/levels/LastLevel.java deleted file mode 100644 index b22cc42e..00000000 --- a/java/com/hmdzl/spspd/change/levels/LastLevel.java +++ /dev/null @@ -1,179 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels; - -import java.util.Arrays; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.items.PuddingCup; -import com.hmdzl.spspd.change.levels.painters.Painter; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.noosa.Scene; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -public class LastLevel extends Level { - - private static final int SIZE = 30; - - { - color1 = 0x801500; - color2 = 0xa68521; - - viewDistance = 8; - } - - private int pedestal; - - @Override - public String tilesTex() { - return Assets.TILES_HALLS; - } - - @Override - public String waterTex() { - return Assets.WATER_HALLS; - } - - @Override - public void create() { - super.create(); - for (int i = 0; i < getLength(); i++) { - int flags = Terrain.flags[map[i]]; - if ((flags & Terrain.PIT) != 0) { - passable[i] = avoid[i] = false; - solid[i] = true; - } - } - } - - @Override - protected boolean build() { - - Arrays.fill(map, Terrain.CHASM); - - Painter.fill(this, 7, 31, 19, 1, Terrain.WALL); - Painter.fill(this, 15, 10, 3, 21, Terrain.EMPTY); - Painter.fill(this, 13, 30, 7, 1, Terrain.EMPTY); - Painter.fill(this, 14, 29, 5, 1, Terrain.EMPTY); - - Painter.fill(this, 14, 9, 5, 7, Terrain.EMPTY); - Painter.fill(this, 13, 10, 7, 5, Terrain.EMPTY); - - // Painter.fill( this, 2, 2, SIZE-2, SIZE-2, Terrain.EMPTY ); - // Painter.fill( this, SIZE/2, SIZE/2, 3, 3, Terrain.EMPTY_SP ); - - entrance = SIZE * getWidth() + SIZE / 2 + 1; - map[entrance] = Terrain.ENTRANCE; - - pedestal = (SIZE / 2 + 1) * (getWidth() + 1) - 4 * getWidth(); - map[pedestal] = Terrain.PEDESTAL; - map[pedestal - 1 - getWidth()] = map[pedestal + 1 - getWidth()] = map[pedestal - - 1 + getWidth()] = map[pedestal + 1 + getWidth()] = Terrain.STATUE_SP; - - exit = pedestal; - - int pos = pedestal; - - map[pos - getWidth()] = map[pos - 1] = map[pos + 1] = map[pos - 2] = map[pos + 2] = Terrain.WATER; - pos += getWidth(); - map[pos] = map[pos - 2] = map[pos + 2] = map[pos - 3] = map[pos + 3] = Terrain.WATER; - pos += getWidth(); - map[pos - 3] = map[pos - 2] = map[pos - 1] = map[pos] = map[pos + 1] = map[pos + 2] = map[pos + 3] = Terrain.WATER; - pos += getWidth(); - map[pos - 2] = map[pos + 2] = Terrain.WATER; - - feeling = Feeling.NONE; - viewDistance = 8; - - return true; - } - - @Override - protected void decorate() { - for (int i = 0; i < getLength(); i++) { - if (map[i] == Terrain.EMPTY && Random.Int(10) == 0) { - map[i] = Terrain.EMPTY_DECO; - } - } - } - - @Override - protected void createMobs() { - } - - @Override - protected void createItems() { - drop(new PuddingCup(), pedestal); - } - - @Override - public int randomRespawnCell() { - return -1; - } - - @Override - public String tileName(int tile) { - switch (tile) { - case Terrain.WATER: - return Messages.get(HallsLevel.class, "water_name"); - case Terrain.GRASS: - return Messages.get(HallsLevel.class, "grass_name"); - case Terrain.HIGH_GRASS: - return Messages.get(HallsLevel.class, "high_grass_name"); - case Terrain.STATUE: - case Terrain.STATUE_SP: - return Messages.get(HallsLevel.class, "statue_name"); - default: - return super.tileName(tile); - } - } - - @Override - public String tileDesc(int tile) { - switch (tile) { - case Terrain.WATER: - return Messages.get(HallsLevel.class, "water_desc"); - case Terrain.STATUE: - case Terrain.STATUE_SP: - return Messages.get(HallsLevel.class, "statue_desc"); - case Terrain.BOOKSHELF: - return Messages.get(HallsLevel.class, "bookshelf_desc"); - default: - return super.tileDesc(tile); - } - } - - @Override - public void addVisuals(Scene scene) { - super.addVisuals(scene); - HallsLevel.addVisuals(this, scene); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - for (int i = 0; i < getLength(); i++) { - int flags = Terrain.flags[map[i]]; - if ((flags & Terrain.PIT) != 0) { - passable[i] = avoid[i] = false; - solid[i] = true; - } - } - } -} diff --git a/java/com/hmdzl/spspd/change/levels/LastShopLevel.java b/java/com/hmdzl/spspd/change/levels/LastShopLevel.java deleted file mode 100644 index 421d023f..00000000 --- a/java/com/hmdzl/spspd/change/levels/LastShopLevel.java +++ /dev/null @@ -1,227 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels; - -import java.util.List; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.items.Heap; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.levels.Room.Type; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.noosa.Scene; -import com.watabou.utils.Graph; -import com.watabou.utils.Random; - -public class LastShopLevel extends RegularLevel { - - { - color1 = 0x4b6636; - color2 = 0xf2f2f2; - } - - @Override - public String tilesTex() { - return Assets.TILES_CITY; - } - - @Override - public String waterTex() { - return Assets.WATER_CITY; - } - - @Override - protected boolean build() { - - feeling = Feeling.CHASM; - viewDistance = 6; - - initRooms(); - - int distance; - int retry = 0; - int minDistance = (int) Math.sqrt(rooms.size()); - do { - int innerRetry = 0; - do { - if (innerRetry++ > 10) { - return false; - } - roomEntrance = Random.element(rooms); - } while (roomEntrance.width() < 4 || roomEntrance.height() < 4); - - innerRetry = 0; - do { - if (innerRetry++ > 10) { - return false; - } - roomExit = Random.element(rooms); - } while (roomExit == roomEntrance || roomExit.width() < 6 - || roomExit.height() < 6 || roomExit.top == 0); - - Graph.buildDistanceMap(rooms, roomExit); - distance = Graph.buildPath(rooms, roomEntrance, roomExit).size(); - - if (retry++ > 10) { - return false; - } - - } while (distance < minDistance); - - roomEntrance.type = Type.ENTRANCE; - roomExit.type = Type.EXIT; - - Graph.buildDistanceMap(rooms, roomExit); - List path = Graph.buildPath(rooms, roomEntrance, roomExit); - - Graph.setPrice(path, roomEntrance.distance); - - Graph.buildDistanceMap(rooms, roomExit); - path = Graph.buildPath(rooms, roomEntrance, roomExit); - - Room room = roomEntrance; - for (Room next : path) { - room.connect(next); - room = next; - } - - Room roomShop = null; - int shopSquare = 0; - for (Room r : rooms) { - if (r.type == Type.NULL && r.connected.size() > 0) { - r.type = Type.PASSAGE; - if (r.square() > shopSquare) { - roomShop = r; - shopSquare = r.square(); - } - } - } - - if (roomShop == null || shopSquare < 54) { - return false; - } else { - roomShop.type = Room.Type.SHOP; - } - - paint(); - - paintWater(); - paintGrass(); - - return true; - } - - @Override - protected void decorate() { - - for (int i = 0; i < getLength(); i++) { - if (map[i] == Terrain.EMPTY && Random.Int(10) == 0) { - - map[i] = Terrain.EMPTY_DECO; - - } else if (map[i] == Terrain.WALL && Random.Int(8) == 0) { - - map[i] = Terrain.WALL_DECO; - - } else if (map[i] == Terrain.SECRET_DOOR) { - - map[i] = Terrain.DOOR; - - } - } - - - while (true) { - int pos = roomEntrance.random(); - if (pos != entrance) { - map[pos] = Terrain.SIGN; - break; - } - } - - } - - @Override - protected void createMobs() { - } - - @Override - public Actor respawner() { - return null; - } - - @Override - protected void createItems() { - } - - @Override - public int randomRespawnCell() { - return -1; - } - - @Override - public String tileName(int tile) { - switch (tile) { - case Terrain.WATER: - return Messages.get(CityLevel.class, "water_name"); - case Terrain.HIGH_GRASS: - return Messages.get(CityLevel.class, "high_grass_name"); - default: - return super.tileName(tile); - } - } - - @Override - public String tileDesc(int tile) { - switch (tile) { - case Terrain.ENTRANCE: - return Messages.get(CityLevel.class, "entrance_desc"); - case Terrain.EXIT: - return Messages.get(CityLevel.class, "exit_desc"); - case Terrain.WALL_DECO: - case Terrain.EMPTY_DECO: - return Messages.get(CityLevel.class, "deco_desc"); - case Terrain.EMPTY_SP: - return Messages.get(CityLevel.class, "sp_desc"); - case Terrain.STATUE: - case Terrain.STATUE_SP: - return Messages.get(CityLevel.class, "statue_desc"); - case Terrain.BOOKSHELF: - return Messages.get(CityLevel.class, "bookshelf_desc"); - default: - return super.tileDesc(tile); - } - } - - @Override - protected boolean[] water() { - return Patch.generate(0.35f, 4); - } - - @Override - protected boolean[] grass() { - return Patch.generate(0.30f, 3); - } - - @Override - public void addVisuals(Scene scene) { - super.addVisuals(scene); - CityLevel.addVisuals(this, scene); - } -} diff --git a/java/com/hmdzl/spspd/change/levels/Level.java b/java/com/hmdzl/spspd/change/levels/Level.java deleted file mode 100644 index a70168ed..00000000 --- a/java/com/hmdzl/spspd/change/levels/Level.java +++ /dev/null @@ -1,2046 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.HashMap; -import java.util.HashSet; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Challenges; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.Statistics; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.Alchemy; -import com.hmdzl.spspd.change.actors.blobs.Blob; -import com.hmdzl.spspd.change.actors.blobs.WellWater; -import com.hmdzl.spspd.change.actors.buffs.AflyBless; -import com.hmdzl.spspd.change.actors.buffs.Awareness; -import com.hmdzl.spspd.change.actors.buffs.Blindness; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.ExitFind; -import com.hmdzl.spspd.change.actors.buffs.MindVision; -import com.hmdzl.spspd.change.actors.buffs.Shadows; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.hero.HeroClass; -import com.hmdzl.spspd.change.actors.mobs.Bestiary; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.actors.mobs.npcs.SheepSokoban; -import com.hmdzl.spspd.change.actors.mobs.npcs.SheepSokobanCorner; -import com.hmdzl.spspd.change.actors.mobs.npcs.SheepSokobanSwitch; -import com.hmdzl.spspd.change.actors.mobs.pets.BlueDragon; -import com.hmdzl.spspd.change.actors.mobs.pets.BugDragon; -import com.hmdzl.spspd.change.actors.mobs.pets.Bunny; -import com.hmdzl.spspd.change.actors.mobs.pets.CocoCat; -import com.hmdzl.spspd.change.actors.mobs.pets.Fly; -import com.hmdzl.spspd.change.actors.mobs.pets.GentleCrab; -import com.hmdzl.spspd.change.actors.mobs.pets.GoldDragon; -import com.hmdzl.spspd.change.actors.mobs.pets.GreenDragon; -import com.hmdzl.spspd.change.actors.mobs.pets.LeryFire; -import com.hmdzl.spspd.change.actors.mobs.pets.LightDragon; -import com.hmdzl.spspd.change.actors.mobs.pets.Monkey; -import com.hmdzl.spspd.change.actors.mobs.pets.PET; -import com.hmdzl.spspd.change.actors.mobs.pets.RedDragon; -import com.hmdzl.spspd.change.actors.mobs.pets.RibbonRat; -import com.hmdzl.spspd.change.actors.mobs.pets.Scorpion; -import com.hmdzl.spspd.change.actors.mobs.pets.ShadowDragon; -import com.hmdzl.spspd.change.actors.mobs.pets.Snake; -import com.hmdzl.spspd.change.actors.mobs.pets.Spider; -import com.hmdzl.spspd.change.actors.mobs.pets.Stone; - -import com.hmdzl.spspd.change.actors.mobs.pets.Velocirooster; -import com.hmdzl.spspd.change.actors.mobs.pets.VioletDragon; - -import com.hmdzl.spspd.change.actors.mobs.pets.YearPet; -import com.hmdzl.spspd.change.effects.Pushing; -import com.hmdzl.spspd.change.effects.particles.FlowParticle; -import com.hmdzl.spspd.change.effects.particles.WindParticle; -import com.hmdzl.spspd.change.items.Dewdrop; -import com.hmdzl.spspd.change.items.Generator; -import com.hmdzl.spspd.change.items.Heap; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.Stylus; -import com.hmdzl.spspd.change.items.Torch; -import com.hmdzl.spspd.change.items.StoneOre; -import com.hmdzl.spspd.change.items.Weightstone; -import com.hmdzl.spspd.change.items.armor.Armor; -import com.hmdzl.spspd.change.items.artifacts.AlchemistsToolkit; -import com.hmdzl.spspd.change.items.artifacts.DriedRose; -import com.hmdzl.spspd.change.items.artifacts.TimekeepersHourglass; -import com.hmdzl.spspd.change.items.bags.ScrollHolder; -import com.hmdzl.spspd.change.items.bags.SeedPouch; -import com.hmdzl.spspd.change.items.bags.ShoppingCart; -import com.hmdzl.spspd.change.items.food.fruit.Blandfruit; -import com.hmdzl.spspd.change.items.food.Food; -import com.hmdzl.spspd.change.items.misc.LuckyBadge; -import com.hmdzl.spspd.change.items.potions.PotionOfHealing; -import com.hmdzl.spspd.change.items.potions.PotionOfMight; -import com.hmdzl.spspd.change.items.potions.PotionOfStrength; -import com.hmdzl.spspd.change.items.scrolls.Scroll; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfMagicalInfusion; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfUpgrade; -import com.hmdzl.spspd.change.levels.features.Chasm; -import com.hmdzl.spspd.change.levels.features.Door; -import com.hmdzl.spspd.change.levels.features.HighGrass; -import com.hmdzl.spspd.change.levels.painters.Painter; -import com.hmdzl.spspd.change.levels.traps.ChangeSheepTrap; -import com.hmdzl.spspd.change.levels.traps.FleecingTrap; -import com.hmdzl.spspd.change.levels.traps.HeapGenTrap; -import com.hmdzl.spspd.change.levels.traps.*; -import com.hmdzl.spspd.change.sprites.ItemSprite; -import com.hmdzl.spspd.change.ui.CustomTileVisual; -import com.hmdzl.spspd.change.mechanics.ShadowCaster; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.plants.BlandfruitBush; -import com.hmdzl.spspd.change.plants.Plant; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.Scene; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundlable; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; -import com.watabou.utils.SparseArray; - -public abstract class Level implements Bundlable { - - public static enum Feeling { - NONE, CHASM, WATER, GRASS, DARK, TRAP - }; - - - - /* -W-1 -W -W+1 - * -1 P +1 - * W-1 W W+1 - * - */ - - public static int WIDTH = 48; - public static int HEIGHT = 48; - public static int LENGTH = WIDTH * HEIGHT; - - //public static int WIDTH = 50; - //public static int HEIGHT = 50; - //public static int LENGTH = (WIDTH-2) * (HEIGHT-2); - - public static final int[] NEIGHBOURS4 = { -getWidth(), +1, +getWidth(), -1 }; - public static final int[] NEIGHBOURS8 = { +1, -1, +getWidth(), -getWidth(), - +1 + getWidth(), +1 - getWidth(), -1 + getWidth(), -1 - getWidth() }; - public static final int[] NEIGHBOURS9 = { 0, +1, -1, +getWidth(), -getWidth(), - +1 + getWidth(), +1 - getWidth(), -1 + getWidth(), -1 - getWidth() }; - - // Note that use of these without checking values is unsafe, mobs can be - // within 2 tiles of the - // edge of the map, unsafe use in that case will cause an array out of - // bounds exception. - public static final int[] NEIGHBOURS8DIST2 = { +2 + 2 * getWidth(), - +1 + 2 * getWidth(), 2 * getWidth(), -1 + 2 * getWidth(), -2 + 2 * getWidth(), - +2 + getWidth(), +1 + getWidth(), +getWidth(), -1 + getWidth(), -2 + getWidth(), +2, +1, -1, - -2, +2 - getWidth(), +1 - getWidth(), -getWidth(), -1 - getWidth(), -2 - getWidth(), - +2 - 2 * getWidth(), +1 - 2 * getWidth(), -2 * getWidth(), -1 - 2 * getWidth(), - -2 - 2 * getWidth() }; - public static final int[] NEIGHBOURS9DIST2 = { +2 + 2 * getWidth(), - +1 + 2 * getWidth(), 2 * getWidth(), -1 + 2 * getWidth(), -2 + 2 * getWidth(), - +2 + getWidth(), +1 + getWidth(), +getWidth(), -1 + getWidth(), -2 + getWidth(), +2, +1, 0, - -1, -2, +2 - getWidth(), +1 - getWidth(), -getWidth(), -1 - getWidth(), -2 - getWidth(), - +2 - 2 * getWidth(), +1 - 2 * getWidth(), -2 * getWidth(), -1 - 2 * getWidth(), - -2 - 2 * getWidth() }; - - protected static final float TIME_TO_RESPAWN = 50; - protected static final int REGROW_TIMER = 10; - protected static final int DROP_TIMER = 10; - protected static final int PET_TICK = 1; - - private static final String TXT_HIDDEN_PLATE_CLICKS = "A hidden pressure plate clicks!"; - - public static boolean resizingNeeded; - public static boolean first; - public static int loadedMapSize; - - public int[] map; - public boolean[] visited; - public boolean[] mapped; - - public int movepar=0; - public int currentmoves=0; - public boolean genpetnext = false; - - //private int newvd; - public int viewDistance = /*Dungeon.isChallenged(Challenges.DARKNESS) ? 5 :*/ 8; - - public static boolean[] fieldOfView = new boolean[getLength()]; - - public static boolean[] passable = new boolean[getLength()]; - //public static boolean[] losBlocking = new boolean[getLength()]; - public static boolean[] losBlockHigh = new boolean[getLength()]; - public static boolean[] losBlockLow = new boolean[getLength()]; - public static boolean[] flamable = new boolean[getLength()]; - public static boolean[] shockable = new boolean[getLength()]; - public static boolean[] secret = new boolean[getLength()]; - public static boolean[] solid = new boolean[getLength()]; - public static boolean[] avoid = new boolean[getLength()]; - public static boolean[] water = new boolean[getLength()]; - public static boolean[] pit = new boolean[getLength()]; - - public static boolean[] discoverable = new boolean[getLength()]; - - public Feeling feeling = Feeling.NONE; - - - public int entrance; - public int exit; - public int pitSign; - - // when a boss level has become locked. - public boolean locked = false; - public boolean special = false; - public boolean cleared = false; - public boolean forcedone = false; - public boolean sealedlevel = false; - - public HashSet mobs; - public SparseArray heaps; - public HashMap, Blob> blobs; - public SparseArray plants; - public SparseArray traps; - public HashSet customTiles; - - protected ArrayList itemsToSpawn = new ArrayList(); - - public int color1 = 0x004400; - public int color2 = 0x88CC44; - - protected static boolean pitRoomNeeded = false; - protected static boolean weakFloorCreated = false; - public boolean reset = false; - - private static final String MAP = "map"; - private static final String VISITED = "visited"; - private static final String MAPPED = "mapped"; - private static final String ENTRANCE = "entrance"; - private static final String EXIT = "exit"; - private static final String LOCKED = "locked"; - private static final String HEAPS = "heaps"; - private static final String PLANTS = "plants"; - private static final String TRAPS = "traps"; - private static final String CUSTOM_TILES= "customTiles"; - private static final String MOBS = "mobs"; - private static final String BLOBS = "blobs"; - private static final String FEELING = "feeling"; - private static final String PITSIGN = "pitSign"; - private static final String MOVES = "currentmoves"; - private static final String CLEARED = "cleared"; - private static final String RESET = "reset"; - private static final String FORCEDONE = "forcedone"; - private static final String GENPETNEXT = "genpetnext"; - private static final String SEALEDLEVEL = "sealedlevel"; - - - public void create() { - - resizingNeeded = false; - - map = new int[getLength()]; - visited = new boolean[getLength()]; - Arrays.fill(visited, false); - mapped = new boolean[getLength()]; - Arrays.fill(mapped, false); - - mobs = new HashSet(); - heaps = new SparseArray(); - blobs = new HashMap, Blob>(); - plants = new SparseArray(); - traps = new SparseArray<>(); - customTiles = new HashSet<>(); - - if (!Dungeon.bossLevel()) { - addItemToSpawn(Generator.random(Generator.Category.FOOD)); - addItemToSpawn(Generator.random(Generator.Category.FOOD)); - if (Dungeon.posNeeded()) { - addItemToSpawn(new PotionOfStrength()); - Dungeon.limitedDrops.strengthPotions.count++; - } - if (Dungeon.souNeeded()) { - addItemToSpawn(new ScrollOfUpgrade()); - Dungeon.limitedDrops.upgradeScrolls.count++; - } - if (Random.Int(2) == 0) { - addItemToSpawn(new Stylus()); - addItemToSpawn(new Weightstone()); - } - - int bonus = 0; - for (Buff buff : Dungeon.hero.buffs(LuckyBadge.GreatLucky.class)) { - bonus += ((LuckyBadge.GreatLucky) buff).level; - } - if (Dungeon.hero.heroClass == HeroClass.SOLDIER) - bonus += 5; - - for (Buff buff : Dungeon.hero.buffs(AflyBless.class)) { - bonus += 5; - } - if (Random.Float() > Math.pow(0.95, bonus)) { - if (Random.Int(2) == 0) - addItemToSpawn(new ScrollOfMagicalInfusion()); - else - addItemToSpawn(new PotionOfMight()); - } - - DriedRose rose = Dungeon.hero.belongings.getItem(DriedRose.class); - if (rose != null && !rose.cursed) { - // this way if a rose is dropped later in the game, player still - // has a chance to max it out. - int petalsNeeded = (int) Math - .ceil((float) ((Dungeon.depth / 2) - rose.droppedPetals) / 3); - - for (int i = 1; i <= petalsNeeded; i++) { - // the player may miss a single petal and still max their - // rose. - if (rose.droppedPetals < 12) { - addItemToSpawn(new DriedRose.Petal()); - rose.droppedPetals++; - } - } - } - - if (Dungeon.depth > 1 && Dungeon.depth < 6) { - if (Dungeon.depth == 4 && !Dungeon.earlygrass) { - feeling = Feeling.GRASS; - } else { - switch (Random.Int(10)) { - case 0: - if (!Dungeon.bossLevel(Dungeon.depth + 1)) { - feeling = Feeling.CHASM; - } - break; - case 1: - feeling = Feeling.WATER; - break; - case 2: case 3: case 4: - feeling = Feeling.GRASS; - Dungeon.earlygrass = true; - break; - } - } - } else if (Dungeon.depth > 5 && Dungeon.depth < 22) { - switch (Random.Int(10)) { - case 0: - if (!Dungeon.bossLevel(Dungeon.depth + 1)) { - feeling = Feeling.CHASM; - } - break; - case 1: - feeling = Feeling.WATER; - break; - case 2: - feeling = Feeling.GRASS; - break; - case 3: - feeling = Feeling.DARK; - addItemToSpawn(new Torch()); - addItemToSpawn(new Torch()); - addItemToSpawn(new Torch()); - viewDistance = (int) Math.ceil(viewDistance / 3f); - break; - } - } else if (Dungeon.depth > 21 && Dungeon.depth < 27) { - switch (Random.Int(10)) { - case 1: - feeling = Feeling.WATER; - break; - case 2: - feeling = Feeling.GRASS; - break; - case 3: - case 0: - feeling = Feeling.DARK; - addItemToSpawn(new Torch()); - addItemToSpawn(new Torch()); - addItemToSpawn(new Torch()); - viewDistance = (int) Math.ceil(viewDistance / 3f); - break; - } - } else if (Dungeon.depth==29) { - feeling = Feeling.WATER; - } else if (Dungeon.depth==31) { - feeling = Feeling.DARK; - viewDistance = (int) Math.ceil(viewDistance / 3f); - } else if (Dungeon.depth>55) { - addItemToSpawn(new StoneOre()); - addItemToSpawn(new StoneOre()); - addItemToSpawn(new StoneOre()); - addItemToSpawn(new StoneOre()); - addItemToSpawn(new StoneOre()); - addItemToSpawn(new StoneOre()); - addItemToSpawn(new StoneOre()); - addItemToSpawn(new StoneOre()); - addItemToSpawn(new StoneOre()); - }else if (Dungeon.depth==32) { - feeling = Feeling.WATER; - } else if (Dungeon.depth==33) { - feeling = Feeling.TRAP; - } - - } - - boolean pitNeeded = Dungeon.depth > 1 && weakFloorCreated; - - do { - Arrays.fill(map, feeling == Feeling.CHASM ? Terrain.CHASM - : (feeling == Feeling.TRAP ? Terrain.TRAP_AIR : Terrain.WALL)); - - pitRoomNeeded = pitNeeded; - weakFloorCreated = false; - - } while (!build()); - decorate(); - - buildFlagMaps(); - cleanWalls(); - - createMobs(); - createItems(); - } - - public void reset() { - - for (Mob mob : mobs.toArray(new Mob[0])) { - if (!mob.reset()) { - mobs.remove(mob); - } - } - createMobs(); - reset=true; - } - - @Override - public void restoreFromBundle(Bundle bundle) { - - mobs = new HashSet(); - heaps = new SparseArray(); - blobs = new HashMap, Blob>(); - plants = new SparseArray(); - traps = new SparseArray<>(); - customTiles = new HashSet<>(); - - map = bundle.getIntArray(MAP); - visited = bundle.getBooleanArray(VISITED); - mapped = bundle.getBooleanArray(MAPPED); - - entrance = bundle.getInt(ENTRANCE); - exit = bundle.getInt(EXIT); - pitSign = bundle.getInt(PITSIGN); - currentmoves = bundle.getInt(MOVES); - - locked = bundle.getBoolean(LOCKED); - - cleared = bundle.getBoolean(CLEARED); - reset = bundle.getBoolean(RESET); - forcedone = bundle.getBoolean(FORCEDONE); - genpetnext = bundle.getBoolean(GENPETNEXT); - sealedlevel = bundle.getBoolean(SEALEDLEVEL); - - weakFloorCreated = false; - - adjustMapSize(); - - Collection collection = bundle.getCollection(HEAPS); - for (Bundlable h : collection) { - Heap heap = (Heap) h; - if (resizingNeeded) { - heap.pos = adjustPos(heap.pos); - } - if (!heap.isEmpty()) - heaps.put(heap.pos, heap); - } - - collection = bundle.getCollection(PLANTS); - for (Bundlable p : collection) { - Plant plant = (Plant) p; - if (resizingNeeded) { - plant.pos = adjustPos(plant.pos); - } - plants.put(plant.pos, plant); - } - - collection = bundle.getCollection( TRAPS ); - for (Bundlable p : collection) { - Trap trap = (Trap)p; - if (resizingNeeded) { - trap.pos = adjustPos( trap.pos ); - } - traps.put( trap.pos, trap ); - } - - collection = bundle.getCollection(MOBS); - for (Bundlable m : collection) { - Mob mob = (Mob) m; - if (mob != null) { - if (resizingNeeded) { - mob.pos = adjustPos(mob.pos); - } - mobs.add(mob); - } - } - - collection = bundle.getCollection(BLOBS); - for (Bundlable b : collection) { - Blob blob = (Blob) b; - blobs.put(blob.getClass(), blob); - } - - collection = bundle.getCollection( CUSTOM_TILES ); - for (Bundlable p : collection) { - CustomTileVisual vis = (CustomTileVisual)p; - if (resizingNeeded) { - //TODO: add proper resizing logic here - } - customTiles.add( vis ); - } - - feeling = bundle.getEnum(FEELING, Feeling.class); - if (feeling == Feeling.DARK) - viewDistance = (int) Math.ceil(viewDistance / 3f); - - buildFlagMaps(); - cleanWalls(); - } - - @Override - public void storeInBundle(Bundle bundle) { - bundle.put(MAP, map); - bundle.put(VISITED, visited); - bundle.put(MAPPED, mapped); - bundle.put(ENTRANCE, entrance); - bundle.put(EXIT, exit); - bundle.put(LOCKED, locked); - bundle.put(HEAPS, heaps.values()); - bundle.put(PLANTS, plants.values()); - bundle.put( TRAPS, traps.values() ); - bundle.put( CUSTOM_TILES, customTiles ); - bundle.put(MOBS, mobs); - bundle.put(BLOBS, blobs.values()); - bundle.put(FEELING, feeling); - bundle.put(PITSIGN, pitSign); - bundle.put(MOVES, currentmoves); - bundle.put(CLEARED, cleared); - bundle.put(RESET, reset); - bundle.put(FORCEDONE, forcedone); - bundle.put(GENPETNEXT, genpetnext); - bundle.put(SEALEDLEVEL, sealedlevel); - } - - public int tunnelTile() { - return feeling == Feeling.CHASM ? Terrain.EMPTY_SP : (feeling == Feeling.TRAP ? Terrain.EMPTY_SP : Terrain.EMPTY ); - } - - private void adjustMapSize() { - // For levels saved before 1.6.3 - // Seeing as shattered started on 1.7.1 this is never used, but the code - // may be resused in future. - if (map.length < getLength()) { - - resizingNeeded = true; - loadedMapSize = (int) Math.sqrt(map.length); - - int[] map = new int[getLength()]; - Arrays.fill(map, Terrain.WALL); - - boolean[] visited = new boolean[getLength()]; - Arrays.fill(visited, false); - - boolean[] mapped = new boolean[getLength()]; - Arrays.fill(mapped, false); - - for (int i = 0; i < loadedMapSize; i++) { - System.arraycopy(this.map, i * loadedMapSize, map, i * getWidth(), - loadedMapSize); - System.arraycopy(this.visited, i * loadedMapSize, visited, i - * getWidth(), loadedMapSize); - System.arraycopy(this.mapped, i * loadedMapSize, mapped, i - * getWidth(), loadedMapSize); - } - - this.map = map; - this.visited = visited; - this.mapped = mapped; - - entrance = adjustPos(entrance); - exit = adjustPos(exit); - } else { - resizingNeeded = false; - } - } - - public int adjustPos(int pos) { - return (pos / loadedMapSize) * getWidth() + (pos % loadedMapSize); - } - - public String tilesTex() { - return null; - } - - public String waterTex() { - return null; - } - - abstract protected boolean build(); - - abstract protected void decorate(); - - abstract protected void createMobs(); - - abstract protected void createItems(); - - - public void seal(){ - if (!locked) { - locked = true; - //Buff.affect(Dungeon.hero, LockedFloor.class); - } - } - - public void unseal(){ - if (locked) { - locked = false; - } - } - - public void addVisuals(Scene scene) { - for (int i = 0; i < getLength(); i++) { - if (pit[i]) { - scene.add(new WindParticle.Wind(i)); - if (i >= getWidth() && water[i - getWidth()]) { - scene.add(new FlowParticle.Flow(i - getWidth())); - } - } - } - } - - public int nMobs() { - return 0; - } - - public Mob findMob( int pos ){ - for (Mob mob : mobs){ - if (mob.pos == pos){ - return mob; - } - } - return null; - } - - public int movepar(){ - return movepar+Statistics.prevfloormoves; - } - - - public Actor respawner() { - return new Actor() { - @Override - protected boolean act() { - if (((Dungeon.dewDraw || Dungeon.dewWater)&& Dungeon.level.cleared && mobs.size() < nMobs()) - || (!(Dungeon.dewDraw || Dungeon.dewWater) && mobs.size() < nMobs())) - { - Mob mob = Bestiary.mutable(Dungeon.depth); - mob.state = mob.WANDERING; - mob.pos = randomRespawnCell(); - if (Dungeon.hero.isAlive() && mob.pos != -1) { - GameScene.add(mob); - } - } - spend(Dungeon.level.feeling == Feeling.DARK - || Statistics.amuletObtained ? TIME_TO_RESPAWN / 2 - : TIME_TO_RESPAWN); - return true; - } - }; - } - - public Actor respawnerPet() { - return new Actor() { - @Override - protected boolean act() { - //GLog.i("Check Pet"); - int petpos = -1; - int heropos = Dungeon.hero.pos; - if (Actor.findChar(heropos) != null && Dungeon.hero.petfollow) { - //GLog.i("Check Pet 2"); - ArrayList candidates = new ArrayList(); - boolean[] passable = Level.passable; - - for (int n : Level.NEIGHBOURS8) { - int c = heropos + n; - if (passable[c] && Actor.findChar(c) == null) { - candidates.add(c); - } - } - - petpos = candidates.size() > 0 ? Random.element(candidates) : -1; - } - - if (petpos != -1 && Dungeon.hero.haspet && Dungeon.hero.petfollow) { - - PET petCheck = checkpet(); - if(petCheck!=null){petCheck.destroy();petCheck.sprite.killAndErase();} - - if (Dungeon.hero.petType==1){ - Spider pet = new Spider(); - spawnPet(pet,petpos,heropos); - } - if (Dungeon.hero.petType==2){ - CocoCat pet = new CocoCat(); - spawnPet(pet,petpos,heropos); - } - if (Dungeon.hero.petType==3){ - Velocirooster pet = new Velocirooster(); - spawnPet(pet,petpos,heropos); - } - if (Dungeon.hero.petType==4){ - RedDragon pet = new RedDragon(); - spawnPet(pet,petpos,heropos); - } - if (Dungeon.hero.petType==5){ - GreenDragon pet = new GreenDragon(); - spawnPet(pet,petpos,heropos); - } - if (Dungeon.hero.petType==6){ - VioletDragon pet = new VioletDragon(); - spawnPet(pet,petpos,heropos); - } - if (Dungeon.hero.petType==7){ - BlueDragon pet = new BlueDragon(); - spawnPet(pet,petpos,heropos); - } - if (Dungeon.hero.petType==8){ - Scorpion pet = new Scorpion(); - spawnPet(pet,petpos,heropos); - } - if (Dungeon.hero.petType==9){ - Bunny pet = new Bunny(); - spawnPet(pet,petpos,heropos); - } - if (Dungeon.hero.petType==10){ - LightDragon pet = new LightDragon(); - spawnPet(pet,petpos,heropos); - } - if (Dungeon.hero.petType==11){ - BugDragon pet = new BugDragon(); - spawnPet(pet,petpos,heropos); - } - if (Dungeon.hero.petType==12){ - ShadowDragon pet = new ShadowDragon(); - spawnPet(pet,petpos,heropos); - } - if (Dungeon.hero.petType==13){ - CocoCat pet = new CocoCat(); - spawnPet(pet,petpos,heropos); - } - if (Dungeon.hero.petType==14){ - LeryFire pet = new LeryFire(); - spawnPet(pet,petpos,heropos); - } - if (Dungeon.hero.petType==15){ - GoldDragon pet = new GoldDragon(); - spawnPet(pet,petpos,heropos); - } - if (Dungeon.hero.petType==16){ - Snake pet = new Snake(); - spawnPet(pet,petpos,heropos); - } - if (Dungeon.hero.petType==17){ - Fly pet = new Fly(); - spawnPet(pet,petpos,heropos); - } - if (Dungeon.hero.petType==18){ - Stone pet = new Stone(); - spawnPet(pet,petpos,heropos); - } - if (Dungeon.hero.petType==19){ - Monkey pet = new Monkey(); - spawnPet(pet,petpos,heropos); - } - if (Dungeon.hero.petType==20){ - GentleCrab pet = new GentleCrab(); - spawnPet(pet,petpos,heropos); - } - if (Dungeon.hero.petType==21){ - RibbonRat pet = new RibbonRat(); - spawnPet(pet,petpos,heropos); - } - if (Dungeon.hero.petType==22){ - YearPet pet = new YearPet(); - spawnPet(pet,petpos,heropos); - } - } - - spend(PET_TICK); - return true; - } - }; - } - - private PET checkpet(){ - for (Mob mob : Dungeon.level.mobs) { - if(mob instanceof PET) { - return (PET) mob; - } - } - return null; - } - - public void spawnPet(PET pet, Integer petpos, Integer heropos){ - pet.spawn(Dungeon.hero.petLevel); - pet.HP = Dungeon.hero.petHP; - pet.pos = petpos; - pet.state = pet.HUNTING; - pet.experience = Dungeon.hero.petExperience; - pet.cooldown = Dungeon.hero.petCooldown; - - GameScene.add(pet); - Actor.addDelayed(new Pushing(pet, heropos, petpos), -1f); - Dungeon.hero.petfollow = false; - } - - public boolean checkOriginalGenMobs (){ - for (Mob mob : Dungeon.level.mobs.toArray(new Mob[0])) { - if (mob.originalgen){return true;} - } - return false; - } - - public Actor regrower() { - return new Actor() { - @Override - protected boolean act() { - - int growPos = -1; - for (int i = 0; i < 20; i++) { - growPos = randomRegrowthCell(); - - if (growPos != -1) { - break; - } - } - if (growPos != -1) { - if (map[growPos] == Terrain.GRASS){ - Level.set(growPos, Terrain.HIGH_GRASS); - } - GameScene.updateMap(); - Dungeon.observe(); - } - - - spend(REGROW_TIMER); - return true; - } - }; - } - - public Actor waterer() { - return new Actor() { - @Override - protected boolean act() { - - int growPos = -1; - for (int i = 0; i < 20; i++) { - growPos = randomRegrowthCell(); - - if (growPos != -1) { - break; - } - } - if (growPos != -1) { - if (map[growPos] == Terrain.GRASS || map[growPos] == Terrain.EMBERS){ - Level.set(growPos, Terrain.WATER); - } - GameScene.updateMap(); - Dungeon.observe(); - } - - - spend(REGROW_TIMER); - return true; - } - }; - } - - public int randomRegrowthCell() { - int cell; - int count = 1; - do { - cell = Random.Int(getLength()); - count++; - } while (map[cell] != Terrain.GRASS && count < 100); - return cell; - } - - public Actor floordropper() { - return new Actor() { - @Override - protected boolean act() { - - int dropPos = -1; - for (int i = 0; i < 20; i++) { - dropPos = randomChasmCell(); - - if (dropPos != -1) { - //GLog.i("one "); - break; - } - } - - if (dropPos != -1) { - - //GLog.i("two %s",dropPos); - if (map[dropPos] == Terrain.EMPTY && Actor.findChar(dropPos) == null){ - - //GLog.i("three "); - //if the tile above is not chasm then set to chasm floor. If is chasm then set to chasm - - if (map[dropPos-getWidth()]==Terrain.WALL || - map[dropPos-getWidth()]==Terrain.WALL_DECO){ - - set(dropPos, Terrain.CHASM_WALL); - //GLog.i("four "); - } - else if (map[dropPos-getWidth()]!=Terrain.CHASM && - map[dropPos-getWidth()]!=Terrain.CHASM_FLOOR && - map[dropPos-getWidth()]!=Terrain.CHASM_WALL) - { - set(dropPos, Terrain.CHASM_FLOOR); - } - else { - set(dropPos, Terrain.CHASM); - // GLog.i("five "); - } - - if (map[dropPos+getWidth()]==Terrain.CHASM_FLOOR){ - set(dropPos+getWidth(), Terrain.CHASM); - // GLog.i("six "); - } - - - } - GameScene.updateMap(dropPos); - GameScene.updateMap(dropPos-getWidth()); - GameScene.updateMap(dropPos+getWidth()); - Dungeon.observe(); - } - - spend(DROP_TIMER); - return true; - } - }; - } - - public int randomChasmCell() { - int cell; - int count = 1; - do { - cell = Random.Int(getWidth()+1, getLength()-(getWidth()+1)); - count++; - } while (map[cell] != Terrain.EMPTY && count < 100); - return cell; - } - - public int randomRespawnCell() { - int cell; - do { - cell = Random.Int(getLength()); - } while (!passable[cell] || Dungeon.visible[cell] - || Actor.findChar(cell) != null); - return cell; - } - - public int randomRespawnCellMob() { - int cell; - do { - cell = Random.Int(getLength()); - } while (!passable[cell] || Dungeon.visible[cell] - || Actor.findChar(cell) != null); - return cell; - } - - public int dropRespawnCell() { - int cell; - do { - cell = Random.Int(getLength()); - } while ((map[cell]!=Terrain.EMPTY && - map[cell]!=Terrain.EMPTY_DECO && - map[cell]!=Terrain.EMPTY_SP && - map[cell]!=Terrain.GRASS && - map[cell]!=Terrain.WATER) - || !passable[cell]); - return cell; - } - - public int wellRespawnCellMob() { - int cell; - do { - cell = Random.Int(getLength()); - } while (!passable[cell] || map[cell]!=Terrain.EMPTY_WELL || Dungeon.visible[cell] - || Actor.findChar(cell) != null); - return cell; - } - - public int randomRespawnCellSheep(int start, int dist) { - int cell; - do { - cell = Random.Int(getLength()); - } while (!avoid[cell] || Actor.findChar(cell) != null || map[cell]!=Terrain.FLEECING_TRAP - || distance(start, cell) > dist); - return cell; - } - - public int countFleeceTraps(int start, int dist) { - int count=0; - for (int cell = 0; cell < getLength(); cell++) { - if(avoid[cell] && Actor.findChar(cell) == null && map[cell]==Terrain.FLEECING_TRAP && distance(start, cell) < dist){ - count++; - } - } - return count; - } - - - public int randomRespawnCellFish() { - int cell; - do { - cell = Random.Int(getLength()); - } while (!passable[cell] || Actor.findChar(cell) != null || (map[cell]!=Terrain.EMPTY && map[cell]!=Terrain.EMPTY_SP && map[cell]!=Terrain.GRASS && map[cell]!=Terrain.HIGH_GRASS) ); - return cell; - } - - public int randomDestination() { - int cell; - do { - cell = Random.Int(getLength()); - } while (!passable[cell]); - return cell; - } - - public void addItemToSpawn(Item item) { - if (item != null) { - itemsToSpawn.add(item); - } - } - - public Item findPrizeItem() { - return findPrizeItem(null); - } - - public Item findPrizeItem(Class match) { - if (itemsToSpawn.size() == 0) - return null; - - if (match == null) { - Item item = Random.element(itemsToSpawn); - itemsToSpawn.remove(item); - return item; - } - - for (Item item : itemsToSpawn) { - if (match.isInstance(item)) { - itemsToSpawn.remove(item); - return item; - } - } - - return null; - } - - protected void buildFlagMaps() { - - for (int i = 0; i < getLength(); i++) { - int flags = Terrain.flags[map[i]]; - passable[i] = (flags & Terrain.PASSABLE) != 0; - //losBlocking[i] = (flags & Terrain.LOS_BLOCKING) != 0; - losBlockLow[i] = (flags & Terrain.LOS_BLOCKING) != 0; - losBlockHigh[i] = losBlockLow[i] && (flags & Terrain.SOLID) != 0 ; - flamable[i] = (flags & Terrain.FLAMABLE) != 0; - //shockable[i] = (flags & Terrain.SHOCKABLE) != 0; - secret[i] = (flags & Terrain.SECRET) != 0; - solid[i] = (flags & Terrain.SOLID) != 0; - avoid[i] = (flags & Terrain.AVOID) != 0; - water[i] = (flags & Terrain.LIQUID) != 0; - pit[i] = (flags & Terrain.PIT) != 0; - } - - int lastRow = getLength() - getWidth(); - for (int i = 0; i < getWidth(); i++) { - passable[i] = avoid[i] = false; - passable[lastRow + i] = avoid[lastRow + i] = false; - } - for (int i = getWidth(); i < lastRow; i += getWidth()) { - passable[i] = avoid[i] = false; - passable[i + getWidth() - 1] = avoid[i + getWidth() - 1] = false; - } - - for (int i = getWidth(); i < getLength() - getWidth(); i++) { - - if (water[i]) { - int t = Terrain.WATER_TILES; - for (int j = 0; j < NEIGHBOURS4.length; j++) { - if ((Terrain.flags[map[i + NEIGHBOURS4[j]]] & Terrain.UNSTITCHABLE) != 0) { - t += 1 << j; - } - } - map[i] = t; - } - - if (pit[i]) { - if (!pit[i - getWidth()]) { - int c = map[i - getWidth()]; - if (c == Terrain.EMPTY_SP || c == Terrain.STATUE_SP) { - map[i] = Terrain.CHASM_FLOOR_SP; - } else if (water[i - getWidth()]) { - map[i] = Terrain.CHASM_WATER; - } else if ((Terrain.flags[c] & Terrain.UNSTITCHABLE) != 0) { - map[i] = Terrain.CHASM_WALL; - } else { - map[i] = Terrain.CHASM_FLOOR; - } - } - } - } - } - - private int getWaterTile( int pos ) { - int t = Terrain.WATER_TILES; - for (int j=0; j < NEIGHBOURS4.length; j++) { - if ((Terrain.flags[map[pos + NEIGHBOURS4[j]]] & Terrain.UNSTITCHABLE) != 0) { - t += 1 << j; - } - } - return t; - } - - public void destroy( int pos ) { - if ((Terrain.flags[map[pos]] & Terrain.UNSTITCHABLE) == 0) { - - set( pos, Terrain.EMBERS ); - - } else { - boolean flood = false; - for (int j=0; j < NEIGHBOURS4.length; j++) { - if (water[pos + NEIGHBOURS4[j]]) { - flood = true; - break; - } - } - if (flood) { - set( pos, getWaterTile( pos ) ); - } else { - set( pos, Terrain.EMBERS ); - } - } - } - - protected void cleanWalls() { - for (int i = 0; i < getLength(); i++) { - - boolean d = false; - - for (int j = 0; j < NEIGHBOURS9.length; j++) { - int n = i + NEIGHBOURS9[j]; - if (n >= 0 && n < getLength() && map[n] != Terrain.WALL - && map[n] != Terrain.WALL_DECO) { - d = true; - break; - } - } - - if (d) { - d = false; - - for (int j = 0; j < NEIGHBOURS9.length; j++) { - int n = i + NEIGHBOURS9[j]; - if (n >= 0 && n < getLength() && !pit[n]) { - d = true; - break; - } - } - } - - discoverable[i] = d; - } - } - - public static void set(int cell, int terrain) { - Painter.set(Dungeon.level, cell, terrain); - - int flags = Terrain.flags[terrain]; - passable[cell] = (flags & Terrain.PASSABLE) != 0; - //losBlocking[cell] = (flags & Terrain.LOS_BLOCKING) != 0; - losBlockLow[cell] = (flags & Terrain.LOS_BLOCKING) != 0; - losBlockHigh[cell] = losBlockLow[cell] && (flags & Terrain.SOLID) != 0; - flamable[cell] = (flags & Terrain.FLAMABLE) != 0; - //shockable[cell] = (flags & Terrain.SHOCKABLE) != 0; - secret[cell] = (flags & Terrain.SECRET) != 0; - solid[cell] = (flags & Terrain.SOLID) != 0; - avoid[cell] = (flags & Terrain.AVOID) != 0; - pit[cell] = (flags & Terrain.PIT) != 0; - water[cell] = terrain == Terrain.WATER || (terrain >= Terrain.WATER_TILES && terrain 1) || !sighted) { - - int ax = Math.max(0, cx - sense); - int bx = Math.min(cx + sense, getWidth() - 1); - int ay = Math.max(0, cy - sense); - int by = Math.min(cy + sense, HEIGHT - 1); - - int len = bx - ax + 1; - int pos = ax + ay * getWidth(); - for (int y = ay; y <= by; y++, pos += getWidth()) { - Arrays.fill(fieldOfView, pos, pos + len, true); - } - - for (int i = 0; i < getLength(); i++) { - fieldOfView[i] &= discoverable[i]; - } - } - - if (c.isAlive() && c == Dungeon.hero) { - if (c.buff(MindVision.class) != null) { - for (Mob mob : mobs) { - int p = mob.pos; - fieldOfView[p] = true; - fieldOfView[p + 1] = true; - fieldOfView[p - 1] = true; - fieldOfView[p + getWidth() + 1] = true; - fieldOfView[p + getWidth() - 1] = true; - fieldOfView[p - getWidth() + 1] = true; - fieldOfView[p - getWidth() - 1] = true; - fieldOfView[p + getWidth()] = true; - fieldOfView[p - getWidth()] = true; - } - } else if (((Hero) c).heroClass == HeroClass.HUNTRESS) { - for (Mob mob : mobs) { - int p = mob.pos; - if (distance(c.pos, p) == 2) { - fieldOfView[p] = true; - fieldOfView[p + 1] = true; - fieldOfView[p - 1] = true; - fieldOfView[p + getWidth() + 1] = true; - fieldOfView[p + getWidth() - 1] = true; - fieldOfView[p - getWidth() + 1] = true; - fieldOfView[p - getWidth() - 1] = true; - fieldOfView[p + getWidth()] = true; - fieldOfView[p - getWidth()] = true; - } - } - } - if (c.buff(Awareness.class) != null) { - for (Heap heap : heaps.values()) { - int p = heap.pos; - fieldOfView[p] = true; - fieldOfView[p + 1] = true; - fieldOfView[p - 1] = true; - fieldOfView[p + getWidth() + 1] = true; - fieldOfView[p + getWidth() - 1] = true; - fieldOfView[p - getWidth() + 1] = true; - fieldOfView[p - getWidth() - 1] = true; - fieldOfView[p + getWidth()] = true; - fieldOfView[p - getWidth()] = true; - } - } - - if (c.buff(ExitFind.class) != null && Dungeon.depth < 26) { - int p = Dungeon.level.exit; - fieldOfView[p] = true; - fieldOfView[p + 1] = true; - fieldOfView[p - 1] = true; - fieldOfView[p + getWidth() + 1] = true; - fieldOfView[p + getWidth() - 1] = true; - fieldOfView[p - getWidth() + 1] = true; - fieldOfView[p - getWidth() - 1] = true; - fieldOfView[p + getWidth()] = true; - fieldOfView[p - getWidth()] = true; - - } - } - - for (Heap heap : heaps.values()) - if (!heap.seen && fieldOfView[heap.pos]) - heap.seen = true; - - return fieldOfView; - } - - public static int distance(int a, int b) { - int ax = a % getWidth(); - int ay = a / getWidth(); - int bx = b % getWidth(); - int by = b / getWidth(); - return Math.max(Math.abs(ax - bx), Math.abs(ay - by)); - } - - public static boolean adjacent(int a, int b) { - int diff = Math.abs(a - b); - return diff == 1 || diff == getWidth() || diff == getWidth() + 1 - || diff == getWidth() - 1; - } - - public static boolean insideMap( int tile ){ - //outside map array - return !((tile <= -1 || tile >= LENGTH) || - //top and bottom row - (tile <= 47 || tile >= LENGTH - WIDTH) || - //left and right column - (tile % WIDTH == 0 || tile % WIDTH == 47)); - - } - - public String tileName(int tile) { - - if (tile >= Terrain.WATER_TILES) { - return tileName(Terrain.WATER); - } - // && tile= Terrain.WATER_TILES) { - return tileDesc(Terrain.WATER); - } - if ((Terrain.flags[tile] & Terrain.PIT) != 0) { - return tileDesc(Terrain.CHASM); - } - return Messages.get(Level.class, "default_desc"); - } - } - - /* - -public static final int FLEECING_TRAP = 65; - public static final int WOOL_RUG = 66; - public static final int SOKOBAN_SHEEP = 67; - public static final int CORNER_SOKOBAN_SHEEP = 68; - public static final int SWITCH_SOKOBAN_SHEEP = 69; - public static final int CHANGE_SHEEP_TRAP = 70; - public static final int SOKOBAN_ITEM_REVEAL = 71; - public static final int SOKOBAN_HEAP = 72; - public static final int BLACK_SOKOBAN_SHEEP = 73; - public static final int SOKOBAN_PORT_SWITCH = 75; - public static final int PORT_WELL = 74; -*/ - public boolean darkness(){ - return (Dungeon.isChallenged(Challenges.DARKNESS) || Dungeon.level.feeling == Feeling.DARK); - } - public static int getWidth() { - return WIDTH; - } - - public static int getLength() { - return LENGTH; - } -} diff --git a/java/com/hmdzl/spspd/change/levels/MazeLayout.java b/java/com/hmdzl/spspd/change/levels/MazeLayout.java deleted file mode 100644 index 5a9c21d6..00000000 --- a/java/com/hmdzl/spspd/change/levels/MazeLayout.java +++ /dev/null @@ -1,219 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels; - -import com.hmdzl.spspd.change.Dungeon; -import com.watabou.utils.Random; - -public class MazeLayout { - - //32X32 - private static final int W = Terrain.WALL; - private static final int T = Terrain.SHRUB; - private static final int Z = Terrain.HIGH_GRASS; - private static final int D = Terrain.DOOR; - private static final int L = Terrain.LOCKED_DOOR; - - //private static final int T = Terrain.INACTIVE_TRAP; - - private static final int E = Terrain.EMPTY; - //private static final int X = Terrain.EXIT; - - private static final int M = Terrain.WALL_DECO; - //private static final int P = Terrain.PEDESTAL; - - private static final int A = Terrain.SOKOBAN_SHEEP; - private static final int X = Terrain.CORNER_SOKOBAN_SHEEP; - private static final int C = Terrain.SWITCH_SOKOBAN_SHEEP; - private static final int B = Terrain.BLACK_SOKOBAN_SHEEP; - private static final int H = Terrain.SOKOBAN_HEAP; - private static final int I = Terrain.SOKOBAN_ITEM_REVEAL; - private static final int F = Terrain.FLEECING_TRAP; - private static final int U = Terrain.STATUE; - private static final int G = Terrain.CHANGE_SHEEP_TRAP; - private static final int S = Terrain.SECRET_DOOR; - private static final int R = Terrain.PORT_WELL; - private static final int V = Terrain.SOKOBAN_PORT_SWITCH; - /* - public boolean[][] maze; - */ - /* - public static final int[] MAZE1 = { - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, _, _, _, _, _, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, H, _, W, _, Z, Z, Z, _, W, Z, Z, Z, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, H, _, L, _, Z, E, Z, _, L, Z, Z, Z, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, H, _, W, _, Z, Z, Z, _, W, Z, Z, Z, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, I, X, _, _, _, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W - - }; - - */ - - /* - protected void buildMazeMask() { - - maze = new boolean[Level.WIDTH][Level.HEIGHT]; - - for (int x = 0; x < maze.length; x++) { - for (int y = 0; y < maze[0].length; y++) { - if (x == 0 || x == maze.length|| - y == 0 || y == maze[0].length) { - - - if (d.x == x + room.left && d.y == y + room.top) { - maze[x][y] = true; - } - } - - } else { - maze[x][y] = true; - } - } - } - - int fails = 0; - while (fails < 10000) { - - //find a random wall point - int x, y; - do { - x = Random.Int(maze.length); - y = Random.Int(maze[0].length); - } while (maze[x][y]); - - //decide on how we're going to move - int[] mov = decideDirection(maze, x, y); - if (mov == null) { - fails++; - } else { - - fails = 0; - int moves = 0; - do { - x += mov[0]; - y += mov[1]; - maze[x][y] = false; - moves++; - } while (Random.Int(moves+1) == 0 && checkValidMove(maze, x, y, mov)); - - } - - } - - fill(level, room, 1, Terrain.EMPTY); - for (int x = 0; x < maze.length; x++) - for (int y = 0; y < maze[0].length; y++) { - if (!maze[x][y]) { - fill(level, x + room.left, y + room.top, 1, 1, Terrain.WALL); - } - } - } - - - private static int[] decideDirection(boolean[][] maze, int x, int y){ - - //attempts to move up - if (Random.Int(4) == 0 && //1 in 4 chance - checkValidMove(maze, x, y, new int[]{0, -1})){ - return new int[]{0, -1}; - } - - //attempts to move right - if (Random.Int(3) == 0 && //1 in 3 chance - checkValidMove(maze, x, y, new int[]{1, 0})){ - return new int[]{1, 0}; - } - - //attempts to move down - if (Random.Int(2) == 0 && //1 in 2 chance - checkValidMove(maze, x, y, new int[]{0, 1})){ - return new int[]{0, 1}; - } - - //attempts to move left - if ( - checkValidMove(maze, x, y, new int[]{-1, 0})){ - return new int[]{-1, 0}; - } - - return null; - } - - private static boolean checkValidMove( boolean[][] maze, int x, int y, int[] mov){ - int sideX = 1 - Math.abs(mov[0]); - int sideY = 1 - Math.abs(mov[1]); - - //checking two tiles forward in the movement, and the tiles to their left/right - for (int i = 0; i < 2; i ++) { - x += mov[0]; - y += mov[1]; - //checks if tiles we're examining are valid and open - if ( x > 0 && x < maze.length-1 && y > 0 && y < maze[0].length-1 && - maze[x][y] && maze[x + sideX][y+ sideY] && maze[x - sideX][y - sideY]){ - continue; - } else { - return false; - } - } - return true; - } - */ -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/levels/MineBossLayouts.java b/java/com/hmdzl/spspd/change/levels/MineBossLayouts.java deleted file mode 100644 index 82954ce3..00000000 --- a/java/com/hmdzl/spspd/change/levels/MineBossLayouts.java +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels; - -import com.watabou.utils.Random; - -public class MineBossLayouts { - - //32X32 - private static final int W = Terrain.WALL; - private static final int T = Terrain.SHRUB; - private static final int Z = Terrain.HIGH_GRASS; - private static final int D = Terrain.DOOR; - private static final int L = Terrain.LOCKED_DOOR; - - //private static final int T = Terrain.INACTIVE_TRAP; - - private static final int E = Terrain.EMPTY; - //private static final int I = Terrain.EXIT; - - private static final int M = Terrain.WALL_DECO; - //private static final int P = Terrain.PEDESTAL; - - private static final int A = Terrain.SOKOBAN_SHEEP; - private static final int X = Terrain.CORNER_SOKOBAN_SHEEP; - private static final int C = Terrain.SWITCH_SOKOBAN_SHEEP; - private static final int B = Terrain.BLACK_SOKOBAN_SHEEP; - private static final int H = Terrain.SOKOBAN_HEAP; - //private static final int I = Terrain.SOKOBAN_ITEM_REVEAL; - private static final int F = Terrain.FLEECING_TRAP; - private static final int U = Terrain.STATUE; - private static final int G = Terrain.CHANGE_SHEEP_TRAP; - private static final int S = Terrain.SECRET_DOOR; - private static final int R = Terrain.PORT_WELL; - private static final int V = Terrain.SOKOBAN_PORT_SWITCH; - - private static final int J = Terrain.WATER; - private static final int Y = Terrain.ALCHEMY; - private static final int K = Terrain.EMPTY_SP; - - public static final int[] MINE_BOSS = { - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, E, E, E, E, E, E, E, E, X, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, W, W, W, W, W, W, - W, W, W, W, E, E, E, E, E, E, X, E, E, E, E, E, E, E, X, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, W, W, W, W, - W, W, W, W, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, W, W, W, W, - W, W, W, W, E, E, E, E, E, E, E, A, A, A, A, A, A, A, E, E, E, E, E, E, E, E, E, E, E, E, A, A, A, A, A, A, A, E, E, E, E, E, E, E, W, W, W, W, - W, W, W, W, E, E, E, E, E, E, E, A, A, A, A, A, A, A, E, E, E, E, E, E, E, E, E, E, E, E, A, A, A, A, A, A, A, E, E, E, E, E, E, E, W, W, W, W, - W, W, W, W, E, E, E, E, E, E, E, A, A, A, A, A, A, A, E, E, E, E, E, E, E, E, E, E, E, E, A, A, E, E, E, A, A, E, E, E, E, E, E, E, W, W, W, W, - W, W, W, W, E, E, E, E, E, X, E, A, A, A, E, A, A, A, E, X, E, E, E, E, E, E, E, E, E, E, A, A, E, E, E, A, A, E, E, E, E, E, E, E, W, W, W, W, - W, W, W, W, E, E, E, E, E, E, E, A, A, A, A, A, A, A, E, E, E, E, E, E, E, E, E, E, E, E, A, A, E, E, E, A, A, E, E, E, E, E, E, E, W, W, W, W, - W, W, W, W, E, E, E, E, E, E, E, A, A, A, A, A, A, A, E, E, E, E, E, E, E, E, E, E, E, E, A, A, A, A, A, A, A, E, E, E, E, E, E, E, W, W, W, W, - W, W, W, W, E, E, E, E, E, E, E, A, A, A, A, A, A, A, E, E, E, E, E, E, E, E, E, E, E, E, A, A, A, A, A, A, A, E, E, E, E, E, E, E, W, W, W, W, - W, W, W, W, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, W, W, W, W, - W, W, W, W, E, E, E, E, E, E, X, E, E, E, E, E, E, E, X, E, E, E, E, U, U, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, W, W, W, W, - W, W, W, W, E, E, E, E, E, E, E, E, E, E, X, E, E, E, E, E, E, E, E, U, U, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, W, W, W, W, - W, W, W, W, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, U, U, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, W, W, W, W, - W, W, W, W, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, U, U, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, W, W, W, W, - W, W, W, W, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, U, E, E, U, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, W, W, W, W, - W, W, W, W, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, W, W, W, W, - W, W, W, W, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, W, W, W, W, - W, W, W, W, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, W, W, W, W, - W, W, W, W, W, W, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, W, W, W, W, W, W, - W, W, W, W, W, W, W, E, E, E, E, E, W, W, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, W, W, E, E, E, E, E, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, E, E, E, W, W, W, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, W, W, W, E, E, E, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, L, W, W, W, W, W, W, L, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, E, E, E, E, E, E, E, E, E, E, E, E, E, E, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, E, W, E, W, E, W, E, E, W, E, W, E, W, E, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, E, W, E, W, E, W, E, E, W, E, W, E, W, E, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, E, W, E, W, E, E, E, E, E, E, W, E, W, E, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, E, W, E, E, E, E, E, E, E, E, E, E, W, E, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, E, W, E, W, E, W, E, E, W, E, W, E, W, E, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, E, W, E, W, E, W, E, E, W, E, W, E, W, E, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, E, E, E, W, E, W, E, E, W, E, W, E, E, E, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W - }; - -} diff --git a/java/com/hmdzl/spspd/change/levels/MinesBossLevel.java b/java/com/hmdzl/spspd/change/levels/MinesBossLevel.java deleted file mode 100644 index ed4b33bc..00000000 --- a/java/com/hmdzl/spspd/change/levels/MinesBossLevel.java +++ /dev/null @@ -1,317 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.WellWater; -import com.hmdzl.spspd.change.actors.mobs.LitTower; -import com.hmdzl.spspd.change.actors.mobs.MineSentinel; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.actors.mobs.Otiluke; -import com.hmdzl.spspd.change.actors.mobs.npcs.SheepSokoban; -import com.hmdzl.spspd.change.actors.mobs.npcs.SheepSokobanBlack; -import com.hmdzl.spspd.change.actors.mobs.npcs.SheepSokobanCorner; -import com.hmdzl.spspd.change.actors.mobs.npcs.SheepSokobanSwitch; -import com.hmdzl.spspd.change.items.Heap; -import com.hmdzl.spspd.change.items.Palantir; -import com.hmdzl.spspd.change.items.artifacts.TimekeepersHourglass; -import com.hmdzl.spspd.change.items.keys.IronKey; -import com.hmdzl.spspd.change.levels.features.Chasm; -import com.hmdzl.spspd.change.levels.features.Door; -import com.hmdzl.spspd.change.levels.features.HighGrass; -import com.hmdzl.spspd.change.levels.traps.ChangeSheepTrap; -import com.hmdzl.spspd.change.levels.traps.FleecingTrap; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.plants.Plant; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.windows.WndOtilukeMessage; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundle; - -public class MinesBossLevel extends Level { - - - { - color1 = 0x534f3e; - color2 = 0xb9d661; - WIDTH = 48; - HEIGHT = 48; - LENGTH = HEIGHT*WIDTH; - - } - - - private boolean entered = false; - private static final String ENTERED = "entered"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(ENTERED, entered); - - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - entered = bundle.getBoolean(ENTERED); - - } - - - - @Override - public void press(int cell, Char ch) { - - - if (ch == Dungeon.hero && !entered) { - - entered = true; - locked = true; - GameScene.show(new WndOtilukeMessage()); - - } - - if (pit[cell] && ch == Dungeon.hero) { - Chasm.heroFall(cell); - return; - } - - TimekeepersHourglass.timeFreeze timeFreeze = null; - - if (ch != null) - timeFreeze = ch.buff(TimekeepersHourglass.timeFreeze.class); - - boolean trap = false; - - switch (map[cell]) { - - case Terrain.FLEECING_TRAP: - - if (ch != null && ch==Dungeon.hero){ - trap = true; - FleecingTrap.trigger(cell, ch); - } - break; - - case Terrain.CHANGE_SHEEP_TRAP: - - if (ch instanceof SheepSokoban || ch instanceof SheepSokobanSwitch || ch instanceof SheepSokobanCorner ){ - trap = true; - ChangeSheepTrap.trigger(cell, ch); - } - break; - - - case Terrain.HIGH_GRASS: - HighGrass.trample(this, cell, ch); - break; - - case Terrain.WELL: - WellWater.affectCell(cell); - break; - - /*case Terrain.ALCHEMY: - if (ch == null) { - Alchemy.transmute(cell); - } - break;*/ - - case Terrain.DOOR: - Door.enter(cell); - break; - } - - if (trap){ - - if (Dungeon.visible[cell]) - Sample.INSTANCE.play(Assets.SND_TRAP); - - if (ch == Dungeon.hero) - Dungeon.hero.interrupt(); - - set(cell, Terrain.INACTIVE_TRAP); - GameScene.updateMap(cell); - } - - Plant plant = plants.get(cell); - if (plant != null) { - plant.activate(ch); - } - } - - - - @Override - public void mobPress(Mob mob) { - - int cell = mob.pos; - - if (pit[cell] && !mob.flying) { - Chasm.mobFall(mob); - return; - } - - boolean trap = true; - boolean fleece = false; - boolean sheep = false; - switch (map[cell]) { - - case Terrain.FLEECING_TRAP: - if (mob instanceof SheepSokoban || mob instanceof SheepSokobanSwitch || mob instanceof SheepSokobanCorner || mob instanceof SheepSokobanBlack ){ - fleece=true; - } - FleecingTrap.trigger(cell, mob); - break; - - case Terrain.DOOR: - Door.enter(cell); - - default: - trap = false; - } - - if (trap && !fleece && !sheep) { - if (Dungeon.visible[cell]) { - Sample.INSTANCE.play(Assets.SND_TRAP); - } - set(cell, Terrain.INACTIVE_TRAP); - GameScene.updateMap(cell); - } - - if (trap && fleece) { - if (Dungeon.visible[cell]) { - Sample.INSTANCE.play(Assets.SND_TRAP); - } - set(cell, Terrain.WOOL_RUG); - GameScene.updateMap(cell); - } - - if (trap && sheep) { - if (Dungeon.visible[cell]) { - Sample.INSTANCE.play(Assets.SND_TRAP); - } - set(cell, Terrain.EMPTY); - GameScene.updateMap(cell); - } - - - Plant plant = plants.get(cell); - if (plant != null) { - plant.activate(mob); - } - - Dungeon.observe(); - } - - @Override - public String tilesTex() { - return Assets.TILES_PUZZLE; - } - - @Override - public String waterTex() { - return Assets.WATER_PRISON; - } - - @Override - protected boolean build() { - - - map = MineBossLayouts.MINE_BOSS.clone(); - - decorate(); - - buildFlagMaps(); - cleanWalls(); - - entrance = 17 + WIDTH * 44; - exit = 0 ; - - - return true; - } - @Override - protected void decorate() { - //do nothing, all decorations are hard-coded. - } - - @Override - protected void createMobs() { - for (int i = 0; i < LENGTH; i++) { - if (map[i]==Terrain.SOKOBAN_SHEEP){ - MineSentinel npc = new MineSentinel(); - mobs.add(npc); npc.pos = i; - Actor.occupyCell(npc); - } else if (map[i]==Terrain.CORNER_SOKOBAN_SHEEP){ - LitTower npc = new LitTower(); - mobs.add(npc); npc.pos = i; - Actor.occupyCell(npc); - } - } - - Otiluke mob = new Otiluke(); - mobs.add(mob); mob.pos = 33 + WIDTH * 10; - Actor.occupyCell(mob); - } - - - - - @Override - public String tileName( int tile ) { - switch (tile) { - case Terrain.WATER: - return Messages.get(PrisonLevel.class, "water_name"); - default: - return super.tileName( tile ); - } - } - - @Override - public String tileDesc(int tile) { - switch (tile) { - case Terrain.EMPTY_DECO: - return Messages.get(PrisonLevel.class, "empty_deco_desc"); - case Terrain.BOOKSHELF: - return Messages.get(PrisonLevel.class, "bookshelf_desc"); - default: - return super.tileDesc( tile ); - } - } - - - - @Override - protected void createItems() { - - drop(new IronKey(Dungeon.depth), 30 + WIDTH * 44).type = Heap.Type.CHEST; - drop(new Palantir(), 14 + WIDTH * 10); - - } - - @Override - public int randomRespawnCell() { - return -1; - } - - -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/levels/Patch.java b/java/com/hmdzl/spspd/change/levels/Patch.java deleted file mode 100644 index fa9a8bc1..00000000 --- a/java/com/hmdzl/spspd/change/levels/Patch.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels; - -import com.watabou.utils.Random; - -public class Patch { - - private static boolean[] cur = new boolean[Level.getLength()]; - private static boolean[] off = new boolean[Level.getLength()]; - - public static boolean[] generate(float seed, int nGen) { - - int w = Level.getWidth(); - int h = Level.HEIGHT; - - for (int i = 0; i < Level.getLength(); i++) { - off[i] = Random.Float() < seed; - } - - for (int i = 0; i < nGen; i++) { - - for (int y = 1; y < h - 1; y++) { - for (int x = 1; x < w - 1; x++) { - - int pos = x + y * w; - int count = 0; - if (off[pos - w - 1]) { - count++; - } - if (off[pos - w]) { - count++; - } - if (off[pos - w + 1]) { - count++; - } - if (off[pos - 1]) { - count++; - } - if (off[pos + 1]) { - count++; - } - if (off[pos + w - 1]) { - count++; - } - if (off[pos + w]) { - count++; - } - if (off[pos + w + 1]) { - count++; - } - - if (!off[pos] && count >= 5) { - cur[pos] = true; - } else if (off[pos] && count >= 4) { - cur[pos] = true; - } else { - cur[pos] = false; - } - } - } - - boolean[] tmp = cur; - cur = off; - off = tmp; - } - - return off; - } -} diff --git a/java/com/hmdzl/spspd/change/levels/PrisonBossLevel.java b/java/com/hmdzl/spspd/change/levels/PrisonBossLevel.java deleted file mode 100644 index 345d2248..00000000 --- a/java/com/hmdzl/spspd/change/levels/PrisonBossLevel.java +++ /dev/null @@ -1,256 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.mobs.Bestiary; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.watabou.noosa.Scene; -import com.watabou.utils.Bundle; - -import static com.hmdzl.spspd.change.Dungeon.hero; - -public class PrisonBossLevel extends Level { - - { - color1 = 0x6a723d; - color2 = 0x88924c; - } - - //private Room anteroom; - //private int arenaDoor; - - private int stairs = -1; - private boolean enteredArena = false; - - - @Override - public String tilesTex() { - return Assets.TILES_PRISON; - } - - @Override - public String waterTex() { - return Assets.WATER_PRISON; - } - - //private static final String ARENA = "arena"; - //private static final String STAIRS = "stairs"; - //private static final String DOOR = "door"; - private static final String ENTERED = "entered"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - //bundle.put(DOOR, arenaDoor); - //bundle.put( STAIRS, stairs ); - bundle.put(ENTERED, enteredArena); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - //arenaDoor = bundle.getInt(DOOR); - //stairs = bundle.getInt( STAIRS ); - enteredArena = bundle.getBoolean(ENTERED); - } - - @Override - protected boolean build() { - map = MAP_START.clone(); - decorate(); - - buildFlagMaps(); - cleanWalls(); - - entrance = 23 + WIDTH * 15; - exit = 23 + WIDTH * 37; - - - return true; - - } - - @Override - protected void decorate() { - //do nothing, all decorations are hard-coded. - } - - @Override - protected void createMobs() { - } - - @Override - public Actor respawner() { - return null; - } - - @Override - protected void createItems() { - } - - @Override - public void press(int cell, Char ch) { - - super.press(cell, ch); - - if (!enteredArena && hero == Dungeon.hero && cell != entrance) { - - enteredArena = true; - seal(); - - Mob boss = Bestiary.mob(Dungeon.depth); - boss.state = boss.HUNTING; - boss.pos = 23 + WIDTH * 21; - GameScene.add(boss); - boss.notice(); - - GameScene.updateMap(); - Dungeon.observe(); - - - } - } - - @Override - public int randomRespawnCell() { - return -1; - } - - public void seal() { - if (entrance != 0) { - - locked = true; - - set(entrance, Terrain.WALL_DECO); - GameScene.updateMap(entrance); - GameScene.ripple(entrance); - - } - } - - public void unseal() { - if (stairs != 0) { - - locked = false; - - set(entrance, Terrain.ENTRANCE); - GameScene.updateMap(entrance); - - } - } - - @Override - public String tileName(int tile) { - switch (tile) { - case Terrain.WATER: - return Messages.get(PrisonLevel.class, "water_name"); - default: - return super.tileName(tile); - } - } - - @Override - public String tileDesc(int tile) { - switch (tile) { - case Terrain.EMPTY_DECO: - return Messages.get(PrisonLevel.class, "empty_deco_desc"); - case Terrain.BOOKSHELF: - return Messages.get(PrisonLevel.class, "bookshelf_desc"); - default: - return super.tileDesc(tile); - } - } - - @Override - public void addVisuals(Scene scene) { - PrisonLevel.addVisuals(this, scene); - } - - private static final int W = Terrain.WALL; - private static final int D = Terrain.DOOR; - private static final int I = Terrain.HIGH_GRASS; - private static final int O = Terrain.EMPTY; //for readability - private static final int S = Terrain.SIGN; - private static final int A = Terrain.WATER; - - private static final int T = Terrain.INACTIVE_TRAP; - - private static final int E = Terrain.ENTRANCE; - private static final int X = Terrain.LOCKED_EXIT; - - private static final int M = Terrain.WALL_DECO; - private static final int P = Terrain.PEDESTAL; - - private static final int[] MAP_START = - { - M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, - M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, - M, M, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, M, M, - M, M, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, M, M, - M, M, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, M, M, - M, M, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, M, M, - M, M, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, M, M, - M, M, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, M, M, - M, M, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, M, M, - M, M, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, M, M, - M, M, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, M, M, - M, M, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, M, M, - M, M, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, M, M, - M, M, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, O, O, O, O, O, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, M, M, - M, M, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, O, I, O, W, O, S, O, T, O, W, O, O, I, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, M, M, - M, M, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, O, W, T, D, O, O, E, O, O, D, O, W, O, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, M, M, - M, M, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, O, I, O, W, O, I, O, A, O, W, T, O, O, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, M, M, - M, M, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, D, W, W, W, O, O, O, O, O, W, W, W, D, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, M, M, - M, M, W, W, W, W, W, W, W, W, W, W, W, W, W, O, O, A, O, W, W, W, W, D, W, W, W, W, O, O, A, A, W, W, W, W, W, W, W, W, W, W, W, W, W, W, M, M, - M, M, W, W, W, W, W, W, W, W, W, W, W, W, W, O, W, W, O, W, O, I, O, O, O, I, O, W, W, O, A, A, W, W, W, W, W, W, W, W, W, W, W, W, W, W, M, M, - M, M, W, W, W, W, W, W, W, W, W, W, W, W, W, O, I, A, O, W, O, W, W, T, W, W, O, W, O, O, O, O, W, W, W, W, W, W, W, W, W, W, W, W, W, W, M, M, - M, M, W, W, W, W, W, W, W, W, W, W, W, W, W, T, O, A, O, D, O, O, T, P, T, O, O, D, T, O, W, O, W, W, W, W, W, W, W, W, W, W, W, W, W, W, M, M, - M, M, W, W, W, W, W, W, W, W, W, W, W, W, W, O, W, W, O, W, O, O, T, O, T, O, O, W, T, O, O, O, W, W, W, W, W, W, W, W, W, W, W, W, W, W, M, M, - M, M, W, W, W, W, W, W, W, W, W, W, W, W, W, O, O, A, O, W, O, W, W, T, W, W, O, W, O, W, O, O, W, W, W, W, W, W, W, W, W, W, W, W, W, W, M, M, - M, M, W, W, W, W, W, W, W, W, W, W, W, W, W, O, O, A, O, W, O, I, O, O, O, I, O, W, O, O, O, O, W, W, W, W, W, W, W, W, W, W, W, W, W, W, M, M, - M, M, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, D, W, W, D, W, W, D, W, W, D, W, W, D, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, M, M, - M, M, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, O, O, W, O, W, O, A, O, W, O, O, O, O, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, M, M, - M, M, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, O, A, W, O, W, A, W, A, W, W, W, O, O, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, M, M, - M, M, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, T, O, O, T, D, O, A, O, D, O, O, O, O, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, M, M, - M, M, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, O, W, O, O, W, O, W, O, W, O, O, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, M, M, - M, M, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, O, W, O, O, W, O, O, O, W, O, A, O, O, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, M, M, - M, M, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, D, W, W, W, W, W, D, W, W, W, W, W, D, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, M, M, - M, M, W, W, W, W, W, W, W, W, W, W, W, W, W, O, W, O, O, W, O, W, W, O, W, W, O, W, T, W, T, O, W, W, W, W, W, W, W, W, W, W, W, W, W, W, M, M, - M, M, W, W, W, W, W, W, W, W, W, W, W, W, W, O, T, O, O, O, T, W, W, O, W, W, O, W, T, W, T, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, M, M, - M, M, W, W, W, W, W, W, W, W, W, W, W, W, W, O, W, W, W, W, O, D, O, O, O, D, O, W, O, W, O, O, W, W, W, W, W, W, W, W, W, W, W, W, W, W, M, M, - M, M, W, W, W, W, W, W, W, W, W, W, W, W, W, O, W, O, O, W, O, W, W, O, W, W, O, W, O, W, A, O, W, W, W, W, W, W, W, W, W, W, W, W, W, W, M, M, - M, M, W, W, W, W, W, W, W, W, W, W, W, W, W, O, W, A, W, W, O, W, T, T, T, W, T, O, A, W, W, O, W, W, W, W, W, W, W, W, W, W, W, W, W, W, M, M, - M, M, W, W, W, W, W, W, W, W, W, W, W, W, W, O, I, I, I, O, O, W, T, X, T, W, O, O, W, O, O, O, W, W, W, W, W, W, W, W, W, W, W, W, W, W, M, M, - M, M, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, T, T, T, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, M, M, - M, M, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, M, M, - M, M, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, M, M, - M, M, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, M, M, - M, M, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, M, M, - M, M, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, M, M, - M, M, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, M, M, - M, M, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, M, M, - M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, - M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M - }; -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/levels/PrisonBossLevel2.java b/java/com/hmdzl/spspd/change/levels/PrisonBossLevel2.java deleted file mode 100644 index 47d08c54..00000000 --- a/java/com/hmdzl/spspd/change/levels/PrisonBossLevel2.java +++ /dev/null @@ -1,380 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels; - -import java.util.List; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.mobs.Bestiary; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.items.Heap; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.keys.IronKey; -import com.hmdzl.spspd.change.items.keys.SkeletonKey; -import com.hmdzl.spspd.change.levels.Room.Type; -import com.hmdzl.spspd.change.levels.painters.Painter; -import com.hmdzl.spspd.change.levels.traps.SpearTrap; -import com.hmdzl.spspd.change.levels.traps.Trap; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.watabou.noosa.Scene; -import com.watabou.utils.Bundle; -import com.watabou.utils.Graph; -import com.watabou.utils.Point; -import com.watabou.utils.Random; - -public class PrisonBossLevel2 extends RegularLevel { - - { - color1 = 0x6a723d; - color2 = 0x88924c; - } - - private Room anteroom; - private int arenaDoor; - - private boolean enteredArena = false; - private boolean keyDropped = false; - - @Override - public String tilesTex() { - return Assets.TILES_PRISON; - } - - @Override - public String waterTex() { - return Assets.WATER_PRISON; - } - - private static final String ARENA = "arena"; - private static final String DOOR = "door"; - private static final String ENTERED = "entered"; - private static final String DROPPED = "droppped"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(ARENA, roomExit); - bundle.put(DOOR, arenaDoor); - bundle.put(ENTERED, enteredArena); - bundle.put(DROPPED, keyDropped); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - roomExit = (Room) bundle.get(ARENA); - arenaDoor = bundle.getInt(DOOR); - enteredArena = bundle.getBoolean(ENTERED); - keyDropped = bundle.getBoolean(DROPPED); - } - - @Override - protected boolean build() { - - initRooms(); - - int distance; - int retry = 0; - - do { - - if (retry++ > 10) { - return false; - } - - int innerRetry = 0; - do { - if (innerRetry++ > 10) { - return false; - } - roomEntrance = Random.element(rooms); - } while (roomEntrance.width() < 4 || roomEntrance.height() < 4); - - innerRetry = 0; - do { - if (innerRetry++ > 10) { - return false; - } - roomExit = Random.element(rooms); - } while (roomExit == roomEntrance || roomExit.width() < 7 - || roomExit.height() < 7 || roomExit.top == 0); - - Graph.buildDistanceMap(rooms, roomExit); - distance = Graph.buildPath(rooms, roomEntrance, roomExit).size(); - - } while (distance < 3); - - roomEntrance.type = Type.ENTRANCE; - roomExit.type = Type.BOSS_EXIT; - - List path = Graph.buildPath(rooms, roomEntrance, roomExit); - Graph.setPrice(path, roomEntrance.distance); - - Graph.buildDistanceMap(rooms, roomExit); - path = Graph.buildPath(rooms, roomEntrance, roomExit); - - anteroom = path.get(path.size() - 2); - anteroom.type = Type.STANDARD; - - Room room = roomEntrance; - for (Room next : path) { - room.connect(next); - room = next; - } - - for (Room r : rooms) { - if (r.type == Type.NULL && r.connected.size() > 0) { - r.type = Type.PASSAGE; - } - } - - paint(); - - Room r = (Room) roomExit.connected.keySet().toArray()[0]; - if (roomExit.connected.get(r).y == roomExit.top) { - return false; - } - - paintWater(); - paintGrass(); - - placeTraps(); - - return true; - } - - @Override - protected boolean[] water() { - return Patch.generate(0.45f, 5); - } - - @Override - protected boolean[] grass() { - return Patch.generate(0.30f, 4); - } - - @Override - protected void paintDoors(Room r) { - - for (Room n : r.connected.keySet()) { - - if (r.type == Type.NULL) { - continue; - } - - Point door = r.connected.get(n); - - if (r.type == Room.Type.PASSAGE && n.type == Room.Type.PASSAGE) { - - Painter.set(this, door, Terrain.EMPTY); - - } else { - - Painter.set(this, door, Terrain.DOOR); - - } - - } - } - - @Override - protected void placeTraps() { - - int nTraps = nTraps(); - - for (int i = 0; i < nTraps; i++) { - - int trapPos = Random.Int(getLength()); - - if (map[trapPos] == Terrain.EMPTY) { - map[trapPos] = Terrain.INACTIVE_TRAP; - Trap t = new SpearTrap().reveal(); - t.active = false; - setTrap(t, trapPos); - } - } - } - - @Override - protected void decorate() { - - for (int i = getWidth() + 1; i < getLength() - getWidth() - 1; i++) { - if (map[i] == Terrain.EMPTY) { - - float c = 0.15f; - if (map[i + 1] == Terrain.WALL - && map[i + getWidth()] == Terrain.WALL) { - c += 0.2f; - } - if (map[i - 1] == Terrain.WALL - && map[i + getWidth()] == Terrain.WALL) { - c += 0.2f; - } - if (map[i + 1] == Terrain.WALL - && map[i - getWidth()] == Terrain.WALL) { - c += 0.2f; - } - if (map[i - 1] == Terrain.WALL - && map[i - getWidth()] == Terrain.WALL) { - c += 0.2f; - } - - if (Random.Float() < c) { - map[i] = Terrain.EMPTY_DECO; - } - } - } - - for (int i = 0; i < getWidth(); i++) { - if (map[i] == Terrain.WALL - && (map[i + getWidth()] == Terrain.EMPTY || map[i + getWidth()] == Terrain.EMPTY_SP) - && Random.Int(4) == 0) { - - map[i] = Terrain.WALL_DECO; - } - } - - for (int i = getWidth(); i < getLength() - getWidth(); i++) { - if (map[i] == Terrain.WALL - && map[i - getWidth()] == Terrain.WALL - && (map[i + getWidth()] == Terrain.EMPTY || map[i + getWidth()] == Terrain.EMPTY_SP) - && Random.Int(2) == 0) { - - map[i] = Terrain.WALL_DECO; - } - } - - while (true) { - int pos = roomEntrance.random(); - if (pos != entrance) { - map[pos] = Terrain.SIGN; - break; - } - } - - Point door = roomExit.entrance(); - arenaDoor = door.x + door.y * getWidth(); - Painter.set(this, arenaDoor, Terrain.LOCKED_DOOR); - - Painter.fill(this, roomExit.left + 2, roomExit.top + 2, - roomExit.width() - 3, roomExit.height() - 3, - Terrain.INACTIVE_TRAP); - } - - @Override - protected void createMobs() { - } - - @Override - public Actor respawner() { - return null; - } - - @Override - protected void createItems() { - - int keyPos = anteroom.random(); - while (!passable[keyPos]) { - keyPos = anteroom.random(); - } - drop(new IronKey(Dungeon.depth), keyPos).type = Heap.Type.CHEST; - - } - - @Override - public void press(int cell, Char ch) { - - super.press(cell, ch); - - if (ch == Dungeon.hero && !enteredArena && roomExit.inside(cell)) { - - enteredArena = true; - locked = true; - - int pos; - do { - pos = roomExit.random(); - } while (pos == cell || Actor.findChar(pos) != null); - - Mob boss = Bestiary.mob(Dungeon.depth); - boss.state = boss.HUNTING; - boss.pos = pos; - GameScene.add(boss); - boss.notice(); - - mobPress(boss); - - set(arenaDoor, Terrain.LOCKED_DOOR); - GameScene.updateMap(arenaDoor); - Dungeon.observe(); - - } - } - - @Override - public Heap drop(Item item, int cell) { - - if (!keyDropped && item instanceof SkeletonKey) { - - keyDropped = true; - locked = false; - - set(arenaDoor, Terrain.DOOR); - GameScene.updateMap(arenaDoor); - Dungeon.observe(); - } - - return super.drop(item, cell); - } - - @Override - public int randomRespawnCell() { - return -1; - } - - @Override - public String tileName( int tile ) { - switch (tile) { - case Terrain.WATER: - return Messages.get(PrisonLevel.class, "water_name"); - default: - return super.tileName( tile ); - } - } - - @Override - public String tileDesc(int tile) { - switch (tile) { - case Terrain.EMPTY_DECO: - return Messages.get(PrisonLevel.class, "empty_deco_desc"); - case Terrain.BOOKSHELF: - return Messages.get(PrisonLevel.class, "bookshelf_desc"); - default: - return super.tileDesc( tile ); - } - } - - @Override - public void addVisuals(Scene scene) { - PrisonLevel.addVisuals(this, scene); - } -} diff --git a/java/com/hmdzl/spspd/change/levels/PrisonLevel.java b/java/com/hmdzl/spspd/change/levels/PrisonLevel.java deleted file mode 100644 index 6b0a6611..00000000 --- a/java/com/hmdzl/spspd/change/levels/PrisonLevel.java +++ /dev/null @@ -1,243 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.DungeonTilemap; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.hero.HeroClass; -import com.hmdzl.spspd.change.actors.mobs.MossySkeleton; -import com.hmdzl.spspd.change.actors.mobs.npcs.Wandmaker; -import com.hmdzl.spspd.change.effects.Halo; -import com.hmdzl.spspd.change.effects.particles.FlameParticle; -import com.hmdzl.spspd.change.items.bombs.Bomb; -import com.hmdzl.spspd.change.items.bombs.DungeonBomb; -import com.hmdzl.spspd.change.levels.Room.Type; -import com.hmdzl.spspd.change.levels.traps.*; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.noosa.Scene; -import com.watabou.noosa.particles.Emitter; -import com.watabou.utils.PointF; -import com.watabou.utils.Random; - -public class PrisonLevel extends RegularLevel { - - { - color1 = 0x6a723d; - color2 = 0x88924c; - } - - @Override - public String tilesTex() { - return Assets.TILES_PRISON; - } - - @Override - public String waterTex() { - return Assets.WATER_PRISON; - } - - @Override - protected boolean[] water() { - return Patch.generate(feeling == Feeling.WATER ? 0.65f : 0.45f, 4); - } - - @Override - protected boolean[] grass() { - return Patch.generate(feeling == Feeling.GRASS ? 0.60f : 0.40f, 3); - } - - @Override - protected Class[] trapClasses() { - return new Class[]{ ChillingTrap.class, FireTrap.class, PoisonTrap.class, SpearTrap.class, ToxicTrap.class, ShockTrap.class, - AlarmTrap.class, FlashingTrap.class, GrippingTrap.class, ParalyticTrap.class, LightningTrap.class, OozeTrap.class, - ConfusionTrap.class, FlockTrap.class, SummoningTrap.class, TeleportationTrap.class, }; - } - - @Override - protected float[] trapChances() { - return new float[]{ 4, 4, 4, 4, 4, - 2, 2, 2, 2, 2, 2, - 1, 1, 1, 1 }; - } - - @Override - protected boolean assignRoomType() { - super.assignRoomType(); - - for (Room r : rooms) { - if (r.type == Type.TUNNEL) { - r.type = Type.PASSAGE; - } - } - - return true; - } - - @Override - protected void setPar(){ - Dungeon.pars[Dungeon.depth] = 500+(Dungeon.depth*50)+(secretDoors*20); - } - - @Override - protected void createItems() { - if (Dungeon.hero.heroClass==HeroClass.PERFORMER && Random.Int(1) == 0){addItemToSpawn(new DungeonBomb());} - - super.createItems(); - - Wandmaker.Quest.spawn(this, roomEntrance); - spawnSkeleton(this); - } - - public static void spawnSkeleton(PrisonLevel level) { - if (Dungeon.depth == 9 && !Dungeon.skeletonspawned){ - - MossySkeleton skeleton = new MossySkeleton(); - do { - skeleton.pos = level.randomRespawnCell(); - } while (skeleton.pos == -1); - level.mobs.add(skeleton); - Actor.occupyCell(skeleton); - - Dungeon.skeletonspawned = true; - } - } - - - @Override - protected void decorate() { - - for (int i = getWidth() + 1; i < getLength() - getWidth() - 1; i++) { - if (map[i] == Terrain.EMPTY) { - - float c = 0.05f; - if (map[i + 1] == Terrain.WALL - && map[i + getWidth()] == Terrain.WALL) { - c += 0.2f; - } - if (map[i - 1] == Terrain.WALL - && map[i + getWidth()] == Terrain.WALL) { - c += 0.2f; - } - if (map[i + 1] == Terrain.WALL - && map[i - getWidth()] == Terrain.WALL) { - c += 0.2f; - } - if (map[i - 1] == Terrain.WALL - && map[i - getWidth()] == Terrain.WALL) { - c += 0.2f; - } - - if (Random.Float() < c) { - map[i] = Terrain.EMPTY_DECO; - } - } - } - - for (int i = 0; i < getWidth(); i++) { - if (map[i] == Terrain.WALL - && (map[i + getWidth()] == Terrain.EMPTY || map[i + getWidth()] == Terrain.EMPTY_SP) - && Random.Int(6) == 0) { - - map[i] = Terrain.WALL_DECO; - } - } - - for (int i = getWidth(); i < getLength() - getWidth(); i++) { - if (map[i] == Terrain.WALL - && map[i - getWidth()] == Terrain.WALL - && (map[i + getWidth()] == Terrain.EMPTY || map[i + getWidth()] == Terrain.EMPTY_SP) - && Random.Int(3) == 0) { - - map[i] = Terrain.WALL_DECO; - } - } - - while (true) { - int pos = roomEntrance.random(); - if (pos != entrance) { - map[pos] = Terrain.SIGN; - break; - } - } - - setPar(); - } - - @Override - public String tileName( int tile ) { - switch (tile) { - case Terrain.WATER: - return Messages.get(PrisonLevel.class, "water_name"); - default: - return super.tileName( tile ); - } - } - - @Override - public String tileDesc(int tile) { - switch (tile) { - case Terrain.EMPTY_DECO: - return Messages.get(PrisonLevel.class, "empty_deco_desc"); - case Terrain.BOOKSHELF: - return Messages.get(PrisonLevel.class, "bookshelf_desc"); - default: - return super.tileDesc( tile ); - } - } - - @Override - public void addVisuals(Scene scene) { - super.addVisuals(scene); - addVisuals(this, scene); - } - - public static void addVisuals(Level level, Scene scene) { - for (int i = 0; i < getLength(); i++) { - if (level.map[i] == Terrain.WALL_DECO) { - scene.add(new Torch(i)); - } - } - } - - private static class Torch extends Emitter { - - private int pos; - - public Torch(int pos) { - super(); - - this.pos = pos; - - PointF p = DungeonTilemap.tileCenterToWorld(pos); - pos(p.x - 1, p.y + 3, 2, 0); - - pour(FlameParticle.FACTORY, 0.15f); - - add(new Halo(16, 0xFFFFCC, 0.2f).point(p.x, p.y)); - } - - @Override - public void update() { - if (visible = Dungeon.visible[pos]) { - super.update(); - } - } - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/levels/RegularLevel.java b/java/com/hmdzl/spspd/change/levels/RegularLevel.java deleted file mode 100644 index 7817d046..00000000 --- a/java/com/hmdzl/spspd/change/levels/RegularLevel.java +++ /dev/null @@ -1,779 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.HashSet; -import java.util.LinkedList; -import java.util.List; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.Statistics; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.buffs.AflyBless; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.hero.HeroClass; -import com.hmdzl.spspd.change.actors.mobs.Bestiary; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.items.Generator; -import com.hmdzl.spspd.change.items.Heap; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.misc.LuckyBadge; -import com.hmdzl.spspd.change.items.scrolls.Scroll; -import com.hmdzl.spspd.change.levels.Room.Type; -import com.hmdzl.spspd.change.levels.painters.Painter; -import com.hmdzl.spspd.change.levels.painters.ShopPainter; -import com.hmdzl.spspd.change.levels.traps.*; -import com.watabou.utils.Bundle; -import com.watabou.utils.Graph; -import com.watabou.utils.Random; -import com.watabou.utils.Rect; - -public abstract class RegularLevel extends Level { - - protected HashSet rooms; - - protected Room roomEntrance; - protected Room roomExit; - - protected ArrayList specials; - protected ArrayList secrets; - protected ArrayList specialsf; - protected ArrayList specialsc; - - public int secretDoors; - - @Override - protected boolean build() { - - if (!initRooms()) { - return false; - } - - int distance; - int retry = 0; - int minDistance = (int) Math.sqrt(rooms.size()); - do { - do { - roomEntrance = Random.element(rooms); - } while (roomEntrance.width() < 4 || roomEntrance.height() < 4); - - do { - roomExit = Random.element(rooms); - } while (roomExit == roomEntrance || roomExit.width() < 4 - || roomExit.height() < 4); - - Graph.buildDistanceMap(rooms, roomExit); - distance = roomEntrance.distance(); - - if (retry++ > 10) { - return false; - } - - } while (distance < minDistance); - - roomEntrance.type = Type.ENTRANCE; - roomExit.type = Type.EXIT; - - HashSet connected = new HashSet(); - connected.add(roomEntrance); - - Graph.buildDistanceMap(rooms, roomExit); - List path = Graph.buildPath(rooms, roomEntrance, roomExit); - - Room room = roomEntrance; - for (Room next : path) { - room.connect(next); - room = next; - connected.add(room); - } - - Graph.setPrice(path, roomEntrance.distance); - - Graph.buildDistanceMap(rooms, roomExit); - path = Graph.buildPath(rooms, roomEntrance, roomExit); - - room = roomEntrance; - for (Room next : path) { - room.connect(next); - room = next; - connected.add(room); - } - - int nConnected = (int) (rooms.size() * Random.Float(0.5f, 0.7f)); - while (connected.size() < nConnected) { - - Room cr = Random.element(connected); - Room or = Random.element(cr.neigbours); - if (!connected.contains(or)) { - - cr.connect(or); - connected.add(or); - } - } - - if (Dungeon.shopOnLevel()) { - Room shop = null; - for (Room r : roomEntrance.connected.keySet()) { - if (r.connected.size() == 1 - && ((r.width() - 1) * (r.height() - 1) >= ShopPainter - .spaceNeeded())) { - shop = r; - break; - } - } - - if (shop == null) { - return false; - } else { - shop.type = Room.Type.SHOP; - } - } - - specials = new ArrayList(Room.SPECIALS); - if (Dungeon.bossLevel(Dungeon.depth + 1) || Dungeon.townCheck(Dungeon.depth)) { - specials.remove(Room.Type.WEAK_FLOOR); - } - //if (Dungeon.isChallenged(Challenges.NO_ARMOR)) { - // no sense in giving an armor reward room on a run with no armor. - //specials.remove(Room.Type.CRYPT); - //} - //if (Dungeon.isChallenged(Challenges.NO_HERBALISM)) { - // sorry warden, no lucky sungrass or blandfruit seeds for you! - //specials.remove(Room.Type.GARDEN); - //} - - if (Dungeon.depth > 21 && Dungeon.depth < 25) { - specials.remove(Room.Type.WEAK_FLOOR); - } - - if (Dungeon.depth > 50 && Dungeon.depth < 100) { - specials.remove(Room.Type.WEAK_FLOOR); - specials.remove(Room.Type.ARMORY); - specials.remove(Room.Type.CRYPT); - specials.remove(Room.Type.GARDEN); - specials.remove(Room.Type.LABORATORY); - specials.remove(Room.Type.LIBRARY); - specials.remove(Room.Type.MAGIC_WELL); - specials.remove(Room.Type.POOL); - specials.remove(Room.Type.STATUE); - specials.remove(Room.Type.STORAGE); - specials.remove(Room.Type.TRAPS); - specials.remove(Room.Type.TREASURY); - specials.remove(Room.Type.VAULT); - } - - - if (!assignRoomType()) - return false; - - paint(); - paintWater(); - paintGrass(); - - placeTraps(); - - return true; - } - - protected void placeSign(){ - while (true) { - int pos = roomEntrance.random(); - if (pos != entrance && traps.get(pos) == null && findMob(pos) == null) { - map[pos] = Terrain.SIGN; - break; - } - } - } - - protected boolean initRooms() { - - rooms = new HashSet(); - split(new Rect(0, 0, getWidth() - 1, HEIGHT - 1)); - - if (rooms.size() < 8) { - return false; - } - - Room[] ra = rooms.toArray(new Room[0]); - for (int i = 0; i < ra.length - 1; i++) { - for (int j = i + 1; j < ra.length; j++) { - ra[i].addNeigbour(ra[j]); - } - } - - return true; - } - - protected boolean assignRoomType() { - - int specialRooms = 0; - - for (Room r : rooms) { - if (r.type == Type.NULL && r.connected.size() == 1) { - - if (specials.size() > 0 && r.width() > 3 && r.height() > 3 - && Random.Int(specialRooms * specialRooms + 2) == 0) { - - if (pitRoomNeeded) { - - r.type = Type.PIT; - pitRoomNeeded = false; - - } else if (Dungeon.depth % 5 == 2 - && specials.contains(Type.LABORATORY)) { - - r.type = Type.LABORATORY; - - } else if (specials.contains(Type.MAGIC_WELL)) { - - r.type = Type.MAGIC_WELL; - - } else { - - int n = specials.size(); - r.type = specials.get(Math.min(Random.Int(n), - Random.Int(n))); - if (r.type == Type.WEAK_FLOOR) { - weakFloorCreated = true; - } - - } - - Room.useType(r.type); - specials.remove(r.type); - specialRooms++; - - } else if (Random.Int(2) == 0) { - - HashSet neigbours = new HashSet(); - for (Room n : r.neigbours) { - if (!r.connected.containsKey(n) - && !Room.SPECIALS.contains(n.type) - && n.type != Type.PIT) { - - neigbours.add(n); - } - } - if (neigbours.size() > 1) { - r.connect(Random.element(neigbours)); - } - } - } - } - - int count = 0; - for (Room r : rooms) { - if (r.type == Type.NULL) { - int connections = r.connected.size(); - if (connections == 0) { - - } else if (Random.Int(connections * connections) == 0) { - r.type = Type.STANDARD; - count++; - } else { - r.type = Type.TUNNEL; - } - } - } - - while (count < 4) { - Room r = randomRoom(Type.TUNNEL, 1); - if (r != null) { - r.type = Type.STANDARD; - count++; - } - } - - return true; - } - - protected void paintWater() { - boolean[] lake = water(); - for (int i = 0; i < getLength(); i++) { - if (map[i] == Terrain.EMPTY && lake[i]) { - map[i] = Terrain.WATER; - } - } - } - - protected void paintGrass() { - boolean[] grass = grass(); - - if (feeling == Feeling.GRASS) { - - for (Room room : rooms) { - if (room.type != Type.NULL && room.type != Type.PASSAGE - && room.type != Type.TUNNEL) { - grass[(room.left + 1) + (room.top + 1) * getWidth()] = true; - grass[(room.right - 1) + (room.top + 1) * getWidth()] = true; - grass[(room.left + 1) + (room.bottom - 1) * getWidth()] = true; - grass[(room.right - 1) + (room.bottom - 1) * getWidth()] = true; - } - } - } - - for (int i = getWidth() + 1; i < getLength() - getWidth() - 1; i++) { - if (map[i] == Terrain.EMPTY && grass[i]) { - int count = 1; - for (int n : NEIGHBOURS8) { - if (grass[i + n]) { - count++; - } - } - map[i] = (Random.Float() < count / 12f) ? Terrain.HIGH_GRASS - : Terrain.GRASS; - } - } - } - - protected abstract boolean[] water(); - - protected abstract boolean[] grass(); - - protected void placeTraps() { - - int nTraps = nTraps(); - float[] trapChances = trapChances(); - Class[] trapClasses = trapClasses(); - - LinkedList validCells = new LinkedList(); - - for (int i = 0; i < LENGTH; i ++) { - if (map[i] == Terrain.EMPTY){ - - if(Dungeon.depth == 1){ - //extra check to prevent annoying inactive traps in hallways on floor 1 - Room r = room(i); - if (r != null && r.type != Type.TUNNEL){ - validCells.add(i); - } - } else - validCells.add(i); - } - } - - //no more than one trap every 5 valid tiles. - nTraps = Math.min(nTraps, validCells.size()/5); - - Collections.shuffle(validCells); - - for (int i = 0; i < nTraps; i++) { - - int trapPos = validCells.removeFirst(); - - try { - Trap trap = ((Trap)trapClasses[Random.chances( trapChances )].newInstance()).hide(); - setTrap( trap, trapPos ); - //some traps will not be hidden - map[trapPos] = trap.visible ? Terrain.TRAP : Terrain.SECRET_TRAP; - } catch (Exception e) { - throw new RuntimeException(e); - } - } - } - - protected int nTraps() { - return Random.NormalIntRange( 1, 4+(Dungeon.depth/2) ); - } - - protected Class[] trapClasses(){ - return new Class[]{WornTrap.class}; - } - - protected float[] trapChances() { - return new float[]{1}; - } - - protected int minRoomSize = 7; - protected int maxRoomSize = 9; - - protected void split(Rect rect) { - - int w = rect.width(); - int h = rect.height(); - - if (w > maxRoomSize && h < minRoomSize) { - - int vw = Random.Int(rect.left + 3, rect.right - 3); - split(new Rect(rect.left, rect.top, vw, rect.bottom)); - split(new Rect(vw, rect.top, rect.right, rect.bottom)); - - } else if (h > maxRoomSize && w < minRoomSize) { - - int vh = Random.Int(rect.top + 3, rect.bottom - 3); - split(new Rect(rect.left, rect.top, rect.right, vh)); - split(new Rect(rect.left, vh, rect.right, rect.bottom)); - - } else if ((Math.random() <= (minRoomSize * minRoomSize / rect.square()) - && w <= maxRoomSize && h <= maxRoomSize) - || w < minRoomSize || h < minRoomSize) { - - rooms.add((Room) new Room().set(rect)); - - } else { - - if (Random.Float() < (float) (w - 2) / (w + h - 4)) { - int vw = Random.Int(rect.left + 3, rect.right - 3); - split(new Rect(rect.left, rect.top, vw, rect.bottom)); - split(new Rect(vw, rect.top, rect.right, rect.bottom)); - } else { - int vh = Random.Int(rect.top + 3, rect.bottom - 3); - split(new Rect(rect.left, rect.top, rect.right, vh)); - split(new Rect(rect.left, vh, rect.right, rect.bottom)); - } - - } - } - - protected void paint() { - - for (Room r : rooms) { - if (r.type != Type.NULL) { - placeDoors(r); - r.type.paint(this, r); - } else { - if (feeling == Feeling.CHASM && Random.Int(2) == 0) { - Painter.fill(this, r, Terrain.WALL); - } - } - } - - for (Room r : rooms) { - paintDoors(r); - } - } - - private void placeDoors(Room r) { - for (Room n : r.connected.keySet()) { - Room.Door door = r.connected.get(n); - if (door == null) { - - Rect i = r.intersect(n); - if (i.width() == 0) { - door = new Room.Door(i.left, - Random.Int(i.top + 1, i.bottom)); - } else { - door = new Room.Door(Random.Int(i.left + 1, i.right), i.top); - } - - r.connected.put(n, door); - n.connected.put(r, door); - } - } - } - - protected void paintDoors(Room r) { - for (Room n : r.connected.keySet()) { - - if (joinRooms(r, n)) { - continue; - } - - Room.Door d = r.connected.get(n); - int door = d.x + d.y * getWidth(); - - switch (d.type) { - case EMPTY: - map[door] = Terrain.EMPTY; - break; - case TUNNEL: - map[door] = tunnelTile(); - break; - case REGULAR: - if (Dungeon.depth <= 1) { - map[door] = Terrain.DOOR; - } else { - boolean secret = (Dungeon.depth < 6 ? Random - .Int(12 - Dungeon.depth) : Random.Int(6)) == 0; - map[door] = secret ? Terrain.SECRET_DOOR : Terrain.DOOR; - if (secret) { - secretDoors++; - } - } - break; - case UNLOCKED: - map[door] = Terrain.DOOR; - break; - case HIDDEN: - map[door] = Terrain.SECRET_DOOR; - break; - case BARRICADE: - map[door] = Random.Int(3) == 0 ? Terrain.BOOKSHELF - : Terrain.BARRICADE; - break; - case LOCKED: - map[door] = Terrain.LOCKED_DOOR; - break; - case ONEWAY: - map[door] = Terrain.STATUE_SSP; - break; - } - } - } - - protected boolean joinRooms(Room r, Room n) { - - if (r.type != Room.Type.STANDARD || n.type != Room.Type.STANDARD) { - return false; - } - - Rect w = r.intersect(n); - if (w.left == w.right) { - - if (w.bottom - w.top < 3) { - return false; - } - - if (w.height() == Math.max(r.height(), n.height())) { - return false; - } - - if (r.width() + n.width() > maxRoomSize) { - return false; - } - - w.top += 1; - w.bottom -= 0; - - w.right++; - - Painter.fill(this, w.left, w.top, 1, w.height(), Terrain.EMPTY); - - } else { - - if (w.right - w.left < 3) { - return false; - } - - if (w.width() == Math.max(r.width(), n.width())) { - return false; - } - - if (r.height() + n.height() > maxRoomSize) { - return false; - } - - w.left += 1; - w.right -= 0; - - w.bottom++; - - Painter.fill(this, w.left, w.top, w.width(), 1, Terrain.EMPTY); - } - - return true; - } - - protected void setPar(){ - Dungeon.pars[Dungeon.depth] = 600; - } - - @Override - public int nMobs() { - if (Dungeon.depth < 5 && !Statistics.amuletObtained){ - return 10 + Dungeon.depth + Random.Int(3); - } else if(!Statistics.amuletObtained) { - return 10 + Dungeon.depth % 3 + Random.Int(3); - } else { - return 10 + (5 - Dungeon.depth % 5) + Random.Int(3); - } - } - - @Override - protected void createMobs() { - int nMobs = nMobs(); - for (int i = 0; i < nMobs; i++) { - Mob mob = Bestiary.mob(Dungeon.depth); - do { - mob.pos = randomRespawnCell(); - mob.originalgen=true; - } while (mob.pos == -1); - mobs.add(mob); - Actor.occupyCell(mob); - } - } - - @Override - public int randomRespawnCell() { - - int count = 0; - int cell = -1; - - while (true) { - - if (++count > 30) { - return -1; - } - - Room room = randomRoom(Room.Type.STANDARD, 10); - if (room == null) { - continue; - } - - cell = room.random(); - if (!Dungeon.visible[cell] && Actor.findChar(cell) == null - && Level.passable[cell]) { - return cell; - } - - } - - } - - @Override - public int randomDestination() { - - int cell = -1; - - while (true) { - - Room room = Random.element(rooms); - if (room == null) { - continue; - } - - cell = room.random(); - if (Level.passable[cell]) { - return cell; - } - - } - } - - @Override - protected void createItems() { - - int nItems = 3; - int bonus = 0; - for (Buff buff : Dungeon.hero.buffs(LuckyBadge.GreatLucky.class)) { - bonus += ((LuckyBadge.GreatLucky) buff).level; - } - if (Dungeon.hero.heroClass == HeroClass.SOLDIER) - bonus += 5; - for (Buff buff : Dungeon.hero.buffs(AflyBless.class)) { - bonus += 5; - } - // just incase someone gets a ridiculous ring, cap this at 80% - bonus = Math.min(bonus, 10); - while (Random.Float() < (0.3f + bonus * 0.05f)) { - nItems++; - } - - for (int i = 0; i < nItems; i++) { - Heap.Type type = null; - switch (Random.Int(20)) { - case 0: - type = Heap.Type.SKELETON; - break; - case 1: - case 2: - case 3: - case 4: - type = Heap.Type.CHEST; - break; - case 5: - type = Dungeon.depth > 1 ? Heap.Type.MIMIC : Heap.Type.CHEST; - break; - default: - type = Heap.Type.HEAP; - } - drop(Generator.random(), randomDropCell()).type = type; - } - - for (Item item : itemsToSpawn) { - int cell = randomDropCell(); - if (item instanceof Scroll) { - while (map[cell] == Terrain.TRAP - || map[cell] == Terrain.SECRET_TRAP - && traps.get( cell ) instanceof FireTrap) { - cell = randomDropCell(); - } - } - drop(item, cell).type = Heap.Type.HEAP; - } - } - - protected Room randomRoom(Room.Type type, int tries) { - for (int i = 0; i < tries; i++) { - Room room = Random.element(rooms); - if (room.type == type) { - return room; - } - } - return null; - } - - public Room room(int pos) { - for (Room room : rooms) { - if (room.type != Type.NULL && room.inside(pos)) { - return room; - } - } - - return null; - } - - protected int randomDropCell() { - while (true) { - Room room = randomRoom(Room.Type.STANDARD, 1); - if (room != null) { - int pos = room.random(); - if (passable[pos]) { - return pos; - } - } - } - } - - @Override - public int pitCell() { - for (Room room : rooms) { - if (room.type == Type.PIT) { - return room.random(); - } - } - - return super.pitCell(); - } - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put("rooms", rooms); - } - - @SuppressWarnings("unchecked") - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - - rooms = new HashSet( - (Collection) ((Collection) bundle - .getCollection("rooms"))); - for (Room r : rooms) { - if (r.type == Type.WEAK_FLOOR) { - weakFloorCreated = true; - break; - } - } - } - -} diff --git a/java/com/hmdzl/spspd/change/levels/Room.java b/java/com/hmdzl/spspd/change/levels/Room.java deleted file mode 100644 index 03a9f926..00000000 --- a/java/com/hmdzl/spspd/change/levels/Room.java +++ /dev/null @@ -1,291 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels; - -import java.lang.reflect.Method; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.HashMap; -import java.util.HashSet; - -import com.hmdzl.spspd.change.ShatteredPixelDungeon; -import com.hmdzl.spspd.change.levels.painters.ArmoryPainter; -import com.hmdzl.spspd.change.levels.painters.BarricadedPainter; -import com.hmdzl.spspd.change.levels.painters.BlacksmithPainter; -import com.hmdzl.spspd.change.levels.painters.BossExitPainter; -import com.hmdzl.spspd.change.levels.painters.CryptPainter; -import com.hmdzl.spspd.change.levels.painters.EntrancePainter; -import com.hmdzl.spspd.change.levels.painters.ExitPainter; -import com.hmdzl.spspd.change.levels.painters.GardenPainter; -import com.hmdzl.spspd.change.levels.painters.LaboratoryPainter; -import com.hmdzl.spspd.change.levels.painters.LibraryPainter; -import com.hmdzl.spspd.change.levels.painters.MagicWellPainter; -import com.hmdzl.spspd.change.levels.painters.Painter; -import com.hmdzl.spspd.change.levels.painters.PassagePainter; -import com.hmdzl.spspd.change.levels.painters.PitPainter; -import com.hmdzl.spspd.change.levels.painters.PoolPainter; -import com.hmdzl.spspd.change.levels.painters.RatKingPainter; -import com.hmdzl.spspd.change.levels.painters.RatKingPainter2; -import com.hmdzl.spspd.change.levels.painters.ShopPainter; -import com.hmdzl.spspd.change.levels.painters.StandardPainter; -import com.hmdzl.spspd.change.levels.painters.StatuePainter; -import com.hmdzl.spspd.change.levels.painters.StoragePainter; -import com.hmdzl.spspd.change.levels.painters.TrapsPainter; -import com.hmdzl.spspd.change.levels.painters.TreasuryPainter; -import com.hmdzl.spspd.change.levels.painters.TunnelPainter; -import com.hmdzl.spspd.change.levels.painters.VaultPainter; -import com.hmdzl.spspd.change.levels.painters.WeakFloorPainter; -import com.hmdzl.spspd.change.levels.painters.MemoryPainter; -import com.watabou.utils.Bundlable; -import com.watabou.utils.Bundle; -import com.watabou.utils.Graph; -import com.watabou.utils.Point; -import com.watabou.utils.Random; -import com.watabou.utils.Rect; - -public class Room extends Rect implements Graph.Node, Bundlable { - - public HashSet neigbours = new HashSet(); - public HashMap connected = new HashMap(); - - public int distance; - public int price = 1; - - public static enum Type { - NULL(null), - STANDARD(StandardPainter.class), - ENTRANCE(EntrancePainter.class), - EXIT(ExitPainter.class), - BOSS_EXIT(BossExitPainter.class), - TUNNEL(TunnelPainter.class), - PASSAGE(PassagePainter.class), - SHOP(ShopPainter.class), - BLACKSMITH(BlacksmithPainter.class), - TREASURY(TreasuryPainter.class), - ARMORY(ArmoryPainter.class), - LIBRARY(LibraryPainter.class), - LABORATORY(LaboratoryPainter.class), - VAULT(VaultPainter.class), - TRAPS(TrapsPainter.class), - STORAGE(StoragePainter.class), - BARRICADED ( BarricadedPainter.class ), - MAGIC_WELL(MagicWellPainter.class), - GARDEN(GardenPainter.class), - CRYPT(CryptPainter.class), - STATUE(StatuePainter.class), - POOL(PoolPainter.class), - RAT_KING(RatKingPainter.class), - WEAK_FLOOR(WeakFloorPainter.class), - PIT(PitPainter.class), - RAT_KING2(RatKingPainter2.class), - MEMORY(MemoryPainter.class); - - private Method paint; - - private Type(Class painter) { - try { - paint = painter.getMethod("paint", Level.class, Room.class); - } catch (Exception e) { - paint = null; - } - } - - public void paint(Level level, Room room) { - try { - paint.invoke(null, level, room); - } catch (Exception e) { - ShatteredPixelDungeon.reportException(e); - } - } - }; - - public static final ArrayList SPECIALS = new ArrayList( - Arrays.asList(Type.WEAK_FLOOR, Type.MAGIC_WELL, Type.CRYPT, - Type.POOL, Type.GARDEN, Type.LIBRARY, Type.ARMORY, - Type.TREASURY, Type.TRAPS, Type.STORAGE, Type.STATUE, - Type.LABORATORY, Type.VAULT, Type.MEMORY, Type.BARRICADED)); - - public static final ArrayList SPECIALSFORT = new ArrayList( - Arrays.asList(Type.GARDEN, Type.GARDEN, Type.GARDEN, Type.GARDEN, - Type.GARDEN, Type.GARDEN, Type.GARDEN, Type.GARDEN, - Type.GARDEN, Type.GARDEN)); - - public static final ArrayList SPECIALSTRANSCEND = new ArrayList( - Arrays.asList(Type.MAGIC_WELL, Type.MAGIC_WELL, Type.MAGIC_WELL, Type.MAGIC_WELL, - Type.MAGIC_WELL, Type.MAGIC_WELL, Type.MAGIC_WELL, Type.MAGIC_WELL, - Type.MAGIC_WELL, Type.MAGIC_WELL)); - - public Type type = Type.NULL; - - public int random() { - return random(0); - } - - public int random(int m) { - int x = Random.Int(left + 1 + m, right - m); - int y = Random.Int(top + 1 + m, bottom - m); - return x + y * Level.getWidth(); - } - - public void addNeigbour(Room other) { - - Rect i = intersect(other); - if ((i.width() == 0 && i.height() >= 3) - || (i.height() == 0 && i.width() >= 3)) { - neigbours.add(other); - other.neigbours.add(this); - } - - } - - public void connect(Room room) { - if (!connected.containsKey(room)) { - connected.put(room, null); - room.connected.put(this, null); - } - } - - public Door entrance() { - return connected.values().iterator().next(); - } - - public boolean inside(int p) { - int x = p % Level.getWidth(); - int y = p / Level.getWidth(); - return x > left && y > top && x < right && y < bottom; - } - - public Point center() { - return new Point((left + right) / 2 - + (((right - left) & 1) == 1 ? Random.Int(2) : 0), - (top + bottom) / 2 - + (((bottom - top) & 1) == 1 ? Random.Int(2) : 0)); - } - - public HashSet getCells(){ - HashSet points = getPoints(); - HashSet cells = new HashSet<>(); - for( Point point : points) - cells.add(point.x + point.y*Level.WIDTH); - return cells; - } - - // **** Graph.Node interface **** - - @Override - public int distance() { - return distance; - } - - @Override - public void distance(int value) { - distance = value; - } - - @Override - public int price() { - return price; - } - - @Override - public void price(int value) { - price = value; - } - - @Override - public Collection edges() { - return neigbours; - } - - @Override - public void storeInBundle(Bundle bundle) { - bundle.put("left", left); - bundle.put("top", top); - bundle.put("right", right); - bundle.put("bottom", bottom); - bundle.put("type", type.toString()); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - left = bundle.getInt("left"); - top = bundle.getInt("top"); - right = bundle.getInt("right"); - bottom = bundle.getInt("bottom"); - type = Type.valueOf(bundle.getString("type")); - } - - public static void shuffleTypes() { - int size = SPECIALS.size(); - for (int i = 0; i < size - 1; i++) { - int j = Random.Int(i, size); - if (j != i) { - Type t = SPECIALS.get(i); - SPECIALS.set(i, SPECIALS.get(j)); - SPECIALS.set(j, t); - } - } - } - - public static void useType(Type type) { - if (SPECIALS.remove(type)) { - SPECIALS.add(type); - } - } - - private static final String ROOMS = "rooms"; - - public static void restoreRoomsFromBundle(Bundle bundle) { - if (bundle.contains(ROOMS)) { - SPECIALS.clear(); - for (String type : bundle.getStringArray(ROOMS)) { - SPECIALS.add(Type.valueOf(type)); - } - } else { - shuffleTypes(); - } - } - - public static void storeRoomsInBundle(Bundle bundle) { - String[] array = new String[SPECIALS.size()]; - for (int i = 0; i < array.length; i++) { - array[i] = SPECIALS.get(i).toString(); - } - bundle.put(ROOMS, array); - } - - public static class Door extends Point { - - public static enum Type { - EMPTY, TUNNEL, REGULAR, UNLOCKED, HIDDEN, BARRICADE, LOCKED, ONEWAY - } - - public Type type = Type.EMPTY; - - public Door(int x, int y) { - super(x, y); - } - - public void set(Type type) { - if (type.compareTo(this.type) > 0) { - this.type = type; - } - } - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/levels/RoomOfZotLevel.java b/java/com/hmdzl/spspd/change/levels/RoomOfZotLevel.java deleted file mode 100644 index efa50bdd..00000000 --- a/java/com/hmdzl/spspd/change/levels/RoomOfZotLevel.java +++ /dev/null @@ -1,405 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels; - -import java.util.Collection; -import java.util.HashSet; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.WellWater; -import com.hmdzl.spspd.change.actors.mobs.npcs.Sheep; -import com.hmdzl.spspd.change.actors.mobs.npcs.SheepSokoban; -import com.hmdzl.spspd.change.actors.mobs.npcs.SheepSokobanBlack; -import com.hmdzl.spspd.change.actors.mobs.npcs.SheepSokobanCorner; -import com.hmdzl.spspd.change.actors.mobs.npcs.SheepSokobanSwitch; -import com.hmdzl.spspd.change.items.Gold; -import com.hmdzl.spspd.change.items.Heap; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.artifacts.TimekeepersHourglass; -import com.hmdzl.spspd.change.items.misc.LuckyBadge; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfUpgrade; -import com.hmdzl.spspd.change.items.wands.WandOfFlock; -import com.hmdzl.spspd.change.levels.features.Chasm; -import com.hmdzl.spspd.change.levels.features.Door; -import com.hmdzl.spspd.change.levels.features.HighGrass; -import com.hmdzl.spspd.change.levels.traps.ChangeSheepTrap; -import com.hmdzl.spspd.change.levels.traps.FleecingTrap; -import com.hmdzl.spspd.change.levels.traps.SokobanPortalTrap; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.plants.Plant; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundlable; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -public class RoomOfZotLevel extends Level { - - - { - color1 = 0x534f3e; - color2 = 0xb9d661; - WIDTH = 48; - HEIGHT = 48; - LENGTH = HEIGHT*WIDTH; - } - - - public HashSet heapstogen; - public int[] heapgenspots; - public int[] teleportspots; - public int[] portswitchspots; - public int[] teleportassign; - public int[] destinationspots; - public int[] destinationassign; - public int prizeNo; - - private static final String HEAPSTOGEN = "heapstogen"; - private static final String HEAPGENSPOTS = "heapgenspots"; - private static final String TELEPORTSPOTS = "teleportspots"; - private static final String PORTSWITCHSPOTS = "portswitchspots"; - private static final String DESTINATIONSPOTS = "destinationspots"; - private static final String TELEPORTASSIGN = "teleportassign"; - private static final String DESTINATIONASSIGN= "destinationassign"; - private static final String PRIZENO = "prizeNo"; - - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(HEAPSTOGEN, heapstogen); - bundle.put(HEAPGENSPOTS, heapgenspots); - bundle.put(TELEPORTSPOTS, teleportspots); - bundle.put(PORTSWITCHSPOTS, portswitchspots); - bundle.put(DESTINATIONSPOTS, destinationspots); - bundle.put(DESTINATIONASSIGN, destinationassign); - bundle.put(TELEPORTASSIGN, teleportassign); - bundle.put(PRIZENO, prizeNo); - } - - - - @Override - public void restoreFromBundle(Bundle bundle) { - - super.restoreFromBundle(bundle); - - heapgenspots = bundle.getIntArray(HEAPGENSPOTS); - teleportspots = bundle.getIntArray(TELEPORTSPOTS); - portswitchspots = bundle.getIntArray(PORTSWITCHSPOTS); - destinationspots = bundle.getIntArray(DESTINATIONSPOTS); - destinationassign = bundle.getIntArray(DESTINATIONASSIGN); - teleportassign = bundle.getIntArray(TELEPORTASSIGN); - prizeNo = bundle.getInt(PRIZENO); - - heapstogen = new HashSet(); - - Collection collectionheap = bundle.getCollection(HEAPSTOGEN); - for (Bundlable i : collectionheap) { - Item item = (Item) i; - if (item != null) { - heapstogen.add(item); - } - } - } - - @Override - public void create() { - heapstogen = new HashSet(); - heapgenspots = new int[10]; - teleportspots = new int[10]; - portswitchspots = new int[10]; - destinationspots = new int[10]; - destinationassign = new int[10]; - teleportassign = new int[10]; - super.create(); - } - - public void addItemToGen(Item item, int arraypos, int pos) { - if (item != null) { - heapstogen.add(item); - heapgenspots[arraypos]=pos; - } - } - - - public Item genPrizeItem() { - return genPrizeItem(null); - } - - - public Item genPrizeItem(Class match) { - - boolean keysLeft = false; - - if (heapstogen.size() == 0) - return null; - - for (Item item : heapstogen) { - if (match.isInstance(item)) { - heapstogen.remove(item); - keysLeft=true; - return item; - } - } - - if (match == null || !keysLeft) { - Item item = Random.element(heapstogen); - heapstogen.remove(item); - return item; - } - - return null; - } - - @Override - public void press(int cell, Char ch) { - - if (pit[cell] && ch == Dungeon.hero) { - Chasm.heroFall(cell); - return; - } - - TimekeepersHourglass.timeFreeze timeFreeze = null; - - if (ch != null) - timeFreeze = ch.buff(TimekeepersHourglass.timeFreeze.class); - - boolean trap = false; - - switch (map[cell]) { - - case Terrain.FLEECING_TRAP: - - if (ch != null && ch==Dungeon.hero){ - trap = true; - FleecingTrap.trigger(cell, ch); - } - break; - - case Terrain.CHANGE_SHEEP_TRAP: - - if (ch instanceof SheepSokoban || ch instanceof SheepSokobanSwitch || ch instanceof SheepSokobanCorner || ch instanceof Sheep || ch instanceof WandOfFlock.MagicSheep){ - trap = true; - ChangeSheepTrap.trigger(cell, ch); - } - break; - - case Terrain.PORT_WELL: - - if (ch != null && ch==Dungeon.hero){ - - int portarray=-1; - int destinationspot=cell; - - for(int i = 0; i < teleportspots.length; i++) { - if(teleportspots[i] == cell) { - portarray = i; - break; - } - } - - if(portarray != -1) { - destinationspot=destinationspots[portarray]; - if (destinationspot>0){ - SokobanPortalTrap.trigger(cell, ch, destinationspot); - } - } - } - break; - - case Terrain.HIGH_GRASS: - HighGrass.trample(this, cell, ch); - break; - - case Terrain.WELL: - WellWater.affectCell(cell); - break; - - /*case Terrain.ALCHEMY: - if (ch == null) { - Alchemy.transmute(cell); - } - break;*/ - - case Terrain.DOOR: - Door.enter(cell); - break; - } - - if (trap){ - - if (Dungeon.visible[cell]) - Sample.INSTANCE.play(Assets.SND_TRAP); - - if (ch == Dungeon.hero) - Dungeon.hero.interrupt(); - - set(cell, Terrain.INACTIVE_TRAP); - GameScene.updateMap(cell); - } - - Plant plant = plants.get(cell); - if (plant != null) { - plant.activate(ch); - } - } - - @Override - public String tilesTex() { - return Assets.TILES_PUZZLE; - } - - @Override - public String waterTex() { - return Assets.WATER_PRISON; - } - - @Override - protected boolean build() { - - map = SaveRoomLayouts.ROOM_OF_ZOT.clone(); - - decorate(); - - buildFlagMaps(); - cleanWalls(); - createSwitches(); - createSheep(); - - entrance = 23 + WIDTH * 15; - - - return true; - } - @Override - protected void decorate() { - //do nothing, all decorations are hard-coded. - } - - @Override - protected void createMobs() { - /* - SokobanSentinel mob = new SokobanSentinel(); - mob.pos = 38 + WIDTH * 21; - mobs.add(mob); - Actor.occupyCell(mob); - - SokobanSentinel mob2 = new SokobanSentinel(); - mob2.pos = 25 + WIDTH * 36; - mobs.add(mob2); - Actor.occupyCell(mob2); - */ - } - - - - - @Override - public String tileName( int tile ) { - switch (tile) { - case Terrain.WATER: - return Messages.get(PrisonLevel.class, "water_name"); - default: - return super.tileName( tile ); - } - } - - @Override - public String tileDesc(int tile) { - switch (tile) { - case Terrain.EMPTY_DECO: - return Messages.get(PrisonLevel.class, "empty_deco_desc"); - case Terrain.BOOKSHELF: - return Messages.get(PrisonLevel.class, "bookshelf_desc"); - default: - return super.tileDesc( tile ); - } - } - - - protected void createSheep() { - for (int i = 0; i < LENGTH; i++) { - if (map[i]==Terrain.SOKOBAN_SHEEP){SheepSokoban npc = new SheepSokoban(); mobs.add(npc); npc.pos = i; Actor.occupyCell(npc);} - else if (map[i]==Terrain.CORNER_SOKOBAN_SHEEP){SheepSokobanCorner npc = new SheepSokobanCorner(); mobs.add(npc); npc.pos = i; Actor.occupyCell(npc);} - else if (map[i]==Terrain.SWITCH_SOKOBAN_SHEEP){SheepSokobanSwitch npc = new SheepSokobanSwitch(); mobs.add(npc); npc.pos = i; Actor.occupyCell(npc);} - else if (map[i]==Terrain.BLACK_SOKOBAN_SHEEP){SheepSokobanBlack npc = new SheepSokobanBlack(); mobs.add(npc); npc.pos = i; Actor.occupyCell(npc);} - else if (map[i]==Terrain.PORT_WELL){ - - /* - Portal portal = new Portal(); - portal.seed(i, 1); - blobs.put(Portal.class, portal); - */ - } - - } - } - - - protected void createSwitches(){ - - //spots where your portal switches are - - - //spots where your portals are - - - - //assign each switch to a portal - - - //assign each switch to a destination spot - - - - //set the original destination of portals - - - } - - - @Override - protected void createItems() { - int goldmin=1; int goldmax=10; - boolean ringDrop = false; - if (first){ - goldmin=50; goldmax=100; - } - for (int i = 0; i < LENGTH; i++) { - if (map[i]==Terrain.EMPTY && heaps.get(i) == null && Random.Int(100)>70){ - if (first && !ringDrop){drop(new LuckyBadge(), i).type = Heap.Type.CHEST; ringDrop=true;} - else if (first && Random.Int(50)==0){drop(new ScrollOfUpgrade(), i).type = Heap.Type.CHEST;} - else {drop(new Gold(Random.Int(goldmin, goldmax)), i).type = Heap.Type.CHEST;} - } - } - - - } - - @Override - public int randomRespawnCell() { - return -1; - } - - - -} diff --git a/java/com/hmdzl/spspd/change/levels/SafeLevel.java b/java/com/hmdzl/spspd/change/levels/SafeLevel.java deleted file mode 100644 index f18891ff..00000000 --- a/java/com/hmdzl/spspd/change/levels/SafeLevel.java +++ /dev/null @@ -1,406 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels; - -import java.util.Collection; -import java.util.HashSet; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.WellWater; -import com.hmdzl.spspd.change.actors.mobs.npcs.Sheep; -import com.hmdzl.spspd.change.actors.mobs.npcs.SheepSokoban; -import com.hmdzl.spspd.change.actors.mobs.npcs.SheepSokobanBlack; -import com.hmdzl.spspd.change.actors.mobs.npcs.SheepSokobanCorner; -import com.hmdzl.spspd.change.actors.mobs.npcs.SheepSokobanSwitch; -import com.hmdzl.spspd.change.items.Gold; -import com.hmdzl.spspd.change.items.Heap; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.artifacts.TimekeepersHourglass; -import com.hmdzl.spspd.change.items.misc.LuckyBadge; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfUpgrade; -import com.hmdzl.spspd.change.items.wands.WandOfFlock; -import com.hmdzl.spspd.change.levels.features.Chasm; -import com.hmdzl.spspd.change.levels.features.Door; -import com.hmdzl.spspd.change.levels.features.HighGrass; -import com.hmdzl.spspd.change.levels.traps.ChangeSheepTrap; -import com.hmdzl.spspd.change.levels.traps.FleecingTrap; -import com.hmdzl.spspd.change.levels.traps.SokobanPortalTrap; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.plants.Plant; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundlable; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -public class SafeLevel extends Level { - - - { - color1 = 0x534f3e; - color2 = 0xb9d661; - WIDTH = 48; - HEIGHT = 48; - LENGTH = HEIGHT*WIDTH; - } - - - public HashSet heapstogen; - public int[] heapgenspots; - public int[] teleportspots; - public int[] portswitchspots; - public int[] teleportassign; - public int[] destinationspots; - public int[] destinationassign; - public int prizeNo; - - private static final String HEAPSTOGEN = "heapstogen"; - private static final String HEAPGENSPOTS = "heapgenspots"; - private static final String TELEPORTSPOTS = "teleportspots"; - private static final String PORTSWITCHSPOTS = "portswitchspots"; - private static final String DESTINATIONSPOTS = "destinationspots"; - private static final String TELEPORTASSIGN = "teleportassign"; - private static final String DESTINATIONASSIGN= "destinationassign"; - private static final String PRIZENO = "prizeNo"; - - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(HEAPSTOGEN, heapstogen); - bundle.put(HEAPGENSPOTS, heapgenspots); - bundle.put(TELEPORTSPOTS, teleportspots); - bundle.put(PORTSWITCHSPOTS, portswitchspots); - bundle.put(DESTINATIONSPOTS, destinationspots); - bundle.put(DESTINATIONASSIGN, destinationassign); - bundle.put(TELEPORTASSIGN, teleportassign); - bundle.put(PRIZENO, prizeNo); - } - - - - @Override - public void restoreFromBundle(Bundle bundle) { - - super.restoreFromBundle(bundle); - - heapgenspots = bundle.getIntArray(HEAPGENSPOTS); - teleportspots = bundle.getIntArray(TELEPORTSPOTS); - portswitchspots = bundle.getIntArray(PORTSWITCHSPOTS); - destinationspots = bundle.getIntArray(DESTINATIONSPOTS); - destinationassign = bundle.getIntArray(DESTINATIONASSIGN); - teleportassign = bundle.getIntArray(TELEPORTASSIGN); - prizeNo = bundle.getInt(PRIZENO); - - heapstogen = new HashSet(); - - Collection collectionheap = bundle.getCollection(HEAPSTOGEN); - for (Bundlable i : collectionheap) { - Item item = (Item) i; - if (item != null) { - heapstogen.add(item); - } - } - } - - @Override - public void create() { - heapstogen = new HashSet(); - heapgenspots = new int[10]; - teleportspots = new int[10]; - portswitchspots = new int[10]; - destinationspots = new int[10]; - destinationassign = new int[10]; - teleportassign = new int[10]; - super.create(); - } - - public void addItemToGen(Item item, int arraypos, int pos) { - if (item != null) { - heapstogen.add(item); - heapgenspots[arraypos]=pos; - } - } - - - public Item genPrizeItem() { - return genPrizeItem(null); - } - - - public Item genPrizeItem(Class match) { - - boolean keysLeft = false; - - if (heapstogen.size() == 0) - return null; - - for (Item item : heapstogen) { - if (match.isInstance(item)) { - heapstogen.remove(item); - keysLeft=true; - return item; - } - } - - if (match == null || !keysLeft) { - Item item = Random.element(heapstogen); - heapstogen.remove(item); - return item; - } - - return null; - } - - @Override - public void press(int cell, Char ch) { - - if (pit[cell] && ch == Dungeon.hero) { - Chasm.heroFall(cell); - return; - } - - TimekeepersHourglass.timeFreeze timeFreeze = null; - - if (ch != null) - timeFreeze = ch.buff(TimekeepersHourglass.timeFreeze.class); - - boolean trap = false; - - switch (map[cell]) { - - case Terrain.FLEECING_TRAP: - - if (ch != null && ch==Dungeon.hero){ - trap = true; - FleecingTrap.trigger(cell, ch); - } - break; - - case Terrain.CHANGE_SHEEP_TRAP: - - if (ch instanceof SheepSokoban || ch instanceof SheepSokobanSwitch || ch instanceof SheepSokobanCorner || ch instanceof Sheep || ch instanceof WandOfFlock.MagicSheep){ - trap = true; - ChangeSheepTrap.trigger(cell, ch); - } - break; - - case Terrain.PORT_WELL: - - if (ch != null && ch==Dungeon.hero){ - - int portarray=-1; - int destinationspot=cell; - - for(int i = 0; i < teleportspots.length; i++) { - if(teleportspots[i] == cell) { - portarray = i; - break; - } - } - - if(portarray != -1) { - destinationspot=destinationspots[portarray]; - if (destinationspot>0){ - SokobanPortalTrap.trigger(cell, ch, destinationspot); - } - } - } - break; - - case Terrain.HIGH_GRASS: - HighGrass.trample(this, cell, ch); - break; - - case Terrain.WELL: - WellWater.affectCell(cell); - break; - - /*case Terrain.ALCHEMY: - if (ch == null) { - Alchemy.transmute(cell); - } - break;*/ - - case Terrain.DOOR: - Door.enter(cell); - break; - } - - if (trap){ - - if (Dungeon.visible[cell]) - Sample.INSTANCE.play(Assets.SND_TRAP); - - if (ch == Dungeon.hero) - Dungeon.hero.interrupt(); - - set(cell, Terrain.INACTIVE_TRAP); - GameScene.updateMap(cell); - } - - Plant plant = plants.get(cell); - if (plant != null) { - plant.activate(ch); - } - } - - @Override - public String tilesTex() { - return Assets.TILES_PUZZLE; - } - - @Override - public String waterTex() { - return Assets.WATER_PRISON; - } - - @Override - protected boolean build() { - - map = SaveRoomLayouts.SAFE_ROOM_DEFAULT.clone(); - - decorate(); - - buildFlagMaps(); - cleanWalls(); - createSwitches(); - createSheep(); - - entrance = 23 + WIDTH * 15; - exit = 0 + WIDTH * 47; - - - return true; - } - @Override - protected void decorate() { - //do nothing, all decorations are hard-coded. - } - - @Override - protected void createMobs() { - /* - SokobanSentinel mob = new SokobanSentinel(); - mob.pos = 38 + WIDTH * 21; - mobs.add(mob); - Actor.occupyCell(mob); - - SokobanSentinel mob2 = new SokobanSentinel(); - mob2.pos = 25 + WIDTH * 36; - mobs.add(mob2); - Actor.occupyCell(mob2); - */ - } - - - - - @Override - public String tileName( int tile ) { - switch (tile) { - case Terrain.WATER: - return Messages.get(PrisonLevel.class, "water_name"); - default: - return super.tileName( tile ); - } - } - - @Override - public String tileDesc(int tile) { - switch (tile) { - case Terrain.EMPTY_DECO: - return Messages.get(PrisonLevel.class, "empty_deco_desc"); - case Terrain.BOOKSHELF: - return Messages.get(PrisonLevel.class, "bookshelf_desc"); - default: - return super.tileDesc( tile ); - } - } - - - protected void createSheep() { - for (int i = 0; i < LENGTH; i++) { - if (map[i]==Terrain.SOKOBAN_SHEEP){SheepSokoban npc = new SheepSokoban(); mobs.add(npc); npc.pos = i; Actor.occupyCell(npc);} - else if (map[i]==Terrain.CORNER_SOKOBAN_SHEEP){SheepSokobanCorner npc = new SheepSokobanCorner(); mobs.add(npc); npc.pos = i; Actor.occupyCell(npc);} - else if (map[i]==Terrain.SWITCH_SOKOBAN_SHEEP){SheepSokobanSwitch npc = new SheepSokobanSwitch(); mobs.add(npc); npc.pos = i; Actor.occupyCell(npc);} - else if (map[i]==Terrain.BLACK_SOKOBAN_SHEEP){SheepSokobanBlack npc = new SheepSokobanBlack(); mobs.add(npc); npc.pos = i; Actor.occupyCell(npc);} - else if (map[i]==Terrain.PORT_WELL){ - - /* - Portal portal = new Portal(); - portal.seed(i, 1); - blobs.put(Portal.class, portal); - */ - } - - } - } - - - protected void createSwitches(){ - - //spots where your portal switches are - - - //spots where your portals are - - - - //assign each switch to a portal - - - //assign each switch to a destination spot - - - - //set the original destination of portals - - - } - - - @Override - protected void createItems() { - int goldmin=1; int goldmax=10; - boolean ringDrop = false; - if (first){ - goldmin=25; goldmax=50; - } - for (int i = 0; i < LENGTH; i++) { - if (map[i]==Terrain.EMPTY && heaps.get(i) == null && Random.Int(100)>70){ - if (first && !ringDrop){drop(new LuckyBadge().identify(), i).type = Heap.Type.CHEST; ringDrop=true;} - else if (first && Random.Int(50)==0){drop(new ScrollOfUpgrade(), i).type = Heap.Type.CHEST;} - else {drop(new Gold(Random.Int(goldmin, goldmax)), i).type = Heap.Type.CHEST;} - } - } - - - } - - @Override - public int randomRespawnCell() { - return -1; - } - - - -} diff --git a/java/com/hmdzl/spspd/change/levels/SaveRoomLayouts.java b/java/com/hmdzl/spspd/change/levels/SaveRoomLayouts.java deleted file mode 100644 index e799ff15..00000000 --- a/java/com/hmdzl/spspd/change/levels/SaveRoomLayouts.java +++ /dev/null @@ -1,149 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels; - -import com.watabou.utils.Random; - -public class SaveRoomLayouts { - - //32X32 - private static final int W = Terrain.WALL; - private static final int B = Terrain.BED; - private static final int Z = Terrain.HIGH_GRASS; - private static final int D = Terrain.DOOR; - private static final int L = Terrain.LOCKED_DOOR; - - private static final int T = Terrain.TENT; - - private static final int E = Terrain.EMPTY; - //private static final int I = Terrain.EXIT; - - private static final int M = Terrain.WALL_DECO; - private static final int P = Terrain.PEDESTAL; - - private static final int J = Terrain.WATER; - private static final int Y = Terrain.ALCHEMY; - private static final int K = Terrain.EMPTY_SP; - - - public static final int[] SAFE_ROOM_DEFAULT = { - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, E, E, E, E, E, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, K, K, K, W, E, K, K, K, E, W, E, E, E, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, B, K, K, D, E, K, T, K, E, D, E, Z, E, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, K, K, K, W, E, K, K, K, E, W, E, E, E, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, E, E, E, E, E, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, E, E, E, E, W, W, W, W, D, W, W, W, W, E, E, E, E, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, E, E, E, E, W, E, E, E, E, E, E, E, W, E, E, E, E, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, E, E, E, E, W, E, E, E, E, E, E, E, W, E, E, E, E, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, E, E, E, E, D, E, E, E, E, E, E, E, D, E, E, E, E, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, E, E, E, E, W, E, E, E, E, E, E, E, W, E, E, E, E, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, E, E, E, E, W, E, E, E, E, E, E, E, W, E, E, E, E, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, E, E, E, E, W, E, E, E, E, E, E, E, W, E, E, E, E, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, D, W, W, D, W, W, D, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, Y, K, K, W, Z, Z, Z, W, J, J, J, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, K, K, K, W, Z, Z, Z, W, J, J, J, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, K, K, K, W, Z, Z, Z, W, J, J, J, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, Z, Z, Z, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W - - }; - - public static final int[] ROOM_OF_ZOT = { - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, E, E, E, E, E, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, K, K, K, W, E, K, K, K, E, W, E, E, E, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, B, K, K, D, E, K, T, K, E, D, E, Z, E, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, K, K, K, W, E, K, K, K, E, W, E, E, E, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, E, E, E, E, E, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, E, E, E, E, W, W, W, W, D, W, W, W, W, E, E, E, E, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, E, E, E, E, W, E, E, E, E, E, E, E, W, E, E, E, E, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, E, E, E, E, W, E, E, E, E, E, E, E, W, E, E, E, E, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, E, E, E, E, D, E, E, E, E, E, E, E, D, E, E, E, E, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, E, E, E, E, W, E, E, E, E, E, E, E, W, E, E, E, E, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, E, E, E, E, W, E, E, E, E, E, E, E, W, E, E, E, E, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, E, E, E, E, W, E, E, E, E, E, E, E, W, E, E, E, E, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, D, W, W, D, W, W, D, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, Y, K, K, W, Z, Z, Z, W, J, J, J, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, K, K, K, W, Z, Z, Z, W, J, J, J, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, K, K, K, W, Z, Z, Z, W, J, J, J, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, Z, Z, Z, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W - - }; - - -} diff --git a/java/com/hmdzl/spspd/change/levels/SewerBossLevel.java b/java/com/hmdzl/spspd/change/levels/SewerBossLevel.java deleted file mode 100644 index a87b5bae..00000000 --- a/java/com/hmdzl/spspd/change/levels/SewerBossLevel.java +++ /dev/null @@ -1,310 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels; - -import java.util.ArrayList; -import java.util.List; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.mobs.Bestiary; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.items.Heap; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.levels.Room.Type; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.watabou.noosa.Scene; -import com.watabou.utils.Bundle; -import com.watabou.utils.Graph; -import com.watabou.utils.Random; - -public class SewerBossLevel extends RegularLevel { - - { - color1 = 0x48763c; - color2 = 0x59994a; - } - - private int stairs = 0; - - @Override - public String tilesTex() { - return Assets.TILES_SEWERS; - } - - @Override - public String waterTex() { - return Assets.WATER_SEWERS; - } - - @Override - protected boolean build() { - - initRooms(); - - int distance; - // if we ever need to try 20 or more times to find a room, better to - // give up and try again. - int retry = 0; - - // start with finding an entrance room (will also contain exit) - // the room must be at least 4x4 and be nearer the top of the map(so - // that it is less likely something connects to the top) - do { - if (retry++ > 20) { - return false; - } - roomEntrance = Random.element(rooms); - } while (roomEntrance.width() < 4 || roomEntrance.height() < 4 - || roomEntrance.top == 0 || roomEntrance.top >= 12); - - roomEntrance.type = Type.ENTRANCE; - roomExit = roomEntrance; - - // now find the rest of the rooms for this boss mini-maze - Room curRoom = null; - Room lastRoom = roomEntrance; - // we make 4 rooms, last iteration is tieing the final room to the start - for (int i = 0; i <= 4; i++) { - retry = 0; - // find a suitable room the first four times - // suitable room should be empty, have a distance of 2 from the - // current room, and not touch the entrance. - if (i < 4) { - do { - if (retry++ > 20) { - return false; - } - curRoom = Random.element(rooms); - Graph.buildDistanceMap(rooms, curRoom); - distance = lastRoom.distance(); - } while (curRoom.type != Type.NULL || distance != 2 - || !curRoom.intersect(roomEntrance).isEmpty()); - - curRoom.type = Type.STANDARD; - - // otherwise, we're on the last iteration. - } else { - // set the current room to the entrance, so we can build a - // connection to it. - curRoom = roomEntrance; - } - - // now build a connection between the current room and the last one. - Graph.buildDistanceMap(rooms, curRoom); - List path = Graph.buildPath(rooms, lastRoom, curRoom); - - Graph.setPrice(path, lastRoom.distance); - - path = Graph.buildPath(rooms, lastRoom, curRoom); - - Room room = lastRoom; - for (Room next : path) { - room.connect(next); - room = next; - } - - if (i == 4) { - - // we must find a room for his royal highness! - // look at rooms adjacent to the final found room (likely to be - // furthest from start) - ArrayList candidates = new ArrayList(); - for (Room r : lastRoom.neigbours) { - if (r.type == Type.NULL && r.connected.size() == 0 - && !r.neigbours.contains(roomEntrance)) { - candidates.add(r); - } - } - - // if we have candidates, pick a room and put the king there - if (candidates.size() > 0) { - Room kingsRoom = Random.element(candidates); - kingsRoom.connect(lastRoom); - kingsRoom.type = Room.Type.RAT_KING; - - // unacceptable! make a new level... - } else { - return false; - } - } - lastRoom = curRoom; - } - - // the connection structure ensures that (most of the time) there is a - // nice loop for the player to kite the - // boss around. What's nice is that there is enough chaos such that the - // loop is rarely straightforward - // and boring. - - // fills our connection rooms in with tunnel - for (Room r : rooms) { - if (r.type == Type.NULL && r.connected.size() > 0) { - r.type = Type.TUNNEL; - } - } - - // make sure nothing is connecting at the top of the entrance, this - // would be bad. - for (Room r : roomEntrance.neigbours) { - if (r.bottom == roomEntrance.top && r.type != Type.NULL) - return false; - } - - paint(); - - // TODO: not handling this through a painter is kinda iffy, separate - // into a painter if you use it again. - // sticks the exit in the room entrance. - exit = roomEntrance.top * Level.getWidth() - + (roomEntrance.left + roomEntrance.right) / 2; - map[exit] = Terrain.LOCKED_EXIT; - - paintWater(); - paintGrass(); - - return true; - } - - @Override - protected boolean[] water() { - return Patch.generate(0.5f, 5); - } - - @Override - protected boolean[] grass() { - return Patch.generate(0.40f, 4); - } - - @Override - protected void decorate() { - int start = roomExit.top * getWidth() + roomExit.left + 1; - int end = start + roomExit.width() - 1; - for (int i = start; i < end; i++) { - if (i != exit) { - map[i] = Terrain.WALL_DECO; - map[i + getWidth()] = Terrain.WATER; - } else { - map[i + getWidth()] = Terrain.EMPTY; - } - } - - while (true) { - int pos = roomEntrance.random(); - if (pos != entrance) { - map[pos] = Terrain.SIGN; - break; - } - } - } - - @Override - public void addVisuals(Scene scene) { - SewerLevel.addVisuals(this, scene); - } - - @Override - protected void createMobs() { - Mob mob = Bestiary.mob(Dungeon.depth); - Room room; - do { - room = Random.element(rooms); - } while (room.type != Type.STANDARD); - mob.pos = room.random(); - mobs.add(mob); - } - - @Override - public Actor respawner() { - return null; - } - - @Override - protected void createItems() { - } - - @Override - public int randomRespawnCell() { - return -1; - } - public void seal() { - if (entrance != 0) { - - locked = true; - - set(entrance, Terrain.WATER_TILES); - GameScene.updateMap(entrance); - GameScene.ripple(entrance); - - stairs = entrance; - entrance = 0; - } - } - - public void unseal() { - if (stairs != 0) { - - locked = false; - - entrance = stairs; - stairs = 0; - - set(entrance, Terrain.ENTRANCE); - GameScene.updateMap(entrance); - - } - } - - private static final String STAIRS = "stairs"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(STAIRS, stairs); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - stairs = bundle.getInt(STAIRS); - } - - @Override - public String tileName( int tile ) { - switch (tile) { - case Terrain.WATER: - return Messages.get(SewerLevel.class, "water_name"); - default: - return super.tileName( tile ); - } - } - - @Override - public String tileDesc(int tile) { - switch (tile) { - case Terrain.EMPTY_DECO: - return Messages.get(SewerLevel.class, "empty_deco_desc"); - case Terrain.BOOKSHELF: - return Messages.get(SewerLevel.class, "bookshelf_desc"); - default: - return super.tileDesc( tile ); - } - } -} diff --git a/java/com/hmdzl/spspd/change/levels/SewerLevel.java b/java/com/hmdzl/spspd/change/levels/SewerLevel.java deleted file mode 100644 index 236806ff..00000000 --- a/java/com/hmdzl/spspd/change/levels/SewerLevel.java +++ /dev/null @@ -1,310 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Challenges; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.DungeonTilemap; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.hero.HeroClass; -import com.hmdzl.spspd.change.actors.mobs.npcs.Ghost; -import com.hmdzl.spspd.change.actors.mobs.GnollArcher; -import com.hmdzl.spspd.change.actors.mobs.npcs.Tinkerer1; -import com.hmdzl.spspd.change.items.bombs.Bomb; -import com.hmdzl.spspd.change.items.DewVial; -import com.hmdzl.spspd.change.items.bombs.DungeonBomb; -import com.hmdzl.spspd.change.items.quest.Mushroom; -import com.hmdzl.spspd.change.items.food.fruit.Blackberry; -import com.hmdzl.spspd.change.items.food.fruit.Blueberry; -import com.hmdzl.spspd.change.items.food.fruit.Cloudberry; -import com.hmdzl.spspd.change.items.food.fruit.Moonberry; -import com.hmdzl.spspd.change.levels.traps.AlarmTrap; -import com.hmdzl.spspd.change.levels.traps.ChillingTrap; -import com.hmdzl.spspd.change.levels.traps.FlockTrap; -import com.hmdzl.spspd.change.levels.traps.OozeTrap; -import com.hmdzl.spspd.change.levels.traps.ShockTrap; -import com.hmdzl.spspd.change.levels.traps.SummoningTrap; -import com.hmdzl.spspd.change.levels.traps.TeleportationTrap; -import com.hmdzl.spspd.change.levels.traps.ToxicTrap; -import com.hmdzl.spspd.change.levels.traps.WornTrap; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.watabou.noosa.Game; -import com.watabou.noosa.Scene; -import com.watabou.noosa.particles.Emitter; -import com.watabou.noosa.particles.PixelParticle; -import com.watabou.utils.ColorMath; -import com.watabou.utils.PointF; -import com.watabou.utils.Random; - -public class SewerLevel extends RegularLevel { - - { - color1 = 0x48763c; - color2 = 0x59994a; - } - - @Override - public String tilesTex() { - return Assets.TILES_SEWERS; - } - - - @Override - public String waterTex() { - return Assets.WATER_SEWERS; - } - - @Override - protected boolean[] water() { - return Patch.generate(feeling == Feeling.WATER ? 0.60f : 0.45f, 5); - } - - @Override - protected boolean[] grass() { - return Patch.generate(feeling == Feeling.GRASS ? 0.60f : 0.40f, 4); - } - - @Override - protected Class[] trapClasses() { - return Dungeon.depth == 1 ? - new Class[]{WornTrap.class} : - new Class[]{ChillingTrap.class, ToxicTrap.class, WornTrap.class, - AlarmTrap.class, OozeTrap.class, ShockTrap.class, - FlockTrap.class, SummoningTrap.class, TeleportationTrap.class, }; -} - - @Override - protected float[] trapChances() { - return Dungeon.depth == 1 ? - new float[]{1} : - new float[]{4, 4, 4, - 2, 2, 2, - 1, 1, 1}; - } - - @Override - protected void setPar(){ - Dungeon.pars[Dungeon.depth] = 500+(Dungeon.depth*50)+(secretDoors*50); - } - - @Override - protected void decorate() { - - for (int i = 0; i < getWidth(); i++) { - if (map[i] == Terrain.WALL && map[i + getWidth()] == Terrain.WATER - && Random.Int(4) == 0) { - - map[i] = Terrain.WALL_DECO; - } - } - - for (int i = getWidth(); i < getLength() - getWidth(); i++) { - if (map[i] == Terrain.WALL && map[i - getWidth()] == Terrain.WALL - && map[i + getWidth()] == Terrain.WATER && Random.Int(2) == 0) { - - map[i] = Terrain.WALL_DECO; - } - } - - for (int i = getWidth() + 1; i < getLength() - getWidth() - 1; i++) { - if (map[i] == Terrain.EMPTY) { - - int count = (map[i + 1] == Terrain.WALL ? 1 : 0) - + (map[i - 1] == Terrain.WALL ? 1 : 0) - + (map[i + getWidth()] == Terrain.WALL ? 1 : 0) - + (map[i - getWidth()] == Terrain.WALL ? 1 : 0); - - if (Random.Int(16) < count * count) { - map[i] = Terrain.EMPTY_DECO; - } - } - } - - while (true) { - int pos = roomEntrance.random(); - if (pos != entrance) { - map[pos] = Terrain.SIGN; - break; - } - } - - setPar(); - - - } - - @Override - protected void createItems() { - if (!Dungeon.limitedDrops.dewVial.dropped() && Dungeon.depth == 1) { - addItemToSpawn(new DewVial()); - Dungeon.limitedDrops.dewVial.drop(); - addItemToSpawn(new Moonberry()); - addItemToSpawn(new Blueberry()); - addItemToSpawn(new Cloudberry()); - addItemToSpawn(new Blackberry()); - - //addItemToSpawn(new Spectacles()); - //addItemToSpawn(new Towel()); - - //addItemToSpawn(new Egg()); - } - - if (Dungeon.depth == 1 && Dungeon.isChallenged(Challenges.TEST_TIME)){ - Tinkerer1 npc = new Tinkerer1(); - do { - npc.pos = randomRespawnCell(); - } while (npc.pos == -1 || heaps.get(npc.pos) != null); - mobs.add(npc); - Actor.occupyCell(npc); - } else if (Dungeon.depth == 2){ - Tinkerer1 npc = new Tinkerer1(); - do { - npc.pos = randomRespawnCell(); - } while (npc.pos == -1 || heaps.get(npc.pos) != null); - mobs.add(npc); - Actor.occupyCell(npc); - } - - if (Dungeon.depth == 1){ - addItemToSpawn(new Mushroom()); - } - - Ghost.Quest.spawn(this); - spawnGnoll(this); - - if (Dungeon.hero.heroClass==HeroClass.PERFORMER && Random.Int(3) == 0){addItemToSpawn(new DungeonBomb());} - super.createItems(); - } - - public static void spawnGnoll(SewerLevel level) { - if (Dungeon.depth == 4 && !Dungeon.gnollspawned){ - - GnollArcher gnoll = new GnollArcher(); - do { - gnoll.pos = level.randomRespawnCell(); - } while (gnoll.pos == -1); - level.mobs.add(gnoll); - Actor.occupyCell(gnoll); - - Dungeon.gnollspawned = true; - } - } - - - @Override - public void addVisuals(Scene scene) { - super.addVisuals(scene); - addVisuals(this, scene); - } - - public static void addVisuals(Level level, Scene scene) { - for (int i = 0; i < getLength(); i++) { - if (level.map[i] == Terrain.WALL_DECO) { - scene.add(new Sink(i)); - } - } - } - - @Override - public String tileName( int tile ) { - switch (tile) { - case Terrain.WATER: - return Messages.get(SewerLevel.class, "water_name"); - default: - return super.tileName( tile ); - } - } - - @Override - public String tileDesc(int tile) { - switch (tile) { - case Terrain.EMPTY_DECO: - return Messages.get(SewerLevel.class, "empty_deco_desc"); - case Terrain.BOOKSHELF: - return Messages.get(SewerLevel.class, "bookshelf_desc"); - default: - return super.tileDesc( tile ); - } - } - - private static class Sink extends Emitter { - - private int pos; - private float rippleDelay = 0; - - private static final Emitter.Factory factory = new Factory() { - - @Override - public void emit(Emitter emitter, int index, float x, float y) { - WaterParticle p = (WaterParticle) emitter - .recycle(WaterParticle.class); - p.reset(x, y); - } - }; - - public Sink(int pos) { - super(); - - this.pos = pos; - - PointF p = DungeonTilemap.tileCenterToWorld(pos); - pos(p.x - 2, p.y + 1, 4, 0); - - pour(factory, 0.05f); - } - - @Override - public void update() { - if (visible = Dungeon.visible[pos]) { - - super.update(); - - if ((rippleDelay -= Game.elapsed) <= 0) { - GameScene.ripple(pos + getWidth()).y -= DungeonTilemap.SIZE / 2; - rippleDelay = Random.Float(0.2f, 0.3f); - } - } - } - } - - public static final class WaterParticle extends PixelParticle { - - public WaterParticle() { - super(); - - acc.y = 50; - am = 0.5f; - - color(ColorMath.random(0xb6ccc2, 0x3b6653)); - size(2); - } - - public void reset(float x, float y) { - revive(); - - this.x = x; - this.y = y; - - speed.set(Random.Float(-2, +2), 0); - - left = lifespan = 0.5f; - } - } -} diff --git a/java/com/hmdzl/spspd/change/levels/SkeletonBossLevel.java b/java/com/hmdzl/spspd/change/levels/SkeletonBossLevel.java deleted file mode 100644 index 24b23739..00000000 --- a/java/com/hmdzl/spspd/change/levels/SkeletonBossLevel.java +++ /dev/null @@ -1,279 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.actors.mobs.SkeletonHand1; -import com.hmdzl.spspd.change.actors.mobs.SkeletonHand2; -import com.hmdzl.spspd.change.actors.mobs.SkeletonKing; -import com.hmdzl.spspd.change.items.Heap; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.keys.SkeletonKey; -import com.hmdzl.spspd.change.items.potions.PotionOfLiquidFlame; -import com.hmdzl.spspd.change.levels.painters.Painter; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.watabou.noosa.Scene; -import com.watabou.noosa.tweeners.AlphaTweener; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -public class SkeletonBossLevel extends Level { - - { - color1 = 0x6a723d; - color2 = 0x88924c; - cleared=true; - viewDistance = 8; - } - - private static final int TOP = 2; - private static final int HALL_WIDTH = 13; - private static final int HALL_HEIGHT = 15; - private static final int CHAMBER_HEIGHT = 3; - - private static final int LEFT = (getWidth() - HALL_WIDTH) / 2; - private static final int CENTER = LEFT + HALL_WIDTH / 2; - - private int arenaDoor; - private boolean enteredArena = false; - private boolean keyDropped = false; - - @Override - public String tilesTex() { - return Assets.TILES_SKELETON; - } - - @Override - public String waterTex() { - return Assets.WATER_PRISON; - } - - private static final String DOOR = "door"; - private static final String ENTERED = "entered"; - private static final String DROPPED = "droppped"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(DOOR, arenaDoor); - bundle.put(ENTERED, enteredArena); - bundle.put(DROPPED, keyDropped); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - arenaDoor = bundle.getInt(DOOR); - enteredArena = bundle.getBoolean(ENTERED); - keyDropped = bundle.getBoolean(DROPPED); - } - - @Override - protected boolean build() { - - Painter.fill(this, LEFT, TOP, HALL_WIDTH, HALL_HEIGHT, Terrain.EMPTY); - Painter.fill(this, CENTER, TOP, 1, HALL_HEIGHT, Terrain.EMPTY); - - int y = TOP + 1; - while (y < TOP + HALL_HEIGHT) { - map[y * getWidth() + CENTER - 2] = Terrain.STATUE; - map[y * getWidth() + CENTER + 2] = Terrain.STATUE; - y += 2; - } - - exit = (TOP - 1) * getWidth() + CENTER; - map[exit] = Terrain.LOCKED_EXIT; - - arenaDoor = (TOP + HALL_HEIGHT) * getWidth() + CENTER; - map[arenaDoor] = Terrain.DOOR; - - Painter.fill(this, LEFT, TOP + HALL_HEIGHT + 1, HALL_WIDTH, - CHAMBER_HEIGHT, Terrain.EMPTY); - Painter.fill(this, LEFT, TOP + HALL_HEIGHT + 1, 1, CHAMBER_HEIGHT, - Terrain.WATER); - Painter.fill(this, LEFT + HALL_WIDTH - 1, TOP + HALL_HEIGHT + 1, 1, - CHAMBER_HEIGHT, Terrain.WATER); - - entrance = (TOP + HALL_HEIGHT + 2 + Random.Int(CHAMBER_HEIGHT - 1)) - * getWidth() + LEFT + (/* 1 + */Random.Int(HALL_WIDTH - 2)); - map[entrance] = Terrain.PEDESTAL; - - map[exit] = Terrain.WALL; - - return true; - } - - @Override - protected void decorate() { - - for (int i = 0; i < getLength(); i++) { - if (map[i] == Terrain.EMPTY && Random.Int(10) == 0) { - map[i] = Terrain.EMPTY_DECO; - } else if (map[i] == Terrain.WALL && Random.Int(8) == 0) { - map[i] = Terrain.WALL_DECO; - } - } - - int shrub1 = arenaDoor + getWidth(); - int shrub2 = arenaDoor + getWidth() + 1; - int shrub3 = arenaDoor + getWidth() - 1; - int potionpos = arenaDoor + 2*getWidth(); - map[shrub1] = Terrain.SHRUB; - map[shrub2] = Terrain.SHRUB; - map[shrub3] = Terrain.SHRUB; - drop(new PotionOfLiquidFlame(), potionpos); - - for (int i = 0; i < getLength(); i++) { - if (map[i] == Terrain.WALL && Random.Int(8) == 0) { - map[i] = Terrain.WALL_DECO; - } - if (map[i]==Terrain.ENTRANCE){map[i] = Terrain.EMPTY;} - if (map[i]==Terrain.EMPTY && heaps.get(i) == null && Random.Float()<.20){map[i] = Terrain.HIGH_GRASS;} - if (map[i]==Terrain.EMPTY && heaps.get(i) == null && Random.Float()<.25){map[i] = Terrain.GRASS;} - if (map[i]==Terrain.EMPTY && heaps.get(i) == null && Random.Float()<.30){map[i] = Terrain.SHRUB;} - } - - //int sign = arenaDoor + WIDTH + 1; - //map[sign] = Terrain.SIGN; - } - - public static int pedestal(boolean left) { - if (left) { - return (TOP + HALL_HEIGHT / 2) * getWidth() + CENTER - 2; - } else { - return (TOP + HALL_HEIGHT / 2) * getWidth() + CENTER + 2; - } - } - - @Override - protected void createMobs() { - } - - @Override - public Actor respawner() { - return null; - } - - @Override - protected void createItems() { - - } - - @Override - public int randomRespawnCell() { - return -1; - } - - @Override - public void press(int cell, Char hero) { - - super.press(cell, hero); - - if (!enteredArena && outsideEntraceRoom(cell) && hero == Dungeon.hero) { - - enteredArena = true; - //locked = true; - - Mob boss = new SkeletonKing(); - Mob hand1 = new SkeletonHand1(); - Mob hand2 = new SkeletonHand2(); - boss.state = boss.HUNTING; - hand1.state = hand1.HUNTING; - hand2.state = hand2.HUNTING; - int count = 0; - do { - boss.pos = Random.Int(getLength()); - hand1.pos = (TOP + 1) * getWidth() + CENTER; - hand2.pos = (TOP + 1) * getWidth() + CENTER+1; - - } while (!passable[boss.pos] - || !outsideEntraceRoom(boss.pos) - || (Dungeon.visible[boss.pos] && count++ < 20)); - - GameScene.add(boss); - - GameScene.add(hand1); - GameScene.add(hand2); - - - if (Dungeon.visible[boss.pos]) { - boss.notice(); - boss.sprite.alpha(0); - boss.sprite.parent.add(new AlphaTweener(boss.sprite, 1, 0.1f)); - } - - //set(arenaDoor, Terrain.WALL); - //GameScene.updateMap(arenaDoor); - Dungeon.observe(); - } - } - - @Override - public Heap drop(Item item, int cell) { - - if (!keyDropped && item instanceof SkeletonKey) { - - keyDropped = true; - locked = false; - - set(arenaDoor, Terrain.DOOR); - GameScene.updateMap(arenaDoor); - Dungeon.observe(); - } - - return super.drop(item, cell); - } - - private boolean outsideEntraceRoom(int cell) { - return cell / getWidth() < arenaDoor / getWidth(); - } - - public String tileName(int tile) { - switch (tile) { - case Terrain.WATER: - return "Dark cold water."; - case Terrain.HIGH_GRASS: - return "Ancient pottery."; - default: - return super.tileName(tile); - } - } - - @Override - public String tileDesc(int tile) { - switch (tile) { - case Terrain.EMPTY_DECO: - return "Oddly shaped bones are piled up here. Good thing they are not animated. "; - case Terrain.HIGH_GRASS: - return "Ancient pottery litters the floor."; - case Terrain.BOOKSHELF: - return "The bookshelf is packed with cheap useless books. Might it burn?"; - default: - return super.tileDesc(tile); - } - } - - @Override - public void addVisuals(Scene scene) { - CityLevel.addVisuals(this, scene); - } -} diff --git a/java/com/hmdzl/spspd/change/levels/SokobanCastle.java b/java/com/hmdzl/spspd/change/levels/SokobanCastle.java deleted file mode 100644 index 53609bb4..00000000 --- a/java/com/hmdzl/spspd/change/levels/SokobanCastle.java +++ /dev/null @@ -1,685 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels; - -import java.util.Collection; -import java.util.HashMap; -import java.util.HashSet; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.Alchemy; -import com.hmdzl.spspd.change.actors.blobs.Blob; -import com.hmdzl.spspd.change.actors.blobs.Fire; -import com.hmdzl.spspd.change.actors.blobs.Foliage; -import com.hmdzl.spspd.change.actors.blobs.Portal; -import com.hmdzl.spspd.change.actors.blobs.WaterOfHealth; -import com.hmdzl.spspd.change.actors.blobs.WaterOfTransmutation; -import com.hmdzl.spspd.change.actors.blobs.WellWater; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.mobs.AdultDragonViolet; -import com.hmdzl.spspd.change.actors.mobs.Bestiary; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.actors.mobs.SokobanSentinel; -import com.hmdzl.spspd.change.actors.mobs.npcs.Blacksmith; -import com.hmdzl.spspd.change.actors.mobs.npcs.Sheep; -import com.hmdzl.spspd.change.actors.mobs.npcs.SheepSokoban; -import com.hmdzl.spspd.change.actors.mobs.npcs.SheepSokobanBlack; -import com.hmdzl.spspd.change.actors.mobs.npcs.SheepSokobanCorner; -import com.hmdzl.spspd.change.actors.mobs.npcs.SheepSokobanSwitch; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.Gold; -import com.hmdzl.spspd.change.items.Heap; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.artifacts.TimekeepersHourglass; -import com.hmdzl.spspd.change.items.keys.IronKey; -import com.hmdzl.spspd.change.items.misc.Spectacles; -import com.hmdzl.spspd.change.items.potions.PotionOfLiquidFlame; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfMagicalInfusion; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfRegrowth; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfUpgrade; - -import com.hmdzl.spspd.change.items.wands.WandOfFlock; -import com.hmdzl.spspd.change.levels.features.Chasm; -import com.hmdzl.spspd.change.levels.features.Door; -import com.hmdzl.spspd.change.levels.features.HighGrass; -import com.hmdzl.spspd.change.levels.traps.ActivatePortalTrap; -import com.hmdzl.spspd.change.levels.traps.AlarmTrap; -import com.hmdzl.spspd.change.levels.traps.ChangeSheepTrap; -import com.hmdzl.spspd.change.levels.traps.FireTrap; -import com.hmdzl.spspd.change.levels.traps.FleecingTrap; -import com.hmdzl.spspd.change.levels.traps.GrippingTrap; -import com.hmdzl.spspd.change.levels.traps.HeapGenTrap; -import com.hmdzl.spspd.change.levels.traps.LightningTrap; -import com.hmdzl.spspd.change.levels.traps.ParalyticTrap; -import com.hmdzl.spspd.change.levels.traps.PoisonTrap; -import com.hmdzl.spspd.change.levels.traps.SokobanPortalTrap; -import com.hmdzl.spspd.change.levels.traps.SummoningTrap; -import com.hmdzl.spspd.change.levels.traps.ToxicTrap; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.plants.Phaseshift; -import com.hmdzl.spspd.change.plants.Plant; -import com.hmdzl.spspd.change.plants.Starflower; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.AdultDragonVioletSprite; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundlable; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; -import com.watabou.utils.SparseArray; - -public class SokobanCastle extends Level { - - - { - color1 = 0x534f3e; - color2 = 0xb9d661; - WIDTH = 48; - HEIGHT = 48; - LENGTH = HEIGHT*WIDTH; - } - - - public HashSet heapstogen; - public int[] heapgenspots; - public int[] teleportspots; - public int[] portswitchspots; - public int[] teleportassign; - public int[] destinationspots; - public int[] destinationassign; - public int prizeNo; - - private static final String HEAPSTOGEN = "heapstogen"; - private static final String HEAPGENSPOTS = "heapgenspots"; - private static final String TELEPORTSPOTS = "teleportspots"; - private static final String PORTSWITCHSPOTS = "portswitchspots"; - private static final String DESTINATIONSPOTS = "destinationspots"; - private static final String TELEPORTASSIGN = "teleportassign"; - private static final String DESTINATIONASSIGN= "destinationassign"; - private static final String PRIZENO = "prizeNo"; - - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(HEAPSTOGEN, heapstogen); - bundle.put(HEAPGENSPOTS, heapgenspots); - bundle.put(TELEPORTSPOTS, teleportspots); - bundle.put(PORTSWITCHSPOTS, portswitchspots); - bundle.put(DESTINATIONSPOTS, destinationspots); - bundle.put(DESTINATIONASSIGN, destinationassign); - bundle.put(TELEPORTASSIGN, teleportassign); - bundle.put(PRIZENO, prizeNo); - } - - - @Override - public String tileName(int tile) { - switch (tile) { - case Terrain.SOKOBAN_SHEEP: - case Terrain.SWITCH_SOKOBAN_SHEEP: - case Terrain.CORNER_SOKOBAN_SHEEP: - case Terrain.BLACK_SOKOBAN_SHEEP: - return Messages.get(Level.class, "floor_name"); - case Terrain.WATER: - return Messages.get(Level.class, "water_name"); - case Terrain.WOOL_RUG: - return Messages.get(Level.class, "wool_rug_name"); - case Terrain.FLEECING_TRAP: - return Messages.get(Level.class, "fleecing_trap_name"); - case Terrain.CHANGE_SHEEP_TRAP: - return Messages.get(Level.class, "change_sheep_trap_name"); - case Terrain.SOKOBAN_ITEM_REVEAL: - return Messages.get(Level.class, "sokoban_item_reveal_name"); - case Terrain.SOKOBAN_PORT_SWITCH: - return Messages.get(Level.class, "sokoban_port_switch_name"); - case Terrain.PORT_WELL: - return Messages.get(Level.class, "port_well_name"); - default: - return super.tileName(tile); - } - } - - - @Override - public String tileDesc(int tile) { - switch (tile) { - case Terrain.SOKOBAN_SHEEP: - case Terrain.SWITCH_SOKOBAN_SHEEP: - case Terrain.CORNER_SOKOBAN_SHEEP: - case Terrain.BLACK_SOKOBAN_SHEEP: - return Messages.get(Level.class, "default_desc"); - case Terrain.EMPTY_DECO: - return Messages.get(PrisonLevel.class, "empty_deco_desc"); - case Terrain.BOOKSHELF: - return Messages.get(PrisonLevel.class, "bookshelf_desc"); - case Terrain.WOOL_RUG: - return Messages.get(Level.class, "wool_rug_desc"); - case Terrain.FLEECING_TRAP: - return Messages.get(Level.class, "fleecing_trap_desc"); - case Terrain.CHANGE_SHEEP_TRAP: - return Messages.get(Level.class, "change_sheep_trap_desc"); - case Terrain.SOKOBAN_ITEM_REVEAL: - return Messages.get(Level.class, "sokoban_item_reveal_desc"); - case Terrain.SOKOBAN_PORT_SWITCH: - return Messages.get(Level.class, "sokoban_port_switch_desc"); - case Terrain.PORT_WELL: - return Messages.get(Level.class, "port_well_desc"); - default: - return super.tileDesc(tile); - } - } - - - @Override - public void restoreFromBundle(Bundle bundle) { - - super.restoreFromBundle(bundle); - - heapgenspots = bundle.getIntArray(HEAPGENSPOTS); - teleportspots = bundle.getIntArray(TELEPORTSPOTS); - portswitchspots = bundle.getIntArray(PORTSWITCHSPOTS); - destinationspots = bundle.getIntArray(DESTINATIONSPOTS); - destinationassign = bundle.getIntArray(DESTINATIONASSIGN); - teleportassign = bundle.getIntArray(TELEPORTASSIGN); - prizeNo = bundle.getInt(PRIZENO); - - heapstogen = new HashSet(); - - Collection collectionheap = bundle.getCollection(HEAPSTOGEN); - for (Bundlable i : collectionheap) { - Item item = (Item) i; - if (item != null) { - heapstogen.add(item); - } - } - } - - @Override - public void create() { - heapstogen = new HashSet(); - heapgenspots = new int[20]; - teleportspots = new int[10]; - portswitchspots = new int[10]; - destinationspots = new int[10]; - destinationassign = new int[10]; - teleportassign = new int[10]; - super.create(); - } - - public void addItemToGen(Item item, int arraypos, int pos) { - if (item != null) { - heapstogen.add(item); - heapgenspots[arraypos]=pos; - } - } - - - public Item genPrizeItem() { - return genPrizeItem(null); - } - - - public Item genPrizeItem(Class match) { - - boolean keysLeft = false; - - if (heapstogen.size() == 0) - return null; - - for (Item item : heapstogen) { - if (match.isInstance(item)) { - heapstogen.remove(item); - keysLeft=true; - return item; - } - } - - if (match == null || !keysLeft) { - Item item = Random.element(heapstogen); - heapstogen.remove(item); - return item; - } - - return null; - } - - @Override - public void press(int cell, Char ch) { - - if (pit[cell] && ch == Dungeon.hero) { - Chasm.heroFall(cell); - return; - } - - TimekeepersHourglass.timeFreeze timeFreeze = null; - - if (ch != null) - timeFreeze = ch.buff(TimekeepersHourglass.timeFreeze.class); - - boolean trap = false; - - switch (map[cell]) { - - case Terrain.FLEECING_TRAP: - - if (ch != null && ch==Dungeon.hero){ - trap = true; - FleecingTrap.trigger(cell, ch); - } - break; - - case Terrain.CHANGE_SHEEP_TRAP: - - if (ch instanceof SheepSokoban || ch instanceof SheepSokobanSwitch || ch instanceof SheepSokobanCorner || ch instanceof Sheep || ch instanceof WandOfFlock.MagicSheep){ - trap = true; - ChangeSheepTrap.trigger(cell, ch); - } - break; - - case Terrain.PORT_WELL: - - if (ch != null && ch==Dungeon.hero){ - - int portarray=-1; - int destinationspot=cell; - - for(int i = 0; i < teleportspots.length; i++) { - if(teleportspots[i] == cell) { - portarray = i; - break; - } - } - - if(portarray != -1) { - destinationspot=destinationspots[portarray]; - if (destinationspot>0){ - SokobanPortalTrap.trigger(cell, ch, destinationspot); - } - } - } - break; - - case Terrain.SOKOBAN_PORT_SWITCH: - trap=false; - ActivatePortalTrap.trigger(cell, ch); - - /* - int arraypos = -1; //position in array of teleport switch - int portpos = -1; //position on map of teleporter - int portarraypos = -1; //position in array of teleporter - int destpos = -1; //destination position assigned to switch - - for(int i = 0; i < portswitchspots.length; i++) { - if(portswitchspots[i] == cell) { - arraypos = i; - // GLog.i("Pos1 %s", arraypos); - break; - } - } - - portpos = teleportassign[arraypos]; - destpos = destinationassign[arraypos]; - - // Stepping on switch deactivates the portal - destpos = -1; - - //GLog.i("ass2 %s", portpos); - // GLog.i("dest3 %s", destpos); - - for(int i = 0; i < teleportspots.length; i++) { - if(teleportspots[i] == portpos) { - portarraypos = i; - // GLog.i("Pos4 %s", portarraypos); - break; - } - } - - if (map[portpos] == Terrain.PORT_WELL){ - destinationspots[portarraypos]=destpos; - //GLog.i("Pos5 %s", destpos); - GLog.i("Portal Deactivated!"); - } - - */ - - break; - - - case Terrain.HIGH_GRASS: - HighGrass.trample(this, cell, ch); - break; - - case Terrain.WELL: - WellWater.affectCell(cell); - break; - - /*case Terrain.ALCHEMY: - if (ch == null) { - Alchemy.transmute(cell); - } - break;*/ - - case Terrain.DOOR: - Door.enter(cell); - break; - } - - if (trap){ - - if (Dungeon.visible[cell]) - Sample.INSTANCE.play(Assets.SND_TRAP); - - if (ch == Dungeon.hero) - Dungeon.hero.interrupt(); - - set(cell, Terrain.INACTIVE_TRAP); - GameScene.updateMap(cell); - } - - Plant plant = plants.get(cell); - if (plant != null) { - plant.activate(ch); - } - } - - - - @Override - public void mobPress(Mob mob) { - - int cell = mob.pos; - - if (pit[cell] && !mob.flying) { - Chasm.mobFall(mob); - return; - } - - boolean trap = true; - boolean fleece = false; - boolean sheep = false; - switch (map[cell]) { - - case Terrain.FLEECING_TRAP: - if (mob instanceof SheepSokoban || mob instanceof SheepSokobanSwitch || mob instanceof SheepSokobanCorner || mob instanceof SheepSokobanBlack || mob instanceof Sheep || mob instanceof WandOfFlock.MagicSheep){ - fleece=true; - } - FleecingTrap.trigger(cell, mob); - break; - - case Terrain.CHANGE_SHEEP_TRAP: - trap=false; - if (mob instanceof SheepSokoban || mob instanceof SheepSokobanSwitch || mob instanceof SheepSokobanCorner || mob instanceof Sheep || mob instanceof WandOfFlock.MagicSheep){ - trap=true; - ChangeSheepTrap.trigger(cell, mob); - } - break; - - case Terrain.SOKOBAN_ITEM_REVEAL: - trap=false; - if (mob instanceof SheepSokoban || mob instanceof SheepSokobanSwitch || mob instanceof SheepSokobanCorner || mob instanceof SheepSokobanBlack || mob instanceof Sheep || mob instanceof WandOfFlock.MagicSheep){ - HeapGenTrap.trigger(cell, mob); - drop(genPrizeItem(IronKey.class),heapgenspots[prizeNo]); - prizeNo++; - sheep=true; - trap=true; - } - break; - - case Terrain.SOKOBAN_PORT_SWITCH: - trap=false; - if (mob instanceof SheepSokoban || mob instanceof SheepSokobanSwitch || mob instanceof SheepSokobanCorner || mob instanceof SheepSokobanBlack || mob instanceof Sheep || mob instanceof WandOfFlock.MagicSheep){ - ActivatePortalTrap.trigger(cell, mob); - - /* - public int[] teleportspots; location of teleports - public int[] portswitchspots; location of switches - public int[] teleportassign; assignment of teleports to switches - public int[] destinationspots; current assignment of destination spots to teleports - public int[] destinationassign; assignemnt of destination spots to switches - */ - - int arraypos = -1; //position in array of teleport switch - int portpos = -1; //position on map of teleporter - int portarray = -1; //position in array of teleporter - int destpos = -1; //destination position assigned to switch - - for(int i = 0; i < portswitchspots.length; i++) { - if(portswitchspots[i] == cell) { - arraypos = i; - //GLog.i("Pos1 %s", arraypos); - break; - } - } - - portpos = teleportassign[arraypos]; - destpos = destinationassign[arraypos]; - - //GLog.i("ass2 %s", portpos); - //GLog.i("dest3 %s", destpos); - - for(int i = 0; i < teleportspots.length; i++) { - if(teleportspots[i] == portpos) { - portarray = i; - //GLog.i("Pos4 %s", portarray); - break; - } - } - - if (map[portpos] == Terrain.PORT_WELL){ - destinationspots[portarray]=destpos; - //GLog.i("Pos5 %s", destpos); - GLog.i("Click!"); - } - - sheep=true; - } - break; - - case Terrain.DOOR: - Door.enter(cell); - - default: - trap = false; - } - - if (trap && !fleece && !sheep) { - if (Dungeon.visible[cell]) { - Sample.INSTANCE.play(Assets.SND_TRAP); - } - set(cell, Terrain.INACTIVE_TRAP); - GameScene.updateMap(cell); - } - - if (trap && fleece) { - if (Dungeon.visible[cell]) { - Sample.INSTANCE.play(Assets.SND_TRAP); - } - set(cell, Terrain.WOOL_RUG); - GameScene.updateMap(cell); - } - - if (trap && sheep) { - if (Dungeon.visible[cell]) { - Sample.INSTANCE.play(Assets.SND_TRAP); - } - set(cell, Terrain.EMPTY); - GameScene.updateMap(cell); - } - - - Plant plant = plants.get(cell); - if (plant != null) { - plant.activate(mob); - } - - Dungeon.observe(); - } - - @Override - public String tilesTex() { - return Assets.TILES_PUZZLE; - } - - @Override - public String waterTex() { - return Assets.WATER_PRISON; - } - - @Override - protected boolean build() { - - map = SokobanLayouts.SOKOBAN_CASTLE.clone(); - decorate(); - - buildFlagMaps(); - cleanWalls(); - createSwitches(); - createSheep(); - - entrance = 24 + WIDTH * 22; - exit = 0; - - - return true; - } - @Override - protected void decorate() { - //do nothing, all decorations are hard-coded. - } - - @Override - protected void createMobs() { - - /* - SokobanSentinel mob = new SokobanSentinel(); - mob.pos = 38 + WIDTH * 21; - mobs.add(mob); - Actor.occupyCell(mob); - */ - SokobanSentinel mob2 = new SokobanSentinel(); - mob2.pos = 38 + WIDTH * 20; - mobs.add(mob2); - Actor.occupyCell(mob2); - /* - SokobanSentinel mob3 = new SokobanSentinel(); - mob3.pos = 2 + WIDTH * 43; - mobs.add(mob3); - Actor.occupyCell(mob3); - */ - /* - AdultDragonViolet mob3 = new AdultDragonViolet(); - mob3.pos = 18 + WIDTH * 23; - mobs.add(mob3); - Actor.occupyCell(mob3); - */ - } - - - - protected void createSheep() { - for (int i = 0; i < LENGTH; i++) { - if (map[i]==Terrain.SOKOBAN_SHEEP){SheepSokoban npc = new SheepSokoban(); mobs.add(npc); npc.pos = i; Actor.occupyCell(npc);} - else if (map[i]==Terrain.CORNER_SOKOBAN_SHEEP){SheepSokobanCorner npc = new SheepSokobanCorner(); mobs.add(npc); npc.pos = i; Actor.occupyCell(npc);} - else if (map[i]==Terrain.SWITCH_SOKOBAN_SHEEP){SheepSokobanSwitch npc = new SheepSokobanSwitch(); mobs.add(npc); npc.pos = i; Actor.occupyCell(npc);} - else if (map[i]==Terrain.BLACK_SOKOBAN_SHEEP){SheepSokobanBlack npc = new SheepSokobanBlack(); mobs.add(npc); npc.pos = i; Actor.occupyCell(npc);} - else if (map[i]==Terrain.PORT_WELL){ - /* - Portal portal = new Portal(); - portal.seed(i, 1); - blobs.put(Portal.class, portal); - */ - } - - } - } - - - protected void createSwitches(){ - - //spots where your portals are - teleportspots[0] = 4 + WIDTH * 3; - teleportspots[1] = 7 + WIDTH * 27; - teleportspots[2] = 37 + WIDTH * 35; - - - //spots where your portal switches are - portswitchspots[0] = 32 + WIDTH * 40; - - - //assign each switch to a portal - teleportassign[0] = 37 + WIDTH * 35; - - - //assign each switch to a destination spot - destinationassign[0] = 9 + WIDTH * 37; - - - //set the original destination of portals - destinationspots[0] = 24 + WIDTH * 22; //6 + WIDTH * 5; - destinationspots[1] = 1 + WIDTH * 27; - destinationspots[2] = 0; - - - } - - - @Override - protected void createItems() { - int goldmin=300; int goldmax=500; - if (first){ - goldmin=400; goldmax=800; - } - for (int i = 0; i < LENGTH; i++) { - if (map[i]==Terrain.SOKOBAN_HEAP){ - if (first && Random.Int(5)==0){drop(new ScrollOfUpgrade(), i).type = Heap.Type.CHEST;} - else {drop(new Gold(Random.Int(goldmin, goldmax)), i).type = Heap.Type.CHEST;} - } - } - - addItemToGen(new IronKey(Dungeon.depth) , 0, 24 + WIDTH * 22); - addItemToGen(new IronKey(Dungeon.depth) , 1, 24 + WIDTH * 22); - addItemToGen(new IronKey(Dungeon.depth) , 2, 24 + WIDTH * 22); - addItemToGen(new IronKey(Dungeon.depth) , 3, 24 + WIDTH * 22); - addItemToGen(new IronKey(Dungeon.depth) , 4, 24 + WIDTH * 22); - addItemToGen(new IronKey(Dungeon.depth) , 5, 24 + WIDTH * 22); - - - if (first){ - addItemToGen(new Phaseshift.Seed() , 6, 30 + WIDTH * 23); - addItemToGen(new Starflower.Seed() , 7, 18 + WIDTH * 23); - addItemToGen(new Spectacles() , 8, 25 + WIDTH * 2); - addItemToGen(new ScrollOfMagicalInfusion() , 9, 26 + WIDTH * 2); - addItemToGen(new ScrollOfMagicalInfusion() , 10, 8 + WIDTH * 37); - addItemToGen(new ScrollOfRegrowth() , 11, 10 + WIDTH * 37); - } - - drop(new PotionOfLiquidFlame(), 9 + WIDTH * 24).type = Heap.Type.CHEST; - } - - @Override - public int randomRespawnCell() { - return -1; - } - - -} diff --git a/java/com/hmdzl/spspd/change/levels/SokobanIntroLevel.java b/java/com/hmdzl/spspd/change/levels/SokobanIntroLevel.java deleted file mode 100644 index f914ae86..00000000 --- a/java/com/hmdzl/spspd/change/levels/SokobanIntroLevel.java +++ /dev/null @@ -1,677 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels; - -import java.util.Collection; -import java.util.HashMap; -import java.util.HashSet; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.Alchemy; -import com.hmdzl.spspd.change.actors.blobs.Blob; -import com.hmdzl.spspd.change.actors.blobs.Fire; -import com.hmdzl.spspd.change.actors.blobs.Foliage; -import com.hmdzl.spspd.change.actors.blobs.Portal; -import com.hmdzl.spspd.change.actors.blobs.WaterOfHealth; -import com.hmdzl.spspd.change.actors.blobs.WaterOfTransmutation; -import com.hmdzl.spspd.change.actors.blobs.WellWater; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.mobs.Bestiary; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.actors.mobs.SokobanSentinel; -import com.hmdzl.spspd.change.actors.mobs.npcs.Blacksmith; -import com.hmdzl.spspd.change.actors.mobs.npcs.Sheep; -import com.hmdzl.spspd.change.actors.mobs.npcs.SheepSokoban; -import com.hmdzl.spspd.change.actors.mobs.npcs.SheepSokobanBlack; -import com.hmdzl.spspd.change.actors.mobs.npcs.SheepSokobanCorner; -import com.hmdzl.spspd.change.actors.mobs.npcs.SheepSokobanSwitch; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.eggs.Egg; -import com.hmdzl.spspd.change.items.Gold; -import com.hmdzl.spspd.change.items.Heap; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.Towel; -import com.hmdzl.spspd.change.items.artifacts.TimekeepersHourglass; -import com.hmdzl.spspd.change.items.keys.IronKey; -import com.hmdzl.spspd.change.items.potions.PotionOfLiquidFlame; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfMagicalInfusion; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfUpgrade; - -import com.hmdzl.spspd.change.items.wands.WandOfFlock; -import com.hmdzl.spspd.change.levels.features.Chasm; -import com.hmdzl.spspd.change.levels.features.Door; -import com.hmdzl.spspd.change.levels.features.HighGrass; -import com.hmdzl.spspd.change.levels.painters.Painter; -import com.hmdzl.spspd.change.levels.traps.ActivatePortalTrap; -import com.hmdzl.spspd.change.levels.traps.AlarmTrap; -import com.hmdzl.spspd.change.levels.traps.ChangeSheepTrap; -import com.hmdzl.spspd.change.levels.traps.FireTrap; -import com.hmdzl.spspd.change.levels.traps.FleecingTrap; -import com.hmdzl.spspd.change.levels.traps.GrippingTrap; -import com.hmdzl.spspd.change.levels.traps.HeapGenTrap; -import com.hmdzl.spspd.change.levels.traps.LightningTrap; -import com.hmdzl.spspd.change.levels.traps.ParalyticTrap; -import com.hmdzl.spspd.change.levels.traps.PoisonTrap; -import com.hmdzl.spspd.change.levels.traps.SokobanPortalTrap; -import com.hmdzl.spspd.change.levels.traps.SummoningTrap; -import com.hmdzl.spspd.change.levels.traps.ToxicTrap; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.plants.Dewcatcher; -import com.hmdzl.spspd.change.plants.Flytrap; -import com.hmdzl.spspd.change.plants.Phaseshift; -import com.hmdzl.spspd.change.plants.Plant; -import com.hmdzl.spspd.change.plants.Starflower; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundlable; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; -import com.watabou.utils.SparseArray; - -public class SokobanIntroLevel extends Level { - - - { - color1 = 0x534f3e; - color2 = 0xb9d661; - WIDTH = 48; - HEIGHT = 48; - LENGTH = HEIGHT*WIDTH; - } - - - public HashSet heapstogen; - public int[] heapgenspots; - public int[] teleportspots; - public int[] portswitchspots; - public int[] teleportassign; - public int[] destinationspots; - public int[] destinationassign; - public int prizeNo; - - private static final String HEAPSTOGEN = "heapstogen"; - private static final String HEAPGENSPOTS = "heapgenspots"; - private static final String TELEPORTSPOTS = "teleportspots"; - private static final String PORTSWITCHSPOTS = "portswitchspots"; - private static final String DESTINATIONSPOTS = "destinationspots"; - private static final String TELEPORTASSIGN = "teleportassign"; - private static final String DESTINATIONASSIGN= "destinationassign"; - private static final String PRIZENO = "prizeNo"; - - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(HEAPSTOGEN, heapstogen); - bundle.put(HEAPGENSPOTS, heapgenspots); - bundle.put(TELEPORTSPOTS, teleportspots); - bundle.put(PORTSWITCHSPOTS, portswitchspots); - bundle.put(DESTINATIONSPOTS, destinationspots); - bundle.put(DESTINATIONASSIGN, destinationassign); - bundle.put(TELEPORTASSIGN, teleportassign); - bundle.put(PRIZENO, prizeNo); - } - - - - @Override - public void restoreFromBundle(Bundle bundle) { - - super.restoreFromBundle(bundle); - - heapgenspots = bundle.getIntArray(HEAPGENSPOTS); - teleportspots = bundle.getIntArray(TELEPORTSPOTS); - portswitchspots = bundle.getIntArray(PORTSWITCHSPOTS); - destinationspots = bundle.getIntArray(DESTINATIONSPOTS); - destinationassign = bundle.getIntArray(DESTINATIONASSIGN); - teleportassign = bundle.getIntArray(TELEPORTASSIGN); - prizeNo = bundle.getInt(PRIZENO); - - heapstogen = new HashSet(); - - Collection collectionheap = bundle.getCollection(HEAPSTOGEN); - for (Bundlable i : collectionheap) { - Item item = (Item) i; - if (item != null) { - heapstogen.add(item); - } - } - } - - @Override - public void create() { - heapstogen = new HashSet(); - heapgenspots = new int[10]; - teleportspots = new int[10]; - portswitchspots = new int[10]; - destinationspots = new int[10]; - destinationassign = new int[10]; - teleportassign = new int[10]; - super.create(); - } - - public void addItemToGen(Item item, int arraypos, int pos) { - if (item != null) { - heapstogen.add(item); - heapgenspots[arraypos]=pos; - } - } - - - public Item genPrizeItem() { - return genPrizeItem(null); - } - - - public Item genPrizeItem(Class match) { - - boolean keysLeft = false; - - if (heapstogen.size() == 0) - return null; - - for (Item item : heapstogen) { - if (match.isInstance(item)) { - heapstogen.remove(item); - keysLeft=true; - return item; - } - } - - if (match == null || !keysLeft) { - Item item = Random.element(heapstogen); - heapstogen.remove(item); - return item; - } - - return null; - } - - @Override - public void press(int cell, Char ch) { - - if (pit[cell] && ch == Dungeon.hero) { - Chasm.heroFall(cell); - return; - } - - TimekeepersHourglass.timeFreeze timeFreeze = null; - - if (ch != null) - timeFreeze = ch.buff(TimekeepersHourglass.timeFreeze.class); - - boolean trap = false; - boolean interrupt = false; - - switch (map[cell]) { - - case Terrain.FLEECING_TRAP: - - if (ch==null){ - interrupt=true; - } - - if (ch != null && ch==Dungeon.hero){ - trap = true; - FleecingTrap.trigger(cell, ch); - } - break; - - case Terrain.CHANGE_SHEEP_TRAP: - - if (ch instanceof SheepSokoban || ch instanceof SheepSokobanSwitch || ch instanceof SheepSokobanCorner || ch instanceof Sheep || ch instanceof WandOfFlock.MagicSheep){ - trap = true; - ChangeSheepTrap.trigger(cell, ch); - } - break; - - case Terrain.WOOL_RUG: - - break; - - case Terrain.SOKOBAN_PORT_SWITCH: - trap=false; - if (ch!=null){ - ActivatePortalTrap.trigger(cell, ch); - - /* - int arraypos = -1; //position in array of teleport switch - int portpos = -1; //position on map of teleporter - int portarraypos = -1; //position in array of teleporter - int destpos = -1; //destination position assigned to switch - - for(int i = 0; i < portswitchspots.length; i++) { - if(portswitchspots[i] == cell) { - arraypos = i; - break; - } - } - - portpos = teleportassign[arraypos]; - destpos = destinationassign[arraypos]; - - // Stepping on switch deactivates the portal - destpos = -1; - - for(int i = 0; i < teleportspots.length; i++) { - if(teleportspots[i] == portpos) { - portarraypos = i; - break; - } - } - - if (map[portpos] == Terrain.PORT_WELL){ - destinationspots[portarraypos]=destpos; - GLog.i("Portal Deactivated!"); - } - - */ - } - break; - - - case Terrain.PORT_WELL: - - if (ch != null && ch==Dungeon.hero){ - - int portarray=-1; - int destinationspot=cell; - - for(int i = 0; i < teleportspots.length; i++) { - if(teleportspots[i] == cell) { - portarray = i; - break; - } - } - - if(portarray != -1) { - destinationspot=destinationspots[portarray]; - if (destinationspot>0){ - SokobanPortalTrap.trigger(cell, ch, destinationspot); - } - } - } - break; - - case Terrain.HIGH_GRASS: - HighGrass.trample(this, cell, ch); - break; - - case Terrain.WELL: - WellWater.affectCell(cell); - break; - - /*case Terrain.ALCHEMY: - if (ch == null) { - Alchemy.transmute(cell); - } - break;*/ - - case Terrain.DOOR: - Door.enter(cell); - break; - } - - if (trap){ - - if (Dungeon.visible[cell]) - Sample.INSTANCE.play(Assets.SND_TRAP); - - if (ch == Dungeon.hero) - Dungeon.hero.interrupt(); - - set(cell, Terrain.INACTIVE_TRAP); - GameScene.updateMap(cell); - } - - if (interrupt){ - - Dungeon.hero.interrupt(); - GameScene.updateMap(cell); - } - - Plant plant = plants.get(cell); - if (plant != null) { - plant.activate(ch); - } - } - - - - @Override - public void mobPress(Mob mob) { - - int cell = mob.pos; - - if (pit[cell] && !mob.flying) { - Chasm.mobFall(mob); - return; - } - - boolean trap = true; - boolean fleece = false; - boolean sheep = false; - switch (map[cell]) { - - case Terrain.FLEECING_TRAP: - if (mob instanceof SheepSokoban || mob instanceof SheepSokobanSwitch || mob instanceof SheepSokobanCorner || mob instanceof SheepSokobanBlack || mob instanceof Sheep || mob instanceof WandOfFlock.MagicSheep){ - fleece=true; - } - FleecingTrap.trigger(cell, mob); - break; - - case Terrain.CHANGE_SHEEP_TRAP: - trap=false; - if (mob instanceof SheepSokoban || mob instanceof SheepSokobanSwitch || mob instanceof SheepSokobanCorner || mob instanceof Sheep || mob instanceof WandOfFlock.MagicSheep){ - trap=true; - ChangeSheepTrap.trigger(cell, mob); - } - break; - - case Terrain.SOKOBAN_ITEM_REVEAL: - trap=false; - if (mob instanceof SheepSokoban || mob instanceof SheepSokobanSwitch || mob instanceof SheepSokobanCorner || mob instanceof SheepSokobanBlack || mob instanceof Sheep || mob instanceof WandOfFlock.MagicSheep){ - HeapGenTrap.trigger(cell, mob); - drop(genPrizeItem(IronKey.class),heapgenspots[prizeNo]); - prizeNo++; - sheep=true; - trap=true; - } - break; - - case Terrain.SOKOBAN_PORT_SWITCH: - trap=false; - if (mob instanceof SheepSokoban || mob instanceof SheepSokobanSwitch || mob instanceof SheepSokobanCorner || mob instanceof SheepSokobanBlack || mob instanceof Sheep || mob instanceof WandOfFlock.MagicSheep){ - ActivatePortalTrap.trigger(cell, mob); - - /* - public int[] teleportspots; location of teleports - public int[] portswitchspots; location of switches - public int[] teleportassign; assignment of teleports to switches - public int[] destinationspots; current assignment of destination spots to teleports - public int[] destinationassign; assignemnt of destination spots to switches - */ - - int arraypos = -1; //position in array of teleport switch - int portpos = -1; //position on map of teleporter - int portarray = -1; //position in array of teleporter - int destpos = -1; //destination position assigned to switch - - for(int i = 0; i < portswitchspots.length; i++) { - if(portswitchspots[i] == cell) { - arraypos = i; - break; - } - } - - portpos = teleportassign[arraypos]; - destpos = destinationassign[arraypos]; - - for(int i = 0; i < teleportspots.length; i++) { - if(teleportspots[i] == portpos) { - portarray = i; - break; - } - } - - if (map[portpos] == Terrain.PORT_WELL){ - destinationspots[portarray]=destpos; - GLog.i("Click!"); - } - - sheep=true; - } - break; - - case Terrain.DOOR: - Door.enter(cell); - - default: - trap = false; - } - - if (trap && !fleece && !sheep) { - if (Dungeon.visible[cell]) { - Sample.INSTANCE.play(Assets.SND_TRAP); - } - set(cell, Terrain.INACTIVE_TRAP); - GameScene.updateMap(cell); - } - - if (trap && fleece) { - if (Dungeon.visible[cell]) { - Sample.INSTANCE.play(Assets.SND_TRAP); - } - set(cell, Terrain.WOOL_RUG); - GameScene.updateMap(cell); - } - - if (trap && sheep) { - if (Dungeon.visible[cell]) { - Sample.INSTANCE.play(Assets.SND_TRAP); - } - set(cell, Terrain.EMPTY); - GameScene.updateMap(cell); - } - - - Plant plant = plants.get(cell); - if (plant != null) { - plant.activate(mob); - } - - Dungeon.observe(); - } - - @Override - public String tilesTex() { - return Assets.TILES_PUZZLE; - } - - @Override - public String waterTex() { - return Assets.WATER_PRISON; - } - - @Override - protected boolean build() { - - map = SokobanLayouts.SOKOBAN_INTRO_LEVEL.clone(); - decorate(); - - buildFlagMaps(); - cleanWalls(); - createSwitches(); - createSheep(); - - entrance = 7 + WIDTH * 3; - exit = 0 ; - - - return true; - } - - - @Override - protected void decorate() { - //do nothing, all decorations are hard-coded. - } - - @Override - protected void createMobs() { - /* - SokobanSentinel mob = new SokobanSentinel(); - mob.pos = 38 + WIDTH * 21; - mobs.add(mob); - Actor.occupyCell(mob); - - SokobanSentinel mob2 = new SokobanSentinel(); - mob2.pos = 25 + WIDTH * 36; - mobs.add(mob2); - Actor.occupyCell(mob2); - */ - } - - -/* - public static final int FLEECING_TRAP = 65; - public static final int WOOL_RUG = 66; - public static final int SOKOBAN_SHEEP = 67; - public static final int CORNER_SOKOBAN_SHEEP = 68; - public static final int SWITCH_SOKOBAN_SHEEP = 69; - public static final int CHANGE_SHEEP_TRAP = 70; - public static final int SOKOBAN_ITEM_REVEAL = 71; - public static final int SOKOBAN_HEAP = 72; - public static final int BLACK_SOKOBAN_SHEEP = 73; - public static final int SOKOBAN_PORT_SWITCH = 75; - public static final int PORT_WELL = 74; - -*/ - - protected void createSheep() { - for (int i = 0; i < LENGTH; i++) { - if (map[i]==Terrain.SOKOBAN_SHEEP){SheepSokoban npc = new SheepSokoban(); mobs.add(npc); npc.pos = i; Actor.occupyCell(npc);} - else if (map[i]==Terrain.CORNER_SOKOBAN_SHEEP){SheepSokobanCorner npc = new SheepSokobanCorner(); mobs.add(npc); npc.pos = i; Actor.occupyCell(npc);} - else if (map[i]==Terrain.SWITCH_SOKOBAN_SHEEP){SheepSokobanSwitch npc = new SheepSokobanSwitch(); mobs.add(npc); npc.pos = i; Actor.occupyCell(npc);} - else if (map[i]==Terrain.BLACK_SOKOBAN_SHEEP){SheepSokobanBlack npc = new SheepSokobanBlack(); mobs.add(npc); npc.pos = i; Actor.occupyCell(npc);} - else if (map[i]==Terrain.PORT_WELL){ - - /* - Portal portal = new Portal(); - portal.seed(i, 1); - blobs.put(Portal.class, portal); - */ - } - - } - } - - - protected void createSwitches(){ - - //spots where your portals are - teleportspots[0] = 7 + WIDTH * 21; - - //spots where your portal switches are - portswitchspots[0] = 8 + WIDTH * 27; - - //assign each switch to a portal - teleportassign[0] = 7 + WIDTH * 21; - - //assign each switch to a destination spot - destinationassign[0] = 34 + WIDTH * 8; - - //set the original destination of portals - destinationspots[0] = 0; - } - - - @Override - public String tileName(int tile) { - switch (tile) { - case Terrain.SOKOBAN_SHEEP: - case Terrain.SWITCH_SOKOBAN_SHEEP: - case Terrain.CORNER_SOKOBAN_SHEEP: - case Terrain.BLACK_SOKOBAN_SHEEP: - return Messages.get(Level.class, "floor_name"); - case Terrain.WATER: - return Messages.get(Level.class, "water_name"); - case Terrain.WOOL_RUG: - return Messages.get(Level.class, "wool_rug_name"); - case Terrain.FLEECING_TRAP: - return Messages.get(Level.class, "fleecing_trap_name"); - case Terrain.CHANGE_SHEEP_TRAP: - return Messages.get(Level.class, "change_sheep_trap_name"); - case Terrain.SOKOBAN_ITEM_REVEAL: - return Messages.get(Level.class, "sokoban_item_reveal_name"); - case Terrain.SOKOBAN_PORT_SWITCH: - return Messages.get(Level.class, "sokoban_port_switch_name"); - case Terrain.PORT_WELL: - return Messages.get(Level.class, "port_well_name"); - default: - return super.tileName(tile); - } - } - - - @Override - public String tileDesc(int tile) { - switch (tile) { - case Terrain.SOKOBAN_SHEEP: - case Terrain.SWITCH_SOKOBAN_SHEEP: - case Terrain.CORNER_SOKOBAN_SHEEP: - case Terrain.BLACK_SOKOBAN_SHEEP: - return Messages.get(Level.class, "default_desc"); - case Terrain.EMPTY_DECO: - return Messages.get(PrisonLevel.class, "empty_deco_desc"); - case Terrain.BOOKSHELF: - return Messages.get(PrisonLevel.class, "bookshelf_desc"); - case Terrain.WOOL_RUG: - return Messages.get(Level.class, "wool_rug_desc"); - case Terrain.FLEECING_TRAP: - return Messages.get(Level.class, "fleecing_trap_desc"); - case Terrain.CHANGE_SHEEP_TRAP: - return Messages.get(Level.class, "change_sheep_trap_desc"); - case Terrain.SOKOBAN_ITEM_REVEAL: - return Messages.get(Level.class, "sokoban_item_reveal_desc"); - case Terrain.SOKOBAN_PORT_SWITCH: - return Messages.get(Level.class, "sokoban_port_switch_desc"); - case Terrain.PORT_WELL: - return Messages.get(Level.class, "port_well_desc"); - default: - return super.tileDesc(tile); - } - } - - @Override - protected void createItems() { - int goldmin=300; int goldmax=500; - if (first){ - goldmin=300; goldmax=500; - } - for (int i = 0; i < LENGTH; i++) { - if (map[i]==Terrain.SOKOBAN_HEAP){ - if (first && Random.Int(5)==0){drop(new ScrollOfUpgrade(), i).type = Heap.Type.CHEST;} - else {drop(new Gold(Random.Int(goldmin, goldmax)), i).type = Heap.Type.CHEST;} - } - } - - addItemToGen(new IronKey(Dungeon.depth) , 0, 24 + WIDTH * 21); - - - if (first){ - addItemToGen(new Towel() , 1, 37 + WIDTH * 21); - } else { - addItemToGen(new Gold(1) , 1, 37 + WIDTH * 21); - } - - } - - @Override - public int randomRespawnCell() { - return -1; - } - - - -} diff --git a/java/com/hmdzl/spspd/change/levels/SokobanLayouts.java b/java/com/hmdzl/spspd/change/levels/SokobanLayouts.java deleted file mode 100644 index 42097334..00000000 --- a/java/com/hmdzl/spspd/change/levels/SokobanLayouts.java +++ /dev/null @@ -1,261 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels; - -import com.watabou.utils.Random; - -public class SokobanLayouts { - - //32X32 - private static final int W = Terrain.WALL; - private static final int T = Terrain.SHRUB; - //private static final int Z = Terrain.HIGH_GRASS; - private static final int D = Terrain.DOOR; - private static final int L = Terrain.LOCKED_DOOR; - - //private static final int T = Terrain.INACTIVE_TRAP; - - private static final int E = Terrain.EMPTY; - private static final int Z = Terrain.EXIT; - - //private static final int M = Terrain.WALL_DECO; - //private static final int P = Terrain.PEDESTAL; - - private static final int A = Terrain.SOKOBAN_SHEEP; - private static final int X = Terrain.CORNER_SOKOBAN_SHEEP; - private static final int C = Terrain.SWITCH_SOKOBAN_SHEEP; - private static final int B = Terrain.BLACK_SOKOBAN_SHEEP; - private static final int H = Terrain.SOKOBAN_HEAP; - private static final int I = Terrain.SOKOBAN_ITEM_REVEAL; - private static final int F = Terrain.FLEECING_TRAP; - private static final int U = Terrain.STATUE; - private static final int G = Terrain.CHANGE_SHEEP_TRAP; - private static final int S = Terrain.SECRET_DOOR; - private static final int R = Terrain.PORT_WELL; - private static final int V = Terrain.SOKOBAN_PORT_SWITCH; - - public static final int[] SOKOBAN_INTRO_LEVEL = { - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, E, E, E, E, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, E, E, E, E, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, E, E, E, E, E, E, E, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, E, U, A, U, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, S, W, W, W, W, W, E, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, E, U, F, U, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, C, E, W, E, C, W, W, W, E, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, E, U, U, E, D, E, E, E, E, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, E, G, E, E, E, G, E, W, W, E, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, E, E, E, E, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, E, E, E, E, E, W, W, W, E, W, W, W, W, W, W, W, - W, W, W, W, E, E, W, W, W, W, W, W, U, U, A, U, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, E, E, E, E, E, W, W, W, E, W, W, W, W, W, W, W, - W, W, W, W, E, E, S, E, E, E, E, D, F, E, E, E, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, E, E, E, E, E, W, W, W, E, W, W, W, W, W, W, W, - W, W, W, W, H, W, W, U, U, E, E, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, E, U, F, U, E, W, W, W, E, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, U, F, A, E, W, E, E, E, E, W, E, E, E, E, E, W, W, W, W, W, W, W, W, W, W, E, U, F, U, E, W, W, W, E, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, U, U, X, U, W, E, E, E, E, W, E, C, E, E, U, W, W, W, W, W, W, W, W, W, W, E, U, F, U, E, W, W, W, E, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, H, U, U, F, D, E, E, C, E, W, E, G, E, E, F, D, E, E, E, E, W, W, W, W, W, G, U, F, U, G, W, W, W, E, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, S, W, W, W, W, E, E, E, E, W, E, E, E, E, U, W, C, G, G, E, W, W, W, W, W, C, U, H, U, C, W, W, W, E, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, F, W, W, W, W, E, E, E, E, D, E, E, E, E, E, W, E, E, E, E, W, W, W, W, W, W, W, S, W, W, W, W, W, E, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, E, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, E, E, E, U, W, W, W, W, W, W, W, E, W, W, W, W, W, E, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, S, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, E, E, U, F, W, W, W, W, W, W, W, E, W, W, W, W, W, E, W, W, W, W, W, W, W, - W, W, W, W, W, E, B, E, E, E, D, F, E, E, E, D, E, E, E, E, W, W, W, W, W, W, D, W, W, W, W, W, W, W, E, W, W, W, W, W, E, W, W, W, W, W, W, W, - W, W, W, W, W, E, E, E, E, E, W, U, U, U, E, W, E, E, E, E, W, W, W, W, W, W, E, W, W, W, W, W, W, E, E, E, W, W, W, W, E, W, W, W, W, W, W, W, - W, W, W, W, W, E, E, R, E, E, W, B, B, E, E, W, E, G, E, E, W, E, E, E, E, W, E, H, W, W, W, W, W, E, E, B, W, E, F, F, A, E, W, W, W, W, W, W, - W, W, W, W, W, E, E, E, E, E, W, U, U, U, E, W, E, G, E, E, W, E, E, E, E, D, E, W, W, W, W, W, W, E, E, E, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, E, E, E, E, E, W, H, F, E, E, W, E, G, E, E, W, E, I, A, E, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, D, W, W, W, W, W, W, W, W, W, W, E, C, E, E, W, E, E, E, E, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, E, E, E, E, E, W, W, W, W, W, W, E, E, E, E, L, E, E, E, E, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, E, E, X, E, E, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, E, E, I, V, E, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, E, E, E, E, E, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W - - }; - - public static final int[] SOKOBAN_CASTLE = { - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, I, T, I, T, I, T, I, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, W, - W, T, T, W, S, W, W, W, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, W, W, W, W, W, T, T, W, - W, T, T, W, R, U, E, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, E, F, H, W, T, T, W, - W, T, T, W, U, U, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, F, F, W, T, T, W, - W, T, T, W, E, E, E, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, E, E, E, W, T, T, W, - W, T, T, W, W, E, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, H, W, H, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, E, W, W, T, T, W, - W, T, T, W, W, E, W, W, W, W, G, E, W, F, G, C, F, E, E, F, E, B, W, F, W, F, W, F, F, H, F, H, F, F, F, F, W, E, E, W, W, W, E, W, T, T, W, W, - W, T, T, W, W, E, W, W, W, W, H, E, S, F, F, X, F, E, C, U, E, E, W, E, W, E, W, F, F, F, F, F, F, F, F, F, S, E, X, W, W, W, E, W, T, T, W, W, - W, T, T, W, W, E, W, W, W, W, E, E, W, F, F, X, F, G, C, U, E, E, W, E, W, E, W, F, F, F, F, F, F, F, F, F, W, E, E, W, W, W, E, W, T, T, W, W, - W, T, T, W, W, E, W, W, W, W, F, F, W, H, F, E, F, G, H, U, E, E, W, E, W, E, W, E, X, X, X, X, X, E, E, E, W, F, F, W, W, W, E, W, T, T, W, W, - W, T, T, W, W, E, W, W, W, W, W, W, W, W, W, W, W, W, L, W, W, W, W, E, B, E, W, W, W, W, D, W, W, W, W, S, W, W, S, W, W, W, E, W, T, T, W, W, - W, T, T, W, W, E, W, W, W, W, W, W, W, W, W, W, E, F, F, F, E, W, W, E, W, E, W, W, H, F, U, F, H, W, W, W, W, W, E, E, E, W, E, W, T, T, W, W, - W, T, T, W, W, E, W, W, W, W, W, W, W, W, W, W, U, F, U, F, U, W, W, E, W, E, W, W, U, U, E, U, U, W, W, W, W, W, U, E, H, W, E, W, T, T, W, W, - W, T, T, W, W, E, W, W, W, W, W, W, W, W, W, W, E, X, G, X, E, W, W, E, W, E, W, W, E, G, E, G, E, W, W, W, W, W, S, W, W, W, E, W, T, T, W, W, - W, T, T, W, W, E, W, W, W, W, W, W, W, W, W, W, E, C, G, C, E, W, W, E, W, E, W, W, C, G, E, G, C, W, W, H, H, E, E, W, W, W, E, W, T, T, W, W, - W, T, T, W, W, E, W, W, W, W, W, W, W, W, W, W, W, W, D, W, W, W, W, E, W, E, W, W, W, W, S, W, W, W, W, E, E, X, E, W, W, W, E, W, T, T, W, W, - W, T, T, W, W, E, W, W, W, U, U, U, C, L, E, W, W, W, F, W, W, W, W, E, W, E, W, W, W, W, F, W, W, W, W, U, E, U, U, W, W, W, E, W, T, T, W, W, - W, T, T, W, W, E, W, W, W, H, F, G, E, W, E, W, W, W, F, W, W, W, W, E, W, E, W, W, W, W, F, W, W, W, W, E, E, E, E, W, W, W, E, W, T, T, W, W, - W, T, T, W, W, E, W, W, W, U, U, U, B, W, E, W, W, W, G, G, I, W, W, E, W, E, W, W, E, G, F, W, W, W, W, E, E, E, E, W, W, W, E, W, T, T, W, W, - W, T, T, W, W, E, W, W, W, W, W, W, W, W, E, W, W, W, X, E, C, W, W, G, W, G, W, W, C, A, G, W, W, W, W, E, E, E, E, W, W, W, E, W, T, T, W, W, - W, T, T, W, W, E, W, W, W, E, U, U, F, D, E, W, W, W, E, E, C, E, G, X, C, X, G, E, E, C, E, W, W, W, W, E, E, E, E, W, W, W, E, W, T, T, W, W, - W, T, T, W, W, E, W, W, W, I, C, E, F, W, E, W, W, W, W, W, W, W, W, C, E, C, W, W, W, W, W, W, E, W, W, W, W, E, W, W, W, W, E, W, T, T, W, W, - W, T, T, W, W, E, W, W, W, G, X, E, E, W, X, E, E, E, E, E, E, E, G, X, C, X, G, E, E, E, E, E, X, E, W, W, W, L, W, W, W, W, E, W, T, T, W, W, - W, T, T, W, W, E, W, W, W, E, U, U, E, W, E, W, W, W, W, W, W, W, W, G, W, G, W, W, W, W, W, W, W, E, W, E, E, E, E, E, W, W, E, W, T, T, W, W, - W, T, T, W, W, E, W, W, W, W, W, W, W, W, E, W, F, F, F, F, F, U, W, E, W, E, W, W, W, W, W, W, W, E, W, U, U, E, U, U, W, W, E, W, T, T, W, W, - W, T, T, W, W, E, W, W, W, U, U, E, E, W, E, W, F, F, F, F, F, U, W, E, W, E, W, W, W, W, W, W, W, E, W, E, G, X, G, I, S, S, E, W, T, T, W, W, - W, E, T, W, W, E, W, R, L, F, F, X, E, W, E, W, F, F, H, F, F, U, W, E, W, E, W, W, W, W, W, E, E, E, W, U, F, E, F, U, W, W, E, W, T, T, W, W, - W, T, T, W, W, E, W, W, W, H, U, G, G, D, E, W, F, F, F, F, F, U, W, E, W, E, W, W, W, W, W, E, E, E, E, E, E, X, E, E, W, W, E, W, T, T, W, W, - W, T, T, W, W, E, W, W, W, F, U, E, C, W, E, W, F, F, F, F, F, U, W, E, W, E, W, W, W, W, W, E, E, W, W, U, E, X, E, U, W, W, E, W, T, T, W, W, - W, T, T, W, W, E, W, W, W, S, W, W, W, W, E, W, E, X, X, E, E, E, W, E, W, E, W, W, W, W, W, E, W, W, W, E, E, E, E, E, W, W, E, W, T, T, W, W, - W, T, T, W, W, E, W, W, W, A, W, W, W, W, D, W, W, W, W, L, W, W, W, E, W, E, W, W, H, S, I, E, E, W, W, W, W, W, W, W, W, W, E, W, T, T, W, W, - W, T, T, W, W, E, W, W, W, G, W, W, W, W, E, E, E, E, E, E, E, G, W, E, W, E, W, W, W, W, W, L, W, W, W, W, W, W, W, W, W, W, E, W, T, T, W, W, - W, T, T, W, W, E, W, W, E, E, E, W, W, W, E, U, E, U, E, F, X, U, W, E, W, E, W, W, W, W, U, E, U, S, E, W, W, W, W, W, W, W, E, W, T, T, W, W, - W, T, T, W, W, E, W, W, U, F, U, W, W, W, E, E, E, E, E, E, X, G, W, E, W, E, W, W, W, W, E, X, E, W, E, E, E, E, E, W, W, W, E, W, T, T, W, W, - W, T, T, W, W, E, W, W, I, H, C, W, W, W, E, U, E, U, E, U, E, U, W, E, W, E, W, W, W, W, E, E, E, W, W, W, E, R, E, W, W, W, E, W, T, T, W, W, - W, T, T, W, W, E, W, W, W, W, W, W, W, W, E, U, E, U, E, U, E, U, W, E, B, E, W, W, W, W, X, X, X, W, W, W, E, E, E, W, W, W, E, W, T, T, W, W, - W, T, T, W, W, E, W, W, E, E, E, W, W, W, E, E, X, E, E, E, E, B, W, E, W, E, W, W, W, W, E, E, E, W, W, W, W, W, W, W, W, W, E, W, T, T, W, W, - W, T, T, W, W, E, W, W, E, E, E, W, W, W, E, U, E, U, E, U, F, U, W, E, W, E, W, W, W, W, E, X, E, W, W, W, W, W, W, W, W, W, E, W, T, T, W, W, - W, T, T, W, W, E, W, W, X, X, X, W, W, W, E, U, E, U, F, U, F, U, W, E, W, E, W, W, W, W, E, E, E, W, W, W, W, W, W, W, W, W, E, W, T, T, W, W, - W, T, T, W, W, E, W, W, I, H, I, W, W, W, E, E, C, G, F, F, H, I, W, F, W, F, W, W, W, W, E, H, V, W, W, W, W, W, W, W, W, W, E, W, T, T, W, W, - W, T, T, W, W, E, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, H, W, H, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, E, W, W, T, W, W, - W, T, T, W, E, E, E, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, E, E, E, W, T, W, W, - W, T, E, W, F, F, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, F, F, W, T, W, W, - W, T, T, W, H, F, E, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, E, F, H, S, T, W, W, - W, T, T, W, W, W, W, W, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, W, W, W, W, W, T, W, W, - W, W, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W - - }; - - public static final int[] SOKOBAN_TELEPORT_LEVEL = { - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, R, E, E, W, W, W, W, W, W, W, W, H, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, E, F, H, H, F, E, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, E, X, H, W, W, W, W, W, W, W, W, F, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, E, F, F, F, F, E, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, B, F, E, W, W, W, W, W, W, W, W, G, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, E, X, E, E, E, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, C, R, S, E, L, B, W, F, R, W, W, W, W, W, W, W, E, R, W, W, W, W, W, W, W, E, E, E, W, W, W, W, W, - W, W, I, F, R, W, W, W, W, F, H, F, W, W, W, W, W, W, W, W, W, W, F, F, F, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, A, X, E, W, W, W, W, W, - W, W, E, F, F, W, W, W, W, F, F, F, W, W, W, W, W, W, W, W, W, W, E, E, E, E, W, W, W, W, W, W, W, W, W, W, W, W, W, F, F, F, E, W, W, W, W, W, - W, W, E, E, E, W, W, W, W, E, X, E, W, W, W, W, W, W, W, W, W, W, E, E, E, R, W, W, W, W, W, W, W, W, W, W, W, W, W, F, F, F, R, W, W, W, W, W, - W, W, E, E, H, W, W, W, W, E, R, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, H, F, W, W, W, W, W, W, W, - W, W, R, E, E, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, E, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, C, G, G, G, G, F, F, F, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, E, E, X, A, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, V, E, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, E, X, E, E, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, F, W, W, E, E, E, E, W, W, E, E, E, I, W, W, W, W, - W, W, W, W, W, W, W, E, E, E, E, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, E, C, W, E, V, X, E, W, W, E, X, V, E, W, W, W, W, - W, W, E, R, W, W, W, E, R, X, E, W, W, W, W, W, E, R, E, W, W, W, W, W, W, W, W, W, W, W, W, G, W, W, E, E, E, R, W, W, R, E, E, E, W, W, W, W, - W, W, E, X, W, W, W, E, E, I, E, W, W, W, W, W, E, X, E, W, W, W, W, W, W, W, W, W, W, W, W, E, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, C, G, W, W, W, E, E, E, E, W, W, W, W, W, F, F, F, W, W, W, W, H, W, W, W, W, W, W, W, E, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, C, G, W, W, W, W, W, W, W, W, W, W, W, W, E, H, E, W, W, W, W, S, W, W, W, W, W, W, W, E, W, W, E, E, E, R, W, W, R, E, E, E, W, W, W, W, - W, W, C, G, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, R, E, U, F, W, W, W, W, W, W, E, W, W, E, V, X, E, W, W, E, X, V, E, W, W, W, W, - W, W, U, F, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, U, A, R, W, W, W, W, W, E, W, W, I, E, E, E, W, W, E, E, E, H, W, W, W, W, - W, W, U, F, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, E, E, E, W, W, W, W, W, W, E, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, U, F, W, W, W, W, W, W, W, W, W, E, C, R, W, W, W, W, W, E, E, E, W, W, W, W, W, W, W, E, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, U, E, E, E, E, E, W, E, E, W, W, E, X, E, W, W, W, W, W, E, E, W, W, W, W, W, W, W, W, E, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, U, E, U, E, E, E, L, E, H, W, W, G, G, G, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, E, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, U, I, U, I, E, E, W, E, E, W, W, E, E, I, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, L, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, L, W, W, W, W, W, W, W, W, W, W, H, E, E, E, E, F, F, F, E, E, E, E, E, E, E, E, E, E, E, R, H, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, I, W, W, W, W, W, W, W, W, W, W, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, E, W, W, W, W, W, W, W, W, W, W, E, U, E, E, E, U, E, U, E, E, U, E, U, E, E, E, E, E, E, U, E, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, E, W, W, W, W, W, W, W, W, W, W, E, E, E, E, E, U, E, U, E, E, U, E, U, E, E, E, E, E, E, E, E, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, E, W, W, W, W, W, W, W, W, W, W, E, U, E, U, U, U, E, U, F, F, U, E, U, U, U, E, E, E, E, U, E, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, E, W, W, W, W, W, W, W, W, W, W, E, E, E, F, F, F, F, F, F, F, F, F, F, F, F, E, E, E, E, E, E, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, L, W, W, W, W, W, W, W, W, W, W, E, U, G, U, F, E, E, E, E, E, E, E, E, F, U, G, E, E, E, U, I, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, E, F, F, F, E, W, W, W, W, W, W, W, W, E, E, G, F, E, E, X, E, X, X, E, X, E, E, F, G, E, E, E, E, E, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, E, E, E, E, E, W, W, W, W, W, W, W, W, E, U, G, U, F, V, E, V, E, E, V, E, V, F, U, G, E, E, E, U, E, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, E, E, H, E, E, W, W, W, W, W, W, W, W, E, E, E, F, F, E, E, E, E, E, E, E, E, F, F, E, E, E, E, E, E, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, E, U, E, U, U, U, U, U, U, U, U, U, U, U, U, E, E, E, E, U, E, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, E, E, E, E, E, E, E, X, E, E, X, E, E, E, E, E, E, E, E, E, E, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, I, U, E, E, E, E, E, X, E, E, X, E, E, E, E, E, E, E, E, U, I, W, W, - W, W, W, E, E, H, E, H, E, E, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, E, E, V, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, W, W, - W, W, W, F, F, F, F, F, F, F, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, E, U, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, U, E, W, W, - W, W, W, F, F, F, F, F, F, F, W, W, W, W, W, W, W, W, W, H, E, W, W, W, W, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, W, W, - W, W, W, E, X, X, R, C, E, E, W, W, W, W, W, W, W, W, W, H, E, E, E, R, S, E, U, E, U, E, U, E, U, E, U, E, U, E, U, E, U, E, U, E, U, E, W, W, - W, W, W, E, E, G, G, G, I, W, W, W, W, W, W, W, W, W, W, H, E, W, W, W, W, H, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, H, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W - - - }; - - public static final int[] SOKOBAN_PUZZLE_LEVEL = { - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, E, E, R, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, U, E, E, E, E, U, S, R, W, W, W, E, A, E, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, C, C, U, H, U, C, C, W, W, W, W, W, W, W, W, W, W, W, E, E, H, H, E, E, W, W, W, W, W, U, I, U, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, G, G, U, F, U, G, G, W, W, W, W, W, W, W, W, W, W, W, E, E, H, H, E, E, W, W, W, W, W, U, I, U, W, W, W, W, - W, W, W, W, W, W, W, W, E, E, S, E, G, G, U, F, U, G, G, V, S, E, E, U, W, W, W, W, W, W, U, E, E, E, E, U, W, W, W, W, W, U, I, U, W, W, W, W, - W, W, W, W, W, W, W, W, G, U, W, W, C, I, U, F, U, I, C, W, W, W, W, G, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, U, I, U, W, W, W, W, - W, W, W, W, W, W, W, W, W, V, W, W, G, G, U, F, U, G, G, W, W, W, W, E, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, U, I, U, W, W, W, W, - W, W, W, W, W, W, W, W, W, E, W, W, C, E, U, F, U, E, C, W, W, W, W, G, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, U, I, U, W, W, W, W, - W, W, W, W, W, W, W, W, W, E, S, R, G, G, U, F, U, G, G, V, S, E, E, U, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, U, I, U, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, E, E, A, E, A, E, I, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, U, I, U, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, U, G, C, U, C, G, U, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, U, H, U, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, L, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, H, E, E, E, W, B, E, E, E, B, W, E, E, E, E, W, W, W, W, W, W, W, W, W, W, W, W, W, W, E, E, E, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, F, F, F, F, W, G, G, E, G, G, W, E, E, F, F, W, W, W, W, W, W, W, E, E, R, W, W, W, E, E, U, E, H, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, H, E, E, E, S, E, E, G, E, E, S, E, G, F, H, W, W, W, W, W, W, W, E, H, E, W, W, W, E, E, E, E, H, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, F, F, F, F, W, E, F, F, F, E, W, E, E, F, F, W, W, W, W, W, W, W, E, E, E, W, W, W, E, E, U, E, H, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, H, E, E, E, W, E, F, H, F, E, W, E, E, E, E, W, W, W, W, W, W, W, W, W, W, W, W, W, W, R, E, E, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, L, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, E, C, G, C, E, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, X, G, X, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, F, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, F, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, E, E, E, E, E, E, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, F, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, E, W, W, W, W, E, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, F, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, E, W, W, W, W, E, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, C, C, C, C, C, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, E, W, W, W, W, E, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, I, E, G, G, G, G, G, E, I, W, W, W, W, W, W, W, W, W, W, W, W, W, F, F, H, H, E, L, E, W, W, W, W, E, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, E, E, U, U, U, U, U, E, E, W, W, W, W, W, W, W, W, W, E, H, E, W, F, U, U, U, U, W, T, W, W, W, W, E, W, W, W, - W, W, W, W, W, W, W, W, W, W, C, G, U, F, E, E, E, F, U, G, C, W, W, W, W, W, W, W, W, E, E, E, W, A, X, B, I, E, W, T, W, W, W, E, E, W, W, W, - W, W, W, W, W, W, W, W, W, W, C, G, U, E, F, F, F, E, U, G, C, W, W, W, W, W, W, W, W, E, E, E, W, E, E, E, E, E, W, T, W, W, W, U, A, W, W, W, - W, W, W, W, W, W, W, W, W, W, C, G, U, E, U, F, U, E, U, G, C, W, W, W, W, W, W, W, W, W, E, W, W, E, E, E, E, E, W, T, W, W, W, T, T, W, W, W, - W, W, W, W, W, W, W, W, W, W, C, G, U, E, U, F, U, E, U, G, C, W, W, W, W, W, W, W, W, W, E, W, W, L, W, W, W, W, W, T, W, W, W, T, F, W, W, W, - W, W, W, W, W, W, W, W, W, W, C, G, U, F, U, H, U, F, U, G, C, W, W, W, W, W, W, W, E, E, E, E, A, F, F, E, W, W, W, T, W, W, W, T, F, R, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, F, U, U, U, U, U, F, W, W, W, W, W, W, W, W, W, G, W, W, W, W, W, W, E, W, W, W, T, W, W, W, T, F, W, W, W, - W, W, W, W, W, W, W, W, W, H, F, S, E, B, E, B, E, B, E, S, F, H, W, W, W, W, W, E, E, W, W, W, W, W, W, E, W, W, W, T, W, W, W, T, T, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, L, W, W, W, W, W, W, W, W, W, W, W, W, E, W, W, W, W, W, W, E, W, W, W, T, W, W, W, T, T, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, E, G, V, W, W, W, W, W, W, W, W, W, W, W, E, W, W, W, W, W, W, E, W, W, W, T, T, T, T, T, T, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, B, G, G, G, G, G, F, F, E, W, W, W, W, W, W, W, E, W, W, W, W, W, W, E, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, C, C, G, C, C, W, W, W, W, W, W, W, W, W, W, E, E, E, E, E, E, E, E, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, U, U, G, U, U, W, W, W, W, W, E, E, R, W, W, E, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, C, C, E, C, C, W, W, W, W, W, X, E, E, W, W, E, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, U, G, E, G, U, W, W, W, W, W, F, E, E, W, W, I, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, B, C, E, C, E, W, W, W, W, W, W, W, W, W, W, E, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, U, U, E, U, U, W, W, W, W, E, E, E, W, W, W, G, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, B, F, F, F, F, F, F, F, L, E, B, E, F, H, D, C, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, E, E, E, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - }; - - -} diff --git a/java/com/hmdzl/spspd/change/levels/SokobanLayouts2.java b/java/com/hmdzl/spspd/change/levels/SokobanLayouts2.java deleted file mode 100644 index 2e08652c..00000000 --- a/java/com/hmdzl/spspd/change/levels/SokobanLayouts2.java +++ /dev/null @@ -1,159 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels; - -import com.watabou.utils.Random; - -public class SokobanLayouts2 { - - //32X32 - private static final int W = Terrain.WALL_DECO; - private static final int T = Terrain.SHRUB; - private static final int Z = Terrain.HIGH_GRASS; - private static final int D = Terrain.DOOR; - private static final int L = Terrain.LOCKED_DOOR; - - //private static final int T = Terrain.INACTIVE_TRAP; - - private static final int E = Terrain.EMPTY; - //private static final int X = Terrain.EXIT; - - //private static final int M = Terrain.WALL_DECO; - //private static final int P = Terrain.PEDESTAL; - - private static final int A = Terrain.WALL; - private static final int C = Terrain.EMPTY_DECO; - private static final int X = Terrain.EMPTY_SP; - private static final int B = Terrain.BOOKSHELF; - private static final int H = Terrain.SOKOBAN_HEAP; - private static final int I = Terrain.EMBERS; - private static final int F = Terrain.FLEECING_TRAP; - private static final int U = Terrain.STATUE; - private static final int G = Terrain.TENT; - private static final int S = Terrain.SECRET_DOOR; - private static final int R = Terrain.BED; - private static final int V = Terrain.ALCHEMY; - - private static final int J = Terrain.STATUE_SP; - private static final int K = Terrain.WATER; - // M N O P - - - public static final int[] SOKOBAN_VAULT_LEVEL = { - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, I, I, I, I, I, E, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, E, E, I, I, I, I, I, E, W, W, W, W, A, A, A, A, A, A, A, W, W, W, W, A, A, A, A, A, A, A, A, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, X, X, X, X, X, I, I, I, E, E, E, W, W, W, A, B, B, B, B, B, A, W, W, A, A, A, X, X, X, J, Z, Z, A, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, E, X, K, K, K, X, E, E, E, E, E, E, E, A, A, A, X, X, X, X, R, A, W, W, A, X, X, X, X, X, J, Z, Z, A, A, W, W, W, W, W, - W, W, W, W, W, W, W, E, E, X, K, U, K, X, E, E, E, E, E, E, E, A, X, X, X, X, X, X, X, A, W, W, A, X, X, J, X, X, J, Z, Z, Z, A, W, W, W, W, W, - W, W, W, W, W, W, W, E, E, X, K, K, K, X, E, E, E, E, E, E, E, A, V, X, X, X, X, X, X, A, W, W, A, X, X, J, J, J, J, Z, Z, Z, A, W, W, W, W, W, - W, W, W, W, W, W, W, G, E, X, X, X, X, X, E, E, E, E, E, E, E, A, A, A, X, X, X, X, X, A, W, W, A, X, X, X, X, X, J, Z, Z, Z, A, W, W, W, W, W, - W, W, W, W, W, W, W, X, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, A, A, A, D, A, A, A, W, W, A, X, X, X, X, X, J, D, A, A, A, A, W, W, W, W, - W, W, W, W, W, W, W, X, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, X, X, X, X, X, X, X, A, K, K, A, W, W, W, W, - W, W, W, W, W, W, W, E, E, E, K, K, K, K, K, K, K, K, K, K, K, K, K, K, K, K, K, E, E, E, E, E, E, X, X, X, X, X, X, X, A, K, K, A, W, W, W, W, - W, W, W, W, E, E, E, E, E, E, K, J, J, J, K, J, J, J, K, J, J, J, K, J, J, J, K, E, E, E, E, E, E, X, X, X, X, X, X, X, J, K, K, A, W, W, W, W, - W, W, E, E, E, E, E, E, E, E, K, K, K, J, K, J, K, J, K, K, K, J, K, J, K, J, K, E, E, E, E, E, E, X, X, X, X, X, X, X, A, K, K, A, W, W, W, W, - W, W, E, E, E, E, E, E, E, E, K, J, J, J, K, J, K, J, K, J, J, J, K, J, K, J, K, E, E, E, E, E, A, A, A, D, A, J, J, A, A, D, A, A, W, W, W, W, - W, W, E, E, E, E, E, E, E, E, K, J, K, K, K, J, K, J, K, J, K, K, K, J, K, J, K, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, W, W, W, W, - W, W, E, E, E, E, E, E, E, E, K, J, J, J, K, J, J, J, K, J, J, J, K, J, J, J, K, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, W, W, W, W, - W, W, W, E, E, E, E, E, E, E, K, K, K, K, K, K, K, K, K, K, K, K, K, K, K, K, K, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, W, W, W, W, W, - W, W, W, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, W, W, W, W, W, W, - W, W, W, E, E, E, E, E, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, E, E, E, E, E, E, E, W, W, W, W, W, W, - W, W, W, E, E, E, E, E, C, C, T, T, C, T, T, C, C, T, T, C, C, T, T, T, C, T, C, C, T, C, C, T, T, T, C, E, E, E, E, E, E, E, W, W, Z, Z, W, W, - W, W, W, W, E, E, E, E, C, T, C, C, C, T, C, T, C, T, C, T, C, C, T, C, C, T, T, C, T, C, T, C, C, C, C, E, E, E, E, E, E, Z, Z, Z, Z, Z, W, W, - W, W, W, W, E, E, E, E, C, C, T, C, C, T, T, C, C, T, T, C, C, C, T, C, C, T, T, T, T, C, T, C, T, T, C, E, E, E, E, E, E, Z, Z, Z, Z, Z, W, W, - W, W, W, W, E, E, E, E, C, C, C, T, C, T, C, C, C, T, T, C, C, C, T, C, C, T, C, T, T, C, T, C, C, T, C, E, E, E, E, E, E, Z, Z, Z, Z, Z, Z, W, - W, W, W, E, E, E, E, E, C, T, T, C, C, T, C, C, C, T, C, T, C, T, T, T, C, T, C, C, T, C, T, T, T, T, C, E, E, E, X, X, X, X, X, Z, Z, Z, Z, W, - W, W, W, E, E, E, E, E, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, E, E, E, X, G, X, G, X, Z, Z, Z, W, W, - W, W, W, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, X, X, X, X, X, Z, Z, W, W, W, - W, W, E, E, E, E, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, E, X, G, X, G, X, Z, W, W, W, W, - W, W, E, E, E, E, C, T, T, T, C, T, T, T, C, C, T, T, C, T, T, T, C, T, T, T, C, T, C, T, C, C, T, C, C, T, C, E, X, X, X, X, X, Z, W, W, W, W, - W, W, E, E, E, E, C, T, C, C, C, T, C, C, C, T, C, C, C, C, T, C, C, C, T, C, C, T, C, T, C, T, C, T, C, T, C, E, E, E, E, E, E, E, E, E, E, W, - W, W, E, E, E, E, C, T, T, C, C, T, T, T, C, C, T, C, C, C, T, C, C, C, T, C, C, T, C, T, C, T, T, T, C, T, C, E, E, E, E, E, E, E, E, E, E, W, - W, W, E, E, E, E, C, T, C, C, C, T, C, C, C, C, C, T, C, C, T, C, C, C, T, C, C, T, C, T, C, T, C, T, C, T, C, C, C, E, E, E, E, E, E, E, E, W, - W, W, E, E, E, E, C, T, C, C, C, T, T, T, C, T, T, C, C, C, T, C, C, T, T, T, C, C, T, C, C, T, C, T, C, T, T, T, C, E, E, E, E, E, E, E, E, W, - W, W, E, E, E, E, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, E, E, E, E, E, E, E, E, W, - W, W, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, W, - W, W, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, X, X, X, X, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, W, - W, W, W, W, W, A, D, A, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, E, E, E, W, W, W, W, W, W, W, W, W, E, E, E, E, E, W, W, W, W, W, W, W, - W, W, W, W, W, A, E, A, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, T, W, W, W, W, W, W, W, W, W, E, E, E, W, W, W, W, W, W, W, W, - W, W, W, W, W, A, E, A, W, W, W, W, W, W, W, W, W, W, W, A, A, A, A, A, W, W, T, W, W, W, A, A, A, A, A, A, A, A, D, A, A, A, A, W, W, W, W, W, - W, W, W, W, W, A, E, A, W, W, W, W, W, W, W, W, W, Z, Z, J, B, B, X, A, W, T, W, W, W, W, A, B, B, B, B, A, X, X, X, X, R, B, A, W, W, W, W, W, - W, W, W, T, T, S, K, S, T, T, W, W, W, W, W, W, W, U, Z, A, R, X, X, A, T, W, W, W, W, W, A, B, X, X, X, A, X, X, X, X, X, B, A, W, W, W, W, W, - W, W, W, T, W, A, K, A, W, T, W, W, W, W, T, T, T, Z, Z, D, X, X, X, D, W, W, W, W, W, W, A, B, X, X, X, D, X, X, X, X, X, B, A, W, W, W, W, W, - W, W, W, W, A, A, L, A, A, W, T, T, T, W, T, W, W, U, Z, A, X, X, V, A, W, W, W, W, W, W, A, B, X, X, X, A, X, X, X, X, X, A, A, W, W, W, W, W, - W, W, W, W, A, K, K, K, A, W, W, W, T, T, T, W, W, Z, Z, A, X, X, X, A, W, W, W, W, W, W, A, B, X, G, A, A, A, A, A, A, A, A, W, W, W, W, W, W, - W, W, W, W, A, K, K, K, A, W, W, W, W, W, W, W, W, W, W, A, A, A, A, A, W, W, W, W, W, W, A, A, A, A, A, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, A, U, E, U, A, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, A, A, A, A, A, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W - }; - - public static final int[] DRAGON_CAVE = { - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, E, W, W, E, W, W, W, W, W, W, W, W, W, W, W, F, F, F, F, F, F, F, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, E, E, E, E, E, W, E, E, W, W, W, W, E, W, W, W, W, W, W, F, F, F, F, F, F, F, F, F, F, F, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, H, W, E, E, E, W, W, W, W, W, W, E, H, W, W, W, W, W, F, F, F, F, F, F, F, F, F, F, F, F, F, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, E, E, E, E, W, W, W, W, W, E, W, W, W, W, W, W, F, F, F, F, F, F, F, F, F, F, F, F, F, F, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, E, E, E, W, W, W, W, W, E, W, W, W, W, W, W, F, F, F, F, F, F, F, F, F, F, F, F, F, F, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, E, W, W, W, W, W, W, E, W, W, W, W, W, W, W, F, F, F, F, F, F, F, F, F, F, F, F, F, F, W, W, W, W, W, W, W, H, H, W, W, W, W, W, W, - W, W, W, W, E, W, W, W, W, E, E, E, E, W, W, W, W, W, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, W, W, W, W, W, H, H, H, H, W, W, W, W, W, - W, W, W, W, E, W, W, W, W, E, W, W, E, W, W, W, W, W, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, W, W, W, H, H, H, H, W, W, W, W, W, - W, W, W, W, E, W, W, W, W, E, W, W, E, E, W, W, W, W, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, W, W, W, E, H, H, E, W, W, W, W, W, - W, W, W, W, E, E, W, W, E, E, W, W, W, E, W, W, W, W, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, W, W, W, E, E, W, W, W, W, W, W, W, - W, W, W, W, W, E, W, W, E, W, W, W, W, E, W, W, W, W, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, W, W, W, E, W, W, W, W, W, W, W, W, - W, W, W, W, W, E, E, E, E, W, W, W, W, E, E, W, W, W, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, W, W, W, E, E, W, W, W, W, W, W, W, - W, W, W, W, W, W, E, E, W, W, W, W, W, W, E, E, W, W, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, W, W, W, W, E, W, W, W, W, W, W, W, - W, W, W, W, W, W, E, W, W, W, W, W, W, W, W, E, W, W, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, W, W, W, E, E, W, W, W, W, W, W, - W, W, W, W, W, E, E, W, W, W, W, W, W, W, W, E, W, W, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, W, W, W, W, E, E, W, W, W, W, W, - W, W, W, W, W, E, W, W, W, W, W, W, W, W, W, E, W, W, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, W, W, W, W, W, E, W, W, W, W, W, - W, W, E, W, W, E, W, W, W, W, W, W, W, W, W, E, W, W, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, W, W, W, W, W, E, W, W, W, W, W, - W, W, H, E, W, E, W, W, W, W, W, W, W, W, W, E, E, E, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, W, W, W, W, W, E, E, W, W, W, W, - W, W, E, E, E, E, E, W, W, W, W, W, W, W, W, W, W, W, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, W, W, W, W, W, W, E, W, W, W, W, - W, W, W, W, W, W, E, W, W, W, W, W, W, W, W, W, W, W, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, W, W, W, W, W, W, E, W, W, W, W, - W, W, W, W, W, W, E, W, W, W, W, E, W, W, W, W, W, W, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, W, W, W, W, W, E, E, W, W, W, W, - W, W, W, W, W, W, E, W, W, W, E, E, E, W, W, W, W, W, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, W, W, W, W, W, E, E, W, W, W, W, - W, W, W, W, W, W, E, W, W, W, E, H, E, W, W, W, W, W, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, W, W, W, W, W, E, E, W, W, W, W, - W, W, W, W, W, E, E, W, W, W, W, E, E, W, W, W, W, W, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, W, W, W, W, W, E, W, S, W, W, W, - W, W, W, W, E, E, W, E, E, E, E, E, E, W, W, W, W, W, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, W, W, W, W, E, E, W, W, E, W, W, - W, W, W, W, E, W, W, W, W, W, W, W, W, W, W, E, W, W, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, W, W, W, W, E, E, W, W, W, E, W, W, - W, W, W, W, E, W, W, W, W, W, W, W, W, W, E, W, W, W, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, W, W, W, E, E, W, W, W, W, E, W, W, - W, W, W, W, W, E, W, W, W, W, W, W, W, W, W, E, H, W, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, E, E, E, W, W, W, W, E, E, W, W, - W, W, W, W, W, E, W, W, W, W, W, W, W, W, W, E, E, W, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, W, W, W, W, W, W, W, E, W, W, W, - W, W, W, W, W, E, E, E, E, E, E, W, W, W, W, E, W, W, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, W, W, W, W, W, W, W, E, W, W, W, - W, W, W, W, W, W, W, W, E, W, W, E, W, W, W, E, W, W, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, W, W, W, W, W, E, E, E, W, W, W, - W, W, W, W, W, W, W, E, E, W, W, W, E, W, W, E, W, W, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, W, W, W, W, W, H, E, E, W, W, W, W, - W, W, W, W, W, W, E, E, H, W, W, W, W, E, E, E, W, W, W, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, W, W, W, W, W, H, E, E, E, W, W, W, - W, W, W, W, W, E, E, H, E, E, W, W, W, W, W, W, W, W, W, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, W, W, W, W, W, W, E, E, E, W, W, W, - W, W, W, W, W, E, E, E, E, E, W, W, W, W, W, W, W, W, W, W, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, E, E, E, E, E, W, W, W, W, W, W, W, W, W, W, W, F, F, F, F, F, F, F, F, F, F, F, F, F, F, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, - W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W - }; - -} diff --git a/java/com/hmdzl/spspd/change/levels/SokobanPuzzlesLevel.java b/java/com/hmdzl/spspd/change/levels/SokobanPuzzlesLevel.java deleted file mode 100644 index aeaec3b3..00000000 --- a/java/com/hmdzl/spspd/change/levels/SokobanPuzzlesLevel.java +++ /dev/null @@ -1,701 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels; - -import java.util.Collection; -import java.util.HashMap; -import java.util.HashSet; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.Alchemy; -import com.hmdzl.spspd.change.actors.blobs.Blob; -import com.hmdzl.spspd.change.actors.blobs.Fire; -import com.hmdzl.spspd.change.actors.blobs.Foliage; -import com.hmdzl.spspd.change.actors.blobs.Portal; -import com.hmdzl.spspd.change.actors.blobs.WaterOfHealth; -import com.hmdzl.spspd.change.actors.blobs.WaterOfTransmutation; -import com.hmdzl.spspd.change.actors.blobs.WellWater; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.mobs.Bestiary; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.actors.mobs.SokobanSentinel; -import com.hmdzl.spspd.change.actors.mobs.npcs.Blacksmith; -import com.hmdzl.spspd.change.actors.mobs.npcs.Sheep; -import com.hmdzl.spspd.change.actors.mobs.npcs.SheepSokoban; -import com.hmdzl.spspd.change.actors.mobs.npcs.SheepSokobanBlack; -import com.hmdzl.spspd.change.actors.mobs.npcs.SheepSokobanCorner; -import com.hmdzl.spspd.change.actors.mobs.npcs.SheepSokobanSwitch; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.eggs.Egg; -import com.hmdzl.spspd.change.items.Gold; -import com.hmdzl.spspd.change.items.Heap; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.Whistle; -import com.hmdzl.spspd.change.items.artifacts.TimekeepersHourglass; -import com.hmdzl.spspd.change.items.keys.IronKey; -import com.hmdzl.spspd.change.items.potions.PotionOfLiquidFlame; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfMagicalInfusion; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfRegrowth; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfUpgrade; - -import com.hmdzl.spspd.change.items.wands.WandOfFlock; -import com.hmdzl.spspd.change.levels.features.Chasm; -import com.hmdzl.spspd.change.levels.features.Door; -import com.hmdzl.spspd.change.levels.features.HighGrass; -import com.hmdzl.spspd.change.levels.traps.ActivatePortalTrap; -import com.hmdzl.spspd.change.levels.traps.AlarmTrap; -import com.hmdzl.spspd.change.levels.traps.ChangeSheepTrap; -import com.hmdzl.spspd.change.levels.traps.FireTrap; -import com.hmdzl.spspd.change.levels.traps.FleecingTrap; -import com.hmdzl.spspd.change.levels.traps.GrippingTrap; -import com.hmdzl.spspd.change.levels.traps.HeapGenTrap; -import com.hmdzl.spspd.change.levels.traps.LightningTrap; -import com.hmdzl.spspd.change.levels.traps.ParalyticTrap; -import com.hmdzl.spspd.change.levels.traps.PoisonTrap; -import com.hmdzl.spspd.change.levels.traps.SokobanPortalTrap; -import com.hmdzl.spspd.change.levels.traps.SummoningTrap; -import com.hmdzl.spspd.change.levels.traps.ToxicTrap; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.plants.Flytrap; -import com.hmdzl.spspd.change.plants.Phaseshift; -import com.hmdzl.spspd.change.plants.Plant; -import com.hmdzl.spspd.change.plants.Starflower; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundlable; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; -import com.watabou.utils.SparseArray; - -public class SokobanPuzzlesLevel extends Level { - - - { - color1 = 0x534f3e; - color2 = 0xb9d661; - WIDTH = 48; - HEIGHT = 48; - LENGTH = HEIGHT*WIDTH; - } - - - public HashSet heapstogen; - public int[] heapgenspots; - public int[] teleportspots; - public int[] portswitchspots; - public int[] teleportassign; - public int[] destinationspots; - public int[] destinationassign; - public int prizeNo; - - private static final String HEAPSTOGEN = "heapstogen"; - private static final String HEAPGENSPOTS = "heapgenspots"; - private static final String TELEPORTSPOTS = "teleportspots"; - private static final String PORTSWITCHSPOTS = "portswitchspots"; - private static final String DESTINATIONSPOTS = "destinationspots"; - private static final String TELEPORTASSIGN = "teleportassign"; - private static final String DESTINATIONASSIGN= "destinationassign"; - private static final String PRIZENO = "prizeNo"; - - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(HEAPSTOGEN, heapstogen); - bundle.put(HEAPGENSPOTS, heapgenspots); - bundle.put(TELEPORTSPOTS, teleportspots); - bundle.put(PORTSWITCHSPOTS, portswitchspots); - bundle.put(DESTINATIONSPOTS, destinationspots); - bundle.put(DESTINATIONASSIGN, destinationassign); - bundle.put(TELEPORTASSIGN, teleportassign); - bundle.put(PRIZENO, prizeNo); - } - - - @Override - public String tileName(int tile) { - switch (tile) { - case Terrain.SOKOBAN_SHEEP: - case Terrain.SWITCH_SOKOBAN_SHEEP: - case Terrain.CORNER_SOKOBAN_SHEEP: - case Terrain.BLACK_SOKOBAN_SHEEP: - return Messages.get(Level.class, "floor_name"); - case Terrain.WATER: - return Messages.get(Level.class, "water_name"); - case Terrain.WOOL_RUG: - return Messages.get(Level.class, "wool_rug_name"); - case Terrain.FLEECING_TRAP: - return Messages.get(Level.class, "fleecing_trap_name"); - case Terrain.CHANGE_SHEEP_TRAP: - return Messages.get(Level.class, "change_sheep_trap_name"); - case Terrain.SOKOBAN_ITEM_REVEAL: - return Messages.get(Level.class, "sokoban_item_reveal_name"); - case Terrain.SOKOBAN_PORT_SWITCH: - return Messages.get(Level.class, "sokoban_port_switch_name"); - case Terrain.PORT_WELL: - return Messages.get(Level.class, "port_well_name"); - default: - return super.tileName(tile); - } - } - - - @Override - public String tileDesc(int tile) { - switch (tile) { - case Terrain.SOKOBAN_SHEEP: - case Terrain.SWITCH_SOKOBAN_SHEEP: - case Terrain.CORNER_SOKOBAN_SHEEP: - case Terrain.BLACK_SOKOBAN_SHEEP: - return Messages.get(Level.class, "default_desc"); - case Terrain.EMPTY_DECO: - return Messages.get(PrisonLevel.class, "empty_deco_desc"); - case Terrain.BOOKSHELF: - return Messages.get(PrisonLevel.class, "bookshelf_desc"); - case Terrain.WOOL_RUG: - return Messages.get(Level.class, "wool_rug_desc"); - case Terrain.FLEECING_TRAP: - return Messages.get(Level.class, "fleecing_trap_desc"); - case Terrain.CHANGE_SHEEP_TRAP: - return Messages.get(Level.class, "change_sheep_trap_desc"); - case Terrain.SOKOBAN_ITEM_REVEAL: - return Messages.get(Level.class, "sokoban_item_reveal_desc"); - case Terrain.SOKOBAN_PORT_SWITCH: - return Messages.get(Level.class, "sokoban_port_switch_desc"); - case Terrain.PORT_WELL: - return Messages.get(Level.class, "port_well_desc"); - default: - return super.tileDesc(tile); - } - } - - - @Override - public void restoreFromBundle(Bundle bundle) { - - super.restoreFromBundle(bundle); - - heapgenspots = bundle.getIntArray(HEAPGENSPOTS); - teleportspots = bundle.getIntArray(TELEPORTSPOTS); - portswitchspots = bundle.getIntArray(PORTSWITCHSPOTS); - destinationspots = bundle.getIntArray(DESTINATIONSPOTS); - destinationassign = bundle.getIntArray(DESTINATIONASSIGN); - teleportassign = bundle.getIntArray(TELEPORTASSIGN); - prizeNo = bundle.getInt(PRIZENO); - - heapstogen = new HashSet(); - - Collection collectionheap = bundle.getCollection(HEAPSTOGEN); - for (Bundlable i : collectionheap) { - Item item = (Item) i; - if (item != null) { - heapstogen.add(item); - } - } - } - - @Override - public void create() { - heapstogen = new HashSet(); - heapgenspots = new int[20]; - teleportspots = new int[10]; - portswitchspots = new int[10]; - destinationspots = new int[10]; - destinationassign = new int[10]; - teleportassign = new int[10]; - super.create(); - } - - public void addItemToGen(Item item, int arraypos, int pos) { - if (item != null) { - heapstogen.add(item); - heapgenspots[arraypos]=pos; - } - } - - - public Item genPrizeItem() { - return genPrizeItem(null); - } - - - public Item genPrizeItem(Class match) { - - boolean keysLeft = false; - - if (heapstogen.size() == 0) - return null; - - for (Item item : heapstogen) { - if (match.isInstance(item)) { - heapstogen.remove(item); - keysLeft=true; - return item; - } - } - - if (match == null || !keysLeft) { - Item item = Random.element(heapstogen); - heapstogen.remove(item); - return item; - } - - return null; - } - - @Override - public void press(int cell, Char ch) { - - if (pit[cell] && ch == Dungeon.hero) { - Chasm.heroFall(cell); - return; - } - - TimekeepersHourglass.timeFreeze timeFreeze = null; - - if (ch != null) - timeFreeze = ch.buff(TimekeepersHourglass.timeFreeze.class); - - boolean trap = false; - - switch (map[cell]) { - - case Terrain.FLEECING_TRAP: - - if (ch != null && ch==Dungeon.hero){ - trap = true; - FleecingTrap.trigger(cell, ch); - } - break; - - case Terrain.CHANGE_SHEEP_TRAP: - - if (ch instanceof SheepSokoban || ch instanceof SheepSokobanSwitch || ch instanceof SheepSokobanCorner || ch instanceof Sheep || ch instanceof WandOfFlock.MagicSheep){ - trap = true; - ChangeSheepTrap.trigger(cell, ch); - } - break; - - case Terrain.PORT_WELL: - - if (ch != null && ch==Dungeon.hero){ - - int portarray=-1; - int destinationspot=cell; - - for(int i = 0; i < teleportspots.length; i++) { - if(teleportspots[i] == cell) { - portarray = i; - break; - } - } - - if(portarray != -1) { - destinationspot=destinationspots[portarray]; - if (destinationspot>0){ - SokobanPortalTrap.trigger(cell, ch, destinationspot); - } - } - } - break; - - case Terrain.SOKOBAN_PORT_SWITCH: - trap=false; - ActivatePortalTrap.trigger(cell, ch); - - /* - int arraypos = -1; //position in array of teleport switch - int portpos = -1; //position on map of teleporter - int portarraypos = -1; //position in array of teleporter - int destpos = -1; //destination position assigned to switch - - for(int i = 0; i < portswitchspots.length; i++) { - if(portswitchspots[i] == cell) { - arraypos = i; - //GLog.i("Pos1 %s", arraypos); - break; - } - } - - portpos = teleportassign[arraypos]; - destpos = destinationassign[arraypos]; - - // Stepping on switch deactivates the portal - destpos = -1; - - //GLog.i("ass2 %s", portpos); - //GLog.i("dest3 %s", destpos); - - for(int i = 0; i < teleportspots.length; i++) { - if(teleportspots[i] == portpos) { - portarraypos = i; - // GLog.i("Pos4 %s", portarraypos); - break; - } - } - - if (map[portpos] == Terrain.PORT_WELL){ - destinationspots[portarraypos]=destpos; - GLog.i("Portal Deactivated!"); - } - - - */ - break; - - - case Terrain.HIGH_GRASS: - HighGrass.trample(this, cell, ch); - break; - - case Terrain.WELL: - WellWater.affectCell(cell); - break; - - /*case Terrain.ALCHEMY: - if (ch == null) { - Alchemy.transmute(cell); - } - break;*/ - - case Terrain.DOOR: - Door.enter(cell); - break; - } - - if (trap){ - - if (Dungeon.visible[cell]) - Sample.INSTANCE.play(Assets.SND_TRAP); - - if (ch == Dungeon.hero) - Dungeon.hero.interrupt(); - - set(cell, Terrain.INACTIVE_TRAP); - GameScene.updateMap(cell); - } - - Plant plant = plants.get(cell); - if (plant != null) { - plant.activate(ch); - } - } - - - - @Override - public void mobPress(Mob mob) { - - int cell = mob.pos; - - if (pit[cell] && !mob.flying) { - Chasm.mobFall(mob); - return; - } - - boolean trap = true; - boolean fleece = false; - boolean sheep = false; - switch (map[cell]) { - - case Terrain.FLEECING_TRAP: - if (mob instanceof SheepSokoban || mob instanceof SheepSokobanSwitch || mob instanceof SheepSokobanCorner || mob instanceof SheepSokobanBlack || mob instanceof Sheep || mob instanceof WandOfFlock.MagicSheep){ - fleece=true; - } - FleecingTrap.trigger(cell, mob); - break; - - case Terrain.CHANGE_SHEEP_TRAP: - trap=false; - if (mob instanceof SheepSokoban || mob instanceof SheepSokobanSwitch || mob instanceof SheepSokobanCorner || mob instanceof Sheep || mob instanceof WandOfFlock.MagicSheep){ - trap=true; - ChangeSheepTrap.trigger(cell, mob); - } - break; - - case Terrain.SOKOBAN_ITEM_REVEAL: - trap=false; - if (mob instanceof SheepSokoban || mob instanceof SheepSokobanSwitch || mob instanceof SheepSokobanCorner || mob instanceof SheepSokobanBlack || mob instanceof Sheep || mob instanceof WandOfFlock.MagicSheep){ - HeapGenTrap.trigger(cell, mob); - drop(genPrizeItem(IronKey.class),heapgenspots[prizeNo]); - prizeNo++; - sheep=true; - trap=true; - } - break; - - case Terrain.SOKOBAN_PORT_SWITCH: - trap=false; - if (mob instanceof SheepSokoban || mob instanceof SheepSokobanSwitch || mob instanceof SheepSokobanCorner || mob instanceof SheepSokobanBlack || mob instanceof Sheep || mob instanceof WandOfFlock.MagicSheep){ - ActivatePortalTrap.trigger(cell, mob); - - /* - public int[] teleportspots; location of teleports - public int[] portswitchspots; location of switches - public int[] teleportassign; assignment of teleports to switches - public int[] destinationspots; current assignment of destination spots to teleports - public int[] destinationassign; assignemnt of destination spots to switches - */ - - int arraypos = -1; //position in array of teleport switch - int portpos = -1; //position on map of teleporter - int portarray = -1; //position in array of teleporter - int destpos = -1; //destination position assigned to switch - - for(int i = 0; i < portswitchspots.length; i++) { - if(portswitchspots[i] == cell) { - arraypos = i; - //GLog.i("Pos1 %s", arraypos); - break; - } - } - - portpos = teleportassign[arraypos]; - destpos = destinationassign[arraypos]; - - //GLog.i("ass2 %s", portpos); - //GLog.i("dest3 %s", destpos); - - for(int i = 0; i < teleportspots.length; i++) { - if(teleportspots[i] == portpos) { - portarray = i; - // GLog.i("Pos4 %s", portarray); - break; - } - } - - if (map[portpos] == Terrain.PORT_WELL){ - destinationspots[portarray]=destpos; - GLog.i("Click!"); - } - - sheep=true; - } - break; - - case Terrain.DOOR: - Door.enter(cell); - - default: - trap = false; - } - - if (trap && !fleece && !sheep) { - if (Dungeon.visible[cell]) { - Sample.INSTANCE.play(Assets.SND_TRAP); - } - set(cell, Terrain.INACTIVE_TRAP); - GameScene.updateMap(cell); - } - - if (trap && fleece) { - if (Dungeon.visible[cell]) { - Sample.INSTANCE.play(Assets.SND_TRAP); - } - set(cell, Terrain.WOOL_RUG); - GameScene.updateMap(cell); - } - - if (trap && sheep) { - if (Dungeon.visible[cell]) { - Sample.INSTANCE.play(Assets.SND_TRAP); - } - set(cell, Terrain.EMPTY); - GameScene.updateMap(cell); - } - - - Plant plant = plants.get(cell); - if (plant != null) { - plant.activate(mob); - } - - Dungeon.observe(); - } - - @Override - public String tilesTex() { - return Assets.TILES_PUZZLE; - } - - @Override - public String waterTex() { - return Assets.WATER_PRISON; - } - - @Override - protected boolean build() { - - map = SokobanLayouts.SOKOBAN_PUZZLE_LEVEL.clone(); - decorate(); - - buildFlagMaps(); - cleanWalls(); - createSwitches(); - createSheep(); - - entrance = 15 + WIDTH * 11; - exit = 0 ; - - - return true; - } - @Override - protected void decorate() { - //do nothing, all decorations are hard-coded. - } - - @Override - protected void createMobs() { - - /* - SokobanSentinel mob = new SokobanSentinel(); - mob.pos = 38 + WIDTH * 21; - mobs.add(mob); - Actor.occupyCell(mob); - */ - SokobanSentinel mob2 = new SokobanSentinel(); - mob2.pos = 33 + WIDTH * 30; - mobs.add(mob2); - Actor.occupyCell(mob2); - /* - SokobanSentinel mob3 = new SokobanSentinel(); - mob3.pos = 2 + WIDTH * 43; - mobs.add(mob3); - Actor.occupyCell(mob3); - */ - } - - - - protected void createSheep() { - for (int i = 0; i < LENGTH; i++) { - if (map[i]==Terrain.SOKOBAN_SHEEP){SheepSokoban npc = new SheepSokoban(); mobs.add(npc); npc.pos = i; Actor.occupyCell(npc);} - else if (map[i]==Terrain.CORNER_SOKOBAN_SHEEP){SheepSokobanCorner npc = new SheepSokobanCorner(); mobs.add(npc); npc.pos = i; Actor.occupyCell(npc);} - else if (map[i]==Terrain.SWITCH_SOKOBAN_SHEEP){SheepSokobanSwitch npc = new SheepSokobanSwitch(); mobs.add(npc); npc.pos = i; Actor.occupyCell(npc);} - else if (map[i]==Terrain.BLACK_SOKOBAN_SHEEP){SheepSokobanBlack npc = new SheepSokobanBlack(); mobs.add(npc); npc.pos = i; Actor.occupyCell(npc);} - else if (map[i]==Terrain.PORT_WELL){ - /* - Portal portal = new Portal(); - portal.seed(i, 1); - blobs.put(Portal.class, portal); - */ - } - - } - } - - - protected void createSwitches(){ - - //spots where your portals are - teleportspots[0] = 11 + WIDTH * 10; - teleportspots[1] = 32 + WIDTH * 15; - teleportspots[2] = 25 + WIDTH * 40; - teleportspots[3] = 37 + WIDTH * 18; - teleportspots[4] = 45 + WIDTH * 33; - teleportspots[5] = 37 + WIDTH * 3; - teleportspots[6] = 43 + WIDTH * 2; - - //spots where your portal switches are - portswitchspots[0] = 19 + WIDTH * 10; - portswitchspots[1] = 19 + WIDTH * 6; - portswitchspots[2] = 9 + WIDTH * 8; - portswitchspots[3] = 16 + WIDTH * 37; - - - - //assign each switch to a portal - teleportassign[0] = 11 + WIDTH * 10; - teleportassign[1] = 11 + WIDTH * 10; - teleportassign[2] = 15 + WIDTH * 32; - teleportassign[3] = 37 + WIDTH * 3; - - - - //assign each switch to a destination spot - destinationassign[0] = 30 + WIDTH * 16; - destinationassign[1] = 23 + WIDTH * 40; - destinationassign[2] = 37 + WIDTH * 16; - destinationassign[3] = 42 + WIDTH * 2; - - - - //set the original destination of portals - destinationspots[0] = 0; - destinationspots[1] = 23 + WIDTH * 8; - destinationspots[2] = 23 + WIDTH * 8; - destinationspots[3] = 23 + WIDTH * 8; - destinationspots[4] = 34 + WIDTH * 6; - destinationspots[5] = 23 + WIDTH * 8; - destinationspots[6] = 23 + WIDTH * 8; - - - - - } - - - @Override - protected void createItems() { - int goldmin=300; int goldmax=500; - if (first){ - goldmin=300; goldmax=500; - } - for (int i = 0; i < LENGTH; i++) { - if (map[i]==Terrain.SOKOBAN_HEAP){ - if (first && Random.Int(5)==0){drop(new ScrollOfUpgrade(), i).type = Heap.Type.CHEST;} - else {drop(new Gold(Random.Int(goldmin, goldmax)), i).type = Heap.Type.CHEST;} - } - } - - addItemToGen(new IronKey(Dungeon.depth) , 0, 15 + WIDTH * 11); - addItemToGen(new IronKey(Dungeon.depth) , 1, 16 + WIDTH * 17); - addItemToGen(new IronKey(Dungeon.depth) , 2, 16 + WIDTH * 35); - addItemToGen(new IronKey(Dungeon.depth) , 3, 20 + WIDTH * 38); - addItemToGen(new IronKey(Dungeon.depth) , 4, 27 + WIDTH * 35); - addItemToGen(new IronKey(Dungeon.depth) , 5, 33 + WIDTH * 31); - - - if (first){ - addItemToGen(new ScrollOfMagicalInfusion() , 6, 11 + WIDTH * 10); - addItemToGen(new ScrollOfMagicalInfusion() , 7, 41 + WIDTH * 2); - addItemToGen(new Egg() , 8, 41 + WIDTH * 2); - addItemToGen(new Phaseshift.Seed() , 9, 41 + WIDTH * 2); - addItemToGen(new Starflower.Seed() , 10, 41 + WIDTH * 2); - addItemToGen(new Flytrap.Seed() , 11, 41 + WIDTH * 2); - addItemToGen(new Phaseshift.Seed() , 12, 41 + WIDTH * 2); - addItemToGen(new Flytrap.Seed() , 13, 41 + WIDTH * 2); - addItemToGen(new Whistle() , 14, 41 + WIDTH * 2); - } - - drop(new PotionOfLiquidFlame(), 9 + WIDTH * 24).type = Heap.Type.CHEST; - } - - @Override - public int randomRespawnCell() { - return -1; - } - - -} diff --git a/java/com/hmdzl/spspd/change/levels/SokobanSPLevel.java b/java/com/hmdzl/spspd/change/levels/SokobanSPLevel.java deleted file mode 100644 index 5f24ba47..00000000 --- a/java/com/hmdzl/spspd/change/levels/SokobanSPLevel.java +++ /dev/null @@ -1,481 +0,0 @@ -package com.hmdzl.spspd.change.levels; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.Alchemy; -import com.hmdzl.spspd.change.actors.blobs.Alter; -import com.hmdzl.spspd.change.actors.blobs.WellWater; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.actors.mobs.TestMob; -import com.hmdzl.spspd.change.actors.mobs.YearBeast2; -import com.hmdzl.spspd.change.actors.mobs.npcs.AFly; -import com.hmdzl.spspd.change.actors.mobs.npcs.ARealMan; -import com.hmdzl.spspd.change.actors.mobs.npcs.Apostle; -import com.hmdzl.spspd.change.actors.mobs.npcs.Coconut; -import com.hmdzl.spspd.change.actors.mobs.npcs.Coconut2; -import com.hmdzl.spspd.change.actors.mobs.npcs.DreamPlayer; -import com.hmdzl.spspd.change.actors.mobs.npcs.Evan; -import com.hmdzl.spspd.change.actors.mobs.npcs.FruitCat; -import com.hmdzl.spspd.change.actors.mobs.npcs.G2159687; -import com.hmdzl.spspd.change.actors.mobs.npcs.GoblinPlayer; -import com.hmdzl.spspd.change.actors.mobs.npcs.HBB; -import com.hmdzl.spspd.change.actors.mobs.npcs.HateSokoban; -import com.hmdzl.spspd.change.actors.mobs.npcs.Hmdzl001; -import com.hmdzl.spspd.change.actors.mobs.npcs.HoneyPoooot; -import com.hmdzl.spspd.change.actors.mobs.npcs.Ice13; -import com.hmdzl.spspd.change.actors.mobs.npcs.Jinkeloid; -import com.hmdzl.spspd.change.actors.mobs.npcs.Kostis12345; -import com.hmdzl.spspd.change.actors.mobs.npcs.LaJi; -import com.hmdzl.spspd.change.actors.mobs.npcs.Lery; -import com.hmdzl.spspd.change.actors.mobs.npcs.Lyn; -import com.hmdzl.spspd.change.actors.mobs.npcs.Lynn; -import com.hmdzl.spspd.change.actors.mobs.npcs.MemoryOfSand; -import com.hmdzl.spspd.change.actors.mobs.npcs.Millilitre; -import com.hmdzl.spspd.change.actors.mobs.npcs.NewPlayer; -import com.hmdzl.spspd.change.actors.mobs.npcs.Omicronrg9; -import com.hmdzl.spspd.change.actors.mobs.npcs.RENnpc; -import com.hmdzl.spspd.change.actors.mobs.npcs.Rustyblade; -import com.hmdzl.spspd.change.actors.mobs.npcs.SFB; -import com.hmdzl.spspd.change.actors.mobs.npcs.SaidbySun; -import com.hmdzl.spspd.change.actors.mobs.npcs.Shower; -import com.hmdzl.spspd.change.actors.mobs.npcs.StormAndRain; -import com.hmdzl.spspd.change.actors.mobs.npcs.Tempest102; -import com.hmdzl.spspd.change.actors.mobs.npcs.ThankList; -import com.hmdzl.spspd.change.actors.mobs.npcs.Tinkerer5; -import com.hmdzl.spspd.change.actors.mobs.npcs.UncleS; -import com.hmdzl.spspd.change.actors.mobs.npcs.XixiZero; -import com.hmdzl.spspd.change.items.Generator; -import com.hmdzl.spspd.change.items.Heap; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.artifacts.TimekeepersHourglass; -import com.hmdzl.spspd.change.items.food.completefood.PetFood; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfUpgrade; -import com.hmdzl.spspd.change.items.weapon.missiles.PocketBall; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.features.Chasm; -import com.hmdzl.spspd.change.levels.features.Door; -import com.hmdzl.spspd.change.levels.features.HighGrass; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.plants.Plant; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -public class SokobanSPLevel extends Level { - - - { - color1 = 0x534f3e; - color2 = 0xb9d661; - WIDTH = 48; - HEIGHT = 48; - LENGTH = HEIGHT*WIDTH; - cleared=false; - } - - public int mineDepth=0; - - public int[] storespots; - public int[] bombpots; - - - - private static final String MINEDEPTH = "mineDepth"; - private static final String STORESPOTS = "storespots"; - private static final String BOMBPOTS = "bombpots"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(MINEDEPTH, mineDepth); - bundle.put(STORESPOTS, storespots); - bundle.put(BOMBPOTS, bombpots); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - mineDepth = bundle.getInt(MINEDEPTH); - storespots = bundle.getIntArray(STORESPOTS); - bombpots = bundle.getIntArray(BOMBPOTS); - } - - public void storeStock (){ - - - for (int i : bombpots) { - Heap heap = heaps.get(i); - if (heap == null){ - Item storeitem2 = storeItem2(); - drop(storeitem2, i).type = Heap.Type.FOR_SALE; - } - } - for (int i : storespots) { - Heap heap = heaps.get(i); - if (heap == null){ - Item storeitem = storeItem(); - drop(storeitem, i).type = Heap.Type.FOR_SALE; - } - } - } - - - public Item storeItem (){ - Item prize; - switch (Random.Int(2)) { - case 0: - prize = Generator.random(Generator.Category.ARTIFACT);; - break; - case 1: - prize = Generator.random(Generator.Category.RING); - break; - default: - prize = new PetFood(); - break; - } - - return prize; - - } - - public Item storeItem2 (){ - Item prize; - switch (Random.Int(6)) { - case 0: - prize = Generator.random(Generator.Category.WEAPON); - break; - case 1: - prize = Generator.random(Generator.Category.ARMOR); - break; - case 2: - prize = Generator.random(Generator.Category.POTION); - break; - case 3: - prize = Generator.random(Generator.Category.WAND); - break; - case 4: - prize = Generator.random(Generator.Category.SCROLL); - break; - case 5: - prize = Generator.random(Generator.Category.HIGHFOOD); - break; - default: - prize = new ScrollOfUpgrade(); - break; - } - - return prize; - - } - - @Override - public void create() { - super.create(); - } - - @Override - protected void createItems() { - - Mob g2159687 = new G2159687(); - g2159687.pos = 36 + WIDTH * 6; - mobs.add(g2159687); - - Mob evan = new Evan(); - evan.pos = 40 + WIDTH * 42; - mobs.add(evan); - - Mob hbb = new HBB(); - hbb.pos = 38 + WIDTH * 13; - mobs.add(hbb); - - Mob sfb = new SFB(); - sfb.pos = 34 + WIDTH * 11; - mobs.add(sfb); - - Mob jinkeloid = new Jinkeloid(); - jinkeloid.pos = 38 + WIDTH * 41; - mobs.add(jinkeloid); - - Mob rustyblade = new Rustyblade(); - rustyblade.pos = 36 + WIDTH * 15; - mobs.add(rustyblade); - - Mob lyn = new Lyn(); - lyn.pos = 37 + WIDTH * 9; - mobs.add(lyn); - - Mob lery = new Lery(); - lery.pos = 33 + WIDTH * 9; - mobs.add(lery); - - Mob fruitcat = new FruitCat(); - fruitcat.pos = 37 + WIDTH * 4; - mobs.add(fruitcat); - - Mob coconut2 = new Coconut2(); - coconut2.pos = 20 + WIDTH * 35; - mobs.add(coconut2); - - Mob hmdzl = new Hmdzl001(); - hmdzl.pos = 20 + WIDTH * 42; - mobs.add(hmdzl); - - Mob xixizero = new XixiZero(); - xixizero.pos = 25 + WIDTH * 11; - mobs.add(xixizero); - - Mob omi = new Omicronrg9(); - omi.pos = 36 + WIDTH * 11; - mobs.add(omi); - - Mob mill = new Millilitre(); - mill.pos = 42 + WIDTH * 26; - mobs.add(mill); - - Mob honey = new HoneyPoooot(); - honey.pos = 39 + WIDTH * 15; - mobs.add(honey); - - Mob uncles = new UncleS(); - uncles.pos = 43 + WIDTH * 22; - mobs.add(uncles); - - Mob realman = new ARealMan(); - realman.pos = 36 + WIDTH * 42; - mobs.add(realman); - - Mob saidbysun = new SaidbySun(); - saidbysun.pos = 36 + WIDTH * 39; - mobs.add(saidbysun); - - Mob dp = new DreamPlayer(); - dp.pos = 43 + WIDTH * 24; - mobs.add(dp); - - Mob ice13 = new Ice13(); - ice13.pos = 29 + WIDTH * 35; - mobs.add(ice13); - - Mob goblin = new GoblinPlayer(); - goblin.pos = 8 + WIDTH * 14; - mobs.add(goblin); - - Mob Afly = new AFly(); - Afly.pos = 27 + WIDTH * 17; - mobs.add(Afly); - - Mob apos = new Apostle(); - apos.pos = 20 + WIDTH * 8; - mobs.add(apos); - - Mob shower = new Shower(); - shower.pos = 30 + WIDTH * 19; - mobs.add(shower); - - Mob year2 = new YearBeast2(); - year2.pos = 6 + WIDTH * 44; - mobs.add(year2); - - Mob tempest102 = new Tempest102(); - tempest102.pos = 33 + WIDTH * 42; - mobs.add(tempest102); - - Mob MOS = new MemoryOfSand(); - MOS.pos = 26 + WIDTH * 5; - mobs.add(MOS); - - Mob HS = new HateSokoban(); - HS.pos = 28 + WIDTH * 8; - mobs.add(HS); - - Mob LJ = new LaJi(); - LJ.pos = 23 + WIDTH * 10; - mobs.add(LJ); - - Mob NP = new NewPlayer(); - NP.pos = 23 + WIDTH * 11; - mobs.add(NP); - - Mob TL = new ThankList(); - TL.pos = 39 + WIDTH * 37; - mobs.add(TL); - - Mob SAR = new StormAndRain(); - SAR.pos = 24 + WIDTH * 6; - mobs.add(SAR); - - Mob LYNN = new Lynn(); - LYNN.pos = 40 + WIDTH * 28; - mobs.add(LYNN); - - Mob REN = new RENnpc(); - REN.pos = 40 + WIDTH * 26; - mobs.add(REN); - - Mob KOSTIS = new Kostis12345(); - KOSTIS.pos = 7 + WIDTH * 9;; - mobs.add(KOSTIS); - - TestMob test4 = new TestMob(); - test4.pos = 15 + WIDTH * 3; - mobs.add(test4); - - Mob tinkerer5 = new Tinkerer5(); - tinkerer5.pos = 10 + WIDTH * 34; - mobs.add(tinkerer5); - - storespots = new int[1]; - storespots[0] = 7 + WIDTH * 10; - - bombpots = new int[1]; - bombpots[0] = 21 + WIDTH * 35; - - } - - @Override - public void press(int cell, Char ch) { - - if(!special){ - storeStock(); - special=true; - } - - if (pit[cell] && ch == Dungeon.hero) { - Chasm.heroFall(cell); - return; - } - - TimekeepersHourglass.timeFreeze timeFreeze = null; - - if (ch != null) - timeFreeze = ch.buff(TimekeepersHourglass.timeFreeze.class); - - boolean trap = false; - boolean interrupt = false; - - - - switch (map[cell]) { - - - case Terrain.HIGH_GRASS: - HighGrass.trample(this, cell, ch); - break; - - case Terrain.WELL: - WellWater.affectCell(cell); - break; - - //case Terrain.ALCHEMY: - // Alchemy alchemy = new Alchemy(); - //level.blobs.put( Alchemy.class, alchemy ); - // break; - - case Terrain.PEDESTAL: - if (ch == null ) { - Alter.transmute(cell); - } - break; - - /*case Terrain.BED: - if(ch == null){ - BedLight.transmute(cell); - } - break;*/ - - case Terrain.DOOR: - Door.enter(cell); - break; - } - - if (trap){ - - if (Dungeon.visible[cell]) - Sample.INSTANCE.play(Assets.SND_TRAP); - - if (ch == Dungeon.hero) - Dungeon.hero.interrupt(); - - set(cell, Terrain.INACTIVE_TRAP); - GameScene.updateMap(cell); - } - - if (interrupt){ - - Dungeon.hero.interrupt(); - GameScene.updateMap(cell); - } - - Plant plant = plants.get(cell); - if (plant != null) { - plant.activate(ch); - } - } - - @Override - public String tilesTex() { - return Assets.TILES_SP; - } - - @Override - public String waterTex() { - return Assets.WATER_SEWERS; - } - - @Override - protected boolean build() { - - map = SokobanLayouts2.SOKOBAN_VAULT_LEVEL.clone(); - decorate(); - - buildFlagMaps(); - cleanWalls(); - - entrance = 8 + WIDTH * 5; - exit = 0; - - - return true; - } - @Override - protected void decorate() { - } - - @Override - protected void createMobs() { - - } - - @Override - public String tileName( int tile ) { - switch (tile) { - case Terrain.WATER: - return Messages.get(PrisonLevel.class, "water_name"); - default: - return super.tileName( tile ); - } - } - - @Override - public String tileDesc(int tile) { - switch (tile) { - case Terrain.EMPTY_DECO: - return Messages.get(PrisonLevel.class, "empty_deco_desc"); - case Terrain.BOOKSHELF: - return Messages.get(PrisonLevel.class, "bookshelf_desc"); - default: - return super.tileDesc( tile ); - } - } - - - @Override - public int randomRespawnCell() { - return -1; - } - - - -} diff --git a/java/com/hmdzl/spspd/change/levels/SokobanTeleportLevel.java b/java/com/hmdzl/spspd/change/levels/SokobanTeleportLevel.java deleted file mode 100644 index 4aa628c6..00000000 --- a/java/com/hmdzl/spspd/change/levels/SokobanTeleportLevel.java +++ /dev/null @@ -1,743 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels; - -import java.util.Collection; -import java.util.HashMap; -import java.util.HashSet; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.Alchemy; -import com.hmdzl.spspd.change.actors.blobs.Blob; -import com.hmdzl.spspd.change.actors.blobs.Fire; -import com.hmdzl.spspd.change.actors.blobs.Foliage; -import com.hmdzl.spspd.change.actors.blobs.Portal; -import com.hmdzl.spspd.change.actors.blobs.WaterOfHealth; -import com.hmdzl.spspd.change.actors.blobs.WaterOfTransmutation; -import com.hmdzl.spspd.change.actors.blobs.WellWater; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.mobs.Bestiary; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.actors.mobs.SokobanSentinel; -import com.hmdzl.spspd.change.actors.mobs.npcs.Blacksmith; -import com.hmdzl.spspd.change.actors.mobs.npcs.Sheep; -import com.hmdzl.spspd.change.actors.mobs.npcs.SheepSokoban; -import com.hmdzl.spspd.change.actors.mobs.npcs.SheepSokobanBlack; -import com.hmdzl.spspd.change.actors.mobs.npcs.SheepSokobanCorner; -import com.hmdzl.spspd.change.actors.mobs.npcs.SheepSokobanSwitch; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.Gold; -import com.hmdzl.spspd.change.items.Heap; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.artifacts.TimekeepersHourglass; -import com.hmdzl.spspd.change.items.keys.IronKey; -import com.hmdzl.spspd.change.items.misc.AutoPotion; -import com.hmdzl.spspd.change.items.potions.PotionOfLiquidFlame; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfMagicalInfusion; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfRegrowth; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfUpgrade; - -import com.hmdzl.spspd.change.items.wands.WandOfFlock; -import com.hmdzl.spspd.change.levels.features.Chasm; -import com.hmdzl.spspd.change.levels.features.Door; -import com.hmdzl.spspd.change.levels.features.HighGrass; -import com.hmdzl.spspd.change.levels.traps.ActivatePortalTrap; -import com.hmdzl.spspd.change.levels.traps.AlarmTrap; -import com.hmdzl.spspd.change.levels.traps.ChangeSheepTrap; -import com.hmdzl.spspd.change.levels.traps.FireTrap; -import com.hmdzl.spspd.change.levels.traps.FleecingTrap; -import com.hmdzl.spspd.change.levels.traps.GrippingTrap; -import com.hmdzl.spspd.change.levels.traps.HeapGenTrap; -import com.hmdzl.spspd.change.levels.traps.LightningTrap; -import com.hmdzl.spspd.change.levels.traps.ParalyticTrap; -import com.hmdzl.spspd.change.levels.traps.PoisonTrap; -import com.hmdzl.spspd.change.levels.traps.SokobanPortalTrap; -import com.hmdzl.spspd.change.levels.traps.SummoningTrap; -import com.hmdzl.spspd.change.levels.traps.ToxicTrap; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.plants.Phaseshift; -import com.hmdzl.spspd.change.plants.Plant; -import com.hmdzl.spspd.change.plants.Starflower; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundlable; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; -import com.watabou.utils.SparseArray; - -public class SokobanTeleportLevel extends Level { - - - { - color1 = 0x534f3e; - color2 = 0xb9d661; - WIDTH = 48; - HEIGHT = 48; - LENGTH = HEIGHT*WIDTH; - } - - - public HashSet heapstogen; - public int[] heapgenspots; - public int[] teleportspots; - public int[] portswitchspots; - public int[] teleportassign; - public int[] destinationspots; - public int[] destinationassign; - public int prizeNo; - - private static final String HEAPSTOGEN = "heapstogen"; - private static final String HEAPGENSPOTS = "heapgenspots"; - private static final String TELEPORTSPOTS = "teleportspots"; - private static final String PORTSWITCHSPOTS = "portswitchspots"; - private static final String DESTINATIONSPOTS = "destinationspots"; - private static final String TELEPORTASSIGN = "teleportassign"; - private static final String DESTINATIONASSIGN= "destinationassign"; - private static final String PRIZENO = "prizeNo"; - - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(HEAPSTOGEN, heapstogen); - bundle.put(HEAPGENSPOTS, heapgenspots); - bundle.put(TELEPORTSPOTS, teleportspots); - bundle.put(PORTSWITCHSPOTS, portswitchspots); - bundle.put(DESTINATIONSPOTS, destinationspots); - bundle.put(DESTINATIONASSIGN, destinationassign); - bundle.put(TELEPORTASSIGN, teleportassign); - bundle.put(PRIZENO, prizeNo); - } - - - @Override - public String tileName(int tile) { - switch (tile) { - case Terrain.SOKOBAN_SHEEP: - case Terrain.SWITCH_SOKOBAN_SHEEP: - case Terrain.CORNER_SOKOBAN_SHEEP: - case Terrain.BLACK_SOKOBAN_SHEEP: - return Messages.get(Level.class, "floor_name"); - case Terrain.WATER: - return Messages.get(Level.class, "water_name"); - case Terrain.WOOL_RUG: - return Messages.get(Level.class, "wool_rug_name"); - case Terrain.FLEECING_TRAP: - return Messages.get(Level.class, "fleecing_trap_name"); - case Terrain.CHANGE_SHEEP_TRAP: - return Messages.get(Level.class, "change_sheep_trap_name"); - case Terrain.SOKOBAN_ITEM_REVEAL: - return Messages.get(Level.class, "sokoban_item_reveal_name"); - case Terrain.SOKOBAN_PORT_SWITCH: - return Messages.get(Level.class, "sokoban_port_switch_name"); - case Terrain.PORT_WELL: - return Messages.get(Level.class, "port_well_name"); - default: - return super.tileName(tile); - } - } - - - @Override - public String tileDesc(int tile) { - switch (tile) { - case Terrain.SOKOBAN_SHEEP: - case Terrain.SWITCH_SOKOBAN_SHEEP: - case Terrain.CORNER_SOKOBAN_SHEEP: - case Terrain.BLACK_SOKOBAN_SHEEP: - return Messages.get(Level.class, "default_desc"); - case Terrain.EMPTY_DECO: - return Messages.get(PrisonLevel.class, "empty_deco_desc"); - case Terrain.BOOKSHELF: - return Messages.get(PrisonLevel.class, "bookshelf_desc"); - case Terrain.WOOL_RUG: - return Messages.get(Level.class, "wool_rug_desc"); - case Terrain.FLEECING_TRAP: - return Messages.get(Level.class, "fleecing_trap_desc"); - case Terrain.CHANGE_SHEEP_TRAP: - return Messages.get(Level.class, "change_sheep_trap_desc"); - case Terrain.SOKOBAN_ITEM_REVEAL: - return Messages.get(Level.class, "sokoban_item_reveal_desc"); - case Terrain.SOKOBAN_PORT_SWITCH: - return Messages.get(Level.class, "sokoban_port_switch_desc"); - case Terrain.PORT_WELL: - return Messages.get(Level.class, "port_well_desc"); - default: - return super.tileDesc(tile); - } - } - - - @Override - public void restoreFromBundle(Bundle bundle) { - - super.restoreFromBundle(bundle); - - heapgenspots = bundle.getIntArray(HEAPGENSPOTS); - teleportspots = bundle.getIntArray(TELEPORTSPOTS); - portswitchspots = bundle.getIntArray(PORTSWITCHSPOTS); - destinationspots = bundle.getIntArray(DESTINATIONSPOTS); - destinationassign = bundle.getIntArray(DESTINATIONASSIGN); - teleportassign = bundle.getIntArray(TELEPORTASSIGN); - prizeNo = bundle.getInt(PRIZENO); - - heapstogen = new HashSet(); - - Collection collectionheap = bundle.getCollection(HEAPSTOGEN); - for (Bundlable i : collectionheap) { - Item item = (Item) i; - if (item != null) { - heapstogen.add(item); - } - } - } - - @Override - public void create() { - heapstogen = new HashSet(); - heapgenspots = new int[30]; - teleportspots = new int[30]; - portswitchspots = new int[30]; - destinationspots = new int[30]; - destinationassign = new int[30]; - teleportassign = new int[30]; - super.create(); - } - - public void addItemToGen(Item item, int arraypos, int pos) { - if (item != null) { - heapstogen.add(item); - heapgenspots[arraypos]=pos; - } - } - - - public Item genPrizeItem() { - return genPrizeItem(null); - } - - - public Item genPrizeItem(Class match) { - - boolean keysLeft = false; - - if (heapstogen.size() == 0) - return null; - - for (Item item : heapstogen) { - if (match.isInstance(item)) { - heapstogen.remove(item); - keysLeft=true; - return item; - } - } - - if (match == null || !keysLeft) { - Item item = Random.element(heapstogen); - heapstogen.remove(item); - return item; - } - - return null; - } - - @Override - public void press(int cell, Char ch) { - - if (pit[cell] && ch == Dungeon.hero) { - Chasm.heroFall(cell); - return; - } - - TimekeepersHourglass.timeFreeze timeFreeze = null; - - if (ch != null) - timeFreeze = ch.buff(TimekeepersHourglass.timeFreeze.class); - - boolean trap = false; - - switch (map[cell]) { - - case Terrain.FLEECING_TRAP: - - if (ch != null && ch==Dungeon.hero){ - trap = true; - FleecingTrap.trigger(cell, ch); - } - break; - - case Terrain.CHANGE_SHEEP_TRAP: - - if (ch instanceof SheepSokoban || ch instanceof SheepSokobanSwitch || ch instanceof SheepSokobanCorner || ch instanceof Sheep || ch instanceof WandOfFlock.MagicSheep){ - trap = true; - ChangeSheepTrap.trigger(cell, ch); - } - break; - - case Terrain.SOKOBAN_PORT_SWITCH: - trap=false; - ActivatePortalTrap.trigger(cell, ch); - - /* - int arraypos = -1; //position in array of teleport switch - int portpos = -1; //position on map of teleporter - int portarraypos = -1; //position in array of teleporter - int destpos = -1; //destination position assigned to switch - - for(int i = 0; i < portswitchspots.length; i++) { - if(portswitchspots[i] == cell) { - arraypos = i; - //GLog.i("Pos1 %s", arraypos); - break; - } - } - - portpos = teleportassign[arraypos]; - destpos = destinationassign[arraypos]; - - // Stepping on switch deactivates the portal - destpos = -1; - - //GLog.i("ass2 %s", portpos); - //GLog.i("dest3 %s", destpos); - - for(int i = 0; i < teleportspots.length; i++) { - if(teleportspots[i] == portpos) { - portarraypos = i; - //GLog.i("Pos4 %s", portarraypos); - break; - } - } - - if (map[portpos] == Terrain.PORT_WELL){ - destinationspots[portarraypos]=destpos; - GLog.i("Portal Deactivated!"); - } - - */ - - break; - - - case Terrain.PORT_WELL: - - if (ch != null && ch==Dungeon.hero){ - - int portarray=-1; - int destinationspot=cell; - - for(int i = 0; i < teleportspots.length; i++) { - if(teleportspots[i] == cell) { - portarray = i; - break; - } - } - - //GLog.i("hero %s", portarray); - - if(portarray != -1) { - //GLog.i("portar %s", portarray); - destinationspot=destinationspots[portarray]; - //GLog.i("destspot %s", destinationspot); - if (destinationspot>0){ - SokobanPortalTrap.trigger(cell, ch, destinationspot); - } - } - } - break; - - case Terrain.HIGH_GRASS: - HighGrass.trample(this, cell, ch); - break; - - case Terrain.WELL: - WellWater.affectCell(cell); - break; - - /*case Terrain.ALCHEMY: - if (ch == null) { - Alchemy.transmute(cell); - } - break;*/ - - case Terrain.DOOR: - Door.enter(cell); - break; - } - - if (trap){ - - if (Dungeon.visible[cell]) - Sample.INSTANCE.play(Assets.SND_TRAP); - - if (ch == Dungeon.hero) - Dungeon.hero.interrupt(); - - set(cell, Terrain.INACTIVE_TRAP); - GameScene.updateMap(cell); - } - - Plant plant = plants.get(cell); - if (plant != null) { - plant.activate(ch); - } - } - - - - @Override - public void mobPress(Mob mob) { - - int cell = mob.pos; - - if (pit[cell] && !mob.flying) { - Chasm.mobFall(mob); - return; - } - - boolean trap = true; - boolean fleece = false; - boolean sheep = false; - switch (map[cell]) { - - case Terrain.FLEECING_TRAP: - if (mob instanceof SheepSokoban || mob instanceof SheepSokobanSwitch || mob instanceof SheepSokobanCorner || mob instanceof SheepSokobanBlack || mob instanceof Sheep || mob instanceof WandOfFlock.MagicSheep){ - fleece=true; - } - FleecingTrap.trigger(cell, mob); - break; - - case Terrain.CHANGE_SHEEP_TRAP: - trap=false; - if (mob instanceof SheepSokoban || mob instanceof SheepSokobanSwitch || mob instanceof SheepSokobanCorner || mob instanceof Sheep || mob instanceof WandOfFlock.MagicSheep){ - trap=true; - ChangeSheepTrap.trigger(cell, mob); - } - break; - - case Terrain.SOKOBAN_ITEM_REVEAL: - trap=false; - if (mob instanceof SheepSokoban || mob instanceof SheepSokobanSwitch || mob instanceof SheepSokobanCorner || mob instanceof SheepSokobanBlack || mob instanceof Sheep || mob instanceof WandOfFlock.MagicSheep){ - HeapGenTrap.trigger(cell, mob); - drop(genPrizeItem(IronKey.class),heapgenspots[prizeNo]); - prizeNo++; - sheep=true; - trap=true; - } - break; - - case Terrain.SOKOBAN_PORT_SWITCH: - trap=false; - if (mob instanceof SheepSokoban || mob instanceof SheepSokobanSwitch || mob instanceof SheepSokobanCorner || mob instanceof SheepSokobanBlack || mob instanceof Sheep || mob instanceof WandOfFlock.MagicSheep){ - ActivatePortalTrap.trigger(cell, mob); - - /* - public int[] teleportspots; location of teleports - public int[] portswitchspots; location of switches - public int[] teleportassign; assignment of teleports to switches - public int[] destinationspots; current assignment of destination spots to teleports - public int[] destinationassign; assignemnt of destination spots to switches - */ - - int arraypos = -1; //position in array of teleport switch - int portpos = -1; //position on map of teleporter - int portarray = -1; //position in array of teleporter - int destpos = -1; //destination position assigned to switch - - for(int i = 0; i < portswitchspots.length; i++) { - if(portswitchspots[i] == cell) { - arraypos = i; - //GLog.i("Pos1 %s", arraypos); - break; - } - } - - portpos = teleportassign[arraypos]; - destpos = destinationassign[arraypos]; - - //GLog.i("ass2 %s", portpos); - //GLog.i("dest3 %s", destpos); - - for(int i = 0; i < teleportspots.length; i++) { - if(teleportspots[i] == portpos) { - portarray = i; - //GLog.i("Pos4 %s", portarray); - break; - } - } - - if (map[portpos] == Terrain.PORT_WELL){ - destinationspots[portarray]=destpos; - GLog.i("Click!"); - } - - sheep=true; - } - break; - - case Terrain.DOOR: - Door.enter(cell); - - default: - trap = false; - } - - if (trap && !fleece && !sheep) { - if (Dungeon.visible[cell]) { - Sample.INSTANCE.play(Assets.SND_TRAP); - } - set(cell, Terrain.INACTIVE_TRAP); - GameScene.updateMap(cell); - } - - if (trap && fleece) { - if (Dungeon.visible[cell]) { - Sample.INSTANCE.play(Assets.SND_TRAP); - } - set(cell, Terrain.WOOL_RUG); - GameScene.updateMap(cell); - } - - if (trap && sheep) { - if (Dungeon.visible[cell]) { - Sample.INSTANCE.play(Assets.SND_TRAP); - } - set(cell, Terrain.EMPTY); - GameScene.updateMap(cell); - } - - - Plant plant = plants.get(cell); - if (plant != null) { - plant.activate(mob); - } - - Dungeon.observe(); - } - - @Override - public String tilesTex() { - return Assets.TILES_PUZZLE; - } - - @Override - public String waterTex() { - return Assets.WATER_PRISON; - } - - @Override - protected boolean build() { - - map = SokobanLayouts.SOKOBAN_TELEPORT_LEVEL.clone(); - decorate(); - - buildFlagMaps(); - cleanWalls(); - createSwitches(); - createSheep(); - - entrance = 8 + WIDTH * 16; - exit = 0 ; - - - return true; - } - @Override - protected void decorate() { - //do nothing, all decorations are hard-coded. - } - - @Override - protected void createMobs() { - - - SokobanSentinel mob = new SokobanSentinel(); - mob.pos = 21 + WIDTH * 25; - mobs.add(mob); - Actor.occupyCell(mob); - - SokobanSentinel mob2 = new SokobanSentinel(); - mob2.pos = 42 + WIDTH * 42; - mobs.add(mob2); - Actor.occupyCell(mob2); - - } - - - - protected void createSheep() { - for (int i = 0; i < LENGTH; i++) { - if (map[i]==Terrain.SOKOBAN_SHEEP){SheepSokoban npc = new SheepSokoban(); mobs.add(npc); npc.pos = i; Actor.occupyCell(npc);} - else if (map[i]==Terrain.CORNER_SOKOBAN_SHEEP){SheepSokobanCorner npc = new SheepSokobanCorner(); mobs.add(npc); npc.pos = i; Actor.occupyCell(npc);} - else if (map[i]==Terrain.SWITCH_SOKOBAN_SHEEP){SheepSokobanSwitch npc = new SheepSokobanSwitch(); mobs.add(npc); npc.pos = i; Actor.occupyCell(npc);} - else if (map[i]==Terrain.BLACK_SOKOBAN_SHEEP){SheepSokobanBlack npc = new SheepSokobanBlack(); mobs.add(npc); npc.pos = i; Actor.occupyCell(npc);} - else if (map[i]==Terrain.PORT_WELL){ - /* - Portal portal = new Portal(); - portal.seed(i, 1); - blobs.put(Portal.class, portal); - */ - } - - } - } - - - protected void createSwitches(){ - - //spots where your portals are - teleportspots[0] = 4 + WIDTH * 2; - teleportspots[1] = 16 + WIDTH * 5; - teleportspots[2] = 23 + WIDTH * 5; - teleportspots[3] = 32 + WIDTH * 5; - teleportspots[4] = 4 + WIDTH * 6; - teleportspots[5] = 25 + WIDTH * 7; - teleportspots[6] = 42 + WIDTH * 8; - teleportspots[7] = 10 + WIDTH * 9; - teleportspots[8] = 2 + WIDTH * 10; - teleportspots[9] = 3 + WIDTH * 17; - teleportspots[10] = 8 + WIDTH * 17; - teleportspots[11] = 17 + WIDTH * 17; - teleportspots[12] = 37 + WIDTH * 17; - teleportspots[13] = 40 + WIDTH * 17; - teleportspots[14] = 37 + WIDTH * 20; - teleportspots[15] = 40 + WIDTH * 20; - teleportspots[16] = 21 + WIDTH * 21; - teleportspots[17] = 25 + WIDTH * 22; - teleportspots[18] = 15 + WIDTH * 24; - teleportspots[19] = 6 + WIDTH * 44; - teleportspots[20] = 23 + WIDTH * 44; - teleportspots[21] = 44 + WIDTH * 28; - - - - //spots where your portal switches are - portswitchspots[0] = 30 + WIDTH * 14; - portswitchspots[1] = 35 + WIDTH * 16; - portswitchspots[2] = 42 + WIDTH * 16; - portswitchspots[3] = 35 + WIDTH * 21; - portswitchspots[4] = 42 + WIDTH * 21; - portswitchspots[5] = 30 + WIDTH * 36; - portswitchspots[6] = 32 + WIDTH * 36; - portswitchspots[7] = 35 + WIDTH * 36; - portswitchspots[8] = 37 + WIDTH * 36; - portswitchspots[9] = 27 + WIDTH * 41; - - - - //assign each switch to a portal - teleportassign[0] = 8 + WIDTH * 17; - teleportassign[1] = 44 + WIDTH * 28; - teleportassign[2] = 40 + WIDTH * 17; - teleportassign[3] = 40 + WIDTH * 17; - teleportassign[4] = 8 + WIDTH * 17; - teleportassign[5] = 40 + WIDTH * 20; - teleportassign[6] = 15 + WIDTH * 24; - teleportassign[7] = 8 + WIDTH * 17; - teleportassign[8] = 23 + WIDTH * 44; - teleportassign[9] = 6 + WIDTH * 44; - - - //assign each switch to a destination spot - destinationassign[0] = 9 + WIDTH * 9; - destinationassign[1] = 25 + WIDTH * 44; - destinationassign[2] = 36 + WIDTH * 20; - destinationassign[3] = 41 + WIDTH * 20; - destinationassign[4] = 2 + WIDTH * 17; - destinationassign[5] = 22 + WIDTH * 21; - destinationassign[6] = 16 + WIDTH * 17; - destinationassign[7] = 13 + WIDTH * 24; - destinationassign[8] = 0; - destinationassign[9] = 42 + WIDTH * 7; - - //set the original destination of portals - destinationspots[0] = 2 + WIDTH * 9; - destinationspots[1] = 24 + WIDTH * 8; - destinationspots[2] = 8 + WIDTH * 44; - destinationspots[3] = 37 + WIDTH * 16; - destinationspots[4] = 31 + WIDTH * 5; - destinationspots[5] = 9 + WIDTH * 16; - destinationspots[6] = 9 + WIDTH * 16; - destinationspots[7] = 5 + WIDTH * 2; - destinationspots[8] = 9 + WIDTH * 16; - destinationspots[9] = 9 + WIDTH * 16; - destinationspots[10] = 0; - destinationspots[11] = 9 + WIDTH * 16; - destinationspots[12] = 40 + WIDTH * 16; - destinationspots[13] = 36 + WIDTH * 20; - destinationspots[14] = 36 + WIDTH * 17; - destinationspots[15] = 24 + WIDTH * 23; - destinationspots[16] = 18 + WIDTH * 5; - destinationspots[17] = 9 + WIDTH * 16; - destinationspots[18] = 9 + WIDTH * 16; - destinationspots[19] = 9 + WIDTH * 16; - destinationspots[20] = 9 + WIDTH * 16; - destinationspots[21] = 0; - - - - } - - - @Override - protected void createItems() { - int goldmin=300; int goldmax=500; - if (first){ - goldmin=300; goldmax=500; - } - for (int i = 0; i < LENGTH; i++) { - if (map[i]==Terrain.SOKOBAN_HEAP){ - if (first && Random.Int(5)==0){drop(new ScrollOfUpgrade(), i).type = Heap.Type.CHEST;} - else {drop(new Gold(Random.Int(goldmin, goldmax)), i).type = Heap.Type.CHEST;} - } - } - - addItemToGen(new IronKey(Dungeon.depth) , 0, 8 + WIDTH * 18); - addItemToGen(new IronKey(Dungeon.depth) , 1, 8 + WIDTH * 18); - addItemToGen(new IronKey(Dungeon.depth) , 2, 8 + WIDTH * 18); - addItemToGen(new IronKey(Dungeon.depth) , 3, 8 + WIDTH * 18); - addItemToGen(new IronKey(Dungeon.depth) , 4, 8 + WIDTH * 18); - addItemToGen(new IronKey(Dungeon.depth) , 5, 8 + WIDTH * 18); - - - if (first){ - addItemToGen(new Phaseshift.Seed(), 6, 36 + WIDTH * 28); - addItemToGen(new Starflower.Seed(), 7, 36 + WIDTH * 28); - addItemToGen(new AutoPotion(), 8, 36 + WIDTH * 28); - addItemToGen(new ScrollOfMagicalInfusion(), 9, 36 + WIDTH * 28); - addItemToGen(new ScrollOfMagicalInfusion(), 10, 36 + WIDTH * 28); - addItemToGen(new ScrollOfRegrowth(), 11, 36 + WIDTH * 28); - addItemToGen(new Starflower.Seed(), 12, 36 + WIDTH * 28); - } - - //drop(new PotionOfLiquidFlame(), 9 + WIDTH * 24).type = Heap.Type.CHEST; - } - - @Override - public int randomRespawnCell() { - return -1; - } - - - -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/levels/SokobanVaultLevel.java b/java/com/hmdzl/spspd/change/levels/SokobanVaultLevel.java deleted file mode 100644 index f02a0d70..00000000 --- a/java/com/hmdzl/spspd/change/levels/SokobanVaultLevel.java +++ /dev/null @@ -1,531 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels; - -import java.util.Collection; -import java.util.HashMap; -import java.util.HashSet; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.Alchemy; -import com.hmdzl.spspd.change.actors.blobs.Blob; -import com.hmdzl.spspd.change.actors.blobs.Fire; -import com.hmdzl.spspd.change.actors.blobs.Foliage; -import com.hmdzl.spspd.change.actors.blobs.Portal; -import com.hmdzl.spspd.change.actors.blobs.WaterOfHealth; -import com.hmdzl.spspd.change.actors.blobs.WaterOfTransmutation; -import com.hmdzl.spspd.change.actors.blobs.WellWater; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.mobs.Bestiary; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.actors.mobs.SokobanSentinel; -import com.hmdzl.spspd.change.actors.mobs.npcs.Blacksmith; -import com.hmdzl.spspd.change.actors.mobs.npcs.Sheep; -import com.hmdzl.spspd.change.actors.mobs.npcs.SheepSokoban; -import com.hmdzl.spspd.change.actors.mobs.npcs.SheepSokobanBlack; -import com.hmdzl.spspd.change.actors.mobs.npcs.SheepSokobanCorner; -import com.hmdzl.spspd.change.actors.mobs.npcs.SheepSokobanSwitch; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.eggs.Egg; -import com.hmdzl.spspd.change.items.Gold; -import com.hmdzl.spspd.change.items.Heap; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.Towel; -import com.hmdzl.spspd.change.items.artifacts.TimekeepersHourglass; -import com.hmdzl.spspd.change.items.keys.IronKey; -import com.hmdzl.spspd.change.items.misc.LuckyBadge; -import com.hmdzl.spspd.change.items.potions.PotionOfLiquidFlame; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfMagicalInfusion; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfUpgrade; - -import com.hmdzl.spspd.change.items.wands.WandOfFlock; -import com.hmdzl.spspd.change.levels.features.Chasm; -import com.hmdzl.spspd.change.levels.features.Door; -import com.hmdzl.spspd.change.levels.features.HighGrass; -import com.hmdzl.spspd.change.levels.traps.ActivatePortalTrap; -import com.hmdzl.spspd.change.levels.traps.AlarmTrap; -import com.hmdzl.spspd.change.levels.traps.ChangeSheepTrap; -import com.hmdzl.spspd.change.levels.traps.FireTrap; -import com.hmdzl.spspd.change.levels.traps.FleecingTrap; -import com.hmdzl.spspd.change.levels.traps.GrippingTrap; -import com.hmdzl.spspd.change.levels.traps.HeapGenTrap; -import com.hmdzl.spspd.change.levels.traps.LightningTrap; -import com.hmdzl.spspd.change.levels.traps.ParalyticTrap; -import com.hmdzl.spspd.change.levels.traps.PoisonTrap; -import com.hmdzl.spspd.change.levels.traps.SokobanPortalTrap; -import com.hmdzl.spspd.change.levels.traps.SummoningTrap; -import com.hmdzl.spspd.change.levels.traps.ToxicTrap; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.plants.Dewcatcher; -import com.hmdzl.spspd.change.plants.Flytrap; -import com.hmdzl.spspd.change.plants.Phaseshift; -import com.hmdzl.spspd.change.plants.Plant; -import com.hmdzl.spspd.change.plants.Starflower; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundlable; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; -import com.watabou.utils.SparseArray; - -public class SokobanVaultLevel extends Level { - - - { - color1 = 0x534f3e; - color2 = 0xb9d661; - WIDTH = 48; - HEIGHT = 48; - LENGTH = HEIGHT*WIDTH; - cleared=true; - } - - - public HashSet heapstogen; - public int[] heapgenspots; - public int[] teleportspots; - public int[] portswitchspots; - public int[] teleportassign; - public int[] destinationspots; - public int[] destinationassign; - public int prizeNo; - - private static final String HEAPSTOGEN = "heapstogen"; - private static final String HEAPGENSPOTS = "heapgenspots"; - private static final String TELEPORTSPOTS = "teleportspots"; - private static final String PORTSWITCHSPOTS = "portswitchspots"; - private static final String DESTINATIONSPOTS = "destinationspots"; - private static final String TELEPORTASSIGN = "teleportassign"; - private static final String DESTINATIONASSIGN= "destinationassign"; - private static final String PRIZENO = "prizeNo"; - - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(HEAPSTOGEN, heapstogen); - bundle.put(HEAPGENSPOTS, heapgenspots); - bundle.put(TELEPORTSPOTS, teleportspots); - bundle.put(PORTSWITCHSPOTS, portswitchspots); - bundle.put(DESTINATIONSPOTS, destinationspots); - bundle.put(DESTINATIONASSIGN, destinationassign); - bundle.put(TELEPORTASSIGN, teleportassign); - bundle.put(PRIZENO, prizeNo); - } - - - - @Override - public void restoreFromBundle(Bundle bundle) { - - super.restoreFromBundle(bundle); - - heapgenspots = bundle.getIntArray(HEAPGENSPOTS); - teleportspots = bundle.getIntArray(TELEPORTSPOTS); - portswitchspots = bundle.getIntArray(PORTSWITCHSPOTS); - destinationspots = bundle.getIntArray(DESTINATIONSPOTS); - destinationassign = bundle.getIntArray(DESTINATIONASSIGN); - teleportassign = bundle.getIntArray(TELEPORTASSIGN); - prizeNo = bundle.getInt(PRIZENO); - - heapstogen = new HashSet(); - - Collection collectionheap = bundle.getCollection(HEAPSTOGEN); - for (Bundlable i : collectionheap) { - Item item = (Item) i; - if (item != null) { - heapstogen.add(item); - } - } - } - - @Override - public void create() { - heapstogen = new HashSet(); - heapgenspots = new int[10]; - teleportspots = new int[10]; - portswitchspots = new int[10]; - destinationspots = new int[10]; - destinationassign = new int[10]; - teleportassign = new int[10]; - super.create(); - } - - public void addItemToGen(Item item, int arraypos, int pos) { - if (item != null) { - heapstogen.add(item); - heapgenspots[arraypos]=pos; - } - } - - - public Item genPrizeItem() { - return genPrizeItem(null); - } - - - public Item genPrizeItem(Class match) { - - boolean keysLeft = false; - - if (heapstogen.size() == 0) - return null; - - for (Item item : heapstogen) { - if (match.isInstance(item)) { - heapstogen.remove(item); - keysLeft=true; - return item; - } - } - - if (match == null || !keysLeft) { - Item item = Random.element(heapstogen); - heapstogen.remove(item); - return item; - } - - return null; - } - - @Override - public void press(int cell, Char ch) { - - if (pit[cell] && ch == Dungeon.hero) { - Chasm.heroFall(cell); - return; - } - - TimekeepersHourglass.timeFreeze timeFreeze = null; - - if (ch != null) - timeFreeze = ch.buff(TimekeepersHourglass.timeFreeze.class); - - boolean trap = false; - boolean interrupt = false; - - switch (map[cell]) { - - case Terrain.FLEECING_TRAP: - - if (ch==null){ - interrupt=true; - } - - if (ch != null && ch==Dungeon.hero){ - trap = true; - FleecingTrap.trigger(cell, ch); - } - break; - - case Terrain.CHANGE_SHEEP_TRAP: - - if (ch instanceof SheepSokoban || ch instanceof SheepSokobanSwitch || ch instanceof SheepSokobanCorner || ch instanceof Sheep || ch instanceof WandOfFlock.MagicSheep){ - trap = true; - ChangeSheepTrap.trigger(cell, ch); - } - break; - - case Terrain.WOOL_RUG: - - break; - - case Terrain.SOKOBAN_PORT_SWITCH: - trap=false; - if (ch!=null){ - ActivatePortalTrap.trigger(cell, ch); - - - int arraypos = -1; //position in array of teleport switch - int portpos = -1; //position on map of teleporter - int portarraypos = -1; //position in array of teleporter - int destpos = -1; //destination position assigned to switch - - for(int i = 0; i < portswitchspots.length; i++) { - if(portswitchspots[i] == cell) { - arraypos = i; - break; - } - } - - portpos = teleportassign[arraypos]; - destpos = destinationassign[arraypos]; - - /* Stepping on switch deactivates the portal */ - destpos = -1; - - for(int i = 0; i < teleportspots.length; i++) { - if(teleportspots[i] == portpos) { - portarraypos = i; - break; - } - } - - if (map[portpos] == Terrain.PORT_WELL){ - destinationspots[portarraypos]=destpos; - } - - - } - break; - - - case Terrain.PORT_WELL: - - if (ch != null && ch==Dungeon.hero){ - - int portarray=-1; - int destinationspot=cell; - - for(int i = 0; i < teleportspots.length; i++) { - if(teleportspots[i] == cell) { - portarray = i; - break; - } - } - - if(portarray != -1) { - destinationspot=destinationspots[portarray]; - if (destinationspot>0){ - SokobanPortalTrap.trigger(cell, ch, destinationspot); - } - } - } - break; - - case Terrain.HIGH_GRASS: - HighGrass.trample(this, cell, ch); - break; - - case Terrain.WELL: - WellWater.affectCell(cell); - break; - - /*case Terrain.ALCHEMY: - if (ch == null) { - Alchemy.transmute(cell); - } - break;*/ - - case Terrain.DOOR: - Door.enter(cell); - break; - } - - if (trap){ - - if (Dungeon.visible[cell]) - Sample.INSTANCE.play(Assets.SND_TRAP); - - if (ch == Dungeon.hero) - Dungeon.hero.interrupt(); - - set(cell, Terrain.INACTIVE_TRAP); - GameScene.updateMap(cell); - } - - if (interrupt){ - - Dungeon.hero.interrupt(); - GameScene.updateMap(cell); - } - - Plant plant = plants.get(cell); - if (plant != null) { - plant.activate(ch); - } - } - - @Override - public String tilesTex() { - return Assets.TILES_PUZZLE; - } - - @Override - public String waterTex() { - return Assets.WATER_PRISON; - } - - @Override - protected boolean build() { - - map = SokobanLayouts2.SOKOBAN_VAULT_LEVEL.clone(); - decorate(); - - buildFlagMaps(); - cleanWalls(); - createSwitches(); - createSheep(); - - entrance = 8 + WIDTH * 5; - exit = 0 + WIDTH * 47; - - - return true; - } - @Override - protected void decorate() { - for (int i = 0; i < getLength(); i++) { - - if (map[i]==Terrain.EMPTY && heaps.get(i) == null && Random.Float()<.20){map[i] = Terrain.HIGH_GRASS;} - if (map[i]==Terrain.EMPTY && heaps.get(i) == null && Random.Float()<.25){map[i] = Terrain.GRASS;} - if (map[i]==Terrain.EMPTY && heaps.get(i) == null && Random.Float()<.30){map[i] = Terrain.SHRUB;} - } - } - - @Override - protected void createMobs() { - /* - SokobanSentinel mob = new SokobanSentinel(); - mob.pos = 38 + WIDTH * 21; - mobs.add(mob); - Actor.occupyCell(mob); - - SokobanSentinel mob2 = new SokobanSentinel(); - mob2.pos = 25 + WIDTH * 36; - mobs.add(mob2); - Actor.occupyCell(mob2); - */ - } - - - - protected void createSheep() { - for (int i = 0; i < LENGTH; i++) { - if (map[i]==Terrain.SOKOBAN_SHEEP){SheepSokoban npc = new SheepSokoban(); mobs.add(npc); npc.pos = i; Actor.occupyCell(npc);} - else if (map[i]==Terrain.CORNER_SOKOBAN_SHEEP){SheepSokobanCorner npc = new SheepSokobanCorner(); mobs.add(npc); npc.pos = i; Actor.occupyCell(npc);} - else if (map[i]==Terrain.SWITCH_SOKOBAN_SHEEP){SheepSokobanSwitch npc = new SheepSokobanSwitch(); mobs.add(npc); npc.pos = i; Actor.occupyCell(npc);} - else if (map[i]==Terrain.BLACK_SOKOBAN_SHEEP){SheepSokobanBlack npc = new SheepSokobanBlack(); mobs.add(npc); npc.pos = i; Actor.occupyCell(npc);} - else if (map[i]==Terrain.PORT_WELL){ - - /* - Portal portal = new Portal(); - portal.seed(i, 1); - blobs.put(Portal.class, portal); - */ - } - - } - } - - - protected void createSwitches(){ - - //spots where your portals are - - - //spots where your portal switches are - - - //assign each switch to a portal - - - //assign each switch to a destination spot - - - //set the original destination of portals - - } - - - @Override - protected void createItems() { - int goldmin=1; int goldmax=10; - boolean ringDrop = false; - if (first){ - goldmin=300; goldmax=500; - } - for (int i = 0; i < LENGTH; i++) { - if (map[i]==Terrain.EMPTY && heaps.get(i) == null && Random.Int(100)>70){ - if (first && !ringDrop){drop(new LuckyBadge(), i).type = Heap.Type.CHEST; ringDrop=true;} - else if (first && Random.Int(50)==0){drop(new ScrollOfUpgrade(), i).type = Heap.Type.CHEST;} - else {drop(new Gold(Random.Int(goldmin, goldmax)), i).type = Heap.Type.CHEST;} - } - } - - - } - - @Override - public int randomRespawnCell() { - return -1; - } - - @Override - public String tileName(int tile) { - switch (tile) { - case Terrain.SOKOBAN_SHEEP: - case Terrain.SWITCH_SOKOBAN_SHEEP: - case Terrain.CORNER_SOKOBAN_SHEEP: - case Terrain.BLACK_SOKOBAN_SHEEP: - return Messages.get(Level.class, "floor_name"); - case Terrain.WATER: - return Messages.get(Level.class, "water_name"); - case Terrain.WOOL_RUG: - return Messages.get(Level.class, "wool_rug_name"); - case Terrain.FLEECING_TRAP: - return Messages.get(Level.class, "fleecing_trap_name"); - case Terrain.CHANGE_SHEEP_TRAP: - return Messages.get(Level.class, "change_sheep_trap_name"); - case Terrain.SOKOBAN_ITEM_REVEAL: - return Messages.get(Level.class, "sokoban_item_reveal_name"); - case Terrain.SOKOBAN_PORT_SWITCH: - return Messages.get(Level.class, "sokoban_port_switch_name"); - case Terrain.PORT_WELL: - return Messages.get(Level.class, "port_well_name"); - default: - return super.tileName(tile); - } - } - - - @Override - public String tileDesc(int tile) { - switch (tile) { - case Terrain.SOKOBAN_SHEEP: - case Terrain.SWITCH_SOKOBAN_SHEEP: - case Terrain.CORNER_SOKOBAN_SHEEP: - case Terrain.BLACK_SOKOBAN_SHEEP: - return Messages.get(Level.class, "default_desc"); - case Terrain.EMPTY_DECO: - return Messages.get(PrisonLevel.class, "empty_deco_desc"); - case Terrain.BOOKSHELF: - return Messages.get(PrisonLevel.class, "bookshelf_desc"); - case Terrain.WOOL_RUG: - return Messages.get(Level.class, "wool_rug_desc"); - case Terrain.FLEECING_TRAP: - return Messages.get(Level.class, "fleecing_trap_desc"); - case Terrain.CHANGE_SHEEP_TRAP: - return Messages.get(Level.class, "change_sheep_trap_desc"); - case Terrain.SOKOBAN_ITEM_REVEAL: - return Messages.get(Level.class, "sokoban_item_reveal_desc"); - case Terrain.SOKOBAN_PORT_SWITCH: - return Messages.get(Level.class, "sokoban_port_switch_desc"); - case Terrain.PORT_WELL: - return Messages.get(Level.class, "port_well_desc"); - default: - return super.tileDesc(tile); - } - } - -} diff --git a/java/com/hmdzl/spspd/change/levels/TenguDenLevel.java b/java/com/hmdzl/spspd/change/levels/TenguDenLevel.java deleted file mode 100644 index 9e5e80c6..00000000 --- a/java/com/hmdzl/spspd/change/levels/TenguDenLevel.java +++ /dev/null @@ -1,312 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels; - -import java.util.ArrayList; -import java.util.List; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.mobs.Bestiary; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.items.Heap; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.levels.Room.Type; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.watabou.noosa.Scene; -import com.watabou.utils.Bundle; -import com.watabou.utils.Graph; -import com.watabou.utils.Random; - -public class TenguDenLevel extends RegularLevel { - - { - color1 = 0x48763c; - color2 = 0x59994a; - cleared=true; - } - - private int stairs = 0; - - @Override - public String tilesTex() { - return Assets.TILES_CAVES; - } - - @Override - public String waterTex() { - return Assets.WATER_CAVES; - } - - @Override - protected boolean build() { - - initRooms(); - - int distance; - // if we ever need to try 20 or more times to find a room, better to - // give up and try again. - int retry = 0; - - // start with finding an entrance room (will also contain exit) - // the room must be at least 4x4 and be nearer the top of the map(so - // that it is less likely something connects to the top) - do { - if (retry++ > 20) { - return false; - } - roomEntrance = Random.element(rooms); - } while (roomEntrance.width() < 4 || roomEntrance.height() < 4 - || roomEntrance.top == 0 || roomEntrance.top >= 12); - - roomEntrance.type = Type.ENTRANCE; - roomExit = roomEntrance; - - // now find the rest of the rooms for this boss mini-maze - Room curRoom = null; - Room lastRoom = roomEntrance; - // we make 4 rooms, last iteration is tieing the final room to the start - for (int i = 0; i <= 4; i++) { - retry = 0; - // find a suitable room the first four times - // suitable room should be empty, have a distance of 2 from the - // current room, and not touch the entrance. - if (i < 4) { - do { - if (retry++ > 20) { - return false; - } - curRoom = Random.element(rooms); - Graph.buildDistanceMap(rooms, curRoom); - distance = lastRoom.distance(); - } while (curRoom.type != Type.NULL || distance != 2 - || !curRoom.intersect(roomEntrance).isEmpty()); - - curRoom.type = Type.STANDARD; - - // otherwise, we're on the last iteration. - } else { - // set the current room to the entrance, so we can build a - // connection to it. - curRoom = roomEntrance; - } - - // now build a connection between the current room and the last one. - Graph.buildDistanceMap(rooms, curRoom); - List path = Graph.buildPath(rooms, lastRoom, curRoom); - - Graph.setPrice(path, lastRoom.distance); - - path = Graph.buildPath(rooms, lastRoom, curRoom); - - Room room = lastRoom; - for (Room next : path) { - room.connect(next); - room = next; - } - - if (i == 4) { - - // we must find a room for his royal highness! - // look at rooms adjacent to the final found room (likely to be - // furthest from start) - ArrayList candidates = new ArrayList(); - for (Room r : lastRoom.neigbours) { - if (r.type == Type.NULL && r.connected.size() == 0 - && !r.neigbours.contains(roomEntrance)) { - candidates.add(r); - } - } - - // if we have candidates, pick a room and put the king there - if (candidates.size() > 0) { - Room kingsRoom = Random.element(candidates); - kingsRoom.connect(lastRoom); - kingsRoom.type = Room.Type.RAT_KING2; - - - // unacceptable! make a new level... - } else { - return false; - } - } - lastRoom = curRoom; - } - - // the connection structure ensures that (most of the time) there is a - // nice loop for the player to kite the - // boss around. What's nice is that there is enough chaos such that the - // loop is rarely straightforward - // and boring. - - // fills our connection rooms in with tunnel - for (Room r : rooms) { - if (r.type == Type.NULL && r.connected.size() > 0) { - r.type = Type.TUNNEL; - } - } - - // make sure nothing is connecting at the top of the entrance, this - // would be bad. - for (Room r : roomEntrance.neigbours) { - if (r.bottom == roomEntrance.top && r.type != Type.NULL) - return false; - } - - paint(); - - // TODO: not handling this through a painter is kinda iffy, separate - // into a painter if you use it again. - // sticks the exit in the room entrance. - exit = roomEntrance.top * Level.getWidth() - + (roomEntrance.left + roomEntrance.right) / 2; - - - map[exit] = Terrain.WALL; - map[entrance] = Terrain.PEDESTAL; - - - paintWater(); - paintGrass(); - - return true; - } - - @Override - protected boolean[] water() { - return Patch.generate(0.5f, 5); - } - - @Override - protected boolean[] grass() { - return Patch.generate(0.40f, 4); - } - - @Override - protected void decorate() { - int start = roomExit.top * getWidth() + roomExit.left + 1; - int end = start + roomExit.width() - 1; - for (int i = start; i < end; i++) { - if (i != exit) { - map[i] = Terrain.WALL_DECO; - map[i + getWidth()] = Terrain.WATER; - } else { - map[i + getWidth()] = Terrain.EMPTY; - } - } - } - - @Override - public void addVisuals(Scene scene) { - SewerLevel.addVisuals(this, scene); - } - - @Override - protected void createMobs() { - if (Dungeon.tengudenkilled){ - return; - } - Mob mob = Bestiary.mob(Dungeon.depth); - Room room; - do { - room = Random.element(rooms); - } while (room.type != Type.STANDARD); - mob.pos = room.random(); - mobs.add(mob); - } - - @Override - public Actor respawner() { - return null; - } - - @Override - protected void createItems() { - - } - - @Override - public int randomRespawnCell() { - return -1; - } - public void seal() { - if (entrance != 0) { - - //locked = true; - - set(entrance, Terrain.WATER_TILES); - GameScene.updateMap(entrance); - GameScene.ripple(entrance); - - stairs = entrance; - entrance = 0; - } - } - - public void unseal() { - if (stairs != 0) { - - locked = false; - - entrance = stairs; - stairs = 0; - - set(entrance, Terrain.ENTRANCE); - GameScene.updateMap(entrance); - - } - } - - private static final String STAIRS = "stairs"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(STAIRS, stairs); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - stairs = bundle.getInt(STAIRS); - } - - @Override - public String tileName( int tile ) { - switch (tile) { - case Terrain.WATER: - return Messages.get(SewerLevel.class, "water_name"); - default: - return super.tileName( tile ); - } - } - - @Override - public String tileDesc(int tile) { - switch (tile) { - case Terrain.EMPTY_DECO: - return Messages.get(SewerLevel.class, "empty_deco_desc"); - case Terrain.BOOKSHELF: - return Messages.get(SewerLevel.class, "bookshelf_desc"); - default: - return super.tileDesc( tile ); - } - } -} diff --git a/java/com/hmdzl/spspd/change/levels/Terrain.java b/java/com/hmdzl/spspd/change/levels/Terrain.java deleted file mode 100644 index 3734bece..00000000 --- a/java/com/hmdzl/spspd/change/levels/Terrain.java +++ /dev/null @@ -1,228 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels; - -import com.hmdzl.spspd.change.levels.traps.*; -import com.watabou.utils.SparseArray; - -public class Terrain { - - public static final int CHASM = 0; - public static final int EMPTY = 1; - public static final int GRASS = 2; - public static final int EMPTY_WELL = 3; - public static final int WALL = 4; - public static final int DOOR = 5; - public static final int OPEN_DOOR = 6; - public static final int ENTRANCE = 7; - public static final int EXIT = 8; - public static final int EMBERS = 9; - public static final int LOCKED_DOOR = 10; - public static final int PEDESTAL = 11; - public static final int WALL_DECO = 12; - public static final int BARRICADE = 13; - public static final int EMPTY_SP = 14; - public static final int HIGH_GRASS = 15; - - public static final int SECRET_DOOR = 16; - public static final int SECRET_TRAP = 18; - public static final int TRAP = 20; - public static final int INACTIVE_TRAP = 22; - - public static final int UNBREAK_WALL = 28; - - public static final int EMPTY_DECO = 24; - public static final int LOCKED_EXIT = 25; - public static final int UNLOCKED_EXIT = 26; - public static final int SIGN = 29; - - public static final int TRAP_AIR = 30; - public static final int EMPTY_AIR = 31; - - public static final int WELL = 34; - public static final int STATUE = 35; - public static final int STATUE_SP = 36; - public static final int STATUE_SSP = 37; - public static final int TENT = 38; - public static final int BED = 40; - public static final int BOOKSHELF = 41; - public static final int ALCHEMY = 42; - public static final int CHASM_FLOOR = 43; - public static final int CHASM_FLOOR_SP = 44; - public static final int CHASM_WALL = 45; - public static final int CHASM_WATER = 46; - public static final int SHRUB = 47; - - /*public static final int SECRET_DOOR = 16; - public static final int TOXIC_TRAP = 17; - public static final int SECRET_TOXIC_TRAP = 18; - public static final int FIRE_TRAP = 19; - public static final int SECRET_FIRE_TRAP = 20; - public static final int PARALYTIC_TRAP = 21; - public static final int SECRET_PARALYTIC_TRAP = 22; - public static final int INACTIVE_TRAP = 23; - public static final int POISON_TRAP = 27; - public static final int SECRET_POISON_TRAP = 28; - public static final int ALARM_TRAP = 30; - public static final int SECRET_ALARM_TRAP = 31; - public static final int LIGHTNING_TRAP = 32; - public static final int SECRET_LIGHTNING_TRAP = 33; - public static final int GRIPPING_TRAP = 37; - public static final int SECRET_GRIPPING_TRAP = 38; - public static final int SUMMONING_TRAP = 39; - public static final int SECRET_SUMMONING_TRAP = 40;*/ - public static final int FLEECING_TRAP = 65; - public static final int WOOL_RUG = 66; - public static final int SOKOBAN_SHEEP = 67; - public static final int CORNER_SOKOBAN_SHEEP = 68; - public static final int SWITCH_SOKOBAN_SHEEP = 69; - public static final int CHANGE_SHEEP_TRAP = 70; - public static final int SOKOBAN_ITEM_REVEAL = 71; - public static final int SOKOBAN_HEAP = 72; - public static final int BLACK_SOKOBAN_SHEEP = 73; - public static final int SOKOBAN_PORT_SWITCH = 75; - public static final int PORT_WELL = 74; - - public static final int WATER_TILES = 48; - public static final int WATER = 63; - - public static final int PASSABLE = 0x01; - public static final int LOS_BLOCKING = 0x02; - public static final int FLAMABLE = 0x04; - public static final int SECRET = 0x08; - public static final int SOLID = 0x10; - public static final int AVOID = 0x20; - public static final int LIQUID = 0x40; - public static final int PIT = 0x80; - //public static final int SHOCKABLE = 0x200; - - public static final int UNSTITCHABLE = 0x100; - - public static final int[] flags = new int[256]; - static { - flags[CHASM] = AVOID | PIT | UNSTITCHABLE; - flags[EMPTY] = PASSABLE; - flags[GRASS] = PASSABLE | FLAMABLE; - flags[EMPTY_WELL] = PASSABLE; - flags[WATER] = PASSABLE | LIQUID | UNSTITCHABLE /*SHOCKABLE*/; - flags[WALL] = LOS_BLOCKING | SOLID | UNSTITCHABLE; - flags[UNBREAK_WALL] = flags[WALL]; - flags[DOOR] = PASSABLE | LOS_BLOCKING | FLAMABLE | SOLID | UNSTITCHABLE; - flags[OPEN_DOOR] = PASSABLE | FLAMABLE | UNSTITCHABLE; - flags[ENTRANCE] = PASSABLE/* | SOLID */; - flags[EXIT] = PASSABLE; - flags[EMBERS] = PASSABLE; - flags[LOCKED_DOOR] = LOS_BLOCKING | SOLID | UNSTITCHABLE; - flags[PEDESTAL] = PASSABLE | UNSTITCHABLE; - flags[TENT] = PASSABLE | UNSTITCHABLE; - flags[BED] = PASSABLE | UNSTITCHABLE; - flags[WALL_DECO] = flags[WALL]; - flags[BARRICADE] = FLAMABLE | SOLID | LOS_BLOCKING; - flags[EMPTY_SP] = flags[EMPTY] | UNSTITCHABLE; - flags[HIGH_GRASS] = PASSABLE | LOS_BLOCKING | FLAMABLE; - - flags[SECRET_DOOR] = flags[WALL] | SECRET | UNSTITCHABLE; - flags[SECRET_TRAP] = flags[EMPTY] | SECRET; - flags[TRAP] = AVOID; - flags[INACTIVE_TRAP]= flags[EMPTY]; - - flags[TRAP_AIR] = AVOID; - - flags[EMPTY_DECO] = flags[EMPTY]; - flags[LOCKED_EXIT] = SOLID; - flags[UNLOCKED_EXIT] = PASSABLE; - flags[SIGN] = PASSABLE | FLAMABLE; - flags[WELL] = AVOID; - flags[STATUE] = SOLID; - flags[STATUE_SP] = flags[STATUE] | UNSTITCHABLE; - flags[STATUE_SSP] = flags[STATUE] | UNSTITCHABLE; - flags[BOOKSHELF] = flags[BARRICADE] | UNSTITCHABLE; - flags[ALCHEMY] = PASSABLE; - //flags[ALCHEMY] = SOLID; - flags[SHRUB] = FLAMABLE | SOLID | LOS_BLOCKING;; - - flags[CHASM_WALL] = flags[CHASM]; - flags[CHASM_FLOOR] = flags[CHASM]; - flags[CHASM_FLOOR_SP] = flags[CHASM]; - flags[CHASM_WATER] = flags[CHASM]; - - //flags[SECRET_DOOR] = flags[WALL] | SECRET | UNSTITCHABLE; - //flags[TOXIC_TRAP] = AVOID; - //flags[SECRET_TOXIC_TRAP] = flags[EMPTY] | SECRET; - //flags[FIRE_TRAP] = AVOID; - //flags[SECRET_FIRE_TRAP] = flags[EMPTY] | SECRET; - //flags[PARALYTIC_TRAP] = AVOID; - //flags[SECRET_PARALYTIC_TRAP] = flags[EMPTY] | SECRET; - //flags[POISON_TRAP] = AVOID; - //flags[SECRET_POISON_TRAP] = flags[EMPTY] | SECRET; - //flags[ALARM_TRAP] = AVOID; - //flags[SECRET_ALARM_TRAP] = flags[EMPTY] | SECRET; - //flags[LIGHTNING_TRAP] = AVOID; - //flags[SECRET_LIGHTNING_TRAP] = flags[EMPTY] | SECRET; - //flags[GRIPPING_TRAP] = AVOID; - //flags[SECRET_GRIPPING_TRAP] = flags[EMPTY] | SECRET; - //flags[SUMMONING_TRAP] = AVOID; - //flags[SECRET_SUMMONING_TRAP] = flags[EMPTY] | SECRET; - //flags[INACTIVE_TRAP] = flags[EMPTY]; - flags[FLEECING_TRAP] = AVOID ; - flags[WOOL_RUG] = PASSABLE; - flags[SOKOBAN_SHEEP] = PASSABLE; - flags[CORNER_SOKOBAN_SHEEP] = PASSABLE; - flags[SWITCH_SOKOBAN_SHEEP] = PASSABLE; - flags[CHANGE_SHEEP_TRAP] = PASSABLE; - flags[SOKOBAN_ITEM_REVEAL] = PASSABLE; - flags[SOKOBAN_HEAP] = PASSABLE; - flags[BLACK_SOKOBAN_SHEEP] = PASSABLE; - flags[SOKOBAN_PORT_SWITCH] = PASSABLE; - flags[PORT_WELL] = PASSABLE; - - - for (int i = WATER_TILES; i < WATER_TILES + 16; i++) { - flags[i] = flags[WATER]; - } - }; - - public static int discover(int terr) { - switch (terr) { - case SECRET_DOOR: - return DOOR; - /*case SECRET_FIRE_TRAP: - return FIRE_TRAP; - case SECRET_PARALYTIC_TRAP: - return PARALYTIC_TRAP; - case SECRET_TOXIC_TRAP: - return TOXIC_TRAP; - case SECRET_POISON_TRAP: - return POISON_TRAP; - case SECRET_ALARM_TRAP: - return ALARM_TRAP; - case SECRET_LIGHTNING_TRAP: - return LIGHTNING_TRAP; - case SECRET_GRIPPING_TRAP: - return GRIPPING_TRAP; - case SECRET_SUMMONING_TRAP: - return SUMMONING_TRAP;*/ - case SECRET_TRAP: - return TRAP; - default: - return terr; - } - } - - -} diff --git a/java/com/hmdzl/spspd/change/levels/ThiefBossLevel.java b/java/com/hmdzl/spspd/change/levels/ThiefBossLevel.java deleted file mode 100644 index 2b07e961..00000000 --- a/java/com/hmdzl/spspd/change/levels/ThiefBossLevel.java +++ /dev/null @@ -1,269 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.mobs.BanditKing; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.actors.mobs.ThiefKing; -import com.hmdzl.spspd.change.items.Heap; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.keys.SkeletonKey; -import com.hmdzl.spspd.change.levels.painters.Painter; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.watabou.noosa.Scene; -import com.watabou.noosa.tweeners.AlphaTweener; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -public class ThiefBossLevel extends Level { - - { - color1 = 0x4b6636; - color2 = 0xf2f2f2; - cleared=true; - } - - protected static final int DROP_TIMER = 5; - - private static final int TOP = 2; - private static final int HALL_WIDTH = 13; - private static final int HALL_HEIGHT = 15; - private static final int CHAMBER_HEIGHT = 3; - - private static final int LEFT = (getWidth() - HALL_WIDTH) / 2; - private static final int CENTER = LEFT + HALL_WIDTH / 2; - - private int arenaDoor; - private boolean enteredArena = false; - private boolean keyDropped = false; - - @Override - public String tilesTex() { - return Assets.TILES_VAULT; - } - - @Override - public String waterTex() { - return Assets.WATER_PRISON; - } - - private static final String DOOR = "door"; - private static final String ENTERED = "entered"; - private static final String DROPPED = "droppped"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(DOOR, arenaDoor); - bundle.put(ENTERED, enteredArena); - bundle.put(DROPPED, keyDropped); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - arenaDoor = bundle.getInt(DOOR); - enteredArena = bundle.getBoolean(ENTERED); - keyDropped = bundle.getBoolean(DROPPED); - } - - @Override - protected boolean build() { - - Painter.fill(this, LEFT, TOP, HALL_WIDTH, HALL_HEIGHT, Terrain.EMPTY); - Painter.fill(this, CENTER, TOP, 1, HALL_HEIGHT, Terrain.EMPTY); - - int y = TOP + 1; - while (y < TOP + HALL_HEIGHT) { - map[y * getWidth() + CENTER - 2] = Terrain.TRAP_AIR; - map[y * getWidth() + CENTER + 2] = Terrain.TRAP_AIR; - y += 2; - } - - exit = (TOP - 1) * getWidth() + CENTER; - map[exit] = Terrain.LOCKED_EXIT; - - arenaDoor = (TOP + HALL_HEIGHT) * getWidth() + CENTER; - map[arenaDoor] = Terrain.DOOR; - - Painter.fill(this, LEFT, TOP + HALL_HEIGHT + 1, HALL_WIDTH, - CHAMBER_HEIGHT, Terrain.EMPTY); - Painter.fill(this, LEFT, TOP + HALL_HEIGHT + 1, 1, CHAMBER_HEIGHT, - Terrain.WATER); - Painter.fill(this, LEFT + HALL_WIDTH - 1, TOP + HALL_HEIGHT + 1, 1, - CHAMBER_HEIGHT, Terrain.WATER); - - entrance = (TOP + HALL_HEIGHT + 2 + Random.Int(CHAMBER_HEIGHT - 1)) - * getWidth() + LEFT + (/* 1 + */Random.Int(HALL_WIDTH - 2)); - map[entrance] = Terrain.PEDESTAL; - - map[exit] = Terrain.WALL; - - return true; - } - - @Override - protected void decorate() { - - for (int i = 0; i < getLength(); i++) { - if (map[i] == Terrain.EMPTY && Random.Int(10) == 0) { - map[i] = Terrain.EMPTY_DECO; - } else if (map[i] == Terrain.WALL && Random.Int(8) == 0) { - map[i] = Terrain.WALL_DECO; - } - } - - //int sign = arenaDoor + WIDTH + 1; - //map[sign] = Terrain.SIGN; - } - - public static int pedestal(boolean left) { - if (left) { - return (TOP + HALL_HEIGHT / 2) * getWidth() + CENTER - 2; - } else { - return (TOP + HALL_HEIGHT / 2) * getWidth() + CENTER + 2; - } - } - - @Override - protected void createMobs() { - } - - @Override - public Actor respawner() { - return null; - } - - @Override - protected void createItems() { - - } - - @Override - public int randomRespawnCell() { - return -1; - } - - @Override - public void press(int cell, Char hero) { - - super.press(cell, hero); - - if (!enteredArena && outsideEntraceRoom(cell) && hero == Dungeon.hero) { - - enteredArena = true; - //locked = true; - - Mob boss = new ThiefKing(); - Mob bandit1 = new BanditKing(); - Mob bandit2 = new BanditKing(); - boss.state = boss.HUNTING; - bandit1.state = bandit1.HUNTING; - bandit2.state = bandit2.HUNTING; - int count = 0; - do { - boss.pos = Random.Int(getLength()); - bandit1.pos = (TOP + 1) * getWidth() + CENTER+1; - bandit2.pos = (TOP + 1) * getWidth() + CENTER-1; - - } while (!passable[boss.pos] - || !outsideEntraceRoom(boss.pos) - || (Dungeon.visible[boss.pos] && count++ < 20)); - - GameScene.add(boss); - - - GameScene.add(bandit1); - GameScene.add(bandit2); - - - if (Dungeon.visible[boss.pos]) { - boss.notice(); - boss.sprite.alpha(0); - boss.sprite.parent.add(new AlphaTweener(boss.sprite, 1, 0.1f)); - } - - //set(arenaDoor, Terrain.WALL); - //GameScene.updateMap(arenaDoor); - Dungeon.observe(); - } - } - - @Override - public Heap drop(Item item, int cell) { - - if (!keyDropped && item instanceof SkeletonKey) { - - keyDropped = true; - locked = false; - - set(arenaDoor, Terrain.DOOR); - GameScene.updateMap(arenaDoor); - Dungeon.observe(); - } - - return super.drop(item, cell); - } - - private boolean outsideEntraceRoom(int cell) { - return cell / getWidth() < arenaDoor / getWidth(); - } - - @Override - public String tileName(int tile) { - switch (tile) { - case Terrain.WATER: - return "Suspiciously colored water"; - case Terrain.HIGH_GRASS: - return "Flowers with little gem-shaped leaves"; - default: - return super.tileName(tile); - } - } - - @Override - public String tileDesc(int tile) { - switch (tile) { - case Terrain.ENTRANCE: - return "A ramp leads up to the upper depth."; - case Terrain.EXIT: - return "A ramp leads down to the lower depth."; - case Terrain.WALL_DECO: - case Terrain.EMPTY_DECO: - return "Rough-hewn gold ore adorns the dungeon."; - case Terrain.EMPTY_SP: - return "Thick carpet covers the floor."; - case Terrain.STATUE: - case Terrain.STATUE_SP: - return "The statue is made of solid gold."; - case Terrain.BOOKSHELF: - return "The rows of books on different disciplines fill the bookshelf."; - default: - return super.tileDesc(tile); - } - } - - @Override - public void addVisuals(Scene scene) { - CityLevel.addVisuals(this, scene); - } -} diff --git a/java/com/hmdzl/spspd/change/levels/ThiefCatchLevel.java b/java/com/hmdzl/spspd/change/levels/ThiefCatchLevel.java deleted file mode 100644 index 2a52351e..00000000 --- a/java/com/hmdzl/spspd/change/levels/ThiefCatchLevel.java +++ /dev/null @@ -1,305 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels; - -import java.util.ArrayList; -import java.util.List; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.mobs.Bestiary; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.levels.Room.Type; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.watabou.noosa.Scene; -import com.watabou.utils.Bundle; -import com.watabou.utils.Graph; -import com.watabou.utils.Random; - -public class ThiefCatchLevel extends RegularLevel { - - { - color1 = 0x48763c; - color2 = 0x59994a; - cleared=true; - } - - private int stairs = 0; - - @Override - public String tilesTex() { - return Assets.TILES_CAVES; - } - - @Override - public String waterTex() { - return Assets.WATER_CAVES; - } - - @Override - protected boolean build() { - - initRooms(); - - int distance; - // if we ever need to try 20 or more times to find a room, better to - // give up and try again. - int retry = 0; - - // start with finding an entrance room (will also contain exit) - // the room must be at least 4x4 and be nearer the top of the map(so - // that it is less likely something connects to the top) - do { - if (retry++ > 20) { - return false; - } - roomEntrance = Random.element(rooms); - } while (roomEntrance.width() < 4 || roomEntrance.height() < 4 - || roomEntrance.top == 0 || roomEntrance.top >= 12); - - roomEntrance.type = Type.ENTRANCE; - roomExit = roomEntrance; - - // now find the rest of the rooms for this boss mini-maze - Room curRoom = null; - Room lastRoom = roomEntrance; - // we make 4 rooms, last iteration is tieing the final room to the start - for (int i = 0; i <= 4; i++) { - retry = 0; - // find a suitable room the first four times - // suitable room should be empty, have a distance of 2 from the - // current room, and not touch the entrance. - if (i < 4) { - do { - if (retry++ > 20) { - return false; - } - curRoom = Random.element(rooms); - Graph.buildDistanceMap(rooms, curRoom); - distance = lastRoom.distance(); - } while (curRoom.type != Type.NULL || distance != 2 - || !curRoom.intersect(roomEntrance).isEmpty()); - - curRoom.type = Type.STANDARD; - - // otherwise, we're on the last iteration. - } else { - // set the current room to the entrance, so we can build a - // connection to it. - curRoom = roomEntrance; - } - - // now build a connection between the current room and the last one. - Graph.buildDistanceMap(rooms, curRoom); - List path = Graph.buildPath(rooms, lastRoom, curRoom); - - Graph.setPrice(path, lastRoom.distance); - - path = Graph.buildPath(rooms, lastRoom, curRoom); - - Room room = lastRoom; - for (Room next : path) { - room.connect(next); - room = next; - } - - if (i == 4) { - - // we must find a room for his royal highness! - // look at rooms adjacent to the final found room (likely to be - // furthest from start) - ArrayList candidates = new ArrayList(); - for (Room r : lastRoom.neigbours) { - if (r.type == Type.NULL && r.connected.size() == 0 - && !r.neigbours.contains(roomEntrance)) { - candidates.add(r); - } - } - - // if we have candidates, pick a room and put the king there - if (candidates.size() > 0) { - Room kingsRoom = Random.element(candidates); - kingsRoom.connect(lastRoom); - - kingsRoom.type = Room.Type.STANDARD; - - - // unacceptable! make a new level... - } else { - return false; - } - } - lastRoom = curRoom; - } - - // the connection structure ensures that (most of the time) there is a - // nice loop for the player to kite the - // boss around. What's nice is that there is enough chaos such that the - // loop is rarely straightforward - // and boring. - - // fills our connection rooms in with tunnel - for (Room r : rooms) { - if (r.type == Type.NULL && r.connected.size() > 0) { - r.type = Type.TUNNEL; - } - } - - // make sure nothing is connecting at the top of the entrance, this - // would be bad. - for (Room r : roomEntrance.neigbours) { - if (r.bottom == roomEntrance.top && r.type != Type.NULL) - return false; - } - - paint(); - - // TODO: not handling this through a painter is kinda iffy, separate - // into a painter if you use it again. - // sticks the exit in the room entrance. - exit = roomEntrance.top * Level.getWidth() - + (roomEntrance.left + roomEntrance.right) / 2; - - - map[exit] = Terrain.EMPTY_SP; - - - paintWater(); - paintGrass(); - - return true; - } - - @Override - protected boolean[] water() { - return Patch.generate(0.5f, 5); - } - - @Override - protected boolean[] grass() { - return Patch.generate(0.40f, 4); - } - - @Override - protected void decorate() { - int start = roomExit.top * getWidth() + roomExit.left + 1; - int end = start + roomExit.width() - 1; - for (int i = start; i < end; i++) { - if (i != exit) { - map[i] = Terrain.WALL_DECO; - map[i + getWidth()] = Terrain.WATER; - } else { - map[i + getWidth()] = Terrain.EMPTY; - } - } - } - - @Override - public void addVisuals(Scene scene) { - SewerLevel.addVisuals(this, scene); - } - - @Override - protected void createMobs() { - if (Dungeon.tengudenkilled){ - return; - } - Mob mob = Bestiary.mob(Dungeon.depth); - Room room; - do { - room = Random.element(rooms); - } while (room.type != Type.STANDARD); - mob.pos = room.random(); - mobs.add(mob); - } - - @Override - public Actor respawner() { - return null; - } - - //@Override - //public int randomRespawnCell() { - // return -1; - //} - public void seal() { - if (entrance != 0) { - - locked = true; - - set(entrance, Terrain.WATER_TILES); - GameScene.updateMap(entrance); - GameScene.ripple(entrance); - - stairs = entrance; - entrance = 0; - } - } - - public void unseal() { - if (stairs != 0) { - - locked = false; - - entrance = stairs; - stairs = 0; - - set(entrance, Terrain.ENTRANCE); - GameScene.updateMap(entrance); - - } - } - - private static final String STAIRS = "stairs"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(STAIRS, stairs); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - stairs = bundle.getInt(STAIRS); - } - - @Override - public String tileName( int tile ) { - switch (tile) { - case Terrain.WATER: - return Messages.get(SewerLevel.class, "water_name"); - default: - return super.tileName( tile ); - } - } - - @Override - public String tileDesc(int tile) { - switch (tile) { - case Terrain.EMPTY_DECO: - return Messages.get(SewerLevel.class, "empty_deco_desc"); - case Terrain.BOOKSHELF: - return Messages.get(SewerLevel.class, "bookshelf_desc"); - default: - return super.tileDesc( tile ); - } - } -} diff --git a/java/com/hmdzl/spspd/change/levels/TownLayouts.java b/java/com/hmdzl/spspd/change/levels/TownLayouts.java deleted file mode 100644 index ed35a0c5..00000000 --- a/java/com/hmdzl/spspd/change/levels/TownLayouts.java +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels; - -import com.watabou.utils.Random; - -public class TownLayouts { - - //32X32 - private static final int W = Terrain.WALL; - private static final int T = Terrain.SHRUB; - private static final int Z = Terrain.HIGH_GRASS; - private static final int D = Terrain.DOOR; - private static final int L = Terrain.LOCKED_DOOR; - - private static final int E = Terrain.EMPTY; - private static final int X = Terrain.EXIT; - - private static final int M = Terrain.WALL_DECO; - private static final int P = Terrain.PEDESTAL; - private static final int F = Terrain.EMPTY_DECO; - private static final int O = Terrain.EMPTY_SP; - private static final int A = Terrain.WELL; - private static final int B = Terrain.BOOKSHELF; - - private static final int U = Terrain.STATUE; - private static final int S = Terrain.SECRET_DOOR; - private static final int R = Terrain.WATER; - private static final int Y = Terrain.ALCHEMY; - private static final int G = Terrain.STATUE_SP; - private static final int C = Terrain.TENT; - private static final int H = Terrain.BED; - private static final int I = Terrain.EMBERS; - - //private static final int V = Terrain.TRAP_AIR; - - - public static final int[] TOWN_LAYOUT = { - M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, - M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, O, O, O, M, - M, M, M, M, E, M, T, M, M, M, M, M, E, E, M, M, M, M, M, R, R, R, A, W, W, W, W, W, W, E, E, W, W, W, W, W, W, W, W, M, M, M, M, M, O, E, O, M, - M, M, M, E, E, E, W, S, W, W, W, E, E, E, E, E, E, E, T, C, E, E, E, W, O, O, O, O, W, E, E, G, O, O, G, O, O, O, W, W, W, W, W, W, O, O, O, M, - M, M, O, E, E, E, L, O, O, O, W, E, E, E, E, E, E, E, T, E, E, E, E, W, O, O, O, O, W, E, E, W, O, O, G, G, G, O, W, O, O, O, O, W, M, M, D, M, - M, M, O, E, T, E, G, O, O, O, W, E, E, E, E, E, E, E, T, W, W, S, W, W, O, G, G, G, W, E, E, D, O, O, O, O, O, O, W, O, O, O, H, W, M, M, E, M, - M, M, O, E, E, E, W, W, W, W, W, W, W, W, W, W, E, E, E, W, O, O, O, O, O, O, O, O, E, E, E, W, O, O, O, O, O, O, L, O, O, O, O, W, M, M, E, M, - M, M, M, E, E, E, W, O, O, O, O, O, O, O, O, W, E, E, E, W, O, O, O, O, O, O, O, O, E, E, E, W, O, O, O, O, O, O, W, W, W, G, W, W, M, M, E, M, - M, M, M, E, E, E, W, O, O, O, O, G, G, G, O, W, E, E, E, W, O, O, O, O, O, O, O, O, E, E, E, W, W, W, O, O, O, O, W, R, R, R, R, R, R, M, E, M, - M, M, M, E, E, E, W, O, O, O, O, G, O, O, O, W, E, E, E, W, O, O, O, O, O, O, O, O, E, E, E, E, E, W, O, O, O, O, G, R, R, R, R, R, R, M, E, M, - M, M, M, E, E, E, W, O, O, O, O, G, O, O, O, G, E, E, E, W, O, O, O, O, O, O, O, O, W, E, E, E, E, W, W, W, D, W, W, R, R, R, R, R, U, T, E, M, - M, M, M, M, E, E, W, W, W, D, W, W, O, O, O, W, E, E, E, W, O, O, O, O, O, O, O, O, W, E, E, E, E, W, O, O, O, O, W, E, E, E, R, R, R, M, M, M, - M, M, M, M, E, E, E, E, E, E, E, W, O, O, O, W, E, E, E, W, E, E, E, W, O, O, O, O, W, E, E, E, E, W, O, O, O, O, G, E, E, E, R, R, R, M, M, M, - M, M, M, M, E, E, E, E, E, E, E, W, O, O, O, W, E, E, E, E, E, E, E, W, W, Y, O, O, W, E, E, E, E, W, O, H, O, H, W, W, D, W, W, W, W, M, M, M, - M, M, M, E, E, E, E, E, E, E, E, W, W, W, W, W, E, E, E, E, E, E, E, E, W, W, W, W, W, E, E, E, E, W, W, W, W, W, W, W, O, O, O, O, W, M, M, M, - M, M, M, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, W, O, O, O, O, W, M, M, M, - M, M, M, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, G, O, P, P, O, W, M, M, M, - M, M, M, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, U, W, O, O, O, O, W, M, M, M, - M, M, M, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, D, O, O, O, O, W, M, M, M, - M, M, M, M, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, U, W, O, O, O, O, W, M, M, M, - M, M, M, M, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, W, O, O, O, O, W, M, M, M, - M, M, M, W, W, W, W, W, G, W, W, W, E, E, E, E, O, O, O, O, O, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, W, W, W, W, W, W, M, M, M, - M, M, M, W, O, O, G, O, O, O, O, W, E, E, E, E, O, R, R, R, O, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, W, O, O, O, O, W, M, M, M, - M, M, M, W, O, O, O, O, O, O, O, W, E, E, E, E, O, R, U, R, O, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, W, O, O, O, O, W, M, M, M, - M, M, M, W, O, O, G, G, G, G, G, W, E, E, E, E, O, R, R, R, O, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, G, O, O, O, O, W, M, M, M, - M, M, M, W, O, O, O, O, O, O, O, W, E, E, E, E, O, O, O, O, O, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, G, O, O, O, O, W, M, M, M, - M, M, M, W, O, O, O, O, O, O, O, W, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, U, O, U, W, W, W, W, W, E, E, E, E, W, O, O, O, O, W, M, M, M, - M, M, M, W, O, O, O, O, O, O, O, W, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, O, O, O, W, B, B, B, W, E, E, E, E, W, O, O, O, O, W, M, M, M, - M, M, M, W, W, W, W, W, D, W, W, W, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, U, O, U, W, O, O, O, W, E, E, E, E, W, W, D, W, W, W, M, M, M, - M, M, M, M, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, W, W, W, W, W, W, W, W, W, O, O, O, W, W, E, E, E, E, E, E, E, E, E, M, M, M, - M, M, M, M, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, W, O, O, O, O, O, O, O, O, O, O, O, O, W, W, E, E, E, E, E, E, E, E, M, M, M, - M, M, M, M, M, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, W, O, O, O, O, O, O, O, O, O, O, O, O, B, W, E, E, E, E, E, E, E, E, M, M, M, - M, M, M, M, M, M, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, D, O, O, O, O, O, O, O, O, O, O, P, O, B, W, E, E, E, E, O, O, O, O, M, M, M, - M, M, M, M, M, M, M, M, E, E, E, E, E, E, E, E, E, E, E, E, E, E, W, O, O, O, O, O, O, O, O, O, O, O, O, B, W, E, E, E, E, O, R, R, R, M, M, M, - M, M, M, M, M, M, M, M, M, E, E, E, E, E, E, E, E, E, E, E, E, E, W, O, O, O, O, O, O, O, O, O, O, O, O, W, W, E, E, E, E, O, R, R, R, M, M, M, - M, M, W, W, W, W, W, W, M, E, E, E, E, E, E, E, E, E, E, E, E, E, W, W, W, W, W, W, W, W, W, O, O, O, W, W, E, E, E, E, E, O, R, R, R, M, M, M, - M, M, W, I, F, F, F, W, T, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, W, O, O, O, W, E, E, E, E, E, E, O, R, R, R, M, M, M, - M, M, W, F, F, I, F, T, T, T, M, M, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, W, B, B, B, W, E, E, E, E, E, E, O, R, R, R, M, M, M, - M, M, W, F, F, F, F, T, T, T, M, M, M, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, W, W, W, W, W, E, E, E, E, E, E, O, O, O, O, M, M, M, - M, M, W, F, F, F, F, W, W, W, W, W, M, M, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, Z, Z, Z, Z, Z, Z, W, M, M, M, - M, M, W, F, F, U, F, F, W, F, F, W, M, M, M, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, Z, Z, Z, Z, Z, Z, W, M, M, M, - M, M, W, I, F, F, F, F, W, F, F, W, M, M, M, M, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, U, E, U, E, E, Z, Z, Z, Z, Z, Z, W, W, W, M, - M, M, W, F, F, F, F, I, F, F, F, S, T, T, T, T, M, I, I, I, I, I, I, E, E, E, E, E, E, E, E, E, G, O, O, O, G, E, Z, Z, Z, Z, W, S, W, Z, W, M, - M, M, W, F, F, F, F, F, W, F, F, W, M, M, M, M, M, O, I, I, I, I, O, E, E, E, M, M, E, E, E, E, W, O, O, O, W, E, Z, Z, Z, Z, S, Z, Z, Z, W, M, - M, M, W, F, F, F, F, F, W, F, I, W, M, M, M, M, M, O, I, I, I, I, O, E, E, M, M, M, M, M, E, E, W, O, O, O, W, W, W, W, W, W, W, Z, O, O, W, M, - M, M, W, W, W, W, W, W, W, W, W, W, M, M, M, M, M, O, O, O, O, O, O, E, M, M, M, M, M, M, M, M, W, W, W, W, W, M, M, M, M, W, Z, Z, O, O, W, M, - M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, W, W, W, W, W, W, M, - M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M - - - }; - -} diff --git a/java/com/hmdzl/spspd/change/levels/TownLevel.java b/java/com/hmdzl/spspd/change/levels/TownLevel.java deleted file mode 100644 index 659a92ac..00000000 --- a/java/com/hmdzl/spspd/change/levels/TownLevel.java +++ /dev/null @@ -1,1111 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.Challenges; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.Statistics; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.Alchemy; -import com.hmdzl.spspd.change.actors.blobs.Alter; -import com.hmdzl.spspd.change.actors.blobs.WellWater; -import com.hmdzl.spspd.change.actors.mobs.AdultDragonViolet; -import com.hmdzl.spspd.change.actors.mobs.Piranha; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.actors.mobs.TestMob; -import com.hmdzl.spspd.change.actors.mobs.TestMob2; -import com.hmdzl.spspd.change.actors.mobs.npcs.AFly; -import com.hmdzl.spspd.change.actors.mobs.npcs.ARealMan; -import com.hmdzl.spspd.change.actors.mobs.npcs.Apostle; -import com.hmdzl.spspd.change.actors.mobs.npcs.DreamPlayer; -import com.hmdzl.spspd.change.actors.mobs.npcs.GoblinPlayer; -import com.hmdzl.spspd.change.actors.mobs.npcs.HoneyPoooot; -import com.hmdzl.spspd.change.actors.mobs.npcs.Ice13; -import com.hmdzl.spspd.change.actors.mobs.npcs.Juh9870; -import com.hmdzl.spspd.change.actors.mobs.npcs.Kostis12345; -import com.hmdzl.spspd.change.actors.mobs.npcs.Lynn; -import com.hmdzl.spspd.change.actors.mobs.npcs.Millilitre; -import com.hmdzl.spspd.change.actors.mobs.npcs.NutPainter; -import com.hmdzl.spspd.change.actors.mobs.npcs.OldNewStwist; -import com.hmdzl.spspd.change.actors.mobs.npcs.Omicronrg9; -import com.hmdzl.spspd.change.actors.mobs.npcs.OtilukeNPC; -import com.hmdzl.spspd.change.actors.mobs.npcs.RENnpc; -import com.hmdzl.spspd.change.actors.mobs.npcs.RainTrainer; -import com.hmdzl.spspd.change.actors.mobs.npcs.SadSaltan; -import com.hmdzl.spspd.change.actors.mobs.npcs.SaidbySun; -import com.hmdzl.spspd.change.actors.mobs.npcs.Shopkeeper; -import com.hmdzl.spspd.change.actors.mobs.npcs.Shower; -import com.hmdzl.spspd.change.actors.mobs.npcs.Tinkerer4; -import com.hmdzl.spspd.change.actors.mobs.npcs.Tinkerer5; -import com.hmdzl.spspd.change.actors.mobs.npcs.Udawos; -import com.hmdzl.spspd.change.actors.mobs.npcs.TypedScroll; -import com.hmdzl.spspd.change.actors.mobs.npcs.G2159687; -import com.hmdzl.spspd.change.actors.mobs.npcs.ConsideredHamster; -import com.hmdzl.spspd.change.actors.mobs.npcs.NYRDS; -import com.hmdzl.spspd.change.actors.mobs.npcs.Evan; -import com.hmdzl.spspd.change.actors.mobs.npcs.UncleS; -import com.hmdzl.spspd.change.actors.mobs.npcs.Watabou; -import com.hmdzl.spspd.change.actors.mobs.npcs.Bilboldev; -import com.hmdzl.spspd.change.actors.mobs.npcs.HBB; -import com.hmdzl.spspd.change.actors.mobs.npcs.SFB; -import com.hmdzl.spspd.change.actors.mobs.npcs.Jinkeloid; -import com.hmdzl.spspd.change.actors.mobs.npcs.Rustyblade; -import com.hmdzl.spspd.change.actors.mobs.npcs.HeXA; -import com.hmdzl.spspd.change.actors.mobs.npcs.SP931; -import com.hmdzl.spspd.change.actors.mobs.npcs.Lery; -import com.hmdzl.spspd.change.actors.mobs.npcs.Lyn; -import com.hmdzl.spspd.change.actors.mobs.npcs.Coconut; -import com.hmdzl.spspd.change.actors.mobs.npcs.FruitCat; -import com.hmdzl.spspd.change.actors.mobs.npcs.Locastan; -import com.hmdzl.spspd.change.actors.mobs.npcs.Tempest102; -import com.hmdzl.spspd.change.actors.mobs.npcs.Dachhack; -import com.hmdzl.spspd.change.actors.mobs.npcs.MemoryOfSand; -import com.hmdzl.spspd.change.actors.mobs.npcs.StormAndRain; -import com.hmdzl.spspd.change.actors.mobs.npcs.HateSokoban; -import com.hmdzl.spspd.change.actors.mobs.npcs.AliveFish; -import com.hmdzl.spspd.change.actors.mobs.npcs.LaJi; -import com.hmdzl.spspd.change.actors.mobs.npcs.WhiteGhost; -import com.hmdzl.spspd.change.actors.mobs.npcs.XixiZero; -import com.hmdzl.spspd.change.items.food.Nut; -import com.hmdzl.spspd.change.items.food.vegetable.NutVegetable; -import com.hmdzl.spspd.change.items.food.vegetable.Vegetable; -import com.hmdzl.spspd.change.items.summon.ActiveMrDestructo; -import com.hmdzl.spspd.change.items.eggs.Egg; -import com.hmdzl.spspd.change.items.Generator; -import com.hmdzl.spspd.change.items.Heap; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.Ankh; -import com.hmdzl.spspd.change.items.AdamantArmor; -import com.hmdzl.spspd.change.items.AdamantRing; -import com.hmdzl.spspd.change.items.AdamantWand; -import com.hmdzl.spspd.change.items.AdamantWeapon; -import com.hmdzl.spspd.change.items.food.completefood.PetFood; -import com.hmdzl.spspd.change.items.misc.SkillOfAtk; -import com.hmdzl.spspd.change.items.misc.SkillOfDef; -import com.hmdzl.spspd.change.items.misc.SkillOfMig; -import com.hmdzl.spspd.change.items.quest.DarkGold; - - -import com.hmdzl.spspd.change.items.summon.Honeypot; - - - -import com.hmdzl.spspd.change.items.artifacts.TimekeepersHourglass; -import com.hmdzl.spspd.change.items.potions.PotionOfHealing; -import com.hmdzl.spspd.change.items.potions.PotionOfMending; -import com.hmdzl.spspd.change.items.potions.PotionOfOverHealing; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfUpgrade; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfMagicalInfusion; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfRegrowth; -import com.hmdzl.spspd.change.items.weapon.guns.ToyGun; -import com.hmdzl.spspd.change.items.weapon.melee.special.Brick; -import com.hmdzl.spspd.change.items.weapon.melee.special.FireCracker; -import com.hmdzl.spspd.change.items.weapon.melee.special.HookHam; -import com.hmdzl.spspd.change.items.weapon.melee.special.Lollipop; -import com.hmdzl.spspd.change.items.weapon.melee.special.Pumpkin; -import com.hmdzl.spspd.change.items.weapon.melee.special.RunicBlade; -import com.hmdzl.spspd.change.items.weapon.melee.special.SJRBMusic; -import com.hmdzl.spspd.change.items.weapon.melee.special.TestWeapon; -import com.hmdzl.spspd.change.items.weapon.melee.special.Tree; -import com.hmdzl.spspd.change.items.weapon.missiles.MiniMoai; -import com.hmdzl.spspd.change.items.weapon.missiles.MoneyPack; -import com.hmdzl.spspd.change.items.weapon.missiles.PocketBall; -import com.hmdzl.spspd.change.levels.features.Chasm; -import com.hmdzl.spspd.change.levels.features.Door; -import com.hmdzl.spspd.change.levels.features.HighGrass; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.plants.Phaseshift; -import com.hmdzl.spspd.change.plants.Plant; -import com.hmdzl.spspd.change.plants.Starflower; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -import static com.hmdzl.spspd.change.Dungeon.level; - -public class TownLevel extends Level { - - - { - color1 = 0x534f3e; - color2 = 0xb9d661; - WIDTH = 48; - HEIGHT = 48; - LENGTH = HEIGHT*WIDTH; - special=false; - } - - - public int mineDepth=0; - - public int[] scrollspots; - public int[] storespots; - public int[] bombpots; - public int[] foodpots; - public int[] sppots; - public int[] eggpots; - public int[] gnollpots; - public int[] skillpots; - public int[] pillpots; - - private static final String MINEDEPTH = "mineDepth"; - private static final String SCROLLSPOTS = "scrollspots"; - private static final String STORESPOTS = "storespots"; - private static final String BOMBPOTS = "bombpots"; - private static final String FOODPOTS = "foodpots"; - private static final String SPPOTS = "sppots"; - private static final String EGGPOTS = "eggpots"; - private static final String GNOLLPOTS = "gnollpots"; - private static final String SKILLPOTS = "skillpots"; - private static final String PILLPOTS = "pillpots"; - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(MINEDEPTH, mineDepth); - bundle.put(SCROLLSPOTS, scrollspots); - bundle.put(STORESPOTS, storespots); - bundle.put(BOMBPOTS, bombpots); - bundle.put(FOODPOTS, foodpots); - bundle.put(SPPOTS, sppots); - bundle.put(EGGPOTS, eggpots); - bundle.put(GNOLLPOTS, gnollpots); - bundle.put(SKILLPOTS, skillpots); - bundle.put(PILLPOTS, pillpots); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - mineDepth = bundle.getInt(MINEDEPTH); - scrollspots = bundle.getIntArray(SCROLLSPOTS); - storespots = bundle.getIntArray(STORESPOTS); - bombpots = bundle.getIntArray(BOMBPOTS); - foodpots = bundle.getIntArray(FOODPOTS); - sppots = bundle.getIntArray(SPPOTS); - eggpots = bundle.getIntArray(EGGPOTS); - gnollpots = bundle.getIntArray(GNOLLPOTS); - skillpots = bundle.getIntArray(SKILLPOTS); - pillpots = bundle.getIntArray(PILLPOTS); - } - - private boolean checkOtiluke(){ - boolean check=false; - for (Mob mob : mobs) { - if (mob instanceof OtilukeNPC ) { - check=true; - } - } - return check; - } - - public void storeStock (){ - - - if(Actor.findChar(13 + WIDTH * 10) == null){ - Mob shopkeeper = new Shopkeeper(); - shopkeeper.pos = 13 + WIDTH * 10; - mobs.add(shopkeeper); - } - if(Actor.findChar(8 + WIDTH * 23) == null){ - Mob shopkeeper2 = new Shopkeeper(); - shopkeeper2.pos = 8 + WIDTH * 23; - mobs.add(shopkeeper2); - } - - if(Badges.checkOtilukeRescued()&&!checkOtiluke()){ - if(Actor.findChar(32 + WIDTH * 15) == null){ - Mob otiluke = new OtilukeNPC(); - otiluke.pos = 32 + WIDTH * 15; - mobs.add(otiluke); - } - - map[exit] = Terrain.STATUE; - } - - if(storeRefresh()){ - if (Badges.checkSARRescued()|| Dungeon.isChallenged(Challenges.TEST_TIME)){ - for (int i : sppots) { - Heap heap = heaps.get(i); - if (heap == null){ - Item storeitem5 = storeItem5(); - drop(storeitem5, i).type = Heap.Type.FOR_SALE; - } - } - } - - if (Badges.checkMOSRescued()|| Dungeon.isChallenged(Challenges.TEST_TIME)){ - for (int i : foodpots) { - Heap heap = heaps.get(i); - if (heap == null){ - Item storeitem4 = storeItem4(); - drop(storeitem4, i).type = Heap.Type.FOR_SALE; - } - } - } - - if (Badges.checkCoconutRescued()|| Dungeon.isChallenged(Challenges.TEST_TIME)){ - for (int i : bombpots) { - Heap heap = heaps.get(i); - if (heap == null){ - Item storeitem3 = storeItem3(); - drop(storeitem3, i).type = Heap.Type.FOR_SALE; - } - } - } - - if (Badges.checkItemRescued()|| Dungeon.isChallenged(Challenges.TEST_TIME)){ - for (int i : scrollspots) { - Heap heap = heaps.get(i); - if (heap == null){ - Item storeitem2 = storeItem2(); - drop(storeitem2, i).type = Heap.Type.FOR_SALE; - } - } - for (int i : storespots) { - Heap heap = heaps.get(i); - if (heap == null){ - Item storeitem = storeItem(); - drop(storeitem, i).type = Heap.Type.FOR_SALE; - } - } - } - - if (Badges.checkEggRescued()|| Dungeon.isChallenged(Challenges.TEST_TIME)){ - for (int i : eggpots) { - Heap heap = heaps.get(i); - if (heap == null){ - Item storeitem6 = storeItem6(); - drop(storeitem6, i).type = Heap.Type.FOR_SALE; - } - } - } - if (Dungeon.gnollmission==true|| Dungeon.isChallenged(Challenges.TEST_TIME)){ - for (int i : gnollpots) { - Heap heap = heaps.get(i); - if (heap == null){ - Item storeitem7 = storeItem7(); - drop(storeitem7, i).type = Heap.Type.FOR_SALE; - } - } - } - if (Badges.checkRainRescued() || Dungeon.isChallenged(Challenges.TEST_TIME)) { - for (int i : skillpots) { - Heap heap = heaps.get(i); - if (heap == null) { - Item storeitem8 = storeItem8(); - drop(storeitem8, i).type = Heap.Type.FOR_SALE; - } - } - } - if (Badges.checkUncleRescued()|| Dungeon.isChallenged(Challenges.TEST_TIME)) { - for (int i : pillpots) { - Heap heap = heaps.get(i); - if (heap == null) { - Item storeitem9 = storeItem9(); - drop(storeitem9, i).type = Heap.Type.FOR_SALE; - } - } - } - } - } - - public Item storeItem (){ - Item prize; - switch (Random.Int(10)) { - case 0: - prize = Generator.random(Generator.Category.MUSHROOM); - break; - case 1: - prize = Generator.random(Generator.Category.POTION); - break; - case 2: - prize = new PocketBall(); - break; - case 3: - prize = Generator.random(Generator.Category.SCROLL); - break; - case 4: - prize = Generator.random(Generator.Category.SEED); - break; - case 5: - prize = Generator.random(Generator.Category.BERRY); - break; - case 6: - prize = Generator.random(Generator.Category.SUMMONED); - break; - case 7: - prize = new PetFood(); - break; - case 8: - prize = new NutVegetable(); - break; - default: - prize = new Nut(); - break; - } - - return prize; - - } - - public Item storeItem2 (){ - Item prize; - switch (Random.Int(12)) { - case 0: - prize = new ScrollOfUpgrade(); - break; - case 1: - prize = new ScrollOfMagicalInfusion(); - break; - case 2: - prize = Generator.random(Generator.Category.RANGEWEAPON); - break; - case 3: - prize = Generator.random(Generator.Category.WAND); - break; - case 4: - prize = Generator.random(Generator.Category.RING); - break; - case 5: - prize = Generator.random(Generator.Category.WEAPON); - break; - case 6: - prize = Generator.random(Generator.Category.NORNSTONE); - break; - case 7: - prize = Generator.random(Generator.Category.ARMOR); - break; - case 8: - prize = new RunicBlade(); - break; - case 9: - prize = Generator.random(Generator.Category.RANGEWEAPON); - break; - default: - prize = new ScrollOfUpgrade(); - break; - } - - return prize; - - } - - public Item storeItem3 (){ - Item prize; - switch (Random.Int(12)) { - case 0: - prize = new Ankh(); - break; - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - case 10: - prize = Generator.random(Generator.Category.BOMBS); - break; - case 11: - prize = new ScrollOfRegrowth(); - break; - default: - prize = new Ankh(); - break; - } - - return prize; - - } - - public Item storeItem4 (){ - Item prize; - switch (Random.Int(3)) { - case 0: - prize = Generator.random(Generator.Category.HIGHFOOD); - break; - case 1: - prize = Generator.random(Generator.Category.FOOD); - break; - default: - prize = Generator.random(Generator.Category.HIGHFOOD); - break; - } - return prize; - } - - public Item storeItem5 (){ - Item prize; - switch (Random.Int(6)) { - case 0: - prize = new AdamantArmor(); - break; - case 1: - prize = new AdamantRing(); - break; - case 2: - prize = new AdamantWand(); - break; - case 3: - prize = new AdamantWeapon(); - break; - default: - prize = new DarkGold().quantity(10); - break; - } - return prize; - } - - public Item storeItem6 (){ - Item prize; - switch (Random.Int(2)) { - case 0: - case 1: - prize = Generator.random(Generator.Category.EGGS); - break; - default: - prize = new Egg(); - break; - } - return prize; - } - - public Item storeItem7 (){ - Item prize; - switch (Random.Int(11)) { - case 0: - prize = new Pumpkin(); - break; - case 1: - prize = new Tree(); - break; - case 2: - prize = new FireCracker(); - break; - case 3: - prize = new MiniMoai(); - break; - case 4: - prize = new TestWeapon(); - break; - case 5: - prize = new ToyGun(); - break; - case 6: - prize = new HookHam(); - break; - case 7: - prize = new Brick(); - break; - case 8: - prize = new Lollipop(); - break; - case 9: - prize = new SJRBMusic(); - break; - case 10: - prize = new MoneyPack(5); - break; - default: - prize = new PetFood(); - break; - } - return prize; - } - - public Item storeItem8 (){ - Item prize; - switch (Random.Int(6)) { - case 0: - prize = new SkillOfAtk(); - break; - case 1: - prize = new SkillOfDef(); - break; - case 2: - prize = new SkillOfMig(); - break; - default: - prize = Generator.random(Generator.Category.MUSICWEAPON); - break; - } - return prize; - } - - public Item storeItem9 (){ - Item prize; - prize = Generator.random(Generator.Category.PILL); - return prize; - } - - public boolean storeRefresh(){ - boolean check=false; - if (Statistics.realdeepestFloor>mineDepth || Dungeon.oneDay==true){ - //mineDepth=Statistics.realdeepestFloor; - check=true; - Dungeon.oneDay=false; - } - return check; - } - - @Override - public void create() { - - super.create(); - } - - - @Override - protected void createItems() { - - /*Mob bluecat = new BlueCat(); - bluecat.pos = 35 + WIDTH * 5; - mobs.add(bluecat);*/ - - Mob udawos = new Udawos(); - udawos.pos = 33 + WIDTH * 34; - mobs.add(udawos); - - Mob typedscroll = new TypedScroll(); - typedscroll.pos = 9 + WIDTH * 23; - mobs.add(typedscroll); - - Mob g2159687 = new G2159687(); - g2159687.pos = 35 + WIDTH * 3; - mobs.add(g2159687); - - Mob consideredhamster = new ConsideredHamster(); - consideredhamster.pos = 26 + WIDTH * 10; - mobs.add(consideredhamster); - - Mob bilboldev = new Bilboldev(); - bilboldev.pos = 24 + WIDTH * 10; - mobs.add(bilboldev); - - Mob xixizero = new XixiZero(); - xixizero.pos = 25 + WIDTH * 11; - mobs.add(xixizero); - - if(Badges.checkTombRescued() || Dungeon.isChallenged(Challenges.TEST_TIME)){ - Mob watabou = new Watabou(); - watabou.pos = 42 + WIDTH * 42; - mobs.add(watabou); - - Mob wg = new WhiteGhost(); - wg.pos = 45 + WIDTH * 44; - mobs.add(wg); - - } - - Mob mill = new Millilitre(); - mill.pos = 45 + WIDTH * 42; - mobs.add(mill); - - Mob nyrds = new NYRDS(); - nyrds.pos = 13 + WIDTH * 11; - mobs.add(nyrds); - - Mob hbb = new HBB(); - hbb.pos = 43 + WIDTH * 15; - mobs.add(hbb); - - Mob sfb = new SFB(); - sfb.pos = 34 + WIDTH * 11; - mobs.add(sfb); - - Mob omi = new Omicronrg9(); - omi.pos = 36 + WIDTH * 11; - mobs.add(omi); - - Mob honey = new HoneyPoooot(); - honey.pos = 40 + WIDTH * 15; - mobs.add(honey); - - Mob jinkeloid = new Jinkeloid(); - jinkeloid.pos = 43 + WIDTH * 14; - mobs.add(jinkeloid); - - if (Badges.checkUncleRescued() || Dungeon.isChallenged(Challenges.TEST_TIME)) { - Mob uncles = new UncleS(); - uncles.pos = 43 + WIDTH * 22; - mobs.add(uncles); - - Mob realman = new ARealMan(); - realman.pos = 44 + WIDTH * 45; - mobs.add(realman); - - Mob lyn = new Lyn(); - lyn.pos = 40 + WIDTH * 22; - mobs.add(lyn); - - Mob saidbysun = new SaidbySun(); - saidbysun.pos = 42 + WIDTH * 45;; - mobs.add(saidbysun); - } - - Mob sp931 = new SP931(); - sp931.pos = 40 + WIDTH * 16; - mobs.add(sp931); - - Mob dp = new DreamPlayer(); - dp.pos = 43 + WIDTH * 24; - mobs.add(dp); - - if (Badges.checkEggRescued()|| Dungeon.isChallenged(Challenges.TEST_TIME)){ - Mob lery = new Lery(); - lery.pos = 41 + WIDTH * 9; - mobs.add(lery); - } - Mob evan = new Evan(); - evan.pos = 27 + WIDTH * 31; - mobs.add(evan); - - Mob ice13 = new Ice13(); - ice13.pos = 29 + WIDTH * 32; - mobs.add(ice13); - - Mob hexa = new HeXA(); - hexa.pos = 33 + WIDTH * 30; - mobs.add(hexa); - - if (Badges.checkCoconutRescued()){ - Mob fruitcat = new FruitCat(); - fruitcat.pos = 45 + WIDTH * 2; - mobs.add(fruitcat); - } else { - Mob coconut = new Coconut(); - coconut.pos = 45 + WIDTH * 2; - mobs.add(coconut); - } - - Mob locastan = new Locastan(); - locastan.pos = 5 + WIDTH * 5; - mobs.add(locastan); - - Mob goblin = new GoblinPlayer(); - goblin.pos = 2 + WIDTH * 5; - mobs.add(goblin); - - Mob dachhack = new Dachhack(); - dachhack.pos = 37 + WIDTH * 3; - mobs.add(dachhack); - - if (Badges.checkMOSRescued() || Dungeon.isChallenged(Challenges.TEST_TIME)){ - Mob MOS = new MemoryOfSand(); - MOS.pos = 26 + WIDTH * 4; - mobs.add(MOS); - - Mob Afly = new AFly(); - Afly.pos = 27 + WIDTH * 17; - mobs.add(Afly); - - - } - - Mob ONS = new OldNewStwist(); - ONS.pos = 20 + WIDTH * 3; - mobs.add(ONS); - - Mob HS = new HateSokoban(); - HS.pos = 23 + WIDTH * 10; - mobs.add(HS); - - Mob LJ = new LaJi(); - LJ.pos = 23 + WIDTH * 12; - mobs.add(LJ); - - if (Badges.checkSARRescued()|| Dungeon.isChallenged(Challenges.TEST_TIME)){ - Mob SAR = new StormAndRain(); - SAR.pos = 21 + WIDTH * 6; - mobs.add(SAR); - } - - if (Dungeon.dewNorn == true || Dungeon.isChallenged(Challenges.TEST_TIME)) { - Mob LYNN = new Lynn(); - LYNN.pos = 31 + WIDTH * 32; - mobs.add(LYNN); - } - - Mob REN = new RENnpc(); - REN.pos = 28 + WIDTH * 27; - mobs.add(REN); - - Mob KOSTIS = new Kostis12345(); - KOSTIS.pos = 20 + WIDTH * 25; - mobs.add(KOSTIS); - - Mob apos = new Apostle(); - apos.pos = 20 + WIDTH * 21; - mobs.add(apos); - - Mob painter = new NutPainter(); - painter.pos = 16 + WIDTH * 21; - mobs.add(painter); - - Mob JUH = new Juh9870(); - JUH.pos = 35 + WIDTH * 6; - mobs.add(JUH); - - Mob SADS = new SadSaltan(); - SADS.pos = 42 + WIDTH * 38; - mobs.add(SADS); - - Mob tinkerer4 = new Tinkerer4(); - tinkerer4.pos = 31 + WIDTH * 20; - mobs.add(tinkerer4); - - Mob shower = new Shower(); - shower.pos = 30 + WIDTH * 19; - mobs.add(shower); - - Mob tinkerer5 = new Tinkerer5(); - tinkerer5.pos = 14 + WIDTH * 33; - mobs.add(tinkerer5); - - AdultDragonViolet mob3 = new AdultDragonViolet(); - mob3.pos = 5 + WIDTH * 43; - mobs.add(mob3); - - /*SandMob test = new SandMob(); - test.pos = 14 + WIDTH * 32; - mobs.add(test);*/ - - /*Guard test2 = new Guard(); - test2.pos = 14 + WIDTH * 31; - mobs.add(test2);*/ - - /*TrollWarrior test3 = new TrollWarrior(); - test3.pos = 14 + WIDTH * 30; - mobs.add(test3);*/ - if (Badges.checkRainRescued() || Dungeon.isChallenged(Challenges.TEST_TIME)) { - TestMob test4 = new TestMob(); - test4.pos = 18 + WIDTH * 44; - mobs.add(test4); - - RainTrainer rain = new RainTrainer(); - rain.pos = 17 + WIDTH * 42; - mobs.add(rain); - - Mob rustyblade = new Rustyblade(); - rustyblade.pos = 22 + WIDTH * 42; - mobs.add(rustyblade); - - Mob tempest102 = new Tempest102(); - tempest102.pos = 33 + WIDTH * 42; - mobs.add(tempest102); - } - - TestMob2 test5 = new TestMob2(); - test5.pos = 21 + WIDTH * 44; - mobs.add(test5); - - /*Assassin test5 = new Assassin(); - test5.pos = 14 + WIDTH * 28; - mobs.add(test5);*/ - - if (Badges.checkFishRescued() || Dungeon.isChallenged(Challenges.TEST_TIME)){ - Piranha mob4 = new Piranha(); - mob4.pos = 42 + WIDTH * 37; - mobs.add(mob4); - Piranha mob5 = new Piranha(); - mob5.pos = 42 + WIDTH * 36; - mobs.add(mob5); - Mob alivefish = new AliveFish(); - alivefish.pos = 42 + WIDTH * 9; - mobs.add(alivefish); - } - - /*Golem mob6 = new Golem(); - mob6.pos = 42 + WIDTH * 36; - mobs.add(mob6);*/ - - scrollspots = new int[11]; - scrollspots[0] = 4 + WIDTH * 27; - scrollspots[1] = 4 + WIDTH * 26; - scrollspots[2] = 4 + WIDTH * 25; - scrollspots[3] = 4 + WIDTH * 24; - scrollspots[4] = 4 + WIDTH * 23; - scrollspots[5] = 4 + WIDTH * 22; - - scrollspots[6] = 6 + WIDTH * 25; - scrollspots[7] = 7 + WIDTH * 25; - scrollspots[8] = 8 + WIDTH * 25; - scrollspots[9] = 9 + WIDTH * 25; - scrollspots[10] = 10 + WIDTH * 25; - - storespots = new int[9]; - storespots[0] = 7 + WIDTH * 10; - storespots[1] = 7 + WIDTH * 9; - storespots[2] = 7 + WIDTH * 8; - storespots[3] = 7 + WIDTH * 7; - - storespots[4] = 12 + WIDTH * 13; - storespots[5] = 12 + WIDTH * 12; - storespots[6] = 12 + WIDTH * 11; - storespots[7] = 12 + WIDTH * 10; - storespots[8] = 12 + WIDTH * 9; - - bombpots = new int[8]; - bombpots[0] = 45 + WIDTH * 1; - bombpots[1] = 45 + WIDTH * 3; - bombpots[2] = 44 + WIDTH * 1; - bombpots[3] = 44 + WIDTH * 2; - - bombpots[4] = 44 + WIDTH * 3; - bombpots[5] = 46 + WIDTH * 1; - bombpots[6] = 46 + WIDTH * 2; - bombpots[7] = 46 + WIDTH * 3; - - foodpots = new int[4]; - foodpots[0] = 24 + WIDTH * 6; - foodpots[1] = 25 + WIDTH * 6; - foodpots[2] = 26 + WIDTH * 6; - foodpots[3] = 27 + WIDTH * 6; - - sppots = new int[1]; - sppots[0] = 20 + WIDTH * 6; - - eggpots = new int[1]; - eggpots[0] = 41 + WIDTH * 10; - - gnollpots = new int[1]; - gnollpots[0] = 21 + WIDTH * 3; - - skillpots = new int[3]; - skillpots[0] = 33 + WIDTH * 44; - skillpots[1] = 34 + WIDTH * 44; - skillpots[2] = 35 + WIDTH * 44; - - pillpots = new int[1]; - pillpots[0] = 43 + WIDTH * 23; - - storeStock(); - if (Dungeon.dewNorn == true) { - Alter alter = new Alter(); - alter.seed(33 + WIDTH * 32, 1); - blobs.put(Alter.class, alter); - } - - addChest(39 + WIDTH * 4); - addChest(40 + WIDTH * 4); - addChest(41 + WIDTH * 4); - addChest(42 + WIDTH * 4); - - if(Badges.checkTombRescued()){ - addChest(41 + WIDTH * 18); - addChest(42 + WIDTH * 18); - } - - addChest(7 + WIDTH * 5); - addChest(8 + WIDTH * 5); - addChest(9 + WIDTH * 5); - - if(Badges.checkFishRescued()){ - addChest(27 + WIDTH * 11); - addChest(27 + WIDTH * 12); - } - - if(Badges.checkTombRescued()){ - addTomb(41 + WIDTH * 41); - } - } - - private void addChest(int pos) { - - Item prize; - switch (Random.Int(10)) { - case 0: - prize = Generator.random(Generator.Category.BERRY); - break; - case 1: - prize = new Starflower.Seed(); - break; - default: - prize = new DarkGold(); - break; - } - - drop(prize, pos).type = Heap.Type.CHEST; - } - - private void addTomb(int pos) { - - Item prize; - switch (Random.Int(10)) { - case 0: - prize = new Phaseshift.Seed(); - break; - case 1: - prize = Generator.random(Generator.Category.MUSHROOM); - break; - default: - prize = new DarkGold(); - break; - } - - drop(prize, pos).type = Heap.Type.TOMB; - } - - @Override - public void press(int cell, Char ch) { - - if(!special){ - storeStock(); - special=true; - } - - if (pit[cell] && ch == Dungeon.hero) { - Chasm.heroFall(cell); - return; - } - - TimekeepersHourglass.timeFreeze timeFreeze = null; - - if (ch != null) - timeFreeze = ch.buff(TimekeepersHourglass.timeFreeze.class); - - boolean trap = false; - boolean interrupt = false; - - - - switch (map[cell]) { - - - case Terrain.HIGH_GRASS: - HighGrass.trample(this, cell, ch); - break; - - case Terrain.WELL: - WellWater.affectCell(cell); - break; - - case Terrain.ALCHEMY: - Alchemy alchemy = new Alchemy(); - level.blobs.put( Alchemy.class, alchemy ); - break; - - case Terrain.PEDESTAL: - if (ch == null ) { - Alter.transmute(cell); - } - break; - - /*case Terrain.BED: - if(ch == null){ - BedLight.transmute(cell); - } - break;*/ - - case Terrain.DOOR: - Door.enter(cell); - break; - } - - if (trap){ - - if (Dungeon.visible[cell]) - Sample.INSTANCE.play(Assets.SND_TRAP); - - if (ch == Dungeon.hero) - Dungeon.hero.interrupt(); - - set(cell, Terrain.INACTIVE_TRAP); - GameScene.updateMap(cell); - } - - if (interrupt){ - - Dungeon.hero.interrupt(); - GameScene.updateMap(cell); - } - - Plant plant = plants.get(cell); - if (plant != null) { - plant.activate(ch); - } - } - - @Override - public String tilesTex() { - return Assets.TILES_TOWN; - } - - @Override - public String waterTex() { - return Assets.WATER_PRISON; - } - - @Override - protected boolean build() { - - map = TownLayouts.TOWN_LAYOUT.clone(); - decorate(); - - buildFlagMaps(); - cleanWalls(); - - entrance = 25 + WIDTH * 21; - exit = 5 + WIDTH * 40; - - - return true; - } - @Override - protected void decorate() { - - } - - @Override - protected void createMobs() { - - } - @Override - public String tileName( int tile ) { - switch (tile) { - case Terrain.WATER: - return Messages.get(PrisonLevel.class, "water_name"); - default: - return super.tileName( tile ); - } - } - - @Override - public String tileDesc(int tile) { - switch (tile) { - case Terrain.EMPTY_DECO: - return Messages.get(PrisonLevel.class, "empty_deco_desc"); - case Terrain.BOOKSHELF: - return Messages.get(PrisonLevel.class, "bookshelf_desc"); - default: - return super.tileDesc( tile ); - } - } - - @Override - public int randomRespawnCell() { - return -1; - } - -} diff --git a/java/com/hmdzl/spspd/change/levels/VaultLevel.java b/java/com/hmdzl/spspd/change/levels/VaultLevel.java deleted file mode 100644 index f43ed219..00000000 --- a/java/com/hmdzl/spspd/change/levels/VaultLevel.java +++ /dev/null @@ -1,249 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.Statistics; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.mobs.Bestiary; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.items.Gold; -import com.hmdzl.spspd.change.levels.painters.Painter; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.watabou.noosa.Scene; -import com.watabou.utils.Random; - -public class VaultLevel extends Level { - - { - color1 = 0x4b6636; - color2 = 0xf2f2f2; - cleared=true; - - } - - private static final int ROOM_LEFT = getWidth() / 2 - 2; - private static final int ROOM_RIGHT = getWidth() / 2 + 2; - private static final int ROOM_TOP = HEIGHT / 2 - 2; - private static final int ROOM_BOTTOM = HEIGHT / 2 + 2; - - protected static final float TIME_TO_RESPAWN = 20; - protected static final int REGROW_TIMER = 4; - @Override - public String tilesTex() { - return Assets.TILES_VAULT; - } - - @Override - public String waterTex() { - return Assets.WATER_CITY; - } - - - - @Override - protected boolean build() { - - int topMost = Integer.MAX_VALUE; - - for (int i = 0; i < 8; i++) { - int left, right, top, bottom; - if (Random.Int(2) == 0) { - left = Random.Int(1, ROOM_LEFT - 3); - right = ROOM_RIGHT + 3; - } else { - left = ROOM_LEFT - 3; - right = Random.Int(ROOM_RIGHT + 3, getWidth() - 1); - } - if (Random.Int(2) == 0) { - top = Random.Int(2, ROOM_TOP - 3); - bottom = ROOM_BOTTOM + 3; - } else { - top = ROOM_LEFT - 3; - bottom = Random.Int(ROOM_TOP + 3, HEIGHT - 1); - } - - Painter.fill(this, left, top, right - left + 1, bottom - top + 1, - Terrain.EMPTY); - - if (top < topMost) { - topMost = top; - exit = Random.Int(left, right) + (top - 1) * getWidth(); - } - } - - map[exit] = Terrain.WALL; - - - - Painter.fill(this, ROOM_LEFT, ROOM_TOP + 1, ROOM_RIGHT - ROOM_LEFT + 1, - ROOM_BOTTOM - ROOM_TOP, Terrain.EMPTY); - - - entrance = Random.Int(ROOM_LEFT + 1, ROOM_RIGHT - 1) - + Random.Int(ROOM_TOP + 1, ROOM_BOTTOM - 1) * getWidth(); - map[entrance] = Terrain.EMPTY; - - return true; - } - - @Override - protected void decorate() { - - for (int i = getWidth() + 1; i < getLength() - getWidth(); i++) { - if (map[i] == Terrain.EMPTY) { - int n = 0; - if (map[i + 1] == Terrain.WALL) { - n++; - } - if (map[i - 1] == Terrain.WALL) { - n++; - } - if (map[i + getWidth()] == Terrain.WALL) { - n++; - } - if (map[i - getWidth()] == Terrain.WALL) { - n++; - } - if (Random.Int(8) <= n) { - map[i] = Terrain.EMPTY_DECO; - } - } - } - - for (int i = 0; i < getLength(); i++) { - if (map[i] == Terrain.WALL && Random.Int(8) == 0) { - map[i] = Terrain.WALL_DECO; - } - if (map[i]==Terrain.ENTRANCE){map[i] = Terrain.EMPTY;} - if (map[i]==Terrain.EMPTY && heaps.get(i) == null && Random.Float()<.15){map[i] = Terrain.STATUE;} - if (map[i]==Terrain.EMPTY && heaps.get(i) == null && Random.Float()<.10){map[i] = Terrain.HIGH_GRASS;} - if (map[i]==Terrain.EMPTY && heaps.get(i) == null && Random.Float()<.10){map[i] = Terrain.GRASS;} - } - - } - - //@Override - //protected void createMobs() { - //} - - //@Override - //public Actor respawner() { - // return null; - //} - - @Override - protected void createItems() { - - for (int i = 0; i < 50; i++) { - int pos = randomDestination(); - drop(new Gold(Random.Int(100,300)), pos); - } - - } - - - - //@Override - //public int randomRespawnCell() { - // return -1; - //} - - - - - @Override - public String tileName(int tile) { - switch (tile) { - case Terrain.WATER: - return "Suspiciously colored water"; - case Terrain.HIGH_GRASS: - return "Flowers with little gem-shaped leaves"; - default: - return super.tileName(tile); - } - } - - @Override - public String tileDesc(int tile) { - switch (tile) { - case Terrain.ENTRANCE: - return "A ramp leads up to the upper depth."; - case Terrain.EXIT: - return "A ramp leads down to the lower depth."; - case Terrain.WALL_DECO: - case Terrain.EMPTY_DECO: - return "Rough-hewn gold ore adorns the dungeon."; - case Terrain.EMPTY_SP: - return "Thick carpet covers the floor."; - case Terrain.STATUE: - case Terrain.STATUE_SP: - return "The statue is made of solid gold."; - case Terrain.BOOKSHELF: - return "The rows of books on different disciplines fill the bookshelf."; - default: - return super.tileDesc(tile); - } - } - - - @Override - public void addVisuals(Scene scene) { - CavesLevel.addVisuals(this, scene); - } - @Override - public int nMobs() { - return 16; - } - - @Override - protected void createMobs() { - int nMobs = nMobs(); - for (int i = 0; i < nMobs; i++) { - Mob mob = Bestiary.mob(Dungeon.depth); - do { - mob.pos = randomRespawnCellMob(); - } while (mob.pos == -1); - mobs.add(mob); - Actor.occupyCell(mob); - } - } - - @Override - public Actor respawner() { - return new Actor() { - @Override - protected boolean act() { - if (mobs.size() < nMobs()) { - - Mob mob = Bestiary.mutable(Dungeon.depth); - mob.state = mob.WANDERING; - mob.pos = randomRespawnCellMob(); - if (Dungeon.hero.isAlive() && mob.pos != -1) { - GameScene.add(mob); - } - } - spend(Dungeon.level.feeling == Feeling.DARK - || Statistics.amuletObtained ? TIME_TO_RESPAWN / 2 - : TIME_TO_RESPAWN); - return true; - } - }; - } -} diff --git a/java/com/hmdzl/spspd/change/levels/ZotBossLevel.java b/java/com/hmdzl/spspd/change/levels/ZotBossLevel.java deleted file mode 100644 index 6315186c..00000000 --- a/java/com/hmdzl/spspd/change/levels/ZotBossLevel.java +++ /dev/null @@ -1,276 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.Statistics; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.mobs.Bestiary; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.actors.mobs.ShadowYog; -import com.hmdzl.spspd.change.actors.mobs.Zot; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.levels.painters.Painter; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.Camera; -import com.watabou.noosa.Scene; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -public class ZotBossLevel extends Level { - - { - color1 = 0x534f3e; - color2 = 0xb9d661; - cleared=true; - viewDistance = 6; - } - - private static final int ROOM_LEFT = getWidth() / 2 - 2; - private static final int ROOM_RIGHT = getWidth() / 2 + 2; - private static final int ROOM_TOP = HEIGHT / 2 - 2; - private static final int ROOM_BOTTOM = HEIGHT / 2 + 2; - - private int arenaDoor; - private boolean enteredArena = false; - private boolean keyDropped = false; - - @Override - public String tilesTex() { - return Assets.TILES_SEAL; - } - - @Override - public String waterTex() { - return Assets.WATER_CITY; - } - - - private static final String DOOR = "door"; - private static final String ENTERED = "entered"; - private static final String DROPPED = "droppped"; - - protected static final float TIME_TO_RESPAWN = 20; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(DOOR, arenaDoor); - bundle.put(ENTERED, enteredArena); - bundle.put(DROPPED, keyDropped); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - arenaDoor = bundle.getInt(DOOR); - enteredArena = bundle.getBoolean(ENTERED); - keyDropped = bundle.getBoolean(DROPPED); - } - - @Override - protected boolean build() { - - int topMost = Integer.MAX_VALUE; - - for (int i = 0; i < 8; i++) { - int left, right, top, bottom; - if (Random.Int(2) == 0) { - left = Random.Int(1, ROOM_LEFT - 3); - right = ROOM_RIGHT + 3; - } else { - left = ROOM_LEFT - 3; - right = Random.Int(ROOM_RIGHT + 3, getWidth() - 1); - } - if (Random.Int(2) == 0) { - top = Random.Int(2, ROOM_TOP - 3); - bottom = ROOM_BOTTOM + 3; - } else { - top = ROOM_LEFT - 3; - bottom = Random.Int(ROOM_TOP + 3, HEIGHT - 1); - } - - Painter.fill(this, left, top, right - left + 1, bottom - top + 1, - Terrain.EMPTY); - - if (top < topMost) { - topMost = top; - exit = Random.Int(left, right) + (top - 1) * getWidth(); - } - } - - map[exit] = Terrain.WALL; - - Painter.fill(this, ROOM_LEFT - 1, ROOM_TOP - 1, ROOM_RIGHT - ROOM_LEFT - + 3, ROOM_BOTTOM - ROOM_TOP + 3, Terrain.WALL); - Painter.fill(this, ROOM_LEFT, ROOM_TOP + 1, ROOM_RIGHT - ROOM_LEFT + 1, - ROOM_BOTTOM - ROOM_TOP, Terrain.EMPTY); - - Painter.fill(this, ROOM_LEFT, ROOM_TOP, ROOM_RIGHT - ROOM_LEFT + 1, 1, - Terrain.TRAP); - - arenaDoor = Random.Int(ROOM_LEFT, ROOM_RIGHT) + (ROOM_BOTTOM + 1) - * getWidth(); - map[arenaDoor] = Terrain.DOOR; - - entrance = Random.Int(ROOM_LEFT + 1, ROOM_RIGHT - 1) - + Random.Int(ROOM_TOP + 1, ROOM_BOTTOM - 1) * getWidth(); - map[entrance] = Terrain.ENTRANCE; - - return true; - } - - @Override - protected void decorate() { - - for (int i = getWidth() + 1; i < getLength() - getWidth(); i++) { - if (map[i] == Terrain.EMPTY) { - int n = 0; - if (map[i + 1] == Terrain.WALL) { - n++; - } - if (map[i - 1] == Terrain.WALL) { - n++; - } - if (map[i + getWidth()] == Terrain.WALL) { - n++; - } - if (map[i - getWidth()] == Terrain.WALL) { - n++; - } - if (Random.Int(8) <= n) { - map[i] = Terrain.EMPTY_DECO; - } - } - } - - for (int i = 0; i < getLength(); i++) { - - if (map[i]==Terrain.ENTRANCE){map[i] = Terrain.PEDESTAL;} - } - - locked=true; - - } - - //@Override - //protected void createMobs() { - //} - - //@Override - //public Actor respawner() { - // return null; - //} - - @Override - protected void createItems() { - } - - //@Override - //public int randomRespawnCell() { - // return -1; - //} - - @Override - public void press(int cell, Char hero) { - - super.press(cell, hero); - - if (!enteredArena && outsideEntraceRoom(cell) && hero == Dungeon.hero) { - - enteredArena = true; - //locked = true; - - Zot boss = new Zot(); - boss.state = boss.HUNTING; - do { - boss.pos = Random.Int(getLength()); - } while (!passable[boss.pos] || !outsideEntraceRoom(boss.pos) - || Dungeon.visible[boss.pos]); - GameScene.add(boss); - GLog.n("..."); - - - //set(arenaDoor, Terrain.WALL); - GameScene.updateMap(arenaDoor); - Dungeon.observe(); - - CellEmitter.get(arenaDoor).start(Speck.factory(Speck.ROCK), 0.07f, 10); - Camera.main.shake(3, 0.7f); - Sample.INSTANCE.play(Assets.SND_ROCKS); - } - } - - - private boolean outsideEntraceRoom(int cell) { - int cx = cell % getWidth(); - int cy = cell / getWidth(); - return cx < ROOM_LEFT - 1 || cx > ROOM_RIGHT + 1 || cy < ROOM_TOP - 1 - || cy > ROOM_BOTTOM + 1; - } - - @Override - public String tileName(int tile) { - switch (tile) { - case Terrain.WATER: - return Messages.get(BossRushLevel.class, "water_name"); - case Terrain.GRASS: - return Messages.get(BossRushLevel.class, "grass_name"); - case Terrain.HIGH_GRASS: - return Messages.get(BossRushLevel.class, "high_grass_name"); - case Terrain.STATUE: - case Terrain.STATUE_SP: - return Messages.get(BossRushLevel.class, "statue_sp_name"); - default: - return super.tileName(tile); - } - } - - @Override - public String tileDesc(int tile) { - switch (tile) { - case Terrain.WATER: - return Messages.get(BossRushLevel.class, "water_desc"); - case Terrain.STATUE: - case Terrain.STATUE_SP: - return Messages.get(BossRushLevel.class, "statue_sp_desc"); - default: - return super.tileDesc(tile); - } - } - - @Override - public void addVisuals(Scene scene) { - CavesLevel.addVisuals(this, scene); - } - @Override - public int nMobs() { - return 0; - } - - @Override - protected void createMobs() { } - - -} diff --git a/java/com/hmdzl/spspd/change/levels/features/AlchemyPot.java b/java/com/hmdzl/spspd/change/levels/features/AlchemyPot.java deleted file mode 100644 index 37b775b3..00000000 --- a/java/com/hmdzl/spspd/change/levels/features/AlchemyPot.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels.features; - -import com.hmdzl.spspd.change.Journal; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.windows.WndAlchemy; - -public class AlchemyPot { - - public static void cook(int pos) { - GameScene.show(new WndAlchemy()); - } - - /*private static final String TXT_SELECT_SEED = "Select a seed to throw"; - private static final String TXT_POT = "Alchemy Pot"; - private static final String TXT_FRUIT = "Cook a Blandfruit"; - private static final String TXT_POTION = "Brew a Potion"; - private static final String TXT_OPTIONS = "Do you want to cook a Blandfruit with a seed, or brew a Potion from seeds?"; - - public static Hero hero; - public static int pos; - - public static boolean foundFruit; - public static Item curItem = null; - - public static void operate(Hero hero, int pos) { - - AlchemyPot.hero = hero; - AlchemyPot.pos = pos; - - Iterator items = hero.belongings.iterator(); - foundFruit = false; - Heap heap = Dungeon.level.heaps.get(pos); - - if (heap == null) - while (items.hasNext() && !foundFruit) { - curItem = items.next(); - if (curItem instanceof Blandfruit - && ((Blandfruit) curItem).potionAttrib == null) { - GameScene.show(new WndOptions(Messages.get(AlchemyPot.class, "pot"), - Messages.get(AlchemyPot.class, "options"), - Messages.get(AlchemyPot.class, "fruit"), - Messages.get(AlchemyPot.class, "potion")) { - @Override - protected void onSelect(int index) { - if (index == 0) { - curItem.cast(AlchemyPot.hero, AlchemyPot.pos); - } else - GameScene.selectItem(itemSelector, - WndBag.Mode.SEED, Messages.get(AlchemyPot.class, "select_seed")); - } - }); - foundFruit = true; - } - } - - if (!foundFruit) - GameScene.selectItem(itemSelector, WndBag.Mode.SEED, - Messages.get(AlchemyPot.class, "select_seed")); - } - - private static final WndBag.Listener itemSelector = new WndBag.Listener() { - @Override - public void onSelect(Item item) { - if (item != null) { - item.cast(hero, pos); - } - } - };*/ -} diff --git a/java/com/hmdzl/spspd/change/levels/features/Chasm.java b/java/com/hmdzl/spspd/change/levels/features/Chasm.java deleted file mode 100644 index 53b8c40a..00000000 --- a/java/com/hmdzl/spspd/change/levels/features/Chasm.java +++ /dev/null @@ -1,126 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels.features; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.ResultDescriptions; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Cripple; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.actors.mobs.pets.PET; -import com.hmdzl.spspd.change.items.Heap; -import com.hmdzl.spspd.change.items.TriforceOfWisdom; -import com.hmdzl.spspd.change.items.artifacts.DriedRose; -import com.hmdzl.spspd.change.items.artifacts.TimekeepersHourglass; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.RegularLevel; -import com.hmdzl.spspd.change.levels.Room; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.scenes.InterlevelScene; -import com.hmdzl.spspd.change.sprites.MobSprite; -import com.hmdzl.spspd.change.utils.GLog; -import com.hmdzl.spspd.change.windows.WndOptions; -import com.watabou.noosa.Camera; -import com.watabou.noosa.Game; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Random; - -public class Chasm { - - private static final String TXT_CHASM = "Chasm"; - private static final String TXT_YES = "Yes, I know what I'm doing"; - private static final String TXT_NO = "No, I changed my mind"; - private static final String TXT_JUMP = "Do you really want to jump into the chasm? You can probably die."; - - public static boolean jumpConfirmed = false; - - public static void heroJump(final Hero hero) { - GameScene.show(new WndOptions(Messages.get(Chasm.class, "chasm"), - Messages.get(Chasm.class, "jump"), - Messages.get(Chasm.class, "yes"), - Messages.get(Chasm.class, "no") ) { - @Override - protected void onSelect(int index) { - if (index == 0) { - jumpConfirmed = true; - hero.resume(); - } - }; - }); - } - - - - public static void heroFall(int pos) { - - jumpConfirmed = false; - - Sample.INSTANCE.play(Assets.SND_FALLING); - - Buff buff = Dungeon.hero.buff(TimekeepersHourglass.timeFreeze.class); - if (buff != null) - buff.detach(); - - if (Dungeon.hero.isAlive()) { - Dungeon.hero.interrupt(); - InterlevelScene.mode = InterlevelScene.Mode.FALL; - if (Dungeon.level instanceof RegularLevel) { - Room room = ((RegularLevel) Dungeon.level).room(pos); - InterlevelScene.fallIntoPit = room != null - && room.type == Room.Type.WEAK_FLOOR; - } else { - InterlevelScene.fallIntoPit = false; - } - Game.switchScene(InterlevelScene.class); - } else { - Dungeon.hero.sprite.visible = false; - } - } - - - public static void heroLand() { - - Hero hero = Dungeon.hero; - - hero.sprite.burst(hero.sprite.blood(), 10); - Camera.main.shake(4, 0.2f); - - Buff.prolong(hero, Cripple.class, Cripple.DURATION); - - - hero.damage(Random.IntRange(hero.HT/3, hero.HT/2), new Hero.Doom() { - @Override - public void onDeath() { - Badges.validateDeathFromFalling(); - - Dungeon.fail(Messages.format(ResultDescriptions.FALL)); - //GLog.n("You fell to death..."); - } - }); - } - - public static void mobFall(Mob mob) { - mob.die(null); - - ((MobSprite) mob.sprite).fall(); - } -} diff --git a/java/com/hmdzl/spspd/change/levels/features/Door.java b/java/com/hmdzl/spspd/change/levels/features/Door.java deleted file mode 100644 index 9ef0e164..00000000 --- a/java/com/hmdzl/spspd/change/levels/features/Door.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels.features; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.Terrain; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.watabou.noosa.audio.Sample; - -public class Door { - - public static void enter(int pos) { - Level.set(pos, Terrain.OPEN_DOOR); - GameScene.updateMap(pos); - Dungeon.observe(); - - if (Dungeon.visible[pos]) { - Sample.INSTANCE.play(Assets.SND_OPEN); - } - } - - public static void leave(int pos) { - if (Dungeon.level.heaps.get(pos) == null) { - Level.set(pos, Terrain.DOOR); - GameScene.updateMap(pos); - Dungeon.observe(); - } - } -} diff --git a/java/com/hmdzl/spspd/change/levels/features/HighGrass.java b/java/com/hmdzl/spspd/change/levels/features/HighGrass.java deleted file mode 100644 index dca2b493..00000000 --- a/java/com/hmdzl/spspd/change/levels/features/HighGrass.java +++ /dev/null @@ -1,116 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels.features; - -import com.hmdzl.spspd.change.Challenges; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Invisibility; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.hero.HeroSubClass; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.particles.LeafParticle; -import com.hmdzl.spspd.change.items.Dewdrop; -import com.hmdzl.spspd.change.items.Generator; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.RedDewdrop; -import com.hmdzl.spspd.change.items.VioletDewdrop; -import com.hmdzl.spspd.change.items.YellowDewdrop; -import com.hmdzl.spspd.change.items.artifacts.SandalsOfNature; -import com.hmdzl.spspd.change.items.food.Nut; -import com.hmdzl.spspd.change.items.food.vegetable.Vegetable; -import com.hmdzl.spspd.change.items.food.fruit.Blackberry; -import com.hmdzl.spspd.change.items.food.fruit.Blueberry; -import com.hmdzl.spspd.change.items.food.fruit.Cloudberry; -import com.hmdzl.spspd.change.items.food.fruit.Moonberry; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.Terrain; -import com.hmdzl.spspd.change.plants.BlandfruitBush; -import com.hmdzl.spspd.change.plants.Flytrap; -import com.hmdzl.spspd.change.plants.NutPlant; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.watabou.utils.Random; - -public class HighGrass { - - public static void trample(Level level, int pos, Char ch) { - - Level.set(pos, Terrain.GRASS); - GameScene.updateMap(pos); - - //if (!Dungeon.isChallenged(Challenges.NO_HERBALISM)) { - int naturalismLevel = 0; - - if (ch != null) { - SandalsOfNature.Naturalism naturalism = ch - .buff(SandalsOfNature.Naturalism.class); - if (naturalism != null) { - if (!naturalism.isCursed()) { - naturalismLevel = naturalism.level() + 1; - naturalism.charge(); - } else { - naturalismLevel = -1; - } - } - } - - if (naturalismLevel >= 0) { - // Seed - if (Random.Int(20 - ((int) (naturalismLevel * 3.34))) == 0) { - Item seed = Generator.random(Generator.Category.SEED); - level.drop(seed, pos).sprite.drop(); - } - - // Vegetable - //if (Dungeon.growLevel(Dungeon.depth) && Random.Int(40 - ((int) (naturalismLevel * 3.34))) == 0) { - //level.drop(new NutVegetable(), pos).sprite.drop(); - //} - - if (Dungeon.growLevel(Dungeon.depth) && Random.Int(15 - ((int) (naturalismLevel * 3.34))) == 0) { - level.drop(new NutPlant.Seed(), pos).sprite.drop(); - } - - // Dew - if (Random.Int(3 - naturalismLevel) == 0) { - if (Random.Int(30 - naturalismLevel) == 0 && naturalismLevel>0) { - level.drop(new YellowDewdrop(), pos).sprite.drop(); - } else if (Random.Int(50 - naturalismLevel) == 0 && naturalismLevel>2) { - level.drop(new RedDewdrop(), pos).sprite.drop(); - } else if (Random.Int(100 - naturalismLevel) == 0 && naturalismLevel>4){ - level.drop(new VioletDewdrop(), pos).sprite.drop(); - } else { - level.drop(new Dewdrop(), pos).sprite.drop(); - } - } - } - // } - - int leaves = 4; - - // Barkskin - if (ch instanceof Hero && ((Hero) ch).subClass == HeroSubClass.WARDEN) { - //Buff.affect(ch, Barkskin.class).level(ch.HT / 3); - Buff.affect(ch, Invisibility.class,2f); - //leaves = 8; - } - - CellEmitter.get(pos).burst(LeafParticle.LEVEL_SPECIFIC, leaves); - Dungeon.observe(); - } -} diff --git a/java/com/hmdzl/spspd/change/levels/features/Sign.java b/java/com/hmdzl/spspd/change/levels/features/Sign.java deleted file mode 100644 index f614a592..00000000 --- a/java/com/hmdzl/spspd/change/levels/features/Sign.java +++ /dev/null @@ -1,128 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels.features; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.particles.ElmoParticle; -import com.hmdzl.spspd.change.levels.DeadEndLevel; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.Terrain; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.utils.GLog; -import com.hmdzl.spspd.change.windows.WndMessage; -import com.watabou.noosa.audio.Sample; - -public class Sign { - - private static final String TXT_DEAD_END = "What are you doing here?!"; - - private static final String[] TIPS = { - "Almost all equipment has a strength requirement. Don't overestimate your strength, using equipment you can't " - + "handle has big penalties!\n\nRaising your strength is not the only way to access better equipment, " - + "you can also lower equipment strength requirements with Scrolls of Upgrade.\n\n\n" - + "Items found in the dungeon will often be unidentified. Some items will have unknown effects, others " - + "may be upgraded, or degraded and cursed! Unidentified items are unpredictable, so be careful!", - "Charging forward recklessly is a great way to get killed.\n\n" - + "Slowing down a bit to examine enemies and use the environment and items to your advantage can make a" - + " big difference.\n\nThe dungeon is full of traps and hidden passageways as well, keep your eyes open!", - "Levelling up is important!\n\nBeing about the same level as the floor you are on is a good idea. " - + "Hunger may keep you moving in search of more food, but don't be afraid to slow down a little and train." - + "\n\n\nHunger and health are both resources, and using them well can mean starving yourself in order" - + " to help conserve food, if you have some health to spare.", - "The rogue isn't the only character that benefits from being sneaky. You can retreat to the other side of a " - + "door to ambush a chasing opponent for a guaranteed hit!" - + "\n\nAny attack on an unaware opponent is guaranteed to hit them.", - - "Note to all sewer maintenance & cleaning crews: TURN BACK NOW. Some sort of sludge monster has made its home" - + " here and several crews have been lost trying to deal with it.\n\n" - + "Approval has been given to seal off the lower sewers, this area has been condemned, LEAVE NOW.", - - "Pixel-Mart - all you need for successful adventure!", - "Identify your potions and scrolls as soon as possible. Don't put it off to the moment " - + "when you actually need them.", - "Being hungry doesn't hurt, but starving does hurt.", - "Surprise attack has a better chance to hit. For example, you can ambush your enemy behind " - + "a closed door when you know it is approaching.", - - "Don't let The Tengu out!", - - "Pixel-Mart. Spend money. Live longer.", - "When you're attacked by several monsters at the same time, try to retreat behind a door.", - "If you are burning, you can't put out the fire in the water while levitating.", - "There is no sense in possessing more than one unblessed Ankh at the same time, " - + "because you will lose them upon resurrecting.", - - "DANGER! Heavy machinery can cause injury, loss of limbs or death!", - - "Pixel-Mart. A safer life in dungeon.", - "When you upgrade an enchanted weapon, there is a chance to destroy that enchantment.", - "In a Well of Transmutation you can get an item, that cannot be obtained otherwise.", - "The only way to enchant a weapon is by upgrading it with a Scroll of Weapon Upgrade.", - - "No weapons allowed in the presence of His Majesty!", - - "Pixel-Mart. Special prices for demon hunters!", - - // hmm.. I wonder what this is? - "standOfF roW", "fraCtion doWnpOur", "gaffe MaSts" }; - - - private static final String PIT = "Note to self: Always leave a teleport scroll in the vault."; - //private static final String BOOKLVL = "Note to self: Always leave a teleport scroll in the vault."; - - - private static final String TXT_BURN = "As you try to read the sign it bursts into greenish flames."; - - public static void read(int pos) { - - if (Dungeon.level instanceof DeadEndLevel) { - - GameScene.show(new WndMessage(Messages.get(Sign.class, "dead_end"))); - - } else { - - int index = Dungeon.depth - 1; - - if (index < TIPS.length) { - GameScene.show(new WndMessage(Messages.get(Sign.class, "tip_"+Dungeon.depth))); - - if (index >= 21) { - - Level.set(pos, Terrain.EMBERS); - GameScene.updateMap(pos); - GameScene.discoverTile(pos, Terrain.SIGN); - - GLog.w(Messages.get(Sign.class, "burn")); - - CellEmitter.get(pos).burst(ElmoParticle.FACTORY, 6); - Sample.INSTANCE.play(Assets.SND_BURNING); - } - - } - } - } - - public static void readPit(int pos) { - GameScene.show(new WndMessage(Messages.get(Sign.class,"pit_message"))); - } - - -} diff --git a/java/com/hmdzl/spspd/change/levels/painters/ArmoryPainter.java b/java/com/hmdzl/spspd/change/levels/painters/ArmoryPainter.java deleted file mode 100644 index a39d6e5f..00000000 --- a/java/com/hmdzl/spspd/change/levels/painters/ArmoryPainter.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels.painters; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.items.bombs.Bomb; -import com.hmdzl.spspd.change.items.Generator; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.keys.IronKey; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.Room; -import com.hmdzl.spspd.change.levels.Terrain; -import com.watabou.utils.Point; -import com.watabou.utils.Random; - -public class ArmoryPainter extends Painter { - - public static void paint(Level level, Room room) { - - fill(level, room, Terrain.WALL); - fill(level, room, 1, Terrain.EMPTY); - - Room.Door entrance = room.entrance(); - Point statue = null; - if (entrance.x == room.left) { - statue = new Point(room.right - 1, - Random.Int(2) == 0 ? room.top + 1 : room.bottom - 1); - } else if (entrance.x == room.right) { - statue = new Point(room.left + 1, Random.Int(2) == 0 ? room.top + 1 - : room.bottom - 1); - } else if (entrance.y == room.top) { - statue = new Point(Random.Int(2) == 0 ? room.left + 1 - : room.right - 1, room.bottom - 1); - } else if (entrance.y == room.bottom) { - statue = new Point(Random.Int(2) == 0 ? room.left + 1 - : room.right - 1, room.top + 1); - } - if (statue != null) { - set(level, statue, Terrain.STATUE); - } - - int n = Random.IntRange(2, 3); - for (int i = 0; i < n; i++) { - int pos; - do { - pos = room.random(); - } while (level.map[pos] != Terrain.EMPTY - || level.heaps.get(pos) != null); - level.drop(prize(level), pos); - } - - entrance.set(Room.Door.Type.LOCKED); - level.addItemToSpawn(new IronKey(Dungeon.depth)); - } - - private static Item prize(Level level) { - return Random.Int(6) == 0 ? new Bomb().random() : Generator - .random(Random.oneOf(Generator.Category.ARMOR, - Generator.Category.WEAPON)); - } -} diff --git a/java/com/hmdzl/spspd/change/levels/painters/BarricadedPainter.java b/java/com/hmdzl/spspd/change/levels/painters/BarricadedPainter.java deleted file mode 100644 index 8ed061c8..00000000 --- a/java/com/hmdzl/spspd/change/levels/painters/BarricadedPainter.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * Yet Another Pixel Dungeon - * Copyright (C) 2015-2016 Considered Hamster - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels.painters; - -import com.watabou.utils.Random; -import com.hmdzl.spspd.change.items.Generator; -import com.hmdzl.spspd.change.items.Heap; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.potions.PotionOfLiquidFlame; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.Room; -import com.hmdzl.spspd.change.levels.Terrain; - -public class BarricadedPainter extends Painter { - - public static void paint( Level level, Room room ) { - - final int floor = Terrain.EMPTY_SP; - - fill( level, room, Terrain.WALL ); - fill( level, room, 1, floor ); - - if (room.width() > room.height()) { - for (int i=room.left + 2; i < room.right; i += 2) { - fill( level, i, room.top + 2, 1, room.height() - 3, Terrain.BOOKSHELF ); - } - } else { - for (int i=room.top + 2; i < room.bottom; i += 2) { - fill( level, room.left + 2, i, room.width() - 3, 1, Terrain.BOOKSHELF); - } - } - - int n = 2 + Random.Int( 0,2 ); - for (int i=0; i < n; i++) { - int pos; - do { - pos = room.random(); - } while (level.map[pos] != floor); - level.drop( prize( level ), pos ).type = Heap.Type.SKELETON; - } - - room.entrance().set( Room.Door.Type.BARRICADE ); - level.addItemToSpawn( new PotionOfLiquidFlame() ); - } - - private static Item prize( Level level ) { - - Item prize = Generator.random(); - - if (prize != null) { - return prize; - } - - return Generator.random( Random.oneOf( - Generator.Category.POTION, - Generator.Category.SCROLL, - Generator.Category.GOLD, - Generator.Category.NORNSTONE - ) ); - } -} diff --git a/java/com/hmdzl/spspd/change/levels/painters/BlacksmithPainter.java b/java/com/hmdzl/spspd/change/levels/painters/BlacksmithPainter.java deleted file mode 100644 index a364009e..00000000 --- a/java/com/hmdzl/spspd/change/levels/painters/BlacksmithPainter.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels.painters; - -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.mobs.npcs.Blacksmith; -import com.hmdzl.spspd.change.actors.mobs.npcs.Blacksmith2; -import com.hmdzl.spspd.change.items.Generator; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.Room; -import com.hmdzl.spspd.change.levels.Terrain; -import com.hmdzl.spspd.change.levels.traps.FireTrap; -import com.watabou.utils.Random; - -public class BlacksmithPainter extends Painter { - - public static void paint(Level level, Room room) { - - fill(level, room, Terrain.WALL); - fill(level, room, 1, Terrain.TRAP); - fill(level, room, 2, Terrain.EMPTY_SP); - - - for (int i = 0; i < 2; i++) { - int pos; - do { - pos = room.random(); - } while (level.map[pos] != Terrain.EMPTY_SP); - level.drop(Generator.random(Random.oneOf(Generator.Category.ARMOR, - Generator.Category.WEAPON)), pos); - } - - - for (Room.Door door : room.connected.values()) { - door.set(Room.Door.Type.UNLOCKED); - drawInside(level, room, door, 1, Terrain.EMPTY); - } - - Blacksmith npc = new Blacksmith(); - do { - npc.pos = room.random(1); - } while (level.heaps.get(npc.pos) != null); - level.mobs.add(npc); - Actor.occupyCell(npc); - - - Blacksmith2 npc2 = new Blacksmith2(); - do { - npc2.pos = room.random(1); - } while (level.heaps.get(npc2.pos) != null || Actor.findChar(npc2.pos) != null); - level.mobs.add(npc2); - Actor.occupyCell(npc2); - - for(int cell : room.getCells()) { - if (level.map[cell] == Terrain.TRAP){ - level.setTrap(new FireTrap().reveal(), cell); - } - } - } -} diff --git a/java/com/hmdzl/spspd/change/levels/painters/BossExitPainter.java b/java/com/hmdzl/spspd/change/levels/painters/BossExitPainter.java deleted file mode 100644 index e5a614c0..00000000 --- a/java/com/hmdzl/spspd/change/levels/painters/BossExitPainter.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels.painters; - -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.Room; -import com.hmdzl.spspd.change.levels.Terrain; - -public class BossExitPainter extends Painter { - - public static void paint(Level level, Room room) { - - fill(level, room, Terrain.WALL); - fill(level, room, 1, Terrain.EMPTY); - - for (Room.Door door : room.connected.values()) { - door.set(Room.Door.Type.REGULAR); - } - - level.exit = room.top * Level.getWidth() + (room.left + room.right) / 2; - set(level, level.exit, Terrain.LOCKED_EXIT); - } - -} diff --git a/java/com/hmdzl/spspd/change/levels/painters/CryptPainter.java b/java/com/hmdzl/spspd/change/levels/painters/CryptPainter.java deleted file mode 100644 index 115002e5..00000000 --- a/java/com/hmdzl/spspd/change/levels/painters/CryptPainter.java +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels.painters; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.blobs.Foliage; -import com.hmdzl.spspd.change.actors.blobs.weather.WeatherOfDead; -import com.hmdzl.spspd.change.items.Generator; -import com.hmdzl.spspd.change.items.Heap.Type; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.keys.IronKey; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.Room; -import com.hmdzl.spspd.change.levels.Terrain; -import com.watabou.utils.Point; -import com.watabou.utils.Random; - -public class CryptPainter extends Painter { - - public static void paint(Level level, Room room) { - - fill(level, room, Terrain.WALL); - fill(level, room, 1, Terrain.EMPTY); - - Point c = room.center(); - int cx = c.x; - int cy = c.y; - - Room.Door entrance = room.entrance(); - - entrance.set(Room.Door.Type.LOCKED); - level.addItemToSpawn(new IronKey(Dungeon.depth)); - - if (entrance.x == room.left) { - set(level, new Point(room.right - 1, room.top + 1), Terrain.STATUE); - set(level, new Point(room.right - 1, room.bottom - 1), - Terrain.STATUE); - cx = room.right - 2; - } else if (entrance.x == room.right) { - set(level, new Point(room.left + 1, room.top + 1), Terrain.STATUE); - set(level, new Point(room.left + 1, room.bottom - 1), - Terrain.STATUE); - cx = room.left + 2; - } else if (entrance.y == room.top) { - set(level, new Point(room.left + 1, room.bottom - 1), - Terrain.STATUE); - set(level, new Point(room.right - 1, room.bottom - 1), - Terrain.STATUE); - cy = room.bottom - 2; - } else if (entrance.y == room.bottom) { - set(level, new Point(room.left + 1, room.top + 1), Terrain.STATUE); - set(level, new Point(room.right - 1, room.top + 1), Terrain.STATUE); - cy = room.top + 2; - } - - level.drop(prize(level), cx + cy * Level.getWidth()).type = Type.TOMB; - - if (Random.Int(10) > 5) { - WeatherOfDead light = (WeatherOfDead) level.blobs.get(WeatherOfDead.class); - if (light == null) { - light = new WeatherOfDead(); - } - for (int i = room.top + 1; i < room.bottom; i++) { - for (int j = room.left + 1; j < room.right; j++) { - light.seed(j + Level.getWidth() * i, 1); - } - } - level.blobs.put(WeatherOfDead.class, light); - } - - } - - private static Item prize(Level level) { - - Item prize = Generator.random(Generator.Category.ARMOR); - - for (int i = 0; i < 3; i++) { - Item another = Generator.random(Generator.Category.ARMOR); - if (another.level > prize.level) { - prize = another; - } - } - - return prize; - } -} diff --git a/java/com/hmdzl/spspd/change/levels/painters/EntrancePainter.java b/java/com/hmdzl/spspd/change/levels/painters/EntrancePainter.java deleted file mode 100644 index b4b16ffc..00000000 --- a/java/com/hmdzl/spspd/change/levels/painters/EntrancePainter.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels.painters; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.mobs.GoldCollector; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.Room; -import com.hmdzl.spspd.change.levels.Terrain; - -public class EntrancePainter extends Painter { - - public static void paint(Level level, Room room) { - - fill(level, room, Terrain.WALL); - fill(level, room, 1, Terrain.EMPTY); - - for (Room.Door door : room.connected.values()) { - door.set(Room.Door.Type.REGULAR); - } - - level.entrance = room.random(1); - set(level, level.entrance, Terrain.ENTRANCE); - - if (Dungeon.gold > (2000000/(Math.max(1,20-Dungeon.depth))) && Dungeon.depth < 25){ - GoldCollector gc = new GoldCollector(); - gc.pos = room.random(); - level.mobs.add(gc); - Actor.occupyCell(gc); - } - - } - -} diff --git a/java/com/hmdzl/spspd/change/levels/painters/ExitPainter.java b/java/com/hmdzl/spspd/change/levels/painters/ExitPainter.java deleted file mode 100644 index 17977303..00000000 --- a/java/com/hmdzl/spspd/change/levels/painters/ExitPainter.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels.painters; - -import com.hmdzl.spspd.change.Challenges; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.mobs.GoldCollector; -import com.hmdzl.spspd.change.actors.mobs.LevelChecker; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.Room; -import com.hmdzl.spspd.change.levels.Terrain; - -public class ExitPainter extends Painter { - - public static void paint(Level level, Room room) { - - fill(level, room, Terrain.WALL); - fill(level, room, 1, Terrain.EMPTY); - - for (Room.Door door : room.connected.values()) { - door.set(Room.Door.Type.REGULAR); - } - - if ((Dungeon.hero.lvl > 14 + Dungeon.depth) && Dungeon.depth < 25 && !Dungeon.isChallenged(Challenges.TEST_TIME)){ - LevelChecker lc = new LevelChecker(); - lc.pos = room.random(); - level.mobs.add(lc); - Actor.occupyCell(lc); - } - - level.exit = room.random(1); - if (Dungeon.isChallenged(Challenges.TEST_TIME)) { - set(level, level.exit, Terrain.STATUE); - } else - set(level, level.exit, Terrain.EXIT); - } - -} diff --git a/java/com/hmdzl/spspd/change/levels/painters/GardenPainter.java b/java/com/hmdzl/spspd/change/levels/painters/GardenPainter.java deleted file mode 100644 index 3c0e04ce..00000000 --- a/java/com/hmdzl/spspd/change/levels/painters/GardenPainter.java +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels.painters; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.blobs.Foliage; -import com.hmdzl.spspd.change.items.Ankh; -import com.hmdzl.spspd.change.items.eggs.EasterEgg; -import com.hmdzl.spspd.change.items.summon.Honeypot; -import com.hmdzl.spspd.change.items.bags.ShoppingCart; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.Room; -import com.hmdzl.spspd.change.levels.Terrain; -import com.hmdzl.spspd.change.plants.BlandfruitBush; -import com.hmdzl.spspd.change.plants.Seedpod; -import com.watabou.utils.Random; - -public class GardenPainter extends Painter { - - public static void paint(Level level, Room room) { - - fill(level, room, Terrain.WALL); - fill(level, room, 1, Terrain.HIGH_GRASS); - fill(level, room, 2, Terrain.WATER); - - room.entrance().set(Room.Door.Type.REGULAR); - - //if (Dungeon.isChallenged(Challenges.NO_FOOD)) { - //if (Random.Int(2) == 0) { - //level.plant(new Seedpod.Seed(), room.random()); - //} - //} else { - int bushes = Random.Int(3); - if (bushes == 0) { - level.plant(new Seedpod.Seed(), room.random()); - } else if (bushes == 1) { - level.plant(new BlandfruitBush.Seed(), room.random()); - } else if (Random.Int(5) == 0) { - level.plant(new Seedpod.Seed(), room.random()); - level.plant(new BlandfruitBush.Seed(), room.random()); - } - //} - - - if (!Dungeon.limitedDrops.shopcart.dropped()){ - int pos; - do {pos = room.random();} - while (level.heaps.get(pos) != null); - level.drop(new ShoppingCart(), pos); - Dungeon.limitedDrops.shopcart.drop(); - } - - if (Random.Int(100)==0 && (Dungeon.getMonth()==4 || Dungeon.getMonth()==5)){ - int pos; - do {pos = room.random();} - while (level.heaps.get(pos) != null); - level.drop(new EasterEgg(), pos); - } - - if (Dungeon.depth==32 && Random.Float() < 0.75f){ - int pos; - do {pos = room.random();} - while (level.heaps.get(pos) != null); - level.drop(new Honeypot(), pos); - - do {pos = room.random();} - while (level.heaps.get(pos) != null); - level.drop(new Honeypot(), pos); - - do {pos = room.random();} - while (level.heaps.get(pos) != null); - level.drop(new Honeypot(), pos); - } - - if (Dungeon.depth==32 && Random.Float() < 0.75f){ - int pos; - do {pos = room.random();} - while (level.heaps.get(pos) != null); - level.drop(new Ankh(), pos); - } - - Foliage light = (Foliage) level.blobs.get(Foliage.class); - if (light == null) { - light = new Foliage(); - } - for (int i = room.top + 1; i < room.bottom; i++) { - for (int j = room.left + 1; j < room.right; j++) { - light.seed(j + Level.getWidth() * i, 1); - } - } - level.blobs.put(Foliage.class, light); - } -} diff --git a/java/com/hmdzl/spspd/change/levels/painters/LaboratoryPainter.java b/java/com/hmdzl/spspd/change/levels/painters/LaboratoryPainter.java deleted file mode 100644 index 2235b417..00000000 --- a/java/com/hmdzl/spspd/change/levels/painters/LaboratoryPainter.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels.painters; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.blobs.Alchemy; -import com.hmdzl.spspd.change.items.Generator; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.keys.IronKey; -import com.hmdzl.spspd.change.items.potions.Potion; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.Room; -import com.hmdzl.spspd.change.levels.Terrain; -import com.watabou.utils.Point; -import com.watabou.utils.Random; - -public class LaboratoryPainter extends Painter { - - public static void paint(Level level, Room room) { - - fill(level, room, Terrain.WALL); - fill(level, room, 1, Terrain.EMPTY_SP); - - Room.Door entrance = room.entrance(); - - Point pot = null; - if (entrance.x == room.left) { - pot = new Point(room.right - 1, Random.Int(2) == 0 ? room.top + 1 - : room.bottom - 1); - } else if (entrance.x == room.right) { - pot = new Point(room.left + 1, Random.Int(2) == 0 ? room.top + 1 - : room.bottom - 1); - } else if (entrance.y == room.top) { - pot = new Point( - Random.Int(2) == 0 ? room.left + 1 : room.right - 1, - room.bottom - 1); - } else if (entrance.y == room.bottom) { - pot = new Point( - Random.Int(2) == 0 ? room.left + 1 : room.right - 1, - room.top + 1); - } - set(level, pot, Terrain.ALCHEMY); - - Alchemy alchemy = new Alchemy(); - alchemy.seed(pot.x + Level.getWidth() * pot.y, 1); - level.blobs.put(Alchemy.class, alchemy); - - int n = Random.IntRange(2, 3); - for (int i = 0; i < n; i++) { - int pos; - do { - pos = room.random(); - } while (level.map[pos] != Terrain.EMPTY_SP - || level.heaps.get(pos) != null); - level.drop(prize(level), pos); - } - - entrance.set(Room.Door.Type.LOCKED); - level.addItemToSpawn(new IronKey(Dungeon.depth)); - } - - private static Item prize(Level level) { - - Item prize = level.findPrizeItem(Potion.class); - if (prize == null) - prize = Generator.random(Generator.Category.POTION); - - return prize; - } -} diff --git a/java/com/hmdzl/spspd/change/levels/painters/LibraryPainter.java b/java/com/hmdzl/spspd/change/levels/painters/LibraryPainter.java deleted file mode 100644 index a5bd94c0..00000000 --- a/java/com/hmdzl/spspd/change/levels/painters/LibraryPainter.java +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels.painters; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.blobs.Foliage; -import com.hmdzl.spspd.change.actors.blobs.weather.WeatherOfQuite; -import com.hmdzl.spspd.change.items.Generator; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.keys.IronKey; -import com.hmdzl.spspd.change.items.scrolls.Scroll; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.Room; -import com.hmdzl.spspd.change.levels.Terrain; -import com.watabou.utils.Point; -import com.watabou.utils.Random; - -public class LibraryPainter extends Painter { - - public static void paint(Level level, Room room) { - - fill(level, room, Terrain.WALL); - fill(level, room, 1, Terrain.EMPTY); - - Room.Door entrance = room.entrance(); - Point a = null; - Point b = null; - - if (entrance.x == room.left) { - a = new Point(room.left + 1, entrance.y - 1); - b = new Point(room.left + 1, entrance.y + 1); - fill(level, room.right - 1, room.top + 1, 1, room.height() - 1, - Terrain.BOOKSHELF); - } else if (entrance.x == room.right) { - a = new Point(room.right - 1, entrance.y - 1); - b = new Point(room.right - 1, entrance.y + 1); - fill(level, room.left + 1, room.top + 1, 1, room.height() - 1, - Terrain.BOOKSHELF); - } else if (entrance.y == room.top) { - a = new Point(entrance.x + 1, room.top + 1); - b = new Point(entrance.x - 1, room.top + 1); - fill(level, room.left + 1, room.bottom - 1, room.width() - 1, 1, - Terrain.BOOKSHELF); - } else if (entrance.y == room.bottom) { - a = new Point(entrance.x + 1, room.bottom - 1); - b = new Point(entrance.x - 1, room.bottom - 1); - fill(level, room.left + 1, room.top + 1, room.width() - 1, 1, - Terrain.BOOKSHELF); - } - if (a != null && level.map[a.x + a.y * Level.getWidth()] == Terrain.EMPTY) { - set(level, a, Terrain.STATUE); - } - if (b != null && level.map[b.x + b.y * Level.getWidth()] == Terrain.EMPTY) { - set(level, b, Terrain.STATUE); - } - - int n = Random.IntRange(2, 3); - for (int i = 0; i < n; i++) { - int pos; - do { - pos = room.random(); - } while (level.map[pos] != Terrain.EMPTY - || level.heaps.get(pos) != null); - level.drop(prize(level), pos); - } - - entrance.set(Room.Door.Type.LOCKED); - level.addItemToSpawn(new IronKey(Dungeon.depth)); - - if (Random.Int(10) > 5){ - WeatherOfQuite light = (WeatherOfQuite) level.blobs.get(WeatherOfQuite.class); - if (light == null) { - light = new WeatherOfQuite(); - } - for (int i = room.top + 1; i < room.bottom; i++) { - for (int j = room.left + 1; j < room.right; j++) { - light.seed(j + Level.getWidth() * i, 1); - } - } - level.blobs.put(WeatherOfQuite.class, light);} - } - - private static Item prize(Level level) { - - Item prize = level.findPrizeItem(Scroll.class); - if (prize == null) - prize = Generator.random(Generator.Category.SCROLL); - - return prize; - } -} diff --git a/java/com/hmdzl/spspd/change/levels/painters/MagicWellPainter.java b/java/com/hmdzl/spspd/change/levels/painters/MagicWellPainter.java deleted file mode 100644 index b7a72ad9..00000000 --- a/java/com/hmdzl/spspd/change/levels/painters/MagicWellPainter.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels.painters; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.blobs.WaterOfAwareness; -import com.hmdzl.spspd.change.actors.blobs.WaterOfHealth; -import com.hmdzl.spspd.change.actors.blobs.WaterOfTransmutation; -import com.hmdzl.spspd.change.actors.blobs.WellWater; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.Room; -import com.hmdzl.spspd.change.levels.Terrain; -import com.hmdzl.spspd.change.plants.BlandfruitBush; -import com.hmdzl.spspd.change.plants.Flytrap; -import com.hmdzl.spspd.change.plants.Phaseshift; -import com.hmdzl.spspd.change.plants.Seedpod; -import com.watabou.utils.Point; -import com.watabou.utils.Random; - -public class MagicWellPainter extends Painter { - - private static final Class[] WATERS = { WaterOfAwareness.class, - WaterOfHealth.class, WaterOfTransmutation.class }; - - public static void paint(Level level, Room room) { - - fill(level, room, Terrain.WALL); - fill(level, room, 1, Terrain.EMPTY); - - Point c = room.center(); - set(level, c.x, c.y, Terrain.WELL); - - @SuppressWarnings("unchecked") - Class waterClass = (Class) Random.element(WATERS); - - - WellWater water = (WellWater) level.blobs.get(waterClass); - if (water == null) { - try { - water = waterClass.newInstance(); - } catch (Exception e) { - water = null; - } - } - - int bushes = Random.Int(3); - if (bushes == 0) { - level.plant(new Flytrap.Seed(), room.random()); - } else if (bushes == 1) { - level.plant(new BlandfruitBush.Seed(), room.random()); - } else if (bushes == 2) { - level.plant(new Phaseshift.Seed(), room.random()); - } - - water.seed(c.x + Level.getWidth() * c.y, 1); - level.blobs.put(waterClass, water); - - room.entrance().set(Room.Door.Type.REGULAR); - } -} diff --git a/java/com/hmdzl/spspd/change/levels/painters/MemoryPainter.java b/java/com/hmdzl/spspd/change/levels/painters/MemoryPainter.java deleted file mode 100644 index 54408819..00000000 --- a/java/com/hmdzl/spspd/change/levels/painters/MemoryPainter.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels.painters; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.blobs.MemoryFire; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.Room; -import com.hmdzl.spspd.change.levels.Terrain; -import com.watabou.utils.Point; - -public class MemoryPainter extends Painter { - - public static void paint( Level level, Room room ) { - - fill( level, room, Terrain.WALL ); - fill( level, room, 1, Dungeon.bossLevel( Dungeon.depth + 1 ) ? Terrain.HIGH_GRASS : Terrain.CHASM ); - - Point c = room.center(); - Room.Door door = room.entrance(); - if (door.x == room.left || door.x == room.right) { - Point p = drawInside( level, room, door, Math.abs( door.x - c.x ) - 2, Terrain.EMPTY_SP ); - for (; p.y != c.y; p.y += p.y < c.y ? +1 : -1) { - set( level, p, Terrain.EMPTY_SP ); - } - } else { - Point p = drawInside( level, room, door, Math.abs( door.y - c.y ) - 2, Terrain.EMPTY_SP ); - for (; p.x != c.x; p.x += p.x < c.x ? +1 : -1) { - set( level, p, Terrain.EMPTY_SP ); - } - } - - fill( level, c.x - 1, c.y - 1, 3, 3, Terrain.EMBERS ); - set( level, c, Terrain.PEDESTAL ); - - MemoryFire fire = (MemoryFire)level.blobs.get( MemoryFire.class ); - if (fire == null) { - fire = new MemoryFire(); - } - fire.seed( c.x + c.y * Level.WIDTH, 5 + Dungeon.depth * 5 ); - level.blobs.put(MemoryFire.class, fire ); - - door.set( Room.Door.Type.HIDDEN ); - } -} diff --git a/java/com/hmdzl/spspd/change/levels/painters/Painter.java b/java/com/hmdzl/spspd/change/levels/painters/Painter.java deleted file mode 100644 index 9ef60ac6..00000000 --- a/java/com/hmdzl/spspd/change/levels/painters/Painter.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels.painters; - -import java.util.Arrays; - -import com.hmdzl.spspd.change.actors.blobs.Foliage; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.Room; -import com.watabou.utils.Point; -import com.watabou.utils.Rect; - -public class Painter { - - public static void set(Level level, int cell, int value) { - level.map[cell] = value; - } - - public static void set(Level level, int x, int y, int value) { - set(level, x + y * Level.getWidth(), value); - } - - public static void set(Level level, Point p, int value) { - set(level, p.x, p.y, value); - } - - public static void fill(Level level, int x, int y, int w, int h, int value) { - - int width = Level.getWidth(); - - int pos = y * width + x; - for (int i = y; i < y + h; i++, pos += width) { - Arrays.fill(level.map, pos, pos + w, value); - } - } - - public static void fill(Level level, Rect rect, int value) { - fill(level, rect.left, rect.top, rect.width() + 1, rect.height() + 1, - value); - } - - public static void fill(Level level, Rect rect, int m, int value) { - fill(level, rect.left + m, rect.top + m, rect.width() + 1 - m * 2, - rect.height() + 1 - m * 2, value); - } - - public static void fill(Level level, Rect rect, int l, int t, int r, int b, - int value) { - fill(level, rect.left + l, rect.top + t, rect.width() + 1 - (l + r), - rect.height() + 1 - (t + b), value); - } - - public static Point drawInside(Level level, Room room, Point from, int n, - int value) { - - Point step = new Point(); - if (from.x == room.left) { - step.set(+1, 0); - } else if (from.x == room.right) { - step.set(-1, 0); - } else if (from.y == room.top) { - step.set(0, +1); - } else if (from.y == room.bottom) { - step.set(0, -1); - } - - Point p = new Point(from).offset(step); - for (int i = 0; i < n; i++) { - if (value != -1) { - set(level, p, value); - } - p.offset(step); - } - - return p; - } - -} diff --git a/java/com/hmdzl/spspd/change/levels/painters/PassagePainter.java b/java/com/hmdzl/spspd/change/levels/painters/PassagePainter.java deleted file mode 100644 index f8ac93d3..00000000 --- a/java/com/hmdzl/spspd/change/levels/painters/PassagePainter.java +++ /dev/null @@ -1,118 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels.painters; - -import java.util.ArrayList; -import java.util.Collections; - -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.Room; -import com.watabou.utils.Point; - -public class PassagePainter extends Painter { - - private static int pasWidth; - private static int pasHeight; - - public static void paint(Level level, Room room) { - - pasWidth = room.width() - 2; - pasHeight = room.height() - 2; - - int floor = level.tunnelTile(); - - ArrayList joints = new ArrayList(); - for (Point door : room.connected.values()) { - joints.add(xy2p(room, door)); - } - Collections.sort(joints); - - int nJoints = joints.size(); - int perimeter = pasWidth * 2 + pasHeight * 2; - - int start = 0; - int maxD = joints.get(0) + perimeter - joints.get(nJoints - 1); - for (int i = 1; i < nJoints; i++) { - int d = joints.get(i) - joints.get(i - 1); - if (d > maxD) { - maxD = d; - start = i; - } - } - - int end = (start + nJoints - 1) % nJoints; - - int p = joints.get(start); - do { - set(level, p2xy(room, p), floor); - p = (p + 1) % perimeter; - } while (p != joints.get(end)); - - set(level, p2xy(room, p), floor); - - for (Room.Door door : room.connected.values()) { - door.set(Room.Door.Type.TUNNEL); - } - } - - private static int xy2p(Room room, Point xy) { - if (xy.y == room.top) { - - return (xy.x - room.left - 1); - - } else if (xy.x == room.right) { - - return (xy.y - room.top - 1) + pasWidth; - - } else if (xy.y == room.bottom) { - - return (room.right - xy.x - 1) + pasWidth + pasHeight; - - } else { - - if (xy.y == room.top + 1) { - return 0; - } else { - return (room.bottom - xy.y - 1) + pasWidth * 2 + pasHeight; - } - - } - } - - private static Point p2xy(Room room, int p) { - if (p < pasWidth) { - - return new Point(room.left + 1 + p, room.top + 1); - - } else if (p < pasWidth + pasHeight) { - - return new Point(room.right - 1, room.top + 1 + (p - pasWidth)); - - } else if (p < pasWidth * 2 + pasHeight) { - - return new Point(room.right - 1 - (p - (pasWidth + pasHeight)), - room.bottom - 1); - - } else { - - return new Point(room.left + 1, room.bottom - 1 - - (p - (pasWidth * 2 + pasHeight))); - - } - } -} diff --git a/java/com/hmdzl/spspd/change/levels/painters/PitPainter.java b/java/com/hmdzl/spspd/change/levels/painters/PitPainter.java deleted file mode 100644 index 485e0992..00000000 --- a/java/com/hmdzl/spspd/change/levels/painters/PitPainter.java +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels.painters; - -import com.hmdzl.spspd.change.items.Ankh; -import com.hmdzl.spspd.change.items.Generator; -import com.hmdzl.spspd.change.items.Heap.Type; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfTeleportation; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.Room; -import com.hmdzl.spspd.change.levels.Terrain; -import com.hmdzl.spspd.change.plants.Fadeleaf; -import com.watabou.utils.Point; -import com.watabou.utils.Random; - -public class PitPainter extends Painter { - - public static void paint(Level level, Room room) { - - fill(level, room, Terrain.WALL); - fill(level, room, 1, Terrain.EMPTY); - - Room.Door entrance = room.entrance(); - entrance.set(Room.Door.Type.ONEWAY); - - Point well = null; - if (entrance.x == room.left) { - well = new Point(room.right - 1, Random.Int(2) == 0 ? room.top + 1 - : room.bottom - 1); - } else if (entrance.x == room.right) { - well = new Point(room.left + 1, Random.Int(2) == 0 ? room.top + 1 - : room.bottom - 1); - } else if (entrance.y == room.top) { - well = new Point(Random.Int(2) == 0 ? room.left + 1 - : room.right - 1, room.bottom - 1); - } else if (entrance.y == room.bottom) { - well = new Point(Random.Int(2) == 0 ? room.left + 1 - : room.right - 1, room.top + 1); - } - set(level, well, Terrain.EMPTY_WELL); - - int remains = room.random(); - while (level.map[remains] == Terrain.EMPTY_WELL) { - remains = room.random(); - } - - int sign = room.random(); - while (level.map[sign] == Terrain.EMPTY_WELL || sign == remains) { - sign = room.random(); - } - - level.map[sign] = Terrain.SIGN; - level.pitSign=sign; - - level.drop(new ScrollOfTeleportation(), remains).type = Type.SKELETON; - int loot = Random.Int(3); - if (loot == 0) { - level.drop(Generator.random(Generator.Category.RING), remains); - } else if (loot == 1) { - level.drop(Generator.random(Generator.Category.ARTIFACT), remains); - } else { - level.drop(Generator.random(Random.oneOf(Generator.Category.WEAPON, - Generator.Category.ARMOR)), remains); - } - level.drop(new Ankh(), remains); - level.drop(new Fadeleaf.Seed(), remains); - int n = Random.IntRange(1, 2); - for (int i = 0; i < n; i++) { - level.drop(prize(level), remains); - } - } - - private static Item prize(Level level) { - - if (Random.Int(2) != 0) { - Item prize = level.findPrizeItem(); - if (prize != null) - return prize; - } - - return Generator.random(Random.oneOf(Generator.Category.POTION, - Generator.Category.SCROLL, Generator.Category.FOOD, - Generator.Category.GOLD)); - } -} diff --git a/java/com/hmdzl/spspd/change/levels/painters/PoolPainter.java b/java/com/hmdzl/spspd/change/levels/painters/PoolPainter.java deleted file mode 100644 index 57d83200..00000000 --- a/java/com/hmdzl/spspd/change/levels/painters/PoolPainter.java +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels.painters; - -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.mobs.Piranha; -import com.hmdzl.spspd.change.items.Generator; -import com.hmdzl.spspd.change.items.Heap; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.potions.PotionOfInvisibility; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.Room; -import com.hmdzl.spspd.change.levels.Terrain; -import com.watabou.utils.Random; - -public class PoolPainter extends Painter { - - private static final int NPIRANHAS = 4; - - public static void paint(Level level, Room room) { - - fill(level, room, Terrain.WALL); - fill(level, room, 1, Terrain.WATER); - - Room.Door door = room.entrance(); - door.set(Room.Door.Type.REGULAR); - - int x = -1; - int y = -1; - if (door.x == room.left) { - - x = room.right - 1; - y = room.top + room.height() / 2; - - } else if (door.x == room.right) { - - x = room.left + 1; - y = room.top + room.height() / 2; - - } else if (door.y == room.top) { - - x = room.left + room.width() / 2; - y = room.bottom - 1; - - } else if (door.y == room.bottom) { - - x = room.left + room.width() / 2; - y = room.top + 1; - - } - - int pos = x + y * Level.getWidth(); - level.drop(prize(level), pos).type = Random.Int(3) == 0 ? Heap.Type.CHEST - : Heap.Type.HEAP; - set(level, pos, Terrain.PEDESTAL); - - level.addItemToSpawn(new PotionOfInvisibility()); - - for (int i = 0; i < NPIRANHAS; i++) { - Piranha piranha = new Piranha(); - do { - piranha.pos = room.random(); - } while (level.map[piranha.pos] != Terrain.WATER - || Actor.findChar(piranha.pos) != null); - level.mobs.add(piranha); - Actor.occupyCell(piranha); - } - } - - private static Item prize(Level level) { - - Item prize; - - if (Random.Int(3) != 0) { - prize = level.findPrizeItem(); - if (prize != null) - return prize; - } - - prize = Generator.random(Random.oneOf(Generator.Category.WEAPON, - Generator.Category.ARMOR)); - - for (int i = 0; i < 4; i++) { - Item another = Generator.random(Random.oneOf( - Generator.Category.WEAPON, Generator.Category.ARMOR)); - if (another.level > prize.level) { - prize = another; - } - } - - return prize; - } -} diff --git a/java/com/hmdzl/spspd/change/levels/painters/RatKingPainter.java b/java/com/hmdzl/spspd/change/levels/painters/RatKingPainter.java deleted file mode 100644 index a379d4cc..00000000 --- a/java/com/hmdzl/spspd/change/levels/painters/RatKingPainter.java +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels.painters; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.Statistics; -import com.hmdzl.spspd.change.actors.mobs.npcs.RatKing; -import com.hmdzl.spspd.change.items.Generator; -import com.hmdzl.spspd.change.items.Gold; -import com.hmdzl.spspd.change.items.Heap; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.bags.ShoppingCart; -import com.hmdzl.spspd.change.items.journalpages.Town; -import com.hmdzl.spspd.change.items.weapon.missiles.MissileWeapon; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.Room; -import com.hmdzl.spspd.change.levels.Terrain; -import com.watabou.utils.Random; - -public class RatKingPainter extends Painter { - - static boolean page = false; - - public static void paint(Level level, Room room) { - - fill(level, room, Terrain.WALL); - fill(level, room, 1, Terrain.EMPTY_SP); - - Room.Door entrance = room.entrance(); - entrance.set(Room.Door.Type.HIDDEN); - int door = entrance.x + entrance.y * Level.getWidth(); - - Dungeon.ratChests=0; - - for (int i = room.left + 1; i < room.right; i++) { - addChest(level, (room.top + 1) * Level.getWidth() + i, door); - addChest(level, (room.bottom - 1) * Level.getWidth() + i, door); - } - - for (int i = room.top + 2; i < room.bottom - 1; i++) { - addChest(level, i * Level.getWidth() + room.left + 1, door); - addChest(level, i * Level.getWidth() + room.right - 1, door); - } - - while (true) { - Heap chest = level.heaps.get(room.random()); - if (chest != null) { - chest.type = Heap.Type.MIMIC; - break; - } - } - - RatKing king = new RatKing(); - king.pos = room.random(1); - level.mobs.add(king); - } - - private static void addChest(Level level, int pos, int door) { - - if (pos == door - 1 || pos == door + 1 || pos == door - Level.getWidth() - || pos == door + Level.getWidth()) { - return; - } - - Item prize; - switch (Random.Int(10)) { - case 0: - prize = Generator.random(Generator.Category.WEAPON); - if (prize instanceof MissileWeapon) { - prize.quantity(1); - } else { - prize.degrade(Random.Int(3)); - } - break; - case 1: - prize = Generator.random(Generator.Category.ARMOR).degrade( - Random.Int(3)); - break; - default: - prize = new Gold(Random.IntRange(1, 5)); - break; - } - - if (!page && Statistics.enemiesSlain<21 && Dungeon.limitedDrops.journal.dropped()){ - level.drop(new Town(), pos); - page=true; - } else { - level.drop(prize, pos).type = Heap.Type.CHEST; - Dungeon.ratChests++; - } - - } -} diff --git a/java/com/hmdzl/spspd/change/levels/painters/RatKingPainter2.java b/java/com/hmdzl/spspd/change/levels/painters/RatKingPainter2.java deleted file mode 100644 index d751bcaa..00000000 --- a/java/com/hmdzl/spspd/change/levels/painters/RatKingPainter2.java +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels.painters; - -import com.hmdzl.spspd.change.actors.mobs.npcs.RatKingDen; -import com.hmdzl.spspd.change.items.summon.ActiveMrDestructo; -import com.hmdzl.spspd.change.items.eggs.Egg; -import com.hmdzl.spspd.change.items.Generator; -import com.hmdzl.spspd.change.items.Gold; -import com.hmdzl.spspd.change.items.Heap; -import com.hmdzl.spspd.change.items.Item; - -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.Room; -import com.hmdzl.spspd.change.levels.Terrain; -import com.hmdzl.spspd.change.plants.Phaseshift; -import com.hmdzl.spspd.change.plants.Starflower; -import com.watabou.utils.Random; - -public class RatKingPainter2 extends Painter { - - public static void paint(Level level, Room room) { - - fill(level, room, Terrain.WALL); - fill(level, room, 1, Terrain.EMPTY_SP); - - Room.Door entrance = room.entrance(); - entrance.set(Room.Door.Type.HIDDEN); - int door = entrance.x + entrance.y * Level.getWidth(); - - //Dungeon.ratChests=0; - - for (int i = room.left + 1; i < room.right; i++) { - addChest(level, (room.top + 1) * Level.getWidth() + i, door); - addChest(level, (room.bottom - 1) * Level.getWidth() + i, door); - } - - for (int i = room.top + 2; i < room.bottom - 1; i++) { - addChest(level, i * Level.getWidth() + room.left + 1, door); - addChest(level, i * Level.getWidth() + room.right - 1, door); - } - - while (true) { - Heap chest = level.heaps.get(room.random()); - if (chest != null) { - chest.type = Heap.Type.MIMIC; - break; - } - } - - RatKingDen king = new RatKingDen(); - king.pos = room.random(1); - level.mobs.add(king); - } - - private static void addChest(Level level, int pos, int door) { - - if (pos == door - 1 || pos == door + 1 || pos == door - Level.getWidth() - || pos == door + Level.getWidth()) { - return; - } - - Item prize; - switch (Random.Int(10)) { - case 0: - prize = new Egg(); - break; - case 1: - prize = new Phaseshift.Seed(); - break; - case 2: - prize = Generator.random(Generator.Category.BERRY); - break; - case 3: - prize = new Starflower.Seed(); - break; - case 5: - prize = new ActiveMrDestructo(); - break; - case 6: - prize = Generator.random(Generator.Category.BOMBS); - break; - default: - prize = new Gold(Random.IntRange(1, 5)); - break; - } - - level.drop(prize, pos).type = Heap.Type.CHEST; - //Dungeon.ratChests++; - } -} diff --git a/java/com/hmdzl/spspd/change/levels/painters/ShopPainter.java b/java/com/hmdzl/spspd/change/levels/painters/ShopPainter.java deleted file mode 100644 index fd00b28f..00000000 --- a/java/com/hmdzl/spspd/change/levels/painters/ShopPainter.java +++ /dev/null @@ -1,409 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels.painters; - -import java.util.ArrayList; -import java.util.Collections; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.hero.Belongings; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.actors.mobs.npcs.ImpShopkeeper; -import com.hmdzl.spspd.change.actors.mobs.npcs.Shopkeeper; -import com.hmdzl.spspd.change.items.Ankh; -import com.hmdzl.spspd.change.items.Generator; -import com.hmdzl.spspd.change.items.Heap; -import com.hmdzl.spspd.change.items.armor.normalarmor.PlateArmor; -import com.hmdzl.spspd.change.items.bombs.DungeonBomb; -import com.hmdzl.spspd.change.items.summon.ActiveMrDestructo; -import com.hmdzl.spspd.change.items.summon.CallCoconut; -import com.hmdzl.spspd.change.items.summon.FairyCard; -import com.hmdzl.spspd.change.items.summon.Honeypot; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.DolyaSlate; -import com.hmdzl.spspd.change.items.Stylus; -import com.hmdzl.spspd.change.items.Torch; -import com.hmdzl.spspd.change.items.Weightstone; -import com.hmdzl.spspd.change.items.challengelists.CourageChallenge; -import com.hmdzl.spspd.change.items.challengelists.PowerChallenge; -import com.hmdzl.spspd.change.items.challengelists.WisdomChallenge; -import com.hmdzl.spspd.change.items.food.staplefood.Pasty; -import com.hmdzl.spspd.change.items.journalpages.Town; -import com.hmdzl.spspd.change.items.journalpages.SafeSpotPage; -import com.hmdzl.spspd.change.items.armor.normalarmor.DiscArmor; -import com.hmdzl.spspd.change.items.armor.normalarmor.MailArmor; -import com.hmdzl.spspd.change.items.armor.normalarmor.ScaleArmor; -import com.hmdzl.spspd.change.items.artifacts.TimekeepersHourglass; -import com.hmdzl.spspd.change.items.bags.PotionBandolier; -import com.hmdzl.spspd.change.items.bags.ScrollHolder; -import com.hmdzl.spspd.change.items.bags.SeedPouch; -import com.hmdzl.spspd.change.items.bags.WandHolster; -import com.hmdzl.spspd.change.items.potions.Potion; -import com.hmdzl.spspd.change.items.potions.PotionOfHealing; -import com.hmdzl.spspd.change.items.scrolls.Scroll; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfIdentify; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfMagicMapping; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfRemoveCurse; -import com.hmdzl.spspd.change.items.summon.Mobile; -import com.hmdzl.spspd.change.items.wands.Wand; -import com.hmdzl.spspd.change.items.weapon.guns.GunA; -import com.hmdzl.spspd.change.items.weapon.guns.GunB; -import com.hmdzl.spspd.change.items.weapon.guns.GunC; -import com.hmdzl.spspd.change.items.weapon.guns.GunD; -import com.hmdzl.spspd.change.items.weapon.guns.GunE; -import com.hmdzl.spspd.change.items.weapon.melee.special.Brick; -import com.hmdzl.spspd.change.items.weapon.melee.special.Lollipop; -import com.hmdzl.spspd.change.items.weapon.melee.special.Pumpkin; -import com.hmdzl.spspd.change.items.weapon.melee.special.SJRBMusic; -import com.hmdzl.spspd.change.items.weapon.missiles.MiniMoai; -import com.hmdzl.spspd.change.items.weapon.missiles.MoneyPack; -import com.hmdzl.spspd.change.items.weapon.missiles.PocketBall; -import com.hmdzl.spspd.change.levels.LastShopLevel; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.Room; -import com.hmdzl.spspd.change.levels.Terrain; -import com.hmdzl.spspd.change.plants.Plant; -import com.watabou.utils.Point; -import com.watabou.utils.Random; - -public class ShopPainter extends Painter { - - private static int pasWidth; - private static int pasHeight; - - private static ArrayList itemsToSpawn; - - public static void paint(Level level, Room room) { - - fill(level, room, Terrain.WALL); - fill(level, room, 1, Terrain.EMPTY_SP); - - pasWidth = room.width() - 2; - pasHeight = room.height() - 2; - int per = pasWidth * 2 + pasHeight * 2; - - if (itemsToSpawn == null) - generateItems(); - - int pos = xy2p(room, room.entrance()) + (per - itemsToSpawn.size()) / 2; - for (Item item : itemsToSpawn) { - - Point xy = p2xy(room, (pos + per) % per); - int cell = xy.x + xy.y * Level.getWidth(); - - if (level.heaps.get(cell) != null) { - do { - cell = room.random(); - } while (level.heaps.get(cell) != null); - } - - level.drop(item, cell).type = Heap.Type.FOR_SALE; - - pos++; - } - - placeShopkeeper(level, room); - - for (Room.Door door : room.connected.values()) { - door.set(Room.Door.Type.REGULAR); - } - - itemsToSpawn = null; - } - - private static void generateItems() { - - itemsToSpawn = new ArrayList(); - - switch (Dungeon.depth) { - case 1: - itemsToSpawn.add(new GunA().identify()); - //itemsToSpawn.add(new MiniMoai().identify()); - itemsToSpawn.add(new MoneyPack(5)); - itemsToSpawn.add(new DolyaSlate().identify()); - itemsToSpawn.add(new Pasty()); - //itemsToSpawn.add(new UnstableSpellbook()); - Dungeon.limitedDrops.journal.drop(); - break; - - case 6: - itemsToSpawn.add(new SafeSpotPage().identify()); - Dungeon.limitedDrops.safespotpage.drop(); - itemsToSpawn.add(new GunB().identify()); - itemsToSpawn.add(new DiscArmor().identify()); - break; - - case 11: - itemsToSpawn.add(new Town().identify()); - Dungeon.limitedDrops.town.drop(); - itemsToSpawn.add(new GunC().identify()); - itemsToSpawn.add(new MailArmor().identify()); - break; - - case 16: - itemsToSpawn.add(new GunD().identify()); - itemsToSpawn.add(new ScaleArmor().identify()); - break; - - case 21: - //itemsToSpawn.add(Random.Int(2) == 0 ? new Glaive().identify() - // : new WarHammer().identify()); - //itemsToSpawn.add(Random.Int(2) == 0 ? new Bola().quantity(Random - // .NormalIntRange(4, 7)) : new Tamahawk().quantity(Random - // .NormalIntRange(4, 7))); - //itemsToSpawn.add(new PlateArmor().identify()); - //itemsToSpawn.add(new Torch()); - itemsToSpawn.add(new GunE().identify()); - itemsToSpawn.add(new PlateArmor().identify()); - itemsToSpawn.add(new CourageChallenge()); - itemsToSpawn.add(new PowerChallenge()); - itemsToSpawn.add(new WisdomChallenge()); - break; - } - - ChooseBag(Dungeon.hero.belongings); - - itemsToSpawn.add(new PotionOfHealing()); - for (int i = 0; i < 2; i++) - itemsToSpawn.add(Generator.random(Generator.Category.POTION)); - - //itemsToSpawn.add(new ScrollOfIdentify()); - //itemsToSpawn.add(new ScrollOfRemoveCurse()); - itemsToSpawn.add(new ScrollOfMagicMapping()); - for (int i = 0; i < 2; i++) - itemsToSpawn.add(Generator.random(Generator.Category.SCROLL)); - itemsToSpawn.add(new PocketBall()); - itemsToSpawn.add(Generator.random(Generator.Category.BOMBS)); - //for (int i = 0; i < 2; i++) - itemsToSpawn.add(Random.Int(2) == 0 ? - Generator.random(Generator.Category.POTION): - Generator.random(Generator.Category.SCROLL)); - for (int i = 0; i < 2; i++) - itemsToSpawn.add(Generator.random(Generator.Category.RANGEWEAPON)); - itemsToSpawn.add(Generator.random(Generator.Category.MELEEWEAPON)); - //itemsToSpawn.add(new DungeonBomb().random()); - switch (Random.Int(8)) { - case 1: - itemsToSpawn.add(new ActiveMrDestructo()); - break; - case 2: - itemsToSpawn.add(new FairyCard()); - break; - case 3: - itemsToSpawn.add(new Mobile()); - break; - case 4: - itemsToSpawn.add(new Honeypot()); - break; - case 5: - case 6: - case 7: - itemsToSpawn.add(new Torch()); - break; - } - - //if (Dungeon.depth == 6) { - itemsToSpawn.add(new Ankh()); - itemsToSpawn.add(new Weightstone()); - //} else { - //itemsToSpawn.add(Random.Int(2) == 0 ? new Ankh() - //: new Weightstone()); - //} - - TimekeepersHourglass hourglass = Dungeon.hero.belongings - .getItem(TimekeepersHourglass.class); - if (hourglass != null) { - int bags = 0; - // creates the given float percent of the remaining bags to be - // dropped. - // this way players who get the hourglass late can still max it, - // usually. - switch (Dungeon.depth) { - case 6: - bags = (int) Math.ceil((5 - hourglass.sandBags) * 0.20f); - break; - case 11: - bags = (int) Math.ceil((5 - hourglass.sandBags) * 0.25f); - break; - case 16: - bags = (int) Math.ceil((5 - hourglass.sandBags) * 0.50f); - break; - case 21: - bags = (int) Math.ceil((5 - hourglass.sandBags) * 0.80f); - break; - } - - for (int i = 1; i <= bags; i++) { - itemsToSpawn.add(new TimekeepersHourglass.sandBag()); - hourglass.sandBags++; - } - } - - Item rare; - switch (Random.Int(4)) { - case 0: - rare = Generator.random(Generator.Category.WAND); - rare.level = 0; - break; - case 1: - rare = Generator.random(Generator.Category.RING); - rare.level = 1; - break; - case 2: - rare = Generator.random(Generator.Category.ARTIFACT).identify(); - break; - default: - rare = new Stylus(); - } - rare.cursed = rare.cursedKnown = false; - itemsToSpawn.add(rare); - - // this is a hard limit, level gen allows for at most an 8x5 room, can't - // fit more than 39 items + 1 shopkeeper. - if (itemsToSpawn.size() > 39) - throw new RuntimeException( - "Shop attempted to carry more than 39 items!"); - - Collections.shuffle(itemsToSpawn); - } - - private static void ChooseBag(Belongings pack) { - // FIXME: this whole method is pretty messy to accomplish a fairly - // simple logic goal. Should be a better way. - - // there is a bias towards giving certain bags earlier, seen here - int seeds = 10, scrolls = 1, potions = 1, wands = 0; - - // we specifically only want to look at items in the main bag, none of - // the sub-bags. - for (Item item : pack.backpack.items) { - if (item instanceof Plant.Seed) - seeds++; - else if (item instanceof Scroll) - scrolls++; - else if (item instanceof Potion) - potions++; - else if (item instanceof Wand) - wands++; - } - // kill our counts for bags that have already been dropped. - if (Dungeon.limitedDrops.seedBag.dropped()) - seeds = 0; - if (Dungeon.limitedDrops.scrollBag.dropped()) - scrolls = 0; - if (Dungeon.limitedDrops.potionBag.dropped()) - potions = 0; - if (Dungeon.limitedDrops.wandBag.dropped()) - wands = 0; - - // then pick whichever valid bag has the most items available to put - // into it. - if (seeds >= scrolls && seeds >= potions && seeds >= wands - && !Dungeon.limitedDrops.seedBag.dropped()) { - Dungeon.limitedDrops.seedBag.drop(); - itemsToSpawn.add(new SeedPouch()); - } else if (scrolls >= potions && scrolls >= wands - && !Dungeon.limitedDrops.scrollBag.dropped()) { - Dungeon.limitedDrops.scrollBag.drop(); - itemsToSpawn.add(new ScrollHolder()); - } else if (potions >= wands - && !Dungeon.limitedDrops.potionBag.dropped()) { - Dungeon.limitedDrops.potionBag.drop(); - itemsToSpawn.add(new PotionBandolier()); - } else if (!Dungeon.limitedDrops.wandBag.dropped()) { - Dungeon.limitedDrops.wandBag.drop(); - itemsToSpawn.add(new WandHolster()); - } - } - - public static int spaceNeeded() { - if (itemsToSpawn == null) - generateItems(); - - // plus one for the shopkeeper - return itemsToSpawn.size() + 1; - } - - private static void placeShopkeeper(Level level, Room room) { - - int pos; - do { - pos = room.random(); - } while (level.heaps.get(pos) != null); - - Mob shopkeeper = level instanceof LastShopLevel ? new ImpShopkeeper() - : new Shopkeeper(); - shopkeeper.pos = pos; - level.mobs.add(shopkeeper); - - if (level instanceof LastShopLevel) { - for (int i = 0; i < Level.NEIGHBOURS9.length; i++) { - int p = shopkeeper.pos + Level.NEIGHBOURS9[i]; - if (level.map[p] == Terrain.EMPTY_SP) { - level.map[p] = Terrain.WATER; - } - } - } - } - - private static int xy2p(Room room, Point xy) { - if (xy.y == room.top) { - - return (xy.x - room.left - 1); - - } else if (xy.x == room.right) { - - return (xy.y - room.top - 1) + pasWidth; - - } else if (xy.y == room.bottom) { - - return (room.right - xy.x - 1) + pasWidth + pasHeight; - - } else { - - if (xy.y == room.top + 1) { - return 0; - } else { - return (room.bottom - xy.y - 1) + pasWidth * 2 + pasHeight; - } - - } - } - - private static Point p2xy(Room room, int p) { - if (p < pasWidth) { - - return new Point(room.left + 1 + p, room.top + 1); - - } else if (p < pasWidth + pasHeight) { - - return new Point(room.right - 1, room.top + 1 + (p - pasWidth)); - - } else if (p < pasWidth * 2 + pasHeight) { - - return new Point(room.right - 1 - (p - (pasWidth + pasHeight)), - room.bottom - 1); - - } else { - - return new Point(room.left + 1, room.bottom - 1 - - (p - (pasWidth * 2 + pasHeight))); - - } - } -} diff --git a/java/com/hmdzl/spspd/change/levels/painters/StandardPainter.java b/java/com/hmdzl/spspd/change/levels/painters/StandardPainter.java deleted file mode 100644 index 596822fc..00000000 --- a/java/com/hmdzl/spspd/change/levels/painters/StandardPainter.java +++ /dev/null @@ -1,453 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels.painters; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.blobs.weather.WeatherOfDead; -import com.hmdzl.spspd.change.actors.blobs.weather.WeatherOfQuite; -import com.hmdzl.spspd.change.actors.blobs.weather.WeatherOfRain; -import com.hmdzl.spspd.change.actors.blobs.weather.WeatherOfSand; -import com.hmdzl.spspd.change.actors.blobs.weather.WeatherOfSnow; -import com.hmdzl.spspd.change.actors.blobs.weather.WeatherOfSun; -import com.hmdzl.spspd.change.items.Generator; -import com.hmdzl.spspd.change.items.Gold; -import com.hmdzl.spspd.change.items.Heap; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.Room; -import com.hmdzl.spspd.change.levels.Terrain; -import com.hmdzl.spspd.change.levels.traps.FireTrap; -import com.watabou.utils.Point; -import com.watabou.utils.Random; - -public class StandardPainter extends Painter { - - public static void paint(Level level, Room room) { - - fill(level, room, Terrain.WALL); - for (Room.Door door : room.connected.values()) { - door.set(Room.Door.Type.REGULAR); - } - - if (Dungeon.depth==31){ - if (Math.min(room.width(), room.height()) >= 4 - && Math.max(room.width(), room.height()) >= 6) { - paintGraveyard(level, room); - return; - } - } - if (Dungeon.depth==32){ - if (Math.min(room.width(), room.height()) >= 4 - && Math.max(room.width(), room.height()) >= 6) { - paintStriped(level, room); - return; - } - } - if (Dungeon.depth==33){ - if (Math.min(room.width(), room.height()) >= 4 - && Math.max(room.width(), room.height()) >= 6) { - paintStudy(level, room); - return; - } - } - - if (!Dungeon.bossLevel() && Random.Int(5) == 0) { - switch (Random.Int(7)) { - case 0: - if (level.feeling != Level.Feeling.GRASS) { - if (Math.min(room.width(), room.height()) >= 4 - && Math.max(room.width(), room.height()) >= 6) { - paintGraveyard(level, room); - return; - } - break; - } else { - // Burned room - } - case 1: - if (Dungeon.depth > 1) { - paintBurned(level, room); - return; - } - break; - case 2: - if (Math.max(room.width(), room.height()) >= 4) { - paintStriped(level, room); - return; - } - break; - case 3: - if (room.width() >= 6 && room.height() >= 6) { - paintStudy(level, room); - return; - } - break; - case 4: - if (room.width() >= 6 && room.height() >= 6) { - paintStudy2(level, room); - return; - } - break; - case 5: - if (level.feeling != Level.Feeling.WATER) { - if (room.connected.size() == 2 && room.width() >= 4 - && room.height() >= 4) { - paintBridge(level, room); - return; - } - break; - } else { - // Fissure - } - case 6: - if (!Dungeon.bossLevel() - && !Dungeon.bossLevel(Dungeon.depth + 1) - && (Dungeon.depth < 22 || Dungeon.depth > 100) - && !Dungeon.townCheck(Dungeon.depth) - && Math.min(room.width(), room.height()) >= 5) { - paintFissure(level, room); - return; - } - break; - } - } - - fill(level, room, 1, Terrain.EMPTY); - - if (!Dungeon.bossLevel() && Random.Int(5) == 0) { - switch (Random.Int(4)) { - case 0: - WeatherOfRain rain = (WeatherOfRain) level.blobs.get(WeatherOfRain.class); - if (rain == null) { - rain = new WeatherOfRain(); - } - for (int i = room.top + 1; i < room.bottom; i++) { - for (int j = room.left + 1; j < room.right; j++) { - rain.seed(j + Level.getWidth() * i, 1); - } - } - level.blobs.put(WeatherOfRain.class, rain); - break; - case 1: - WeatherOfSand sand = (WeatherOfSand) level.blobs.get(WeatherOfSand.class); - if (sand == null) { - sand = new WeatherOfSand(); - } - for (int i = room.top + 1; i < room.bottom; i++) { - for (int j = room.left + 1; j < room.right; j++) { - sand.seed(j + Level.getWidth() * i, 1); - } - } - level.blobs.put(WeatherOfSand.class, sand); - break; - case 2: - WeatherOfSnow snow = (WeatherOfSnow) level.blobs.get(WeatherOfSnow.class); - if (snow == null) { - snow = new WeatherOfSnow(); - } - for (int i = room.top + 1; i < room.bottom; i++) { - for (int j = room.left + 1; j < room.right; j++) { - snow.seed(j + Level.getWidth() * i, 1); - } - } - level.blobs.put(WeatherOfSnow.class, snow); - break; - case 3: - WeatherOfSun sun = (WeatherOfSun) level.blobs.get(WeatherOfSun.class); - if (sun == null) { - sun = new WeatherOfSun(); - } - for (int i = room.top + 1; i < room.bottom; i++) { - for (int j = room.left + 1; j < room.right; j++) { - sun.seed(j + Level.getWidth() * i, 1); - } - } - level.blobs.put(WeatherOfSun.class, sun); - break; - - } - } - } - - private static void paintBurned(Level level, Room room) { - for (int i = room.top + 1; i < room.bottom; i++) { - for (int j = room.left + 1; j < room.right; j++) { - int cell = i * Level.WIDTH + j; - int t = Terrain.EMBERS; - switch (Random.Int(5)) { - case 0: - t = Terrain.EMPTY; - break; - case 1: - t = Terrain.TRAP; - level.setTrap(new FireTrap().reveal(), cell); - break; - case 2: - t = Terrain.SECRET_TRAP; - level.setTrap(new FireTrap().hide(), cell); - break; - case 3: - t = Terrain.INACTIVE_TRAP; - FireTrap trap = new FireTrap(); - trap.reveal().active = false; - level.setTrap(trap, cell); - break; - } - level.map[i * Level.getWidth() + j] = t; - } - } - } - - private static void paintGraveyard(Level level, Room room) { - fill(level, room.left + 1, room.top + 1, room.width() - 1, - room.height() - 1, Terrain.GRASS); - - int w = room.width() - 1; - int h = room.height() - 1; - int nGraves = Math.max(w, h) / 2; - - int index = Random.Int(nGraves); - - int shift = Random.Int(2); - for (int i = 0; i < nGraves; i++) { - int pos = w > h ? room.left + 1 + shift + i * 2 - + (room.top + 2 + Random.Int(h - 2)) * Level.getWidth() - : (room.left + 2 + Random.Int(w - 2)) - + (room.top + 1 + shift + i * 2) * Level.getWidth(); - level.drop(i == index ? Generator.random() : new Gold().random(), - pos).type = Heap.Type.TOMB; - } - - if (Random.Int(10)==0){ - WeatherOfDead light = (WeatherOfDead) level.blobs.get(WeatherOfDead.class); - if (light == null) { - light = new WeatherOfDead(); - } - for (int i = room.top + 1; i < room.bottom; i++) { - for (int j = room.left + 1; j < room.right; j++) { - light.seed(j + Level.getWidth() * i, 1); - } - } - level.blobs.put(WeatherOfDead.class, light); - } - - } - - private static void paintStriped(Level level, Room room) { - fill(level, room.left + 1, room.top + 1, room.width() - 1, - room.height() - 1, Terrain.EMPTY_SP); - - if (room.width() > room.height()) { - for (int i = room.left + 2; i < room.right; i += 2) { - fill(level, i, room.top + 1, 1, room.height() - 1, - Terrain.HIGH_GRASS); - } - } else { - for (int i = room.top + 2; i < room.bottom; i += 2) { - fill(level, room.left + 1, i, room.width() - 1, 1, - Terrain.HIGH_GRASS); - } - } - } - - // TODO: this is almost a special room type now, consider moving this into - // its own painter if/when you address room gen significantly. - private static void paintStudy(Level level, Room room) { - fill(level, room.left + 1, room.top + 1, room.width() - 1, - room.height() - 1, Terrain.BOOKSHELF); - fill(level, room.left + 2, room.top + 2, room.width() - 3, - room.height() - 3, Terrain.EMPTY_SP); - - for (Point door : room.connected.values()) { - if (door.x == room.left) { - set(level, door.x + 1, door.y, Terrain.EMPTY); - } else if (door.x == room.right) { - set(level, door.x - 1, door.y, Terrain.EMPTY); - } else if (door.y == room.top) { - set(level, door.x, door.y + 1, Terrain.EMPTY); - } else if (door.y == room.bottom) { - set(level, door.x, door.y - 1, Terrain.EMPTY); - } - } - Point center = room.center(); - set(level, center, Terrain.PEDESTAL); - if (Random.Int(2) != 0) { - Item prize = level.findPrizeItem(); - if (prize != null) { - level.drop(prize, (room.center().x + center.y * Level.getWidth())); - return; - } - } - - level.drop(Generator.random(Random.oneOf(Generator.Category.POTION, - Generator.Category.SCROLL)), (room.center().x + center.y - * Level.getWidth())); - - if (Random.Int(5)==0){ - WeatherOfQuite light = (WeatherOfQuite) level.blobs.get(WeatherOfQuite.class); - if (light == null) { - light = new WeatherOfQuite(); - } - for (int i = room.top + 1; i < room.bottom; i++) { - for (int j = room.left + 1; j < room.right; j++) { - light.seed(j + Level.getWidth() * i, 1); - } - } - level.blobs.put(WeatherOfQuite.class, light); } - - } - - private static void paintStudy2( Level level, Room room ) { - - fill( level, room.left + 1, room.top + 1, room.width() - 1, room.height() - 1 , Terrain.EMPTY_SP ); - - if (room.width() > room.height()) { - for (int i=room.left + 2; i < room.right; i += 2) { - fill( level, i, room.top + 2, 1, room.height() - 3, Terrain.BOOKSHELF ); - } - } else { - for (int i=room.top + 2; i < room.bottom; i += 2) { - fill( level, room.left + 2, i, room.width() - 3, 1, Terrain.BOOKSHELF ); - } - } - -// fill( bonus, room.left + 1, room.top + 1, room.width() - 1, room.height() - 1 , Terrain.SHELF_EMPTY ); -// fill( bonus, room.left + 2, room.top + 2, room.width() - 3, room.height() - 3 , Terrain.EMPTY_SP ); -// - for (Point door : room.connected.values()) { - if (door.x == room.left) { - set( level, door.x + 1, door.y, Terrain.EMPTY_SP ); - } else if (door.x == room.right) { - set( level, door.x - 1, door.y, Terrain.EMPTY_SP ); - } else if (door.y == room.top) { - set( level, door.x, door.y + 1, Terrain.EMPTY_SP ); - } else if (door.y == room.bottom) { - set( level, door.x , door.y - 1, Terrain.EMPTY_SP ); - } - } - - if (Random.Int(5)==0){ - WeatherOfQuite light = (WeatherOfQuite) level.blobs.get(WeatherOfQuite.class); - if (light == null) { - light = new WeatherOfQuite(); - } - for (int i = room.top + 1; i < room.bottom; i++) { - for (int j = room.left + 1; j < room.right; j++) { - light.seed(j + Level.getWidth() * i, 1); - } - } - level.blobs.put(WeatherOfQuite.class, light);} - -// set( bonus, room.center(), Terrain.PEDESTAL ); - } - - private static void paintBridge(Level level, Room room) { - - if( room.connected.size() == 2 ) { - - fill(level, room.left + 1, room.top + 1, room.width() - 1, - room.height() - 1, - !Dungeon.bossLevel() && !Dungeon.bossLevel(Dungeon.depth + 1) && (Dungeon.depth < 22 || Dungeon.depth > 26) - && !Dungeon.townCheck(Dungeon.depth) - && Random.Int(3) == 0 ? Terrain.CHASM : Terrain.WATER); - - Point door1 = null; - Point door2 = null; - for (Point p : room.connected.values()) { - if (door1 == null) { - door1 = p; - } else { - door2 = p; - } - } - - if ((door1.x == room.left && door2.x == room.right) - || (door1.x == room.right && door2.x == room.left)) { - - int s = room.width() / 2; - - drawInside(level, room, door1, s, Terrain.EMPTY_SP); - drawInside(level, room, door2, s, Terrain.EMPTY_SP); - fill(level, room.center().x, Math.min(door1.y, door2.y), 1, - Math.abs(door1.y - door2.y) + 1, Terrain.EMPTY_SP); - - } else if ((door1.y == room.top && door2.y == room.bottom) - || (door1.y == room.bottom && door2.y == room.top)) { - - int s = room.height() / 2; - - drawInside(level, room, door1, s, Terrain.EMPTY_SP); - drawInside(level, room, door2, s, Terrain.EMPTY_SP); - fill(level, Math.min(door1.x, door2.x), room.center().y, - Math.abs(door1.x - door2.x) + 1, 1, Terrain.EMPTY_SP); - - } else if (door1.x == door2.x) { - - fill(level, door1.x == room.left ? room.left + 1 : room.right - 1, - Math.min(door1.y, door2.y), 1, - Math.abs(door1.y - door2.y) + 1, Terrain.EMPTY_SP); - - } else if (door1.y == door2.y) { - - fill(level, Math.min(door1.x, door2.x), - door1.y == room.top ? room.top + 1 : room.bottom - 1, - Math.abs(door1.x - door2.x) + 1, 1, Terrain.EMPTY_SP); - - } else if (door1.y == room.top || door1.y == room.bottom) { - - drawInside(level, room, door1, Math.abs(door1.y - door2.y), - Terrain.EMPTY_SP); - drawInside(level, room, door2, Math.abs(door1.x - door2.x), - Terrain.EMPTY_SP); - - } else if (door1.x == room.left || door1.x == room.right) { - - drawInside(level, room, door1, Math.abs(door1.x - door2.x), - Terrain.EMPTY_SP); - drawInside(level, room, door2, Math.abs(door1.y - door2.y), - Terrain.EMPTY_SP); - - } - } else { - fill( level, room.left + 1, room.top + 1, room.width() - 1, room.height() - 1, Terrain.EMPTY_SP ); - - fill( level, room.left + 2, room.top + 2, room.width() - 3, room.height() - 3, - level.feeling == Level.Feeling.WATER ? - Terrain.WATER : Terrain.CHASM ); - } - - for (Room.Door door : room.connected.values()) { - door.set( Room.Door.Type.REGULAR ); - } - } - - private static void paintFissure(Level level, Room room) { - fill(level, room.left + 1, room.top + 1, room.width() - 1, - room.height() - 1, Terrain.EMPTY); - - for (int i = room.top + 2; i < room.bottom - 1; i++) { - for (int j = room.left + 2; j < room.right - 1; j++) { - int v = Math.min(i - room.top, room.bottom - i); - int h = Math.min(j - room.left, room.right - j); - if (Math.min(v, h) > 2 || Random.Int(2) == 0) { - set(level, j, i, Terrain.CHASM); - } - } - } - } -} diff --git a/java/com/hmdzl/spspd/change/levels/painters/StatuePainter.java b/java/com/hmdzl/spspd/change/levels/painters/StatuePainter.java deleted file mode 100644 index 77f57497..00000000 --- a/java/com/hmdzl/spspd/change/levels/painters/StatuePainter.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels.painters; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.mobs.Statue; -import com.hmdzl.spspd.change.items.keys.IronKey; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.Room; -import com.hmdzl.spspd.change.levels.Terrain; -import com.watabou.utils.Point; - -public class StatuePainter extends Painter { - - public static void paint(Level level, Room room) { - - fill(level, room, Terrain.WALL); - fill(level, room, 1, Terrain.EMPTY); - - Point c = room.center(); - int cx = c.x; - int cy = c.y; - - Room.Door door = room.entrance(); - - door.set(Room.Door.Type.LOCKED); - level.addItemToSpawn(new IronKey(Dungeon.depth)); - - if (door.x == room.left) { - - fill(level, room.right - 1, room.top + 1, 1, room.height() - 1, - Terrain.STATUE); - cx = room.right - 2; - - } else if (door.x == room.right) { - - fill(level, room.left + 1, room.top + 1, 1, room.height() - 1, - Terrain.STATUE); - cx = room.left + 2; - - } else if (door.y == room.top) { - - fill(level, room.left + 1, room.bottom - 1, room.width() - 1, 1, - Terrain.STATUE); - cy = room.bottom - 2; - - } else if (door.y == room.bottom) { - - fill(level, room.left + 1, room.top + 1, room.width() - 1, 1, - Terrain.STATUE); - cy = room.top + 2; - - } - - Statue statue = new Statue(); - statue.pos = cx + cy * Level.getWidth(); - level.mobs.add(statue); - Actor.occupyCell(statue); - } -} diff --git a/java/com/hmdzl/spspd/change/levels/painters/StoragePainter.java b/java/com/hmdzl/spspd/change/levels/painters/StoragePainter.java deleted file mode 100644 index 94c0a203..00000000 --- a/java/com/hmdzl/spspd/change/levels/painters/StoragePainter.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels.painters; - -import com.hmdzl.spspd.change.items.Generator; -import com.hmdzl.spspd.change.items.Heap; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.potions.PotionOfLiquidFlame; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.Room; -import com.hmdzl.spspd.change.levels.Terrain; -import com.watabou.utils.Random; - -public class StoragePainter extends Painter { - - public static void paint( Level level, Room room ) { - - final int floor = Terrain.EMPTY_SP; - - fill( level, room, Terrain.WALL ); - fill( level, room, 1, floor ); - - Room.Door entrance = room.entrance(); - - if (entrance.x == room.left) { - fill( level, room.right - 1, room.top + 1, 1, room.height() - 1 , Terrain.EMPTY ); - fill( level, room.right - 2, room.top + 1, 1, room.height() - 1 , Terrain.BOOKSHELF ); - } else if (entrance.x == room.right) { - fill( level, room.left + 1, room.top + 1, 1, room.height() - 1 , Terrain.EMPTY ); - fill( level, room.left + 2, room.top + 1, 1, room.height() - 1 , Terrain.BOOKSHELF ); - } else if (entrance.y == room.top) { - fill( level, room.left + 1, room.bottom - 1, room.width() - 1, 1 , Terrain.EMPTY ); - fill( level, room.left + 1, room.bottom - 2, room.width() - 1, 1 , Terrain.BOOKSHELF ); - } else if (entrance.y == room.bottom) { - fill( level, room.left + 1, room.top + 1, room.width() - 1, 1 , Terrain.EMPTY ); - fill( level, room.left + 1, room.top + 2, room.width() - 1, 1 , Terrain.BOOKSHELF ); - } - - int n = 2 + Random.Int( 3 ); - for (int i=0; i < n; i++) { - int pos; - do { - pos = room.random(); - } while (level.map[pos] != Terrain.EMPTY); - level.drop( prize( level ), pos ).type = Heap.Type.SKELETON; - } - - int pos; - do { - pos = room.random(); - } while (level.map[pos] != floor); - level.drop( prize( level ), pos ).type = Heap.Type.CHEST; - - room.entrance().set( Room.Door.Type.REGULAR ); - level.addItemToSpawn( new PotionOfLiquidFlame() ); - } - - private static Item prize( Level level ) { - - Item prize = Generator.random(); - - if (prize != null) { - return prize; - } - - return Generator.random( Random.oneOf( - Generator.Category.POTION, - Generator.Category.SCROLL, - Generator.Category.GOLD, - Generator.Category.WAND - ) ); - } -} diff --git a/java/com/hmdzl/spspd/change/levels/painters/TrapsPainter.java b/java/com/hmdzl/spspd/change/levels/painters/TrapsPainter.java deleted file mode 100644 index 77422540..00000000 --- a/java/com/hmdzl/spspd/change/levels/painters/TrapsPainter.java +++ /dev/null @@ -1,154 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels.painters; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.ShatteredPixelDungeon; -import com.hmdzl.spspd.change.items.Generator; -import com.hmdzl.spspd.change.items.Heap; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.potions.PotionOfLevitation; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.Room; -import com.hmdzl.spspd.change.levels.Terrain; -import com.hmdzl.spspd.change.levels.traps.*; -import com.watabou.utils.Point; -import com.watabou.utils.Random; - -public class TrapsPainter extends Painter { - - public static void paint(Level level, Room room) { - - fill( level, room, Terrain.WALL ); - - Class trapClass; - switch (Random.Int(5)){ - case 0: default: - trapClass = SpearTrap.class; - break; - case 1: - trapClass = !Dungeon.bossLevel(Dungeon.depth + 1)? null : SummoningTrap.class; - break; - case 2: case 3: case 4: - trapClass = Random.oneOf(trapType); - break; - } - - if (trapClass == null){ - Painter.fill(level, room, 1, Terrain.CHASM); - } else { - Painter.fill(level, room, 1, Terrain.TRAP); - } - - Room.Door door = room.entrance(); - door.set(Room.Door.Type.REGULAR); - - int lastRow = level.map[room.left + 1 + (room.top + 1) * Level.getWidth()] == Terrain.CHASM ? Terrain.CHASM - : Terrain.EMPTY; - - int x = -1; - int y = -1; - if (door.x == room.left) { - x = room.right - 1; - y = room.top + room.height() / 2; - fill(level, x, room.top + 1, 1, room.height() - 1, lastRow); - } else if (door.x == room.right) { - x = room.left + 1; - y = room.top + room.height() / 2; - fill(level, x, room.top + 1, 1, room.height() - 1, lastRow); - } else if (door.y == room.top) { - x = room.left + room.width() / 2; - y = room.bottom - 1; - fill(level, room.left + 1, y, room.width() - 1, 1, lastRow); - } else if (door.y == room.bottom) { - x = room.left + room.width() / 2; - y = room.top + 1; - fill(level, room.left + 1, y, room.width() - 1, 1, lastRow); - } - - for(int cell : room.getCells()) { - if (level.map[cell] == Terrain.TRAP){ - try { - level.setTrap(((Trap) trapClass.newInstance()).reveal(), cell); - } catch (Exception e) { - ShatteredPixelDungeon.reportException(e); - } - } - } - - int pos = x + y * Level.getWidth(); - if (Random.Int(3) == 0) { - if (lastRow == Terrain.CHASM) { - set(level, pos, Terrain.EMPTY); - } - level.drop(prize(level), pos).type = Heap.Type.CHEST; - } else { - set(level, pos, Terrain.PEDESTAL); - level.drop(prize(level), pos); - } - - level.addItemToSpawn(new PotionOfLevitation()); - } - - private static Item prize(Level level) { - - Item prize; - - if (Random.Int(4) != 0) { - prize = level.findPrizeItem(); - if (prize != null) - return prize; - } - - prize = Generator.random(Random.oneOf(Generator.Category.WEAPON, - Generator.Category.ARMOR)); - - for (int i = 0; i < 3; i++) { - Item another = Generator.random(Random.oneOf( - Generator.Category.WEAPON, Generator.Category.ARMOR)); - if (another.level > prize.level) { - prize = another; - } - } - - return prize; - } - - /*@SuppressWarnings("unchecked") - private static Class[][] levelTraps = new Class[][]{ - //sewers - {ToxicTrap.class, TeleportationTrap.class, FlockTrap.class}, - //prison - {ConfusionTrap.class, ExplosiveTrap.class, ParalyticTrap.class}, - //caves - {BlazingTrap.class, VenomTrap.class, ExplosiveTrap.class}, - //city - {WarpingTrap.class, VenomTrap.class, DisintegrationTrap.class}, - //halls, muahahahaha - {GrimTrap.class} - };*/ - @SuppressWarnings("unchecked") - private static Class[] trapType = new Class[]{ - ToxicTrap.class, TeleportationTrap.class, FlockTrap.class, - ConfusionTrap.class, ExplosiveTrap.class, ParalyticTrap.class, - BlazingTrap.class, VenomTrap.class, ExplosiveTrap.class, - WarpingTrap.class, DisintegrationTrap.class, - GrimTrap.class,SpearTrap.class, - !Dungeon.bossLevel(Dungeon.depth + 1)? null : SummoningTrap.class}; - -} diff --git a/java/com/hmdzl/spspd/change/levels/painters/TreasuryPainter.java b/java/com/hmdzl/spspd/change/levels/painters/TreasuryPainter.java deleted file mode 100644 index 0675d4ea..00000000 --- a/java/com/hmdzl/spspd/change/levels/painters/TreasuryPainter.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels.painters; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.items.Gold; -import com.hmdzl.spspd.change.items.Heap; -import com.hmdzl.spspd.change.items.keys.IronKey; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.Room; -import com.hmdzl.spspd.change.levels.Terrain; -import com.watabou.utils.Random; - -public class TreasuryPainter extends Painter { - - public static void paint(Level level, Room room) { - - fill(level, room, Terrain.WALL); - fill(level, room, 1, Terrain.EMPTY); - - set(level, room.center(), Terrain.STATUE); - - Heap.Type heapType = Random.Int(2) == 0 ? Heap.Type.CHEST - : Heap.Type.HEAP; - - int n = Random.IntRange(2, 3); - for (int i = 0; i < n; i++) { - int pos; - do { - pos = room.random(); - } while (level.map[pos] != Terrain.EMPTY - || level.heaps.get(pos) != null); - level.drop(new Gold().random(), pos).type = (i == 0 - && heapType == Heap.Type.CHEST ? Heap.Type.MIMIC : heapType); - } - - if (heapType == Heap.Type.HEAP) { - for (int i = 0; i < n; i++) { - int pos; - do { - pos = room.random(); - } while (level.map[pos] != Terrain.EMPTY - || level.heaps.get(pos) != null); - level.drop(new Gold().random(), pos).type = (i == 0 - && heapType == Heap.Type.CHEST ? Heap.Type.MIMIC : heapType); - } - } - - room.entrance().set(Room.Door.Type.LOCKED); - level.addItemToSpawn(new IronKey(Dungeon.depth)); - } -} diff --git a/java/com/hmdzl/spspd/change/levels/painters/TunnelPainter.java b/java/com/hmdzl/spspd/change/levels/painters/TunnelPainter.java deleted file mode 100644 index 80b0f76d..00000000 --- a/java/com/hmdzl/spspd/change/levels/painters/TunnelPainter.java +++ /dev/null @@ -1,121 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels.painters; - -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.Room; -import com.watabou.utils.Point; -import com.watabou.utils.Random; - -public class TunnelPainter extends Painter { - - public static void paint(Level level, Room room) { - - int floor = level.tunnelTile(); - - Point c = room.center(); - - if (room.width() > room.height() - || (room.width() == room.height() && Random.Int(2) == 0)) { - - int from = room.right - 1; - int to = room.left + 1; - - for (Room.Door door : room.connected.values()) { - - int step = door.y < c.y ? +1 : -1; - - if (door.x == room.left) { - - from = room.left + 1; - for (int i = door.y; i != c.y; i += step) { - set(level, from, i, floor); - } - - } else if (door.x == room.right) { - - to = room.right - 1; - for (int i = door.y; i != c.y; i += step) { - set(level, to, i, floor); - } - - } else { - if (door.x < from) { - from = door.x; - } - if (door.x > to) { - to = door.x; - } - - for (int i = door.y + step; i != c.y; i += step) { - set(level, door.x, i, floor); - } - } - } - - for (int i = from; i <= to; i++) { - set(level, i, c.y, floor); - } - - } else { - - int from = room.bottom - 1; - int to = room.top + 1; - - for (Room.Door door : room.connected.values()) { - - int step = door.x < c.x ? +1 : -1; - - if (door.y == room.top) { - - from = room.top + 1; - for (int i = door.x; i != c.x; i += step) { - set(level, i, from, floor); - } - - } else if (door.y == room.bottom) { - - to = room.bottom - 1; - for (int i = door.x; i != c.x; i += step) { - set(level, i, to, floor); - } - - } else { - if (door.y < from) { - from = door.y; - } - if (door.y > to) { - to = door.y; - } - - for (int i = door.x + step; i != c.x; i += step) { - set(level, i, door.y, floor); - } - } - } - - for (int i = from; i <= to; i++) { - set(level, c.x, i, floor); - } - } - - for (Room.Door door : room.connected.values()) { - door.set(Room.Door.Type.TUNNEL); - } - } -} diff --git a/java/com/hmdzl/spspd/change/levels/painters/VaultPainter.java b/java/com/hmdzl/spspd/change/levels/painters/VaultPainter.java deleted file mode 100644 index e7efcdf5..00000000 --- a/java/com/hmdzl/spspd/change/levels/painters/VaultPainter.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels.painters; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.items.Generator; -import com.hmdzl.spspd.change.items.Heap.Type; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.keys.GoldenKey; -import com.hmdzl.spspd.change.items.keys.IronKey; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.Room; -import com.hmdzl.spspd.change.levels.Terrain; -import com.watabou.utils.Random; - -public class VaultPainter extends Painter { - - public static void paint(Level level, Room room) { - - fill(level, room, Terrain.WALL); - fill(level, room, 1, Terrain.EMPTY_SP); - fill( level, room, 2, Terrain.EMPTY ); - - int cx = (room.left + room.right) / 2; - int cy = (room.top + room.bottom) / 2; - int c = cx + cy * Level.getWidth(); - - switch (Random.Int(3)) { - - case 0: case 1: case 2: - Item i1,i2; - do { - i1 = prizeUncursed(level); - i2 = prizeUncursed(level); - } while (i1.getClass() == i2.getClass()); - level.drop(i1, c).type = Type.CRYSTAL_CHEST; - level.drop(i2, c + Level.NEIGHBOURS8[Random.Int(8)]).type = Type.CRYSTAL_CHEST; - level.addItemToSpawn(new GoldenKey(Dungeon.depth)); - break; - - /* - level.drop(prizeUncursed(level), c); - set(level, c, Terrain.PEDESTAL); - break;*/ - } - - room.entrance().set(Room.Door.Type.LOCKED); - level.addItemToSpawn(new IronKey(Dungeon.depth)); - } - - private static Item prize(Level level) { - return Generator.random(Random.oneOf(Generator.Category.WAND, - Generator.Category.RING, Generator.Category.ARTIFACT)); - } - - - private static Item prizeUncursed(Level level) { - - Item item = Generator.random(Random.oneOf(Generator.Category.WAND, Generator.Category.RING, Generator.Category.ARTIFACT)); - - if (item != null && item.cursed && item.isUpgradable()) { - item.cursed = false; - if(item.level<0){item.upgrade(-item.level);} //upgrade to even - } - - return item; - } - -} diff --git a/java/com/hmdzl/spspd/change/levels/painters/WeakFloorPainter.java b/java/com/hmdzl/spspd/change/levels/painters/WeakFloorPainter.java deleted file mode 100644 index afaf7540..00000000 --- a/java/com/hmdzl/spspd/change/levels/painters/WeakFloorPainter.java +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels.painters; - -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.Room; -import com.hmdzl.spspd.change.levels.Terrain; -import com.watabou.utils.Point; -import com.watabou.utils.Random; -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.Room; -import com.hmdzl.spspd.change.levels.Terrain; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.ui.CustomTileVisual; -import com.watabou.utils.Point; -import com.watabou.utils.Random; - -public class WeakFloorPainter extends Painter { - - public static void paint(Level level, Room room) { - - fill(level, room, Terrain.WALL); - fill(level, room, 1, Terrain.CHASM); - - Room.Door door = room.entrance(); - door.set(Room.Door.Type.REGULAR); - - if (door.x == room.left) { - for (int i = room.top + 1; i < room.bottom; i++) { - drawInside(level, room, new Point(room.left, i), - Random.IntRange(1, room.width() - 2), Terrain.EMPTY_SP); - } - } else if (door.x == room.right) { - for (int i = room.top + 1; i < room.bottom; i++) { - drawInside(level, room, new Point(room.right, i), - Random.IntRange(1, room.width() - 2), Terrain.EMPTY_SP); - } - } else if (door.y == room.top) { - for (int i = room.left + 1; i < room.right; i++) { - drawInside(level, room, new Point(i, room.top), - Random.IntRange(1, room.height() - 2), Terrain.EMPTY_SP); - } - } else if (door.y == room.bottom) { - for (int i = room.left + 1; i < room.right; i++) { - drawInside(level, room, new Point(i, room.bottom), - Random.IntRange(1, room.height() - 2), Terrain.EMPTY_SP); - } - } - - Point well = null; - if (door.x == room.left) { - well = new Point( room.right-1, Random.Int( 2 ) == 0 ? room.top + 2 : room.bottom - 1 ); - } else if (door.x == room.right) { - well = new Point( room.left+1, Random.Int( 2 ) == 0 ? room.top + 2 : room.bottom - 1 ); - } else if (door.y == room.top) { - well = new Point( Random.Int( 2 ) == 0 ? room.left + 1 : room.right - 1, room.bottom-1 ); - } else if (door.y == room.bottom) { - well = new Point( Random.Int( 2 ) == 0 ? room.left + 1 : room.right - 1, room.top+2 ); - } - set(level, well, Terrain.CHASM); - CustomTileVisual vis = new HiddenWell(); - vis.pos(well.x, well.y); - level.customTiles.add(vis); - } - - public static class HiddenWell extends CustomTileVisual{ - - { - name = Messages.get(this, "name"); - - tx = Assets.WEAK_FLOOR; - txX = Dungeon.depth/5; - txY = 0; - } - - @Override - public String desc() { - return Messages.get(this, "desc"); - } - } -} diff --git a/java/com/hmdzl/spspd/change/levels/traps/ActivatePortalTrap.java b/java/com/hmdzl/spspd/change/levels/traps/ActivatePortalTrap.java deleted file mode 100644 index 45eb72a3..00000000 --- a/java/com/hmdzl/spspd/change/levels/traps/ActivatePortalTrap.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels.traps; - -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.mobs.npcs.SheepSokoban; -import com.hmdzl.spspd.change.actors.mobs.npcs.SheepSokobanCorner; -import com.hmdzl.spspd.change.actors.mobs.npcs.SheepSokobanSwitch; -import com.hmdzl.spspd.change.items.wands.WandOfFlock; - -public class ActivatePortalTrap { - - public static boolean gen = false; - public static int portPos = 0; - - // 00x66CCEE - - public static void trigger(int pos, Char ch) { - - if (ch instanceof SheepSokoban || ch instanceof SheepSokobanCorner || ch instanceof SheepSokobanSwitch || ch instanceof WandOfFlock.MagicSheep){ - gen = true; - } - } -} diff --git a/java/com/hmdzl/spspd/change/levels/traps/AirTrap.java b/java/com/hmdzl/spspd/change/levels/traps/AirTrap.java deleted file mode 100644 index a836cd0f..00000000 --- a/java/com/hmdzl/spspd/change/levels/traps/AirTrap.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels.traps; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.ResultDescriptions; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Bleeding; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.mobs.npcs.Sheep; -import com.hmdzl.spspd.change.actors.mobs.npcs.SheepSokoban; -import com.hmdzl.spspd.change.actors.mobs.npcs.SheepSokobanBlack; -import com.hmdzl.spspd.change.actors.mobs.npcs.SheepSokobanCorner; -import com.hmdzl.spspd.change.actors.mobs.npcs.SheepSokobanSwitch; -import com.hmdzl.spspd.change.effects.Wound; -import com.hmdzl.spspd.change.effects.particles.ShadowParticle; -import com.hmdzl.spspd.change.items.KindOfArmor; -import com.hmdzl.spspd.change.items.armor.Armor; -import com.hmdzl.spspd.change.items.keys.IronKey; - -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.Terrain; -import com.hmdzl.spspd.change.levels.traps.LightningTrap.Electricity; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.InterlevelScene; -import com.hmdzl.spspd.change.sprites.HeroSprite; -import com.hmdzl.spspd.change.sprites.TrapSprite; -import com.hmdzl.spspd.change.utils.GLog; - -import com.watabou.noosa.Camera; -import com.watabou.noosa.Game; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Random; - -public class AirTrap { - - public static void trigger( int pos, Char ch ) { - - if (ch != null) { - int damage = Random.NormalIntRange(Dungeon.depth, Dungeon.depth*2); - ch.damage(damage,Bleeding.class); - Wound.hit( ch ); - if (ch == Dungeon.hero && !ch.isAlive()) { - Dungeon.fail(Messages.format(ResultDescriptions.TRAP)); - //GLog.n("You bled to death..."); - } - } else { - Wound.hit( pos ); - } - Dungeon.hero.next(); - } - -} diff --git a/java/com/hmdzl/spspd/change/levels/traps/AlarmTrap.java b/java/com/hmdzl/spspd/change/levels/traps/AlarmTrap.java deleted file mode 100644 index 8ed1e97a..00000000 --- a/java/com/hmdzl/spspd/change/levels/traps/AlarmTrap.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * Shattered Pixel Dungeon - * Copyright (C) 2014-2015 Evan Debenham - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels.traps; - -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.TrapSprite; -import com.watabou.noosa.audio.Sample; -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.utils.GLog; - -public class AlarmTrap extends Trap { - - { - color = TrapSprite.RED; - shape = TrapSprite.DOTS; - } - - @Override - public void activate(Char ch) { - super.activate(ch); - - for (Mob mob : Dungeon.level.mobs) { - mob.beckon( pos ); - } - - if (Dungeon.visible[pos]) { - GLog.w( Messages.get(this, "alarm") ); - CellEmitter.center( pos ).start( Speck.factory( Speck.SCREAM ), 0.3f, 3 ); - } - - Sample.INSTANCE.play( Assets.SND_ALERT ); - } -} diff --git a/java/com/hmdzl/spspd/change/levels/traps/BlazingTrap.java b/java/com/hmdzl/spspd/change/levels/traps/BlazingTrap.java deleted file mode 100644 index 27dcb82b..00000000 --- a/java/com/hmdzl/spspd/change/levels/traps/BlazingTrap.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * Shattered Pixel Dungeon - * Copyright (C) 2014-2015 Evan Debenham - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels.traps; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.Blob; -import com.hmdzl.spspd.change.actors.blobs.Fire; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.particles.FlameParticle; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.TrapSprite; -import com.watabou.noosa.audio.Sample; - -public class BlazingTrap extends Trap { - - { - color = TrapSprite.ORANGE; - shape = TrapSprite.STARS; - } - - - @Override - public void activate(Char ch) { - super.activate(ch); - for (int i : Level.NEIGHBOURS9DIST2){ - if (Level.insideMap(pos+i) && !Level.solid[pos+i]) { - if (Level.pit[pos+i] || Level.water[pos+i]) - GameScene.add(Blob.seed(pos + i, 1, Fire.class)); - else - GameScene.add(Blob.seed(pos + i, 5, Fire.class)); - CellEmitter.get(pos + i).burst(FlameParticle.FACTORY, 5); - } - } - Sample.INSTANCE.play(Assets.SND_BURNING); - } -} diff --git a/java/com/hmdzl/spspd/change/levels/traps/ChangeSheepTrap.java b/java/com/hmdzl/spspd/change/levels/traps/ChangeSheepTrap.java deleted file mode 100644 index b38695dd..00000000 --- a/java/com/hmdzl/spspd/change/levels/traps/ChangeSheepTrap.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels.traps; - -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.mobs.npcs.SheepSokoban; -import com.hmdzl.spspd.change.actors.mobs.npcs.SheepSokobanCorner; -import com.hmdzl.spspd.change.actors.mobs.npcs.SheepSokobanStop; -import com.hmdzl.spspd.change.actors.mobs.npcs.SheepSokobanSwitch; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.particles.ElmoParticle; -import com.hmdzl.spspd.change.scenes.GameScene; - -public class ChangeSheepTrap { - - private static final float SPAWN_DELAY = 0.2f; - - // 00x66CCEE - - public static void trigger(int pos, Char ch) { - - if (ch instanceof SheepSokoban) { - ch.destroy(); - ch.sprite.killAndErase(); - CellEmitter.get(pos).burst(ElmoParticle.FACTORY, 6); - SheepSokobanCorner s = new SheepSokobanCorner(); - s.pos = pos; - GameScene.add(s, SPAWN_DELAY); - } - - else if (ch instanceof SheepSokobanCorner) { - ch.destroy(); - ch.sprite.killAndErase(); - CellEmitter.get(pos).burst(ElmoParticle.FACTORY, 6); - SheepSokobanStop s = new SheepSokobanStop(); - s.pos = pos; - GameScene.add(s, SPAWN_DELAY); - - } - - else if (ch instanceof SheepSokobanSwitch) { - ch.destroy(); - ch.sprite.killAndErase(); - CellEmitter.get(pos).burst(ElmoParticle.FACTORY, 6); - SheepSokoban s = new SheepSokoban(); - s.pos = pos; - GameScene.add(s, SPAWN_DELAY); - } - } -} diff --git a/java/com/hmdzl/spspd/change/levels/traps/ChillingTrap.java b/java/com/hmdzl/spspd/change/levels/traps/ChillingTrap.java deleted file mode 100644 index 3813bd36..00000000 --- a/java/com/hmdzl/spspd/change/levels/traps/ChillingTrap.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * Shattered Pixel Dungeon - * Copyright (C) 2014-2015 Evan Debenham - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels.traps; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.ResultDescriptions; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.Blob; -import com.hmdzl.spspd.change.actors.blobs.FrostGas; -import com.hmdzl.spspd.change.actors.buffs.Chill; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Splash; -import com.hmdzl.spspd.change.effects.particles.SnowParticle; -import com.hmdzl.spspd.change.items.Heap; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.TrapSprite; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Random; - -public class ChillingTrap extends Trap{ - - { - color = TrapSprite.WHITE; - shape = TrapSprite.DOTS; - } - - @Override - public void activate(Char ch) { - super.activate(ch); - for (int i : Level.NEIGHBOURS9){ - if (Level.insideMap(pos+i) && !Level.solid[pos+i]) { - GameScene.add(Blob.seed(pos + i, 10, FrostGas.class)); - CellEmitter.get(pos + i).burst(SnowParticle.FACTORY, 5); - } - } - Sample.INSTANCE.play(Assets.SND_SHATTER); - } -} diff --git a/java/com/hmdzl/spspd/change/levels/traps/ConfusionTrap.java b/java/com/hmdzl/spspd/change/levels/traps/ConfusionTrap.java deleted file mode 100644 index d08142d9..00000000 --- a/java/com/hmdzl/spspd/change/levels/traps/ConfusionTrap.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * Shattered Pixel Dungeon - * Copyright (C) 2014-2015 Evan Debenham - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels.traps; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.Blob; -import com.hmdzl.spspd.change.actors.blobs.ConfusionGas; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.TrapSprite; - -public class ConfusionTrap extends Trap { - - { - color = TrapSprite.TEAL; - shape = TrapSprite.GRILL; - } - - @Override - public void activate(Char ch) { - super.activate(ch); - - GameScene.add(Blob.seed(pos, 300 + 20 * Dungeon.depth, ConfusionGas.class)); - - } -} diff --git a/java/com/hmdzl/spspd/change/levels/traps/CursingTrap.java b/java/com/hmdzl/spspd/change/levels/traps/CursingTrap.java deleted file mode 100644 index a4260578..00000000 --- a/java/com/hmdzl/spspd/change/levels/traps/CursingTrap.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * Shattered Pixel Dungeon - * Copyright (C) 2014-2015 Evan Debenham - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels.traps; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.particles.ShadowParticle; -import com.hmdzl.spspd.change.items.*; -import com.hmdzl.spspd.change.items.armor.Armor; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.TrapSprite; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.audio.Sample; - -public class CursingTrap extends Trap { - - { - color = TrapSprite.VIOLET; - shape = TrapSprite.WAVES; - } - - @Override - public void activate(Char ch) { - super.activate(ch); - if (Dungeon.visible[ pos ]) { - CellEmitter.get(pos).burst(ShadowParticle.UP, 5); - Sample.INSTANCE.play(Assets.SND_CURSED); - } - - Heap heap = Dungeon.level.heaps.get( pos ); - if (heap != null){ - for (Item item : heap.items){ - if (item.isUpgradable()) - item.cursed = item.cursedKnown = true; - } - } - - if (Dungeon.hero.pos == pos){ - Hero hero = Dungeon.hero; - KindOfWeapon weapon = hero.belongings.weapon; - KindOfArmor armor = hero.belongings.armor; - KindofMisc misc1 = hero.belongings.misc1; - KindofMisc misc2 = hero.belongings.misc2; - KindofMisc misc3 = hero.belongings.misc3; - if (weapon != null) weapon.cursed = weapon.cursedKnown = true; - if (armor != null) armor.cursed = armor.cursedKnown = true; - if (misc1 != null) misc1.cursed = misc1.cursedKnown = true; - if (misc2 != null) misc2.cursed = misc2.cursedKnown = true; - if (misc3 != null) misc3.cursed = misc3.cursedKnown = true; - EquipableItem.equipCursed(hero); - GLog.n( Messages.get(this, "curse") ); - } - } -} diff --git a/java/com/hmdzl/spspd/change/levels/traps/DisarmingTrap.java b/java/com/hmdzl/spspd/change/levels/traps/DisarmingTrap.java deleted file mode 100644 index bda92096..00000000 --- a/java/com/hmdzl/spspd/change/levels/traps/DisarmingTrap.java +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * Shattered Pixel Dungeon - * Copyright (C) 2014-2015 Evan Debenham - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels.traps; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.Heap; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.KindOfWeapon; -import com.hmdzl.spspd.change.items.weapon.melee.FightGloves; -import com.hmdzl.spspd.change.items.weapon.melee.Knuckles; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.TrapSprite; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.audio.Sample; - -public class DisarmingTrap extends Trap{ - - { - color = TrapSprite.RED; - shape = TrapSprite.LARGE_DOT; - } - - @Override - public void activate(Char ch) { - super.activate(ch); - Heap heap = Dungeon.level.heaps.get( pos ); - - if (heap != null){ - int cell = Dungeon.level.randomRespawnCell(); - - if (cell != -1) { - Item item = heap.pickUp(); - Dungeon.level.drop( item, cell ).seen = true; - for (int i : Level.NEIGHBOURS9) - Dungeon.level.visited[cell+i] = true; - Dungeon.observe(); - - Sample.INSTANCE.play(Assets.SND_TELEPORT); - CellEmitter.get(pos).burst(Speck.factory(Speck.LIGHT), 4); - } - } - - if (Dungeon.hero.pos == pos){ - Hero hero = Dungeon.hero; - KindOfWeapon weapon = hero.belongings.weapon; - - if (weapon != null && !(weapon instanceof Knuckles || weapon instanceof FightGloves) && !weapon.cursed) { - - int cell = Dungeon.level.randomRespawnCell(); - if (cell != -1) { - hero.belongings.weapon = null; - Dungeon.quickslot.clearItem(weapon); - weapon.updateQuickslot(); - - Dungeon.level.drop(weapon, cell).seen = true; - for (int i : Level.NEIGHBOURS9) - Dungeon.level.visited[cell+i] = true; - Dungeon.observe(); - - GLog.w( Messages.get(this, "disarm") ); - - Sample.INSTANCE.play(Assets.SND_TELEPORT); - CellEmitter.get(pos).burst(Speck.factory(Speck.LIGHT), 4); - - } - - } - } - } -} diff --git a/java/com/hmdzl/spspd/change/levels/traps/DisintegrationTrap.java b/java/com/hmdzl/spspd/change/levels/traps/DisintegrationTrap.java deleted file mode 100644 index a5423af9..00000000 --- a/java/com/hmdzl/spspd/change/levels/traps/DisintegrationTrap.java +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * Shattered Pixel Dungeon - * Copyright (C) 2014-2015 Evan Debenham - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels.traps; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.DungeonTilemap; -import com.hmdzl.spspd.change.ResultDescriptions; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.Beam; -import com.hmdzl.spspd.change.items.Heap; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.bags.Bag; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.TrapSprite; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Random; - -public class DisintegrationTrap extends Trap { - - { - color = TrapSprite.VIOLET; - shape = TrapSprite.LARGE_DOT; - } - - @Override - public void activate(Char ch) { - super.activate(ch); - - if (Dungeon.visible[ pos ]) { - sprite.parent.add( new Beam.DeathRay( DungeonTilemap.tileCenterToWorld(pos-1), - DungeonTilemap.tileCenterToWorld(pos+1))); - sprite.parent.add(new Beam.DeathRay(DungeonTilemap.tileCenterToWorld(pos - Level.WIDTH), - DungeonTilemap.tileCenterToWorld(pos + Level.WIDTH))); - Sample.INSTANCE.play( Assets.SND_RAY ); - } - - Heap heap = Dungeon.level.heaps.get(pos); - if (heap != null) heap.explode(); - - //Char ch = Actor.findChar(pos); - if (ch != null){ - ch.damage( Math.max( ch.HT/5, Random.Int(ch.HP / 2, 2 * ch.HP / 3) ), this ); - if (ch == Dungeon.hero){ - Hero hero = (Hero)ch; - if (!hero.isAlive()){ - Dungeon.fail(ResultDescriptions.TRAP); - //GLog.n( Messages.get(this, "ondeath") ); - } else { - Item item = hero.belongings.randomUnequipped(); - Bag bag = hero.belongings.backpack; - //bags do not protect against this trap - if (item instanceof Bag){ - bag = (Bag)item; - item = Random.element(bag.items); - } - if (item == null || item.level > 0 || item.unique ) return; - if (!item.stackable){ - item.detachAll(bag); - GLog.w( Messages.get(this, "one", item.name()) ); - } else { - int n = Random.NormalIntRange(1, (item.quantity()+1)/2); - for(int i = 1; i <= n; i++) - item.detach(bag); - GLog.w( Messages.get(this, "some", item.name()) ); - } - } - } - } - - } -} diff --git a/java/com/hmdzl/spspd/change/levels/traps/DistortionTrap.java b/java/com/hmdzl/spspd/change/levels/traps/DistortionTrap.java deleted file mode 100644 index 99a6c9fc..00000000 --- a/java/com/hmdzl/spspd/change/levels/traps/DistortionTrap.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * Shattered Pixel Dungeon - * Copyright (C) 2014-2015 Evan Debenham - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels.traps; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.keys.Key; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.scenes.InterlevelScene; -import com.hmdzl.spspd.change.sprites.TrapSprite; -import com.watabou.noosa.Game; - -public class DistortionTrap extends Trap{ - - { - color = TrapSprite.TEAL; - shape = TrapSprite.LARGE_DOT; - } - - @Override - public void activate(Char ch) { - super.activate(ch); - InterlevelScene.returnDepth = Dungeon.depth; - for (Item item : Dungeon.hero.belongings.backpack.items.toArray( new Item[0])){ - if (item instanceof Key && ((Key)item).depth == Dungeon.depth){ - item.detachAll(Dungeon.hero.belongings.backpack); - } - } - InterlevelScene.mode = InterlevelScene.Mode.RESET; - Game.switchScene(InterlevelScene.class); - } -} diff --git a/java/com/hmdzl/spspd/change/levels/traps/ExplosiveTrap.java b/java/com/hmdzl/spspd/change/levels/traps/ExplosiveTrap.java deleted file mode 100644 index eb425fef..00000000 --- a/java/com/hmdzl/spspd/change/levels/traps/ExplosiveTrap.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * Shattered Pixel Dungeon - * Copyright (C) 2014-2015 Evan Debenham - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels.traps; - -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.items.bombs.Bomb; -import com.hmdzl.spspd.change.items.bombs.BuildBomb; -import com.hmdzl.spspd.change.items.bombs.MiniBomb; -import com.hmdzl.spspd.change.sprites.TrapSprite; - -public class ExplosiveTrap extends Trap { - - { - color = TrapSprite.ORANGE; - shape = TrapSprite.DIAMOND; - } - - @Override - public void activate(Char ch) { - super.activate(ch); - new BuildBomb().explode(pos); - } - -} diff --git a/java/com/hmdzl/spspd/change/levels/traps/FireTrap.java b/java/com/hmdzl/spspd/change/levels/traps/FireTrap.java deleted file mode 100644 index 3097151d..00000000 --- a/java/com/hmdzl/spspd/change/levels/traps/FireTrap.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * Shattered Pixel Dungeon - * Copyright (C) 2014-2015 Evan Debenham - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels.traps; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.Blob; -import com.hmdzl.spspd.change.actors.blobs.Fire; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.particles.FlameParticle; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.TrapSprite; -import com.watabou.noosa.audio.Sample; - -public class FireTrap extends Trap { - - { - color = TrapSprite.ORANGE; - shape = TrapSprite.DOTS; - } - - @Override - public void activate(Char ch) { - super.activate(ch); - for (int i : Level.NEIGHBOURS9){ - if (Level.insideMap(pos+i) && !Level.solid[pos+i]) { - if (Level.pit[pos+i] || Level.water[pos+i]) - GameScene.add(Blob.seed(pos + i, 1, Fire.class)); - else - GameScene.add(Blob.seed(pos + i, 2, Fire.class)); - CellEmitter.get(pos + i).burst(FlameParticle.FACTORY, 5); - } - } - Sample.INSTANCE.play(Assets.SND_BURNING); - } -} diff --git a/java/com/hmdzl/spspd/change/levels/traps/FlashingTrap.java b/java/com/hmdzl/spspd/change/levels/traps/FlashingTrap.java deleted file mode 100644 index 34f8afc6..00000000 --- a/java/com/hmdzl/spspd/change/levels/traps/FlashingTrap.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * Shattered Pixel Dungeon - * Copyright (C) 2014-2015 Evan Debenham - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels.traps; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Blindness; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Cripple; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.Heap; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.TrapSprite; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Random; - -public class FlashingTrap extends Trap { - - { - color = TrapSprite.YELLOW; - shape = TrapSprite.STARS; - } - - @Override - public void activate(Char ch) { - super.activate(ch); - //Char ch = Actor.findChar(pos); - - Heap heap = Dungeon.level.heaps.get(pos); - if (heap != null) {heap.light();} - - if (ch != null) { - int len = Random.Int(5, 10)+Dungeon.depth; - Buff.prolong( ch, Blindness.class, len ); - Buff.prolong( ch, Cripple.class, len ); - if (ch instanceof Mob) { - if (((Mob)ch).state == ((Mob)ch).HUNTING) ((Mob)ch).state = ((Mob)ch).WANDERING; - ((Mob)ch).beckon( Dungeon.level.randomDestination() ); - } - if (ch == Dungeon.hero){ - Sample.INSTANCE.play( Assets.SND_BLAST ); - } - } - - if (Dungeon.visible[pos]) { - GameScene.flash(0xFFFFFF); - CellEmitter.get(pos).burst( Speck.factory(Speck.LIGHT), 4 ); - } - } - -} diff --git a/java/com/hmdzl/spspd/change/levels/traps/FleecingTrap.java b/java/com/hmdzl/spspd/change/levels/traps/FleecingTrap.java deleted file mode 100644 index 717febab..00000000 --- a/java/com/hmdzl/spspd/change/levels/traps/FleecingTrap.java +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels.traps; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.ResultDescriptions; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.mobs.npcs.Sheep; -import com.hmdzl.spspd.change.actors.mobs.npcs.SheepSokoban; -import com.hmdzl.spspd.change.actors.mobs.npcs.SheepSokobanBlack; -import com.hmdzl.spspd.change.actors.mobs.npcs.SheepSokobanCorner; -import com.hmdzl.spspd.change.actors.mobs.npcs.SheepSokobanSwitch; -import com.hmdzl.spspd.change.effects.particles.ShadowParticle; -import com.hmdzl.spspd.change.items.KindOfArmor; -import com.hmdzl.spspd.change.items.armor.Armor; -import com.hmdzl.spspd.change.items.keys.IronKey; - -import com.hmdzl.spspd.change.items.wands.WandOfFlock; -import com.hmdzl.spspd.change.levels.traps.LightningTrap.Electricity; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.InterlevelScene; -import com.hmdzl.spspd.change.sprites.HeroSprite; -import com.hmdzl.spspd.change.utils.GLog; - -import com.watabou.noosa.Camera; -import com.watabou.noosa.Game; - -public class FleecingTrap { - - // 00x66CCEE - - public static void trigger(int pos, Char ch) { - - if (ch instanceof SheepSokoban || ch instanceof SheepSokobanCorner || ch instanceof SheepSokobanSwitch || ch instanceof Sheep || ch instanceof WandOfFlock.MagicSheep - || ch instanceof SheepSokobanBlack){ - Camera.main.shake(2, 0.3f); - ch.destroy(); - ch.sprite.killAndErase(); - ch.sprite.emitter().burst(ShadowParticle.UP, 5); - - } else if (ch != null) { - - int dmg = ch.HP; - boolean port=true; - - if (ch == Dungeon.hero) { - - Hero hero = Dungeon.hero; - - KindOfArmor armor = hero.belongings.armor; - if (armor!=null){ - hero.belongings.armor=null; - GLog.n(Messages.get(FleecingTrap.class, "destroy")); - ((HeroSprite) hero.sprite).updateArmor(); - dmg=dmg-1; - port=false; - } - - } - - //Port back to 1,1 or something - - Camera.main.shake(2, 0.3f); - ch.sprite.emitter().burst(ShadowParticle.UP, 5); - - if (ch == Dungeon.hero && port) { - IronKey key = ((Hero)ch).belongings.getKey(IronKey.class, Dungeon.depth); - if (key!=null){key.detachAll(Dungeon.hero.belongings.backpack);} - InterlevelScene.mode = InterlevelScene.Mode.SOKOBANFAIL; - Game.switchScene(InterlevelScene.class); - } - - if (ch == Dungeon.hero) { - - Camera.main.shake(2, 0.3f); - - if (!ch.isAlive()) { - Dungeon.fail(Messages.format(ResultDescriptions.TRAP)); - } - } - } - - Dungeon.hero.next(); - - } - - public static final Fleece FLEECE = new Fleece(); - - public static class Fleece { - } - - -} diff --git a/java/com/hmdzl/spspd/change/levels/traps/FlockTrap.java b/java/com/hmdzl/spspd/change/levels/traps/FlockTrap.java deleted file mode 100644 index 2b81923e..00000000 --- a/java/com/hmdzl/spspd/change/levels/traps/FlockTrap.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * Shattered Pixel Dungeon - * Copyright (C) 2014-2015 Evan Debenham - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels.traps; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.mobs.npcs.Sheep; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.Heap; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.TrapSprite; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Random; - -public class FlockTrap extends Trap { - - { - color = TrapSprite.WHITE; - shape = TrapSprite.WAVES; - } - - - @Override - public void activate(Char ch) { - super.activate(ch); - //use an actor as we want to put this on a slight delay so all chars get a chance to act this turn first. - Actor.add(new Actor() { - - protected boolean act() { - int cell; - for (int i : Level.NEIGHBOURS9DIST2) { - cell = pos + i; - if (Level.insideMap(cell) && Actor.findChar(cell) == null && !(Level.solid[cell] || Level.pit[cell])) { - Sheep sheep = new Sheep(); - sheep.lifespan = 2 + Random.Int(Dungeon.depth + 10); - sheep.pos = cell; - GameScene.add(sheep); - } - CellEmitter.get(cell).burst(Speck.factory(Speck.WOOL), 4); - } - Sample.INSTANCE.play(Assets.SND_PUFF); - Actor.remove(this); - return true; - } - }); - - Heap heap = Dungeon.level.heaps.get(pos); - if (heap != null) {heap.summon();} - } - -} diff --git a/java/com/hmdzl/spspd/change/levels/traps/FrostTrap.java b/java/com/hmdzl/spspd/change/levels/traps/FrostTrap.java deleted file mode 100644 index 1a3027d7..00000000 --- a/java/com/hmdzl/spspd/change/levels/traps/FrostTrap.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * Shattered Pixel Dungeon - * Copyright (C) 2014-2015 Evan Debenham - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels.traps; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.ResultDescriptions; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.Blob; -import com.hmdzl.spspd.change.actors.blobs.FrostGas; -import com.hmdzl.spspd.change.actors.buffs.Chill; -import com.hmdzl.spspd.change.actors.buffs.Frost; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Splash; -import com.hmdzl.spspd.change.effects.particles.SnowParticle; -import com.hmdzl.spspd.change.items.Heap; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.TrapSprite; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Random; - -public class FrostTrap extends Trap { - - { - color = TrapSprite.WHITE; - shape = TrapSprite.STARS; - } - - @Override - public void activate(Char ch) { - super.activate(ch); - for (int i : Level.NEIGHBOURS9DIST2){ - if (Level.insideMap(pos+i) && !Level.solid[pos+i]) { - GameScene.add(Blob.seed(pos + i, 20, FrostGas.class)); - CellEmitter.get(pos + i).burst(SnowParticle.FACTORY, 5); - } - } - Sample.INSTANCE.play(Assets.SND_SHATTER); - } -} diff --git a/java/com/hmdzl/spspd/change/levels/traps/GrimTrap.java b/java/com/hmdzl/spspd/change/levels/traps/GrimTrap.java deleted file mode 100644 index 7db312da..00000000 --- a/java/com/hmdzl/spspd/change/levels/traps/GrimTrap.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * Shattered Pixel Dungeon - * Copyright (C) 2014-2015 Evan Debenham - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels.traps; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.ResultDescriptions; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.MagicMissile; -import com.hmdzl.spspd.change.effects.Wound; -import com.hmdzl.spspd.change.effects.particles.ShadowParticle; -import com.hmdzl.spspd.change.items.Heap; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.mechanics.Ballistica; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.TrapSprite; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Callback; -import com.watabou.utils.Random; - -public class GrimTrap extends Trap { - - { - color = TrapSprite.GREY; - shape = TrapSprite.LARGE_DOT; - } - - @Override - public Trap hide() { - //cannot hide this trap - return reveal(); - } - - @Override - public void activate(Char ch) { - - if (Dungeon.visible[pos]){ - Sample.INSTANCE.play(Assets.SND_HIT); - Wound.hit(pos); - } - - //Char ch = Actor.findChar( pos); - if (ch != null){ - int damage = Random.NormalIntRange(ch.HP/2,ch.HP); - damage -= Random.IntRange( ch.drRoll()/2, ch.drRoll()); - ch.damage( Math.max(damage, 0) , this); - if (!ch.isAlive() && ch == Dungeon.hero){ - Dungeon.fail(ResultDescriptions.TRAP); - //GLog.n( Messages.get(this, "ondeath") ); - } - } - } -} diff --git a/java/com/hmdzl/spspd/change/levels/traps/GrippingTrap.java b/java/com/hmdzl/spspd/change/levels/traps/GrippingTrap.java deleted file mode 100644 index 87e2ac82..00000000 --- a/java/com/hmdzl/spspd/change/levels/traps/GrippingTrap.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * Shattered Pixel Dungeon - * Copyright (C) 2014-2015 Evan Debenham - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels.traps; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Bleeding; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Cripple; -import com.hmdzl.spspd.change.actors.buffs.Roots; -import com.hmdzl.spspd.change.effects.Wound; -import com.hmdzl.spspd.change.items.Heap; -import com.hmdzl.spspd.change.sprites.TrapSprite; -import com.watabou.utils.Random; - -public class GrippingTrap extends Trap { - - { - color = TrapSprite.GREY; - shape = TrapSprite.CROSSHAIR; - } - - @Override - public void activate(Char ch) { - //super.activate(ch); - Char c = Actor.findChar( pos ); - - if (c != null) { - int damage = Math.max( 0, (Dungeon.depth) - Random.IntRange( 0, c.drRoll() / 2 ) ); - Buff.affect( c, Bleeding.class ).set( damage ); - Buff.prolong( c, Cripple.class, 15f); - Buff.prolong( c, Roots.class, 5f); - Wound.hit( c ); - } else { - Wound.hit( pos ); - } - Heap heap = Dungeon.level.heaps.get(pos); - if (heap != null) {heap.poison();} - - } -} diff --git a/java/com/hmdzl/spspd/change/levels/traps/GuardianTrap.java b/java/com/hmdzl/spspd/change/levels/traps/GuardianTrap.java deleted file mode 100644 index 4c279d77..00000000 --- a/java/com/hmdzl/spspd/change/levels/traps/GuardianTrap.java +++ /dev/null @@ -1,114 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * Shattered Pixel Dungeon - * Copyright (C) 2014-2015 Evan Debenham - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels.traps; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.Statistics; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.actors.mobs.Statue; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.Heap; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.StatueSprite; -import com.hmdzl.spspd.change.sprites.TrapSprite; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.audio.Sample; - -public class GuardianTrap extends Trap { - - { - color = TrapSprite.RED; - shape = TrapSprite.STARS; - } - - @Override - public void activate(Char ch) { - super.activate(ch); - for (Mob mob : Dungeon.level.mobs) { - mob.beckon( pos ); - } - - if (Dungeon.visible[pos]) { - GLog.w( Messages.get(this, "alarm") ); - CellEmitter.center(pos).start( Speck.factory(Speck.SCREAM), 0.3f, 3 ); - } - - Sample.INSTANCE.play( Assets.SND_ALERT ); - - for (int i = 0; i < (Dungeon.depth - 5)/5; i++){ - Guardian guardian = new Guardian(); - guardian.state = guardian.WANDERING; - guardian.pos = Dungeon.level.randomRespawnCell(); - GameScene.add(guardian); - guardian.beckon(Dungeon.hero.pos ); - } - Heap heap = Dungeon.level.heaps.get(pos); - if (heap != null) {heap.summon();} - - } - - public static class Guardian extends Statue { - - { - spriteClass = GuardianSprite.class; - - EXP = 0; - state = WANDERING; - } - - public Guardian(){ - super(); - - //weapon.enchant(null); - //weapon.degrade(weapon.level); - } - - @Override - public void beckon(int cell) { - //Beckon works on these ones, unlike their superclass. - notice(); - - if (state != HUNTING) { - state = WANDERING; - } - target = cell; - } - - } - - public static class GuardianSprite extends StatueSprite { - - public GuardianSprite(){ - super(); - tint(0, 0, 1, 0.2f); - } - - @Override - public void resetColor() { - super.resetColor(); - tint(0, 0, 1, 0.2f); - } - } -} diff --git a/java/com/hmdzl/spspd/change/levels/traps/HeapGenTrap.java b/java/com/hmdzl/spspd/change/levels/traps/HeapGenTrap.java deleted file mode 100644 index 24637d9e..00000000 --- a/java/com/hmdzl/spspd/change/levels/traps/HeapGenTrap.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels.traps; - -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.mobs.npcs.SheepSokoban; -import com.hmdzl.spspd.change.actors.mobs.npcs.SheepSokobanCorner; -import com.hmdzl.spspd.change.actors.mobs.npcs.SheepSokobanSwitch; -import com.hmdzl.spspd.change.items.wands.WandOfFlock; - -public class HeapGenTrap { - - public static boolean gen = false; - - // 00x66CCEE - - public static void trigger(int pos, Char ch) { - - if (ch instanceof SheepSokoban || ch instanceof SheepSokobanCorner || ch instanceof SheepSokobanSwitch || ch instanceof WandOfFlock.MagicSheep){ - gen = true; - } - } -} diff --git a/java/com/hmdzl/spspd/change/levels/traps/LightningTrap.java b/java/com/hmdzl/spspd/change/levels/traps/LightningTrap.java deleted file mode 100644 index 830263fd..00000000 --- a/java/com/hmdzl/spspd/change/levels/traps/LightningTrap.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * Shattered Pixel Dungeon - * Copyright (C) 2014-2015 Evan Debenham - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels.traps; - -import com.hmdzl.spspd.change.ResultDescriptions; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.items.Heap; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.wands.Wand; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.TrapSprite; -import com.watabou.noosa.Camera; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Lightning; -import com.hmdzl.spspd.change.effects.particles.SparkParticle; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.utils.Random; - -import java.util.ArrayList; - -public class LightningTrap extends Trap { - - { - color = TrapSprite.TEAL; - shape = TrapSprite.CROSSHAIR; - } - - @Override - public void activate(Char ch) { - super.activate(ch); - - //Char ch = Actor.findChar( pos ); - - if (ch != null) { - ch.damage( Math.max( 1, Random.Int( ch.HP / 3, 2 * ch.HP / 3 ) ), LIGHTNING ); - if (ch == Dungeon.hero) { - - Camera.main.shake( 2, 0.3f ); - - if (!ch.isAlive()) { - Dungeon.fail(ResultDescriptions.TRAP); - GLog.n( Messages.get(this, "ondeath") ); - } - } - - ArrayList arcs = new ArrayList<>(); - arcs.add(new Lightning.Arc(pos - Level.WIDTH, pos + Level.WIDTH)); - arcs.add(new Lightning.Arc(pos - 1, pos + 1)); - - ch.sprite.parent.add( new Lightning( arcs, null ) ); - } - - Heap heap = Dungeon.level.heaps.get(pos); - if (heap != null){ - //TODO: this should probably charge staffs too - Item item = heap.items.peek(); - if (item instanceof Wand){ - Wand wand = (Wand)item; - ((Wand)item).curCharges += (int)Math.ceil((wand.maxCharges - wand.curCharges)/2f); - } - heap.lit(); - } - - CellEmitter.center( pos ).burst( SparkParticle.FACTORY, Random.IntRange( 3, 4 ) ); - } - - //FIXME: this is bad, handle when you rework resistances, make into a category - public static final Electricity LIGHTNING = new Electricity(); - public static class Electricity { - } -} diff --git a/java/com/hmdzl/spspd/change/levels/traps/OozeTrap.java b/java/com/hmdzl/spspd/change/levels/traps/OozeTrap.java deleted file mode 100644 index f252c31d..00000000 --- a/java/com/hmdzl/spspd/change/levels/traps/OozeTrap.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * Shattered Pixel Dungeon - * Copyright (C) 2014-2015 Evan Debenham - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels.traps; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Ooze; -import com.hmdzl.spspd.change.effects.Splash; -import com.hmdzl.spspd.change.items.Heap; -import com.hmdzl.spspd.change.sprites.TrapSprite; - -public class OozeTrap extends Trap { - - { - color = TrapSprite.GREEN; - shape = TrapSprite.DOTS; - } - - @Override - public void activate(Char ch) { - super.activate(ch); - //Char ch = Actor.findChar( pos ); - - if (ch != null){ - Buff.affect(ch, Ooze.class); - Splash.at(sprite.center(), 0x000000, 5); - } - Heap heap = Dungeon.level.heaps.get(pos); - if (heap != null) {heap.poison();} - } -} diff --git a/java/com/hmdzl/spspd/change/levels/traps/ParalyticTrap.java b/java/com/hmdzl/spspd/change/levels/traps/ParalyticTrap.java deleted file mode 100644 index 520458fd..00000000 --- a/java/com/hmdzl/spspd/change/levels/traps/ParalyticTrap.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * Shattered Pixel Dungeon - * Copyright (C) 2014-2015 Evan Debenham - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels.traps; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.Blob; -import com.hmdzl.spspd.change.actors.blobs.ParalyticGas; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.TrapSprite; - -public class ParalyticTrap extends Trap{ - - { - color = TrapSprite.YELLOW; - shape = TrapSprite.GRILL; - } - - @Override - public void activate(Char ch) { - super.activate(ch); - - GameScene.add( Blob.seed( pos, 80 + 5 * Dungeon.depth, ParalyticGas.class ) ); - - } -} diff --git a/java/com/hmdzl/spspd/change/levels/traps/PitfallTrap.java b/java/com/hmdzl/spspd/change/levels/traps/PitfallTrap.java deleted file mode 100644 index 7c1c479b..00000000 --- a/java/com/hmdzl/spspd/change/levels/traps/PitfallTrap.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * Shattered Pixel Dungeon - * Copyright (C) 2014-2015 Evan Debenham - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels.traps; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.effects.particles.WindParticle; -import com.hmdzl.spspd.change.items.Heap; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.Terrain; -import com.hmdzl.spspd.change.levels.features.Chasm; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.TrapSprite; - -public class PitfallTrap extends Trap { - - { - color = TrapSprite.RED; - shape = TrapSprite.DIAMOND; - } - - @Override - public void activate(Char ch) { - super.activate(ch); - Heap heap = Dungeon.level.heaps.get( pos ); - - if (heap != null){ - for (Item item : heap.items){ - Dungeon.dropToChasm(item); - } - heap.sprite.kill(); - GameScene.discard(heap); - Dungeon.level.heaps.remove( pos ); - } - - //Char ch = Actor.findChar( pos ); - - if (ch == Dungeon.hero){ - Chasm.heroFall( pos ); - } else if (ch != null){ - Chasm.mobFall((Mob)ch); - } - } - - /*@Override - protected void disarm() { - super.disarm(); - - //if making a pit here wouldn't block any paths, make a pit tile instead of a disarmed trap tile. - if (!(Dungeon.level.solid[pos - Level.WIDTH] && Dungeon.level.solid[pos + Level.WIDTH]) - && !(Dungeon.level.solid[pos - 1]&& Dungeon.level.solid[pos + 1])){ - - int c = Dungeon.level.map[pos - Level.WIDTH]; - - if (c == Terrain.WALL || c == Terrain.WALL_DECO) { - Level.set(pos, Terrain.CHASM_WALL); - } else { - Level.set( pos, Terrain.CHASM_FLOOR ); - } - - sprite.parent.add(new WindParticle.Wind(pos)); - sprite.kill(); - GameScene.updateMap( pos ); - } - }*/ -} diff --git a/java/com/hmdzl/spspd/change/levels/traps/PoisonTrap.java b/java/com/hmdzl/spspd/change/levels/traps/PoisonTrap.java deleted file mode 100644 index 690e0f88..00000000 --- a/java/com/hmdzl/spspd/change/levels/traps/PoisonTrap.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * Shattered Pixel Dungeon - * Copyright (C) 2014-2015 Evan Debenham - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels.traps; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Poison; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.particles.PoisonParticle; -import com.hmdzl.spspd.change.items.Heap; -import com.hmdzl.spspd.change.sprites.TrapSprite; - -public class PoisonTrap extends Trap{ - - { - color = TrapSprite.VIOLET; - shape = TrapSprite.CROSSHAIR; - } - - @Override - public void activate(Char ch) { - super.activate(ch); - - //Char ch = Actor.findChar( pos ); - - if (ch != null) { - Buff.affect( ch, Poison.class ).set( Poison.durationFactor( ch ) * (4 + Dungeon.depth / 2) ); - } - - CellEmitter.center( pos ).burst( PoisonParticle.SPLASH, 3 ); - Heap heap = Dungeon.level.heaps.get(pos); - if (heap != null) {heap.poison();} - - } -} diff --git a/java/com/hmdzl/spspd/change/levels/traps/RockfallTrap.java b/java/com/hmdzl/spspd/change/levels/traps/RockfallTrap.java deleted file mode 100644 index 55481675..00000000 --- a/java/com/hmdzl/spspd/change/levels/traps/RockfallTrap.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * Shattered Pixel Dungeon - * Copyright (C) 2014-2015 Evan Debenham - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels.traps; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.ResultDescriptions; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Paralysis; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.TrapSprite; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.Camera; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Random; - -public class RockfallTrap extends Trap { - - { - color = TrapSprite.GREY; - shape = TrapSprite.DIAMOND; - } - - @Override - public void activate(Char ch) { - super.activate(ch); - - boolean seen = false; - - for (int i : Level.NEIGHBOURS9){ - - if (Level.solid[pos+i]) - continue; - - if (Dungeon.visible[ pos+i ]){ - CellEmitter.get( pos + i - Level.WIDTH ).start(Speck.factory(Speck.ROCK), 0.07f, 10); - if (!seen) { - Camera.main.shake(3, 0.7f); - Sample.INSTANCE.play(Assets.SND_ROCKS); - seen = true; - } - } - - //Char ch = Actor.findChar( pos+i ); - - if (ch != null){ - int damage = Random.NormalIntRange(Dungeon.depth, Dungeon.depth*2); - damage -= Random.IntRange( 0, ch.drRoll()); - ch.damage( Math.max(damage, 0) , this); - - Buff.prolong( ch, Paralysis.class, Paralysis.duration(ch)/2); - - if (!ch.isAlive() && ch == Dungeon.hero){ - Dungeon.fail( ResultDescriptions.TRAP ); - GLog.n( Messages.get(this, "ondeath") ); - } - } - } - - } -} diff --git a/java/com/hmdzl/spspd/change/levels/traps/ShockTrap.java b/java/com/hmdzl/spspd/change/levels/traps/ShockTrap.java deleted file mode 100644 index a95c5898..00000000 --- a/java/com/hmdzl/spspd/change/levels/traps/ShockTrap.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * Shattered Pixel Dungeon - * Copyright (C) 2014-2015 Evan Debenham - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels.traps; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.Blob; -import com.hmdzl.spspd.change.actors.blobs.ElectriShock; -import com.hmdzl.spspd.change.actors.blobs.Fire; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.particles.EnergyParticle; -import com.hmdzl.spspd.change.effects.particles.FlameParticle; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.TrapSprite; -import com.watabou.noosa.audio.Sample; - -public class ShockTrap extends Trap { - - { - color = TrapSprite.GREEN; - shape = TrapSprite.DIAMOND; - } - - @Override - public void activate(Char ch) { - super.activate(ch); - for (int i : Level.NEIGHBOURS9){ - if (Level.insideMap(pos+i) && !Level.solid[pos+i]) { - GameScene.add(Blob.seed(pos + i, 10, ElectriShock.class)); - CellEmitter.get(pos + i).burst(EnergyParticle.FACTORY, 5); - } - } - Sample.INSTANCE.play(Assets.SND_ZAP); - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/levels/traps/SokobanPortalTrap.java b/java/com/hmdzl/spspd/change/levels/traps/SokobanPortalTrap.java deleted file mode 100644 index a3aa5151..00000000 --- a/java/com/hmdzl/spspd/change/levels/traps/SokobanPortalTrap.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels.traps; - -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfTeleportation; - -public class SokobanPortalTrap { - - public static int portPos = 0; - - // 00x66CCEE - - public static void trigger(int pos, Char ch, int dest) { - - if (ch instanceof Hero ){ - //teleport ch to dest from pos teleport scroll - ScrollOfTeleportation.teleportHeroLocation((Hero) ch,dest); - //GLog.i("teleport to, %s",dest); - - } - } -} diff --git a/java/com/hmdzl/spspd/change/levels/traps/SpearTrap.java b/java/com/hmdzl/spspd/change/levels/traps/SpearTrap.java deleted file mode 100644 index fafe717a..00000000 --- a/java/com/hmdzl/spspd/change/levels/traps/SpearTrap.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * Shattered Pixel Dungeon - * Copyright (C) 2014-2015 Evan Debenham - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels.traps; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.ResultDescriptions; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.effects.Wound; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.Terrain; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.TrapSprite; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Random; - -public class SpearTrap extends Trap { - - { - color = TrapSprite.GREY; - shape = TrapSprite.DOTS; - } - - public void trigger() { - if (Dungeon.visible[pos]){ - Sample.INSTANCE.play(Assets.SND_TRAP); - } - //this trap is not disarmed by being triggered - reveal(); - Level.set(pos, Terrain.TRAP); - } - - @Override - public void activate(Char ch) { - //super.activate(ch); - if (Dungeon.visible[pos]){ - Sample.INSTANCE.play(Assets.SND_HIT); - Wound.hit(pos); - } - - //Char ch = Actor.findChar( pos); - if (ch != null){ - int damage = Random.NormalIntRange(Dungeon.depth, Dungeon.depth*2); - damage -= Random.IntRange( 0, ch.drRoll()); - ch.damage( Math.max(damage, 0) , this); - if (!ch.isAlive() && ch == Dungeon.hero){ - Dungeon.fail(ResultDescriptions.TRAP); - //GLog.n( Messages.get(this, "ondeath") ); - } - } - } -} diff --git a/java/com/hmdzl/spspd/change/levels/traps/StormTrap.java b/java/com/hmdzl/spspd/change/levels/traps/StormTrap.java deleted file mode 100644 index 4d80647d..00000000 --- a/java/com/hmdzl/spspd/change/levels/traps/StormTrap.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * Shattered Pixel Dungeon - * Copyright (C) 2014-2015 Evan Debenham - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels.traps; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.Blob; -import com.hmdzl.spspd.change.actors.blobs.ElectriShock; -import com.hmdzl.spspd.change.actors.blobs.Fire; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.particles.EnergyParticle; -import com.hmdzl.spspd.change.effects.particles.FlameParticle; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.TrapSprite; -import com.watabou.noosa.audio.Sample; - -public class StormTrap extends Trap { - - { - color = TrapSprite.GREEN; - shape = TrapSprite.LARGE_DOT; - } - - @Override - public void activate(Char ch) { - super.activate(ch); - for (int i : Level.NEIGHBOURS9DIST2){ - if (Level.insideMap(pos+i) && !Level.solid[pos+i]) { - GameScene.add(Blob.seed(pos + i, 20, ElectriShock.class)); - CellEmitter.get(pos + i).burst(EnergyParticle.FACTORY, 5); - } - } - Sample.INSTANCE.play(Assets.SND_ZAP); - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/levels/traps/SummoningTrap.java b/java/com/hmdzl/spspd/change/levels/traps/SummoningTrap.java deleted file mode 100644 index bc14829a..00000000 --- a/java/com/hmdzl/spspd/change/levels/traps/SummoningTrap.java +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * Shattered Pixel Dungeon - * Copyright (C) 2014-2015 Evan Debenham - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels.traps; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.mobs.Bestiary; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.items.Heap; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfTeleportation; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.TrapSprite; -import com.watabou.utils.Random; - -public class SummoningTrap extends Trap { - - private static final float DELAY = 2f; - - { - color = TrapSprite.TEAL; - shape = TrapSprite.WAVES; - } - - @Override - public void activate(Char ch) { - super.activate(ch); - - if (Dungeon.bossLevel()) { - return; - } - - int nMobs = 1; - if (Random.Int( 2 ) == 0) { - nMobs++; - if (Random.Int( 2 ) == 0) { - nMobs++; - } - } - - ArrayList candidates = new ArrayList<>(); - - for (int i=0; i < Level.NEIGHBOURS8.length; i++) { - int p = pos + Level.NEIGHBOURS8[i]; - if (Actor.findChar( p ) == null && (Level.passable[p] || Level.avoid[p])) { - candidates.add( p ); - } - } - - ArrayList respawnPoints = new ArrayList<>(); - - while (nMobs > 0 && candidates.size() > 0) { - int index = Random.index( candidates ); - - respawnPoints.add( candidates.remove( index ) ); - nMobs--; - } - - ArrayList mobs = new ArrayList<>(); - - for (Integer point : respawnPoints) { - Mob mob = Bestiary.mob( Dungeon.depth ); - mob.state = mob.WANDERING; - mob.pos = point; - GameScene.add( mob, DELAY ); - mobs.add( mob ); - } - - //important to process the visuals and pressing of cells last, so spawned mobs have a chance to occupy cells first - for (Mob mob : mobs){ - ScrollOfTeleportation.appear(mob, mob.pos); - } - - Heap heap = Dungeon.level.heaps.get(pos); - if (heap != null) {heap.summon();} - - } -} diff --git a/java/com/hmdzl/spspd/change/levels/traps/TeleportationTrap.java b/java/com/hmdzl/spspd/change/levels/traps/TeleportationTrap.java deleted file mode 100644 index 276e5df0..00000000 --- a/java/com/hmdzl/spspd/change/levels/traps/TeleportationTrap.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * Shattered Pixel Dungeon - * Copyright (C) 2014-2015 Evan Debenham - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels.traps; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.Heap; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfTeleportation; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.TrapSprite; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.audio.Sample; - -import java.util.LinkedList; - -public class TeleportationTrap extends Trap { - - { - color = TrapSprite.TEAL; - shape = TrapSprite.DOTS; - } - - @Override - public void activate(Char ch) { - super.activate(ch); - - CellEmitter.get(pos).start(Speck.factory(Speck.LIGHT), 0.2f, 3); - Sample.INSTANCE.play( Assets.SND_TELEPORT ); - - //Char ch = Actor.findChar( pos); - if (ch instanceof Hero){ - ScrollOfTeleportation.teleportHero((Hero)ch); - ((Hero) ch).curAction = null; - } else if (ch != null){ - int count = 10; - int pos; - do { - pos = Dungeon.level.randomRespawnCell(); - if (count-- <= 0) { - break; - } - } while (pos == -1); - - if (pos == -1 || Dungeon.bossLevel()) { - - GLog.w( Messages.get(ScrollOfTeleportation.class, "no_tele") ); - - } else { - - ch.pos = pos; - ch.sprite.place(ch.pos); - ch.sprite.visible = Dungeon.visible[pos]; - - } - } - - Heap heap = Dungeon.level.heaps.get(pos); - - if (heap != null){ - int cell = Dungeon.level.randomRespawnCell(); - - Item item = heap.pickUp(); - - if (cell != -1) { - Dungeon.level.drop( item, cell ); - } - } - } -} diff --git a/java/com/hmdzl/spspd/change/levels/traps/ToxicTrap.java b/java/com/hmdzl/spspd/change/levels/traps/ToxicTrap.java deleted file mode 100644 index 3d16f993..00000000 --- a/java/com/hmdzl/spspd/change/levels/traps/ToxicTrap.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * Shattered Pixel Dungeon - * Copyright (C) 2014-2015 Evan Debenham - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels.traps; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.Blob; -import com.hmdzl.spspd.change.actors.blobs.ToxicGas; -import com.hmdzl.spspd.change.items.Heap; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.TrapSprite; - -public class ToxicTrap extends Trap{ - - { - color = TrapSprite.GREEN; - shape = TrapSprite.GRILL; - } - - @Override - public void activate(Char ch) { - super.activate(ch); - - GameScene.add( Blob.seed( pos, 300 + 20 * Dungeon.depth, ToxicGas.class ) ); - Heap heap = Dungeon.level.heaps.get(pos); - if (heap != null) {heap.poison();} - } -} diff --git a/java/com/hmdzl/spspd/change/levels/traps/Trap.java b/java/com/hmdzl/spspd/change/levels/traps/Trap.java deleted file mode 100644 index dcffca0e..00000000 --- a/java/com/hmdzl/spspd/change/levels/traps/Trap.java +++ /dev/null @@ -1,112 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * Shattered Pixel Dungeon - * Copyright (C) 2014-2015 Evan Debenham - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels.traps; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.Terrain; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.TrapSprite; -import com.watabou.noosa.audio.Sample; -import com.watabou.noosa.tweeners.AlphaTweener; -import com.watabou.utils.Bundlable; -import com.watabou.utils.Bundle; - -public abstract class Trap implements Bundlable { - - public String name = Messages.get(this, "name"); - - public int color; - public int shape; - - public int pos; - - public TrapSprite sprite; - public boolean visible; - public boolean active = true; - - public Trap set(int pos){ - this.pos = pos; - return this; - } - - public Trap reveal() { - visible = true; - if (sprite != null && sprite.visible == false) { - sprite.visible = true; - sprite.alpha( 0 ); - sprite.parent.add( new AlphaTweener( sprite, 1, 0.6f)); - } - return this; - } - - public Trap hide() { - visible = false; - if (sprite != null) - sprite.visible = false; - return this; - } - - public void activate(Char ch) { - - if (Dungeon.visible[pos]) { - Sample.INSTANCE.play(Assets.SND_TRAP); - } - disarm(); - reveal(); - - } - - protected void disarm(){ - Dungeon.level.disarmTrap(pos); - active = false; - if (sprite != null) { - sprite.reset( this ); - } - } - - private static final String POS = "pos"; - private static final String VISIBLE = "visible"; - private static final String ACTIVE = "active"; - - @Override - public void restoreFromBundle( Bundle bundle ) { - pos = bundle.getInt( POS ); - visible = bundle.getBoolean( VISIBLE ); - if (bundle.contains(ACTIVE)){ - active = bundle.getBoolean(ACTIVE); - } - } - - @Override - public void storeInBundle( Bundle bundle ) { - bundle.put( POS, pos ); - bundle.put( VISIBLE, visible ); - bundle.put( ACTIVE, active ); - } - - public String desc() { - return Messages.get(this, "desc"); - } -} diff --git a/java/com/hmdzl/spspd/change/levels/traps/VenomTrap.java b/java/com/hmdzl/spspd/change/levels/traps/VenomTrap.java deleted file mode 100644 index aea968ac..00000000 --- a/java/com/hmdzl/spspd/change/levels/traps/VenomTrap.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * Shattered Pixel Dungeon - * Copyright (C) 2014-2015 Evan Debenham - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels.traps; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.Blob; -import com.hmdzl.spspd.change.actors.blobs.VenomGas; -import com.hmdzl.spspd.change.items.Heap; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.TrapSprite; - -public class VenomTrap extends Trap { - - { - color = TrapSprite.VIOLET; - shape = TrapSprite.GRILL; - } - @Override - public void activate(Char ch) { - super.activate(ch); - - VenomGas venomGas = Blob.seed(pos, 80 + 5 * Dungeon.depth, VenomGas.class); - - venomGas.setStrength(1+Dungeon.depth/4); - - GameScene.add(venomGas); - Heap heap = Dungeon.level.heaps.get(pos); - if (heap != null) {heap.poison();} - - } -} diff --git a/java/com/hmdzl/spspd/change/levels/traps/WarpingTrap.java b/java/com/hmdzl/spspd/change/levels/traps/WarpingTrap.java deleted file mode 100644 index bda96804..00000000 --- a/java/com/hmdzl/spspd/change/levels/traps/WarpingTrap.java +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * Shattered Pixel Dungeon - * Copyright (C) 2014-2015 Evan Debenham - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels.traps; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.Heap; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.artifacts.DriedRose; -import com.hmdzl.spspd.change.items.artifacts.TimekeepersHourglass; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfTeleportation; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.InterlevelScene; -import com.hmdzl.spspd.change.sprites.TrapSprite; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.Game; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Random; - -import java.util.ArrayList; - -public class WarpingTrap extends Trap { - - { - color = TrapSprite.TEAL; - shape = TrapSprite.STARS; - } - - @Override - public void activate(Char ch) { - super.activate(ch); - CellEmitter.get(pos).start(Speck.factory(Speck.LIGHT), 0.2f, 3); - Sample.INSTANCE.play( Assets.SND_TELEPORT ); - - if (Dungeon.depth > 1 && !Dungeon.bossLevel()) { - - //each depth has 1 more weight than the previous depth. - float[] depths = new float[Dungeon.depth-1]; - for (int i = 1; i < Dungeon.depth; i++) depths[i-1] = i; - int depth = 1+Random.chances(depths); - - Heap heap = Dungeon.level.heaps.get(pos); - if (heap != null) { - ArrayList dropped = Dungeon.droppedItems.get( depth ); - if (dropped == null) { - Dungeon.droppedItems.put( depth, dropped = new ArrayList() ); - } - for (Item item : heap.items){ - dropped.add(item); - } - heap.destroy(); - } - - //Char ch = Actor.findChar( pos ); - if (ch == Dungeon.hero){ - Buff buff = Dungeon.hero.buff(TimekeepersHourglass.timeFreeze.class); - if (buff != null) buff.detach(); - - InterlevelScene.mode = InterlevelScene.Mode.RETURN; - InterlevelScene.returnDepth = depth; - InterlevelScene.returnPos = -1; - Game.switchScene(InterlevelScene.class); - } else if (ch != null) { - int count = 10; - int pos; - do { - pos = Dungeon.level.randomRespawnCell(); - if (count-- <= 0) { - break; - } - } while (pos == -1); - - if (pos == -1 || Dungeon.bossLevel()) { - - GLog.w( Messages.get(ScrollOfTeleportation.class, "no_tele") ); - - } else { - - ch.pos = pos; - ch.sprite.place(ch.pos); - ch.sprite.visible = Dungeon.visible[pos]; - - } - } - - } - - } -} diff --git a/java/com/hmdzl/spspd/change/levels/traps/WeakeningTrap.java b/java/com/hmdzl/spspd/change/levels/traps/WeakeningTrap.java deleted file mode 100644 index 4a758b9a..00000000 --- a/java/com/hmdzl/spspd/change/levels/traps/WeakeningTrap.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * Shattered Pixel Dungeon - * Copyright (C) 2014-2015 Evan Debenham - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels.traps; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Slow; -import com.hmdzl.spspd.change.actors.buffs.Weakness; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.particles.ShadowParticle; -import com.hmdzl.spspd.change.items.Heap; -import com.hmdzl.spspd.change.sprites.TrapSprite; - -public class WeakeningTrap extends Trap{ - - { - color = TrapSprite.GREEN; - shape = TrapSprite.WAVES; - } - - @Override - public void activate(Char ch) { - super.activate(ch); - if (Dungeon.visible[ pos ]){ - CellEmitter.get(pos).burst(ShadowParticle.UP, 5); - } - - //Char ch = Actor.findChar( pos ); - if (ch == Dungeon.hero){ - Buff.prolong( ch, Weakness.class, Weakness.duration(ch)*2f); - } else if (ch != null) { - Buff.prolong( ch, Slow.class, Slow.duration(ch)); - } - Heap heap = Dungeon.level.heaps.get(pos); - if (heap != null) {heap.poison();} - } -} diff --git a/java/com/hmdzl/spspd/change/levels/traps/WornTrap.java b/java/com/hmdzl/spspd/change/levels/traps/WornTrap.java deleted file mode 100644 index ef9632a3..00000000 --- a/java/com/hmdzl/spspd/change/levels/traps/WornTrap.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * Shattered Pixel Dungeon - * Copyright (C) 2014-2015 Evan Debenham - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.levels.traps; - -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.TrapSprite; -import com.hmdzl.spspd.change.utils.GLog; - -public class WornTrap extends Trap { - - { - color = TrapSprite.BLACK; - shape = TrapSprite.DOTS; - } - - @Override - public Trap hide() { - //this one can't be hidden - return reveal(); - } - - @Override - public void activate(Char ch) { - super.activate(ch); - CellEmitter.get(pos).burst(Speck.factory(Speck.STEAM), 6); - GLog.i(Messages.get(this, "nothing")); - } -} diff --git a/java/com/hmdzl/spspd/change/mechanics/Ballistica.java b/java/com/hmdzl/spspd/change/mechanics/Ballistica.java deleted file mode 100644 index 222c0113..00000000 --- a/java/com/hmdzl/spspd/change/mechanics/Ballistica.java +++ /dev/null @@ -1,140 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.mechanics; - -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.levels.Level; - -import java.util.ArrayList; -import java.util.List; - -public class Ballistica { - - public ArrayList path = new ArrayList<>(); - public Integer sourcePos = null; - public Integer collisionPos = null; - public Integer dist = 0; - - //parameters to specify the colliding cell - public static final int STOP_TARGET = 1; //ballistica will stop at the target cell - public static final int STOP_CHARS = 2; //ballistica will stop on first char hit - public static final int STOP_TERRAIN = 4; //ballistica will stop on terrain(LOS blocking, impassable, etc.) - - public static final int PROJECTILE = STOP_TARGET | STOP_CHARS | STOP_TERRAIN; - - public static final int MAGIC_BOLT = STOP_CHARS | STOP_TERRAIN; - - public static final int WONT_STOP = 0; - - public static int[] trace = new int[Math.max(Level.getWidth(), Level.HEIGHT)]; - public static int distance; - - public Ballistica( int from, int to, int params ){ - sourcePos = from; - build(from, to, (params & STOP_TARGET) > 0, (params & STOP_CHARS) > 0, (params & STOP_TERRAIN) > 0); - if (collisionPos != null) - dist = path.indexOf( collisionPos ); - else - collisionPos = path.get( dist=path.size()-1 ); - } - - private void build( int from, int to, boolean stopTarget, boolean stopChars, boolean stopTerrain ) { - int w = Level.WIDTH; - - int x0 = from % w; - int x1 = to % w; - int y0 = from / w; - int y1 = to / w; - - int dx = x1 - x0; - int dy = y1 - y0; - - int stepX = dx > 0 ? +1 : -1; - int stepY = dy > 0 ? +1 : -1; - - dx = Math.abs( dx ); - dy = Math.abs( dy ); - - int stepA; - int stepB; - int dA; - int dB; - - if (dx > dy) { - - stepA = stepX; - stepB = stepY * w; - dA = dx; - dB = dy; - - } else { - - stepA = stepY * w; - stepB = stepX; - dA = dy; - dB = dx; - - } - - int cell = from; - - int err = dA / 2; - while (Level.insideMap(cell)) { - - //if we're in a wall, collide with the previous cell along the path. - if (stopTerrain && cell != sourcePos && !Level.passable[cell] && !Level.avoid[cell]) { - collide(path.get(path.size() - 1)); - } - - path.add(cell); - - if ((stopTerrain && cell != sourcePos && Level.losBlockHigh[cell]) - || (cell != sourcePos && stopChars && Actor.findChar( cell ) != null) - || (cell == to && stopTarget)){ - collide(cell); - } - - cell += stepA; - - err += dB; - if (err >= dA) { - err = err - dA; - cell = cell + stepB; - } - } - } - - //we only want to record the first position collision occurs at. - private void collide(int cell){ - if (collisionPos == null) - collisionPos = cell; - } - - //returns a segment of the path from start to end, inclusive. - //if there is an error, returns an empty arraylist instead. - public List subPath(int start, int end){ - try { - end = Math.min( end, path.size()-1); - return path.subList(start, end+1); - } catch (Exception e){ - return new ArrayList<>(); - } - } - - -} diff --git a/java/com/hmdzl/spspd/change/mechanics/ShadowCaster.java b/java/com/hmdzl/spspd/change/mechanics/ShadowCaster.java deleted file mode 100644 index 551e373c..00000000 --- a/java/com/hmdzl/spspd/change/mechanics/ShadowCaster.java +++ /dev/null @@ -1,162 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.mechanics; - -import java.util.Arrays; - -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.actors.blobs.Blob; -import com.hmdzl.spspd.change.actors.blobs.DarkGas; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.utils.BArray; - -public final class ShadowCaster { - - private static final int MAX_DISTANCE = 8; - - private static final int WIDTH = Level.getWidth(); - private static final int HEIGHT = Level.HEIGHT; - - private static int distance; - private static int limits[]; - - private static boolean[] losBlocking; - private static boolean[] fieldOfView; - - private static int[][] rounding; - static { - rounding = new int[MAX_DISTANCE + 1][]; - for (int i = 1; i <= MAX_DISTANCE; i++) { - rounding[i] = new int[i + 1]; - for (int j = 1; j <= i; j++) { - rounding[i][j] = (int) Math.min(j, - Math.round(i * Math.cos(Math.asin(j / (i + 0.5))))); - } - } - } - - private static Obstacles obs = new Obstacles(); - - public static void castShadow(int x, int y, boolean[] fieldOfView, - int distance, boolean flying) { - - losBlocking = flying ? Level.losBlockHigh.clone() : Level.losBlockLow.clone() ; - - ShadowCaster.distance = distance; - limits = rounding[distance]; - - ShadowCaster.fieldOfView = fieldOfView; - Arrays.fill(fieldOfView, false); - fieldOfView[y * WIDTH + x] = true; - - scanSector(x, y, +1, +1, 0, 0); - scanSector(x, y, -1, +1, 0, 0); - scanSector(x, y, +1, -1, 0, 0); - scanSector(x, y, -1, -1, 0, 0); - scanSector(x, y, 0, 0, +1, +1); - scanSector(x, y, 0, 0, -1, +1); - scanSector(x, y, 0, 0, +1, -1); - scanSector(x, y, 0, 0, -1, -1); - } - - private static void scanSector(int cx, int cy, int m1, int m2, int m3, - int m4) { - - obs.reset(); - - for (int p = 1; p <= distance; p++) { - - float dq2 = 0.5f / p; - - int pp = limits[p]; - for (int q = 0; q <= pp; q++) { - - int x = cx + q * m1 + p * m3; - int y = cy + p * m2 + q * m4; - - if (y >= 0 && y < HEIGHT && x >= 0 && x < WIDTH) { - - float a0 = (float) q / p; - float a1 = a0 - dq2; - float a2 = a0 + dq2; - - int pos = y * WIDTH + x; - - if (obs.isBlocked(a0) && obs.isBlocked(a1) - && obs.isBlocked(a2)) { - - // Do nothing - } else { - fieldOfView[pos] = true; - } - - if (losBlocking[pos]) { - obs.add(a1, a2); - } - - } - } - - obs.nextRow(); - } - } - - private static final class Obstacles { - - private static int SIZE = (MAX_DISTANCE + 1) * (MAX_DISTANCE + 1) / 2; - private static float[] a1 = new float[SIZE]; - private static float[] a2 = new float[SIZE]; - - private int length; - private int limit; - - public void reset() { - length = 0; - limit = 0; - } - - public void add(float o1, float o2) { - - if (length > limit && o1 <= a2[length - 1]) { - - // Merging several blocking cells - a2[length - 1] = o2; - - } else { - - a1[length] = o1; - a2[length++] = o2; - - } - - } - - public boolean isBlocked(float a) { - for (int i = 0; i < limit; i++) { - if (a >= a1[i] && a <= a2[i]) { - return true; - } - } - return false; - } - - public void nextRow() { - limit = length; - } - } -} diff --git a/java/com/hmdzl/spspd/change/messages/Languages.java b/java/com/hmdzl/spspd/change/messages/Languages.java deleted file mode 100644 index 9567d52a..00000000 --- a/java/com/hmdzl/spspd/change/messages/Languages.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * Shattered Pixel Dungeon - * Copyright (C) 2014-2016 Evan Debenham - */ -package com.hmdzl.spspd.change.messages; - -import java.util.Locale; - -public enum Languages { - ENGLISH("english", "", Status.REVIEWED, null, null), - - //RUSSIAN("русский", "ru", Status.INCOMPLETE, new String[]{"ConsideredHamster", "Inevielle", "yarikonline"}, new String[]{"AttHawk46", "HerrGotlieb", "MrXantar", "Shamahan", "roman.yagodin", "un_logic"}), - //KOREAN("한국어", "ko", Status.INCOMPLETE, new String[]{"Flameblast12"}, new String[]{"WondarRabb1t", "ddojin0115", "eeeei", "linterpreteur", "lsiebnie" }), - CHINESE("中文", "zh", Status.INCOMPLETE, new String[]{"Jinkeloid(zdx00793)"}, new String[]{"931451545", "HoofBumpBlurryface", "Lery", "Lyn-0401", "ShatteredFlameBlast", "hmdzl001", "tempest102"}); - //FINNISH("suomi", "fi", Status.INCOMPLETE, new String[]{"TenguTheKnight"}, null ), - //POLISH("polski", "pl", Status.INCOMPLETE, new String[]{"Deksippos", "kuadziw"}, new String[]{"Chasseur", "Darden", "MJedi", "Peperos", "Scharnvirk", "Shmilly", "dusakus", "michaub", "ozziezombie", "szczoteczka22", "szymex73"}), - - //ITALIAN("italiano", "it", Status.INCOMPLETE, new String[]{"bizzolino", "funnydwarf"}, new String[]{"4est", "DaniMare", "Danzl", "andrearubbino00", "nessunluogo", "righi.a", "umby000"}), - //CATALAN("català", "ca", Status.INCOMPLETE, new String[]{"Illyatwo2"}, null), - //SPANISH("español", "es", Status.INCOMPLETE, new String[]{"Kiroto", "Kohru", "grayscales"}, new String[]{"Alesxanderk", "CorvosUtopy", "Dewstend", "Dyrran", "Fervoreking", "Illyatwo2", "airman12", "alfongad", "benzarr410", "ctrijueque", "dhg121", "javifs", "jonismack1"}), - //ESPERANTO("esperanto", "eo", Status.INCOMPLETE, new String[]{"Verdulo"}, null), - //HUNGARIAN("magyar", "hu", Status.INCOMPLETE, new String[]{"dorheim"}, new String[]{"Navetelen", "clarovani", "dhialub", "nanometer", "nardomaa"}), - //TURKISH("türkçe", "tr", Status.INCOMPLETE, new String[]{"LokiofMillenium", "emrebnk"}, new String[]{"AcuriousPotato", "alpekin98", "denizakalin", "melezorus34"}), - - //GERMAN("deutsch", "de", Status.INCOMPLETE, new String[]{"Dallukas", "KrystalCroft", "Wuzzy", "Zap0", "davedude" }, new String[]{"DarkPixel", "ErichME", "LenzB", "Sarius", "Sorpl3x", "ThunfischGott", "Topicranger", "oragothen"}); - //FRENCH("français", "fr", Status.INCOMPLETE, new String[]{"Emether", "canc42", "kultissim", "minikrob"}, new String[]{"Alsydis", "Basttee", "Dekadisk", "Draal", "antoine9298", "go11um", "linterpreteur", "solthaar"}), - //PORTUGUESE("português", "pt", Status.INCOMPLETE, new String[]{"TDF2001", "matheus208"}, new String[]{"ChainedFreaK", "JST", "MadHorus", "Tio_P_", "ancientorange", "danypr23", "ismael.henriques12", "owenreilly", "try31"}), - //INDONESIAN("indonésien","in", Status.INCOMPLETE, new String[]{"rakapratama"}, null); - - public enum Status{ - //below 60% complete languages are not added. - INCOMPLETE, //60-99% complete - UNREVIEWED, //100% complete - REVIEWED //100% reviewed - } - - private String name; - private String code; - private Status status; - private String[] reviewers; - private String[] translators; - - Languages(String name, String code, Status status, String[] reviewers, String[] translators){ - this.name = name; - this.code = code; - this.status = status; - this.reviewers = reviewers; - this.translators = translators; - } - - public String nativeName(){ - return name; - } - - public String code(){ - return code; - } - - public Status status(){ - return status; - } - - public String[] reviewers() { - if (reviewers == null) return new String[]{}; - else return reviewers.clone(); - } - - public String[] translators() { - if (translators == null) return new String[]{}; - else return translators.clone(); - } - - public static Languages matchLocale(Locale locale){ - return matchCode(locale.getLanguage()); - } - - public static Languages matchCode(String code){ - for (Languages lang : Languages.values()){ - if (lang.code().equals(code)) - return lang; - } - return ENGLISH; - } - -} diff --git a/java/com/hmdzl/spspd/change/messages/Messages.java b/java/com/hmdzl/spspd/change/messages/Messages.java deleted file mode 100644 index b984fba5..00000000 --- a/java/com/hmdzl/spspd/change/messages/Messages.java +++ /dev/null @@ -1,185 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * Shattered Pixel Dungeon - * Copyright (C) 2014-2015 Evan Debenham - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.messages; - -import com.hmdzl.spspd.change.SPSSettings; -import com.hmdzl.spspd.change.ShatteredPixelDungeon; -import com.watabou.utils.DeviceCompat; - -import java.util.Arrays; -import java.util.Enumeration; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Locale; -import java.util.ResourceBundle; - -/* - Simple wrapper class for java resource bundles. - - The core idea here is that each string resource's key is a combination of the class definition and a local value. - An object or static method would usually call this with an object/class reference (usually its own) and a local key. - This means that an object can just ask for "name" rather than, say, "items.weapon.enchantments.death.name" - */ -public class Messages { - - /* - use hashmap for two reasons. Firstly because android 2.2 doesn't support resourcebundle.containskey(), - secondly so I can read in and combine multiple properties files, - resulting in a more clean structure for organizing all the strings, instead of one big file. - - ..Yes R.string would do this for me, but that's not multiplatform - */ - private static HashMap strings; - private static Languages lang; - - public static Languages lang(){ - return lang; - } - - - - /** - * Setup Methods - */ - - private static String[] prop_files = new String[]{ - "com.hmdzl.spspd.change.messages.actors.actors", - "com.hmdzl.spspd.change.messages.items.items", - "com.hmdzl.spspd.change.messages.levels.levels", - "com.hmdzl.spspd.change.messages.plants.plants", - "com.hmdzl.spspd.change.messages.scenes.scenes", - "com.hmdzl.spspd.change.messages.ui.ui", - "com.hmdzl.spspd.change.messages.windows.windows", - "com.hmdzl.spspd.change.messages.misc.misc" - }; - - static{ - setup(SPSSettings.language()); - } - - public static void setup( Languages lang ){ - strings = new HashMap<>(); - Messages.lang = lang; - Locale locale = new Locale(lang.code()); - - for (String file : prop_files) { - ResourceBundle bundle = ResourceBundle.getBundle( file, locale); - Enumeration keys = bundle.getKeys(); - while (keys.hasMoreElements()) { - String key = keys.nextElement(); - String value = bundle.getString(key); - - //android 2.2 doesn't use UTF-8 by default, need to force it. - if (DeviceCompat.usesISO_8859_1()) { - try { - value = new String(value.getBytes("ISO-8859-1"), "UTF-8"); - } catch (Exception e) { - ShatteredPixelDungeon.reportException(e); - } - } - - strings.put(key, value); - } - } - } - - - - /** - * Resource grabbing methods - */ - - public static String get(String key, Object...args){ - return get(null, key, args); - } - - public static String get(Object o, String k, Object...args){ - return get(o.getClass(), k, args); - } - - public static String get(Class c, String k, Object...args){ - String key; - if (c != null){ - key = c.getName().replace("com.hmdzl.spspd.change.", ""); - key += "." + k; - } else - key = k; - - if (strings.containsKey(key.toLowerCase(Locale.ENGLISH))){ - if (args.length > 0) return format(strings.get(key.toLowerCase(Locale.ENGLISH)), args); - else return strings.get(key.toLowerCase(Locale.ENGLISH)); - } else { - //this is so child classes can inherit properties from their parents. - //in cases where text is commonly grabbed as a utility from classes that aren't mean to be instantiated - //(e.g. flavourbuff.dispTurns()) using .class directly is probably smarter to prevent unnecessary recursive calls. - if (c != null && c.getSuperclass() != null){ - return get(c.getSuperclass(), k, args); - } else { - return "!!!NO TEXT FOUND!!!"; - } - } - } - - - - /** - * String Utility Methods - */ - - public static String format( String format, Object...args ) { - return String.format( Locale.ENGLISH, format, args ); - } - - public static String capitalize( String str ){ - if (str.length() == 0) return str; - else return Character.toTitleCase( str.charAt( 0 ) ) + str.substring( 1 ); - } - - //Words which should not be capitalized in title case, mostly prepositions which appear ingame - //This list is not comprehensive! - private static final HashSet noCaps = new HashSet<>( - Arrays.asList(new String[]{ - //English - //"a", "of", "by", "to", "the", "x" - "a", "an", "and", "of", "by", "to", "the", "x" - }) - ); - - public static String titleCase( String str ){ - //English capitalizes every word except for a few exceptions - if (lang == Languages.ENGLISH){ - String result = ""; - //split by any unicode space character - for (String word : str.split("(?<=\\p{Zs})")){ - if (noCaps.contains(word.trim().toLowerCase(Locale.ENGLISH).replaceAll(":|[0-9]", ""))){ - result += word; - } else { - result += capitalize(word); - } - } - //first character is always capitalized. - return capitalize(result); - } - - //Otherwise, use sentence case - return capitalize(str); - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/plants/BlandfruitBush.java b/java/com/hmdzl/spspd/change/plants/BlandfruitBush.java deleted file mode 100644 index 758a2bb9..00000000 --- a/java/com/hmdzl/spspd/change/plants/BlandfruitBush.java +++ /dev/null @@ -1,50 +0,0 @@ -package com.hmdzl.spspd.change.plants; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.items.food.fruit.Blackberry; -import com.hmdzl.spspd.change.items.food.fruit.Blandfruit; -import com.hmdzl.spspd.change.items.food.fruit.Blueberry; -import com.hmdzl.spspd.change.items.food.fruit.Cloudberry; -import com.hmdzl.spspd.change.items.food.fruit.Moonberry; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.watabou.utils.Random; - -/** - * Created by Evan on 13/08/2014. - */ -public class BlandfruitBush extends Plant { - - { - image = 8; - } - - @Override - public void activate(Char ch) { - super.activate(ch); - Dungeon.level.drop(new Blandfruit(), pos).sprite.drop(); - switch (Random.Int(4)){ - case 0: - Dungeon.level.drop(new Blackberry(), pos).sprite.drop(); - break; - case 1: - Dungeon.level.drop(new Blueberry(), pos).sprite.drop(); - break; - case 2: - Dungeon.level.drop(new Cloudberry(), pos).sprite.drop(); - break; - case 3: - Dungeon.level.drop(new Moonberry(), pos).sprite.drop(); - break; - } - } - - public static class Seed extends Plant.Seed { - { - image = ItemSpriteSheet.SEED_BLANDFRUIT; - - plantClass = BlandfruitBush.class; - alchemyClass = null; - } - } -} diff --git a/java/com/hmdzl/spspd/change/plants/Blindweed.java b/java/com/hmdzl/spspd/change/plants/Blindweed.java deleted file mode 100644 index 2ae19e3e..00000000 --- a/java/com/hmdzl/spspd/change/plants/Blindweed.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.plants; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Blindness; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Cripple; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.potions.PotionOfInvisibility; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.watabou.utils.Random; - -public class Blindweed extends Plant { - - { - image = 3; - } - - @Override - public void activate(Char ch) { - super.activate(ch); - - if (ch != null) { - int len = Random.Int(5, 10); - Buff.prolong(ch, Blindness.class, len); - Buff.prolong(ch, Cripple.class, len); - if (ch instanceof Mob) { - if (((Mob)ch).state == ((Mob)ch).HUNTING) ((Mob)ch).state = ((Mob)ch).WANDERING; - ((Mob)ch).beckon( Dungeon.level.randomDestination() ); - } - } - - if (Dungeon.visible[pos]) { - CellEmitter.get(pos).burst(Speck.factory(Speck.LIGHT), 4); - } - } - - public static class Seed extends Plant.Seed { - { - image = ItemSpriteSheet.SEED_BLINDWEED; - - plantClass = Blindweed.class; - alchemyClass = PotionOfInvisibility.class; - } - } -} diff --git a/java/com/hmdzl/spspd/change/plants/Dewcatcher.java b/java/com/hmdzl/spspd/change/plants/Dewcatcher.java deleted file mode 100644 index 1c2e2bc5..00000000 --- a/java/com/hmdzl/spspd/change/plants/Dewcatcher.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.plants; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.items.RedDewdrop; -import com.hmdzl.spspd.change.items.VioletDewdrop; -import com.hmdzl.spspd.change.items.YellowDewdrop; -import com.hmdzl.spspd.change.items.potions.PotionOfOverHealing; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.watabou.utils.Random; - -public class Dewcatcher extends Plant { - - { - image = 12; - } - - @Override - public void activate(Char ch) { - - explodeDew(pos); - if (Random.Int(2)==0){super.activate(ch);} - - - } - - public static class Seed extends Plant.Seed { - { - image = ItemSpriteSheet.SEED_DEWCATCHER; - - plantClass = Dewcatcher.class; - alchemyClass = PotionOfOverHealing.class; - } - } - -public void explodeDew(int cell) { - - for (int n : Level.NEIGHBOURS8) { - int c = cell + n; - if (c >= 0 && c < Level.getLength() && Level.passable[c]) { - - if (Random.Int(10)==1){Dungeon.level.drop(new VioletDewdrop(), c).sprite.drop();} - else if (Random.Int(5)==1){Dungeon.level.drop(new RedDewdrop(), c).sprite.drop();} - else if (Random.Int(3)==1){Dungeon.level.drop(new YellowDewdrop(), c).sprite.drop();} - } - } - - } - - -} diff --git a/java/com/hmdzl/spspd/change/plants/Dreamfoil.java b/java/com/hmdzl/spspd/change/plants/Dreamfoil.java deleted file mode 100644 index 0f7006cc..00000000 --- a/java/com/hmdzl/spspd/change/plants/Dreamfoil.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.plants; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Bleeding; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Cripple; -import com.hmdzl.spspd.change.actors.buffs.Drowsy; -import com.hmdzl.spspd.change.actors.buffs.MagicalSleep; -import com.hmdzl.spspd.change.actors.buffs.Poison; -import com.hmdzl.spspd.change.actors.buffs.Slow; -import com.hmdzl.spspd.change.actors.buffs.Vertigo; -import com.hmdzl.spspd.change.actors.buffs.Weakness; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.items.food.vegetable.DreamLeaf; -import com.hmdzl.spspd.change.items.potions.PotionOfPurity; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.GLog; - -public class Dreamfoil extends Plant { - - { - image = 10; - } - - @Override - public void activate(Char ch) { - super.activate(ch); - Dungeon.level.drop(new DreamLeaf(), pos).sprite.drop(); - if (ch != null) { - if (ch instanceof Mob) - Buff.affect(ch, MagicalSleep.class); - else if (ch instanceof Hero) { - //GLog.i("You feel refreshed."); - Buff.detach(ch, Poison.class); - Buff.detach(ch, Cripple.class); - Buff.detach(ch, Weakness.class); - Buff.detach(ch, Bleeding.class); - Buff.detach(ch, Drowsy.class); - Buff.detach(ch, Slow.class); - Buff.detach(ch, Vertigo.class); - } - } - } - - - public static class Seed extends Plant.Seed { - { - image = ItemSpriteSheet.SEED_DREAMFOIL; - - plantClass = Dreamfoil.class; - alchemyClass = PotionOfPurity.class; - } - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/plants/Earthroot.java b/java/com/hmdzl/spspd/change/plants/Earthroot.java deleted file mode 100644 index dfd70e28..00000000 --- a/java/com/hmdzl/spspd/change/plants/Earthroot.java +++ /dev/null @@ -1,135 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.plants; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.particles.EarthParticle; -import com.hmdzl.spspd.change.items.potions.PotionOfParalyticGas; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.ui.BuffIndicator; - -import com.watabou.noosa.Camera; -import com.watabou.utils.Bundle; - -public class Earthroot extends Plant { - - { - image = 5; - } - - @Override - public void activate(Char ch) { - super.activate(ch); - - if (ch != null) { - Buff.affect(ch, Armor.class).level = ch.HT; - } - - if (Dungeon.visible[pos]) { - CellEmitter.bottom(pos).start(EarthParticle.FACTORY, 0.05f, 8); - Camera.main.shake(1, 0.4f); - } - } - - public static class Seed extends Plant.Seed { - { - image = ItemSpriteSheet.SEED_EARTHROOT; - - plantClass = Earthroot.class; - alchemyClass = PotionOfParalyticGas.class; - - - } - } - - public static class Armor extends Buff { - - private static final float STEP = 1f; - - private int pos; - private int level; - - @Override - public boolean attachTo(Char target) { - pos = target.pos; - return super.attachTo(target); - } - - @Override - public boolean act() { - if (target.pos != pos) { - detach(); - } - spend(STEP); - return true; - } - - public int absorb(int damage) { - if (level <= damage - damage / 2) { - detach(); - return damage - level; - } else { - level -= damage - damage / 2; - return damage / 2; - } - } - - public void level(int value) { - if (level < value) { - level = value; - } - } - - @Override - public int icon() { - return BuffIndicator.ARMOR; - } - - @Override - public String toString() { - return Messages.get(this, "name"); - } - - @Override - public String desc() { - return Messages.get(this, "desc", level); - } - - - private static final String POS = "pos"; - private static final String LEVEL = "level"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(POS, pos); - bundle.put(LEVEL, level); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - pos = bundle.getInt(POS); - level = bundle.getInt(LEVEL); - } - } -} diff --git a/java/com/hmdzl/spspd/change/plants/Fadeleaf.java b/java/com/hmdzl/spspd/change/plants/Fadeleaf.java deleted file mode 100644 index 8c5117f3..00000000 --- a/java/com/hmdzl/spspd/change/plants/Fadeleaf.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.plants; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.potions.PotionOfMindVision; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfTeleportation; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; - -public class Fadeleaf extends Plant { - - { - image = 6; - } - - @Override - public void activate(Char ch) { - super.activate(ch); - - if (ch instanceof Hero) { - - ScrollOfTeleportation.teleportHero((Hero) ch); - ((Hero) ch).curAction = null; - - } else if (ch instanceof Mob) { - - int count = 10; - int newPos; - do { - newPos = Dungeon.level.randomRespawnCell(); - if (count-- <= 0) { - break; - } - } while (newPos == -1); - - if (newPos != -1) { - - ch.pos = newPos; - ch.sprite.place(ch.pos); - ch.sprite.visible = Dungeon.visible[pos]; - - } - - } - - if (Dungeon.visible[pos]) { - CellEmitter.get(pos).start(Speck.factory(Speck.LIGHT), 0.2f, 3); - } - } - - public static class Seed extends Plant.Seed { - { - image = ItemSpriteSheet.SEED_FADELEAF; - - plantClass = Fadeleaf.class; - alchemyClass = PotionOfMindVision.class; - } - - } -} diff --git a/java/com/hmdzl/spspd/change/plants/Firebloom.java b/java/com/hmdzl/spspd/change/plants/Firebloom.java deleted file mode 100644 index dd76a214..00000000 --- a/java/com/hmdzl/spspd/change/plants/Firebloom.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.plants; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.Blob; -import com.hmdzl.spspd.change.actors.blobs.Fire; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.particles.FlameParticle; -import com.hmdzl.spspd.change.items.potions.PotionOfLiquidFlame; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; - -public class Firebloom extends Plant { - - { - image = 0; - } - - @Override - public void activate(Char ch) { - super.activate(ch); - - GameScene.add(Blob.seed(pos, 2, Fire.class)); - - if (Dungeon.visible[pos]) { - CellEmitter.get(pos).burst(FlameParticle.FACTORY, 5); - } - } - - public static class Seed extends Plant.Seed { - { - image = ItemSpriteSheet.SEED_FIREBLOOM; - - plantClass = Firebloom.class; - alchemyClass = PotionOfLiquidFlame.class; - } - } -} diff --git a/java/com/hmdzl/spspd/change/plants/Flytrap.java b/java/com/hmdzl/spspd/change/plants/Flytrap.java deleted file mode 100644 index cad45e4a..00000000 --- a/java/com/hmdzl/spspd/change/plants/Flytrap.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.plants; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.Blob; -import com.hmdzl.spspd.change.actors.blobs.WellWater; -import com.hmdzl.spspd.change.items.UpgradeEatBall; -import com.hmdzl.spspd.change.items.food.fruit.Blackberry; -import com.hmdzl.spspd.change.items.food.fruit.Blueberry; -import com.hmdzl.spspd.change.items.food.fruit.Cloudberry; -import com.hmdzl.spspd.change.items.food.fruit.Moonberry; -import com.hmdzl.spspd.change.items.potions.PotionOfOverHealing; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.watabou.utils.Random; - -public class Flytrap extends Plant { - - { - image = 15; - } - - @Override - public void activate(Char ch) { - super.activate(ch); - Dungeon.level.drop(new UpgradeEatBall(), pos).sprite.drop(); - switch (Random.Int(4)){ - case 0: - Dungeon.level.drop(new Blackberry(), pos).sprite.drop(); - break; - case 1: - Dungeon.level.drop(new Blueberry(), pos).sprite.drop(); - break; - case 2: - Dungeon.level.drop(new Cloudberry(), pos).sprite.drop(); - break; - case 3: - Dungeon.level.drop(new Moonberry(), pos).sprite.drop(); - break; - } - } - - public static class Seed extends Plant.Seed { - { - image = ItemSpriteSheet.SEED_FLYTRAP; - - plantClass = Flytrap.class; - alchemyClass = PotionOfOverHealing.class; - } - - } -} diff --git a/java/com/hmdzl/spspd/change/plants/Icecap.java b/java/com/hmdzl/spspd/change/plants/Icecap.java deleted file mode 100644 index 4e283fa1..00000000 --- a/java/com/hmdzl/spspd/change/plants/Icecap.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.plants; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.Fire; -import com.hmdzl.spspd.change.actors.blobs.Freezing; -import com.hmdzl.spspd.change.items.potions.PotionOfFrost; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.utils.BArray; -import com.watabou.utils.PathFinder; - -public class Icecap extends Plant { - - { - image = 1; - } - - @Override - public void activate(Char ch) { - super.activate(ch); - - PathFinder - .buildDistanceMap(pos, BArray.not(Level.losBlockLow, null), 1); - - Fire fire = (Fire) Dungeon.level.blobs.get(Fire.class); - - for (int i = 0; i < Level.getLength(); i++) { - if (PathFinder.distance[i] < Integer.MAX_VALUE) { - Freezing.affect(i, fire); - } - } - } - - public static class Seed extends Plant.Seed { - { - image = ItemSpriteSheet.SEED_ICECAP; - - plantClass = Icecap.class; - alchemyClass = PotionOfFrost.class; - } - } -} diff --git a/java/com/hmdzl/spspd/change/plants/NutPlant.java b/java/com/hmdzl/spspd/change/plants/NutPlant.java deleted file mode 100644 index 8d124dfa..00000000 --- a/java/com/hmdzl/spspd/change/plants/NutPlant.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.hmdzl.spspd.change.plants; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.items.food.Nut; -import com.hmdzl.spspd.change.items.food.vegetable.NutVegetable; -import com.hmdzl.spspd.change.items.food.vegetable.Vegetable; -import com.hmdzl.spspd.change.items.food.fruit.Blackberry; -import com.hmdzl.spspd.change.items.food.fruit.Blandfruit; -import com.hmdzl.spspd.change.items.food.fruit.Blueberry; -import com.hmdzl.spspd.change.items.food.fruit.Cloudberry; -import com.hmdzl.spspd.change.items.food.fruit.Moonberry; -import com.hmdzl.spspd.change.items.potions.PotionOfHealing; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.watabou.utils.Random; - -/** - * Created by Evan on 13/08/2014. - */ -public class NutPlant extends Plant { - - { - image = 17; - } - - @Override - public void activate(Char ch) { - super.activate(ch); - Dungeon.level.drop(new Nut(), pos).sprite.drop(); - Dungeon.level.drop(new NutVegetable(), pos).sprite.drop(); - } - - public static class Seed extends Plant.Seed { - { - image = ItemSpriteSheet.SEED_DUNGEONNUT; - - plantClass = NutPlant.class; - alchemyClass = PotionOfHealing.class;; - } - } -} diff --git a/java/com/hmdzl/spspd/change/plants/Phaseshift.java b/java/com/hmdzl/spspd/change/plants/Phaseshift.java deleted file mode 100644 index 3068873c..00000000 --- a/java/com/hmdzl/spspd/change/plants/Phaseshift.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.plants; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.Blob; -import com.hmdzl.spspd.change.actors.blobs.WaterOfTransmutation; -import com.hmdzl.spspd.change.actors.blobs.WellWater; -import com.hmdzl.spspd.change.items.TransmutationBall; -import com.hmdzl.spspd.change.items.food.fruit.Blackberry; -import com.hmdzl.spspd.change.items.food.fruit.Blueberry; -import com.hmdzl.spspd.change.items.food.fruit.Cloudberry; -import com.hmdzl.spspd.change.items.food.fruit.Moonberry; -import com.hmdzl.spspd.change.items.potions.PotionOfMight; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.watabou.utils.Random; - -public class Phaseshift extends Plant { - - { - image = 14; - } - - @Override - public void activate(Char ch) { - super.activate(ch); - Dungeon.level.drop(new TransmutationBall(), pos).sprite.drop(); - switch (Random.Int(4)){ - case 0: - Dungeon.level.drop(new Blackberry(), pos).sprite.drop(); - break; - case 1: - Dungeon.level.drop(new Blueberry(), pos).sprite.drop(); - break; - case 2: - Dungeon.level.drop(new Cloudberry(), pos).sprite.drop(); - break; - case 3: - Dungeon.level.drop(new Moonberry(), pos).sprite.drop(); - break; - } - } - - public static class Seed extends Plant.Seed { - { - image = ItemSpriteSheet.SEED_PHASEPITCHER; - - plantClass = Phaseshift.class; - alchemyClass = PotionOfMight.class; - } - - - } -} diff --git a/java/com/hmdzl/spspd/change/plants/Plant.java b/java/com/hmdzl/spspd/change/plants/Plant.java deleted file mode 100644 index 736c8c24..00000000 --- a/java/com/hmdzl/spspd/change/plants/Plant.java +++ /dev/null @@ -1,199 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.plants; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Barkskin; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.hero.HeroSubClass; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.particles.LeafParticle; -import com.hmdzl.spspd.change.items.Dewdrop; -import com.hmdzl.spspd.change.items.Generator; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.artifacts.SandalsOfNature; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.Terrain; -import com.hmdzl.spspd.change.sprites.PlantSprite; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.utils.GLog; - -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Bundlable; -import com.watabou.utils.Bundle; -import com.watabou.utils.Random; - -public class Plant implements Bundlable { - - public String plantName = Messages.get(this, "name"); - - public int image; - public int pos; - - public PlantSprite sprite; - - public void activate(Char ch) { - - if (ch instanceof Hero && ((Hero) ch).subClass == HeroSubClass.WARDEN) { - Buff.affect(ch, Barkskin.class).level(ch.HT / 3); - } - wither(); - } - - public static boolean checkPhase(int cell) { - Plant plant = Dungeon.level.plants.get(cell); - if (plant instanceof Phaseshift || plant instanceof Flytrap) { - return true; - } else { - return false; - } - } - - public void wither() { - Dungeon.level.uproot(pos); - - sprite.kill(); - if (Dungeon.visible[pos]) { - CellEmitter.get(pos).burst(LeafParticle.GENERAL, 6); - } - - if (Dungeon.hero.subClass == HeroSubClass.WARDEN) { - - int naturalismLevel = 0; - SandalsOfNature.Naturalism naturalism = Dungeon.hero - .buff(SandalsOfNature.Naturalism.class); - if (naturalism != null) { - naturalismLevel = naturalism.level() + 1; - } - - if (Random.Int(5 - (naturalismLevel / 2)) == 0) { - Item seed = Generator.random(Generator.Category.SEED); - Dungeon.level.drop(seed, pos).sprite.drop(); - } - if (Random.Int(5 - naturalismLevel) == 0) { - Dungeon.level.drop(new Dewdrop(), pos).sprite.drop(); - } - } - } - - private static final String POS = "pos"; - - @Override - public void restoreFromBundle(Bundle bundle) { - pos = bundle.getInt(POS); - } - - @Override - public void storeInBundle(Bundle bundle) { - bundle.put(POS, pos); - } - - public String desc() { - return Messages.get(this, "desc"); - } - - public static class Seed extends Item { - - public static final String AC_PLANT = "PLANT"; - - private static final float TIME_TO_PLANT = 1f; - - { - stackable = true; - defaultAction = AC_THROW; - } - - protected Class plantClass; - - public Class alchemyClass; - - @Override - public ArrayList actions(Hero hero) { - ArrayList actions = super.actions(hero); - actions.add(AC_PLANT); - return actions; - } - - @Override - protected void onThrow(int cell) { - if (Dungeon.level.map[cell] == Terrain.ALCHEMY || Level.pit[cell]) { - super.onThrow(cell); - } else { - Dungeon.level.plant(this, cell); - } - } - - @Override - public void execute(Hero hero, String action) { - if (action.equals(AC_PLANT)) { - - hero.spend(TIME_TO_PLANT); - hero.busy(); - ((Seed) detach(hero.belongings.backpack)).onThrow(hero.pos); - - hero.sprite.operate(hero.pos); - - } else { - super.execute(hero, action); - } - } - - public Plant couch(int pos) { - try { - if (Dungeon.visible[pos]) { - Sample.INSTANCE.play(Assets.SND_PLANT); - } - Plant plant = plantClass.newInstance(); - plant.pos = pos; - return plant; - } catch (Exception e) { - return null; - } - } - - @Override - public boolean isUpgradable() { - return false; - } - - @Override - public boolean isIdentified() { - return true; - } - - @Override - public int price() { - return 10 * quantity; - } - - @Override - public String desc() { - return Messages.get(plantClass, "desc"); - } - - @Override - public String info() { - return Messages.get( Seed.class, "info", desc() ); - } - } -} diff --git a/java/com/hmdzl/spspd/change/plants/Rotberry.java b/java/com/hmdzl/spspd/change/plants/Rotberry.java deleted file mode 100644 index 015f78bb..00000000 --- a/java/com/hmdzl/spspd/change/plants/Rotberry.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.plants; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.blobs.Blob; -import com.hmdzl.spspd.change.actors.blobs.ToxicGas; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Roots; -import com.hmdzl.spspd.change.items.potions.PotionOfStrength; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; - -public class Rotberry extends Plant { - - { - image = 7; - } - - @Override - public void activate(Char ch) { - super.activate(ch); - - GameScene.add(Blob.seed(pos, 100, ToxicGas.class)); - - Dungeon.level.drop(new Seed(), pos).sprite.drop(); - - if (ch != null) { - Buff.prolong(ch, Roots.class,3); - } - } - - public static class Seed extends Plant.Seed { - { - image = ItemSpriteSheet.SEED_ROTBERRY; - - plantClass = Rotberry.class; - alchemyClass = PotionOfStrength.class; - } - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/plants/Seedpod.java b/java/com/hmdzl/spspd/change/plants/Seedpod.java deleted file mode 100644 index a8c43d23..00000000 --- a/java/com/hmdzl/spspd/change/plants/Seedpod.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.plants; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.items.potions.PotionOfOverHealing; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.items.Generator; -import com.hmdzl.spspd.change.levels.Level; -import com.watabou.utils.Random; -import java.util.ArrayList; - -public class Seedpod extends Plant{ - - { - image = 13; - } - - @Override - public void activate(Char ch) { - super.activate(ch); - - int nSeeds = Random.NormalIntRange(1, 5); - - ArrayList candidates = new ArrayList(); - for (int i : Level.NEIGHBOURS8){ - if (Level.passable[pos+i]){ - candidates.add(pos+i); - } - } - - for (int i = 0; i < nSeeds && !candidates.isEmpty(); i++){ - Integer c = Random.element(candidates); - Dungeon.level.drop(Generator.random(Generator.Category.SEED), c).sprite.drop(pos); - candidates.remove(c); - } - - } - - - public static class Seed extends Plant.Seed { - { - image = ItemSpriteSheet.SEED_SEEDPOD; - - plantClass = Seedpod.class; - alchemyClass = PotionOfOverHealing.class;; - } - } -} - - diff --git a/java/com/hmdzl/spspd/change/plants/Sorrowmoss.java b/java/com/hmdzl/spspd/change/plants/Sorrowmoss.java deleted file mode 100644 index 6f0095f6..00000000 --- a/java/com/hmdzl/spspd/change/plants/Sorrowmoss.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.plants; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Poison; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.particles.PoisonParticle; -import com.hmdzl.spspd.change.items.potions.PotionOfToxicGas; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; - -public class Sorrowmoss extends Plant { - - { - image = 2; - } - - @Override - public void activate(Char ch) { - super.activate(ch); - - if (ch != null) { - Buff.affect(ch, Poison.class).set( - Poison.durationFactor(ch) * (4 + Dungeon.depth / 2)); - } - - if (Dungeon.visible[pos]) { - CellEmitter.center(pos).burst(PoisonParticle.SPLASH, 3); - } - } - - public static class Seed extends Plant.Seed { - { - image = ItemSpriteSheet.SEED_SORROWMOSS; - - plantClass = Sorrowmoss.class; - alchemyClass = PotionOfToxicGas.class; - } - } -} diff --git a/java/com/hmdzl/spspd/change/plants/Starflower.java b/java/com/hmdzl/spspd/change/plants/Starflower.java deleted file mode 100644 index 1ba10b72..00000000 --- a/java/com/hmdzl/spspd/change/plants/Starflower.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.plants; - - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Strength; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.items.food.vegetable.BattleFlower; -import com.hmdzl.spspd.change.items.potions.PotionOfExperience; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.watabou.utils.Random; - -public class Starflower extends Plant { - - { - image = 11; - } - - @Override - public void activate(Char ch) { - super.activate(ch); - Dungeon.level.drop(new BattleFlower(), pos).sprite.drop(); - if (ch != null) { - Buff.affect(ch, Strength.class); - } - } - - public static class Seed extends Plant.Seed{ - - { - image = ItemSpriteSheet.SEED_STARFLOWER; - - plantClass = Starflower.class; - alchemyClass = PotionOfExperience.class; - } - } -} diff --git a/java/com/hmdzl/spspd/change/plants/Stormvine.java b/java/com/hmdzl/spspd/change/plants/Stormvine.java deleted file mode 100644 index b0f211bc..00000000 --- a/java/com/hmdzl/spspd/change/plants/Stormvine.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.hmdzl.spspd.change.plants; - -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Vertigo; -import com.hmdzl.spspd.change.items.potions.PotionOfLevitation; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; - -/** - * Created by Evan on 23/10/2014. - */ -public class Stormvine extends Plant { - - { - image = 9; - } - - @Override - public void activate(Char ch) { - super.activate(ch); - - if (ch != null) { - Buff.affect(ch, Vertigo.class, Vertigo.duration(ch)); - } - } - - - public static class Seed extends Plant.Seed { - { - image = ItemSpriteSheet.SEED_STORMVINE; - - plantClass = Stormvine.class; - alchemyClass = PotionOfLevitation.class; - } - } -} diff --git a/java/com/hmdzl/spspd/change/plants/Sungrass.java b/java/com/hmdzl/spspd/change/plants/Sungrass.java deleted file mode 100644 index f94884e5..00000000 --- a/java/com/hmdzl/spspd/change/plants/Sungrass.java +++ /dev/null @@ -1,157 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.plants; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.effects.particles.ShaftParticle; -import com.hmdzl.spspd.change.items.food.vegetable.HealGrass; -import com.hmdzl.spspd.change.items.potions.PotionOfHealing; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.ui.BuffIndicator; - -import com.watabou.utils.Bundle; - -public class Sungrass extends Plant { - - - { - image = 4; - } - - @Override - public void activate(Char ch) { - super.activate(ch); - Dungeon.level.drop(new HealGrass(), pos).sprite.drop(); - if (ch != null) { - Buff.affect(ch, Health.class).level = ch.HT; - } - - if (Dungeon.visible[pos]) { - CellEmitter.get(pos).start(ShaftParticle.FACTORY, 0.2f, 3); - } - } - - public static class Seed extends Plant.Seed { - { - - image = ItemSpriteSheet.SEED_SUNGRASS; - - plantClass = Sungrass.class; - alchemyClass = PotionOfHealing.class; - - - } - } - - public static class Health extends Buff { - - private static final float STEP = 1f; - - private int pos; - private int healCurr = 1; - private int count = 0; - private int level; - - @Override - public boolean attachTo(Char target) { - pos = target.pos; - return super.attachTo(target); - } - - @Override - public boolean act() { - if (target.pos != pos) { - detach(); - } - if (count == 5) { - if (level <= healCurr * .025 * target.HT) { - target.HP = Math.min(target.HT, target.HP + level); - target.sprite.emitter().burst(Speck.factory(Speck.HEALING), - 1); - detach(); - } else { - target.HP = Math.min(target.HT, target.HP - + (int) (healCurr * .025 * target.HT)); - level -= (healCurr * .025 * target.HT); - if (healCurr < 6) - healCurr++; - target.sprite.emitter().burst(Speck.factory(Speck.HEALING), - 1); - } - count = 1; - } else { - count++; - } - if (level <= 0) - detach(); - spend(STEP); - return true; - } - - public int absorb(int damage) { - level -= damage; - if (level <= 0) - detach(); - return damage; - } - - @Override - public int icon() { - return BuffIndicator.HEALING; - } - - @Override - public String toString() { - return Messages.get(this, "name"); - } - - @Override - public String desc() { - return Messages.get(this, "desc", level); - } - - private static final String POS = "pos"; - private static final String HEALCURR = "healCurr"; - private static final String COUNT = "count"; - private static final String LEVEL = "level"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put(POS, pos); - bundle.put(HEALCURR, healCurr); - bundle.put(COUNT, count); - bundle.put(LEVEL, level); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - pos = bundle.getInt(POS); - healCurr = bundle.getInt(HEALCURR); - count = bundle.getInt(COUNT); - level = bundle.getInt(LEVEL); - - } - } -} diff --git a/java/com/hmdzl/spspd/change/scenes/AboutScene.java b/java/com/hmdzl/spspd/change/scenes/AboutScene.java deleted file mode 100644 index f44e3ca8..00000000 --- a/java/com/hmdzl/spspd/change/scenes/AboutScene.java +++ /dev/null @@ -1,160 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.scenes; - -import android.content.Intent; -import android.net.Uri; - -import com.hmdzl.spspd.change.ShatteredPixelDungeon; -import com.hmdzl.spspd.change.effects.Flare; -import com.hmdzl.spspd.change.ui.Archs; -import com.hmdzl.spspd.change.ui.ExitButton; -import com.hmdzl.spspd.change.ui.Icons; -import com.hmdzl.spspd.change.ui.RenderedTextMultiline; -import com.hmdzl.spspd.change.ui.Window; -import com.watabou.input.Touchscreen.Touch; -import com.watabou.noosa.BitmapTextMultiline; -import com.watabou.noosa.Camera; -import com.watabou.noosa.Game; -import com.watabou.noosa.Image; -import com.watabou.noosa.RenderedText; -import com.watabou.noosa.TouchArea; - -public class AboutScene extends PixelScene { - - private static final String TTL_SHPX = "SPecial Surprise Pixel Dungeon"; - - private static final String TXT_SHPX = "Modified from lots of Pixel Dungeon Mods"; - - private static final String LNK_SHPX = "github.com/hmdzl001/SPS-PD"; - - private static final String TTL_WATA = "Original Pixel Dungeon"; - - private static final String TXT_WATA = "Code & Graphics: Watabou\n" + "Music: Cube_Code"; - - private static final String LNK_WATA = "pixeldungeon.watabou.ru"; - - @Override - public void create() { - super.create(); - - final float colWidth = Camera.main.width - / (ShatteredPixelDungeon.landscape() ? 2 : 1); - final float colTop = (Camera.main.height / 2) - - (ShatteredPixelDungeon.landscape() ? 30 : 90); - final float wataOffset = ShatteredPixelDungeon.landscape() ? colWidth - : 0; - - Image shpx = Icons.SHPX.get(); - shpx.x = align((colWidth - shpx.width()) / 2); - shpx.y = align(colTop); - align(shpx); - add(shpx); - - new Flare(7, 64).color(0x225511, true).show(shpx, 0).angularSpeed = +20; - - RenderedText shpxtitle = renderText( TTL_SHPX, 8 ); - shpxtitle.hardlight( Window.SHPX_COLOR ); - add( shpxtitle ); - - shpxtitle.x = (colWidth - shpxtitle.width()) / 2; - shpxtitle.y = shpx.y + shpx.height + 5; - align(shpxtitle); - - RenderedTextMultiline shpxtext = renderMultiline( TXT_SHPX, 8 ); - shpxtext.maxWidth((int)Math.min(colWidth, 120)); - add( shpxtext ); - - shpxtext.setPos((colWidth - shpxtext.width()) / 2, shpxtitle.y + shpxtitle.height() + 12); - align(shpxtext); - - RenderedTextMultiline shpxlink = renderMultiline( LNK_SHPX, 8 ); - shpxlink.maxWidth(shpxtext.maxWidth()); - shpxlink.hardlight( Window.SHPX_COLOR ); - add( shpxlink ); - - shpxlink.setPos((colWidth - shpxlink.width()) / 2, shpxtext.bottom() + 6); - align(shpxlink); - - TouchArea shpxhotArea = new TouchArea( shpxlink.left(), shpxlink.top(), shpxlink.width(), shpxlink.height() ) { - @Override - protected void onClick( Touch touch ) { - Intent intent = new Intent( Intent.ACTION_VIEW, Uri.parse( "https://" + LNK_SHPX ) ); - Game.instance.startActivity( intent ); - } - }; - add(shpxhotArea); - - Image wata = Icons.WATA.get(); - wata.x = wataOffset + (colWidth - wata.width()) / 2; - wata.y = ShatteredPixelDungeon.landscape() ? - colTop: - shpxlink.top() + wata.height + 20; - align(wata); - add( wata ); - - new Flare(7, 64).color(0x112233, true).show(wata, 0).angularSpeed = +20; - - RenderedText wataTitle = renderText( TTL_WATA, 8 ); - wataTitle.hardlight(Window.TITLE_COLOR); - add( wataTitle ); - - wataTitle.x = wataOffset + (colWidth - wataTitle.width()) / 2; - wataTitle.y = wata.y + wata.height + 11; - align(wataTitle); - - RenderedTextMultiline wataText = renderMultiline( TXT_WATA, 8 ); - wataText.maxWidth((int)Math.min(colWidth, 120)); - add( wataText ); - - wataText.setPos(wataOffset + (colWidth - wataText.width()) / 2, wataTitle.y + wataTitle.height() + 12); - align(wataText); - - RenderedTextMultiline wataLink = renderMultiline( LNK_WATA, 8 ); - wataLink.maxWidth((int)Math.min(colWidth, 120)); - wataLink.hardlight(Window.TITLE_COLOR); - add(wataLink); - - wataLink.setPos(wataOffset + (colWidth - wataLink.width()) / 2 , wataText.bottom() + 6); - align(wataLink); - - TouchArea hotArea = new TouchArea( wataLink.left(), wataLink.top(), wataLink.width(), wataLink.height() ) { - @Override - protected void onClick( Touch touch ) { - Intent intent = new Intent( Intent.ACTION_VIEW, Uri.parse( "https://" + LNK_WATA ) ); - Game.instance.startActivity( intent ); - } - }; - add( hotArea ); - - Archs archs = new Archs(); - archs.setSize(Camera.main.width, Camera.main.height); - addToBack(archs); - - ExitButton btnExit = new ExitButton(); - btnExit.setPos(Camera.main.width - btnExit.width(), 0); - add(btnExit); - - fadeIn(); - } - - @Override - protected void onBackPressed() { - ShatteredPixelDungeon.switchNoFade(TitleScene.class); - } -} diff --git a/java/com/hmdzl/spspd/change/scenes/AmuletScene.java b/java/com/hmdzl/spspd/change/scenes/AmuletScene.java deleted file mode 100644 index e19a23f7..00000000 --- a/java/com/hmdzl/spspd/change/scenes/AmuletScene.java +++ /dev/null @@ -1,120 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * Shattered Pixel Dungeon - * Copyright (C) 2014-2015 Evan Debenham - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.scenes; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.ResultDescriptions; -import com.hmdzl.spspd.change.effects.Flare; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.Amulet; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.ui.RedButton; -import com.hmdzl.spspd.change.ui.RenderedTextMultiline; -import com.watabou.noosa.Camera; -import com.watabou.noosa.Game; -import com.watabou.noosa.Image; -import com.watabou.utils.Random; - -public class AmuletScene extends PixelScene { - - private static final int WIDTH = 120; - private static final int BTN_HEIGHT = 18; - private static final float SMALL_GAP = 2; - private static final float LARGE_GAP = 8; - - private Image amulet; - - @Override - public void create() { - super.create(); - - RenderedTextMultiline text = null; - - text = renderMultiline( Messages.get(this, "text"), 8 ); - text.maxWidth(WIDTH); - add( text ); - - - amulet = new Image( Assets.AMULET ); - add( amulet ); - - RedButton btnExit = new RedButton( Messages.get(this, "exit") ) { - @Override - protected void onClick() { - Dungeon.win(Messages.format(ResultDescriptions.WIN)); - Dungeon.deleteGame( Dungeon.hero.heroClass, true ); - Game.switchScene( RankingsScene.class ); - } - }; - btnExit.setSize( WIDTH, BTN_HEIGHT ); - add( btnExit ); - - RedButton btnStay = new RedButton( Messages.get(this, "stay") ) { - @Override - protected void onClick() { - onBackPressed(); - } - }; - btnStay.setSize( WIDTH, BTN_HEIGHT ); - add( btnStay ); - - float height; - - height = amulet.height + LARGE_GAP + text.height() + LARGE_GAP + btnExit.height() + SMALL_GAP + btnStay.height(); - - amulet.x = (Camera.main.width - amulet.width) / 2; - amulet.y = (Camera.main.height - height) / 2; - align(amulet); - - text.setPos((Camera.main.width - text.width()) / 2, amulet.y + amulet.height + LARGE_GAP); - align(text); - - btnExit.setPos( (Camera.main.width - btnExit.width()) / 2, text.top() + text.height() + LARGE_GAP ); - btnStay.setPos( btnExit.left(), btnExit.bottom() + SMALL_GAP ); - - - new Flare( 8, 48 ).color( 0xFFDDBB, true ).show( amulet, 0 ).angularSpeed = +30; - - fadeIn(); - } - - @Override - protected void onBackPressed() { - InterlevelScene.mode = InterlevelScene.Mode.CONTINUE; - Game.switchScene( InterlevelScene.class ); - } - - private float timer = 0; - - @Override - public void update() { - super.update(); - - if ((timer -= Game.elapsed) < 0) { - timer = Random.Float( 0.5f, 5f ); - - Speck star = (Speck)recycle( Speck.class ); - star.reset( 0, amulet.x + 10.5f, amulet.y + 5.5f, Speck.DISCOVER ); - add( star ); - } - } -} diff --git a/java/com/hmdzl/spspd/change/scenes/BadgesScene.java b/java/com/hmdzl/spspd/change/scenes/BadgesScene.java deleted file mode 100644 index 03d900ca..00000000 --- a/java/com/hmdzl/spspd/change/scenes/BadgesScene.java +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.scenes; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.Chrome; -import com.hmdzl.spspd.change.ShatteredPixelDungeon; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.ui.Archs; -import com.hmdzl.spspd.change.ui.BadgesList; -import com.hmdzl.spspd.change.ui.ExitButton; -import com.hmdzl.spspd.change.ui.ScrollPane; -import com.hmdzl.spspd.change.ui.Window; -import com.watabou.noosa.BitmapText; -import com.watabou.noosa.Camera; -import com.watabou.noosa.Game; -import com.watabou.noosa.NinePatch; -import com.watabou.noosa.audio.Music; -import com.watabou.utils.Callback; -import com.watabou.noosa.RenderedText; - -public class BadgesScene extends PixelScene { - - private static final String TXT_TITLE = "Your Badges"; - - private static final int MAX_PANE_WIDTH = 160; - - @Override - public void create() { - - super.create(); - - Music.INSTANCE.play(Assets.THEME, true); - Music.INSTANCE.volume(1f); - - uiCamera.visible = false; - - int w = Camera.main.width; - int h = Camera.main.height; - - Archs archs = new Archs(); - archs.setSize(w, h); - add(archs); - - int pw = Math.min(MAX_PANE_WIDTH, w - 6); - int ph = h - 30; - - NinePatch panel = Chrome.get(Chrome.Type.WINDOW); - panel.size(pw, ph); - panel.x = (w - pw) / 2; - panel.y = (h - ph) / 2; - add(panel); - - RenderedText title = PixelScene.renderText( Messages.get(this, "title"), 9 ); - title.hardlight(Window.TITLE_COLOR); - title.x = align((w - title.width()) / 2); - title.y = align((panel.y - title.baseLine()) / 2); - add(title); - - Badges.loadGlobal(); - - ScrollPane list = new BadgesList(true); - add(list); - - list.setRect(panel.x + panel.marginLeft(), panel.y + panel.marginTop(), - panel.innerWidth(), panel.innerHeight()); - - ExitButton btnExit = new ExitButton(); - btnExit.setPos(Camera.main.width - btnExit.width(), 0); - add(btnExit); - - fadeIn(); - - Badges.loadingListener = new Callback() { - @Override - public void call() { - if (Game.scene() == BadgesScene.this) { - ShatteredPixelDungeon.switchNoFade(BadgesScene.class); - } - } - }; - } - - @Override - public void destroy() { - - Badges.saveGlobal(); - Badges.loadingListener = null; - - super.destroy(); - } - - @Override - protected void onBackPressed() { - ShatteredPixelDungeon.switchNoFade(TitleScene.class); - } -} diff --git a/java/com/hmdzl/spspd/change/scenes/CellSelector.java b/java/com/hmdzl/spspd/change/scenes/CellSelector.java deleted file mode 100644 index 837e475e..00000000 --- a/java/com/hmdzl/spspd/change/scenes/CellSelector.java +++ /dev/null @@ -1,179 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.scenes; - -import com.hmdzl.spspd.change.DungeonTilemap; -import com.hmdzl.spspd.change.ShatteredPixelDungeon; -import com.watabou.input.Touchscreen.Touch; -import com.watabou.noosa.TouchArea; -import com.watabou.utils.GameMath; -import com.watabou.utils.PointF; - -public class CellSelector extends TouchArea { - - public Listener listener = null; - - public boolean enabled; - - private float dragThreshold; - - public CellSelector(DungeonTilemap map) { - super(map); - camera = map.camera(); - - dragThreshold = PixelScene.defaultZoom * DungeonTilemap.SIZE / 2; - } - - @Override - protected void onClick(Touch touch) { - if (dragging) { - - dragging = false; - - } else { - - select(((DungeonTilemap) target).screenToTile( - (int) touch.current.x, (int) touch.current.y)); - } - } - - public void select(int cell) { - if (enabled && listener != null && cell != -1) { - - listener.onSelect(cell); - GameScene.ready(); - - } else { - - GameScene.cancel(); - - } - } - - private boolean pinching = false; - private Touch another; - private float startZoom; - private float startSpan; - - @Override - protected void onTouchDown(Touch t) { - - if (t != touch && another == null) { - - if (!touch.down) { - touch = t; - onTouchDown(t); - return; - } - - pinching = true; - - another = t; - startSpan = PointF.distance(touch.current, another.current); - startZoom = camera.zoom; - - dragging = false; - } else if (t != touch) { - reset(); - } - } - - @Override - protected void onTouchUp(Touch t) { - if (pinching && (t == touch || t == another)) { - - pinching = false; - - int zoom = Math.round(camera.zoom); - camera.zoom(zoom); - ShatteredPixelDungeon.zoom((int) (zoom - PixelScene.defaultZoom)); - - dragging = true; - if (t == touch) { - touch = another; - } - another = null; - lastPos.set(touch.current); - } - } - - private boolean dragging = false; - private PointF lastPos = new PointF(); - - @Override - protected void onDrag(Touch t) { - - camera.target = null; - - if (pinching) { - - float curSpan = PointF.distance(touch.current, another.current); - camera.zoom(GameMath.gate(PixelScene.minZoom, startZoom * curSpan - / startSpan, PixelScene.maxZoom)); - - } else { - - if (!dragging - && PointF.distance(t.current, t.start) > dragThreshold) { - - dragging = true; - lastPos.set(t.current); - - } else if (dragging) { - camera.scroll.offset(PointF.diff(lastPos, t.current).invScale( - camera.zoom)); - lastPos.set(t.current); - } - } - - } - - public void cancel() { - - if (listener != null) { - listener.onSelect(null); - } - - GameScene.ready(); - } - - @Override - public void reset() { - super.reset(); - another = null; - if (pinching) { - pinching = false; - - int zoom = Math.round(camera.zoom); - camera.zoom(zoom); - ShatteredPixelDungeon.zoom((int) (zoom - PixelScene.defaultZoom)); - } - } - - public void enable(boolean value) { - if (enabled != value) { - enabled = value; - } - } - - public interface Listener { - void onSelect(Integer cell); - - String prompt(); - } -} diff --git a/java/com/hmdzl/spspd/change/scenes/GameScene.java b/java/com/hmdzl/spspd/change/scenes/GameScene.java deleted file mode 100644 index 9f98a7ab..00000000 --- a/java/com/hmdzl/spspd/change/scenes/GameScene.java +++ /dev/null @@ -1,866 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.scenes; - -import java.io.IOException; -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.DungeonTilemap; -import com.hmdzl.spspd.change.FogOfWar; -import com.hmdzl.spspd.change.ShatteredPixelDungeon; -import com.hmdzl.spspd.change.Statistics; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.blobs.Blob; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.effects.BannerSprites; -import com.hmdzl.spspd.change.effects.BlobEmitter; -import com.hmdzl.spspd.change.effects.CircleArc; -import com.hmdzl.spspd.change.effects.EmoIcon; -import com.hmdzl.spspd.change.effects.Flare; -import com.hmdzl.spspd.change.effects.FloatingText; -import com.hmdzl.spspd.change.effects.Ripple; -import com.hmdzl.spspd.change.effects.SpellSprite; -import com.hmdzl.spspd.change.items.Heap; -import com.hmdzl.spspd.change.items.summon.Honeypot; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.bags.PotionBandolier; -import com.hmdzl.spspd.change.items.bags.ScrollHolder; -import com.hmdzl.spspd.change.items.bags.SeedPouch; -import com.hmdzl.spspd.change.items.bags.WandHolster; -import com.hmdzl.spspd.change.items.potions.Potion; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfTeleportation; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.RegularLevel; -import com.hmdzl.spspd.change.levels.features.Chasm; -import com.hmdzl.spspd.change.levels.traps.Trap; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.plants.Plant; -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.hmdzl.spspd.change.sprites.DiscardedItemSprite; -import com.hmdzl.spspd.change.sprites.HeroSprite; -import com.hmdzl.spspd.change.sprites.ItemSprite; -import com.hmdzl.spspd.change.sprites.PlantSprite; -import com.hmdzl.spspd.change.sprites.TrapSprite; -import com.hmdzl.spspd.change.ui.ActionIndicator; -import com.hmdzl.spspd.change.ui.AttackIndicator; -import com.hmdzl.spspd.change.ui.Banner; -import com.hmdzl.spspd.change.ui.BusyIndicator; -import com.hmdzl.spspd.change.ui.CharHealthIndicator; -import com.hmdzl.spspd.change.ui.GameLog; -import com.hmdzl.spspd.change.ui.HealthIndicator; -import com.hmdzl.spspd.change.ui.LootIndicator; -import com.hmdzl.spspd.change.ui.QuickSlotButton; -import com.hmdzl.spspd.change.ui.ResumeIndicator; -import com.hmdzl.spspd.change.ui.StatusPane; -import com.hmdzl.spspd.change.ui.TargetHealthIndicator; -import com.hmdzl.spspd.change.ui.Toast; -import com.hmdzl.spspd.change.ui.Toolbar; -import com.hmdzl.spspd.change.ui.Window; -import com.hmdzl.spspd.change.utils.GLog; -import com.hmdzl.spspd.change.windows.WndBag; -import com.hmdzl.spspd.change.windows.WndBag.Mode; -import com.hmdzl.spspd.change.windows.WndGame; -import com.hmdzl.spspd.change.windows.WndHero; -import com.hmdzl.spspd.change.windows.WndInfoCell; -import com.hmdzl.spspd.change.windows.WndInfoItem; -import com.hmdzl.spspd.change.windows.WndInfoMob; -import com.hmdzl.spspd.change.windows.WndInfoPlant; -import com.hmdzl.spspd.change.windows.WndInfoTrap; -import com.hmdzl.spspd.change.windows.WndMessage; -import com.hmdzl.spspd.change.windows.WndStory; -import com.hmdzl.spspd.change.windows.WndTradeItem; -import com.watabou.noosa.Camera; -import com.watabou.noosa.Game; -import com.watabou.noosa.Group; -import com.watabou.noosa.SkinnedBlock; -import com.watabou.noosa.Visual; -import com.watabou.noosa.audio.Music; -import com.watabou.noosa.audio.Sample; -import com.watabou.noosa.particles.Emitter; -import com.watabou.utils.Random; - -public class GameScene extends PixelScene { - - private static final String TXT_WELCOME = "Welcome to the level %d of Pixel Dungeon!"; - private static final String TXT_WELCOME_BACK = "Welcome back to the level %d of Pixel Dungeon!"; - - private static final String TXT_CHASM = "Your steps echo across the dungeon."; - private static final String TXT_WATER = "You hear water splashing around you."; - private static final String TXT_GRASS = "The smell of vegetation is thick in the air."; - private static final String TXT_DARK = "You can hear enemies moving in the darkness..."; - private static final String TXT_SECRETS = "The atmosphere hints that this floor hides many secrets."; - - static GameScene scene; - - private SkinnedBlock water; - private DungeonTilemap tiles; - private FogOfWar fog; - private HeroSprite hero; - - private GameLog log; - - private BusyIndicator busy; - private CircleArc counter; - - private static CellSelector cellSelector; - - private Group terrain; - private Group ripples; - private Group plants; - private Group traps; - private Group heaps; - private Group mobs; - private Group emitters; - private Group effects; - private Group gases; - private Group spells; - private Group statuses; - private Group emoicons; - private Group healthIndicators; - - private Toolbar toolbar; - private Toast prompt; - - private AttackIndicator attack; - private LootIndicator loot; - private ActionIndicator action; - private ResumeIndicator resume; - - @Override - public void create() { - - Music.INSTANCE.play(Assets.TUNE, true); - Music.INSTANCE.volume(1f); - - ShatteredPixelDungeon.lastClass(Dungeon.hero.heroClass.ordinal()); - - super.create(); - Camera.main.zoom(defaultZoom + ShatteredPixelDungeon.zoom()); - - scene = this; - - terrain = new Group(); - add(terrain); - - water = new SkinnedBlock(Level.getWidth() * DungeonTilemap.SIZE, - Level.HEIGHT * DungeonTilemap.SIZE, Dungeon.level.waterTex()); - terrain.add(water); - - ripples = new Group(); - terrain.add(ripples); - - tiles = new DungeonTilemap(); - terrain.add(tiles); - - Dungeon.level.addVisuals(this); - - traps = new Group(); - add(traps); - - int size = Dungeon.level.traps.size(); - for (int i=0; i < size; i++) { - addTrapSprite( Dungeon.level.traps.valueAt( i ) ); - } - - plants = new Group(); - add(plants); - - size = Dungeon.level.plants.size(); - for (int i = 0; i < size; i++) { - addPlantSprite(Dungeon.level.plants.valueAt(i)); - } - - heaps = new Group(); - add(heaps); - - size = Dungeon.level.heaps.size(); - for (int i = 0; i < size; i++) { - addHeapSprite(Dungeon.level.heaps.valueAt(i)); - } - - emitters = new Group(); - effects = new Group(); - emoicons = new Group(); - healthIndicators = new Group(); - - mobs = new Group(); - add(mobs); - - for (Mob mob : Dungeon.level.mobs) { - addMobSprite(mob); - } - - add(emitters); - add(effects); - - gases = new Group(); - add(gases); - - for (Blob blob : Dungeon.level.blobs.values()) { - blob.emitter = null; - addBlobSprite(blob); - } - - fog = new FogOfWar(Level.getWidth(), Level.HEIGHT); - fog.updateVisibility(Dungeon.visible, Dungeon.level.visited, - Dungeon.level.mapped); - add(fog); - - brightness(ShatteredPixelDungeon.brightness()); - - spells = new Group(); - add(spells); - - statuses = new Group(); - add(statuses); - - add( healthIndicators ); - //always appears ontop of other health indicators - add( new TargetHealthIndicator() ); - - add(emoicons); - - hero = new HeroSprite(); - hero.place(Dungeon.hero.pos); - hero.updateArmor(); - mobs.add(hero); - - add(new HealthIndicator()); - - add(cellSelector = new CellSelector(tiles)); - - StatusPane sb = new StatusPane(); - sb.camera = uiCamera; - sb.setSize(uiCamera.width, 0); - add(sb); - - toolbar = new Toolbar(); - toolbar.camera = uiCamera; - toolbar.setRect(0, uiCamera.height - toolbar.height(), uiCamera.width, - toolbar.height()); - add(toolbar); - - attack = new AttackIndicator(); - attack.camera = uiCamera; - attack.setPos(uiCamera.width - attack.width(), - toolbar.top() - attack.height()); - add(attack); - - loot = new LootIndicator(); - loot.camera = uiCamera; - add(loot); - - action = new ActionIndicator(); - action.camera = uiCamera; - action.setPos(uiCamera.width - attack.width(), - toolbar.top() -3 * attack.height()); - add( action ); - - resume = new ResumeIndicator(); - resume.camera = uiCamera; - add(resume); - - layoutTags(); - - log = new GameLog(); - log.camera = uiCamera; - log.setRect(0, toolbar.top(), attack.left(), 0); - add(log); - - if (Dungeon.depth < Statistics.deepestFloor) - GLog.i(Messages.get(this, "welcome_back"), Dungeon.depth); - else - GLog.i(Messages.get(this, "welcome"), Dungeon.depth); - Sample.INSTANCE.play(Assets.SND_DESCEND); - switch (Dungeon.level.feeling) { - case CHASM: - GLog.w(Messages.get(this, "chasm")); - break; - case WATER: - GLog.w(Messages.get(this, "water")); - break; - case GRASS: - GLog.w(Messages.get(this, "grass")); - break; - case DARK: - GLog.w(Messages.get(this, "dark")); - break; - default: - } - if (Dungeon.level instanceof RegularLevel - && ((RegularLevel) Dungeon.level).secretDoors > Random - .IntRange(3, 4)) { - GLog.w(Messages.get(this, "secrets")); - } - - busy = new BusyIndicator(); - busy.camera = uiCamera; - busy.x = 1; - busy.y = sb.bottom() + 1; - add(busy); - - /*counter = new CircleArc(18, 4.25f); - counter.color( 0x808080, true ); - counter.camera = uiCamera; - counter.show(this, busy.center(), 0f);*/ - - switch (InterlevelScene.mode) { - case RESURRECT: - ScrollOfTeleportation.appear(Dungeon.hero, Dungeon.level.entrance); - new Flare(8, 32).color(0xFFFF66, true).show(hero, 2f); - break; - case RETURN: - ScrollOfTeleportation.appear(Dungeon.hero, Dungeon.hero.pos); - break; - case FALL: - Chasm.heroLand(); - break; - case PALANTIR: - WndStory.showChapter(WndStory.ID_ZOT); - break; - case DESCEND: - switch (Dungeon.depth) { - case 1: - WndStory.showChapter(WndStory.ID_SEWERS); - break; - case 6: - WndStory.showChapter(WndStory.ID_PRISON); - break; - case 11: - WndStory.showChapter(WndStory.ID_CAVES); - break; - case 16: - WndStory.showChapter(WndStory.ID_CITY); - break; - } - case CHAOS: - switch (Dungeon.depth) { - case 85: - WndStory.showChapter(WndStory.ID_CHAOS); - break; - } - case JOURNAL: - switch (Dungeon.depth) { - case 50: - WndStory.showChapter(WndStory.ID_SAFELEVEL); - break; - case 51: - WndStory.showChapter(WndStory.ID_SOKOBAN1); - break; - case 52: - WndStory.showChapter(WndStory.ID_SOKOBAN2); - break; - case 53: - WndStory.showChapter(WndStory.ID_SOKOBAN3); - break; - case 54: - WndStory.showChapter(WndStory.ID_SOKOBAN4); - break; - case 55: - WndStory.showChapter(WndStory.ID_TOWN); - break; - } - - if (Dungeon.hero.isAlive() && Dungeon.depth != 22) { - Badges.validateNoKilling(); - } - break; - default: - } - - ArrayList dropped = Dungeon.droppedItems.get(Dungeon.depth); - if (dropped != null) { - for (Item item : dropped) { - int pos = Dungeon.level.randomRespawnCell(); - if (item instanceof Potion) { - ((Potion) item).shatter(pos); - } else if (item instanceof Plant.Seed) { - Dungeon.level.plant((Plant.Seed) item, pos); - } else if (item instanceof Honeypot) { - Dungeon.level.drop(((Honeypot) item).shatter(null, pos), - pos); - } else { - Dungeon.level.drop(item, pos); - } - } - Dungeon.droppedItems.remove(Dungeon.depth); - } - - Camera.main.target = hero; - fadeIn(); - } - - @Override - public void destroy() { - - freezeEmitters = false; - - scene = null; - Badges.saveGlobal(); - - super.destroy(); - } - - @Override - public synchronized void pause() { - try { - Dungeon.saveAll(); - Badges.saveGlobal(); - } catch (IOException e) { - // - } - } - - @Override - public synchronized void update() { - if (Dungeon.hero == null) { - return; - } - - super.update(); - - if (!freezeEmitters) - water.offset(0, -5 * Game.elapsed); - - Actor.process(); - - if (Dungeon.hero.ready && Dungeon.hero.paralysed == 0) { - log.newLine(); - } - - if (tagAttack != attack.active || tagLoot != loot.visible - || tagResume != resume.visible) { - - boolean atkAppearing = attack.active && !tagAttack; - boolean lootAppearing = loot.visible && !tagLoot; - boolean resAppearing = resume.visible && !tagResume; - - tagAttack = attack.active; - tagLoot = loot.visible; - tagResume = resume.visible; - - if (atkAppearing || lootAppearing || resAppearing) - layoutTags(); - } - - cellSelector.enable(Dungeon.hero.ready); - } - - private boolean tagAttack = false; - private boolean tagLoot = false; - private boolean tagResume = false; - - private void layoutTags() { - - float pos = tagAttack ? attack.top() : toolbar.top(); - - if (tagLoot) { - loot.setPos(uiCamera.width - loot.width(), pos - loot.height()); - pos = loot.top(); - } - - if (tagResume) { - resume.setPos(uiCamera.width - resume.width(), - pos - resume.height()); - } - } - - @Override - protected void onBackPressed() { - if (!cancel()) { - add(new WndGame()); - } - } - - @Override - protected void onMenuPressed() { - if (Dungeon.hero.ready) { - selectItem(null, WndBag.Mode.ALL, null); - } - } - - public void brightness(boolean value) { - water.rm = water.gm = water.bm = tiles.rm = tiles.gm = tiles.bm = value ? 1.5f - : 1.0f; - if (value) { - fog.am = +2f; - fog.aa = -1f; - } else { - fog.am = +1f; - fog.aa = 0f; - } - } - - private void addHeapSprite(Heap heap) { - ItemSprite sprite = heap.sprite = (ItemSprite) heaps - .recycle(ItemSprite.class); - sprite.revive(); - sprite.link(heap); - heaps.add(sprite); - } - - private void addDiscardedSprite(Heap heap) { - heap.sprite = (DiscardedItemSprite) heaps - .recycle(DiscardedItemSprite.class); - heap.sprite.revive(); - heap.sprite.link(heap); - heaps.add(heap.sprite); - } - - private void addPlantSprite(Plant plant) { - (plant.sprite = (PlantSprite) plants.recycle(PlantSprite.class)) - .reset(plant); - } - - private void addTrapSprite( Trap trap ) { - (trap.sprite = (TrapSprite)traps.recycle( TrapSprite.class )).reset( trap ); - trap.sprite.visible = trap.visible; - } - - private void addBlobSprite(final Blob gas) { - if (gas.emitter == null) { - gases.add(new BlobEmitter(gas)); - } - } - - private void addMobSprite(Mob mob) { - CharSprite sprite = mob.sprite(); - sprite.visible = Dungeon.visible[mob.pos]; - mobs.add(sprite); - sprite.link(mob); - } - - private void prompt(String text) { - - if (prompt != null) { - prompt.killAndErase(); - prompt = null; - } - - if (text != null) { - prompt = new Toast(text) { - @Override - protected void onClose() { - cancel(); - } - }; - prompt.camera = uiCamera; - prompt.setPos((uiCamera.width - prompt.width()) / 2, - uiCamera.height - 60); - add(prompt); - } - } - - private void showBanner(Banner banner) { - banner.camera = uiCamera; - banner.x = align(uiCamera, (uiCamera.width - banner.width) / 2); - banner.y = align(uiCamera, (uiCamera.height - banner.height) / 3); - //add(banner); - addToFront( banner ); - } - - // ------------------------------------------------------- - - public static void add(Plant plant) { - if (scene != null) { - scene.addPlantSprite(plant); - } - } - - public static void add( Trap trap ) { - if (scene != null) { - scene.addTrapSprite( trap ); - } - } - - public static void add(Blob gas) { - Actor.add(gas); - if (scene != null) { - scene.addBlobSprite(gas); - } - } - - public static void add(Heap heap) { - if (scene != null) { - scene.addHeapSprite(heap); - } - } - - public static void discard(Heap heap) { - if (scene != null) { - scene.addDiscardedSprite(heap); - } - } - - public static void add(Mob mob) { - Dungeon.level.mobs.add(mob); - Actor.add(mob); - Actor.occupyCell(mob); - scene.addMobSprite(mob); - } - - public static void add(Mob mob, float delay) { - Dungeon.level.mobs.add(mob); - Actor.addDelayed(mob, delay); - Actor.occupyCell(mob); - scene.addMobSprite(mob); - } - - public static void add(EmoIcon icon) { - scene.emoicons.add(icon); - } - - public static void add( CharHealthIndicator indicator ){ - if (scene != null) scene.healthIndicators.add(indicator); - } - - public static void effect(Visual effect) { - scene.effects.add(effect); - } - - public static Ripple ripple(int pos) { - Ripple ripple = (Ripple) scene.ripples.recycle(Ripple.class); - ripple.reset(pos); - return ripple; - } - - public static SpellSprite spellSprite() { - return (SpellSprite) scene.spells.recycle(SpellSprite.class); - } - - public static Emitter emitter() { - if (scene != null) { - Emitter emitter = (Emitter) scene.emitters.recycle(Emitter.class); - emitter.revive(); - return emitter; - } else { - return null; - } - } - - public static FloatingText status() { - return scene != null ? (FloatingText) scene.statuses - .recycle(FloatingText.class) : null; - } - - public static void pickUp(Item item) { - scene.toolbar.pickup(item); - } - - public static void resetMap() { - if (scene != null) { - scene.tiles.map(Dungeon.level.map, Level.getWidth() ); - - } - } - - public static void updateMap() { - if (scene != null) { - scene.tiles.updated.set(0, 0, Level.getWidth(), Level.HEIGHT); - } - } - - public static void updateMap(int cell) { - if (scene != null) { - scene.tiles.updated.union(cell % Level.getWidth(), cell / Level.getWidth()); - } - } - - public static void discoverTile(int pos, int oldValue) { - if (scene != null) { - scene.tiles.discover(pos, oldValue); - } - } - - public static void show(Window wnd) { - //cancelCellSelector(); - //scene.add(wnd); - if (scene != null) { - cancelCellSelector(); - scene.addToFront(wnd); - } - } - - public static void afterObserve() { - if (scene != null) { - scene.fog.updateVisibility(Dungeon.visible, Dungeon.level.visited, - Dungeon.level.mapped); - - for (Mob mob : Dungeon.level.mobs) { - mob.sprite.visible = Dungeon.visible[mob.pos]; - } - } - } - - public static void flash(int color) { - scene.fadeIn(0xFF000000 | color, true); - } - - public static void gameOver() { - Banner gameOver = new Banner( - BannerSprites.get(BannerSprites.Type.GAME_OVER)); - gameOver.show(0x000000, 1f); - scene.showBanner(gameOver); - - Sample.INSTANCE.play(Assets.SND_DEATH); - } - - public static void bossSlain() { - if (Dungeon.hero.isAlive()) { - Banner bossSlain = new Banner( - BannerSprites.get(BannerSprites.Type.BOSS_SLAIN)); - bossSlain.show(0xFFFFFF, 0.3f, 5f); - scene.showBanner(bossSlain); - - Sample.INSTANCE.play(Assets.SND_BOSS); - } - } - - public static void levelCleared() { - if (Dungeon.hero.isAlive()) { - Banner levelCleared = new Banner( - BannerSprites.get(BannerSprites.Type.CLEARED)); - levelCleared.show(0xFFFFFF, 0.3f, 5f); - scene.showBanner(levelCleared); - - Sample.INSTANCE.play(Assets.SND_BADGE); - } - } - - public static void handleCell(int cell) { - cellSelector.select(cell); - } - - public static void selectCell(CellSelector.Listener listener) { - cellSelector.listener = listener; - scene.prompt(listener.prompt()); - } - - private static boolean cancelCellSelector() { - if (cellSelector.listener != null - && cellSelector.listener != defaultCellListener) { - cellSelector.cancel(); - return true; - } else { - return false; - } - } - - public static WndBag selectItem(WndBag.Listener listener, WndBag.Mode mode, - String title) { - cancelCellSelector(); - - WndBag wnd = - mode == Mode.SEED ? WndBag.getBag(SeedPouch.class, listener, mode, title) : - mode == Mode.SCROLL ? WndBag.getBag(ScrollHolder.class, listener, mode, title) : - mode == Mode.POTION ? WndBag.getBag(PotionBandolier.class, listener, mode, title) : - mode == Mode.WAND ? WndBag.getBag(WandHolster.class, listener, mode, title) : - WndBag.lastBag(listener, mode, title); - - //scene.add(wnd); - - if (scene != null) scene.addToFront( wnd ); - - return wnd; - } - - static boolean cancel() { - if (Dungeon.hero.curAction != null || Dungeon.hero.restoreHealth) { - - Dungeon.hero.curAction = null; - Dungeon.hero.restoreHealth = false; - return true; - - } else { - - return cancelCellSelector(); - - } - } - - public static void ready() { - selectCell(defaultCellListener); - QuickSlotButton.cancel(); - if (scene != null && scene.toolbar != null) scene.toolbar.examining = false; - } - - public static void examineCell( Integer cell ) { - if (cell == null) { - return; - } - - if (cell < 0 || cell > Level.LENGTH || (!Dungeon.level.visited[cell] && !Dungeon.level.mapped[cell])) { - GameScene.show( new WndMessage( Messages.get(GameScene.class, "dont_know") ) ) ; - return; - } - - if (cell == Dungeon.hero.pos) { - GameScene.show( new WndHero() ); - return; - } - - if (Dungeon.visible[cell]) { - Mob mob = (Mob) Actor.findChar(cell); - if (mob != null) { - GameScene.show(new WndInfoMob(mob)); - return; - } - } - - Heap heap = Dungeon.level.heaps.get(cell); - if (heap != null && heap.seen) { - if (heap.type == Heap.Type.FOR_SALE && heap.size() == 1 && heap.peek().price() > 0) { - GameScene.show(new WndTradeItem(heap, false)); - } else { - GameScene.show(new WndInfoItem(heap)); - } - return; - } - - Plant plant = Dungeon.level.plants.get( cell ); - if (plant != null) { - GameScene.show( new WndInfoPlant( plant ) ); - return; - } - - Trap trap = Dungeon.level.traps.get( cell ); - if (trap != null && trap.visible) { - GameScene.show( new WndInfoTrap( trap )); - return; - } - - GameScene.show( new WndInfoCell( cell ) ); - } - - private static final CellSelector.Listener defaultCellListener = new CellSelector.Listener() { - @Override - public void onSelect(Integer cell) { - if (Dungeon.hero.handle(cell)) { - Dungeon.hero.next(); - } - } - - @Override - public String prompt() { - return null; - } - }; -} diff --git a/java/com/hmdzl/spspd/change/scenes/InterlevelScene.java b/java/com/hmdzl/spspd/change/scenes/InterlevelScene.java deleted file mode 100644 index 447d4915..00000000 --- a/java/com/hmdzl/spspd/change/scenes/InterlevelScene.java +++ /dev/null @@ -1,584 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.scenes; - -import java.io.FileNotFoundException; -import java.io.IOException; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.Statistics; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.actors.mobs.pets.PET; -import com.hmdzl.spspd.change.items.Generator; -import com.hmdzl.spspd.change.items.artifacts.DriedRose; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.ui.GameLog; -import com.hmdzl.spspd.change.utils.GLog; -import com.hmdzl.spspd.change.windows.WndError; -import com.hmdzl.spspd.change.windows.WndStory; -import com.watabou.noosa.BitmapText; -import com.watabou.noosa.Camera; -import com.watabou.noosa.Game; -import com.watabou.noosa.audio.Music; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Random; -import com.watabou.noosa.RenderedText; -import com.hmdzl.spspd.change.messages.Messages; - -public class InterlevelScene extends PixelScene { - - private static final float TIME_TO_FADE = 0.3f; - - public static enum Mode { - DESCEND, ASCEND, CONTINUE, RESURRECT, RETURN, FALL, /*PORT1, PORT2, PORT3,*/ PORT4, - /*PORTSEWERS, PORTPRISON, PORTCAVES, PORTCITY, ORTHALLS,*/ PORTCRAB, PORTTENGU, PORTCOIN, PORTBONE, RETURNSAVE, - JOURNAL, SOKOBANFAIL, PALANTIR, BOSSRUSH, PORTMAP, SAVE, SLEEP, CHALLENGEBOOK, RESET,CHAOS - }; - - public static Mode mode; - - public static int returnDepth; - public static int returnPos; - - public static int journalpage; - public static boolean first; - - public static int challengelist; - - public static boolean noStory = false; - - public static boolean fallIntoPit; - - private enum Phase { - FADE_IN, STATIC, FADE_OUT - }; - - private Phase phase; - private float timeLeft; - - private RenderedText message; - - private Thread thread; - private Exception error = null; - - @Override - public void create() { - super.create(); - - String text = Messages.get(Mode.class, mode.name()); - - message = PixelScene.renderText(text, 9); - message.x = (Camera.main.width - message.width()) / 2; - message.y = (Camera.main.height - message.height()) / 2; - align(message); - add(message); - - phase = Phase.FADE_IN; - timeLeft = TIME_TO_FADE; - - thread = new Thread() { - @Override - public void run() { - - try { - - Generator.reset(); - - switch (mode) { - case DESCEND: - descend(); - break; - case ASCEND: - ascend(); - break; - case CONTINUE: - restore(); - break; - case RESURRECT: - resurrect(); - break; - case RETURN: - returnTo(); - break; - case RETURNSAVE: - returnToSave(); - break; - case FALL: - fall(); - break; - //case PORT1: - //portal(1); - //break; - //case PORT2: - //portal(2); - //break; - //case PORT3: - //portal(3); - //break; - case PORT4: - portal(4); - break; - //case PORTSEWERS: - //portal(5); - //break; - //case PORTPRISON: - //portal(6); - //break; - //case PORTCAVES: - //portal(7); - //break; - //case PORTCITY: - //portal(8); - //break; - //case PORTHALLS: - //portal(9); - //break; - case PORTCRAB: - portal(10); - break; - case PORTTENGU: - portal(11); - break; - case PORTCOIN: - portal(12); - break; - case PORTBONE: - portal(13); - break; - case JOURNAL: - journalPortal(journalpage); - break; - case SOKOBANFAIL: - ascend(); - break; - case PALANTIR: - portal(14); - break; - case BOSSRUSH: - portal(15); - break; - case PORTMAP: - portal(16); - break; - case SAVE: - restore2(); - break; - case SLEEP: - restore3(); - break; - case CHALLENGEBOOK: - challengePortal(challengelist); - break; - case RESET: - reset(); - break; - case CHAOS: - portal(17); - break; - } - - if ((Dungeon.depth % 5) == 0) { - Sample.INSTANCE.load(Assets.SND_BOSS); - } - - } catch (Exception e) { - - error = e; - - } - - if (phase == Phase.STATIC && error == null) { - phase = Phase.FADE_OUT; - timeLeft = TIME_TO_FADE; - } - } - }; - thread.start(); - } - - @Override - public void update() { - super.update(); - - float p = timeLeft / TIME_TO_FADE; - - switch (phase) { - - case FADE_IN: - message.alpha(1 - p); - if ((timeLeft -= Game.elapsed) <= 0) { - if (!thread.isAlive() && error == null) { - phase = Phase.FADE_OUT; - timeLeft = TIME_TO_FADE; - } else { - phase = Phase.STATIC; - } - } - break; - - case FADE_OUT: - message.alpha(p); - - if (mode == Mode.CONTINUE - || (mode == Mode.DESCEND && Dungeon.depth == 1)) { - Music.INSTANCE.volume(p); - } - if ((timeLeft -= Game.elapsed) <= 0) { - Game.switchScene(GameScene.class); - } - break; - - case STATIC: - if (error != null) { - String errorMsg; - if (error instanceof FileNotFoundException) errorMsg = Messages.get(this, "file_not_found"); - else if (error instanceof IOException) errorMsg = Messages.get(this, "io_error"); - else throw new RuntimeException( - "fatal error occured while moving between floors", - error); - - add(new WndError(errorMsg) { - @Override - public void onBackPressed() { - super.onBackPressed(); - Game.switchScene(StartScene.class); - }; - }); - error = null; - } - break; - } - } - - private void descend() throws IOException { - - Actor.fixTime(); - if (Dungeon.hero == null) { - DriedRose.clearHeldGhostHero(); - Dungeon.init(); - if (noStory) { - Dungeon.chapters.add(WndStory.ID_SEWERS); - noStory = false; - } - GameLog.wipe(); - } else { - //DriedRose.holdGhostHero( Dungeon.level ); - DriedRose.clearHeldGhostHero(); - //Dungeon.saveLevel(); - Dungeon.saveAll(); - } - - Level level; - if ((Dungeon.depth>55) && (Dungeon.depth >= Statistics.realdeepestFloor) && ((Random.Int(100)<101) || Dungeon.depth==56) ){ - level = Dungeon.newMineBossLevel(); - }else if (Dungeon.townCheck(Dungeon.depth) && (Dungeon.depth >= Statistics.realdeepestFloor || Random.Int(10)<2)){ - level = Dungeon.newLevel(); - }else if (Dungeon.depth >= Statistics.deepestFloor && !Dungeon.townCheck(Dungeon.depth) ){ - level = Dungeon.newLevel(); - } else { - Dungeon.depth++; - level = Dungeon.loadLevel(Dungeon.hero.heroClass); - } - Dungeon.switchLevel(level, level.entrance); - } - - private void fall() throws IOException { - - Actor.fixTime(); - DriedRose.clearHeldGhostHero(); - //DriedRose.holdGhostHero( Dungeon.level ); - //Dungeon.saveLevel(); - Dungeon.saveAll(); - - Level level; - if (Dungeon.depth >= Statistics.deepestFloor) { - level = Dungeon.newLevel(); - } else { - Dungeon.depth++; - level = Dungeon.loadLevel(Dungeon.hero.heroClass); - } - Dungeon.switchLevel(level, - fallIntoPit ? level.pitCell() : level.randomRespawnCell()); - } - - private void ascend() throws IOException { - Actor.fixTime(); - //DriedRose.holdGhostHero( Dungeon.level ); - DriedRose.clearHeldGhostHero(); - Dungeon.saveAll(); - //Dungeon.saveLevel(); - if (Dungeon.depth == 41) { - Dungeon.depth=40; - Level level = Dungeon.loadLevel(Dungeon.hero.heroClass); - Dungeon.switchLevel(level, level.entrance); - } else if (Dungeon.depth > 26 && !Dungeon.townCheck(Dungeon.depth)) { - Dungeon.depth=1; - Level level = Dungeon.loadLevel(Dungeon.hero.heroClass); - Dungeon.switchLevel(level, level.entrance); - } else { - Dungeon.depth--; - Level level = Dungeon.loadLevel(Dungeon.hero.heroClass); - Dungeon.switchLevel(level, level.exit); - } - } - - private void returnTo() throws IOException { - Actor.fixTime(); - DriedRose.clearHeldGhostHero(); - //DriedRose.holdGhostHero( Dungeon.level ); - //Dungeon.hero.invisible=0; - Dungeon.saveAll(); - Dungeon.depth = returnDepth; - Level level = Dungeon.loadLevel(Dungeon.hero.heroClass); - Dungeon.switchLevel(level, - Level.resizingNeeded ? level.adjustPos(returnPos) : returnPos); - } - - private void returnToSave() throws IOException { - - Actor.fixTime(); - DriedRose.clearHeldGhostHero(); - // Dungeon.hero.invisible=0; - Dungeon.saveAll(); - if (Dungeon.bossLevel(Statistics.deepestFloor)){ - Dungeon.depth = Statistics.deepestFloor-1; - } else { - Dungeon.depth = Statistics.deepestFloor; - } - Level level = Dungeon.loadLevel(Dungeon.hero.heroClass); - Dungeon.switchLevel(level, level.entrance); - } - - private void restore() throws IOException { - - Actor.fixTime(); - GameLog.wipe(); - DriedRose.clearHeldGhostHero(); - Dungeon.loadGame(StartScene.curClass); - if (Dungeon.depth == -1) { - Dungeon.depth = Statistics.deepestFloor; - Dungeon.switchLevel(Dungeon.loadLevel(StartScene.curClass), -1); - } else { - Level level = Dungeon.loadLevel(StartScene.curClass); - Dungeon.switchLevel(level, - Level.resizingNeeded ? level.adjustPos(Dungeon.hero.pos) - : Dungeon.hero.pos); - } - } - - private void restore2() throws IOException { - - Actor.fixTime(); - DriedRose.clearHeldGhostHero(); - Dungeon.loadGame(StartScene.curClass); - if (Dungeon.depth == -1) { - Dungeon.depth = Statistics.deepestFloor; - Dungeon.switchLevel(Dungeon.loadLevel(StartScene.curClass), -1); - } else { - Level level = Dungeon.loadLevel(StartScene.curClass); - Dungeon.switchLevel( level, Dungeon.hero.pos ); - //Dungeon.switchLevel(level,Level.resizingNeeded ? level.adjustPos(Dungeon.hero.pos): Dungeon.hero.pos); - } - } - - private void restore3() throws IOException { - - Actor.fixTime(); - DriedRose.clearHeldGhostHero(); - Dungeon.loadGame(StartScene.curClass); - if (Dungeon.depth == -1) { - Dungeon.depth = Statistics.deepestFloor; - Dungeon.switchLevel(Dungeon.loadLevel(StartScene.curClass), -1); - } else { - Level level = Dungeon.loadLevel(StartScene.curClass); - Dungeon.switchLevel( level, Dungeon.hero.pos ); - //Dungeon.switchLevel(level,Level.resizingNeeded ? level.adjustPos(Dungeon.hero.pos): Dungeon.hero.pos); - } - } - - private void resurrect() throws IOException { - - Actor.fixTime(); - DriedRose.clearHeldGhostHero(); - //DriedRose.holdGhostHero( Dungeon.level ); - - if (Dungeon.level.locked) { - Dungeon.hero.resurrect(Dungeon.depth); - Dungeon.depth--; - Level level = Dungeon.newLevel(); - Dungeon.switchLevel(level, level.entrance); - } else { - Dungeon.hero.resurrect(-1); - Dungeon.resetLevel(); - } - } - - private void reset() throws IOException { - - Actor.fixTime(); - Dungeon.depth--; - if (Dungeon.depth > 50) - {Level level = Dungeon.newChaosLevel(); - Dungeon.switchLevel( level, level.entrance ); - } else {Level level = Dungeon.newLevel(); - Dungeon.switchLevel( level, level.entrance );} - - } - - private void portal(int branch) throws IOException { - - Actor.fixTime(); - DriedRose.clearHeldGhostHero(); - Dungeon.saveAll(); - - Level level; - switch(branch){ - case 1: - level=Dungeon.newCatacombLevel(); - break; - case 2: - level = Dungeon.newFortressLevel(); - break; - case 3: - level = Dungeon.newChasmLevel(); - break; - case 4: - level = Dungeon.newInfestLevel(); - break; - case 5: - level = Dungeon.newFieldLevel(); - break; - case 6: - level = Dungeon.newBattleLevel(); - break; - case 7: - level = Dungeon.newFishLevel(); - break; - case 8: - level = Dungeon.newVaultLevel(); - break; - //case 9: - //level = Dungeon.newHallsBossLevel(); - //break; - case 10: - level = Dungeon.newCrabBossLevel(); - break; - case 11: - level = Dungeon.newTenguHideoutLevel(); - break; - case 12: - level = Dungeon.newThiefBossLevel(); - break; - case 13: - level = Dungeon.newSkeletonBossLevel(); - break; - case 14: - level = Dungeon.newZotBossLevel(); - break; - case 15: - level = Dungeon.newBossRushLevel(); - break; - case 16: - level = Dungeon.newFieldBossLevel(); - break; - case 17: - level = Dungeon.newChaosLevel(); - break; - default: - level = Dungeon.newLevel(); - } - Dungeon.switchLevel(level, level.entrance); - } - - private void journalPortal(int branch) throws IOException { - Actor.fixTime(); - DriedRose.clearHeldGhostHero(); - //DriedRose.holdGhostHero( Dungeon.level ); - Dungeon.saveAll(); - - Level level; - - /*if (branch==5 && !first){ - Dungeon.depth=55; - level = Dungeon.loadLevel(Dungeon.hero.heroClass); - - } else*/ if (branch==0 && !first){ - Dungeon.depth=50; - level = Dungeon.loadLevel(Dungeon.hero.heroClass); - - } else if (branch==7 && !first){ - Dungeon.depth=67; - level = Dungeon.loadLevel(Dungeon.hero.heroClass); - } else { - level=Dungeon.newJournalLevel(branch, first); - } - - Dungeon.switchLevel(level, level.entrance); - } - - private void challengePortal(int branch) throws IOException { - Actor.fixTime(); - DriedRose.clearHeldGhostHero(); - //DriedRose.holdGhostHero( Dungeon.level ); - Dungeon.saveAll(); - Level level; - if (branch==0 && !first){ - Dungeon.depth=26; - level = Dungeon.loadLevel(Dungeon.hero.heroClass); - - } else if (branch==1 && !first){ - Dungeon.depth=27; - level = Dungeon.loadLevel(Dungeon.hero.heroClass); - - } else if (branch==2 && !first){ - Dungeon.depth=28; - level = Dungeon.loadLevel(Dungeon.hero.heroClass); - - } else if (branch==3 && !first){ - Dungeon.depth=29; - level = Dungeon.loadLevel(Dungeon.hero.heroClass); - - } else if (branch==4 && !first){ - Dungeon.depth=30; - level = Dungeon.loadLevel(Dungeon.hero.heroClass); - - } else if (branch==5 && !first){ - Dungeon.depth=31; - level = Dungeon.loadLevel(Dungeon.hero.heroClass); - - } else if (branch==6 && !first){ - Dungeon.depth=32; - level = Dungeon.loadLevel(Dungeon.hero.heroClass); - - /*} else if (branch==7 && !first){ - Dungeon.depth=33; - level = Dungeon.loadLevel(Dungeon.hero.heroClass);*/ - }else{ - level=Dungeon.newChallengeLevel(branch, first); - } - - Dungeon.switchLevel(level, level.entrance); - } - - @Override - protected void onBackPressed() { - // Do nothing - } -} diff --git a/java/com/hmdzl/spspd/change/scenes/IntroScene.java b/java/com/hmdzl/spspd/change/scenes/IntroScene.java deleted file mode 100644 index 03185eb4..00000000 --- a/java/com/hmdzl/spspd/change/scenes/IntroScene.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.scenes; - -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.windows.WndStory; -import com.watabou.noosa.Game; - -public class IntroScene extends PixelScene { - - @Override - public void create() { - super.create(); - - add(new WndStory(Messages.get(this, "text")) { - @Override - public void hide() { - super.hide(); - Game.switchScene(InterlevelScene.class); - } - }); - - fadeIn(); - } -} diff --git a/java/com/hmdzl/spspd/change/scenes/LoadSaveScene.java b/java/com/hmdzl/spspd/change/scenes/LoadSaveScene.java deleted file mode 100644 index 1d07bc1a..00000000 --- a/java/com/hmdzl/spspd/change/scenes/LoadSaveScene.java +++ /dev/null @@ -1,337 +0,0 @@ - -// NOTE - the idea behind Load/Save functionality was originated in Soft Pixel Dungeon - package com.hmdzl.spspd.change.scenes; - - import java.io.File; - import java.io.FileInputStream; - import java.io.FileNotFoundException; - import java.io.FileOutputStream; - import java.io.IOException; - import java.io.OutputStream; - import java.util.ArrayList; - - import com.hmdzl.spspd.change.Challenges; - import com.hmdzl.spspd.change.Dungeon; - import com.hmdzl.spspd.change.GamesInProgress; - import com.hmdzl.spspd.change.levels.Terrain; - import com.hmdzl.spspd.change.messages.Messages; - import com.hmdzl.spspd.change.ui.Archs; - import com.hmdzl.spspd.change.ui.RedButton; - import com.hmdzl.spspd.change.ui.RedButton; - import com.hmdzl.spspd.change.ui.Window; - //import com.hmdzl.spspd.change.utils.Utils; - import com.hmdzl.spspd.change.windows.WndOptions; - import com.hmdzl.spspd.change.windows.WndStory; - import com.watabou.noosa.BitmapText; - import com.watabou.noosa.Camera; - import com.watabou.noosa.Game; - import com.watabou.noosa.RenderedText; - import com.watabou.utils.Bundle; - - import android.annotation.SuppressLint; - -@SuppressLint("DefaultLocale") - public class LoadSaveScene extends PixelScene { - - private static final float BUTTON1_WIDTH = 34; - private static final float BUTTON2_WIDTH = 55; - private static final float BUTTON_HEIGHT = 20; - private static final float BUTTON_PADDING = 3; - - private static final String TXT_TITLE = "Save/Load "; - - //private static final String SD_ROOT = Environment.getExternalStorageDirectory().toString(); - - private static final String TXT_LOAD = "Load"; - private static final String TXT_SAVE = "Save"; - private static final String TXT_SLOTNAME= "Game"; - - private static final String HERO = "hero"; - private static final String DEPTH = "depth"; - private static final String LEVEL = "lvl"; - - private static final String TXT_REALLY = "Load"; - private static final String TXT_WARNING = "Your current progress will be lost."; - private static final String TXT_YES = "Yes, load " + TXT_SLOTNAME; - private static final String TXT_NO = "No, return to main menu"; - - private static final String TXT_DPTH_LVL = "Depth: %d, level: %d"; - - - private static final int CLR_WHITE = 0xFFFFFF; - - - @Override - public void create() { - - super.create(); - - uiCamera.visible = false; - - int w = Camera.main.width; - int h = Camera.main.height; - - Archs archs = new Archs(); - archs.setSize( w, h ); - add( archs ); - - String showClassName = capitalizeWord(Dungeon.hero.heroClass.title2()); - - RenderedText title = PixelScene.renderText( TXT_TITLE + showClassName, 9 ); - title.hardlight( Window.TITLE_COLOR ); - title.x = align( (w - title.width()) / 2 ); - title.y = BUTTON_PADDING; - add( title ); - - String currentProgress = "dead"; - GamesInProgress.Info info = GamesInProgress.check(Dungeon.hero.heroClass); - if (info != null) { - currentProgress = Messages.format(TXT_DPTH_LVL, info.depth, info.level); - } - RenderedText subTitle = PixelScene.renderText( "Currently " + currentProgress, 6 ); - subTitle.hardlight( Window.TITLE_COLOR ); - subTitle.x = align( (w - title.width()) / 2 ); - subTitle.y = (BUTTON_HEIGHT / 2) + BUTTON_PADDING ; - add( subTitle ); - - int posY = (int) BUTTON_HEIGHT + ( (int) BUTTON_PADDING * 3); - int posX2 = w - (int) (BUTTON2_WIDTH + BUTTON_PADDING); - int posX = (int) (BUTTON1_WIDTH + (BUTTON_PADDING * 3)); - - String[] classList = { "warrior", "mage", "rogue", "huntress", "performer", "soldier", "follower" }; - String[] slotList = { "A", "B", "C", "D", "E" }; - - for (String classInfo : classList) { - if (Dungeon.hero.heroClass.title2().equals(classInfo)) { - - for (String saveSlot : slotList) { - // add the row caption.. - RenderedText buttonCapton1 = PixelScene.renderText( TXT_SLOTNAME + " " + saveSlot, 9 ); - buttonCapton1.hardlight( CLR_WHITE ); - buttonCapton1.x = BUTTON_PADDING; - buttonCapton1.y = posY + (BUTTON_HEIGHT/3); - add( buttonCapton1 ); - - // add the save button.. - if (Dungeon.hero.isAlive() && (Dungeon.canSave==true /*|| Dungeon.isChallenged(Challenges.BOSSRUSH)*/)) { - GameButton btnSave = new GameButton( this, true, TXT_SAVE, "", classInfo, saveSlot ); - add( btnSave ); - btnSave.visible = true; - btnSave.setRect(posX, posY, BUTTON1_WIDTH, BUTTON_HEIGHT); - } - // add the load button if there are saved files to load.. - String saveSlotFolder = Game.instance.getFilesDir().toString() + "/" + classInfo + saveSlot; - - File backupFolder = new File(saveSlotFolder); - if (backupFolder.exists()) { - FileInputStream input; - try { - input = new FileInputStream(saveSlotFolder +"/" + classInfo +".dat"); - Bundle bundle = Bundle.read( input ); - input.close(); - int savedDepth = bundle.getInt( DEPTH ); - Bundle savedHero = bundle.getBundle( HERO ); - int savedLevel = savedHero.getInt( LEVEL ); - String savedProgress = Messages.format( TXT_DPTH_LVL, savedDepth, savedLevel ); - GameButton btnLoad1A = new GameButton( this, false, TXT_LOAD , savedProgress, classInfo, saveSlot ); - - add( btnLoad1A ); - btnLoad1A.visible = true; - btnLoad1A.setRect(posX2, posY, (int) (BUTTON2_WIDTH), BUTTON_HEIGHT); - } catch (FileNotFoundException e) { - //e.printStackTrace(); - } catch (IOException e) { - //e.printStackTrace(); - } - } - // move down the line now... - posY += BUTTON_HEIGHT + BUTTON_PADDING; - } - } - } - - fadeIn(); - } - - @Override - protected void onBackPressed() { - Dungeon.canSave = false; - InterlevelScene.mode = InterlevelScene.Mode.CONTINUE; - Game.switchScene( InterlevelScene.class ); - } - - protected static void exportGames(String classInfo, String saveSlot) { - ArrayList files = new ArrayList(); - String saveSlotFolder = Game.instance.getFilesDir().toString() + "/" + classInfo + saveSlot; - makeFolder(saveSlotFolder); - - for(String fileName : Game.instance.fileList()){ - if(isGameLevelFile(classInfo, fileName)){ - files.add(fileName); - } - } - - // remove previous saved game files.. - File backupFolder = new File(saveSlotFolder); - - for(File backupFile : backupFolder.listFiles()){ - if(isGameLevelFile(classInfo, backupFile.getName())){ - backupFile.delete(); - } - } - - for (String fileName : files){ - try { - FileInputStream in = Game.instance.openFileInput(fileName); - OutputStream out = new FileOutputStream(saveSlotFolder + "/" + fileName); - - // Transfer bytes from in to out - byte[] buf = new byte[23768]; - int len; - while ((len = in.read(buf)) > 0) { - out.write(buf, 0, len); - } - in.close(); - out.close(); - } - catch(Exception e){ - e.printStackTrace(); - WndStory.showChapter("Failed to save file " + fileName); - //Log.d("FAILED EXPORT", f); - } - } - Dungeon.canSave = false; - InterlevelScene.mode = InterlevelScene.Mode.SAVE; - Game.switchScene( InterlevelScene.class ); - } - - private static boolean isGameLevelFile(String classInfo, String fileName) { - return fileName.endsWith(".dat") && (fileName.startsWith(classInfo)); - } - - private static void makeFolder(String saveSlotFolder) { - File dir = new File(saveSlotFolder); - if (!dir.exists()) { - dir.mkdir(); - } - } - - protected static void importGames(String classInfo, String saveSlot) { - ArrayList files = new ArrayList(); - String saveSlotFolder = Game.instance.getFilesDir().toString() + "/" + classInfo + saveSlot; - File backupFolder = new File(saveSlotFolder); - - for(File backupFile : backupFolder.listFiles()){ - if(isGameLevelFile(classInfo, backupFile.getName())){ - files.add(backupFile.getName()); - } - } - - // remove in progress game files.. - for(String fileName : Game.instance.fileList()){ - if(fileName.startsWith("game_") || isGameLevelFile(classInfo, fileName)){ - Game.instance.deleteFile(fileName); - } - } - - - for (String fileName : files){ - try { - FileInputStream in = new FileInputStream(saveSlotFolder + "/" + fileName); // - OutputStream out = Game.instance.openFileOutput(fileName, Game.MODE_PRIVATE ); - - // Transfer bytes from in to out - byte[] buf = new byte[23768]; - int len; - while ((len = in.read(buf)) > 0) { - out.write(buf, 0, len); - } - in.close(); - out.close(); - } - catch(Exception e){ - e.printStackTrace(); - WndStory.showChapter("Failed to load file " + fileName); - } - } - Dungeon.canSave = false; - InterlevelScene.mode = InterlevelScene.Mode.CONTINUE; - Game.switchScene( InterlevelScene.class ); - - for(File backupFile : backupFolder.listFiles()){ - if(isGameLevelFile(classInfo, backupFile.getName())){ - backupFile.delete(); - } - } - - } - - private static class GameButton extends RedButton { - - private static final int SECONDARY_COLOR = 0xCACFC2; - - private RenderedText secondary; - private Boolean isSave = true; - private String classInfo = ""; - private String saveSlot = ""; - private LoadSaveScene loadSaveScene; - - public GameButton(LoadSaveScene loadSaveScene, Boolean isSave, String primary, String secondary, String classInfo, String saveSlot ) { - super( primary ); - this.secondary( secondary ); - this.isSave = isSave; - this.classInfo = classInfo; - this.saveSlot = saveSlot; - this.loadSaveScene = loadSaveScene; - } - @Override - protected void onClick() { - if (isSave) { - exportGames(classInfo, saveSlot); - } else { - loadSaveScene.add( new WndOptions( TXT_REALLY + " " +saveSlot + " " + secondary.text() + "?", TXT_WARNING, TXT_YES + " " + saveSlot, TXT_NO ) { - @Override - protected void onSelect( int index ) { - if (index == 0) { - importGames(classInfo, saveSlot); - } - } - } ); - } - }; - - @Override - protected void createChildren() { - super.createChildren(); - - secondary = renderText( 6 ); - secondary.hardlight( SECONDARY_COLOR ); - add( secondary ); - } - - @Override - protected void layout() { - super.layout(); - - if (secondary.text().length() > 0) { - text.y = y + (height - text.height() - secondary.baseLine()) / 2; - - secondary.x = align( x + (width - secondary.width()) / 2 ); - secondary.y = align( text.y + text.height() ); - } else { - text.y = y + (height - text.baseLine()) / 2; - } - } - - public void secondary( String text ) { - secondary.text( text ); - } - - } - public static String capitalizeWord(String oneWord) - { - return Character.toUpperCase(oneWord.charAt(0)) + oneWord.substring(1); - } - - - } \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/scenes/PixelScene.java b/java/com/hmdzl/spspd/change/scenes/PixelScene.java deleted file mode 100644 index c4536cf7..00000000 --- a/java/com/hmdzl/spspd/change/scenes/PixelScene.java +++ /dev/null @@ -1,381 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.scenes; - -import javax.microedition.khronos.opengles.GL10; - -import android.opengl.GLES20; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.ShatteredPixelDungeon; -import com.hmdzl.spspd.change.effects.BadgeBanner; -import com.hmdzl.spspd.change.ui.RenderedTextMultiline; -import com.watabou.input.Touchscreen; -import com.watabou.noosa.BitmapText; -import com.watabou.noosa.BitmapText.Font; -import com.watabou.noosa.BitmapTextMultiline; -import com.watabou.noosa.Camera; -import com.watabou.noosa.ColorBlock; -import com.watabou.noosa.Game; -import com.watabou.noosa.RenderedText; -import com.watabou.noosa.Scene; -import com.watabou.noosa.Visual; -import com.watabou.utils.BitmapCache; -import com.watabou.noosa.ui.Component; - -public class PixelScene extends Scene { - - // Minimum virtual display size for portrait orientation - public static final float MIN_WIDTH_P = 128; - public static final float MIN_HEIGHT_P = 224; - - // Minimum virtual display size for landscape orientation - public static final float MIN_WIDTH_L = 224; - public static final float MIN_HEIGHT_L = 160; - - public static int defaultZoom = 0; - public static int maxDefaultZoom = 0; - public static int maxScreenZoom = 0; - public static int minZoom; - public static int maxZoom; - - public static Camera uiCamera; - - public static BitmapText.Font font1x; - public static BitmapText.Font font15x; - public static BitmapText.Font font2x; - public static BitmapText.Font font25x; - public static BitmapText.Font font3x; - - public static BitmapText.Font pixelFont; - - @Override - public void create() { - - super.create(); - - GameScene.scene = null; - - float minWidth, minHeight; - if (ShatteredPixelDungeon.landscape()) { - minWidth = MIN_WIDTH_L; - minHeight = MIN_HEIGHT_L; - } else { - minWidth = MIN_WIDTH_P; - minHeight = MIN_HEIGHT_P; - } - - maxDefaultZoom = (int)Math.min(Game.width/minWidth, Game.height/minHeight); - maxScreenZoom = (int)Math.min(Game.dispWidth/minWidth, Game.dispHeight/minHeight); - - defaultZoom = (int) Math.ceil(Game.density * 2.5); - defaultZoom--; - while ((Game.width / defaultZoom < minWidth || Game.height - / defaultZoom < minHeight) - && defaultZoom > 1) { - - defaultZoom--; - } - - if (ShatteredPixelDungeon.scaleUp()) { - while (Game.width / (defaultZoom + 1) >= minWidth - && Game.height / (defaultZoom + 1) >= minHeight) { - defaultZoom++; - } - } - minZoom = 1; - maxZoom = defaultZoom * 2; - - Camera.reset(new PixelCamera(defaultZoom)); - - float uiZoom = defaultZoom; - uiCamera = Camera.createFullscreen(uiZoom); - Camera.add(uiCamera); - - if (font1x == null) { - - // 3x5 (6) - font1x = Font.colorMarked(BitmapCache.get(Assets.FONTS1X), - 0x00000000, BitmapText.Font.LATIN_FULL); - font1x.baseLine = 6; - font1x.tracking = -1; - - // 5x8 (10) - font15x = Font.colorMarked(BitmapCache.get(Assets.FONTS15X), 12, - 0x00000000, BitmapText.Font.LATIN_FULL); - font15x.baseLine = 9; - font15x.tracking = -1; - - // 6x10 (12) - font2x = Font.colorMarked(BitmapCache.get(Assets.FONTS2X), 14, - 0x00000000, BitmapText.Font.LATIN_FULL); - font2x.baseLine = 11; - font2x.tracking = -1; - - // 7x12 (15) - font25x = Font.colorMarked(BitmapCache.get(Assets.FONTS25X), 17, - 0x00000000, BitmapText.Font.LATIN_FULL); - font25x.baseLine = 13; - font25x.tracking = -1; - - // 9x15 (18) - font3x = Font.colorMarked(BitmapCache.get(Assets.FONTS3X), 22, - 0x00000000, BitmapText.Font.LATIN_FULL); - font3x.baseLine = 17; - font3x.tracking = -2; - } - } - - @Override - public void destroy() { - super.destroy(); - Touchscreen.event.removeAll(); - } - - public static BitmapText.Font font; - public static float scale; - - public static void chooseFont(float size) { - chooseFont(size, defaultZoom); - } - - public static void chooseFont(float size, float zoom) { - - float pt = size * zoom; - - if (pt >= 19) { - - scale = pt / 19; - if (1.5 <= scale && scale < 2) { - font = font25x; - scale = (int) (pt / 14); - } else { - font = font3x; - scale = (int) scale; - } - - } else if (pt >= 14) { - - scale = pt / 14; - if (1.8 <= scale && scale < 2) { - font = font2x; - scale = (int) (pt / 12); - } else { - font = font25x; - scale = (int) scale; - } - - } else if (pt >= 12) { - - scale = pt / 12; - if (1.7 <= scale && scale < 2) { - font = font15x; - scale = (int) (pt / 10); - } else { - font = font2x; - scale = (int) scale; - } - - } else if (pt >= 10) { - - scale = pt / 10; - if (1.4 <= scale && scale < 2) { - font = font1x; - scale = (int) (pt / 7); - } else { - font = font15x; - scale = (int) scale; - } - - } else { - - font = pixelFont; - scale = 1f; - - //font = font1x; - //scale = Math.max(1, (int) (pt / 7)); - - } - - - scale /= zoom; - } - - public static BitmapText createText(float size) { - return createText(null, size); - } - - public static BitmapText createText(String text, float size) { - - chooseFont(size); - - BitmapText result = new BitmapText(text, font); - result.scale.set(scale); - - return result; - } - - public static BitmapTextMultiline createMultiline(float size) { - return createMultiline(null, size); - } - - public static BitmapTextMultiline createMultiline(String text, float size) { - - chooseFont(size); - - BitmapTextMultiline result = new BitmapTextMultiline(text, font); - result.scale.set(scale); - - return result; - } - - - public static RenderedText renderText(int size ) { - return renderText("", size); - } - - public static RenderedText renderText( String text, int size ) { - RenderedText result = new RenderedText( text, size*defaultZoom); - result.scale.set(1/(float)defaultZoom); - return result; - } - - public static RenderedTextMultiline renderMultiline( int size ){ - return renderMultiline("", size); - } - - public static RenderedTextMultiline renderMultiline( String text, int size ){ - RenderedTextMultiline result = new RenderedTextMultiline( text, size*defaultZoom); - result.zoom(1/(float)defaultZoom); - return result; - } - - public static float align( float pos ) { - return Math.round(pos * defaultZoom) / (float)defaultZoom; - } - - public static float align( Camera camera, float pos ) { - return Math.round(pos * camera.zoom) / camera.zoom; - } - - public static void align( Visual v ) { - v.x = align( v.x ); - v.y = align( v.y ); - } - - public static void align( Component c ){ - c.setPos(align(c.left()), align(c.top())); - } - - public static boolean noFade = false; - - protected void fadeIn() { - if (noFade) { - noFade = false; - } else { - fadeIn(0xFF000000, false); - } - } - - protected void fadeIn(int color, boolean light) { - add(new Fader(color, light)); - } - - public static void showBadge(Badges.Badge badge) { - BadgeBanner banner = BadgeBanner.show(badge.image); - banner.camera = uiCamera; - banner.x = align(banner.camera, - (banner.camera.width - banner.width) / 2); - banner.y = align(banner.camera, - (banner.camera.height - banner.height) / 3); - Game.scene().add(banner); - } - - protected static class Fader extends ColorBlock { - - private static float FADE_TIME = 1f; - - private boolean light; - - private float time; - - public Fader(int color, boolean light) { - super(uiCamera.width, uiCamera.height, color); - - this.light = light; - - camera = uiCamera; - - alpha(1f); - time = FADE_TIME; - } - - @Override - public void update() { - - super.update(); - - if ((time -= Game.elapsed) <= 0) { - alpha(0f); - parent.remove(this); - } else { - alpha(time / FADE_TIME); - } - } - - @Override - public void draw() { - if (light) { - GLES20.glBlendFunc(GL10.GL_SRC_ALPHA, GL10.GL_ONE); - super.draw(); - GLES20.glBlendFunc(GL10.GL_SRC_ALPHA, - GL10.GL_ONE_MINUS_SRC_ALPHA); - } else { - try { - super.draw(); - } catch (Exception e) { - } - } - } - } - - private static class PixelCamera extends Camera { - - public PixelCamera(float zoom) { - super( - (int) (Game.width - Math.ceil(Game.width / zoom) * zoom) / 2, - (int) (Game.height - Math.ceil(Game.height / zoom) * zoom) / 2, - (int) Math.ceil(Game.width / zoom), (int) Math - .ceil(Game.height / zoom), zoom); - } - - @Override - protected void updateMatrix() { - float sx = align(this, scroll.x + shakeX); - float sy = align(this, scroll.y + shakeY); - - matrix[0] = +zoom * invW2; - matrix[5] = -zoom * invH2; - - matrix[12] = -1 + x * invW2 - sx * matrix[0]; - matrix[13] = +1 - y * invH2 - sy * matrix[5]; - - } - } -} diff --git a/java/com/hmdzl/spspd/change/scenes/PowerHandScene.java b/java/com/hmdzl/spspd/change/scenes/PowerHandScene.java deleted file mode 100644 index 8053f5cf..00000000 --- a/java/com/hmdzl/spspd/change/scenes/PowerHandScene.java +++ /dev/null @@ -1,123 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * Shattered Pixel Dungeon - * Copyright (C) 2014-2015 Evan Debenham - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.scenes; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.ResultDescriptions; -import com.hmdzl.spspd.change.ShatteredPixelDungeon; -import com.hmdzl.spspd.change.effects.Flare; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.Amulet; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.ui.RedButton; -import com.hmdzl.spspd.change.ui.RenderedTextMultiline; -import com.watabou.noosa.Camera; -import com.watabou.noosa.Game; -import com.watabou.noosa.Image; -import com.watabou.utils.Random; - -public class PowerHandScene extends PixelScene { - - private static final int WIDTH = 120; - private static final int BTN_HEIGHT = 18; - private static final float SMALL_GAP = 2; - private static final float LARGE_GAP = 8; - - private Image pudding_cup; - - @Override - public void create() { - super.create(); - - RenderedTextMultiline text = null; - - text = renderMultiline( Messages.get(this, "text"), 8 ); - text.maxWidth(WIDTH); - add( text ); - - - pudding_cup = new Image(Assets.PUDDING_CUP); - add(pudding_cup); - - - RedButton btnExit = new RedButton( Messages.get(this, "exit") ) { - @Override - protected void onClick() { - Dungeon.win(Messages.format(ResultDescriptions.WIN2)); - Dungeon.deleteGame( Dungeon.hero.heroClass, true ); - Game.switchScene( RankingsScene.class); - } - }; - btnExit.setSize( WIDTH, BTN_HEIGHT ); - add( btnExit ); - - RedButton btnStay = new RedButton(Messages.get(this, "stay")) { - @Override - protected void onClick() { - InterlevelScene.mode = InterlevelScene.Mode.CHAOS; - Game.switchScene(InterlevelScene.class); - } - }; - btnStay.setSize(WIDTH, BTN_HEIGHT); - add(btnStay); - - float height; - - height = pudding_cup.height + LARGE_GAP + text.height() + LARGE_GAP + btnExit.height() + SMALL_GAP; - - pudding_cup.x = (Camera.main.width - pudding_cup.width) / 2; - pudding_cup.y = (Camera.main.height - height) / 2; - align(pudding_cup); - - text.setPos((Camera.main.width - text.width()) / 2, pudding_cup.y + pudding_cup.height + LARGE_GAP); - align(text); - - btnExit.setPos( (Camera.main.width - btnExit.width()) / 2, text.top() + text.height() + LARGE_GAP ); - btnStay.setPos( btnExit.left(), btnExit.bottom() + SMALL_GAP ); - - new Flare( 8, 48 ).color( 0xFFDDBB, true ).show( pudding_cup, 0 ).angularSpeed = +30; - - fadeIn(); - } - - //@Override - //protected void onBackPressed() { - //InterlevelScene.mode = InterlevelScene.Mode.CONTINUE; - //Game.switchScene( InterlevelScene.class ); - //} - - private float timer = 0; - - @Override - public void update() { - super.update(); - - if ((timer -= Game.elapsed) < 0) { - timer = Random.Float( 0.5f, 5f ); - - Speck star = (Speck)recycle( Speck.class ); - star.reset( 0, pudding_cup.x + 10.5f, pudding_cup.y + 5.5f, Speck.DISCOVER ); - add( star ); - } - } - -} diff --git a/java/com/hmdzl/spspd/change/scenes/Pudding_CupScene.java b/java/com/hmdzl/spspd/change/scenes/Pudding_CupScene.java deleted file mode 100644 index d9755edb..00000000 --- a/java/com/hmdzl/spspd/change/scenes/Pudding_CupScene.java +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.scenes; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.ResultDescriptions; -import com.hmdzl.spspd.change.effects.Flare; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.ui.RedButton; -import com.hmdzl.spspd.change.ui.RenderedTextMultiline; -import com.watabou.noosa.Camera; -import com.watabou.noosa.Game; -import com.watabou.noosa.Image; -import com.watabou.utils.Random; - -public class Pudding_CupScene extends PixelScene { - - private static final String TXT_EXIT = "Wait,WHAT?!"; - private static final String TXT_STAY = "I can't leave now."; - - private static final int WIDTH = 120; - private static final int BTN_HEIGHT = 18; - private static final float SMALL_GAP = 2; - private static final float LARGE_GAP = 8; - - private static final String TXT = "Looks like someone taken the Amulet and left Pudding cup here."; - - private Image pudding_cup; - - @Override - public void create() { - super.create(); - - RenderedTextMultiline text = null; - text = renderMultiline( Messages.get(this, "text"), 8 ); - text.maxWidth(WIDTH); - add( text ); - - - pudding_cup = new Image(Assets.PUDDING_CUP); - add(pudding_cup); - - RedButton btnExit = new RedButton( Messages.get(this, "exit") ){ - @Override - protected void onClick() { - onBackPressed(); - } - }; - btnExit.setSize(WIDTH, BTN_HEIGHT); - add(btnExit); - - RedButton btnStay = new RedButton(Messages.get(this, "stay")) { - @Override - protected void onClick() { - onBackPressed(); - } - }; - btnStay.setSize(WIDTH, BTN_HEIGHT); - add(btnStay); - - float height; - height = pudding_cup.height + LARGE_GAP + text.height() + LARGE_GAP + btnExit.height() + SMALL_GAP + btnStay.height(); - - pudding_cup.x = (Camera.main.width - pudding_cup.width) / 2; - pudding_cup.y = (Camera.main.height - height) / 2; - align(pudding_cup); - - text.setPos((Camera.main.width - text.width()) / 2, pudding_cup.y + pudding_cup.height + LARGE_GAP); - align(text); - - btnExit.setPos( (Camera.main.width - btnExit.width()) / 2, text.top() + text.height() + LARGE_GAP ); - btnStay.setPos( btnExit.left(), btnExit.bottom() + SMALL_GAP ); - - new Flare(8, 48).color(0xFFDDBB, true).show(pudding_cup, 0).angularSpeed = +30; - - fadeIn(); - } - - @Override - protected void onBackPressed() { - InterlevelScene.mode = InterlevelScene.Mode.CONTINUE; - Game.switchScene(InterlevelScene.class); - } - - private float timer = 0; - -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/scenes/RankingsScene.java b/java/com/hmdzl/spspd/change/scenes/RankingsScene.java deleted file mode 100644 index b23c5248..00000000 --- a/java/com/hmdzl/spspd/change/scenes/RankingsScene.java +++ /dev/null @@ -1,300 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.scenes; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Rankings; -import com.hmdzl.spspd.change.ResultDescriptions; -import com.hmdzl.spspd.change.ShatteredPixelDungeon; -import com.hmdzl.spspd.change.effects.Flare; -import com.hmdzl.spspd.change.sprites.ItemSprite; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.ui.Archs; -import com.hmdzl.spspd.change.ui.ExitButton; -import com.hmdzl.spspd.change.ui.Icons; -import com.hmdzl.spspd.change.ui.RenderedTextMultiline; -import com.hmdzl.spspd.change.ui.Window; -import com.hmdzl.spspd.change.windows.WndError; -import com.hmdzl.spspd.change.windows.WndRanking; -import com.watabou.noosa.BitmapText; -import com.watabou.noosa.RenderedText; -import com.watabou.noosa.Camera; -import com.watabou.noosa.Image; -import com.watabou.noosa.audio.Music; -import com.watabou.noosa.ui.Button; -import com.watabou.utils.GameMath; -import com.hmdzl.spspd.change.messages.Messages; - -public class RankingsScene extends PixelScene { - - private static final float ROW_HEIGHT_MAX = 20; - private static final float ROW_HEIGHT_MIN = 12; - - private static final float MAX_ROW_WIDTH = 160; - - private static final float GAP = 4; - - private Archs archs; - - @Override - public void create() { - - super.create(); - - Music.INSTANCE.play(Assets.THEME, true); - Music.INSTANCE.volume(1f); - - uiCamera.visible = false; - - int w = Camera.main.width; - int h = Camera.main.height; - - archs = new Archs(); - archs.setSize(w, h); - add(archs); - - Rankings.INSTANCE.load(); - - RenderedText title = PixelScene.renderText(Messages.get(this, "title"), 9); - title.hardlight(Window.SHPX_COLOR); - title.x = align((w - title.width()) / 2); - title.y = align(GAP); - add(title); - - if (Rankings.INSTANCE.records.size() > 0) { - - // attempts to give each record as much space as possible, ideally - // as much space as portrait mode - float rowHeight = GameMath.gate(ROW_HEIGHT_MIN, - (uiCamera.height - 26) / Rankings.INSTANCE.records.size(), - ROW_HEIGHT_MAX); - - float left = (w - Math.min(MAX_ROW_WIDTH, w)) / 2 + GAP; - float top = align((h - rowHeight * Rankings.INSTANCE.records.size()) / 2); - - int pos = 0; - - for (Rankings.Record rec : Rankings.INSTANCE.records) { - Record row = new Record(pos, - pos == Rankings.INSTANCE.lastRecord, rec); - float offset = rowHeight <= 14 ? pos % 2 == 1 ? 5 : -5 : 0; - row.setRect(left + offset, top + pos * rowHeight, w - left * 2, - rowHeight); - add(row); - - pos++; - } - - if (Rankings.INSTANCE.totalNumber >= Rankings.TABLE_SIZE) { - RenderedText label = PixelScene.renderText(Messages.get(this, "total") + " ", 8); - label.hardlight(0xCCCCCC); - add(label); - - RenderedText won = PixelScene.renderText( - Integer.toString(Rankings.INSTANCE.wonNumber), 8); - won.hardlight(Window.SHPX_COLOR); - add(won); - - RenderedText total = PixelScene.renderText("/" - + Rankings.INSTANCE.totalNumber, 8); - total.hardlight(0xCCCCCC); - total.x = align((w - total.width()) / 2); - total.y = align(top + pos * rowHeight + GAP); - add(total); - - float tw = label.width() + won.width() + total.width(); - label.x = align((w - tw) / 2); - won.x = label.x + label.width(); - total.x = won.x + won.width(); - label.y = won.y = total.y = align(h - label.height() - GAP); - - align(label); - align(total); - align(won); - - } - - } else { - - RenderedText noRec = PixelScene.renderText(Messages.get(this, "no_games"), 8); - noRec.hardlight(0xCCCCCC); - noRec.x = align((w - noRec.width()) / 2); - noRec.y = align((h - noRec.height()) / 2); - add(noRec); - - } - - ExitButton btnExit = new ExitButton(); - btnExit.setPos(Camera.main.width - btnExit.width(), 0); - add(btnExit); - - fadeIn(); - } - - @Override - protected void onBackPressed() { - ShatteredPixelDungeon.switchNoFade(TitleScene.class); - } - - public static class Record extends Button { - - private static final float GAP = 4; - - private static final int[] TEXT_WIN = { 0xFFFF88, 0xB2B25F }; - private static final int[] TEXT_LOSE = { 0xDDDDDD, 0x888888 }; - private static final int FLARE_WIN = 0x888866; - private static final int FLARE_LOSE = 0x666666; - - private Rankings.Record rec; - - protected ItemSprite shield; - private Flare flare; - private BitmapText position; - private RenderedTextMultiline desc; - private Image steps; - private BitmapText depth; - private Image classIcon; - private BitmapText level; - - public Record(int pos, boolean latest, Rankings.Record rec) { - super(); - - this.rec = rec; - - if (latest) { - flare = new Flare(6, 24); - flare.angularSpeed = 90; - flare.color(rec.win ? FLARE_WIN : FLARE_LOSE); - addToBack(flare); - } - - if (pos != Rankings.TABLE_SIZE - 1) { - position.text(Integer.toString(pos + 1)); - } else - position.text(" "); - position.measure(); - - desc.text(Messages.titleCase(Messages.get(ResultDescriptions.class,rec.info))); - - - int odd = pos % 2; - - if (rec.win) { - shield.view(ItemSpriteSheet.AMULET, null); - position.hardlight(TEXT_WIN[odd]); - desc.hardlight(TEXT_WIN[odd]); - depth.hardlight(TEXT_WIN[odd]); - level.hardlight(TEXT_WIN[odd]); - } else { - position.hardlight(TEXT_LOSE[odd]); - desc.hardlight(TEXT_LOSE[odd]); - depth.hardlight(TEXT_LOSE[odd]); - level.hardlight(TEXT_LOSE[odd]); - - if (rec.depth != 0) { - depth.text(Integer.toString(rec.depth)); - depth.measure(); - steps.copy(Icons.DEPTH.get()); - - add(steps); - add(depth); - } - - } - - if (rec.herolevel != 0) { - level.text(Integer.toString(rec.herolevel)); - level.measure(); - add(level); - } - - classIcon.copy(Icons.get(rec.heroClass)); - } - - @Override - protected void createChildren() { - - super.createChildren(); - - shield = new ItemSprite(ItemSpriteSheet.TOMB, null); - add(shield); - - position = new BitmapText(PixelScene.font1x); - position.alpha(0.8f); - add(position); - - desc = renderMultiline(7); - add(desc); - - depth = new BitmapText(PixelScene.font1x); - depth.alpha(0.8f); - - steps = new Image(); - - classIcon = new Image(); - add(classIcon); - - level = new BitmapText(PixelScene.font1x); - level.alpha(0.8f); - } - - @Override - protected void layout() { - - super.layout(); - - shield.x = x; - shield.y = y + (height - shield.height) / 2; - - position.x = align(shield.x + (shield.width - position.width()) / 2); - position.y = align(shield.y + (shield.height - position.height()) - / 2 + 1); - - if (flare != null) { - flare.point( shield.center() ); - } - - classIcon.x = x + width - classIcon.width; - classIcon.y = shield.y; - - level.x = classIcon.x + (classIcon.width - level.width()) / 2f; - level.y = classIcon.y + (classIcon.height - level.height()) / 2f + 1; - align(level); - - steps.x = x + width - steps.width - classIcon.width; - steps.y = shield.y; - - depth.x = steps.x + (steps.width - depth.width()) / 2f; - depth.y = steps.y + (steps.height - depth.height()) / 2f + 1; - align(depth); - - desc.maxWidth((int)(steps.x - (shield.x + shield.width + GAP))); - desc.setPos(shield.x + shield.width + GAP, shield.y + (shield.height - desc.height()) / 2f + 1); - align(desc); - } - - @Override - protected void onClick() { - if (rec.gameFile.length() > 0) { - parent.add(new WndRanking(rec.gameFile)); - } else { - parent.add(new WndError(Messages.get(this, "no_info"))); - } - } - } -} diff --git a/java/com/hmdzl/spspd/change/scenes/StartScene.java b/java/com/hmdzl/spspd/change/scenes/StartScene.java deleted file mode 100644 index 02d842c8..00000000 --- a/java/com/hmdzl/spspd/change/scenes/StartScene.java +++ /dev/null @@ -1,536 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.scenes; - -import java.util.HashMap; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.GamesInProgress; -import com.hmdzl.spspd.change.ShatteredPixelDungeon; -import com.hmdzl.spspd.change.Skins; -import com.hmdzl.spspd.change.actors.hero.HeroClass; -import com.hmdzl.spspd.change.effects.BannerSprites; -import com.hmdzl.spspd.change.effects.BannerSprites.Type; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.ui.Archs; -import com.hmdzl.spspd.change.ui.ExitButton; -import com.hmdzl.spspd.change.ui.Icons; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.ui.MemoryButton; -import com.hmdzl.spspd.change.ui.RedButton; -import com.hmdzl.spspd.change.ui.ResumeButton; -import com.hmdzl.spspd.change.windows.WndChallenges; -import com.hmdzl.spspd.change.windows.WndClass; -import com.hmdzl.spspd.change.windows.WndMessage; -import com.hmdzl.spspd.change.windows.WndOptions; -import com.watabou.noosa.Camera; -import com.watabou.noosa.Game; -import com.watabou.noosa.Group; -import com.watabou.noosa.Image; -import com.watabou.noosa.RenderedText; -import com.watabou.noosa.audio.Sample; -import com.watabou.noosa.particles.Emitter; -import com.watabou.noosa.particles.BitmaskEmitter; -import com.watabou.noosa.ui.Button; -import com.watabou.utils.Callback; -import com.hmdzl.spspd.change.ui.RenderedTextMultiline; - -import static com.hmdzl.spspd.change.Dungeon.skins; - -public class StartScene extends PixelScene { - - private static final float BUTTON_HEIGHT = 24; - private static final float GAP = 2; - - private static final float WIDTH_P = 116; - private static final float HEIGHT_P = 220; - - private static final float WIDTH_L = 224; - private static final float HEIGHT_L = 124; - - private static HashMap shields = new HashMap(); - - private float buttonX; - private float buttonY; - - private GameButton btnLoad; - private GameButton btnNewGame; - - public static HeroClass curClass; - - @Override - public void create() { - - super.create(); - - Badges.loadGlobal(); - - uiCamera.visible = false; - - int w = Camera.main.width; - int h = Camera.main.height; - - float width, height; - if (ShatteredPixelDungeon.landscape()) { - width = WIDTH_L; - height = HEIGHT_L; - } else { - width = WIDTH_P; - height = HEIGHT_P; - } - - float left = (w - width) / 2; - float top = (h - height) / 2; - float bottom = h - top; - - Archs archs = new Archs(); - archs.setSize(w, h); - add(archs); - - Image title = BannerSprites.get(Type.SELECT_YOUR_HERO); - title.x = align((w - title.width()) / 2); - title.y = align(top); - align(title); - add(title); - - buttonX = left; - buttonY = bottom - BUTTON_HEIGHT; - - btnNewGame = new GameButton(Messages.get(this, "new")) { - @Override - protected void onClick() { - if (GamesInProgress.check(curClass) != null) { - StartScene.this.add(new WndOptions( - Messages.get(StartScene.class, "really"), - Messages.get(StartScene.class, "warning"), - Messages.get(StartScene.class, "yes"), - Messages.get(StartScene.class, "no")) { - @Override - protected void onSelect(int index) { - if (index == 0) { - //startNewGame(); - askSkin(); - } - } - }); - - } else { - //startNewGame(); - askSkin(); - } - } - }; - add(btnNewGame); - - btnLoad = new GameButton(Messages.get(this, "load")) { - @Override - protected void onClick() { - InterlevelScene.mode = InterlevelScene.Mode.CONTINUE; - Game.switchScene(InterlevelScene.class); - } - }; - add(btnLoad); - - float centralHeight = buttonY - title.y - title.height(); - - HeroClass[] classes = { - HeroClass.WARRIOR, HeroClass.MAGE, HeroClass.ROGUE, HeroClass.HUNTRESS, HeroClass.PERFORMER, HeroClass.SOLDIER, HeroClass.FOLLOWER - }; - for (HeroClass cl : classes) { - ClassShield shield = new ClassShield(cl); - shields.put(cl, shield); - add(shield); - } - if (ShatteredPixelDungeon.landscape()) { - float shieldW = width / 7; - float shieldH = Math.min(centralHeight, shieldW); - top = title.y + title.height + (centralHeight - shieldH) / 2; - for (int i = 0; i < classes.length; i++) { - ClassShield shield = shields.get(classes[i]); - shield.setRect(left + i * shieldW, top, shieldW, shieldH); - } - - ChallengeButton challenge = new ChallengeButton(); - challenge.setPos( - w / 2 - challenge.width() / 2, - top + shieldH / 2 - challenge.height() / 2); - add(challenge); - - } else { - float shieldW = width / 4; - float shieldH = Math.min(centralHeight / 3, shieldW * 1.2f); - top = title.y + title.height() + centralHeight / 2 - shieldH; - for (int i = 0; i < classes.length; i++) { - ClassShield shield = shields.get(classes[i]); - if (i < 4) { - shield.setRect(left + (i % 4) * shieldW, top - shieldH * 0.5f, shieldW, shieldH); - }else{ - shield.setRect(left + (i % 4) * shieldW, top + /*(i / 2) **/ shieldH, shieldW, shieldH); - } - align(shield); - } - - ChallengeButton challenge = new ChallengeButton(); - challenge.setPos( - w / 2 - challenge.width() / 2, - top + shieldH - challenge.height() / 2 + 70 ); - align(challenge); - add(challenge); - - } - - ExitButton btnExit = new ExitButton(); - btnExit.setPos(Camera.main.width - btnExit.width(), 0); - add(btnExit); - - curClass = null; - updateClass(HeroClass.values()[ShatteredPixelDungeon.lastClass()]); - - fadeIn(); - - Badges.loadingListener = new Callback() { - @Override - public void call() { - if (Game.scene() == StartScene.this) { - ShatteredPixelDungeon.switchNoFade(StartScene.class); - } - } - }; - } - - @Override - public void destroy() { - - Badges.saveGlobal(); - Badges.loadingListener = null; - - super.destroy(); - - } - - private void updateClass(HeroClass cl) { - - if (curClass == cl) { - add(new WndClass(cl)); - return; - } - - if (curClass != null) { - shields.get(curClass).highlight(false); - } - shields.get(curClass = cl).highlight(true); - - - - GamesInProgress.Info info = GamesInProgress.check( curClass ); - if (info != null) { - - btnLoad.visible = true; - btnLoad.secondary( Messages.format( Messages.get(this, "depth_level"), info.depth, info.level ), info.challenges ); - btnNewGame.visible = true; - btnNewGame.secondary( Messages.get(this, "erase"), false ); - - float w = (Camera.main.width - GAP) / 2 - buttonX; - - btnLoad.setRect( - buttonX, buttonY, w, BUTTON_HEIGHT ); - btnNewGame.setRect( - btnLoad.right() + GAP, buttonY, w, BUTTON_HEIGHT ); - - } else { - btnLoad.visible = false; - - btnNewGame.visible = true; - btnNewGame.secondary( null, false ); - btnNewGame.setRect( buttonX, buttonY, Camera.main.width - buttonX * 2, BUTTON_HEIGHT ); - } - - } - - private void askSkin() { - - StartScene.this.add( new WndSkin() ); - } - - private void startNewGame() { - - Dungeon.hero = null; - InterlevelScene.mode = InterlevelScene.Mode.DESCEND; - - if (ShatteredPixelDungeon.intro()) { - ShatteredPixelDungeon.intro(false); - Game.switchScene(IntroScene.class); - } else { - Game.switchScene(InterlevelScene.class); - } - } - - @Override - protected void onBackPressed() { - ShatteredPixelDungeon.switchNoFade(TitleScene.class); - } - - private static class GameButton extends RedButton { - - private static final int SECONDARY_COLOR_N = 0xCACFC2; - private static final int SECONDARY_COLOR_H = 0xFFFF88; - - private RenderedText secondary; - - public GameButton(String primary) { - super(primary); - - this.secondary.text(null); - } - - @Override - protected void createChildren() { - super.createChildren(); - - secondary = renderText(6); - add(secondary); - } - - @Override - protected void layout() { - super.layout(); - - if (secondary.text().length() > 0) { - text.y = align(y - + (height - text.height() - secondary.baseLine()) / 2); - - secondary.x = align(x + (width - secondary.width()) / 2); - secondary.y = align(text.y + text.height()); - } else { - text.y = align(y + (height - text.baseLine()) / 2); - } - align(text); - align(secondary); - } - - public void secondary(String text, boolean highlighted) { - secondary.text(text); - secondary.hardlight(highlighted ? SECONDARY_COLOR_H : SECONDARY_COLOR_N); - } - } - - private class ClassShield extends Button { - - private static final float MIN_BRIGHTNESS = 0.6f; - - private static final int BASIC_NORMAL = 0x444444; - private static final int BASIC_HIGHLIGHTED = 0xCACFC2; - - private static final int MASTERY_NORMAL = 0x666644; - private static final int MASTERY_HIGHLIGHTED = 0xFFFF88; - - private static final int WIDTH = 24; - private static final int HEIGHT = 32; - private static final float SCALE = 1f; - - private HeroClass cl; - - private Image avatar; - private RenderedText name; - private Emitter emitter; - - private float brightness; - - private int normal; - private int highlighted; - - public ClassShield(HeroClass cl) { - super(); - - this.cl = cl; - - avatar.frame(cl.ordinal() * WIDTH, 0, WIDTH, HEIGHT); - avatar.scale.set(SCALE); - - if (Badges.isUnlocked(cl.masteryBadge())) { - normal = MASTERY_NORMAL; - highlighted = MASTERY_HIGHLIGHTED; - } else { - normal = BASIC_NORMAL; - highlighted = BASIC_HIGHLIGHTED; - } - - name.text( cl.title().toUpperCase() ); - name.hardlight( normal ); - - brightness = MIN_BRIGHTNESS; - updateBrightness(); - } - - @Override - protected void createChildren() { - - super.createChildren(); - - avatar = new Image(Assets.AVATARS); - add(avatar); - - name = PixelScene.renderText(9); - add(name); - - emitter = new BitmaskEmitter(avatar); - add(emitter); - } - - @Override - protected void layout() { - - super.layout(); - - avatar.x = x + (width - avatar.width()) / 2; - avatar.y = y + (height - avatar.height() - name.height()) / 2; - align(avatar); - - - name.x = align(x + (width - name.width()) / 2); - name.y = avatar.y + avatar.height() + SCALE; - align(name); - //emitter.pos(avatar.x, avatar.y, avatar.width(), avatar.height()); - } - - @Override - protected void onTouchDown() { - - emitter.revive(); - emitter.start(Speck.factory(Speck.LIGHT), 0.05f, 7); - - Sample.INSTANCE.play(Assets.SND_CLICK, 1, 1, 1.2f); - updateClass(cl); - } - - @Override - public void update() { - super.update(); - - if (brightness < 1.0f && brightness > MIN_BRIGHTNESS) { - if ((brightness -= Game.elapsed) <= MIN_BRIGHTNESS) { - brightness = MIN_BRIGHTNESS; - } - updateBrightness(); - } - } - - public void highlight(boolean value) { - if (value) { - brightness = 1.0f; - name.hardlight(highlighted); - } else { - brightness = 0.999f; - name.hardlight(normal); - } - - updateBrightness(); - } - - private void updateBrightness() { - avatar.gm = avatar.bm = avatar.rm = avatar.am = brightness; - } - } - - private class ChallengeButton extends Button { - - private Image image; - - public ChallengeButton() { - super(); - - width = image.width; - height = image.height; - - image.am = Badges.isUnlocked(Badges.Badge.MONSTERS_SLAIN_1) ? 1.0f : 0.5f; - } - - @Override - protected void createChildren() { - - super.createChildren(); - - image = Icons.get(ShatteredPixelDungeon.challenges() > 0 ? Icons.CHALLENGE_ON : Icons.CHALLENGE_OFF); - add(image); - } - - @Override - protected void layout() { - - super.layout(); - - image.x = x; - image.y = y; - } - - @Override - protected void onClick() { - StartScene.this.add(new WndChallenges(ShatteredPixelDungeon.challenges(), true) { - public void onBackPressed() { - super.onBackPressed(); - image.copy(Icons.get(ShatteredPixelDungeon.challenges() > 0 ? - Icons.CHALLENGE_ON : Icons.CHALLENGE_OFF)); - } - }); - - } - - @Override - protected void onTouchDown() { - Sample.INSTANCE.play(Assets.SND_CLICK); - } - } - - private class WndSkin extends WndOptions { - - public WndSkin() { - super(Messages.get(Skins.class, "title"), Messages.get(Skins.class, "info"),Messages.get(Skins.class, "normal"), - Messages.get(Skins.class, "first"),Messages.get(Skins.class, "second"),Messages.get(Skins.class, "third") ); - } - - @Override - protected void onSelect( int index ) { - - skins = index; - final String skin = Skins.NAME_IDS[index]; - StartScene.this.add( - new WndOptions( Messages.get(Skins.class,skin), - Messages.get(Skins.class, skin+"_desc"), - Messages.get(Skins.class, "yes"), - Messages.get(Skins.class, "no") - ) { - @Override - protected void onSelect( int index ) { - if (index == 0) { - - startNewGame(); - - } else { - - StartScene.this.add( new WndSkin() ); - - } - } - } ); - } - - } - -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/scenes/SurfaceScene.java b/java/com/hmdzl/spspd/change/scenes/SurfaceScene.java deleted file mode 100644 index d992eabe..00000000 --- a/java/com/hmdzl/spspd/change/scenes/SurfaceScene.java +++ /dev/null @@ -1,380 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.scenes; - -import java.nio.FloatBuffer; -import java.util.Calendar; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.hero.HeroClass; -import com.hmdzl.spspd.change.sprites.RatSprite; -import com.hmdzl.spspd.change.ui.Archs; -import com.hmdzl.spspd.change.ui.RedButton; -import com.hmdzl.spspd.change.ui.RedButton; -import com.watabou.gltextures.Gradient; -import com.watabou.gltextures.SmartTexture; -import com.watabou.glwrap.Matrix; -import com.watabou.glwrap.Quad; -import com.watabou.input.Touchscreen.Touch; -import com.watabou.noosa.Camera; -import com.watabou.noosa.ColorBlock; -import com.watabou.noosa.Game; -import com.watabou.noosa.Group; -import com.watabou.noosa.Image; -import com.watabou.noosa.NoosaScript; -import com.watabou.noosa.TextureFilm; -import com.watabou.noosa.TouchArea; -import com.watabou.noosa.Visual; -import com.watabou.noosa.audio.Music; -import com.watabou.utils.Point; -import com.watabou.utils.Random; -import com.hmdzl.spspd.change.messages.Messages; - -public class SurfaceScene extends PixelScene { - - private static final int FRAME_WIDTH = 88; - private static final int FRAME_HEIGHT = 125; - - private static final int FRAME_MARGIN_TOP = 9; - private static final int FRAME_MARGIN_X = 4; - - private static final int BUTTON_HEIGHT = 20; - - private static final int SKY_WIDTH = 80; - private static final int SKY_HEIGHT = 112; - - private static final int NSTARS = 100; - private static final int NCLOUDS = 5; - - private Camera viewport; - - @Override - public void create() { - - super.create(); - - Music.INSTANCE.play(Assets.HAPPY, true); - Music.INSTANCE.volume(1f); - - uiCamera.visible = false; - - int w = Camera.main.width; - int h = Camera.main.height; - - Archs archs = new Archs(); - archs.reversed = true; - archs.setSize(w, h); - add(archs); - - float vx = align((w - SKY_WIDTH) / 2); - float vy = align((h - SKY_HEIGHT - BUTTON_HEIGHT) / 2); - - Point s = Camera.main.cameraToScreen(vx, vy); - viewport = new Camera(s.x, s.y, SKY_WIDTH, SKY_HEIGHT, defaultZoom); - Camera.add(viewport); - - Group window = new Group(); - window.camera = viewport; - add(window); - - boolean dayTime = Calendar.getInstance().get(Calendar.HOUR_OF_DAY) >= 7; - - Sky sky = new Sky(dayTime); - sky.scale.set(SKY_WIDTH, SKY_HEIGHT); - window.add(sky); - - if (!dayTime) { - for (int i = 0; i < NSTARS; i++) { - float size = Random.Float(); - ColorBlock star = new ColorBlock(size, size, 0xFFFFFFFF); - star.x = Random.Float(SKY_WIDTH) - size / 2; - star.y = Random.Float(SKY_HEIGHT) - size / 2; - star.am = size * (1 - star.y / SKY_HEIGHT); - window.add(star); - } - } - - float range = SKY_HEIGHT * 2 / 3; - for (int i = 0; i < NCLOUDS; i++) { - Cloud cloud = new Cloud((NCLOUDS - 1 - i) * (range / NCLOUDS) - + Random.Float(range / NCLOUDS), dayTime); - window.add(cloud); - } - - int nPatches = (int) (sky.width() / GrassPatch.WIDTH + 1); - - for (int i = 0; i < nPatches * 4; i++) { - GrassPatch patch = new GrassPatch((i - 0.75f) * GrassPatch.WIDTH - / 4, SKY_HEIGHT + 1, dayTime); - patch.brightness(dayTime ? 0.7f : 0.4f); - window.add(patch); - } - - Avatar a = new Avatar(Dungeon.hero.heroClass); - // Removing semitransparent contour - a.am = 2; - a.aa = -1; - a.x = PixelScene.align((SKY_WIDTH - a.width) / 2); - a.y = SKY_HEIGHT - a.height; - window.add(a); - - final Pet pet = new Pet(); - pet.rm = pet.gm = pet.bm = 1.2f; - pet.x = SKY_WIDTH / 2 + 2; - pet.y = SKY_HEIGHT - pet.height; - window.add(pet); - - window.add(new TouchArea(sky) { - @Override - protected void onClick(Touch touch) { - pet.jump(); - }; - }); - - for (int i = 0; i < nPatches; i++) { - GrassPatch patch = new GrassPatch((i - 0.5f) * GrassPatch.WIDTH, - SKY_HEIGHT, dayTime); - patch.brightness(dayTime ? 1.0f : 0.8f); - window.add(patch); - } - - Image frame = new Image(Assets.SURFACE); - - frame.frame(0, 0, FRAME_WIDTH, FRAME_HEIGHT); - frame.x = vx - FRAME_MARGIN_X; - frame.y = vy - FRAME_MARGIN_TOP; - add(frame); - - if (dayTime) { - a.brightness(1.2f); - pet.brightness(1.2f); - } else { - frame.hardlight(0xDDEEFF); - } - - RedButton gameOver = new RedButton(Messages.get(this, "exit")) { - @Override - protected void onClick() { - Game.switchScene(TitleScene.class); - } - }; - gameOver.setSize(SKY_WIDTH - FRAME_MARGIN_X * 2, BUTTON_HEIGHT); - gameOver.setPos(frame.x + FRAME_MARGIN_X * 2, frame.y + frame.height - + 4); - add(gameOver); - - Badges.validateHappyEnd(); - Badges.saveGlobal(); - - fadeIn(); - } - - @Override - public void destroy() { - Badges.saveGlobal(); - - Camera.remove(viewport); - super.destroy(); - } - - @Override - protected void onBackPressed() { - } - - private static class Sky extends Visual { - - private static final int[] day = { 0xFF4488FF, 0xFFCCEEFF }; - private static final int[] night = { 0xFF001155, 0xFF335980 }; - - private SmartTexture texture; - private FloatBuffer verticesBuffer; - - public Sky(boolean dayTime) { - super(0, 0, 1, 1); - - texture = new Gradient(dayTime ? day : night); - - float[] vertices = new float[16]; - verticesBuffer = Quad.create(); - - vertices[2] = 0.25f; - vertices[6] = 0.25f; - vertices[10] = 0.75f; - vertices[14] = 0.75f; - - vertices[3] = 0; - vertices[7] = 1; - vertices[11] = 1; - vertices[15] = 0; - - vertices[0] = 0; - vertices[1] = 0; - - vertices[4] = 1; - vertices[5] = 0; - - vertices[8] = 1; - vertices[9] = 1; - - vertices[12] = 0; - vertices[13] = 1; - - verticesBuffer.position(0); - verticesBuffer.put(vertices); - } - - @Override - public void draw() { - - super.draw(); - - NoosaScript script = NoosaScript.get(); - - texture.bind(); - - script.camera(camera()); - - script.uModel.valueM4(matrix); - script.lighting(rm, gm, bm, am, ra, ga, ba, aa); - - script.drawQuad(verticesBuffer); - } - } - - private static class Cloud extends Image { - - private static int lastIndex = -1; - - public Cloud(float y, boolean dayTime) { - super(Assets.SURFACE); - - int index; - do { - index = Random.Int(3); - } while (index == lastIndex); - - switch (index) { - case 0: - frame(88, 0, 49, 20); - break; - case 1: - frame(88, 20, 49, 22); - break; - case 2: - frame(88, 42, 50, 18); - break; - } - - lastIndex = index; - - this.y = y; - - scale.set(1 - y / SKY_HEIGHT); - x = Random.Float(SKY_WIDTH + width()) - width(); - speed.x = scale.x * (dayTime ? +8 : -8); - - if (dayTime) { - tint(0xCCEEFF, 1 - scale.y); - } else { - rm = gm = bm = +3.0f; - ra = ga = ba = -2.1f; - } - } - - @Override - public void update() { - super.update(); - if (speed.x > 0 && x > SKY_WIDTH) { - x = -width(); - } else if (speed.x < 0 && x < -width()) { - x = SKY_WIDTH; - } - } - } - - private static class Avatar extends Image { - - private static final int WIDTH = 24; - private static final int HEIGHT = 32; - - public Avatar(HeroClass cl) { - super(Assets.AVATARS); - frame(new TextureFilm(texture, WIDTH, HEIGHT).get(cl.ordinal())); - } - } - - private static class Pet extends RatSprite { - - public void jump() { - play(run); - } - - @Override - public void onComplete(Animation anim) { - if (anim == run) { - idle(); - } - } - } - - private static class GrassPatch extends Image { - - public static final int WIDTH = 16; - public static final int HEIGHT = 14; - - private float tx; - private float ty; - - private double a = Random.Float(5); - private double angle; - - private boolean forward; - - public GrassPatch(float tx, float ty, boolean forward) { - - super(Assets.SURFACE); - - frame(88 + Random.Int(4) * WIDTH, 60, WIDTH, HEIGHT); - - this.tx = tx; - this.ty = ty; - - this.forward = forward; - } - - @Override - public void update() { - super.update(); - a += Random.Float(Game.elapsed * 5); - angle = (2 + Math.cos(a)) * (forward ? +0.2 : -0.2); - - scale.y = (float) Math.cos(angle); - - x = tx + (float) Math.tan(angle) * width; - y = ty - scale.y * height; - } - - @Override - protected void updateMatrix() { - super.updateMatrix(); - Matrix.skewX(matrix, (float) (angle / Matrix.G2RAD)); - } - } -} diff --git a/java/com/hmdzl/spspd/change/scenes/TitleScene.java b/java/com/hmdzl/spspd/change/scenes/TitleScene.java deleted file mode 100644 index 7896a68f..00000000 --- a/java/com/hmdzl/spspd/change/scenes/TitleScene.java +++ /dev/null @@ -1,235 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * Shattered Pixel Dungeon - * Copyright (C) 2014-2016 Evan Debenham - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.scenes; - -import android.opengl.GLES20; -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.ShatteredPixelDungeon; -import com.hmdzl.spspd.change.effects.BannerSprites; -import com.hmdzl.spspd.change.effects.Fireball; -import com.hmdzl.spspd.change.messages.Messages; -//import com.hmdzl.spspd.change.scenes.PixelScene; -import com.hmdzl.spspd.change.ui.Archs; -import com.hmdzl.spspd.change.ui.ChangesButton; -import com.hmdzl.spspd.change.ui.ExitButton; -import com.hmdzl.spspd.change.ui.LanguageButton; -import com.hmdzl.spspd.change.ui.PrefsButton; -import com.watabou.noosa.BitmapText; -import com.watabou.noosa.Camera; -import com.watabou.noosa.Game; -import com.watabou.noosa.Image; -import com.watabou.noosa.RenderedText; -import com.watabou.noosa.audio.Music; -import com.watabou.noosa.audio.Sample; -import com.watabou.noosa.ui.Button; - -import javax.microedition.khronos.opengles.GL10; - -public class TitleScene extends PixelScene { - - @Override - public void create() { - - super.create(); - - Music.INSTANCE.play( Assets.THEME, true ); - Music.INSTANCE.volume( 1f ); - - uiCamera.visible = false; - - int w = Camera.main.width; - int h = Camera.main.height; - - Archs archs = new Archs(); - archs.setSize( w, h ); - add( archs ); - - Image title = BannerSprites.get( BannerSprites.Type.PIXEL_DUNGEON ); - add( title ); - - float topRegion = Math.max(95f, h*0.45f); - - title.x = (w - title.width()) / 2f; - if (ShatteredPixelDungeon.landscape()) - title.y = (topRegion - title.height()) / 2f; - else - title.y = 16 + (topRegion - title.height() - 16) / 2f; - - align(title); - - placeTorch(title.x + 18, title.y + 20); - placeTorch(title.x + title.width - 18, title.y + 20); - - Image signs = new Image( BannerSprites.get( BannerSprites.Type.PIXEL_DUNGEON_SIGNS ) ) { - private float time = 0; - @Override - public void update() { - super.update(); - am = (float)Math.sin( -(time += Game.elapsed) ); - } - @Override - public void draw() { - GLES20.glBlendFunc( GL10.GL_SRC_ALPHA, GL10.GL_ONE ); - super.draw(); - GLES20.glBlendFunc(GL10.GL_SRC_ALPHA, GL10.GL_ONE_MINUS_SRC_ALPHA); - } - }; - signs.x = title.x + (title.width() - signs.width())/2f; - signs.y = title.y; - add( signs ); - - DashboardItem btnBadges = new DashboardItem( Messages.get(this, "badges"), 3 ) { - @Override - protected void onClick() { - ShatteredPixelDungeon.switchNoFade( BadgesScene.class ); - } - }; - add(btnBadges); - - DashboardItem btnAbout = new DashboardItem( Messages.get(this, "about"), 1 ) { - @Override - protected void onClick() { - ShatteredPixelDungeon.switchNoFade( AboutScene.class ); - } - }; - add( btnAbout ); - - DashboardItem btnPlay = new DashboardItem( Messages.get(this, "play"), 0 ) { - @Override - protected void onClick() { - ShatteredPixelDungeon.switchNoFade( StartScene.class ); - } - }; - add( btnPlay ); - - DashboardItem btnRankings = new DashboardItem( Messages.get(this, "rankings"), 2 ) { - @Override - protected void onClick() { - ShatteredPixelDungeon.switchNoFade( RankingsScene.class ); - } - }; - add( btnRankings ); - - if (ShatteredPixelDungeon.landscape()) { - btnRankings .setPos( w / 2 - btnRankings.width(), topRegion ); - btnBadges .setPos( w / 2, topRegion ); - btnPlay .setPos( btnRankings.left() - btnPlay.width(), topRegion ); - btnAbout .setPos( btnBadges.right(), topRegion ); - } else { - btnPlay.setPos( w / 2 - btnPlay.width(), topRegion ); - btnRankings.setPos( w / 2, btnPlay.top() ); - btnBadges.setPos( w / 2 - btnBadges.width(), btnPlay.top() + DashboardItem.SIZE ); - btnAbout.setPos( w / 2, btnBadges.top() ); - } - - BitmapText source = new BitmapText("PD v 1.7.5", font1x); - source.measure(); - source.hardlight(0x444444); - source.x = w - source.width(); - source.y = h - source.height(); - add(source); - - BitmapText version = new BitmapText("v " + Game.version + "", font1x); - version.measure(); - version.hardlight(0xCCCCCC); - version.x = w - version.width(); - version.y = h - version.height() - source.height(); - add(version); - - Button changes = new ChangesButton(); - changes.setPos( 6, h - version.height() - changes.height()); - add( changes ); - - PrefsButton btnPrefs = new PrefsButton(); - btnPrefs.setPos(0, 0); - add(btnPrefs); - - LanguageButton btnLang = new LanguageButton(); - btnLang.setPos(16, 1); - add( btnLang ); - - ExitButton btnExit = new ExitButton(); - btnExit.setPos(w - btnExit.width(), 0); - add(btnExit); - - fadeIn(); - } - - private void placeTorch( float x, float y ) { - Fireball fb = new Fireball(); - fb.setPos( x, y ); - add( fb ); - } - - private static class DashboardItem extends Button { - - public static final float SIZE = 48; - - private static final int IMAGE_SIZE = 32; - - private Image image; - private RenderedText label; - - public DashboardItem( String text, int index ) { - super(); - - image.frame( image.texture.uvRect( index * IMAGE_SIZE, 0, (index + 1) * IMAGE_SIZE, IMAGE_SIZE ) ); - this.label.text( text ); - - setSize( SIZE, SIZE ); - } - - @Override - protected void createChildren() { - super.createChildren(); - - image = new Image( Assets.DASHBOARD ); - add( image ); - - label = renderText( 9 ); - add( label ); - } - - @Override - protected void layout() { - super.layout(); - - image.x = x + (width - image.width()) / 2; - image.y = y; - align(image); - - label.x = x + (width - label.width()) / 2; - label.y = image.y + image.height() +2; - align(label); - } - - @Override - protected void onTouchDown() { - image.brightness( 1.5f ); - Sample.INSTANCE.play( Assets.SND_CLICK, 1, 1, 0.8f ); - } - - @Override - protected void onTouchUp() { - image.resetColor(); - } - } -} diff --git a/java/com/hmdzl/spspd/change/scenes/WelcomeScene.java b/java/com/hmdzl/spspd/change/scenes/WelcomeScene.java deleted file mode 100644 index 6f0608d4..00000000 --- a/java/com/hmdzl/spspd/change/scenes/WelcomeScene.java +++ /dev/null @@ -1,101 +0,0 @@ -package com.hmdzl.spspd.change.scenes; - -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.Chrome; -import com.hmdzl.spspd.change.Rankings; -import com.hmdzl.spspd.change.ShatteredPixelDungeon; -import com.hmdzl.spspd.change.ui.Archs; -import com.hmdzl.spspd.change.ui.RedButton; -import com.hmdzl.spspd.change.ui.ScrollPane; -import com.hmdzl.spspd.change.ui.Window; -import com.watabou.noosa.BitmapTextMultiline; -import com.watabou.noosa.Camera; -import com.watabou.noosa.Game; -import com.watabou.noosa.NinePatch; -import com.watabou.noosa.ui.Component; -import com.hmdzl.spspd.change.ui.RedButton; -import com.hmdzl.spspd.change.ui.RenderedTextMultiline; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.noosa.RenderedText; -import com.hmdzl.spspd.change.ui.ExitButton; - -//TODO: update this class with relevant info as new versions come out. -public class WelcomeScene extends PixelScene { - - - @Override - public void create() { - super.create(); - - int w = Camera.main.width; - int h = Camera.main.height; - - RenderedText title = PixelScene.renderText( Messages.get(this, "title"), 9 ); - title.hardlight(Window.TITLE_COLOR); - title.x = (w - title.width()) / 2 ; - title.y = 4; - align(title); - add(title); - - ExitButton btnExit = new ExitButton(); - btnExit.setPos( Camera.main.width - btnExit.width(), 0 ); - add( btnExit ); - - RenderedTextMultiline text = renderMultiline(Messages.get(WelcomeScene.class,"new_things"), 6 ); - - - int pw = w - 6; - int ph = h - 40; - - - NinePatch panel = Chrome.get(Chrome.Type.WINDOW); - panel.size( pw, ph ); - panel.x = (w - pw) / 2; - //panel.y = title.y + title.height() + 2; - panel.y = (h - ph) / 2; - add( panel ); - - ScrollPane list = new ScrollPane( new Component() ); - add( list ); - - Component content = list.content(); - content.clear(); - - text.maxWidth((int) panel.innerWidth()); - - content.add(text); - - content.setSize( panel.innerWidth(), text.height() ); - - list.setRect( - panel.x + panel.marginLeft(), - panel.y + panel.marginTop(), - panel.innerWidth(), - panel.innerHeight()); - list.scrollTo(0, 0); - - Archs archs = new Archs(); - archs.setSize( Camera.main.width, Camera.main.height ); - addToBack( archs ); - - fadeIn(); - - RedButton okay = new RedButton(Messages.get(this, "continue")){ - @Override - protected void onClick() { - super.onClick(); - //updateVersion(previousVersion); - ShatteredPixelDungeon.switchScene(TitleScene.class); - } - }; - - okay.setRect(title.x, h-20, title.width(), 16); - okay.textColor(0xBBBB33); - add(okay); - } - - @Override - protected void onBackPressed() { - ShatteredPixelDungeon.switchNoFade(TitleScene.class); - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/AFlySprite.java b/java/com/hmdzl/spspd/change/sprites/AFlySprite.java deleted file mode 100644 index 25880299..00000000 --- a/java/com/hmdzl/spspd/change/sprites/AFlySprite.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.levels.Level; -import com.watabou.noosa.Game; -import com.watabou.noosa.TextureFilm; -import com.watabou.noosa.audio.Sample; -import com.watabou.noosa.particles.Emitter; - -public class AFlySprite extends MobSprite { - - public AFlySprite() { - super(); - - texture( Assets.A_FLY ); - - TextureFilm frames = new TextureFilm( texture, 16, 16 ); - - idle = new Animation( 15, true ); - idle.frames(frames, 0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3); - - run = new Animation( 20, true ); - run.frames( frames, 0 ); - - attack = new Animation( 12, false ); - attack.frames( frames, 0, 2, 3 ); - - die = new Animation( 20, false ); - die.frames( frames, 0 ); - - play( idle ); - } - - -} diff --git a/java/com/hmdzl/spspd/change/sprites/ARealManSprite.java b/java/com/hmdzl/spspd/change/sprites/ARealManSprite.java deleted file mode 100644 index 1f82d160..00000000 --- a/java/com/hmdzl/spspd/change/sprites/ARealManSprite.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.levels.Level; -import com.watabou.noosa.TextureFilm; -import com.watabou.noosa.audio.Sample; -import com.watabou.noosa.particles.Emitter; - -public class ARealManSprite extends MobSprite { - - public ARealManSprite() { - super(); - - texture( Assets.M_AMD_W ); - - TextureFilm frames = new TextureFilm( texture, 16, 16 ); - - idle = new Animation( 3, true ); - idle.frames(frames, 0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3); - - run = new Animation( 20, true ); - run.frames( frames, 0 ); - - attack = new Animation( 12, false ); - attack.frames( frames, 0, 2, 3 ); - - die = new Animation( 20, false ); - die.frames( frames, 0 ); - - play( idle ); - } - - -} diff --git a/java/com/hmdzl/spspd/change/sprites/AcidicSprite.java b/java/com/hmdzl/spspd/change/sprites/AcidicSprite.java deleted file mode 100644 index 9ba25ef4..00000000 --- a/java/com/hmdzl/spspd/change/sprites/AcidicSprite.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.watabou.noosa.TextureFilm; - -public class AcidicSprite extends ScorpioSprite { - - public AcidicSprite() { - super(); - - texture(Assets.SCORPIO); - - TextureFilm frames = new TextureFilm(texture, 18, 17); - - idle = new Animation(12, true); - idle.frames(frames, 14, 14, 14, 14, 14, 14, 14, 14, 15, 16, 15, 16, 15, - 16); - - run = new Animation(4, true); - run.frames(frames, 19, 20); - - attack = new Animation(15, false); - attack.frames(frames, 14, 17, 18); - - zap = attack.clone(); - - die = new Animation(12, false); - die.frames(frames, 14, 21, 22, 23, 24); - - play(idle); - } - - @Override - public int blood() { - return 0xFF66FF22; - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/AdultDragonVioletSprite.java b/java/com/hmdzl/spspd/change/sprites/AdultDragonVioletSprite.java deleted file mode 100644 index 5f5f8490..00000000 --- a/java/com/hmdzl/spspd/change/sprites/AdultDragonVioletSprite.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.actors.mobs.AdultDragonViolet; -import com.hmdzl.spspd.change.effects.MagicMissile; -import com.hmdzl.spspd.change.items.weapon.missiles.Wave; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.watabou.noosa.TextureFilm; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Callback; - -public class AdultDragonVioletSprite extends MobSprite { - - private static final float DURATION = 2f; - private Animation cast; - - public AdultDragonVioletSprite() { - super(); - - texture(Assets.DRAGON); - - TextureFilm frames = new TextureFilm(texture, 16, 16); - - idle = new Animation(10, true); - idle.frames(frames, 0, 1, 0, 1, 0, 1, 0); - - run = new Animation(10, false); - run.frames(frames, 0, 2, 1); - - attack = new Animation(10, false); - attack.frames(frames, 0, 2, 3, 4, 5); - - cast = attack.clone(); - - die = new Animation(10, false); - die.frames(frames, 0, 5, 6, 7, 8, 9, 9, 9); - - play(run.clone()); - } - - - - @Override - public void zap(int cell) { - - turnTo(ch.pos, cell); - play(zap); - - MagicMissile.poison(parent, ch.pos, cell, new Callback() { - @Override - public void call() { - ((AdultDragonViolet) ch).onZapComplete(); - } - }); - Sample.INSTANCE.play(Assets.SND_ZAP); - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/AlbinoPiranhaSprite.java b/java/com/hmdzl/spspd/change/sprites/AlbinoPiranhaSprite.java deleted file mode 100644 index 10596112..00000000 --- a/java/com/hmdzl/spspd/change/sprites/AlbinoPiranhaSprite.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.watabou.noosa.TextureFilm; - -public class AlbinoPiranhaSprite extends MobSprite { - - public AlbinoPiranhaSprite() { - super(); - - texture(Assets.ALBINOPIRANHA); - - TextureFilm frames = new TextureFilm(texture, 12, 16); - - idle = new Animation(8, true); - idle.frames(frames, 0, 1, 2, 1); - - run = new Animation(20, true); - run.frames(frames, 0, 1, 2, 1); - - attack = new Animation(20, false); - attack.frames(frames, 3, 4, 5, 6, 7, 8, 9, 10, 11); - - die = new Animation(4, false); - die.frames(frames, 12, 13, 14); - - play(idle); - } - - @Override - public void onComplete(Animation anim) { - super.onComplete(anim); - - if (anim == attack) { - GameScene.ripple(ch.pos); - } - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/AlbinoSprite.java b/java/com/hmdzl/spspd/change/sprites/AlbinoSprite.java deleted file mode 100644 index 1d91f60b..00000000 --- a/java/com/hmdzl/spspd/change/sprites/AlbinoSprite.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.watabou.noosa.TextureFilm; - -public class AlbinoSprite extends MobSprite { - - public AlbinoSprite() { - super(); - - texture(Assets.RAT); - - TextureFilm frames = new TextureFilm(texture, 16, 15); - - idle = new Animation(2, true); - idle.frames(frames, 16, 16, 16, 17); - - run = new Animation(10, true); - run.frames(frames, 22, 23, 24, 25, 26); - - attack = new Animation(15, false); - attack.frames(frames, 18, 19, 20, 21); - - die = new Animation(10, false); - die.frames(frames, 27, 28, 29, 30); - - play(idle); - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/ApostleSprite.java b/java/com/hmdzl/spspd/change/sprites/ApostleSprite.java deleted file mode 100644 index 4a98d8b7..00000000 --- a/java/com/hmdzl/spspd/change/sprites/ApostleSprite.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.levels.Level; -import com.watabou.noosa.TextureFilm; -import com.watabou.noosa.audio.Sample; -import com.watabou.noosa.particles.Emitter; - -public class ApostleSprite extends MobSprite { - - public ApostleSprite() { - super(); - - texture( Assets.APOSTLE ); - - TextureFilm frames = new TextureFilm( texture, 16, 16 ); - - idle = new Animation( 3, true ); - idle.frames(frames, 0, 0, 1, 1, 2, 2, 3, 3, 3, 3, 3, 3); - - run = new Animation( 3, true ); - run.frames( frames, 0, 0, 1, 1, 2, 2, 3, 3, 3, 3, 3, 3 ); - - attack = new Animation( 12, false ); - attack.frames( frames, 0, 2, 3 ); - - die = new Animation( 20, false ); - die.frames( frames, 0 ); - - play( idle ); - } - - -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/sprites/AssassinSprite.java b/java/com/hmdzl/spspd/change/sprites/AssassinSprite.java deleted file mode 100644 index a4d60be3..00000000 --- a/java/com/hmdzl/spspd/change/sprites/AssassinSprite.java +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Slow; -import com.hmdzl.spspd.change.items.weapon.missiles.Smoke; -import com.hmdzl.spspd.change.levels.Level; -import com.watabou.noosa.TextureFilm; -import com.watabou.utils.Callback; -import com.watabou.utils.Random; - -public class AssassinSprite extends MobSprite { - - private Animation cast; - - public AssassinSprite() { - super(); - - texture(Assets.ASSASSIN); - - TextureFilm frames = new TextureFilm(texture, 14, 16); - - idle = new Animation(2, true); - idle.frames(frames, 0, 0, 0, 1); - - run = new Animation(15, false); - run.frames(frames, 2, 3, 4, 5, 0); - - attack = new Animation(15, false); - attack.frames(frames, 6, 7, 7, 0); - - cast = attack.clone(); - - die = new Animation(8, false); - die.frames(frames, 8, 9, 10, 10); - - play(run.clone()); - } - - - @Override - public void attack(int cell) { - if (!Level.adjacent(cell, ch.pos)) { - Char enemy = Actor.findChar(cell); - ((MissileSprite) parent.recycle(MissileSprite.class)).reset(ch.pos, - cell, new Smoke(), new Callback() { - @Override - public void call() { - ch.onAttackComplete(); - } - }); - - - if(Random.Int(5)==0){ - Buff.affect(enemy, Slow.class, Slow.duration(enemy)); - } - - - - play(cast); - turnTo(ch.pos, cell); - - } else { - - super.attack(cell); - - } - } - - @Override - public void onComplete(Animation anim) { - if (anim == run) { - isMoving = false; - idle(); - } else { - super.onComplete(anim); - } - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/BaBaSprite.java b/java/com/hmdzl/spspd/change/sprites/BaBaSprite.java deleted file mode 100644 index 676456e5..00000000 --- a/java/com/hmdzl/spspd/change/sprites/BaBaSprite.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2452-2454 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.watabou.noosa.TextureFilm; -import com.watabou.utils.Random; - -public class BaBaSprite extends MobSprite { - - public BaBaSprite() { - super(); - - texture(Assets.SHEEP); - - TextureFilm frames = new TextureFilm(texture, 16, 15); - - idle = new Animation(8, true); - idle.frames(frames, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 6, 7, 4); - - run = idle.clone(); - - attack = new Animation(12, false); - attack.frames(frames, 2, 3, 0, 1); - - die = new Animation(20, false); - die.frames(frames, 4); - - play(idle); - curFrame = Random.Int(curAnim.frames.length); - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/BanditKingSprite.java b/java/com/hmdzl/spspd/change/sprites/BanditKingSprite.java deleted file mode 100644 index 728a6859..00000000 --- a/java/com/hmdzl/spspd/change/sprites/BanditKingSprite.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.actors.Char; -import com.watabou.noosa.TextureFilm; - -public class BanditKingSprite extends MobSprite { - - public BanditKingSprite() { - super(); - - texture(Assets.BANDITKING); - TextureFilm film = new TextureFilm(texture, 12, 13); - - idle = new Animation(1, true); - idle.frames(film, 0, 0, 0, 1, 0, 0, 0, 0, 1); - - run = new Animation(15, true); - run.frames(film, 0, 0, 2, 3, 3, 4); - - die = new Animation(10, false); - die.frames(film, 1, 1, 5, 5, 5); - - attack = new Animation(12, false); - attack.frames(film, 10, 11, 12, 0); - - idle(); - } - - @Override - public void link(Char ch) { - super.link(ch); - add(State.LEVITATING); - } - - @Override - public void die() { - super.die(); - remove(State.LEVITATING); - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/BanditSprite.java b/java/com/hmdzl/spspd/change/sprites/BanditSprite.java deleted file mode 100644 index 258cf8ce..00000000 --- a/java/com/hmdzl/spspd/change/sprites/BanditSprite.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.watabou.noosa.TextureFilm; - -public class BanditSprite extends MobSprite { - - public BanditSprite() { - super(); - - texture(Assets.THIEF); - TextureFilm film = new TextureFilm(texture, 12, 13); - - idle = new Animation(1, true); - idle.frames(film, 21, 21, 21, 22, 21, 21, 21, 21, 22); - - run = new Animation(15, true); - run.frames(film, 21, 21, 23, 24, 24, 25); - - die = new Animation(10, false); - die.frames(film, 25, 27, 28, 29, 30); - - attack = new Animation(12, false); - attack.frames(film, 31, 32, 33); - - idle(); - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/BatSprite.java b/java/com/hmdzl/spspd/change/sprites/BatSprite.java deleted file mode 100644 index 47689f6e..00000000 --- a/java/com/hmdzl/spspd/change/sprites/BatSprite.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.watabou.noosa.TextureFilm; - -public class BatSprite extends MobSprite { - - public BatSprite() { - super(); - - texture(Assets.BAT); - - TextureFilm frames = new TextureFilm(texture, 15, 15); - - idle = new Animation(8, true); - idle.frames(frames, 0, 1); - - run = new Animation(12, true); - run.frames(frames, 0, 1); - - attack = new Animation(12, false); - attack.frames(frames, 2, 3, 0, 1); - - die = new Animation(12, false); - die.frames(frames, 4, 5, 6); - - play(idle); - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/BatteryTombSprite.java b/java/com/hmdzl/spspd/change/sprites/BatteryTombSprite.java deleted file mode 100644 index 672b820d..00000000 --- a/java/com/hmdzl/spspd/change/sprites/BatteryTombSprite.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.levels.Level; -import com.watabou.noosa.Game; -import com.watabou.noosa.TextureFilm; -import com.watabou.noosa.audio.Sample; -import com.watabou.noosa.particles.Emitter; - -public class BatteryTombSprite extends MobSprite { - - public BatteryTombSprite() { - super(); - - texture( Assets.BATTERYTOMB ); - - TextureFilm frames = new TextureFilm( texture, 16, 16 ); - - idle = new Animation( 15, true ); - idle.frames(frames, 0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3); - - run = new Animation( 20, true ); - run.frames( frames, 0,1,2,3 ); - - attack = new Animation( 12, false ); - attack.frames( frames, 0, 2, 3 ); - - die = new Animation( 20, false ); - die.frames( frames, 0 ); - - play( idle ); - } - @Override - public void update() { - super.update(); - - if (flashTime <= 0){ - float interval = (Game.timeTotal % 9 ) /3f; - tint(interval > 2 ? interval - 2 : Math.max(0, 1 - interval), - interval > 1 ? Math.max(0, 2-interval): interval, - interval > 2 ? Math.max(0, 3-interval): interval-1, 0.5f); - } - } - -} diff --git a/java/com/hmdzl/spspd/change/sprites/BeastYearSprite.java b/java/com/hmdzl/spspd/change/sprites/BeastYearSprite.java deleted file mode 100644 index 1b2ffeca..00000000 --- a/java/com/hmdzl/spspd/change/sprites/BeastYearSprite.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.levels.Level; -import com.watabou.noosa.TextureFilm; -import com.watabou.noosa.audio.Sample; -import com.watabou.noosa.particles.Emitter; - -public class BeastYearSprite extends MobSprite { - - public BeastYearSprite() { - super(); - - texture( Assets.BEAST_YEAR ); - - TextureFilm frames = new TextureFilm( texture, 16, 16 ); - - idle = new Animation( 15, true ); - idle.frames(frames, 0,0,1,1,0,0); - - run = new Animation( 20, true ); - run.frames( frames, 0,0 ); - - attack = new Animation( 12, false ); - attack.frames( frames, 1,1,2, 2,2, 3,3 ); - - die = new Animation( 20, false ); - die.frames( frames, 2,2,1,1,0,0 ); - - play( idle ); - } - - -} diff --git a/java/com/hmdzl/spspd/change/sprites/BeeSprite.java b/java/com/hmdzl/spspd/change/sprites/BeeSprite.java deleted file mode 100644 index 1fe7f6e4..00000000 --- a/java/com/hmdzl/spspd/change/sprites/BeeSprite.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.watabou.noosa.TextureFilm; - -public class BeeSprite extends MobSprite { - - public BeeSprite() { - super(); - - texture(Assets.BEE); - - TextureFilm frames = new TextureFilm(texture, 16, 16); - - idle = new Animation(12, true); - idle.frames(frames, 0, 1, 1, 0, 2, 2); - - run = new Animation(15, true); - run.frames(frames, 0, 1, 1, 0, 2, 2); - - attack = new Animation(20, false); - attack.frames(frames, 3, 4, 5, 6); - - die = new Animation(20, false); - die.frames(frames, 7, 8, 9, 10); - - play(idle); - } - - @Override - public int blood() { - return 0xffd500; - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/BilboldevSprite.java b/java/com/hmdzl/spspd/change/sprites/BilboldevSprite.java deleted file mode 100644 index 6c94afd9..00000000 --- a/java/com/hmdzl/spspd/change/sprites/BilboldevSprite.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.levels.Level; -import com.watabou.noosa.TextureFilm; -import com.watabou.noosa.audio.Sample; -import com.watabou.noosa.particles.Emitter; - -public class BilboldevSprite extends MobSprite { - - public BilboldevSprite() { - super(); - - texture( Assets.BILBOLDEV ); - - TextureFilm frames = new TextureFilm( texture, 16, 14 ); - - idle = new Animation( 15, true ); - idle.frames(frames, 0, 0, 0, 0, 0, 0, 0, 1, 2, 2, 2, 3); - - run = new Animation( 20, true ); - run.frames( frames, 0 ); - - attack = new Animation( 12, false ); - attack.frames( frames, 0, 2, 3 ); - - die = new Animation( 20, false ); - die.frames( frames, 0 ); - - play( idle ); - } - - -} diff --git a/java/com/hmdzl/spspd/change/sprites/BlacksmithSprite.java b/java/com/hmdzl/spspd/change/sprites/BlacksmithSprite.java deleted file mode 100644 index 56d3d742..00000000 --- a/java/com/hmdzl/spspd/change/sprites/BlacksmithSprite.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.levels.Level; -import com.watabou.noosa.TextureFilm; -import com.watabou.noosa.audio.Sample; -import com.watabou.noosa.particles.Emitter; - -public class BlacksmithSprite extends MobSprite { - - private Emitter emitter; - - public BlacksmithSprite() { - super(); - - texture(Assets.TROLL); - - TextureFilm frames = new TextureFilm(texture, 13, 16); - - idle = new Animation(15, true); - idle.frames(frames, 0, 0, 0, 0, 0, 0, 0, 1, 2, 2, 2, 3); - - run = new Animation(20, true); - run.frames(frames, 0); - - die = new Animation(20, false); - die.frames(frames, 0); - - play(idle); - } - - @Override - public void link(Char ch) { - super.link(ch); - - emitter = new Emitter(); - emitter.autoKill = false; - emitter.pos(x + 7, y + 12); - parent.add(emitter); - } - - @Override - public void update() { - super.update(); - - if (emitter != null) { - emitter.visible = visible; - } - } - - @Override - public void onComplete(Animation anim) { - super.onComplete(anim); - - if (visible && emitter != null && anim == idle) { - emitter.burst(Speck.factory(Speck.FORGE), 3); - float volume = 0.2f / (Level.distance(ch.pos, Dungeon.hero.pos)); - Sample.INSTANCE.play(Assets.SND_EVOKE, volume, volume, 0.8f); - } - } - -} diff --git a/java/com/hmdzl/spspd/change/sprites/BlueDragonSprite.java b/java/com/hmdzl/spspd/change/sprites/BlueDragonSprite.java deleted file mode 100644 index 5533fb67..00000000 --- a/java/com/hmdzl/spspd/change/sprites/BlueDragonSprite.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.actors.mobs.pets.BlueDragon; -import com.hmdzl.spspd.change.effects.MagicMissile; -import com.watabou.noosa.TextureFilm; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Callback; - -public class BlueDragonSprite extends MobSprite { - - //Frames 1-4 are idle, 5-8 are moving, 9-12 are attack and the last are for death RBVG - - public BlueDragonSprite() { - super(); - - texture(Assets.PETDRAGON); - - TextureFilm frames = new TextureFilm(texture, 16, 16); - - idle = new Animation(2, true); - idle.frames(frames, 16, 17, 18, 19); - - run = new Animation(8, true); - run.frames(frames, 20, 21, 22, 23); - - attack = new Animation(8, false); - attack.frames(frames, 24, 25, 26, 27); - - zap = attack.clone(); - - die = new Animation(8, false); - die.frames(frames, 28, 29, 30, 31); - - play(idle); - } - - @Override - public void zap(int cell) { - - turnTo(ch.pos, cell); - play(zap); - - MagicMissile.coldLight(parent, ch.pos, cell, new Callback() { - @Override - public void call() { - ((BlueDragon) ch).onZapComplete(); - } - }); - Sample.INSTANCE.play(Assets.SND_ZAP); - } - - @Override - public int blood() { - return 0xFFcdcdb7; - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/BlueWraithSprite.java b/java/com/hmdzl/spspd/change/sprites/BlueWraithSprite.java deleted file mode 100644 index 376fcc5e..00000000 --- a/java/com/hmdzl/spspd/change/sprites/BlueWraithSprite.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.watabou.noosa.TextureFilm; - -public class BlueWraithSprite extends MobSprite { - - public BlueWraithSprite() { - super(); - - texture(Assets.BLUEWRAITH); - - TextureFilm frames = new TextureFilm(texture, 14, 15); - - idle = new Animation(5, true); - idle.frames(frames, 0, 1); - - run = new Animation(10, true); - run.frames(frames, 0, 1); - - attack = new Animation(10, false); - attack.frames(frames, 0, 2, 3); - - die = new Animation(8, false); - die.frames(frames, 0, 4, 5, 6, 7); - - play(idle); - } - - @Override - public int blood() { - return 0x88000000; - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/BrokenRobotSprite.java b/java/com/hmdzl/spspd/change/sprites/BrokenRobotSprite.java deleted file mode 100644 index 538b704f..00000000 --- a/java/com/hmdzl/spspd/change/sprites/BrokenRobotSprite.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.DungeonTilemap; -import com.hmdzl.spspd.change.effects.DeathRay; -import com.watabou.noosa.TextureFilm; - -public class BrokenRobotSprite extends MobSprite { - - private int attackPos; - - public BrokenRobotSprite() { - super(); - - texture(Assets.BROKENROBOT); - - TextureFilm frames = new TextureFilm(texture, 16, 18); - - idle = new Animation(2, true); - idle.frames(frames, 0, 1, 0, 1); - - run = new Animation(12, true); - run.frames(frames, 2, 3, 4, 5, 6, 7); - - attack = new Animation(8, false); - attack.frames(frames, 8, 9); - - die = new Animation(8, false); - die.frames(frames, 10, 11, 12, 13); - - play(idle); - } - - @Override - public void attack(int pos) { - attackPos = pos; - super.attack(pos); - } - - - @Override - public void onComplete(Animation anim) { - super.onComplete(anim); - - if (anim == attack) { - if (Dungeon.visible[ch.pos] || Dungeon.visible[attackPos]) { - parent.add(new DeathRay(center(), DungeonTilemap - .tileCenterToWorld(attackPos))); - } - } - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/BrownBatSprite.java b/java/com/hmdzl/spspd/change/sprites/BrownBatSprite.java deleted file mode 100644 index e8ad05ca..00000000 --- a/java/com/hmdzl/spspd/change/sprites/BrownBatSprite.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.watabou.noosa.TextureFilm; - -public class BrownBatSprite extends MobSprite { - - public BrownBatSprite() { - super(); - - texture(Assets.BAT); - - TextureFilm frames = new TextureFilm(texture, 15, 15); - - idle = new Animation(8, true); - idle.frames(frames, 16, 17); - - run = new Animation(12, true); - run.frames(frames, 16, 17); - - attack = new Animation(12, false); - attack.frames(frames, 18, 19, 16, 17); - - die = new Animation(12, false); - die.frames(frames, 20, 21, 22); - - play(idle); - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/BruteSprite.java b/java/com/hmdzl/spspd/change/sprites/BruteSprite.java deleted file mode 100644 index f952bb2e..00000000 --- a/java/com/hmdzl/spspd/change/sprites/BruteSprite.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.items.weapon.missiles.EscapeKnive; -import com.hmdzl.spspd.change.levels.Level; -import com.watabou.noosa.TextureFilm; -import com.watabou.utils.Callback; - -public class BruteSprite extends MobSprite { - - private Animation cast; - - public BruteSprite() { - super(); - - texture(Assets.BRUTE); - - TextureFilm frames = new TextureFilm(texture, 12, 16); - - idle = new Animation(2, true); - idle.frames(frames, 0, 0, 0, 1, 0, 0, 1, 1); - - run = new Animation(12, true); - run.frames(frames, 4, 5, 6, 7); - - attack = new Animation(12, false); - attack.frames(frames, 2, 3, 0); - - cast = attack.clone(); - - die = new Animation(12, false); - die.frames(frames, 8, 9, 10); - - play(idle); - } - - @Override - public void attack(int cell) { - if (!Level.adjacent(cell, ch.pos)) { - - ((MissileSprite) parent.recycle(MissileSprite.class)).reset(ch.pos, - cell, new EscapeKnive(), new Callback() { - @Override - public void call() { - ch.onAttackComplete(); - } - }); - - play(cast); - turnTo(ch.pos, cell); - - } else { - - super.attack(cell); - - } - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/BugDragonSprite.java b/java/com/hmdzl/spspd/change/sprites/BugDragonSprite.java deleted file mode 100644 index 457693e9..00000000 --- a/java/com/hmdzl/spspd/change/sprites/BugDragonSprite.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.DungeonTilemap; -import com.hmdzl.spspd.change.actors.mobs.Warlock; -import com.hmdzl.spspd.change.actors.mobs.pets.BugDragon; -import com.hmdzl.spspd.change.actors.mobs.pets.GoldDragon; -import com.hmdzl.spspd.change.effects.Beam; -import com.hmdzl.spspd.change.effects.Lightning; -import com.hmdzl.spspd.change.effects.MagicMissile; -import com.watabou.noosa.TextureFilm; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Callback; - -public class BugDragonSprite extends MobSprite { - - //Frames 1-4 are idle, 5-8 are moving, 9-12 are attack and the last are for death RBVG - - private int[] points = new int[2]; - - public BugDragonSprite() { - super(); - - texture(Assets.PETDRAGON); - - TextureFilm frames = new TextureFilm(texture, 16, 16); - - idle = new Animation(2, true); - idle.frames(frames, 112, 113, 114, 115); - - run = new Animation(8, true); - run.frames(frames, 116, 117, 118, 119); - - attack = new Animation(8, false); - attack.frames(frames, 120, 121, 122, 123); - - zap = attack.clone(); - - die = new Animation(8, false); - die.frames(frames, 124, 125, 126, 127); - - play(idle); - } - @Override - public void zap(int cell) { - - turnTo(ch.pos, cell); - play(zap); - - MagicMissile.force(parent, ch.pos, cell, new Callback() { - @Override - public void call() { - ((BugDragon) ch).onZapComplete(); - } - }); - Sample.INSTANCE.play(Assets.SND_ZAP); - } - - @Override - public int blood() { - return 0xFFcdcdb7; - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/sprites/BunnySprite.java b/java/com/hmdzl/spspd/change/sprites/BunnySprite.java deleted file mode 100644 index 65a59276..00000000 --- a/java/com/hmdzl/spspd/change/sprites/BunnySprite.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; - -import com.hmdzl.spspd.change.effects.Lightning; -import com.watabou.noosa.TextureFilm; - -public class BunnySprite extends MobSprite { - - //Frames 0,2 are idle, 0,1,2 are moving, 0,3,4,1 are attack and 5,6,7 are for death - - - public BunnySprite() { - super(); - - texture(Assets.BUNNY); - - TextureFilm frames = new TextureFilm(texture, 14, 16); - - idle = new Animation(2, true); - idle.frames(frames, 0, 1, 0, 0); - - run = new Animation(4, true); - run.frames(frames, 0, 0, 0, 2); - - attack = new Animation(8, false); - attack.frames(frames, 0, 2, 3, 4); - - zap = attack.clone(); - - die = new Animation(8, false); - die.frames(frames, 5, 6, 7, 8); - - play(idle); - } - - @Override - public int blood() { - return 0xFFcdcdb7; - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/BurningFistSprite.java b/java/com/hmdzl/spspd/change/sprites/BurningFistSprite.java deleted file mode 100644 index 74c6422d..00000000 --- a/java/com/hmdzl/spspd/change/sprites/BurningFistSprite.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.effects.MagicMissile; -import com.watabou.noosa.TextureFilm; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Callback; - -public class BurningFistSprite extends MobSprite { - - public BurningFistSprite() { - super(); - - texture(Assets.BURNING); - - TextureFilm frames = new TextureFilm(texture, 24, 17); - - idle = new Animation(2, true); - idle.frames(frames, 0, 0, 1); - - run = new Animation(3, true); - run.frames(frames, 0, 1); - - attack = new Animation(8, false); - attack.frames(frames, 0, 5, 6); - - die = new Animation(10, false); - die.frames(frames, 0, 2, 3, 4); - - play(idle); - } - - private int posToShoot; - - @Override - public void attack(int cell) { - posToShoot = cell; - super.attack(cell); - } - - @Override - public void onComplete(Animation anim) { - if (anim == attack) { - - Sample.INSTANCE.play(Assets.SND_ZAP); - MagicMissile.shadow(parent, ch.pos, posToShoot, new Callback() { - @Override - public void call() { - ch.onAttackComplete(); - } - }); - - idle(); - - } else { - super.onComplete(anim); - } - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/CellmobSprite.java b/java/com/hmdzl/spspd/change/sprites/CellmobSprite.java deleted file mode 100644 index 373fde32..00000000 --- a/java/com/hmdzl/spspd/change/sprites/CellmobSprite.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.DungeonTilemap; -import com.hmdzl.spspd.change.effects.DeathRay; -import com.watabou.noosa.TextureFilm; - -public class CellmobSprite extends MobSprite { - - private int attackPos; - - public CellmobSprite() { - super(); - - texture(Assets.CELL_MOB); - - TextureFilm frames = new TextureFilm(texture, 16, 18); - - idle = new Animation(2, true); - idle.frames(frames, 1, 2, 3, 4); - - run = new Animation(12, true); - run.frames(frames, 2, 3, 4); - - attack = new Animation(8, false); - attack.frames(frames, 1, 5); - - die = new Animation(8, false); - die.frames(frames, 1, 0, 6); - - play(idle); - } - - @Override - public void attack(int pos) { - attackPos = pos; - super.attack(pos); - } - - - @Override - public void onComplete(Animation anim) { - super.onComplete(anim); - - if (anim == attack) { - if (Dungeon.visible[ch.pos] || Dungeon.visible[attackPos]) { - parent.add(new DeathRay(center(), DungeonTilemap - .tileCenterToWorld(attackPos))); - } - } - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/sprites/CharSprite.java b/java/com/hmdzl/spspd/change/sprites/CharSprite.java deleted file mode 100644 index 5266925c..00000000 --- a/java/com/hmdzl/spspd/change/sprites/CharSprite.java +++ /dev/null @@ -1,603 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * Shattered Pixel Dungeon - * Copyright (C) 2014-2015 Evan Debenham - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.DungeonTilemap; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.effects.DarkBlock; -import com.hmdzl.spspd.change.effects.EmoIcon; -import com.hmdzl.spspd.change.effects.FloatingText; -import com.hmdzl.spspd.change.effects.IceBlock; -import com.hmdzl.spspd.change.effects.ShieldHalo; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.effects.Splash; -import com.hmdzl.spspd.change.effects.TorchHalo; -import com.hmdzl.spspd.change.effects.particles.FlameParticle; -import com.hmdzl.spspd.change.effects.particles.LeafParticle; -import com.hmdzl.spspd.change.effects.particles.ShadowParticle; -import com.hmdzl.spspd.change.effects.particles.SnowParticle; -import com.hmdzl.spspd.change.items.potions.PotionOfInvisibility; -import com.hmdzl.spspd.change.scenes.PixelScene; -import com.hmdzl.spspd.change.ui.CharHealthIndicator; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.watabou.noosa.Camera; -import com.watabou.noosa.Game; -import com.watabou.noosa.MovieClip; -import com.watabou.noosa.Visual; -import com.watabou.noosa.audio.Sample; -import com.watabou.noosa.particles.Emitter; -import com.watabou.noosa.tweeners.AlphaTweener; -import com.watabou.noosa.tweeners.PosTweener; -import com.watabou.noosa.tweeners.Tweener; -import com.watabou.utils.Callback; -import com.watabou.utils.PointF; -import com.watabou.utils.Random; - -public class CharSprite extends MovieClip implements Tweener.Listener, MovieClip.Listener { - - // Color constants for floating text - public static final int DEFAULT = 0xFFFFFF; - public static final int POSITIVE = 0x00FF00; - public static final int NEGATIVE = 0xFF0000; - public static final int WARNING = 0xFF8800; - public static final int NEUTRAL = 0xFFFF00; - - private static final float MOVE_INTERVAL = 0.1f; - private static final float FLASH_INTERVAL = 0.05f; - - public enum State { - BURNING, LEVITATING, INVISIBLE, PARALYSED, FROZEN, ILLUMINATED, CHILLED, DARKENED, MARKED, REGROW, HEALING, SHIELDED, - } - - protected Animation idle; - protected Animation run; - protected Animation attack; - protected Animation operate; - protected Animation zap; - protected Animation die; - - protected Callback animCallback; - - protected Tweener motion; - - protected Emitter burning; - protected Emitter chilled; - protected Emitter marked; - protected Emitter levitation; - protected Emitter regrow; - protected Emitter healing; - - protected IceBlock iceBlock; - protected DarkBlock darkBlock; - protected TorchHalo halo; - protected ShieldHalo shield; - protected AlphaTweener invisible; - - protected EmoIcon emo; - protected CharHealthIndicator health; - - private Tweener jumpTweener; - private Callback jumpCallback; - - //private float flashTime = 0; - protected float flashTime = 0; - - protected boolean sleeping = false; - - public Char ch; - - public volatile boolean isMoving = false; - - public CharSprite() { - super(); - listener = this; - } - - public void link( Char ch ) { - this.ch = ch; - ch.sprite = this; - - place( ch.pos ); - turnTo( ch.pos, Random.Int( Level.LENGTH ) ); - - if (ch != Dungeon.hero) { - if (health == null) { - health = new CharHealthIndicator(ch); - } else { - health.target(ch); - } - } - - ch.updateSpriteState(); - } - - public PointF worldToCamera( int cell ) { - - final int csize = DungeonTilemap.SIZE; - - return new PointF( - ((cell % Level.WIDTH) + 0.5f) * csize - width * 0.5f, - ((cell / Level.WIDTH) + 1.0f) * csize - height - ); - } - - public void place( int cell ) { - point( worldToCamera( cell ) ); - } - - public void showStatus( int color, String text, Object... args ) { - if (visible) { - if (args.length > 0) { - text = Messages.format( text, args ); - } - if (ch != null) { - PointF tile = DungeonTilemap.tileCenterToWorld(ch.pos); - FloatingText.show( tile.x, tile.y-(width*0.5f), ch.pos, text, color ); - } else { - FloatingText.show( x + width * 0.5f, y, text, color ); - } - } - } - - public void idle() { - play( idle ); - } - - public void move( int from, int to ) { - turnTo( from , to ); - - play( run ); - - motion = new PosTweener( this, worldToCamera( to ), MOVE_INTERVAL ); - motion.listener = this; - parent.add( motion ); - - isMoving = true; - - if (visible && Level.water[from] && !ch.flying) { - GameScene.ripple( from ); - } - - } - - public void interruptMotion() { - if (motion != null) { - onComplete( motion ); - } - } - - public void attack( int cell ) { - turnTo( ch.pos, cell ); - play( attack ); - } - - public void attack( int cell, Callback callback ) { - animCallback = callback; - turnTo( ch.pos, cell ); - play( attack ); - } - - public void operate( int cell ) { - turnTo( ch.pos, cell ); - play( operate ); - } - - public void zap( int cell ) { - turnTo( ch.pos, cell ); - play( zap ); - } - - public void zap( int cell, Callback callback ) { - animCallback = callback; - zap( cell ); - } - - public void turnTo( int from, int to ) { - int fx = from % Level.WIDTH; - int tx = to % Level.WIDTH; - if (tx > fx) { - flipHorizontal = false; - } else if (tx < fx) { - flipHorizontal = true; - } - } - - public void jump( int from, int to, Callback callback ) { - jumpCallback = callback; - - int distance = Level.distance( from, to ); - jumpTweener = new JumpTweener( this, worldToCamera( to ), distance * 4, distance * 0.1f ); - jumpTweener.listener = this; - parent.add( jumpTweener ); - - turnTo( from, to ); - } - - public void die() { - sleeping = false; - play( die ); - - if (emo != null) { - emo.killAndErase(); - } - if (health != null){ - health.killAndErase(); - } - } - - public Emitter emitter() { - Emitter emitter = GameScene.emitter(); - emitter.pos( this ); - return emitter; - } - - public Emitter centerEmitter() { - Emitter emitter = GameScene.emitter(); - emitter.pos( center() ); - return emitter; - } - - public Emitter bottomEmitter() { - Emitter emitter = GameScene.emitter(); - emitter.pos( x, y + height, width, 0 ); - return emitter; - } - - public void burst( final int color, int n ) { - if (visible) { - Splash.at( center(), color, n ); - } - } - - public void bloodBurstA( PointF from, int damage ) { - if (visible) { - PointF c = center(); - int n = (int)Math.min( 9 * Math.sqrt( (double)damage / ch.HT ), 9 ); - Splash.at( c, PointF.angle( from, c ), 3.1415926f / 2, blood(), n ); - } - } - - public int blood() { - return 0xFFBB0000; - } - - public void flash() { - ra = ba = ga = 1f; - flashTime = FLASH_INTERVAL; - } - - public void add( State state ) { - switch (state) { - case BURNING: - burning = emitter(); - burning.pour( FlameParticle.FACTORY, 0.06f ); - if (visible) { - Sample.INSTANCE.play( Assets.SND_BURNING ); - } - break; - case LEVITATING: - levitation = emitter(); - levitation.pour( Speck.factory( Speck.JET ), 0.02f ); - break; - case INVISIBLE: - PotionOfInvisibility.melt( ch ); - break; - case PARALYSED: - paused = true; - break; - case FROZEN: - iceBlock = IceBlock.freeze( this ); - paused = true; - break; - case ILLUMINATED: - GameScene.effect( halo = new TorchHalo( this ) ); - break; - case CHILLED: - chilled = emitter(); - chilled.pour(SnowParticle.FACTORY, 0.1f); - break; - case DARKENED: - darkBlock = DarkBlock.darken( this ); - break; - case MARKED: - marked = emitter(); - marked.pour(ShadowParticle.UP, 0.1f); - break; - - case REGROW: - regrow = emitter(); - regrow.pour( LeafParticle.LEVEL_SPECIFIC, 0.06f ); - break; - case HEALING: - healing = emitter(); - healing.pour(Speck.factory(Speck.HEALING), 0.5f); - break; - case SHIELDED: - GameScene.effect( shield = new ShieldHalo( this )); - break; - } - } - - public void remove( State state ) { - switch (state) { - case BURNING: - if (burning != null) { - burning.on = false; - burning = null; - } - break; - case LEVITATING: - if (levitation != null) { - levitation.on = false; - levitation = null; - } - break; - case INVISIBLE: - alpha( 1f ); - break; - case PARALYSED: - paused = false; - break; - case FROZEN: - if (iceBlock != null) { - iceBlock.melt(); - iceBlock = null; - } - paused = false; - break; - case ILLUMINATED: - if (halo != null) { - halo.putOut(); - } - break; - case CHILLED: - if (chilled != null){ - chilled.on = false; - chilled = null; - } - break; - case DARKENED: - if (darkBlock != null) { - darkBlock.lighten(); - darkBlock = null; - } - break; - case MARKED: - if (marked != null){ - marked.on = false; - marked = null; - } - break; - case REGROW: - if (regrow != null) { - regrow.on = false; - regrow = null; - } - break; - case HEALING: - if (healing != null){ - healing.on = false; - healing = null; - } - break; - case SHIELDED: - if (shield != null){ - shield.putOut(); - } - break; - } - } - - @Override - public void update() { - - super.update(); - - if (paused && listener != null) { - listener.onComplete( curAnim ); - } - - if (flashTime > 0 && (flashTime -= Game.elapsed) <= 0) { - resetColor(); - } - - if (burning != null) { - burning.visible = visible; - } - if (levitation != null) { - levitation.visible = visible; - } - if (iceBlock != null) { - iceBlock.visible = visible; - } - if (chilled != null) { - chilled.visible = visible; - } - if (marked != null) { - marked.visible = visible; - } - if (sleeping) { - showSleep(); - } else { - hideSleep(); - } - if (emo != null) { - emo.visible = visible; - } - if (regrow != null) { - regrow.visible = visible; - } - - } - - @Override - public void resetColor() { - super.resetColor(); - if (invisible != null){ - alpha(0.4f); - } - } - - public synchronized void showSleep() { - if (emo instanceof EmoIcon.Sleep) { - - } else { - if (emo != null) { - emo.killAndErase(); - } - emo = new EmoIcon.Sleep( this ); - } - idle(); - } - - public synchronized void hideSleep() { - if (emo instanceof EmoIcon.Sleep) { - emo.killAndErase(); - emo = null; - } - } - - public synchronized void showAlert() { - if (emo instanceof EmoIcon.Alert) { - - } else { - if (emo != null) { - emo.killAndErase(); - } - emo = new EmoIcon.Alert( this ); - emo.visible = visible; - } - } - - public synchronized void hideAlert() { - if (emo instanceof EmoIcon.Alert) { - emo.killAndErase(); - emo = null; - } - } - - public synchronized void showLost() { - if (emo instanceof EmoIcon.Lost) { - - } else { - if (emo != null) { - emo.killAndErase(); - } - emo = new EmoIcon.Lost( this ); - emo.visible = visible; - } - } - - public synchronized void hideLost() { - if (emo instanceof EmoIcon.Lost) { - emo.killAndErase(); - emo = null; - } - } - - @Override - public void kill() { - super.kill(); - - if (emo != null) { - emo.killAndErase(); - emo = null; - } - - if (health != null){ - health.killAndErase(); - } - - } - - @Override - public void onComplete( Tweener tweener ) { - if (tweener == jumpTweener) { - - if (visible && Level.water[ch.pos] && !ch.flying) { - GameScene.ripple( ch.pos ); - } - if (jumpCallback != null) { - jumpCallback.call(); - } - - } else if (tweener == motion) { - - isMoving = false; - - motion.killAndErase(); - motion = null; - ch.onMotionComplete(); - } - } - - @Override - public void onComplete( Animation anim ) { - - if (animCallback != null) { - animCallback.call(); - animCallback = null; - } else { - - if (anim == attack) { - - idle(); - ch.onAttackComplete(); - - } else if (anim == operate) { - - idle(); - ch.onOperateComplete(); - - } - - } - } - - private static class JumpTweener extends Tweener { - - public Visual visual; - - public PointF start; - public PointF end; - - public float height; - - public JumpTweener( Visual visual, PointF pos, float height, float time ) { - super( visual, time ); - - this.visual = visual; - start = visual.point(); - end = pos; - - this.height = height; - } - - @Override - protected void updateValues( float progress ) { - visual.point( PointF.inter( start, end, progress ).offset( 0, -height * 4 * progress * (1 - progress) ) ); - } - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/CoconutSprite.java b/java/com/hmdzl/spspd/change/sprites/CoconutSprite.java deleted file mode 100644 index 9f7e7ed8..00000000 --- a/java/com/hmdzl/spspd/change/sprites/CoconutSprite.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.levels.Level; -import com.watabou.noosa.TextureFilm; -import com.watabou.noosa.audio.Sample; -import com.hmdzl.spspd.change.items.weapon.missiles.NormalBomb; -import com.watabou.noosa.particles.Emitter; -import com.watabou.utils.Callback; - -public class CoconutSprite extends MobSprite { - private Animation cast; - - public CoconutSprite() { - super(); - - texture( Assets.COCONUT ); - - TextureFilm frames = new TextureFilm( texture, 16, 16 ); - - idle = new Animation( 3, true ); - idle.frames(frames, 0, 0, 1, 1, 2, 2, 3, 3, 3, 3, 3, 3); - - run = new Animation( 20, true ); - run.frames( frames, 0 ); - - attack = new Animation( 12, false ); - attack.frames( frames, 0, 2, 3 ); - - die = new Animation( 20, false ); - die.frames( frames, 3,4,5,6 ); - - play( idle ); - } - - @Override - public void attack(int cell) { - if (!Level.adjacent(cell, ch.pos)) { - - ((MissileSprite) parent.recycle(MissileSprite.class)).reset(ch.pos, - cell, new NormalBomb(), new Callback() { - @Override - public void call() { - ch.onAttackComplete(); - } - }); - - play(cast); - turnTo(ch.pos, cell); - - } else { - - super.attack(cell); - - } - } - -} diff --git a/java/com/hmdzl/spspd/change/sprites/ConsideredHamsterSprite.java b/java/com/hmdzl/spspd/change/sprites/ConsideredHamsterSprite.java deleted file mode 100644 index 00c3f2df..00000000 --- a/java/com/hmdzl/spspd/change/sprites/ConsideredHamsterSprite.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.levels.Level; -import com.watabou.noosa.TextureFilm; -import com.watabou.noosa.audio.Sample; -import com.watabou.noosa.particles.Emitter; - -public class ConsideredHamsterSprite extends MobSprite { - - public ConsideredHamsterSprite() { - super(); - - texture( Assets.CONSIDEREDHAMSTER ); - - TextureFilm frames = new TextureFilm( texture, 16, 14 ); - - idle = new Animation( 15, true ); - idle.frames(frames, 0, 0, 0, 0, 0, 0, 0, 1, 2, 2, 2, 3); - - run = new Animation( 20, true ); - run.frames( frames, 0 ); - - attack = new Animation( 12, false ); - attack.frames( frames, 0, 2, 3 ); - - die = new Animation( 20, false ); - die.frames( frames, 0 ); - - play( idle ); - } - - -} diff --git a/java/com/hmdzl/spspd/change/sprites/CrabKingSprite.java b/java/com/hmdzl/spspd/change/sprites/CrabKingSprite.java deleted file mode 100644 index 1706cfb5..00000000 --- a/java/com/hmdzl/spspd/change/sprites/CrabKingSprite.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.items.weapon.missiles.Wave; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.watabou.noosa.TextureFilm; -import com.watabou.utils.Callback; - -public class CrabKingSprite extends MobSprite { - - private static final float DURATION = 2f; - private Animation cast; - - public CrabKingSprite() { - super(); - - texture(Assets.CRABKING); - - TextureFilm frames = new TextureFilm(texture, 16, 16); - - idle = new Animation(2, true); - idle.frames(frames, 0, 1, 2, 3, 10, 11, 12); - - run = new Animation(15, false); - run.frames(frames, 4, 5, 6, 10, 11, 12); - - attack = new Animation(15, false); - attack.frames(frames, 7, 8, 9); - - cast = attack.clone(); - - die = new Animation(8, false); - die.frames(frames, 8, 9, 10, 10, 10, 10, 10, 10); - - play(run.clone()); - } - - @Override - public void move(int from, int to) { - - place(to); - - play(run); - turnTo(from, to); - - isMoving = true; - - if (Level.water[to]) { - GameScene.ripple(to); - } - - ch.onMotionComplete(); - } - - @Override - public void attack(int cell) { - if (!Level.adjacent(cell, ch.pos)) { - //Char enemy = Actor.findChar(cell); - ((MissileSprite) parent.recycle(MissileSprite.class)).reset(ch.pos, - cell, new Wave(), new Callback() { - @Override - public void call() { - ch.onAttackComplete(); - } - }); - - - play(cast); - turnTo(ch.pos, cell); - - } else { - - super.attack(cell); - - } - } - - @Override - public void onComplete(Animation anim) { - if (anim == run) { - isMoving = false; - idle(); - } else { - super.onComplete(anim); - } - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/CrabSprite.java b/java/com/hmdzl/spspd/change/sprites/CrabSprite.java deleted file mode 100644 index eb365d1c..00000000 --- a/java/com/hmdzl/spspd/change/sprites/CrabSprite.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.watabou.noosa.TextureFilm; - -public class CrabSprite extends MobSprite { - - public CrabSprite() { - super(); - - texture(Assets.CRAB); - - TextureFilm frames = new TextureFilm(texture, 16, 16); - - idle = new Animation(5, true); - idle.frames(frames, 0, 1, 0, 2); - - run = new Animation(15, true); - run.frames(frames, 3, 4, 5, 6); - - attack = new Animation(12, false); - attack.frames(frames, 7, 8, 9); - - die = new Animation(12, false); - die.frames(frames, 10, 11, 12, 13); - - play(idle); - } - - @Override - public int blood() { - return 0xFFFFEA80; - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/DM300Sprite.java b/java/com/hmdzl/spspd/change/sprites/DM300Sprite.java deleted file mode 100644 index 2660d9b0..00000000 --- a/java/com/hmdzl/spspd/change/sprites/DM300Sprite.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.actors.mobs.DM300; -import com.hmdzl.spspd.change.effects.Lightning; -import com.hmdzl.spspd.change.effects.Speck; -import com.watabou.noosa.TextureFilm; - -public class DM300Sprite extends MobSprite { - - public DM300Sprite() { - super(); - - texture(Assets.DM300); - - TextureFilm frames = new TextureFilm(texture, 22, 20); - - idle = new Animation(10, true); - idle.frames(frames, 0, 1); - - run = new Animation(10, true); - run.frames(frames, 2, 3); - - attack = new Animation(15, false); - attack.frames(frames, 4, 5, 6); - - die = new Animation(20, false); - die.frames(frames, 0, 7, 0, 7, 0, 7, 0, 7, 0, 7, 0, 7, 8); - - play(idle); - } - - @Override - public void onComplete(Animation anim) { - - super.onComplete(anim); - - if (anim == die) { - emitter().burst(Speck.factory(Speck.WOOL), 15); - } - } - - @Override - public int blood() { - return 0xFFFFFF88; - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/DachhackSprite.java b/java/com/hmdzl/spspd/change/sprites/DachhackSprite.java deleted file mode 100644 index ed7c4e93..00000000 --- a/java/com/hmdzl/spspd/change/sprites/DachhackSprite.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.levels.Level; -import com.watabou.noosa.TextureFilm; -import com.watabou.noosa.audio.Sample; -import com.watabou.noosa.particles.Emitter; - -public class DachhackSprite extends MobSprite { - - public DachhackSprite() { - super(); - - texture( Assets.DACHHACK ); - - TextureFilm frames = new TextureFilm( texture, 16, 16 ); - - idle = new Animation( 3, true ); - idle.frames(frames, 0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3); - - run = new Animation( 20, true ); - run.frames( frames, 0 ); - - attack = new Animation( 12, false ); - attack.frames( frames, 0, 2, 3 ); - - die = new Animation( 20, false ); - die.frames( frames, 0 ); - - play( idle ); - } - - -} diff --git a/java/com/hmdzl/spspd/change/sprites/DemonGooSprite.java b/java/com/hmdzl/spspd/change/sprites/DemonGooSprite.java deleted file mode 100644 index 6813cee8..00000000 --- a/java/com/hmdzl/spspd/change/sprites/DemonGooSprite.java +++ /dev/null @@ -1,127 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.watabou.noosa.TextureFilm; -import com.watabou.noosa.particles.Emitter; -import com.watabou.noosa.particles.Emitter.Factory; -import com.watabou.noosa.particles.PixelParticle; -import com.watabou.utils.PointF; -import com.watabou.utils.Random; - -public class DemonGooSprite extends MobSprite { - - private Animation pump; - private Animation pumpAttack; - - public DemonGooSprite() { - super(); - - texture(Assets.DEMONGOO); - - TextureFilm frames = new TextureFilm(texture, 20, 14); - - idle = new Animation(10, true); - idle.frames(frames, 2, 1, 0, 0, 1); - - run = new Animation(15, true); - run.frames(frames, 3, 2, 1, 2); - - pump = new Animation(20, true); - pump.frames(frames, 4, 3, 2, 1, 0); - - pumpAttack = new Animation(20, false); - pumpAttack.frames(frames, 4, 3, 2, 1, 0, 7); - - attack = new Animation(10, false); - attack.frames(frames, 8, 9, 10); - - die = new Animation(10, false); - die.frames(frames, 5, 6, 7); - - play(idle); - } - - public void pumpUp() { - play(pump); - } - - public void pumpAttack() { - play(pumpAttack); - } - - @Override - public void play(Animation anim, boolean force) { - super.play(anim, force); - } - - @Override - public int blood() { - return 0xFF000000; - } - - public static class GooParticle extends PixelParticle.Shrinking { - - public static final Emitter.Factory FACTORY = new Factory() { - @Override - public void emit(Emitter emitter, int index, float x, float y) { - ((GooParticle) emitter.recycle(GooParticle.class)).reset(x, y); - } - }; - - public GooParticle() { - super(); - - color(0x000000); - lifespan = 0.3f; - - acc.set(0, +50); - } - - public void reset(float x, float y) { - revive(); - - this.x = x; - this.y = y; - - left = lifespan; - - size = 4; - speed.polar(-Random.Float(PointF.PI), Random.Float(32, 48)); - } - - @Override - public void update() { - super.update(); - float p = left / lifespan; - am = p > 0.5f ? (1 - p) * 2f : 1; - } - } - - @Override - public void onComplete(Animation anim) { - super.onComplete(anim); - - if (anim == pumpAttack) { - - idle(); - ch.onAttackComplete(); - } - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/DemonflowerSprite.java b/java/com/hmdzl/spspd/change/sprites/DemonflowerSprite.java deleted file mode 100644 index c170ca83..00000000 --- a/java/com/hmdzl/spspd/change/sprites/DemonflowerSprite.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.levels.Level; -import com.watabou.noosa.TextureFilm; -import com.watabou.utils.Callback; - -public class DemonflowerSprite extends MobSprite { - - public DemonflowerSprite() { - super(); - - texture(Assets.DEMONFLOWER); - - TextureFilm frames = new TextureFilm(texture, 16, 16); - - idle = new Animation(2, true); - idle.frames(frames, 0, 0, 0, 1, 0, 0, 0, 1); - - run = new Animation(12, true); - run.frames(frames, 4, 5); - - attack = new Animation(12, false); - attack.frames(frames, 2, 3, 0); - - die = new Animation(12, false); - die.frames(frames, 0, 6, 7); - - play(idle); - } - - } diff --git a/java/com/hmdzl/spspd/change/sprites/DewProtectorSprite.java b/java/com/hmdzl/spspd/change/sprites/DewProtectorSprite.java deleted file mode 100644 index 6e384685..00000000 --- a/java/com/hmdzl/spspd/change/sprites/DewProtectorSprite.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.actors.mobs.FlyingProtector; -import com.hmdzl.spspd.change.effects.Lightning; -import com.watabou.noosa.TextureFilm; - -public class DewProtectorSprite extends MobSprite { - - private int[] points = new int[2]; - - public DewProtectorSprite() { - super(); - - texture(Assets.DEWPROTECTOR); - - TextureFilm frames = new TextureFilm(texture, 12, 15); - - idle = new Animation(2, true); - idle.frames(frames, 0, 0, 0, 0, 0, 1, 1); - - run = new Animation(15, true); - run.frames(frames, 2, 3, 4, 5, 6, 7); - - attack = new Animation(12, false); - attack.frames(frames, 8, 9, 10); - - zap = attack.clone(); - - die = new Animation(5, false); - die.frames(frames, 11, 12, 13, 14, 15, 15); - - play(idle); - } - - @Override - public void zap(int pos) { - - parent.add( new Lightning( ch.pos, pos, (FlyingProtector) ch)); - - turnTo(ch.pos, pos); - play(zap); - } - - @Override - public int blood() { - return 0xFFcdcdb7; - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/DiscardedItemSprite.java b/java/com/hmdzl/spspd/change/sprites/DiscardedItemSprite.java deleted file mode 100644 index 709ecc6c..00000000 --- a/java/com/hmdzl/spspd/change/sprites/DiscardedItemSprite.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.watabou.noosa.Game; - -public class DiscardedItemSprite extends ItemSprite { - - public DiscardedItemSprite() { - - super(); - - originToCenter(); - angularSpeed = 720; - } - - @Override - public void drop() { - scale.set(1); - am = 1; - } - - @Override - public void update() { - - super.update(); - - scale.set(scale.x * 0.9f); - if ((am -= Game.elapsed) <= 0) { - remove(); - } - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/DragonkingSprite.java b/java/com/hmdzl/spspd/change/sprites/DragonkingSprite.java deleted file mode 100644 index d2412bf4..00000000 --- a/java/com/hmdzl/spspd/change/sprites/DragonkingSprite.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.watabou.noosa.TextureFilm; - -public class DragonkingSprite extends MobSprite { - - public DragonkingSprite() { - super(); - - texture(Assets.DRAGONKING); - - TextureFilm frames = new TextureFilm(texture, 16, 16); - - idle = new Animation(1, true); - idle.frames(frames, 0, 0, 0, 1, 1, 1); - - run = new Animation(1, true); - run.frames(frames, 0, 0, 0, 1, 1, 1); - - attack = new Animation(10, false); - attack.frames(frames, 0, 3, 4, 5); - - die = new Animation(10, false); - die.frames(frames, 0, 6, 7, 8, 9); - - play(idle); - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/sprites/DreamPlayerSprite.java b/java/com/hmdzl/spspd/change/sprites/DreamPlayerSprite.java deleted file mode 100644 index 2ecc457a..00000000 --- a/java/com/hmdzl/spspd/change/sprites/DreamPlayerSprite.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.levels.Level; -import com.watabou.noosa.Game; -import com.watabou.noosa.TextureFilm; -import com.watabou.noosa.audio.Sample; -import com.watabou.noosa.particles.Emitter; - -public class DreamPlayerSprite extends MobSprite { - - public DreamPlayerSprite() { - super(); - - texture( Assets.DREAMPLAYER ); - - TextureFilm frames = new TextureFilm( texture, 16, 16 ); - - idle = new Animation( 15, true ); - idle.frames(frames, 0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3); - - run = new Animation( 20, true ); - run.frames( frames, 0,1,2,3 ); - - attack = new Animation( 12, false ); - attack.frames( frames, 0, 2, 3 ); - - die = new Animation( 20, false ); - die.frames( frames, 0 ); - - play( idle ); - } - @Override - public void update() { - super.update(); - - if (flashTime <= 0){ - float interval = (Game.timeTotal % 9 ) /3f; - tint(interval > 2 ? interval - 2 : Math.max(0, 1 - interval), - interval > 1 ? Math.max(0, 2-interval): interval, - interval > 2 ? Math.max(0, 3-interval): interval-1, 0.5f); - } - } - -} diff --git a/java/com/hmdzl/spspd/change/sprites/DustElementSprite.java b/java/com/hmdzl/spspd/change/sprites/DustElementSprite.java deleted file mode 100644 index 0780a87d..00000000 --- a/java/com/hmdzl/spspd/change/sprites/DustElementSprite.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.actors.Char; -import com.watabou.noosa.TextureFilm; - - -public class DustElementSprite extends MobSprite { - - public DustElementSprite() { - super(); - - texture(Assets.ELEMENTAL); - - TextureFilm frames = new TextureFilm(texture, 12, 14); - - idle = new Animation(10, true); - idle.frames(frames, 42, 43, 44); - - run = new Animation(12, true); - run.frames(frames, 42, 43, 45); - - attack = new Animation(15, false); - attack.frames(frames, 46, 47, 48); - - zap = attack.clone(); - - die = new Animation(15, false); - die.frames(frames, 49, 50, 51, 52, 53, 54, 55, 54); - - play(idle); - } - - - @Override - public int blood() { - return 0x999999; - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/DwarfKingTombSprite.java b/java/com/hmdzl/spspd/change/sprites/DwarfKingTombSprite.java deleted file mode 100644 index bbd02b2c..00000000 --- a/java/com/hmdzl/spspd/change/sprites/DwarfKingTombSprite.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.watabou.noosa.TextureFilm; - -public class DwarfKingTombSprite extends MobSprite { - - - public DwarfKingTombSprite() { - super(); - - texture(Assets.DWARFKINGTOMB); - TextureFilm frames = new TextureFilm(texture, 16, 16); - - idle = new Animation(10, true); - idle.frames(frames, 0, 0, 0, 0, 0, 0, 0, 0, 0); - - run = idle.clone(); - die = idle.clone(); - attack = idle.clone(); - - idle(); - } - -} diff --git a/java/com/hmdzl/spspd/change/sprites/DwarfLichSprite.java b/java/com/hmdzl/spspd/change/sprites/DwarfLichSprite.java deleted file mode 100644 index db6d5e45..00000000 --- a/java/com/hmdzl/spspd/change/sprites/DwarfLichSprite.java +++ /dev/null @@ -1,120 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.ResultDescriptions; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Paralysis; -import com.hmdzl.spspd.change.actors.mobs.RedWraith; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.levels.Level; - -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.noosa.Camera; -import com.watabou.noosa.TextureFilm; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Random; - -public class DwarfLichSprite extends MobSprite { - - public DwarfLichSprite() { - super(); - - texture(Assets.DWARFLICH); - - TextureFilm frames = new TextureFilm(texture, 12, 16); - - idle = new Animation(12, true); - idle.frames(frames, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3); - - run = new Animation(15, true); - run.frames(frames, 4, 5, 6, 7, 8, 9); - - attack = new Animation(15, false); - attack.frames(frames, 14, 15, 16); - - die = new Animation(12, false); - die.frames(frames, 10, 11, 12, 13); - - play(idle); - } - - @Override - public int blood() { - return 0xFF44FF22; - } - - public void boneExplode(int cell) { - for (int n : Level.NEIGHBOURS9) { - int c = cell + n; - if (c >= 0 && c < Level.getLength()) { - if (Dungeon.visible[c] && Level.passable[c]) { - Sample.INSTANCE.play(Assets.SND_BONES); - CellEmitter.center(c).start(Speck.factory(Speck.RATTLE), 0.1f, 3); - } - - Char ch = Actor.findChar(c); - if (ch != null && ch==Dungeon.hero) { - // those not at the center of the blast take damage less - // consistently. - int minDamage = c == cell ? Dungeon.depth + 5 : 1; - int maxDamage = 10 + Dungeon.depth * 2; - - - int dmg = Random.NormalIntRange(minDamage, maxDamage) - Math.max(ch.drRoll(),0); - - - if (dmg > 0) { - ch.damage(dmg, this); - if(Random.Int(15)==1){Buff.prolong(ch, Paralysis.class, 1);} - } - - - if (ch == Dungeon.hero && !ch.isAlive()){ - Dungeon.fail(Messages.format(ResultDescriptions.MOB)); - } - } - } - } - - } - - @Override - public void attack(int cell) { - if (!Level.adjacent(cell, ch.pos)) { - - turnTo(ch.pos, cell); - boneExplode(cell); - play(attack); - - } else { - - super.attack(cell); - - } - } - - - - -} diff --git a/java/com/hmdzl/spspd/change/sprites/ElderAvatarSprite.java b/java/com/hmdzl/spspd/change/sprites/ElderAvatarSprite.java deleted file mode 100644 index 47c18884..00000000 --- a/java/com/hmdzl/spspd/change/sprites/ElderAvatarSprite.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.food.staplefood.NormalRation; -import com.hmdzl.spspd.change.items.weapon.guns.GunWeapon; -import com.hmdzl.spspd.change.items.weapon.missiles.EscapeKnive; -import com.hmdzl.spspd.change.items.weapon.missiles.PoisonDart; -import com.hmdzl.spspd.change.items.weapon.missiles.ShatteredAmmo; -import com.hmdzl.spspd.change.levels.Level; -import com.watabou.noosa.TextureFilm; -import com.watabou.noosa.audio.Sample; -import com.watabou.noosa.particles.Emitter; -import com.watabou.utils.Callback; - -public class ElderAvatarSprite extends MobSprite { - - private Animation cast; - public ElderAvatarSprite() { - super(); - - texture( Assets.ELDER_AVATAR ); - - TextureFilm frames = new TextureFilm( texture, 16, 16 ); - - idle = new Animation( 3, true ); - idle.frames(frames, 0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3); - - run = new Animation( 20, true ); - run.frames( frames, 0 ); - - attack = new Animation( 12, false ); - attack.frames( frames, 0, 2, 3 ); - - cast = attack.clone(); - - die = new Animation( 20, false ); - die.frames( frames, 0 ); - - play( idle ); - } - - @Override - public void attack(int cell) { - if (!Level.adjacent(cell, ch.pos)) { - - ((MissileSprite) parent.recycle(MissileSprite.class)).reset(ch.pos, - cell, new PoisonDart(), new Callback() { - @Override - public void call() { - ch.onAttackComplete(); - } - }); - - play(cast); - turnTo(ch.pos, cell); - - } else { - - super.attack(cell); - - } - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/ElectricwelderSprite.java b/java/com/hmdzl/spspd/change/sprites/ElectricwelderSprite.java deleted file mode 100644 index 9ca00684..00000000 --- a/java/com/hmdzl/spspd/change/sprites/ElectricwelderSprite.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.levels.Level; -import com.watabou.noosa.TextureFilm; -import com.watabou.noosa.audio.Sample; -import com.watabou.noosa.particles.Emitter; - -public class ElectricwelderSprite extends MobSprite { - - private Emitter emitter; - - public ElectricwelderSprite() { - super(); - - texture(Assets.TROLL); - - TextureFilm frames = new TextureFilm(texture, 13, 16); - - idle = new Animation(15, true); - idle.frames(frames, 4, 4, 4, 4, 4, 4, 4, 5, 6, 6, 6, 7); - - run = new Animation(20, true); - run.frames(frames, 4); - - die = new Animation(20, false); - die.frames(frames, 4); - - play(idle); - } - - /*@Override - public void link(Char ch) { - super.link(ch); - - emitter = new Emitter(); - emitter.autoKill = false; - emitter.pos(x + 7, y + 12); - parent.add(emitter); - }*/ - - /*@Override - public void update() { - super.update(); - - if (emitter != null) { - emitter.visible = visible; - } - }*/ - -/* @Override - public void onComplete(Animation anim) { - super.onComplete(anim); - - if (visible && emitter != null && anim == idle) { - //emitter.burst(Speck.factory(Speck.FORGE), 3); - emitter.burst(Speck.factory(Speck.STEAM), 3); - //float volume = 0.2f / (Level.distance(ch.pos, Dungeon.hero.pos)); - //Sample.INSTANCE.play(Assets.SND_EVOKE, volume, volume, 0.8f); - } - }*/ - -} diff --git a/java/com/hmdzl/spspd/change/sprites/ErrorSprite.java b/java/com/hmdzl/spspd/change/sprites/ErrorSprite.java deleted file mode 100644 index a97fbc13..00000000 --- a/java/com/hmdzl/spspd/change/sprites/ErrorSprite.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.levels.Level; -import com.watabou.noosa.TextureFilm; -import com.watabou.noosa.audio.Sample; -import com.watabou.noosa.particles.Emitter; - -public class ErrorSprite extends MobSprite { - - public ErrorSprite() { - super(); - - texture( Assets.ERROR ); - - TextureFilm frames = new TextureFilm( texture, 16, 16 ); - - idle = new Animation( 3, true ); - idle.frames(frames, 0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3); - - run = new Animation( 20, true ); - run.frames( frames, 0 ); - - attack = new Animation( 12, false ); - attack.frames( frames, 0, 2, 3 ); - - die = new Animation( 20, false ); - die.frames( frames, 0 ); - - play( idle ); - } - - -} diff --git a/java/com/hmdzl/spspd/change/sprites/ExMobileSprite.java b/java/com/hmdzl/spspd/change/sprites/ExMobileSprite.java deleted file mode 100644 index 3b72a013..00000000 --- a/java/com/hmdzl/spspd/change/sprites/ExMobileSprite.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.weapon.missiles.EscapeKnive; -import com.hmdzl.spspd.change.levels.Level; -import com.watabou.noosa.TextureFilm; -import com.watabou.noosa.audio.Sample; -import com.watabou.noosa.particles.Emitter; -import com.watabou.utils.Callback; - -public class ExMobileSprite extends MobSprite { - - private Animation cast; - - public ExMobileSprite() { - super(); - - texture( Assets.MOBILE ); - - TextureFilm frames = new TextureFilm( texture, 16, 16 ); - - idle = new Animation( 3, true ); - idle.frames(frames, 4, 4, 4, 5, 5, 5, 6, 6, 6, 7, 7, 7); - - run = new Animation( 20, true ); - run.frames( frames, 4 ); - - attack = new Animation( 12, false ); - attack.frames( frames, 4, 6, 7 ); - - cast = attack.clone(); - - die = new Animation( 20, false ); - die.frames( frames, 4 ); - - play( idle ); - } - @Override - public void attack(int cell) { - if (!Level.adjacent(cell, ch.pos)) { - - ((MissileSprite) parent.recycle(MissileSprite.class)).reset(ch.pos, - cell, new EscapeKnive(), new Callback() { - @Override - public void call() { - ch.onAttackComplete(); - } - }); - - play(cast); - turnTo(ch.pos, cell); - - } else { - - super.attack(cell); - - } - } - -} diff --git a/java/com/hmdzl/spspd/change/sprites/EyeSprite.java b/java/com/hmdzl/spspd/change/sprites/EyeSprite.java deleted file mode 100644 index 100267ea..00000000 --- a/java/com/hmdzl/spspd/change/sprites/EyeSprite.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.DungeonTilemap; -import com.hmdzl.spspd.change.effects.DeathRay; -import com.watabou.noosa.TextureFilm; - -public class EyeSprite extends MobSprite { - - private int attackPos; - - public EyeSprite() { - super(); - - texture(Assets.EYE); - - TextureFilm frames = new TextureFilm(texture, 16, 18); - - idle = new Animation(8, true); - idle.frames(frames, 0, 1, 2); - - run = new Animation(12, true); - run.frames(frames, 5, 6); - - attack = new Animation(8, false); - attack.frames(frames, 4, 3); - - die = new Animation(8, false); - die.frames(frames, 7, 8, 9); - - play(idle); - } - - @Override - public void attack(int pos) { - attackPos = pos; - super.attack(pos); - } - - @Override - public void onComplete(Animation anim) { - super.onComplete(anim); - - if (anim == attack) { - if (Dungeon.visible[ch.pos] || Dungeon.visible[attackPos]) { - parent.add(new DeathRay(center(), DungeonTilemap - .tileCenterToWorld(attackPos))); - } - } - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/FairySprite.java b/java/com/hmdzl/spspd/change/sprites/FairySprite.java deleted file mode 100644 index b749fd19..00000000 --- a/java/com/hmdzl/spspd/change/sprites/FairySprite.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; - -import com.hmdzl.spspd.change.effects.Lightning; -import com.hmdzl.spspd.change.items.summon.FairyCard; -import com.watabou.noosa.TextureFilm; - -public class FairySprite extends MobSprite { - - //Frames 0,2 are idle, 0,1,2 are moving, 0,3,4,1 are attack and 5,6,7 are for death - - private int[] points = new int[2]; - - public FairySprite() { - super(); - - texture(Assets.FAIRY); - - TextureFilm frames = new TextureFilm(texture, 15, 15); - - idle = new Animation(2, true); - idle.frames(frames, 0, 2, 3, 0); - - run = new Animation(8, true); - run.frames(frames, 0, 1, 2, 0); - - attack = new Animation(8, false); - attack.frames(frames, 0, 3, 4, 1); - - die = new Animation(8, false); - die.frames(frames, 5, 6, 7, 7); - - play(idle); - } - - - @Override - public int blood() { - return 0xFFcdcdb7; - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/FetidRatSprite.java b/java/com/hmdzl/spspd/change/sprites/FetidRatSprite.java deleted file mode 100644 index 835c27e0..00000000 --- a/java/com/hmdzl/spspd/change/sprites/FetidRatSprite.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.effects.Speck; -import com.watabou.noosa.TextureFilm; -import com.watabou.noosa.particles.Emitter; - -public class FetidRatSprite extends MobSprite { - - private Emitter cloud; - - public FetidRatSprite() { - super(); - - texture(Assets.RAT); - - TextureFilm frames = new TextureFilm(texture, 16, 15); - - idle = new Animation(2, true); - idle.frames(frames, 32, 32, 32, 33); - - run = new Animation(10, true); - run.frames(frames, 38, 39, 40, 41, 42); - - attack = new Animation(15, false); - attack.frames(frames, 34, 35, 36, 37, 32); - - die = new Animation(10, false); - die.frames(frames, 43, 44, 45, 46); - - play(idle); - } - - @Override - public void link(Char ch) { - super.link(ch); - - if (cloud == null) { - cloud = emitter(); - cloud.pour(Speck.factory(Speck.STENCH), 0.7f); - } - } - - @Override - public void update() { - - super.update(); - - if (cloud != null) { - cloud.visible = visible; - } - } - - @Override - public void die() { - super.die(); - - if (cloud != null) { - cloud.on = false; - } - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/FiendSprite.java b/java/com/hmdzl/spspd/change/sprites/FiendSprite.java deleted file mode 100644 index 7293fc17..00000000 --- a/java/com/hmdzl/spspd/change/sprites/FiendSprite.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.actors.mobs.Fiend; -import com.hmdzl.spspd.change.effects.MagicMissile; -import com.watabou.noosa.TextureFilm; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Callback; - -public class FiendSprite extends MobSprite { - - public FiendSprite() { - super(); - - texture(Assets.SPECTRALRAT); - - TextureFilm frames = new TextureFilm( texture, 16, 16 ); - - idle = new Animation( 5, true ); - idle.frames(frames, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 4, 10, 11, 10, 4, 1, 1 ); - - run = new Animation( 5, true ); - run.frames( frames, 0, 1, 2, 3 ); - - attack = new Animation( 15, false ); - attack.frames( frames, 10, 11, 12, 13, 14, 15 ); - - zap = attack.clone(); - - die = new Animation( 10, false ); - die.frames( frames, 16, 17, 18, 19, 19, 19 ); - - play( idle ); - } - - @Override - public void zap(int cell) { - - turnTo(ch.pos, cell); - play(zap); - - MagicMissile.shadow(parent, ch.pos, cell, new Callback() { - @Override - public void call() { - ((Fiend) ch).onZapComplete(); - } - }); - Sample.INSTANCE.play(Assets.SND_ZAP); - } - - @Override - public void onComplete(Animation anim) { - if (anim == zap) { - idle(); - } - super.onComplete(anim); - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/FireElementalSprite.java b/java/com/hmdzl/spspd/change/sprites/FireElementalSprite.java deleted file mode 100644 index ae1b5f9d..00000000 --- a/java/com/hmdzl/spspd/change/sprites/FireElementalSprite.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.actors.Char; -import com.watabou.noosa.TextureFilm; - - -public class FireElementalSprite extends MobSprite { - - public FireElementalSprite() { - super(); - - texture(Assets.ELEMENTAL); - - TextureFilm frames = new TextureFilm(texture, 12, 14); - - idle = new Animation(10, true); - idle.frames(frames, 0, 1, 2); - - run = new Animation(12, true); - run.frames(frames, 0, 1, 3); - - attack = new Animation(15, false); - attack.frames(frames, 4, 5, 6); - - zap = attack.clone(); - - die = new Animation(15, false); - die.frames(frames, 7, 8, 9, 10, 11, 12, 13, 12); - - play(idle); - } - - @Override - public void link(Char ch) { - super.link(ch); - add(State.BURNING); - } - - @Override - public void die() { - super.die(); - remove(State.BURNING); - } - - @Override - public int blood() { - return 0xFFFF7D13; - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/FishProtectorSprite.java b/java/com/hmdzl/spspd/change/sprites/FishProtectorSprite.java deleted file mode 100644 index b5d0f906..00000000 --- a/java/com/hmdzl/spspd/change/sprites/FishProtectorSprite.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.actors.mobs.FishProtector; -import com.hmdzl.spspd.change.effects.Lightning; -import com.watabou.noosa.TextureFilm; - -public class FishProtectorSprite extends MobSprite { - - private int[] points = new int[2]; - - public FishProtectorSprite() { - super(); - - texture(Assets.DEWPROTECTOR); - - TextureFilm frames = new TextureFilm(texture, 12, 15); - - idle = new Animation(2, true); - idle.frames(frames, 0, 0, 0, 0, 0, 1, 1); - - run = new Animation(15, true); - run.frames(frames, 2, 3, 4, 5, 6, 7); - - attack = new Animation(12, false); - attack.frames(frames, 8, 9, 10); - - zap = attack.clone(); - - die = new Animation(5, false); - die.frames(frames, 11, 12, 13, 14, 15, 15); - - play(idle); - } - - @Override - public void zap(int pos) { - - parent.add( new Lightning( ch.pos, pos, (FishProtector) ch)); - - turnTo(ch.pos, pos); - play(zap); - } - - @Override - public int blood() { - return 0xFFcdcdb7; - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/FlySprite.java b/java/com/hmdzl/spspd/change/sprites/FlySprite.java deleted file mode 100644 index 8123881a..00000000 --- a/java/com/hmdzl/spspd/change/sprites/FlySprite.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * Shattered Pixel Dungeon - * Copyright (C) 2014-2015 Evan Debenham - * - * Goblins Pixel Dungeon - * Copyright (C) 2016 Mario Braun - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.watabou.noosa.TextureFilm; -import com.hmdzl.spspd.change.Assets; - -public class FlySprite extends MobSprite { - - public FlySprite() { - super(); - - texture( Assets.SWARM ); - - TextureFilm frames = new TextureFilm( texture, 16, 16 ); - - idle = new Animation( 15, true ); - idle.frames( frames, 16, 17, 18, 19, 20, 21 ); - - run = new Animation( 15, true ); - run.frames( frames, 16, 17, 18, 19, 20, 21 ); - - attack = new Animation( 20, false ); - attack.frames( frames, 22, 23, 24, 25 ); - - die = new Animation( 15, false ); - die.frames( frames, 26, 27, 28, 29, 30 ); - - play( idle ); - } - - @Override - public int blood() { - return 0xFF8BA077; - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/FlyingProtectorSprite.java b/java/com/hmdzl/spspd/change/sprites/FlyingProtectorSprite.java deleted file mode 100644 index 6868870c..00000000 --- a/java/com/hmdzl/spspd/change/sprites/FlyingProtectorSprite.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.actors.mobs.FlyingProtector; -import com.hmdzl.spspd.change.effects.Lightning; -import com.watabou.noosa.TextureFilm; - -public class FlyingProtectorSprite extends MobSprite { - - private int[] points = new int[2]; - - public FlyingProtectorSprite() { - super(); - - texture(Assets.FLYINGPROTECTOR); - - TextureFilm frames = new TextureFilm(texture, 12, 15); - - idle = new Animation(2, true); - idle.frames(frames, 0, 0, 0, 0, 0, 1, 1); - - run = new Animation(15, true); - run.frames(frames, 2, 3, 4, 5, 6, 7); - - attack = new Animation(12, false); - attack.frames(frames, 8, 9, 10); - - zap = attack.clone(); - - die = new Animation(5, false); - die.frames(frames, 11, 12, 13, 14, 15, 15); - - play(idle); - } - - @Override - public void zap(int pos) { - - parent.add( new Lightning( ch.pos, pos,(FlyingProtector) ch)); - - turnTo(ch.pos, pos); - play(zap); - } - - @Override - public int blood() { - return 0xFFcdcdb7; - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/ForestProtectorSprite.java b/java/com/hmdzl/spspd/change/sprites/ForestProtectorSprite.java deleted file mode 100644 index a5203bfe..00000000 --- a/java/com/hmdzl/spspd/change/sprites/ForestProtectorSprite.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.actors.mobs.ForestProtector; -import com.hmdzl.spspd.change.effects.Lightning; -import com.watabou.noosa.TextureFilm; - -public class ForestProtectorSprite extends MobSprite { - - private int[] points = new int[2]; - - public ForestProtectorSprite() { - super(); - - texture(Assets.DEWPROTECTOR); - - TextureFilm frames = new TextureFilm(texture, 12, 15); - - idle = new Animation(2, true); - idle.frames(frames, 0, 0, 0, 0, 0, 1, 1); - - run = new Animation(15, true); - run.frames(frames, 2, 3, 4, 5, 6, 7); - - attack = new Animation(12, false); - attack.frames(frames, 8, 9, 10); - - zap = attack.clone(); - - die = new Animation(5, false); - die.frames(frames, 11, 12, 13, 14, 15, 15); - - play(idle); - } - - @Override - public void zap(int pos) { - - parent.add( new Lightning( ch.pos, pos, (ForestProtector) ch)); - - turnTo(ch.pos, pos); - play(zap); - } - - @Override - public int blood() { - return 0xFFcdcdb7; - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/FruitCatSprite.java b/java/com/hmdzl/spspd/change/sprites/FruitCatSprite.java deleted file mode 100644 index a439cff6..00000000 --- a/java/com/hmdzl/spspd/change/sprites/FruitCatSprite.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.levels.Level; -import com.watabou.noosa.TextureFilm; -import com.watabou.noosa.audio.Sample; -import com.watabou.noosa.particles.Emitter; - -public class FruitCatSprite extends MobSprite { - - public FruitCatSprite() { - super(); - - texture( Assets.FRUITCAT ); - - TextureFilm frames = new TextureFilm( texture, 16, 16 ); - - idle = new Animation( 3, true ); - idle.frames(frames, 0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3); - - run = new Animation( 20, true ); - run.frames( frames, 0 ); - - attack = new Animation( 12, false ); - attack.frames( frames, 0, 2, 3 ); - - die = new Animation( 20, false ); - die.frames( frames, 0 ); - - play( idle ); - } - - -} diff --git a/java/com/hmdzl/spspd/change/sprites/GentleCrabSprite.java b/java/com/hmdzl/spspd/change/sprites/GentleCrabSprite.java deleted file mode 100644 index 0ae56fab..00000000 --- a/java/com/hmdzl/spspd/change/sprites/GentleCrabSprite.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.watabou.noosa.TextureFilm; - -public class GentleCrabSprite extends MobSprite { - - public GentleCrabSprite() { - super(); - - texture(Assets.GENTLECRAB); - - TextureFilm frames = new TextureFilm(texture, 16, 16); - - idle = new Animation(5, true); - idle.frames(frames, 0, 1, 0, 2); - - run = new Animation(15, true); - run.frames(frames, 3, 4, 5, 6); - - attack = new Animation(12, false); - attack.frames(frames, 7, 8, 9); - - die = new Animation(12, false); - die.frames(frames, 10, 11, 12, 13); - - play(idle); - } - - @Override - public int blood() { - return 0xFFFFEA80; - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/GhostSprite.java b/java/com/hmdzl/spspd/change/sprites/GhostSprite.java deleted file mode 100644 index 0c1393c3..00000000 --- a/java/com/hmdzl/spspd/change/sprites/GhostSprite.java +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import javax.microedition.khronos.opengles.GL10; - -import android.opengl.GLES20; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.ShatteredPixelDungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.effects.particles.ShaftParticle; -import com.hmdzl.spspd.change.items.artifacts.DriedRose; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.ui.HealthBar; -import com.watabou.noosa.TextureFilm; - -public class GhostSprite extends MobSprite { - - public GhostSprite() { - super(); - - texture(Assets.GHOST); - - TextureFilm frames = new TextureFilm(texture, 14, 15); - - idle = new Animation(5, true); - idle.frames(frames, 0, 1); - - run = new Animation(10, true); - run.frames(frames, 0, 1); - - attack = new Animation(10, false); - attack.frames(frames, 0, 2, 3); - - die = new Animation(8, false); - die.frames(frames, 0, 4, 5, 6, 7); - - play(idle); - } - - /*@Override - public void link(Char ch) { - super.link(ch); - if (ch instanceof DriedRose.GhostHero){ - final Char finalCH = ch; - hpBar = new HealthBar(){ - @Override - public synchronized void update() { - super.update(); - hpBar.setRect(finalCH.sprite.x, finalCH.sprite.y-3, finalCH.sprite.width, hpBar.height()); - hpBar.level( finalCH ); - visible = finalCH.sprite.visible; - } - }; - ((GameScene) ShatteredPixelDungeon.scene()).ghostHP.add(hpBar); - } - }*/ - - @Override - public void draw() { - GLES20.glBlendFunc(GL10.GL_SRC_ALPHA, GL10.GL_ONE); - super.draw(); - GLES20.glBlendFunc(GL10.GL_SRC_ALPHA, GL10.GL_ONE_MINUS_SRC_ALPHA); - } - - @Override - public void die() { - super.die(); - emitter().start(ShaftParticle.FACTORY, 0.3f, 4); - emitter().start(Speck.factory(Speck.LIGHT), 0.2f, 3); - } - - @Override - public int blood() { - return 0xFFFFFF; - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/GnollArcherSprite.java b/java/com/hmdzl/spspd/change/sprites/GnollArcherSprite.java deleted file mode 100644 index 70f8c81a..00000000 --- a/java/com/hmdzl/spspd/change/sprites/GnollArcherSprite.java +++ /dev/null @@ -1,61 +0,0 @@ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.items.weapon.missiles.EscapeKnive; -import com.hmdzl.spspd.change.levels.Level; -import com.watabou.noosa.TextureFilm; -import com.watabou.utils.Callback; - -/** - * Created by Evan on 09/10/2014. - */ -public class GnollArcherSprite extends MobSprite { - - private Animation cast; - - public GnollArcherSprite() { - super(); - - texture(Assets.GNOLLARCHER); - - TextureFilm frames = new TextureFilm(texture, 12, 15); - - idle = new Animation(2, true); - idle.frames(frames, 0, 0, 0, 1, 0, 0, 1, 1); - - run = new Animation(12, true); - run.frames(frames, 4, 5, 6, 7); - - attack = new Animation(12, false); - attack.frames(frames, 2, 3, 0); - - cast = attack.clone(); - - die = new Animation(12, false); - die.frames(frames, 8, 9, 10); - - play(idle); - } - - @Override - public void attack(int cell) { - if (!Level.adjacent(cell, ch.pos)) { - - ((MissileSprite) parent.recycle(MissileSprite.class)).reset(ch.pos, - cell, new EscapeKnive(), new Callback() { - @Override - public void call() { - ch.onAttackComplete(); - } - }); - - play(cast); - turnTo(ch.pos, cell); - - } else { - - super.attack(cell); - - } - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/GnollKeeperSprite.java b/java/com/hmdzl/spspd/change/sprites/GnollKeeperSprite.java deleted file mode 100644 index 3cd525ef..00000000 --- a/java/com/hmdzl/spspd/change/sprites/GnollKeeperSprite.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.items.weapon.missiles.EscapeKnive; -import com.hmdzl.spspd.change.levels.Level; -import com.watabou.noosa.TextureFilm; -import com.watabou.utils.Callback; - -public class GnollKeeperSprite extends MobSprite { - - private Animation cast; - - public GnollKeeperSprite() { - super(); - - texture(Assets.GNOLLKING); - - TextureFilm frames = new TextureFilm(texture, 12, 16); - - idle = new Animation(2, true); - idle.frames(frames, 21, 21, 21, 22, 21, 21, 22, 22); - - run = new Animation(12, true); - run.frames(frames, 25, 26, 27, 28); - - attack = new Animation(12, false); - attack.frames(frames, 23, 24); - - cast = attack.clone(); - - die = new Animation(12, false); - die.frames(frames, 29, 30, 31); - - play(idle); - } - @Override - public void attack(int cell) { - if (!Level.adjacent(cell, ch.pos)) { - - ((MissileSprite) parent.recycle(MissileSprite.class)).reset(ch.pos, - cell, new EscapeKnive(), new Callback() { - @Override - public void call() { - ch.onAttackComplete(); - } - }); - - play(cast); - turnTo(ch.pos, cell); - - } else { - - super.attack(cell); - - } - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/GnollKingSprite.java b/java/com/hmdzl/spspd/change/sprites/GnollKingSprite.java deleted file mode 100644 index 359f8552..00000000 --- a/java/com/hmdzl/spspd/change/sprites/GnollKingSprite.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.items.weapon.missiles.EscapeKnive; -import com.hmdzl.spspd.change.levels.Level; -import com.watabou.noosa.TextureFilm; -import com.watabou.utils.Callback; - -public class GnollKingSprite extends MobSprite { - - private Animation cast; - - public GnollKingSprite() { - super(); - - texture(Assets.GNOLLKING); - - TextureFilm frames = new TextureFilm(texture, 12, 16); - - idle = new Animation(2, true); - idle.frames(frames, 0, 0, 0, 1, 0, 0, 1, 1); - - run = new Animation(12, true); - run.frames(frames, 4, 5, 6, 7); - - attack = new Animation(12, false); - attack.frames(frames, 2, 3, 0); - - cast = attack.clone(); - - die = new Animation(12, false); - die.frames(frames, 8, 9, 10); - - play(idle); - } - - @Override - public void attack(int cell) { - if (!Level.adjacent(cell, ch.pos)) { - - ((MissileSprite) parent.recycle(MissileSprite.class)).reset(ch.pos, - cell, new EscapeKnive(), new Callback() { - @Override - public void call() { - ch.onAttackComplete(); - } - }); - - play(cast); - turnTo(ch.pos, cell); - - } else { - - super.attack(cell); - - } - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/GnollSprite.java b/java/com/hmdzl/spspd/change/sprites/GnollSprite.java deleted file mode 100644 index 38aa7b90..00000000 --- a/java/com/hmdzl/spspd/change/sprites/GnollSprite.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.items.weapon.missiles.EscapeKnive; -import com.hmdzl.spspd.change.levels.Level; -import com.watabou.noosa.TextureFilm; -import com.watabou.utils.Callback; - -public class GnollSprite extends MobSprite { - - private Animation cast; - - public GnollSprite() { - super(); - - texture(Assets.GNOLL); - - TextureFilm frames = new TextureFilm(texture, 12, 15); - - idle = new Animation(2, true); - idle.frames(frames, 0, 0, 0, 1, 0, 0, 1, 1); - - run = new Animation(12, true); - run.frames(frames, 4, 5, 6, 7); - - attack = new Animation(12, false); - attack.frames(frames, 2, 3, 0); - - cast = attack.clone(); - - die = new Animation(12, false); - die.frames(frames, 8, 9, 10); - - play(idle); - } - - @Override - public void attack(int cell) { - if (!Level.adjacent(cell, ch.pos)) { - - ((MissileSprite) parent.recycle(MissileSprite.class)).reset(ch.pos, - cell, new EscapeKnive(), new Callback() { - @Override - public void call() { - ch.onAttackComplete(); - } - }); - - play(cast); - turnTo(ch.pos, cell); - - } else { - - super.attack(cell); - - } - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/GnollTricksterSprite.java b/java/com/hmdzl/spspd/change/sprites/GnollTricksterSprite.java deleted file mode 100644 index 2bf2a93a..00000000 --- a/java/com/hmdzl/spspd/change/sprites/GnollTricksterSprite.java +++ /dev/null @@ -1,62 +0,0 @@ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.items.weapon.missiles.PoisonDart; -import com.hmdzl.spspd.change.levels.Level; -import com.watabou.noosa.MovieClip; -import com.watabou.noosa.TextureFilm; -import com.watabou.utils.Callback; - -/** - * Created by Evan on 09/10/2014. - */ -public class GnollTricksterSprite extends MobSprite { - - private Animation cast; - - public GnollTricksterSprite() { - super(); - - texture(Assets.GNOLL); - - TextureFilm frames = new TextureFilm(texture, 12, 15); - - idle = new MovieClip.Animation(2, true); - idle.frames(frames, 21, 21, 21, 22, 21, 21, 22, 22); - - run = new MovieClip.Animation(12, true); - run.frames(frames, 25, 26, 27, 28); - - attack = new MovieClip.Animation(12, false); - attack.frames(frames, 23, 24, 21); - - cast = attack.clone(); - - die = new MovieClip.Animation(12, false); - die.frames(frames, 29, 30, 31); - - play(idle); - } - - @Override - public void attack(int cell) { - if (!Level.adjacent(cell, ch.pos)) { - - ((MissileSprite) parent.recycle(MissileSprite.class)).reset(ch.pos, - cell, new PoisonDart(), new Callback() { - @Override - public void call() { - ch.onAttackComplete(); - } - }); - - play(cast); - turnTo(ch.pos, cell); - - } else { - - super.attack(cell); - - } - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/GoblinPlayerSprite.java b/java/com/hmdzl/spspd/change/sprites/GoblinPlayerSprite.java deleted file mode 100644 index 1d96975f..00000000 --- a/java/com/hmdzl/spspd/change/sprites/GoblinPlayerSprite.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.levels.Level; -import com.watabou.noosa.TextureFilm; -import com.watabou.noosa.audio.Sample; -import com.watabou.noosa.particles.Emitter; - -public class GoblinPlayerSprite extends MobSprite { - - public GoblinPlayerSprite() { - super(); - - texture( Assets.GOBLIN_PLAYER ); - - TextureFilm frames = new TextureFilm( texture, 16, 16 ); - - idle = new Animation( 3, true ); - idle.frames(frames, 0, 0, 1, 1, 2, 2, 3, 3, 3, 3, 3, 3); - - run = new Animation( 3, true ); - run.frames( frames, 0, 0, 1, 1, 2, 2, 3, 3, 3, 3, 3, 3 ); - - attack = new Animation( 12, false ); - attack.frames( frames, 0, 2, 3 ); - - die = new Animation( 20, false ); - die.frames( frames, 0 ); - - play( idle ); - } - - -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/sprites/GoldDragonSprite.java b/java/com/hmdzl/spspd/change/sprites/GoldDragonSprite.java deleted file mode 100644 index 5db05795..00000000 --- a/java/com/hmdzl/spspd/change/sprites/GoldDragonSprite.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.DungeonTilemap; -import com.hmdzl.spspd.change.actors.mobs.Warlock; -import com.hmdzl.spspd.change.actors.mobs.pets.GoldDragon; -import com.hmdzl.spspd.change.effects.Beam; -import com.hmdzl.spspd.change.effects.Lightning; -import com.hmdzl.spspd.change.effects.MagicMissile; -import com.watabou.noosa.TextureFilm; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Callback; - -public class GoldDragonSprite extends MobSprite { - - //Frames 1-4 are idle, 5-8 are moving, 9-12 are attack and the last are for death RBVG - - private int[] points = new int[2]; - - public GoldDragonSprite() { - super(); - - texture(Assets.PETDRAGON); - - TextureFilm frames = new TextureFilm(texture, 16, 16); - - idle = new Animation(2, true); - idle.frames(frames, 80, 81, 82, 83); - - run = new Animation(8, true); - run.frames(frames, 84, 85, 86, 87); - - attack = new Animation(8, false); - attack.frames(frames, 88, 89, 90, 91); - - zap = attack.clone(); - - die = new Animation(8, false); - die.frames(frames, 92, 93, 94, 95); - - play(idle); - } - @Override - public void zap(int cell) { - - turnTo(ch.pos, cell); - play(zap); - - MagicMissile.force(parent, ch.pos, cell, new Callback() { - @Override - public void call() { - ((GoldDragon) ch).onZapComplete(); - } - }); - Sample.INSTANCE.play(Assets.SND_ZAP); - } - - @Override - public int blood() { - return 0xFFcdcdb7; - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/GoldOrcSprite.java b/java/com/hmdzl/spspd/change/sprites/GoldOrcSprite.java deleted file mode 100644 index d81735ee..00000000 --- a/java/com/hmdzl/spspd/change/sprites/GoldOrcSprite.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.effects.Speck; -import com.watabou.noosa.TextureFilm; - -public class GoldOrcSprite extends MobSprite { - - public GoldOrcSprite() { - super(); - - texture(Assets.GREYONI); - - TextureFilm frames = new TextureFilm(texture, 12, 16); - - idle = new Animation(12, true); - idle.frames(frames, 0, 0, 0, 0, 0, 0, 1, 1 ); - - run = new Animation(15, true); - run.frames(frames, 0, 2, 3, 4, 5 ); - - attack = new Animation(15, false); - attack.frames(frames, 0, 5, 6); - - die = new Animation(12, false); - die.frames(frames, 7, 8, 9, 10, 10, 11, 12, 13, 14, 15, 16, 17); - - play(idle); - } - -} diff --git a/java/com/hmdzl/spspd/change/sprites/GoldThiefSprite.java b/java/com/hmdzl/spspd/change/sprites/GoldThiefSprite.java deleted file mode 100644 index 28c2e281..00000000 --- a/java/com/hmdzl/spspd/change/sprites/GoldThiefSprite.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.watabou.noosa.TextureFilm; - -public class GoldThiefSprite extends MobSprite { - - public GoldThiefSprite() { - super(); - - texture(Assets.GOLDTHIEF); - TextureFilm film = new TextureFilm(texture, 12, 13); - - idle = new Animation(1, true); - idle.frames(film, 0, 0, 0, 1, 0, 0, 0, 0, 1); - - run = new Animation(15, true); - run.frames(film, 0, 0, 2, 3, 3, 4); - - die = new Animation(10, false); - die.frames(film, 5, 6, 7, 8, 9); - - attack = new Animation(12, false); - attack.frames(film, 10, 11, 12, 0); - - idle(); - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/GolemSprite.java b/java/com/hmdzl/spspd/change/sprites/GolemSprite.java deleted file mode 100644 index c40fce94..00000000 --- a/java/com/hmdzl/spspd/change/sprites/GolemSprite.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.effects.particles.ElmoParticle; -import com.watabou.noosa.TextureFilm; - -public class GolemSprite extends MobSprite { - - public GolemSprite() { - super(); - - texture(Assets.GOLEM); - - TextureFilm frames = new TextureFilm(texture, 16, 16); - - idle = new Animation(4, true); - idle.frames(frames, 0, 1); - - run = new Animation(12, true); - run.frames(frames, 2, 3, 4, 5); - - attack = new Animation(10, false); - attack.frames(frames, 6, 7, 8); - - die = new Animation(15, false); - die.frames(frames, 9, 10, 11, 12, 13); - - play(idle); - } - - @Override - public int blood() { - return 0xFF80706c; - } - - @Override - public void onComplete(Animation anim) { - if (anim == die) { - emitter().burst(ElmoParticle.FACTORY, 4); - } - super.onComplete(anim); - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/GooSprite.java b/java/com/hmdzl/spspd/change/sprites/GooSprite.java deleted file mode 100644 index dee48a09..00000000 --- a/java/com/hmdzl/spspd/change/sprites/GooSprite.java +++ /dev/null @@ -1,127 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.watabou.noosa.TextureFilm; -import com.watabou.noosa.particles.Emitter; -import com.watabou.noosa.particles.Emitter.Factory; -import com.watabou.noosa.particles.PixelParticle; -import com.watabou.utils.PointF; -import com.watabou.utils.Random; - -public class GooSprite extends MobSprite { - - private Animation pump; - private Animation pumpAttack; - - public GooSprite() { - super(); - - texture(Assets.GOO); - - TextureFilm frames = new TextureFilm(texture, 20, 14); - - idle = new Animation(10, true); - idle.frames(frames, 2, 1, 0, 0, 1); - - run = new Animation(15, true); - run.frames(frames, 3, 2, 1, 2); - - pump = new Animation(20, true); - pump.frames(frames, 4, 3, 2, 1, 0); - - pumpAttack = new Animation(20, false); - pumpAttack.frames(frames, 4, 3, 2, 1, 0, 7); - - attack = new Animation(10, false); - attack.frames(frames, 8, 9, 10); - - die = new Animation(10, false); - die.frames(frames, 5, 6, 7); - - play(idle); - } - - public void pumpUp() { - play(pump); - } - - public void pumpAttack() { - play(pumpAttack); - } - - @Override - public void play(Animation anim, boolean force) { - super.play(anim, force); - } - - @Override - public int blood() { - return 0xFF000000; - } - - public static class GooParticle extends PixelParticle.Shrinking { - - public static final Emitter.Factory FACTORY = new Factory() { - @Override - public void emit(Emitter emitter, int index, float x, float y) { - ((GooParticle) emitter.recycle(GooParticle.class)).reset(x, y); - } - }; - - public GooParticle() { - super(); - - color(0x000000); - lifespan = 0.3f; - - acc.set(0, +50); - } - - public void reset(float x, float y) { - revive(); - - this.x = x; - this.y = y; - - left = lifespan; - - size = 4; - speed.polar(-Random.Float(PointF.PI), Random.Float(32, 48)); - } - - @Override - public void update() { - super.update(); - float p = left / lifespan; - am = p > 0.5f ? (1 - p) * 2f : 1; - } - } - - @Override - public void onComplete(Animation anim) { - super.onComplete(anim); - - if (anim == pumpAttack) { - - idle(); - ch.onAttackComplete(); - } - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/GraveProtectorSprite.java b/java/com/hmdzl/spspd/change/sprites/GraveProtectorSprite.java deleted file mode 100644 index b333b897..00000000 --- a/java/com/hmdzl/spspd/change/sprites/GraveProtectorSprite.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.actors.mobs.GraveProtector; -import com.hmdzl.spspd.change.effects.Lightning; -import com.watabou.noosa.TextureFilm; - -public class GraveProtectorSprite extends MobSprite { - - private int[] points = new int[2]; - - public GraveProtectorSprite() { - super(); - - texture(Assets.DEWPROTECTOR); - - TextureFilm frames = new TextureFilm(texture, 12, 15); - - idle = new Animation(2, true); - idle.frames(frames, 0, 0, 0, 0, 0, 1, 1); - - run = new Animation(15, true); - run.frames(frames, 2, 3, 4, 5, 6, 7); - - attack = new Animation(12, false); - attack.frames(frames, 8, 9, 10); - - zap = attack.clone(); - - die = new Animation(5, false); - die.frames(frames, 11, 12, 13, 14, 15, 15); - - play(idle); - } - - @Override - public void zap(int pos) { - parent.add( new Lightning( ch.pos, pos,(GraveProtector) ch)); - - turnTo(ch.pos, pos); - play(zap); - } - - @Override - public int blood() { - return 0xFFcdcdb7; - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/GreatCrabSprite.java b/java/com/hmdzl/spspd/change/sprites/GreatCrabSprite.java deleted file mode 100644 index 431f05d3..00000000 --- a/java/com/hmdzl/spspd/change/sprites/GreatCrabSprite.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.watabou.noosa.MovieClip; -import com.watabou.noosa.TextureFilm; - -/** - * Created by Evan on 09/10/2014. - */ -public class GreatCrabSprite extends MobSprite { - - public GreatCrabSprite() { - super(); - - texture(Assets.CRAB); - - TextureFilm frames = new TextureFilm(texture, 16, 16); - - idle = new MovieClip.Animation(5, true); - idle.frames(frames, 16, 17, 16, 18); - - run = new MovieClip.Animation(10, true); - run.frames(frames, 19, 20, 21, 22); - - attack = new MovieClip.Animation(12, false); - attack.frames(frames, 23, 24, 25); - - die = new MovieClip.Animation(12, false); - die.frames(frames, 26, 27, 28, 29); - - play(idle); - } - - @Override - public int blood() { - return 0xFFFFEA80; - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/GreenDragonSprite.java b/java/com/hmdzl/spspd/change/sprites/GreenDragonSprite.java deleted file mode 100644 index 9d37247c..00000000 --- a/java/com/hmdzl/spspd/change/sprites/GreenDragonSprite.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.actors.mobs.pets.GreenDragon; -import com.hmdzl.spspd.change.effects.Lightning; -import com.watabou.noosa.TextureFilm; - -public class GreenDragonSprite extends MobSprite { - - //Frames 1-4 are idle, 5-8 are moving, 9-12 are attack and the last are for death RBVG - - private int[] points = new int[2]; - - public GreenDragonSprite() { - super(); - - texture(Assets.PETDRAGON); - - TextureFilm frames = new TextureFilm(texture, 16, 16); - - idle = new Animation(2, true); - idle.frames(frames, 48, 49, 50, 51); - - run = new Animation(8, true); - run.frames(frames, 52, 53, 54, 55); - - attack = new Animation(8, false); - attack.frames(frames, 56, 57, 58, 59); - - zap = attack.clone(); - - die = new Animation(8, false); - die.frames(frames, 60, 61, 62, 63); - - play(idle); - } - - @Override - public void zap(int pos) { - - parent.add( new Lightning( ch.pos, pos, (GreenDragon) ch)); - - turnTo(ch.pos, pos); - play(zap); - } - - @Override - public int blood() { - return 0xFFcdcdb7; - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/GreyRatSprite.java b/java/com/hmdzl/spspd/change/sprites/GreyRatSprite.java deleted file mode 100644 index b1ccccde..00000000 --- a/java/com/hmdzl/spspd/change/sprites/GreyRatSprite.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.watabou.noosa.TextureFilm; - -public class GreyRatSprite extends MobSprite { - - public GreyRatSprite() { - super(); - - texture(Assets.RAT); - - TextureFilm frames = new TextureFilm(texture, 16, 15); - - idle = new Animation(2, true); - idle.frames(frames, 48, 48, 48, 49); - - run = new Animation(10, true); - run.frames(frames, 54, 55, 56, 57, 58); - - attack = new Animation(15, false); - attack.frames(frames, 50, 51, 52, 53); - - die = new Animation(10, false); - die.frames(frames, 59, 60, 61, 62); - - play(idle); - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/GuardSprite.java b/java/com/hmdzl/spspd/change/sprites/GuardSprite.java deleted file mode 100644 index fd2c8d47..00000000 --- a/java/com/hmdzl/spspd/change/sprites/GuardSprite.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.effects.Speck; -import com.watabou.noosa.TextureFilm; - -public class GuardSprite extends MobSprite { - - public GuardSprite() { - super(); - - texture(Assets.GUARD); - - TextureFilm frames = new TextureFilm( texture, 12, 16 ); - - idle = new Animation( 2, true ); - idle.frames( frames, 0, 0, 0, 1, 0, 0, 1, 1 ); - - run = new Animation( 15, true ); - run.frames( frames, 2, 3, 4, 5, 6, 7 ); - - attack = new Animation( 12, false ); - attack.frames( frames, 8, 9, 10 ); - - die = new Animation( 8, false ); - die.frames( frames, 11, 12, 13, 14 ); - - play( idle ); - } - - @Override - public void die() { - super.die(); - if (Dungeon.visible[ch.pos]) { - emitter().burst(Speck.factory(Speck.BONE), 6); - } - } - - @Override - public int blood() { - return 0xFFcccccc; - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/HBBSprite.java b/java/com/hmdzl/spspd/change/sprites/HBBSprite.java deleted file mode 100644 index 9d56d724..00000000 --- a/java/com/hmdzl/spspd/change/sprites/HBBSprite.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.levels.Level; -import com.watabou.noosa.TextureFilm; -import com.watabou.noosa.audio.Sample; -import com.watabou.noosa.particles.Emitter; - -public class HBBSprite extends MobSprite { - - public HBBSprite() { - super(); - - texture( Assets.HBB ); - - TextureFilm frames = new TextureFilm( texture, 16, 16 ); - - idle = new Animation( 3, true ); - idle.frames(frames, 0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3); - - run = new Animation( 20, true ); - run.frames( frames, 0 ); - - attack = new Animation( 12, false ); - attack.frames( frames, 0, 2, 3 ); - - die = new Animation( 20, false ); - die.frames( frames, 0 ); - - play( idle ); - } - - -} diff --git a/java/com/hmdzl/spspd/change/sprites/HateSokobanSprite.java b/java/com/hmdzl/spspd/change/sprites/HateSokobanSprite.java deleted file mode 100644 index aab45636..00000000 --- a/java/com/hmdzl/spspd/change/sprites/HateSokobanSprite.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.levels.Level; -import com.watabou.noosa.TextureFilm; -import com.watabou.noosa.audio.Sample; -import com.watabou.noosa.particles.Emitter; - -public class HateSokobanSprite extends MobSprite { - - public HateSokobanSprite() { - super(); - - texture( Assets.HS ); - - TextureFilm frames = new TextureFilm( texture, 16, 16 ); - - idle = new Animation( 3, true ); - idle.frames(frames, 0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3); - - run = new Animation( 20, true ); - run.frames( frames, 0 ); - - attack = new Animation( 12, false ); - attack.frames( frames, 0, 2, 3 ); - - die = new Animation( 20, false ); - die.frames( frames, 0 ); - - play( idle ); - } - - -} diff --git a/java/com/hmdzl/spspd/change/sprites/HeXASprite.java b/java/com/hmdzl/spspd/change/sprites/HeXASprite.java deleted file mode 100644 index 74cfbbb2..00000000 --- a/java/com/hmdzl/spspd/change/sprites/HeXASprite.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.levels.Level; -import com.watabou.noosa.TextureFilm; -import com.watabou.noosa.audio.Sample; -import com.watabou.noosa.particles.Emitter; - -public class HeXASprite extends MobSprite { - - public HeXASprite() { - super(); - - texture( Assets.HEXA ); - - TextureFilm frames = new TextureFilm( texture, 16, 16 ); - - idle = new Animation( 15, true ); - idle.frames(frames, 0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3); - - run = new Animation( 20, true ); - run.frames( frames, 0 ); - - attack = new Animation( 12, false ); - attack.frames( frames, 0, 2, 3 ); - - die = new Animation( 20, false ); - die.frames( frames, 0 ); - - play( idle ); - } - - -} diff --git a/java/com/hmdzl/spspd/change/sprites/HermitCrabSprite.java b/java/com/hmdzl/spspd/change/sprites/HermitCrabSprite.java deleted file mode 100644 index 196ef407..00000000 --- a/java/com/hmdzl/spspd/change/sprites/HermitCrabSprite.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.actors.mobs.HermitCrab; -import com.hmdzl.spspd.change.effects.Lightning; -import com.watabou.noosa.TextureFilm; - -public class HermitCrabSprite extends MobSprite { - - private int[] points = new int[2]; - - public HermitCrabSprite() { - super(); - - texture(Assets.HERMITCRAB); - - TextureFilm frames = new TextureFilm(texture, 16, 16); - - idle = new Animation(2, true); - idle.frames(frames, 0, 0, 0, 1, 0, 0, 1, 1); - - run = new Animation(12, true); - run.frames(frames, 2, 3, 4, 5, 6); - - attack = new Animation(12, false); - attack.frames(frames, 6, 7, 8, 9); - - zap = attack.clone(); - - die = new Animation(12, false); - die.frames(frames, 10, 11 ,12 ,13); - - play(idle); - } - - @Override - public void zap(int pos) { - - parent.add( new Lightning( ch.pos, pos,(HermitCrab) ch)); - - turnTo(ch.pos, pos); - play(zap); - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/HeroSprite.java b/java/com/hmdzl/spspd/change/sprites/HeroSprite.java deleted file mode 100644 index 658fe2f9..00000000 --- a/java/com/hmdzl/spspd/change/sprites/HeroSprite.java +++ /dev/null @@ -1,149 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import android.graphics.RectF; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.hero.HeroClass; -import com.watabou.gltextures.SmartTexture; -import com.watabou.gltextures.TextureCache; -import com.watabou.noosa.Camera; -import com.watabou.noosa.Image; -import com.watabou.noosa.TextureFilm; -import com.watabou.utils.Callback; - -public class HeroSprite extends CharSprite { - - private static final int FRAME_WIDTH = 12; - private static final int FRAME_HEIGHT = 15; - - private static final int RUN_FRAMERATE = 20; - - private static TextureFilm skins; - - private Animation fly; - private Animation read; - - public HeroSprite() { - super(); - - link(Dungeon.hero); - - texture(Dungeon.hero.heroClass.spritesheet()); - updateArmor(); - - idle(); - } - - public void updateArmor() { - - TextureFilm film = new TextureFilm(skins(), ((Hero) ch).useskin(), - FRAME_WIDTH, FRAME_HEIGHT); - - idle = new Animation(1, true); - idle.frames(film, 0, 0, 0, 1, 0, 0, 1, 1); - - run = new Animation(RUN_FRAMERATE, true); - run.frames(film, 2, 3, 4, 5, 6, 7); - - die = new Animation(20, false); - die.frames(film, 8, 9, 10, 11, 12, 11); - - attack = new Animation(15, false); - attack.frames(film, 13, 14, 15, 0); - - zap = attack.clone(); - - operate = new Animation(8, false); - operate.frames(film, 16, 17, 16, 17); - - fly = new Animation(1, true); - fly.frames(film, 18); - - read = new Animation( 8, false ); - read.frames(film, 16, 17, 16, 17); - } - - @Override - public void place(int p) { - super.place(p); - Camera.main.target = this; - } - - @Override - public void move(int from, int to) { - super.move(from, to); - if (ch.flying) { - play(fly); - } - Camera.main.target = this; - } - - @Override - public void jump(int from, int to, Callback callback) { - super.jump(from, to, callback); - play(fly); - } - - public void read() { - animCallback = new Callback() { - @Override - public void call() { - idle(); - ch.onOperateComplete(); - } - }; - play( read ); - } - - - @Override - public void update() { - sleeping = ((Hero) ch).restoreHealth; - - super.update(); - } - - public boolean sprint(boolean on) { - run.delay = on ? 0.667f / RUN_FRAMERATE : 1f / RUN_FRAMERATE; - return on; - } - - public static TextureFilm skins() { - if (skins == null) { - SmartTexture texture = TextureCache.get(Assets.ROGUE); - skins = new TextureFilm(texture, texture.width, FRAME_HEIGHT); - } - - return skins; - } - - public static Image avatar(HeroClass cl, int skin) { - - RectF patch = skins().get(skin); - Image avatar = new Image(cl.spritesheet()); - RectF frame = avatar.texture.uvRect(1, 0, FRAME_WIDTH, FRAME_HEIGHT); - frame.offset(patch.left, patch.top); - avatar.frame(frame); - - return avatar; - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/HoneyPooootSprite.java b/java/com/hmdzl/spspd/change/sprites/HoneyPooootSprite.java deleted file mode 100644 index 6b21dacd..00000000 --- a/java/com/hmdzl/spspd/change/sprites/HoneyPooootSprite.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.levels.Level; -import com.watabou.noosa.TextureFilm; -import com.watabou.noosa.audio.Sample; -import com.watabou.noosa.particles.Emitter; - -public class HoneyPooootSprite extends MobSprite { - - public HoneyPooootSprite() { - super(); - - texture( Assets.HONEY_POOOOT ); - - TextureFilm frames = new TextureFilm( texture, 16, 16 ); - - idle = new Animation( 3, true ); - idle.frames(frames, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1); - - run = new Animation( 3, true ); - run.frames( frames, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1 ); - - attack = new Animation( 12, false ); - attack.frames( frames, 0, 1, 1 ); - - die = new Animation( 20, false ); - die.frames( frames, 0 ); - - play( idle ); - } - - -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/sprites/HybridSprite.java b/java/com/hmdzl/spspd/change/sprites/HybridSprite.java deleted file mode 100644 index 36f567d6..00000000 --- a/java/com/hmdzl/spspd/change/sprites/HybridSprite.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.DungeonTilemap; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.effects.Beam; -import com.hmdzl.spspd.change.effects.DeathRay; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.levels.Level; -import com.watabou.noosa.TextureFilm; -import com.watabou.noosa.audio.Sample; -import com.watabou.noosa.particles.Emitter; - -public class HybridSprite extends MobSprite { - private int attackPos; - public HybridSprite() { - super(); - - texture( Assets.HYBRID ); - - TextureFilm frames = new TextureFilm( texture, 16, 16 ); - - idle = new Animation( 3, true ); - idle.frames(frames, 0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3); - - run = new Animation( 20, true ); - run.frames( frames, 0 ); - - attack = new Animation( 12, false ); - attack.frames( frames, 0, 2, 3 ); - - die = new Animation( 20, false ); - die.frames( frames, 0 ); - - play( idle ); - } - - @Override - public void attack(int pos) { - attackPos = pos; - super.attack(pos); - } - - - @Override - public void onComplete(Animation anim) { - super.onComplete(anim); - - if (anim == attack) { - if (Dungeon.visible[ch.pos] || Dungeon.visible[attackPos]) { - parent.add(new Beam.WaterRay(center(), DungeonTilemap - .tileCenterToWorld(attackPos))); - } - } - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/Ice13Sprite.java b/java/com/hmdzl/spspd/change/sprites/Ice13Sprite.java deleted file mode 100644 index 0f4d7b20..00000000 --- a/java/com/hmdzl/spspd/change/sprites/Ice13Sprite.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.levels.Level; -import com.watabou.noosa.Game; -import com.watabou.noosa.TextureFilm; -import com.watabou.noosa.audio.Sample; -import com.watabou.noosa.particles.Emitter; - -public class Ice13Sprite extends MobSprite { - - public Ice13Sprite() { - super(); - - texture( Assets.ICE13 ); - - TextureFilm frames = new TextureFilm( texture, 16, 16 ); - - idle = new Animation( 15, true ); - idle.frames(frames, 0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3); - - run = new Animation( 20, true ); - run.frames( frames, 0 ); - - attack = new Animation( 12, false ); - attack.frames( frames, 0, 2, 3 ); - - die = new Animation( 20, false ); - die.frames( frames, 0 ); - - play( idle ); - } - - -} diff --git a/java/com/hmdzl/spspd/change/sprites/ImpSprite.java b/java/com/hmdzl/spspd/change/sprites/ImpSprite.java deleted file mode 100644 index 47470470..00000000 --- a/java/com/hmdzl/spspd/change/sprites/ImpSprite.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.mobs.npcs.Imp; -import com.hmdzl.spspd.change.effects.Speck; -import com.watabou.noosa.TextureFilm; - -public class ImpSprite extends MobSprite { - - public ImpSprite() { - super(); - - texture(Assets.IMP); - - TextureFilm frames = new TextureFilm(texture, 12, 14); - - idle = new Animation(10, true); - idle.frames(frames, 0, 1, 2, 3, 0, 1, 2, 3, 0, 0, 0, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 3, 0, 0, 0, 4, 4, 4, - 4, 4, 4, 4, 4, 0, 0, 0, 4, 4, 4, 4, 4, 4, 4, 4); - - run = new Animation(20, true); - run.frames(frames, 0); - - die = new Animation(10, false); - die.frames(frames, 0, 3, 2, 1, 0, 3, 2, 1, 0); - - play(idle); - } - - @Override - public void link(Char ch) { - super.link(ch); - - if (ch instanceof Imp) { - alpha(0.4f); - } - } - - @Override - public void onComplete(Animation anim) { - if (anim == die) { - - emitter().burst(Speck.factory(Speck.WOOL), 15); - killAndErase(); - - } else { - super.onComplete(anim); - } - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/InfectingFistSprite.java b/java/com/hmdzl/spspd/change/sprites/InfectingFistSprite.java deleted file mode 100644 index 0efdd6ce..00000000 --- a/java/com/hmdzl/spspd/change/sprites/InfectingFistSprite.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.watabou.noosa.Camera; -import com.watabou.noosa.TextureFilm; - -public class InfectingFistSprite extends MobSprite { - - private static final float FALL_SPEED = 64; - - public InfectingFistSprite() { - super(); - - texture(Assets.INFECTING); - - TextureFilm frames = new TextureFilm(texture, 24, 17); - - idle = new Animation(2, true); - idle.frames(frames, 0, 0, 1); - - run = new Animation(3, true); - run.frames(frames, 0, 1); - - attack = new Animation(2, false); - attack.frames(frames, 0); - - die = new Animation(10, false); - die.frames(frames, 0, 2, 3, 4); - - play(idle); - } - - @Override - public void attack(int cell) { - super.attack(cell); - - speed.set(0, -FALL_SPEED); - acc.set(0, FALL_SPEED * 4); - } - - @Override - public void onComplete(Animation anim) { - super.onComplete(anim); - if (anim == attack) { - speed.set(0); - acc.set(0); - place(ch.pos); - - Camera.main.shake(4, 0.2f); - } - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/ItemSprite.java b/java/com/hmdzl/spspd/change/sprites/ItemSprite.java deleted file mode 100644 index 523c7884..00000000 --- a/java/com/hmdzl/spspd/change/sprites/ItemSprite.java +++ /dev/null @@ -1,233 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import android.graphics.Bitmap; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.DungeonTilemap; -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.Gold; -import com.hmdzl.spspd.change.items.Heap; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.Terrain; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.watabou.gltextures.TextureCache; -import com.watabou.noosa.Game; -import com.watabou.noosa.MovieClip; -import com.watabou.noosa.TextureFilm; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.PointF; -import com.watabou.utils.Random; - -public class ItemSprite extends MovieClip { - - public static final int SIZE = 16; - - private static final float DROP_INTERVAL = 0.4f; - - protected static TextureFilm film; - - public Heap heap; - - private Glowing glowing; - private float phase; - private boolean glowUp; - - private float dropInterval; - - public ItemSprite() { - this(ItemSpriteSheet.SOMETHING, null); - } - - public ItemSprite(Item item) { - this(item.image(), item.glowing()); - } - - public ItemSprite(int image, Glowing glowing) { - super(Assets.ITEMS); - - if (film == null) { - film = new TextureFilm(texture, SIZE, SIZE); - } - - view(image, glowing); - } - - public void originToCenter() { - origin.set(SIZE / 2); - } - - public void link() { - link(heap); - } - - public void link(Heap heap) { - this.heap = heap; - view(heap.image(), heap.glowing()); - place(heap.pos); - } - - @Override - public void revive() { - super.revive(); - - speed.set(0); - acc.set(0); - dropInterval = 0; - - heap = null; - } - - public PointF worldToCamera(int cell) { - final int csize = DungeonTilemap.SIZE; - - return new PointF(cell % Level.getWidth() * csize + (csize - SIZE) * 0.5f, - cell / Level.getWidth() * csize + (csize - SIZE) * 0.5f); - } - - public void place(int p) { - point(worldToCamera(p)); - } - - public void drop() { - - if (heap.isEmpty()) { - return; - } - - dropInterval = DROP_INTERVAL; - - speed.set(0, -100); - acc.set(0, -speed.y / DROP_INTERVAL * 2); - - if (visible && heap != null && heap.peek() instanceof Gold) { - CellEmitter.center(heap.pos).burst(Speck.factory(Speck.COIN), 5); - Sample.INSTANCE.play(Assets.SND_GOLD, 1, 1, - Random.Float(0.9f, 1.1f)); - } - } - - public void drop(int from) { - - if (heap.pos == from) { - drop(); - } else { - - float px = x; - float py = y; - drop(); - - place(from); - - speed.offset((px - x) / DROP_INTERVAL, (py - y) / DROP_INTERVAL); - } - } - - public ItemSprite view(int image, Glowing glowing) { - frame(film.get(image)); - if ((this.glowing = glowing) == null) { - resetColor(); - } - return this; - } - - @Override - public void update() { - super.update(); - - visible = (heap == null || heap.seen); - - if (dropInterval > 0 && (dropInterval -= Game.elapsed) <= 0) { - - speed.set(0); - acc.set(0); - place(heap.pos); - - if (visible) { - boolean water = Level.water[heap.pos]; - - if (water) { - GameScene.ripple(heap.pos); - } else { - int cell = Dungeon.level.map[heap.pos]; - water = (cell == Terrain.WELL || cell == Terrain.ALCHEMY); - } - - if (!(heap.peek() instanceof Gold)) { - Sample.INSTANCE.play(water ? Assets.SND_WATER - : Assets.SND_STEP, 0.8f, 0.8f, 1.2f); - } - } - } - - if (visible && glowing != null) { - if (glowUp && (phase += Game.elapsed) > glowing.period) { - - glowUp = false; - phase = glowing.period; - - } else if (!glowUp && (phase -= Game.elapsed) < 0) { - - glowUp = true; - phase = 0; - - } - - float value = phase / glowing.period * 0.6f; - - rm = gm = bm = 1 - value; - ra = glowing.red * value; - ga = glowing.green * value; - ba = glowing.blue * value; - } - } - - public static int pick(int index, int x, int y) { - Bitmap bmp = TextureCache.get(Assets.ITEMS).bitmap; - int rows = bmp.getWidth() / SIZE; - int row = index / rows; - int col = index % rows; - return bmp.getPixel(col * SIZE + x, row * SIZE + y); - } - - public static class Glowing { - - public static final Glowing WHITE = new Glowing(0xFFFFFF, 0.6f); - - public float red; - public float green; - public float blue; - public float period; - - public Glowing(int color) { - this(color, 1f); - } - - public Glowing(int color, float period) { - red = (color >> 16) / 255f; - green = ((color >> 8) & 0xFF) / 255f; - blue = (color & 0xFF) / 255f; - - this.period = period; - } - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/ItemSpriteSheet.java b/java/com/hmdzl/spspd/change/sprites/ItemSpriteSheet.java deleted file mode 100644 index 011648a7..00000000 --- a/java/com/hmdzl/spspd/change/sprites/ItemSpriteSheet.java +++ /dev/null @@ -1,575 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -public class ItemSpriteSheet { - - // Row definers - private static final int ROW1 = 0 * 16; - private static final int ROW2 = 1 * 16; - private static final int ROW3 = 2 * 16; - private static final int ROW4 = 3 * 16; - private static final int ROW5 = 4 * 16; - private static final int ROW6 = 5 * 16; - private static final int ROW7 = 6 * 16; - private static final int ROW8 = 7 * 16; - private static final int ROW9 = 8 * 16; - private static final int ROW10 = 9 * 16; - private static final int ROW11 = 10 * 16; - private static final int ROW12 = 11 * 16; - private static final int ROW13 = 12 * 16; - private static final int ROW14 = 13 * 16; - private static final int ROW15 = 14 * 16; - private static final int ROW16 = 15 * 16; - private static final int ROW17 = 16 * 16; - private static final int ROW18 = 17 * 16; - private static final int ROW19 = 18 * 16; - private static final int ROW20 = 19 * 16; - private static final int ROW21 = 20 * 16; - private static final int ROW22 = 21 * 16; - private static final int ROW23 = 22 * 16; - private static final int ROW24 = 23 * 16; - private static final int ROW25 = 24 * 16; - private static final int ROW26 = 25 * 16; - private static final int ROW27 = 26 * 16; - private static final int ROW28 = 27 * 16; - - // Row One: Items which can't be obtained - // null warning occupies space 0, should only show up if there's a bug. - public static final int NULLWARN = ROW1 + 0; - public static final int DEWDROP = ROW1 + 1; - public static final int PETAL = ROW1 + 2; - public static final int SANDBAG = ROW1 + 3; - public static final int REDDEWDROP = ROW8 + 8; - public static final int YELLOWDEWDROP = ROW8 + 14; - public static final int VIOLETDEWDROP = ROW14 + 13; - public static final int COIN = ROW14 + 14; - public static final int ARTIFACT = ROW14 + 15; - - // Heaps (containers) - public static final int BONES = ROW1 + 4; - public static final int REMAINS = ROW1 + 5; - public static final int TOMB = ROW1 + 6; - public static final int GRAVE = ROW1 + 7; - public static final int CHEST = ROW1 + 8; - public static final int LOCKED_CHEST = ROW1 + 9; - public static final int CRYSTAL_CHEST = ROW1 + 10; - // Placeholders - public static final int WEAPON_HOLDER = ROW1 + 11; - public static final int ARMOR_HOLDER = ROW1 + 12; - public static final int RING_HOLDER = ROW1 + 13; - public static final int SOMETHING = ROW1 + 14; - - // Row Two: Miscellaneous single use items - public static final int GOLD = ROW2 + 0; - public static final int TORCH = ROW2 + 1; - public static final int STYLUS = ROW2 + 2; - public static final int ANKH = ROW2 + 3; - // Keys - public static final int IRON_KEY = ROW2 + 4; - public static final int GOLDEN_KEY = ROW2 + 5; - public static final int SKELETON_KEY = ROW2 + 6; - // Boss Rewards - public static final int BEACON = ROW2 + 7; - public static final int MASTERY = ROW2 + 8; - public static final int KIT = ROW2 + 9; - public static final int AMULET = ROW2 + 10; - public static final int WEIGHT = ROW2 + 11; - public static final int BOMB = ROW2 + 12; - public static final int DBL_BOMB = ROW2 + 13; - public static final int HONEYPOT = ROW2 + 14; - public static final int SHATTPOT = ROW2 + 15; - public static final int SHELL = ROW5 + 10; - public static final int BONE = ROW5 + 11; - - - // Row Three: Melee weapons - public static final int KNUCKLEDUSTER = ROW3 + 0; - public static final int DAGGER = ROW3 + 1; - public static final int SHORT_SWORD = ROW3 + 2; - public static final int HANDAXE = ROW3 + 3; - public static final int SPEAR = ROW3 + 4; - public static final int SCIMITAR = ROW3 + 5; - public static final int WHIP = ROW3 + 6; - public static final int BATTLE_AXE = ROW3 + 7; - public static final int ASSASSINSBLADE = ROW3 + 8; - public static final int WAR_HAMMER = ROW3 + 9; - public static final int GLAIVE = ROW3 + 10; - public static final int ADAMANT_WEAPON = ROW3 + 11; - public static final int HANDCANNON = ROW3 + 12; - public static final int MAGEBOOK = ROW3 + 13; - public static final int SPKEY = ROW3 + 14; - - // Row Four: Missile weapons and sporks - public static final int KNIVE = ROW4 + 0; - public static final int BOOMERANG = ROW4 + 1; - public static final int INCENDIARY_DART = ROW4 + 2; - public static final int SHURIKEN = ROW4 + 3; - public static final int POSION_DART = ROW4 + 4; - public static final int BOLA = ROW4 + 5; - public static final int TOMAHAWK = ROW4 + 6; - public static final int SPORK = ROW4 + 7; - public static final int RUNICBLADE = ROW4 + 8; - public static final int WAVE = ROW4 + 9; - public static final int AMMO = ROW4 + 12; - public static final int SOUL_COLLECT = ROW4 + 13; - public static final int PALANTIR = ROW20 + 8; - public static final int SKULLWEP = ROW4 + 14; - public static final int STONE = ROW4 + 15; - - - // Row Five: Armors - public static final int ARMOR_CLOTH = ROW5 + 0; - public static final int ARMOR_LEATHER = ROW5 + 1; - public static final int ARMOR_MAIL = ROW5 + 2; - public static final int ARMOR_SCALE = ROW5 + 3; - public static final int ARMOR_PLATE = ROW5 + 4; - public static final int ARMOR_WARRIOR = ROW5 + 5; - public static final int ARMOR_MAGE = ROW5 + 6; - public static final int ARMOR_ROGUE = ROW5 + 7; - public static final int ARMOR_HUNTRESS = ROW5 + 8; - public static final int ARMOR_ADAMANT = ROW5 + 9; - public static final int ARMOR_DISC = ROW17 + 8; - - // Row Six: Wands - public static final int WAND_MAGIC_MISSILE = ROW6 + 0; - public static final int WAND_ACID = ROW6 + 1; - public static final int WAND_METEORITE = ROW6 + 2; - public static final int WAND_FLOW = ROW6 + 3; - public static final int WAND_CHARM = ROW6 + 4; - public static final int WAND_DISINTEGRATION = ROW6 + 5; - public static final int WAND_FIREBOLT = ROW6 + 6; - public static final int WAND_BLOOD = ROW6 + 7; - public static final int WAND_FREEZE = ROW6 + 8; - public static final int WAND_LIGHTNING = ROW6 + 9; - public static final int WAND_POISON = ROW6 + 10; - public static final int WAND_REGROWTH = ROW6 + 11; - public static final int WAND_FLOCK = ROW6 + 12; - public static final int WAND_ADAMANT = ROW6 + 13; - public static final int WAND_TCLOUD = ROW4 + 11; - - // Row Seven: Rings - public static final int RING_GARNET = ROW7 + 0; - public static final int RING_RUBY = ROW7 + 1; - public static final int RING_TOPAZ = ROW7 + 2; - public static final int RING_EMERALD = ROW7 + 3; - public static final int RING_ONYX = ROW7 + 4; - public static final int RING_OPAL = ROW7 + 5; - public static final int RING_TOURMALINE = ROW7 + 6; - public static final int RING_SAPPHIRE = ROW7 + 7; - public static final int RING_AMETHYST = ROW7 + 8; - public static final int RING_QUARTZ = ROW7 + 9; - public static final int RING_AGATE = ROW7 + 10; - public static final int RING_DIAMOND = ROW7 + 11; - public static final int RING_ADAMANT = ROW7 + 12; - - // Row Eight: Artifacts with Static Images - public static final int ARTIFACT_CLOAK = ROW8 + 0; - public static final int ARTIFACT_ARMBAND = ROW8 + 1; - public static final int ARTIFACT_CAPE = ROW8 + 2; - public static final int ARTIFACT_TALISMAN = ROW8 + 3; - public static final int ARTIFACT_HOURGLASS = ROW8 + 4; - public static final int ARTIFACT_TOOLKIT = ROW8 + 5; - public static final int ARTIFACT_SPELLBOOK = ROW8 + 6; - - public static final int COURAGETRIAL = ROW8 + 9; - public static final int POWERTRIAL = ROW8 + 10; - public static final int WISDOMTRIAL = ROW8 + 11; - public static final int DWARFHAMMER = ROW8 + 12; - public static final int ANCIENTKEY = ROW8 + 13; - public static final int OTILUKES_JOURNAL = ROW16 + 3; - public static final int RING_DISINTEGRATION = ROW7 + 13; - public static final int RING_FROST = ROW7 + 15; - - // Row Nine: Artifacts with Dynamic Images - public static final int ARTIFACT_HORN1 = ROW9 + 0; - public static final int ARTIFACT_HORN2 = ROW9 + 1; - public static final int ARTIFACT_HORN3 = ROW9 + 2; - public static final int ARTIFACT_HORN4 = ROW9 + 3; - public static final int ARTIFACT_CHALICE1 = ROW9 + 4; - public static final int ARTIFACT_CHALICE2 = ROW9 + 5; - public static final int ARTIFACT_CHALICE3 = ROW9 + 6; - public static final int ARTIFACT_SANDALS = ROW9 + 7; - public static final int ARTIFACT_SHOES = ROW9 + 8; - public static final int ARTIFACT_BOOTS = ROW9 + 9; - public static final int ARTIFACT_GREAVES = ROW9 + 10; - public static final int ARTIFACT_ROSE1 = ROW9 + 11; - public static final int ARTIFACT_ROSE2 = ROW9 + 12; - public static final int ARTIFACT_ROSE3 = ROW9 + 13; - public static final int ARTIFACT_CHAINS = ROW17 + 15; - public static final int LUCKY_BADGE = ROW5 + 14; - - // Row Ten: Scrolls - public static final int SCROLL_KAUNAN = ROW10 + 0; - public static final int SCROLL_SOWILO = ROW10 + 1; - public static final int SCROLL_LAGUZ = ROW10 + 2; - public static final int SCROLL_YNGVI = ROW10 + 3; - public static final int SCROLL_GYFU = ROW10 + 4; - public static final int SCROLL_RAIDO = ROW10 + 5; - public static final int SCROLL_ISAZ = ROW10 + 6; - public static final int SCROLL_MANNAZ = ROW10 + 7; - public static final int SCROLL_NAUDIZ = ROW10 + 8; - public static final int SCROLL_BERKANAN = ROW10 + 9; - public static final int SCROLL_NCOSRANE = ROW10 + 10; - public static final int SCROLL_TIWAZ = ROW10 + 11; - public static final int SCROLL_NENDIL = ROW10 + 12; - public static final int SCROLL_LIBRA = ROW10 + 14; - public static final int JOURNAL_PAGE = ROW10 + 13; - - // Row Eleven: Potions - public static final int POTION_CRIMSON = ROW11 + 0; - public static final int POTION_AMBER = ROW11 + 1; - public static final int POTION_GOLDEN = ROW11 + 2; - public static final int POTION_JADE = ROW11 + 3; - public static final int POTION_TURQUOISE = ROW11 + 4; - public static final int POTION_AZURE = ROW11 + 5; - public static final int POTION_INDIGO = ROW11 + 6; - public static final int POTION_MAGENTA = ROW11 + 7; - public static final int POTION_BISTRE = ROW11 + 8; - public static final int POTION_CHARCOAL = ROW11 + 9; - public static final int POTION_SILVER = ROW11 + 10; - public static final int POTION_IVORY = ROW11 + 11; - public static final int POTION_AQUA = ROW11 + 12; - public static final int POTION_HONEY = ROW11 + 13; - public static final int POTION_VIOLET = ROW11 + 14; - - // Row Twelve: Seeds - public static final int SEED_ROTBERRY = ROW12 + 0; - public static final int SEED_FIREBLOOM = ROW12 + 1; - public static final int SEED_BLINDWEED = ROW12 + 2; - public static final int SEED_SUNGRASS = ROW12 + 3; - public static final int SEED_ICECAP = ROW12 + 4; - public static final int SEED_STORMVINE = ROW12 + 5; - public static final int SEED_SORROWMOSS = ROW12 + 6; - public static final int SEED_DREAMFOIL = ROW12 + 7; - public static final int SEED_EARTHROOT = ROW12 + 8; - public static final int SEED_FADELEAF = ROW12 + 9; - public static final int SEED_BLANDFRUIT = ROW12 + 10; - public static final int SEED_DUNGEONNUT = ROW12 + 11; - public static final int SEED_TOASTEDDUNGEONNUT = ROW12 + 12; - public static final int SEED_GOLDENDUNGEONNUT = ROW12 + 13; - public static final int SEED_BLACKBERRY = ROW12 + 14; - public static final int SEED_RICE = ROW12 + 15; - public static final int SEED_CLOUDBERRY = ROW13 + 11; - public static final int SEED_BLUEBERRY = ROW13 + 12; - public static final int SEED_MOONBERRY = ROW13 + 14; - public static final int SEED_FULLMOONBERRY = ROW13 + 15; - public static final int SEED_STARFLOWER = ROW9 + 15; - public static final int SEED_PHASEPITCHER = ROW14 + 5; - public static final int SEED_FLYTRAP = ROW5 + 12; - public static final int SEED_DEWCATCHER = ROW5+13; - public static final int SEED_SEEDPOD = ROW5 + 15; - - // Row Thirteen: Food - public static final int MEAT = ROW13 + 0; - public static final int STEAK = ROW13 + 1; - public static final int OVERPRICED = ROW13 + 2; - public static final int CARPACCIO = ROW13 + 3; - public static final int BLANDFRUIT = ROW13 + 4; - public static final int RATION = ROW13 + 5; - public static final int PASTY = ROW13 + 6; - public static final int MYSTERYMEAT = ROW13 + 7; - - // Row Fourteen: Quest Items - public static final int SKULL = ROW14 + 0; - public static final int DUST = ROW14 + 1; - public static final int PICKAXE = ROW14 + 2; - public static final int ORE = ROW14 + 3; - public static final int TOKEN = ROW14 + 4; - public static final int ATRIFORCE = ROW13 + 9; - public static final int TRIFORCE = ROW17 + 4; - public static final int MUSHROOM = ROW9 + 14; - public static final int MUSHROOM_DEATHCAP = ROW14 + 9; - public static final int MUSHROOM_LANTERN = ROW14 + 6; - public static final int MUSHROOM_LICHEN = ROW14 + 8; - public static final int MUSHROOM_EARTHSTAR = ROW14 + 7; - public static final int MUSHROOM_BLUEMILK = ROW14 + 12; - public static final int MUSHROOM_GOLDENJELLY = ROW14 + 11; - public static final int MUSHROOM_PIXIEPARASOL= ROW14 + 10; - - // Row Fifteen: Containers/Bags - public static final int VIAL = ROW15 + 0; - public static final int POUCH = ROW15 + 1; - public static final int HOLDER = ROW15 + 2; - public static final int BANDOLIER = ROW15 + 3; - public static final int HOLSTER = ROW15 + 4; - public static final int SHOPCART = ROW15 + 5; - public static final int ACTIVEMRD = ROW15 + 6; - public static final int ACTIVEMRD2 = ROW15 + 7; - public static final int ORBOFZOT = ROW15 + 10; - public static final int KEYRING = ROW4 + 10; - - //Bombs - public static final int DARK_BOMB = ROW13 + 8; - public static final int FISH_BOMB = ROW13 + 10; - public static final int LIGHT_BOMB = ROW13 + 13; - public static final int FIRE_BOMB = ROW15 + 11; - public static final int STORM_BOMB = ROW15 + 12; - public static final int EARTH_BOMB = ROW15 + 13; - public static final int ICE_BOMB = ROW15 + 14; - public static final int HUGE_BOMB = ROW15 + 15; - public static final int MINI_BOMB = ROW15 + 8; - public static final int BUILD_BOMB = ROW15 + 9; - - // Row Sixteen: Random OP Stuff - public static final int UPGRADEGOO_YELLOW = ROW16 + 0; - public static final int UPGRADEGOO_RED = ROW16 + 1; - public static final int UPGRADEGOO_VIOLET = ROW16 + 2; - public static final int EGG = ROW16 + 4; - public static final int TRIDENT = ROW16 + 5; - public static final int ARESSWORD = ROW16 + 6; - public static final int JUPITERSWRAITH = ROW16 + 7; - public static final int CROMAXE = ROW16 + 8; - public static final int LOKISFLAIL = ROW16 + 9; - public static final int NORNGREEN = ROW16 + 11; - public static final int NORNBLUE = ROW16 + 12; - public static final int NORNORANGE = ROW16 + 13; - public static final int NORNPURPLE = ROW16 + 14; - public static final int NORNYELLOW = ROW16 + 15; - - // Row Seventeen: Random Lame Stuff - public static final int TOWEL = ROW17 + 0; - public static final int OTILUKES_SPECS = ROW17 + 1; - public static final int PUDDING_CUP = ROW17 + 2; - public static final int POCKET_BALL = ROW17 + 3; - - public static final int BOSSRUSH = ROW8 + 7; - public static final int JUMP = ROW17 + 5; - public static final int SHIELD = ROW17 + 6; - public static final int DKNIVE = ROW17 + 7; - public static final int NUNCHAKUS = ROW17 + 9; - - public static final int TEKKOKAGI = ROW17 + 10; - public static final int WRAITHBREATH = ROW4 + 9; - public static final int GSWORD = ROW17 + 11; - public static final int HALBERD = ROW17 + 12; - public static final int MAP = ROW6 + 14; - public static final int PLAYERICON = ROW17 + 13; - public static final int SHOESKIT = ROW17 + 14; - public static final int TREE = ROW6 + 15; - - public static final int SEWERSKEY = ROW18 + 0; - public static final int PRISONKEY = ROW18 + 1; - public static final int CAVEKEY = ROW18 + 2; - public static final int CITYKEY = ROW18 + 3; - public static final int HALLKEY = ROW18 + 4; - public static final int TENGUKEY = ROW18 + 5; - - public static final int RANDOWNEGG = ROW19 + 0; - public static final int SCORPIONEGG = ROW19 + 1; - public static final int SPIDEREGG = ROW19 + 2; - public static final int FIREEGG = ROW19 + 3; - public static final int RED_DRAGONEGG = ROW19 + 4; - public static final int BLUE_DRAGONEGG = ROW19 + 5; - public static final int VIOLET_DRAGONEGG = ROW19 + 6; - public static final int GREEN_DRAGONEGG = ROW19 + 7; - public static final int SHADOWEGG = ROW19 + 8; - public static final int BEEEGG = ROW19 + 9; - public static final int RABBITEGG = ROW19 + 10; - public static final int VELOCIROOSTEREGG = ROW19 + 11; - public static final int LIGHT_DRAGONEGG = ROW19 + 13; - public static final int GOLD_DRAGONEGG = ROW19 + 14; - - public static final int FAIRYCARD = ROW19 + 12; - - public static final int HUGESHURIKEN = ROW8 + 15; - public static final int TPTRAP = ROW3 + 15; - - public static final int POTION = ROW18 + 12; - - public static final int FIGHTGLOVES = ROW18 + 6; - public static final int LANCE = ROW20 + 11; - public static final int RAPIER = ROW20 + 12; - public static final int CLUB = ROW20 + 13; - public static final int GNOLL_ARMOR = ROW20 + 14; - public static final int FIRECRACKER = ROW20 + 15; - - - public static final int PETFOOD = ROW18 + 15; - public static final int PUMPKIN = ROW19 + 15; - - public static final int EASTER_EGG = ROW16 + 10; - public static final int PUMPKIN_PIE = ROW20 + 0 ; - public static final int CANDY_CANE = ROW20 + 1 ; - public static final int TURKEY_MEAT = ROW20 + 2; - public static final int SPRING_ASSORTED = ROW20 + 3; - - public static final int MOAI = ROW20 + 6; - public static final int POCKETBALL_EMPTY = ROW20 + 7; - public static final int SPAMMO = ROW20 + 9; - - public static final int ERROR_WEAPON = ROW18 + 7; - public static final int ERROR_ARMOR = ROW18 + 8; - public static final int ERROR_WAND = ROW18 + 9; - public static final int ERROR_FOOD = ROW18 + 11; - public static final int ERROR_AMMO = ROW20 + 5; - - public static final int ERROR_BOOK = ROW18 + 13; - - public static final int H_O_SCARECROW = ROW18 + 14; - - public static final int ELEVATOR = ROW20 + 10; - - public static final int HOOK_HAM = ROW21 + 1; - public static final int KNOWNLADGE_FOOD = ROW21 + 2; - - public static final int SKILL_ATK = ROW21 + 8; - public static final int SKILL_DEF = ROW21 + 9; - public static final int SKILL_MIG = ROW21 + 10; - public static final int WARRIORSHIELD = ROW21 + 11; - - public static final int TRIANGOLO = ROW21 + 0; - public static final int FLUTE = ROW21 + 3; - public static final int WARDURM = ROW21 + 4; - public static final int TRUMPET = ROW21 + 5; - public static final int HARP = ROW21 + 6; - public static final int SHOVEL = ROW21 + 7; - public static final int GLASSTOTEM = ROW21 + 12 ; - public static final int ARMOR_PERFORMER = ROW21 + 13; - - public static final int HAMBURGER = ROW22 + 0; - public static final int HONEYWATER = ROW22 + 1; - public static final int CHICKENNUGGET = ROW22 + 2; - public static final int HONEYMEAT = ROW22 + 3; - public static final int MEATSOUP = ROW22 + 4; - public static final int HOTDOG = ROW22 + 5; - public static final int KEBAB = ROW22 + 6 ; - public static final int SANDWICH = ROW22 + 7; - public static final int ALIEN_BAG = ROW22 + 8; - public static final int ICECREAM = ROW22 + 9; - public static final int VEGETABLESOUP = ROW22 + 10; - public static final int RICE = ROW22 + 11; - public static final int FRUITSALAD = ROW22 + 12; - public static final int FOAMED = ROW22 + 13; - public static final int EAT_GRASS = ROW22 + 14; - public static final int PERFECT_FOOD = ROW22 + 15; - - public static final int CHALLENGE_BOOK = ROW21 + 14; - public static final int GOEI = ROW21 + 15; - - public static final int VEST_ARMOR = ROW23 + 0; - public static final int RUBBER_ARMOR = ROW23 + 1; - public static final int CD_ARMOR = ROW23 + 2; - public static final int STY_ARMOR = ROW23 + 3; - public static final int PRO_ARMOR = ROW23 + 4; - public static final int PHANTOM_ARMOR = ROW23 + 5; - - public static final int WOODEN_ARMOR = ROW23 + 6; - public static final int CERAMICS_ARMOR = ROW23 + 7; - public static final int STONE_ARMOR = ROW23 + 8; - public static final int MUL_ARMOR = ROW23 + 9; - public static final int BULLET_ARMOR = ROW23 + 10; - public static final int MECH_ARMOR = ROW23 + 11; - - public static final int ARMOR_SOLDIER = ROW23 + 13; - public static final int ARMOR_FOLLOWER = ROW27 + 8; - - public static final int HERB_MEAT = ROW23 + 12; - - public static final int GUN_A = ROW24 + 0; - public static final int GUN_B = ROW24 + 1; - public static final int GUN_C = ROW24 + 2; - public static final int GUN_D = ROW24 + 3; - public static final int GUN_E = ROW24 + 4; - public static final int GUN_S = ROW24 + 5; - public static final int TOYGUN = ROW24 + 6; - public static final int SLING = ROW24 + 7; - public static final int MOBS = ROW24 + 8; - public static final int BRICK = ROW24 + 9; - public static final int PILL_ATK = ROW24 + 10; - public static final int PILL_DEF = ROW24 + 11; - public static final int PILL_STR = ROW24 + 12; - public static final int PILL_MIG = ROW24 + 13; - public static final int PILL_MUC = ROW24 + 14; - public static final int PILL_SOT = ROW24 + 15; - - public static final int W_BRICK = ROW20 + 4; - - public static final int FOURCLOVER = ROW23 + 14; - public static final int POTION_OF_MAGE = ROW23 + 15; - - public static final int LOLLIPOP = ROW25 + 0; - public static final int JELLY_SWORD = ROW25 + 1; - public static final int POWER_HAND = ROW25 + 2; - public static final int S_J_R_B_M = ROW25 + 3; - public static final int FRENCHFRIES = ROW25 + 4; - public static final int CHOCOLATE = ROW25 + 5; - public static final int FOODFANS = ROW25 + 6; - - public static final int ATTACKSHIELD = ROW25 + 8; - - public static final int BSHOVEL = ROW25 + 7; - - public static final int CANNON_OF_MAGE = ROW25 + 9; - - public static final int MANY_KNIVE = ROW25 + 10; - - public static final int MK_BOX = ROW25 + 11; - - public static final int WOODEN_H = ROW25 + 12; - - public static final int S_AND_S = ROW25 + 13; - - public static final int AFLY_FOOD = ROW25 + 14; - - public static final int FLAG = ROW25 + 15; - - public static final int COPY_BALL = ROW26 + 1; - public static final int EMPTY_BOMB = ROW26 + 2; - public static final int SHATTERED_AMMO = ROW26 + 3; - public static final int BOW = ROW26 + 4; - - public static final int STAR_FLOWER = ROW26 + 5; - public static final int UP_EATER = ROW26 + 6; - public static final int TRAN_BALL = ROW26 + 7; - public static final int DREAM_L = ROW26 + 8; - public static final int HEAL_L = ROW26 + 9; - public static final int MECH_POCKET = ROW26 + 10; - - public static final int DEMO_SCROLL = ROW26 + 11; - public static final int UNDEAD_BOOK = ROW26 + 12; - public static final int GNOLL_MARK = ROW26 + 13; - - public static final int HELMET = ROW26 + 14; - public static final int WOODEN_STAFF = ROW26 + 15; - - - public static final int HEAL_BAG = ROW27 + 0; - - public static final int MACE = ROW27 + 4; - public static final int HOLY_WATER = ROW27 + 2; - public static final int PRAYER_WHEEL = ROW27 + 5; - public static final int STONE_CROSS = ROW27 + 1; - - public static final int FAITH_SIGN = ROW27 + 6; - public static final int ARTIFACT_BEACON = ROW27 + 7; - - public static final int DIAMOND_PICKAXE = ROW27 + 3; - - public static final int MONEY_PACK = ROW27 + 10; - - public static final int DOOR_BLOCK = ROW27 + 11; - public static final int WALL_BLOCK = ROW27 + 12; - public static final int STONE_BLOCK = ROW27 + 13; - public static final int WOODEN_BLOCK = ROW27 + 14; - public static final int BOOK_BLOCK = ROW27 + 15; - - public static final int HORSE_TOTEM = ROW28 + 0; - public static final int RANGE_BAG = ROW28 + 1; - public static final int DANCE_LION = ROW28 + 1; -} diff --git a/java/com/hmdzl/spspd/change/sprites/JinkeloidSprite.java b/java/com/hmdzl/spspd/change/sprites/JinkeloidSprite.java deleted file mode 100644 index d0f773f9..00000000 --- a/java/com/hmdzl/spspd/change/sprites/JinkeloidSprite.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.levels.Level; -import com.watabou.noosa.TextureFilm; -import com.watabou.noosa.audio.Sample; -import com.watabou.noosa.particles.Emitter; - -public class JinkeloidSprite extends MobSprite { - - public JinkeloidSprite() { - super(); - - texture( Assets.JINKELOID ); - - TextureFilm frames = new TextureFilm( texture, 16, 16 ); - - idle = new Animation( 15, true ); - idle.frames(frames, 0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3); - - run = new Animation( 20, true ); - run.frames( frames, 0 ); - - attack = new Animation( 12, false ); - attack.frames( frames, 0, 2, 3 ); - - die = new Animation( 20, false ); - die.frames( frames, 0 ); - - play( idle ); - } - - -} diff --git a/java/com/hmdzl/spspd/change/sprites/Juh9870Sprite.java b/java/com/hmdzl/spspd/change/sprites/Juh9870Sprite.java deleted file mode 100644 index 64cf5375..00000000 --- a/java/com/hmdzl/spspd/change/sprites/Juh9870Sprite.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.levels.Level; -import com.watabou.noosa.TextureFilm; -import com.watabou.noosa.audio.Sample; -import com.watabou.noosa.particles.Emitter; - -public class Juh9870Sprite extends MobSprite { - - public Juh9870Sprite() { - super(); - - texture( Assets.JUH9870 ); - - TextureFilm frames = new TextureFilm( texture, 16, 16 ); - - idle = new Animation( 3, true ); - idle.frames(frames, 0, 0, 1, 1, 2, 2, 2, 3, 3, 3, 3, 3); - - run = new Animation( 20, true ); - run.frames( frames, 0 ); - - attack = new Animation( 12, false ); - attack.frames( frames, 0, 2, 3 ); - - die = new Animation( 20, false ); - die.frames( frames, 0 ); - - play( idle ); - } - - -} diff --git a/java/com/hmdzl/spspd/change/sprites/KeKeSprite.java b/java/com/hmdzl/spspd/change/sprites/KeKeSprite.java deleted file mode 100644 index 44843763..00000000 --- a/java/com/hmdzl/spspd/change/sprites/KeKeSprite.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 5415-5415 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 5 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.effects.Lightning; -import com.hmdzl.spspd.change.items.wands.WandOfTCloud; -import com.watabou.noosa.TextureFilm; - -public class KeKeSprite extends MobSprite { - - public KeKeSprite() { - super(); - - texture(Assets.T_CLOUD); - - TextureFilm frames = new TextureFilm( texture, 16, 16 ); - - idle = new Animation( 5, true ); - idle.frames(frames, 4, 4, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7); - - run = new Animation( 54, true ); - run.frames( frames, 4 ); - - attack = new Animation( 15, false ); - attack.frames( frames, 4, 5, 5 ); - - die = new Animation( 24, false ); - die.frames( frames, 4 ); - - zap = attack.clone(); - - play(idle); - } - - @Override - public void zap(int pos) { - - parent.add( new Lightning( ch.pos, pos, (WandOfTCloud.STCloud) ch)); - - turnTo(ch.pos, pos); - play(zap); - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/sprites/KingSprite.java b/java/com/hmdzl/spspd/change/sprites/KingSprite.java deleted file mode 100644 index 3d21898f..00000000 --- a/java/com/hmdzl/spspd/change/sprites/KingSprite.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.watabou.noosa.TextureFilm; - -public class KingSprite extends MobSprite { - - public KingSprite() { - super(); - - texture(Assets.KING); - - TextureFilm frames = new TextureFilm(texture, 16, 16); - - idle = new Animation( 5, true ); - idle.frames(frames, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 2, 2, 1, 1, 1); - - run = new Animation( 15, true ); - run.frames( frames, 3, 4, 5, 6, 7, 8 ); - - attack = new Animation( 15, false ); - attack.frames( frames, 9, 10, 11, 12, 13, 14, 15 ); - - die = new Animation( 10, false ); - die.frames( frames, 21, 22, 23, 24 ); - - play(idle); - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/Kostis12345Sprite.java b/java/com/hmdzl/spspd/change/sprites/Kostis12345Sprite.java deleted file mode 100644 index 77eb8216..00000000 --- a/java/com/hmdzl/spspd/change/sprites/Kostis12345Sprite.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.levels.Level; -import com.watabou.noosa.TextureFilm; -import com.watabou.noosa.audio.Sample; -import com.watabou.noosa.particles.Emitter; - -public class Kostis12345Sprite extends MobSprite { - - public Kostis12345Sprite() { - super(); - - texture( Assets.KOSTIS ); - - TextureFilm frames = new TextureFilm( texture, 16, 16 ); - - idle = new Animation( 3, true ); - idle.frames(frames, 0, 0, 1, 1, 2, 2, 3, 3, 3, 3, 3, 3); - - run = new Animation( 3, true ); - run.frames( frames, 0, 0, 1, 1, 2, 2, 3, 3, 3, 3, 3, 3 ); - - attack = new Animation( 12, false ); - attack.frames( frames, 0, 2, 3 ); - - die = new Animation( 20, false ); - die.frames( frames, 0 ); - - play( idle ); - } - - -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/sprites/LaJiSprite.java b/java/com/hmdzl/spspd/change/sprites/LaJiSprite.java deleted file mode 100644 index 97d85c09..00000000 --- a/java/com/hmdzl/spspd/change/sprites/LaJiSprite.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.levels.Level; -import com.watabou.noosa.TextureFilm; -import com.watabou.noosa.audio.Sample; -import com.watabou.noosa.particles.Emitter; - -public class LaJiSprite extends MobSprite { - - public LaJiSprite() { - super(); - - texture( Assets.LAJI ); - - TextureFilm frames = new TextureFilm( texture, 16, 16 ); - - idle = new Animation( 3, true ); - idle.frames(frames, 0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3); - - run = new Animation( 20, true ); - run.frames( frames, 0 ); - - attack = new Animation( 12, false ); - attack.frames( frames, 0, 2, 3 ); - - die = new Animation( 20, false ); - die.frames( frames, 0 ); - - play( idle ); - } - - -} diff --git a/java/com/hmdzl/spspd/change/sprites/LarvaSprite.java b/java/com/hmdzl/spspd/change/sprites/LarvaSprite.java deleted file mode 100644 index ed00b2de..00000000 --- a/java/com/hmdzl/spspd/change/sprites/LarvaSprite.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.effects.Splash; -import com.watabou.noosa.TextureFilm; - -public class LarvaSprite extends MobSprite { - - public LarvaSprite() { - super(); - - texture(Assets.LARVA); - - TextureFilm frames = new TextureFilm(texture, 12, 8); - - idle = new Animation(5, true); - idle.frames(frames, 4, 4, 4, 4, 4, 5, 5); - - run = new Animation(12, true); - run.frames(frames, 0, 1, 2, 3); - - attack = new Animation(15, false); - attack.frames(frames, 6, 5, 7); - - die = new Animation(10, false); - die.frames(frames, 8); - - play(idle); - } - - @Override - public int blood() { - return 0xbbcc66; - } - - @Override - public void die() { - Splash.at(center(), blood(), 10); - super.die(); - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/LerySprite.java b/java/com/hmdzl/spspd/change/sprites/LerySprite.java deleted file mode 100644 index 85e5c080..00000000 --- a/java/com/hmdzl/spspd/change/sprites/LerySprite.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.mobs.pets.LeryFire; -import com.hmdzl.spspd.change.effects.MagicMissile; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.levels.Level; -import com.watabou.noosa.TextureFilm; -import com.watabou.noosa.audio.Sample; -import com.watabou.noosa.particles.Emitter; -import com.watabou.utils.Callback; - -public class LerySprite extends MobSprite { - - public LerySprite() { - super(); - - texture( Assets.ELEMENTAL ); - - TextureFilm frames = new TextureFilm( texture, 12, 14 ); - - idle = new Animation( 10, true ); - idle.frames( frames, 21, 22, 23 ); - - run = new Animation( 12, true ); - run.frames( frames, 21, 22, 24 ); - - attack = new Animation( 15, false ); - attack.frames( frames, 25, 26, 27 ); - - zap = attack.clone(); - - die = new Animation( 15, false ); - die.frames( frames, 28, 29, 30, 31, 32, 33, 34, 33 ); - - play( idle ); - } - - @Override - public void link( Char ch ) { - super.link( ch ); - add( CharSprite.State.BURNING ); - } - @Override - public void die() { - super.die(); - remove( CharSprite.State.BURNING ); - } - - @Override - public void zap(int cell) { - - turnTo(ch.pos, cell); - play(zap); - - MagicMissile.fire(parent, ch.pos, cell, new Callback() { - @Override - public void call() { - ((LeryFire) ch).onZapComplete(); - } - }); - Sample.INSTANCE.play(Assets.SND_ZAP); - } - @Override - public int blood() { - return 0xFFFF7D13; - } - - -} diff --git a/java/com/hmdzl/spspd/change/sprites/LichDancerSprite.java b/java/com/hmdzl/spspd/change/sprites/LichDancerSprite.java deleted file mode 100644 index ff3534a4..00000000 --- a/java/com/hmdzl/spspd/change/sprites/LichDancerSprite.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.watabou.noosa.Game; -import com.watabou.noosa.TextureFilm; - -public class LichDancerSprite extends MobSprite { - - public LichDancerSprite() { - super(); - - texture(Assets.LICH_DANCER); - - TextureFilm frames = new TextureFilm(texture, 16, 16); - - idle = new Animation(10, true); - idle.frames(frames, 0, 0, 0, 0, 1, 2, 0, 1); - - run = new Animation(15, true); - run.frames(frames, 2, 3, 4, 5); - - attack = new Animation(12, false); - attack.frames(frames, 6, 7, 8, 9); - - die = new Animation(12, false); - die.frames(frames, 10, 11, 12, 13); - - play(idle); - } - - @Override - public void update() { - super.update(); - if (flashTime <= 0 ){ - float interval = (Game.timeTotal % 9 ) /3f; - tint(interval > 2 ? interval - 2 : Math.max(0, 1 - interval), - interval > 1 ? Math.max(0, 2-interval): interval, - interval > 2 ? Math.max(0, 3-interval): interval-1, 0.5f); - } - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/sprites/LightDragonSprite.java b/java/com/hmdzl/spspd/change/sprites/LightDragonSprite.java deleted file mode 100644 index 3fa95d8f..00000000 --- a/java/com/hmdzl/spspd/change/sprites/LightDragonSprite.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.DungeonTilemap; -import com.hmdzl.spspd.change.actors.mobs.Warlock; -import com.hmdzl.spspd.change.actors.mobs.pets.GoldDragon; -import com.hmdzl.spspd.change.effects.Beam; -import com.hmdzl.spspd.change.effects.Lightning; -import com.hmdzl.spspd.change.effects.MagicMissile; -import com.watabou.noosa.TextureFilm; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Callback; - -public class LightDragonSprite extends MobSprite { - private int attackPos; - //Frames 1-4 are idle, 5-8 are moving, 9-12 are attack and the last are for death RBVG - - private int[] points = new int[2]; - - public LightDragonSprite() { - super(); - - texture(Assets.PETDRAGON); - - TextureFilm frames = new TextureFilm(texture, 16, 16); - - idle = new Animation(2, true); - idle.frames(frames, 96, 97, 98, 99); - - run = new Animation(8, true); - run.frames(frames, 100, 101, 102, 103); - - attack = new Animation(8, false); - attack.frames(frames, 104, 105, 106, 107); - - zap = attack.clone(); - - die = new Animation(8, false); - die.frames(frames, 108, 109, 110, 111); - - play(idle); - } - - @Override - public void attack(int pos) { - attackPos = pos; - super.attack(pos); - } - - - @Override - public void onComplete(Animation anim) { - super.onComplete(anim); - - if (anim == attack) { - if (Dungeon.visible[ch.pos] || Dungeon.visible[attackPos]) { - parent.add(new Beam.LightRay(center(), DungeonTilemap - .tileCenterToWorld(attackPos))); - } - } - } - - @Override - public int blood() { - return 0xFFcdcdb7; - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/LiveMossSprite.java b/java/com/hmdzl/spspd/change/sprites/LiveMossSprite.java deleted file mode 100644 index f8c1510f..00000000 --- a/java/com/hmdzl/spspd/change/sprites/LiveMossSprite.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.mobs.npcs.MirrorImage; -import com.watabou.noosa.TextureFilm; - -public class LiveMossSprite extends MobSprite { - - public LiveMossSprite() { - super(); - - texture( Assets.LIVEMOSS ); - - TextureFilm frames = new TextureFilm(texture, 16, 15); - - idle = new Animation( 2, true ); - idle.frames( frames, 0,0,0,1); - - run = new Animation( 10, true ); - run.frames( frames, 0,1,1,1,0,0); - - attack = new Animation( 15, false ); - attack.frames( frames, 1, 2, 2, 1, 1 ); - - die = new Animation( 10, false ); - die.frames( frames, 2, 2, 3, 3 ); - - play( idle ); - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/sprites/LocastanSprite.java b/java/com/hmdzl/spspd/change/sprites/LocastanSprite.java deleted file mode 100644 index 3d22c98f..00000000 --- a/java/com/hmdzl/spspd/change/sprites/LocastanSprite.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.levels.Level; -import com.watabou.noosa.TextureFilm; -import com.watabou.noosa.audio.Sample; -import com.watabou.noosa.particles.Emitter; - -public class LocastanSprite extends MobSprite { - - public LocastanSprite() { - super(); - - texture( Assets.LOCASTAN ); - - TextureFilm frames = new TextureFilm( texture, 16, 16 ); - - idle = new Animation( 3, true ); - idle.frames(frames, 0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3); - - run = new Animation( 20, true ); - run.frames( frames, 0 ); - - attack = new Animation( 12, false ); - attack.frames( frames, 0, 2, 3 ); - - die = new Animation( 20, false ); - die.frames( frames, 0 ); - - play( idle ); - } - - -} diff --git a/java/com/hmdzl/spspd/change/sprites/LynSprite.java b/java/com/hmdzl/spspd/change/sprites/LynSprite.java deleted file mode 100644 index dd0115b8..00000000 --- a/java/com/hmdzl/spspd/change/sprites/LynSprite.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.levels.Level; -import com.watabou.noosa.TextureFilm; -import com.watabou.noosa.audio.Sample; -import com.watabou.noosa.particles.Emitter; - -public class LynSprite extends MobSprite { - - public LynSprite() { - super(); - - texture( Assets.LYN ); - - TextureFilm frames = new TextureFilm( texture, 16, 16 ); - - idle = new Animation( 3, true ); - idle.frames(frames, 0, 0, 1, 1, 2, 2, 3, 3, 3, 3, 3, 3); - - run = new Animation( 20, true ); - run.frames( frames, 0 ); - - attack = new Animation( 12, false ); - attack.frames( frames, 0, 2, 3 ); - - die = new Animation( 20, false ); - die.frames( frames, 0 ); - - play( idle ); - } - - -} diff --git a/java/com/hmdzl/spspd/change/sprites/LynnSprite.java b/java/com/hmdzl/spspd/change/sprites/LynnSprite.java deleted file mode 100644 index 20f19026..00000000 --- a/java/com/hmdzl/spspd/change/sprites/LynnSprite.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.levels.Level; -import com.watabou.noosa.TextureFilm; -import com.watabou.noosa.audio.Sample; -import com.watabou.noosa.particles.Emitter; - -public class LynnSprite extends MobSprite { - - public LynnSprite() { - super(); - - texture( Assets.LYNN ); - - TextureFilm frames = new TextureFilm( texture, 16, 16 ); - - idle = new Animation( 3, true ); - idle.frames(frames, 0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3); - - run = new Animation( 20, true ); - run.frames( frames, 0 ); - - attack = new Animation( 12, false ); - attack.frames( frames, 0, 2, 3 ); - - die = new Animation( 20, false ); - die.frames( frames, 0 ); - - play( idle ); - } - - -} diff --git a/java/com/hmdzl/spspd/change/sprites/MagicEyeSprite.java b/java/com/hmdzl/spspd/change/sprites/MagicEyeSprite.java deleted file mode 100644 index 964861b4..00000000 --- a/java/com/hmdzl/spspd/change/sprites/MagicEyeSprite.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.DungeonTilemap; -import com.hmdzl.spspd.change.effects.DeathRay; -import com.watabou.noosa.TextureFilm; - -public class MagicEyeSprite extends MobSprite { - - private int attackPos; - - public MagicEyeSprite() { - super(); - - texture(Assets.MAGICEYE); - - TextureFilm frames = new TextureFilm(texture, 16, 18); - - idle = new Animation(8, true); - idle.frames(frames, 0, 1, 2); - - run = new Animation(12, true); - run.frames(frames, 5, 6); - - attack = new Animation(8, false); - attack.frames(frames, 4, 3); - - die = new Animation(8, false); - die.frames(frames, 7, 8, 9); - - play(idle); - } - - @Override - public void attack(int pos) { - attackPos = pos; - super.attack(pos); - } - - @Override - public void onComplete(Animation anim) { - super.onComplete(anim); - - if (anim == attack) { - if (Dungeon.visible[ch.pos] || Dungeon.visible[attackPos]) { - parent.add(new DeathRay(center(), DungeonTilemap - .tileCenterToWorld(attackPos))); - } - } - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/ManySkeletonSprite.java b/java/com/hmdzl/spspd/change/sprites/ManySkeletonSprite.java deleted file mode 100644 index 68e1ef5b..00000000 --- a/java/com/hmdzl/spspd/change/sprites/ManySkeletonSprite.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.levels.Level; -import com.watabou.noosa.Game; -import com.watabou.noosa.TextureFilm; -import com.watabou.noosa.audio.Sample; -import com.watabou.noosa.particles.Emitter; - -public class ManySkeletonSprite extends MobSprite { - - public ManySkeletonSprite() { - super(); - - texture( Assets.MANY_SKELETON ); - - TextureFilm frames = new TextureFilm( texture, 16, 16 ); - - idle = new Animation( 15, true ); - idle.frames(frames, 0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3); - - run = new Animation( 20, true ); - run.frames( frames, 0 ); - - attack = new Animation( 12, false ); - attack.frames( frames, 0, 2, 3 ); - - die = new Animation( 20, false ); - die.frames( frames, 0 ); - - play( idle ); - } - - -} diff --git a/java/com/hmdzl/spspd/change/sprites/MemoryOfSandSprite.java b/java/com/hmdzl/spspd/change/sprites/MemoryOfSandSprite.java deleted file mode 100644 index 277d0a03..00000000 --- a/java/com/hmdzl/spspd/change/sprites/MemoryOfSandSprite.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.levels.Level; -import com.watabou.noosa.TextureFilm; -import com.watabou.noosa.audio.Sample; -import com.watabou.noosa.particles.Emitter; - -public class MemoryOfSandSprite extends MobSprite { - - public MemoryOfSandSprite() { - super(); - - texture( Assets.MOS ); - - TextureFilm frames = new TextureFilm( texture, 16, 16 ); - - idle = new Animation( 3, true ); - idle.frames(frames, 0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3); - - run = new Animation( 20, true ); - run.frames( frames, 0 ); - - attack = new Animation( 12, false ); - attack.frames( frames, 0, 2, 3 ); - - die = new Animation( 20, false ); - die.frames( frames, 0 ); - - play( idle ); - } - - -} diff --git a/java/com/hmdzl/spspd/change/sprites/MillilitreSprite.java b/java/com/hmdzl/spspd/change/sprites/MillilitreSprite.java deleted file mode 100644 index 61c67524..00000000 --- a/java/com/hmdzl/spspd/change/sprites/MillilitreSprite.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.levels.Level; -import com.watabou.noosa.TextureFilm; -import com.watabou.noosa.audio.Sample; -import com.watabou.noosa.particles.Emitter; - -public class MillilitreSprite extends MobSprite { - - public MillilitreSprite() { - super(); - - texture( Assets.MILLILITRE ); - - TextureFilm frames = new TextureFilm( texture, 16, 16 ); - - idle = new Animation( 3, true ); - idle.frames(frames, 0, 0, 1, 1, 2, 2, 3, 3, 3, 3, 3, 3); - - run = new Animation( 3, true ); - run.frames( frames, 0, 0, 1, 1, 2, 2, 3, 3, 3, 3, 3, 3 ); - - attack = new Animation( 12, false ); - attack.frames( frames, 0, 2, 3 ); - - die = new Animation( 20, false ); - die.frames( frames, 0 ); - - play( idle ); - } - - -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/sprites/MimicSprite.java b/java/com/hmdzl/spspd/change/sprites/MimicSprite.java deleted file mode 100644 index beb19505..00000000 --- a/java/com/hmdzl/spspd/change/sprites/MimicSprite.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.watabou.noosa.TextureFilm; - -public class MimicSprite extends MobSprite { - - public MimicSprite() { - super(); - - texture(Assets.MIMIC); - - TextureFilm frames = new TextureFilm(texture, 16, 16); - - idle = new Animation(5, true); - idle.frames(frames, 0, 0, 0, 1, 1); - - run = new Animation(10, true); - run.frames(frames, 0, 1, 2, 3, 3, 2, 1); - - attack = new Animation(10, false); - attack.frames(frames, 0, 4, 5, 6); - - die = new Animation(5, false); - die.frames(frames, 7, 8, 9); - - play(idle); - } - - @Override - public int blood() { - return 0xFFcb9700; - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/MirrorSprite.java b/java/com/hmdzl/spspd/change/sprites/MirrorSprite.java deleted file mode 100644 index 3ce184d1..00000000 --- a/java/com/hmdzl/spspd/change/sprites/MirrorSprite.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.mobs.npcs.MirrorImage; -import com.watabou.noosa.TextureFilm; - -public class MirrorSprite extends MobSprite { - - private static final int FRAME_WIDTH = 12; - private static final int FRAME_HEIGHT = 15; - - public MirrorSprite() { - super(); - - texture(Dungeon.hero.heroClass.spritesheet()); - updateArmor(0); - idle(); - } - - @Override - public void link(Char ch) { - super.link(ch); - updateArmor(((MirrorImage) ch).skin); - } - - public void updateArmor(int tier) { - TextureFilm film = new TextureFilm(HeroSprite.skins(), tier, - FRAME_WIDTH, FRAME_HEIGHT); - - idle = new Animation(1, true); - idle.frames(film, 0, 0, 0, 1, 0, 0, 1, 1); - - run = new Animation(20, true); - run.frames(film, 2, 3, 4, 5, 6, 7); - - die = new Animation(20, false); - die.frames(film, 0); - - attack = new Animation(15, false); - attack.frames(film, 13, 14, 15, 0); - - idle(); - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/MissileSprite.java b/java/com/hmdzl/spspd/change/sprites/MissileSprite.java deleted file mode 100644 index 0758a9a2..00000000 --- a/java/com/hmdzl/spspd/change/sprites/MissileSprite.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.DungeonTilemap; -import com.hmdzl.spspd.change.items.Item; -import com.watabou.noosa.tweeners.PosTweener; -import com.watabou.noosa.tweeners.Tweener; -import com.watabou.utils.Callback; -import com.watabou.utils.PointF; - -public class MissileSprite extends ItemSprite implements Tweener.Listener { - - private static final float SPEED = 240f; - - private Callback callback; - - public MissileSprite() { - super(); - originToCenter(); - } - - public void reset(int from, int to, Item item, Callback listener) { - if (item == null) { - reset(from, to, 0, null, listener); - } else { - reset(from, to, item.image(), item.glowing(), listener); - } - } - - public void reset(int from, int to, int image, Glowing glowing, - Callback listener) { - revive(); - - view(image, glowing); - - this.callback = listener; - - point(DungeonTilemap.tileToWorld(from)); - PointF dest = DungeonTilemap.tileToWorld(to); - - PointF d = PointF.diff(dest, point()); - speed.set(d).normalize().scale(SPEED); - - if (image == ItemSpriteSheet.KNIVE - || image == ItemSpriteSheet.INCENDIARY_DART - || image == ItemSpriteSheet.POSION_DART) { - - angularSpeed = 0; - angle = 135 - (float) (Math.atan2(d.x, d.y) / 3.1415926 * 180); - - } else if (image == ItemSpriteSheet.WAVE - || image == ItemSpriteSheet.SKULLWEP) { - - angularSpeed = 0; - angle = 90 - (float) (Math.atan2(d.x, d.y) / 3.1415926 * 180); - - } else { - - angularSpeed = image == 15 || image == 106 ? 1440 : 720; - - } - - PosTweener tweener = new PosTweener(this, dest, d.length() / SPEED); - tweener.listener = this; - parent.add(tweener); - } - - @Override - public void onComplete(Tweener tweener) { - kill(); - if (callback != null) { - callback.call(); - } - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/MobSprite.java b/java/com/hmdzl/spspd/change/sprites/MobSprite.java deleted file mode 100644 index baf0f35a..00000000 --- a/java/com/hmdzl/spspd/change/sprites/MobSprite.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.DungeonTilemap; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.watabou.noosa.tweeners.AlphaTweener; -import com.watabou.noosa.tweeners.ScaleTweener; -import com.watabou.utils.PointF; -import com.watabou.utils.Random; - -public class MobSprite extends CharSprite { - - private static final float FADE_TIME = 3f; - private static final float FALL_TIME = 1f; - - @Override - public void update() { - sleeping = ch != null && ((Mob) ch).state == ((Mob) ch).SLEEPING; - super.update(); - } - - @Override - public void onComplete(Animation anim) { - - super.onComplete(anim); - - if (anim == die) { - parent.add(new AlphaTweener(this, 0, FADE_TIME) { - @Override - protected void onComplete() { - MobSprite.this.killAndErase(); - parent.erase(this); - }; - }); - } - } - - public void fall() { - - origin.set(width / 2, height - DungeonTilemap.SIZE / 2); - angularSpeed = Random.Int(2) == 0 ? -720 : 720; - - parent.add(new ScaleTweener(this, new PointF(0, 0), FALL_TIME) { - @Override - protected void onComplete() { - MobSprite.this.killAndErase(); - parent.erase(this); - }; - - @Override - protected void updateValues(float progress) { - super.updateValues(progress); - am = 1 - progress; - } - }); - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/MobileSprite.java b/java/com/hmdzl/spspd/change/sprites/MobileSprite.java deleted file mode 100644 index 5224f906..00000000 --- a/java/com/hmdzl/spspd/change/sprites/MobileSprite.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.weapon.missiles.EscapeKnive; -import com.hmdzl.spspd.change.levels.Level; -import com.watabou.noosa.TextureFilm; -import com.watabou.noosa.audio.Sample; -import com.watabou.noosa.particles.Emitter; -import com.watabou.utils.Callback; - -public class MobileSprite extends MobSprite { - private Animation cast; - public MobileSprite() { - super(); - - texture( Assets.MOBILE ); - - TextureFilm frames = new TextureFilm( texture, 16, 16 ); - - idle = new Animation( 3, true ); - idle.frames(frames, 0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3); - - run = new Animation( 20, true ); - run.frames( frames, 0 ); - - attack = new Animation( 12, false ); - attack.frames( frames, 0, 2, 3 ); - - cast = attack.clone(); - - die = new Animation( 20, false ); - die.frames( frames, 0 ); - - play( idle ); - } - @Override - public void attack(int cell) { - if (!Level.adjacent(cell, ch.pos)) { - - ((MissileSprite) parent.recycle(MissileSprite.class)).reset(ch.pos, - cell, new EscapeKnive(), new Callback() { - @Override - public void call() { - ch.onAttackComplete(); - } - }); - - play(cast); - turnTo(ch.pos, cell); - - } else { - - super.attack(cell); - - } - } - -} diff --git a/java/com/hmdzl/spspd/change/sprites/MonkSprite.java b/java/com/hmdzl/spspd/change/sprites/MonkSprite.java deleted file mode 100644 index 5559f4e7..00000000 --- a/java/com/hmdzl/spspd/change/sprites/MonkSprite.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.watabou.noosa.TextureFilm; -import com.watabou.utils.Random; - -public class MonkSprite extends MobSprite { - - private Animation kick; - - public MonkSprite() { - super(); - - texture(Assets.MONK); - - TextureFilm frames = new TextureFilm(texture, 15, 14); - - idle = new Animation(6, true); - idle.frames(frames, 1, 0, 1, 2); - - run = new Animation(15, true); - run.frames(frames, 11, 12, 13, 14, 15, 16); - - attack = new Animation(12, false); - attack.frames(frames, 3, 4, 3, 4); - - kick = new Animation(10, false); - kick.frames(frames, 5, 6, 5); - - die = new Animation(15, false); - die.frames(frames, 1, 7, 8, 8, 9, 10); - - play(idle); - } - - @Override - public void attack(int cell) { - super.attack(cell); - if (Random.Float() < 0.5f) { - play(kick); - } - } - - @Override - public void onComplete(Animation anim) { - super.onComplete(anim == kick ? attack : anim); - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/MonkeySprite.java b/java/com/hmdzl/spspd/change/sprites/MonkeySprite.java deleted file mode 100644 index f355ab13..00000000 --- a/java/com/hmdzl/spspd/change/sprites/MonkeySprite.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.effects.MagicMissile; -import com.watabou.noosa.TextureFilm; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Callback; - -public class MonkeySprite extends MobSprite { - - //Frames 1-4 are idle, 5-8 are moving, 9-12 are attack and the last are for death RBVG - - public MonkeySprite() { - super(); - - texture(Assets.KLIKS); - - TextureFilm frames = new TextureFilm(texture, 16, 16); - - idle = new Animation(2, true); - idle.frames(frames, 17, 18, 19, 20); - - run = new Animation(8, true); - run.frames(frames, 21, 22, 23, 24); - - attack = new Animation(8, false); - attack.frames(frames, 25, 26, 27, 28); - - zap = attack.clone(); - - die = new Animation(8, false); - die.frames(frames, 29, 30, 30, 30); - - play(idle); - } - - - @Override - public int blood() { - return 0xFFcdcdb7; - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/MonsterBoxSprite.java b/java/com/hmdzl/spspd/change/sprites/MonsterBoxSprite.java deleted file mode 100644 index dbb42483..00000000 --- a/java/com/hmdzl/spspd/change/sprites/MonsterBoxSprite.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.watabou.noosa.TextureFilm; - -public class MonsterBoxSprite extends MobSprite { - - public MonsterBoxSprite() { - super(); - - texture(Assets.MONSTERBOX); - - TextureFilm frames = new TextureFilm(texture, 16, 16); - - idle = new Animation(5, true); - idle.frames(frames, 0, 0, 0, 1, 1); - - run = new Animation(10, true); - run.frames(frames, 0, 1, 2, 3, 3, 2, 1); - - attack = new Animation(10, false); - attack.frames(frames, 0, 4, 5, 6); - - die = new Animation(5, false); - die.frames(frames, 7, 8, 9); - - play(idle); - } - - @Override - public int blood() { - return 0xFFcb9700; - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/MossySkeletonSprite.java b/java/com/hmdzl/spspd/change/sprites/MossySkeletonSprite.java deleted file mode 100644 index 5fcf3b2b..00000000 --- a/java/com/hmdzl/spspd/change/sprites/MossySkeletonSprite.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.effects.Speck; -import com.watabou.noosa.TextureFilm; - -public class MossySkeletonSprite extends MobSprite { - - public MossySkeletonSprite() { - super(); - - texture(Assets.MOSSYSKELETON); - - TextureFilm frames = new TextureFilm(texture, 12, 15); - - idle = new Animation(12, true); - idle.frames(frames, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3); - - run = new Animation(15, true); - run.frames(frames, 4, 5, 6, 7, 8, 9); - - attack = new Animation(15, false); - attack.frames(frames, 14, 15, 16); - - die = new Animation(12, false); - die.frames(frames, 10, 11, 12, 13); - - play(idle); - } - - @Override - public void die() { - super.die(); - if (Dungeon.visible[ch.pos]) { - emitter().burst(Speck.factory(Speck.BONE), 6); - } - } - - @Override - public int blood() { - return 0xFFcccccc; - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/MrDestructo2dot0Sprite.java b/java/com/hmdzl/spspd/change/sprites/MrDestructo2dot0Sprite.java deleted file mode 100644 index 91667cba..00000000 --- a/java/com/hmdzl/spspd/change/sprites/MrDestructo2dot0Sprite.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.DungeonTilemap; -import com.hmdzl.spspd.change.effects.DeathRay; -import com.watabou.noosa.TextureFilm; - -public class MrDestructo2dot0Sprite extends MobSprite { - - private int attackPos; - - public MrDestructo2dot0Sprite() { - super(); - - texture(Assets.MRDESTRUCTO2); - - TextureFilm frames = new TextureFilm(texture, 16, 18); - - idle = new Animation(2, true); - idle.frames(frames, 1, 2, 3, 4); - - run = new Animation(12, true); - run.frames(frames, 2, 3, 4); - - attack = new Animation(8, false); - attack.frames(frames, 1, 5); - - die = new Animation(8, false); - die.frames(frames, 1, 0, 6); - - play(idle); - } - - @Override - public void attack(int pos) { - attackPos = pos; - super.attack(pos); - } - - - @Override - public void onComplete(Animation anim) { - super.onComplete(anim); - - if (anim == attack) { - if (Dungeon.visible[ch.pos] || Dungeon.visible[attackPos]) { - parent.add(new DeathRay(center(), DungeonTilemap - .tileCenterToWorld(attackPos))); - } - } - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/MrDestructoSprite.java b/java/com/hmdzl/spspd/change/sprites/MrDestructoSprite.java deleted file mode 100644 index 08019255..00000000 --- a/java/com/hmdzl/spspd/change/sprites/MrDestructoSprite.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.DungeonTilemap; -import com.hmdzl.spspd.change.effects.DeathRay; -import com.watabou.noosa.TextureFilm; - -public class MrDestructoSprite extends MobSprite { - - private int attackPos; - - public MrDestructoSprite() { - super(); - - texture(Assets.MRDESTRUCTO); - - TextureFilm frames = new TextureFilm(texture, 16, 18); - - idle = new Animation(2, true); - idle.frames(frames, 1, 2, 3, 4); - - run = new Animation(12, true); - run.frames(frames, 2, 3, 4); - - attack = new Animation(8, false); - attack.frames(frames, 1, 5); - - die = new Animation(8, false); - die.frames(frames, 1, 0, 6); - - play(idle); - } - - @Override - public void attack(int pos) { - attackPos = pos; - super.attack(pos); - } - - - @Override - public void onComplete(Animation anim) { - super.onComplete(anim); - - if (anim == attack) { - if (Dungeon.visible[ch.pos] || Dungeon.visible[attackPos]) { - parent.add(new DeathRay(center(), DungeonTilemap - .tileCenterToWorld(attackPos))); - } - } - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/MusketeerSprite.java b/java/com/hmdzl/spspd/change/sprites/MusketeerSprite.java deleted file mode 100644 index 4ee8ab76..00000000 --- a/java/com/hmdzl/spspd/change/sprites/MusketeerSprite.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.items.weapon.missiles.ShatteredAmmo; -import com.hmdzl.spspd.change.levels.Level; -import com.watabou.noosa.TextureFilm; -import com.watabou.utils.Callback; -import com.watabou.utils.Random; - -public class MusketeerSprite extends MobSprite { - - private Animation cast; - - public MusketeerSprite() { - super(); - - texture(Assets.MUSKETEER); - - TextureFilm frames = new TextureFilm(texture, 15, 14); - - idle = new Animation(6, true); - idle.frames(frames, 1, 0, 1, 2); - - run = new Animation(15, true); - run.frames(frames, 9, 10, 11, 12, 13, 14); - - attack = new Animation(12, false); - attack.frames(frames, 3, 4, 3); - - cast = attack.clone(); - - die = new Animation(15, false); - die.frames(frames, 1, 5, 6, 7, 8); - - play(idle); - } - - @Override - public void attack(int cell) { - if (!Level.adjacent(cell, ch.pos)) { - - ((MissileSprite) parent.recycle(MissileSprite.class)).reset(ch.pos, - cell, new ShatteredAmmo(), new Callback() { - @Override - public void call() { - ch.onAttackComplete(); - } - }); - - play(cast); - turnTo(ch.pos, cell); - - } else { - - super.attack(cell); - - } - } - -} diff --git a/java/com/hmdzl/spspd/change/sprites/NYRDSSprite.java b/java/com/hmdzl/spspd/change/sprites/NYRDSSprite.java deleted file mode 100644 index b13f0478..00000000 --- a/java/com/hmdzl/spspd/change/sprites/NYRDSSprite.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.levels.Level; -import com.watabou.noosa.TextureFilm; -import com.watabou.noosa.audio.Sample; -import com.watabou.noosa.particles.Emitter; - -public class NYRDSSprite extends MobSprite { - - public NYRDSSprite() { - super(); - - texture( Assets.NYRDS ); - - TextureFilm frames = new TextureFilm( texture, 16, 14 ); - - idle = new Animation( 15, true ); - idle.frames(frames, 0, 0, 0, 0, 0, 0, 0, 1, 2, 2, 2, 3); - - run = new Animation( 20, true ); - run.frames( frames, 0 ); - - attack = new Animation( 12, false ); - attack.frames( frames, 0, 2, 3 ); - - die = new Animation( 20, false ); - die.frames( frames, 0 ); - - play( idle ); - } - - -} diff --git a/java/com/hmdzl/spspd/change/sprites/NewPlayerSprite.java b/java/com/hmdzl/spspd/change/sprites/NewPlayerSprite.java deleted file mode 100644 index df2853c7..00000000 --- a/java/com/hmdzl/spspd/change/sprites/NewPlayerSprite.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.levels.Level; -import com.watabou.noosa.TextureFilm; -import com.watabou.noosa.audio.Sample; -import com.watabou.noosa.particles.Emitter; - -public class NewPlayerSprite extends MobSprite { - - public NewPlayerSprite() { - super(); - - texture( Assets.NEW_PLAYER ); - - TextureFilm frames = new TextureFilm( texture, 16, 16 ); - - idle = new Animation( 3, true ); - idle.frames(frames, 0, 0, 1, 1, 2, 2, 3, 3, 3, 3, 3, 3); - - run = new Animation( 3, true ); - run.frames( frames, 0, 0, 1, 1, 2, 2, 3, 3, 3, 3, 3, 3 ); - - attack = new Animation( 12, false ); - attack.frames( frames, 0, 2, 3 ); - - die = new Animation( 20, false ); - die.frames( frames, 0 ); - - play( idle ); - } - - -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/sprites/NoodlemireSprite.java b/java/com/hmdzl/spspd/change/sprites/NoodlemireSprite.java deleted file mode 100644 index f876f9fb..00000000 --- a/java/com/hmdzl/spspd/change/sprites/NoodlemireSprite.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.levels.Level; -import com.watabou.noosa.TextureFilm; -import com.watabou.noosa.audio.Sample; -import com.watabou.noosa.particles.Emitter; - -public class NoodlemireSprite extends MobSprite { - - public NoodlemireSprite() { - super(); - - texture( Assets.NOODLEMIRE ); - - TextureFilm frames = new TextureFilm( texture, 16, 16 ); - - idle = new Animation( 3, true ); - idle.frames(frames, 0, 0, 1, 1, 2, 2, 3, 3, 3, 3, 3, 3); - - run = new Animation( 3, true ); - run.frames( frames, 0, 0, 1, 1, 2, 2, 3, 3, 3, 3, 3, 3 ); - - attack = new Animation( 12, false ); - attack.frames( frames, 0, 2, 3 ); - - die = new Animation( 20, false ); - die.frames( frames, 0 ); - - play( idle ); - } - - -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/sprites/ObeliskSprite.java b/java/com/hmdzl/spspd/change/sprites/ObeliskSprite.java deleted file mode 100644 index 03f94079..00000000 --- a/java/com/hmdzl/spspd/change/sprites/ObeliskSprite.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.levels.Level; -import com.watabou.noosa.TextureFilm; -import com.watabou.noosa.audio.Sample; -import com.watabou.noosa.particles.Emitter; - -public class ObeliskSprite extends MobSprite { - - public ObeliskSprite() { - super(); - - texture( Assets.OBELISK ); - - TextureFilm frames = new TextureFilm( texture, 16, 16 ); - - idle = new Animation( 3, true ); - idle.frames(frames, 0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3); - - run = new Animation( 20, true ); - run.frames( frames, 0 ); - - attack = new Animation( 12, false ); - attack.frames( frames, 0, 2, 3 ); - - die = new Animation( 20, false ); - die.frames( frames, 0 ); - - play( idle ); - } - - -} diff --git a/java/com/hmdzl/spspd/change/sprites/OldNewStwistSprite.java b/java/com/hmdzl/spspd/change/sprites/OldNewStwistSprite.java deleted file mode 100644 index 3d16c869..00000000 --- a/java/com/hmdzl/spspd/change/sprites/OldNewStwistSprite.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import java.util.Calendar; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.watabou.noosa.TextureFilm; - -public class OldNewStwistSprite extends MobSprite { - - public boolean gnollmission; - - public OldNewStwistSprite() { - super(); - - - gnollmission = (Dungeon.gnollmission == false); - - - final int c = gnollmission ? 8 : 0; - - texture(Assets.OLDNEWSTWIST); - - TextureFilm frames = new TextureFilm(texture, 12, 15); - - idle = new Animation(2, true); - idle.frames(frames, c + 0, c + 0, c + 0, c + 1); - - run = new Animation(10, true); - run.frames(frames, c + 2, c + 3, c + 4, c + 5, c + 6); - - attack = new Animation(15, false); - attack.frames(frames, c + 0); - - die = new Animation(10, false); - die.frames(frames, c + 0); - - play(idle); - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/Omicronrg9Sprite.java b/java/com/hmdzl/spspd/change/sprites/Omicronrg9Sprite.java deleted file mode 100644 index 580d86fb..00000000 --- a/java/com/hmdzl/spspd/change/sprites/Omicronrg9Sprite.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.levels.Level; -import com.watabou.noosa.Game; -import com.watabou.noosa.TextureFilm; -import com.watabou.noosa.audio.Sample; -import com.watabou.noosa.particles.Emitter; - -public class Omicronrg9Sprite extends MobSprite { - - public Omicronrg9Sprite() { - super(); - - texture( Assets.OMICRONRG9 ); - - TextureFilm frames = new TextureFilm( texture, 16, 16 ); - - idle = new Animation( 15, true ); - idle.frames(frames, 0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3); - - run = new Animation( 20, true ); - run.frames( frames, 0 ); - - attack = new Animation( 12, false ); - attack.frames( frames, 0, 2, 3 ); - - die = new Animation( 20, false ); - die.frames( frames, 0 ); - - play( idle ); - } - - -} diff --git a/java/com/hmdzl/spspd/change/sprites/OrbOfZotSprite.java b/java/com/hmdzl/spspd/change/sprites/OrbOfZotSprite.java deleted file mode 100644 index d212bdb3..00000000 --- a/java/com/hmdzl/spspd/change/sprites/OrbOfZotSprite.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.DungeonTilemap; -import com.hmdzl.spspd.change.effects.DeathRay; -import com.watabou.noosa.TextureFilm; - -public class OrbOfZotSprite extends MobSprite { - - private int attackPos; - - public OrbOfZotSprite() { - super(); - - texture(Assets.ORBOFZOT); - - TextureFilm frames = new TextureFilm(texture, 16, 18); - - idle = new Animation(2, true); - idle.frames(frames, 1, 2, 3, 4); - - run = new Animation(12, true); - run.frames(frames, 2, 3, 4); - - attack = new Animation(8, false); - attack.frames(frames, 1, 5); - - die = new Animation(8, false); - die.frames(frames, 1, 0, 6); - - play(idle); - } - - @Override - public void attack(int pos) { - attackPos = pos; - super.attack(pos); - } - - - @Override - public void onComplete(Animation anim) { - super.onComplete(anim); - - if (anim == attack) { - if (Dungeon.visible[ch.pos] || Dungeon.visible[attackPos]) { - parent.add(new DeathRay(center(), DungeonTilemap - .tileCenterToWorld(attackPos))); - } - } - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/OrcSprite.java b/java/com/hmdzl/spspd/change/sprites/OrcSprite.java deleted file mode 100644 index 684fbf3e..00000000 --- a/java/com/hmdzl/spspd/change/sprites/OrcSprite.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.effects.Speck; -import com.watabou.noosa.TextureFilm; - -public class OrcSprite extends MobSprite { - - public OrcSprite() { - super(); - - texture(Assets.ONI); - - TextureFilm frames = new TextureFilm(texture, 12, 16); - - idle = new Animation(12, true); - idle.frames(frames, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1); - - run = new Animation(15, true); - run.frames(frames, 0, 2, 3, 4); - - attack = new Animation(15, false); - attack.frames(frames, 5, 6, 6); - - die = new Animation(12, false); - die.frames(frames, 7, 8, 9, 10); - - play(idle); - } - -} diff --git a/java/com/hmdzl/spspd/change/sprites/OtiluckStoneSprite.java b/java/com/hmdzl/spspd/change/sprites/OtiluckStoneSprite.java deleted file mode 100644 index 56dc59b5..00000000 --- a/java/com/hmdzl/spspd/change/sprites/OtiluckStoneSprite.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.actors.mobs.LitTower; -import com.hmdzl.spspd.change.effects.Lightning; -import com.watabou.noosa.TextureFilm; - -public class OtiluckStoneSprite extends MobSprite { - - private int[] points = new int[2]; - - public OtiluckStoneSprite() { - super(); - - texture(Assets.OTILUKESTONE); - TextureFilm frames = new TextureFilm(texture, 16, 16); - - idle = new Animation(2, true); - idle.frames(frames, 0, 0, 0, 3, 0, 0, 3, 3); - - run = new Animation(15, true); - run.frames(frames, 0, 1, 2, 0); - - attack = new Animation(12, false); - attack.frames(frames, 0, 1, 4, 4, 4); - - zap = attack.clone(); - - die = new Animation(15, false); - die.frames(frames, 0, 5, 6, 7, 8, 7); - - play(idle); - } - - @Override - public void zap(int pos) { - - parent.add( new Lightning( ch.pos, pos,(LitTower) ch)); - - turnTo(ch.pos, pos); - play(zap); - } - -} diff --git a/java/com/hmdzl/spspd/change/sprites/OtilukeNPCSprite.java b/java/com/hmdzl/spspd/change/sprites/OtilukeNPCSprite.java deleted file mode 100644 index 51886daa..00000000 --- a/java/com/hmdzl/spspd/change/sprites/OtilukeNPCSprite.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import javax.microedition.khronos.opengles.GL10; - -import android.opengl.GLES20; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.effects.Halo; -import com.hmdzl.spspd.change.effects.particles.ElmoParticle; -import com.watabou.noosa.Game; -import com.watabou.noosa.TextureFilm; -import com.watabou.utils.PointF; - -public class OtilukeNPCSprite extends MobSprite { - - public OtilukeNPCSprite() { - super(); - - texture(Assets.OTILUKE); - - TextureFilm frames = new TextureFilm(texture, 16, 16); - - idle = new Animation(10, true); - idle.frames(frames, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, - 3, 3, 3, 3, 3, 2, 1); - - run = new Animation(20, true); - run.frames(frames, 0); - - die = new Animation(20, false); - die.frames(frames, 0); - - play(idle); - } - - -} diff --git a/java/com/hmdzl/spspd/change/sprites/OtilukeSprite.java b/java/com/hmdzl/spspd/change/sprites/OtilukeSprite.java deleted file mode 100644 index 648236a4..00000000 --- a/java/com/hmdzl/spspd/change/sprites/OtilukeSprite.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.actors.mobs.Otiluke; -import com.hmdzl.spspd.change.effects.MagicMissile; -import com.watabou.noosa.TextureFilm; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Callback; - -public class OtilukeSprite extends MobSprite { - - public OtilukeSprite() { - super(); - - texture(Assets.OTILUKE); - - TextureFilm frames = new TextureFilm(texture, 16, 16); - - idle = new Animation(2, true); - idle.frames(frames, 0, 0, 0, 3, 0, 0, 3, 3); - - run = new Animation(15, true); - run.frames(frames, 0, 1, 2, 0); - - attack = new Animation(12, false); - attack.frames(frames, 0, 1, 4, 4, 4); - - zap = attack.clone(); - - die = new Animation(15, false); - die.frames(frames, 0, 5, 6, 7, 8, 7); - - play(idle); - } - - @Override - public void zap(int cell) { - - turnTo(ch.pos, cell); - play(zap); - - MagicMissile.shadow(parent, ch.pos, cell, new Callback() { - @Override - public void call() { - ((Otiluke) ch).onZapComplete(); - } - }); - Sample.INSTANCE.play(Assets.SND_ZAP); - } - - @Override - public void onComplete(Animation anim) { - if (anim == zap) { - idle(); - } - super.onComplete(anim); - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/PainterSprite.java b/java/com/hmdzl/spspd/change/sprites/PainterSprite.java deleted file mode 100644 index 36dd3137..00000000 --- a/java/com/hmdzl/spspd/change/sprites/PainterSprite.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.levels.Level; -import com.watabou.noosa.Game; -import com.watabou.noosa.TextureFilm; -import com.watabou.noosa.audio.Sample; -import com.watabou.noosa.particles.Emitter; - -public class PainterSprite extends MobSprite { - - public PainterSprite() { - super(); - - texture( Assets.PAINTER ); - - TextureFilm frames = new TextureFilm( texture, 16, 16 ); - - idle = new Animation( 15, true ); - idle.frames(frames, 0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3); - - run = new Animation( 20, true ); - run.frames( frames, 0 ); - - attack = new Animation( 12, false ); - attack.frames( frames, 0, 2, 3 ); - - die = new Animation( 20, false ); - die.frames( frames, 0 ); - - play( idle ); - } - - -} diff --git a/java/com/hmdzl/spspd/change/sprites/PatrolUAVSprite.java b/java/com/hmdzl/spspd/change/sprites/PatrolUAVSprite.java deleted file mode 100644 index 05f68a94..00000000 --- a/java/com/hmdzl/spspd/change/sprites/PatrolUAVSprite.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.levels.Level; -import com.watabou.noosa.TextureFilm; -import com.watabou.utils.Callback; - -public class PatrolUAVSprite extends MobSprite { - - public PatrolUAVSprite() { - super(); - - texture(Assets.PATROLUAV); - - TextureFilm frames = new TextureFilm(texture, 16, 16); - - idle = new Animation(4, true); - idle.frames(frames, 0, 1, 2, 3, 4); - - run = new Animation(12, true); - run.frames(frames, 0,5,6,7); - - attack = new Animation(12, false); - attack.frames(frames, 0,8,9,8); - - die = new Animation(12, false); - die.frames(frames, 0, 10, 11,11); - - play(idle); - } - - } diff --git a/java/com/hmdzl/spspd/change/sprites/PinningFistSprite.java b/java/com/hmdzl/spspd/change/sprites/PinningFistSprite.java deleted file mode 100644 index bb759cf3..00000000 --- a/java/com/hmdzl/spspd/change/sprites/PinningFistSprite.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.effects.MagicMissile; -import com.watabou.noosa.TextureFilm; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Callback; - -public class PinningFistSprite extends MobSprite { - - public PinningFistSprite() { - super(); - - texture(Assets.PINNING); - - TextureFilm frames = new TextureFilm(texture, 24, 17); - - idle = new Animation(2, true); - idle.frames(frames, 0, 0, 1); - - run = new Animation(3, true); - run.frames(frames, 0, 1); - - attack = new Animation(8, false); - attack.frames(frames, 0, 5, 6); - - die = new Animation(10, false); - die.frames(frames, 0, 2, 3, 4); - - play(idle); - } - - private int posToShoot; - - @Override - public void attack(int cell) { - posToShoot = cell; - super.attack(cell); - } - - @Override - public void onComplete(Animation anim) { - if (anim == attack) { - - Sample.INSTANCE.play(Assets.SND_ZAP); - MagicMissile.force(parent, ch.pos, posToShoot, new Callback() { - @Override - public void call() { - ch.onAttackComplete(); - } - }); - - idle(); - - } else { - super.onComplete(anim); - } - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/PiranhaSprite.java b/java/com/hmdzl/spspd/change/sprites/PiranhaSprite.java deleted file mode 100644 index 153fdfa6..00000000 --- a/java/com/hmdzl/spspd/change/sprites/PiranhaSprite.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.watabou.noosa.TextureFilm; - -public class PiranhaSprite extends MobSprite { - - public PiranhaSprite() { - super(); - - texture(Assets.PIRANHA); - - TextureFilm frames = new TextureFilm(texture, 12, 16); - - idle = new Animation(8, true); - idle.frames(frames, 0, 1, 2, 1); - - run = new Animation(20, true); - run.frames(frames, 0, 1, 2, 1); - - attack = new Animation(20, false); - attack.frames(frames, 3, 4, 5, 6, 7, 8, 9, 10, 11); - - die = new Animation(4, false); - die.frames(frames, 12, 13, 14); - - play(idle); - } - - @Override - public void onComplete(Animation anim) { - super.onComplete(anim); - - if (anim == attack) { - GameScene.ripple(ch.pos); - } - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/PlagueDoctorSprite.java b/java/com/hmdzl/spspd/change/sprites/PlagueDoctorSprite.java deleted file mode 100644 index e6528ddb..00000000 --- a/java/com/hmdzl/spspd/change/sprites/PlagueDoctorSprite.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.mobs.npcs.MirrorImage; -import com.watabou.noosa.TextureFilm; - -public class PlagueDoctorSprite extends MobSprite { - - public PlagueDoctorSprite() { - super(); - - texture( Assets.PLAGUEDOCTOR ); - - TextureFilm frames = new TextureFilm(texture, 16, 16); - - idle = new Animation( 2, true ); - idle.frames( frames, 0,0,1,1); - - run = new Animation( 10, true ); - run.frames( frames, 1,2,2,3,2,1); - - attack = new Animation( 15, false ); - attack.frames( frames, 4, 5, 6, 7, 8 ); - - die = new Animation( 10, false ); - die.frames( frames, 8, 8, 9, 10 ); - - play( idle ); - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/sprites/PlantKingSprite.java b/java/com/hmdzl/spspd/change/sprites/PlantKingSprite.java deleted file mode 100644 index d98fb970..00000000 --- a/java/com/hmdzl/spspd/change/sprites/PlantKingSprite.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.levels.Level; -import com.watabou.noosa.Game; -import com.watabou.noosa.TextureFilm; -import com.watabou.noosa.audio.Sample; -import com.watabou.noosa.particles.Emitter; - -public class PlantKingSprite extends MobSprite { - - public PlantKingSprite() { - super(); - - texture( Assets.PLANT_KING ); - - TextureFilm frames = new TextureFilm( texture, 16, 16 ); - - idle = new Animation( 15, true ); - idle.frames(frames, 0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3); - - run = new Animation( 20, true ); - run.frames( frames, 0 ); - - attack = new Animation( 12, false ); - attack.frames( frames, 0, 2, 3 ); - - die = new Animation( 20, false ); - die.frames( frames, 0 ); - - play( idle ); - } - - -} diff --git a/java/com/hmdzl/spspd/change/sprites/PlantSprite.java b/java/com/hmdzl/spspd/change/sprites/PlantSprite.java deleted file mode 100644 index f0b00aa2..00000000 --- a/java/com/hmdzl/spspd/change/sprites/PlantSprite.java +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.DungeonTilemap; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.plants.Plant; -import com.watabou.noosa.Game; -import com.watabou.noosa.Image; -import com.watabou.noosa.TextureFilm; - -public class PlantSprite extends Image { - - private static final float DELAY = 0.2f; - - private enum State { - GROWING, NORMAL, WITHERING - } - - private State state = State.NORMAL; - private float time; - - private static TextureFilm frames; - - private int pos = -1; - - public PlantSprite() { - super(Assets.PLANTS); - - if (frames == null) { - frames = new TextureFilm(texture, 16, 16); - } - - origin.set(8, 12); - } - - public PlantSprite(int image) { - this(); - reset(image); - } - - public void reset(Plant plant) { - - revive(); - - reset(plant.image); - alpha(1f); - - pos = plant.pos; - x = (pos % Level.getWidth()) * DungeonTilemap.SIZE; - y = (pos / Level.getWidth()) * DungeonTilemap.SIZE; - - state = State.GROWING; - time = DELAY; - } - - public void reset(int image) { - frame(frames.get(image)); - } - - @Override - public void update() { - super.update(); - - visible = pos == -1 || Dungeon.visible[pos]; - - switch (state) { - case GROWING: - if ((time -= Game.elapsed) <= 0) { - state = State.NORMAL; - scale.set(1); - } else { - scale.set(1 - time / DELAY); - } - break; - case WITHERING: - if ((time -= Game.elapsed) <= 0) { - super.kill(); - } else { - alpha(time / DELAY); - } - break; - default: - } - } - - @Override - public void kill() { - state = State.WITHERING; - time = DELAY; - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/PoisonGooSprite.java b/java/com/hmdzl/spspd/change/sprites/PoisonGooSprite.java deleted file mode 100644 index 72eaae69..00000000 --- a/java/com/hmdzl/spspd/change/sprites/PoisonGooSprite.java +++ /dev/null @@ -1,127 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.watabou.noosa.TextureFilm; -import com.watabou.noosa.particles.Emitter; -import com.watabou.noosa.particles.Emitter.Factory; -import com.watabou.noosa.particles.PixelParticle; -import com.watabou.utils.PointF; -import com.watabou.utils.Random; - -public class PoisonGooSprite extends MobSprite { - - private Animation pump; - private Animation pumpAttack; - - public PoisonGooSprite() { - super(); - - texture(Assets.POISONGOO); - - TextureFilm frames = new TextureFilm(texture, 20, 14); - - idle = new Animation(10, true); - idle.frames(frames, 2, 1, 0, 0, 1); - - run = new Animation(15, true); - run.frames(frames, 3, 2, 1, 2); - - pump = new Animation(20, true); - pump.frames(frames, 4, 3, 2, 1, 0); - - pumpAttack = new Animation(20, false); - pumpAttack.frames(frames, 4, 3, 2, 1, 0, 7); - - attack = new Animation(10, false); - attack.frames(frames, 8, 9, 10); - - die = new Animation(10, false); - die.frames(frames, 5, 6, 7); - - play(idle); - } - - public void pumpUp() { - play(pump); - } - - public void pumpAttack() { - play(pumpAttack); - } - - @Override - public void play(Animation anim, boolean force) { - super.play(anim, force); - } - - @Override - public int blood() { - return 0xFF000000; - } - - public static class GooParticle extends PixelParticle.Shrinking { - - public static final Emitter.Factory FACTORY = new Factory() { - @Override - public void emit(Emitter emitter, int index, float x, float y) { - ((GooParticle) emitter.recycle(GooParticle.class)).reset(x, y); - } - }; - - public GooParticle() { - super(); - - color(0x000000); - lifespan = 0.3f; - - acc.set(0, +50); - } - - public void reset(float x, float y) { - revive(); - - this.x = x; - this.y = y; - - left = lifespan; - - size = 4; - speed.polar(-Random.Float(PointF.PI), Random.Float(32, 48)); - } - - @Override - public void update() { - super.update(); - float p = left / lifespan; - am = p > 0.5f ? (1 - p) * 2f : 1; - } - } - - @Override - public void onComplete(Animation anim) { - super.onComplete(anim); - - if (anim == pumpAttack) { - - idle(); - ch.onAttackComplete(); - } - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/PrisonWanderSprite.java b/java/com/hmdzl/spspd/change/sprites/PrisonWanderSprite.java deleted file mode 100644 index 554ce81c..00000000 --- a/java/com/hmdzl/spspd/change/sprites/PrisonWanderSprite.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.effects.Speck; -import com.watabou.noosa.TextureFilm; - -public class PrisonWanderSprite extends MobSprite { - - public PrisonWanderSprite() { - super(); - - texture(Assets.PRISONWANDER); - - TextureFilm frames = new TextureFilm( texture, 12, 16 ); - - idle = new Animation( 2, true ); - idle.frames( frames, 0, 0, 0, 1, 0, 0, 1, 1 ); - - run = new Animation( 15, true ); - run.frames( frames, 2, 3, 4, 5, 6, 7 ); - - attack = new Animation( 12, false ); - attack.frames( frames, 8, 9, 10 ); - - die = new Animation( 8, false ); - die.frames( frames, 11, 12, 13, 14 ); - - play( idle ); - } - -} diff --git a/java/com/hmdzl/spspd/change/sprites/RENSprite.java b/java/com/hmdzl/spspd/change/sprites/RENSprite.java deleted file mode 100644 index 53b48936..00000000 --- a/java/com/hmdzl/spspd/change/sprites/RENSprite.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.levels.Level; -import com.watabou.noosa.TextureFilm; -import com.watabou.noosa.audio.Sample; -import com.watabou.noosa.particles.Emitter; - -public class RENSprite extends MobSprite { - - public RENSprite() { - super(); - - texture( Assets.REN ); - - TextureFilm frames = new TextureFilm( texture, 16, 16 ); - - idle = new Animation( 15, true ); - idle.frames(frames, 0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3); - - run = new Animation( 20, true ); - run.frames( frames, 0 ); - - attack = new Animation( 12, false ); - attack.frames( frames, 0, 2, 3 ); - - die = new Animation( 20, false ); - die.frames( frames, 0 ); - - play( idle ); - } - - -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/sprites/RainSprite.java b/java/com/hmdzl/spspd/change/sprites/RainSprite.java deleted file mode 100644 index 769e09d4..00000000 --- a/java/com/hmdzl/spspd/change/sprites/RainSprite.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.levels.Level; -import com.watabou.noosa.TextureFilm; -import com.watabou.noosa.audio.Sample; -import com.watabou.noosa.particles.Emitter; - -public class RainSprite extends MobSprite { - - public RainSprite() { - super(); - - texture( Assets.RAIN ); - - TextureFilm frames = new TextureFilm( texture, 16, 16 ); - - idle = new Animation( 3, true ); - idle.frames(frames, 0, 0, 1, 1, 2, 2, 3, 3, 3, 3, 3, 3); - - run = new Animation( 3, true ); - run.frames( frames, 0, 0, 1, 1, 2, 2, 3, 3, 3, 3, 3, 3 ); - - attack = new Animation( 12, false ); - attack.frames( frames, 0, 2, 3 ); - - die = new Animation( 20, false ); - die.frames( frames, 0 ); - - play( idle ); - } - - -} diff --git a/java/com/hmdzl/spspd/change/sprites/RatBossSprite.java b/java/com/hmdzl/spspd/change/sprites/RatBossSprite.java deleted file mode 100644 index 3d47e935..00000000 --- a/java/com/hmdzl/spspd/change/sprites/RatBossSprite.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.watabou.noosa.TextureFilm; - -public class RatBossSprite extends MobSprite { - - public RatBossSprite() { - super(); - - texture(Assets.RAT); - - TextureFilm frames = new TextureFilm(texture, 16, 15); - - idle = new Animation(2, true); - idle.frames(frames, 80, 80, 80, 81); - - run = new Animation(10, true); - run.frames(frames, 86, 87, 88, 89, 90); - - attack = new Animation(15, false); - attack.frames(frames, 82, 83,84, 85, 80); - - die = new Animation(10, false); - die.frames(frames, 91, 92, 93, 94); - - play(idle); - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/RatKingSprite.java b/java/com/hmdzl/spspd/change/sprites/RatKingSprite.java deleted file mode 100644 index 30232b68..00000000 --- a/java/com/hmdzl/spspd/change/sprites/RatKingSprite.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import java.util.Calendar; - -import com.hmdzl.spspd.change.Assets; -import com.watabou.noosa.TextureFilm; - -public class RatKingSprite extends MobSprite { - - public boolean festive; - - public RatKingSprite() { - super(); - - final Calendar calendar = Calendar.getInstance(); - // once a year the rat king feels a bit festive! - festive = (calendar.get(Calendar.MONTH) == 11 && calendar - .get(Calendar.WEEK_OF_MONTH) > 2); - - final int c = festive ? 8 : 0; - - texture(Assets.RATKING); - - TextureFilm frames = new TextureFilm(texture, 16, 17); - - idle = new Animation(2, true); - idle.frames(frames, c + 0, c + 0, c + 0, c + 1); - - run = new Animation(10, true); - run.frames(frames, c + 2, c + 3, c + 4, c + 5, c + 6); - - attack = new Animation(15, false); - attack.frames(frames, c + 0); - - die = new Animation(10, false); - die.frames(frames, c + 0); - - play(idle); - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/RatSprite.java b/java/com/hmdzl/spspd/change/sprites/RatSprite.java deleted file mode 100644 index a1417650..00000000 --- a/java/com/hmdzl/spspd/change/sprites/RatSprite.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.watabou.noosa.TextureFilm; - -public class RatSprite extends MobSprite { - - public RatSprite() { - super(); - - texture(Assets.RAT); - - TextureFilm frames = new TextureFilm(texture, 16, 15); - - idle = new Animation(2, true); - idle.frames(frames, 0, 0, 0, 1); - - run = new Animation(10, true); - run.frames(frames, 6, 7, 8, 9, 10); - - attack = new Animation(15, false); - attack.frames(frames, 2, 3, 4, 5, 0); - - die = new Animation(10, false); - die.frames(frames, 11, 12, 13, 14); - - play(idle); - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/RavenwolfSprite.java b/java/com/hmdzl/spspd/change/sprites/RavenwolfSprite.java deleted file mode 100644 index bbaedab9..00000000 --- a/java/com/hmdzl/spspd/change/sprites/RavenwolfSprite.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.levels.Level; -import com.watabou.noosa.TextureFilm; -import com.watabou.noosa.audio.Sample; -import com.watabou.noosa.particles.Emitter; - -public class RavenwolfSprite extends MobSprite { - - public RavenwolfSprite() { - super(); - - texture( Assets.RAVEBWOLF ); - - TextureFilm frames = new TextureFilm( texture, 16, 16 ); - - idle = new Animation( 3, true ); - idle.frames(frames, 0, 0, 1, 1, 2, 2, 3, 3, 3, 3, 3, 3); - - run = new Animation( 3, true ); - run.frames( frames, 0, 0, 1, 1, 2, 2, 3, 3, 3, 3, 3, 3 ); - - attack = new Animation( 12, false ); - attack.frames( frames, 0, 2, 3 ); - - die = new Animation( 20, false ); - die.frames( frames, 0 ); - - play( idle ); - } - - -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/sprites/RedDragonSprite.java b/java/com/hmdzl/spspd/change/sprites/RedDragonSprite.java deleted file mode 100644 index e84f5aef..00000000 --- a/java/com/hmdzl/spspd/change/sprites/RedDragonSprite.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.actors.mobs.pets.RedDragon; -import com.hmdzl.spspd.change.effects.MagicMissile; -import com.watabou.noosa.TextureFilm; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Callback; - -public class RedDragonSprite extends MobSprite { - - //Frames 1-4 are idle, 5-8 are moving, 9-12 are attack and the last are for death - - public RedDragonSprite() { - super(); - - texture(Assets.PETDRAGON); - - TextureFilm frames = new TextureFilm(texture, 16, 16); - - idle = new Animation(2, true); - idle.frames(frames, 0, 1, 2, 3); - - run = new Animation(8, true); - run.frames(frames, 4, 5, 6, 7); - - attack = new Animation(8, false); - attack.frames(frames, 8, 9, 10, 11); - - zap = attack.clone(); - - die = new Animation(8, false); - die.frames(frames, 12, 13, 14, 15); - - play(idle); - } - - @Override - public void zap(int cell) { - - turnTo(ch.pos, cell); - play(zap); - - MagicMissile.fire(parent, ch.pos, cell, new Callback() { - @Override - public void call() { - ((RedDragon) ch).onZapComplete(); - } - }); - Sample.INSTANCE.play(Assets.SND_ZAP); - } - - @Override - public int blood() { - return 0xFFcdcdb7; - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/RedWraithSprite.java b/java/com/hmdzl/spspd/change/sprites/RedWraithSprite.java deleted file mode 100644 index 2da8bde0..00000000 --- a/java/com/hmdzl/spspd/change/sprites/RedWraithSprite.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.items.weapon.missiles.Wave; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.watabou.noosa.TextureFilm; -import com.watabou.utils.Callback; - -public class RedWraithSprite extends MobSprite { - - private Animation cast; - - public RedWraithSprite() { - super(); - - texture(Assets.REDWRAITH); - - TextureFilm frames = new TextureFilm(texture, 14, 15); - - idle = new Animation(5, true); - idle.frames(frames, 0, 1); - - run = new Animation(10, true); - run.frames(frames, 0, 1); - - attack = new Animation(10, false); - attack.frames(frames, 0, 2, 3); - - cast = attack.clone(); - - die = new Animation(8, false); - die.frames(frames, 0, 4, 5, 6, 7); - - play(idle); - } - - @Override - public int blood() { - return 0x88000000; - } - - @Override - public void attack(int cell) { - if (!Level.adjacent(cell, ch.pos)) { - //Char enemy = Actor.findChar(cell); - ((MissileSprite) parent.recycle(MissileSprite.class)).reset(ch.pos, - cell, new Wave(), new Callback() { - @Override - public void call() { - ch.onAttackComplete(); - } - }); - - - play(cast); - turnTo(ch.pos, cell); - - } else { - - super.attack(cell); - - } - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/RottingFistSprite.java b/java/com/hmdzl/spspd/change/sprites/RottingFistSprite.java deleted file mode 100644 index ccfeb357..00000000 --- a/java/com/hmdzl/spspd/change/sprites/RottingFistSprite.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.watabou.noosa.Camera; -import com.watabou.noosa.TextureFilm; - -public class RottingFistSprite extends MobSprite { - - private static final float FALL_SPEED = 64; - - public RottingFistSprite() { - super(); - - texture(Assets.ROTTING); - - TextureFilm frames = new TextureFilm(texture, 24, 17); - - idle = new Animation(2, true); - idle.frames(frames, 0, 0, 1); - - run = new Animation(3, true); - run.frames(frames, 0, 1); - - attack = new Animation(2, false); - attack.frames(frames, 0); - - die = new Animation(10, false); - die.frames(frames, 0, 2, 3, 4); - - play(idle); - } - - @Override - public void attack(int cell) { - super.attack(cell); - - speed.set(0, -FALL_SPEED); - acc.set(0, FALL_SPEED * 4); - } - - @Override - public void onComplete(Animation anim) { - super.onComplete(anim); - if (anim == attack) { - speed.set(0); - acc.set(0); - place(ch.pos); - - Camera.main.shake(4, 0.2f); - } - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/RustybladeSprite.java b/java/com/hmdzl/spspd/change/sprites/RustybladeSprite.java deleted file mode 100644 index d9525da0..00000000 --- a/java/com/hmdzl/spspd/change/sprites/RustybladeSprite.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.levels.Level; -import com.watabou.noosa.Game; -import com.watabou.noosa.TextureFilm; -import com.watabou.noosa.audio.Sample; -import com.watabou.noosa.particles.Emitter; - -public class RustybladeSprite extends MobSprite { - - public RustybladeSprite() { - super(); - - texture( Assets.RUSTYBLADE ); - - TextureFilm frames = new TextureFilm( texture, 16, 16 ); - - idle = new Animation( 15, true ); - idle.frames(frames, 0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3); - - run = new Animation( 20, true ); - run.frames( frames, 0 ); - - attack = new Animation( 12, false ); - attack.frames( frames, 0, 2, 3 ); - - die = new Animation( 20, false ); - die.frames( frames, 0 ); - - play( idle ); - } - - -} diff --git a/java/com/hmdzl/spspd/change/sprites/SFBSprite.java b/java/com/hmdzl/spspd/change/sprites/SFBSprite.java deleted file mode 100644 index 256667e9..00000000 --- a/java/com/hmdzl/spspd/change/sprites/SFBSprite.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.levels.Level; -import com.watabou.noosa.TextureFilm; -import com.watabou.noosa.audio.Sample; -import com.watabou.noosa.particles.Emitter; - -public class SFBSprite extends MobSprite { - - public SFBSprite() { - super(); - - texture( Assets.SFB ); - - TextureFilm frames = new TextureFilm( texture, 16, 16 ); - - idle = new Animation( 3, true ); - idle.frames(frames, 0, 0, 1, 1, 2, 2, 3, 3, 3, 3, 3, 3); - - run = new Animation( 20, true ); - run.frames( frames, 0 ); - - attack = new Animation( 12, false ); - attack.frames( frames, 0, 2, 3 ); - - die = new Animation( 20, false ); - die.frames( frames, 0 ); - - play( idle ); - } - - -} diff --git a/java/com/hmdzl/spspd/change/sprites/SP931Sprite.java b/java/com/hmdzl/spspd/change/sprites/SP931Sprite.java deleted file mode 100644 index fbb6288f..00000000 --- a/java/com/hmdzl/spspd/change/sprites/SP931Sprite.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.levels.Level; -import com.watabou.noosa.TextureFilm; -import com.watabou.noosa.audio.Sample; -import com.watabou.noosa.particles.Emitter; - -public class SP931Sprite extends MobSprite { - - public SP931Sprite() { - super(); - - texture( Assets.SP931 ); - - TextureFilm frames = new TextureFilm( texture, 16, 16 ); - - idle = new Animation( 3, true ); - idle.frames(frames, 0, 0, 1, 1, 2, 2, 3, 3, 3, 3, 3, 3); - - run = new Animation( 3, true ); - run.frames( frames, 0, 0, 1, 1, 2, 2, 3, 3, 3, 3, 3, 3 ); - - attack = new Animation( 12, false ); - attack.frames( frames, 0, 2, 3 ); - - die = new Animation( 20, false ); - die.frames( frames, 0 ); - - play( idle ); - } - - -} diff --git a/java/com/hmdzl/spspd/change/sprites/SadSaltanSprite.java b/java/com/hmdzl/spspd/change/sprites/SadSaltanSprite.java deleted file mode 100644 index d8ae9838..00000000 --- a/java/com/hmdzl/spspd/change/sprites/SadSaltanSprite.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import android.graphics.RectF; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.hero.HeroClass; -import com.watabou.gltextures.SmartTexture; -import com.watabou.gltextures.TextureCache; -import com.watabou.noosa.Camera; -import com.watabou.noosa.Image; -import com.watabou.noosa.TextureFilm; -import com.watabou.utils.Callback; - -public class SadSaltanSprite extends CharSprite { - - - public SadSaltanSprite(){ - super(); - - texture(Assets.SADSALTAN); - - TextureFilm film = new TextureFilm(texture, 12, 15); - - idle = new Animation(1, true); - idle.frames(film, 0, 0, 0, 1, 0, 0, 1, 1); - - run = new Animation(20, true); - run.frames(film, 2, 3, 4, 5, 6, 7); - - die = new Animation(20, false); - die.frames(film, 8, 9, 10, 11, 12, 11); - - attack = new Animation(15, false); - attack.frames(film, 13, 14, 15, 0); - - play(idle); - - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/SaidbySunSprite.java b/java/com/hmdzl/spspd/change/sprites/SaidbySunSprite.java deleted file mode 100644 index 9469c4dc..00000000 --- a/java/com/hmdzl/spspd/change/sprites/SaidbySunSprite.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.levels.Level; -import com.watabou.noosa.TextureFilm; -import com.watabou.noosa.audio.Sample; -import com.watabou.noosa.particles.Emitter; - -public class SaidbySunSprite extends MobSprite { - - public SaidbySunSprite() { - super(); - - texture( Assets.SAID_BY_SUN); - - TextureFilm frames = new TextureFilm( texture, 16, 16 ); - - idle = new Animation( 3, true ); - idle.frames(frames, 0, 0, 1, 1, 2, 2, 3, 3, 3, 3, 3, 3); - - run = new Animation( 3, true ); - run.frames( frames, 0, 0, 1, 1, 2, 2, 3, 3, 3, 3, 3, 3 ); - - attack = new Animation( 12, false ); - attack.frames( frames, 0, 2, 3 ); - - die = new Animation( 20, false ); - die.frames( frames, 0 ); - - play( idle ); - } - - -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/sprites/SandmobSprite.java b/java/com/hmdzl/spspd/change/sprites/SandmobSprite.java deleted file mode 100644 index 3c70270b..00000000 --- a/java/com/hmdzl/spspd/change/sprites/SandmobSprite.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Unleashed Pixel Dungeon - * Copyright (C) 2015 David Mitchell - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.watabou.noosa.TextureFilm; -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.scenes.GameScene; - -public class SandmobSprite extends MobSprite { - - // private int cellToAttack; - - public SandmobSprite() { - super(); - - texture( Assets.SANDMOB ); - - TextureFilm frames = new TextureFilm( texture, 16, 17 ); - - idle = new Animation( 8, true ); - idle.frames( frames, 0, 1, 2, 1 ); - - run = new Animation( 8, true ); - run.frames( frames, 0, 1, 2, 1 ); - - attack = new Animation( 14, false ); - attack.frames( frames, 3, 4, 5, 6, 5, 4, 3 ); - - die = new Animation( 6, false ); - die.frames( frames, 7, 8, 9 ); - - play( idle ); - } - - /* - @Override - public void attack( int cell ) { - if (!Level.adjacent(cell, ch.pos)) { - - cellToAttack = cell; - turnTo( ch.pos , cell ); - play( zap ); - - } else { - - super.attack( cell ); - - } - } - */ - - @Override - public void onComplete( Animation anim ) { - super.onComplete( anim ); - - /* - if (anim == zap) { - idle(); - - ((MissileSprite)parent.recycle( MissileSprite.class )). - reset(ch.pos, cellToAttack, new Dart(), new Callback() { - @Override - public void call() { - ch.onAttackComplete(); - } - }); - } else - */ - if (anim == attack) { - GameScene.ripple( ch.pos ); - } - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/ScarecrowSprite.java b/java/com/hmdzl/spspd/change/sprites/ScarecrowSprite.java deleted file mode 100644 index 88a88704..00000000 --- a/java/com/hmdzl/spspd/change/sprites/ScarecrowSprite.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.weapon.missiles.PoisonDart; -import com.hmdzl.spspd.change.levels.Level; -import com.watabou.noosa.TextureFilm; -import com.watabou.noosa.audio.Sample; -import com.watabou.noosa.particles.Emitter; -import com.watabou.utils.Callback; - -public class ScarecrowSprite extends MobSprite { - -private Animation cast; - - public ScarecrowSprite() { - super(); - - texture( Assets.SCARECROW ); - - TextureFilm frames = new TextureFilm( texture, 16, 16 ); - - idle = new Animation( 3, true ); - idle.frames(frames, 0, 0, 1, 1, 2, 2, 3, 3, 3, 3, 3, 3); - - run = new Animation( 3, true ); - run.frames( frames, 0, 0, 1, 1, 2, 2, 3, 3, 3, 3, 3, 3 ); - - attack = new Animation( 12, false ); - attack.frames( frames, 0, 2, 3 ); - - cast = attack.clone(); - - die = new Animation( 20, false ); - die.frames( frames, 0 ); - - play( idle ); - } - - - @Override - public void attack(int cell) { - if (!Level.adjacent(cell, ch.pos)) { - - ((MissileSprite) parent.recycle(MissileSprite.class)).reset(ch.pos, - cell, new PoisonDart(), new Callback() { - @Override - public void call() { - ch.onAttackComplete(); - } - }); - - play(cast); - turnTo(ch.pos, cell); - - } else { - - super.attack(cell); - - } - } - -} diff --git a/java/com/hmdzl/spspd/change/sprites/ScorpioSprite.java b/java/com/hmdzl/spspd/change/sprites/ScorpioSprite.java deleted file mode 100644 index ab0f116f..00000000 --- a/java/com/hmdzl/spspd/change/sprites/ScorpioSprite.java +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.items.weapon.missiles.EscapeKnive; -import com.hmdzl.spspd.change.levels.Level; -import com.watabou.noosa.TextureFilm; -import com.watabou.utils.Callback; - -public class ScorpioSprite extends MobSprite { - - private int cellToAttack; - - public ScorpioSprite() { - super(); - - texture(Assets.SCORPIO); - - TextureFilm frames = new TextureFilm(texture, 18, 17); - - idle = new Animation(12, true); - idle.frames(frames, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 1, 2, 1, 2); - - run = new Animation(8, true); - run.frames(frames, 5, 5, 6, 6); - - attack = new Animation(15, false); - attack.frames(frames, 0, 3, 4); - - zap = attack.clone(); - - die = new Animation(12, false); - die.frames(frames, 0, 7, 8, 9, 10); - - play(idle); - } - - @Override - public int blood() { - return 0xFF44FF22; - } - - @Override - public void attack(int cell) { - if (!Level.adjacent(cell, ch.pos)) { - - cellToAttack = cell; - turnTo(ch.pos, cell); - play(zap); - - } else { - - super.attack(cell); - - } - } - - @Override - public void onComplete(Animation anim) { - if (anim == zap) { - idle(); - - ((MissileSprite) parent.recycle(MissileSprite.class)).reset(ch.pos, - cellToAttack, new EscapeKnive(), new Callback() { - @Override - public void call() { - ch.onAttackComplete(); - } - }); - } else { - super.onComplete(anim); - } - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/ScorpionSprite.java b/java/com/hmdzl/spspd/change/sprites/ScorpionSprite.java deleted file mode 100644 index bc69e210..00000000 --- a/java/com/hmdzl/spspd/change/sprites/ScorpionSprite.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.watabou.noosa.TextureFilm; - -public class ScorpionSprite extends MobSprite { - - - public ScorpionSprite() { - super(); - - texture(Assets.SCORPIO); - - TextureFilm frames = new TextureFilm(texture, 18, 17); - - idle = new Animation(12, true); - idle.frames(frames, 28, 28, 28, 28, 28, 28, 28, 28, 29, 30, 29, 30, 29, 30); - - run = new Animation(8, true); - run.frames(frames, 33, 33, 34, 34); - - attack = new Animation(15, false); - attack.frames(frames, 28, 31, 32); - - die = new Animation(12, false); - die.frames(frames, 28, 35, 36, 37, 38); - - play(idle); - } - - @Override - public int blood() { - return 0xFF44FF22; - } - -} diff --git a/java/com/hmdzl/spspd/change/sprites/SeekingBombSprite.java b/java/com/hmdzl/spspd/change/sprites/SeekingBombSprite.java deleted file mode 100644 index 94c2ea85..00000000 --- a/java/com/hmdzl/spspd/change/sprites/SeekingBombSprite.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.watabou.noosa.TextureFilm; - -public class SeekingBombSprite extends MobSprite { - - public SeekingBombSprite() { - super(); - - texture(Assets.SEEKINGBOMB); - - TextureFilm frames = new TextureFilm(texture, 16, 16); - - idle = new Animation(5, true); - idle.frames(frames, 0, 0, 0, 0); - - run = new Animation(15, true); - run.frames(frames, 1, 2, 3, 4); - - attack = new Animation(12, false); - attack.frames(frames, 1, 2, 3); - - die = new Animation(12, false); - die.frames(frames, 4, 4, 4, 4); - - play(idle); - } - - @Override - public int blood() { - return 0xFFFFEA80; - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/SeekingClusterBombSprite.java b/java/com/hmdzl/spspd/change/sprites/SeekingClusterBombSprite.java deleted file mode 100644 index f90bdc3a..00000000 --- a/java/com/hmdzl/spspd/change/sprites/SeekingClusterBombSprite.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.watabou.noosa.TextureFilm; - -public class SeekingClusterBombSprite extends MobSprite { - - public SeekingClusterBombSprite() { - super(); - - texture(Assets.SEEKINGBOMB); - - TextureFilm frames = new TextureFilm(texture, 16, 16); - - idle = new Animation(5, true); - idle.frames(frames, 16, 16, 16, 16); - - run = new Animation(15, true); - run.frames(frames, 17, 18, 19, 20); - - attack = new Animation(12, false); - attack.frames(frames, 17, 18, 19); - - die = new Animation(12, false); - die.frames(frames, 20, 20, 20, 20); - - play(idle); - } - - @Override - public int blood() { - return 0xFFFFEA80; - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/SeniorSprite.java b/java/com/hmdzl/spspd/change/sprites/SeniorSprite.java deleted file mode 100644 index 140db3e4..00000000 --- a/java/com/hmdzl/spspd/change/sprites/SeniorSprite.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.watabou.noosa.TextureFilm; -import com.watabou.utils.Random; - -public class SeniorSprite extends MobSprite { - - private Animation kick; - - public SeniorSprite() { - super(); - - texture(Assets.MONK); - - TextureFilm frames = new TextureFilm(texture, 15, 14); - - idle = new Animation(6, true); - idle.frames(frames, 18, 17, 18, 19); - - run = new Animation(15, true); - run.frames(frames, 28, 29, 30, 31, 32, 33); - - attack = new Animation(12, false); - attack.frames(frames, 20, 21, 20, 21); - - kick = new Animation(10, false); - kick.frames(frames, 22, 23, 22); - - die = new Animation(15, false); - die.frames(frames, 18, 24, 25, 25, 26, 27); - - play(idle); - } - - @Override - public void attack(int cell) { - super.attack(cell); - if (Random.Float() < 0.3f) { - play(kick); - } - } - - @Override - public void onComplete(Animation anim) { - super.onComplete(anim == kick ? attack : anim); - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/SentinelSprite.java b/java/com/hmdzl/spspd/change/sprites/SentinelSprite.java deleted file mode 100644 index 466b718e..00000000 --- a/java/com/hmdzl/spspd/change/sprites/SentinelSprite.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.watabou.noosa.TextureFilm; - -public class SentinelSprite extends MobSprite { - - public SentinelSprite() { - super(); - - texture(Assets.SENTINEL); - - TextureFilm frames = new TextureFilm(texture, 12, 15); - - idle = new Animation(2, true); - idle.frames(frames, 0, 0, 0, 0, 0, 1, 1); - - run = new Animation(15, true); - run.frames(frames, 2, 3, 4, 5, 6, 7); - - attack = new Animation(12, false); - attack.frames(frames, 8, 9, 10); - - die = new Animation(5, false); - die.frames(frames, 11, 12, 13, 14, 15, 15); - - play(idle); - } - - @Override - public int blood() { - return 0xFFcdcdb7; - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/SewerHeartSprite.java b/java/com/hmdzl/spspd/change/sprites/SewerHeartSprite.java deleted file mode 100644 index 21703bbd..00000000 --- a/java/com/hmdzl/spspd/change/sprites/SewerHeartSprite.java +++ /dev/null @@ -1,141 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * Shattered Pixel Dungeon - * Copyright (C) 2014-2015 Evan Debenham - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.DungeonTilemap; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.mobs.SewerHeart; -import com.hmdzl.spspd.change.effects.Beam; -import com.hmdzl.spspd.change.effects.MagicMissile; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.effects.particles.EnergyParticle; -import com.watabou.noosa.MovieClip; -import com.watabou.noosa.TextureFilm; -import com.watabou.noosa.particles.Emitter; - -public class SewerHeartSprite extends MobSprite { - - private int zapPos; - - private Emitter cloud; - private Animation charging; - private Emitter chargeParticles; - - public SewerHeartSprite(){ - super(); - - texture( Assets.SEWER_HEART ); - - TextureFilm frames = new TextureFilm( texture, 16, 16 ); - - idle = new MovieClip.Animation( 1, true ); - idle.frames( frames, 0); - - run = new MovieClip.Animation( 1, true ); - run.frames( frames, 0 ); - - attack = new MovieClip.Animation( 10, false ); - attack.frames( frames, 0,1 ); - zap = attack.clone(); - - chargeParticles = centerEmitter(); - chargeParticles.autoKill = false; - chargeParticles.pour( EnergyParticle.FACTORY, 0.05f); - chargeParticles.on = false; - - die = new MovieClip.Animation( 8, false ); - die.frames( frames, 1, 2, 3, 4, 5, 6, 7, 7, 7 ); - - play( idle ); - } - - @Override - public void link( Char ch ) { - super.link( ch ); - if (((SewerHeart)ch).beamCharged) play(charging); - if (cloud == null) { - cloud = emitter(); - cloud.pour( Speck.factory(Speck.TOXIC), 0.7f ); - } - } - - @Override - public void turnTo(int from, int to) { - //do nothing - } - - @Override - public void update() { - - super.update(); - chargeParticles.pos(center()); - chargeParticles.visible = visible; - if (cloud != null) { - cloud.visible = visible; - } - } - - @Override - public void die() { - super.die(); - - if (cloud != null) { - cloud.on = false; - } - } - - public void charge( int pos ){ - turnTo(ch.pos, pos); - play(charging); - } - - @Override - public void play(Animation anim) { - chargeParticles.on = anim == charging; - super.play(anim); - } - - @Override - public void zap( int pos ) { - zapPos = pos; - super.zap( pos ); - } - - @Override - public void onComplete( Animation anim ) { - super.onComplete( anim ); - - if (anim == zap) { - idle(); - if (Actor.findChar(zapPos) != null){ - parent.add(new Beam.LightRay(center(), Actor.findChar(zapPos).sprite.center())); - } else { - parent.add(new Beam.LightRay(center(), DungeonTilemap.raisedTileCenterToWorld(zapPos))); - } - ((SewerHeart)ch).deathGaze(); - ch.next(); - } else if (anim == die){ - chargeParticles.killAndErase(); - } - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/SewerLasherSprite.java b/java/com/hmdzl/spspd/change/sprites/SewerLasherSprite.java deleted file mode 100644 index c724099e..00000000 --- a/java/com/hmdzl/spspd/change/sprites/SewerLasherSprite.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * Shattered Pixel Dungeon - * Copyright (C) 2014-2015 Evan Debenham - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.watabou.noosa.TextureFilm; - -public class SewerLasherSprite extends MobSprite { - - public SewerLasherSprite() { - super(); - - texture( Assets.SEWER_LASHER ); - - TextureFilm frames = new TextureFilm( texture, 12, 16 ); - - idle = new Animation( 0, true ); - idle.frames( frames, 0); - - run = new Animation( 0, true ); - run.frames( frames, 0); - - attack = new Animation( 24, false ); - attack.frames( frames, 0, 1, 2, 2, 1 ); - - die = new Animation( 12, false ); - die.frames( frames, 3, 4, 5, 6 ); - - play( idle ); - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/ShadowDragonSprite.java b/java/com/hmdzl/spspd/change/sprites/ShadowDragonSprite.java deleted file mode 100644 index 3deb3ae6..00000000 --- a/java/com/hmdzl/spspd/change/sprites/ShadowDragonSprite.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.actors.mobs.Warlock; -import com.hmdzl.spspd.change.actors.mobs.pets.ShadowDragon; -import com.hmdzl.spspd.change.effects.Lightning; -import com.hmdzl.spspd.change.effects.MagicMissile; -import com.watabou.noosa.TextureFilm; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Callback; - -public class ShadowDragonSprite extends MobSprite { - - //Frames 1-4 are idle, 5-8 are moving, 9-12 are attack and the last are for death RBVG - - private int[] points = new int[2]; - - public ShadowDragonSprite() { - super(); - - texture(Assets.PETDRAGON); - - TextureFilm frames = new TextureFilm(texture, 16, 16); - - idle = new Animation(2, true); - idle.frames(frames, 64, 65, 66, 67); - - run = new Animation(8, true); - run.frames(frames, 68, 69, 70, 71); - - attack = new Animation(8, false); - attack.frames(frames, 72, 73, 74, 75); - - zap = attack.clone(); - - die = new Animation(8, false); - die.frames(frames, 76, 77, 78, 79); - - play(idle); - } - - @Override - public void zap(int cell) { - - turnTo(ch.pos, cell); - play(zap); - - MagicMissile.shadow(parent, ch.pos, cell, new Callback() { - @Override - public void call() { - ((ShadowDragon) ch).onZapComplete(); - } - }); - Sample.INSTANCE.play(Assets.SND_ZAP); - } - - @Override - public int blood() { - return 0xFFcdcdb7; - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/ShadowRatSprite.java b/java/com/hmdzl/spspd/change/sprites/ShadowRatSprite.java deleted file mode 100644 index a1429bb9..00000000 --- a/java/com/hmdzl/spspd/change/sprites/ShadowRatSprite.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.watabou.noosa.TextureFilm; - -public class ShadowRatSprite extends MobSprite { - - public ShadowRatSprite() { - super(); - - texture(Assets.RAT); - - TextureFilm frames = new TextureFilm(texture, 16, 15); - - idle = new Animation(2, true); - idle.frames(frames, 64, 64, 64, 65); - - run = new Animation(10, true); - run.frames(frames, 70, 71, 72, 73, 74); - - attack = new Animation(15, false); - attack.frames(frames, 66, 67, 68, 64); - - die = new Animation(10, false); - die.frames(frames, 75, 76, 77, 78); - - play(idle); - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/ShadowYogSprite.java b/java/com/hmdzl/spspd/change/sprites/ShadowYogSprite.java deleted file mode 100644 index c259deaf..00000000 --- a/java/com/hmdzl/spspd/change/sprites/ShadowYogSprite.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.effects.Splash; -import com.watabou.noosa.TextureFilm; - -public class ShadowYogSprite extends MobSprite { - - - public ShadowYogSprite() { - super(); - - texture(Assets.SHADOWYOG); - - TextureFilm frames = new TextureFilm(texture, 20, 19); - - idle = new Animation(10, true); - idle.frames(frames, 0, 1, 2, 2, 1, 0, 3, 4, 4, 3, 0, 5, 6, 6, 5); - - run = new Animation(12, true); - run.frames(frames, 0); - - attack = new Animation(12, false); - attack.frames(frames, 0); - - zap = attack.clone(); - - die = new Animation(10, false); - die.frames(frames, 0, 7, 8, 9); - - play(idle); - } - - - @Override - public void die() { - super.die(); - - Splash.at(center(), blood(), 12); - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/ShamanSprite.java b/java/com/hmdzl/spspd/change/sprites/ShamanSprite.java deleted file mode 100644 index 88f8c866..00000000 --- a/java/com/hmdzl/spspd/change/sprites/ShamanSprite.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.actors.mobs.GnollShaman; -import com.hmdzl.spspd.change.effects.Lightning; -import com.watabou.noosa.TextureFilm; - -public class ShamanSprite extends MobSprite { - - private int[] points = new int[2]; - - public ShamanSprite() { - super(); - - texture(Assets.SHAMAN); - - TextureFilm frames = new TextureFilm(texture, 12, 15); - - idle = new Animation(2, true); - idle.frames(frames, 0, 0, 0, 1, 0, 0, 1, 1); - - run = new Animation(12, true); - run.frames(frames, 4, 5, 6, 7); - - attack = new Animation(12, false); - attack.frames(frames, 2, 3, 0); - - zap = attack.clone(); - - die = new Animation(12, false); - die.frames(frames, 8, 9, 10); - - play(idle); - } - - @Override - public void zap(int pos) { - - parent.add( new Lightning( ch.pos, pos, (GnollShaman) ch)); - - turnTo(ch.pos, pos); - play(zap); - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/SheepSprite.java b/java/com/hmdzl/spspd/change/sprites/SheepSprite.java deleted file mode 100644 index 94ed49b6..00000000 --- a/java/com/hmdzl/spspd/change/sprites/SheepSprite.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.watabou.noosa.TextureFilm; -import com.watabou.utils.Random; - -public class SheepSprite extends MobSprite { - - public SheepSprite() { - super(); - - texture(Assets.SHEEP); - - TextureFilm frames = new TextureFilm(texture, 16, 15); - - idle = new Animation(8, true); - idle.frames(frames, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 0); - - run = idle.clone(); - attack = idle.clone(); - - die = new Animation(20, false); - die.frames(frames, 0); - - play(idle); - curFrame = Random.Int(curAnim.frames.length); - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/ShellSprite.java b/java/com/hmdzl/spspd/change/sprites/ShellSprite.java deleted file mode 100644 index ca4d3d9d..00000000 --- a/java/com/hmdzl/spspd/change/sprites/ShellSprite.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.actors.mobs.Shell; -import com.hmdzl.spspd.change.effects.Lightning; -import com.watabou.noosa.TextureFilm; - -public class ShellSprite extends MobSprite { - - private int[] points = new int[2]; - - public ShellSprite() { - super(); - - texture(Assets.SHELL); - TextureFilm frames = new TextureFilm(texture, 16, 16); - - idle = new Animation(10, true); - idle.frames(frames, 0, 0, 0, 0, 0, 0, 0, 0, 0); - - run = idle.clone(); - die = idle.clone(); - attack = idle.clone(); - - zap = attack.clone(); - - idle(); - } - - @Override - public void zap(int pos) { - - parent.add( new Lightning( ch.pos, pos,(Shell) ch)); - - turnTo(ch.pos, pos); - play(zap); - } - -} diff --git a/java/com/hmdzl/spspd/change/sprites/ShieldedSprite.java b/java/com/hmdzl/spspd/change/sprites/ShieldedSprite.java deleted file mode 100644 index 9aa461d5..00000000 --- a/java/com/hmdzl/spspd/change/sprites/ShieldedSprite.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.items.weapon.missiles.EscapeKnive; -import com.hmdzl.spspd.change.levels.Level; -import com.watabou.noosa.TextureFilm; -import com.watabou.utils.Callback; - -public class ShieldedSprite extends MobSprite { - - private Animation cast; - - public ShieldedSprite() { - super(); - - texture(Assets.BRUTE); - - TextureFilm frames = new TextureFilm(texture, 12, 16); - - idle = new Animation(2, true); - idle.frames(frames, 21, 21, 21, 22, 21, 21, 22, 22); - - run = new Animation(12, true); - run.frames(frames, 25, 26, 27, 28); - - attack = new Animation(12, false); - attack.frames(frames, 23, 24); - - cast = attack.clone(); - - die = new Animation(12, false); - die.frames(frames, 29, 30, 31); - - play(idle); - } - @Override - public void attack(int cell) { - if (!Level.adjacent(cell, ch.pos)) { - - ((MissileSprite) parent.recycle(MissileSprite.class)).reset(ch.pos, - cell, new EscapeKnive(), new Callback() { - @Override - public void call() { - ch.onAttackComplete(); - } - }); - - play(cast); - turnTo(ch.pos, cell); - - } else { - - super.attack(cell); - - } - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/ShopkeeperSprite.java b/java/com/hmdzl/spspd/change/sprites/ShopkeeperSprite.java deleted file mode 100644 index f6b1cc34..00000000 --- a/java/com/hmdzl/spspd/change/sprites/ShopkeeperSprite.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.watabou.noosa.TextureFilm; -import com.watabou.noosa.particles.PixelParticle; - -public class ShopkeeperSprite extends MobSprite { - - private PixelParticle coin; - - public ShopkeeperSprite() { - super(); - - texture(Assets.KEEPER); - TextureFilm film = new TextureFilm(texture, 14, 14); - - idle = new Animation(10, true); - idle.frames(film, 1, 1, 1, 1, 1, 0, 0, 0, 0); - - run = idle.clone(); - die = idle.clone(); - attack = idle.clone(); - - idle(); - } - - @Override - public void onComplete(Animation anim) { - super.onComplete(anim); - - if (visible && anim == idle) { - if (coin == null) { - coin = new PixelParticle(); - parent.add(coin); - } - coin.reset(x + (flipHorizontal ? 0 : 13), y + 7, 0xFFFF00, 1, 0.5f); - coin.speed.y = -40; - coin.acc.y = +160; - } - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/ShowerSprite.java b/java/com/hmdzl/spspd/change/sprites/ShowerSprite.java deleted file mode 100644 index 95685a0d..00000000 --- a/java/com/hmdzl/spspd/change/sprites/ShowerSprite.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.levels.Level; -import com.watabou.noosa.TextureFilm; -import com.watabou.noosa.audio.Sample; -import com.watabou.noosa.particles.Emitter; - -public class ShowerSprite extends MobSprite { - - public ShowerSprite() { - super(); - - texture( Assets.SHOWER ); - - TextureFilm frames = new TextureFilm( texture, 16, 16 ); - - idle = new Animation( 3, true ); - idle.frames(frames, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1); - - run = new Animation( 3, true ); - run.frames( frames, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1 ); - - attack = new Animation( 12, false ); - attack.frames( frames, 0, 1, 1 ); - - die = new Animation( 20, false ); - die.frames( frames, 0 ); - - play( idle ); - } - - -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/sprites/SkeletonHand1Sprite.java b/java/com/hmdzl/spspd/change/sprites/SkeletonHand1Sprite.java deleted file mode 100644 index 1d01c453..00000000 --- a/java/com/hmdzl/spspd/change/sprites/SkeletonHand1Sprite.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.actors.Char; -import com.watabou.noosa.TextureFilm; - -public class SkeletonHand1Sprite extends MobSprite { - - public SkeletonHand1Sprite() { - super(); - - texture(Assets.SKELETONHAND1); - - TextureFilm frames = new TextureFilm(texture, 16, 16); - - idle = new Animation(2, true); - idle.frames(frames, 0, 1); - - run = new Animation(4, true); - run.frames(frames, 0, 1); - - attack = new Animation(5, false); - attack.frames(frames, 2, 3, 4, 5); - - die = new Animation(5, false); - die.frames(frames, 6, 7, 8, 9); - - play(idle); - } - - @Override - public void link(Char ch) { - super.link(ch); - add(State.BURNING); - } - - @Override - public void die() { - super.die(); - remove(State.BURNING); - } - -} diff --git a/java/com/hmdzl/spspd/change/sprites/SkeletonHand2Sprite.java b/java/com/hmdzl/spspd/change/sprites/SkeletonHand2Sprite.java deleted file mode 100644 index 22895efd..00000000 --- a/java/com/hmdzl/spspd/change/sprites/SkeletonHand2Sprite.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.watabou.noosa.TextureFilm; - -public class SkeletonHand2Sprite extends MobSprite { - - public SkeletonHand2Sprite() { - super(); - - texture(Assets.SKELETONHAND1); - - TextureFilm frames = new TextureFilm(texture, 16, 16); - - idle = new Animation(2, true); - idle.frames(frames, 0, 1); - - run = new Animation(4, true); - run.frames(frames, 0, 1); - - attack = new Animation(5, false); - attack.frames(frames, 2, 3, 4, 5); - - die = new Animation(5, false); - die.frames(frames, 6, 7, 8, 9); - - play(idle); - } - -} diff --git a/java/com/hmdzl/spspd/change/sprites/SkeletonKingSprite.java b/java/com/hmdzl/spspd/change/sprites/SkeletonKingSprite.java deleted file mode 100644 index de4c6514..00000000 --- a/java/com/hmdzl/spspd/change/sprites/SkeletonKingSprite.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.watabou.noosa.TextureFilm; - -public class SkeletonKingSprite extends MobSprite { - - public SkeletonKingSprite() { - super(); - - texture(Assets.SKELETONKING); - - TextureFilm frames = new TextureFilm(texture, 16, 16); - - idle = new Animation(5, true); - idle.frames(frames, 0, 1, 2); - - run = new Animation(6, true); - run.frames(frames, 3, 4); - - attack = new Animation(5, false); - attack.frames(frames, 5, 6, 7); - - die = new Animation(5, false); - die.frames(frames, 8, 9, 10, 11, 12, 13); - - play(idle); - } - -} diff --git a/java/com/hmdzl/spspd/change/sprites/SkeletonSprite.java b/java/com/hmdzl/spspd/change/sprites/SkeletonSprite.java deleted file mode 100644 index de3d1943..00000000 --- a/java/com/hmdzl/spspd/change/sprites/SkeletonSprite.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.effects.Speck; -import com.watabou.noosa.TextureFilm; - -public class SkeletonSprite extends MobSprite { - - public SkeletonSprite() { - super(); - - texture(Assets.SKELETON); - - TextureFilm frames = new TextureFilm(texture, 12, 15); - - idle = new Animation(12, true); - idle.frames(frames, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3); - - run = new Animation(15, true); - run.frames(frames, 4, 5, 6, 7, 8, 9); - - attack = new Animation(15, false); - attack.frames(frames, 14, 15, 16); - - die = new Animation(12, false); - die.frames(frames, 10, 11, 12, 13); - - play(idle); - } - - @Override - public void die() { - super.die(); - if (Dungeon.visible[ch.pos]) { - emitter().burst(Speck.factory(Speck.BONE), 6); - } - } - - @Override - public int blood() { - return 0xFFcccccc; - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/SnakeSprite.java b/java/com/hmdzl/spspd/change/sprites/SnakeSprite.java deleted file mode 100644 index ff1593a0..00000000 --- a/java/com/hmdzl/spspd/change/sprites/SnakeSprite.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Unleashed Pixel Dungeon - * Copyright (C) 2015 David Mitchell - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.watabou.noosa.TextureFilm; - -public class SnakeSprite extends MobSprite { - - public SnakeSprite() { - super(); - - texture( Assets.SNAKE ); - - TextureFilm frames = new TextureFilm( texture, 16, 16 ); - - idle = new Animation( 2, true ); - idle.frames( frames, 0, 0, 0, 1 ); - - run = new Animation( 10, true ); - run.frames( frames, 5, 4, 3, 4, 5 ); - - attack = new Animation( 14, false ); - attack.frames( frames, 0, 2, 0 ); - - die = new Animation( 10, false ); - die.frames( frames, 2, 6, 7 ); - - play( idle ); - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/SokobanBlackSheepSprite.java b/java/com/hmdzl/spspd/change/sprites/SokobanBlackSheepSprite.java deleted file mode 100644 index effa91c0..00000000 --- a/java/com/hmdzl/spspd/change/sprites/SokobanBlackSheepSprite.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.watabou.noosa.TextureFilm; -import com.watabou.utils.Random; - -public class SokobanBlackSheepSprite extends MobSprite { - - public SokobanBlackSheepSprite() { - super(); - - texture(Assets.SOKOBANSHEEP); - - TextureFilm frames = new TextureFilm(texture, 16, 15); - - idle = new Animation(8, true); - idle.frames(frames, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 14, 15, 12); - - run = idle.clone(); - attack = idle.clone(); - - die = new Animation(20, false); - die.frames(frames, 8); - - play(idle); - curFrame = Random.Int(curAnim.frames.length); - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/SokobanCornerSheepSprite.java b/java/com/hmdzl/spspd/change/sprites/SokobanCornerSheepSprite.java deleted file mode 100644 index 075654b6..00000000 --- a/java/com/hmdzl/spspd/change/sprites/SokobanCornerSheepSprite.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.watabou.noosa.TextureFilm; -import com.watabou.utils.Random; - -public class SokobanCornerSheepSprite extends MobSprite { - - public SokobanCornerSheepSprite() { - super(); - - texture(Assets.SOKOBANSHEEP); - - TextureFilm frames = new TextureFilm(texture, 16, 15); - - idle = new Animation(8, true); - idle.frames(frames, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 6, 7, 4); - - run = idle.clone(); - attack = idle.clone(); - - die = new Animation(20, false); - die.frames(frames, 4); - - play(idle); - curFrame = Random.Int(curAnim.frames.length); - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/SokobanSheepSprite.java b/java/com/hmdzl/spspd/change/sprites/SokobanSheepSprite.java deleted file mode 100644 index 453ad7f9..00000000 --- a/java/com/hmdzl/spspd/change/sprites/SokobanSheepSprite.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.watabou.noosa.TextureFilm; -import com.watabou.utils.Random; - -public class SokobanSheepSprite extends MobSprite { - - public SokobanSheepSprite() { - super(); - - texture(Assets.SOKOBANSHEEP); - - TextureFilm frames = new TextureFilm(texture, 16, 15); - - idle = new Animation(8, true); - idle.frames(frames, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 0); - - run = idle.clone(); - attack = idle.clone(); - - die = new Animation(20, false); - die.frames(frames, 0); - - play(idle); - curFrame = Random.Int(curAnim.frames.length); - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/SokobanSheepSwitchSprite.java b/java/com/hmdzl/spspd/change/sprites/SokobanSheepSwitchSprite.java deleted file mode 100644 index 8e9b2ad3..00000000 --- a/java/com/hmdzl/spspd/change/sprites/SokobanSheepSwitchSprite.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.watabou.noosa.TextureFilm; -import com.watabou.utils.Random; - -public class SokobanSheepSwitchSprite extends MobSprite { - - public SokobanSheepSwitchSprite() { - super(); - - texture(Assets.SOKOBANSHEEP); - - TextureFilm frames = new TextureFilm(texture, 16, 15); - - idle = new Animation(8, true); - idle.frames(frames, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 10, 11, 8); - - run = idle.clone(); - attack = idle.clone(); - - die = new Animation(20, false); - die.frames(frames, 8); - - play(idle); - curFrame = Random.Int(curAnim.frames.length); - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/SpiderBotSprite.java b/java/com/hmdzl/spspd/change/sprites/SpiderBotSprite.java deleted file mode 100644 index 55c7ae74..00000000 --- a/java/com/hmdzl/spspd/change/sprites/SpiderBotSprite.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Unleashed Pixel Dungeon - * Copyright (C) 2015 David Mitchell - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.watabou.noosa.TextureFilm; - -public class SpiderBotSprite extends MobSprite { - public SpiderBotSprite() { - super(); - - texture(Assets.SPIDERBOT); - - TextureFilm frames = new TextureFilm( texture, 16, 16 ); - - idle = new Animation( 10, true ); - idle.frames( frames, 0, 0, 0, 0, 0, 1, 0, 1 ); - - run = new Animation( 15, true ); - run.frames( frames, 0, 2, 0, 3 ); - - attack = new Animation( 12, false ); - attack.frames( frames, 0, 4, 5, 0 ); - - die = new Animation( 12, false ); - die.frames( frames, 6, 7, 8, 9 ); - - play( idle ); - } - - @Override - public int blood() { - return 0xFFFFFF88; - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/sprites/SpiderEggSprite.java b/java/com/hmdzl/spspd/change/sprites/SpiderEggSprite.java deleted file mode 100644 index 9ef2a582..00000000 --- a/java/com/hmdzl/spspd/change/sprites/SpiderEggSprite.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.watabou.noosa.TextureFilm; - -public class SpiderEggSprite extends MobSprite { - - public SpiderEggSprite() { - super(); - - texture(Assets.SPIDEREGG); - - TextureFilm frames = new TextureFilm(texture, 16, 16); - - idle = new Animation(10, true); - idle.frames(frames, 0, 0, 0, 0, 0, 1, 0, 1); - - run = new Animation(15, true); - run.frames(frames, 0, 1, 0, 1); - - attack = new Animation(12, false); - attack.frames(frames, 0, 1, 0, 0); - - die = new Animation(12, false); - die.frames(frames, 1, 2, 3, 4); - - play(idle); - } - - @Override - public int blood() { - return 0xFFBFE5B8; - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/sprites/SpiderGoldSprite.java b/java/com/hmdzl/spspd/change/sprites/SpiderGoldSprite.java deleted file mode 100644 index 043b7d71..00000000 --- a/java/com/hmdzl/spspd/change/sprites/SpiderGoldSprite.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.watabou.noosa.TextureFilm; - -public class SpiderGoldSprite extends MobSprite { - - public SpiderGoldSprite() { - super(); - - texture(Assets.SPIDERMIND); - - TextureFilm frames = new TextureFilm(texture, 16, 16); - - idle = new Animation(10, true); - idle.frames(frames, 16, 16, 16, 16, 16, 17, 16, 17); - - run = new Animation(15, true); - run.frames(frames, 16, 18, 19, 20); - - attack = new Animation(12, false); - attack.frames(frames, 20, 21, 22, 23); - - die = new Animation(12, false); - die.frames(frames, 24, 25, 25, 25); - - play(idle); - } - - @Override - public int blood() { - return 0xFFBFE5B8; - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/sprites/SpiderJumpSprite.java b/java/com/hmdzl/spspd/change/sprites/SpiderJumpSprite.java deleted file mode 100644 index 8d687a49..00000000 --- a/java/com/hmdzl/spspd/change/sprites/SpiderJumpSprite.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.watabou.noosa.TextureFilm; - -public class SpiderJumpSprite extends MobSprite { - - public SpiderJumpSprite() { - super(); - - texture(Assets.SPIDERWORKER); - - TextureFilm frames = new TextureFilm(texture, 16, 16); - - idle = new Animation(10, true); - idle.frames(frames, 16, 16, 16, 16, 17, 18, 16, 17); - - run = new Animation(15, true); - run.frames(frames, 18, 19, 20, 21); - - attack = new Animation(12, false); - attack.frames(frames, 22, 23, 24, 25); - - die = new Animation(12, false); - die.frames(frames, 26, 27, 27, 27); - - play(idle); - } - - @Override - public int blood() { - return 0xFFBFE5B8; - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/sprites/SpiderMindSprite.java b/java/com/hmdzl/spspd/change/sprites/SpiderMindSprite.java deleted file mode 100644 index 60360b02..00000000 --- a/java/com/hmdzl/spspd/change/sprites/SpiderMindSprite.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.watabou.noosa.TextureFilm; - -public class SpiderMindSprite extends MobSprite { - - public SpiderMindSprite() { - super(); - - texture(Assets.SPIDERMIND); - - TextureFilm frames = new TextureFilm(texture, 16, 16); - - idle = new Animation(10, true); - idle.frames(frames, 0, 0, 0, 0, 0, 1, 0, 1); - - run = new Animation(15, true); - run.frames(frames, 0, 2, 3, 4); - - attack = new Animation(12, false); - attack.frames(frames, 4, 5, 6, 7); - - die = new Animation(12, false); - die.frames(frames, 8, 9, 10, 11); - - play(idle); - } - - @Override - public int blood() { - return 0xFFBFE5B8; - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/sprites/SpiderNormalSprite.java b/java/com/hmdzl/spspd/change/sprites/SpiderNormalSprite.java deleted file mode 100644 index fb432460..00000000 --- a/java/com/hmdzl/spspd/change/sprites/SpiderNormalSprite.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.watabou.noosa.TextureFilm; - -public class SpiderNormalSprite extends MobSprite { - - public SpiderNormalSprite() { - super(); - - texture(Assets.SPIDERWORKER); - - TextureFilm frames = new TextureFilm(texture, 16, 16); - - idle = new Animation(10, true); - idle.frames(frames, 0, 0, 0, 0, 1, 2, 0, 1); - - run = new Animation(15, true); - run.frames(frames, 2, 3, 4, 5); - - attack = new Animation(12, false); - attack.frames(frames, 6, 7, 8, 9); - - die = new Animation(12, false); - die.frames(frames, 10, 11, 12, 13); - - play(idle); - } - - @Override - public int blood() { - return 0xFFBFE5B8; - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/sprites/SpiderQueenSprite.java b/java/com/hmdzl/spspd/change/sprites/SpiderQueenSprite.java deleted file mode 100644 index 1fc65025..00000000 --- a/java/com/hmdzl/spspd/change/sprites/SpiderQueenSprite.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.watabou.noosa.TextureFilm; - -public class SpiderQueenSprite extends MobSprite { - - public SpiderQueenSprite() { - super(); - - texture(Assets.SPIDERQUEEN); - - TextureFilm frames = new TextureFilm(texture, 16, 16); - - idle = new Animation(10, true); - idle.frames(frames, 0, 0, 1, 2, 1, 0, 0, 1); - - run = new Animation(15, true); - run.frames(frames, 2, 2, 3, 4); - - attack = new Animation(12, false); - attack.frames(frames, 4, 5, 6, 7); - - die = new Animation(12, false); - die.frames(frames, 8, 9, 10, 11); - - play(idle); - } - - @Override - public int blood() { - return 0xFFBFE5B8; - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/sprites/SpiderSprite.java b/java/com/hmdzl/spspd/change/sprites/SpiderSprite.java deleted file mode 100644 index 79005621..00000000 --- a/java/com/hmdzl/spspd/change/sprites/SpiderSprite.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.watabou.noosa.TextureFilm; - -public class SpiderSprite extends MobSprite { - - public SpiderSprite() { - super(); - - texture(Assets.SPINNER); - - TextureFilm frames = new TextureFilm(texture, 16, 16); - - idle = new Animation(10, true); - idle.frames(frames, 16, 16, 16, 16, 16, 17, 16, 17); - - run = new Animation(15, true); - run.frames(frames, 16, 18, 16, 19); - - attack = new Animation(12, false); - attack.frames(frames, 16, 20, 21, 16); - - die = new Animation(12, false); - die.frames(frames, 22, 23, 24, 25); - - play(idle); - } - - @Override - public int blood() { - return 0xFFBFE5B8; - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/SpinnerSprite.java b/java/com/hmdzl/spspd/change/sprites/SpinnerSprite.java deleted file mode 100644 index df17e0f1..00000000 --- a/java/com/hmdzl/spspd/change/sprites/SpinnerSprite.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.watabou.noosa.TextureFilm; - -public class SpinnerSprite extends MobSprite { - - public SpinnerSprite() { - super(); - - texture(Assets.SPINNER); - - TextureFilm frames = new TextureFilm(texture, 16, 16); - - idle = new Animation(10, true); - idle.frames(frames, 0, 0, 0, 0, 0, 1, 0, 1); - - run = new Animation(15, true); - run.frames(frames, 0, 2, 0, 3); - - attack = new Animation(12, false); - attack.frames(frames, 0, 4, 5, 0); - - die = new Animation(12, false); - die.frames(frames, 6, 7, 8, 9); - - play(idle); - } - - @Override - public int blood() { - return 0xFFBFE5B8; - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/SteelBeeSprite.java b/java/com/hmdzl/spspd/change/sprites/SteelBeeSprite.java deleted file mode 100644 index 85531b8d..00000000 --- a/java/com/hmdzl/spspd/change/sprites/SteelBeeSprite.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.watabou.noosa.TextureFilm; - -public class SteelBeeSprite extends MobSprite { - - public SteelBeeSprite() { - super(); - - texture(Assets.BEE); - - TextureFilm frames = new TextureFilm(texture, 16, 16); - - idle = new Animation(12, true); - idle.frames(frames, 16, 17, 17, 16, 18, 18); - - run = new Animation(15, true); - run.frames(frames, 16, 17, 17, 16, 18, 18); - - attack = new Animation(20, false); - attack.frames(frames, 19, 20, 21, 22); - - die = new Animation(20, false); - die.frames(frames, 23, 24, 25, 26); - - - play(idle); - } - - @Override - public int blood() { - return 0xffd500; - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/StoneSprite.java b/java/com/hmdzl/spspd/change/sprites/StoneSprite.java deleted file mode 100644 index 687b75dc..00000000 --- a/java/com/hmdzl/spspd/change/sprites/StoneSprite.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.effects.MagicMissile; -import com.watabou.noosa.TextureFilm; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Callback; - -public class StoneSprite extends MobSprite { - - //Frames 1-4 are idle, 5-8 are moving, 9-12 are attack and the last are for death - - public StoneSprite() { - super(); - - texture(Assets.KLIKS); - - TextureFilm frames = new TextureFilm(texture, 16, 16); - - idle = new Animation(2, true); - idle.frames(frames, 0, 1, 2, 3); - - run = new Animation(4, true); - run.frames(frames, 4, 5, 6, 7); - - attack = new Animation(8, false); - attack.frames(frames, 8, 9, 10, 11); - - zap = attack.clone(); - - die = new Animation(6, false); - die.frames(frames, 12, 13, 14, 15); - - play(idle); - } - - - @Override - public int blood() { - return 0xFFcdcdb7; - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/StormAndRainSprite.java b/java/com/hmdzl/spspd/change/sprites/StormAndRainSprite.java deleted file mode 100644 index 1e1000f5..00000000 --- a/java/com/hmdzl/spspd/change/sprites/StormAndRainSprite.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.levels.Level; -import com.watabou.noosa.TextureFilm; -import com.watabou.noosa.audio.Sample; -import com.watabou.noosa.particles.Emitter; - -public class StormAndRainSprite extends MobSprite { - - public StormAndRainSprite() { - super(); - - texture( Assets.SAR ); - - TextureFilm frames = new TextureFilm( texture, 16, 16 ); - - idle = new Animation( 3, true ); - idle.frames(frames, 0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3); - - run = new Animation( 20, true ); - run.frames( frames, 0 ); - - attack = new Animation( 12, false ); - attack.frames( frames, 0, 2, 3 ); - - die = new Animation( 20, false ); - die.frames( frames, 0 ); - - play( idle ); - } - - -} diff --git a/java/com/hmdzl/spspd/change/sprites/SuccubusSprite.java b/java/com/hmdzl/spspd/change/sprites/SuccubusSprite.java deleted file mode 100644 index 5f10909b..00000000 --- a/java/com/hmdzl/spspd/change/sprites/SuccubusSprite.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.effects.particles.ShadowParticle; -import com.watabou.noosa.TextureFilm; - -public class SuccubusSprite extends MobSprite { - - public SuccubusSprite() { - super(); - - texture(Assets.SUCCUBUS); - - TextureFilm frames = new TextureFilm(texture, 12, 15); - - idle = new Animation(8, true); - idle.frames(frames, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 2, - 2, 2, 1); - - run = new Animation(15, true); - run.frames(frames, 3, 4, 5, 6, 7, 8); - - attack = new Animation(12, false); - attack.frames(frames, 9, 10, 11); - - die = new Animation(10, false); - die.frames(frames, 12); - - play(idle); - } - - @Override - public void die() { - super.die(); - emitter().burst(Speck.factory(Speck.HEART), 6); - emitter().burst(ShadowParticle.UP, 8); - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/SuffererSprite.java b/java/com/hmdzl/spspd/change/sprites/SuffererSprite.java deleted file mode 100644 index e57ddaa5..00000000 --- a/java/com/hmdzl/spspd/change/sprites/SuffererSprite.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Unleashed Pixel Dungeon - * Copyright (C) 2015 David Mitchell - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.effects.particles.ElmoParticle; -import com.hmdzl.spspd.change.sprites.MobSprite; -import com.watabou.noosa.TextureFilm; - -public class SuffererSprite extends MobSprite { - - public SuffererSprite() { - super(); - - texture( Assets.SUFFERER ); - - TextureFilm frames = new TextureFilm( texture, 12, 14 ); - - idle = new Animation( 8, true ); - idle.frames( frames, 0, 0, 0, 1, 0, 0, 1, 1 ); - - run = new Animation( 12, true ); - run.frames( frames, 2, 3, 4, 5, 6, 7 ); - - attack = new Animation( 12, false ); - attack.frames( frames, 8, 9, 10 ); - - die = new Animation( 12, false ); - die.frames( frames, 11, 12, 13, 14 ); - - play( idle ); - } - - @Override - public void onComplete( Animation anim ) { - if (anim == die) { - emitter().burst( ElmoParticle.FACTORY, 4 ); - } - super.onComplete( anim ); - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/SugarplumFairySprite.java b/java/com/hmdzl/spspd/change/sprites/SugarplumFairySprite.java deleted file mode 100644 index 37e8dc0c..00000000 --- a/java/com/hmdzl/spspd/change/sprites/SugarplumFairySprite.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; - -import com.hmdzl.spspd.change.effects.Lightning; -import com.watabou.noosa.TextureFilm; - -public class SugarplumFairySprite extends MobSprite { - - //Frames 0,2 are idle, 0,1,2 are moving, 0,3,4,1 are attack and 5,6,7 are for death - - private int[] points = new int[2]; - - public SugarplumFairySprite() { - super(); - - texture(Assets.FAIRY); - - TextureFilm frames = new TextureFilm(texture, 15, 15); - - idle = new Animation(2, true); - idle.frames(frames, 16, 18, 19, 16); - - run = new Animation(8, true); - run.frames(frames, 16, 17, 18, 16); - - attack = new Animation(8, false); - attack.frames(frames, 16, 19, 20, 17); - - die = new Animation(8, false); - die.frames(frames, 21, 22, 23, 23); - - play(idle); - } - - @Override - public int blood() { - return 0xFFcdcdb7; - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/SwarmSprite.java b/java/com/hmdzl/spspd/change/sprites/SwarmSprite.java deleted file mode 100644 index d2724102..00000000 --- a/java/com/hmdzl/spspd/change/sprites/SwarmSprite.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.watabou.noosa.TextureFilm; - -public class SwarmSprite extends MobSprite { - - public SwarmSprite() { - super(); - - texture(Assets.SWARM); - - TextureFilm frames = new TextureFilm(texture, 16, 16); - - idle = new Animation(15, true); - idle.frames(frames, 0, 1, 2, 3, 4, 5); - - run = new Animation(15, true); - run.frames(frames, 0, 1, 2, 3, 4, 5); - - attack = new Animation(20, false); - attack.frames(frames, 6, 7, 8, 9); - - die = new Animation(15, false); - die.frames(frames, 10, 11, 12, 13, 14); - - play(idle); - } - - @Override - public int blood() { - return 0xFF8BA077; - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/TCloudSprite.java b/java/com/hmdzl/spspd/change/sprites/TCloudSprite.java deleted file mode 100644 index 2cf1f0f2..00000000 --- a/java/com/hmdzl/spspd/change/sprites/TCloudSprite.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.effects.Lightning; -import com.hmdzl.spspd.change.items.wands.WandOfTCloud; -import com.watabou.noosa.TextureFilm; - -public class TCloudSprite extends MobSprite { - - private int[] points = new int[2]; - - public TCloudSprite() { - super(); - - texture(Assets.T_CLOUD); - - TextureFilm frames = new TextureFilm( texture, 16, 16 ); - - idle = new Animation( 3, true ); - idle.frames(frames, 0, 0, 1, 1, 2, 2, 2, 3, 3, 3, 3, 3); - - run = new Animation( 20, true ); - run.frames( frames, 0 ); - - attack = new Animation( 12, false ); - attack.frames( frames, 0, 2, 3 ); - - die = new Animation( 20, false ); - die.frames( frames, 0 ); - - zap = attack.clone(); - - play(idle); - } - - @Override - public void zap(int pos) { - - parent.add( new Lightning( ch.pos, pos, (WandOfTCloud.TCloud) ch)); - - turnTo(ch.pos, pos); - play(zap); - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/TankSprite.java b/java/com/hmdzl/spspd/change/sprites/TankSprite.java deleted file mode 100644 index 3215a32a..00000000 --- a/java/com/hmdzl/spspd/change/sprites/TankSprite.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.levels.Level; -import com.watabou.noosa.TextureFilm; -import com.watabou.utils.Callback; - -public class TankSprite extends MobSprite { - - public TankSprite() { - super(); - - texture(Assets.TANK); - - TextureFilm frames = new TextureFilm(texture, 16, 14); - - idle = new Animation(2, true); - idle.frames(frames, 0, 0, 0, 1); - - run = new Animation(10, true); - run.frames(frames, 6, 7, 8, 9, 10); - - attack = new Animation(15, false); - attack.frames(frames, 2, 3, 4, 5, 0); - - die = new Animation(10, false); - die.frames(frames, 11, 12, 13, 14); - - play(idle); - } - - } diff --git a/java/com/hmdzl/spspd/change/sprites/Tempest102Sprite.java b/java/com/hmdzl/spspd/change/sprites/Tempest102Sprite.java deleted file mode 100644 index 95fc1969..00000000 --- a/java/com/hmdzl/spspd/change/sprites/Tempest102Sprite.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.levels.Level; -import com.watabou.noosa.TextureFilm; -import com.watabou.noosa.audio.Sample; -import com.watabou.noosa.particles.Emitter; - -public class Tempest102Sprite extends MobSprite { - - public Tempest102Sprite() { - super(); - - texture( Assets.TEMPEST102 ); - - TextureFilm frames = new TextureFilm( texture, 16, 16 ); - - idle = new Animation( 3, true ); - idle.frames(frames, 0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3); - - run = new Animation( 20, true ); - run.frames( frames, 0 ); - - attack = new Animation( 12, false ); - attack.frames( frames, 0, 2, 3 ); - - die = new Animation( 20, false ); - die.frames( frames, 0 ); - - play( idle ); - } - - -} diff --git a/java/com/hmdzl/spspd/change/sprites/TenguSprite.java b/java/com/hmdzl/spspd/change/sprites/TenguSprite.java deleted file mode 100644 index 6ca99f52..00000000 --- a/java/com/hmdzl/spspd/change/sprites/TenguSprite.java +++ /dev/null @@ -1,111 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Burning; -import com.hmdzl.spspd.change.actors.buffs.Paralysis; -import com.hmdzl.spspd.change.actors.buffs.Slow; -import com.hmdzl.spspd.change.effects.particles.FlameParticle; -import com.hmdzl.spspd.change.items.weapon.missiles.HugeShuriken; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.watabou.noosa.TextureFilm; -import com.watabou.utils.Callback; -import com.watabou.utils.Random; - -public class TenguSprite extends MobSprite { - - private static final float DURATION = 2f; - private Animation cast; - - public TenguSprite() { - super(); - - texture(Assets.TENGU); - - TextureFilm frames = new TextureFilm(texture, 14, 16); - - idle = new Animation(2, true); - idle.frames(frames, 0, 0, 0, 1); - - run = new Animation(15, false); - run.frames(frames, 2, 3, 4, 5, 0); - - attack = new Animation(15, false); - attack.frames(frames, 6, 7, 7, 0); - - cast = attack.clone(); - - die = new Animation(8, false); - die.frames(frames, 8, 9, 10, 10, 10, 10, 10, 10); - - play(run.clone()); - } - - @Override - public void move(int from, int to) { - - place(to); - - play(run); - turnTo(from, to); - - isMoving = true; - - if (Level.water[to]) { - GameScene.ripple(to); - } - - ch.onMotionComplete(); - } - - @Override - public void attack(int cell) { - if (!Level.adjacent(cell, ch.pos)) { - Char enemy = Actor.findChar(cell); - ((MissileSprite) parent.recycle(MissileSprite.class)).reset(ch.pos, - cell, new HugeShuriken(), new Callback() { - @Override - public void call() { - ch.onAttackComplete(); - } - }); - play(cast); - turnTo(ch.pos, cell); - - } else { - - super.attack(cell); - - } - } - - @Override - public void onComplete(Animation anim) { - if (anim == run) { - isMoving = false; - idle(); - } else { - super.onComplete(anim); - } - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/ThankListSprite.java b/java/com/hmdzl/spspd/change/sprites/ThankListSprite.java deleted file mode 100644 index a65cbd92..00000000 --- a/java/com/hmdzl/spspd/change/sprites/ThankListSprite.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.levels.Level; -import com.watabou.noosa.TextureFilm; -import com.watabou.noosa.audio.Sample; -import com.watabou.noosa.particles.Emitter; - -public class ThankListSprite extends MobSprite { - - public ThankListSprite() { - super(); - - texture( Assets.THANK_LIST ); - - TextureFilm frames = new TextureFilm( texture, 16, 16 ); - - idle = new Animation( 3, true ); - idle.frames(frames, 0, 0, 1, 1, 2, 2, 3, 3, 3, 3, 3, 3); - - run = new Animation( 3, true ); - run.frames( frames, 0, 0, 1, 1, 2, 2, 3, 3, 3, 3, 3, 3 ); - - attack = new Animation( 12, false ); - attack.frames( frames, 0, 2, 3 ); - - die = new Animation( 20, false ); - die.frames( frames, 0 ); - - play( idle ); - } - - -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/sprites/ThiefImpSprite.java b/java/com/hmdzl/spspd/change/sprites/ThiefImpSprite.java deleted file mode 100644 index e612c90c..00000000 --- a/java/com/hmdzl/spspd/change/sprites/ThiefImpSprite.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.sprites.MobSprite; -import com.watabou.noosa.TextureFilm; - -public class ThiefImpSprite extends MobSprite { - - public ThiefImpSprite() { - super(); - - texture( Assets.THIEFIMP ); - - TextureFilm frames = new TextureFilm( texture, 16, 16 ); - - idle = new Animation( 5, true ); - idle.frames(frames, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 4, 5, 6, 7); - - run = new Animation( 10, true ); - run.frames( frames, 0, 1, 2, 3 ); - - attack = new Animation( 15, false ); - attack.frames( frames, 8, 9, 10, 11, 12 ); - -// cast = new Animation( 15, false ); -// cast.frames( frames, 8, 9, 10, 11, 12 ); - - zap = new Animation( 10, false ); - zap.frames( frames, 13, 14, 15, 0 ); - - die = new Animation( 10, false ); - die.frames( frames, 16, 17, 18, 19, 20, 21 ); - - play( idle ); - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/sprites/ThiefKingSprite.java b/java/com/hmdzl/spspd/change/sprites/ThiefKingSprite.java deleted file mode 100644 index 5a17615c..00000000 --- a/java/com/hmdzl/spspd/change/sprites/ThiefKingSprite.java +++ /dev/null @@ -1,137 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Poison; -import com.hmdzl.spspd.change.actors.buffs.Slow; -import com.hmdzl.spspd.change.items.weapon.missiles.EscapeKnive; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.watabou.noosa.TextureFilm; -import com.watabou.utils.Callback; -import com.watabou.utils.Random; - -public class ThiefKingSprite extends MobSprite { - - private static final float DURATION = 2f; - private Animation cast; - - - - public ThiefKingSprite() { - super(); - - texture(Assets.THIEFKING); - - TextureFilm frames = new TextureFilm(texture, 16, 16); - - idle = new Animation(2, true); - idle.frames(frames, 0, 0, 0, 0); - - run = new Animation(15, false); - run.frames(frames, 1, 2, 3, 4, 5); - - attack = new Animation(15, false); - attack.frames(frames, 6, 7, 8); - - cast = new Animation(15, false); - cast.frames(frames, 9, 10); - - die = new Animation(8, false); - die.frames(frames, 11, 12, 13, 14); - - play(run.clone()); - } - - @Override - public void link(Char ch) { - super.link(ch); - add(State.LEVITATING); - } - - @Override - public void die() { - super.die(); - remove(State.LEVITATING); - } - - @Override - public void move(int from, int to) { - - place(to); - - play(run); - turnTo(from, to); - - isMoving = true; - - if (Level.water[to]) { - GameScene.ripple(to); - } - - - - ch.onMotionComplete(); - } - - - @Override - public void attack(int cell) { - if (!Level.adjacent(cell, ch.pos)) { - Char enemy = Actor.findChar(cell); - ((MissileSprite) parent.recycle(MissileSprite.class)).reset(ch.pos, - cell, new EscapeKnive(), new Callback() { - @Override - public void call() { - ch.onAttackComplete(); - } - }); - - - if(Random.Int(10)==0){ - Buff.affect(enemy, Slow.class, Slow.duration(enemy) / 2); - } - - if(Random.Int(10)==0){ - Buff.affect(enemy, Poison.class).set(Random.Int(7, 9) * Poison.durationFactor(enemy)); - } - - play(cast); - turnTo(ch.pos, cell); - - } else { - - super.attack(cell); - - } - } - - @Override - public void onComplete(Animation anim) { - if (anim == run) { - isMoving = false; - idle(); - } else { - super.onComplete(anim); - } - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/ThiefSprite.java b/java/com/hmdzl/spspd/change/sprites/ThiefSprite.java deleted file mode 100644 index 07423512..00000000 --- a/java/com/hmdzl/spspd/change/sprites/ThiefSprite.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.watabou.noosa.TextureFilm; - -public class ThiefSprite extends MobSprite { - - public ThiefSprite() { - super(); - - texture(Assets.THIEF); - TextureFilm film = new TextureFilm(texture, 12, 13); - - idle = new Animation(1, true); - idle.frames(film, 0, 0, 0, 1, 0, 0, 0, 0, 1); - - run = new Animation(15, true); - run.frames(film, 0, 0, 2, 3, 3, 4); - - die = new Animation(10, false); - die.frames(film, 5, 6, 7, 8, 9); - - attack = new Animation(12, false); - attack.frames(film, 10, 11, 12, 0); - - idle(); - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/TinkererSprite.java b/java/com/hmdzl/spspd/change/sprites/TinkererSprite.java deleted file mode 100644 index a320c349..00000000 --- a/java/com/hmdzl/spspd/change/sprites/TinkererSprite.java +++ /dev/null @@ -1,121 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import javax.microedition.khronos.opengles.GL10; - -import android.opengl.GLES20; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.effects.Halo; -import com.hmdzl.spspd.change.effects.particles.ElmoParticle; -import com.watabou.noosa.Game; -import com.watabou.noosa.TextureFilm; -import com.watabou.utils.PointF; - -public class TinkererSprite extends MobSprite { - - private Shield shield; - - public TinkererSprite() { - super(); - - texture(Assets.TINKERER1); - - TextureFilm frames = new TextureFilm(texture, 12, 14); - - idle = new Animation(10, true); - idle.frames(frames, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, - 3, 3, 3, 3, 3, 2, 1); - - run = new Animation(20, true); - run.frames(frames, 0); - - die = new Animation(20, false); - die.frames(frames, 0); - - play(idle); - } - - @Override - public void link(Char ch) { - super.link(ch); - - if (shield == null) { - parent.add(shield = new Shield()); - } - } - - @Override - public void die() { - super.die(); - - if (shield != null) { - shield.putOut(); - } - emitter().start(ElmoParticle.FACTORY, 0.03f, 60); - } - - public class Shield extends Halo { - - private float phase; - - public Shield() { - - super(14, 0xBBAACC, 1f); - - am = -1; - aa = +1; - - phase = 1; - } - - @Override - public void update() { - super.update(); - - if (phase < 1) { - if ((phase -= Game.elapsed) <= 0) { - killAndErase(); - } else { - scale.set((2 - phase) * radius / RADIUS); - am = phase * (-1); - aa = phase * (+1); - } - } - - if (visible = TinkererSprite.this.visible) { - PointF p = TinkererSprite.this.center(); - point(p.x, p.y); - } - } - - @Override - public void draw() { - GLES20.glBlendFunc(GL10.GL_SRC_ALPHA, GL10.GL_ONE); - super.draw(); - GLES20.glBlendFunc(GL10.GL_SRC_ALPHA, GL10.GL_ONE_MINUS_SRC_ALPHA); - } - - public void putOut() { - phase = 0.999f; - } - } - -} diff --git a/java/com/hmdzl/spspd/change/sprites/TowerSprite.java b/java/com/hmdzl/spspd/change/sprites/TowerSprite.java deleted file mode 100644 index fea0aa60..00000000 --- a/java/com/hmdzl/spspd/change/sprites/TowerSprite.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.watabou.noosa.TextureFilm; - -public class TowerSprite extends MobSprite { - - - public TowerSprite() { - super(); - - texture(Assets.TOWER); - TextureFilm frames = new TextureFilm(texture, 16, 16); - - idle = new Animation(10, true); - idle.frames(frames, 0, 0, 0, 0, 0, 0, 0, 0, 0); - - run = idle.clone(); - die = idle.clone(); - attack = idle.clone(); - - idle(); - } - -} diff --git a/java/com/hmdzl/spspd/change/sprites/TrapSprite.java b/java/com/hmdzl/spspd/change/sprites/TrapSprite.java deleted file mode 100644 index 3b4d1619..00000000 --- a/java/com/hmdzl/spspd/change/sprites/TrapSprite.java +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * Shattered Pixel Dungeon - * Copyright (C) 2014-2015 Evan Debenham - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.DungeonTilemap; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.traps.Trap; -import com.watabou.noosa.Image; -import com.watabou.noosa.TextureFilm; - -public class TrapSprite extends Image { - - private static TextureFilm frames; - - private int pos = -1; - - //trap colors - public static final int RED = 0; - public static final int ORANGE = 1; - public static final int YELLOW = 2; - public static final int GREEN = 3; - public static final int TEAL = 4; - public static final int VIOLET = 5; - public static final int WHITE = 6; - public static final int GREY = 7; - public static final int BLACK = 8; - - //trap shapes - public static final int DOTS = 0; - public static final int WAVES = 1; - public static final int GRILL = 2; - public static final int STARS = 3; - public static final int DIAMOND = 4; - public static final int CROSSHAIR = 5; - public static final int LARGE_DOT = 6; - - - public TrapSprite() { - super( Assets.TRAPS ); - - if (frames == null) { - frames = new TextureFilm( texture, 16, 16 ); - } - - origin.set( 8, 12 ); - } - - public TrapSprite( int image ) { - this(); - reset( image ); - } - - public void reset( Trap trap ) { - - revive(); - - reset( (trap.active ? trap.color : BLACK) + (trap.shape * 16) ); - alpha( 1f ); - - pos = trap.pos; - x = (pos % Level.WIDTH) * DungeonTilemap.SIZE; - y = (pos / Level.WIDTH) * DungeonTilemap.SIZE; - - } - - public void reset( int image ) { - frame( frames.get( image ) ); - } - -} diff --git a/java/com/hmdzl/spspd/change/sprites/TrollWarriorSprite.java b/java/com/hmdzl/spspd/change/sprites/TrollWarriorSprite.java deleted file mode 100644 index 46a17677..00000000 --- a/java/com/hmdzl/spspd/change/sprites/TrollWarriorSprite.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.levels.Level; -import com.watabou.noosa.TextureFilm; -import com.watabou.utils.Callback; - -public class TrollWarriorSprite extends MobSprite { - - public TrollWarriorSprite() { - super(); - - texture(Assets.TROLLWARRIOR); - - TextureFilm frames = new TextureFilm(texture, 16, 16); - - idle = new Animation(2, true); - idle.frames(frames, 0, 0, 0, 1); - - run = new Animation(12, true); - run.frames(frames,0, 2,3,4,5,6,7); - - attack = new Animation(12, false); - attack.frames(frames, 0,8,9,10,11); - - die = new Animation(12, false); - die.frames(frames, 0, 11, 12); - - play(idle); - } - - } diff --git a/java/com/hmdzl/spspd/change/sprites/TypedScrollSprite.java b/java/com/hmdzl/spspd/change/sprites/TypedScrollSprite.java deleted file mode 100644 index d3374397..00000000 --- a/java/com/hmdzl/spspd/change/sprites/TypedScrollSprite.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.levels.Level; -import com.watabou.noosa.TextureFilm; -import com.watabou.noosa.audio.Sample; -import com.watabou.noosa.particles.Emitter; - -public class TypedScrollSprite extends MobSprite { - - public TypedScrollSprite() { - super(); - - texture( Assets.TYPEDSCROLL ); - - TextureFilm frames = new TextureFilm( texture, 15, 14 ); - - idle = new Animation( 15, true ); - idle.frames(frames, 0, 0, 0, 0, 0, 0, 0, 1, 2, 2, 2, 3); - - run = new Animation( 20, true ); - run.frames( frames, 0 ); - - attack = new Animation( 12, false ); - attack.frames( frames, 0, 2, 3 ); - - die = new Animation( 20, false ); - die.frames( frames, 0 ); - - play( idle ); - } - - -} diff --git a/java/com/hmdzl/spspd/change/sprites/UDM300Sprite.java b/java/com/hmdzl/spspd/change/sprites/UDM300Sprite.java deleted file mode 100644 index e3a25af3..00000000 --- a/java/com/hmdzl/spspd/change/sprites/UDM300Sprite.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.actors.mobs.DM300; -import com.hmdzl.spspd.change.effects.Lightning; -import com.hmdzl.spspd.change.effects.Speck; -import com.watabou.noosa.TextureFilm; - -public class UDM300Sprite extends MobSprite { - - public UDM300Sprite() { - super(); - - texture(Assets.DM300); - - TextureFilm frames = new TextureFilm(texture, 22, 20); - - idle = new Animation(10, true); - idle.frames(frames, 9, 10); - - run = new Animation(10, true); - run.frames(frames, 11, 12); - - attack = new Animation(15, false); - attack.frames(frames, 13, 14, 15); - - die = new Animation(20, false); - die.frames(frames, 9, 16, 9, 16, 9, 16, 9, 16, 9, 16, 9, 16, 17); - - play(idle); - } - - @Override - public void onComplete(Animation anim) { - - super.onComplete(anim); - - if (anim == die) { - emitter().burst(Speck.factory(Speck.WOOL), 15); - } - } - - @Override - public int blood() { - return 0xFFFFFF88; - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/sprites/UGooSprite.java b/java/com/hmdzl/spspd/change/sprites/UGooSprite.java deleted file mode 100644 index a76fcba1..00000000 --- a/java/com/hmdzl/spspd/change/sprites/UGooSprite.java +++ /dev/null @@ -1,150 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * Yet Another Pixel Dungeon - * Copyright (C) 2015-2016 Considered Hamster - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.watabou.noosa.TextureFilm; - -public class UGooSprite extends MobSprite { - - - public UGooSprite() { - super(); - - texture( Assets.UGOO ); - - TextureFilm frames = new TextureFilm( texture, 20, 16 ); - - idle = new Animation( 10, true ); - idle.frames( frames, 0, 1, 1, 2, 1, 1 ); - - run = new Animation( 10, true ); - run.frames( frames, 0, 1, 2, 1 ); - - attack = new Animation( 10, false ); - attack.frames( frames, 3, 4, 5 ); - - die = new Animation( 10, false ); - die.frames( frames, 6, 7, 8, 9 ); - - play( idle ); - } - - @Override - public int blood() { - return 0xFF000000; - } - - public static class IceSpawnSprite extends MobSprite { - - public IceSpawnSprite() { - super(); - texture( Assets.UGOO ); - - TextureFilm frames = new TextureFilm( texture, 20, 16 ); - - idle = new Animation( 10, true ); - idle.frames( frames, 10, 11, 11, 12, 11, 11 ); - - run = new Animation( 10, true ); - run.frames( frames, 10, 11, 12, 11 ); - - attack = new Animation( 10, false ); - attack.frames( frames, 13, 14, 15 ); - - die = new Animation( 10, false ); - die.frames( frames, 16, 17, 18, 19 ); - - play( idle ); - } - } - - public static class EarthSpawnSprite extends MobSprite { - - public EarthSpawnSprite() { - super(); - texture( Assets.UGOO ); - - TextureFilm frames = new TextureFilm( texture, 20, 16 ); - - idle = new Animation( 10, true ); - idle.frames( frames, 20, 21, 21, 22, 21, 21 ); - - run = new Animation( 10, true ); - run.frames( frames, 20, 21, 22, 21 ); - - attack = new Animation( 10, false ); - attack.frames( frames, 23, 24, 25 ); - - die = new Animation( 10, false ); - die.frames( frames, 26, 27, 28, 29 ); - - play( idle ); - } - } - - public static class FireSpawnSprite extends MobSprite { - - public FireSpawnSprite() { - super(); - texture( Assets.UGOO ); - - TextureFilm frames = new TextureFilm( texture, 20, 16 ); - - idle = new Animation( 10, true ); - idle.frames( frames, 30, 31, 31, 32, 31, 31 ); - - run = new Animation( 10, true ); - run.frames( frames, 30, 31, 32, 31 ); - - attack = new Animation( 10, false ); - attack.frames( frames, 33, 34, 35 ); - - die = new Animation( 10, false ); - die.frames( frames, 36, 37, 38, 39 ); - - play( idle ); - } - } - - public static class ShockSpawnSprite extends MobSprite { - public ShockSpawnSprite() { - super(); - texture( Assets.UGOO ); - - TextureFilm frames = new TextureFilm( texture, 20, 16 ); - - idle = new Animation( 10, true ); - idle.frames( frames, 40, 41, 41, 42, 41, 41 ); - - run = new Animation( 10, true ); - run.frames( frames, 40, 41, 42, 41 ); - - attack = new Animation( 10, false ); - attack.frames( frames, 43, 44, 45 ); - - die = new Animation( 10, false ); - die.frames( frames, 46, 47, 48, 49 ); - - play( idle ); - } - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/UTenguSprite.java b/java/com/hmdzl/spspd/change/sprites/UTenguSprite.java deleted file mode 100644 index 7d0ae006..00000000 --- a/java/com/hmdzl/spspd/change/sprites/UTenguSprite.java +++ /dev/null @@ -1,125 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Burning; -import com.hmdzl.spspd.change.actors.buffs.Paralysis; -import com.hmdzl.spspd.change.actors.buffs.Slow; -import com.hmdzl.spspd.change.effects.particles.FlameParticle; -import com.hmdzl.spspd.change.items.weapon.missiles.HugeShuriken; -import com.hmdzl.spspd.change.items.weapon.missiles.Smoke; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.watabou.noosa.TextureFilm; -import com.watabou.utils.Callback; -import com.watabou.utils.Random; - -public class UTenguSprite extends MobSprite { - - private static final float DURATION = 2f; - private Animation cast; - - public UTenguSprite() { - super(); - - texture(Assets.TENGU); - - TextureFilm frames = new TextureFilm(texture, 14, 16); - - idle = new Animation(2, true); - idle.frames(frames, 11, 11, 11, 12); - - run = new Animation(15, false); - run.frames(frames, 13, 14, 15, 16, 11); - - attack = new Animation(15, false); - attack.frames(frames, 17, 18, 18, 11); - - cast = attack.clone(); - - die = new Animation(8, false); - die.frames(frames, 19, 20, 21, 21, 21, 21, 21, 21); - - play(run.clone()); - } - - @Override - public void move(int from, int to) { - - place(to); - - play(run); - turnTo(from, to); - - isMoving = true; - - if (Level.water[to]) { - GameScene.ripple(to); - } - - ch.onMotionComplete(); - } - - @Override - public void attack(int cell) { - if (!Level.adjacent(cell, ch.pos)) { - Char enemy = Actor.findChar(cell); - ((MissileSprite) parent.recycle(MissileSprite.class)).reset(ch.pos, - cell, new HugeShuriken(), new Callback() { - @Override - public void call() { - ch.onAttackComplete(); - } - }); - - if(Random.Int(15)==0){ - Buff.affect(enemy, Burning.class).reignite(enemy); - enemy.sprite.emitter().burst(FlameParticle.FACTORY, 5); - } - if(Random.Int(20)==0){ - Buff.affect(enemy, Slow.class, Slow.duration(enemy) / 2); - } - - if(Random.Int(30)==0){ - Buff.prolong(enemy, Paralysis.class, DURATION); - } - - play(cast); - turnTo(ch.pos, cell); - - } else { - - super.attack(cell); - - } - } - - @Override - public void onComplete(Animation anim) { - if (anim == run) { - isMoving = false; - idle(); - } else { - super.onComplete(anim); - } - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/UdawosSprite.java b/java/com/hmdzl/spspd/change/sprites/UdawosSprite.java deleted file mode 100644 index dbd2a6f2..00000000 --- a/java/com/hmdzl/spspd/change/sprites/UdawosSprite.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.levels.Level; -import com.watabou.noosa.TextureFilm; -import com.watabou.noosa.audio.Sample; -import com.watabou.noosa.particles.Emitter; - -public class UdawosSprite extends MobSprite { - - - public UdawosSprite() { - super(); - - texture( Assets.UDAWOS ); - - TextureFilm frames = new TextureFilm( texture, 14, 16 ); - - idle = new Animation( 15, true ); - idle.frames(frames, 0, 0, 0, 0, 0, 0, 0, 1, 2, 2, 2, 3); - - run = new Animation( 20, true ); - run.frames( frames, 0 ); - - attack = new Animation( 12, false ); - attack.frames( frames, 0, 2, 3 ); - - die = new Animation( 20, false ); - die.frames( frames, 0 ); - - play( idle ); - } - -} diff --git a/java/com/hmdzl/spspd/change/sprites/UncleSSprite.java b/java/com/hmdzl/spspd/change/sprites/UncleSSprite.java deleted file mode 100644 index 83fe7fc9..00000000 --- a/java/com/hmdzl/spspd/change/sprites/UncleSSprite.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.levels.Level; -import com.watabou.noosa.TextureFilm; -import com.watabou.noosa.audio.Sample; -import com.watabou.noosa.particles.Emitter; - -public class UncleSSprite extends MobSprite { - - public UncleSSprite() { - super(); - - texture( Assets.UNCLE_S ); - - TextureFilm frames = new TextureFilm( texture, 16, 16 ); - - idle = new Animation( 3, true ); - idle.frames(frames, 0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3); - - run = new Animation( 20, true ); - run.frames( frames, 0 ); - - attack = new Animation( 12, false ); - attack.frames( frames, 0, 2, 3 ); - - die = new Animation( 20, false ); - die.frames( frames, 0 ); - - play( idle ); - } - - -} diff --git a/java/com/hmdzl/spspd/change/sprites/UndeadSprite.java b/java/com/hmdzl/spspd/change/sprites/UndeadSprite.java deleted file mode 100644 index 4afacc27..00000000 --- a/java/com/hmdzl/spspd/change/sprites/UndeadSprite.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.effects.Speck; -import com.watabou.noosa.TextureFilm; - -public class UndeadSprite extends MobSprite { - - public UndeadSprite() { - super(); - - texture(Assets.UNDEAD); - - TextureFilm frames = new TextureFilm(texture, 12, 16); - - idle = new Animation(12, true); - idle.frames(frames, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3); - - run = new Animation(15, true); - run.frames(frames, 4, 5, 6, 7, 8, 9); - - attack = new Animation(15, false); - attack.frames(frames, 14, 15, 16); - - die = new Animation(12, false); - die.frames(frames, 10, 11, 12, 13); - - play(idle); - } - - @Override - public void die() { - super.die(); - if (Dungeon.visible[ch.pos]) { - emitter().burst(Speck.factory(Speck.BONE), 3); - } - } - - @Override - public int blood() { - return 0xFFcccccc; - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/VaultProtectorSprite.java b/java/com/hmdzl/spspd/change/sprites/VaultProtectorSprite.java deleted file mode 100644 index 261c5360..00000000 --- a/java/com/hmdzl/spspd/change/sprites/VaultProtectorSprite.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.actors.mobs.VaultProtector; -import com.hmdzl.spspd.change.effects.Lightning; -import com.watabou.noosa.TextureFilm; - -public class VaultProtectorSprite extends MobSprite { - - private int[] points = new int[2]; - - public VaultProtectorSprite() { - super(); - - texture(Assets.DEWPROTECTOR); - - TextureFilm frames = new TextureFilm(texture, 12, 15); - - idle = new Animation(2, true); - idle.frames(frames, 0, 0, 0, 0, 0, 1, 1); - - run = new Animation(15, true); - run.frames(frames, 2, 3, 4, 5, 6, 7); - - attack = new Animation(12, false); - attack.frames(frames, 8, 9, 10); - - zap = attack.clone(); - - die = new Animation(5, false); - die.frames(frames, 11, 12, 13, 14, 15, 15); - - play(idle); - } - - @Override - public void zap(int pos) { - - parent.add( new Lightning( ch.pos, pos,(VaultProtector) ch)); - - turnTo(ch.pos, pos); - play(zap); - } - - @Override - public int blood() { - return 0xFFcdcdb7; - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/VelociroosterSprite.java b/java/com/hmdzl/spspd/change/sprites/VelociroosterSprite.java deleted file mode 100644 index 19bae2d9..00000000 --- a/java/com/hmdzl/spspd/change/sprites/VelociroosterSprite.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.watabou.noosa.TextureFilm; - -public class VelociroosterSprite extends MobSprite { - - public VelociroosterSprite() { - super(); - - texture( Assets.VELOCIROOSTER ); - - TextureFilm frames = new TextureFilm( texture, 16, 16 ); - - idle = new Animation( 2, true ); - idle.frames( frames, 0, 0, 1 ); - - run = new Animation( 10, true ); - run.frames( frames, 3, 4, 5, 4 ); - - attack = new Animation( 14, false ); - attack.frames( frames, 1, 2, 1 ); - - die = new Animation( 10, false ); - die.frames( frames, 1, 6, 7 ); - - play( idle ); - } - - @Override - public int blood() { - return 0xFFFFEA80; - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/VillagerSprite.java b/java/com/hmdzl/spspd/change/sprites/VillagerSprite.java deleted file mode 100644 index 6d856c51..00000000 --- a/java/com/hmdzl/spspd/change/sprites/VillagerSprite.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import javax.microedition.khronos.opengles.GL10; - -import android.opengl.GLES20; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.effects.Halo; -import com.hmdzl.spspd.change.effects.particles.ElmoParticle; -import com.watabou.noosa.Game; -import com.watabou.noosa.TextureFilm; -import com.watabou.utils.PointF; - -public class VillagerSprite extends MobSprite { - - public VillagerSprite() { - super(); - - texture(Assets.TINKERER1); - - TextureFilm frames = new TextureFilm(texture, 12, 14); - - idle = new Animation(10, true); - idle.frames(frames, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, - 3, 3, 3, 3, 3, 2, 1); - - run = new Animation(20, true); - run.frames(frames, 0); - - die = new Animation(20, false); - die.frames(frames, 0); - - play(idle); - } - - - -} diff --git a/java/com/hmdzl/spspd/change/sprites/VioletDragonSprite.java b/java/com/hmdzl/spspd/change/sprites/VioletDragonSprite.java deleted file mode 100644 index 58c72ca9..00000000 --- a/java/com/hmdzl/spspd/change/sprites/VioletDragonSprite.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.actors.mobs.pets.VioletDragon; -import com.hmdzl.spspd.change.effects.MagicMissile; -import com.watabou.noosa.TextureFilm; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Callback; - -public class VioletDragonSprite extends MobSprite { - - //Frames 1-4 are idle, 5-8 are moving, 9-12 are attack and the last are for death - - public VioletDragonSprite() { - super(); - - texture(Assets.PETDRAGON); - - TextureFilm frames = new TextureFilm(texture, 16, 16); - - idle = new Animation(2, true); - idle.frames(frames, 32, 33, 34, 35); - - run = new Animation(8, true); - run.frames(frames, 36, 37, 38, 39); - - attack = new Animation(8, false); - attack.frames(frames, 40, 41, 42, 43); - - zap = attack.clone(); - - die = new Animation(8, false); - die.frames(frames, 44, 45, 46, 47); - - play(idle); - } - - @Override - public void zap(int cell) { - - turnTo(ch.pos, cell); - play(zap); - - MagicMissile.poison(parent, ch.pos, cell, new Callback() { - @Override - public void call() { - ((VioletDragon) ch).onZapComplete(); - } - }); - Sample.INSTANCE.play(Assets.SND_ZAP); - } - - @Override - public int blood() { - return 0xFFcdcdb7; - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/WandmakerSprite.java b/java/com/hmdzl/spspd/change/sprites/WandmakerSprite.java deleted file mode 100644 index f21a2cb9..00000000 --- a/java/com/hmdzl/spspd/change/sprites/WandmakerSprite.java +++ /dev/null @@ -1,121 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import javax.microedition.khronos.opengles.GL10; - -import android.opengl.GLES20; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.effects.Halo; -import com.hmdzl.spspd.change.effects.particles.ElmoParticle; -import com.watabou.noosa.Game; -import com.watabou.noosa.TextureFilm; -import com.watabou.utils.PointF; - -public class WandmakerSprite extends MobSprite { - - private Shield shield; - - public WandmakerSprite() { - super(); - - texture(Assets.MAKER); - - TextureFilm frames = new TextureFilm(texture, 12, 14); - - idle = new Animation(10, true); - idle.frames(frames, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, - 3, 3, 3, 3, 3, 2, 1); - - run = new Animation(20, true); - run.frames(frames, 0); - - die = new Animation(20, false); - die.frames(frames, 0); - - play(idle); - } - - @Override - public void link(Char ch) { - super.link(ch); - - if (shield == null) { - parent.add(shield = new Shield()); - } - } - - @Override - public void die() { - super.die(); - - if (shield != null) { - shield.putOut(); - } - emitter().start(ElmoParticle.FACTORY, 0.03f, 60); - } - - public class Shield extends Halo { - - private float phase; - - public Shield() { - - super(14, 0xBBAACC, 1f); - - am = -1; - aa = +1; - - phase = 1; - } - - @Override - public void update() { - super.update(); - - if (phase < 1) { - if ((phase -= Game.elapsed) <= 0) { - killAndErase(); - } else { - scale.set((2 - phase) * radius / RADIUS); - am = phase * (-1); - aa = phase * (+1); - } - } - - if (visible = WandmakerSprite.this.visible) { - PointF p = WandmakerSprite.this.center(); - point(p.x, p.y); - } - } - - @Override - public void draw() { - GLES20.glBlendFunc(GL10.GL_SRC_ALPHA, GL10.GL_ONE); - super.draw(); - GLES20.glBlendFunc(GL10.GL_SRC_ALPHA, GL10.GL_ONE_MINUS_SRC_ALPHA); - } - - public void putOut() { - phase = 0.999f; - } - } - -} diff --git a/java/com/hmdzl/spspd/change/sprites/WarlockSprite.java b/java/com/hmdzl/spspd/change/sprites/WarlockSprite.java deleted file mode 100644 index 7dd725d7..00000000 --- a/java/com/hmdzl/spspd/change/sprites/WarlockSprite.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.actors.mobs.Warlock; -import com.hmdzl.spspd.change.effects.MagicMissile; -import com.watabou.noosa.TextureFilm; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Callback; - -public class WarlockSprite extends MobSprite { - - public WarlockSprite() { - super(); - - texture(Assets.WARLOCK); - - TextureFilm frames = new TextureFilm(texture, 12, 15); - - idle = new Animation(2, true); - idle.frames(frames, 0, 0, 0, 1, 0, 0, 1, 1); - - run = new Animation(15, true); - run.frames(frames, 0, 2, 3, 4); - - attack = new Animation(12, false); - attack.frames(frames, 0, 5, 6); - - zap = attack.clone(); - - die = new Animation(15, false); - die.frames(frames, 0, 7, 8, 8, 9, 10); - - play(idle); - } - - @Override - public void zap(int cell) { - - turnTo(ch.pos, cell); - play(zap); - - MagicMissile.shadow(parent, ch.pos, cell, new Callback() { - @Override - public void call() { - ((Warlock) ch).onZapComplete(); - } - }); - Sample.INSTANCE.play(Assets.SND_ZAP); - } - - @Override - public void onComplete(Animation anim) { - if (anim == zap) { - idle(); - } - super.onComplete(anim); - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/WatabouSprite.java b/java/com/hmdzl/spspd/change/sprites/WatabouSprite.java deleted file mode 100644 index 0318b58f..00000000 --- a/java/com/hmdzl/spspd/change/sprites/WatabouSprite.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.levels.Level; -import com.watabou.noosa.TextureFilm; -import com.watabou.noosa.audio.Sample; -import com.watabou.noosa.particles.Emitter; - -public class WatabouSprite extends MobSprite { - - public WatabouSprite() { - super(); - - texture( Assets.WATABOU ); - - TextureFilm frames = new TextureFilm( texture, 16, 14 ); - - idle = new Animation( 15, true ); - idle.frames(frames, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2); - - run = new Animation( 20, true ); - run.frames( frames, 0 ); - - attack = new Animation( 12, false ); - attack.frames( frames, 0, 2, 3 ); - - die = new Animation( 20, false ); - die.frames( frames, 0 ); - - play( idle ); - } - - -} diff --git a/java/com/hmdzl/spspd/change/sprites/WhiteGhostSprite.java b/java/com/hmdzl/spspd/change/sprites/WhiteGhostSprite.java deleted file mode 100644 index 02056c02..00000000 --- a/java/com/hmdzl/spspd/change/sprites/WhiteGhostSprite.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.levels.Level; -import com.watabou.noosa.TextureFilm; -import com.watabou.noosa.audio.Sample; -import com.watabou.noosa.particles.Emitter; - -public class WhiteGhostSprite extends MobSprite { - - public WhiteGhostSprite() { - super(); - - texture( Assets.M_AMD_W ); - - TextureFilm frames = new TextureFilm( texture, 16, 16 ); - - idle = new Animation( 3, true ); - idle.frames(frames, 4, 4, 4, 5, 5, 5, 6, 6, 6, 7, 7, 7); - - run = new Animation( 20, true ); - run.frames( frames, 4 ); - - attack = new Animation( 12, false ); - attack.frames( frames, 4, 6, 7 ); - - die = new Animation( 20, false ); - die.frames( frames, 4 ); - - play( idle ); - } - - -} diff --git a/java/com/hmdzl/spspd/change/sprites/WraithSprite.java b/java/com/hmdzl/spspd/change/sprites/WraithSprite.java deleted file mode 100644 index 616e2825..00000000 --- a/java/com/hmdzl/spspd/change/sprites/WraithSprite.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.items.weapon.missiles.Wave; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.watabou.noosa.TextureFilm; -import com.watabou.utils.Callback; - -public class WraithSprite extends MobSprite { - - private Animation cast; - - public WraithSprite() { - super(); - - texture(Assets.WRAITH); - - TextureFilm frames = new TextureFilm(texture, 14, 15); - - idle = new Animation(5, true); - idle.frames(frames, 0, 1); - - run = new Animation(10, true); - run.frames(frames, 0, 1); - - attack = new Animation(10, false); - attack.frames(frames, 0, 2, 3); - - cast = attack.clone(); - - die = new Animation(8, false); - die.frames(frames, 0, 4, 5, 6, 7); - - play(idle); - } - - @Override - public int blood() { - return 0x88000000; - } - - @Override - public void attack(int cell) { - if (!Level.adjacent(cell, ch.pos)) { - //Char enemy = Actor.findChar(cell); - ((MissileSprite) parent.recycle(MissileSprite.class)).reset(ch.pos, - cell, new Wave(), new Callback() { - @Override - public void call() { - ch.onAttackComplete(); - } - }); - - - play(cast); - turnTo(ch.pos, cell); - - } else { - - super.attack(cell); - - } - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/Xavier251998Sprite.java b/java/com/hmdzl/spspd/change/sprites/Xavier251998Sprite.java deleted file mode 100644 index 9887ce77..00000000 --- a/java/com/hmdzl/spspd/change/sprites/Xavier251998Sprite.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.levels.Level; -import com.watabou.noosa.TextureFilm; -import com.watabou.noosa.audio.Sample; -import com.watabou.noosa.particles.Emitter; - -public class Xavier251998Sprite extends MobSprite { - - public Xavier251998Sprite() { - super(); - - texture( Assets.XAVIER ); - - TextureFilm film = new TextureFilm(texture, 12, 15); - - idle = new Animation(1, true); - idle.frames(film, 0, 1); - - run = new Animation(20, true); - run.frames(film, 0,1,2,3); - - die = new Animation(20, false); - die.frames(film,0,1,2,3); - - attack = new Animation(15, false); - attack.frames(film, 0,1,2,3); - - play(idle); - } - - -} diff --git a/java/com/hmdzl/spspd/change/sprites/XixiZeroSprite.java b/java/com/hmdzl/spspd/change/sprites/XixiZeroSprite.java deleted file mode 100644 index 9a175633..00000000 --- a/java/com/hmdzl/spspd/change/sprites/XixiZeroSprite.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.levels.Level; -import com.watabou.noosa.Game; -import com.watabou.noosa.TextureFilm; -import com.watabou.noosa.audio.Sample; -import com.watabou.noosa.particles.Emitter; - -public class XixiZeroSprite extends MobSprite { - - public XixiZeroSprite() { - super(); - - texture( Assets.XIXIZERO ); - - TextureFilm frames = new TextureFilm( texture, 16, 16 ); - - idle = new Animation( 15, true ); - idle.frames(frames, 0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3); - - run = new Animation( 20, true ); - run.frames( frames, 0 ); - - attack = new Animation( 12, false ); - attack.frames( frames, 0, 2, 3 ); - - die = new Animation( 20, false ); - die.frames( frames, 0 ); - - play( idle ); - } - - -} diff --git a/java/com/hmdzl/spspd/change/sprites/YogSprite.java b/java/com/hmdzl/spspd/change/sprites/YogSprite.java deleted file mode 100644 index ace43e1c..00000000 --- a/java/com/hmdzl/spspd/change/sprites/YogSprite.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.effects.Splash; -import com.watabou.noosa.TextureFilm; - -public class YogSprite extends MobSprite { - - public YogSprite() { - super(); - - texture(Assets.YOG); - - TextureFilm frames = new TextureFilm(texture, 20, 19); - - idle = new Animation(10, true); - idle.frames(frames, 0, 1, 2, 2, 1, 0, 3, 4, 4, 3, 0, 5, 6, 6, 5); - - run = new Animation(12, true); - run.frames(frames, 0); - - attack = new Animation(12, false); - attack.frames(frames, 0); - - die = new Animation(10, false); - die.frames(frames, 0, 7, 8, 9); - - play(idle); - } - - @Override - public void die() { - super.die(); - - Splash.at(center(), blood(), 12); - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/ZombieSprite.java b/java/com/hmdzl/spspd/change/sprites/ZombieSprite.java deleted file mode 100644 index 8a0e6f59..00000000 --- a/java/com/hmdzl/spspd/change/sprites/ZombieSprite.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Unleashed Pixel Dungeon - * Copyright (C) 2015 David Mitchell - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.watabou.noosa.TextureFilm; - -public class ZombieSprite extends MobSprite { - - public ZombieSprite() { - super(); - - texture( Assets.ZOMBIE ); - - TextureFilm frames = new TextureFilm( texture, 12, 16 ); - - idle = new Animation( 5, true ); - idle.frames( frames, 0, 1 ); - - run = new Animation( 10, true ); - run.frames( frames, 2, 3, 4, 5, 6 ); - - attack = new Animation( 10, false ); - attack.frames( frames, 7, 8, 9, 8 ); - - die = new Animation( 8, false ); - die.frames( frames, 1, 10, 11, 12 ); - - play( idle ); - } - - @Override - public int blood() { - return 0x99FF99; - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/ZotPhaseSprite.java b/java/com/hmdzl/spspd/change/sprites/ZotPhaseSprite.java deleted file mode 100644 index 660dca8b..00000000 --- a/java/com/hmdzl/spspd/change/sprites/ZotPhaseSprite.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.actors.mobs.ZotPhase; -import com.hmdzl.spspd.change.effects.Lightning; -import com.watabou.noosa.TextureFilm; - -public class ZotPhaseSprite extends MobSprite { - - private int[] points = new int[2]; - - public ZotPhaseSprite() { - super(); - - texture(Assets.ZOTPHASE); - - TextureFilm frames = new TextureFilm(texture, 18, 18); - - idle = new Animation(2, true); - idle.frames(frames, 0, 0, 0, 1, 0); - - run = new Animation(8, false); - run.frames(frames, 0, 1, 2); - - attack = new Animation(8, false); - attack.frames(frames, 0, 2, 2); - - zap = new Animation(8, false); - zap.frames(frames, 2, 3, 4); - - die = new Animation(8, false); - die.frames(frames, 0, 5, 6, 7, 8, 9, 8); - - play(idle); - } -} diff --git a/java/com/hmdzl/spspd/change/sprites/ZotSprite.java b/java/com/hmdzl/spspd/change/sprites/ZotSprite.java deleted file mode 100644 index c13009b3..00000000 --- a/java/com/hmdzl/spspd/change/sprites/ZotSprite.java +++ /dev/null @@ -1,162 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.ResultDescriptions; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; - -import com.hmdzl.spspd.change.effects.CellEmitter; -import com.hmdzl.spspd.change.effects.Lightning; -import com.hmdzl.spspd.change.effects.particles.BlastParticle; -import com.hmdzl.spspd.change.effects.particles.SmokeParticle; -import com.hmdzl.spspd.change.items.weapon.missiles.Skull; -import com.hmdzl.spspd.change.items.weapon.missiles.Wave; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.Terrain; -import com.hmdzl.spspd.change.scenes.GameScene; - -import com.watabou.noosa.TextureFilm; -import com.watabou.noosa.audio.Sample; -import com.watabou.utils.Callback; -import com.watabou.utils.Random; - -public class ZotSprite extends MobSprite { - - private Animation cast; - - public ZotSprite() { - super(); - - texture(Assets.ZOT); - - TextureFilm frames = new TextureFilm(texture, 18, 18); - - idle = new Animation(2, true); - idle.frames(frames, 0, 0, 0, 1, 0); - - run = new Animation(8, false); - run.frames(frames, 0, 1, 2); - - attack = new Animation(8, false); - attack.frames(frames, 0, 2, 2); - - cast = new Animation(8, false); - cast.frames(frames, 2, 3, 4); - - die = new Animation(8, false); - die.frames(frames, 0, 5, 6, 7, 8, 9, 8); - - play(run.clone()); - } - - @Override - public void move(int from, int to) { - - place(to); - - play(run); - turnTo(from, to); - - isMoving = true; - - if (Level.water[to]) { - GameScene.ripple(to); - } - - ch.onMotionComplete(); - } - - @Override - public void attack(int cell) { - if (!Level.adjacent(cell, ch.pos)) { - //Char enemy = Actor.findChar(cell); - ((MissileSprite) parent.recycle(MissileSprite.class)).reset(ch.pos, - cell, new Skull(), new Callback() { - @Override - public void call() { - ch.onAttackComplete(); - } - }); - - - play(cast); - turnTo(ch.pos, cell); - explode(cell); - - } else { - - super.attack(cell); - - } - } - - public void explode(int cell) { - - Sample.INSTANCE.play(Assets.SND_BLAST, 2); - - if (Dungeon.visible[cell]) { - CellEmitter.center(cell).burst(BlastParticle.FACTORY, 30); - } - - boolean terrainAffected = false; - for (int n : Level.NEIGHBOURS9) { - int c = cell + n; - if (c >= 0 && c < Level.getLength()) { - - if (Level.flamable[c]) { - Level.set(c, Terrain.EMBERS); - GameScene.updateMap(c); - terrainAffected = true; - } - - Char ch = Actor.findChar(c); - if (ch != null && ch==Dungeon.hero) { - // those not at the center of the blast take damage less - // consistently. - int minDamage = c == cell ? Dungeon.depth + 5 : 1; - int maxDamage = 10 + Dungeon.depth; - - int dmg = Random.NormalIntRange(minDamage, maxDamage) - - Math.max(ch.drRoll(),0); - if (dmg > 0) { - ch.damage(dmg, this); - } - } - } - } - - if (terrainAffected) { - Dungeon.observe(); - } - - } - - - @Override - public void onComplete(Animation anim) { - if (anim == run) { - isMoving = false; - idle(); - } else { - super.onComplete(anim); - } - } -} diff --git a/java/com/hmdzl/spspd/change/ui/ActionIndicator.java b/java/com/hmdzl/spspd/change/ui/ActionIndicator.java deleted file mode 100644 index 043dd1a2..00000000 --- a/java/com/hmdzl/spspd/change/ui/ActionIndicator.java +++ /dev/null @@ -1,119 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * Shattered Pixel Dungeon - * Copyright (C) 2014-2016 Evan Debenham - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.ui; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.scenes.PixelScene; -import com.watabou.noosa.Image; - -public class ActionIndicator extends Tag { - - Image icon; - - public static Action action; - public static ActionIndicator instance; - - public ActionIndicator() { - super( 0xFFFF4C ); - - instance = this; - - setSize( 24, 24 ); - visible = false; - } - - @Override - public void destroy() { - super.destroy(); - instance = null; - action = null; - } - - @Override - protected void layout() { - super.layout(); - - if (icon != null){ - icon.x = x + (width - icon.width()) / 2; - icon.y = y + (height - icon.height()) / 2; - PixelScene.align(icon); - if (!members.contains(icon)) - add(icon); - } - } - - @Override - public void update() { - super.update(); - - if (!Dungeon.hero.ready){ - if (icon != null) icon.alpha(0.5f); - } else { - if (icon != null) icon.alpha(1f); - } - - if (!visible && action != null){ - visible = true; - updateIcon(); - flash(); - } else { - visible = action != null; - } - } - - @Override - protected void onClick() { - if (action != null && Dungeon.hero.ready) - action.doAction(); - } - - public static void setAction(Action action){ - ActionIndicator.action = action; - updateIcon(); - } - - public static void clearAction(Action action){ - if (ActionIndicator.action == action) - ActionIndicator.action = null; - } - - public static void updateIcon(){ - if (instance != null){ - if (instance.icon != null){ - instance.icon.killAndErase(); - instance.icon = null; - } - if (action != null){ - instance.icon = action.getIcon(); - instance.layout(); - } - } - } - - public interface Action{ - - public Image getIcon(); - - public void doAction(); - - } - -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/ui/Archs.java b/java/com/hmdzl/spspd/change/ui/Archs.java deleted file mode 100644 index 8b601041..00000000 --- a/java/com/hmdzl/spspd/change/ui/Archs.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.ui; - -import com.hmdzl.spspd.change.Assets; -import com.watabou.noosa.Game; -import com.watabou.noosa.SkinnedBlock; -import com.watabou.noosa.ui.Component; - -public class Archs extends Component { - - private static final float SCROLL_SPEED = 20f; - - private SkinnedBlock arcsBg; - private SkinnedBlock arcsFg; - - private static float offsB = 0; - private static float offsF = 0; - - public boolean reversed = false; - - @Override - protected void createChildren() { - arcsBg = new SkinnedBlock(1, 1, Assets.ARCS_BG); - arcsBg.offsetTo(0, offsB); - add(arcsBg); - - arcsFg = new SkinnedBlock(1, 1, Assets.ARCS_FG); - arcsFg.offsetTo(0, offsF); - add(arcsFg); - } - - @Override - protected void layout() { - arcsBg.size(width, height); - arcsBg.offset(arcsBg.texture.width / 4 - (width % arcsBg.texture.width) - / 2, 0); - - arcsFg.size(width, height); - arcsFg.offset(arcsFg.texture.width / 4 - (width % arcsFg.texture.width) - / 2, 0); - } - - @Override - public void update() { - - super.update(); - - float shift = Game.elapsed * SCROLL_SPEED; - if (reversed) { - shift = -shift; - } - - arcsBg.offset(0, shift); - arcsFg.offset(0, shift * 2); - - offsB = arcsBg.offsetY(); - offsF = arcsFg.offsetY(); - } -} diff --git a/java/com/hmdzl/spspd/change/ui/AttackIndicator.java b/java/com/hmdzl/spspd/change/ui/AttackIndicator.java deleted file mode 100644 index fb67c953..00000000 --- a/java/com/hmdzl/spspd/change/ui/AttackIndicator.java +++ /dev/null @@ -1,182 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.ui; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.scenes.PixelScene; -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.watabou.noosa.Game; -import com.watabou.utils.Random; - -public class AttackIndicator extends Tag { - - private static final float ENABLED = 1.0f; - private static final float DISABLED = 0.3f; - - private static float delay = 0.75f; - - private static AttackIndicator instance; - - private CharSprite sprite = null; - - private static Mob lastTarget = null; - private ArrayList candidates = new ArrayList(); - - public AttackIndicator() { - super(DangerIndicator.COLOR); - - instance = this; - - setSize(24, 24); - visible(false); - enable(false); - } - - @Override - protected void createChildren() { - super.createChildren(); - } - - @Override - protected void layout() { - super.layout(); - - if (sprite != null) { - sprite.x = x + (width - sprite.width()) / 2; - sprite.y = y + (height - sprite.height()) / 2; - PixelScene.align(sprite); - } - } - - @Override - public void update() { - super.update(); - - if (!bg.visible) { - enable(false); - if (delay > 0f) - delay -= Game.elapsed; - if (delay <= 0f) - active = false; - } else { - delay = 0.75f; - active = true; - - if (Dungeon.hero.isAlive()) { - - enable(Dungeon.hero.ready); - - } else { - visible(false); - enable(false); - } - } - } - - private void checkEnemies() { - - candidates.clear(); - int v = Dungeon.hero.visibleEnemies(); - for (int i = 0; i < v; i++) { - Mob mob = Dungeon.hero.visibleEnemy(i); - if (Dungeon.hero.canAttack(mob)) { - candidates.add(mob); - } - } - - if (!candidates.contains(lastTarget)) { - if (candidates.isEmpty()) { - lastTarget = null; - } else { - active = true; - lastTarget = Random.element(candidates); - updateImage(); - flash(); - } - } else { - if (!bg.visible) { - active = true; - flash(); - } - } - - visible(lastTarget != null); - enable(bg.visible); - } - - private void updateImage() { - - if (sprite != null) { - sprite.killAndErase(); - sprite = null; - } - - try { - sprite = lastTarget.spriteClass.newInstance(); - active = true; - sprite.idle(); - sprite.paused = true; - add(sprite); - - sprite.x = x + (width - sprite.width()) / 2 + 1; - sprite.y = y + (height - sprite.height()) / 2; - PixelScene.align(sprite); - - } catch (Exception e) { - } - } - - private boolean enabled = true; - - private void enable(boolean value) { - enabled = value; - if (sprite != null) { - sprite.alpha(value ? ENABLED : DISABLED); - } - } - - private void visible(boolean value) { - bg.visible = value; - if (sprite != null) { - sprite.visible = value; - } - } - - @Override - protected void onClick() { - if (enabled) { - Dungeon.hero.handle(lastTarget.pos); - } - } - - public static void target(Char target) { - lastTarget = (Mob) target; - instance.updateImage(); - - HealthIndicator.instance.target(target); - } - - public static void updateState() { - instance.checkEnemies(); - } -} diff --git a/java/com/hmdzl/spspd/change/ui/BadgesList.java b/java/com/hmdzl/spspd/change/ui/BadgesList.java deleted file mode 100644 index 818e523d..00000000 --- a/java/com/hmdzl/spspd/change/ui/BadgesList.java +++ /dev/null @@ -1,123 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.ui; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.effects.BadgeBanner; -import com.hmdzl.spspd.change.scenes.PixelScene; -import com.hmdzl.spspd.change.windows.WndBadge; -import com.watabou.noosa.BitmapText; -import com.watabou.noosa.Game; -import com.watabou.noosa.Image; -import com.watabou.noosa.audio.Sample; -import com.watabou.noosa.ui.Component; -import com.watabou.noosa.RenderedText; - -public class BadgesList extends ScrollPane { - - private ArrayList items = new ArrayList(); - - public BadgesList(boolean global) { - super(new Component()); - - for (Badges.Badge badge : Badges.filtered(global)) { - - if (badge.image == -1) { - continue; - } - - ListItem item = new ListItem(badge); - content.add(item); - items.add(item); - } - } - - @Override - protected void layout() { - super.layout(); - - float pos = 0; - - int size = items.size(); - for (int i = 0; i < size; i++) { - items.get(i).setRect(0, pos, width, ListItem.HEIGHT); - pos += ListItem.HEIGHT; - } - - content.setSize(width, pos); - } - - @Override - public void onClick(float x, float y) { - int size = items.size(); - for (int i = 0; i < size; i++) { - if (items.get(i).onClick(x, y)) { - break; - } - } - } - - private class ListItem extends Component { - - private static final float HEIGHT = 20; - - private Badges.Badge badge; - - private Image icon; - private RenderedText label; - - public ListItem(Badges.Badge badge) { - super(); - - this.badge = badge; - icon.copy(BadgeBanner.image(badge.image)); - label.text(badge.desc() ); - } - - @Override - protected void createChildren() { - icon = new Image(); - add(icon); - - label = PixelScene.renderText(6); - add(label); - } - - @Override - protected void layout() { - icon.x = x; - icon.y = PixelScene.align(y + (height - icon.height) / 2); - - label.x = icon.x + icon.width + 2; - label.y = PixelScene.align(y + (height - label.baseLine()) / 2); - } - - public boolean onClick(float x, float y) { - if (inside(x, y)) { - Sample.INSTANCE.play(Assets.SND_CLICK, 0.7f, 0.7f, 1.2f); - Game.scene().add(new WndBadge(badge)); - return true; - } else { - return false; - } - } - } -} diff --git a/java/com/hmdzl/spspd/change/ui/Banner.java b/java/com/hmdzl/spspd/change/ui/Banner.java deleted file mode 100644 index 77c2a575..00000000 --- a/java/com/hmdzl/spspd/change/ui/Banner.java +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.ui; - -import com.watabou.noosa.Game; -import com.watabou.noosa.Image; - -public class Banner extends Image { - - private enum State { - FADE_IN, STATIC, FADE_OUT - }; - - private State state; - - private float time; - - private int color; - private float fadeTime; - private float showTime; - - public Banner(Image sample) { - super(); - copy(sample); - alpha(0); - } - - public Banner(Object tx) { - super(tx); - alpha(0); - } - - public void show(int color, float fadeTime, float showTime) { - - this.color = color; - this.fadeTime = fadeTime; - this.showTime = showTime; - - state = State.FADE_IN; - - time = fadeTime; - } - - public void show(int color, float fadeTime) { - show(color, fadeTime, Float.MAX_VALUE); - } - - @Override - public void update() { - super.update(); - - time -= Game.elapsed; - if (time >= 0) { - - float p = time / fadeTime; - - switch (state) { - case FADE_IN: - tint(color, p); - alpha(1 - p); - break; - case STATIC: - break; - case FADE_OUT: - alpha(p); - break; - } - - } else { - - switch (state) { - case FADE_IN: - time = showTime; - state = State.STATIC; - break; - case STATIC: - time = fadeTime; - state = State.FADE_OUT; - break; - case FADE_OUT: - killAndErase(); - break; - } - - } - } -} diff --git a/java/com/hmdzl/spspd/change/ui/BuffIndicator.java b/java/com/hmdzl/spspd/change/ui/BuffIndicator.java deleted file mode 100644 index 156370a9..00000000 --- a/java/com/hmdzl/spspd/change/ui/BuffIndicator.java +++ /dev/null @@ -1,302 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.ui; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.windows.WndInfoBuff; -import com.watabou.gltextures.SmartTexture; -import com.watabou.gltextures.TextureCache; -import com.watabou.noosa.Image; -import com.watabou.noosa.TextureFilm; -import com.watabou.noosa.tweeners.AlphaTweener; -import com.watabou.noosa.ui.Button; -import com.watabou.noosa.ui.Component; -import com.watabou.utils.SparseArray; - -public class BuffIndicator extends Component { - - public static final int NONE = -1; - - public static final int MIND_VISION = 0; - public static final int LEVITATION = 1; - public static final int FIRE = 2; - public static final int POISON = 3; - public static final int PARALYSIS = 4; - public static final int HUNGER = 5; - public static final int STARVATION = 6; - public static final int SLOW = 7; - public static final int OOZE = 8; - public static final int AMOK = 9; - public static final int TERROR = 10; - public static final int ROOTS = 11; - public static final int INVISIBLE = 12; - public static final int SHADOWS = 13; - public static final int WEAKNESS = 14; - public static final int FROST = 15; - public static final int BLINDNESS = 16; - public static final int COMBO = 17; - public static final int FURY = 18; - public static final int HEALING = 19; - public static final int ARMOR = 20; - public static final int HEART = 21; - public static final int LIGHT = 22; - public static final int CRIPPLE = 23; - public static final int BARKSKIN = 24; - public static final int IMMUNITY = 25; - public static final int BLEEDING = 26; - public static final int MARK = 27; - public static final int DEFERRED = 28; - public static final int DROWSY = 29; - public static final int MAGIC_SLEEP = 30; - public static final int THORNS = 31; - public static final int FORESIGHT = 32; - public static final int VERTIGO = 33; - public static final int RECHARGING = 34; - public static final int LOCKED_FLOOR= 35; - public static final int CORRUPT = 36; - public static final int BLESS = 37; - public static final int HASTE = 38; - public static final int REGEN = 39; - public static final int COUNTDOWN = 40; - public static final int MOON_FURY = 41; - public static final int DEWCHARGE = 42; - public static final int DISPEL = 43; - public static final int PFIRE = 44; - public static final int PTOXIC = 45; - public static final int PEARTH = 46; - public static final int PBLOOD = 47; - public static final int SHIELDBLOCK = 48; - public static final int OVERFED = 49; - public static final int TAR = 50; - public static final int WET = 51; - public static final int HOT = 52; - public static final int COLD = 53; - public static final int DRY = 54; - public static final int SILENT = 55; - public static final int DISARM = 56; - public static final int GLASS_SHIELD = 57; - public static final int ARMOR_BREAK = 58; - public static final int TAUNT = 59; - public static final int GROW_SEED = 60; - public static final int ATTACK_UP = 61; - public static final int SHOCKED = 62; - public static final int RHYTHM = 63; - public static final int RHYTHM2 = 64; - public static final int ARCANE = 65; - public static final int NO_FUSHIGI = 66; - public static final int GOLDTOUCH = 67; - public static final int NEEDLING = 68; - public static final int FEED = 69; - public static final int NOTICE = 70; - public static final int BLOODANGRY = 71; - public static final int WARGROOVE = 72; - public static final int MECHARMOR = 73; - public static final int VOICE_UP = 74; - public static final int HIGH_ATTACK = 75; - public static final int SMASH = 76; - public static final int UNKNOW_BOX = 77; - public static final int MIRROR_SHIELD = 78; - - public static final int HUMAN_FAITH = 79; - public static final int DEMON_FAITH = 80; - public static final int LIFE_FAITH = 81; - public static final int MECH_FAITH = 82; - public static final int BALANCE_FAITH = 83; - - public static final int SIZE = 7; - - /*private static BuffIndicator heroInstance; - - private SmartTexture texture; - private TextureFilm film; - - private SparseArray icons = new SparseArray(); - - private Char ch; - - public BuffIndicator(Char ch) { - super(); - - this.ch = ch; - if (ch == Dungeon.hero) { - heroInstance = this; - } - } - - @Override - public void destroy() { - super.destroy(); - - if (this == heroInstance) { - heroInstance = null; - } - } - - @Override - protected void createChildren() { - texture = TextureCache.get(Assets.BUFFS_SMALL); - film = new TextureFilm(texture, SIZE, SIZE); - } - - @Override - protected void layout() { - clear(); - - SparseArray newIcons = new SparseArray(); - - for (Buff buff : ch.buffs()) { - int icon = buff.icon(); - if (icon != NONE) { - Image img = new Image(texture); - img.frame(film.get(icon)); - img.x = x + members.size() * (SIZE + 2); - img.y = y; - add(img); - - newIcons.put(icon, img); - } - } - - for (Integer key : icons.keyArray()) { - if (newIcons.get(key) == null) { - Image icon = icons.get(key); - icon.origin.set(SIZE / 2); - add(icon); - add(new AlphaTweener(icon, 0, 0.6f) { - @Override - protected void updateValues(float progress) { - super.updateValues(progress); - image.scale.set(1 + 5 * progress); - }; - }); - } - } - - icons = newIcons; - } - - public static void refreshHero() { - if (heroInstance != null) { - heroInstance.layout(); - } - }*/ - private static BuffIndicator heroInstance; - - private SmartTexture texture; - private TextureFilm film; - - private SparseArray icons = new SparseArray(); - - private Char ch; - - public BuffIndicator( Char ch ) { - super(); - - this.ch = ch; - if (ch == Dungeon.hero) { - heroInstance = this; - } - } - - @Override - public void destroy() { - super.destroy(); - - if (this == heroInstance) { - heroInstance = null; - } - } - - @Override - protected void createChildren() { - texture = TextureCache.get( Assets.BUFFS_SMALL ); - film = new TextureFilm( texture, SIZE, SIZE ); - } - - @Override - protected void layout() { - clear(); - - SparseArray newIcons = new SparseArray(); - - for (Buff buff : ch.buffs()) { - if (buff.icon() != NONE) { - BuffIcon icon = new BuffIcon( buff ); - icon.setRect(x + members.size() * (SIZE + 2), y, 9, 12); - add(icon); - newIcons.put( buff.icon(), icon ); - } - } - - for (Integer key : icons.keyArray()) { - if (newIcons.get( key ) == null) { - Image icon = icons.get( key ).icon; - icon.origin.set( SIZE / 2 ); - add( icon ); - add( new AlphaTweener( icon, 0, 0.6f ) { - @Override - protected void updateValues( float progress ) { - super.updateValues( progress ); - image.scale.set( 1 + 5 * progress ); - }; - } ); - } - } - - icons = newIcons; - } - - private class BuffIcon extends Button { - - private Buff buff; - - public Image icon; - - public BuffIcon( Buff buff ){ - super(); - this.buff = buff; - - icon = new Image( texture ); - icon.frame( film.get( buff.icon() ) ); - add( icon ); - } - - @Override - protected void layout() { - super.layout(); - icon.x = this.x+1; - icon.y = this.y+2; - } - - @Override - protected void onClick() { - GameScene.show(new WndInfoBuff(buff)); - } - } - - public static void refreshHero() { - if (heroInstance != null) { - heroInstance.layout(); - } - } - -} diff --git a/java/com/hmdzl/spspd/change/ui/BusyIndicator.java b/java/com/hmdzl/spspd/change/ui/BusyIndicator.java deleted file mode 100644 index 3cac5ef9..00000000 --- a/java/com/hmdzl/spspd/change/ui/BusyIndicator.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.ui; - -import com.hmdzl.spspd.change.Dungeon; -import com.watabou.noosa.Image; - -public class BusyIndicator extends Image { - - public BusyIndicator() { - super(); - copy(Icons.BUSY.get()); - - origin.set(width / 2, height / 2); - angularSpeed = 720; - } - - @Override - public void update() { - super.update(); - visible = Dungeon.hero.isAlive() && !Dungeon.hero.ready; - } -} diff --git a/java/com/hmdzl/spspd/change/ui/ChangesButton.java b/java/com/hmdzl/spspd/change/ui/ChangesButton.java deleted file mode 100644 index 27fdf1cd..00000000 --- a/java/com/hmdzl/spspd/change/ui/ChangesButton.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * Shattered Pixel Dungeon - * Copyright (C) 2014-2015 Evan Debenham - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.ui; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.ShatteredPixelDungeon; -import com.hmdzl.spspd.change.scenes.WelcomeScene; -import com.watabou.noosa.Image; -import com.watabou.noosa.audio.Sample; -import com.watabou.noosa.ui.Button; - -public class ChangesButton extends Button { - - protected Image image; - - public ChangesButton() { - super(); - - width = image.width; - height = image.height; - } - - @Override - protected void createChildren() { - super.createChildren(); - - image = Icons.NOTES.get(); - add( image ); - } - - @Override - protected void layout() { - super.layout(); - - image.x = x; - image.y = y; - } - - @Override - protected void onTouchDown() { - image.brightness( 1.5f ); - Sample.INSTANCE.play( Assets.SND_CLICK ); - } - - @Override - protected void onTouchUp() { - image.resetColor(); - } - - @Override - protected void onClick() { - ShatteredPixelDungeon.switchNoFade(WelcomeScene.class); - } -} diff --git a/java/com/hmdzl/spspd/change/ui/CharHealthIndicator.java b/java/com/hmdzl/spspd/change/ui/CharHealthIndicator.java deleted file mode 100644 index 20830c4b..00000000 --- a/java/com/hmdzl/spspd/change/ui/CharHealthIndicator.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * Shattered Pixel Dungeon - * Copyright (C) 2014-2019 Evan Debenham - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ - -package com.hmdzl.spspd.change.ui; - -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.hmdzl.spspd.change.ui.HealthBar; - -public class CharHealthIndicator extends HealthBar { - - private static final int HEIGHT = 1; - - private Char target; - - public CharHealthIndicator( Char c ){ - target = c; - GameScene.add(this); - } - - @Override - protected void createChildren() { - super.createChildren(); - height = HEIGHT; - } - - @Override - public void update() { - super.update(); - - if (target != null && target.isAlive() && target.sprite.visible) { - CharSprite sprite = target.sprite; - width = sprite.width()*(4/6f); - x = sprite.x + sprite.width()/6f; - y = sprite.y - 2; - level( target ); - visible = target.HP < target.HT; - } else { - visible = false; - } - } - - public void target( Char ch ) { - if (ch != null && ch.isAlive()) { - target = ch; - } else { - target = null; - } - } - - public Char target() { - return target; - } -} diff --git a/java/com/hmdzl/spspd/change/ui/CheckBox.java b/java/com/hmdzl/spspd/change/ui/CheckBox.java deleted file mode 100644 index 8679db48..00000000 --- a/java/com/hmdzl/spspd/change/ui/CheckBox.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.ui; - -import com.hmdzl.spspd.change.scenes.PixelScene; - -public class CheckBox extends RedButton { - - private boolean checked = false; - - public CheckBox(String label) { - super(label); - - icon(Icons.get(Icons.UNCHECKED)); - } - - @Override - protected void layout() { - super.layout(); - - float margin = (height - text.baseLine()) / 2; - - text.x = PixelScene.align(PixelScene.uiCamera, x + margin); - text.y = PixelScene.align(PixelScene.uiCamera, y + margin); - - margin = (height - icon.height) / 2; - - icon.x = PixelScene.align(PixelScene.uiCamera, x + width - margin - - icon.width); - icon.y = PixelScene.align(PixelScene.uiCamera, y + margin); - } - - public boolean checked() { - return checked; - } - - public void checked(boolean value) { - if (checked != value) { - checked = value; - icon.copy(Icons.get(checked ? Icons.CHECKED : Icons.UNCHECKED)); - } - } - - @Override - protected void onClick() { - super.onClick(); - checked(!checked); - } -} diff --git a/java/com/hmdzl/spspd/change/ui/Compass.java b/java/com/hmdzl/spspd/change/ui/Compass.java deleted file mode 100644 index 48d176e8..00000000 --- a/java/com/hmdzl/spspd/change/ui/Compass.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.ui; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.DungeonTilemap; -import com.watabou.noosa.Camera; -import com.watabou.noosa.Image; -import com.watabou.utils.PointF; - -public class Compass extends Image { - - private static final float RAD_2_G = 180f / 3.1415926f; - private static final float RADIUS = 12; - - private int cell; - private PointF cellCenter; - - private PointF lastScroll = new PointF(); - - public Compass(int cell) { - - super(); - copy(Icons.COMPASS.get()); - origin.set(width / 2, RADIUS); - - this.cell = cell; - cellCenter = DungeonTilemap.tileCenterToWorld(cell); - visible = false; - } - - @Override - public void update() { - super.update(); - - if (!visible) { - visible = Dungeon.level.visited[cell] || Dungeon.level.mapped[cell]; - } - - if (visible) { - PointF scroll = Camera.main.scroll; - if (!scroll.equals(lastScroll)) { - lastScroll.set(scroll); - PointF center = Camera.main.center().offset(scroll); - angle = (float) Math.atan2(cellCenter.x - center.x, center.y - - cellCenter.y) - * RAD_2_G; - } - } - } -} diff --git a/java/com/hmdzl/spspd/change/ui/CustomTileVisual.java b/java/com/hmdzl/spspd/change/ui/CustomTileVisual.java deleted file mode 100644 index 163a8493..00000000 --- a/java/com/hmdzl/spspd/change/ui/CustomTileVisual.java +++ /dev/null @@ -1,123 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * Shattered Pixel Dungeon - * Copyright (C) 2014-2015 Evan Debenham - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.ui; - -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.Room; -import com.watabou.noosa.Image; -import com.watabou.utils.Bundlable; -import com.watabou.utils.Bundle; - -import java.util.ArrayList; - -public abstract class CustomTileVisual extends Image implements Bundlable { - - protected static final int TILE_SIZE = 16; - - public String name; - - protected String tx; //string for resource file - protected int txX, txY; //position(in tiles) within resource file - //bundleable offsets from the standard texture xy, useful for mapping larger than 1x1 textures to many tiles - //(e.g. mapping a 3x3 texture to a room, where the corners are walls and the center is the floor) - protected int ofsX = 0, ofsY = 0; - - public int tileX, tileY; //x and y coords for texture within a level - public int tileW = 1, tileH = 1; //width and height in tiles - - public void pos(int pos) { - pos( pos%Level.WIDTH, pos/Level.WIDTH ); - } - - public void pos(int tileX, int tileY){ - this.tileX = tileX; - this.tileY = tileY; - } - - public String desc(){ - return null; - } - - public CustomTileVisual create() { - texture(tx); - frame(texture.uvRect((txX + ofsX) * TILE_SIZE, (txY + ofsY) * TILE_SIZE, - (txX + ofsX + tileW) * TILE_SIZE, (txY + ofsY + tileH) * TILE_SIZE)); - - x = tileX*TILE_SIZE; - y = tileY*TILE_SIZE; - - return this; - } - - //returns a number of 1x1 tiles to fill a room, based on a 3x3 texture, not dissimilar to a ninepatch. - public static ArrayList CustomTilesForRoom(Room r, Class c){ - ArrayList result = new ArrayList<>(); - - try { - for (int x = r.left; x <= r.right; x++) { - for (int y = r.top; y <= r.bottom; y++) { - CustomTileVisual vis = c.newInstance(); - - if (x == r.right) vis.ofsX = 2; - else if (x != r.left) vis.ofsX = 1; - - if (y == r.bottom) vis.ofsY = 2; - else if (y != r.top) vis.ofsY = 1; - - vis.pos(x, y); - result.add(vis); - } - } - } catch (InstantiationException | IllegalAccessException e) { - throw new RuntimeException("Something went wrong while making a bunch of tile visuals for a room!", e); - } - - return result; - } - - private static final String TILE_X = "tileX"; - private static final String TILE_Y = "tileY"; - - private static final String OFS_X = "ofsX"; - private static final String OFS_Y = "ofsY"; - - @Override - public void restoreFromBundle(Bundle bundle) { - tileX = bundle.getInt(TILE_X); - tileY = bundle.getInt(TILE_Y); - - //if these weren't stored they will default to 0 - ofsX = bundle.getInt(OFS_X); - ofsY = bundle.getInt(OFS_Y); - } - - @Override - public void storeInBundle(Bundle bundle) { - bundle.put(TILE_X, tileX); - bundle.put(TILE_Y, tileY); - - //don't need to store this in all cases - if (ofsX != 0 || ofsY != 0){ - bundle.put(OFS_X, ofsX); - bundle.put(OFS_Y, ofsY); - } - } -} diff --git a/java/com/hmdzl/spspd/change/ui/DangerIndicator.java b/java/com/hmdzl/spspd/change/ui/DangerIndicator.java deleted file mode 100644 index 9d3ae695..00000000 --- a/java/com/hmdzl/spspd/change/ui/DangerIndicator.java +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.ui; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.scenes.PixelScene; -import com.watabou.noosa.BitmapText; -import com.watabou.noosa.Camera; -import com.watabou.noosa.Image; - -public class DangerIndicator extends Tag { - - public static final int COLOR = 0xFF4C4C; - - private BitmapText number; - private Image icon; - - private int enemyIndex = 0; - - private int lastNumber = -1; - - public DangerIndicator() { - super(0xFF4C4C); - - setSize(24, 16); - - visible = false; - } - - @Override - protected void createChildren() { - super.createChildren(); - - number = new BitmapText(PixelScene.font1x); - add(number); - - icon = Icons.SKULL.get(); - add(icon); - } - - @Override - protected void layout() { - super.layout(); - - icon.x = right() - 10; - icon.y = y + (height - icon.height) / 2; - - placeNumber(); - } - - private void placeNumber() { - number.x = right() - 11 - number.width(); - number.y = PixelScene.align(y + (height - number.baseLine()) / 2); - } - - @Override - public void update() { - - if (Dungeon.hero.isAlive()) { - int v = Dungeon.hero.visibleEnemies(); - if (v != lastNumber) { - lastNumber = v; - if (visible = lastNumber > 0) { - number.text(Integer.toString(lastNumber)); - number.measure(); - placeNumber(); - - flash(); - } - } - } else { - visible = false; - } - - super.update(); - } - - @Override - protected void onClick() { - - Mob target = Dungeon.hero.visibleEnemy(enemyIndex++); - - HealthIndicator.instance.target(target == HealthIndicator.instance - .target() ? null : target); - - if (Dungeon.hero.curAction == null) { - Camera.main.target = null; - Camera.main.focusOn(target.sprite); - } - } -} diff --git a/java/com/hmdzl/spspd/change/ui/ExitButton.java b/java/com/hmdzl/spspd/change/ui/ExitButton.java deleted file mode 100644 index fde5f7c2..00000000 --- a/java/com/hmdzl/spspd/change/ui/ExitButton.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.ui; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.ShatteredPixelDungeon; -import com.hmdzl.spspd.change.scenes.TitleScene; -import com.watabou.noosa.Game; -import com.watabou.noosa.Image; -import com.watabou.noosa.audio.Sample; -import com.watabou.noosa.ui.Button; - -public class ExitButton extends Button { - - protected Image image; - - public ExitButton() { - super(); - - width = image.width; - height = image.height; - } - - @Override - protected void createChildren() { - super.createChildren(); - - image = Icons.EXIT.get(); - add(image); - } - - @Override - protected void layout() { - super.layout(); - - image.x = x; - image.y = y; - } - - @Override - protected void onTouchDown() { - image.brightness(1.5f); - Sample.INSTANCE.play(Assets.SND_CLICK); - } - - @Override - protected void onTouchUp() { - image.resetColor(); - } - - @Override - protected void onClick() { - if (Game.scene() instanceof TitleScene) { - Game.instance.finish(); - } else { - ShatteredPixelDungeon.switchNoFade(TitleScene.class); - } - } -} diff --git a/java/com/hmdzl/spspd/change/ui/GameLog.java b/java/com/hmdzl/spspd/change/ui/GameLog.java deleted file mode 100644 index 02a1e4d5..00000000 --- a/java/com/hmdzl/spspd/change/ui/GameLog.java +++ /dev/null @@ -1,157 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * Shattered Pixel Dungeon - * Copyright (C) 2014-2016 Evan Debenham - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.ui; - -import com.hmdzl.spspd.change.scenes.PixelScene; -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.hmdzl.spspd.change.utils.GLog; -import com.watabou.noosa.ui.Component; -import com.watabou.utils.Signal; - -import java.util.ArrayList; -import java.util.regex.Pattern; - -public class GameLog extends Component implements Signal.Listener { - - private static final int MAX_LINES = 3; - - private static final Pattern PUNCTUATION = Pattern.compile( ".*[.,;?! ]$" ); - - private RenderedTextMultiline lastEntry; - private int lastColor; - - private static ArrayList entries = new ArrayList(); - - public GameLog() { - super(); - GLog.update.replace( this ); - - recreateLines(); - } - - private void recreateLines() { - for (Entry entry : entries) { - lastEntry = PixelScene.renderMultiline( entry.text, 6 ); - lastEntry.hardlight( lastColor = entry.color ); - add( lastEntry ); - } - } - - public void newLine() { - lastEntry = null; - } - - @Override - public void onSignal( String text ) { - - if (length != entries.size()){ - clear(); - recreateLines(); - } - - int color = CharSprite.DEFAULT; - if (text.startsWith( GLog.POSITIVE )) { - text = text.substring( GLog.POSITIVE.length() ); - color = CharSprite.POSITIVE; - } else - if (text.startsWith( GLog.NEGATIVE )) { - text = text.substring( GLog.NEGATIVE.length() ); - color = CharSprite.NEGATIVE; - } else - if (text.startsWith( GLog.WARNING )) { - text = text.substring( GLog.WARNING.length() ); - color = CharSprite.WARNING; - } else - if (text.startsWith( GLog.HIGHLIGHT )) { - text = text.substring( GLog.HIGHLIGHT.length() ); - color = CharSprite.NEUTRAL; - } - - if (lastEntry != null && color == lastColor && lastEntry.nLines < MAX_LINES) { - - String lastMessage = lastEntry.text(); - lastEntry.text( lastMessage.length() == 0 ? text : lastMessage + " " + text ); - - entries.get( entries.size() - 1 ).text = lastEntry.text(); - - } else { - - lastEntry = PixelScene.renderMultiline( text, 6 ); - lastEntry.hardlight( color ); - lastColor = color; - add( lastEntry ); - - entries.add( new Entry( text, color ) ); - - } - - if (length > 0) { - int nLines; - do { - nLines = 0; - for (int i = 0; i < length-1; i++) { - nLines += ((RenderedTextMultiline) members.get(i)).nLines; - } - - if (nLines > MAX_LINES) { - remove(members.get(0)); - - entries.remove( 0 ); - } - } while (nLines > MAX_LINES); - if (entries.isEmpty()) { - lastEntry = null; - } - } - - layout(); - } - - @Override - protected void layout() { - float pos = y; - for (int i=length-1; i >= 0; i--) { - RenderedTextMultiline entry = (RenderedTextMultiline)members.get( i ); - entry.maxWidth((int)width); - entry.setPos(x, pos-entry.height()); - pos -= entry.height(); - } - } - - @Override - public void destroy() { - GLog.update.remove( this ); - super.destroy(); - } - - private static class Entry { - public String text; - public int color; - public Entry( String text, int color ) { - this.text = text; - this.color = color; - } - } - - public static void wipe() { - entries.clear(); - } -} diff --git a/java/com/hmdzl/spspd/change/ui/GoldIndicator.java b/java/com/hmdzl/spspd/change/ui/GoldIndicator.java deleted file mode 100644 index 4a230fd5..00000000 --- a/java/com/hmdzl/spspd/change/ui/GoldIndicator.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.ui; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.scenes.PixelScene; -import com.watabou.noosa.BitmapText; -import com.watabou.noosa.Game; -import com.watabou.noosa.ui.Component; - -public class GoldIndicator extends Component { - - private static final float TIME = 2f; - - private int lastValue = 0; - - private BitmapText tf; - - private float time; - - @Override - protected void createChildren() { - tf = new BitmapText(PixelScene.font1x); - tf.hardlight(0xFFFF00); - add(tf); - - visible = false; - } - - @Override - protected void layout() { - tf.x = x + (width - tf.width()) / 2; - tf.y = bottom() - tf.height(); - } - - @Override - public void update() { - super.update(); - - if (visible) { - - time -= Game.elapsed; - if (time > 0) { - tf.alpha(time > TIME / 2 ? 1f : time * 2 / TIME); - } else { - visible = false; - } - - } - - if (Dungeon.gold != lastValue) { - - lastValue = Dungeon.gold; - - tf.text(Integer.toString(lastValue)); - tf.measure(); - - visible = true; - time = TIME; - - layout(); - } - } -} diff --git a/java/com/hmdzl/spspd/change/ui/HealthBar.java b/java/com/hmdzl/spspd/change/ui/HealthBar.java deleted file mode 100644 index c5479e6a..00000000 --- a/java/com/hmdzl/spspd/change/ui/HealthBar.java +++ /dev/null @@ -1,122 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.ui; - -import com.hmdzl.spspd.change.actors.Char; -import com.watabou.noosa.ColorBlock; -import com.watabou.noosa.ui.Component; - -public class HealthBar extends Component { - - /*private static final int COLOR_BG = 0xFFCC0000; - private static final int COLOR_LVL = 0xFF00EE00; - - private static final int HEIGHT = 2; - - private ColorBlock hpBg; - private ColorBlock hpLvl; - - private float level; - - @Override - protected void createChildren() { - hpBg = new ColorBlock(1, 1, COLOR_BG); - add(hpBg); - - hpLvl = new ColorBlock(1, 1, COLOR_LVL); - add(hpLvl); - - height = HEIGHT; - } - - @Override - protected void layout() { - - hpBg.x = hpLvl.x = x; - hpBg.y = hpLvl.y = y; - - hpBg.size(width, HEIGHT); - hpLvl.size(width * level, HEIGHT); - - height = HEIGHT; - } - - public void level(float value) { - level = value; - layout(); - }*/ - - private static final int COLOR_BG = 0xFFCC0000; - private static final int COLOR_HP = 0xFF00EE00; - private static final int COLOR_SHLD = 0xFFBBEEBB; - - private static final int HEIGHT = 2; - - private ColorBlock Bg; - private ColorBlock Shld; - private ColorBlock Hp; - - private float health; - private float shield; - - @Override - protected void createChildren() { - Bg = new ColorBlock( 1, 1, COLOR_BG ); - add( Bg ); - - Shld = new ColorBlock( 1, 1, COLOR_SHLD ); - add( Shld ); - - Hp = new ColorBlock( 1, 1, COLOR_HP ); - add( Hp ); - - height = HEIGHT; - } - - @Override - protected void layout() { - - Bg.x = Shld.x = Hp.x = x; - Bg.y = Shld.y = Hp.y = y; - - Bg.size( width, height ); - - //logic here rounds up to the nearest pixel - float pixelWidth = width; - if (camera() != null) pixelWidth *= camera().zoom; - Shld.size( width * (float)Math.ceil(shield * pixelWidth)/pixelWidth, height ); - Hp.size( width * (float)Math.ceil(health * pixelWidth)/pixelWidth, height ); - } - - public void level( float value ) { - level( value, 0f ); - } - - public void level( float health, float shield ){ - this.health = health; - this.shield = shield; - layout(); - } - - public void level(Char c){ - float health = c.HP; - float max = Math.max(health+shield, c.HT); - - level(health/max, (health+shield)/max); - } -} diff --git a/java/com/hmdzl/spspd/change/ui/HealthIndicator.java b/java/com/hmdzl/spspd/change/ui/HealthIndicator.java deleted file mode 100644 index 4ceb3ae1..00000000 --- a/java/com/hmdzl/spspd/change/ui/HealthIndicator.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.ui; - -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.watabou.gltextures.TextureCache; -import com.watabou.noosa.Image; -import com.watabou.noosa.ui.Component; - -public class HealthIndicator extends Component { - - private static final float HEIGHT = 2; - - public static HealthIndicator instance; - - private Char target; - - private Image bg; - private Image level; - - public HealthIndicator() { - super(); - - instance = this; - } - - @Override - protected void createChildren() { - bg = new Image(TextureCache.createSolid(0xFFcc0000)); - bg.scale.y = HEIGHT; - add(bg); - - level = new Image(TextureCache.createSolid(0xFF00cc00)); - level.scale.y = HEIGHT; - add(level); - } - - @Override - public void update() { - super.update(); - - if (target != null && target.isAlive() && target.sprite.visible) { - CharSprite sprite = target.sprite; - bg.scale.x = sprite.width; - level.scale.x = sprite.width * target.HP / target.HT; - bg.x = level.x = sprite.x; - bg.y = level.y = sprite.y - HEIGHT - 1; - - visible = true; - } else { - visible = false; - } - } - - public void target(Char ch) { - if (ch != null && ch.isAlive()) { - target = ch; - } else { - target = null; - } - } - - public Char target() { - return target; - } -} diff --git a/java/com/hmdzl/spspd/change/ui/IconButton.java b/java/com/hmdzl/spspd/change/ui/IconButton.java deleted file mode 100644 index b8bb471a..00000000 --- a/java/com/hmdzl/spspd/change/ui/IconButton.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * Shattered Pixel Dungeon - * Copyright (C) 2014-2018 Evan Debenham - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ - -package com.hmdzl.spspd.change.ui; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.scenes.PixelScene; -import com.watabou.noosa.Image; -import com.watabou.noosa.audio.Sample; -import com.watabou.noosa.ui.Button; - -public class IconButton extends Button { - - protected Image icon; - - public IconButton(){ - super(); - } - - public IconButton( Image icon ){ - super(); - icon( icon ); - } - - @Override - protected void layout() { - super.layout(); - - if (icon != null) { - icon.x = x + (width - icon.width()) / 2f; - icon.y = y + (height - icon.height()) / 2f; - PixelScene.align(icon); - } - } - - @Override - protected void onTouchDown() { - if (icon != null) icon.brightness( 1.5f ); - Sample.INSTANCE.play( Assets.SND_CLICK ); - } - - @Override - protected void onTouchUp() { - if (icon != null) icon.resetColor(); - } - - public void enable( boolean value ) { - active = value; - if (icon != null) icon.alpha( value ? 1.0f : 0.3f ); - } - - public void icon( Image icon ) { - if (this.icon != null) { - remove( this.icon ); - } - this.icon = icon; - if (this.icon != null) { - add( this.icon ); - layout(); - } - } - - public Image icon(){ - return icon; - } -} diff --git a/java/com/hmdzl/spspd/change/ui/Icons.java b/java/com/hmdzl/spspd/change/ui/Icons.java deleted file mode 100644 index 6736bcdd..00000000 --- a/java/com/hmdzl/spspd/change/ui/Icons.java +++ /dev/null @@ -1,178 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.ui; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.actors.hero.HeroClass; -import com.watabou.noosa.Image; - -public enum Icons { - - SKULL, BUSY, COMPASS, INFO, PREFS, WARNING, TARGET, MASTERY, WATA, SHPX, WARRIOR, MAGE, ROGUE, HUNTRESS, PERFORMER, SOLDIER, FOLLOWER, CLOSE, DEPTH, SLEEP, ALERT, - BACKPACK, SEED_POUCH, SCROLL_HOLDER, POTION_BANDOLIER, WAND_HOLSTER, CHECKED, UNCHECKED, EXIT, CHALLENGE_OFF, CHALLENGE_ON, RESUME, SHOP_CART, KEYRING, - LAN, NOTES, SAVELOAD, HOS, LOST; - - public Image get() { - return get(this); - } - - public static Image get(Icons type) { - Image icon = new Image(Assets.ICONS); - switch (type) { - case SKULL: - icon.frame(icon.texture.uvRect(0, 0, 8, 8)); - break; - case BUSY: - icon.frame(icon.texture.uvRect(8, 0, 16, 8)); - break; - case COMPASS: - icon.frame(icon.texture.uvRect(0, 8, 7, 13)); - break; - case INFO: - icon.frame(icon.texture.uvRect(16, 0, 30, 14)); - break; - case PREFS: - icon.frame(icon.texture.uvRect(30, 0, 46, 16)); - break; - case WARNING: - icon.frame(icon.texture.uvRect(46, 0, 58, 12)); - break; - case TARGET: - icon.frame(icon.texture.uvRect(0, 13, 16, 29)); - break; - case MASTERY: - icon.frame(icon.texture.uvRect(16, 14, 30, 28)); - break; - case WATA: - icon.frame(icon.texture.uvRect(30, 16, 45, 26)); - break; - case SHPX: - icon.frame(icon.texture.uvRect(64, 44, 80, 60)); - break; - case WARRIOR: - icon.frame(icon.texture.uvRect(0, 29, 16, 45)); - break; - case MAGE: - icon.frame(icon.texture.uvRect(16, 29, 32, 45)); - break; - case ROGUE: - icon.frame(icon.texture.uvRect(32, 29, 48, 45)); - break; - case HUNTRESS: - icon.frame(icon.texture.uvRect(48, 29, 64, 45)); - break; - case PERFORMER: - icon.frame(icon.texture.uvRect(48, 65, 60, 74)); - break; - case SOLDIER: - icon.frame(icon.texture.uvRect(64, 64, 78, 78)); - break; - case FOLLOWER: - icon.frame(icon.texture.uvRect(86, 62, 97, 73)); - break; - case CLOSE: - icon.frame(icon.texture.uvRect(0, 45, 13, 58)); - break; - case DEPTH: - icon.frame( icon.texture.uvRect( 38, 46, 54, 62 ) ); - break; - case SLEEP: - icon.frame(icon.texture.uvRect(13, 45, 22, 53)); - break; - case ALERT: - icon.frame(icon.texture.uvRect(22, 45, 30, 53)); - break; - case LOST: - icon.frame( icon.texture.uvRect( 30, 45, 38, 53 ) ); - break; - case BACKPACK: - icon.frame(icon.texture.uvRect(58, 0, 68, 10)); - break; - case SCROLL_HOLDER: - icon.frame(icon.texture.uvRect(68, 0, 78, 10)); - break; - case SEED_POUCH: - icon.frame(icon.texture.uvRect(78, 0, 88, 10)); - break; - case WAND_HOLSTER: - icon.frame(icon.texture.uvRect(88, 0, 98, 10)); - break; - case POTION_BANDOLIER: - icon.frame(icon.texture.uvRect(98, 0, 108, 10)); - break; - case CHECKED: - icon.frame(icon.texture.uvRect(54, 12, 66, 24)); - break; - case UNCHECKED: - icon.frame(icon.texture.uvRect(66, 12, 78, 24)); - break; - case EXIT: - icon.frame(icon.texture.uvRect(108, 0, 124, 16)); - break; - case CHALLENGE_OFF: - icon.frame(icon.texture.uvRect(78, 16, 102, 40)); - break; - case CHALLENGE_ON: - icon.frame(icon.texture.uvRect(102, 16, 126, 40)); - break; - case RESUME: - icon.frame(icon.texture.uvRect(13, 53, 24, 64)); - break; - case SHOP_CART: - icon.frame(icon.texture.uvRect(82, 47, 92, 57)); - break; - case KEYRING: - icon.frame(icon.texture.uvRect(66, 29, 72, 39)); - break; - case LAN: - icon.frame(icon.texture.uvRect(2, 65, 25, 77)); - break; - case NOTES: - icon.frame( icon.texture.uvRect( 110, 43, 125, 59 )); - break; - case SAVELOAD: - icon.frame( icon.texture.uvRect( 97, 46, 108, 56 )); - break; - case HOS: - icon.frame( icon.texture.uvRect( 30, 65, 41, 75 )); - break; - } - return icon; - } - - public static Image get(HeroClass cl) { - switch (cl) { - case WARRIOR: - return get(WARRIOR); - case MAGE: - return get(MAGE); - case ROGUE: - return get(ROGUE); - case HUNTRESS: - return get(HUNTRESS); - case PERFORMER: - return get(PERFORMER); - case SOLDIER: - return get(SOLDIER); - case FOLLOWER: - return get(FOLLOWER); - default: - return null; - } - } -} diff --git a/java/com/hmdzl/spspd/change/ui/ItemSlot.java b/java/com/hmdzl/spspd/change/ui/ItemSlot.java deleted file mode 100644 index eec25e0b..00000000 --- a/java/com/hmdzl/spspd/change/ui/ItemSlot.java +++ /dev/null @@ -1,297 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.ui; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.armor.Armor; -import com.hmdzl.spspd.change.items.keys.Key; -import com.hmdzl.spspd.change.items.keys.SkeletonKey; -import com.hmdzl.spspd.change.items.potions.Potion; -import com.hmdzl.spspd.change.items.scrolls.Scroll; -import com.hmdzl.spspd.change.items.weapon.Weapon; -import com.hmdzl.spspd.change.items.wands.Wand; -import com.hmdzl.spspd.change.items.rings.Ring; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.items.weapon.melee.MeleeWeapon; -import com.hmdzl.spspd.change.scenes.PixelScene; -import com.hmdzl.spspd.change.sprites.ItemSprite; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; - -import com.watabou.noosa.BitmapText; -import com.watabou.noosa.Image; -import com.watabou.noosa.ui.Button; - -public class ItemSlot extends Button { - - public static final int DEGRADED = 0xFF4444; - public static final int UPGRADED = 0x44FF44; - public static final int WARNING = 0xFF8800; - - private static final float ENABLED = 1.0f; - private static final float DISABLED = 0.3f; - - protected ItemSprite icon; - protected BitmapText topLeft; - protected BitmapText topRight; - protected BitmapText bottomRight; - protected Image bottomRightIcon; - protected BitmapText bottomLeft; - protected Image bottomLeftIcon; - protected boolean iconVisible = true; - protected boolean iconVisible2 = true; - - private static final String TXT_STRENGTH = ":%d"; - private static final String TXT_TYPICAL_STR = "%d?"; - private static final String TXT_KEY_DEPTH = "\u007F%d"; - - private static final String TXT_LEVEL = "%+d"; - private static final String TXT_CURSED = "";// "-"; - - // Special "virtual items" - public static final Item CHEST = new Item() { - @Override - public int image() { - return ItemSpriteSheet.CHEST; - }; - }; - public static final Item LOCKED_CHEST = new Item() { - @Override - public int image() { - return ItemSpriteSheet.LOCKED_CHEST; - }; - }; - public static final Item CRYSTAL_CHEST = new Item() { - @Override - public int image() { - return ItemSpriteSheet.CRYSTAL_CHEST; - }; - }; - public static final Item TOMB = new Item() { - @Override - public int image() { - return ItemSpriteSheet.TOMB; - }; - }; - public static final Item SKELETON = new Item() { - @Override - public int image() { - return ItemSpriteSheet.BONES; - }; - }; - public static final Item REMAINS = new Item() { - @Override - public int image() { - return ItemSpriteSheet.REMAINS; - }; - }; - - public ItemSlot() { - super(); - } - - public ItemSlot(Item item) { - this(); - item(item); - } - - @Override - protected void createChildren() { - - super.createChildren(); - - icon = new ItemSprite(); - add(icon); - - topLeft = new BitmapText(PixelScene.font1x); - add(topLeft); - - topRight = new BitmapText(PixelScene.font1x); - add(topRight); - - bottomRight = new BitmapText(PixelScene.font1x); - add(bottomRight); - - bottomLeft = new BitmapText(PixelScene.font1x); - add(bottomLeft); - } - - @Override - protected void layout() { - super.layout(); - - icon.x = x + (width - icon.width) / 2; - icon.y = y + (height - icon.height) / 2; - - if (topLeft != null) { - topLeft.x = x; - topLeft.y = y; - } - - if (topRight != null) { - topRight.x = x + (width - topRight.width()); - topRight.y = y; - } - - if (bottomRight != null) { - bottomRight.x = x + (width - bottomRight.width()); - bottomRight.y = y + (height - bottomRight.height()); - } - - if (bottomRightIcon != null) { - bottomRightIcon.x = x + (width - bottomRightIcon.width()) -1; - bottomRightIcon.y = y + (height - bottomRightIcon.height()); - } - - if (bottomLeft != null) { - bottomLeft.x = x ; - bottomLeft.y = y + (height - bottomLeft.height()); - } - - if (bottomLeftIcon != null) { - bottomLeftIcon.x = x + 1; - bottomLeftIcon.y = y + (height - bottomLeftIcon.height()); - } - } - - public void item(Item item ) { - - if (bottomRightIcon != null){ - remove(bottomRightIcon); - bottomRightIcon = null; - } - - if (bottomLeftIcon != null){ - remove(bottomLeftIcon); - bottomLeftIcon = null; - } - - if (item == null) { - - active = false; - icon.visible = topLeft.visible = topRight.visible = bottomRight.visible = bottomLeft.visible = false; - - } else { - - active = true; - icon.visible = topLeft.visible = topRight.visible = bottomRight.visible = bottomLeft.visible = true; - - icon.view(item.image(), item.glowing()); - - topLeft.text(item.status()); - - boolean isArmor = item instanceof Armor; - boolean isWeapon = item instanceof Weapon; - if (isArmor || isWeapon) { - - if (item.levelKnown - || (isWeapon && !(item instanceof MeleeWeapon))) { - - int str = isArmor ? ((Armor) item).STR() - : ((Weapon) item).STR(); - topRight.text( Messages.format( TXT_STRENGTH, str )); - if (str > Dungeon.hero.STR()) { - topRight.hardlight(DEGRADED); - } else { - topRight.resetColor(); - } - - } else { - - topRight.text(Messages.format(TXT_TYPICAL_STR, - isArmor ? ((Armor) item).STR() - : ((MeleeWeapon) item).typicalSTR())); - topRight.hardlight(WARNING); - - } - topRight.measure(); - - } else if (item instanceof Key && !(item instanceof SkeletonKey)) { - topRight.text(Messages.format(TXT_KEY_DEPTH, ((Key) item).depth)); - topRight.measure(); - } else { - - topRight.text(null); - - } - - int level = item.visiblyUpgraded(); - - if (level != 0) { - bottomRight.text(item.levelKnown ? Messages.format(TXT_LEVEL, - level) : TXT_CURSED); - bottomRight.measure(); - bottomRight.hardlight(level > 0 ? UPGRADED : DEGRADED); - - } else if (item instanceof Scroll || item instanceof Potion) { - - bottomRight.text( null ); - - Integer iconInt; - if (item instanceof Scroll){ - iconInt = ((Scroll) item).initials(); - } else { - iconInt = ((Potion) item).initials(); - } - if (iconInt != null && iconVisible) { - bottomRightIcon = new Image(Assets.CONS_ICONS); - int left = iconInt*7; - int top = item instanceof Potion ? 0 : 7; - bottomRightIcon.frame(left, top, 7, 7); - add(bottomRightIcon); - } else { - bottomRight.text( null ); - } - - } - layout(); - } - } - - public void enable(boolean value) { - - active = value; - - float alpha = value ? ENABLED : DISABLED; - icon.alpha(alpha); - topLeft.alpha(alpha); - topRight.alpha(alpha); - bottomRight.alpha(alpha); - bottomLeft.alpha(alpha); - if (bottomLeftIcon != null) bottomRightIcon.alpha( alpha ); - if (bottomLeftIcon != null) bottomLeftIcon.alpha( alpha ); - } - - public void showParams( boolean TL, boolean TR, boolean BR, boolean BF ) { - if (TL) add( topLeft ); - else remove( topLeft ); - - if (TR) add( topRight ); - else remove( topRight ); - - if (BR) add( bottomRight ); - else remove( bottomRight ); - - if (BF) add( bottomLeft ); - else remove( bottomLeft ); - - iconVisible = BR; - iconVisible2 = BF; - } -} diff --git a/java/com/hmdzl/spspd/change/ui/LanguageButton.java b/java/com/hmdzl/spspd/change/ui/LanguageButton.java deleted file mode 100644 index 7c02e2da..00000000 --- a/java/com/hmdzl/spspd/change/ui/LanguageButton.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * Shattered Pixel Dungeon - * Copyright (C) 2014-2017 Evan Debenham - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ - -package com.hmdzl.spspd.change.ui; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.windows.WndLangs; -import com.watabou.noosa.Image; -import com.watabou.noosa.audio.Sample; -import com.watabou.noosa.ui.Button; - -public class LanguageButton extends Button { - - private Image image; - - public LanguageButton() { - super(); - - width = image.width; - height = image.height; - } - - @Override - protected void createChildren() { - super.createChildren(); - - image = Icons.get(Icons.LAN); - add( image ); - updateIcon(); - } - - private void updateIcon(){ - switch(Messages.lang().status()){ - case INCOMPLETE: - image.tint(1, 0, 0, .5f); - break; - case UNREVIEWED: - image.tint(1, .5f, 0, .5f); - break; - } - } - - @Override - protected void layout() { - super.layout(); - - image.x = x; - image.y = y; - } - - @Override - protected void onTouchDown() { - image.brightness( 1.5f ); - Sample.INSTANCE.play( Assets.SND_CLICK ); - } - - @Override - protected void onTouchUp() { - image.resetColor(); - updateIcon(); - } - - @Override - protected void onClick() { - parent.add(new WndLangs()); - } - -} diff --git a/java/com/hmdzl/spspd/change/ui/LootIndicator.java b/java/com/hmdzl/spspd/change/ui/LootIndicator.java deleted file mode 100644 index c302e4aa..00000000 --- a/java/com/hmdzl/spspd/change/ui/LootIndicator.java +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.ui; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.items.Heap; -import com.hmdzl.spspd.change.items.Item; - -public class LootIndicator extends Tag { - - private ItemSlot slot; - - private Item lastItem = null; - private int lastQuantity = 0; - - public LootIndicator() { - super(0x1F75CC); - - setSize(24, 24); - - visible = false; - } - - @Override - protected void createChildren() { - super.createChildren(); - - slot = new ItemSlot() { - - protected void onClick() { - Dungeon.hero.handle(Dungeon.hero.pos); - }; - }; - slot.showParams(true, false, false, false); - add(slot); - } - - @Override - protected void layout() { - super.layout(); - - slot.setRect(x + 2, y + 3, width - 2, height - 6); - } - - @Override - public void update() { - - if (Dungeon.hero.ready) { - Heap heap = Dungeon.level.heaps.get(Dungeon.hero.pos); - if (heap != null) { - - Item item = - heap.type == Heap.Type.CHEST || heap.type == Heap.Type.MIMIC ? ItemSlot.CHEST : - heap.type == Heap.Type.LOCKED_CHEST ? ItemSlot.LOCKED_CHEST: - heap.type == Heap.Type.CRYSTAL_CHEST ? ItemSlot.CRYSTAL_CHEST: - heap.type == Heap.Type.TOMB ? ItemSlot.TOMB: - heap.type == Heap.Type.SKELETON ? ItemSlot.SKELETON: - heap.type == Heap.Type.REMAINS ? ItemSlot.REMAINS: - heap.peek(); - if (item != lastItem || item.quantity() != lastQuantity) { - lastItem = item; - lastQuantity = item.quantity(); - - slot.item(item); - flash(); - } - visible = true; - - } else { - - lastItem = null; - visible = false; - - } - } - - slot.enable(visible && Dungeon.hero.ready); - - super.update(); - } -} diff --git a/java/com/hmdzl/spspd/change/ui/MemoryButton.java b/java/com/hmdzl/spspd/change/ui/MemoryButton.java deleted file mode 100644 index 9424afa3..00000000 --- a/java/com/hmdzl/spspd/change/ui/MemoryButton.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * Shattered Pixel Dungeon - * Copyright (C) 2014-2015 Evan Debenham - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.ui; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.ShatteredPixelDungeon; -import com.hmdzl.spspd.change.scenes.LoadSaveScene; -import com.hmdzl.spspd.change.scenes.WelcomeScene; -import com.watabou.noosa.Game; -import com.watabou.noosa.Image; -import com.watabou.noosa.audio.Sample; -import com.watabou.noosa.ui.Button; - -import java.io.IOException; - -public class MemoryButton extends Button { - - protected Image image; - - public MemoryButton() { - super(); - - width = image.width; - height = image.height; - } - - @Override - protected void createChildren() { - super.createChildren(); - - image = Icons.SAVELOAD.get(); - add( image ); - } - - @Override - protected void layout() { - super.layout(); - - image.x = x; - image.y = y; - } - - @Override - protected void onTouchDown() { - image.brightness( 1.5f ); - Sample.INSTANCE.play( Assets.SND_CLICK ); - } - - @Override - protected void onTouchUp() { - image.resetColor(); - } - - @Override - protected void onClick() { - try { - Dungeon.saveAll(); - } catch (IOException e) { - // - } - Game.switchScene(LoadSaveScene.class); - } -} diff --git a/java/com/hmdzl/spspd/change/ui/PrefsButton.java b/java/com/hmdzl/spspd/change/ui/PrefsButton.java deleted file mode 100644 index 28614929..00000000 --- a/java/com/hmdzl/spspd/change/ui/PrefsButton.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.ui; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.windows.WndSettings; -import com.watabou.noosa.Image; -import com.watabou.noosa.audio.Sample; -import com.watabou.noosa.ui.Button; - -public class PrefsButton extends Button { - - private Image image; - - public PrefsButton() { - super(); - - width = image.width; - height = image.height; - } - - @Override - protected void createChildren() { - super.createChildren(); - - image = Icons.PREFS.get(); - add(image); - } - - @Override - protected void layout() { - super.layout(); - - image.x = x; - image.y = y; - } - - @Override - protected void onTouchDown() { - image.brightness(1.5f); - Sample.INSTANCE.play(Assets.SND_CLICK); - } - - @Override - protected void onTouchUp() { - image.resetColor(); - } - - @Override - protected void onClick() { - parent.add(new WndSettings(false)); - } -} diff --git a/java/com/hmdzl/spspd/change/ui/QuickSlotButton.java b/java/com/hmdzl/spspd/change/ui/QuickSlotButton.java deleted file mode 100644 index 201ff2b3..00000000 --- a/java/com/hmdzl/spspd/change/ui/QuickSlotButton.java +++ /dev/null @@ -1,251 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.ui; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.DungeonTilemap; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.mechanics.Ballistica; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.scenes.PixelScene; -import com.hmdzl.spspd.change.windows.WndBag; -import com.watabou.noosa.Image; -import com.watabou.noosa.ui.Button; -import com.hmdzl.spspd.change.messages.Messages; - -public class QuickSlotButton extends Button implements WndBag.Listener { - - private static final String TXT_SELECT_ITEM = "Select an item for the quickslot"; - - private static QuickSlotButton[] instance = new QuickSlotButton[6]; - private int slotNum; - - private ItemSlot slot; - - private static Image crossB; - private static Image crossM; - - private static boolean targeting = false; - public static Char lastTarget = null; - - public QuickSlotButton(int slotNum) { - super(); - this.slotNum = slotNum; - item(select(slotNum)); - - instance[slotNum] = this; - } - - @Override - public void destroy() { - super.destroy(); - - reset(); - } - - public static void reset() { - instance = new QuickSlotButton[6]; - - lastTarget = null; - } - - @Override - protected void createChildren() { - super.createChildren(); - - slot = new ItemSlot() { - @Override - protected void onClick() { - if (targeting) { - int cell = autoAim(lastTarget); - - if (cell != -1){ - GameScene.handleCell(cell); - } else { - //couldn't auto-aim, just target the position and hope for the best. - GameScene.handleCell( lastTarget.pos ); - } - //GameScene.handleCell(lastTarget.pos); - } else { - Item item = select(slotNum); - if (item.usesTargeting) - useTargeting(); - item.execute(Dungeon.hero); - } - } - - @Override - protected boolean onLongClick() { - return QuickSlotButton.this.onLongClick(); - } - - @Override - protected void onTouchDown() { - icon.lightness(0.7f); - } - - @Override - protected void onTouchUp() { - icon.resetColor(); - } - }; - slot.showParams( true, false, true, false ); - add(slot); - - crossB = Icons.TARGET.get(); - crossB.visible = false; - add(crossB); - - - crossM = new Image(); - crossM.copy(crossB); - } - - @Override - protected void layout() { - super.layout(); - - slot.fill(this); - - //crossB.x = PixelScene.align(x + (width - crossB.width) / 2); - //crossB.y = PixelScene.align(y + (height - crossB.height) / 2); - crossB.x = x + (width - crossB.width) / 2; - crossB.y = y + (height - crossB.height) / 2; - PixelScene.align(crossB); - - } - - @Override - protected void onClick() { - GameScene.selectItem(this, WndBag.Mode.QUICKSLOT,Messages.get(this, "select_item")); - } - - @Override - protected boolean onLongClick() { - GameScene.selectItem(this, WndBag.Mode.QUICKSLOT,Messages.get(this, "select_item")); - return true; - } - - private static Item select(int slotNum) { - return Dungeon.quickslot.getItem(slotNum); - } - - @Override - public void onSelect(Item item) { - if (item != null) { - Dungeon.quickslot.setSlot(slotNum, item); - refresh(); - } - } - - public void item(Item item) { - slot.item(item); - enableSlot(); - } - - public void enable(boolean value) { - active = value; - if (value) { - enableSlot(); - } else { - slot.enable(false); - } - } - - private void enableSlot() { - slot.enable(Dungeon.quickslot.isNonePlaceholder(slotNum)); - } - - private void useTargeting() { - - //if (lastTarget != null && lastTarget.isAlive() && - //Dungeon.visible[lastTarget.pos]) { - - //targeting = true; - //lastTarget.sprite.parent.add( crossM ); - //crossM.point( DungeonTilemap.tileToWorld( lastTarget.pos ) ); - //crossB.x = x + (width - crossB.width) / 2; - //crossB.y = y + (height - crossB.height) / 2; - //crossB.visible = true; - - if (lastTarget != null && - //Actor.chars().contains( lastTarget ) && - lastTarget.isAlive() && - Dungeon.visible[lastTarget.pos]) { - - targeting = true; - lastTarget.sprite.parent.add( crossM ); - crossM.point( DungeonTilemap.tileToWorld( lastTarget.pos ) ); - crossB.x = x + (width - crossB.width) / 2; - crossB.y = y + (height - crossB.height) / 2; - crossB.visible = true; - - } else { - - lastTarget = null; - targeting = false; - - } - - - } - - public static int autoAim(Char target){ - //first try to directly target - if (new Ballistica(Dungeon.hero.pos, target.pos, Ballistica.PROJECTILE).collisionPos == target.pos) { - return target.pos; - } - - //Otherwise pick nearby tiles to try and 'angle' the shot, auto-aim basically. - for (int i : Level.NEIGHBOURS9DIST2) { - if (new Ballistica(Dungeon.hero.pos, target.pos+i, Ballistica.PROJECTILE).collisionPos == target.pos){ - return target.pos+i; - } - } - - //couldn't find a cell, give up. - return -1; - } - - public static void refresh() { - for (int i = 0; i < instance.length; i++) { - if (instance[i] != null) { - instance[i].item(select(i)); - } - } - } - - public static void target(Char target) { - if (target != Dungeon.hero) { - lastTarget = target; - - HealthIndicator.instance.target(target); - } - } - - public static void cancel() { - if (targeting) { - crossB.visible = false; - crossM.remove(); - targeting = false; - } - } -} diff --git a/java/com/hmdzl/spspd/change/ui/RedButton.java b/java/com/hmdzl/spspd/change/ui/RedButton.java deleted file mode 100644 index 1d736702..00000000 --- a/java/com/hmdzl/spspd/change/ui/RedButton.java +++ /dev/null @@ -1,121 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * Shattered Pixel Dungeon - * Copyright (C) 2014-2016 Evan Debenham - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.ui; - -import com.hmdzl.spspd.change.scenes.PixelScene; -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Chrome; -import com.watabou.noosa.Image; -import com.watabou.noosa.NinePatch; -import com.watabou.noosa.RenderedText; -import com.watabou.noosa.audio.Sample; -import com.watabou.noosa.ui.Button; - -public class RedButton extends Button { - - protected NinePatch bg; - protected RenderedText text; - protected Image icon; - - public RedButton(String label ) { - this(label, 9); - } - - public RedButton(String label, int size ){ - super(); - - text = PixelScene.renderText( size ); - text.text( label ); - add( text ); - } - - @Override - protected void createChildren() { - super.createChildren(); - - bg = Chrome.get( Chrome.Type.BUTTON ); - add( bg ); - } - - @Override - protected void layout() { - - super.layout(); - - bg.x = x; - bg.y = y; - bg.size( width, height ); - - text.x = x + (width - text.width()) / 2; - text.y = y + (height - text.baseLine()) / 2; - PixelScene.align(text); - - if (icon != null) { - icon.x = x + text.x - icon.width() - 2; - icon.y = y + (height - icon.height()) / 2; - PixelScene.align(icon); - } - } - - @Override - protected void onTouchDown() { - bg.brightness( 1.2f ); - Sample.INSTANCE.play( Assets.SND_CLICK ); - } - - @Override - protected void onTouchUp() { - bg.resetColor(); - } - - public void enable( boolean value ) { - active = value; - text.alpha( value ? 1.0f : 0.3f ); - } - - public void text( String value ) { - text.text( value ); - layout(); - } - - public void textColor( int value ) { - text.hardlight( value ); - } - - public void icon( Image icon ) { - if (this.icon != null) { - remove( this.icon ); - } - this.icon = icon; - if (this.icon != null) { - add( this.icon ); - layout(); - } - } - - public float reqWidth() { - return text.width() + 2f; - } - - public float reqHeight() { - return text.baseLine() + 4; - } -} diff --git a/java/com/hmdzl/spspd/change/ui/RenderedTextMultiline.java b/java/com/hmdzl/spspd/change/ui/RenderedTextMultiline.java deleted file mode 100644 index 87914b61..00000000 --- a/java/com/hmdzl/spspd/change/ui/RenderedTextMultiline.java +++ /dev/null @@ -1,197 +0,0 @@ -/* - * Copyright (C) 2012-2015 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ - -package com.hmdzl.spspd.change.ui; - -import com.hmdzl.spspd.change.scenes.PixelScene; -import com.watabou.noosa.RenderedText; -import com.watabou.noosa.ui.Component; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -public class RenderedTextMultiline extends Component { - - private int maxWidth = Integer.MAX_VALUE; - public int nLines; - - private String text; - private List tokens; - private ArrayList words = new ArrayList<>(); - - private int size; - private float zoom; - private int color = -1; - - private static final String SPACE = " "; - private static final String NEWLINE = "\n"; - private static final String UNDERSCORE = "_"; - - private boolean chinese = false; - - public RenderedTextMultiline(int size){ - this.size = size; - } - - public RenderedTextMultiline(String text, int size){ - this.size = size; - text(text); - } - - public void text(String text){ - this.text = text; - - if (text != null && !text.equals("")) { - //conversion for chinese text - - chinese = text.replaceAll("\\p{Han}", "").length() != text.length(); - - if (chinese){ - tokens = Arrays.asList(text.split("")); - } else { - tokens = Arrays.asList(text.split("(?<= )|(?= )|(?<=\n)|(?=\n)")); - } - build(); - } - } - - public void text(String text, int maxWidth){ - this.maxWidth = maxWidth; - text(text); - } - - public String text(){ - return text; - } - - public void maxWidth(int maxWidth){ - if (this.maxWidth != maxWidth){ - this.maxWidth = maxWidth; - layout(); - } - } - - public int maxWidth(){ - return maxWidth; - } - - private void build(){ - clear(); - words = new ArrayList<>(); - boolean highlighting = false; - for (String str : tokens){ - if (str.equals(UNDERSCORE)){ - highlighting = !highlighting; - } else if (str.equals(NEWLINE)){ - words.add(null); - } else if (!str.equals(SPACE)){ - RenderedText word; - if (str.startsWith(UNDERSCORE) && str.endsWith(UNDERSCORE)){ - word = new RenderedText(str.substring(1, str.length()-1), size); - word.hardlight(0xFFFF44); - } else { - if (str.startsWith(UNDERSCORE)){ - highlighting = !highlighting; - word = new RenderedText(str.substring(1, str.length()), size); - } else if (str.endsWith(UNDERSCORE)) { - word = new RenderedText(str.substring(0, str.length()-1), size); - } else { - word = new RenderedText(str, size); - } - if (highlighting) word.hardlight(0xFFFF44); - else if (color != -1) word.hardlight(color); - - if (str.endsWith(UNDERSCORE)) highlighting = !highlighting; - } - word.scale.set(zoom); - words.add(word); - add(word); - - if (height < word.baseLine()) height = word.baseLine(); - - } - } - layout(); - } - - public void zoom(float zoom){ - this.zoom = zoom; - for (RenderedText word : words) { - if (word != null) word.scale.set(zoom); - } - } - - public void hardlight(int color){ - this.color = color; - for (RenderedText word : words) { - if (word != null) word.hardlight( color ); - } - } - - public void invert(){ - if (words != null) { - for (RenderedText word : words) { - if (word != null) { - word.ra = 0.77f; - word.ga = 0.73f; - word.ba = 0.62f; - word.rm = -0.77f; - word.gm = -0.73f; - word.bm = -0.62f; - } - } - } - } - - @Override - protected void layout() { - super.layout(); - float x = this.x; - float y = this.y; - float height = 0; - nLines = 1; - - for (RenderedText word : words){ - if (word == null) { - //newline - y += height+0.5f; - x = this.x; - nLines++; - } else { - if (word.height() > height) height = word.baseLine(); - - if ((x - this.x) + word.width() > maxWidth){ - y += height+0.5f; - x = this.x; - nLines++; - } - - word.x = x; - word.y = y; - PixelScene.align(word); - x += word.width(); - if (!chinese) x ++; - else x--; - - if ((x - this.x) > width) width = (x - this.x); - - } - } - this.height = (y - this.y) + height+0.5f; - } -} diff --git a/java/com/hmdzl/spspd/change/ui/ResumeButton.java b/java/com/hmdzl/spspd/change/ui/ResumeButton.java deleted file mode 100644 index ecdecadd..00000000 --- a/java/com/hmdzl/spspd/change/ui/ResumeButton.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.ui; - -import com.watabou.noosa.Image; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.scenes.PixelScene; - -public class ResumeButton extends Tag { - - private Image icon; - - public ResumeButton() { - super( 0xCDD5C0 ); - - setSize( 24, 22 ); - - visible = false; - } - - @Override - protected void createChildren() { - super.createChildren(); - - icon = Icons.get( Icons.RESUME ); - add( icon ); - } - - @Override - protected void layout() { - super.layout(); - - icon.x = PixelScene.align( PixelScene.uiCamera, x+1 + (width - icon.width) / 2 ); - icon.y = PixelScene.align( PixelScene.uiCamera, y + (height - icon.height) / 2 ); - } - - @Override - public void update() { - boolean prevVisible = visible; - visible = (Dungeon.hero.lastAction != null); - if (visible && !prevVisible) { - flash(); - } - - super.update(); - } - - @Override - protected void onClick() { - Dungeon.hero.resume(); - } -} diff --git a/java/com/hmdzl/spspd/change/ui/ResumeIndicator.java b/java/com/hmdzl/spspd/change/ui/ResumeIndicator.java deleted file mode 100644 index 7d8355db..00000000 --- a/java/com/hmdzl/spspd/change/ui/ResumeIndicator.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.hmdzl.spspd.change.ui; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.scenes.PixelScene; -import com.watabou.noosa.Image; - -/** - * Created by Evan on 21/01/2015. - */ -public class ResumeIndicator extends Tag { - - private Image icon; - - public ResumeIndicator() { - super(0xCDD5C0); - - setSize(24, 24); - - visible = false; - - } - - @Override - protected void createChildren() { - super.createChildren(); - - icon = Icons.get(Icons.RESUME); - add(icon); - } - - @Override - protected void layout() { - super.layout(); - - icon.x = PixelScene.align(PixelScene.uiCamera, x + 1 - + (width - icon.width) / 2); - icon.y = PixelScene.align(PixelScene.uiCamera, y - + (height - icon.height) / 2); - } - - @Override - protected void onClick() { - Dungeon.hero.resume(); - } - - @Override - public void update() { - if (!Dungeon.hero.isAlive()) - visible = false; - else if (visible != (Dungeon.hero.lastAction != null)) { - visible = Dungeon.hero.lastAction != null; - if (visible) - flash(); - } - super.update(); - } -} diff --git a/java/com/hmdzl/spspd/change/ui/ScrollPane.java b/java/com/hmdzl/spspd/change/ui/ScrollPane.java deleted file mode 100644 index 9b96128a..00000000 --- a/java/com/hmdzl/spspd/change/ui/ScrollPane.java +++ /dev/null @@ -1,148 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.ui; - -import com.hmdzl.spspd.change.scenes.PixelScene; -import com.watabou.input.Touchscreen.Touch; -import com.watabou.noosa.Camera; -import com.watabou.noosa.TouchArea; -import com.watabou.noosa.ui.Component; -import com.watabou.utils.Point; -import com.watabou.utils.PointF; - -public class ScrollPane extends Component { - - protected TouchController controller; - protected Component content; - - protected float minX; - protected float minY; - protected float maxX; - protected float maxY; - - public ScrollPane(Component content) { - super(); - - this.content = content; - addToBack(content); - - width = content.width(); - height = content.height(); - - content.camera = new Camera(0, 0, 1, 1, PixelScene.defaultZoom); - Camera.add(content.camera); - } - - @Override - public void destroy() { - super.destroy(); - Camera.remove(content.camera); - } - - public void scrollTo(float x, float y) { - content.camera.scroll.set(x, y); - } - - @Override - protected void createChildren() { - controller = new TouchController(); - add(controller); - } - - @Override - protected void layout() { - - content.setPos(0, 0); - controller.x = x; - controller.y = y; - controller.width = width; - controller.height = height; - - Point p = camera().cameraToScreen(x, y); - Camera cs = content.camera; - cs.x = p.x; - cs.y = p.y; - cs.resize((int) width, (int) height); - } - - public Component content() { - return content; - } - - public void onClick(float x, float y) { - } - - public class TouchController extends TouchArea { - - private float dragThreshold; - - public TouchController() { - super(0, 0, 0, 0); - dragThreshold = PixelScene.defaultZoom * 8; - } - - @Override - protected void onClick(Touch touch) { - if (dragging) { - - dragging = false; - - } else { - - PointF p = content.camera.screenToCamera((int) touch.current.x, - (int) touch.current.y); - ScrollPane.this.onClick(p.x, p.y); - - } - } - - private boolean dragging = false; - private PointF lastPos = new PointF(); - - @Override - protected void onDrag(Touch t) { - if (dragging) { - - Camera c = content.camera; - - c.scroll.offset(PointF.diff(lastPos, t.current) - .invScale(c.zoom)); - if (c.scroll.x + width > content.width()) { - c.scroll.x = content.width() - width; - } - if (c.scroll.x < 0) { - c.scroll.x = 0; - } - if (c.scroll.y + height > content.height()) { - c.scroll.y = content.height() - height; - } - if (c.scroll.y < 0) { - c.scroll.y = 0; - } - - lastPos.set(t.current); - - } else if (PointF.distance(t.current, t.start) > dragThreshold) { - - dragging = true; - lastPos.set(t.current); - - } - } - } -} diff --git a/java/com/hmdzl/spspd/change/ui/SimpleButton.java b/java/com/hmdzl/spspd/change/ui/SimpleButton.java deleted file mode 100644 index 58ec9534..00000000 --- a/java/com/hmdzl/spspd/change/ui/SimpleButton.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.ui; - -import com.watabou.input.Touchscreen.Touch; -import com.watabou.noosa.Image; -import com.watabou.noosa.TouchArea; -import com.watabou.noosa.ui.Component; - -public class SimpleButton extends Component { - - private Image image; - - public SimpleButton(Image image) { - super(); - - this.image.copy(image); - width = image.width; - height = image.height; - } - - @Override - protected void createChildren() { - image = new Image(); - add(image); - - add(new TouchArea(image) { - @Override - protected void onTouchDown(Touch touch) { - image.brightness(1.2f); - }; - - @Override - protected void onTouchUp(Touch touch) { - image.brightness(1.0f); - }; - - @Override - protected void onClick(Touch touch) { - SimpleButton.this.onClick(); - }; - }); - } - - @Override - protected void layout() { - image.x = x; - image.y = y; - } - - protected void onClick() { - }; -} diff --git a/java/com/hmdzl/spspd/change/ui/SpellButton.java b/java/com/hmdzl/spspd/change/ui/SpellButton.java deleted file mode 100644 index eb93b0d1..00000000 --- a/java/com/hmdzl/spspd/change/ui/SpellButton.java +++ /dev/null @@ -1,136 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.ui; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Chrome; -import com.hmdzl.spspd.change.scenes.PixelScene; -import com.watabou.noosa.BitmapText; -import com.watabou.noosa.Image; -import com.watabou.noosa.NinePatch; -import com.watabou.noosa.audio.Sample; -import com.watabou.noosa.ui.Button; -import com.watabou.noosa.RenderedText; - -public class SpellButton extends Button { - - protected NinePatch bg; - protected RenderedText text; - protected Image icon1; - protected Image icon2; - protected Image icon3; - protected Image icon4; - protected Image icon5; - - public SpellButton(String label) { - super(); - - text.text(label); - //text.measure(); - } - - @Override - protected void createChildren() { - super.createChildren(); - - bg = Chrome.get(Chrome.Type.BUTTON); - add(bg); - - text = PixelScene.renderText(9); - add(text); - } - - @Override - protected void layout() { - - super.layout(); - - bg.x = x; - bg.y = y; - bg.size(width, height); - - text.x = x + (int) (width - text.width()) / 2; - text.y = y + (int) (height - text.baseLine()) / 2; - - if (icon1 != null) { - icon1.x = x + text.x - icon1.width() - 2; - icon1.y = y + (height - icon1.height()) / 2; - } - if (icon2 != null) { - icon2.x = x + text.x - icon2.width() - 2; - icon2.y = y + (height - icon2.height()) / 2; - } - if (icon3 != null) { - icon3.x = x + text.x - icon3.width() - 2; - icon3.y = y + (height - icon3.height()) / 2; - } - if (icon4 != null) { - icon4.x = x + text.x - icon4.width() - 2; - icon4.y = y + (height - icon4.height()) / 2; - } - if (icon5 != null) { - icon5.x = x + text.x - icon5.width() - 2; - icon5.y = y + (height - icon5.height()) / 2; - } - } - - @Override - protected void onTouchDown() { - bg.brightness(1.2f); - Sample.INSTANCE.play(Assets.SND_CLICK); - } - - @Override - protected void onTouchUp() { - bg.resetColor(); - } - - public void enable(boolean value) { - active = value; - text.alpha(value ? 1.0f : 0.3f); - } - - public void text(String value) { - text.text(value); - //text.measure(); - layout(); - } - - public void textColor(int value) { - text.hardlight(value); - } - - public void icon(Image icon) { - if (this.icon1 != null) { - remove(this.icon1); - } - this.icon1 = icon; - if (this.icon1 != null) { - add(this.icon1); - layout(); - } - } - - public float reqWidth() { - return text.width() + 4; - } - - public float reqHeight() { - return text.baseLine() + 4; - } -} diff --git a/java/com/hmdzl/spspd/change/ui/StatusPane.java b/java/com/hmdzl/spspd/change/ui/StatusPane.java deleted file mode 100644 index 2a9b2899..00000000 --- a/java/com/hmdzl/spspd/change/ui/StatusPane.java +++ /dev/null @@ -1,262 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.ui; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.effects.particles.BloodParticle; -import com.hmdzl.spspd.change.items.keys.IronKey; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.scenes.PixelScene; -import com.hmdzl.spspd.change.sprites.HeroSprite; -import com.hmdzl.spspd.change.windows.WndGame; -import com.hmdzl.spspd.change.windows.WndHero; -import com.watabou.input.Touchscreen.Touch; -import com.watabou.noosa.BitmapText; -import com.watabou.noosa.Camera; -import com.watabou.noosa.Game; -import com.watabou.noosa.Image; -import com.watabou.noosa.NinePatch; -import com.watabou.noosa.TouchArea; -import com.watabou.noosa.audio.Sample; -import com.watabou.noosa.particles.Emitter; -import com.watabou.noosa.ui.Button; -import com.watabou.noosa.ui.Component; - -public class StatusPane extends Component { - - private NinePatch shield; - private Image avatar; - private Emitter blood; - - private int lastTier = 0; - - private Image hp; - private Image exp; - - private int lastLvl = -1; - private int lastKeys = -1; - - private BitmapText level; - private BitmapText depth; - private BitmapText keys; - - private DangerIndicator danger; - private BuffIndicator buffs; - private Compass compass; - - private MenuButton btnMenu; - private BitmapText version; - - @Override - protected void createChildren() { - - shield = new NinePatch(Assets.STATUS, 80, 0, 30 + 18, 0); - add(shield); - - add(new TouchArea(0, 1, 30, 30) { - @Override - protected void onClick(Touch touch) { - Image sprite = Dungeon.hero.sprite; - if (!sprite.isVisible()) { - Camera.main.focusOn(sprite); - } - GameScene.show(new WndHero()); - }; - }); - - btnMenu = new MenuButton(); - add(btnMenu); - - avatar = HeroSprite.avatar(Dungeon.hero.heroClass, 7-Dungeon.skins); - add(avatar); - - blood = new Emitter(); - blood.pos(avatar); - blood.pour(BloodParticle.FACTORY, 0.3f); - blood.autoKill = false; - blood.on = false; - add(blood); - - compass = new Compass(Dungeon.level.exit); - add(compass); - - hp = new Image(Assets.HP_BAR); - add(hp); - - exp = new Image(Assets.XP_BAR); - add(exp); - - level = new BitmapText(PixelScene.font1x); - level.hardlight(0xFFEBA4); - add(level); - - depth = new BitmapText(Integer.toString(Dungeon.depth), - PixelScene.font1x); - depth.hardlight(0xCACFC2); - depth.measure(); - add(depth); - - Dungeon.hero.belongings.countIronKeys(); - keys = new BitmapText(PixelScene.font1x); - keys.hardlight(0xCACFC2); - add(keys); - - danger = new DangerIndicator(); - add(danger); - - buffs = new BuffIndicator(Dungeon.hero); - add(buffs); - - version = new BitmapText( "v" + Game.version, /*PixelScene.pixelFont*/PixelScene.font1x); - version.alpha( 0.5f ); - add(version); - } - - @Override - protected void layout() { - - height = 32; - - shield.size(width, shield.height); - - avatar.x = PixelScene.align(camera(), shield.x + 15 - avatar.width / 2); - avatar.y = PixelScene - .align(camera(), shield.y + 16 - avatar.height / 2); - - compass.x = avatar.x + avatar.width / 2 - compass.origin.x; - compass.y = avatar.y + avatar.height / 2 - compass.origin.y; - - hp.x = 30; - hp.y = 3; - - depth.x = width - 24 - depth.width() - 18; - depth.y = 6; - - keys.y = 6; - - danger.setPos(width - danger.width(), 18); - - buffs.setPos(32, 11); - - btnMenu.setPos(width - btnMenu.width(), 1); - - version.scale.set(PixelScene.align(0.5f)); - version.measure(); - version.x = width - version.width(); - version.y = btnMenu.bottom() + (4 - version.baseLine()); - PixelScene.align(version); - } - - @Override - public void update() { - super.update(); - - float health = (float) Dungeon.hero.HP / Dungeon.hero.HT; - - if (health == 0) { - avatar.tint(0x000000, 0.6f); - blood.on = false; - } else if (health < 0.25f) { - avatar.tint(0xcc0000, 0.4f); - blood.on = true; - } else { - avatar.resetColor(); - blood.on = false; - } - - hp.scale.x = health; - exp.scale.x = (width / exp.width) * Dungeon.hero.exp - / Dungeon.hero.maxExp(); - - if (Dungeon.hero.lvl != lastLvl) { - - if (lastLvl != -1) { - Emitter emitter = (Emitter) recycle(Emitter.class); - emitter.revive(); - emitter.pos(27, 27); - emitter.burst(Speck.factory(Speck.STAR), 12); - } - - lastLvl = Dungeon.hero.lvl; - level.text(Integer.toString(lastLvl)); - level.measure(); - level.x = PixelScene.align(27.0f - level.width() / 2); - level.y = PixelScene.align(27.5f - level.baseLine() / 2); - } - - int k = IronKey.curDepthQuantity; - if (k != lastKeys) { - lastKeys = k; - keys.text(Integer.toString(lastKeys)); - keys.measure(); - keys.x = width - 8 - keys.width() - 18; - } - - //int tier = Dungeon.hero.tier(); - //if (tier != lastTier) { - //lastTier = tier; - //avatar.copy(HeroSprite.avatar(Dungeon.hero.heroClass, tier)); - //} - } - - private static class MenuButton extends Button { - - private Image image; - - public MenuButton() { - super(); - - width = image.width + 4; - height = image.height + 4; - } - - @Override - protected void createChildren() { - super.createChildren(); - - image = new Image(Assets.STATUS, 114, 3, 12, 11); - add(image); - } - - @Override - protected void layout() { - super.layout(); - - image.x = x + 2; - image.y = y + 2; - } - - @Override - protected void onTouchDown() { - image.brightness(1.5f); - Sample.INSTANCE.play(Assets.SND_CLICK); - } - - @Override - protected void onTouchUp() { - image.resetColor(); - } - - @Override - protected void onClick() { - GameScene.show(new WndGame()); - } - } -} diff --git a/java/com/hmdzl/spspd/change/ui/Tag.java b/java/com/hmdzl/spspd/change/ui/Tag.java deleted file mode 100644 index 528bd82f..00000000 --- a/java/com/hmdzl/spspd/change/ui/Tag.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.ui; - -import com.hmdzl.spspd.change.Chrome; -import com.watabou.noosa.Game; -import com.watabou.noosa.NinePatch; -import com.watabou.noosa.ui.Button; - -public class Tag extends Button { - - private float r; - private float g; - private float b; - protected NinePatch bg; - - protected float lightness = 0; - - public Tag(int color) { - super(); - - this.r = (color >> 16) / 255f; - this.g = ((color >> 8) & 0xFF) / 255f; - this.b = (color & 0xFF) / 255f; - } - - @Override - protected void createChildren() { - - super.createChildren(); - - bg = Chrome.get(Chrome.Type.TAG); - add(bg); - } - - @Override - protected void layout() { - - super.layout(); - - bg.x = x; - bg.y = y; - bg.size(width, height); - } - - public void flash() { - lightness = 1f; - } - - @Override - public void update() { - super.update(); - - if (visible && lightness > 0.5) { - if ((lightness -= Game.elapsed) > 0.5) { - bg.ra = bg.ga = bg.ba = 2 * lightness - 1; - bg.rm = 2 * r * (1 - lightness); - bg.gm = 2 * g * (1 - lightness); - bg.bm = 2 * b * (1 - lightness); - } else { - bg.hardlight(r, g, b); - } - } - } -} diff --git a/java/com/hmdzl/spspd/change/ui/TargetHealthIndicator.java b/java/com/hmdzl/spspd/change/ui/TargetHealthIndicator.java deleted file mode 100644 index f0fe8992..00000000 --- a/java/com/hmdzl/spspd/change/ui/TargetHealthIndicator.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * Shattered Pixel Dungeon - * Copyright (C) 2014-2019 Evan Debenham - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ - -package com.hmdzl.spspd.change.ui; - -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.sprites.CharSprite; - -public class TargetHealthIndicator extends HealthBar { - - public static TargetHealthIndicator instance; - - private Char target; - - public TargetHealthIndicator() { - super(); - - instance = this; - } - - @Override - public void update() { - super.update(); - - if (target != null && target.isAlive() && target.sprite.visible) { - CharSprite sprite = target.sprite; - width = sprite.width; - x = sprite.x; - y = sprite.y - 3; - level( target ); - visible = true; - } else { - visible = false; - } - } - - public void target( Char ch ) { - if (ch != null && ch.isAlive()) { - target = ch; - } else { - target = null; - } - } - - public Char target() { - return target; - } -} diff --git a/java/com/hmdzl/spspd/change/ui/Toast.java b/java/com/hmdzl/spspd/change/ui/Toast.java deleted file mode 100644 index 45e9f104..00000000 --- a/java/com/hmdzl/spspd/change/ui/Toast.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.ui; - -import com.hmdzl.spspd.change.Chrome; -import com.hmdzl.spspd.change.scenes.PixelScene; -import com.watabou.noosa.BitmapText; -import com.watabou.noosa.RenderedText; -import com.watabou.noosa.NinePatch; -import com.watabou.noosa.ui.Component; - -public class Toast extends Component { - - private static final float MARGIN_HOR = 2; - private static final float MARGIN_VER = 2; - - protected NinePatch bg; - protected SimpleButton close; - protected RenderedText text; - - public Toast(String text) { - super(); - text(text); - - width = this.text.width() + close.width() + bg.marginHor() + MARGIN_HOR - * 3; - height = Math.max(this.text.height(), close.height()) + bg.marginVer() - + MARGIN_VER * 2; - } - - @Override - protected void createChildren() { - super.createChildren(); - - bg = Chrome.get(Chrome.Type.TOAST_TR); - add(bg); - - close = new SimpleButton(Icons.get(Icons.CLOSE)) { - @Override - protected void onClick() { - onClose(); - }; - }; - add(close); - - text = PixelScene.renderText(8); - add(text); - } - - @Override - protected void layout() { - super.layout(); - - bg.x = x; - bg.y = y; - bg.size(width, height); - - close.setPos(bg.x + bg.width() - bg.marginHor() / 2 - MARGIN_HOR - - close.width(), y + (height - close.height()) / 2); - - text.x = close.left() - MARGIN_HOR - text.width(); - text.y = y + (height - text.height()) / 2; - PixelScene.align(text); - } - - public void text(String txt) { - text.text(txt); - //text.measure(); - } - - protected void onClose() { - }; -} diff --git a/java/com/hmdzl/spspd/change/ui/Toolbar.java b/java/com/hmdzl/spspd/change/ui/Toolbar.java deleted file mode 100644 index 8ef4c840..00000000 --- a/java/com/hmdzl/spspd/change/ui/Toolbar.java +++ /dev/null @@ -1,400 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.ui; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.DungeonTilemap; -import com.hmdzl.spspd.change.ShatteredPixelDungeon; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.items.Heap; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.plants.Plant; -import com.hmdzl.spspd.change.scenes.CellSelector; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.sprites.ItemSprite; -import com.hmdzl.spspd.change.windows.WndBag; -import com.hmdzl.spspd.change.windows.WndCatalogus; -import com.hmdzl.spspd.change.windows.WndHero; -import com.hmdzl.spspd.change.windows.WndInfoCell; -import com.hmdzl.spspd.change.windows.WndInfoItem; -import com.hmdzl.spspd.change.windows.WndInfoMob; -import com.hmdzl.spspd.change.windows.WndInfoPlant; -import com.hmdzl.spspd.change.windows.WndMessage; -import com.hmdzl.spspd.change.windows.WndTradeItem; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.noosa.Game; -import com.watabou.noosa.Gizmo; -import com.watabou.noosa.Image; -import com.watabou.noosa.ui.Button; -import com.watabou.noosa.ui.Component; - -public class Toolbar extends Component { - - private Tool btnWait; - private Tool btnSearch; - //private Tool btnInfo; - private Tool btnResume; - //private Tool btnJump; - private Tool btnInventory; - private Tool btnQuick; - private Tool btnQuick2; - private Tool btnQuick3; - private Tool btnQuick4; - private Tool btnQuick5; - private Tool btnQuick6; - public static int QuickSlots; - - private PickedUpItem pickedUp; - - private boolean lastEnabled = true; - public boolean examining = false; - - - public Toolbar() { - super(); - - QuickSlots = ShatteredPixelDungeon.quickSlots(); - - height = btnInventory.height(); - } - - - - @Override - protected void createChildren() { - - add(btnWait = new Tool(0, 7, 20, 24) { - @Override - protected void onClick() { - examining = false; - Dungeon.hero.rest(false); - }; - - @Override - protected boolean onLongClick() { - examining = false; - Dungeon.hero.rest(true); - return true; - }; - }); - - add(btnSearch = new Tool(20, 7, 20, 24) { - @Override - protected void onClick() { - - if(!examining) { - GameScene.selectCell(informer); - examining = true; - } else { - informer.onSelect(null); - Dungeon.hero.search(true); - } - } - @Override - protected boolean onLongClick() { - Dungeon.hero.search(true); - return true; - }; - } ); - - /*add(btnInfo = new Tool(40, 7, 21, 24) { - @Override - protected void onClick() { - GameScene.selectCell(informer); - }; - - @Override - protected boolean onLongClick() { - Dungeon.hero.rest(true); - return true; - }; - - }); - - * add( btnResume = new Tool( 61, 7, 21, 24 ) { - * - * @Override protected void onClick() { Dungeon.hero.resume(); } } ); - */ - - /*add(btnJump = new Tool(40,7,21,24){ - @Override - protected void onClick() { - GameScene.selectCell(jumper); - }; - @Override - protected boolean onLongClick() { - Dungeon.hero.search(true); - return true; - }; - });*/ - - - add(btnInventory = new Tool(82, 7, 23, 24) { - private GoldIndicator gold; - - @Override - protected void onClick() { - GameScene.show(new WndBag(Dungeon.hero.belongings.backpack, - null, WndBag.Mode.ALL, null)); - } - - @Override - protected boolean onLongClick() { - GameScene.show(new WndCatalogus()); - return true; - }; - - @Override - protected void createChildren() { - super.createChildren(); - gold = new GoldIndicator(); - add(gold); - }; - - @Override - protected void layout() { - super.layout(); - gold.fill(this); - }; - }); - - add(btnQuick = new QuickslotTool(105, 7, 22, 24, 0)); - - btnQuick2 = new QuickslotTool(105, 7, 22, 24, 1); - - btnQuick3 = new QuickslotTool(105, 7, 22, 24, 2); - - add(btnQuick4 = new QuickslotTool(105, 7, 22, 24, 3)); - - btnQuick5 = new QuickslotTool(105, 7, 22, 24, 4); - - add(btnQuick6 = new QuickslotTool(105, 7, 22, 24, 5)); - - add(pickedUp = new PickedUpItem()); - - - } - - @Override - protected void layout() { - btnWait.setPos(x, y); - btnSearch.setPos(btnWait.right(), y); - //btnInfo.setPos(btnSearch.right(), y); - //btnResume.setPos(btnInfo.right(), y); - //btnRoll.setPos(btnSearch.right(), y); - btnInventory.setPos( width - btnInventory.width(), y ); - btnQuick.setPos(width - btnInventory.width()*2+2, y); - btnQuick2.setPos(width - btnQuick.width(), btnQuick.height()*3-2); - btnQuick3.setPos(width - btnQuick.width(), btnQuick.height()*4-3); - btnQuick4.setPos(width - btnQuick.width(), btnQuick.height()*2); - btnQuick5.setPos(width - btnInventory.width()*4+4, y); - btnQuick6.setPos(width - btnInventory.width()*3+3, y); - if (QuickSlots == 2) { - add(btnQuick2); - btnQuick2.visible = btnQuick2.active = true; - add(btnQuick3); - btnQuick3.visible = btnQuick3.active = true; - add(btnQuick5); - btnQuick5.visible = btnQuick5.active = true; - } else { - remove(btnQuick2); - btnQuick2.visible = btnQuick2.active = false; - remove(btnQuick5); - btnQuick5.visible = btnQuick5.active = false; - remove(btnQuick3); - btnQuick3.visible = btnQuick3.active = false; - } - } - - @Override - public void update() { - super.update(); - - if (lastEnabled != Dungeon.hero.ready) { - lastEnabled = Dungeon.hero.ready; - - for (Gizmo tool : members) { - if (tool instanceof Tool) { - ((Tool) tool).enable(lastEnabled); - } - } - } - - // btnResume.visible = Dungeon.hero.lastAction != null; - - if (!Dungeon.hero.isAlive()) { - btnInventory.enable(true); - } - - // If we have 2 slots, and 2nd one isn't visible, or we have 1, and 2nd - // one is visible... - if ((QuickSlots == 1) == btnQuick2.visible) { - layout(); - } - } - - public void pickup(Item item) { - pickedUp.reset(item, btnInventory.centerX(), btnInventory.centerY()); - } - - private static CellSelector.Listener informer = new CellSelector.Listener() { - @Override - public void onSelect(Integer cell) { - //instance.examining = false; - GameScene.examineCell( cell ); - } - - @Override - public String prompt() { - return Messages.get(Toolbar.class, "examine_prompt"); - } - }; - - private static class Tool extends Button { - - private static final int BGCOLOR = 0x7B8073; - - private Image base; - - public Tool(int x, int y, int width, int height) { - super(); - - base.frame(x, y, width, height); - - this.width = width; - this.height = height; - } - - @Override - protected void createChildren() { - super.createChildren(); - - base = new Image(Assets.TOOLBAR); - add(base); - } - - @Override - protected void layout() { - super.layout(); - - base.x = x; - base.y = y; - } - - @Override - protected void onTouchDown() { - base.brightness(1.4f); - } - - @Override - protected void onTouchUp() { - if (active) { - base.resetColor(); - } else { - base.tint(BGCOLOR, 0.7f); - } - } - - public void enable(boolean value) { - if (value != active) { - if (value) { - base.resetColor(); - } else { - base.tint(BGCOLOR, 0.7f); - } - active = value; - } - } - }; - - private static class QuickslotTool extends Tool { - - private QuickSlotButton slot; - - public QuickslotTool(int x, int y, int width, int height, int slotNum) { - super(x, y, width, height); - - slot = new QuickSlotButton(slotNum); - add(slot); - } - - @Override - protected void layout() { - super.layout(); - slot.setRect(x + 1, y + 2, width - 2, height - 2); - } - - @Override - public void enable(boolean value) { - super.enable(value); - slot.enable(value); - } - } - - private static class PickedUpItem extends ItemSprite { - - private static final float DISTANCE = DungeonTilemap.SIZE; - private static final float DURATION = 0.2f; - - private float dstX; - private float dstY; - private float left; - - public PickedUpItem() { - super(); - - originToCenter(); - - active = visible = false; - } - - public void reset(Item item, float dstX, float dstY) { - view(item.image(), item.glowing()); - - active = visible = true; - - this.dstX = dstX - ItemSprite.SIZE / 2; - this.dstY = dstY - ItemSprite.SIZE / 2; - left = DURATION; - - x = this.dstX - DISTANCE; - y = this.dstY - DISTANCE; - alpha(1); - } - - @Override - public void update() { - super.update(); - - if ((left -= Game.elapsed) <= 0) { - - visible = active = false; - - } else { - float p = left / DURATION; - scale.set((float) Math.sqrt(p)); - float offset = DISTANCE * p; - x = dstX - offset; - y = dstY - offset; - } - } - } -} diff --git a/java/com/hmdzl/spspd/change/ui/Window.java b/java/com/hmdzl/spspd/change/ui/Window.java deleted file mode 100644 index 4ba35833..00000000 --- a/java/com/hmdzl/spspd/change/ui/Window.java +++ /dev/null @@ -1,219 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.ui; - -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import com.hmdzl.spspd.change.Chrome; -import com.hmdzl.spspd.change.effects.ShadowBox; -import com.hmdzl.spspd.change.scenes.PixelScene; -import com.watabou.input.Keys; -import com.watabou.input.Keys.Key; -import com.watabou.input.Touchscreen.Touch; -import com.watabou.noosa.Camera; -import com.watabou.noosa.Game; -import com.watabou.noosa.Group; -import com.watabou.noosa.NinePatch; -import com.watabou.noosa.TouchArea; -import com.watabou.utils.Signal; - -public class Window extends Group implements Signal.Listener { - - protected int width; - protected int height; - - protected int yOffset; - - protected TouchArea blocker; - protected ShadowBox shadow; - protected NinePatch chrome; - - public static final int TITLE_COLOR = 0xFFFF44; - public static final int SHPX_COLOR = 0xCCFFCC; - - public Window() { - this(0, 0, Chrome.get(Chrome.Type.WINDOW)); - } - - public Window(int width, int height) { - this(width, height, Chrome.get(Chrome.Type.WINDOW)); - } - - public Window(int width, int height, NinePatch chrome) { - super(); - - blocker = new TouchArea(0, 0, PixelScene.uiCamera.width, - PixelScene.uiCamera.height) { - @Override - protected void onClick(Touch touch) { - if (!Window.this.chrome.overlapsScreenPoint( - (int) touch.current.x, (int) touch.current.y)) { - - onBackPressed(); - } - } - }; - blocker.camera = PixelScene.uiCamera; - add(blocker); - - this.chrome = chrome; - - this.width = width; - this.height = height; - - shadow = new ShadowBox(); - shadow.am = 0.5f; - shadow.camera = PixelScene.uiCamera.visible ? PixelScene.uiCamera - : Camera.main; - add(shadow); - - chrome.x = -chrome.marginLeft(); - chrome.y = -chrome.marginTop(); - chrome.size(width - chrome.x + chrome.marginRight(), height - chrome.y - + chrome.marginBottom()); - add(chrome); - - camera = new Camera(0, 0, (int) chrome.width, (int) chrome.height, - PixelScene.defaultZoom); - camera.x = (int) (Game.width - camera.width * camera.zoom) / 2; - camera.y = (int) (Game.height - camera.height * camera.zoom) / 2; - camera.scroll.set(chrome.x, chrome.y); - Camera.add(camera); - - shadow.boxRect(camera.x / camera.zoom, camera.y / camera.zoom, - chrome.width(), chrome.height); - - Keys.event.add(this); - } - - public void resize(int w, int h) { - this.width = w; - this.height = h; - - chrome.size(width + chrome.marginHor(), height + chrome.marginVer()); - - camera.resize((int) chrome.width, (int) chrome.height); - camera.x = (int) (Game.width - camera.screenWidth()) / 2; - camera.y = (int) (Game.height - camera.screenHeight()) / 2; - - shadow.boxRect(camera.x / camera.zoom, camera.y / camera.zoom, - chrome.width(), chrome.height); - } - - public void offset( int yOffset ){ - camera.y -= this.yOffset * camera.zoom; - this.yOffset = yOffset; - camera.y += yOffset * camera.zoom; - - shadow.boxRect( camera.x / camera.zoom, camera.y / camera.zoom, chrome.width(), chrome.height ); - } - - public void hide() { - parent.erase(this); - destroy(); - } - - @Override - public void destroy() { - super.destroy(); - - Camera.remove(camera); - Keys.event.remove(this); - } - - @Override - public void onSignal(Key key) { - if (key.pressed) { - switch (key.code) { - case Keys.BACK: - onBackPressed(); - break; - case Keys.MENU: - onMenuPressed(); - break; - } - } - - Keys.event.cancel(); - } - - public void onBackPressed() { - hide(); - } - - public void onMenuPressed() { - } - - protected static class Highlighter { - - private static final Pattern HIGHLIGHTER = Pattern.compile("_(.*?)_"); - private static final Pattern STRIPPER = Pattern.compile("[ \n]"); - - public String text; - - public boolean[] mask; - - public Highlighter(String text) { - - String stripped = STRIPPER.matcher(text).replaceAll(""); - mask = new boolean[stripped.length()]; - - Matcher m = HIGHLIGHTER.matcher(stripped); - - int pos = 0; - int lastMatch = 0; - - while (m.find()) { - pos += (m.start() - lastMatch); - int groupLen = m.group(1).length(); - for (int i = pos; i < pos + groupLen; i++) { - mask[i] = true; - } - pos += groupLen; - lastMatch = m.end(); - } - - m.reset(text); - StringBuffer sb = new StringBuffer(); - while (m.find()) { - m.appendReplacement(sb, m.group(1)); - } - m.appendTail(sb); - - this.text = sb.toString(); - } - - public boolean[] inverted() { - boolean[] result = new boolean[mask.length]; - for (int i = 0; i < result.length; i++) { - result[i] = !mask[i]; - } - return result; - } - - public boolean isHighlighted() { - for (int i = 0; i < mask.length; i++) { - if (mask[i]) { - return true; - } - } - return false; - } - } -} diff --git a/java/com/hmdzl/spspd/change/utils/BArray.java b/java/com/hmdzl/spspd/change/utils/BArray.java deleted file mode 100644 index 5fb6654b..00000000 --- a/java/com/hmdzl/spspd/change/utils/BArray.java +++ /dev/null @@ -1,163 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.utils; - -public class BArray { - - private static boolean[] falseArray; - - //This is MUCH faster than making a new boolean[] or using Arrays.fill; - public static void setFalse( boolean[] toBeFalse ){ - if (falseArray == null || falseArray.length < toBeFalse.length) - falseArray = new boolean[toBeFalse.length]; - - System.arraycopy(falseArray, 0, toBeFalse, 0, toBeFalse.length); - } - - public static boolean[] and(boolean[] a, boolean[] b, boolean[] result) { - - int length = a.length; - - if (result == null) { - result = new boolean[length]; - } - - for (int i = 0; i < length; i++) { - result[i] = a[i] && b[i]; - } - - return result; - } - - public static boolean[] or(boolean[] a, boolean[] b, boolean[] result) { - - int length = a.length; - - if (result == null) { - result = new boolean[length]; - } - - for (int i = 0; i < length; i++) { - result[i] = a[i] || b[i]; - } - - return result; - } - - public static boolean[] or( boolean[] a, boolean[] b, int offset, int length, boolean[] result ) { - - if (result == null) { - result = new boolean[length]; - } - - for (int i=offset; i < offset+length; i++) { - result[i] = a[i] || b[i]; - } - - return result; - } - - public static boolean[] not(boolean[] a, boolean[] result) { - - int length = a.length; - - if (result == null) { - result = new boolean[length]; - } - - for (int i = 0; i < length; i++) { - result[i] = !a[i]; - } - - return result; - } - - public static boolean[] is(int[] a, boolean[] result, int v1) { - - int length = a.length; - - if (result == null) { - result = new boolean[length]; - } - - for (int i = 0; i < length; i++) { - result[i] = a[i] == v1; - } - - return result; - } - - public static boolean[] isOneOf(int[] a, boolean[] result, int... v) { - - int length = a.length; - int nv = v.length; - - if (result == null) { - result = new boolean[length]; - } - - for (int i = 0; i < length; i++) { - result[i] = false; - for (int j = 0; j < nv; j++) { - if (a[i] == v[j]) { - result[i] = true; - break; - } - } - } - - return result; - } - - public static boolean[] isNot(int[] a, boolean[] result, int v1) { - - int length = a.length; - - if (result == null) { - result = new boolean[length]; - } - - for (int i = 0; i < length; i++) { - result[i] = a[i] != v1; - } - - return result; - } - - public static boolean[] isNotOneOf(int[] a, boolean[] result, int... v) { - - int length = a.length; - int nv = v.length; - - if (result == null) { - result = new boolean[length]; - } - - for (int i = 0; i < length; i++) { - result[i] = true; - for (int j = 0; j < nv; j++) { - if (a[i] == v[j]) { - result[i] = false; - break; - } - } - } - - return result; - } -} diff --git a/java/com/hmdzl/spspd/change/utils/GLog.java b/java/com/hmdzl/spspd/change/utils/GLog.java deleted file mode 100644 index b5284389..00000000 --- a/java/com/hmdzl/spspd/change/utils/GLog.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.utils; - -import android.util.Log; - -import com.watabou.utils.Signal; -import com.hmdzl.spspd.change.messages.Messages; - -public class GLog { - - public static final String TAG = "GAME"; - - public static final String POSITIVE = "++ "; - public static final String NEGATIVE = "-- "; - public static final String WARNING = "** "; - public static final String HIGHLIGHT = "@@ "; - - public static Signal update = new Signal(); - - public static void i(String text, Object... args) { - - if (args.length > 0) { - text = Messages.format(text, args); - } - - Log.i(TAG, text); - update.dispatch(text); - } - - public static void p(String text, Object... args) { - i(POSITIVE + text, args); - } - - public static void n(String text, Object... args) { - i(NEGATIVE + text, args); - } - - public static void w(String text, Object... args) { - i(WARNING + text, args); - } - - public static void h(String text, Object... args) { - i(HIGHLIGHT + text, args); - } -} diff --git a/java/com/hmdzl/spspd/change/utils/Utils.java b/java/com/hmdzl/spspd/change/utils/Utils.java deleted file mode 100644 index dcc5ee30..00000000 --- a/java/com/hmdzl/spspd/change/utils/Utils.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * Shattered Pixel Dungeon - * Copyright (C) 2014-2015 Evan Debenham - * - * Goblins Pixel Dungeon - * Copyright (C) 2016 Mario Braun - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.utils; - -import java.util.Locale; - -public class Utils { - - public static String capitalize( String str ) { - return Character.toUpperCase( str.charAt( 0 ) ) + str.substring( 1 ); - } - - public static String format( String format, Object...args ) { - return String.format( Locale.ENGLISH, format, args ); - } - - public static String VOWELS = "aoeiu"; - - public static String indefinite( String noun ) { - if (noun.length() == 0) { - return "a"; - } else { - return (VOWELS.indexOf( Character.toLowerCase( noun.charAt( 0 ) ) ) != -1 ? "an " : "a ") + noun; - } - } -} diff --git a/java/com/hmdzl/spspd/change/windows/IconTitle.java b/java/com/hmdzl/spspd/change/windows/IconTitle.java deleted file mode 100644 index 2b02dba3..00000000 --- a/java/com/hmdzl/spspd/change/windows/IconTitle.java +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.windows; - -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.scenes.PixelScene; -import com.hmdzl.spspd.change.sprites.ItemSprite; -import com.hmdzl.spspd.change.ui.HealthBar; -import com.hmdzl.spspd.change.ui.RenderedTextMultiline; -import com.hmdzl.spspd.change.ui.Window; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.noosa.Image; -import com.watabou.noosa.ui.Component; - -public class IconTitle extends Component { - - private static final int FONT_SIZE = 9; - - private static final float GAP = 2; - - protected Image imIcon; - protected RenderedTextMultiline tfLabel; - protected HealthBar health; - - private float healthLvl = Float.NaN; - - public IconTitle() { - super(); - } - - public IconTitle(Item item) { - this(new ItemSprite(item.image(), item.glowing()),Messages.titleCase( item.toString() ) ); - - } - - public IconTitle(Image icon, String label) { - super(); - - icon(icon); - label(label); - } - - @Override - protected void createChildren() { - imIcon = new Image(); - add(imIcon); - - tfLabel = PixelScene.renderMultiline(FONT_SIZE); - tfLabel.hardlight(Window.TITLE_COLOR); - add(tfLabel); - - health = new HealthBar(); - add(health); - } - - @Override - protected void layout() { - - health.visible = !Float.isNaN( healthLvl ); - - imIcon.x = x; - imIcon.y = y; - - tfLabel.maxWidth((int)(width - (imIcon.x + imIcon.width() + GAP))); - tfLabel.setPos(imIcon.x + imIcon.width() + GAP, imIcon.height > tfLabel.height() ? - imIcon.y + (imIcon.height() - tfLabel.height()) / 2 : - imIcon.y); - PixelScene.align(tfLabel); - - if (health.visible) { - health.setRect( tfLabel.left(), Math.max( tfLabel.top() + tfLabel.height(), imIcon.y + imIcon.height() - health.height() ), tfLabel.maxWidth(), 0 ); - height = health.bottom(); - } else { - height = Math.max( imIcon.height(), tfLabel.height() ); - } - } - - public void icon(Image icon) { - remove(imIcon); - add(imIcon = icon); - } - - public void label(String label) { - tfLabel.text(label); - } - - public void label(String label, int color) { - tfLabel.text(label); - tfLabel.hardlight(color); - } - - public void color(int color) { - tfLabel.hardlight(color); - } - - public void health(float value) { - health.level(healthLvl = value); - layout(); - } -} diff --git a/java/com/hmdzl/spspd/change/windows/WndAflyInfo.java b/java/com/hmdzl/spspd/change/windows/WndAflyInfo.java deleted file mode 100644 index 4e8a23d7..00000000 --- a/java/com/hmdzl/spspd/change/windows/WndAflyInfo.java +++ /dev/null @@ -1,246 +0,0 @@ -package com.hmdzl.spspd.change.windows; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.DewVial; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.food.completefood.AflyFood; -import com.hmdzl.spspd.change.items.food.completefood.Garbage; -import com.hmdzl.spspd.change.items.food.fruit.Fruit; -import com.hmdzl.spspd.change.items.food.meatfood.MeatFood; -import com.hmdzl.spspd.change.items.food.staplefood.StapleFood; -import com.hmdzl.spspd.change.items.food.vegetable.Vegetable; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.scenes.PixelScene; -import com.hmdzl.spspd.change.sprites.HeroSprite; -import com.hmdzl.spspd.change.sprites.ItemSprite; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.ui.Icons; -import com.hmdzl.spspd.change.ui.ItemSlot; -import com.hmdzl.spspd.change.ui.RedButton; -import com.hmdzl.spspd.change.ui.RenderedTextMultiline; -import com.hmdzl.spspd.change.ui.Window; -import com.watabou.noosa.ColorBlock; -import com.watabou.noosa.Image; -import com.watabou.noosa.audio.Sample; -import com.watabou.noosa.particles.Emitter; - -import java.util.ArrayList; - -import static com.hmdzl.spspd.change.Dungeon.hero; - - -public class WndAflyInfo extends Window { - - private WndBlacksmith.ItemButton[] inputs = new WndBlacksmith.ItemButton[3]; - private ItemSlot output; - - private Emitter smokeEmitter; - private Emitter bubbleEmitter; - - private RedButton btnCombine; - - private static final int WIDTH_P = 116; - private static final int WIDTH_L = 160; - - private static final int BTN_SIZE = 28; - - public WndAflyInfo(){ - - int w = WIDTH_P; - - int h = 0; - - IconTitle titlebar = new IconTitle(); - titlebar.icon(HeroSprite.avatar(hero.heroClass, hero.useskin())); - titlebar.label( Messages.get(this, "title") ); - titlebar.setRect( 0, 0, w, 0 ); - add( titlebar ); - - h += titlebar.height() + 2; - - RenderedTextMultiline desc = PixelScene.renderMultiline(6); - desc.text( Messages.get(this, "text") ); - desc.setPos(0, h); - desc.maxWidth(w); - add(desc); - - h += desc.height() + 6; - - for (int i = 0; i < (inputs.length); i++) { - inputs[i] = new WndBlacksmith.ItemButton(){ - @Override - protected void onClick() { - super.onClick(); - if (item != null){ - if (!item.collect()){ - Dungeon.level.drop(item, hero.pos); - } - item = null; - slot.item(new WndBag.Placeholder(ItemSpriteSheet.SOMETHING)); - } - GameScene.selectItem( itemSelector, WndBag.Mode.COOKING, Messages.get(WndAlchemy.class, "select") ); - } - }; - inputs[i].setRect(15, h, BTN_SIZE, BTN_SIZE); - add(inputs[i]); - h += BTN_SIZE + 2; - } - - Image arrow = Icons.get(Icons.RESUME); - arrow.hardlight(0, 0, 0); - arrow.x = (w - arrow.width)/2f; - arrow.y = inputs[1].top() + (inputs[1].height() - arrow.height)/2f; - PixelScene.align(arrow); - add(arrow); - - output = new ItemSlot(){ - @Override - protected void onClick() { - super.onClick(); - /*if (visible){ - GameScene.show(new WndInfoItem); - }*/ - } - }; - output.setRect(w - BTN_SIZE - 15, inputs[1].top(), BTN_SIZE, BTN_SIZE); - - ColorBlock outputBG = new ColorBlock(output.width(), output.height(), 0x9991938C); - outputBG.x = output.left(); - outputBG.y = output.top(); - add(outputBG); - - add(output); - output.visible = false; - - bubbleEmitter = new Emitter(); - smokeEmitter = new Emitter(); - bubbleEmitter.pos(outputBG.x + (BTN_SIZE-16)/2f, outputBG.y + (BTN_SIZE-16)/2f, 16, 16); - smokeEmitter.pos(bubbleEmitter.x, bubbleEmitter.y, bubbleEmitter.width, bubbleEmitter.height); - bubbleEmitter.autoKill = false; - smokeEmitter.autoKill = false; - add(bubbleEmitter); - add(smokeEmitter); - - h += 4; - - float btnWidth = (w-14)/2f; - - btnCombine = new RedButton(Messages.get(this, "combine")){ - @Override - protected void onClick() { - super.onClick(); - combine(); - } - }; - btnCombine.setRect(5, h, btnWidth, 18); - PixelScene.align(btnCombine); - btnCombine.enable(false); - add(btnCombine); - - RedButton btnCancel = new RedButton(Messages.get(this, "cancel")){ - @Override - protected void onClick() { - super.onClick(); - onBackPressed(); - } - }; - btnCancel.setRect(w - 5 - btnWidth, h, btnWidth, 18); - PixelScene.align(btnCancel); - add(btnCancel); - - h += btnCancel.height(); - - resize(w, h); - } - - protected WndBag.Listener itemSelector = new WndBag.Listener() { - @Override - public void onSelect( Item item ) { - if (item != null) { - for (int i = 0; i < (inputs.length); i++) { - if (inputs[i].item == null){ - //inputs[i].item(hero.belongings.misc1 = null); - //inputs[i].item(hero.belongings.misc2 = null); - //inputs[i].item(hero.belongings.misc3 = null); - inputs[i].item(item.detach(hero.belongings.backpack)); - break; - } - } - } - updateState(); - } - }; - - private ArrayList filterInput(Class itemClass){ - ArrayList filtered = new ArrayList<>(); - for (int i = 0; i < (inputs.length); i++){ - Item item = inputs[i].item; - if (item != null && itemClass.isInstance(item)){ - filtered.add((T)item); - } - } - return filtered; - } - - private void updateState(){ - //potion creation - if(filterInput(Item.class).size() > 0){ - output.item(new WndBag.Placeholder(ItemSpriteSheet.SOMETHING)); - output.visible = true; - btnCombine.enable(true); - } else { - btnCombine.enable(false); - output.visible = false; - } - } - - private void combine(){ - - ArrayList vegetables = filterInput(Vegetable.class); - ArrayList fruits = filterInput(Fruit.class); - ArrayList staplefoods = filterInput(StapleFood.class); - ArrayList meatfoods = filterInput(MeatFood.class); - - Item result = null; - - if (fruits.size() == 1 && staplefoods.size() == 1 && meatfoods.size() == 1 ){ - - result = new AflyFood(); - - } else result = new Garbage(); - - if (result != null){ - bubbleEmitter.start(Speck.factory( Speck.BUBBLE ), 0.2f, 10 ); - smokeEmitter.burst(Speck.factory( Speck.WOOL ), 10 ); - Sample.INSTANCE.play( Assets.SND_PUFF ); - - output.item(result); - if (!result.collect()){ - Dungeon.level.drop(result, hero.pos); - } - for (int i = 0; i < (inputs.length ); i++){ - inputs[i].slot.item(new WndBag.Placeholder(ItemSpriteSheet.SOMETHING)); - inputs[i].item = null; - } - - btnCombine.enable(false); - } - - } - - @Override - public void onBackPressed() { - for (int i = 0; i < (inputs.length ); i++) { - if (inputs[i].item != null){ - if (!inputs[i].item.collect()){ - Dungeon.level.drop(inputs[i].item, hero.pos); - } - } - } - super.onBackPressed(); - } -} - diff --git a/java/com/hmdzl/spspd/change/windows/WndAlchemy.java b/java/com/hmdzl/spspd/change/windows/WndAlchemy.java deleted file mode 100644 index 8136af54..00000000 --- a/java/com/hmdzl/spspd/change/windows/WndAlchemy.java +++ /dev/null @@ -1,567 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * Shattered Pixel Dungeon - * Copyright (C) 2014-2018 Evan Debenham - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ - -package com.hmdzl.spspd.change.windows; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.ShatteredPixelDungeon; -import com.hmdzl.spspd.change.Statistics; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.Generator; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.StoneOre; -import com.hmdzl.spspd.change.items.Torch; -import com.hmdzl.spspd.change.items.food.WaterItem; -import com.hmdzl.spspd.change.items.Weightstone; -import com.hmdzl.spspd.change.items.artifacts.AlchemistsToolkit; -import com.hmdzl.spspd.change.items.bombs.BuildBomb; -import com.hmdzl.spspd.change.items.food.completefood.Chocolate; -import com.hmdzl.spspd.change.items.food.completefood.FoodFans; -import com.hmdzl.spspd.change.items.food.completefood.Frenchfries; -import com.hmdzl.spspd.change.items.food.staplefood.NormalRation; -import com.hmdzl.spspd.change.items.food.vegetable.NutVegetable; -import com.hmdzl.spspd.change.items.medicine.BlueMilk; -import com.hmdzl.spspd.change.items.medicine.DeathCap; -import com.hmdzl.spspd.change.items.medicine.Earthstar; -import com.hmdzl.spspd.change.items.medicine.GoldenJelly; -import com.hmdzl.spspd.change.items.medicine.GreenSpore; -import com.hmdzl.spspd.change.items.medicine.Hardpill; -import com.hmdzl.spspd.change.items.medicine.JackOLantern; -import com.hmdzl.spspd.change.items.medicine.Magicpill; -import com.hmdzl.spspd.change.items.medicine.Musicpill; -import com.hmdzl.spspd.change.items.medicine.PixieParasol; -import com.hmdzl.spspd.change.items.medicine.Powerpill; -import com.hmdzl.spspd.change.items.medicine.Shootpill; -import com.hmdzl.spspd.change.items.medicine.Smashpill; -import com.hmdzl.spspd.change.items.summon.Honeypot; -import com.hmdzl.spspd.change.items.bombs.HugeBomb; -import com.hmdzl.spspd.change.items.food.completefood.Chickennugget; -import com.hmdzl.spspd.change.items.food.completefood.Crystalnucleus; -import com.hmdzl.spspd.change.items.food.completefood.Foamedbeverage; -import com.hmdzl.spspd.change.items.food.completefood.Fruitsalad; -import com.hmdzl.spspd.change.items.food.completefood.Garbage; -import com.hmdzl.spspd.change.items.food.completefood.Gel; -import com.hmdzl.spspd.change.items.food.completefood.Hamburger; -import com.hmdzl.spspd.change.items.food.completefood.Herbmeat; -import com.hmdzl.spspd.change.items.food.completefood.HoneyGel; -import com.hmdzl.spspd.change.items.food.completefood.HoneyWater; -import com.hmdzl.spspd.change.items.food.completefood.Honeymeat; -import com.hmdzl.spspd.change.items.food.completefood.Honeyrice; -import com.hmdzl.spspd.change.items.food.completefood.Icecream; -import com.hmdzl.spspd.change.items.food.completefood.Kebab; -import com.hmdzl.spspd.change.items.food.completefood.Meatroll; -import com.hmdzl.spspd.change.items.food.completefood.Porksoup; -import com.hmdzl.spspd.change.items.food.completefood.Ricefood; -import com.hmdzl.spspd.change.items.food.completefood.Vegetablekebab; -import com.hmdzl.spspd.change.items.food.completefood.Vegetableroll; -import com.hmdzl.spspd.change.items.food.completefood.Vegetablesoup; -import com.hmdzl.spspd.change.items.food.fruit.Blandfruit; -import com.hmdzl.spspd.change.items.food.fruit.Fruit; -import com.hmdzl.spspd.change.items.food.meatfood.MeatFood; -import com.hmdzl.spspd.change.items.food.Nut; -import com.hmdzl.spspd.change.items.food.completefood.PerfectFood; -import com.hmdzl.spspd.change.items.food.completefood.PetFood; -import com.hmdzl.spspd.change.items.food.Honey; -import com.hmdzl.spspd.change.items.food.staplefood.OverpricedRation; -import com.hmdzl.spspd.change.items.food.staplefood.StapleFood; -import com.hmdzl.spspd.change.items.food.vegetable.Vegetable; -import com.hmdzl.spspd.change.items.potions.Potion; -import com.hmdzl.spspd.change.items.scrolls.Scroll; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfMagicalInfusion; -import com.hmdzl.spspd.change.items.weapon.spammo.BattleAmmo; -import com.hmdzl.spspd.change.items.weapon.spammo.BlindAmmo; -import com.hmdzl.spspd.change.items.weapon.spammo.DewAmmo; -import com.hmdzl.spspd.change.items.weapon.spammo.DreamAmmo; -import com.hmdzl.spspd.change.items.weapon.spammo.EmptyAmmo; -import com.hmdzl.spspd.change.items.weapon.spammo.EvolveAmmo; -import com.hmdzl.spspd.change.items.weapon.spammo.FireAmmo; -import com.hmdzl.spspd.change.items.weapon.spammo.GoldAmmo; -import com.hmdzl.spspd.change.items.weapon.spammo.HeavyAmmo; -import com.hmdzl.spspd.change.items.weapon.spammo.IceAmmo; -import com.hmdzl.spspd.change.items.weapon.spammo.MossAmmo; -import com.hmdzl.spspd.change.items.weapon.spammo.RotAmmo; -import com.hmdzl.spspd.change.items.weapon.spammo.SandAmmo; -import com.hmdzl.spspd.change.items.weapon.spammo.StarAmmo; -import com.hmdzl.spspd.change.items.weapon.spammo.StormAmmo; -import com.hmdzl.spspd.change.items.weapon.spammo.SunAmmo; -import com.hmdzl.spspd.change.items.weapon.spammo.ThornAmmo; -import com.hmdzl.spspd.change.items.weapon.spammo.WoodenAmmo; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.plants.BlandfruitBush; -import com.hmdzl.spspd.change.plants.Blindweed; -import com.hmdzl.spspd.change.plants.Dewcatcher; -import com.hmdzl.spspd.change.plants.Dreamfoil; -import com.hmdzl.spspd.change.plants.Earthroot; -import com.hmdzl.spspd.change.plants.Fadeleaf; -import com.hmdzl.spspd.change.plants.Firebloom; -import com.hmdzl.spspd.change.plants.Flytrap; -import com.hmdzl.spspd.change.plants.Icecap; -import com.hmdzl.spspd.change.plants.NutPlant; -import com.hmdzl.spspd.change.plants.Phaseshift; -import com.hmdzl.spspd.change.plants.Plant; -import com.hmdzl.spspd.change.plants.Rotberry; -import com.hmdzl.spspd.change.plants.Seedpod; -import com.hmdzl.spspd.change.plants.Sorrowmoss; -import com.hmdzl.spspd.change.plants.Starflower; -import com.hmdzl.spspd.change.plants.Stormvine; -import com.hmdzl.spspd.change.plants.Sungrass; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.scenes.PixelScene; -import com.hmdzl.spspd.change.sprites.HeroSprite; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.ui.Icons; -import com.hmdzl.spspd.change.ui.ItemSlot; -import com.hmdzl.spspd.change.ui.RedButton; -import com.hmdzl.spspd.change.ui.RenderedTextMultiline; -import com.hmdzl.spspd.change.ui.Window; -import com.watabou.noosa.ColorBlock; -import com.watabou.noosa.Image; -import com.watabou.noosa.audio.Sample; -import com.watabou.noosa.particles.Emitter; -import com.watabou.utils.Random; - -import java.util.ArrayList; - -import static com.hmdzl.spspd.change.Dungeon.hero; - -public class WndAlchemy extends Window { - - private WndBlacksmith.ItemButton[] inputs = new WndBlacksmith.ItemButton[5]; - private ItemSlot output; - - private Emitter smokeEmitter; - private Emitter bubbleEmitter; - - private RedButton btnCombine; - - private static final int WIDTH_P = 116; - private static final int WIDTH_L = 160; - - private static final int BTN_SIZE = 28; - - public WndAlchemy(){ - - int w = WIDTH_P; - - int h = 0; - - IconTitle titlebar = new IconTitle(); - titlebar.icon(HeroSprite.avatar(hero.heroClass, hero.useskin())); - titlebar.label( Messages.get(this, "title") ); - titlebar.setRect( 0, 0, w, 0 ); - add( titlebar ); - - h += titlebar.height() + 2; - - RenderedTextMultiline desc = PixelScene.renderMultiline(6); - desc.text( Messages.get(this, "text") ); - desc.setPos(0, h); - desc.maxWidth(w); - add(desc); - - h += desc.height() + 6; - - AlchemistsToolkit.alchemy alchemytool = Dungeon.hero.buff(AlchemistsToolkit.alchemy.class); - int bonus = alchemytool != null ? alchemytool.level()/5 : 0; - for (int i = 0; i < (inputs.length - 2 + bonus ); i++) { - inputs[i] = new WndBlacksmith.ItemButton(){ - @Override - protected void onClick() { - super.onClick(); - if (item != null){ - if (!item.collect()){ - Dungeon.level.drop(item, hero.pos); - } - item = null; - slot.item(new WndBag.Placeholder(ItemSpriteSheet.SOMETHING)); - } - GameScene.selectItem( itemSelector, WndBag.Mode.COOKING, Messages.get(WndAlchemy.class, "select") ); - } - }; - inputs[i].setRect(15, h, BTN_SIZE, BTN_SIZE); - add(inputs[i]); - h += BTN_SIZE + 2; - } - - Image arrow = Icons.get(Icons.RESUME); - arrow.hardlight(0, 0, 0); - arrow.x = (w - arrow.width)/2f; - arrow.y = inputs[1].top() + (inputs[1].height() - arrow.height)/2f; - PixelScene.align(arrow); - add(arrow); - - output = new ItemSlot(){ - @Override - protected void onClick() { - super.onClick(); - /*if (visible){ - GameScene.show(new WndInfoItem); - }*/ - } - }; - output.setRect(w - BTN_SIZE - 15, inputs[1].top(), BTN_SIZE, BTN_SIZE); - - ColorBlock outputBG = new ColorBlock(output.width(), output.height(), 0x9991938C); - outputBG.x = output.left(); - outputBG.y = output.top(); - add(outputBG); - - add(output); - output.visible = false; - - bubbleEmitter = new Emitter(); - smokeEmitter = new Emitter(); - bubbleEmitter.pos(outputBG.x + (BTN_SIZE-16)/2f, outputBG.y + (BTN_SIZE-16)/2f, 16, 16); - smokeEmitter.pos(bubbleEmitter.x, bubbleEmitter.y, bubbleEmitter.width, bubbleEmitter.height); - bubbleEmitter.autoKill = false; - smokeEmitter.autoKill = false; - add(bubbleEmitter); - add(smokeEmitter); - - h += 4; - - float btnWidth = (w-14)/2f; - - btnCombine = new RedButton(Messages.get(this, "combine")){ - @Override - protected void onClick() { - super.onClick(); - combine(); - } - }; - btnCombine.setRect(5, h, btnWidth, 18); - PixelScene.align(btnCombine); - btnCombine.enable(false); - add(btnCombine); - - RedButton btnCancel = new RedButton(Messages.get(this, "cancel")){ - @Override - protected void onClick() { - super.onClick(); - onBackPressed(); - } - }; - btnCancel.setRect(w - 5 - btnWidth, h, btnWidth, 18); - PixelScene.align(btnCancel); - add(btnCancel); - - h += btnCancel.height(); - - resize(w, h); - } - - protected WndBag.Listener itemSelector = new WndBag.Listener() { - @Override - public void onSelect( Item item ) { - if (item != null) { - AlchemistsToolkit.alchemy alchemytool = Dungeon.hero.buff(AlchemistsToolkit.alchemy.class); - int bonus = alchemytool != null ? alchemytool.level()/5 : 0; - for (int i = 0; i < (inputs.length - 2 + bonus ); i++) { - if (inputs[i].item == null){ - inputs[i].item(item.detach(hero.belongings.backpack)); - break; - } - } - } - updateState(); - } - }; - - private ArrayList filterInput(Class itemClass){ - ArrayList filtered = new ArrayList<>(); - AlchemistsToolkit.alchemy alchemytool = Dungeon.hero.buff(AlchemistsToolkit.alchemy.class); - int bonus = alchemytool != null ? alchemytool.level()/5 : 0; - for (int i = 0; i < (inputs.length - 2 + bonus ); i++){ - Item item = inputs[i].item; - if (item != null && itemClass.isInstance(item)){ - filtered.add((T)item); - } - } - return filtered; - } - - private void updateState(){ - //potion creation - if (filterInput(Plant.Seed.class).size() == 3){ - output.item(new WndBag.Placeholder(ItemSpriteSheet.POTION)); - output.visible = true; - btnCombine.enable(true); - - //blandfruit cooking - } else if(filterInput(Blandfruit.class).size() == 1 && filterInput(Plant.Seed.class).size() == 1){ - output.item(new WndBag.Placeholder(ItemSpriteSheet.SOMETHING)); - output.visible = true; - btnCombine.enable(true); - - /*} else if (filterInput(Honeypot.class).size() == 1 || filterInput(Honeypot.ShatteredPot.class).size() == 1 ){ - output.item(new WndBag.Placeholder(ItemSpriteSheet.SOMETHING)); - output.visible = true; - btnCombine.enable(true);*/ - } else if(filterInput(Item.class).size() > 0){ - output.item(new WndBag.Placeholder(ItemSpriteSheet.SOMETHING)); - output.visible = true; - btnCombine.enable(true); - } else { - btnCombine.enable(false); - output.visible = false; - } - } - - private void combine(){ - ArrayList seeds = filterInput(Plant.Seed.class); - ArrayList blandfruits = filterInput(Blandfruit.class); - ArrayList honeypot = filterInput(Honeypot.class); - ArrayList honey = filterInput(Honey.class); - ArrayList shatteredpot = filterInput(Honeypot.ShatteredPot.class); - ArrayList water = filterInput(WaterItem.class); - ArrayList vegetables = filterInput(Vegetable.class); - ArrayList ore = filterInput(StoneOre.class); - ArrayList nut = filterInput(Nut.class); - ArrayList fruits = filterInput(Fruit.class); - ArrayList staplefoods = filterInput(StapleFood.class); - ArrayList meatfoods = filterInput(MeatFood.class); - - ArrayList potions = filterInput(Potion.class); - ArrayList scrolls = filterInput(Scroll.class); - ArrayList gels = filterInput(Gel.class); - ArrayList bbomb = filterInput(BuildBomb.class); - ArrayList miscroll = filterInput(ScrollOfMagicalInfusion.class); - - ArrayList iceseed = filterInput(Icecap.Seed.class); - ArrayList fireseed = filterInput(Firebloom.Seed.class); - ArrayList blindseed = filterInput(Blindweed.Seed.class); - ArrayList stormseed = filterInput(Stormvine.Seed.class); - ArrayList dreamseed = filterInput(Dreamfoil.Seed.class); - ArrayList mossseed = filterInput(Sorrowmoss.Seed.class); - ArrayList starseed = filterInput(Starflower.Seed.class); - ArrayList sunseed = filterInput(Sungrass.Seed.class); - ArrayList dewseed = filterInput(Dewcatcher.Seed.class); - ArrayList sandseed = filterInput(Fadeleaf.Seed.class); - ArrayList seedseed = filterInput(Seedpod.Seed.class); - ArrayList rotseed = filterInput(Rotberry.Seed.class); - ArrayList rootseed = filterInput(Earthroot.Seed.class); - ArrayList blandseed = filterInput(BlandfruitBush.Seed.class); - ArrayList trapseed = filterInput(Flytrap.Seed.class); - ArrayList phaseseed = filterInput(Phaseshift.Seed.class); - ArrayList nutseed = filterInput(NutPlant.Seed.class); - - Item result = null; - - if (honey.size() == 1 && ore.size() == 1 && staplefoods.size() ==1 && water.size() == 1 && seeds.size() == 1 ){ - result = new PerfectFood(); - } else if (vegetables.size() == 1 && ore.size() == 1 && staplefoods.size() ==1 && water.size() == 1 && fruits.size() == 1 ){ - result = new PerfectFood(); - } else if ( ore.size() == 3 && water.size() == 1 && seeds.size() == 1 ){ - result = new Crystalnucleus(); - } else if ( staplefoods.size() ==2 && vegetables.size() == 1 && meatfoods.size() == 2 ){ - result = new Hamburger(); - } else if ( meatfoods.size() ==3 && vegetables.size() == 1 ){ - result = new Powerpill(); - } else if ( meatfoods.size() ==2 && ore.size() == 1 && vegetables.size() ==1 ){ - result = new Hardpill(); - } else if (meatfoods.size() ==2 && potions.size() == 1 && vegetables.size() ==1 ){ - result = new Smashpill(); - } else if ( meatfoods.size() ==3 && seeds.size() == 1 ){ - result = new Shootpill(); - } else if ( meatfoods.size() ==2 && ore.size() == 1 && seeds.size() ==1 ){ - result = new Musicpill(); - } else if (meatfoods.size() ==2 && potions.size() == 1 && seeds.size() ==1 ){ - result = new Magicpill(); - - } else if (water.size() ==1 && vegetables.size() == 1 && dewseed.size() ==1 ){ - result = new GreenSpore(); - } else if (water.size() ==1 && vegetables.size() == 1 && stormseed.size() ==1 ){ - result = new GoldenJelly(); - } else if (water.size() ==1 && vegetables.size() == 1 && rootseed.size() ==1 ){ - result = new Earthstar(); - } else if (water.size() ==1 && vegetables.size() == 1 && fireseed.size() ==1 ){ - result = new JackOLantern(); - } else if (water.size() ==1 && vegetables.size() == 1 && dreamseed.size() ==1 ){ - result = new PixieParasol(); - } else if (water.size() ==1 && vegetables.size() == 1 && sunseed.size() ==1 ){ - result = new BlueMilk(); - } else if (water.size() ==1 && vegetables.size() == 1 && mossseed.size() ==1 ) { - result = new DeathCap(); - - //potion creation - } else if (seeds.size() == 3){ - - if (Random.Int( 3 ) == 0) { - - result = Generator.random( Generator.Category.POTION ); - - } else { - - Class itemClass = Random.element(seeds).alchemyClass; - try { - result = itemClass.newInstance(); - } catch (Exception e) { - ShatteredPixelDungeon.reportException(e); - result = Generator.random( Generator.Category.POTION ); - } - - } - - Statistics.potionsCooked++; - Badges.validatePotionsCooked(); - - //blandfruit cooking - } else if (blandfruits.size() == 1 && seeds.size() == 1) { - result = fruits.get(0); - ((Blandfruit)result).cook(seeds.get(0)); - - } else if (honeypot.size() == 1 || shatteredpot.size() == 1) { - result = new Honey(); - } else if (honey.size() == 1 && water.size() == 1 && iceseed.size() == 1 ){ - result = new Icecream(); - } else if (meatfoods.size() ==1 && water.size() == 1 && vegetables.size() ==1 ){ - result = new Porksoup(); - } else if ( ore.size() == 1 && water.size() == 2 && seeds.size() == 1 && fruits.size() == 1){ - result = new Foamedbeverage(); - } else if (fruits.size() == 2 && water.size() == 1 ){ - result = new Fruitsalad(); - } else if (vegetables.size() == 2 && meatfoods.size() == 1){ - result = new Vegetablekebab(); - } else if ( honey.size() == 1 && water.size() == 2 ){ - result = new HoneyWater(); - } else if (vegetables.size() == 1 && meatfoods.size() == 2 ){ - result = new Kebab(); - } else if (water.size() == 1 && vegetables.size() == 2 ){ - result = new Vegetablesoup(); - } else if (honey.size() == 1 && staplefoods.size() ==1 ){ - result = new Honeyrice(); - } else if (honey.size() == 1 && meatfoods.size() ==1 ){ - result = new Honeymeat(); - } else if ( meatfoods.size() == 1 && seeds.size() == 1 ){ - result = new Herbmeat(); - } else if ( ore.size() == 1 && meatfoods.size() == 1 ){ - result = new Chickennugget(); - } else if ( staplefoods.size() == 1 && water.size() == 1 ){ - result = new Ricefood(); - } else if ( scrolls.size() == 1 && meatfoods.size() == 1 ){ - result = new Meatroll(); - } else if ( scrolls.size() == 1 && vegetables.size() == 1 ){ - result = new Vegetableroll(); - } else if ( ore.size() == 1 && water.size() == 1 ){ - result = new Gel(); - } else if ( nut.size() == 5 ){ - result = new Chocolate(); - } else if ( nut.size() == 4 ){ - result = new NormalRation(); - } else if ( nut.size() == 3 ){ - result = new OverpricedRation(); - } else if (nut.size() == 2 && water.size() == 1){ - result = new PetFood(); - } else if ( nut.size() == 2 && potions.size()==1){ - result = new FoodFans(); - } else if ( nut.size() == 2 && scrolls.size()==1){ - result = new Frenchfries(); - } else if ( honey.size() == 1 && gels.size() == 1 ){ - result = new HoneyGel(); - - } else if ( ore.size() == 1 && seeds.size() == 1 && scrolls.size() == 1 ){ - result = new BuildBomb(); - } else if ( bbomb.size() == 1 && seeds.size() == 2 ){ - result = Generator.random( Generator.Category.BOMBS ); - } else if ( bbomb.size() == 2 ){ - result = new HugeBomb(); - - } else if ( ore.size() == 2 ){ - result = new HeavyAmmo(); - } else if ( ore.size() == 1 && nutseed.size()==1){ - result = new WoodenAmmo(); - } else if ( ore.size() == 1 && fireseed.size() == 1 ){ - result = new FireAmmo(); - } else if ( ore.size() == 1 && iceseed.size() == 1 ){ - result = new IceAmmo(); - } else if (ore.size() == 1 && stormseed.size() == 1 ){ - result = new StormAmmo(); - } else if (ore.size() == 1 && mossseed.size() == 1 ){ - result = new MossAmmo(); - } else if ( ore.size() == 1 && blindseed.size() == 1 ){ - result = new BlindAmmo(); - } else if ( ore.size() == 1 && starseed.size() == 1 ){ - result = new StarAmmo(); - } else if ( ore.size() == 1 && dreamseed.size() == 1 ){ - result = new DreamAmmo(); - } else if ( ore.size() == 1 && dewseed.size() == 1 ){ - result = new DewAmmo(); - } else if ( ore.size() == 1 && sunseed.size() == 1 ){ - result = new SunAmmo(); - } else if ( ore.size() == 1 && sandseed.size() == 1 ){ - result = new SandAmmo(); - } else if ( ore.size() == 1 && seedseed.size() == 1 ){ - result = new GoldAmmo(); - } else if ( ore.size() == 1 && rotseed.size() == 1 ){ - result = new RotAmmo(); - } else if ( ore.size() == 1 && rootseed.size() == 1 ){ - result = new ThornAmmo(); - } else if ( ore.size() == 1 && blandseed.size() == 1 ){ - result = new EmptyAmmo(); - } else if ( ore.size() == 1 && phaseseed.size() == 1 ){ - result = new EvolveAmmo(); - } else if ( ore.size() == 1 && trapseed.size() == 1 ){ - result = new BattleAmmo(); - } else if ( miscroll.size() == 1 ){ - result = new Weightstone(); - } else if ( gels.size() == 1 ){ - result = new Torch(); - } else if ( nut.size() == 1 ){ - result = new NutVegetable(); - } else result = new Garbage(); - - if (result != null){ - bubbleEmitter.start(Speck.factory( Speck.BUBBLE ), 0.2f, 10 ); - smokeEmitter.burst(Speck.factory( Speck.WOOL ), 10 ); - Sample.INSTANCE.play( Assets.SND_PUFF ); - - output.item(result); - if (!result.collect()){ - Dungeon.level.drop(result, hero.pos); - } - AlchemistsToolkit.alchemy alchemytool = Dungeon.hero.buff(AlchemistsToolkit.alchemy.class); - int bonus = alchemytool != null ? alchemytool.level()/5 : 0; - for (int i = 0; i < (inputs.length - 2 + bonus ); i++){ - inputs[i].slot.item(new WndBag.Placeholder(ItemSpriteSheet.SOMETHING)); - inputs[i].item = null; - } - - btnCombine.enable(false); - } - - } - - @Override - public void onBackPressed() { - AlchemistsToolkit.alchemy alchemytool = Dungeon.hero.buff(AlchemistsToolkit.alchemy.class); - int bonus = alchemytool != null ? alchemytool.level()/5 : 0; - for (int i = 0; i < (inputs.length - 2 + bonus ); i++) { - if (inputs[i].item != null){ - if (!inputs[i].item.collect()){ - Dungeon.level.drop(inputs[i].item, hero.pos); - } - } - } - super.onBackPressed(); - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/windows/WndAscend.java b/java/com/hmdzl/spspd/change/windows/WndAscend.java deleted file mode 100644 index edb99d88..00000000 --- a/java/com/hmdzl/spspd/change/windows/WndAscend.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.windows; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.items.DewVial; -import com.hmdzl.spspd.change.scenes.PixelScene; -import com.hmdzl.spspd.change.sprites.ItemSprite; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.ui.RedButton; -import com.hmdzl.spspd.change.ui.RenderedTextMultiline; -import com.hmdzl.spspd.change.ui.Window; - - -public class WndAscend extends Window { - - private static final String TXT_MESSAGE = "Are you sure you want to ascend? " - +"Ascending here will end your game. "; - private static final String TXT_REWARD = "Ascend"; - - private static final int WIDTH = 120; - private static final int BTN_HEIGHT = 20; - private static final int GAP = 2; - - public WndAscend() { - - super(); - - DewVial dewvial = new DewVial(); - - IconTitle titlebar = new IconTitle(); - titlebar.icon(new ItemSprite(dewvial.image(), null)); - titlebar.label(Messages.titleCase(dewvial.name())); - titlebar.setRect(0, 0, WIDTH, 0); - add(titlebar); - - RenderedTextMultiline message = PixelScene - .renderMultiline(TXT_MESSAGE, 6); - message.maxWidth(WIDTH); - message.setPos(0, titlebar.bottom() + GAP); - add(message); - - RedButton btnReward = new RedButton(TXT_REWARD) { - @Override - protected void onClick() { - Dungeon.level.forcedone=true; - hide(); - } - }; - btnReward.setRect(0, message.top() + message.height() + GAP, WIDTH, - BTN_HEIGHT); - add(btnReward); - - resize(WIDTH, (int) btnReward.bottom()); - } - - -} diff --git a/java/com/hmdzl/spspd/change/windows/WndBadge.java b/java/com/hmdzl/spspd/change/windows/WndBadge.java deleted file mode 100644 index f038540f..00000000 --- a/java/com/hmdzl/spspd/change/windows/WndBadge.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.windows; - -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.effects.BadgeBanner; -import com.hmdzl.spspd.change.scenes.PixelScene; -import com.hmdzl.spspd.change.ui.RenderedTextMultiline; -import com.hmdzl.spspd.change.ui.Window; -import com.watabou.noosa.BitmapText; -import com.watabou.noosa.BitmapTextMultiline; -import com.watabou.noosa.Image; - -public class WndBadge extends Window { - - private static final int WIDTH = 120; - private static final int MARGIN = 4; - - public WndBadge(Badges.Badge badge) { - - super(); - - Image icon = BadgeBanner.image(badge.image); - icon.scale.set(2); - add(icon); - - RenderedTextMultiline info = PixelScene.renderMultiline( badge.desc(), 8 ); - info.maxWidth(WIDTH - MARGIN * 2); - PixelScene.align(info); - add(info); - - float w = Math.max( icon.width(), info.width() ) + MARGIN * 2; - - icon.x = (w - icon.width()) / 2f; - icon.y = MARGIN; - PixelScene.align(icon); - - info.setPos((w - info.width()) / 2, icon.y + icon.height() + MARGIN); - resize( (int)w, (int)(info.bottom() + MARGIN) ); - - BadgeBanner.highlight( icon, badge.image ); - } -} diff --git a/java/com/hmdzl/spspd/change/windows/WndBag.java b/java/com/hmdzl/spspd/change/windows/WndBag.java deleted file mode 100644 index e84bc31e..00000000 --- a/java/com/hmdzl/spspd/change/windows/WndBag.java +++ /dev/null @@ -1,565 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.windows; - -import android.graphics.RectF; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.ShatteredPixelDungeon; -import com.hmdzl.spspd.change.Statistics; -import com.hmdzl.spspd.change.actors.hero.Belongings; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.hero.HeroClass; -import com.hmdzl.spspd.change.items.AdamantArmor; -import com.hmdzl.spspd.change.items.AdamantRing; -import com.hmdzl.spspd.change.items.AdamantWand; -import com.hmdzl.spspd.change.items.AdamantWeapon; -import com.hmdzl.spspd.change.items.EquipableItem; -import com.hmdzl.spspd.change.items.Gold; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.StoneOre; -import com.hmdzl.spspd.change.items.artifacts.Artifact; -import com.hmdzl.spspd.change.items.food.WaterItem; -import com.hmdzl.spspd.change.items.bags.HeartOfScarecrow; -import com.hmdzl.spspd.change.items.nornstone.NornStone; -import com.hmdzl.spspd.change.items.rings.Ring; -import com.hmdzl.spspd.change.items.summon.Honeypot; -import com.hmdzl.spspd.change.items.bombs.BuildBomb; -import com.hmdzl.spspd.change.items.challengelists.ChallengeList; -import com.hmdzl.spspd.change.items.misc.JumpH; -import com.hmdzl.spspd.change.items.misc.JumpM; -import com.hmdzl.spspd.change.items.misc.JumpR; -import com.hmdzl.spspd.change.items.misc.JumpS; -import com.hmdzl.spspd.change.items.misc.JumpW; -import com.hmdzl.spspd.change.items.misc.Jumpshoes; -import com.hmdzl.spspd.change.items.weapon.Weapon; -import com.hmdzl.spspd.change.items.weapon.melee.special.Handcannon; -import com.hmdzl.spspd.change.items.misc.MissileShield; -import com.hmdzl.spspd.change.items.weapon.missiles.ManyKnive; -import com.hmdzl.spspd.change.items.weapon.missiles.TaurcenBow; -import com.hmdzl.spspd.change.items.weapon.spammo.SpAmmo; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.items.armor.Armor; -import com.hmdzl.spspd.change.items.bags.ShoppingCart; -import com.hmdzl.spspd.change.items.bags.Bag; -import com.hmdzl.spspd.change.items.bags.KeyRing; -import com.hmdzl.spspd.change.items.bags.PotionBandolier; -import com.hmdzl.spspd.change.items.bags.ScrollHolder; -import com.hmdzl.spspd.change.items.bags.SeedPouch; -import com.hmdzl.spspd.change.items.bags.WandHolster; -import com.hmdzl.spspd.change.items.food.Food; -import com.hmdzl.spspd.change.items.journalpages.JournalPage; -import com.hmdzl.spspd.change.items.potions.Potion; -import com.hmdzl.spspd.change.items.scrolls.Scroll; -import com.hmdzl.spspd.change.items.wands.Wand; -import com.hmdzl.spspd.change.items.weapon.melee.MeleeWeapon; -import com.hmdzl.spspd.change.items.weapon.missiles.Boomerang; -import com.hmdzl.spspd.change.plants.Plant; -import com.hmdzl.spspd.change.plants.Plant.Seed; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.scenes.PixelScene; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.ui.Icons; -import com.hmdzl.spspd.change.ui.ItemSlot; -import com.hmdzl.spspd.change.ui.QuickSlotButton; - -import com.watabou.gltextures.TextureCache; -import com.watabou.noosa.ColorBlock; -import com.watabou.noosa.RenderedText; -import com.watabou.noosa.Image; -import com.watabou.noosa.audio.Sample; - -import java.util.ArrayList; - -import static com.hmdzl.spspd.change.Dungeon.hero; - -public class WndBag extends WndTabbed { - - public static enum Mode { - ALL, - UNIDENTIFED, - UPGRADEABLE, - QUICKSLOT, - FOR_SALE, - WEAPON, - ARMOR, - ENCHANTABLE, - WAND, - SEED, - FOOD, - POTION, - SCROLL, - EQUIPMENT, - ADAMANT, - REINFORCED, - UPGRADEABLESIMPLE, - NOTREINFORCED, - UPGRADEDEW, - JOURNALPAGES, - SHOES, - COOKING, - CHALLENGELIST, - CANBEMIX, - STONE, - TRANMSUTABLE, - AMMO, - EATABLE; - } - - protected static final int COLS_P = 5; - protected static final int COLS_L = 6; - - //protected static final int SLOT_SIZE = 26; - protected static final int SLOT_SIZE = 24; - protected static final int SLOT_MARGIN = 1; - - protected static final int TITLE_HEIGHT = 12; - - private Listener listener; - private WndBag.Mode mode; - private String title; - - private int nCols; - private int nRows; - - protected int count; - protected int col; - protected int row; - - private static Mode lastMode; - private static Bag lastBag; - - public WndBag(Bag bag, Listener listener, Mode mode, String title) { - - super(); - - this.listener = listener; - this.mode = mode; - this.title = title; - - lastMode = mode; - lastBag = bag; - - nCols = ShatteredPixelDungeon.landscape() ? COLS_L : COLS_P; - nRows = (Belongings.BACKPACK_SIZE + 5 + 1) / nCols - + ((Belongings.BACKPACK_SIZE + 5 + 1) % nCols > 0 ? 1 : 0); - - int slotsWidth = SLOT_SIZE * nCols + SLOT_MARGIN * (nCols - 1); - int slotsHeight = SLOT_SIZE * nRows + SLOT_MARGIN * (nRows - 1); - - RenderedText txtTitle = PixelScene.renderText(title != null ? title - : Messages.titleCase( bag.name() ), 9); - txtTitle.hardlight(TITLE_COLOR); - txtTitle.x = (int) (slotsWidth - txtTitle.width()) / 2; - txtTitle.y = (int) (TITLE_HEIGHT - txtTitle.height()) / 2; - add(txtTitle); - - placeItems(bag); - - resize(slotsWidth, slotsHeight + TITLE_HEIGHT); - - Belongings stuff = hero.belongings; - - ArrayList bags = new ArrayList<>(); - - bags.add( stuff.backpack ); - bags.add( stuff.getItem(SeedPouch.class)); - bags.add( stuff.getItem(ScrollHolder.class)); - bags.add( stuff.getItem(PotionBandolier.class) ); - bags.add( stuff.getItem(WandHolster.class) ); - bags.add( stuff.getItem(KeyRing.class)); - bags.add( stuff.getItem(ShoppingCart.class)); - bags.add( stuff.getItem(HeartOfScarecrow.class)); - - while(bags.remove(null)); - - int tabWidth = ( slotsWidth + 12 ) / bags.size() ; - - for (Bag b : bags) { - BagTab tab = new BagTab( b ); - tab.setSize( tabWidth, tabHeight() ); - add( tab ); - - tab.select( b == bag ); - } - - /*Bag[] bags = { stuff.backpack, stuff.getItem(SeedPouch.class), - stuff.getItem(ScrollHolder.class), - stuff.getItem(PotionBandolier.class), - stuff.getItem(WandHolster.class), - stuff.getItem(KeyRing.class), - stuff.getItem(ShoppingCart.class), - stuff.getItem(HeartOfScarecrow.class)}; - - for (Bag b : bags) { - if (b != null) { - BagTab tab = new BagTab(b); - add(tab); - tab.select(b == bag); - } - } - - layoutTabs();*/ - } - - public static WndBag lastBag(Listener listener, Mode mode, String title) { - - if (mode == lastMode && lastBag != null - && hero.belongings.backpack.contains(lastBag)) { - - return new WndBag(lastBag, listener, mode, title); - - } else { - - return new WndBag(hero.belongings.backpack, listener, mode, - title); - - } - } - - public static WndBag getBag(Class bagClass, - Listener listener, Mode mode, String title) { - Bag bag = hero.belongings.getItem(bagClass); - return bag != null ? new WndBag(bag, listener, mode, title) : lastBag( - listener, mode, title); - } - - protected void placeItems(Bag container) { - - // Equipped items - Belongings stuff = hero.belongings; - placeItem(stuff.weapon != null ? stuff.weapon : new Placeholder( - ItemSpriteSheet.WEAPON_HOLDER)); - placeItem(stuff.armor != null ? stuff.armor : new Placeholder( - ItemSpriteSheet.ARMOR_HOLDER)); - placeItem(stuff.misc1 != null ? stuff.misc1 : new Placeholder( - ItemSpriteSheet.RING_HOLDER)); - placeItem(stuff.misc2 != null ? stuff.misc2 : new Placeholder( - ItemSpriteSheet.RING_HOLDER)); - placeItem(stuff.misc3 != null ? stuff.misc3 : new Placeholder( - ItemSpriteSheet.RING_HOLDER)); - - boolean backpack = (container == hero.belongings.backpack); - if (!backpack) { - count = nCols; - col = 0; - row = 1; - } - - // Items in the bag - for (Item item : container.items) { - placeItem(item); - } - - // Free Space - while (count - (backpack ? 5 : nCols) < container.size) { - placeItem(null); - } - - // Gold - if (container == hero.belongings.backpack) { - row = nRows - 1; - col = nCols - 1; - placeItem(new Gold(Dungeon.gold)); - } - } - - protected void placeItem(final Item item) { - - int x = col * (SLOT_SIZE + SLOT_MARGIN); - int y = TITLE_HEIGHT + row * (SLOT_SIZE + SLOT_MARGIN); - - add(new ItemButton(item).setPos(x, y)); - - if (++col >= nCols) { - col = 0; - row++; - } - - count++; - } - - @Override - public void onMenuPressed() { - if (listener == null) { - hide(); - } - } - - @Override - public void onBackPressed() { - if (listener != null) { - listener.onSelect(null); - } - super.onBackPressed(); - } - - @Override - protected void onClick(Tab tab) { - hide(); - GameScene.show(new WndBag(((BagTab) tab).bag, listener, mode, title)); - } - - @Override - protected int tabHeight() { - //return 20; - return 24; - } - - private class BagTab extends Tab { - - private Image icon; - - private Bag bag; - - public BagTab(Bag bag) { - super(); - - this.bag = bag; - - icon = icon(); - add(icon); - } - - @Override - protected void select(boolean value) { - super.select(value); - icon.am = selected ? 1.0f : 0.6f; - } - - @Override - protected void layout() { - super.layout(); - - icon.copy(icon()); - icon.x = x + (width - icon.width) / 2; - icon.y = y + (height - icon.height) / 2 - 2 - (selected ? 0 : 1); - if (!selected && icon.y < y + CUT) { - RectF frame = icon.frame(); - frame.top += (y + CUT - icon.y) / icon.texture.height; - icon.frame(frame); - icon.y = y + CUT; - } - } - - private Image icon() { - if (bag instanceof SeedPouch) { - return Icons.get(Icons.SEED_POUCH); - } else if (bag instanceof ScrollHolder) { - return Icons.get(Icons.SCROLL_HOLDER); - } else if (bag instanceof WandHolster) { - return Icons.get(Icons.WAND_HOLSTER); - } else if (bag instanceof PotionBandolier) { - return Icons.get(Icons.POTION_BANDOLIER); - } else if (bag instanceof ShoppingCart) { - return Icons.get(Icons.SHOP_CART); - } else if (bag instanceof KeyRing) { - return Icons.get(Icons.KEYRING); - } else if (bag instanceof HeartOfScarecrow) { - return Icons.get(Icons.HOS); - } else { - return Icons.get(Icons.BACKPACK); - } - } - } - - public static class Placeholder extends Item { - { - name = null; - } - - public Placeholder(int image) { - this.image = image; - } - - @Override - public boolean isIdentified() { - return true; - } - - @Override - public boolean isEquipped(Hero hero) { - return true; - } - } - - private class ItemButton extends ItemSlot { - - private static final int NORMAL = 0xFF4A4D44; - private static final int EQUIPPED = 0xFF63665B; - - private Item item; - private ColorBlock bg; - - public ItemButton(Item item) { - - super(item); - - this.item = item; - if (item instanceof Gold) { - bg.visible = false; - } - - width = height = SLOT_SIZE; - } - - @Override - protected void createChildren() { - bg = new ColorBlock(SLOT_SIZE, SLOT_SIZE, NORMAL); - add(bg); - - super.createChildren(); - } - - @Override - protected void layout() { - bg.x = x; - bg.y = y; - - super.layout(); - } - - @Override - public void item(Item item) { - - super.item(item); - if (item != null) { - - bg.texture(TextureCache.createSolid(item - .isEquipped(hero) ? EQUIPPED : NORMAL)); - if (item.cursed && item.cursedKnown) { - bg.ra = +0.2f; - bg.ga = -0.1f; - } else if (!item.isIdentified()) { - bg.ra = 0.1f; - bg.ba = 0.1f; - } - - if (item.name() == null) { - enable(false); - } else { - - int levelLimit = Math.max(2, 2+Math.round(Statistics.deepestFloor/3)); - if (hero.heroClass == HeroClass.MAGE){levelLimit++;} - - enable( - mode == Mode.FOR_SALE - && (item.price() > 0) && (!item.isEquipped(hero) || !item.cursed) - || mode == Mode.UPGRADEABLE - && ((item.isUpgradable() && item.level<15 && !item.isReinforced()) || item.isUpgradable() && item.isReinforced()) - || mode == Mode.UPGRADEDEW - && (item.isUpgradable() && item.level < levelLimit) - || mode == Mode.UPGRADEABLESIMPLE - && item.isUpgradable() - || mode == Mode.ADAMANT - && (item instanceof AdamantArmor || item instanceof AdamantRing || item instanceof AdamantWand || item instanceof AdamantWeapon) - || mode == Mode.REINFORCED - && item.isReinforced() - || mode == Mode.NOTREINFORCED - && (!item.isReinforced() && item.isUpgradable()) - || mode == Mode.UNIDENTIFED - && !item.isIdentified() - || mode == Mode.QUICKSLOT - && (item.defaultAction != null) - || mode == Mode.WEAPON - && ((item instanceof MeleeWeapon || item instanceof Boomerang)&& !(item instanceof Handcannon)) - || mode == Mode.ARMOR - && (item instanceof Armor) - || mode == Mode.ENCHANTABLE - && (item instanceof MeleeWeapon || item instanceof Boomerang || item instanceof Armor || item instanceof ManyKnive || item instanceof TaurcenBow) - - || mode == Mode.JOURNALPAGES - && (item instanceof JournalPage) - || mode == Mode.SHOES - && (item instanceof JumpW || item instanceof JumpM || item instanceof JumpR || item instanceof JumpH || item instanceof JumpS || item instanceof Jumpshoes) - || mode == Mode.WAND - && (item instanceof Wand) - || mode == Mode.SEED - && (item instanceof Seed) - || mode == Mode.FOOD - && (item instanceof Food) - || mode == Mode.POTION - && (item instanceof Potion) - || mode == Mode.SCROLL - && (item instanceof Scroll) - || mode == Mode.EQUIPMENT - && (item instanceof EquipableItem) - || mode == Mode.COOKING - && (item instanceof Food ||item instanceof Plant.Seed ||item instanceof WaterItem ||item instanceof StoneOre || item instanceof Honeypot || item instanceof Honeypot.ShatteredPot || item instanceof Potion || item instanceof Scroll || item instanceof BuildBomb) - || mode == Mode.CHALLENGELIST - && (item instanceof ChallengeList) - || mode == Mode.CANBEMIX - && ( !item.isEquipped(hero) && (item instanceof Ring || item instanceof Wand)) - || mode == Mode.STONE - && ( item instanceof NornStone || item instanceof StoneOre) - || mode == Mode.TRANMSUTABLE - && (!item.isEquipped(hero) && ( item instanceof MeleeWeapon || item instanceof Ring || item instanceof Wand || item instanceof Artifact || item instanceof Armor )) - || mode == Mode.AMMO - && (item instanceof SpAmmo) - || mode == Mode.EATABLE - && (!item.isEquipped(hero) && (item instanceof MeleeWeapon || item instanceof Ring || item instanceof Wand || item instanceof Armor)) - || mode == Mode.ALL); - } - } else { - bg.color(NORMAL); - } - } - - @Override - protected void onTouchDown() { - bg.brightness(1.5f); - Sample.INSTANCE.play(Assets.SND_CLICK, 0.7f, 0.7f, 1.2f); - }; - - @Override - protected void onTouchUp() { - bg.brightness(1.0f); - }; - - @Override - protected void onClick() { - if (listener != null) { - - hide(); - listener.onSelect(item); - - } else { - - WndBag.this.add(new WndItem(WndBag.this, item)); - - } - } - - @Override - protected boolean onLongClick() { - if (listener == null && item.defaultAction != null) { - hide(); - Dungeon.quickslot.setSlot(0, item); - QuickSlotButton.refresh(); - return true; - } else { - return false; - } - } - } - - public interface Listener { - void onSelect(Item item); - } -} diff --git a/java/com/hmdzl/spspd/change/windows/WndBlacksmith.java b/java/com/hmdzl/spspd/change/windows/WndBlacksmith.java deleted file mode 100644 index fec11230..00000000 --- a/java/com/hmdzl/spspd/change/windows/WndBlacksmith.java +++ /dev/null @@ -1,173 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.windows; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Chrome; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.mobs.npcs.Blacksmith; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.scenes.PixelScene; -import com.hmdzl.spspd.change.ui.ItemSlot; -import com.hmdzl.spspd.change.ui.RedButton; -import com.hmdzl.spspd.change.ui.Window; - -import com.hmdzl.spspd.change.ui.RenderedTextMultiline; -import com.watabou.noosa.NinePatch; -import com.watabou.noosa.audio.Sample; -import com.watabou.noosa.ui.Component; - -public class WndBlacksmith extends Window { - - private static final int BTN_SIZE = 36; - private static final float GAP = 2; - private static final float BTN_GAP = 10; - private static final int WIDTH = 116; - - private ItemButton btnPressed; - - private ItemButton btnItem1; - private ItemButton btnItem2; - private RedButton btnReforge; - - public WndBlacksmith(Blacksmith troll, Hero hero) { - - super(); - - IconTitle titlebar = new IconTitle(); - titlebar.icon(troll.sprite()); - titlebar.label(Messages.titleCase( troll.name )); - titlebar.setRect(0, 0, WIDTH, 0); - add(titlebar); - - RenderedTextMultiline message = PixelScene.renderMultiline( Messages.get(WndBlacksmith.class, "prompt"), 6 ); - message.maxWidth( WIDTH); - message.setPos(0, titlebar.bottom() + GAP); - add( message ); - - btnItem1 = new ItemButton() { - @Override - protected void onClick() { - btnPressed = btnItem1; - GameScene.selectItem( itemSelector, WndBag.Mode.UPGRADEABLESIMPLE, Messages.get(WndBlacksmith.class, "select1") ); - } - }; - btnItem1.setRect( (WIDTH - BTN_GAP) / 2 - BTN_SIZE, message.top() + message.height() + BTN_GAP, BTN_SIZE, BTN_SIZE ); - add( btnItem1 ); - - btnItem2 = new ItemButton() { - @Override - protected void onClick() { - btnPressed = btnItem2; - GameScene.selectItem(itemSelector, WndBag.Mode.UPGRADEABLESIMPLE, - Messages.get(WndBlacksmith.class,"select2")); - } - }; - btnItem2.setRect(btnItem1.right() + BTN_GAP, btnItem1.top(), BTN_SIZE, - BTN_SIZE); - add(btnItem2); - - btnReforge = new RedButton(Messages.get(WndBlacksmith.class,"reforge")) { - @Override - protected void onClick() { - Blacksmith.upgrade(btnItem1.item, btnItem2.item); - hide(); - } - }; - btnReforge.enable(false); - btnReforge.setRect(0, btnItem1.bottom() + BTN_GAP, WIDTH, 20); - add(btnReforge); - - resize(WIDTH, (int) btnReforge.bottom()); - } - - protected WndBag.Listener itemSelector = new WndBag.Listener() { - @Override - public void onSelect(Item item) { - if (item != null) { - btnPressed.item(item); - - if (btnItem1.item != null && btnItem2.item != null) { - String result = Blacksmith.verify(btnItem1.item, - btnItem2.item); - if (result != null) { - GameScene.show(new WndMessage(result)); - btnReforge.enable(false); - } else { - btnReforge.enable(true); - } - } - } - } - }; - - public static class ItemButton extends Component { - - protected NinePatch bg; - protected ItemSlot slot; - - public Item item = null; - - @Override - protected void createChildren() { - super.createChildren(); - - bg = Chrome.get(Chrome.Type.BUTTON); - add(bg); - - slot = new ItemSlot() { - @Override - protected void onTouchDown() { - bg.brightness(1.2f); - Sample.INSTANCE.play(Assets.SND_CLICK); - } - - @Override - protected void onTouchUp() { - bg.resetColor(); - } - - @Override - protected void onClick() { - ItemButton.this.onClick(); - } - }; - add(slot); - } - - protected void onClick() { - } - - @Override - protected void layout() { - super.layout(); - - bg.x = x; - bg.y = y; - bg.size(width, height); - - slot.setRect(x + 2, y + 2, width - 4, height - 4); - } - - public void item(Item item) { - slot.item(this.item = item); - } - } -} diff --git a/java/com/hmdzl/spspd/change/windows/WndBlacksmith2.java b/java/com/hmdzl/spspd/change/windows/WndBlacksmith2.java deleted file mode 100644 index 5d3b8700..00000000 --- a/java/com/hmdzl/spspd/change/windows/WndBlacksmith2.java +++ /dev/null @@ -1,186 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.windows; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Chrome; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.mobs.npcs.Blacksmith2; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.scenes.PixelScene; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.ui.ItemSlot; -import com.hmdzl.spspd.change.ui.RedButton; -import com.hmdzl.spspd.change.ui.RenderedTextMultiline; -import com.hmdzl.spspd.change.ui.Window; - -import com.watabou.noosa.NinePatch; -import com.watabou.noosa.audio.Sample; -import com.watabou.noosa.ui.Component; - -public class WndBlacksmith2 extends Window { - - private static final int BTN_SIZE = 36; - private static final float GAP = 2; - private static final float BTN_GAP = 10; - private static final int WIDTH = 116; - - private ItemButton btnPressed; - - private ItemButton btnItem1; - private ItemButton btnItem2; - private RedButton btnReforge; - - private static final String TXT_PROMPT = "Listen up, here's what I can do. " - +"I can reinforce an item with adamantite. " - +"Reinforced items can be upgraded to extreme levels. " - +"You have to have the right kind of adamantite and it'll cost you some dark gold. "; - - private static final String TXT_SELECT1 = "Select an item to reinforce."; - private static final String TXT_SELECT2 = "Select your adamantite."; - private static final String TXT_REFORGE = "Reforge them"; - private static final String TXT_WORK = "Great! Let's reinforce it!"; - - public WndBlacksmith2(Blacksmith2 troll, Hero hero) { - - super(); - - IconTitle titlebar = new IconTitle(); - titlebar.icon(troll.sprite()); - titlebar.label(Messages.titleCase( troll.name )); - titlebar.setRect(0, 0, WIDTH, 0); - add(titlebar); - - RenderedTextMultiline message = PixelScene.renderMultiline(Messages.get(WndBlacksmith2.class, "prompt"), 6); - message.maxWidth(WIDTH); - message.setPos(0, titlebar.bottom() + GAP); - add(message); - - btnItem1 = new ItemButton() { - @Override - protected void onClick() { - btnPressed = btnItem1; - GameScene.selectItem(itemSelector, WndBag.Mode.NOTREINFORCED, - Messages.get(WndBlacksmith2.class, "select1")); - } - }; - btnItem1.setRect((WIDTH - BTN_GAP) / 2 - BTN_SIZE, - message.top() + message.height() + BTN_GAP, BTN_SIZE, BTN_SIZE); - add(btnItem1); - - btnItem2 = new ItemButton() { - @Override - protected void onClick() { - btnPressed = btnItem2; - GameScene.selectItem(itemSelector, WndBag.Mode.ADAMANT, - Messages.get(WndBlacksmith2.class,"select2")); - } - }; - btnItem2.setRect(btnItem1.right() + BTN_GAP, btnItem1.top(), BTN_SIZE, - BTN_SIZE); - add(btnItem2); - - btnReforge = new RedButton(Messages.get(WndBlacksmith2.class,"reforge")) { - @Override - protected void onClick() { - Blacksmith2.upgrade(btnItem1.item, btnItem2.item); - hide(); - } - }; - btnReforge.enable(false); - btnReforge.setRect(0, btnItem1.bottom() + BTN_GAP, WIDTH, 20); - add(btnReforge); - - resize(WIDTH, (int) btnReforge.bottom()); - } - - protected WndBag.Listener itemSelector = new WndBag.Listener() { - @Override - public void onSelect(Item item) { - if (item != null) { - btnPressed.item(item); - - if (btnItem1.item != null && btnItem2.item != null) { - String result = Blacksmith2.verify(btnItem1.item, - btnItem2.item); - if (result != null) { - GameScene.show(new WndMessage(result)); - btnReforge.enable(false); - } else { - btnReforge.enable(true); - GameScene.show(new WndMessage(Messages.get(WndBlacksmith2.class,"success"))); - } - } - } - } - }; - - public static class ItemButton extends Component { - - protected NinePatch bg; - protected ItemSlot slot; - - public Item item = null; - - @Override - protected void createChildren() { - super.createChildren(); - - bg = Chrome.get(Chrome.Type.BUTTON); - add(bg); - - slot = new ItemSlot() { - @Override - protected void onTouchDown() { - bg.brightness(1.2f); - Sample.INSTANCE.play(Assets.SND_CLICK); - } - - @Override - protected void onTouchUp() { - bg.resetColor(); - } - - @Override - protected void onClick() { - ItemButton.this.onClick(); - } - }; - add(slot); - } - - protected void onClick() { - } - - @Override - protected void layout() { - super.layout(); - - bg.x = x; - bg.y = y; - bg.size(width, height); - - slot.setRect(x + 2, y + 2, width - 4, height - 4); - } - - public void item(Item item) { - slot.item(this.item = item); - } - } -} diff --git a/java/com/hmdzl/spspd/change/windows/WndCatalogus.java b/java/com/hmdzl/spspd/change/windows/WndCatalogus.java deleted file mode 100644 index 0d604a2c..00000000 --- a/java/com/hmdzl/spspd/change/windows/WndCatalogus.java +++ /dev/null @@ -1,203 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.windows; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.ShatteredPixelDungeon; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.potions.Potion; -import com.hmdzl.spspd.change.items.scrolls.Scroll; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.scenes.PixelScene; -import com.hmdzl.spspd.change.sprites.ItemSprite; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.ui.ScrollPane; -import com.hmdzl.spspd.change.ui.Window; - -import com.watabou.noosa.BitmapText; -import com.watabou.noosa.RenderedText; -import com.watabou.noosa.ui.Component; - -public class WndCatalogus extends WndTabbed { - - private static final int WIDTH_P = 112; - private static final int HEIGHT_P = 160; - - private static final int WIDTH_L = 128; - private static final int HEIGHT_L = 128; - - private static final int ITEM_HEIGHT = 18; - - private static final int TAB_WIDTH = 50; - - private static final String TXT_POTIONS = "Potions"; - private static final String TXT_SCROLLS = "Scrolls"; - private static final String TXT_TITLE = "Catalogus"; - - private RenderedText txtTitle; - private ScrollPane list; - - private ArrayList items = new ArrayList(); - - private static boolean showPotions = true; - - public WndCatalogus() { - - super(); - - if (ShatteredPixelDungeon.landscape()) { - resize(WIDTH_L, HEIGHT_L); - } else { - resize(WIDTH_P, HEIGHT_P); - } - - txtTitle = PixelScene.renderText(Messages.get(this, "title"), 9); - txtTitle.hardlight(Window.TITLE_COLOR); - //txtTitle.measure(); - add(txtTitle); - - list = new ScrollPane(new Component()) { - @Override - public void onClick(float x, float y) { - int size = items.size(); - for (int i = 0; i < size; i++) { - if (items.get(i).onClick(x, y)) { - break; - } - } - } - }; - add(list); - list.setRect(0, txtTitle.height(), width, height - txtTitle.height()); - - boolean showPotions = WndCatalogus.showPotions; - Tab[] tabs = { new LabeledTab(Messages.get(this, "potions")) { - @Override - protected void select(boolean value) { - super.select(value); - WndCatalogus.showPotions = value; - updateList(); - }; - }, new LabeledTab(Messages.get(this, "scrolls")) { - @Override - protected void select(boolean value) { - super.select(value); - WndCatalogus.showPotions = !value; - updateList(); - }; - } }; - for (Tab tab : tabs) { - add(tab); - } - - layoutTabs(); - - select(showPotions ? 0 : 1); - } - - private void updateList() { - - txtTitle.text(Messages.get(this, "title", showPotions ? Messages.get(this, "potions") : Messages.get(this, "scrolls") )); - //txtTitle.measure(); - txtTitle.x = PixelScene.align(PixelScene.uiCamera, - (width - txtTitle.width()) / 2); - - items.clear(); - - Component content = list.content(); - content.clear(); - list.scrollTo(0, 0); - - float pos = 0; - for (Class itemClass : showPotions ? Potion.getKnown() - : Scroll.getKnown()) { - ListItem item = new ListItem(itemClass); - item.setRect(0, pos, width, ITEM_HEIGHT); - content.add(item); - items.add(item); - - pos += item.height(); - } - - for (Class itemClass : showPotions ? Potion - .getUnknown() : Scroll.getUnknown()) { - ListItem item = new ListItem(itemClass); - item.setRect(0, pos, width, ITEM_HEIGHT); - content.add(item); - items.add(item); - - pos += item.height(); - } - - content.setSize(width, pos); - } - - private static class ListItem extends Component { - - private Item item; - private boolean identified; - - private ItemSprite sprite; - private RenderedText label; - - public ListItem(Class cl) { - super(); - - try { - item = cl.newInstance(); - if (identified = item.isIdentified()) { - sprite.view(item.image(), null); - label.text(item.name()); - } else { - sprite.view(127, null); - label.text(item.trueName()); - label.hardlight(0xCCCCCC); - } - } catch (Exception e) { - // Do nothing - } - } - - @Override - protected void createChildren() { - sprite = new ItemSprite(); - add(sprite); - - label = PixelScene.renderText(8); - add(label); - } - - @Override - protected void layout() { - sprite.y = PixelScene.align(y + (height - sprite.height) / 2); - - label.x = sprite.x + sprite.width; - label.y = PixelScene.align(y + (height - label.baseLine()) / 2); - } - - public boolean onClick(float x, float y) { - if (identified && inside(x, y)) { - GameScene.show(new WndInfoItem(item)); - return true; - } else { - return false; - } - } - } -} diff --git a/java/com/hmdzl/spspd/change/windows/WndChallengeBook.java b/java/com/hmdzl/spspd/change/windows/WndChallengeBook.java deleted file mode 100644 index 4cbf0265..00000000 --- a/java/com/hmdzl/spspd/change/windows/WndChallengeBook.java +++ /dev/null @@ -1,137 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.windows; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.items.ChallengeBook; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.items.artifacts.TimekeepersHourglass; -import com.hmdzl.spspd.change.scenes.InterlevelScene; -import com.hmdzl.spspd.change.scenes.PixelScene; -import com.hmdzl.spspd.change.sprites.ItemSprite; -import com.hmdzl.spspd.change.ui.RedButton; -import com.hmdzl.spspd.change.ui.Window; - -import com.watabou.noosa.Game; -import com.hmdzl.spspd.change.ui.RenderedTextMultiline; - -public class WndChallengeBook extends Window { - - - - private static final String TXT_FARAWELL = Messages.get(WndChallengeBook.class,"title"); - public static final float TIME_TO_USE = 1; - - - private static final int PAGES = 10; - private static final int WIDTH = 120; - private static final int BTN_HEIGHT = 20; - private static final float GAP = 2; - - public WndChallengeBook(final boolean[] rooms, final ChallengeBook item) { - - super(); - - String[] roomNames = new String[PAGES]; - roomNames[0] = Messages.get(this,"room0"); - roomNames[1] = Messages.get(this,"room1"); - roomNames[2] = Messages.get(this,"room2"); - roomNames[3] = Messages.get(this,"room3"); - roomNames[4] = Messages.get(this,"room4"); - roomNames[5] = Messages.get(this,"room5"); - roomNames[6] = Messages.get(this,"room6"); - roomNames[7] = Messages.get(this,"room7"); - - IconTitle titlebar = new IconTitle(); - titlebar.icon(new ItemSprite(item.image(), null)); - titlebar.label(Messages.titleCase(item.name())); - titlebar.setRect(0, 0, WIDTH, 0); - add(titlebar); - - RenderedTextMultiline message = PixelScene.renderMultiline(TXT_FARAWELL, 6); - message.maxWidth(WIDTH); - message.setPos(0,titlebar.bottom() + GAP); - add(message); - - //add each button - //after n*BTN_HEIGHT+GAP - //add port function - - if (rooms[0]){ - RedButton btn1 = new RedButton(roomNames[0]) { - @Override - protected void onClick() { - item.returnDepth = Dungeon.depth; - item.returnPos = Dungeon.hero.pos; - port(0, item.firsts[0]); - item.firsts[0]=false; - } - }; - btn1.setRect(0, message.top() + message.height() + GAP, WIDTH, BTN_HEIGHT); - add(btn1); - resize(WIDTH, (int) btn1.bottom()); - } - - int buttons=1; - - for (int i=1; i - */ -package com.hmdzl.spspd.change.windows; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Challenges; -import com.hmdzl.spspd.change.ShatteredPixelDungeon; -import com.hmdzl.spspd.change.scenes.PixelScene; -import com.hmdzl.spspd.change.ui.CheckBox; -import com.hmdzl.spspd.change.ui.IconButton; -import com.hmdzl.spspd.change.ui.Icons; -import com.hmdzl.spspd.change.ui.Window; -import com.watabou.noosa.BitmapText; -import com.hmdzl.spspd.change.messages.Messages; -import com.watabou.noosa.RenderedText; - -public class WndChallenges extends Window { - - private static final int WIDTH = 108; - private static final int TTL_HEIGHT = 12; - private static final int BTN_HEIGHT = 18; - private static final int GAP = 1; - - private boolean editable; - private ArrayList boxes; - - public WndChallenges( int checked, boolean editable ) { - - super(); - - this.editable = editable; - - RenderedText title = PixelScene.renderText( Messages.get(this, "title"), 9 ); - title.hardlight( TITLE_COLOR ); - title.x = (WIDTH - title.width()) / 2; - title.y = (TTL_HEIGHT - title.height()) / 2; - PixelScene.align(title); - add( title ); - - boxes = new ArrayList<>(); - - float pos = TTL_HEIGHT; - for (int i=0; i < Challenges.NAME_IDS.length; i++) { - - final String challenge = Challenges.NAME_IDS[i]; - - CheckBox cb = new CheckBox( Messages.get(Challenges.class, challenge) ); - cb.checked( (checked & Challenges.MASKS[i]) != 0 ); - cb.active = editable; - - if (i > 0) { - pos += GAP; - } - cb.setRect( 0, pos, WIDTH-16, BTN_HEIGHT ); - - add( cb ); - boxes.add( cb ); - - IconButton info = new IconButton(Icons.get(Icons.INFO)){ - @Override - protected void onClick() { - super.onClick(); - ShatteredPixelDungeon.scene().add( - new WndMessage(Messages.get(Challenges.class, challenge+"_desc")) - ); - } - }; - info.setRect(cb.right(), pos, 16, BTN_HEIGHT); - add(info); - - pos = cb.bottom(); - - - } - - resize( WIDTH, (int)pos ); - } - - @Override - public void onBackPressed() { - - if (editable) { - int value = 0; - for (int i=0; i < boxes.size(); i++) { - if (boxes.get( i ).checked()) { - value |= Challenges.MASKS[i]; - } - } - ShatteredPixelDungeon.challenges( value ); - } - - super.onBackPressed(); - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/windows/WndChooseWay.java b/java/com/hmdzl/spspd/change/windows/WndChooseWay.java deleted file mode 100644 index d9280a79..00000000 --- a/java/com/hmdzl/spspd/change/windows/WndChooseWay.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.windows; - -import com.hmdzl.spspd.change.actors.hero.HeroSubClass; -import com.hmdzl.spspd.change.items.TomeOfMastery; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.PixelScene; -import com.hmdzl.spspd.change.sprites.ItemSprite; -import com.hmdzl.spspd.change.ui.RedButton; -import com.hmdzl.spspd.change.ui.Window; - -import com.hmdzl.spspd.change.ui.RenderedTextMultiline; - -public class WndChooseWay extends Window { - - private static final String TXT_MESSAGE = "Which way will you follow?"; - private static final String TXT_CANCEL = "I'll decide later"; - - private static final int WIDTH = 120; - private static final int BTN_HEIGHT = 18; - private static final float GAP = 2; - - public WndChooseWay(final TomeOfMastery tome, final HeroSubClass way1, - final HeroSubClass way2) { - - super(); - - IconTitle titlebar = new IconTitle(); - titlebar.icon(new ItemSprite(tome.image(), null)); - titlebar.label(tome.name()); - titlebar.setRect(0, 0, WIDTH, 0); - add(titlebar); - - RenderedTextMultiline hl = PixelScene.renderMultiline( 6 ); - hl.text( way1.desc() + "\n\n" + way2.desc() + "\n\n" + Messages.get(this, "message"), WIDTH ); - hl.setPos( titlebar.left(), titlebar.bottom() + GAP ); - add( hl ); - - RedButton btnWay1 = new RedButton(way1.title().toUpperCase()) { - @Override - protected void onClick() { - hide(); - tome.choose(way1); - } - }; - btnWay1.setRect( 0, hl.bottom() + GAP, (WIDTH - GAP) / 2, BTN_HEIGHT ); - add( btnWay1 ); - - RedButton btnWay2 = new RedButton(way2.title().toUpperCase()) { - @Override - protected void onClick() { - hide(); - tome.choose(way2); - } - }; - btnWay2.setRect(btnWay1.right() + GAP, btnWay1.top(), btnWay1.width(), - BTN_HEIGHT); - add(btnWay2); - - RedButton btnCancel = new RedButton(Messages.get(this, "cancel")) { - @Override - protected void onClick() { - hide(); - } - }; - btnCancel.setRect(0, btnWay2.bottom() + GAP, WIDTH, BTN_HEIGHT); - add(btnCancel); - - resize(WIDTH, (int) btnCancel.bottom()); - } -} diff --git a/java/com/hmdzl/spspd/change/windows/WndClass.java b/java/com/hmdzl/spspd/change/windows/WndClass.java deleted file mode 100644 index 27e030dd..00000000 --- a/java/com/hmdzl/spspd/change/windows/WndClass.java +++ /dev/null @@ -1,182 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * Shattered Pixel Dungeon - * Copyright (C) 2014-2016 Evan Debenham - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.windows; - -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.actors.hero.HeroClass; -import com.hmdzl.spspd.change.actors.hero.HeroSubClass; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.PixelScene; -import com.hmdzl.spspd.change.ui.RenderedTextMultiline; -import com.watabou.noosa.BitmapText; -import com.watabou.noosa.Group; - -public class WndClass extends WndTabbed { - - private static final int WIDTH = 110; - - private static final int TAB_WIDTH = 50; - - private HeroClass cl; - - private PerksTab tabPerks; - private MasteryTab tabMastery; - - public WndClass( HeroClass cl ) { - - super(); - - this.cl = cl; - - tabPerks = new PerksTab(); - add( tabPerks ); - - Tab tab = new RankingTab( cl.title().toUpperCase(), tabPerks ); - tab.setSize( TAB_WIDTH, tabHeight() ); - add( tab ); - - tabMastery = new MasteryTab(); - add( tabMastery ); - - tab = new RankingTab( Messages.get(this, "mastery"), tabMastery ); - add( tab ); - - resize( - (int)Math.max( tabPerks.width, tabMastery.width ), - (int)Math.max( tabPerks.height, tabMastery.height ) ); - - - layoutTabs(); - - select( 0 ); - } - - private class RankingTab extends LabeledTab { - - private Group page; - - public RankingTab( String label, Group page ) { - super( label ); - this.page = page; - } - - @Override - protected void select( boolean value ) { - super.select( value ); - if (page != null) { - page.visible = page.active = selected; - } - } - } - - private class PerksTab extends Group { - - private static final int MARGIN = 4; - private static final int GAP = 4; - - public float height; - public float width; - - public PerksTab() { - super(); - - float dotWidth = 0; - - String[] items = cl.perks(); - float pos = MARGIN; - - for (int i=0; i < items.length; i++) { - - if (i > 0) { - pos += GAP; - } - - BitmapText dot = PixelScene.createText( "-", 6 ); - dot.x = MARGIN; - dot.y = pos; - if (dotWidth == 0) { - dot.measure(); - dotWidth = dot.width(); - } - add( dot ); - - RenderedTextMultiline item = PixelScene.renderMultiline( items[i], 6 ); - item.maxWidth((int)(WIDTH - MARGIN * 2 - dotWidth)); - item.setPos(dot.x + dotWidth, pos); - add( item ); - - pos += item.height(); - float w = item.width(); - if (w > width) { - width = w; - } - } - - width += MARGIN + dotWidth; - height = pos + MARGIN; - } - } - - private class MasteryTab extends Group { - - private static final int MARGIN = 4; - - public float height; - public float width; - - public MasteryTab() { - super(); - - String message = null; - switch (cl) { - case WARRIOR: - message = HeroSubClass.GLADIATOR.desc() + "\n\n" + HeroSubClass.BERSERKER.desc(); - break; - case MAGE: - message = HeroSubClass.BATTLEMAGE.desc() + "\n\n" + HeroSubClass.WARLOCK.desc(); - break; - case ROGUE: - message = HeroSubClass.FREERUNNER.desc() + "\n\n" + HeroSubClass.ASSASSIN.desc(); - break; - case HUNTRESS: - message = HeroSubClass.SNIPER.desc() + "\n\n" + HeroSubClass.WARDEN.desc(); - break; - case PERFORMER: - message = HeroSubClass.SUPERSTAR.desc() + "\n\n" + HeroSubClass.JOKER.desc(); - break; - case SOLDIER: - message = HeroSubClass.AGENT.desc() + "\n\n" + HeroSubClass.LEADER.desc(); - break; - case FOLLOWER: - message = HeroSubClass.PASTOR.desc() + "\n\n" + HeroSubClass.ARTISAN.desc(); - break; - } - - RenderedTextMultiline text = PixelScene.renderMultiline( 6 ); - text.text( message, WIDTH - MARGIN * 2 ); - text.setPos( MARGIN, MARGIN ); - add( text ); - - height = text.bottom() + MARGIN; - width = text.right() + MARGIN; - } - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/windows/WndDescend.java b/java/com/hmdzl/spspd/change/windows/WndDescend.java deleted file mode 100644 index 772ce9e7..00000000 --- a/java/com/hmdzl/spspd/change/windows/WndDescend.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.windows; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.items.DewVial; -import com.hmdzl.spspd.change.scenes.PixelScene; -import com.hmdzl.spspd.change.sprites.ItemSprite; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.ui.RedButton; -import com.hmdzl.spspd.change.ui.RenderedTextMultiline; -import com.hmdzl.spspd.change.ui.Window; - - -public class WndDescend extends Window { - - private static final String TXT_MESSAGE = "Are you sure you want to descend? " - +"Any dew on this level will evaporate and your dew charge might be wasted. " - +"If you have not cleared the level, you will forfeit any additional dew charge for the next level. " - +"If you really want to descend click the button below then try the stairs again. "; - private static final String TXT_REWARD = "Descend"; - - private static final int WIDTH = 120; - private static final int BTN_HEIGHT = 20; - private static final int GAP = 2; - - public WndDescend() { - - super(); - - DewVial dewvial = new DewVial(); - - IconTitle titlebar = new IconTitle(); - titlebar.icon(new ItemSprite(dewvial.image(), null)); - titlebar.label(Messages.titleCase(dewvial.name())); - titlebar.setRect(0, 0, WIDTH, 0); - add(titlebar); - - RenderedTextMultiline message = PixelScene - .renderMultiline(Messages.get(this,"message"), 6); - message.maxWidth(WIDTH); - message.setPos(0, titlebar.bottom() + GAP); - add(message); - - RedButton btnReward = new RedButton(Messages.get(this,"reward")) { - @Override - protected void onClick() { - Dungeon.level.forcedone=true; - hide(); - } - }; - btnReward.setRect(0, message.top() + message.height() + GAP, WIDTH, - BTN_HEIGHT); - add(btnReward); - - resize(WIDTH, (int) btnReward.bottom()); - } - - -} diff --git a/java/com/hmdzl/spspd/change/windows/WndDewDrawInfo.java b/java/com/hmdzl/spspd/change/windows/WndDewDrawInfo.java deleted file mode 100644 index 1774edff..00000000 --- a/java/com/hmdzl/spspd/change/windows/WndDewDrawInfo.java +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.windows; - -import com.hmdzl.spspd.change.items.DewVial; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.scenes.PixelScene; -import com.hmdzl.spspd.change.sprites.ItemSprite; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.ui.RedButton; -import com.hmdzl.spspd.change.ui.RenderedTextMultiline; -import com.hmdzl.spspd.change.ui.Window; - - -public class WndDewDrawInfo extends Window { - - //if people don't get it after this, I quit. I just quit. - - private static final String TXT_MESSAGE = "Drawing out dew makes it so that mobs on special levels drop dew to fill your vial. " - +"Additionally, your character is buffed with dew charge at the start of each normal level. " - +"As long as you are dew charged, enemies drop dew to fill your vial. "; - - private static final String TXT_MESSAGE2 = "Each level dew charges you for a set amount of moves. " - +"Each level also has a move goal for killing all regular generated enemies. (Not special enemies like statues and piranha) " - +"Killing all regular enemies that were generated with the level clears that level. "; - - private static final String TXT_MESSAGE3 = "If you clear a level in less moves than the goal, the additional moves are added to your dew charge for the next level. " - +"You will need to clear the levels as fast as you can to get dew upgrades. "; - - private static final String TXT_MESSAGE4 = "The dew vial will also allow you to choose which item you apply upgrades to when blessing. "; - - private static final String TXT_WATER = "Okay! Thanks for that!"; - - - private static final int WIDTH = 120; - private static final int BTN_HEIGHT = 20; - private static final float GAP = 2; - - public WndDewDrawInfo(final Item item) { - - super(); - - Item dewvial = new DewVial(); - - IconTitle titlebar = new IconTitle(); - titlebar.icon(new ItemSprite(dewvial.image(), null)); - titlebar.label(Messages.titleCase(dewvial.name())); - titlebar.setRect(0, 0, WIDTH, 0); - add(titlebar); - - RenderedTextMultiline message = PixelScene.renderMultiline(Messages.get(this, "info1"), 6); - message.maxWidth(WIDTH); - message.setPos(0,titlebar.bottom() + GAP); - add(message); - - RenderedTextMultiline message2 = PixelScene.renderMultiline(Messages.get(this, "info2"), 6); - message2.maxWidth(WIDTH); - message2.setPos(0,message.top() + message.height() + GAP); - add(message2); - - RenderedTextMultiline message3 = PixelScene.renderMultiline(Messages.get(this, "info3"), 6); - message3.maxWidth(WIDTH); - message3.setPos(0, message2.top() + message2.height() + GAP); - add(message3); - - RenderedTextMultiline message4 = PixelScene.renderMultiline(Messages.get(this, "info4"), 6); - message4.maxWidth(WIDTH); - message4.setPos(0,message3.top() + message3.height() + GAP); - add(message4); - - - RedButton btnBattle = new RedButton(Messages.get(this, "ok")) { - @Override - protected void onClick() { - hide(); - } - }; - btnBattle.setRect(0, message4.top() + message4.height() + GAP, WIDTH, - BTN_HEIGHT); - add(btnBattle); - - - - resize(WIDTH, (int) btnBattle.bottom()); - } - - -} diff --git a/java/com/hmdzl/spspd/change/windows/WndEgoalInfo.java b/java/com/hmdzl/spspd/change/windows/WndEgoalInfo.java deleted file mode 100644 index b9f1752c..00000000 --- a/java/com/hmdzl/spspd/change/windows/WndEgoalInfo.java +++ /dev/null @@ -1,65 +0,0 @@ -package com.hmdzl.spspd.change.windows; - -import com.hmdzl.spspd.change.items.DewVial; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.weapon.melee.special.ErrorW; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.scenes.PixelScene; -import com.hmdzl.spspd.change.sprites.ItemSprite; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.ui.RedButton; -import com.hmdzl.spspd.change.ui.RenderedTextMultiline; -import com.hmdzl.spspd.change.ui.Window; -import com.hmdzl.spspd.change.utils.GLog; - - -public class WndEgoalInfo extends Window { - - private static final int WIDTH = 120; - private static final int BTN_HEIGHT = 20; - private static final float GAP = 2; - - public WndEgoalInfo(final Item item) { - - super(); - - Item dewvial = new ErrorW(); - - IconTitle titlebar = new IconTitle(); - titlebar.icon(new ItemSprite(dewvial.image(), null)); - titlebar.label(Messages.titleCase(Messages.get(this, "title"))); - titlebar.setRect(0, 0, WIDTH, 0); - add(titlebar); - - RenderedTextMultiline message = PixelScene.renderMultiline(Messages.get(this, "info1"), 6); - message.maxWidth(WIDTH); - message.setPos(0,titlebar.bottom() + GAP); - add(message); - - RedButton btnYes = new RedButton(Messages.get(this, "yes")) { - @Override - protected void onClick() { - hide(); - GLog.n(Messages.get(WndEgoalInfo.class, "tell1")); - } - }; - btnYes.setRect(0, message.top() + message.height() + GAP, WIDTH, - BTN_HEIGHT); - add(btnYes); - - RedButton btnNo = new RedButton(Messages.get(this, "no")) { - @Override - protected void onClick() { - hide(); - GLog.n(Messages.get(WndEgoalInfo.class, "tell2")); - } - }; - btnNo.setRect(0, btnYes.top() + btnYes.height() + GAP, WIDTH, - BTN_HEIGHT); - add(btnNo); - - resize(WIDTH, (int) btnNo.bottom()); - } - - -} diff --git a/java/com/hmdzl/spspd/change/windows/WndError.java b/java/com/hmdzl/spspd/change/windows/WndError.java deleted file mode 100644 index 7d273fdc..00000000 --- a/java/com/hmdzl/spspd/change/windows/WndError.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.windows; - -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.ui.Icons; - -public class WndError extends WndTitledMessage { - - private static final String TXT_TITLE = "ERROR"; - - public WndError(String message) { - super(Icons.WARNING.get(), Messages.get(WndError.class, "title"), message); - } - -} diff --git a/java/com/hmdzl/spspd/change/windows/WndGame.java b/java/com/hmdzl/spspd/change/windows/WndGame.java deleted file mode 100644 index 88761b1d..00000000 --- a/java/com/hmdzl/spspd/change/windows/WndGame.java +++ /dev/null @@ -1,153 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.windows; - -import java.io.IOException; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.ShatteredPixelDungeon; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.scenes.InterlevelScene; -import com.hmdzl.spspd.change.scenes.LoadSaveScene; -import com.hmdzl.spspd.change.scenes.RankingsScene; -import com.hmdzl.spspd.change.scenes.TitleScene; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.ui.GameLog; -import com.hmdzl.spspd.change.ui.Icons; -import com.hmdzl.spspd.change.ui.RedButton; -import com.hmdzl.spspd.change.ui.RedButton; -import com.hmdzl.spspd.change.ui.Window; -import com.watabou.noosa.Game; - -public class WndGame extends Window { - - private static final int WIDTH = 120; - private static final int BTN_HEIGHT = 20; - private static final int GAP = 2; - - private int pos; - - public WndGame() { - - super(); - - addButton(new RedButton( Messages.get(this, "settings")) { - @Override - protected void onClick() { - hide(); - GameScene.show(new WndSettings(true)); - } - }); - - // Challenges window - if (Dungeon.challenges > 0) { - addButton(new RedButton( Messages.get(this, "challenges")) { - @Override - protected void onClick() { - hide(); - GameScene - .show(new WndChallenges(Dungeon.challenges, false)); - } - }); - } - - // Restart - if (!Dungeon.hero.isAlive()) { - - RedButton btnStart; - addButton(btnStart = new RedButton( Messages.get(this, "start") ) { - @Override - protected void onClick() { - //GameLog.wipe(); - Dungeon.hero = null; - ShatteredPixelDungeon.challenges(Dungeon.challenges); - InterlevelScene.mode = InterlevelScene.Mode.DESCEND; - InterlevelScene.noStory = true; - Game.switchScene(InterlevelScene.class); - } - }); - btnStart.icon(Icons.get(Dungeon.hero.heroClass)); - - addButton(new RedButton(Messages.get(this, "rankings")) { - @Override - protected void onClick() { - InterlevelScene.mode = InterlevelScene.Mode.DESCEND; - Game.switchScene(RankingsScene.class); - } - }); - } - - addButton(new RedButton(Messages.get(this, "loadsave") ) { - @Override - protected void onClick() { - try { - Dungeon.saveAll(); - } catch (IOException e) { - ShatteredPixelDungeon.reportException(e); - } - Game.switchScene( LoadSaveScene.class ); - } - }); - - addButtons( - // Main menu - new RedButton( Messages.get(this, "menu")) { - @Override - protected void onClick() { - try { - Dungeon.saveAll(); - } catch (IOException e) { - //ShatteredPixelDungeon.reportException(e); - } - Game.switchScene(TitleScene.class); - } - }, - // Quit - new RedButton( Messages.get(this, "exit")) { - @Override - protected void onClick() { - Game.instance.finish(); - } - }); - - // Cancel - addButton(new RedButton(Messages.get(this, "return")) { - @Override - protected void onClick() { - hide(); - } - }); - - resize(WIDTH, pos); - } - - private void addButton(RedButton btn) { - add(btn); - btn.setRect(0, pos > 0 ? pos += GAP : 0, WIDTH, BTN_HEIGHT); - pos += BTN_HEIGHT; - } - - private void addButtons(RedButton btn1, RedButton btn2) { - add(btn1); - btn1.setRect(0, pos > 0 ? pos += GAP : 0, (WIDTH - GAP) / 2, BTN_HEIGHT); - add(btn2); - btn2.setRect(btn1.right() + GAP, btn1.top(), - WIDTH - btn1.right() - GAP, BTN_HEIGHT); - pos += BTN_HEIGHT; - } -} diff --git a/java/com/hmdzl/spspd/change/windows/WndHero.java b/java/com/hmdzl/spspd/change/windows/WndHero.java deleted file mode 100644 index cc34b57e..00000000 --- a/java/com/hmdzl/spspd/change/windows/WndHero.java +++ /dev/null @@ -1,781 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.windows; - -import java.util.Locale; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.Statistics; -import com.hmdzl.spspd.change.actors.Actor; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Hunger; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.actors.mobs.pets.PET; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.food.completefood.PetFood; -import com.hmdzl.spspd.change.items.potions.Potion; -import com.hmdzl.spspd.change.items.potions.PotionOfFrost; -import com.hmdzl.spspd.change.items.potions.PotionOfLiquidFlame; -import com.hmdzl.spspd.change.items.potions.PotionOfToxicGas; -import com.hmdzl.spspd.change.items.scrolls.Scroll; -import com.hmdzl.spspd.change.items.scrolls.ScrollOfRecharging; -import com.hmdzl.spspd.change.items.food.completefood.Garbage; -import com.hmdzl.spspd.change.items.weapon.missiles.EscapeKnive; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.items.food.meatfood.Meat; -import com.hmdzl.spspd.change.items.food.meatfood.MysteryMeat; -import com.hmdzl.spspd.change.items.food.Nut; -import com.hmdzl.spspd.change.items.StoneOre; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.plants.Plant; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.scenes.PixelScene; -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.hmdzl.spspd.change.sprites.HeroSprite; -import com.hmdzl.spspd.change.ui.BuffIndicator; -import com.hmdzl.spspd.change.ui.HealthBar; -import com.hmdzl.spspd.change.ui.RedButton; -import com.hmdzl.spspd.change.ui.Window; -import com.hmdzl.spspd.change.utils.GLog; - -import com.watabou.gltextures.SmartTexture; -import com.watabou.gltextures.TextureCache; -import com.watabou.noosa.Group; -import com.watabou.noosa.Image; -import com.watabou.noosa.TextureFilm; -import com.watabou.noosa.RenderedText; -import com.watabou.noosa.ui.Button; - -public class WndHero extends WndTabbed { - - private static final String TXT_STATS = "Stats"; - private static final String TXT_LEVELSTATS = "Level"; - private static final String TXT_BUFFS = "Buffs"; - private static final String TXT_PET = "Pet"; - - private static final String TXT_HEALS = "%+dHP"; - - private static final String TXT_EXP = "Experience"; - private static final String TXT_STR = "Strength"; - private static final String TXT_BREATH = "Breath Weapon"; - private static final String TXT_SPIN = "Spinneretes"; - private static final String TXT_STING = "Stinger"; - private static final String TXT_FEATHERS = "Feathers"; - private static final String TXT_SPARKLE = "Wand Attack"; - private static final String TXT_FANGS = "Fangs"; - private static final String TXT_ATTACK = "Attack Skill"; - private static final String TXT_HEALTH = "Health"; - private static final String TXT_GOLD = "Gold Collected"; - private static final String TXT_DEPTH = "Maximum Depth"; - private static final String TXT_MOVES = "Game Moves"; - private static final String TXT_MOVES2 = "Floor Moves"; - private static final String TXT_MOVES3 = "Floor Move Goal"; - private static final String TXT_MOVES4 = "Prev Under Goal"; - private static final String TXT_HUNGER = "Hunger"; - private static final String TXT_MOVES_DEW = "Dew Charge Moves"; - private static final String TXT_PETS = "Pets Lost"; - - private static final int WIDTH = 100; - private static final int TAB_WIDTH = 40; - - private StatsTab stats; - private LevelStatsTab levelstats; - private PetTab pet; - private BuffsTab buffs; - - private SmartTexture icons; - private TextureFilm film; - - - private PET checkpet(){ - for (Mob mob : Dungeon.level.mobs) { - if(mob instanceof PET) { - return (PET) mob; - } - } - return null; - } - - public WndHero() { - - super(); - - icons = TextureCache.get(Assets.BUFFS_LARGE); - film = new TextureFilm(icons, 16, 16); - - stats = new StatsTab(); - add(stats); - - if(Dungeon.dewDraw || Dungeon.dewWater){ - levelstats = new LevelStatsTab(); - add(levelstats); - } - PET heropet = checkpet(); - - if (heropet!=null){ - pet = new PetTab(heropet); - add(pet); - } - - buffs = new BuffsTab(); - add(buffs); - - - add(new LabeledTab(Messages.get(this, "stats")) { - @Override - protected void select(boolean value) { - super.select(value); - stats.visible = stats.active = selected; - }; - }); - - if(Dungeon.dewDraw || Dungeon.dewWater){ - add(new LabeledTab(Messages.get(this, "dew")) { - @Override - protected void select(boolean value) { - super.select(value); - levelstats.visible = levelstats.active = selected; - }; - }); - } - - if (heropet!=null){ - add(new LabeledTab(Messages.get(this, "pet")) { - @Override - protected void select(boolean value) { - super.select(value); - pet.visible = pet.active = selected; - }; - }); - } - - add(new LabeledTab(Messages.get(this, "buffs")) { - @Override - protected void select(boolean value) { - super.select(value); - buffs.visible = buffs.active = selected; - }; - }); - - resize(WIDTH, (int) Math.max(stats.height(), buffs.height())); - - layoutTabs(); - - select(0); - } - - private class StatsTab extends Group { - - private static final String TXT_TITLE = "Level %d %s"; - private static final String TXT_CATALOGUS = "Catalogus"; - private static final String TXT_JOURNAL = "Journal"; - - private static final int GAP = 4; - - private float pos; - - public StatsTab() { - - Hero hero = Dungeon.hero; - - IconTitle title = new IconTitle(); - title.icon(HeroSprite.avatar(hero.heroClass, hero.useskin())); - title.label( Messages.get(this, "title", hero.lvl, hero.className() ) - .toUpperCase(Locale.ENGLISH)); - title.color(Window.SHPX_COLOR); - title.setRect(0, 0, WIDTH, 0); - add(title); - - /*MemoryButton btnmemory = new MemoryButton(); - btnmemory.setRect(60,0,0,0); - add(btnmemory);*/ - - RedButton btnCatalogus = new RedButton(Messages.get(this, "catalogs")) { - @Override - protected void onClick() { - hide(); - GameScene.show(new WndCatalogus()); - }; - }; - btnCatalogus.setRect(0, title.height(), - btnCatalogus.reqWidth() + 2, btnCatalogus.reqHeight() + 2); - add(btnCatalogus); - - RedButton btnJournal = new RedButton(Messages.get(this, "journal")) { - @Override - protected void onClick() { - hide(); - GameScene.show(new WndJournal()); - } - }; - btnJournal.setRect(btnCatalogus.right() + 1, btnCatalogus.top(), - btnJournal.reqWidth() + 2, btnJournal.reqHeight() + 2); - add(btnJournal); - - pos = btnJournal.bottom() + GAP; - - statSlot(Messages.get(this, "str"), hero.STR()); - statSlot(Messages.get(this, "health"), hero.HP + "/" + hero.HT ); - statSlot(Messages.get(this, "exp"), hero.exp + "/" + hero.maxExp()); - - statSlot(Messages.get(this, "time"), ((int)(Statistics.time/60) + ":" + (int)(Statistics.time%60))); - - pos += GAP; - - statSlot(Messages.get(this, "gold"), Statistics.goldCollected); - statSlot(Messages.get(this, "depth"), Statistics.deepestFloor); - statSlot(Messages.get(this, "atkskill"), hero.hitSkill); - statSlot(Messages.get(this, "defskill"), hero.evadeSkill); - statSlot(Messages.get(this, "magskill"), hero.magicSkill()); - - if(Dungeon.hero.buff(Hunger.class) != null){ - statSlot(Messages.get(this, "hunger") , Dungeon.hero.buff(Hunger.class).hungerLevel()); - } - - - pos += GAP; - } - - private void statSlot(String label, String value) { - - RenderedText txt = PixelScene.renderText(label, 8); - txt.y = pos; - add(txt); - - txt = PixelScene.renderText(value, 8); - //txt.measure(); - txt.x = PixelScene.align(WIDTH * 0.5f); - txt.y = pos; - add(txt); - - pos += GAP + txt.baseLine(); - } - - private void statSlot(String label, int value) { - statSlot(label, Integer.toString(value)); - } - - public float height() { - return pos; - } - } - - private class LevelStatsTab extends Group { - - private static final String TXT_TITLE = "Level %d %s"; - private static final String TXT_CATALOGUS = "Catalogus"; - private static final String TXT_JOURNAL = "Journal"; - - private static final int GAP = 4; - - private float pos; - - public LevelStatsTab() { - - Hero hero = Dungeon.hero; - - IconTitle title = new IconTitle(); - title.icon(HeroSprite.avatar(hero.heroClass, hero.useskin())); - title.label( Messages.get(this, "title", hero.lvl, hero.className()) - .toUpperCase(Locale.ENGLISH)); - title.color(Window.SHPX_COLOR); - title.setRect(0, 0, WIDTH, 0); - add(title); - - RedButton btnCatalogus = new RedButton(Messages.get(this, "catalogs")) { - @Override - protected void onClick() { - hide(); - GameScene.show(new WndCatalogus()); - }; - }; - btnCatalogus.setRect(0, title.height(), - btnCatalogus.reqWidth() + 2, btnCatalogus.reqHeight() + 2); - add(btnCatalogus); - - RedButton btnJournal = new RedButton(Messages.get(this, "journal")) { - @Override - protected void onClick() { - hide(); - GameScene.show(new WndJournal()); - } - }; - btnJournal.setRect(btnCatalogus.right() + 1, btnCatalogus.top(), - btnJournal.reqWidth() + 2, btnJournal.reqHeight() + 2); - add(btnJournal); - - pos = btnCatalogus.bottom() + GAP; - - - if (Dungeon.depth<26 && (Dungeon.dewDraw || Dungeon.dewWater)){ - statSlot(Messages.get(this, "level_move"), Dungeon.level.currentmoves); - statSlot(Messages.get(this, "level_max"), Dungeon.pars[Dungeon.depth]); - statSlot(Messages.get(this, "level_prefect"),Statistics.prevfloormoves); - /*if (Dungeon.hero.buff(Dewcharge.class) != null) { - float dewration = Dungeon.hero.buff(Dewcharge.class).dispTurns(); - statSlot(Messages.get(this, "level_left"), dewration); - }*/ - } - - - pos += GAP; - } - - private void statSlot(String label, String value) { - - RenderedText txt = PixelScene.renderText(label, 8); - txt.y = pos; - add(txt); - - txt = PixelScene.renderText(value, 8); - //txt.measure(); - txt.x = PixelScene.align(WIDTH * 0.5f); - txt.y = pos; - add(txt); - - pos += GAP + txt.baseLine(); - } - - private void statSlot(String label, int value) { - statSlot(label, Integer.toString(value)); - } - - public float height() { - return pos; - } - } - - - - - private class BuffsTab extends Group { - - private static final int GAP = 4; - - private float pos; - - public BuffsTab() { - for (Buff buff : Dungeon.hero.buffs()) { - if (buff.icon() != BuffIndicator.NONE) { - BuffSlot slot = new BuffSlot(buff); - slot.setRect(0, pos, WIDTH, slot.icon.height()); - add(slot); - pos += GAP + slot.height(); - } - } - } - - public float height() { - return pos; - } - - private class BuffSlot extends Button { - - private Buff buff; - - Image icon; - RenderedText txt; - - public BuffSlot( Buff buff ){ - super(); - this.buff = buff; - int index = buff.icon(); - - icon = new Image( icons ); - icon.frame( film.get( index ) ); - icon.y = this.y; - add( icon ); - - txt = PixelScene.renderText( buff.toString(), 8 ); - txt.x = icon.width + GAP; - txt.y = this.y + (int)(icon.height - txt.baseLine()) / 2; - add( txt ); - - } - - @Override - protected void layout() { - super.layout(); - icon.y = this.y; - txt.x = icon.width + GAP; - txt.y = pos + (int)(icon.height - txt.baseLine()) / 2; - } - - @Override - protected void onClick() { - GameScene.show( new WndInfoBuff( buff )); - } - } - /*private void buffSlot(Buff buff) { - - int index = buff.icon(); - - if (index != BuffIndicator.NONE) { - - Image icon = new Image(icons); - icon.frame(film.get(index)); - icon.y = pos; - add(icon); - - RenderedText txt = PixelScene.renderText(buff.toString(), 8); - txt.x = icon.width + GAP; - txt.y = pos + (int) (icon.height - txt.baseLine()) / 2; - add(txt); - - pos += GAP + icon.height; - } - } - - public float height() { - return pos; - }*/ - } - - private class PetTab extends Group { - - private static final String TXT_TITLE = "Level %d %s"; - private static final String TXT_FEED = "Feed"; - private static final String TXT_CALL = "Call"; - private static final String TXT_STAY = "Stay"; - private static final String TXT_RELEASE = "Release"; - private static final String TXT_SELECT = "What do you want to feed your pet?"; - - private CharSprite image; - private RenderedText name; - private HealthBar health; - private BuffIndicator buffs; - - private static final int GAP = 4; - - private float pos; - - - public PetTab(final PET heropet) { - - //name = PixelScene.renderText(heropet.name); - //name.hardlight(TITLE_COLOR); - //name.measure(); - //add(name); - - image = heropet.sprite(); - add(image); - - health = new HealthBar(); - health.level((float) heropet.HP / heropet.HT); - add(health); - - buffs = new BuffIndicator(heropet); - add(buffs); - - - - IconTitle title = new IconTitle(); - title.icon(image); - title.label( Messages.get(this, "title", heropet.level, heropet.name).toUpperCase(Locale.ENGLISH), 9); - title.color(Window.SHPX_COLOR); - title.setRect(0, 0, WIDTH, 0); - add(title); - - RedButton btnFeed = new RedButton(Messages.get(this, "pet_feed")) { - @Override - protected void onClick() { - hide(); - GameScene.selectItem(itemSelector, WndBag.Mode.ALL, Messages.get(WndHero.class, "choose_food")); - } - }; - btnFeed.setRect(0, title.height(), - btnFeed.reqWidth() + 2, btnFeed.reqHeight() + 2); - add(btnFeed); - - RedButton btnCall = new RedButton(Messages.get(this, "pet_call")) { - @Override - protected void onClick() { - hide(); - heropet.callback = true; - heropet.stay = false; - } - }; - btnCall.setRect(btnFeed.right() + 1, btnFeed.top(), - btnCall.reqWidth() + 2, btnCall.reqHeight() + 2); - add(btnCall); - - RedButton btnStay = new RedButton(heropet.stay ? Messages.get(this, "pet_move") : Messages.get(this, "pet_stay")) { - @Override - protected void onClick() { - hide(); - if (heropet.stay){ - heropet.stay = false; - } else { - heropet.stay = true; - } - } - }; - - btnStay.setRect(btnCall.right() + 1, btnCall.top(), - btnStay.reqWidth() + 2, btnStay.reqHeight() + 2); - - add(btnStay); - - pos = btnStay.bottom() + GAP; - - statSlot(Messages.get(this, "pet_attack"), heropet.hitSkill(null)); - statSlot(Messages.get(this, "pet_hp"), heropet.HP + "/" + heropet.HT); - statSlot(Messages.get(this, "pet_exp"), heropet.level<30 ? heropet.experience + "/" + (heropet.level*(heropet.level+1) ): "MAX"); - statSlot(Messages.get(this, "pet_skills"), heropet.cooldown==0 ? Messages.get(this, "pet_skills_ready") : heropet.cooldown + Messages.get(this, "pet_skills_turn")); - - pos += GAP; - - - } - - private void statSlot(String label, String value) { - - RenderedText txt = PixelScene.renderText(label, 8); - txt.y = pos; - add(txt); - - txt = PixelScene.renderText(value, 8); - //txt.measure(); - txt.x = PixelScene.align(WIDTH * 0.5f); - txt.y = pos; - add(txt); - - pos += GAP + txt.baseLine(); - } - - private void statSlot(String label, int value) { - statSlot(label, Integer.toString(value)); - } - - public float height() { - return pos; - } - } - - private final WndBag.Listener itemSelector = new WndBag.Listener() { - @Override - public void onSelect(Item item) { - if (item != null) { - feed(item); - } - } - }; - - private boolean checkpetNear(){ - for (int n : Level.NEIGHBOURS8) { - int c = Dungeon.hero.pos + n; - if (Actor.findChar(c) instanceof PET) { - return true; - } - } - return false; - } - - private void feed(Item item) { - - PET heropet = checkpet(); - boolean nomnom = checkFood(heropet.type, item); - boolean nearby = checkpetNear(); - - if (nomnom && nearby){ - int effect = heropet.HT-heropet.HP; - if (effect > 0){ - heropet.HP+= (int)(effect*0.8); - heropet.sprite.emitter().burst(Speck.factory(Speck.HEALING),2); - heropet.sprite.showStatus(CharSprite.POSITIVE,Messages.get(WndHero.class,"heals", effect)); - } - heropet.cooldown=1; - heropet.experience+= 120; - item.detach(Dungeon.hero.belongings.backpack); - Dungeon.hero.spend(1f); - Dungeon.hero.busy(); - Dungeon.hero.sprite.operate(Dungeon.hero.pos); - GLog.n(Messages.get(WndHero.class, "pet_eat",item.name())); - }else if (!nearby){ - GLog.n(Messages.get(WndHero.class, "pet_faraway")); - } else { - GLog.n(Messages.get(WndHero.class, "pet_noeat",item.name())); - - } - } - - private boolean checkFood(Integer petType, Item item){ - boolean nomnom = false; - - if (petType==1){ //Spider - if (item instanceof Meat - || item instanceof MysteryMeat - || item instanceof PetFood){ - nomnom=true; - } - } - - if (petType==3){//Velocirooster - if (item instanceof Plant.Seed - || item instanceof Nut - || item instanceof PetFood){ - nomnom=true; - } - } - if (petType==4){//red dragon - fire - if (item instanceof Meat - || item instanceof PotionOfLiquidFlame - || item instanceof MysteryMeat - || item instanceof PetFood){ - nomnom=true; - } - } - - if (petType==5){//green dragon - lit - if (item instanceof Meat - || item instanceof ScrollOfRecharging - || item instanceof MysteryMeat - || item instanceof PetFood){ - nomnom=true; - } - } - - if (petType==6){//violet dragon - poison - if (item instanceof Meat - || item instanceof PotionOfToxicGas - || item instanceof MysteryMeat - || item instanceof PetFood){ - nomnom=true; - } - } - if (petType==7){//blue dragon - ice - if (item instanceof Meat - || item instanceof PotionOfFrost - || item instanceof MysteryMeat - || item instanceof PetFood){ - nomnom=true; - } - } - - if (petType==8){ //scorpion - if (item instanceof Meat - || item instanceof MysteryMeat - || item instanceof PetFood){ - nomnom=true; - } - } - - if (petType==9){//Vorpal Bunny - if (item instanceof Plant.Seed - || item instanceof PetFood){ - nomnom=true; - } - } - if (petType==10){//Fairy - if (item instanceof Potion - || item instanceof PetFood){ - nomnom=true; - } - } - if (petType==11){//Sugarplum Fairy - if (item instanceof Potion - || item instanceof PetFood){ - nomnom=true; - } - } - if (petType==12){//shadow dragon - if (item instanceof Meat - || item instanceof MysteryMeat - || item instanceof PetFood){ - nomnom=true; - } - } - if (petType==13){//CocoCat - if (item instanceof Nut - || item instanceof Nut - || item instanceof PetFood){ - nomnom=true; - } - } - if (petType==14){//LeryFire - if (item instanceof Scroll - || item instanceof PetFood){ - nomnom=true; - } - } - if (petType==15){//GoldDragon - if (item instanceof Meat - || item instanceof MysteryMeat - || item instanceof PetFood){ - nomnom=true; - } - } - if (petType==16){//snake - if (item instanceof Meat - || item instanceof MysteryMeat - || item instanceof PetFood){ - nomnom=true; - } - } - if (petType==17){//fly - if (item instanceof Meat - || item instanceof MysteryMeat - || item instanceof PetFood){ - nomnom=true; - } - } - if (petType==18){//stone - if (item instanceof EscapeKnive - || item instanceof PetFood - || item instanceof StoneOre - || item instanceof Garbage){ - nomnom=true; - } - } - if (petType==19){//monkey - if (item instanceof Plant.Seed - || item instanceof Nut - || item instanceof PetFood){ - nomnom=true; - } - } - if (petType==20){//GentleCrab - if (item instanceof Meat - || item instanceof MysteryMeat - || item instanceof Plant.Seed - || item instanceof PetFood){ - nomnom=true; - } - } - if (petType==21){//RibbonRat - if (item instanceof Plant.Seed - || item instanceof Nut - || item instanceof Meat - || item instanceof PetFood){ - nomnom=true; - } - } - if (petType==22){//YearPet - if (item instanceof Meat - || item instanceof PetFood){ - nomnom=true; - } - } - - return nomnom; - } - -} diff --git a/java/com/hmdzl/spspd/change/windows/WndHotel.java b/java/com/hmdzl/spspd/change/windows/WndHotel.java deleted file mode 100644 index ee7bdf94..00000000 --- a/java/com/hmdzl/spspd/change/windows/WndHotel.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.windows; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.actors.mobs.npcs.G2159687; -import com.hmdzl.spspd.change.actors.mobs.npcs.Imp; -import com.hmdzl.spspd.change.actors.mobs.npcs.OldNewStwist; -import com.hmdzl.spspd.change.actors.mobs.npcs.StormAndRain; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.keys.IronKey; -import com.hmdzl.spspd.change.items.quest.DwarfToken; -import com.hmdzl.spspd.change.items.quest.GnollClothes; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.PixelScene; -import com.hmdzl.spspd.change.sprites.ItemSprite; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.ui.RedButton; -import com.hmdzl.spspd.change.ui.RenderedTextMultiline; -import com.hmdzl.spspd.change.ui.Window; -import com.hmdzl.spspd.change.utils.GLog; - - -public class WndHotel extends Window { - - private static final int WIDTH = 120; - private static final int BTN_HEIGHT = 20; - private static final int GAP = 2; - - public WndHotel() { - - super(); - - IronKey key = new IronKey(Dungeon.depth); - - - IconTitle titlebar = new IconTitle(); - titlebar.icon(new ItemSprite(key.image(), null)); - titlebar.label(Messages.titleCase(key.name())); - titlebar.setRect(0, 0, WIDTH, 0); - add(titlebar); - - RenderedTextMultiline message = PixelScene - .renderMultiline(Messages.get(this, "message"), 6); - message.maxWidth(WIDTH); - message.setPos(0, titlebar.bottom() + GAP); - add(message); - - RedButton btnReward = new RedButton(Messages.get(this, "buy")) { - @Override - protected void onClick() { - if (Dungeon.gold > 100){ - Dungeon.gold-=100; - IronKey key = new IronKey(Dungeon.depth); - key.doPickUp(Dungeon.hero); - hide(); - } else { - GLog.w(Messages.get(this,"more_gold")); - hide(); - } - } - }; - btnReward.setRect(0, message.top() + message.height() + GAP, WIDTH, - BTN_HEIGHT); - add(btnReward); - - resize(WIDTH, (int) btnReward.bottom()); - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/windows/WndImp.java b/java/com/hmdzl/spspd/change/windows/WndImp.java deleted file mode 100644 index 2b144b69..00000000 --- a/java/com/hmdzl/spspd/change/windows/WndImp.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.windows; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.mobs.npcs.Imp; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.quest.DwarfToken; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.PixelScene; -import com.hmdzl.spspd.change.sprites.ItemSprite; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.ui.RedButton; -import com.hmdzl.spspd.change.ui.RenderedTextMultiline; -import com.hmdzl.spspd.change.ui.Window; -import com.hmdzl.spspd.change.utils.GLog; - - -public class WndImp extends Window { - - private static final int WIDTH = 120; - private static final int BTN_HEIGHT = 20; - private static final int GAP = 2; - - public WndImp(final Imp imp, final DwarfToken tokens) { - - super(); - - IconTitle titlebar = new IconTitle(); - titlebar.icon(new ItemSprite(tokens.image(), null)); - titlebar.label(Messages.titleCase( tokens.name() )); - titlebar.setRect(0, 0, WIDTH, 0); - add(titlebar); - - RenderedTextMultiline message = PixelScene - .renderMultiline( Messages.get(this, "message"), 6); - message.maxWidth(WIDTH); - message.setPos(0,titlebar.bottom() + GAP); - add(message); - - RedButton btnReward = new RedButton(Messages.get(this, "reward")) { - @Override - protected void onClick() { - takeReward(imp, tokens, Imp.Quest.reward); - } - }; - btnReward.setRect(0, message.top() + message.height() + GAP, WIDTH, - BTN_HEIGHT); - add(btnReward); - - resize(WIDTH, (int) btnReward.bottom()); - } - - private void takeReward(Imp imp, DwarfToken tokens, Item reward) { - - hide(); - - tokens.detachAll(Dungeon.hero.belongings.backpack); - - reward.identify(); - - Dungeon.level.drop(reward, imp.pos).sprite.drop(); - - imp.flee(); - - Imp.Quest.complete(); - } -} diff --git a/java/com/hmdzl/spspd/change/windows/WndInfoBuff.java b/java/com/hmdzl/spspd/change/windows/WndInfoBuff.java deleted file mode 100644 index a89726fa..00000000 --- a/java/com/hmdzl/spspd/change/windows/WndInfoBuff.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * Shattered Pixel Dungeon - * Copyright (C) 2014-2015 Evan Debenham - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.windows; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.PixelScene; -import com.hmdzl.spspd.change.ui.RenderedTextMultiline; -import com.hmdzl.spspd.change.ui.Window; -import com.watabou.gltextures.SmartTexture; -import com.watabou.gltextures.TextureCache; -import com.watabou.noosa.Image; -import com.watabou.noosa.TextureFilm; - -public class WndInfoBuff extends Window { - - private static final float GAP = 2; - - private static final int WIDTH = 120; - - private SmartTexture icons; - private TextureFilm film; - - public WndInfoBuff(Buff buff){ - super(); - - IconTitle titlebar = new IconTitle(); - - icons = TextureCache.get( Assets.BUFFS_LARGE ); - film = new TextureFilm( icons, 16, 16 ); - - Image buffIcon = new Image( icons ); - buffIcon.frame( film.get(buff.icon()) ); - - titlebar.icon( buffIcon ); - titlebar.label( Messages.titleCase(buff.toString()), Window.TITLE_COLOR ); - titlebar.setRect( 0, 0, WIDTH, 0 ); - add( titlebar ); - - RenderedTextMultiline txtInfo = PixelScene.renderMultiline(buff.desc(), 6); - txtInfo.maxWidth(WIDTH); - txtInfo.setPos(titlebar.left(), titlebar.bottom() + GAP); - add( txtInfo ); - - resize( WIDTH, (int)(txtInfo.top() + txtInfo.height()) ); - } -} diff --git a/java/com/hmdzl/spspd/change/windows/WndInfoCell.java b/java/com/hmdzl/spspd/change/windows/WndInfoCell.java deleted file mode 100644 index ffb36f84..00000000 --- a/java/com/hmdzl/spspd/change/windows/WndInfoCell.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.windows; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.DungeonTilemap; -import com.hmdzl.spspd.change.actors.blobs.Blob; -import com.hmdzl.spspd.change.levels.Level; -import com.hmdzl.spspd.change.levels.Terrain; -import com.hmdzl.spspd.change.scenes.PixelScene; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.ui.Window; -import com.hmdzl.spspd.change.ui.RenderedTextMultiline; -import com.watabou.noosa.BitmapTextMultiline; -import com.watabou.noosa.Image; - -public class WndInfoCell extends Window { - - private static final float GAP = 2; - - private static final int WIDTH = 120; - - private static final String TXT_NOTHING = "There is nothing here."; - - public WndInfoCell(int cell) { - - super(); - - int tile = Dungeon.level.map[cell]; - if (Level.water[cell]) { - tile = Terrain.WATER; - } else if (Level.pit[cell]) { - tile = Terrain.CHASM; - } - - IconTitle titlebar = new IconTitle(); - if (tile == Terrain.WATER) { - Image water = new Image(Dungeon.level.waterTex()); - water.frame(0, 0, DungeonTilemap.SIZE, DungeonTilemap.SIZE); - titlebar.icon(water); - } else { - titlebar.icon(DungeonTilemap.tile(tile)); - } - titlebar.label(Dungeon.level.tileName(tile)); - titlebar.setRect(0, 0, WIDTH, 0); - add(titlebar); - - RenderedTextMultiline info = PixelScene.renderMultiline(6); - add(info); - - StringBuilder desc = new StringBuilder(Dungeon.level.tileDesc(tile)); - - for (Blob blob : Dungeon.level.blobs.values()) { - if (blob.cur[cell] > 0 && blob.tileDesc() != null) { - if (desc.length() > 0) { - desc.append("\n\n"); - } - desc.append(blob.tileDesc()); - } - } - - info.text(desc.length() > 0 ? desc.toString() : Messages.get("nothing")); - info.maxWidth(WIDTH); - info.setPos(titlebar.left(), titlebar.bottom() + GAP); - - resize( WIDTH, (int)(info.top() + info.height()) ); - } -} diff --git a/java/com/hmdzl/spspd/change/windows/WndInfoItem.java b/java/com/hmdzl/spspd/change/windows/WndInfoItem.java deleted file mode 100644 index b0c19902..00000000 --- a/java/com/hmdzl/spspd/change/windows/WndInfoItem.java +++ /dev/null @@ -1,142 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.windows; - -import com.hmdzl.spspd.change.items.Heap; -import com.hmdzl.spspd.change.items.Heap.Type; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.artifacts.Artifact; -import com.hmdzl.spspd.change.items.wands.Wand; -import com.hmdzl.spspd.change.items.rings.Ring; -import com.hmdzl.spspd.change.scenes.PixelScene; -import com.hmdzl.spspd.change.sprites.ItemSprite; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.ui.ItemSlot; -import com.hmdzl.spspd.change.ui.RenderedTextMultiline; -import com.hmdzl.spspd.change.ui.Window; - - -public class WndInfoItem extends Window { - - private static final String TTL_CHEST = "Chest"; - private static final String TTL_LOCKED_CHEST = "Locked chest"; - private static final String TTL_CRYSTAL_CHEST = "Crystal chest"; - private static final String TTL_TOMB = "Tomb"; - private static final String TTL_SKELETON = "Skeletal remains"; - private static final String TTL_REMAINS = "Heroes remains"; - private static final String TXT_WONT_KNOW = "You won't know what's inside until you open it!"; - private static final String TXT_NEED_KEY = TXT_WONT_KNOW - + " But to open it you need a golden key."; - private static final String TXT_INSIDE = "You can see %s inside, but to open the chest you need a golden key."; - private static final String TXT_OWNER = "This ancient tomb may contain something useful, " - + "but its owner will most certainly object to checking."; - private static final String TXT_SKELETON = "This is all that's left of some unfortunate adventurer. " - + "Maybe it's worth checking for any valuables."; - private static final String TXT_REMAINS = "This is all that's left from one of your predecessors. " - + "Maybe it's worth checking for any valuables."; - - private static final float GAP = 2; - - private static final int WIDTH = 120; - - public WndInfoItem(Heap heap) { - - super(); - - if (heap.type == Heap.Type.HEAP || heap.type == Heap.Type.FOR_SALE) { - - Item item = heap.peek(); - - int color = TITLE_COLOR; - if (item.levelKnown && item.level > 0) { - color = ItemSlot.UPGRADED; - } else if (item.levelKnown && item.level < 0) { - color = ItemSlot.DEGRADED; - } - fillFields(item.image(), item.glowing(), color, item.toString(), - item.info()); - - } else { - - String title; - String info; - - if (heap.type == Type.CHEST || heap.type == Type.MIMIC) { - title = Messages.get(this, "chest"); - info = Messages.get(this, "wont_know"); - } else if (heap.type == Type.TOMB) { - title = Messages.get(this, "tomb"); - info = Messages.get(this, "owner"); - } else if (heap.type == Type.SKELETON) { - title = Messages.get(this, "skeleton"); - info = Messages.get(this, "skeleton_desc"); - } else if (heap.type == Type.REMAINS) { - title = Messages.get(this, "remains"); - info = Messages.get(this, "remains_desc"); - } else if (heap.type == Type.CRYSTAL_CHEST) { - title = Messages.get(this, "crystal_chest"); - if (heap.peek() instanceof Artifact) - info = Messages.get(this, "inside", Messages.get(this, "artifact") ); - else if (heap.peek() instanceof Wand) - info = Messages.get(this, "inside", Messages.get(this, "wand") ); - else if (heap.peek() instanceof Ring) - info = Messages.get(this, "inside", Messages.get(this, "ring") ); - else - info = ""; //This shouldn't happen - } else { - title = Messages.get(this, "locked_chest"); - info = Messages.get(this, "need_key"); - } - - fillFields(heap.image(), heap.glowing(), TITLE_COLOR, title, info); - - } - } - - public WndInfoItem(Item item) { - - super(); - - int color = TITLE_COLOR; - if (item.levelKnown && item.level > 0) { - color = ItemSlot.UPGRADED; - } else if (item.levelKnown && item.level < 0) { - color = ItemSlot.DEGRADED; - } - - fillFields(item.image(), item.glowing(), color, item.toString(), - item.info()); - } - - private void fillFields(int image, ItemSprite.Glowing glowing, - int titleColor, String title, String info) { - - IconTitle titlebar = new IconTitle(); - titlebar.icon(new ItemSprite(image, glowing)); - titlebar.label(Messages.titleCase( title ), titleColor); - titlebar.setRect(0, 0, WIDTH, 0); - add(titlebar); - - RenderedTextMultiline txtInfo = PixelScene.renderMultiline( info, 6 ); - txtInfo.maxWidth(WIDTH); - txtInfo.setPos(titlebar.left(), titlebar.bottom() + GAP); - add( txtInfo ); - - resize( WIDTH, (int)(txtInfo.top() + txtInfo.height()) ); - } -} diff --git a/java/com/hmdzl/spspd/change/windows/WndInfoMob.java b/java/com/hmdzl/spspd/change/windows/WndInfoMob.java deleted file mode 100644 index f98c9fc5..00000000 --- a/java/com/hmdzl/spspd/change/windows/WndInfoMob.java +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.windows; - -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.scenes.PixelScene; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.CharSprite; -import com.hmdzl.spspd.change.ui.BuffIndicator; -import com.hmdzl.spspd.change.ui.HealthBar; - -import com.watabou.noosa.BitmapText; -import com.watabou.noosa.ui.Component; -import com.watabou.noosa.RenderedText; - -public class WndInfoMob extends WndTitledMessage { - - public WndInfoMob(Mob mob) { - - super(new MobTitle(mob), desc(mob)); - - } - - private static String desc(Mob mob) { - - StringBuilder builder = new StringBuilder(mob.description()); - - builder.append("\n\n" + mob.state.status()); - - return builder.toString(); - } - - private static class MobTitle extends Component { - - private static final int GAP = 2; - - private CharSprite image; - private RenderedText name; - private HealthBar health; - private BuffIndicator buffs; - - public MobTitle(Mob mob) { - - name = PixelScene.renderText(Messages.titleCase(mob.name), 9); - name.hardlight(TITLE_COLOR); - //name.measure(); - add(name); - - image = mob.sprite(); - add(image); - - health = new HealthBar(); - health.level((float) mob.HP / mob.HT); - add(health); - - buffs = new BuffIndicator(mob); - add(buffs); - } - - @Override - protected void layout() { - - image.x = 0; - image.y = Math.max(0, name.height() + GAP + health.height() - - image.height); - - name.x = image.width + GAP; - name.y = image.height - health.height() - GAP - name.baseLine(); - - float w = width - image.width - GAP; - - health.setRect(image.width + GAP, image.height - health.height(), - w, health.height()); - - buffs.setPos( name.x + name.width() + GAP-1, - name.y + name.baseLine() - BuffIndicator.SIZE-2 ); - - - height = health.bottom(); - } - } -} diff --git a/java/com/hmdzl/spspd/change/windows/WndInfoPlant.java b/java/com/hmdzl/spspd/change/windows/WndInfoPlant.java deleted file mode 100644 index 85fe1786..00000000 --- a/java/com/hmdzl/spspd/change/windows/WndInfoPlant.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.windows; - -import com.hmdzl.spspd.change.plants.Plant; -import com.hmdzl.spspd.change.sprites.PlantSprite; - -public class WndInfoPlant extends WndTitledMessage { - - public WndInfoPlant(Plant plant) { - - super(new PlantSprite(plant.image), plant.plantName, plant.desc()); - - } -} diff --git a/java/com/hmdzl/spspd/change/windows/WndInfoTrap.java b/java/com/hmdzl/spspd/change/windows/WndInfoTrap.java deleted file mode 100644 index d2917165..00000000 --- a/java/com/hmdzl/spspd/change/windows/WndInfoTrap.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * Shattered Pixel Dungeon - * Copyright (C) 2014-2015 Evan Debenham - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.windows; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.levels.traps.Trap; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.TrapSprite; - -public class WndInfoTrap extends WndTitledMessage { - - public WndInfoTrap(Trap trap) { - - super(new TrapSprite( trap.color + (trap.shape * 16) ), - trap.name, - (!trap.active ? Messages.get(WndInfoTrap.class, "inactive") + "\n\n" : "") + trap.desc()); - - } - -} diff --git a/java/com/hmdzl/spspd/change/windows/WndItem.java b/java/com/hmdzl/spspd/change/windows/WndItem.java deleted file mode 100644 index e30db006..00000000 --- a/java/com/hmdzl/spspd/change/windows/WndItem.java +++ /dev/null @@ -1,164 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.windows; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.scenes.PixelScene; -import com.hmdzl.spspd.change.sprites.ItemSprite; -import com.hmdzl.spspd.change.ui.ItemSlot; -import com.hmdzl.spspd.change.ui.RedButton; -import com.hmdzl.spspd.change.ui.Window; -import com.hmdzl.spspd.change.ui.RedButton; -import com.hmdzl.spspd.change.ui.RenderedTextMultiline; -import com.hmdzl.spspd.change.messages.Messages; - -import com.watabou.noosa.BitmapTextMultiline; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.Comparator; - -public class WndItem extends Window { - - private static final float BUTTON_WIDTH = 36; - private static final float BUTTON_HEIGHT = 16; - - private static final float GAP = 2; - - private static final int WIDTH = 120; - - public WndItem( final WndBag owner, final Item item ){ - this( owner, item, owner != null ); - } - - public WndItem(final WndBag owner, final Item item , final boolean options) { - - super(); - - IconTitle titlebar = new IconTitle(); - titlebar.icon(new ItemSprite(item.image(), item.glowing())); - titlebar.label(Messages.titleCase(item.toString())); - titlebar.setRect(0, 0, WIDTH, 0); - add(titlebar); - - if (item.levelKnown && item.level > 0) { - titlebar.color(ItemSlot.UPGRADED); - } else if (item.levelKnown && item.level < 0) { - titlebar.color(ItemSlot.DEGRADED); - } - - RenderedTextMultiline info = PixelScene.renderMultiline( item.info(), 6 ); - info.maxWidth(WIDTH); - info.setPos(titlebar.left(), titlebar.bottom() + GAP); - add( info ); - - float y = info.top() + info.height() + GAP; - float x = 0; - - if (Dungeon.hero.isAlive() && /*owner != null*/ options) { - ArrayList line = new ArrayList<>(); - for (final String action : item.actions(Dungeon.hero)) { - - RedButton btn = new RedButton(Messages.get(item, "ac_" + action), 8 ) { - @Override - protected void onClick() { - //item.execute(Dungeon.hero, action); - //hide(); - //owner.hide(); - hide(); - if (owner != null && owner.parent != null) owner.hide(); - if (Dungeon.hero.isAlive()) item.execute( Dungeon.hero, action ); - }; - }; - btn.setSize(Math.max(BUTTON_WIDTH, btn.reqWidth()), - BUTTON_HEIGHT); - if (x + btn.width() > WIDTH) { - x = 0; - y += BUTTON_HEIGHT + GAP; - } - btn.setPos(x, y); - add(btn); - - if (action == item.defaultAction) { - btn.textColor(TITLE_COLOR); - } - - x += btn.width() + GAP; - } - } - - resize(WIDTH, (int) (y + (x > 0 ? BUTTON_HEIGHT : 0))); - } - private static void layoutButtons(ArrayList line, float extraWidth, float y){ - if (line == null || line.size() == 0 || extraWidth == 0) return; - if (line.size() == 1){ - line.get(0).setSize(line.get(0).width()+extraWidth, BUTTON_HEIGHT); - line.get(0).setPos( 0 , y ); - return; - } - ArrayList lineByWidths = new ArrayList<>(line); - Collections.sort(lineByWidths, widthComparator); - RedButton smallest, middle, largest; - smallest = lineByWidths.get(0); - middle = lineByWidths.get(1); - largest = null; - if (lineByWidths.size() == 3) { - largest = lineByWidths.get(2); - } - - float btnDiff = middle.width() - smallest.width(); - smallest.setSize(smallest.width() + Math.min(btnDiff, extraWidth), BUTTON_HEIGHT); - extraWidth -= btnDiff; - if (extraWidth > 0) { - if (largest == null) { - smallest.setSize(smallest.width() + extraWidth / 2, BUTTON_HEIGHT); - middle.setSize(middle.width() + extraWidth / 2, BUTTON_HEIGHT); - } else { - btnDiff = largest.width() - smallest.width(); - smallest.setSize(smallest.width() + Math.min(btnDiff, extraWidth/2), BUTTON_HEIGHT); - middle.setSize(middle.width() + Math.min(btnDiff, extraWidth/2), BUTTON_HEIGHT); - extraWidth -= btnDiff*2; - if (extraWidth > 0){ - smallest.setSize(smallest.width() + extraWidth / 3, BUTTON_HEIGHT); - middle.setSize(middle.width() + extraWidth / 3, BUTTON_HEIGHT); - largest.setSize(largest.width() + extraWidth / 3, BUTTON_HEIGHT); - } - } - } - - float x = 0; - for (RedButton btn : line){ - btn.setPos( x , y ); - x += btn.width()+1; - } - } - - private static Comparator widthComparator = new Comparator() { - @Override - public int compare(RedButton lhs, RedButton rhs) { - if (lhs.width() < rhs.width()){ - return -1; - } else if (lhs.width() == rhs.width()){ - return 0; - } else { - return 1; - } - } - }; -} diff --git a/java/com/hmdzl/spspd/change/windows/WndJournal.java b/java/com/hmdzl/spspd/change/windows/WndJournal.java deleted file mode 100644 index a77b83df..00000000 --- a/java/com/hmdzl/spspd/change/windows/WndJournal.java +++ /dev/null @@ -1,129 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.windows; - -import java.util.Collections; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.Journal; -import com.hmdzl.spspd.change.ShatteredPixelDungeon; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.PixelScene; -import com.hmdzl.spspd.change.ui.Icons; -import com.hmdzl.spspd.change.ui.ScrollPane; -import com.hmdzl.spspd.change.ui.Window; -import com.watabou.noosa.BitmapText; -import com.watabou.noosa.Image; -import com.watabou.noosa.ui.Component; -import com.watabou.noosa.RenderedText; - -public class WndJournal extends Window { - - private static final int WIDTH = 112; - private static final int HEIGHT_P = 160; - private static final int HEIGHT_L = 144; - - private static final int ITEM_HEIGHT = 18; - - private static final String TXT_TITLE = "Journal"; - - private RenderedText txtTitle; - private ScrollPane list; - - public WndJournal() { - - super(); - resize(WIDTH, ShatteredPixelDungeon.landscape() ? HEIGHT_L : HEIGHT_P); - - txtTitle = PixelScene.renderText(Messages.get(this, "title"), 9); - txtTitle.hardlight(Window.TITLE_COLOR); - //txtTitle.measure(); - txtTitle.x = PixelScene.align(PixelScene.uiCamera, - (WIDTH - txtTitle.width()) / 2); - add(txtTitle); - - Component content = new Component(); - - Collections.sort(Journal.records); - - float pos = 0; - for (Journal.Record rec : Journal.records) { - ListItem item = new ListItem(rec.feature, rec.depth); - item.setRect(0, pos, WIDTH, ITEM_HEIGHT); - content.add(item); - - pos += item.height(); - } - - content.setSize(WIDTH, pos); - - list = new ScrollPane(content); - add(list); - - list.setRect(0, txtTitle.height(), WIDTH, height - txtTitle.height()); - } - - private static class ListItem extends Component { - - private RenderedText feature; - private BitmapText depth; - - private Image icon; - - public ListItem(Journal.Feature f, int d) { - super(); - - feature.text(f.desc()); - //feature.measure(); - - depth.text(Integer.toString(d)); - depth.measure(); - - if (d == Dungeon.depth) { - feature.hardlight(TITLE_COLOR); - depth.hardlight(TITLE_COLOR); - } - } - - @Override - protected void createChildren() { - feature = PixelScene.renderText(9); - add(feature); - - depth = new BitmapText(PixelScene.font1x); - add(depth); - - icon = Icons.get(Icons.DEPTH); - add(icon); - } - - @Override - protected void layout() { - - icon.x = width - icon.width; - - depth.x = icon.x - 1 - depth.width(); - depth.y = PixelScene.align(y + (height - depth.height()) / 2); - - icon.y = depth.y - 1; - - feature.y = PixelScene.align(depth.y + depth.baseLine() - - feature.baseLine()); - } - } -} diff --git a/java/com/hmdzl/spspd/change/windows/WndLangs.java b/java/com/hmdzl/spspd/change/windows/WndLangs.java deleted file mode 100644 index 35acf78d..00000000 --- a/java/com/hmdzl/spspd/change/windows/WndLangs.java +++ /dev/null @@ -1,205 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * Shattered Pixel Dungeon - * Copyright (C) 2014-2015 Evan Debenham - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.windows; - -import com.hmdzl.spspd.change.SPSSettings; -import com.hmdzl.spspd.change.ShatteredPixelDungeon; -import com.hmdzl.spspd.change.messages.Languages; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.PixelScene; -import com.hmdzl.spspd.change.scenes.TitleScene; -import com.hmdzl.spspd.change.ui.RedButton; -import com.hmdzl.spspd.change.ui.RenderedTextMultiline; -import com.hmdzl.spspd.change.ui.Window; -import com.watabou.noosa.ColorBlock; -import com.watabou.noosa.Game; -import com.watabou.noosa.RenderedText; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Locale; - -public class WndLangs extends Window { - - private int WIDTH_P = 120; - private int WIDTH_L = 171; - - private int MIN_HEIGHT = 110; - - private int BTN_WIDTH = 50; - private int BTN_HEIGHT = 14; - - public WndLangs(){ - - super(); - - final ArrayList langs = new ArrayList<>(Arrays.asList(Languages.values())); - - Languages nativeLang = Languages.matchLocale(Locale.getDefault()); - langs.remove(nativeLang); - //move the native language to the top. - langs.add(0, nativeLang); - - final Languages currLang = Messages.lang(); - - //language buttons layout - int y = 0; - for (int i = 0; i < langs.size(); i++){ - final int langIndex = i; - RedButton btn = new RedButton(Messages.titleCase(langs.get(i).nativeName())){ - @Override - protected void onClick() { - super.onClick(); - Messages.setup(langs.get(langIndex)); - ShatteredPixelDungeon.switchNoFade(TitleScene.class, new Game.SceneChangeCallback() { - @Override - public void beforeCreate() { - SPSSettings.language(langs.get(langIndex)); - RenderedText.clearCache(); - } - @Override - public void afterCreate() { - Game.scene().add(new WndLangs()); - } - }); - } - }; - if (currLang == langs.get(i)){ - btn.textColor(TITLE_COLOR); - } else { - switch (langs.get(i).status()) { - case INCOMPLETE: - btn.textColor(0x999999); - break; - case UNREVIEWED: - btn.textColor(0xCCCCCC); - break; - } - } - btn.setSize(BTN_WIDTH, BTN_HEIGHT); - if (ShatteredPixelDungeon.landscape() && i % 2 == 1){ - btn.setPos(BTN_WIDTH+1, y-15); - } else { - btn.setPos(0, y); - y += BTN_HEIGHT + 1; - } - - add(btn); - } - y = Math.max(MIN_HEIGHT, y+1); - resize(ShatteredPixelDungeon.landscape() ? WIDTH_L : WIDTH_P, y); - - int textLeft = width - 65; - int textWidth = width - textLeft; - - ColorBlock separator = new ColorBlock(1, y, 0xFF000000); - separator.x = textLeft - 2.5f; - add(separator); - - //language info layout. - RenderedText title = PixelScene.renderText( Messages.titleCase(currLang.nativeName()) , 9 ); - title.x = textLeft + (textWidth - title.width())/2f; - title.y = 0; - title.hardlight(TITLE_COLOR); - PixelScene.align(title); - add(title); - - if (currLang == Languages.ENGLISH){ - - RenderedTextMultiline info = PixelScene.renderMultiline(6); - info.text("This is the source language, written by the developer.", width - textLeft); - info.setPos(textLeft, title.height() + 2); - add(info); - - } else { - - RenderedTextMultiline info = PixelScene.renderMultiline(6); - switch (currLang.status()) { - case REVIEWED: - info.text(Messages.get(this, "completed"), width - textLeft); - break; - case UNREVIEWED: - info.text(Messages.get(this, "unreviewed"), width - textLeft); - break; - case INCOMPLETE: - info.text(Messages.get(this, "unfinished"), width - textLeft); - break; - } - info.setPos(textLeft, title.height() + 2); - add(info); - - RedButton creditsBtn = new RedButton(Messages.titleCase(Messages.get(this, "credits"))){ - @Override - protected void onClick() { - super.onClick(); - String creds = ""; - String[] reviewers = currLang.reviewers(); - String[] translators = currLang.translators(); - if (reviewers.length > 0){ - creds += "_" + Messages.titleCase(Messages.get(WndLangs.class, "reviewers")) + "_\n"; - for (String reviewer : reviewers){ - creds += "-" + reviewer + "\n"; - } - creds += "\n"; - } - - if (reviewers.length > 0 || translators.length > 0){ - creds += "_" + Messages.titleCase(Messages.get(WndLangs.class, "translators")) + "_"; - //reviewers are also translators - for (String reviewer : reviewers){ - creds += "\n-" + reviewer; - } - for (String translator : translators){ - creds += "\n-" + translator; - } - } - - Window credits = new Window(); - - RenderedTextMultiline title = PixelScene.renderMultiline(9); - title.text(Messages.titleCase(Messages.get(WndLangs.class, "credits")) , 65); - title.hardlight(SHPX_COLOR); - title.setPos((65 - title.width())/2, 0); - credits.add(title); - - RenderedTextMultiline text = PixelScene.renderMultiline(6); - text.text(creds, 65); - text.setPos(0, title.bottom() + 2); - credits.add(text); - - credits.resize(65, (int)text.bottom()); - parent.add(credits); - } - }; - creditsBtn.setSize(creditsBtn.reqWidth() + 2, 16); - creditsBtn.setPos(textLeft + (textWidth - creditsBtn.width()) / 2f, y - 18); - add(creditsBtn); - - RenderedTextMultiline transifex_text = PixelScene.renderMultiline(6); - transifex_text.text(Messages.get(this, "transifex"), width - textLeft); - transifex_text.setPos(textLeft, creditsBtn.top() - 2 - transifex_text.height()); - add(transifex_text); - - } - - } - -} diff --git a/java/com/hmdzl/spspd/change/windows/WndList.java b/java/com/hmdzl/spspd/change/windows/WndList.java deleted file mode 100644 index bee8babe..00000000 --- a/java/com/hmdzl/spspd/change/windows/WndList.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.windows; - -import com.hmdzl.spspd.change.scenes.PixelScene; -import com.hmdzl.spspd.change.ui.Window; -import com.watabou.noosa.RenderedText; -import com.watabou.noosa.BitmapTextMultiline; - -public class WndList extends Window { - - private static final int WIDTH = 120; - private static final int MARGIN = 4; - private static final int GAP = 4; - - //private static final String DOT = "\u007F"; - - public WndList(String[] items) { - - super(); - - float pos = MARGIN; - float dotWidth = 0; - float maxWidth = 0; - - for (int i = 0; i < items.length; i++) { - - if (i > 0) { - pos += GAP; - } - - RenderedText dot = PixelScene.renderText( "-", 6 ); - dot.x = MARGIN; - dot.y = pos; - if (dotWidth == 0) { - dotWidth = dot.width(); - } - add( dot ); - - BitmapTextMultiline item = PixelScene.createMultiline(items[i], 6); - item.x = dot.x + dotWidth; - item.y = pos; - item.maxWidth = (int) (WIDTH - MARGIN * 2 - dotWidth); - item.measure(); - add(item); - - pos += item.height(); - float w = item.width(); - if (w > maxWidth) { - maxWidth = w; - } - } - - resize((int) (maxWidth + dotWidth + MARGIN * 2), (int) (pos + MARGIN)); - } -} diff --git a/java/com/hmdzl/spspd/change/windows/WndMessage.java b/java/com/hmdzl/spspd/change/windows/WndMessage.java deleted file mode 100644 index a22d4218..00000000 --- a/java/com/hmdzl/spspd/change/windows/WndMessage.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.windows; - -import com.hmdzl.spspd.change.ShatteredPixelDungeon; -import com.hmdzl.spspd.change.scenes.PixelScene; -import com.hmdzl.spspd.change.ui.RenderedTextMultiline; -import com.hmdzl.spspd.change.ui.Window; - -public class WndMessage extends Window { - - private static final int WIDTH_P = 120; - private static final int WIDTH_L = 144; - private static final int MARGIN = 4; - - public WndMessage( String text ) { - - super(); - - RenderedTextMultiline info = PixelScene.renderMultiline( text, 6 ); - info.maxWidth((ShatteredPixelDungeon.landscape() ? WIDTH_L : WIDTH_P) - MARGIN * 2); - info.setPos(MARGIN, MARGIN); - add( info ); - - resize( - (int)info.width() + MARGIN * 2, - (int)info.height() + MARGIN * 2 ); - } -} diff --git a/java/com/hmdzl/spspd/change/windows/WndMix.java b/java/com/hmdzl/spspd/change/windows/WndMix.java deleted file mode 100644 index ed360f62..00000000 --- a/java/com/hmdzl/spspd/change/windows/WndMix.java +++ /dev/null @@ -1,290 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * Shattered Pixel Dungeon - * Copyright (C) 2014-2018 Evan Debenham - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ - -package com.hmdzl.spspd.change.windows; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.Generator; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.rings.Ring; -import com.hmdzl.spspd.change.items.food.completefood.Garbage; -import com.hmdzl.spspd.change.items.wands.Wand; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.scenes.PixelScene; -import com.hmdzl.spspd.change.sprites.HeroSprite; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.ui.Icons; -import com.hmdzl.spspd.change.ui.ItemSlot; -import com.hmdzl.spspd.change.ui.RedButton; -import com.hmdzl.spspd.change.ui.RenderedTextMultiline; -import com.hmdzl.spspd.change.ui.Window; -import com.watabou.noosa.ColorBlock; -import com.watabou.noosa.Image; -import com.watabou.noosa.audio.Sample; -import com.watabou.noosa.particles.Emitter; - -import java.util.ArrayList; - -import static com.hmdzl.spspd.change.Dungeon.hero; - -public class WndMix extends Window { - - private WndBlacksmith.ItemButton[] inputs = new WndBlacksmith.ItemButton[3]; - private ItemSlot output; - - private Emitter smokeEmitter; - private Emitter bubbleEmitter; - - private RedButton btnCombine; - - private static final int WIDTH_P = 116; - private static final int WIDTH_L = 160; - - private static final int BTN_SIZE = 28; - - public WndMix(){ - - int w = WIDTH_P; - - int h = 0; - - IconTitle titlebar = new IconTitle(); - titlebar.icon(HeroSprite.avatar(hero.heroClass, hero.useskin())); - titlebar.label( Messages.get(this, "title") ); - titlebar.setRect( 0, 0, w, 0 ); - add( titlebar ); - - h += titlebar.height() + 2; - - RenderedTextMultiline desc = PixelScene.renderMultiline(6); - desc.text( Messages.get(this, "text") ); - desc.setPos(0, h); - desc.maxWidth(w); - add(desc); - - h += desc.height() + 6; - - for (int i = 0; i < (inputs.length); i++) { - inputs[i] = new WndBlacksmith.ItemButton(){ - @Override - protected void onClick() { - super.onClick(); - if (item != null){ - Dungeon.gold-=1000; - if (!item.collect()){ - Dungeon.level.drop(item, hero.pos); - } - item = null; - slot.item(new WndBag.Placeholder(ItemSpriteSheet.SOMETHING)); - } - GameScene.selectItem( itemSelector, WndBag.Mode.CANBEMIX, Messages.get(WndAlchemy.class, "select") ); - } - }; - inputs[i].setRect(15, h, BTN_SIZE, BTN_SIZE); - add(inputs[i]); - h += BTN_SIZE + 2; - } - - Image arrow = Icons.get(Icons.RESUME); - arrow.hardlight(0, 0, 0); - arrow.x = (w - arrow.width)/2f; - arrow.y = inputs[1].top() + (inputs[1].height() - arrow.height)/2f; - PixelScene.align(arrow); - add(arrow); - - output = new ItemSlot(){ - @Override - protected void onClick() { - super.onClick(); - /*if (visible){ - GameScene.show(new WndInfoItem); - }*/ - } - }; - output.setRect(w - BTN_SIZE - 15, inputs[1].top(), BTN_SIZE, BTN_SIZE); - - ColorBlock outputBG = new ColorBlock(output.width(), output.height(), 0x9991938C); - outputBG.x = output.left(); - outputBG.y = output.top(); - add(outputBG); - - add(output); - output.visible = false; - - bubbleEmitter = new Emitter(); - smokeEmitter = new Emitter(); - bubbleEmitter.pos(outputBG.x + (BTN_SIZE-16)/2f, outputBG.y + (BTN_SIZE-16)/2f, 16, 16); - smokeEmitter.pos(bubbleEmitter.x, bubbleEmitter.y, bubbleEmitter.width, bubbleEmitter.height); - bubbleEmitter.autoKill = false; - smokeEmitter.autoKill = false; - add(bubbleEmitter); - add(smokeEmitter); - - h += 4; - - float btnWidth = (w-14)/2f; - - btnCombine = new RedButton(Messages.get(this, "combine")){ - @Override - protected void onClick() { - super.onClick(); - combine(); - } - }; - btnCombine.setRect(5, h, btnWidth, 18); - PixelScene.align(btnCombine); - btnCombine.enable(false); - add(btnCombine); - - RedButton btnCancel = new RedButton(Messages.get(this, "cancel")){ - @Override - protected void onClick() { - super.onClick(); - onBackPressed(); - } - }; - btnCancel.setRect(w - 5 - btnWidth, h, btnWidth, 18); - PixelScene.align(btnCancel); - add(btnCancel); - - h += btnCancel.height(); - - resize(w, h); - } - - protected WndBag.Listener itemSelector = new WndBag.Listener() { - @Override - public void onSelect( Item item ) { - if (item != null) { - for (int i = 0; i < (inputs.length); i++) { - if (inputs[i].item == null){ - //inputs[i].item(hero.belongings.misc1 = null); - //inputs[i].item(hero.belongings.misc2 = null); - //inputs[i].item(hero.belongings.misc3 = null); - inputs[i].item(item.detach(hero.belongings.backpack)); - break; - } - } - } - updateState(); - } - }; - - private ArrayList filterInput(Class itemClass){ - ArrayList filtered = new ArrayList<>(); - for (int i = 0; i < (inputs.length); i++){ - Item item = inputs[i].item; - if (item != null && itemClass.isInstance(item)){ - filtered.add((T)item); - } - } - return filtered; - } - - private void updateState(){ - //potion creation - if(filterInput(Item.class).size() > 0 && Dungeon.gold > 1000){ - output.item(new WndBag.Placeholder(ItemSpriteSheet.SOMETHING)); - output.visible = true; - btnCombine.enable(true); - } else { - btnCombine.enable(false); - output.visible = false; - } - } - - private void combine(){ - ArrayList rings = filterInput(Ring.class); - ArrayList wands = filterInput(Wand.class); - Item result = null; - - if (rings.size() == 3){ - - result = Generator.random( Generator.Category.ARTIFACT ); - - } else if (wands.size() == 3){ - - result = Generator.random( Generator.Category.ARTIFACT ); - - } else if (rings.size() == 2 && wands.size() == 1){ - - result = Generator.random( Generator.Category.EGGS ); - - } else if (rings.size() == 1 && wands.size() == 2){ - - result = Generator.random( Generator.Category.EGGS ); - - } else if (rings.size() == 1 && wands.size() == 1){ - - result = Generator.random( Generator.Category.SUMMONED); - - } else if (rings.size() == 2){ - - result = Generator.random( Generator.Category.RING); - - } else if (rings.size() == 1){ - - result = Generator.random( Generator.Category.WAND); - - } else if (wands.size() == 2){ - - result = Generator.random( Generator.Category.WAND ); - - } else if (wands.size() == 1){ - - result = Generator.random( Generator.Category.RING ); - - } else result = new Garbage(); - - if (result != null){ - bubbleEmitter.start(Speck.factory( Speck.BUBBLE ), 0.2f, 10 ); - smokeEmitter.burst(Speck.factory( Speck.WOOL ), 10 ); - Sample.INSTANCE.play( Assets.SND_PUFF ); - - output.item(result); - if (!result.collect()){ - Dungeon.level.drop(result, hero.pos); - } - for (int i = 0; i < (inputs.length ); i++){ - inputs[i].slot.item(new WndBag.Placeholder(ItemSpriteSheet.SOMETHING)); - inputs[i].item = null; - } - - btnCombine.enable(false); - } - - } - - @Override - public void onBackPressed() { - for (int i = 0; i < (inputs.length ); i++) { - if (inputs[i].item != null){ - if (!inputs[i].item.collect()){ - Dungeon.level.drop(inputs[i].item, hero.pos); - } - } - } - super.onBackPressed(); - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/windows/WndONS.java b/java/com/hmdzl/spspd/change/windows/WndONS.java deleted file mode 100644 index bc0f9b4a..00000000 --- a/java/com/hmdzl/spspd/change/windows/WndONS.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.windows; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.mobs.npcs.Imp; -import com.hmdzl.spspd.change.actors.mobs.npcs.OldNewStwist; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.quest.DwarfToken; -import com.hmdzl.spspd.change.items.quest.GnollClothes; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.PixelScene; -import com.hmdzl.spspd.change.sprites.ItemSprite; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.ui.RedButton; -import com.hmdzl.spspd.change.ui.RenderedTextMultiline; -import com.hmdzl.spspd.change.ui.Window; -import com.hmdzl.spspd.change.utils.GLog; - - -public class WndONS extends Window { - - private static final int WIDTH = 120; - private static final int BTN_HEIGHT = 20; - private static final int GAP = 2; - - public WndONS(final OldNewStwist ONS, final GnollClothes clothes) { - - super(); - - IconTitle titlebar = new IconTitle(); - titlebar.icon(new ItemSprite(clothes.image(), null)); - titlebar.label(Messages.titleCase(clothes.name())); - titlebar.setRect(0, 0, WIDTH, 0); - add(titlebar); - - RenderedTextMultiline message = PixelScene - .renderMultiline(Messages.get(this, "message"), 6); - message.maxWidth(WIDTH); - message.setPos(0, titlebar.bottom() + GAP); - add(message); - - RedButton btnReward = new RedButton(Messages.get(this, "give")) { - @Override - protected void onClick() { - Dungeon.gnollmission = true; - clothes.detach(Dungeon.hero.belongings.backpack); - hide(); - } - }; - btnReward.setRect(0, message.top() + message.height() + GAP, WIDTH, - BTN_HEIGHT); - add(btnReward); - - resize(WIDTH, (int) btnReward.bottom()); - } -} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/change/windows/WndOptions.java b/java/com/hmdzl/spspd/change/windows/WndOptions.java deleted file mode 100644 index 4115bf27..00000000 --- a/java/com/hmdzl/spspd/change/windows/WndOptions.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.windows; - -import com.hmdzl.spspd.change.ShatteredPixelDungeon; -import com.hmdzl.spspd.change.scenes.PixelScene; -import com.hmdzl.spspd.change.ui.RedButton; -import com.hmdzl.spspd.change.ui.Window; -import com.hmdzl.spspd.change.ui.RenderedTextMultiline; - -public class WndOptions extends Window { - - private static final int MARGIN = 2; - private static final int BUTTON_HEIGHT = 20; - - private static final int WIDTH_P = 120; - private static final int WIDTH_L = 144; - - public WndOptions( String title, String message, String... options ) { - super(); - - int width = ShatteredPixelDungeon.landscape() ? WIDTH_L : WIDTH_P; - - RenderedTextMultiline tfTitle = PixelScene.renderMultiline( title, 9 ); - tfTitle.hardlight( TITLE_COLOR ); - tfTitle.setPos(MARGIN, MARGIN); - tfTitle.maxWidth(width - MARGIN * 2); - add( tfTitle ); - - RenderedTextMultiline tfMesage = PixelScene.renderMultiline( 6 ); - tfMesage.text(message, width - MARGIN * 2); - tfMesage.setPos( MARGIN, tfTitle.top() + tfTitle.height() + MARGIN ); - add( tfMesage ); - - float pos = tfMesage.bottom() + MARGIN; - - for (int i=0; i < options.length; i++) { - final int index = i; - RedButton btn = new RedButton( options[i] ) { - @Override - protected void onClick() { - hide(); - onSelect( index ); - } - }; - btn.setRect( MARGIN, pos, width - MARGIN * 2, BUTTON_HEIGHT ); - add( btn ); - - pos += BUTTON_HEIGHT + MARGIN; - } - - resize( width, (int)pos ); - } - - protected void onSelect( int index ) {} -} diff --git a/java/com/hmdzl/spspd/change/windows/WndOtiluke.java b/java/com/hmdzl/spspd/change/windows/WndOtiluke.java deleted file mode 100644 index 005f5a64..00000000 --- a/java/com/hmdzl/spspd/change/windows/WndOtiluke.java +++ /dev/null @@ -1,140 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.windows; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.items.DolyaSlate; -import com.hmdzl.spspd.change.items.artifacts.TimekeepersHourglass; -import com.hmdzl.spspd.change.scenes.InterlevelScene; -import com.hmdzl.spspd.change.scenes.PixelScene; -import com.hmdzl.spspd.change.sprites.ItemSprite; -import com.hmdzl.spspd.change.ui.RedButton; -import com.hmdzl.spspd.change.ui.Window; - -import com.watabou.noosa.Game; -import com.hmdzl.spspd.change.ui.RenderedTextMultiline; - -public class WndOtiluke extends Window { - - - - private static final String TXT_FARAWELL = Messages.get(WndOtiluke.class,"title"); - public static final float TIME_TO_USE = 1; - - - private static final int PAGES = 10; - private static final int WIDTH = 120; - private static final int BTN_HEIGHT = 20; - private static final float GAP = 2; - - public WndOtiluke(final boolean[] rooms, final DolyaSlate item) { - - super(); - - String[] roomNames = new String[PAGES]; - roomNames[0] = Messages.get(this,"room1"); - roomNames[1] = Messages.get(this,"room2"); - roomNames[2] = Messages.get(this,"room3"); - roomNames[3] = Messages.get(this,"room4"); - roomNames[4] = Messages.get(this,"room5"); - roomNames[5] = Messages.get(this,"room6"); - roomNames[6] = Messages.get(this,"room7"); - roomNames[7] = Messages.get(this,"room8"); - - IconTitle titlebar = new IconTitle(); - titlebar.icon(new ItemSprite(item.image(), null)); - titlebar.label(Messages.titleCase(item.name())); - titlebar.setRect(0, 0, WIDTH, 0); - add(titlebar); - - RenderedTextMultiline message = PixelScene.renderMultiline(TXT_FARAWELL, 6); - message.maxWidth(WIDTH); - message.setPos(0,titlebar.bottom() + GAP); - add(message); - - //add each button - //after n*BTN_HEIGHT+GAP - //add port function - - if (rooms[0]){ - RedButton btn1 = new RedButton(roomNames[0]) { - @Override - protected void onClick() { - item.returnDepth = Dungeon.depth; - item.returnPos = Dungeon.hero.pos; - port(0, item.firsts[0]); - item.firsts[0]=false; - if (item.charge> 500) {item.charge-=500;} - } - }; - btn1.setRect(0, message.top() + message.height() + GAP, WIDTH, BTN_HEIGHT); - add(btn1); - resize(WIDTH, (int) btn1.bottom()); - } - - int buttons=1; - - for (int i=1; i - */ -package com.hmdzl.spspd.change.windows; - -import com.hmdzl.spspd.change.items.Palantir; -import com.hmdzl.spspd.change.scenes.PixelScene; -import com.hmdzl.spspd.change.sprites.ItemSprite; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.ui.RedButton; -import com.hmdzl.spspd.change.ui.RenderedTextMultiline; -import com.hmdzl.spspd.change.ui.Window; - - -public class WndOtilukeMessage extends Window { - - private static final String TXT_MESSAGE = "The power of the Palantir has caused Zot to lose his mind. " - +"I have managed to trap him inside and set guardians. " - +"I will now sacrifice myself to create a powerful stone golem that will protect the Palantir, Zot's prison."; - private static final String TXT_REWARD = "Okay"; - - private static final int WIDTH = 120; - private static final int BTN_HEIGHT = 20; - private static final int GAP = 2; - - public WndOtilukeMessage() { - - super(); - - Palantir palantir = new Palantir(); - - IconTitle titlebar = new IconTitle(); - titlebar.icon(new ItemSprite(palantir.image(), null)); - titlebar.label(Messages.titleCase(palantir.name())); - titlebar.setRect(0, 0, WIDTH, 0); - add(titlebar); - - RenderedTextMultiline message = PixelScene - .renderMultiline(TXT_MESSAGE, 6); - message.maxWidth(WIDTH); - message.setPos(0,titlebar.bottom() + GAP); - add(message); - - RedButton btnReward = new RedButton(TXT_REWARD) { - @Override - protected void onClick() { - hide(); - } - }; - btnReward.setRect(0, message.top() + message.height() + GAP, WIDTH, - BTN_HEIGHT); - add(btnReward); - - resize(WIDTH, (int) btnReward.bottom()); - } - - -} diff --git a/java/com/hmdzl/spspd/change/windows/WndQuest.java b/java/com/hmdzl/spspd/change/windows/WndQuest.java deleted file mode 100644 index 080f3324..00000000 --- a/java/com/hmdzl/spspd/change/windows/WndQuest.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.windows; - -import com.hmdzl.spspd.change.actors.mobs.npcs.NPC; -import com.hmdzl.spspd.change.messages.Messages; - - -public class WndQuest extends WndTitledMessage { - - public WndQuest(NPC questgiver, String text) { - super(questgiver.sprite(),Messages.titleCase( questgiver.name ), text ); - } -} diff --git a/java/com/hmdzl/spspd/change/windows/WndRanking.java b/java/com/hmdzl/spspd/change/windows/WndRanking.java deleted file mode 100644 index 3ead6029..00000000 --- a/java/com/hmdzl/spspd/change/windows/WndRanking.java +++ /dev/null @@ -1,424 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.windows; - -import java.util.Locale; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Badges; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.Statistics; -import com.hmdzl.spspd.change.actors.hero.Belongings; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.scenes.PixelScene; -import com.hmdzl.spspd.change.sprites.HeroSprite; -import com.hmdzl.spspd.change.ui.BadgesList; -import com.hmdzl.spspd.change.ui.Icons; -import com.hmdzl.spspd.change.ui.ItemSlot; -import com.hmdzl.spspd.change.ui.RedButton; -import com.hmdzl.spspd.change.ui.ScrollPane; -import com.hmdzl.spspd.change.ui.Window; -import com.hmdzl.spspd.change.messages.Messages; - -import com.watabou.noosa.BitmapText; -import com.watabou.noosa.ColorBlock; -import com.watabou.noosa.Game; -import com.watabou.noosa.Group; -import com.watabou.noosa.Image; -import com.watabou.noosa.RenderedText; -import com.watabou.noosa.audio.Sample; -import com.watabou.noosa.ui.Button; - -public class WndRanking extends WndTabbed { - - private static final String TXT_ERROR = "Unable to load additional information"; - - private static final String TXT_STATS = "Stats"; - private static final String TXT_ITEMS = "Items"; - private static final String TXT_BADGES = "Badges"; - - private static final int WIDTH = 115; - private static final int HEIGHT = 180; - - private static final int TAB_WIDTH = 40; - - private Thread thread; - private String error = null; - - private Image busy; - - public WndRanking(final String gameFile) { - - super(); - resize(WIDTH, HEIGHT); - - thread = new Thread() { - @Override - public void run() { - try { - Badges.loadGlobal(); - Dungeon.loadGame(gameFile); - } catch (Exception e) { - error = Messages.get(WndRanking.class, "error"); - } - } - }; - thread.start(); - - busy = Icons.BUSY.get(); - busy.origin.set(busy.width / 2, busy.height / 2); - busy.angularSpeed = 720; - busy.x = (WIDTH - busy.width) / 2; - busy.y = (HEIGHT - busy.height) / 2; - add(busy); - } - - @Override - public void update() { - super.update(); - - if (thread != null && !thread.isAlive()) { - thread = null; - if (error == null) { - remove(busy); - createControls(); - } else { - hide(); - Game.scene().add(new WndError(error)); - } - } - } - - private void createControls() { - - String[] labels = - {Messages.get(this, "stats"), Messages.get(this, "items"), Messages.get(this, "badges")}; - Group[] pages = - { new StatsTab(), new ItemsTab(), new BadgesTab() }; - - for (int i = 0; i < pages.length; i++) { - - add(pages[i]); - - Tab tab = new RankingTab(labels[i], pages[i]); - add(tab); - } - - layoutTabs(); - - select(0); - } - - private class RankingTab extends LabeledTab { - - private Group page; - - public RankingTab(String label, Group page) { - super(label); - this.page = page; - } - - @Override - protected void select(boolean value) { - super.select(value); - if (page != null) { - page.visible = page.active = selected; - } - } - } - - private class StatsTab extends Group { - - private static final int GAP = 4; - - private static final String TXT_TITLE = "Level %d %s"; - - private static final String TXT_CHALLENGES = "Challenges"; - - private static final String TXT_HEALTH = "Health"; - private static final String TXT_STR = "Strength"; - //private static final String TXT_TEST = "Playtest Activated"; - - private static final String TXT_DURATION = "Game Duration"; - - private static final String TXT_DEPTH = "Maximum Depth"; - private static final String TXT_ENEMIES = "Mobs Killed"; - private static final String TXT_GOLD = "Gold Collected"; - - private static final String TXT_FOOD = "Food Eaten"; - private static final String TXT_ALCHEMY = "Potions Cooked"; - private static final String TXT_ANKHS = "Ankhs Used"; - private static final String TXT_WATERS = "Dew Waters"; - private static final String TXT_SHADOW = "Shadow Yogs Killed"; - - public StatsTab() { - super(); - - String heroClass = Dungeon.hero.className(); - - IconTitle title = new IconTitle(); - title.icon(HeroSprite.avatar(Dungeon.hero.heroClass, - Dungeon.hero.useskin())); - title.label( Messages.get(this, "title", Dungeon.hero.lvl, heroClass ).toUpperCase( Locale.ENGLISH ) ); - title.color(Window.SHPX_COLOR); - title.setRect(0, 0, WIDTH, 0); - add(title); - - float pos = title.bottom(); - - if (Dungeon.challenges > 0) { - RedButton btnCatalogus = new RedButton( Messages.get(this, "challenges")) { - @Override - protected void onClick() { - Game.scene().add( - new WndChallenges(Dungeon.challenges, false)); - } - }; - btnCatalogus.setRect(0, pos + GAP, btnCatalogus.reqWidth() + 2, - btnCatalogus.reqHeight() + 2); - add(btnCatalogus); - - pos = btnCatalogus.bottom(); - } - - pos += GAP + GAP; - - pos = statSlot(this, Messages.get(this, "str"), Integer.toString(Dungeon.hero.STR), - pos); - pos = statSlot(this, Messages.get(this, "health"), Integer.toString(Dungeon.hero.HT), - pos); - - pos += GAP; - - pos = statSlot(this, (Messages.get(this, "duration")),Integer.toString((int) Statistics.duration), pos); - - pos += GAP; - - pos = statSlot(this, Messages.get(this, "depth"), - Integer.toString(Statistics.deepestFloor), pos); - pos = statSlot(this, Messages.get(this, "enemies"), - Integer.toString(Statistics.enemiesSlain), pos); - pos = statSlot(this, Messages.get(this, "gold"), - Integer.toString(Statistics.goldCollected), pos); - - pos += GAP; - - pos = statSlot(this, Messages.get(this, "food"), - Integer.toString(Statistics.foodEaten), pos); - pos = statSlot(this, Messages.get(this, "alchemy"), - Integer.toString(Statistics.potionsCooked), pos); - pos = statSlot(this, Messages.get(this, "ankhs"), - Integer.toString(Statistics.ankhsUsed), pos); - - pos += GAP; - pos = statSlot(this, Messages.get(this, "water"), - Integer.toString(Statistics.waters), pos); - //pos = statSlot(this, TXT_SHADOW, - //Integer.toString(Statistics.shadowYogsKilled), pos); - } - - private float statSlot(Group parent, String label, String value, - float pos) { - - RenderedText txt = PixelScene.renderText( label, 7 ); - txt.y = pos; - parent.add( txt ); - - txt = PixelScene.renderText( value, 7 ); - txt.x = WIDTH * 0.65f; - txt.y = pos; - PixelScene.align(txt); - parent.add( txt ); - - return pos + GAP + txt.baseLine(); - } - } - - private class ItemsTab extends Group { - - private float pos; - - public ItemsTab() { - super(); - - Belongings stuff = Dungeon.hero.belongings; - if (stuff.weapon != null) { - addItem(stuff.weapon); - } - if (stuff.armor != null) { - addItem(stuff.armor); - } - if (stuff.misc1 != null) { - addItem(stuff.misc1); - } - if (stuff.misc2 != null) { - addItem(stuff.misc2); - } - if (stuff.misc3 != null) { - addItem(stuff.misc3); - } - } - - private void addItem( Item item ) { - ItemButton slot = new ItemButton( item ); - slot.setRect( 0, pos, width, ItemButton.HEIGHT ); - add( slot ); - - pos += slot.height() + 1; - } - } - - private class BadgesTab extends Group { - - public BadgesTab() { - super(); - - camera = WndRanking.this.camera; - - ScrollPane list = new BadgesList(false); - add(list); - - list.setSize(WIDTH, HEIGHT); - } - } - - private class ItemButton extends Button { - - public static final int HEIGHT = 28; - - private Item item; - - private ItemSlot slot; - private ColorBlock bg; - private RenderedText name; - - public ItemButton(Item item) { - - super(); - - this.item = item; - - slot.item(item); - if (item.cursed && item.cursedKnown) { - bg.ra = +0.2f; - bg.ga = -0.1f; - } else if (!item.isIdentified()) { - bg.ra = 0.1f; - bg.ba = 0.1f; - } - } - - @Override - protected void createChildren() { - - bg = new ColorBlock(HEIGHT, HEIGHT, 0xFF4A4D44); - add(bg); - - slot = new ItemSlot(); - add(slot); - - name = PixelScene.renderText("?", 7); - add(name); - - super.createChildren(); - } - - @Override - protected void layout() { - bg.x = x; - bg.y = y; - - slot.setRect(x, y, HEIGHT, HEIGHT); - - name.x = slot.right() + 2; - name.y = y + (height - name.baseLine()) / 2; - - String str = Messages.titleCase( item.name() ); - name.text(str); - if (name.width() > width - name.x) { - do { - str = str.substring(0, str.length() - 1); - name.text(str + "..."); - } while (name.width() > width - name.x); - } - - super.layout(); - } - - @Override - protected void onTouchDown() { - bg.brightness(1.5f); - Sample.INSTANCE.play(Assets.SND_CLICK, 0.7f, 0.7f, 1.2f); - }; - - @Override - protected void onTouchUp() { - bg.brightness(1.0f); - }; - - @Override - protected void onClick() { - Game.scene().add(new WndItem(null, item)); - } - } - - private class QuickSlotButton extends ItemSlot { - - public static final int HEIGHT = 28; - - private Item item; - private ColorBlock bg; - - QuickSlotButton(Item item) { - super(item); - this.item = item; - } - - @Override - protected void createChildren() { - bg = new ColorBlock(HEIGHT, HEIGHT, 0xFF4A4D44); - add(bg); - - super.createChildren(); - } - - @Override - protected void layout() { - bg.x = x; - bg.y = y; - - super.layout(); - } - - @Override - protected void onTouchDown() { - bg.brightness(1.5f); - Sample.INSTANCE.play(Assets.SND_CLICK, 0.7f, 0.7f, 1.2f); - }; - - @Override - protected void onTouchUp() { - bg.brightness(1.0f); - }; - - @Override - protected void onClick() { - Game.scene().add(new WndItem(null, item)); - } - } -} diff --git a/java/com/hmdzl/spspd/change/windows/WndResurrect.java b/java/com/hmdzl/spspd/change/windows/WndResurrect.java deleted file mode 100644 index 147df757..00000000 --- a/java/com/hmdzl/spspd/change/windows/WndResurrect.java +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.windows; - -import com.hmdzl.spspd.change.Rankings; -import com.hmdzl.spspd.change.Statistics; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.items.Ankh; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.InterlevelScene; -import com.hmdzl.spspd.change.scenes.PixelScene; -import com.hmdzl.spspd.change.sprites.ItemSprite; -import com.hmdzl.spspd.change.ui.RedButton; -import com.hmdzl.spspd.change.ui.RenderedTextMultiline; -import com.hmdzl.spspd.change.ui.Window; -import com.watabou.noosa.Game; - -public class WndResurrect extends Window { - - private static final int WIDTH = 120; - private static final int BTN_HEIGHT = 20; - private static final float GAP = 2; - - public static WndResurrect instance; - public static Object causeOfDeath; - - public WndResurrect(final Ankh ankh, Object causeOfDeath) { - - super(); - - instance = this; - WndResurrect.causeOfDeath = causeOfDeath; - - IconTitle titlebar = new IconTitle(); - titlebar.icon(new ItemSprite(ankh.image(), null)); - titlebar.label(ankh.name()); - titlebar.setRect(0, 0, WIDTH, 0); - add(titlebar); - - RenderedTextMultiline message = PixelScene - .renderMultiline(Messages.get(this, "message"), 6 ); - message.maxWidth(WIDTH); - message.setPos(0, titlebar.bottom() + GAP); - add(message); - - RedButton btnYes = new RedButton( Messages.get(this, "yes")) { - @Override - protected void onClick() { - hide(); - - Statistics.ankhsUsed++; - - InterlevelScene.mode = InterlevelScene.Mode.RESURRECT; - Game.switchScene(InterlevelScene.class); - } - }; - btnYes.setRect(0, message.top() + message.height() + GAP, WIDTH, BTN_HEIGHT); - add(btnYes); - - RedButton btnNo = new RedButton( Messages.get(this, "no")) { - @Override - protected void onClick() { - hide(); - - Rankings.INSTANCE.submit(false); - Hero.reallyDie(WndResurrect.causeOfDeath); - } - }; - btnNo.setRect(0, btnYes.bottom() + GAP, WIDTH, BTN_HEIGHT); - add(btnNo); - - resize(WIDTH, (int) btnNo.bottom()); - } - - @Override - public void destroy() { - super.destroy(); - instance = null; - } - - @Override - public void onBackPressed() { - } -} diff --git a/java/com/hmdzl/spspd/change/windows/WndSadGhost.java b/java/com/hmdzl/spspd/change/windows/WndSadGhost.java deleted file mode 100644 index 1e8a82b9..00000000 --- a/java/com/hmdzl/spspd/change/windows/WndSadGhost.java +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.windows; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.mobs.npcs.Ghost; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.PixelScene; -import com.hmdzl.spspd.change.sprites.FetidRatSprite; -import com.hmdzl.spspd.change.sprites.GnollTricksterSprite; -import com.hmdzl.spspd.change.sprites.GreatCrabSprite; -import com.hmdzl.spspd.change.ui.RedButton; -import com.hmdzl.spspd.change.ui.RenderedTextMultiline; -import com.hmdzl.spspd.change.ui.Window; -import com.hmdzl.spspd.change.utils.GLog; - -public class WndSadGhost extends Window { - - private static final int WIDTH = 120; - private static final int BTN_HEIGHT = 20; - private static final float GAP = 2; - - public WndSadGhost(final Ghost ghost, final int type) { - - super(); - - IconTitle titlebar = new IconTitle(); - RenderedTextMultiline message; - switch (type) { - case 1: - default: - titlebar.icon(new FetidRatSprite()); - titlebar.label( Messages.get(this, "rat_title") ); - message = PixelScene.renderMultiline(Messages.get(this, "rat")+Messages.get(this, "give_item"), 6 ); - break; - case 2: - titlebar.icon(new GnollTricksterSprite()); - titlebar.label(Messages.get(this, "gnoll_title")); - message = PixelScene.renderMultiline( Messages.get(this, "gnoll")+Messages.get(this, "give_item"), 6 ); - break; - case 3: - titlebar.icon(new GreatCrabSprite()); - titlebar.label( Messages.get(this, "crab_title")); - message = PixelScene.renderMultiline( Messages.get(this, "crab")+Messages.get(this, "give_item"), 6 ); - break; - - } - - titlebar.setRect(0, 0, WIDTH, 0); - add(titlebar); - - message.maxWidth(WIDTH); - message.setPos(0,titlebar.bottom() + GAP); - add(message); - - RedButton btnWeapon = new RedButton( Messages.get(this, "weapon")) { - @Override - protected void onClick() { - selectReward(ghost, Ghost.Quest.weapon); - } - }; - btnWeapon.setRect(0, message.top() + message.height() + GAP, WIDTH, - BTN_HEIGHT); - add(btnWeapon); - - - RedButton btnArmor = new RedButton( Messages.get(this, "armor")) { - @Override - protected void onClick() { - selectReward(ghost, Ghost.Quest.armor); - } - }; - btnArmor.setRect(0, btnWeapon.bottom() + GAP, WIDTH, BTN_HEIGHT); - add(btnArmor); - - resize(WIDTH, (int) btnArmor.bottom()); - - } - - private void selectReward(Ghost ghost, Item reward) { - - hide(); - - Dungeon.level.drop(reward, ghost.pos).sprite.drop(); - - ghost.yell(Messages.get(this, "farewell")); - ghost.die(null); - - Ghost.Quest.complete(); - } -} diff --git a/java/com/hmdzl/spspd/change/windows/WndSettings.java b/java/com/hmdzl/spspd/change/windows/WndSettings.java deleted file mode 100644 index 64d320f7..00000000 --- a/java/com/hmdzl/spspd/change/windows/WndSettings.java +++ /dev/null @@ -1,246 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.windows; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.SPSSettings; -import com.hmdzl.spspd.change.ShatteredPixelDungeon; -import com.hmdzl.spspd.change.messages.Languages; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.scenes.PixelScene; -import com.hmdzl.spspd.change.ui.CheckBox; -import com.hmdzl.spspd.change.ui.RedButton; -import com.hmdzl.spspd.change.ui.Toolbar; -import com.hmdzl.spspd.change.ui.Window; -import com.watabou.noosa.Game; -import com.watabou.noosa.Group; -import com.watabou.noosa.RenderedText; -import com.watabou.noosa.audio.Music; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.scenes.WelcomeScene; -import com.watabou.noosa.audio.Sample; -import com.watabou.noosa.Camera; - -public class WndSettings extends Window { - - private static final String TXT_ZOOM_IN = "+"; - private static final String TXT_ZOOM_OUT = "-"; - private static final String TXT_ZOOM_DEFAULT = "Default Zoom"; - - private static final String TXT_SCALE_UP = "Scale up UI"; - private static final String TXT_IMMERSIVE = "Immersive mode"; - - private static final String TXT_MUSIC = "Music"; - - private static final String TXT_SOUND = "Sound FX"; - - private static final String TXT_BRIGHTNESS = "Brightness"; - - private static final String TXT_QUICKSLOT = "More QuickSlot"; - - private static final String TXT_SWITCH_PORT = "Switch to portrait"; - private static final String TXT_SWITCH_LAND = "Switch to landscape"; - - private static final String TXT_SYSTEM_FONT = "System Font"; - - private static final int WIDTH = 112; - private static final int BTN_HEIGHT = 20; - private static final int GAP = 2; - - private RedButton btnZoomOut; - private RedButton btnZoomIn; - - public WndSettings(boolean inGame) { - super(); - - CheckBox btnImmersive = null; - - if (inGame) { - int w = BTN_HEIGHT; - - // Zoom out - btnZoomOut = new RedButton(Messages.get(WndSettings.class, "zoom_out")) { - @Override - protected void onClick() { - zoom(Camera.main.zoom - 1); - } - }; - add(btnZoomOut.setRect(0, 0, w, BTN_HEIGHT)); - - // Zoom in - btnZoomIn = new RedButton(Messages.get(WndSettings.class, "zoom_in")) { - @Override - protected void onClick() { - zoom(Camera.main.zoom + 1); - } - }; - add(btnZoomIn.setRect(WIDTH - w, 0, w, BTN_HEIGHT)); - - // Default zoom - add(new RedButton(Messages.get(WndSettings.class, "zoom_default")) { - @Override - protected void onClick() { - zoom(PixelScene.defaultZoom); - } - }.setRect(btnZoomOut.right(), 0, WIDTH - btnZoomIn.width() - - btnZoomOut.width(), BTN_HEIGHT)); - - } else { - - CheckBox btnScaleUp = new CheckBox(Messages.get(WndSettings.class, "scale_up")) { - @Override - protected void onClick() { - super.onClick(); - ShatteredPixelDungeon.scaleUp(checked()); - } - }; - btnScaleUp.setRect(0, 0, WIDTH, BTN_HEIGHT); - btnScaleUp.checked(ShatteredPixelDungeon.scaleUp()); - add(btnScaleUp); - - btnImmersive = new CheckBox(Messages.get(WndSettings.class, "immersive")) { - @Override - protected void onClick() { - super.onClick(); - ShatteredPixelDungeon.immerse(checked()); - } - }; - btnImmersive.setRect(0, btnScaleUp.bottom() + GAP, WIDTH, - BTN_HEIGHT); - btnImmersive.checked(ShatteredPixelDungeon.immersed()); - btnImmersive.enable(android.os.Build.VERSION.SDK_INT >= 19); - add(btnImmersive); - - } - - CheckBox btnMusic = new CheckBox(Messages.get(WndSettings.class, "music")) { - @Override - protected void onClick() { - super.onClick(); - ShatteredPixelDungeon.music(checked()); - } - }; - btnMusic.setRect(0, (btnImmersive != null ? btnImmersive.bottom() - : BTN_HEIGHT) + GAP, WIDTH, BTN_HEIGHT); - btnMusic.checked(ShatteredPixelDungeon.music()); - add(btnMusic); - - CheckBox btnSound = new CheckBox(Messages.get(WndSettings.class, "sound")) { - @Override - protected void onClick() { - super.onClick(); - ShatteredPixelDungeon.soundFx(checked()); - Sample.INSTANCE.play(Assets.SND_CLICK); - } - }; - btnSound.setRect(0, btnMusic.bottom() + GAP, WIDTH, BTN_HEIGHT); - btnSound.checked(ShatteredPixelDungeon.soundFx()); - add(btnSound); - - if (!inGame) { - - RedButton btnOrientation = new RedButton(orientationText()) { - @Override - protected void onClick() { - ShatteredPixelDungeon.landscape(!ShatteredPixelDungeon - .landscape()); - } - }; - btnOrientation.setRect(0, btnSound.bottom() + GAP, WIDTH, - BTN_HEIGHT); - add(btnOrientation); - - resize(WIDTH, (int) btnOrientation.bottom()); - - } else { - - CheckBox btnBrightness = new CheckBox(Messages.get(WndSettings.class, "brightness")) { - @Override - protected void onClick() { - super.onClick(); - ShatteredPixelDungeon.brightness(checked()); - } - }; - btnBrightness - .setRect(0, btnSound.bottom() + GAP, WIDTH, BTN_HEIGHT); - btnBrightness.checked(ShatteredPixelDungeon.brightness()); - add(btnBrightness); - - CheckBox btnQuickSlot = new CheckBox(Messages.get(WndSettings.class, "quickslot")) { - @Override - protected void onClick() { - super.onClick(); - ShatteredPixelDungeon.quickSlots(checked() ? 2 : 1); - Toolbar.QuickSlots = checked() ? 2 : 1; - } - }; - btnQuickSlot.setRect(0, btnBrightness.bottom() + GAP, WIDTH, - BTN_HEIGHT); - btnQuickSlot.checked(ShatteredPixelDungeon.quickSlots() == 2); - add(btnQuickSlot); - - //resize(WIDTH, (int) btnQuickSlot.bottom()); - - CheckBox chkFont = new CheckBox(Messages.get(WndSettings.class, "system_font")){ - @Override - protected void onClick() { - super.onClick(); - ShatteredPixelDungeon.switchNoFade((Class) ShatteredPixelDungeon.scene().getClass(), new Game.SceneChangeCallback() { - @Override - public void beforeCreate() { - SPSSettings.systemFont(checked()); - } - - @Override - public void afterCreate() { - Game.scene().add(new WndSettings(true)); - } - }); - } - }; - chkFont.setRect(0, btnQuickSlot.bottom() + GAP, WIDTH, BTN_HEIGHT); - chkFont.checked(SPSSettings.systemFont()); - add(chkFont); - - resize(WIDTH, (int) chkFont.bottom()); - - } - } - - - - private void zoom(float value) { - - Camera.main.zoom(value); - ShatteredPixelDungeon.zoom((int) (value - PixelScene.defaultZoom)); - - updateEnabled(); - } - - private void updateEnabled() { - float zoom = Camera.main.zoom; - btnZoomIn.enable(zoom < PixelScene.maxZoom); - btnZoomOut.enable(zoom > PixelScene.minZoom); - } - - private String orientationText() { - return ShatteredPixelDungeon.landscape() ? Messages.get(WndSettings.class, "switch_port") - : Messages.get(WndSettings.class, "switch_land"); - } -} diff --git a/java/com/hmdzl/spspd/change/windows/WndStory.java b/java/com/hmdzl/spspd/change/windows/WndStory.java deleted file mode 100644 index c1da2088..00000000 --- a/java/com/hmdzl/spspd/change/windows/WndStory.java +++ /dev/null @@ -1,138 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.windows; - -import com.hmdzl.spspd.change.Chrome; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.ShatteredPixelDungeon; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.PixelScene; -import com.hmdzl.spspd.change.ui.Window; -import com.watabou.input.Touchscreen.Touch; -import com.hmdzl.spspd.change.ui.RenderedTextMultiline; -import com.watabou.noosa.Game; -import com.watabou.noosa.TouchArea; -import com.watabou.utils.SparseArray; - -public class WndStory extends Window { - - private static final int WIDTH_P = 120; - private static final int WIDTH_L = 144; - private static final int MARGIN = 6; - - private static final float bgR = 0.77f; - private static final float bgG = 0.73f; - private static final float bgB = 0.62f; - - public static final int ID_SEWERS = 0; - public static final int ID_PRISON = 1; - public static final int ID_CAVES = 2; - public static final int ID_CITY = 3; - public static final int ID_HALLS = 4; - public static final int ID_SOKOBAN1 = 5; - public static final int ID_SOKOBAN2 = 6; - public static final int ID_SOKOBAN3 = 7; - public static final int ID_SOKOBAN4 = 8; - public static final int ID_SAFELEVEL = 9; - public static final int ID_TOWN = 10; - public static final int ID_CHAOS = 11; - public static final int ID_ZOT = 12; - - private static final SparseArray CHAPTERS = new SparseArray(); - - static { - CHAPTERS.put( ID_SEWERS, "sewers" ); - CHAPTERS.put( ID_PRISON, "prison" ); - CHAPTERS.put( ID_CAVES, "caves" ); - CHAPTERS.put( ID_CITY, "city" ); - CHAPTERS.put( ID_HALLS, "halls" ); - CHAPTERS.put( ID_SOKOBAN1, "sokoban1"); - CHAPTERS.put( ID_SOKOBAN2,"sokoban2"); - CHAPTERS.put( ID_SOKOBAN3,"sokoban3"); - CHAPTERS.put( ID_SOKOBAN4,"sokoban4"); - CHAPTERS.put( ID_SAFELEVEL,"safelevel"); - CHAPTERS.put( ID_TOWN,"town"); - CHAPTERS.put( ID_CHAOS,"chaos"); - CHAPTERS.put( ID_ZOT,"zot"); - } - - private RenderedTextMultiline tf; - - private float delay; - - public WndStory(String text) { - super(0, 0, Chrome.get(Chrome.Type.SCROLL)); - - tf = PixelScene.renderMultiline( text, 7 ); - tf.maxWidth(ShatteredPixelDungeon.landscape() ? - WIDTH_L - MARGIN * 2: - WIDTH_P - MARGIN *2); - tf.invert(); - tf.setPos(MARGIN, 0); - add( tf ); - - add(new TouchArea(chrome) { - @Override - protected void onClick(Touch touch) { - hide(); - } - }); - - resize((int) (tf.width() + MARGIN * 2), - (int) Math.min(tf.height(), 180)); - } - - @Override - public void update() { - super.update(); - - if (delay > 0 && (delay -= Game.elapsed) <= 0) { - shadow.visible = chrome.visible = tf.visible = true; - } - } - - public static void showChapter(int id) { - - if (Dungeon.chapters.contains(id)) { - return; - } - - String text = Messages.get(WndStory.class, CHAPTERS.get( id )); - if (text != null) { - WndStory wnd = new WndStory(text); - if ((wnd.delay = 0.6f) > 0) { - wnd.shadow.visible = wnd.chrome.visible = wnd.tf.visible = false; - } - - Game.scene().add(wnd); - - Dungeon.chapters.add(id); - } - } - - public static void showChapter(String text) { - if (text != null) { - WndStory wnd = new WndStory( text ); - if ((wnd.delay = 0.6f) > 0) { - wnd.chrome.visible = wnd.tf.visible = false; - } - - Game.scene().add( wnd ); - } - } -} diff --git a/java/com/hmdzl/spspd/change/windows/WndTabbed.java b/java/com/hmdzl/spspd/change/windows/WndTabbed.java deleted file mode 100644 index 4b494f34..00000000 --- a/java/com/hmdzl/spspd/change/windows/WndTabbed.java +++ /dev/null @@ -1,225 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.windows; - -import java.util.ArrayList; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Chrome; -import com.hmdzl.spspd.change.scenes.PixelScene; -import com.hmdzl.spspd.change.ui.Window; -import com.watabou.noosa.Game; -import com.watabou.noosa.NinePatch; -import com.watabou.noosa.RenderedText; -import com.watabou.noosa.audio.Sample; -import com.watabou.noosa.ui.Button; - -public class WndTabbed extends Window { - - protected ArrayList tabs = new ArrayList(); - protected Tab selected; - - public WndTabbed() { - super(0, 0, Chrome.get(Chrome.Type.TAB_SET)); - } - - protected Tab add(Tab tab) { - - tab.setPos( - tabs.size() == 0 ? -chrome.marginLeft() + 1 : tabs.get( - tabs.size() - 1).right(), height); - tab.select(false); - super.add(tab); - - tabs.add(tab); - - return tab; - } - - public void select(int index) { - select(tabs.get(index)); - } - - public void select(Tab tab) { - if (tab != selected) { - for (Tab t : tabs) { - if (t == selected) { - t.select(false); - } else if (t == tab) { - t.select(true); - } - } - - selected = tab; - } - } - - @Override - public void resize(int w, int h) { - // -> super.resize(...) - this.width = w; - this.height = h; - - chrome.size(width + chrome.marginHor(), height + chrome.marginVer()); - - camera.resize((int) chrome.width, - chrome.marginTop() + height + tabHeight()); - camera.x = (int) (Game.width - camera.screenWidth()) / 2; - camera.y = (int) (Game.height - camera.screenHeight()) / 2; - - shadow.boxRect(camera.x / camera.zoom, camera.y / camera.zoom, - chrome.width(), chrome.height); - // <- super.resize(...) - - for (Tab tab : tabs) { - remove(tab); - } - - ArrayList tabs = new ArrayList(this.tabs); - this.tabs.clear(); - - for (Tab tab : tabs) { - add(tab); - } - } - - public void layoutTabs() { - // subract two as there's extra horizontal space for those nobs on the - // top. - int fullWidth = width + chrome.marginHor() - 2; - int numTabs = tabs.size(); - - if (numTabs == 0) - return; - if (numTabs == 1) { - tabs.get(0).setSize(fullWidth, tabHeight()); - return; - } - - int spaces = numTabs - 1; - int spacing = -1; - - while (spacing == -1) { - for (int i = 0; i <= 3; i++) { - if ((fullWidth - i * (spaces)) % numTabs == 0) { - spacing = i; - break; - } - } - if (spacing == -1) - fullWidth--; - } - - int tabWidth = (fullWidth - spacing * (numTabs - 1)) / numTabs; - - for (int i = 0; i < tabs.size(); i++) { - tabs.get(i).setSize(tabWidth, tabHeight()); - tabs.get(i).setPos( - i == 0 ? -chrome.marginLeft() + 1 : tabs.get(i - 1).right() - + spacing, height); - } - - } - - protected int tabHeight() { - return 25; - } - - protected void onClick(Tab tab) { - select(tab); - } - - protected class Tab extends Button { - - protected final int CUT = 5; - - protected boolean selected; - - protected NinePatch bg; - - @Override - protected void layout() { - super.layout(); - - if (bg != null) { - bg.x = x; - bg.y = y; - bg.size(width, height); - } - } - - protected void select(boolean value) { - - active = !(selected = value); - - if (bg != null) { - remove(bg); - } - - bg = Chrome.get(selected ? Chrome.Type.TAB_SELECTED - : Chrome.Type.TAB_UNSELECTED); - addToBack(bg); - - layout(); - } - - @Override - protected void onClick() { - Sample.INSTANCE.play(Assets.SND_CLICK, 0.7f, 0.7f, 1.2f); - WndTabbed.this.onClick(this); - } - } - - protected class LabeledTab extends Tab { - - private RenderedText btLabel; - - public LabeledTab(String label) { - - super(); - - btLabel.text(label); - } - - @Override - protected void createChildren() { - super.createChildren(); - - btLabel = PixelScene.renderText(9); - add(btLabel); - } - - @Override - protected void layout() { - super.layout(); - - btLabel.x = PixelScene.align(x + (width - btLabel.width()) / 2); - btLabel.y = PixelScene.align(y + (height - btLabel.baseLine()) / 2) - 1; - if (!selected) { - btLabel.y -= 2; - } - } - - @Override - protected void select(boolean value) { - super.select(value); - btLabel.am = selected ? 1.0f : 0.6f; - } - } - -} diff --git a/java/com/hmdzl/spspd/change/windows/WndTinkerer.java b/java/com/hmdzl/spspd/change/windows/WndTinkerer.java deleted file mode 100644 index fae0d031..00000000 --- a/java/com/hmdzl/spspd/change/windows/WndTinkerer.java +++ /dev/null @@ -1,152 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.windows; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.Statistics; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Dewcharge; -import com.hmdzl.spspd.change.actors.mobs.npcs.Tinkerer1; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.quest.Mushroom; -import com.hmdzl.spspd.change.scenes.GameScene; -import com.hmdzl.spspd.change.scenes.PixelScene; -import com.hmdzl.spspd.change.sprites.ItemSprite; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.ui.RedButton; -import com.hmdzl.spspd.change.ui.RenderedTextMultiline; -import com.hmdzl.spspd.change.ui.Window; -import com.hmdzl.spspd.change.utils.GLog; - - -public class WndTinkerer extends Window { - - private static final String TXT_MESSAGE = "Thanks for the Toadstool Mushroom! " - +"I can upgrade your dew vial for you. " - +"I can make it either draw out dew from certain vanquished enemies, " - +"or I can make it able to regrow the surrounding dungeon by watering with dew. "; - - private static final String TXT_MESSAGE_WATER = "Water with dew allows you to grow high grass around you once you have 50 drops in your vial. " - +"Watering costs 2 drops but you will be able to find more drop, nuts, berries, and seeds by trampling the grass. "; - - - private static final String TXT_MESSAGE_DRAW = "Drawing out dew makes it so that mobs on special levels drop dew to fill your vial. " - +"Additionally, your character is buffed with dew charge at the start of each normal level. " - +"As long as you are dew charged, enemies drop dew to fill your vial. " - +"Each level dew charges you for a set amount of moves. " - +"Each level also has a move goal for killing all regular generated enemies. (Not special enemies like statues and piranha) " - +"Killing all regular enemies that were generated with the level clears that level. " - +"If you clear a level in less moves than the goal, the additional moves are added to your dew charge for the next level. " - +"You will need to clear the levels as fast as you can to get dew upgrades. " - +"The dew vial will also allow you to choose which item you apply upgrades to when blessing. "; - - private static final String TXT_WATER = "Water with Dew"; - private static final String TXT_DRAW = "Draw Out Dew"; - private static final String TXT_DRAW_INFO = "Tell me more about Draw Out Dew"; - - private static final String TXT_FARAWELL = "Good luck in your quest, %s!"; - private static final String TXT_FARAWELL_DRAW = "Good luck in your quest, %s! I'll give you a head start drawing out dew!"; - - - private static final int WIDTH = 120; - private static final int BTN_HEIGHT = 20; - private static final float GAP = 2; - - public WndTinkerer(final Tinkerer1 tinkerer, final Item item) { - - super(); - - IconTitle titlebar = new IconTitle(); - titlebar.icon(new ItemSprite(item.image(), null)); - titlebar.label(Messages.titleCase(item.name())); - titlebar.setRect(0, 0, WIDTH, 0); - add(titlebar); - - RenderedTextMultiline message = PixelScene - .renderMultiline(Messages.get(WndTinkerer.class, "info1"), 6); - message.maxWidth(WIDTH); - message.setPos(0, titlebar.bottom() + GAP); - add(message); - - RedButton btnBattle = new RedButton(Messages.get(WndTinkerer.class, "water")) { - @Override - protected void onClick() { - selectUpgrade(tinkerer, 1); - } - }; - btnBattle.setRect(0, message.top() + message.height() + GAP, WIDTH, - BTN_HEIGHT); - add(btnBattle); - - RedButton btnNonBattle = new RedButton(Messages.get(WndTinkerer.class, "draw")) { - @Override - protected void onClick() { - selectUpgrade(tinkerer, 2); - } - }; - - btnNonBattle.setRect(0, btnBattle.bottom() + GAP, WIDTH, BTN_HEIGHT); - add(btnNonBattle); - - RedButton btnNonBattle2 = new RedButton(Messages.get(WndTinkerer.class, "spinfo")) { - @Override - protected void onClick() { - GameScene.show(new WndDewDrawInfo(item)); - } - }; - btnNonBattle2.setRect(0, btnNonBattle.bottom() + GAP, WIDTH, BTN_HEIGHT); - add(btnNonBattle2); - - resize(WIDTH, (int) btnNonBattle2.bottom()); - } - - private void selectUpgrade(Tinkerer1 tinkerer, int type) { - - hide(); - - Mushroom mushroom = Dungeon.hero.belongings.getItem(Mushroom.class); - mushroom.detach(Dungeon.hero.belongings.backpack); - - if (type==1){ - - Dungeon.dewWater=true; - - } else if (type==2){ - - Dungeon.dewDraw=true; - } - - if (type==1){ - tinkerer.yell(Messages.get(this, "farewell", Dungeon.hero.givenName())); - Statistics.prevfloormoves=500; - Buff.prolong(Dungeon.hero, Dewcharge.class, Dewcharge.DURATION+50); - GLog.p(Messages.get(this,"dungeon")); - } else if (type==2){ - tinkerer.yell(Messages.get(this, "farewell", Dungeon.hero.givenName())); - Statistics.prevfloormoves=500; - Buff.prolong(Dungeon.hero, Dewcharge.class, Dewcharge.DURATION+50); - GLog.p(Messages.get(this,"dungeon")); - } - - tinkerer.destroy(); - - tinkerer.sprite.die(); - - //Wandmaker.Quest.complete(); - } -} diff --git a/java/com/hmdzl/spspd/change/windows/WndTinkerer2.java b/java/com/hmdzl/spspd/change/windows/WndTinkerer2.java deleted file mode 100644 index 5fa1119b..00000000 --- a/java/com/hmdzl/spspd/change/windows/WndTinkerer2.java +++ /dev/null @@ -1,166 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.windows; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.mobs.npcs.Tinkerer2; -import com.hmdzl.spspd.change.items.summon.ActiveMrDestructo; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.quest.Mushroom; -import com.hmdzl.spspd.change.items.summon.CallCoconut; -import com.hmdzl.spspd.change.items.summon.FairyCard; -import com.hmdzl.spspd.change.items.summon.Mobile; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.PixelScene; -import com.hmdzl.spspd.change.sprites.ItemSprite; -import com.hmdzl.spspd.change.ui.RedButton; -import com.hmdzl.spspd.change.ui.RenderedTextMultiline; -import com.hmdzl.spspd.change.ui.Window; - - -public class WndTinkerer2 extends Window { - - private static final String TXT_MESSAGE1 = "Thanks for the Toadstool Mushroom! " - +"In return, I can upgrade your mr destructo for you, " - +"or I can recharge your old one and give you another. "; - - private static final String TXT_MESSAGE2 = "Thanks for the Toadstool Mushroom! " - +"In return, I can upgrade your mr destructo for you. " - +"You can also have this other one I've managed to fix up. "; - - private static final String TXT_MESSAGE3 = "Thanks for the Toadstool Mushroom! " - +"In return, you can have this Mr Destructo if you like. "; - - private static final String TXT_UPGRADE = "Upgrade my Mr Destructo"; - private static final String TXT_RECHARGE = "Recharge my Mr Desructo"; - private static final String TXT_NEW = "I'll take the new Mr Desructo"; - - private static final String TXT_FARAWELL = "Good luck in your quest, %s!"; - - private static final int WIDTH = 120; - private static final int BTN_HEIGHT = 20; - private static final float GAP = 2; - - - public WndTinkerer2(final Tinkerer2 tinkerer, final Item item, final Item mrd) { - - super(); - - IconTitle titlebar = new IconTitle(); - titlebar.icon(new ItemSprite(item.image(), null)); - titlebar.label(Messages.titleCase(item.name())); - titlebar.setRect(0, 0, WIDTH, 0); - add(titlebar); - - RenderedTextMultiline message = PixelScene.renderMultiline(Messages.get(this, "info"), 6); - message.maxWidth(WIDTH); - message.setPos(0, titlebar.bottom() + GAP); - add(message); - - RedButton btnMr = new RedButton(Messages.get(this, "mr")) { - @Override - protected void onClick() { - selectMr(tinkerer); - } - }; - btnMr.setRect(0, message.top() + message.height() + GAP, WIDTH, BTN_HEIGHT); - add(btnMr); - - RedButton btnCall = new RedButton(Messages.get(this, "call")) { - @Override - protected void onClick() { - selectCall(tinkerer); - } - }; - btnCall.setRect(0, btnMr.bottom() + GAP, WIDTH, BTN_HEIGHT); - add(btnCall); - - RedButton btnMob = new RedButton(Messages.get(this, "mob")) { - @Override - protected void onClick() { - selectMob(tinkerer); - } - }; - btnMob.setRect(0, btnCall.bottom() + GAP, WIDTH, BTN_HEIGHT); - add(btnMob); - - resize(WIDTH, (int) btnMob.bottom()); - - } - - private void selectMr(Tinkerer2 tinkerer) { - - hide(); - - Mushroom mushroom = Dungeon.hero.belongings.getItem(Mushroom.class); - mushroom.detach(Dungeon.hero.belongings.backpack); - - Dungeon.dewNorn = true; - - ActiveMrDestructo mrd = new ActiveMrDestructo(); - - Dungeon.level.drop(mrd, Dungeon.hero.pos).sprite.drop(); - - tinkerer.yell( Messages.get(this, "farewell", Dungeon.hero.givenName())); - tinkerer.destroy(); - - tinkerer.sprite.die(); - - //Wandmaker.Quest.complete(); - } - private void selectCall(Tinkerer2 tinkerer) { - - hide(); - - Mushroom mushroom = Dungeon.hero.belongings.getItem(Mushroom.class); - mushroom.detach(Dungeon.hero.belongings.backpack); - - Dungeon.dewNorn = true; - - FairyCard fc = new FairyCard(); - - Dungeon.level.drop(fc, Dungeon.hero.pos).sprite.drop(); - - tinkerer.yell( Messages.get(this, "farewell", Dungeon.hero.givenName())); - tinkerer.destroy(); - - tinkerer.sprite.die(); - - //Wandmaker.Quest.complete(); - } - private void selectMob(Tinkerer2 tinkerer) { - - hide(); - - Mushroom mushroom = Dungeon.hero.belongings.getItem(Mushroom.class); - mushroom.detach(Dungeon.hero.belongings.backpack); - - Dungeon.dewNorn = true; - - Mobile mob = new Mobile(); - - Dungeon.level.drop(mob, Dungeon.hero.pos).sprite.drop(); - - tinkerer.yell( Messages.get(this, "farewell", Dungeon.hero.givenName())); - tinkerer.destroy(); - - tinkerer.sprite.die(); - - //Wandmaker.Quest.complete(); - } -} diff --git a/java/com/hmdzl/spspd/change/windows/WndTinkerer3.java b/java/com/hmdzl/spspd/change/windows/WndTinkerer3.java deleted file mode 100644 index f73a5e5f..00000000 --- a/java/com/hmdzl/spspd/change/windows/WndTinkerer3.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.windows; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.mobs.npcs.Tinkerer3; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.quest.Mushroom; -import com.hmdzl.spspd.change.scenes.PixelScene; -import com.hmdzl.spspd.change.sprites.ItemSprite; -import com.hmdzl.spspd.change.ui.RedButton; -import com.hmdzl.spspd.change.ui.RenderedTextMultiline; -import com.hmdzl.spspd.change.ui.Window; -import com.hmdzl.spspd.change.messages.Messages; - - -public class WndTinkerer3 extends Window { - - private static final String TXT_MESSAGE = "Thanks for the Toadstool Mushroom! " - +"I can upgrade your dew vial for you. " - +"I can make it hold more and give you wings when you splash. "; - private static final String TXT_UPGRADE = "Upgrade my Vial!"; - - private static final String TXT_FARAWELL = "Good luck in your quest, %s!"; - - private static final int WIDTH = 120; - private static final int BTN_HEIGHT = 20; - private static final float GAP = 2; - - public WndTinkerer3(final Tinkerer3 tinkerer, final Item item) { - - super(); - - IconTitle titlebar = new IconTitle(); - titlebar.icon(new ItemSprite(item.image(), null)); - titlebar.label(Messages.titleCase(item.name())); - titlebar.setRect(0, 0, WIDTH, 0); - add(titlebar); - - RenderedTextMultiline message = PixelScene - .renderMultiline(Messages.get(this, "info"), 6); - message.maxWidth(WIDTH); - message.setPos(0, titlebar.bottom() + GAP); - add(message); - - RedButton btnUpgrade = new RedButton(Messages.get(this, "upgrade")) { - @Override - protected void onClick() { - selectUpgrade(tinkerer); - } - }; - btnUpgrade.setRect(0, message.top() + message.height() + GAP, WIDTH, - BTN_HEIGHT); - add(btnUpgrade); - - - resize(WIDTH, (int) btnUpgrade.bottom()); - } - - private void selectUpgrade(Tinkerer3 tinkerer) { - hide(); - - Mushroom mushroom = Dungeon.hero.belongings.getItem(Mushroom.class); - mushroom.detach(Dungeon.hero.belongings.backpack); - - //Dungeon.dewWater=true; - //Dungeon.dewDraw=true; - Dungeon.wings=true; - - - tinkerer.yell( Messages.get(this, "farewell", Dungeon.hero.givenName())); - tinkerer.destroy(); - - tinkerer.sprite.die(); - - //Wandmaker.Quest.complete(); - } -} diff --git a/java/com/hmdzl/spspd/change/windows/WndTitledMessage.java b/java/com/hmdzl/spspd/change/windows/WndTitledMessage.java deleted file mode 100644 index 416abd0b..00000000 --- a/java/com/hmdzl/spspd/change/windows/WndTitledMessage.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.windows; - -import com.hmdzl.spspd.change.ShatteredPixelDungeon; -import com.hmdzl.spspd.change.scenes.PixelScene; -import com.hmdzl.spspd.change.ui.RenderedTextMultiline; -import com.hmdzl.spspd.change.ui.Window; -import com.watabou.noosa.Image; -import com.watabou.noosa.ui.Component; - -public class WndTitledMessage extends Window { - - protected static final int WIDTH_P = 120; - protected static final int WIDTH_L = 144; - protected static final int GAP = 2; - - public WndTitledMessage( Image icon, String title, String message ) { - - this( new IconTitle( icon, title ), message ); - - } - - public WndTitledMessage( Component titlebar, String message ) { - - super(); - - int width = ShatteredPixelDungeon.landscape() ? WIDTH_L : WIDTH_P; - - titlebar.setRect( 0, 0, width, 0 ); - add(titlebar); - - RenderedTextMultiline text = PixelScene.renderMultiline( 6 ); - text.text( message, width ); - text.setPos( titlebar.left(), titlebar.bottom() + GAP ); - add( text ); - - resize( width, (int)text.bottom() ); - } -} diff --git a/java/com/hmdzl/spspd/change/windows/WndTradeItem.java b/java/com/hmdzl/spspd/change/windows/WndTradeItem.java deleted file mode 100644 index 22b4c858..00000000 --- a/java/com/hmdzl/spspd/change/windows/WndTradeItem.java +++ /dev/null @@ -1,285 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.windows; - -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.hero.HeroClass; -import com.hmdzl.spspd.change.actors.mobs.Mob; -import com.hmdzl.spspd.change.actors.mobs.npcs.Shopkeeper; -import com.hmdzl.spspd.change.items.ChallengeBook; -import com.hmdzl.spspd.change.items.EquipableItem; -import com.hmdzl.spspd.change.items.Gold; -import com.hmdzl.spspd.change.items.Heap; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.bags.HeartOfScarecrow; -import com.hmdzl.spspd.change.items.bags.ShoppingCart; -import com.hmdzl.spspd.change.items.bags.KeyRing; -import com.hmdzl.spspd.change.items.bags.PotionBandolier; -import com.hmdzl.spspd.change.items.bags.ScrollHolder; -import com.hmdzl.spspd.change.items.bags.SeedPouch; -import com.hmdzl.spspd.change.items.bags.WandHolster; -import com.hmdzl.spspd.change.items.challengelists.ChallengeList; -import com.hmdzl.spspd.change.items.journalpages.JournalPage; -import com.hmdzl.spspd.change.items.DolyaSlate; -import com.hmdzl.spspd.change.items.artifacts.MasterThievesArmband; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.PixelScene; -import com.hmdzl.spspd.change.sprites.ItemSprite; -import com.hmdzl.spspd.change.ui.ItemSlot; -import com.hmdzl.spspd.change.ui.Window; -import com.hmdzl.spspd.change.utils.GLog; - -import com.hmdzl.spspd.change.ui.RedButton; -import com.hmdzl.spspd.change.ui.RenderedTextMultiline; - -public class WndTradeItem extends Window { - - private static final float GAP = 2; - private static final int WIDTH = 120; - private static final int BTN_HEIGHT = 16; - - private WndBag owner; - - public WndTradeItem(final Item item, WndBag owner) { - - super(); - - this.owner = owner; - - float pos = createDescription(item, false); - - if (item.quantity() == 1) { - - RedButton btnSell = new RedButton(Messages.get(this, "sell", item.price())) { - @Override - protected void onClick() { - sell(item); - hide(); - } - }; - btnSell.setRect(0, pos + GAP, WIDTH, BTN_HEIGHT); - add(btnSell); - - pos = btnSell.bottom(); - - } else { - - int priceAll = item.price(); - RedButton btnSell1 = new RedButton( Messages.get(this, "sell_1", priceAll / item.quantity()) ) { - @Override - protected void onClick() { - sellOne(item); - hide(); - } - }; - btnSell1.setRect(0, pos + GAP, WIDTH, BTN_HEIGHT); - add(btnSell1); - RedButton btnSellAll = new RedButton( Messages.get(this, "sell_all", priceAll )) { - @Override - protected void onClick() { - sell(item); - hide(); - } - }; - btnSellAll.setRect(0, btnSell1.bottom() + GAP, WIDTH, BTN_HEIGHT); - add(btnSellAll); - - pos = btnSellAll.bottom(); - - } - - RedButton btnCancel = new RedButton(Messages.get(this, "cancel")) { - @Override - protected void onClick() { - hide(); - } - }; - btnCancel.setRect(0, pos + GAP, WIDTH, BTN_HEIGHT); - add(btnCancel); - - resize(WIDTH, (int) btnCancel.bottom()); - } - - public WndTradeItem(final Heap heap, boolean canBuy) { - - super(); - - Item item = heap.peek(); - - float pos = createDescription(item, true); - - final int price = price(item); - - if (canBuy) { - - RedButton btnBuy = new RedButton( Messages.get(this, "buy", price)) { - @Override - protected void onClick() { - hide(); - buy(heap); - } - }; - btnBuy.setRect(0, pos + GAP, WIDTH, BTN_HEIGHT); - btnBuy.enable(price <= Dungeon.gold); - add(btnBuy); - - RedButton btnCancel = new RedButton(Messages.get(this, "cancel")) { - @Override - protected void onClick() { - hide(); - } - }; - - - final MasterThievesArmband.Thievery thievery = Dungeon.hero - .buff(MasterThievesArmband.Thievery.class); - if (thievery != null) { - final float chance = thievery.stealChance(price); - RedButton btnSteal = new RedButton( Messages.get(this, "steal", Math.min(100, (int)(chance*100)))) { - @Override - protected void onClick() { - if (thievery.steal(price)) { - Hero hero = Dungeon.hero; - Item item = heap.pickUp(); - int price = (int)Math.max((1 - chance) * price(item) , 0); - Dungeon.gold -= price; - hide(); - if (!item.doPickUp(hero)) { - Dungeon.level.drop(item, heap.pos).sprite.drop(); - } - } else { - for (Mob mob : Dungeon.level.mobs) { - } - hide(); - } - } - }; - btnSteal.setRect(0, btnBuy.bottom() + GAP, WIDTH, BTN_HEIGHT); - btnSteal.enable(price <= Dungeon.gold); - add(btnSteal); - - btnCancel - .setRect(0, btnSteal.bottom() + GAP, WIDTH, BTN_HEIGHT); - } else - btnCancel.setRect(0, btnBuy.bottom() + GAP, WIDTH, BTN_HEIGHT); - - add(btnCancel); - - resize(WIDTH, (int) btnCancel.bottom()); - - } else { - - resize(WIDTH, (int) pos); - - } - } - - @Override - public void hide() { - - super.hide(); - - if (owner != null) { - owner.hide(); - Shopkeeper.sell(); - } - } - - private float createDescription(Item item, boolean forSale) { - - // Title - IconTitle titlebar = new IconTitle(); - titlebar.icon(new ItemSprite(item.image(), item.glowing())); - titlebar.label(forSale ? - Messages.get(this, "sale", item.toString(), price( item ) ) : - Messages.titleCase( item.toString() ) ); - titlebar.setRect(0, 0, WIDTH, 0); - add(titlebar); - - // Upgraded / degraded - if (item.levelKnown && item.level > 0) { - titlebar.color(ItemSlot.UPGRADED); - } else if (item.levelKnown && item.level < 0) { - titlebar.color(ItemSlot.DEGRADED); - } - - // Description - RenderedTextMultiline info = PixelScene.renderMultiline( item.info(), 6 ); - info.maxWidth(WIDTH); - info.setPos(titlebar.left(), titlebar.bottom() + GAP); - add( info ); - - return info.bottom(); - } - - private void sell(Item item) { - - Hero hero = Dungeon.hero; - - if (item instanceof SeedPouch || item instanceof KeyRing || item instanceof ShoppingCart || item instanceof HeartOfScarecrow - || item instanceof PotionBandolier || item instanceof WandHolster || item instanceof ScrollHolder - || item instanceof JournalPage || item instanceof DolyaSlate || item instanceof ChallengeList || item instanceof ChallengeBook){ - GLog.w( Messages.get(this, "donot") ); - return ; - } else if (item.isEquipped(hero) - && !((EquipableItem) item).doUnequip(hero, false)) { - return; - } - - item.detachAll(hero.belongings.backpack); - - new Gold(item.price()).doPickUp(hero); - hero.spend(-hero.cooldown()); - - } - - private void sellOne(Item item) { - - if (item.quantity() <= 1) { - sell(item); - } else { - - Hero hero = Dungeon.hero; - item = item.detach( hero.belongings.backpack ); - - new Gold(item.price()).doPickUp(hero); - hero.spend(-hero.cooldown()); - } - } - - private int price(Item item) { - int price = Dungeon.hero.heroClass == HeroClass.FOLLOWER ? - Math.min(item.price() * 4 * (Dungeon.depth / 5 + 1), item.price() * 20) : - Math.min(item.price() * 5 * (Dungeon.depth / 5 + 1), item.price() * 25); - return price; - } - - private void buy(Heap heap) { - - Hero hero = Dungeon.hero; - Item item = heap.pickUp(); - - int price = price(item); - Dungeon.gold -= price; - - if (!item.doPickUp(hero)) { - Dungeon.level.drop(item, heap.pos).sprite.drop(); - } - } -} diff --git a/java/com/hmdzl/spspd/change/windows/WndWandmaker.java b/java/com/hmdzl/spspd/change/windows/WndWandmaker.java deleted file mode 100644 index 5c59cb43..00000000 --- a/java/com/hmdzl/spspd/change/windows/WndWandmaker.java +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2014 Oleg Dolya - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.hmdzl.spspd.change.windows; - -import com.hmdzl.spspd.change.Challenges; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.actors.hero.HeroClass; -import com.hmdzl.spspd.change.actors.mobs.npcs.Wandmaker; -import com.hmdzl.spspd.change.items.AdamantWand; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.items.wands.Wand; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.scenes.PixelScene; -import com.hmdzl.spspd.change.sprites.ItemSprite; -import com.hmdzl.spspd.change.ui.RedButton; -import com.hmdzl.spspd.change.ui.RenderedTextMultiline; -import com.hmdzl.spspd.change.ui.Window; -import com.hmdzl.spspd.change.utils.GLog; - - -public class WndWandmaker extends Window { - - private static final String TXT_MESSAGE = "Oh, I see you have succeeded! I do hope it hasn't troubled you too much. " - + "As I promised, you can choose one of my high quality wands."; - private static final String TXT_BATTLE = "Battle wand"; - private static final String TXT_NON_BATTLE = "Non-battle wand"; - - private static final String TXT_ADAMANT = "You might find this raw material useful later on. I'm not powerful enough to work with it."; - private static final String TXT_WOW = "How did you make it all this way!? I have another reward for you. "; - private static final String TXT_FARAWELL = "Good luck in your quest, %s!"; - - private static final int WIDTH = 120; - private static final int BTN_HEIGHT = 20; - private static final float GAP = 2; - - public WndWandmaker(final Wandmaker wandmaker, final Item item) { - - super(); - - IconTitle titlebar = new IconTitle(); - titlebar.icon(new ItemSprite(item.image(), null)); - titlebar.label(Messages.titleCase(item.name())); - titlebar.setRect(0, 0, WIDTH, 0); - add(titlebar); - - RenderedTextMultiline message = PixelScene - .renderMultiline(Messages.get(this, "message"), 6); - message.maxWidth(WIDTH); - message.setPos(0,titlebar.bottom() + GAP); - add(message); - - RedButton btnBattle = new RedButton(Messages.get(this, "battle")) { - @Override - protected void onClick() { - selectReward(wandmaker, item, Wandmaker.Quest.wand1); - } - }; - btnBattle.setRect(0, message.top()+ message.height() + GAP, WIDTH, - BTN_HEIGHT); - add(btnBattle); - - RedButton btnNonBattle = new RedButton(Messages.get(this, "no_battle")) { - @Override - protected void onClick() { - selectReward(wandmaker, item, Wandmaker.Quest.wand2); - } - }; - btnNonBattle.setRect(0, btnBattle.bottom() + GAP, WIDTH, BTN_HEIGHT); - add(btnNonBattle); - - resize(WIDTH, (int) btnNonBattle.bottom()); - } - - private void selectReward(Wandmaker wandmaker, Item item, Wand reward) { - - hide(); - - item.detach(Dungeon.hero.belongings.backpack); - - reward.identify(); - Dungeon.level.drop(reward, wandmaker.pos).sprite.drop(); - wandmaker.yell(Messages.get(this, "farewell", Dungeon.hero.givenName())); - Dungeon.level.drop(new AdamantWand(), wandmaker.pos).sprite.drop(); - wandmaker.destroy(); - wandmaker.sprite.die(); - Wandmaker.Quest.complete(); - } -} diff --git a/java/com/hmdzl/spspd/items/Generator.java b/java/com/hmdzl/spspd/items/Generator.java index 352b64f9..b023cd67 100644 --- a/java/com/hmdzl/spspd/items/Generator.java +++ b/java/com/hmdzl/spspd/items/Generator.java @@ -101,6 +101,15 @@ import com.hmdzl.spspd.items.medicine.DeathCap; import com.hmdzl.spspd.items.medicine.JackOLantern; import com.hmdzl.spspd.items.medicine.BlueMilk; +import com.hmdzl.spspd.items.misc.JumpF; +import com.hmdzl.spspd.items.misc.JumpH; +import com.hmdzl.spspd.items.misc.JumpM; +import com.hmdzl.spspd.items.misc.JumpP; +import com.hmdzl.spspd.items.misc.JumpR; +import com.hmdzl.spspd.items.misc.JumpS; +import com.hmdzl.spspd.items.misc.JumpW; +import com.hmdzl.spspd.items.potions.PotionOfMixing; +import com.hmdzl.spspd.items.potions.PotionOfShield; import com.hmdzl.spspd.items.rings.RingOfEnergy; import com.hmdzl.spspd.items.scrolls.ScrollOfSacrifice; import com.hmdzl.spspd.items.summon.ActiveMrDestructo; @@ -141,6 +150,7 @@ import com.hmdzl.spspd.items.weapon.missiles.Skull; import com.hmdzl.spspd.items.weapon.missiles.Smoke; import com.hmdzl.spspd.items.weapon.missiles.Wave; +import com.hmdzl.spspd.plants.NutPlant; import com.hmdzl.spspd.plants.Rotberry; import com.hmdzl.spspd.items.armor.Armor; import com.hmdzl.spspd.items.armor.normalarmor.ClothArmor; @@ -279,7 +289,8 @@ public static enum Category { POTION(500, Potion.class), SCROLL(400, Scroll.class), WAND(40, Wand.class), RING(15, Ring.class), ARTIFACT(20, Artifact.class), SEED(5, Plant.Seed.class), SEED2(0, Plant.Seed.class),SEED3(0, Plant.Seed.class), FOOD(10, Food.class), GOLD(500, Gold.class), BERRY(50, Food.class), MUSHROOM(50, Food.class), BOMBS(20, Bomb.class), - NORNSTONE(0,NornStone.class), EGGS(0, Egg.class), HIGHFOOD(0,Food.class), SUMMONED(1,Item.class), PILL(1, Pill.class),LINKDROP(0, Item.class),MUSICWEAPON(0,Weapon.class); + NORNSTONE(0,NornStone.class), EGGS(0, Egg.class), HIGHFOOD(0,Food.class), SUMMONED(1,Item.class), PILL(1, Pill.class),LINKDROP(0, Item.class),MUSICWEAPON(0,Weapon.class) + ,SHOES(0,Item.class); public Class[] classes; public float[] probs; @@ -330,9 +341,9 @@ public static int order(Item item) { PotionOfMindVision.class, PotionOfPurity.class, PotionOfInvisibility.class, PotionOfMight.class, PotionOfFrost.class, PotionOfMending.class, - PotionOfOverHealing.class, Egg.class}; - Category.POTION.probs = new float[] { 10, 4, 15, 10, 15, 10, 0, 20, 12, - 10, 0, 10, 45, 4, 10}; + PotionOfOverHealing.class, PotionOfShield.class,PotionOfMixing.class}; + Category.POTION.probs = new float[] { 10, 5, 15, 10, 15, 10, 0, 20, 12, + 10, 0, 10, 15, 4, 5, 0}; Category.WAND.classes = new Class[] { WandOfAcid.class, WandOfFreeze.class, WandOfFirebolt.class, @@ -458,12 +469,12 @@ public static int order(Item item) { Category.SEED.classes = new Class[] { Firebloom.Seed.class, Icecap.Seed.class, Sorrowmoss.Seed.class, Blindweed.Seed.class, Sungrass.Seed.class, Earthroot.Seed.class, Fadeleaf.Seed.class, Rotberry.Seed.class, BlandfruitBush.Seed.class, Dreamfoil.Seed.class, - Stormvine.Seed.class, /*Nut.class, Vegetable.class,Blackberry.class, Blueberry.class, Cloudberry.class, + Stormvine.Seed.class, NutPlant.Seed.class, /*Vegetable.class,Blackberry.class, Blueberry.class, Cloudberry.class, Moonberry.class,*/ Starflower.Seed.class, Phaseshift.Seed.class, Flytrap.Seed.class, Dewcatcher.Seed.class, Seedpod.Seed.class}; Category.SEED.probs = new float[] { 12, 12, 12, 12, 12, 12, 12, 0, 4, 12, - 12,/* 48, 36, 20, 4, 16, + 12, 12, /*36, 20, 4, 16, 4,*/ 3, 3, 4, 8, 2}; @@ -530,13 +541,21 @@ public static int order(Item item) { HugeBomb.class,MiniBomb.class, FireBomb.class,IceBomb.class,EarthBomb.class,StormBomb.class, LightBomb.class,DarkBomb.class,FishingBomb.class, EmpBola.class ,EscapeKnive.class,PoisonDart.class,Smoke.class,IncendiaryDart.class,Tamahawk.class, - Skull.class, RiceBall.class, Wave.class, ShatteredAmmo.class, HugeShuriken.class, NormalBomb.class, + Skull.class, RiceBall.class, Wave.class, ShatteredAmmo.class, HugeShuriken.class, NormalBomb.class }; Category.LINKDROP.probs = new float[] { 3,1, 1,1,1,1,1,1, 1,1,1, 2,2,2,2,2,2, 2,2,2,2,2,2}; + + Category.SHOES.classes = new Class[] { + JumpW.class,JumpM.class, + JumpR.class,JumpH.class, JumpP.class, + JumpS.class,JumpF.class + }; + Category.SHOES.probs = new float[] { 1,1,1,1,1,1,1}; + } public static void reset() { diff --git a/java/com/hmdzl/spspd/items/ItemStatusHandler.java b/java/com/hmdzl/spspd/items/ItemStatusHandler.java index bec9a502..c286c861 100644 --- a/java/com/hmdzl/spspd/items/ItemStatusHandler.java +++ b/java/com/hmdzl/spspd/items/ItemStatusHandler.java @@ -34,6 +34,41 @@ public class ItemStatusHandler { private HashMap, String> labels; private HashSet> known; + public ItemStatusHandler( Class[] items, String[] allLabels, Integer[] allImages, int exclude ) { + + this.items = items; + + this.images = new HashMap, Integer>(); + this.labels = new HashMap, String>(); + known = new HashSet>(); + + ArrayList labelsLeft = new ArrayList( Arrays.asList( allLabels ) ); + ArrayList imagesLeft = new ArrayList( Arrays.asList( allImages ) ); + + for (int i=0; i < items.length - exclude; i++) { + + Class item = (Class)(items[i]); + + int index = Random.Int( labelsLeft.size() - exclude); + + labels.put( item, labelsLeft.get( index ) ); + labelsLeft.remove( index ); + + images.put( item, imagesLeft.get( index ) ); + imagesLeft.remove( index ); + } + + for(int i = items.length - exclude; i < items.length; i++) + { + Class item = (Class)(items[i]); + + labels.put( item, allLabels[i] ); + + images.put( item, allImages[i] ); + + } + } + public ItemStatusHandler(Class[] items, String[] allLabels, Integer[] allImages) { diff --git a/java/com/hmdzl/spspd/items/UpgradeEatBall.java b/java/com/hmdzl/spspd/items/UpgradeEatBall.java index c75d3931..eea6a28d 100644 --- a/java/com/hmdzl/spspd/items/UpgradeEatBall.java +++ b/java/com/hmdzl/spspd/items/UpgradeEatBall.java @@ -69,7 +69,7 @@ public void execute(Hero hero, String action) { } private void use(Item item) { -if (!(Dungeon.hero.heroClass == HeroClass.FOLLOWER ) || (Dungeon.hero.heroClass == HeroClass.FOLLOWER && Random.Int(10)>=1 )) + if (!(Dungeon.hero.heroClass == HeroClass.FOLLOWER ) || (Dungeon.hero.heroClass == HeroClass.FOLLOWER && Random.Int(10)>=1 )) detach(curUser.belongings.backpack); curUser.sprite.operate(curUser.pos); diff --git a/java/com/hmdzl/spspd/items/artifacts/AlienBag.java b/java/com/hmdzl/spspd/items/artifacts/AlienBag.java index 374eb7fb..6195dd61 100644 --- a/java/com/hmdzl/spspd/items/artifacts/AlienBag.java +++ b/java/com/hmdzl/spspd/items/artifacts/AlienBag.java @@ -5,6 +5,7 @@ import com.hmdzl.spspd.Dungeon; import com.hmdzl.spspd.actors.buffs.Buff; import com.hmdzl.spspd.actors.buffs.DefenceUp; +import com.hmdzl.spspd.actors.buffs.Haste; import com.hmdzl.spspd.actors.buffs.Invisibility; import com.hmdzl.spspd.actors.buffs.Levitation; import com.hmdzl.spspd.actors.buffs.ShieldArmor; @@ -66,6 +67,7 @@ else if (charge != chargeCap) else { charge = 0; Buff.affect(hero,ShieldArmor.class).level(level * 20); + Buff.affect(hero,DefenceUp.class,20).level(level * 5); hero.spend(1f); updateQuickslot(); } @@ -82,7 +84,7 @@ else if (charge != chargeCap) charge = 0; Buff.affect(hero, Invisibility.class, level * 5f); Buff.affect(hero, Levitation.class, level * 5f); - Buff.affect(hero, DefenceUp.class, level * 5f).level(level * 5); + Buff.affect(hero, Haste.class, level * 5f); hero.spend(1f); updateQuickslot(); } else if (action.equals(AC_ETC)) { diff --git a/java/com/hmdzl/spspd/items/artifacts/CapeOfThorns.java b/java/com/hmdzl/spspd/items/artifacts/CapeOfThorns.java index d6ff8926..d63ac1ea 100644 --- a/java/com/hmdzl/spspd/items/artifacts/CapeOfThorns.java +++ b/java/com/hmdzl/spspd/items/artifacts/CapeOfThorns.java @@ -54,14 +54,15 @@ public void execute(Hero hero, String action) { else if (cursed) GLog.i(Messages.get(Artifact.class, "cursed")); else { - if (level > 1) level--; + if (level > 1) {level--; Sample.INSTANCE.play(Assets.SND_BURNING); hero.sprite.emitter().burst(ElmoParticle.FACTORY, 12); Buff.affect(hero, Needling.class, (level + 1) * 10f); hero.spend(1f); hero.busy(); hero.sprite.operate(hero.pos); - updateQuickslot(); + updateQuickslot();} + else GLog.i(Messages.get(Artifact.class, "cursed")); } } } diff --git a/java/com/hmdzl/spspd/items/artifacts/UnstableSpellbook.java b/java/com/hmdzl/spspd/items/artifacts/UnstableSpellbook.java index 13f6e622..f9208a1a 100644 --- a/java/com/hmdzl/spspd/items/artifacts/UnstableSpellbook.java +++ b/java/com/hmdzl/spspd/items/artifacts/UnstableSpellbook.java @@ -22,7 +22,14 @@ import com.hmdzl.spspd.Assets; import com.hmdzl.spspd.Dungeon; +import com.hmdzl.spspd.actors.buffs.Arcane; +import com.hmdzl.spspd.actors.buffs.AttackUp; import com.hmdzl.spspd.actors.buffs.Blindness; +import com.hmdzl.spspd.actors.buffs.Buff; +import com.hmdzl.spspd.actors.buffs.DefenceUp; +import com.hmdzl.spspd.actors.buffs.Haste; +import com.hmdzl.spspd.actors.buffs.Invisibility; +import com.hmdzl.spspd.actors.buffs.TargetShoot; import com.hmdzl.spspd.actors.hero.Hero; import com.hmdzl.spspd.effects.particles.ElmoParticle; import com.hmdzl.spspd.items.Generator; @@ -135,22 +142,28 @@ public void execute( Hero hero, String action ) { GameScene.selectItem(itemSelector, mode, Messages.get(this, "prompt")); } else if (action.equals( AC_SONG )) { curUser = hero; - level-=4; - exp-=100; switch (Random.Int(3)){ case 0: Dungeon.hero.hitSkill++; + Dungeon.hero.evadeSkill++; GLog.w(Messages.get(SkillOfAtk.class, "skillup")); + GLog.w(Messages.get(SkillOfDef.class, "skillup")); break; case 1: - Dungeon.hero.evadeSkill++; - GLog.w(Messages.get(SkillOfDef.class, "skillup")); + Buff.affect(hero, AttackUp.class,level*10f).level(25); + Buff.affect(hero, DefenceUp.class,level*10f).level(25); + Buff.affect(hero, Arcane.class,level*10f); + Buff.affect(hero, TargetShoot.class,level*10f); break; case 2: Dungeon.hero.magicSkill++; + Buff.affect(hero, Invisibility.class, level*10f ); + Buff.affect(hero, Haste.class, level*3f ); GLog.w(Messages.get(SkillOfMig.class, "skillup")); break; } + level-=4; + exp-=100; curUser.spendAndNext(1f); updateQuickslot(); Sample.INSTANCE.play(Assets.SND_BURNING); diff --git a/java/com/hmdzl/spspd/items/bombs/Bomb.java b/java/com/hmdzl/spspd/items/bombs/Bomb.java index f3a11f79..4de7120c 100644 --- a/java/com/hmdzl/spspd/items/bombs/Bomb.java +++ b/java/com/hmdzl/spspd/items/bombs/Bomb.java @@ -39,7 +39,7 @@ public class Bomb extends Item { { //name = "bomb"; - image = ItemSpriteSheet.BOMB; + image = ItemSpriteSheet.NULLWARN; defaultAction = AC_LIGHTTHROW; usesTargeting = true; diff --git a/java/com/hmdzl/spspd/items/food/Food.java b/java/com/hmdzl/spspd/items/food/Food.java index f39a4b3a..6edce445 100644 --- a/java/com/hmdzl/spspd/items/food/Food.java +++ b/java/com/hmdzl/spspd/items/food/Food.java @@ -23,15 +23,22 @@ import com.hmdzl.spspd.Badges; import com.hmdzl.spspd.Dungeon; import com.hmdzl.spspd.Statistics; +import com.hmdzl.spspd.actors.buffs.AttackUp; import com.hmdzl.spspd.actors.buffs.Buff; +import com.hmdzl.spspd.actors.buffs.Haste; +import com.hmdzl.spspd.actors.buffs.Light; import com.hmdzl.spspd.actors.buffs.Locked; import com.hmdzl.spspd.actors.buffs.Recharging; import com.hmdzl.spspd.actors.buffs.Hunger; +import com.hmdzl.spspd.actors.buffs.WarGroove; import com.hmdzl.spspd.actors.hero.Hero; +import com.hmdzl.spspd.actors.hero.HeroAction; import com.hmdzl.spspd.actors.hero.HeroClass; import com.hmdzl.spspd.effects.Speck; import com.hmdzl.spspd.effects.SpellSprite; +import com.hmdzl.spspd.items.Dewdrop; import com.hmdzl.spspd.items.Item; +import com.hmdzl.spspd.items.YellowDewdrop; import com.hmdzl.spspd.items.scrolls.ScrollOfRecharging; import com.hmdzl.spspd.sprites.ItemSpriteSheet; import com.hmdzl.spspd.utils.GLog; @@ -80,7 +87,7 @@ public void execute(Hero hero, String action) { switch (hero.heroClass) { case WARRIOR: if (hero.HP < hero.HT) { - hero.HP = Math.min(hero.HP + Random.Int(3, healEnergy), hero.HT); + hero.HP = Random.Int(hero.HP + Random.Int(3, healEnergy), hero.HT); hero.sprite.emitter() .burst(Speck.factory(Speck.HEALING), 1); } @@ -88,32 +95,23 @@ public void execute(Hero hero, String action) { case MAGE: Buff.affect(hero, Recharging.class, 4f); ScrollOfRecharging.charge(hero); - if (hero.HP < hero.HT) { - hero.HP = Math.min((hero.HP + Random.Int(1, 3)), hero.HT); - hero.sprite.emitter() - .burst(Speck.factory(Speck.HEALING), 1); - } break; case ROGUE: - if (hero.HP < hero.HT) { - hero.HP = Math.min((hero.HP + Random.Int(1, 3)), hero.HT); - hero.sprite.emitter() - .burst(Speck.factory(Speck.HEALING), 1); - } + Buff.affect(hero, AttackUp.class, 10f).level(30); + Buff.affect(hero, Light.class, 5f); + break; case HUNTRESS: - if (hero.HP < hero.HT) { - hero.HP = Math.min((hero.HP + Random.Int(1, 3)), hero.HT); - hero.sprite.emitter() - .burst(Speck.factory(Speck.HEALING), 1); - } + Dungeon.level.drop(new YellowDewdrop(), hero.pos).sprite.drop(); break; case PERFORMER: - if (hero.HP < hero.HT) { - hero.HP = Math.min((hero.HP + Random.Int(1, 3)), hero.HT); - hero.sprite.emitter() - .burst(Speck.factory(Speck.HEALING), 1); - } - break; + Buff.affect(hero, WarGroove.class); + break; + case SOLDIER: + Buff.affect(hero, Haste.class, 5f); + break; + case FOLLOWER: + Dungeon.gold+=10; + break; } hero.sprite.operate(hero.pos); diff --git a/java/com/hmdzl/spspd/change/items/food/completefood/Chocolate.java b/java/com/hmdzl/spspd/items/food/completefood/ZongZi.java similarity index 62% rename from java/com/hmdzl/spspd/change/items/food/completefood/Chocolate.java rename to java/com/hmdzl/spspd/items/food/completefood/ZongZi.java index 2c0f8796..197577f0 100644 --- a/java/com/hmdzl/spspd/change/items/food/completefood/Chocolate.java +++ b/java/com/hmdzl/spspd/items/food/completefood/ZongZi.java @@ -15,20 +15,22 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see */ -package com.hmdzl.spspd.change.items.food.completefood; +package com.hmdzl.spspd.items.food.completefood; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.ShieldArmor; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.items.food.Food; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; +import com.hmdzl.spspd.actors.buffs.Buff; +import com.hmdzl.spspd.actors.buffs.ShieldArmor; +import com.hmdzl.spspd.actors.buffs.Slow; +import com.hmdzl.spspd.actors.buffs.Tar; +import com.hmdzl.spspd.actors.hero.Hero; +import com.hmdzl.spspd.effects.Speck; +import com.hmdzl.spspd.items.food.Food; +import com.hmdzl.spspd.sprites.ItemSpriteSheet; -public class Chocolate extends CompleteFood { +public class ZongZi extends CompleteFood { { - //name = "Chocolate"; - image = ItemSpriteSheet.CHOCOLATE; + //name = "ZongZi"; + image = ItemSpriteSheet.ZONGZI; energy = 600; hornValue = 5; @@ -44,7 +46,8 @@ public void execute(Hero hero, String action) { super.execute(hero, action); if (action.equals(AC_EAT)){ - Buff.affect(hero, ShieldArmor.class).level(150); + Buff.affect(hero, Tar.class); + Buff.affect(hero, Slow.class, 30f); } } diff --git a/java/com/hmdzl/spspd/items/food/fruit/Blandfruit.java b/java/com/hmdzl/spspd/items/food/fruit/Blandfruit.java index 288fb916..0aa95de7 100644 --- a/java/com/hmdzl/spspd/items/food/fruit/Blandfruit.java +++ b/java/com/hmdzl/spspd/items/food/fruit/Blandfruit.java @@ -20,10 +20,13 @@ import com.hmdzl.spspd.items.potions.PotionOfInvisibility; import com.hmdzl.spspd.items.potions.PotionOfLevitation; import com.hmdzl.spspd.items.potions.PotionOfLiquidFlame; +import com.hmdzl.spspd.items.potions.PotionOfMight; import com.hmdzl.spspd.items.potions.PotionOfMindVision; +import com.hmdzl.spspd.items.potions.PotionOfMixing; import com.hmdzl.spspd.items.potions.PotionOfOverHealing; import com.hmdzl.spspd.items.potions.PotionOfParalyticGas; import com.hmdzl.spspd.items.potions.PotionOfPurity; +import com.hmdzl.spspd.items.potions.PotionOfShield; import com.hmdzl.spspd.items.potions.PotionOfStrength; import com.hmdzl.spspd.items.potions.PotionOfToxicGas; import com.hmdzl.spspd.items.scrolls.ScrollOfRecharging; @@ -34,6 +37,7 @@ import com.hmdzl.spspd.messages.Messages; import com.watabou.noosa.audio.Sample; import com.watabou.utils.Bundle; +import com.watabou.utils.Random; /** * Created by debenhame on 12/08/2014. @@ -97,6 +101,12 @@ public void execute(Hero hero, String action) { } else if (potionAttrib instanceof PotionOfFrost) { GLog.i(Messages.get(this, "frost_msg")); Buff.affect(hero, FrostImbue.class, FrostImbue.DURATION); + } else if (potionAttrib instanceof PotionOfMixing) { + GLog.i(Messages.get(this, "para_msg")); + Buff.affect(hero, FrostImbue.class, FrostImbue.DURATION); + Buff.affect(hero, EarthImbue.class, EarthImbue.DURATION); + Buff.affect(hero, ToxicImbue.class).set(ToxicImbue.DURATION); + Buff.affect(hero, FireImbue.class).set(FireImbue.DURATION); } else potionAttrib.apply(hero); @@ -107,7 +117,7 @@ public void execute(Hero hero, String action) { switch (hero.heroClass) { case WARRIOR: if (hero.HP < hero.HT) { - hero.HP = Math.min(hero.HP + 5, hero.HT); + hero.HP = Random.Int(hero.HP + 5, hero.HT); hero.sprite.emitter().burst( Speck.factory(Speck.HEALING), 1); } @@ -190,12 +200,20 @@ public Item imbuePotion(Potion potion) { } else if (potionAttrib instanceof PotionOfExperience) { name = Messages.get(this, "starfruit"); potionGlow = new ItemSprite.Glowing( 0xA79400 ); - }else if (potionAttrib instanceof PotionOfOverHealing) { + } else if (potionAttrib instanceof PotionOfOverHealing) { name = Messages.get(this, "heartfruit"); potionGlow = new ItemSprite.Glowing( 0xB20000 ); + } else if (potionAttrib instanceof PotionOfShield) { + name = Messages.get(this, "nutfruit"); + potionGlow = new ItemSprite.Glowing(0x67583D); + } else if (potionAttrib instanceof PotionOfMixing) { + name = Messages.get(this, "mixfruit"); + potionGlow = new ItemSprite.Glowing(0xB20000); + } else if (potionAttrib instanceof PotionOfMight) { + name = Messages.get(this, "mightfruit"); + potionGlow = new ItemSprite.Glowing(0xB20000); } - return this; } @@ -208,7 +226,8 @@ public void cast(final Hero user, int dst) { || potionAttrib instanceof PotionOfParalyticGas || potionAttrib instanceof PotionOfFrost || potionAttrib instanceof PotionOfLevitation - || potionAttrib instanceof PotionOfPurity) { + || potionAttrib instanceof PotionOfPurity + ) { potionAttrib.cast(user, dst); detach(user.belongings.backpack); } else { diff --git a/java/com/hmdzl/spspd/change/items/medicine/Smashpill.java b/java/com/hmdzl/spspd/items/medicine/RealgarWine.java similarity index 63% rename from java/com/hmdzl/spspd/change/items/medicine/Smashpill.java rename to java/com/hmdzl/spspd/items/medicine/RealgarWine.java index 39f5e8a5..d6cb4cbf 100644 --- a/java/com/hmdzl/spspd/change/items/medicine/Smashpill.java +++ b/java/com/hmdzl/spspd/items/medicine/RealgarWine.java @@ -15,19 +15,21 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see */ -package com.hmdzl.spspd.change.items.medicine; +package com.hmdzl.spspd.items.medicine; -import com.hmdzl.spspd.change.actors.buffs.AttackUp; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.hero.Hero; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; +import com.hmdzl.spspd.actors.buffs.Arcane; +import com.hmdzl.spspd.actors.buffs.Buff; +import com.hmdzl.spspd.actors.buffs.FireImbue; +import com.hmdzl.spspd.actors.buffs.ToxicImbue; +import com.hmdzl.spspd.actors.hero.Hero; +import com.hmdzl.spspd.effects.Speck; +import com.hmdzl.spspd.sprites.ItemSpriteSheet; -public class Smashpill extends Pill { +public class RealgarWine extends Pill { { - //name = "smashpill"; - image = ItemSpriteSheet.PILL_ATK; + //name = "RealgarWine"; + image = ItemSpriteSheet.WINE; } @@ -36,7 +38,8 @@ public void execute(Hero hero, String action) { super.execute(hero, action); if (action.equals(AC_EAT)){ - Buff.affect(hero, AttackUp.class,200f).level(50); + Buff.affect(hero, FireImbue.class).set(FireImbue.DURATION); + Buff.affect(hero, ToxicImbue.class).set(ToxicImbue.DURATION); hero.sprite.emitter().start(Speck.factory(Speck.UP), 0.4f, 4); } } diff --git a/java/com/hmdzl/spspd/items/misc/AttackShoes.java b/java/com/hmdzl/spspd/items/misc/AttackShoes.java index 8125c160..95fb6608 100644 --- a/java/com/hmdzl/spspd/items/misc/AttackShoes.java +++ b/java/com/hmdzl/spspd/items/misc/AttackShoes.java @@ -23,16 +23,19 @@ import com.hmdzl.spspd.actors.Actor; import com.hmdzl.spspd.actors.Char; import com.hmdzl.spspd.actors.hero.Hero; +import com.hmdzl.spspd.items.Generator; import com.hmdzl.spspd.items.Item; import com.hmdzl.spspd.levels.Level; import com.hmdzl.spspd.mechanics.Ballistica; import com.hmdzl.spspd.effects.CellEmitter; import com.hmdzl.spspd.effects.Speck; +import com.hmdzl.spspd.plants.Plant; import com.hmdzl.spspd.scenes.CellSelector; import com.hmdzl.spspd.scenes.GameScene; import com.hmdzl.spspd.sprites.ItemSpriteSheet; import com.hmdzl.spspd.messages.Messages; import com.watabou.utils.Callback; +import com.watabou.utils.Random; public class AttackShoes extends Item { @@ -94,6 +97,10 @@ public void call() { CellEmitter.center(dest).burst( Speck.factory(Speck.DUST), 10); curUser.spendAndNext(JUMP_TIME); + if (Random.Int(20) == 10 ){ + Plant.Seed seed = (Plant.Seed) Generator.random(Generator.Category.SEED3); + Dungeon.level.plant(seed, dest); + } updateQuickslot(); } }); diff --git a/java/com/hmdzl/spspd/items/misc/BShovel.java b/java/com/hmdzl/spspd/items/misc/BShovel.java index 616268c7..2181d7f4 100644 --- a/java/com/hmdzl/spspd/items/misc/BShovel.java +++ b/java/com/hmdzl/spspd/items/misc/BShovel.java @@ -74,7 +74,7 @@ public void restoreFromBundle(Bundle bundle) { @Override public ArrayList actions(Hero hero ) { ArrayList actions = super.actions( hero ); - if (charge >= 75){ + if (charge >= 65){ actions.add(AC_USE); } actions.remove( AC_THROW ); @@ -85,7 +85,7 @@ public ArrayList actions(Hero hero ) { @Override public void execute( final Hero hero, String action ) { if( action.equals( AC_USE ) ){ - if(charge < 75){ + if(charge < 65){ GLog.i(Messages.get(BShovel.class, "break")); return; } else { @@ -107,7 +107,7 @@ public void execute( final Hero hero, String action ) { hunger.satisfy(-10); BuffIndicator.refreshHero(); } - charge-=75; + charge-=65; switch (Random.Int (6)) { case 0 : @@ -149,7 +149,7 @@ public void execute( final Hero hero, String action ) { @Override public String status() { - return Messages.format("%d", (int)charge/75); + return Messages.format("%d", (int)charge/65); } @Override diff --git a/java/com/hmdzl/spspd/items/misc/CopyBall.java b/java/com/hmdzl/spspd/items/misc/CopyBall.java index e20ef7ce..abbf95d1 100644 --- a/java/com/hmdzl/spspd/items/misc/CopyBall.java +++ b/java/com/hmdzl/spspd/items/misc/CopyBall.java @@ -30,6 +30,7 @@ import com.hmdzl.spspd.actors.hero.Hero; import com.hmdzl.spspd.effects.Splash; import com.hmdzl.spspd.items.Item; +import com.hmdzl.spspd.items.bombs.DungeonBomb; import com.hmdzl.spspd.items.weapon.missiles.MissileWeapon; import com.hmdzl.spspd.messages.Messages; import com.hmdzl.spspd.scenes.CellSelector; @@ -138,6 +139,7 @@ protected void onThrow( int cell ) { if (enemy == null || enemy == curUser) { parent = null; Splash.at( cell, 0xCC99FFFF, 1 ); + new DungeonBomb().explode(cell); } else { if (!curUser.shoot( enemy, this )) { Splash.at(cell, 0xCC99FFFF, 1); diff --git a/java/com/hmdzl/spspd/items/misc/DemoScroll.java b/java/com/hmdzl/spspd/items/misc/DemoScroll.java index da490a8e..41136870 100644 --- a/java/com/hmdzl/spspd/items/misc/DemoScroll.java +++ b/java/com/hmdzl/spspd/items/misc/DemoScroll.java @@ -21,6 +21,10 @@ import com.hmdzl.spspd.Dungeon; import com.hmdzl.spspd.ResultDescriptions; +import com.hmdzl.spspd.actors.buffs.Buff; +import com.hmdzl.spspd.actors.buffs.Muscle; +import com.hmdzl.spspd.actors.buffs.Recharging; +import com.hmdzl.spspd.actors.buffs.Rhythm; import com.hmdzl.spspd.actors.hero.Hero; import com.hmdzl.spspd.items.Item; @@ -69,32 +73,30 @@ public void execute(Hero hero, String action) { if (action.equals(AC_READ)) { - switch (Random.Int (4)) { + switch (Random.Int (3)) { case 0 : hero.hitSkill++; + Buff.affect(hero,Muscle.class,50f); GLog.w(Messages.get(this, "hitup")); break; case 1 : hero.evadeSkill++; + Buff.affect(hero,Rhythm.class,50f); GLog.w(Messages.get(this, "evaup")); break; case 2 : hero.magicSkill++; + Buff.affect(hero,Recharging.class,50f); GLog.w(Messages.get(this, "migup")); break; - case 3 : - hero.STR++; - GLog.w(Messages.get(this, "strup")); - break; default: - break; } charge ++; hero.sprite.operate(hero.pos); hero.busy(); hero.spend(2f); - int dmg = Random.Int(6,Dungeon.hero.lvl); + int dmg = charge+1; hero.damage(dmg,this); if (!hero.isAlive()) { Dungeon.fail(Messages.format(ResultDescriptions.ITEM)); @@ -112,6 +114,14 @@ public void execute(Hero hero, String action) { } } + + @Override + public String info() { + String info = desc(); + info += "\n\n" + Messages.get(this, "charge",charge); + return info; + } + @Override public boolean isUpgradable() { diff --git a/java/com/hmdzl/spspd/items/misc/DiceTower.java b/java/com/hmdzl/spspd/items/misc/DiceTower.java new file mode 100644 index 00000000..105d8310 --- /dev/null +++ b/java/com/hmdzl/spspd/items/misc/DiceTower.java @@ -0,0 +1,147 @@ +/* + * Pixel Dungeon + * Copyright (C) 2012-2014 Oleg Dolya + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + */ +package com.hmdzl.spspd.items.misc; + +import java.util.ArrayList; + +import com.hmdzl.spspd.Dungeon; +import com.hmdzl.spspd.actors.Actor; +import com.hmdzl.spspd.actors.Char; +import com.hmdzl.spspd.actors.buffs.ArmorBreak; +import com.hmdzl.spspd.actors.buffs.AttackDown; +import com.hmdzl.spspd.actors.buffs.Bleeding; +import com.hmdzl.spspd.actors.buffs.Buff; +import com.hmdzl.spspd.actors.buffs.Cripple; +import com.hmdzl.spspd.actors.buffs.Poison; +import com.hmdzl.spspd.actors.buffs.Weakness; +import com.hmdzl.spspd.actors.hero.Hero; +import com.hmdzl.spspd.items.Generator; +import com.hmdzl.spspd.items.Item; + +import com.hmdzl.spspd.levels.Level; +import com.hmdzl.spspd.messages.Messages; +import com.hmdzl.spspd.scenes.GameScene; +import com.hmdzl.spspd.sprites.ItemSpriteSheet; +import com.hmdzl.spspd.utils.GLog; +import com.hmdzl.spspd.windows.WndItem; +import com.watabou.utils.Bundle; +import com.watabou.utils.Random; + +import static com.hmdzl.spspd.ui.ActionIndicator.action; + +public class DiceTower extends Item { + + { + //name = "DiceTower"; + image = ItemSpriteSheet.DICE_TOWER; + unique = true; + defaultAction = AC_CHOOSE; + } + + + public final int fullCharge = 100; + public int charge = 0; + + private static final String AC_CHOOSE = "CHOOSE"; + + public static final String AC_ROLL = "ROLL"; + public static final String AC_REROLL = "REROLL"; + public static final String AC_ALLIN = "ALLIN"; + + private static final String CHARGE = "charge"; + + @Override + public void storeInBundle(Bundle bundle) { + super.storeInBundle(bundle); + bundle.put(CHARGE, charge); + } + + @Override + public void restoreFromBundle(Bundle bundle) { + super.restoreFromBundle(bundle); + charge = bundle.getInt(CHARGE); + } + + @Override + public ArrayList actions(Hero hero) { + ArrayList actions = super.actions(hero); + actions.remove(AC_DROP); + actions.remove(AC_THROW); + + actions.add(AC_ROLL); + actions.add(AC_REROLL); + actions.add(AC_ALLIN); + + return actions; + } + + @Override + public void execute(Hero hero, String action) { + + curUser = Dungeon.hero; + if (action.equals( AC_CHOOSE )) { + + GameScene.show(new WndItem(null, this, true)); + + } else if (action.equals(AC_ROLL)) { + + Dungeon.hero.spp = Random.Int(100); + + hero.spendAndNext(1f); + } else + if (action.equals(AC_REROLL)) { + if (charge < 60) { + GLog.p(Messages.get(this, "need_charge")); + } else { + Dungeon.hero.spp = 100; + charge -= 60; + hero.spendAndNext(1f); + } + } else + if (action.equals(AC_ALLIN)) { + Dungeon.hero.spp += Dungeon.gold / 5000; + Dungeon.gold = 0; + hero.spendAndNext(1f); + } else { + super.execute(hero, action); + } + } + + @Override + public boolean isUpgradable() { + return false; + } + + @Override + public boolean isIdentified() { + return true; + } + + @Override + public String desc() { + String info = super.desc(); + info += "\n\n" + Messages.get(AttackShield.class, "charge",charge,fullCharge); + return info; + } + + @Override + public String status() { + return Messages.format("%d", (int)charge/60); + } + +} diff --git a/java/com/hmdzl/spspd/items/misc/JumpF.java b/java/com/hmdzl/spspd/items/misc/JumpF.java index 444cd897..9d7020d3 100644 --- a/java/com/hmdzl/spspd/items/misc/JumpF.java +++ b/java/com/hmdzl/spspd/items/misc/JumpF.java @@ -100,8 +100,10 @@ public void onSelect(Integer target) { @Override public void call() { if (Dungeon.level.map[curUser.pos] != Terrain.ENTRANCE && - Dungeon.level.map[curUser.pos] != Terrain.EXIT - && Level.insideMap(curUser.pos)) { + Dungeon.level.map[curUser.pos] != Terrain.EXIT && + Dungeon.level.map[curUser.pos] != Terrain.ALCHEMY && + Dungeon.level.map[curUser.pos] != Terrain.PEDESTAL && + Level.insideMap(curUser.pos)) { Level.set(curUser.pos, Terrain.HIGH_GRASS); GameScene.updateMap(curUser.pos); } diff --git a/java/com/hmdzl/spspd/items/misc/NeedPaper.java b/java/com/hmdzl/spspd/items/misc/NeedPaper.java new file mode 100644 index 00000000..6e17e51b --- /dev/null +++ b/java/com/hmdzl/spspd/items/misc/NeedPaper.java @@ -0,0 +1,131 @@ +/* + * Pixel Dungeon + * Copyright (C) 2012-2014 Oleg Dolya + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + */ +package com.hmdzl.spspd.items.misc; + +import java.util.ArrayList; + +import com.hmdzl.spspd.Dungeon; +import com.hmdzl.spspd.actors.Actor; +import com.hmdzl.spspd.actors.Char; +import com.hmdzl.spspd.actors.buffs.ArmorBreak; +import com.hmdzl.spspd.actors.buffs.AttackDown; +import com.hmdzl.spspd.actors.buffs.Bleeding; +import com.hmdzl.spspd.actors.buffs.Buff; +import com.hmdzl.spspd.actors.buffs.Cripple; +import com.hmdzl.spspd.actors.buffs.Poison; +import com.hmdzl.spspd.actors.buffs.Weakness; +import com.hmdzl.spspd.actors.hero.Hero; +import com.hmdzl.spspd.items.Generator; +import com.hmdzl.spspd.items.Item; + +import com.hmdzl.spspd.levels.Level; +import com.hmdzl.spspd.messages.Messages; +import com.hmdzl.spspd.scenes.GameScene; +import com.hmdzl.spspd.sprites.ItemSpriteSheet; +import com.hmdzl.spspd.utils.GLog; +import com.hmdzl.spspd.windows.WndItem; +import com.watabou.utils.Bundle; +import com.watabou.utils.Random; + +import static com.hmdzl.spspd.ui.ActionIndicator.action; + +public class NeedPaper extends Item { + + { + //name = "NeedPaper"; + image = ItemSpriteSheet.NEED_PAPER; + unique = true; + defaultAction = AC_CHOOSE; + } + + private static final String AC_CHOOSE = "CHOOSE"; + + public static final String AC_HELP = "HELP"; + public static final String AC_SHOP = "SHOP"; + + @Override + public ArrayList actions(Hero hero) { + ArrayList actions = super.actions(hero); + actions.remove(AC_DROP); + actions.remove(AC_THROW); + + actions.add(AC_HELP); + actions.add(AC_SHOP); + + return actions; + } + + @Override + public void execute(Hero hero, String action) { + + curUser = Dungeon.hero; + if (action.equals( AC_CHOOSE )) { + + GameScene.show(new WndItem(null, this, true)); + + } else if (action.equals(AC_HELP)) { + if (Dungeon.hero.spp < 500) { + GLog.p(Messages.get(this, "need_charge")); + } else { + hero.sprite.operate(hero.pos); + hero.HP = hero.HT; + Dungeon.hero.spp -= 500; + Buff.detach(hero, Poison.class); + Buff.detach(hero, Cripple.class); + Buff.detach(hero, Weakness.class); + Buff.detach(hero, Bleeding.class); + Buff.detach(hero, AttackDown.class); + Buff.detach(hero, ArmorBreak.class); + } + hero.spendAndNext(1f); + } else + if (action.equals(AC_SHOP)) { + if (Dungeon.hero.spp < 3000) { + GLog.p(Messages.get(this, "need_charge")); + } else { + hero.sprite.operate(hero.pos); + + Dungeon.level.drop(Generator.random(Random.oneOf(Generator.Category.WAND, + Generator.Category.RING, Generator.Category.ARTIFACT, + Generator.Category.WEAPON, Generator.Category.ARMOR)), Dungeon.hero.pos).sprite.drop(Dungeon.hero.pos); + + Dungeon.hero.spp -= 3000; + hero.spendAndNext(1f); + } + } else { + super.execute(hero, action); + } + } + + @Override + public boolean isUpgradable() { + return false; + } + + @Override + public boolean isIdentified() { + return true; + } + + @Override + public String desc() { + String info = super.desc(); + return info; + } + +} diff --git a/java/com/hmdzl/spspd/items/misc/NmHealBag.java b/java/com/hmdzl/spspd/items/misc/NmHealBag.java new file mode 100644 index 00000000..6461f971 --- /dev/null +++ b/java/com/hmdzl/spspd/items/misc/NmHealBag.java @@ -0,0 +1,136 @@ +/* + * Pixel Dungeon + * Copyright (C) 2012-2014 Oleg Dolya + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + */ +package com.hmdzl.spspd.items.misc; + +import java.util.ArrayList; + +import com.hmdzl.spspd.Dungeon; +import com.hmdzl.spspd.actors.Actor; +import com.hmdzl.spspd.actors.Char; +import com.hmdzl.spspd.actors.buffs.ArmorBreak; +import com.hmdzl.spspd.actors.buffs.AttackDown; +import com.hmdzl.spspd.actors.buffs.Bleeding; +import com.hmdzl.spspd.actors.buffs.Buff; +import com.hmdzl.spspd.actors.buffs.Cripple; +import com.hmdzl.spspd.actors.buffs.Poison; +import com.hmdzl.spspd.actors.buffs.Weakness; +import com.hmdzl.spspd.actors.hero.Hero; +import com.hmdzl.spspd.items.Generator; +import com.hmdzl.spspd.items.Item; + +import com.hmdzl.spspd.levels.Level; +import com.hmdzl.spspd.messages.Messages; +import com.hmdzl.spspd.scenes.GameScene; +import com.hmdzl.spspd.sprites.ItemSpriteSheet; +import com.hmdzl.spspd.utils.GLog; +import com.hmdzl.spspd.windows.WndItem; +import com.watabou.utils.Bundle; +import com.watabou.utils.Random; + +import static com.hmdzl.spspd.ui.ActionIndicator.action; + +public class NmHealBag extends Item { + + { + //name = "healbag"; + image = ItemSpriteSheet.HEAL_BAG; + unique = true; + defaultAction = AC_CHOOSE; + } + + private static final String AC_CHOOSE = "CHOOSE"; + + public static final String AC_HEAL = "HEAL"; + public static final String AC_COOK = "COOK"; + public static final String AC_ADD = "ADD"; + + @Override + public ArrayList actions(Hero hero) { + ArrayList actions = super.actions(hero); + actions.remove(AC_DROP); + actions.remove(AC_THROW); + + actions.add(AC_HEAL); + actions.add(AC_COOK); + actions.add(AC_ADD); + + return actions; + } + + @Override + public void execute(Hero hero, String action) { + + curUser = Dungeon.hero; + if (action.equals( AC_CHOOSE )) { + + GameScene.show(new WndItem(null, this, true)); + + } else if (action.equals(AC_HEAL)) { + if (Dungeon.hero.spp > 0) { + hero.HP = hero.HP + Dungeon.hero.spp; + Dungeon.hero.spp = 0; + Buff.detach(hero, Poison.class); + Buff.detach(hero, Cripple.class); + Buff.detach(hero, Weakness.class); + Buff.detach(hero, Bleeding.class); + Buff.detach(hero, AttackDown.class); + Buff.detach(hero, ArmorBreak.class); + } + hero.spendAndNext(1f); + } else + if (action.equals(AC_COOK)) { + if (Dungeon.hero.spp < 10) { + GLog.p(Messages.get(this, "need_charge")); + } else { + if (Random.Int(4) == 0) { + Dungeon.level.drop(Generator.random(Generator.Category.HIGHFOOD), Dungeon.hero.pos).sprite.drop(Dungeon.hero.pos); + } else { + Dungeon.level.drop(Generator.random(Generator.Category.SUMMONED), Dungeon.hero.pos).sprite.drop(Dungeon.hero.pos); + } + Dungeon.hero.spp -= 10; + hero.spendAndNext(1f); + } + } else + if (action.equals(AC_ADD)) { + if (hero.HP > 10) { + Dungeon.hero.spp += (int)(hero.HP/4); + hero.HP = 1; + } + hero.spendAndNext(1f); + } else { + super.execute(hero, action); + } + } + + @Override + public boolean isUpgradable() { + return false; + } + + @Override + public boolean isIdentified() { + return true; + } + + @Override + public String desc() { + String info = super.desc(); + return info; + } + +} diff --git a/java/com/hmdzl/spspd/items/misc/PPC.java b/java/com/hmdzl/spspd/items/misc/PPC.java new file mode 100644 index 00000000..c38536f4 --- /dev/null +++ b/java/com/hmdzl/spspd/items/misc/PPC.java @@ -0,0 +1,169 @@ +/* + * Pixel Dungeon + * Copyright (C) 2012-2015 Oleg Dolya + * + * Yet Another Pixel Dungeon + * Copyright (C) 2015-2016 Considered Hamster + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + */ +package com.hmdzl.spspd.items.misc; + +import com.hmdzl.spspd.Assets; +import com.hmdzl.spspd.Dungeon; +import com.hmdzl.spspd.actors.buffs.Bless; +import com.hmdzl.spspd.actors.buffs.Buff; +import com.hmdzl.spspd.actors.buffs.Hunger; +import com.hmdzl.spspd.actors.buffs.WarGroove; +import com.hmdzl.spspd.actors.buffs.mindbuff.AmokMind; +import com.hmdzl.spspd.actors.buffs.mindbuff.CrazyMind; +import com.hmdzl.spspd.actors.buffs.mindbuff.LoseMind; +import com.hmdzl.spspd.actors.buffs.mindbuff.TerrorMind; +import com.hmdzl.spspd.actors.buffs.mindbuff.WeakMind; +import com.hmdzl.spspd.actors.hero.Hero; +import com.hmdzl.spspd.effects.CellEmitter; +import com.hmdzl.spspd.effects.Speck; +import com.hmdzl.spspd.items.Generator; +import com.hmdzl.spspd.items.Item; +import com.hmdzl.spspd.items.weapon.missiles.MindArrow; +import com.hmdzl.spspd.levels.Level; +import com.hmdzl.spspd.levels.Terrain; +import com.hmdzl.spspd.messages.Messages; +import com.hmdzl.spspd.scenes.GameScene; +import com.hmdzl.spspd.sprites.ItemSpriteSheet; +import com.hmdzl.spspd.ui.BuffIndicator; +import com.hmdzl.spspd.utils.GLog; +import com.watabou.noosa.audio.Sample; +import com.watabou.utils.Bundle; +import com.watabou.utils.Callback; +import com.watabou.utils.Random; + +import java.util.ArrayList; + +public class PPC extends Item { + + public static final String AC_TRY = "TRY"; + public static final String AC_HEAL = "HEAL"; + public static final String AC_MIND = "MIND"; + + + { + //name = "PPC"; + image = ItemSpriteSheet.PPC; + defaultAction = AC_TRY; + unique = true; + + } + + public int charge = 0; + private static final String CHARGE = "charge"; + + @Override + public void storeInBundle(Bundle bundle) { + super.storeInBundle(bundle); + bundle.put(CHARGE, charge); + } + + @Override + public void restoreFromBundle(Bundle bundle) { + super.restoreFromBundle(bundle); + charge = bundle.getInt(CHARGE); + } + + @Override + public ArrayList actions(Hero hero ) { + ArrayList actions = super.actions( hero ); + + actions.add(AC_TRY); + if (charge > 20) + actions.add(AC_HEAL); + if (charge > 5) + actions.add(AC_MIND); + + actions.remove( AC_THROW ); + actions.remove( AC_DROP ); + return actions; + } + + @Override + public void execute( final Hero hero, String action ) { + if (action.equals(AC_TRY)) { + if (charge < 1) { + GLog.p(Messages.get(PPC.class, "need_charge")); + } else { + charge--; + hero.sprite.operate(hero.pos); + hero.busy(); + Dungeon.hero.spp += Random.Int(10); + + Buff.affect(Dungeon.hero, Bless.class, 10f); + + } + } + if (action.equals(AC_HEAL)) { + + hero.sprite.operate(hero.pos); + hero.busy(); + charge -= 20; + if (Dungeon.hero.buff(WeakMind.class) != null) { + Buff.detach(Dungeon.hero, WeakMind.class); + } else if (Dungeon.hero.buff(AmokMind.class) != null) { + Buff.detach(Dungeon.hero, AmokMind.class); + } else if (Dungeon.hero.buff(CrazyMind.class) != null) { + Buff.detach(Dungeon.hero, CrazyMind.class); + } else if (Dungeon.hero.buff(TerrorMind.class) != null) { + Buff.detach(Dungeon.hero, TerrorMind.class); + } else if (Dungeon.hero.buff(LoseMind.class) != null) { + Buff.detach(Dungeon.hero, LoseMind.class); + } + + Dungeon.hero.HP += Dungeon.hero.HT / 5; + Dungeon.hero.spp = 0; + } + if (action.equals(AC_MIND)) { + hero.sprite.operate(hero.pos); + hero.busy(); + charge -= 5; + Dungeon.level.drop(new MindArrow(5), hero.pos).sprite.drop(); + } else { + super.execute(hero, action); + + } + + } + + @Override + public String status() { + return Messages.format("%d", charge); + } + + @Override + public String info() { + String info = desc(); + info += "\n\n" + Messages.get(PPC.class, "charge",charge); + return info; + } + + @Override + public boolean isUpgradable() { + return false; + } + + @Override + public boolean isIdentified() { + return true; + } + + +} diff --git a/java/com/hmdzl/spspd/items/misc/UndeadBook.java b/java/com/hmdzl/spspd/items/misc/UndeadBook.java index 7122effb..86859992 100644 --- a/java/com/hmdzl/spspd/items/misc/UndeadBook.java +++ b/java/com/hmdzl/spspd/items/misc/UndeadBook.java @@ -41,7 +41,7 @@ public class UndeadBook extends Item { //name = "UndeadBook"; image = ItemSpriteSheet.UNDEAD_BOOK; - stackable = false; + unique = true; charge = 0; //defaultAction = AC_READ; } diff --git a/java/com/hmdzl/spspd/items/potions/Potion.java b/java/com/hmdzl/spspd/items/potions/Potion.java index a9da3478..919cb191 100644 --- a/java/com/hmdzl/spspd/items/potions/Potion.java +++ b/java/com/hmdzl/spspd/items/potions/Potion.java @@ -63,11 +63,12 @@ public class Potion extends Item { PotionOfMindVision.class, PotionOfPurity.class, PotionOfInvisibility.class, PotionOfMight.class, PotionOfFrost.class, PotionOfMending.class, - PotionOfOverHealing.class}; + PotionOfOverHealing.class, PotionOfShield.class, PotionOfMixing.class}; private static final String[] colors = { "turquoise", "crimson", "azure", "jade", "golden", "magenta", "charcoal", "ivory", "amber", - "bistre", "indigo", "silver", "aqua", "violet"}; + "bistre", "indigo", "silver", "aqua", "violet", "mihuang" + ,""}; private static final Integer[] images = { ItemSpriteSheet.POTION_TURQUOISE, ItemSpriteSheet.POTION_CRIMSON, ItemSpriteSheet.POTION_AZURE, ItemSpriteSheet.POTION_JADE, ItemSpriteSheet.POTION_GOLDEN, @@ -75,7 +76,8 @@ public class Potion extends Item { ItemSpriteSheet.POTION_IVORY, ItemSpriteSheet.POTION_AMBER, ItemSpriteSheet.POTION_BISTRE, ItemSpriteSheet.POTION_INDIGO, ItemSpriteSheet.POTION_SILVER, ItemSpriteSheet.POTION_AQUA, - ItemSpriteSheet.POTION_VIOLET}; + ItemSpriteSheet.POTION_VIOLET, ItemSpriteSheet.POTION_MIHUANG, + ItemSpriteSheet.POTION_CATALYST}; private static ItemStatusHandler handler; @@ -91,7 +93,7 @@ public class Potion extends Item { @SuppressWarnings("unchecked") public static void initColors() { handler = new ItemStatusHandler( - (Class[]) potions, colors, images); + (Class[]) potions, colors, images, 1); } public static void save(Bundle bundle) { @@ -169,7 +171,8 @@ public void doThrow(final Hero hero) { || this instanceof PotionOfInvisibility || this instanceof PotionOfMight || this instanceof PotionOfOverHealing - || this instanceof PotionOfMending)) { + || this instanceof PotionOfMending + || this instanceof PotionOfShield)) { GameScene.show(new WndOptions( Messages.get(Potion.class, "beneficial"), Messages.get(Potion.class, "sure_throw"), diff --git a/java/com/hmdzl/spspd/items/potions/PotionOfMending.java b/java/com/hmdzl/spspd/items/potions/PotionOfMending.java index d5d8e30a..7ca60778 100644 --- a/java/com/hmdzl/spspd/items/potions/PotionOfMending.java +++ b/java/com/hmdzl/spspd/items/potions/PotionOfMending.java @@ -67,7 +67,7 @@ public void shatter(int cell) { Sample.INSTANCE.play(Assets.SND_SHATTER); } - GameScene.add(Blob.seed(cell, 500, HealLight.class)); + GameScene.add(Blob.seed(cell, 200, HealLight.class)); } @Override diff --git a/java/com/hmdzl/spspd/items/potions/PotionOfMight.java b/java/com/hmdzl/spspd/items/potions/PotionOfMight.java index ff17d322..84b4d070 100644 --- a/java/com/hmdzl/spspd/items/potions/PotionOfMight.java +++ b/java/com/hmdzl/spspd/items/potions/PotionOfMight.java @@ -33,8 +33,8 @@ public class PotionOfMight extends Potion { public void apply(Hero hero) { setKnown(); - hero.HT += 15; - hero.HP += 15; + hero.HT += 10; + hero.HP += 10; hero.sprite.showStatus(CharSprite.POSITIVE, Messages.get(this, "msg_1")); } diff --git a/java/com/hmdzl/spspd/items/potions/PotionOfMixing.java b/java/com/hmdzl/spspd/items/potions/PotionOfMixing.java new file mode 100644 index 00000000..cec9f0e6 --- /dev/null +++ b/java/com/hmdzl/spspd/items/potions/PotionOfMixing.java @@ -0,0 +1,66 @@ +/* + * Pixel Dungeon + * Copyright (C) 2012-2014 Oleg Dolya + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + */ +package com.hmdzl.spspd.items.potions; + +import com.hmdzl.spspd.Dungeon; +import com.hmdzl.spspd.actors.buffs.Bleeding; +import com.hmdzl.spspd.actors.buffs.Buff; +import com.hmdzl.spspd.actors.buffs.Cripple; +import com.hmdzl.spspd.actors.buffs.Poison; +import com.hmdzl.spspd.actors.buffs.Weakness; +import com.hmdzl.spspd.actors.hero.Hero; +import com.hmdzl.spspd.actors.hero.HeroSubClass; +import com.hmdzl.spspd.effects.Speck; +import com.hmdzl.spspd.messages.Messages; +import com.hmdzl.spspd.sprites.ItemSpriteSheet; +import com.hmdzl.spspd.utils.GLog; + +public class PotionOfMixing extends Potion { + + { + + image = ItemSpriteSheet.POTION_CATALYST; + initials = 0; + } + + @Override + public void apply(Hero hero) { + setKnown(); + mixheal(Dungeon.hero); + } + + public static void mixheal(Hero hero) { + + hero.hitSkill++; + hero.evadeSkill++; + hero.magicSkill++; + GLog.w(Messages.get(PotionOfMixing.class, "skillup")); + + hero.sprite.emitter().start(Speck.factory(Speck.UP), 0.4f, 4); + } + + @Override + public int price() { + return isKnown() ? 100 * quantity : super.price(); + } + + @Override + public boolean isKnown() { + return true; + } +} diff --git a/java/com/hmdzl/spspd/items/potions/PotionOfOverHealing.java b/java/com/hmdzl/spspd/items/potions/PotionOfOverHealing.java index 1b75c285..cb3fd3b8 100644 --- a/java/com/hmdzl/spspd/items/potions/PotionOfOverHealing.java +++ b/java/com/hmdzl/spspd/items/potions/PotionOfOverHealing.java @@ -18,6 +18,7 @@ package com.hmdzl.spspd.items.potions; import com.hmdzl.spspd.Dungeon; +import com.hmdzl.spspd.actors.buffs.BerryRegeneration; import com.hmdzl.spspd.actors.buffs.Bleeding; import com.hmdzl.spspd.actors.buffs.Buff; import com.hmdzl.spspd.actors.buffs.Cripple; @@ -44,6 +45,7 @@ public void apply(Hero hero) { public static void heal(Hero hero) { hero.HP = hero.HT+(hero.lvl*2); + Buff.affect(hero, BerryRegeneration.class).level(hero.HT); Buff.detach(hero, Poison.class); Buff.detach(hero, Cripple.class); Buff.detach(hero, Weakness.class); diff --git a/java/com/hmdzl/spspd/items/potions/PotionOfHaste.java b/java/com/hmdzl/spspd/items/potions/PotionOfShield.java similarity index 70% rename from java/com/hmdzl/spspd/items/potions/PotionOfHaste.java rename to java/com/hmdzl/spspd/items/potions/PotionOfShield.java index adb14e13..9e01be09 100644 --- a/java/com/hmdzl/spspd/items/potions/PotionOfHaste.java +++ b/java/com/hmdzl/spspd/items/potions/PotionOfShield.java @@ -20,25 +20,28 @@ import com.hmdzl.spspd.Assets; import com.hmdzl.spspd.actors.Char; import com.hmdzl.spspd.actors.buffs.Buff; +import com.hmdzl.spspd.actors.buffs.DefenceUp; import com.hmdzl.spspd.actors.buffs.Haste; +import com.hmdzl.spspd.actors.buffs.ShieldArmor; import com.hmdzl.spspd.actors.hero.Hero; import com.watabou.noosa.audio.Sample; import com.watabou.noosa.tweeners.AlphaTweener; -public class PotionOfHaste extends Potion { +public class PotionOfShield extends Potion { - private static final float ALPHA = 0.4f; + //private static final float ALPHA = 0.4f; { - //name = "Potion of Haste"; + //name = "Potion of shield"; initials = 2; } @Override public void apply(Hero hero) { setKnown(); - Buff.affect(hero, Haste.class, Haste.DURATION); - //GLog.i("You are moving much faster!"); + if (hero.buff(ShieldArmor.class) == null){ + Buff.affect(hero, ShieldArmor.class).level(hero.HT/2); + } else Buff.affect(hero, DefenceUp.class,50f).level(50); Sample.INSTANCE.play(Assets.SND_MELD); } @@ -52,11 +55,11 @@ public int price() { return isKnown() ? 40 * quantity : super.price(); } - public static void melt(Char ch) { - if (ch.sprite.parent != null) { - ch.sprite.parent.add(new AlphaTweener(ch.sprite, ALPHA, 0.4f)); - } else { - ch.sprite.alpha(ALPHA); - } - } + //public static void melt(Char ch) { + //if (ch.sprite.parent != null) { + // ch.sprite.parent.add(new AlphaTweener(ch.sprite, ALPHA, 0.4f)); + //} else { + // ch.sprite.alpha(ALPHA); + //} + //} } diff --git a/java/com/hmdzl/spspd/items/rings/RingOfMight.java b/java/com/hmdzl/spspd/items/rings/RingOfMight.java index bad00a53..e5d2a360 100644 --- a/java/com/hmdzl/spspd/items/rings/RingOfMight.java +++ b/java/com/hmdzl/spspd/items/rings/RingOfMight.java @@ -14,7 +14,7 @@ public class RingOfMight extends Ring { public String statsInfo() { if (isIdentified()){ - return Messages.get(this, "stats",level/5,level*10); + return Messages.get(this, "stats",level/5,level*8); } else { return "???"; } diff --git a/java/com/hmdzl/spspd/items/scrolls/InventoryScroll.java b/java/com/hmdzl/spspd/items/scrolls/InventoryScroll.java index 75b011e4..d21df0b2 100644 --- a/java/com/hmdzl/spspd/items/scrolls/InventoryScroll.java +++ b/java/com/hmdzl/spspd/items/scrolls/InventoryScroll.java @@ -82,7 +82,7 @@ public void onSelect( Item item ) { Sample.INSTANCE.play( Assets.SND_READ ); Invisibility.dispel(); - } else if (identifiedByUse && !((Scroll)curItem).ownedByBook) { + } else if (/*identifiedByUse &&*/ !((Scroll)curItem).ownedByBook) { ((InventoryScroll)curItem).confirmCancelation(); diff --git a/java/com/hmdzl/spspd/items/scrolls/Scroll.java b/java/com/hmdzl/spspd/items/scrolls/Scroll.java index 873b3da5..87bbdd6f 100644 --- a/java/com/hmdzl/spspd/items/scrolls/Scroll.java +++ b/java/com/hmdzl/spspd/items/scrolls/Scroll.java @@ -127,7 +127,8 @@ public void execute(Hero hero, String action) { GLog.n(Messages.get(this, "cursed") ); } else { curUser = hero; - if (!(Dungeon.hero.heroClass == HeroClass.FOLLOWER ) || (Dungeon.hero.heroClass == HeroClass.FOLLOWER && Random.Int(10)>=1 )) + if (!(Dungeon.hero.heroClass == HeroClass.FOLLOWER ) || + (Dungeon.hero.heroClass == HeroClass.FOLLOWER && Random.Int(10)>=1 )) curItem = detach(hero.belongings.backpack); doRead(); //readAnimation(); diff --git a/java/com/hmdzl/spspd/items/skills/FollowerSkill.java b/java/com/hmdzl/spspd/items/skills/FollowerSkill.java index e9b4f2ac..0981fe98 100644 --- a/java/com/hmdzl/spspd/items/skills/FollowerSkill.java +++ b/java/com/hmdzl/spspd/items/skills/FollowerSkill.java @@ -29,6 +29,7 @@ import com.hmdzl.spspd.actors.mobs.npcs.NPC; import com.hmdzl.spspd.effects.Speck; import com.hmdzl.spspd.items.Item; +import com.hmdzl.spspd.items.scrolls.InventoryScroll; import com.hmdzl.spspd.items.scrolls.ScrollOfUpgrade; import com.hmdzl.spspd.levels.Level; import com.hmdzl.spspd.scenes.GameScene; @@ -106,7 +107,7 @@ public void doSpecial3() { @Override public void doSpecial4() { - GameScene.selectItem(itemSelector, WndBag.Mode.UPGRADEABLE, Messages.get(ScrollOfUpgrade.class,"prompt")); + GameScene.selectItem(itemSelector, WndBag.Mode.UPGRADEABLE, Messages.get(InventoryScroll.class,"title")); } @@ -115,7 +116,7 @@ public void doSpecial4() { public void onSelect(Item item) { if (item != null) { FollowerSkill.this.upgrade(item); - FollowerSkill.charge += 15; + FollowerSkill.charge += 40; } } }; diff --git a/java/com/hmdzl/spspd/items/wands/CannonOfMage.java b/java/com/hmdzl/spspd/items/wands/CannonOfMage.java index 89619b04..199b6c38 100644 --- a/java/com/hmdzl/spspd/items/wands/CannonOfMage.java +++ b/java/com/hmdzl/spspd/items/wands/CannonOfMage.java @@ -92,7 +92,7 @@ protected void onZap( Ballistica bolt ) { break; } processSoulMark(ch, chargesPerCast()); - ch.damage((int) (damageRoll() * (1 + 0.5 * Dungeon.hero.magicSkill())), this); + ch.damage((int) (damageRoll() * (1 + 0.6 * Dungeon.hero.magicSkill())), this); } } } diff --git a/java/com/hmdzl/spspd/items/wands/Wand.java b/java/com/hmdzl/spspd/items/wands/Wand.java index caf4d933..2300f7f6 100644 --- a/java/com/hmdzl/spspd/items/wands/Wand.java +++ b/java/com/hmdzl/spspd/items/wands/Wand.java @@ -94,7 +94,9 @@ public void execute( Hero hero, String action ) { if (action.equals( AC_ZAP )) { if (hero.buff(Silent.class) != null) { GLog.w(Messages.get(Wand.class, "silent")); - } else { + } else if (Dungeon.hero.heroClass == HeroClass.MAGE && Dungeon.skins == 4 && Dungeon.hero.spp < 1) { + GLog.w(Messages.get(Wand.class, "needmana")); + } else{ curUser = hero; curItem = this; GameScene.selectCell( zapper ); @@ -272,7 +274,11 @@ protected void wandUsed() { } else curUser.spendAndNext(TIME_TO_ZAP); GnollMark gnollmark = curUser.belongings.getItem(GnollMark.class); - if (gnollmark!=null && gnollmark.charge) enchants[Random.chances(chancesBuzz)]) .newInstance(); @@ -447,9 +447,9 @@ public static Enchantment randomBuzz() { } @SuppressWarnings("unchecked") - public static Enchantment randomLuck() { + public static Enchantment Luck() { try { - return ((Class) enchants[Random.chances(chancesLuck)]) + return ((Class) relicenchants[Random.chances(chancesLuck)]) .newInstance(); } catch (Exception e) { return null; @@ -488,9 +488,9 @@ public static Enchantment Loki() { @SuppressWarnings("unchecked") - public static Enchantment randomNeptune() { + public static Enchantment Neptune() { try { - return ((Class) enchants[Random.chances(chancesNeptune)]) + return ((Class) relicenchants[Random.chances(chancesNeptune)]) .newInstance(); } catch (Exception e) { return null; diff --git a/java/com/hmdzl/spspd/items/weapon/guns/GunWeapon.java b/java/com/hmdzl/spspd/items/weapon/guns/GunWeapon.java index 48d09916..bc08730f 100644 --- a/java/com/hmdzl/spspd/items/weapon/guns/GunWeapon.java +++ b/java/com/hmdzl/spspd/items/weapon/guns/GunWeapon.java @@ -314,6 +314,7 @@ public class NormalAmmo extends MissileWeapon { { image = ItemSpriteSheet.AMMO; STR = Math.max(typicalSTR(),Dungeon.hero.STR); + ACU = 1.3f; } public int damageRoll(Hero owner) { diff --git a/java/com/hmdzl/spspd/items/weapon/melee/HolyWater.java b/java/com/hmdzl/spspd/items/weapon/melee/HolyWater.java index 6ce97ad9..329561df 100644 --- a/java/com/hmdzl/spspd/items/weapon/melee/HolyWater.java +++ b/java/com/hmdzl/spspd/items/weapon/melee/HolyWater.java @@ -66,8 +66,8 @@ public Item upgrade(boolean enchant) { DLY-=0.05f; } - MIN+=2; - MAX+=1; + MIN+=1; + return super.upgrade(enchant); } @@ -80,7 +80,7 @@ public void proc(Char attacker, Char defender, int damage) { if (charge >= 14) { defender.damage(5*damage ,this); - attacker.HP += damage; + attacker.HP += Math.min(damage,attacker.HT-attacker.HT); charge = 0; } diff --git a/java/com/hmdzl/spspd/items/weapon/melee/Knuckles.java b/java/com/hmdzl/spspd/items/weapon/melee/Knuckles.java index fd462074..cedeeb30 100644 --- a/java/com/hmdzl/spspd/items/weapon/melee/Knuckles.java +++ b/java/com/hmdzl/spspd/items/weapon/melee/Knuckles.java @@ -42,10 +42,10 @@ public Knuckles() { @Override public Item upgrade(boolean enchant) { - if (DLY > 0.40f){ + if (DLY > 0.30f){ DLY-=0.05f; } - if (DLY < 0.45f && RCH < 2){ + if (DLY < 0.35f && RCH < 2){ RCH ++; } MIN+=1; diff --git a/java/com/hmdzl/spspd/items/weapon/melee/Mace.java b/java/com/hmdzl/spspd/items/weapon/melee/Mace.java index dacdc446..a31018e0 100644 --- a/java/com/hmdzl/spspd/items/weapon/melee/Mace.java +++ b/java/com/hmdzl/spspd/items/weapon/melee/Mace.java @@ -70,8 +70,8 @@ public Item upgrade(boolean enchant) { RCH++; } - MIN+=2; - MAX+=1; + MIN+=1; + return super.upgrade(enchant); } diff --git a/java/com/hmdzl/spspd/items/weapon/melee/PrayerWheel.java b/java/com/hmdzl/spspd/items/weapon/melee/PrayerWheel.java index 054b26ab..1fa93d21 100644 --- a/java/com/hmdzl/spspd/items/weapon/melee/PrayerWheel.java +++ b/java/com/hmdzl/spspd/items/weapon/melee/PrayerWheel.java @@ -65,8 +65,8 @@ public Item upgrade(boolean enchant) { if (ACU > 1.2f && DLY > 0.8f){ DLY-=0.05f; } - MIN+=2; - MAX+=2; + MIN+=1; + MAX+=1; return super.upgrade(enchant); } diff --git a/java/com/hmdzl/spspd/items/weapon/melee/StoneCross.java b/java/com/hmdzl/spspd/items/weapon/melee/StoneCross.java index 2ce99db9..85d8ebab 100644 --- a/java/com/hmdzl/spspd/items/weapon/melee/StoneCross.java +++ b/java/com/hmdzl/spspd/items/weapon/melee/StoneCross.java @@ -65,8 +65,8 @@ public Item upgrade(boolean enchant) { if (ACU > 1.2f && DLY > 0.8f){ DLY-=0.05f; } - MIN+=1; - MAX+=2; + + MAX+=1; return super.upgrade(enchant); } diff --git a/java/com/hmdzl/spspd/items/weapon/melee/WoodenStaff.java b/java/com/hmdzl/spspd/items/weapon/melee/WoodenStaff.java index 0d5c9222..1a2cedd6 100644 --- a/java/com/hmdzl/spspd/items/weapon/melee/WoodenStaff.java +++ b/java/com/hmdzl/spspd/items/weapon/melee/WoodenStaff.java @@ -68,8 +68,6 @@ public Item upgrade(boolean enchant) { DLY-=0.05f; } - MIN+=1; - MAX+=1; return super.upgrade(enchant); } diff --git a/java/com/hmdzl/spspd/items/weapon/melee/relic/JupitersWraith.java b/java/com/hmdzl/spspd/items/weapon/melee/relic/JupitersWraith.java index c9e5a38f..ab49faa3 100644 --- a/java/com/hmdzl/spspd/items/weapon/melee/relic/JupitersWraith.java +++ b/java/com/hmdzl/spspd/items/weapon/melee/relic/JupitersWraith.java @@ -77,7 +77,7 @@ public void execute(Hero hero, String action) { private int distance(){ - return Math.round(level/3)+1; + return 4; } private void explode(int distance, Hero hero) { diff --git a/java/com/hmdzl/spspd/items/weapon/melee/relic/RelicMeleeWeapon.java b/java/com/hmdzl/spspd/items/weapon/melee/relic/RelicMeleeWeapon.java index 6f81f1a3..457e78a7 100644 --- a/java/com/hmdzl/spspd/items/weapon/melee/relic/RelicMeleeWeapon.java +++ b/java/com/hmdzl/spspd/items/weapon/melee/relic/RelicMeleeWeapon.java @@ -153,7 +153,7 @@ public Item upgrade() { public Item upgrade(boolean enchant) { MIN+=2; - MAX+=5; + MAX+=4; if (enchant){ GLog.i(Messages.get(this,"refuse")); @@ -224,7 +224,7 @@ public String info() { @Override public int price() { - int price = 150; + int price = 300; if (enchantment != null) { price *= 1.5; } diff --git a/java/com/hmdzl/spspd/change/items/weapon/melee/Dualknive.java b/java/com/hmdzl/spspd/items/weapon/melee/special/DemonBlade.java similarity index 59% rename from java/com/hmdzl/spspd/change/items/weapon/melee/Dualknive.java rename to java/com/hmdzl/spspd/items/weapon/melee/special/DemonBlade.java index 4e7fa0e4..a63726a6 100644 --- a/java/com/hmdzl/spspd/change/items/weapon/melee/Dualknive.java +++ b/java/com/hmdzl/spspd/items/weapon/melee/special/DemonBlade.java @@ -15,27 +15,31 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see */ -package com.hmdzl.spspd.change.items.weapon.melee; +package com.hmdzl.spspd.items.weapon.melee.special; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.items.KindOfWeapon; -import com.hmdzl.spspd.change.items.weapon.melee.MeleeWeapon; -import com.hmdzl.spspd.change.messages.Messages; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.utils.GLog; +import com.hmdzl.spspd.Dungeon; +import com.hmdzl.spspd.actors.buffs.Buff; +import com.hmdzl.spspd.actors.buffs.DBurning; +import com.hmdzl.spspd.items.KindOfWeapon; +import com.hmdzl.spspd.items.weapon.melee.MeleeWeapon; +import com.hmdzl.spspd.messages.Messages; +import com.hmdzl.spspd.sprites.ItemSpriteSheet; +import com.hmdzl.spspd.items.Item; +import com.hmdzl.spspd.actors.Char; +import com.hmdzl.spspd.utils.GLog; import com.watabou.utils.Random; +import static com.hmdzl.spspd.Dungeon.hero; -public class Dualknive extends MeleeWeapon { + +public class DemonBlade extends MeleeWeapon { { - //name = "Dual Knive"; - image = ItemSpriteSheet.DKNIVE; + //name = "D blade"; + image = ItemSpriteSheet.DEMON_BLADE; } - public Dualknive(){ + public DemonBlade(){ super(2, 1f, 1f, 1); } @@ -55,7 +59,7 @@ public Item upgrade(boolean enchant) { } MIN+=2; - MAX+=1; + MAX+=2; return super.upgrade(enchant); } @@ -66,20 +70,20 @@ public void proc(Char attacker, Char defender, int damage) { int DMG = damage; defender.damage(Random.Int(DMG/4,DMG/2), this); + + damage = (int)(damage* (1 + 0.1 * Dungeon.hero.magicSkill())); + + if (Random.Int(8) == 0) { + Buff.affect(defender,DBurning.class).reignite(defender); + } + + if (Random.Int(3) == 0) { + Dungeon.hero.spp++; + } if (enchantment != null) { enchantment.proc(this, attacker, defender, damage); } - if (durable() && attacker == Dungeon.hero){ - durable --; - if (durable == 10){ - GLog.n(Messages.get(KindOfWeapon.class,"almost_destory")); - } - if (durable == 0){ - Dungeon.hero.belongings.weapon = null; - GLog.n(Messages.get(KindOfWeapon.class,"destory")); - } - } } } diff --git a/java/com/hmdzl/spspd/items/weapon/melee/special/DiamondPickaxe.java b/java/com/hmdzl/spspd/items/weapon/melee/special/DiamondPickaxe.java index d5dc0917..3ef22af6 100644 --- a/java/com/hmdzl/spspd/items/weapon/melee/special/DiamondPickaxe.java +++ b/java/com/hmdzl/spspd/items/weapon/melee/special/DiamondPickaxe.java @@ -30,7 +30,9 @@ import com.hmdzl.spspd.effects.Speck; import com.hmdzl.spspd.effects.particles.ShadowParticle; import com.hmdzl.spspd.items.Generator; +import com.hmdzl.spspd.items.Gold; import com.hmdzl.spspd.items.Item; +import com.hmdzl.spspd.items.misc.Shovel; import com.hmdzl.spspd.items.weapon.melee.MeleeWeapon; import com.hmdzl.spspd.items.weapon.missiles.buildblock.BookBlock; import com.hmdzl.spspd.items.weapon.missiles.buildblock.DoorBlock; @@ -52,7 +54,7 @@ public class DiamondPickaxe extends MeleeWeapon { public static final String AC_MINE = "MINE"; - public static final float TIME_TO_MINE = 10; + public static final float TIME_TO_MINE = 6; { //name = "pickaxe"; @@ -79,6 +81,10 @@ public ArrayList actions(Hero hero) { public void execute(final Hero hero, String action) { if (action == AC_MINE) { + if (Dungeon.hero.isHungry() || Dungeon.hero.isStarving()){ + GLog.i(Messages.get(this, "break")); + return; + } if (Random.Int(3) == 0) { for (Mob mob : Dungeon.level.mobs.toArray(new Mob[0])) { mob.beckon(hero.pos); @@ -107,7 +113,10 @@ public void call() { WallBlock wall = new WallBlock(); - Dungeon.level.drop(wall, hero.pos).sprite.drop(); + + if (Random.Int(60)==1){ + Dungeon.level.drop(new Gold(50), hero.pos).sprite.drop(); + } else Dungeon.level.drop(wall, hero.pos).sprite.drop(); Hunger hunger = hero.buff(Hunger.class); if (hunger != null && !hunger.isStarving()) { @@ -139,7 +148,9 @@ public void call() { DoorBlock door = new DoorBlock(); - Dungeon.level.drop(door, hero.pos).sprite.drop(); + if (Random.Int(60)==1){ + Dungeon.level.drop(Generator.random(Generator.Category.SEED), hero.pos).sprite.drop(); + } else Dungeon.level.drop(door, hero.pos).sprite.drop(); Hunger hunger = hero.buff(Hunger.class); if (hunger != null && !hunger.isStarving()) { @@ -171,7 +182,9 @@ public void call() { BookBlock book = new BookBlock(); - Dungeon.level.drop(book, hero.pos).sprite.drop(); + if (Random.Int(60)==1){ + Dungeon.level.drop(Generator.random(Generator.Category.SCROLL), hero.pos).sprite.drop(); + } else Dungeon.level.drop(book, hero.pos).sprite.drop(); Hunger hunger = hero.buff(Hunger.class); if (hunger != null && !hunger.isStarving()) { @@ -203,7 +216,9 @@ public void call() { WoodenBlock wooden = new WoodenBlock(); - Dungeon.level.drop(wooden, hero.pos).sprite.drop(); + if (Random.Int(60)==1){ + Dungeon.level.drop(Generator.random(Generator.Category.MUSHROOM), hero.pos).sprite.drop(); + } else Dungeon.level.drop(wooden, hero.pos).sprite.drop(); Hunger hunger = hero.buff(Hunger.class); if (hunger != null && !hunger.isStarving()) { @@ -235,7 +250,9 @@ public void call() { StoneBlock stone = new StoneBlock(); - Dungeon.level.drop(stone, hero.pos).sprite.drop(); + if (Random.Int(60)==1){ + Dungeon.level.drop(Generator.random(), hero.pos).sprite.drop(); + } else Dungeon.level.drop(stone, hero.pos).sprite.drop(); Hunger hunger = hero.buff(Hunger.class); if (hunger != null && !hunger.isStarving()) { diff --git a/java/com/hmdzl/spspd/items/weapon/melee/special/DragonBoat.java b/java/com/hmdzl/spspd/items/weapon/melee/special/DragonBoat.java new file mode 100644 index 00000000..79f499da --- /dev/null +++ b/java/com/hmdzl/spspd/items/weapon/melee/special/DragonBoat.java @@ -0,0 +1,68 @@ +/* + * Pixel Dungeon + * Copyright (C) 2012-2014 Oleg Dolya + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + */ +package com.hmdzl.spspd.items.weapon.melee.special; + +import com.hmdzl.spspd.actors.buffs.Bleeding; +import com.hmdzl.spspd.actors.buffs.Paralysis; +import com.hmdzl.spspd.actors.buffs.Shieldblock; +import com.hmdzl.spspd.items.Generator; +import com.hmdzl.spspd.items.KindOfWeapon; +import com.hmdzl.spspd.items.weapon.melee.MeleeWeapon; +import com.hmdzl.spspd.messages.Messages; +import com.hmdzl.spspd.sprites.ItemSpriteSheet; +import com.hmdzl.spspd.actors.Char; +import com.hmdzl.spspd.actors.buffs.Buff; +import com.watabou.utils.Random; +import com.hmdzl.spspd.Dungeon; +import com.hmdzl.spspd.utils.GLog; + +public class DragonBoat extends MeleeWeapon { + + { + //name = "Dragon Boat"; + image = ItemSpriteSheet.BOAT; + + usesTargeting = true; + } + + public DragonBoat() { + super(1, 1f, 1f, 1); + MIN = 5; + MAX = 10; + } + + + @Override + public void proc(Char attacker, Char defender, int damage) { + + if (Random.Int(100) < 40) { + Buff.prolong(defender, Paralysis.class, 3f); + } + + if (enchantment != null) { + enchantment.proc(this, attacker, defender, damage); + } + if (Random.Int(100) ==1 ){ + + Dungeon.hero.belongings.weapon = null; + Buff.affect(defender, Bleeding.class).set(50); + GLog.n(Messages.get(KindOfWeapon.class,"destory")); + } + } + +} diff --git a/java/com/hmdzl/spspd/items/weapon/melee/special/LinkSword.java b/java/com/hmdzl/spspd/items/weapon/melee/special/LinkSword.java index 44dda0e5..4d96543c 100644 --- a/java/com/hmdzl/spspd/items/weapon/melee/special/LinkSword.java +++ b/java/com/hmdzl/spspd/items/weapon/melee/special/LinkSword.java @@ -199,7 +199,7 @@ public void detach() { public void proc(Char attacker, Char defender, int damage) { int DMG = damage; - if (Random.Int(100) > 50) { + if (Random.Int(100) > 60) { switch (Random.Int(7)) { case 0: defender.damage(Random.Int(DMG / 4, DMG / 2), this); diff --git a/java/com/hmdzl/spspd/items/weapon/missiles/ElfBow.java b/java/com/hmdzl/spspd/items/weapon/missiles/ElfBow.java new file mode 100644 index 00000000..99e96d98 --- /dev/null +++ b/java/com/hmdzl/spspd/items/weapon/missiles/ElfBow.java @@ -0,0 +1,249 @@ +/* + * Pixel Dungeon + * Copyright (C) 2012-2014 Oleg Dolya + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + */ +package com.hmdzl.spspd.items.weapon.missiles; + +import com.hmdzl.spspd.Assets; +import com.hmdzl.spspd.actors.Actor; +import com.hmdzl.spspd.actors.buffs.MechArmor; +import com.hmdzl.spspd.actors.buffs.TargetShoot; +import com.hmdzl.spspd.actors.hero.Hero; +import com.hmdzl.spspd.effects.Splash; +import com.hmdzl.spspd.items.Item; +import com.hmdzl.spspd.items.rings.RingOfSharpshooting; +import com.hmdzl.spspd.items.weapon.Weapon; +import com.hmdzl.spspd.items.weapon.guns.GunWeapon; +import com.hmdzl.spspd.items.weapon.guns.ToyGun; +import com.hmdzl.spspd.items.weapon.melee.special.DemonBlade; +import com.hmdzl.spspd.items.weapon.spammo.SpAmmo; +import com.hmdzl.spspd.scenes.CellSelector; +import com.hmdzl.spspd.scenes.GameScene; +import com.hmdzl.spspd.sprites.ItemSpriteSheet; +import com.hmdzl.spspd.actors.Char; +import com.hmdzl.spspd.utils.GLog; +import com.hmdzl.spspd.windows.WndBag; +import com.hmdzl.spspd.windows.WndOptions; +import com.watabou.noosa.audio.Sample; +import com.watabou.utils.Bundle; +import com.watabou.utils.Random; +import com.hmdzl.spspd.actors.buffs.Buff; +import com.hmdzl.spspd.Dungeon; +import com.hmdzl.spspd.messages.Messages; + +import java.util.ArrayList; + +public class ElfBow extends Weapon { + + public static final String AC_SHOOT = "SHOOT"; + public static final String AC_DRINK = "DRINK"; + + { + //name = "ElfBow"; + image = ItemSpriteSheet.ELF_BOW; + + STR = 10; + + MIN = 2; + MAX = 6; + + stackable = false; + unique = true; + + defaultAction = AC_SHOOT; + usesTargeting = true; + reinforced = true; + } + + public static int charge = 0; + private static final String CHARGE = "charge"; + + @Override + public void storeInBundle(Bundle bundle) { + super.storeInBundle(bundle); + bundle.put(CHARGE, charge); + } + + @Override + public void restoreFromBundle(Bundle bundle) { + super.restoreFromBundle(bundle); + charge = bundle.getInt(CHARGE); + } + + @Override + public boolean isUpgradable() { + return true; + } + + @Override + public Item upgrade() { + return upgrade(false); + } + + @Override + public boolean isIdentified() { + return true; + } + + @Override + public ArrayList actions(Hero hero) { + ArrayList actions = super.actions(hero); + + actions.add(AC_SHOOT); + + actions.add(AC_DRINK); + + return actions; + } + + @Override + public void execute(Hero hero, String action) { + super.execute(hero, action); + if (action.equals(AC_SHOOT)) { + if (!isEquipped( hero )) + GLog.i( Messages.get(ToyGun.class, "need_to_equip") ); + else GameScene.selectCell( shooter ); + } + if (action.equals(AC_DRINK)) { + if (!isEquipped( hero )){ + GLog.i( Messages.get(ToyGun.class, "need_to_equip") ); + } else { + hero.spp += 10; + charge++; + if (charge > 10) { + Dungeon.level.drop(new DemonBlade().upgrade(3), Dungeon.hero.pos).sprite.drop(); + hero.belongings.weapon = null; + updateQuickslot(); + } + } + } + } + + + @Override + public Item upgrade(boolean enchant) { + + MIN += 1; + MAX += 3; + super.upgrade(enchant); + + updateQuickslot(); + + return this; + } + + @Override + public Item degrade() { + return super.degrade(); + } + + public int damageRoll(Hero owner) { + int damage = Random.Int(MIN, MAX); + + float bonus = 0; + for (Buff buff : owner.buffs(RingOfSharpshooting.Aim.class)) { + bonus += ((RingOfSharpshooting.Aim) buff).level; + } + if (Dungeon.hero.buff(TargetShoot.class)!= null) + bonus += 10; + if (Dungeon.hero.buff(MechArmor.class)!= null) + bonus += 10; + + damage = (int)(damage*(1 + 0.05*bonus ) * (1 + 0.1 * Dungeon.hero.magicSkill())); + + + return Math.round(damage); + } + + + @Override + public String info() { + String info = desc(); + + if (reinforced) { + info += "\n" + Messages.get(Item.class, "reinforced"); + } + info += "\n\n" + Messages.get(this, "damage",MIN,MAX); + + return info; + } + + + private int targetPos; + + public ElfBowAmmo Ammo(){ + return new ElfBowAmmo(); + } + + public class ElfBowAmmo extends MissileWeapon { + + { + image = ItemSpriteSheet.POSION_DART; + enchantment = ElfBow.this.enchantment; + } + + public int damageRoll(Hero owner) { + return ElfBow.this.damageRoll(owner); + } + + @Override + protected void onThrow( int cell ) { + Char enemy = Actor.findChar( cell ); + if (enemy == null || enemy == curUser) { + parent = null; + Splash.at( cell, 0xCC99FFFF, 1 ); + } else { + if (!curUser.shoot( enemy, this )) { + Splash.at(cell, 0xCC99FFFF, 1); + } + } + } + + @Override + public void proc(Char attacker, Char defender, int damage) { + + if (enchantment != null) { + enchantment.proc(ElfBow.this, attacker, defender, damage); + } + + if (damage > defender.HP){ + Dungeon.hero.spp++; + } + + super.proc(attacker, defender, damage); + } + + @Override + public void cast(final Hero user, final int dst) { + final int cell = throwPos( user, dst ); + ElfBow.this.targetPos = cell; + super.cast(user, dst); + } + } + + private CellSelector.Listener shooter = new CellSelector.Listener() { + @Override + public void onSelect( Integer target ) { + if (target != null) { + Ammo().cast(curUser, target); + } + } + @Override + public String prompt() { + return Messages.get(ToyGun.class, "prompt"); + } + }; +} \ No newline at end of file diff --git a/java/com/hmdzl/spspd/items/weapon/missiles/HugeShuriken.java b/java/com/hmdzl/spspd/items/weapon/missiles/HugeShuriken.java index 483272c6..43c16d69 100644 --- a/java/com/hmdzl/spspd/items/weapon/missiles/HugeShuriken.java +++ b/java/com/hmdzl/spspd/items/weapon/missiles/HugeShuriken.java @@ -47,7 +47,7 @@ public HugeShuriken(int number) { @Override public void proc(Char attacker, Char defender, int damage) { - Buff.affect(defender, AttackDown.class,10f).level(30); + Buff.affect(defender, AttackDown.class,10f).level(70); super.proc(attacker, defender, damage); } @Override diff --git a/java/com/hmdzl/spspd/change/items/weapon/missiles/EscapeKnive.java b/java/com/hmdzl/spspd/items/weapon/missiles/MindArrow.java similarity index 65% rename from java/com/hmdzl/spspd/change/items/weapon/missiles/EscapeKnive.java rename to java/com/hmdzl/spspd/items/weapon/missiles/MindArrow.java index c18db2f5..ba3eaf91 100644 --- a/java/com/hmdzl/spspd/change/items/weapon/missiles/EscapeKnive.java +++ b/java/com/hmdzl/spspd/items/weapon/missiles/MindArrow.java @@ -15,34 +15,35 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see */ -package com.hmdzl.spspd.change.items.weapon.missiles; +package com.hmdzl.spspd.items.weapon.missiles; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.actors.buffs.Buff; -import com.hmdzl.spspd.change.actors.buffs.Shieldblock; -import com.hmdzl.spspd.change.items.Item; -import com.hmdzl.spspd.change.sprites.ItemSpriteSheet; +import com.hmdzl.spspd.Dungeon; +import com.hmdzl.spspd.actors.Char; +import com.hmdzl.spspd.actors.buffs.Buff; +import com.hmdzl.spspd.actors.buffs.Shieldblock; +import com.hmdzl.spspd.items.Item; +import com.hmdzl.spspd.sprites.ItemSpriteSheet; import com.watabou.utils.Random; -public class EscapeKnive extends MissileWeapon { +public class MindArrow extends MissileWeapon { { - //name = "throwing knive"; - image = ItemSpriteSheet.KNIVE; + //name = "MindArrow"; + image = ItemSpriteSheet.MIND_ARROW; STR = 10; - MIN = 5; + MIN = 0; MAX = 10; // Finding them in bones would be semi-frequent and // disappointing. } - public EscapeKnive() { + public MindArrow() { this(1); } - public EscapeKnive(int number) { + public MindArrow(int number) { super(); quantity = number; } @@ -50,17 +51,17 @@ public EscapeKnive(int number) { @Override public void proc(Char attacker, Char defender, int damage) { super.proc(attacker, defender, damage); - Buff.prolong(defender, Shieldblock.class, 4f); + defender.damage(Dungeon.hero.spp,this); } @Override public Item random() { - quantity = Random.Int(2, 5); + quantity = 2; return this; } @Override public int price() { - return quantity * 10; + return 0; } } diff --git a/java/com/hmdzl/spspd/items/weapon/missiles/buildblock/BookBlock.java b/java/com/hmdzl/spspd/items/weapon/missiles/buildblock/BookBlock.java index 93e398e2..2ff6a324 100644 --- a/java/com/hmdzl/spspd/items/weapon/missiles/buildblock/BookBlock.java +++ b/java/com/hmdzl/spspd/items/weapon/missiles/buildblock/BookBlock.java @@ -52,7 +52,9 @@ public BookBlock(int number) { @Override protected void onThrow(int cell) { Char enemy = Actor.findChar(cell); - if ((enemy == null || enemy == curUser) && !(Dungeon.level.map[cell] == Terrain.WELL || Dungeon.level.map[cell] == Terrain.ENTRANCE || Dungeon.level.map[cell] == Terrain.EXIT )){ + if ((enemy == null || enemy == curUser) && !(Dungeon.level.map[cell] == Terrain.WELL || + Dungeon.level.map[cell] == Terrain.EMPTY_WELL || + Dungeon.level.map[cell] == Terrain.ENTRANCE || Dungeon.level.map[cell] == Terrain.EXIT )){ Level.set(cell, Terrain.BOOKSHELF); GameScene.updateMap(cell); } diff --git a/java/com/hmdzl/spspd/items/weapon/missiles/buildblock/DoorBlock.java b/java/com/hmdzl/spspd/items/weapon/missiles/buildblock/DoorBlock.java index 282b522a..3946c8d5 100644 --- a/java/com/hmdzl/spspd/items/weapon/missiles/buildblock/DoorBlock.java +++ b/java/com/hmdzl/spspd/items/weapon/missiles/buildblock/DoorBlock.java @@ -52,7 +52,9 @@ public DoorBlock(int number) { @Override protected void onThrow(int cell) { Char enemy = Actor.findChar(cell); - if ((enemy == null || enemy == curUser) && !(Dungeon.level.map[cell] == Terrain.WELL || Dungeon.level.map[cell] == Terrain.ENTRANCE || Dungeon.level.map[cell] == Terrain.EXIT )){ + if ((enemy == null || enemy == curUser) && !(Dungeon.level.map[cell] == Terrain.WELL || + Dungeon.level.map[cell] == Terrain.EMPTY_WELL || + Dungeon.level.map[cell] == Terrain.ENTRANCE || Dungeon.level.map[cell] == Terrain.EXIT )){ Level.set(cell, Terrain.DOOR); GameScene.updateMap(cell); } diff --git a/java/com/hmdzl/spspd/items/weapon/missiles/buildblock/StoneBlock.java b/java/com/hmdzl/spspd/items/weapon/missiles/buildblock/StoneBlock.java index ac82e99f..6e311aa0 100644 --- a/java/com/hmdzl/spspd/items/weapon/missiles/buildblock/StoneBlock.java +++ b/java/com/hmdzl/spspd/items/weapon/missiles/buildblock/StoneBlock.java @@ -52,7 +52,9 @@ public StoneBlock(int number) { @Override protected void onThrow(int cell) { Char enemy = Actor.findChar(cell); - if ((enemy == null || enemy == curUser) && !(Dungeon.level.map[cell] == Terrain.WELL || Dungeon.level.map[cell] == Terrain.ENTRANCE || Dungeon.level.map[cell] == Terrain.EXIT )){ + if ((enemy == null || enemy == curUser) && !(Dungeon.level.map[cell] == Terrain.WELL || + Dungeon.level.map[cell] == Terrain.EMPTY_WELL || + Dungeon.level.map[cell] == Terrain.ENTRANCE || Dungeon.level.map[cell] == Terrain.EXIT )){ Level.set(cell, Terrain.STATUE); GameScene.updateMap(cell); } diff --git a/java/com/hmdzl/spspd/items/weapon/missiles/buildblock/WallBlock.java b/java/com/hmdzl/spspd/items/weapon/missiles/buildblock/WallBlock.java index 608100b5..11426576 100644 --- a/java/com/hmdzl/spspd/items/weapon/missiles/buildblock/WallBlock.java +++ b/java/com/hmdzl/spspd/items/weapon/missiles/buildblock/WallBlock.java @@ -52,7 +52,11 @@ public WallBlock(int number) { @Override protected void onThrow(int cell) { Char enemy = Actor.findChar(cell); - if ((enemy == null || enemy == curUser) && !(Dungeon.level.map[cell] == Terrain.WELL || Dungeon.level.map[cell] == Terrain.ENTRANCE || Dungeon.level.map[cell] == Terrain.EXIT )){ + if ((enemy == null || enemy == curUser) && + !(Dungeon.level.map[cell] == Terrain.WELL || + Dungeon.level.map[cell] == Terrain.EMPTY_WELL || + Dungeon.level.map[cell] == Terrain.ENTRANCE || + Dungeon.level.map[cell] == Terrain.EXIT )){ Level.set(cell, Terrain.WALL); GameScene.updateMap(cell); } diff --git a/java/com/hmdzl/spspd/items/weapon/missiles/buildblock/WoodenBlock.java b/java/com/hmdzl/spspd/items/weapon/missiles/buildblock/WoodenBlock.java index 6cfdc3b8..8bb70354 100644 --- a/java/com/hmdzl/spspd/items/weapon/missiles/buildblock/WoodenBlock.java +++ b/java/com/hmdzl/spspd/items/weapon/missiles/buildblock/WoodenBlock.java @@ -52,7 +52,11 @@ public WoodenBlock(int number) { @Override protected void onThrow(int cell) { Char enemy = Actor.findChar(cell); - if ((enemy == null || enemy == curUser) && !(Dungeon.level.map[cell] == Terrain.WELL || Dungeon.level.map[cell] == Terrain.ENTRANCE || Dungeon.level.map[cell] == Terrain.EXIT )){ + if ((enemy == null || enemy == curUser) && + !(Dungeon.level.map[cell] == Terrain.WELL || + Dungeon.level.map[cell] == Terrain.EMPTY_WELL || + Dungeon.level.map[cell] == Terrain.ENTRANCE || + Dungeon.level.map[cell] == Terrain.EXIT )){ Level.set(cell, Terrain.BARRICADE); GameScene.updateMap(cell); } diff --git a/java/com/hmdzl/spspd/levels/Level.java b/java/com/hmdzl/spspd/levels/Level.java index 8f11c488..db4fc2fb 100644 --- a/java/com/hmdzl/spspd/levels/Level.java +++ b/java/com/hmdzl/spspd/levels/Level.java @@ -41,6 +41,7 @@ import com.hmdzl.spspd.actors.buffs.Shadows; import com.hmdzl.spspd.actors.hero.Hero; import com.hmdzl.spspd.actors.hero.HeroClass; +import com.hmdzl.spspd.actors.hero.HeroSubClass; import com.hmdzl.spspd.actors.mobs.Bestiary; import com.hmdzl.spspd.actors.mobs.Mob; import com.hmdzl.spspd.actors.mobs.npcs.SheepSokoban; @@ -80,6 +81,7 @@ import com.hmdzl.spspd.items.Torch; import com.hmdzl.spspd.items.StoneOre; import com.hmdzl.spspd.items.Weightstone; +import com.hmdzl.spspd.items.armor.Armor; import com.hmdzl.spspd.items.artifacts.DriedRose; import com.hmdzl.spspd.items.artifacts.TimekeepersHourglass; import com.hmdzl.spspd.items.misc.LuckyBadge; @@ -264,14 +266,13 @@ public void create() { if (!Dungeon.bossLevel()) { addItemToSpawn(Generator.random(Generator.Category.FOOD)); addItemToSpawn(Generator.random(Generator.Category.FOOD)); + addItemToSpawn(new ScrollOfUpgrade()); + if (Dungeon.posNeeded()) { addItemToSpawn(new PotionOfStrength()); Dungeon.limitedDrops.strengthPotions.count++; } - if (Dungeon.souNeeded()) { - addItemToSpawn(new ScrollOfUpgrade()); - Dungeon.limitedDrops.upgradeScrolls.count++; - } + if (Random.Int(2) == 0) { addItemToSpawn(new Stylus()); addItemToSpawn(new Weightstone()); @@ -284,8 +285,11 @@ public void create() { if (Dungeon.hero.heroClass == HeroClass.SOLDIER) bonus += 5; + if (Dungeon.hero.subClass == HeroSubClass.SUPERSTAR) + bonus += 3; + for (Buff buff : Dungeon.hero.buffs(AflyBless.class)) { - bonus += 5; + bonus += 3; } if (Random.Float() > Math.pow(0.95, bonus)) { if (Random.Int(2) == 0) @@ -1205,8 +1209,9 @@ public int checkdew(){ public Heap drop(Item item, int cell) { - if (item == null ){ + if ((Dungeon.skins==5 && item instanceof Armor) || item == null ){ + //create a dummy heap, give it a dummy sprite, don't add it to the game, and return it. //effectively nullifies whatever the logic calling this wants to do, including dropping items. Heap heap = new Heap(); diff --git a/java/com/hmdzl/spspd/levels/RegularLevel.java b/java/com/hmdzl/spspd/levels/RegularLevel.java index 117c0ba6..8a0ec87e 100644 --- a/java/com/hmdzl/spspd/levels/RegularLevel.java +++ b/java/com/hmdzl/spspd/levels/RegularLevel.java @@ -30,6 +30,7 @@ import com.hmdzl.spspd.actors.buffs.AflyBless; import com.hmdzl.spspd.actors.buffs.Buff; import com.hmdzl.spspd.actors.hero.HeroClass; +import com.hmdzl.spspd.actors.hero.HeroSubClass; import com.hmdzl.spspd.actors.mobs.Bestiary; import com.hmdzl.spspd.actors.mobs.Mob; import com.hmdzl.spspd.items.Generator; @@ -151,10 +152,10 @@ protected boolean build() { if (Dungeon.bossLevel(Dungeon.depth + 1) || Dungeon.townCheck(Dungeon.depth)) { specials.remove(Room.Type.WEAK_FLOOR); } - //if (Dungeon.isChallenged(Challenges.NO_ARMOR)) { + if (Dungeon.skins == 5) { // no sense in giving an armor reward room on a run with no armor. - //specials.remove(Room.Type.CRYPT); - //} + specials.remove(Room.Type.CRYPT); + } //if (Dungeon.isChallenged(Challenges.NO_HERBALISM)) { // sorry warden, no lucky sungrass or blandfruit seeds for you! //specials.remove(Room.Type.GARDEN); @@ -668,8 +669,11 @@ protected void createItems() { } if (Dungeon.hero.heroClass == HeroClass.SOLDIER) bonus += 5; + if (Dungeon.hero.subClass == HeroSubClass.SUPERSTAR) { + bonus += 3; + } for (Buff buff : Dungeon.hero.buffs(AflyBless.class)) { - bonus += 5; + bonus += 3; } // just incase someone gets a ridiculous ring, cap this at 80% bonus = Math.min(bonus, 10); diff --git a/java/com/hmdzl/spspd/levels/SewerLevel.java b/java/com/hmdzl/spspd/levels/SewerLevel.java index 069d46cc..03aead64 100644 --- a/java/com/hmdzl/spspd/levels/SewerLevel.java +++ b/java/com/hmdzl/spspd/levels/SewerLevel.java @@ -173,7 +173,7 @@ protected void createItems() { mobs.add(npc); Actor.occupyCell(npc); } - + if (Dungeon.depth == 2){ addItemToSpawn(new Mushroom()); } diff --git a/java/com/hmdzl/spspd/levels/TownLevel.java b/java/com/hmdzl/spspd/levels/TownLevel.java index 4e4969e7..f2a4c1f7 100644 --- a/java/com/hmdzl/spspd/levels/TownLevel.java +++ b/java/com/hmdzl/spspd/levels/TownLevel.java @@ -28,6 +28,7 @@ import com.hmdzl.spspd.actors.blobs.Alter; import com.hmdzl.spspd.actors.blobs.WellWater; import com.hmdzl.spspd.actors.mobs.AdultDragonViolet; +import com.hmdzl.spspd.actors.mobs.BambooMob; import com.hmdzl.spspd.actors.mobs.BombBug; import com.hmdzl.spspd.actors.mobs.Piranha; import com.hmdzl.spspd.actors.mobs.Mob; @@ -36,6 +37,8 @@ import com.hmdzl.spspd.actors.mobs.npcs.AFly; import com.hmdzl.spspd.actors.mobs.npcs.ARealMan; import com.hmdzl.spspd.actors.mobs.npcs.Apostle; +import com.hmdzl.spspd.actors.mobs.npcs.BlackMeow; +import com.hmdzl.spspd.actors.mobs.npcs.CatSheep; import com.hmdzl.spspd.actors.mobs.npcs.DreamPlayer; import com.hmdzl.spspd.actors.mobs.npcs.GoblinPlayer; import com.hmdzl.spspd.actors.mobs.npcs.HoneyPoooot; @@ -50,6 +53,7 @@ import com.hmdzl.spspd.actors.mobs.npcs.OtilukeNPC; import com.hmdzl.spspd.actors.mobs.npcs.RENnpc; import com.hmdzl.spspd.actors.mobs.npcs.RainTrainer; +import com.hmdzl.spspd.actors.mobs.npcs.Ravenwolf; import com.hmdzl.spspd.actors.mobs.npcs.SadSaltan; import com.hmdzl.spspd.actors.mobs.npcs.SaidbySun; import com.hmdzl.spspd.actors.mobs.npcs.Shopkeeper; @@ -118,6 +122,7 @@ import com.hmdzl.spspd.items.weapon.melee.special.SJRBMusic; import com.hmdzl.spspd.items.weapon.melee.special.TestWeapon; import com.hmdzl.spspd.items.weapon.melee.special.Tree; +import com.hmdzl.spspd.items.weapon.melee.zero.Bamboo; import com.hmdzl.spspd.items.weapon.missiles.MiniMoai; import com.hmdzl.spspd.items.weapon.missiles.MoneyPack; import com.hmdzl.spspd.items.weapon.missiles.PocketBall; @@ -672,6 +677,15 @@ protected void createItems() { Mob lery = new Lery(); lery.pos = 41 + WIDTH * 9; mobs.add(lery); + + Mob BM = new BlackMeow(); + BM.pos = 38 + WIDTH * 38; + mobs.add(BM); + + Mob catS = new CatSheep(); + catS.pos = 37 + WIDTH * 37; + mobs.add(catS); + } Mob evan = new Evan(); evan.pos = 27 + WIDTH * 31; @@ -734,7 +748,11 @@ protected void createItems() { if (Badges.checkSARRescued()|| Dungeon.isChallenged(Challenges.TEST_TIME)){ Mob SAR = new StormAndRain(); SAR.pos = 21 + WIDTH * 6; - mobs.add(SAR); + mobs.add(SAR); + + Mob RW = new Ravenwolf(); + RW.pos = 23 + WIDTH * 6; + mobs.add(RW); } if (Dungeon.dewNorn == true || Dungeon.isChallenged(Challenges.TEST_TIME)) { @@ -783,9 +801,9 @@ protected void createItems() { mob3.pos = 5 + WIDTH * 43; mobs.add(mob3); - BombBug test = new BombBug(); + /*BambooMob test = new BambooMob(); test.pos = 14 + WIDTH * 32; - mobs.add(test); + mobs.add(test);*/ /*Guard test2 = new Guard(); test2.pos = 14 + WIDTH * 31; diff --git a/java/com/hmdzl/spspd/levels/features/HighGrass.java b/java/com/hmdzl/spspd/levels/features/HighGrass.java index a4b28e4d..7c735f69 100644 --- a/java/com/hmdzl/spspd/levels/features/HighGrass.java +++ b/java/com/hmdzl/spspd/levels/features/HighGrass.java @@ -73,7 +73,7 @@ public static void trample(Level level, int pos, Char ch) { //level.drop(new NutVegetable(), pos).sprite.drop(); //} - if (Dungeon.growLevel(Dungeon.depth) && Random.Int(15 - ((int) (naturalismLevel * 3.34))) == 0) { + if (Dungeon.growLevel(Dungeon.depth) && Random.Int(30 - ((int) (naturalismLevel * 3.34))) == 0) { level.drop(new NutPlant.Seed(), pos).sprite.drop(); } diff --git a/java/com/hmdzl/spspd/levels/painters/ArmoryPainter.java b/java/com/hmdzl/spspd/levels/painters/ArmoryPainter.java index 90785dc7..5ee75dee 100644 --- a/java/com/hmdzl/spspd/levels/painters/ArmoryPainter.java +++ b/java/com/hmdzl/spspd/levels/painters/ArmoryPainter.java @@ -22,6 +22,7 @@ import com.hmdzl.spspd.items.Generator; import com.hmdzl.spspd.items.Item; import com.hmdzl.spspd.items.keys.IronKey; +import com.hmdzl.spspd.items.weapon.missiles.buildblock.DoorBlock; import com.hmdzl.spspd.levels.Level; import com.hmdzl.spspd.levels.Room; import com.hmdzl.spspd.levels.Terrain; @@ -63,14 +64,25 @@ public static void paint(Level level, Room room) { || level.heaps.get(pos) != null); level.drop(prize(level), pos); } + + for (int i = 0; i < 3; i++) { + int pos; + do { + pos = room.random(); + } while (level.map[pos] != Terrain.EMPTY + || level.heaps.get(pos) != null); + level.drop(prize2(level), pos); + } entrance.set(Room.Door.Type.LOCKED); level.addItemToSpawn(new IronKey(Dungeon.depth)); } private static Item prize(Level level) { - return Random.Int(6) == 0 ? new Bomb().random() : Generator - .random(Random.oneOf(Generator.Category.ARMOR, - Generator.Category.WEAPON)); + return Generator.random(Generator.Category.BOMBS); + } + + private static Item prize2(Level level) { + return new DoorBlock(); } } diff --git a/java/com/hmdzl/spspd/levels/painters/CryptPainter.java b/java/com/hmdzl/spspd/levels/painters/CryptPainter.java index d67d4471..1e78855d 100644 --- a/java/com/hmdzl/spspd/levels/painters/CryptPainter.java +++ b/java/com/hmdzl/spspd/levels/painters/CryptPainter.java @@ -20,6 +20,8 @@ import com.hmdzl.spspd.Dungeon; import com.hmdzl.spspd.actors.blobs.weather.WeatherOfDead; import com.hmdzl.spspd.items.Generator; +import com.hmdzl.spspd.items.Gold; +import com.hmdzl.spspd.items.Heap; import com.hmdzl.spspd.items.Heap.Type; import com.hmdzl.spspd.items.Item; import com.hmdzl.spspd.items.keys.IronKey; @@ -81,7 +83,31 @@ public static void paint(Level level, Room room) { } level.blobs.put(WeatherOfDead.class, light); } + + Heap.Type heapType = Random.Int(2) == 0 ? Heap.Type.CHEST + : Heap.Type.HEAP; + int n = Random.IntRange(2, 3); + for (int i = 0; i < n; i++) { + int pos; + do { + pos = room.random(); + } while (level.map[pos] != Terrain.EMPTY + || level.heaps.get(pos) != null); + level.drop(new Gold().random(), pos).type = (i == 0 + && heapType == Heap.Type.CHEST ? Heap.Type.MIMIC : heapType); + } + if (heapType == Heap.Type.HEAP) { + for (int i = 0; i < n; i++) { + int pos; + do { + pos = room.random(); + } while (level.map[pos] != Terrain.EMPTY + || level.heaps.get(pos) != null); + level.drop(new Gold().random(), pos).type = (i == 0 + && heapType == Heap.Type.CHEST ? Heap.Type.MIMIC : heapType); + } + } } private static Item prize(Level level) { diff --git a/java/com/hmdzl/spspd/levels/painters/ExitPainter.java b/java/com/hmdzl/spspd/levels/painters/ExitPainter.java index 0cef5aaf..eb91f748 100644 --- a/java/com/hmdzl/spspd/levels/painters/ExitPainter.java +++ b/java/com/hmdzl/spspd/levels/painters/ExitPainter.java @@ -21,6 +21,7 @@ import com.hmdzl.spspd.Dungeon; import com.hmdzl.spspd.actors.Actor; import com.hmdzl.spspd.actors.mobs.LevelChecker; +import com.hmdzl.spspd.actors.mobs.npcs.Tinkerer1; import com.hmdzl.spspd.levels.Level; import com.hmdzl.spspd.levels.Room; import com.hmdzl.spspd.levels.Terrain; diff --git a/java/com/hmdzl/spspd/levels/painters/LaboratoryPainter.java b/java/com/hmdzl/spspd/levels/painters/LaboratoryPainter.java index 643e9091..42d39f16 100644 --- a/java/com/hmdzl/spspd/levels/painters/LaboratoryPainter.java +++ b/java/com/hmdzl/spspd/levels/painters/LaboratoryPainter.java @@ -34,38 +34,35 @@ public class LaboratoryPainter extends Painter { public static void paint(Level level, Room room) { fill(level, room, Terrain.WALL); - fill(level, room, 1, Terrain.EMPTY_SP); + fill(level, room, 1, Terrain.PEDESTAL); + fill(level, room, 2, Terrain.EMPTY_SP); Room.Door entrance = room.entrance(); - Point pot = null; - if (entrance.x == room.left) { - pot = new Point(room.right - 1, Random.Int(2) == 0 ? room.top + 1 - : room.bottom - 1); - } else if (entrance.x == room.right) { - pot = new Point(room.left + 1, Random.Int(2) == 0 ? room.top + 1 - : room.bottom - 1); - } else if (entrance.y == room.top) { - pot = new Point( - Random.Int(2) == 0 ? room.left + 1 : room.right - 1, - room.bottom - 1); - } else if (entrance.y == room.bottom) { - pot = new Point( - Random.Int(2) == 0 ? room.left + 1 : room.right - 1, - room.top + 1); - } + Point pot = room.center(); + set(level, pot, Terrain.ALCHEMY); Alchemy alchemy = new Alchemy(); alchemy.seed(pot.x + Level.getWidth() * pot.y, 1); level.blobs.put(Alchemy.class, alchemy); - int n = Random.IntRange(2, 3); + int n = Random.IntRange(1, 2); + int n2 = Random.IntRange(2, 3); for (int i = 0; i < n; i++) { int pos; do { pos = room.random(); - } while (level.map[pos] != Terrain.EMPTY_SP + } while (level.map[pos] != Terrain.PEDESTAL + || level.heaps.get(pos) != null); + level.drop(prize2(level), pos); + } + + for (int i2 = 0; i2 < n2; i2++) { + int pos; + do { + pos = room.random(); + } while (level.map[pos] != Terrain.PEDESTAL || level.heaps.get(pos) != null); level.drop(prize(level), pos); } @@ -78,7 +75,16 @@ private static Item prize(Level level) { Item prize = level.findPrizeItem(Potion.class); if (prize == null) - prize = Generator.random(Generator.Category.POTION); + prize = Generator.random(Generator.Category.FOOD); + + return prize; + } + + private static Item prize2(Level level) { + + Item prize = level.findPrizeItem(Potion.class); + if (prize == null) + prize = Generator.random(Generator.Category.HIGHFOOD); return prize; } diff --git a/java/com/hmdzl/spspd/levels/painters/LibraryPainter.java b/java/com/hmdzl/spspd/levels/painters/LibraryPainter.java index bde14248..f533477e 100644 --- a/java/com/hmdzl/spspd/levels/painters/LibraryPainter.java +++ b/java/com/hmdzl/spspd/levels/painters/LibraryPainter.java @@ -18,6 +18,7 @@ package com.hmdzl.spspd.levels.painters; import com.hmdzl.spspd.Dungeon; +import com.hmdzl.spspd.actors.blobs.Alchemy; import com.hmdzl.spspd.actors.blobs.weather.WeatherOfQuite; import com.hmdzl.spspd.items.Generator; import com.hmdzl.spspd.items.Item; @@ -33,65 +34,54 @@ public class LibraryPainter extends Painter { public static void paint(Level level, Room room) { - fill(level, room, Terrain.WALL); - fill(level, room, 1, Terrain.EMPTY); - + fill( level, room, Terrain.WALL ); + fill(level, room, 1, Terrain.EMPTY_SP); + fill(level, room.left + 1, room.top + 1, room.width() - 1, 1, Terrain.BOOKSHELF); + Room.Door entrance = room.entrance(); - Point a = null; - Point b = null; - + + Point pot = null; if (entrance.x == room.left) { - a = new Point(room.left + 1, entrance.y - 1); - b = new Point(room.left + 1, entrance.y + 1); - fill(level, room.right - 1, room.top + 1, 1, room.height() - 1, - Terrain.BOOKSHELF); + pot = new Point( room.right-1, Random.Int( 2 ) == 0 ? room.top + 1 : room.bottom - 1 ); + set( level, entrance.x + 1, entrance.y, Terrain.EMPTY_SP ); } else if (entrance.x == room.right) { - a = new Point(room.right - 1, entrance.y - 1); - b = new Point(room.right - 1, entrance.y + 1); - fill(level, room.left + 1, room.top + 1, 1, room.height() - 1, - Terrain.BOOKSHELF); + pot = new Point( room.left+1, Random.Int( 2 ) == 0 ? room.top + 1 : room.bottom - 1 ); + set( level, entrance.x - 1, entrance.y, Terrain.EMPTY_SP ); } else if (entrance.y == room.top) { - a = new Point(entrance.x + 1, room.top + 1); - b = new Point(entrance.x - 1, room.top + 1); - fill(level, room.left + 1, room.bottom - 1, room.width() - 1, 1, - Terrain.BOOKSHELF); + pot = new Point( Random.Int( 2 ) == 0 ? room.left + 1 : room.right - 1, room.bottom-1 ); + set(level, entrance.x, entrance.y + 1, Terrain.EMPTY_SP); } else if (entrance.y == room.bottom) { - a = new Point(entrance.x + 1, room.bottom - 1); - b = new Point(entrance.x - 1, room.bottom - 1); - fill(level, room.left + 1, room.top + 1, room.width() - 1, 1, - Terrain.BOOKSHELF); - } - if (a != null && level.map[a.x + a.y * Level.getWidth()] == Terrain.EMPTY) { - set(level, a, Terrain.STATUE); - } - if (b != null && level.map[b.x + b.y * Level.getWidth()] == Terrain.EMPTY) { - set(level, b, Terrain.STATUE); + pot = new Point( Random.Int( 2 ) == 0 ? room.left + 1 : room.right - 1, room.top+1 ); + set(level, entrance.x, entrance.y - 1, Terrain.EMPTY_SP); } + set( level, pot, Terrain.ALCHEMY ); + + Alchemy alchemy = new Alchemy(); + alchemy.seed( pot.x + Level.WIDTH * pot.y, 1 ); + level.blobs.put( Alchemy.class, alchemy ); + + int n = Random.IntRange(2, 3); for (int i = 0; i < n; i++) { int pos; do { pos = room.random(); - } while (level.map[pos] != Terrain.EMPTY - || level.heaps.get(pos) != null); + } while (level.map[pos] == Terrain.BOOKSHELF ); level.drop(prize(level), pos); } + + for (int i2 = 0; i2 < n; i2++) { + int pos; + do { + pos = room.random(); + } while (level.map[pos] == Terrain.BOOKSHELF ); + level.drop(prize2(level), pos); + } entrance.set(Room.Door.Type.LOCKED); level.addItemToSpawn(new IronKey(Dungeon.depth)); - if (Random.Int(10) > 5){ - WeatherOfQuite light = (WeatherOfQuite) level.blobs.get(WeatherOfQuite.class); - if (light == null) { - light = new WeatherOfQuite(); - } - for (int i = room.top + 1; i < room.bottom; i++) { - for (int j = room.left + 1; j < room.right; j++) { - light.seed(j + Level.getWidth() * i, 1); - } - } - level.blobs.put(WeatherOfQuite.class, light);} } private static Item prize(Level level) { @@ -102,4 +92,14 @@ private static Item prize(Level level) { return prize; } + + private static Item prize2(Level level) { + + Item prize = level.findPrizeItem(Scroll.class); + if (prize == null) + prize = Generator.random(Generator.Category.POTION); + + return prize; + } + } diff --git a/java/com/hmdzl/spspd/levels/painters/ShopPainter.java b/java/com/hmdzl/spspd/levels/painters/ShopPainter.java index f722d1a7..4dbbf53e 100644 --- a/java/com/hmdzl/spspd/levels/painters/ShopPainter.java +++ b/java/com/hmdzl/spspd/levels/painters/ShopPainter.java @@ -62,6 +62,8 @@ import com.hmdzl.spspd.items.weapon.guns.GunC; import com.hmdzl.spspd.items.weapon.guns.GunD; import com.hmdzl.spspd.items.weapon.guns.GunE; +import com.hmdzl.spspd.items.weapon.melee.special.Brick; +import com.hmdzl.spspd.items.weapon.melee.special.DragonBoat; import com.hmdzl.spspd.items.weapon.melee.special.KeyWeapon; import com.hmdzl.spspd.items.weapon.missiles.PocketBall; import com.hmdzl.spspd.levels.LastShopLevel; @@ -125,7 +127,7 @@ private static void generateItems() { case 1: itemsToSpawn.add(new GunA().identify()); //itemsToSpawn.add(new MiniMoai().identify()); - itemsToSpawn.add(new KeyWeapon()); + itemsToSpawn.add(new DragonBoat()); itemsToSpawn.add(new DolyaSlate().identify()); itemsToSpawn.add(new Pasty()); //itemsToSpawn.add(new UnstableSpellbook()); diff --git a/java/com/hmdzl/spspd/levels/painters/StatuePainter.java b/java/com/hmdzl/spspd/levels/painters/StatuePainter.java index 521a4a0c..532facfb 100644 --- a/java/com/hmdzl/spspd/levels/painters/StatuePainter.java +++ b/java/com/hmdzl/spspd/levels/painters/StatuePainter.java @@ -20,11 +20,14 @@ import com.hmdzl.spspd.Dungeon; import com.hmdzl.spspd.actors.Actor; import com.hmdzl.spspd.actors.mobs.Statue; +import com.hmdzl.spspd.items.Generator; +import com.hmdzl.spspd.items.Item; import com.hmdzl.spspd.items.keys.IronKey; import com.hmdzl.spspd.levels.Level; import com.hmdzl.spspd.levels.Room; import com.hmdzl.spspd.levels.Terrain; import com.watabou.utils.Point; +import com.watabou.utils.Random; public class StatuePainter extends Painter { @@ -68,9 +71,24 @@ public static void paint(Level level, Room room) { } + int n = Random.IntRange(2, 3); + for (int i = 0; i < n; i++) { + int pos; + do { + pos = room.random(); + } while (level.map[pos] != Terrain.EMPTY + || level.heaps.get(pos) != null); + level.drop(prize(level), pos); + } + Statue statue = new Statue(); statue.pos = cx + cy * Level.getWidth(); level.mobs.add(statue); Actor.occupyCell(statue); } + + private static Item prize(Level level) { + return Generator.random(Random.oneOf(Generator.Category.ARMOR, + Generator.Category.WEAPON)); + } } diff --git a/java/com/hmdzl/spspd/levels/painters/TreasuryPainter.java b/java/com/hmdzl/spspd/levels/painters/TreasuryPainter.java index e51e4c98..da9446bb 100644 --- a/java/com/hmdzl/spspd/levels/painters/TreasuryPainter.java +++ b/java/com/hmdzl/spspd/levels/painters/TreasuryPainter.java @@ -18,12 +18,17 @@ package com.hmdzl.spspd.levels.painters; import com.hmdzl.spspd.Dungeon; +import com.hmdzl.spspd.actors.mobs.Greatmoss; +import com.hmdzl.spspd.actors.mobs.Mob; import com.hmdzl.spspd.items.Gold; import com.hmdzl.spspd.items.Heap; import com.hmdzl.spspd.items.keys.IronKey; import com.hmdzl.spspd.levels.Level; import com.hmdzl.spspd.levels.Room; import com.hmdzl.spspd.levels.Terrain; +import com.hmdzl.spspd.plants.BlandfruitBush; +import com.hmdzl.spspd.plants.NutPlant; +import com.hmdzl.spspd.plants.Seedpod; import com.watabou.utils.Random; public class TreasuryPainter extends Painter { @@ -31,37 +36,49 @@ public class TreasuryPainter extends Painter { public static void paint(Level level, Room room) { fill(level, room, Terrain.WALL); - fill(level, room, 1, Terrain.EMPTY); + fill(level, room, 1, Terrain.GRASS); - set(level, room.center(), Terrain.STATUE); + room.entrance().set(Room.Door.Type.LOCKED); + level.addItemToSpawn(new IronKey(Dungeon.depth)); - Heap.Type heapType = Random.Int(2) == 0 ? Heap.Type.CHEST - : Heap.Type.HEAP; + level.plant(new Seedpod.Seed(), room.random()); + level.plant(new BlandfruitBush.Seed(), room.random()); + level.plant(new NutPlant.Seed(), room.random()); + + int lashers = ((room.right-room.left-1)*(room.bottom-room.top-1))/10; - int n = Random.IntRange(2, 3); - for (int i = 0; i < n; i++) { + for (int i = 1; i <= lashers; i++){ int pos; do { pos = room.random(); - } while (level.map[pos] != Terrain.EMPTY - || level.heaps.get(pos) != null); - level.drop(new Gold().random(), pos).type = (i == 0 - && heapType == Heap.Type.CHEST ? Heap.Type.MIMIC : heapType); + } while (!validPlantPos(level, pos)); + placePlant(level, pos, new Greatmoss()); } + } - if (heapType == Heap.Type.HEAP) { - for (int i = 0; i < n; i++) { - int pos; - do { - pos = room.random(); - } while (level.map[pos] != Terrain.EMPTY - || level.heaps.get(pos) != null); - level.drop(new Gold().random(), pos).type = (i == 0 - && heapType == Heap.Type.CHEST ? Heap.Type.MIMIC : heapType); + private static boolean validPlantPos(Level level, int pos){ + if (level.map[pos] != Terrain.GRASS){ + return false; + } + + for (int i : Level.NEIGHBOURS9){ + if (level.findMob(pos+i) != null){ + return false; } } - room.entrance().set(Room.Door.Type.LOCKED); - level.addItemToSpawn(new IronKey(Dungeon.depth)); + return true; } + + private static void placePlant(Level level, int pos, Mob plant){ + plant.pos = pos; + level.mobs.add( plant ); + + for(int i : Level.NEIGHBOURS8) { + if (level.map[pos + i] == Terrain.GRASS){ + set(level, pos + i, Terrain.HIGH_GRASS); + } + } + } + } diff --git a/java/com/hmdzl/spspd/levels/painters/VaultPainter.java b/java/com/hmdzl/spspd/levels/painters/VaultPainter.java index e0f029de..744543f2 100644 --- a/java/com/hmdzl/spspd/levels/painters/VaultPainter.java +++ b/java/com/hmdzl/spspd/levels/painters/VaultPainter.java @@ -43,7 +43,7 @@ public static void paint(Level level, Room room) { switch (Random.Int(3)) { case 0: case 1: case 2: - Item i1,i2; + Item i1,i2,i3; do { i1 = prizeUncursed(level); i2 = prizeUncursed(level); @@ -51,6 +51,17 @@ public static void paint(Level level, Room room) { level.drop(i1, c).type = Type.CRYSTAL_CHEST; level.drop(i2, c + Level.NEIGHBOURS8[Random.Int(8)]).type = Type.CRYSTAL_CHEST; level.addItemToSpawn(new GoldenKey(Dungeon.depth)); + + do { + i3 = prizeUncursed(level); + } while ((i1.getClass() == i3.getClass()) && (i1.getClass() == i2.getClass())); + int pos; + do { + pos = room.random(); + } while (level.map[pos] == Terrain.EMPTY_SP + || level.heaps.get(pos) != null); + level.drop(i3, pos); + break; /* diff --git a/java/com/hmdzl/spspd/levels/traps/DistortionTrap.java b/java/com/hmdzl/spspd/levels/traps/DistortionTrap.java index 60555dca..438d3688 100644 --- a/java/com/hmdzl/spspd/levels/traps/DistortionTrap.java +++ b/java/com/hmdzl/spspd/levels/traps/DistortionTrap.java @@ -38,6 +38,7 @@ public class DistortionTrap extends Trap{ @Override public void activate(Char ch) { super.activate(ch); + if (ch.isAlive()){ InterlevelScene.returnDepth = Dungeon.depth; for (Item item : Dungeon.hero.belongings.backpack.items.toArray( new Item[0])){ if (item instanceof Key && ((Key)item).depth == Dungeon.depth){ @@ -46,5 +47,6 @@ public void activate(Char ch) { } InterlevelScene.mode = InterlevelScene.Mode.RESET; Game.switchScene(InterlevelScene.class); + } } } diff --git a/java/com/hmdzl/spspd/plants/NutPlant.java b/java/com/hmdzl/spspd/plants/NutPlant.java index f7cb2156..5b1ff8cf 100644 --- a/java/com/hmdzl/spspd/plants/NutPlant.java +++ b/java/com/hmdzl/spspd/plants/NutPlant.java @@ -5,6 +5,7 @@ import com.hmdzl.spspd.items.food.Nut; import com.hmdzl.spspd.items.food.vegetable.NutVegetable; import com.hmdzl.spspd.items.potions.PotionOfHealing; +import com.hmdzl.spspd.items.potions.PotionOfShield; import com.hmdzl.spspd.sprites.ItemSpriteSheet; /** @@ -28,7 +29,7 @@ public static class Seed extends Plant.Seed { image = ItemSpriteSheet.SEED_DUNGEONNUT; plantClass = NutPlant.class; - alchemyClass = PotionOfHealing.class;; + alchemyClass = PotionOfShield.class;; } } } diff --git a/java/com/hmdzl/spspd/plants/Seedpod.java b/java/com/hmdzl/spspd/plants/Seedpod.java index 342bf6d5..516f61c4 100644 --- a/java/com/hmdzl/spspd/plants/Seedpod.java +++ b/java/com/hmdzl/spspd/plants/Seedpod.java @@ -19,6 +19,7 @@ import com.hmdzl.spspd.Dungeon; import com.hmdzl.spspd.actors.Char; +import com.hmdzl.spspd.items.potions.PotionOfMixing; import com.hmdzl.spspd.items.potions.PotionOfOverHealing; import com.hmdzl.spspd.sprites.ItemSpriteSheet; import com.hmdzl.spspd.items.Generator; @@ -59,7 +60,7 @@ public static class Seed extends Plant.Seed { image = ItemSpriteSheet.SEED_SEEDPOD; plantClass = Seedpod.class; - alchemyClass = PotionOfOverHealing.class;; + alchemyClass = PotionOfMixing.class; } } } diff --git a/java/com/hmdzl/spspd/scenes/GameScene.java b/java/com/hmdzl/spspd/scenes/GameScene.java index 80889681..6f551353 100644 --- a/java/com/hmdzl/spspd/scenes/GameScene.java +++ b/java/com/hmdzl/spspd/scenes/GameScene.java @@ -99,15 +99,6 @@ public class GameScene extends PixelScene { - private static final String TXT_WELCOME = "Welcome to the level %d of Pixel Dungeon!"; - private static final String TXT_WELCOME_BACK = "Welcome back to the level %d of Pixel Dungeon!"; - - private static final String TXT_CHASM = "Your steps echo across the dungeon."; - private static final String TXT_WATER = "You hear water splashing around you."; - private static final String TXT_GRASS = "The smell of vegetation is thick in the air."; - private static final String TXT_DARK = "You can hear enemies moving in the darkness..."; - private static final String TXT_SECRETS = "The atmosphere hints that this floor hides many secrets."; - static GameScene scene; private SkinnedBlock water; diff --git a/java/com/hmdzl/spspd/scenes/StartScene.java b/java/com/hmdzl/spspd/scenes/StartScene.java index dacbb007..22565079 100644 --- a/java/com/hmdzl/spspd/scenes/StartScene.java +++ b/java/com/hmdzl/spspd/scenes/StartScene.java @@ -497,7 +497,7 @@ private class WndSkin extends WndOptions { public WndSkin() { super(Messages.get(Skins.class, "title"), Messages.get(Skins.class, "info"),Messages.get(Skins.class, "normal"), - Messages.get(Skins.class, "first"),Messages.get(Skins.class, "second"),Messages.get(Skins.class, "third") ); + Messages.get(Skins.class, "first"),Messages.get(Skins.class, "second"),Messages.get(Skins.class, "third"),Messages.get(Skins.class, "fourth"),Messages.get(Skins.class, "fifth")); } @Override diff --git a/java/com/hmdzl/spspd/change/sprites/EvanSprite.java b/java/com/hmdzl/spspd/sprites/BlackMeowSprite.java similarity index 70% rename from java/com/hmdzl/spspd/change/sprites/EvanSprite.java rename to java/com/hmdzl/spspd/sprites/BlackMeowSprite.java index 5ce972ae..a0c8d34b 100644 --- a/java/com/hmdzl/spspd/change/sprites/EvanSprite.java +++ b/java/com/hmdzl/spspd/sprites/BlackMeowSprite.java @@ -15,25 +15,19 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see */ -package com.hmdzl.spspd.change.sprites; +package com.hmdzl.spspd.sprites; -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.levels.Level; +import com.hmdzl.spspd.Assets; import com.watabou.noosa.TextureFilm; -import com.watabou.noosa.audio.Sample; -import com.watabou.noosa.particles.Emitter; -public class EvanSprite extends MobSprite { +public class BlackMeowSprite extends MobSprite { - public EvanSprite() { + public BlackMeowSprite() { super(); - texture( Assets.EVAN ); + texture( Assets.BLACKMEOW ); - TextureFilm frames = new TextureFilm( texture, 16, 14 ); + TextureFilm frames = new TextureFilm( texture, 16, 17 ); idle = new Animation( 15, true ); idle.frames(frames, 0, 0, 0, 0, 0, 0, 0, 1, 2, 2, 2, 3); diff --git a/java/com/hmdzl/spspd/change/sprites/Hmdzl001Sprite.java b/java/com/hmdzl/spspd/sprites/CatSheepSprite.java similarity index 73% rename from java/com/hmdzl/spspd/change/sprites/Hmdzl001Sprite.java rename to java/com/hmdzl/spspd/sprites/CatSheepSprite.java index 243a1490..cf5595cf 100644 --- a/java/com/hmdzl/spspd/change/sprites/Hmdzl001Sprite.java +++ b/java/com/hmdzl/spspd/sprites/CatSheepSprite.java @@ -15,23 +15,17 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see */ -package com.hmdzl.spspd.change.sprites; +package com.hmdzl.spspd.sprites; -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.levels.Level; +import com.hmdzl.spspd.Assets; import com.watabou.noosa.TextureFilm; -import com.watabou.noosa.audio.Sample; -import com.watabou.noosa.particles.Emitter; -public class Hmdzl001Sprite extends MobSprite { +public class CatSheepSprite extends MobSprite { - public Hmdzl001Sprite() { + public CatSheepSprite() { super(); - texture( Assets.HMDZL ); + texture( Assets.CATSHEEP ); TextureFilm frames = new TextureFilm( texture, 16, 16 ); diff --git a/java/com/hmdzl/spspd/change/sprites/StatueSprite.java b/java/com/hmdzl/spspd/sprites/GreatMossSprite.java similarity index 87% rename from java/com/hmdzl/spspd/change/sprites/StatueSprite.java rename to java/com/hmdzl/spspd/sprites/GreatMossSprite.java index 8bb98a2c..fd31e95c 100644 --- a/java/com/hmdzl/spspd/change/sprites/StatueSprite.java +++ b/java/com/hmdzl/spspd/sprites/GreatMossSprite.java @@ -15,17 +15,17 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see */ -package com.hmdzl.spspd.change.sprites; +package com.hmdzl.spspd.sprites; -import com.hmdzl.spspd.change.Assets; +import com.hmdzl.spspd.Assets; import com.watabou.noosa.TextureFilm; -public class StatueSprite extends MobSprite { +public class GreatMossSprite extends MobSprite { - public StatueSprite() { + public GreatMossSprite() { super(); - texture(Assets.STATUE); + texture(Assets.GREATMOSS); TextureFilm frames = new TextureFilm(texture, 12, 15); diff --git a/java/com/hmdzl/spspd/change/sprites/FireRabbitSprite.java b/java/com/hmdzl/spspd/sprites/IceRabbit2Sprite.java similarity index 70% rename from java/com/hmdzl/spspd/change/sprites/FireRabbitSprite.java rename to java/com/hmdzl/spspd/sprites/IceRabbit2Sprite.java index 04f22bcc..d7001d00 100644 --- a/java/com/hmdzl/spspd/change/sprites/FireRabbitSprite.java +++ b/java/com/hmdzl/spspd/sprites/IceRabbit2Sprite.java @@ -15,47 +15,49 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see */ -package com.hmdzl.spspd.change.sprites; - -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.effects.MagicMissile; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.levels.Level; +package com.hmdzl.spspd.sprites; + +import com.hmdzl.spspd.Assets; +import com.hmdzl.spspd.actors.Char; +import com.hmdzl.spspd.effects.MagicMissile; import com.watabou.noosa.TextureFilm; import com.watabou.noosa.audio.Sample; -import com.watabou.noosa.particles.Emitter; import com.watabou.utils.Callback; -public class FireRabbitSprite extends MobSprite { +public class IceRabbit2Sprite extends MobSprite { - public FireRabbitSprite() { + public IceRabbit2Sprite() { super(); - texture( Assets.FIRERABBIT ); + texture( Assets.ICERABBIT ); TextureFilm frames = new TextureFilm( texture, 16, 16 ); idle = new Animation( 3, true ); - idle.frames(frames, 0, 0, 0, 1, 1, 1); + idle.frames(frames, 23, 23, 24, 24); run = new Animation( 20, true ); - run.frames( frames, 0,2,3,4,5,6,7 ); + run.frames( frames, 25,26,27,28,29,30,31 ); attack = new Animation( 20, false ); - attack.frames( frames, 0, 8, 9,9,9,10 ); + attack.frames( frames, 31, 32, 33,34,35,36,37 ); zap = attack.clone(); die = new Animation( 20, false ); - die.frames( frames, 0,11,11,12,12,13 ); + die.frames( frames, 37,38,39,40,41,42, 43,44,45,46,47); play( idle ); } private int posToShoot; + @Override + public void link(Char ch) { + super.link(ch); + add(State.CHILLED); + } + @Override public void attack(int cell) { posToShoot = cell; diff --git a/java/com/hmdzl/spspd/sprites/IceRabbitSprite.java b/java/com/hmdzl/spspd/sprites/IceRabbitSprite.java index 23bdba99..f537d152 100644 --- a/java/com/hmdzl/spspd/sprites/IceRabbitSprite.java +++ b/java/com/hmdzl/spspd/sprites/IceRabbitSprite.java @@ -29,23 +29,23 @@ public class IceRabbitSprite extends MobSprite { public IceRabbitSprite() { super(); - texture( Assets.FIRERABBIT ); + texture( Assets.ICERABBIT ); TextureFilm frames = new TextureFilm( texture, 16, 16 ); idle = new Animation( 3, true ); - idle.frames(frames, 14, 14, 14, 15, 15, 15); + idle.frames(frames, 0, 0, 1, 1, 2, 2, 3, 3); run = new Animation( 20, true ); - run.frames( frames, 14,16,17,18,19,20,21 ); + run.frames( frames, 3,4,4,5,6,6,7 ); attack = new Animation( 20, false ); - attack.frames( frames, 14, 22, 23,23,23,24 ); + attack.frames( frames, 7, 7, 8,9,10,11 ); zap = attack.clone(); die = new Animation( 20, false ); - die.frames( frames, 14,25,25,26,26,27 ); + die.frames( frames, 11,12,13,14,15,16,17,18,19,20,21,22 ); play( idle ); } diff --git a/java/com/hmdzl/spspd/sprites/ItemSpriteSheet.java b/java/com/hmdzl/spspd/sprites/ItemSpriteSheet.java index 03d44a9b..b933f771 100644 --- a/java/com/hmdzl/spspd/sprites/ItemSpriteSheet.java +++ b/java/com/hmdzl/spspd/sprites/ItemSpriteSheet.java @@ -48,6 +48,7 @@ public class ItemSpriteSheet { private static final int ROW26 = 25 * 16; private static final int ROW27 = 26 * 16; private static final int ROW28 = 27 * 16; + private static final int ROW29 = 28 * 16; // Row One: Items which can't be obtained // null warning occupies space 0, should only show up if there's a bug. @@ -148,7 +149,7 @@ public class ItemSpriteSheet { // Row Six: Wands public static final int WAND_MAGIC_MISSILE = ROW6 + 0; - public static final int WAND_ACID = ROW6 + 1; + public static final int WAND_POISON = ROW6 + 1; public static final int WAND_METEORITE = ROW6 + 2; public static final int WAND_FLOW = ROW6 + 3; public static final int WAND_CHARM = ROW6 + 4; @@ -157,8 +158,8 @@ public class ItemSpriteSheet { public static final int WAND_BLOOD = ROW6 + 7; public static final int WAND_FREEZE = ROW6 + 8; public static final int WAND_LIGHTNING = ROW6 + 9; - public static final int WAND_POISON = ROW6 + 10; - public static final int WAND_REGROWTH = ROW6 + 11; + public static final int WAND_ACID = ROW6 + 10; + public static final int WAND_LIGHT = ROW6 + 11; public static final int WAND_FLOCK = ROW6 + 12; public static final int WAND_ADAMANT = ROW6 + 13; public static final int WAND_TCLOUD = ROW4 + 11; @@ -247,6 +248,7 @@ public class ItemSpriteSheet { public static final int POTION_AQUA = ROW11 + 12; public static final int POTION_HONEY = ROW11 + 13; public static final int POTION_VIOLET = ROW11 + 14; + public static final int POTION_MIHUANG = ROW11 + 15; // Row Twelve: Seeds public static final int SEED_ROTBERRY = ROW12 + 0; @@ -416,6 +418,7 @@ public class ItemSpriteSheet { public static final int ERROR_WEAPON = ROW18 + 7; public static final int ERROR_ARMOR = ROW18 + 8; public static final int ERROR_WAND = ROW18 + 9; + public static final int MIND_ARROW = ROW18 + 10; public static final int ERROR_FOOD = ROW18 + 11; public static final int ERROR_AMMO = ROW20 + 5; @@ -568,18 +571,24 @@ public class ItemSpriteSheet { public static final int STONE_BLOCK = ROW27 + 13; public static final int WOODEN_BLOCK = ROW27 + 14; public static final int BOOK_BLOCK = ROW27 + 15; - public static final int HORSE_TOTEM = ROW28 + 0; public static final int RANGE_BAG = ROW28 + 1; public static final int DANCE_LION = ROW28 + 2; - public static final int LIVE_ARMOR = ROW28 + 3; public static final int SHADOW_EATER = ROW28 + 4; - public static final int GOBLIN_SHIELD = ROW28 + 5; public static final int CURSE_BLOOD = ROW28 + 6; public static final int TENGU_SWORD = ROW28 + 7; public static final int SP_KNUCKLE = ROW28 + 8; - + public static final int POTION_CATALYST = ROW28 + 9; + public static final int ELF_BOW = ROW28 + 10; + public static final int DEMON_BLADE = ROW28 + 11; + public static final int DICE_TOWER = ROW28 + 12; + public static final int BOAT = ROW28 + 13; + public static final int ZONGZI = ROW28 + 15; + public static final int WINE = ROW28 + 14; + + public static final int NEED_PAPER = ROW29 + 0; + public static final int PPC = ROW29 + 1; } diff --git a/java/com/hmdzl/spspd/change/sprites/G2159687Sprite.java b/java/com/hmdzl/spspd/sprites/MobBambooSprite.java similarity index 73% rename from java/com/hmdzl/spspd/change/sprites/G2159687Sprite.java rename to java/com/hmdzl/spspd/sprites/MobBambooSprite.java index 5acac03b..2d73574f 100644 --- a/java/com/hmdzl/spspd/change/sprites/G2159687Sprite.java +++ b/java/com/hmdzl/spspd/sprites/MobBambooSprite.java @@ -15,23 +15,17 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see */ -package com.hmdzl.spspd.change.sprites; +package com.hmdzl.spspd.sprites; -import com.hmdzl.spspd.change.Assets; -import com.hmdzl.spspd.change.Dungeon; -import com.hmdzl.spspd.change.actors.Char; -import com.hmdzl.spspd.change.effects.Speck; -import com.hmdzl.spspd.change.levels.Level; +import com.hmdzl.spspd.Assets; import com.watabou.noosa.TextureFilm; -import com.watabou.noosa.audio.Sample; -import com.watabou.noosa.particles.Emitter; -public class G2159687Sprite extends MobSprite { +public class MobBambooSprite extends MobSprite { - public G2159687Sprite() { + public MobBambooSprite() { super(); - texture( Assets.G2159687 ); + texture( Assets.MOB_BAMBOO ); TextureFilm frames = new TextureFilm( texture, 16, 16 ); diff --git a/java/com/hmdzl/spspd/ui/BuffIndicator.java b/java/com/hmdzl/spspd/ui/BuffIndicator.java index 3a6db04f..bcfbdd2d 100644 --- a/java/com/hmdzl/spspd/ui/BuffIndicator.java +++ b/java/com/hmdzl/spspd/ui/BuffIndicator.java @@ -123,8 +123,8 @@ public class BuffIndicator extends Component { public static final int BALANCE_FAITH = 83; public static final int STONE_ICE = 84; - public static final int BUFF_REMOVE = 85; - public static final int BUFF_CURSE = 86; + public static final int MAGICWEAK = 85; + public static final int MIND_BUFF = 86; public static final int SIZE = 7; diff --git a/java/com/hmdzl/spspd/ui/StatusPane.java b/java/com/hmdzl/spspd/ui/StatusPane.java index 93b703f0..1af29fe5 100644 --- a/java/com/hmdzl/spspd/ui/StatusPane.java +++ b/java/com/hmdzl/spspd/ui/StatusPane.java @@ -54,6 +54,7 @@ public class StatusPane extends Component { private int lastKeys = -1; private BitmapText level; + private BitmapText spp; private BitmapText depth; private BitmapText keys; @@ -84,7 +85,7 @@ protected void onClick(Touch touch) { btnMenu = new MenuButton(); add(btnMenu); - avatar = HeroSprite.avatar(Dungeon.hero.heroClass, 7-Dungeon.skins); + avatar = HeroSprite.avatar(Dungeon.hero.heroClass, Dungeon.skins); add(avatar); blood = new Emitter(); @@ -107,6 +108,10 @@ protected void onClick(Touch touch) { level.hardlight(0xFFEBA4); add(level); + spp = new BitmapText(PixelScene.font1x); + spp.hardlight(0xFFEBA4); + add(spp); + depth = new BitmapText(Integer.toString(Dungeon.depth), PixelScene.font1x); depth.hardlight(0xCACFC2); @@ -200,6 +205,11 @@ public void update() { level.x = PixelScene.align(27.0f - level.width() / 2); level.y = PixelScene.align(27.5f - level.baseLine() / 2); } + + spp.text( String.format( "%d", Dungeon.hero.spp)); + spp.measure(); + spp.x = PixelScene.align(camera(), shield.x + 15 - avatar.width / 2); + spp.y = PixelScene.align(camera(), shield.y + 40 - avatar.height / 2); int k = IronKey.curDepthQuantity; if (k != lastKeys) { diff --git a/java/com/hmdzl/spspd/windows/WndAlchemy.java b/java/com/hmdzl/spspd/windows/WndAlchemy.java index 6ab76c2b..1ea96979 100644 --- a/java/com/hmdzl/spspd/windows/WndAlchemy.java +++ b/java/com/hmdzl/spspd/windows/WndAlchemy.java @@ -31,6 +31,7 @@ import com.hmdzl.spspd.items.Item; import com.hmdzl.spspd.items.StoneOre; import com.hmdzl.spspd.items.Torch; +import com.hmdzl.spspd.items.eggs.Egg; import com.hmdzl.spspd.items.food.WaterItem; import com.hmdzl.spspd.items.Weightstone; import com.hmdzl.spspd.items.artifacts.AlchemistsToolkit; @@ -38,6 +39,7 @@ import com.hmdzl.spspd.items.food.completefood.Chocolate; import com.hmdzl.spspd.items.food.completefood.FoodFans; import com.hmdzl.spspd.items.food.completefood.Frenchfries; +import com.hmdzl.spspd.items.food.completefood.ZongZi; import com.hmdzl.spspd.items.food.staplefood.NormalRation; import com.hmdzl.spspd.items.food.vegetable.NutVegetable; import com.hmdzl.spspd.items.medicine.BlueMilk; @@ -51,8 +53,10 @@ import com.hmdzl.spspd.items.medicine.Musicpill; import com.hmdzl.spspd.items.medicine.PixieParasol; import com.hmdzl.spspd.items.medicine.Powerpill; +import com.hmdzl.spspd.items.medicine.RealgarWine; import com.hmdzl.spspd.items.medicine.Shootpill; import com.hmdzl.spspd.items.medicine.Smashpill; +import com.hmdzl.spspd.items.potions.PotionOfMixing; import com.hmdzl.spspd.items.summon.Honeypot; import com.hmdzl.spspd.items.bombs.HugeBomb; import com.hmdzl.spspd.items.food.completefood.Chickennugget; @@ -388,6 +392,10 @@ private void combine(){ } else if (meatfoods.size() ==2 && potions.size() == 1 && seeds.size() ==1 ){ result = new Magicpill(); + } else if (staplefoods.size() ==1 && vegetables.size() == 1 && meatfoods.size() ==1 ){ + result = new ZongZi(); + } else if (water.size() ==1 && fireseed.size() == 1 && rootseed.size() ==1 ){ + result = new RealgarWine(); } else if (water.size() ==1 && vegetables.size() == 1 && dewseed.size() ==1 ){ result = new GreenSpore(); } else if (water.size() ==1 && vegetables.size() == 1 && stormseed.size() ==1 ){ @@ -402,25 +410,20 @@ private void combine(){ result = new BlueMilk(); } else if (water.size() ==1 && vegetables.size() == 1 && mossseed.size() ==1 ) { result = new DeathCap(); - + } else if ( honey.size() == 1 && gels.size() == 1 && ore.size() == 1 ){ + result = new Egg(); //potion creation - } else if (seeds.size() == 3){ - - if (Random.Int( 3 ) == 0) { - - result = Generator.random( Generator.Category.POTION ); - - } else { - Class itemClass = Random.element(seeds).alchemyClass; - try { - result = itemClass.newInstance(); - } catch (Exception e) { - ShatteredPixelDungeon.reportException(e); - result = Generator.random( Generator.Category.POTION ); - } - - } + } else if (seedseed.size() == 3){ + result = new PotionOfMixing(); + } else if (seeds.size() == 3){ + Class itemClass = Random.element(seeds).alchemyClass; + try { + result = itemClass.newInstance(); + } catch (Exception e) { + ShatteredPixelDungeon.reportException(e); + result = Generator.random( Generator.Category.POTION ); + } Statistics.potionsCooked++; Badges.validatePotionsCooked(); diff --git a/java/com/hmdzl/spspd/windows/WndIssic.java b/java/com/hmdzl/spspd/windows/WndIssic.java index fd55bcb9..a896cfe4 100644 --- a/java/com/hmdzl/spspd/windows/WndIssic.java +++ b/java/com/hmdzl/spspd/windows/WndIssic.java @@ -42,7 +42,7 @@ public WndIssic() { super(); - Powerpill key = new Powerpill(); + Gold key = new Gold(); IconTitle titlebar = new IconTitle(); diff --git a/java/com/hmdzl/spspd/windows/WndMix.java b/java/com/hmdzl/spspd/windows/WndMix.java index 0d631556..9a7d5ef6 100644 --- a/java/com/hmdzl/spspd/windows/WndMix.java +++ b/java/com/hmdzl/spspd/windows/WndMix.java @@ -96,7 +96,6 @@ public WndMix(){ protected void onClick() { super.onClick(); if (item != null){ - Dungeon.gold-=1000; if (!item.collect()){ Dungeon.level.drop(item, hero.pos); } @@ -154,6 +153,7 @@ protected void onClick() { @Override protected void onClick() { super.onClick(); + Dungeon.gold -= 1000; combine(); } }; diff --git a/java/com/hmdzl/spspd/windows/WndTinkerer.java b/java/com/hmdzl/spspd/windows/WndTinkerer.java index f045af12..5ed8d12b 100644 --- a/java/com/hmdzl/spspd/windows/WndTinkerer.java +++ b/java/com/hmdzl/spspd/windows/WndTinkerer.java @@ -22,6 +22,7 @@ import com.hmdzl.spspd.actors.buffs.Buff; import com.hmdzl.spspd.actors.buffs.Dewcharge; import com.hmdzl.spspd.actors.mobs.npcs.Tinkerer1; +import com.hmdzl.spspd.items.DewVial; import com.hmdzl.spspd.items.Item; import com.hmdzl.spspd.items.quest.Mushroom; import com.hmdzl.spspd.scenes.GameScene; @@ -121,6 +122,9 @@ private void selectUpgrade(Tinkerer1 tinkerer, int type) { Mushroom mushroom = Dungeon.hero.belongings.getItem(Mushroom.class); mushroom.detach(Dungeon.hero.belongings.backpack); + + DewVial dewvial = Dungeon.hero.belongings.getItem(DewVial.class); + dewvial.fill(); if (type==1){ diff --git a/java/com/hmdzl/spspd/windows/Wndice13.java b/java/com/hmdzl/spspd/windows/Wndice13.java index 12dea5e4..d8b1ba50 100644 --- a/java/com/hmdzl/spspd/windows/Wndice13.java +++ b/java/com/hmdzl/spspd/windows/Wndice13.java @@ -41,7 +41,7 @@ public Wndice13() { super(); - PowerHand key = new PowerHand(); + ChaosPack key = new ChaosPack(); IconTitle titlebar = new IconTitle(); diff --git a/resources/com/hmdzl/spspd/messages/actors/actors_zh.properties b/resources/com/hmdzl/spspd/messages/actors/actors_zh.properties index 8db3f689..fede7230 100644 --- a/resources/com/hmdzl/spspd/messages/actors/actors_zh.properties +++ b/resources/com/hmdzl/spspd/messages/actors/actors_zh.properties @@ -29,6 +29,10 @@ actors.blobs.weather.weatherofsnow.desc=这里降着小雪。降低了周围生 actors.blobs.weather.weatherofsun.desc=这里阳光普照。提升了周围生物受到的伤害。 actors.blobs.web.desc=这里所有东西都被厚厚的蜘蛛网覆盖着。 +actors.blobs.nmgas.desc=这里盘绕着纳米无人机云。云雾会伤害所有吸入它的生物。 + +actors.blobs.poisongas.desc=这里盘绕着沼泽大气。沼泽会减速和易伤靠近它的生物。 + ###buffs actors.buffs.amok.desc=狂乱导致状态下的生物进入一种极度愤怒和混乱的状态。 \n\n狂乱的生物会不分敌我地攻击任何靠近它们的人。\n\n剩余的狂乱效果时长:%s回合 actors.buffs.amok.name=狂乱 @@ -59,6 +63,11 @@ actors.buffs.burning.burnsup=%s被烧毁了! actors.buffs.burning.desc=没什么比被火焰吞没更痛苦了。 \n\n火焰会每回合都会造成伤害直到它被液体扑灭或者自行消散。火会在你进入水中时熄灭,打碎药瓶产生的水花也具有同样的效果。 \n\n此外,火焰还会点燃所有接触到的可燃地形(以及可燃地形上的可燃物)。 \n\n剩余的燃烧效果时长:%s回合 actors.buffs.burning.heromsg=你着火了! actors.buffs.burning.name=燃烧 + +actors.buffs.dburning.desc=恶魔烈焰会每回合都会造成伤害,并且无法被扑灭。 \n\n剩余的燃烧效果时长:%s回合 +actors.buffs.dburning.heromsg=你着火了! +actors.buffs.dburning.name=恶魔烈焰 + actors.buffs.charm.desc=魅惑是一种能让敌人们暂时彼此爱慕的控制类魔法。 \n\n受魅惑的角色无法直接攻击魅惑它的那个生物,不过仍然可以攻击其他目标。\n\n剩余的魅惑效果时长:%s回合 actors.buffs.charm.heromsg=你被魅惑了! actors.buffs.charm.name=魅惑 @@ -107,6 +116,13 @@ actors.buffs.toxicimbue.name=毒性之力 actors.buffs.bloodimbue.desc=鲜血之力将为你提供大量的效果免疫并且强化你的攻击。\n\n剩余的灌注效果时长:%s回合 actors.buffs.bloodimbue.name=鲜血之力 +actors.buffs.actbuff.nmimbue.burnsup=%s被同化了! +actors.buffs.actbuff.nmimbue.desc=纳米机器人在你周围悬浮。\n\纳米机器人会伤害你的敌人。 +actors.buffs.actbuff.nmimbue.name=纳米环绕 + +actors.buffs.actbuff.nmstop.desc=纳米机器人停止增值并逐步分解。\n\n剩余时长:%s回合 +actors.buffs.actbuff.nmstop.name=纳米熔断 + actors.buffs.frost.desc=不要认为被冻得很结实了,这种温和的冻结只是把目标包裹在冰里。 \n\n冻结效果类似于麻痹,使目标不能行动。与麻痹不同的是,冻结效果会在目标受到伤害时立即消失,因为冰会碎。\n\n剩余的冻结效果时长:%s回合 actors.buffs.frost.freezes=%s 冻住了! actors.buffs.frost.name=冰冻 @@ -316,9 +332,33 @@ actors.buffs.faithbuff.humanfaith.desc=对神圣的信仰降低了来自神圣 actors.buffs.faithbuff.balancefaith.name=信仰-平衡派系 actors.buffs.faithbuff.balancefaith.desc=对平衡的信仰降低了来自强大生物的伤害,并提升对其的伤害。 +actors.buffs.mindbuff.terrormind.name=疯狂-恐惧 +actors.buffs.mindbuff.terrormind.desc=闪避率降低 + +actors.buffs.mindbuff.amokmind.name=疯狂-混乱 +actors.buffs.mindbuff.amokmind.desc=命中率降低 + +actors.buffs.mindbuff.hopemind.name=疯狂-希望 +actors.buffs.mindbuff.hopemind.desc=升级时获得额外的生命上限 + +actors.buffs.mindbuff.crazymind.name=疯狂-绝望 +actors.buffs.mindbuff.crazymind.desc=攻击伤害降低 + +actors.buffs.mindbuff.losemind.name=疯狂-失神 +actors.buffs.mindbuff.losemind.desc=法杖伤害降低 + +actors.buffs.mindbuff.weakmind.name=疯狂-脆弱 +actors.buffs.mindbuff.weakmind.desc=受到伤害提升 + +actors.buffs.mindbuff.keepmind.name=疯狂-坚定 +actors.buffs.mindbuff.keepmind.desc=抵抗部分buff + actors.buffs.stoneice.name=源石霜冻 actors.buffs.stoneice.desc=这种附带放射性的霜冻粒子会减缓目标的移动速度,并使其在移动过程中受到大量的伤害。但同时,这种粒子会提升目标的伤害输出。\n\n持续时间:%s。 +actors.buffs.magicweak.name=法术易伤 +actors.buffs.magicweak.desc=受到的法术伤害增加。\n\n持续时间:%s。 + ###hero actors.char.def_verb=闪避 actors.char.out_of_paralysis=疼痛使%s从麻痹中解脱出来。 @@ -340,40 +380,41 @@ actors.hero.hero.search_distracted=你没办法集中精力,搜索花了好一 actors.hero.hero.something_else=这里还有其他东西。 actors.hero.hero.wait=... actors.hero.hero.you_now_have=你得到了%s。 +actors.hero.hero.test=你的信念正在经受考验。 actors.hero.heroclass.huntress=女猎手 actors.hero.heroclass.huntress_desc_item=女猎手持有_指虎_和_EMP套索_。\n\n_回旋镖_是猎手的特殊道具 -actors.hero.heroclass.huntress_desc_loadout=女猎手使用投掷武器命中目标后会立刻对其造成一次攻击伤害。\n\n女猎手可以察觉到附近躲在障碍物后的敌人。 +actors.hero.heroclass.huntress_desc_loadout=女猎手使用投掷武器命中目标后会立刻对其造成一次攻击伤害。\n\n女猎手可以察觉到附近躲在障碍物后的敌人。\n\n女猎手进食后获得少量露珠。 actors.hero.heroclass.huntress_desc_misc=_灵视药水_和_驱散卷轴_在游戏开始就已鉴定。 actors.hero.heroclass.mage=法师 actors.hero.heroclass.mage_desc_item=法师持有_魔法书_,_魔弹法杖_和_解离法杖_。\n\n_奇迹烧瓶_是法师的特殊道具 -actors.hero.heroclass.mage_desc_loadout=法师拥有+3法术强度,并且释放法术速度更快。\n\n法师能更有效的利用露水,并在进食后会获得一个回合的充能效果。 +actors.hero.heroclass.mage_desc_loadout=法师拥有+3法术强度,并且释放法术速度更快。\n\n法师能更有效的利用露水。\n\n法师在进食后会获得一个回合的充能效果。 actors.hero.heroclass.mage_desc_misc=_鉴定卷轴_和_液火药水_在游戏开始就已鉴定。 actors.hero.heroclass.performer=演员 actors.hero.heroclass.performer_desc_item=演员持有_三角铁_,_催眠卷轴_和_炸弹_。\n\n_铁铲_是演员的特殊道具 -actors.hero.heroclass.performer_desc_loadout=演员在击杀或升级后将进入节奏模式,大幅度提升自身的属性。\n\n演员在升级后将获得玻璃祝福,大幅度减少自身受到的伤害。 +actors.hero.heroclass.performer_desc_loadout=演员在击杀或升级后将进入节奏模式,大幅度提升自身的属性。\n\n演员在升级后将获得玻璃祝福,大幅度减少自身受到的伤害。\n\n演员在进食后会获节奏buff。 actors.hero.heroclass.performer_desc_misc=_催眠卷轴_和_净化药水_在游戏开始就已鉴定。 actors.hero.heroclass.rogue=盗贼 actors.hero.heroclass.rogue_desc_item=盗贼拥有_匕首_和_烟雾手里剑_。\n\n_暗影披风_是盗贼的特殊道具 -actors.hero.heroclass.rogue_desc_loadout=盗贼装备武器时,降低该武器2点力量需求。\n\n盗贼更擅于发现隐藏门和陷阱。 +actors.hero.heroclass.rogue_desc_loadout=盗贼装备武器时,降低该武器2点力量需求。\n\n盗贼更擅于发现隐藏门和陷阱。\n\n盗贼在进食后会获得短暂的伤害提升效果。 actors.hero.heroclass.rogue_desc_misc=_探地卷轴_和_隐形药水_在游戏开始就已鉴定。 actors.hero.heroclass.warrior=战士 actors.hero.heroclass.warrior_desc_item=战士持有_短剑_和三枚不同_药丸_。\n\n_盾牌_是战士的特殊道具 -actors.hero.heroclass.warrior_desc_loadout=战士装备防具时,降低该防具2点力量需求。\n\n战士进食后获得更多的生命值。 +actors.hero.heroclass.warrior_desc_loadout=战士装备防具时,降低该防具2点力量需求。\n\n战士在健康状态下遭受致命伤害时,将伤害降低至生命上限的一半。\n\n战士进食后获得更多的生命值。 actors.hero.heroclass.warrior_desc_misc=_力量药水_和_升级卷轴_在游戏开始就已鉴定。 actors.hero.heroclass.soldier=星兵 actors.hero.heroclass.soldier_desc_item=星兵拥有_投石索_和_逃脱匕首_。\n\n_脉冲手枪_是星兵的特殊道具 -actors.hero.heroclass.soldier_desc_loadout=星兵拥有额外的初始命中,初始闪避和生命成长。\n\n星兵幸运相较其他角色更佳出众,并且可以认出被诅咒的物品。 +actors.hero.heroclass.soldier_desc_loadout=星兵拥有额外的初始命中,初始闪避和生命成长。\n\n星兵幸运相较其他角色更佳出众,并且可以认出被诅咒的物品。\n\n星兵进食后获得短暂的加速效果。 actors.hero.heroclass.soldier_desc_misc=_狂怒卷轴_和_恢复药水_在游戏开始就已鉴定。 actors.hero.heroclass.follower=信徒 actors.hero.heroclass.follower_desc_item=信徒拥有_木杖_和_治疗药水_。\n\n_信标盒_是信徒的特殊道具 -actors.hero.heroclass.follower_desc_loadout=信徒使用一件消耗品时,有几率不消耗这件物品。\n\n信徒在商店的开销降低。 +actors.hero.heroclass.follower_desc_loadout=信徒使用一件消耗品时,有几率不消耗这件物品。\n\n信徒在商店的开销降低。\n\n信徒进食后获得一些金币。 actors.hero.heroclass.follower_desc_misc=_恐惧卷轴_和_治疗药水_在游戏开始就已鉴定。 actors.hero.herosubclass.pastor=牧师 @@ -441,6 +482,7 @@ actors.mobs.bat.desc=这些敏捷且坚韧的洞穴穹顶生物能够通过每 actors.mobs.bat.name=吸血蝙蝠 actors.mobs.bluecat.name=布鲁凯特 + actors.mobs.bluewraith.def_verb=闪避 actors.mobs.bluewraith.desc=相较其他怨灵而言,怨灵战士更喜欢近距离作战而不是远程打击。它们的行动速度也比其他怨灵快。 actors.mobs.bluewraith.name=怨灵战士 @@ -745,6 +787,9 @@ actors.mobs.ugoo.name=领主黏咕 actors.mobs.uicecorps.name=术士冬痕 actors.mobs.uicecrops.desc=一只兔人族的术士,向四周散发着寒气 +actors.mobs.uicecorps2.name=术士冬痕-终结形态 +actors.mobs.uicecrops2.desc=一只兔人族的术士,向四周散发着寒气 + actors.mobs.uking.desc=这个家伙是植物的王者。 actors.mobs.uking.name=植物领主 @@ -896,6 +941,28 @@ actors.mobs.yearbeast2.die=啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊 actors.mobs.bombbug.name=霜石虫 actors.mobs.bombbug.desc=包裹着冰石的虫子。 +actors.mobs.bamboomob.name=竹子 +actors.mobs.bamboomob.desc=监狱长养的奇怪植物。会反射物理伤害。 + +actors.mobs.greatmoss.name=孢子巨人 +actors.mobs.greatmoss.desc=一种植物和元素的混合物。 + +###actors.mobs..name=蜂蜡元素 +###actors.mobs..desc=和蜜蜂和谐共生的元素。具有较高的自愈能力,而且很黏稠。 + +###actors.mobs..name=工蜂 +###actors.mobs..desc=普通的蜜蜂。 + +###actors.mobs..name=花蜜精灵 +###actors.mobs..desc=和花朵共生的精灵。 + +###actors.mobs..name=实验者罐罐 +###actors.mobs..desc=。 + +###actors.mobs..name=破坏者薄荷 +###actors.mobs..desc=他入侵了这个系统,暗噬被他控制了。赶快解决他。 + + ###pets actors.mobs.pets.bluedragon.desc=蓝龙精通冰寒之力,也是原先性价比最高的龙。 actors.mobs.pets.bluedragon.name=蓝龙 @@ -1327,6 +1394,21 @@ actors.mobs.npcs.afly.name=阿飞,阿比和阿比斯 actors.mobs.npcs.afly.yell1=你好啊,我是阿飞,旁边两个分别是阿比和阿比斯。 actors.mobs.npcs.afly.desc=不思议地牢的制作者 +actors.mobs.npcs.ravenwolf.name=ravenwolf +actors.mobs.npcs.ravenwolf.yell1=...... +actors.mobs.npcs.ravenwolf.yell2=...... +actors.mobs.npcs.ravenwolf.desc=无名地牢的作者 + +actors.mobs.npcs.blackmeow.name=黑喵 +actors.mobs.npcs.blackmeow.yell1=哦!你好冒险者,你看上去身手不凡,不知道你有没有兴趣到我的领土上去做做客? +actors.mobs.npcs.blackmeow.yell2=嗯…我的意思是说我的领土上也有一个地牢听说里面也有一个护符,不过里面十分危险你可能会受伤。你可以帮我带上来吗,我可以给你很多财富! +actors.mobs.npcs.blackmeow.desc=黑喵地牢的领袖 + +actors.mobs.npcs.catsheep.name=彩虹猫 +actors.mobs.npcs.catsheep.yell1=喵 +actors.mobs.npcs.catsheep.yell2=喵 +actors.mobs.npcs.catsheep.desc=彩虹猫 + actors.mobs.npcs.omicronrg9.name=Ømicrónrg9 actors.mobs.npcs.omicronrg9.yell1=别挡道,伙计!我可没时间弄些杂七杂八的事情,mod表可是不会自己生成的。 actors.mobs.npcs.omicronrg9.yell2=食人鱼这种这种生物是在是太棒了,它们能轻易撕碎各种动物,特别是没有外壳的。 diff --git a/resources/com/hmdzl/spspd/messages/items/items_zh.properties b/resources/com/hmdzl/spspd/messages/items/items_zh.properties index e5395388..a1024e28 100644 --- a/resources/com/hmdzl/spspd/messages/items/items_zh.properties +++ b/resources/com/hmdzl/spspd/messages/items/items_zh.properties @@ -473,6 +473,8 @@ items.food.fruit.blandfruit.starfruit=星陨果 items.food.fruit.blandfruit.powerfruit=强化果 items.food.fruit.blandfruit.mightyfruit=决心果 items.food.fruit.blandfruit.heartfruit=生命果 +items.food.fruit.blandfruit.nutfruit=坚果果 +items.food.fruit.blandfruit.mixfruit=混合果 items.food.fruit.blandfruit.raw=这玩意没法生吃。 items.food.fruit.blandfruit.ice_msg=这个冰霜果尝起来有点冰冻生肉片的感觉。 @@ -660,9 +662,15 @@ items.food.wateritem.desc=通过露珠瓶净化后的水,可以用于烹饪。 items.food.completefood.aflyfood.name=不思议饭团 items.food.completefood.aflyfood.desc=阿飞特制的不思议饭团,拥有另一个世界的力量。 +items.food.completefood.zongzi.name=肉粽 +items.food.completefood.zongzi.desc=好吃但油腻。 + ###medicine items.medicine.pill.ac_eat=食用 +items.medicine.realgarwine.name=雄黄酒 +items.medicine.realgarwine.desc=提供火焰抗性和剧毒抗性。 + items.medicine.powerpill.name=力量药丸 items.medicine.powerpill.desc=在一段时间内提升力量。 @@ -794,6 +802,7 @@ items.potions.potion.indigo=靛蓝 items.potions.potion.silver=银灰 items.potions.potion.aqua=藏青 items.potions.potion.violet=紫靛 +items.potions.potion.mihuang=蜜黄 items.potions.potion.unknown_name=%s药水 items.potions.potion.unknown_desc=这瓶里装着些不断打旋的%s色液体,谁知道投掷或饮用它们时会有什么效果呢? items.potions.potion.harmful=有害药水! @@ -850,6 +859,13 @@ items.potions.potionofoverhealing.name=生命药水 items.potions.potionofoverhealing.effect=你的伤口完全愈合了,同时一股魔法力量注入了你的身体! items.potions.potionofoverhealing.fill=血量溢出%s点! items.potions.potionofoverhealing.desc=一支让你瞬间回复甚至溢出生命值并清除毒素的万能药水。 +items.potions.potionofshield.name=护盾药水 +items.potions.potionofshield.desc=小幅度提升防御力的药水。 + +items.potions.potionofmixing.name=调和药水 +items.potions.potionofmixing.desc=提升全属性的药水。 +items.potions.potionofmixing.skillup=你感觉你的属性提升了 + ###quest items items.quest.ceremonialcandle.name=仪祭蜡烛 @@ -1036,6 +1052,7 @@ items.wands.wand.cursed=这根法杖受到了诅咒,导致它的魔法混乱 items.wands.wand.curse_discover=这根%s是诅咒的! items.wands.wand.prompt=选择要释放魔法的位置 items.wands.wand.silent=沉默魔法阻止你释放法术。 +items.wands.wand.needmana=魔法不足。 items.wands.wandoferror.name=错误法杖 items.wands.wandoferror.desc=这是个错误 @@ -1088,9 +1105,9 @@ items.wands.wandofmagicmissile.name=魔弹法杖 items.wands.wandofmagicmissile.desc=这根无属性法杖能发射纯魔法能量构成的导弹。 items.wands.wandofmagicmissile.stats_desc=尽管不如其它法杖那么强大,但它的大量充能数弥补了这一点。它能造成_%1$d~%2$d点伤害_ 。 -items.wands.wandofpoison.name=剧毒法杖 -items.wands.wandofpoison.desc=这根地属性法杖的紫色主干半包住顶端一颗亮绿色宝石。 -items.wands.wandofpoison.stats_desc=该法杖能射出一颗会在目标位置爆炸的毒性法球。被击中的单位将缓慢受到毒性伤害。 +items.wands.wandofpoison.name=沼泽法杖 +items.wands.wandofpoison.desc=这根地属性法杖由一根枯木枝巧琢而成。不知为何它还活着。 +items.wands.wandofpoison.stats_desc=该法杖能射出一颗会在目标位置爆炸的沼泽法球。它能造成_%1$d~%2$d点伤害_ 并将目标周围的环境改成沼泽。 items.wands.wandoflight.name=强光法杖 items.wands.wandoflight.desc=这根光属性法杖由一块实心半透明水晶构成,就像一块厚长光滑的玻璃。 @@ -1105,7 +1122,7 @@ items.wands.wandofflow.desc=这根冰属性法杖比普通法杖来的短,但 items.wands.wandofflow.stats_desc=该法杖能向目标地点喷射出强劲有力的水流,造成_%1$d~%2$d点伤害_ ,击退目标并将其打湿。 items.wands.wandofacid.name=酸蚀法杖 -items.wands.wandofacid.desc=这根地属性法杖由一根细长木枝巧琢而成。不知为何它还活着而且生机盎然,像一株树苗的嫩芽般艳绿。 +items.wands.wandofacid.desc=这根地属性法杖的紫色主干半包住顶端一颗亮绿色宝石。 items.wands.wandofacid.stats_desc=被使用时,这根法杖会释放出翠绿的强酸,造成_%1$d~%2$d点伤害_并持续伤害被命中的敌人。 items.wands.cannonofmage.name=雷诺的七彩大炮 @@ -1359,6 +1376,7 @@ items.weapon.melee.special.diamondpickaxe.name=史蒂夫的钻石镐 items.weapon.melee.special.diamondpickaxe.desc=一把钻石做的镐。\n时运,耐久,效率,锋利,精准,杀手 items.weapon.melee.special.diamondpickaxe.ac_mine=挖掘 items.weapon.melee.special.diamondpickaxe.no_thing=这里没东西好挖了。 +items.weapon.melee.special.diamondpickaxe.break=你饿了。 items.weapon.melee.special.diamondpickaxe.noise=挖掘惊动了附近的怪物。 items.weapon.melee.special.shadoweater.name=暗噬 @@ -1372,6 +1390,12 @@ items.weapon.melee.special.shadoweater.silent=无需言语... items.weapon.melee.special.shadoweater.locked=无需帮助... items.weapon.melee.special.shadoweater.stand=无需移动... +items.weapon.melee.special.demonblade.name=恶魔刀锋 +items.weapon.melee.special.demonblade.desc=被井水腐化的短弓,环绕着恶魔的气息。\n恶焰,魔吸 + +items.weapon.melee.special.dragonboat.name=龙舟模型 +items.weapon.melee.special.dragonboat.desc=木制的龙舟模型,说实在的应该放在玻璃瓶里。\n钝器,易碎-尖锐 + items.weapon.melee.block.goblinshield.name=哥布林神盾 items.weapon.melee.block.goblinshield.desc=一面来自哥布林部落的萨满盾牌。\n奇迹,招架 items.weapon.melee.block.goblinshield.charge=能量:%d / 10。 @@ -1537,6 +1561,12 @@ items.weapon.missiles.taurcenbow.desc=一把结实的复合弓,在马人族中 items.weapon.missiles.taurcenbow.damage=这件武器可以造成_%d - %d 点伤害_,并可以在不同类型的箭头间切换。当攻击足够次数后,下一次的攻击会附加特殊箭头。 items.weapon.missiles.taurcenbow.charge=充能:%d / %d。 +items.weapon.missiles.elfbow.name=暗夜短弓组 +items.weapon.missiles.elfbow.ac_shoot=射击 +items.weapon.missiles.elfbow.ac_drink=饮用 +items.weapon.missiles.elfbow.desc=暗夜精灵所使用的短弓,会根据法强来提升伤害。同时还带有少量的泉水。 +items.weapon.missiles.elfbow.damage=这件武器可以造成_%d - %d 点伤害_。 + items.weapon.missiles.forestdart.name=森林飞刀 items.weapon.missiles.forestdart.desc=受到森林的祝福的飞刀,能造成大量的伤害。 @@ -1586,28 +1616,27 @@ items.weapon.missiles.pocketball.get_pet=你回收了这只宠物的灵魂。 items.weapon.missiles.moneypack.name=红包 items.weapon.missiles.moneypack.desc=只要准备好钱,在春节就能解决好多问题。2020春节快乐!!! +items.weapon.missiles.mindarrow.name=意识之矢 +items.weapon.missiles.mindarrow.desc=利用你的疯狂,摧毁你的敌人。 + ##mc block items.weapon.missiles.buildblock.wallblock.name=墙块 -items.weapon.missiles.buildblock.wallblock.desc=一种墙块。 +items.weapon.missiles.buildblock.wallblock.desc=一种墙块。投掷来放置墙。 items.weapon.missiles.buildblock.doorblock.name=门块 -items.weapon.missiles.buildblock.doorblock.desc=一种门块。 +items.weapon.missiles.buildblock.doorblock.desc=一种门块。投掷来放置门。 items.weapon.missiles.buildblock.stoneblock.name=雕块 -items.weapon.missiles.buildblock.stoneblock.desc=一种雕块。 +items.weapon.missiles.buildblock.stoneblock.desc=一种雕块。投掷来放置雕。 items.weapon.missiles.buildblock.bookblock.name=书块 -items.weapon.missiles.buildblock.bookblock.desc=一种书块。 +items.weapon.missiles.buildblock.bookblock.desc=一种书块。投掷来放置书。 items.weapon.missiles.buildblock.woodenblock.name=木块 -items.weapon.missiles.buildblock.woodenblock.desc=一种木块。 +items.weapon.missiles.buildblock.woodenblock.desc=一种木块。投掷来放置木。 items.weapon.missiles.buildblock.waterblock.name=水块 -items.weapon.missiles.buildblock.waterblock.desc=一种水块。 - -items.wateritem2.name=水块 -items.wateritem2.pour=使用。 -items.wateritem2.desc=一种水块。 +items.weapon.missiles.buildblock.waterblock.desc=一种水块。投掷来放置水。 ##eggs items.eggs.egg.prevent=这里不是尝试召唤它的最佳地点。 @@ -2058,7 +2087,7 @@ items.misc.jumpr.ac_jump=跳跃 items.misc.jumpr.desc=盗贼并没有训练自己的跳跃能力,使得盗贼跳跃距离很短,但他敏捷的身手可以使他拥有短时间的滞空效果并有几率使其无法被敌人发现。 items.misc.jumpshoes.name=弹跳鞋 -items.misc.jumpshoes.charge=鞋子当前充能数%d,充能上限为%d。 +items.misc.jumpshoes.charge=充能 %d / %d。 items.misc.jumpshoes.ac_jump=跳跃 items.misc.jumpshoes.prompt=选择跳跃的目的地点。 items.misc.jumpshoes.rest=请先休息后再使用。 @@ -2089,13 +2118,13 @@ items.misc.shovel.ac_use=破坏 items.misc.shovel.ac_build=造墙 items.misc.shovel.not_wall=周围没有墙。 items.misc.shovel.break=现在铁铲没耐久了。 -items.misc.shovel.charge=铁铲当前耐久数%d,耐久上限为%d。 +items.misc.shovel.charge=耐久 %d / %d。 items.misc.shovel.desc=在大逃狱事件当中,演员发现了这把铲子。使用这把铲子可以轻松破坏周围的墙壁。\n破坏墙壁将消耗铲子的耐久,但这个耐久会随时间恢复。 items.misc.bshovel.name=卢老爷的奇迹按钮 items.misc.bshovel.ac_use=使用 items.misc.bshovel.break=充能不够 -items.misc.bshovel.charge=按钮当前耐久数%d,耐久上限为%d。 +items.misc.bshovel.charge=耐久 %d / %d。 items.misc.bshovel.desc=一个奇怪的按钮,使用后会发出好听女性的机械声音,并给与奇怪的效果。\n使用的同时会破坏四周墙壁。\n按钮四周刻了奇怪的文字,像什么17张牌,卡布奇诺,牛逼等等。 items.misc.bshovel.mob=锁头已激活 @@ -2112,7 +2141,7 @@ items.misc.potionofmage.ac_shattered=泼洒 items.misc.potionofmage.prompt=选择要瞄准的地方 items.misc.potionofmage.break=现在烧瓶里啥都没有。 items.misc.potionofmage.not_mob=这超出了烧瓶的作用范围。 -items.misc.potionofmage.charge=烧瓶当前质量为%d,质量上限为%d。 +items.misc.potionofmage.charge=质量 %d / %d。 items.misc.potionofmage.desc=法师多年研究结果之一,可以对自身使用来施加增益效果,也可以泼洒出去造成减益效果。 items.misc.gunofsoldier.name=脉冲手枪 @@ -2121,12 +2150,11 @@ items.misc.gunofsoldier.prompt=选择要瞄准的地方 items.misc.gunofsoldier.not_mob=那里没有敌人。 items.misc.gunofsoldier.break=现在没电了。 items.misc.gunofsoldier.not=你不能选择那个目标。 -items.misc.gunofsoldier.charge=手枪当前充能数%d,充能上限为%d。 +items.misc.gunofsoldier.charge=充能 %d / %d。 items.misc.gunofsoldier.desc=脉冲手枪是未来的先进科学产物,会对目标敌人造成基于其受伤程度的惊人的伤害。 items.misc.mkbox.name=蘑菇王国的问号箱 items.misc.mkbox.ac_use=顶一下 - items.misc.mkbox.star=无敌星。 items.misc.mkbox.flowerf=火焰花。 items.misc.mkbox.floweri=冰冻花。 @@ -2135,7 +2163,6 @@ items.misc.mkbox.coin=大金币。 items.misc.mkbox.1up=1up。 items.misc.mkbox.hammer=简易锤子。 items.misc.mkbox.mbox=怪物箱 - items.misc.mkbox.need_gold=你需要100金币来使用它。 items.misc.mkbox.charge=剩余刷新时间%d。 items.misc.mkbox.desc=一个装了各种杂物的箱子,顶一下就会有好东西出来。\n箱子里面多数是蘑菇啦,还有金币,小锤子和花。1up和无敌星非常少见。-某个不愿透露姓名的奇诺比奥。 @@ -2166,7 +2193,7 @@ items.misc.copyball.name=侵蚀核心 items.misc.copyball.ac_use=施放 items.misc.copyball.prompt=选择要瞄准的地方 items.misc.copyball.break=精华不足。 -items.misc.copyball.charge=精华当前数量为%d,数量上限为%d。 +items.misc.copyball.charge=精华 %d / %d。 items.misc.copyball.desc=史莱姆可以在攻击中吸收精华,并可以利用精华来完全控制或扰乱一名敌人。\n系统并不推荐你使用这个,因为可能使这个测试慢到爆炸。 items.misc.gnollmark.name=仪式面具 @@ -2174,7 +2201,7 @@ items.misc.gnollmark.ac_light=光明仪式 items.misc.gnollmark.ac_dark=黑暗仪式 items.misc.gnollmark.ac_earth=自然仪式 items.misc.gnollmark.break=准备不妥。 -items.misc.gnollmark.charge=准备完成度当前为%d,完成度上限为%d。 +items.misc.gnollmark.charge=准备完成度 %d / %d。 items.misc.gnollmark.desc=豺狼人萨满所佩戴的面具,用于仪式准备或者树立地位。在释放法杖后准备度会上升。\n光明仪式会大幅度提升使用者的物理力量,但相对的,使用者的奥术力量会被禁止。黑暗仪式则相反。\n自然仪式将从自然中吸取能量,提升使用者的抗击能力。 items.misc.mechpocket.name=机械口袋 @@ -2202,8 +2229,8 @@ items.misc.demoscroll.desc=一张用鲜血达成的契约,可以用生命来 items.misc.demoscroll.hitup=你感觉你的命中能力提升了。 items.misc.demoscroll.evaup=你感觉你的闪避能力提升了。 items.misc.demoscroll.migup=你感觉你的魔法能力提升了。 -items.misc.demoscroll.strup=你感觉你的力量提升了。 items.misc.demoscroll.htdown=你感觉你的生命上限降低了。 +items.misc.demoscroll.charge=已使用次数 %d 。 items.misc.undeadbook.name=亡灵圣经 items.misc.undeadbook.ac_read=阅读 @@ -2224,7 +2251,7 @@ items.misc.faithsign.ac_human=神圣派系 items.misc.faithsign.ac_mech=机械派系 items.misc.faithsign.ac_life=自然派系 items.misc.faithsign.ac_balance=平衡派系 -items.misc.faithsign.desc=装有不同信仰的标志的盒子,在必要时可以用于解决争端。 +items.misc.faithsign.desc=装有不同信仰的标志的盒子,在必要时可以用于解决争端。\n需要指出的是,sps大陆上的教派复杂混乱,但就区分而言就只有六种派系。神圣派系代表着和人类,兽人,巨魔,精灵,矮人等集群智慧生物,和龙,亡灵,血肉,恶魔这些恶魔派系对立。而机械派系代表着机械,地精,异星人这类科技生物,和植物,野兽,元素这类自然派系对立。\n平衡派系和无派系类似,他们没有对神圣,恶魔,机械,自然派系的偏见,但较无派系而言,平衡派系更擅长对付强大的怪物。 items.misc.savagehelmet.name=蛮族头盔 items.misc.savagehelmet.desc=为狩猎年兽专门准备的头盔,有几率可以减少受到的伤害,并提升相应数量的攻击力。当装备这件头盔时,这个几率提升至100%。 @@ -2235,6 +2262,34 @@ items.misc.healbag.ac_cook=随机调制 items.misc.healbag.need_charge=需要充能 items.misc.healbag.desc=为狩猎年兽专门准备的医疗箱,可以很轻松恢复使用者的生命值,可以作用于周围单位。也可以随机调制一瓶药水、药丸或食物。 +items.misc.nmhealbag.name=纳米维生包 +items.misc.nmhealbag.ac_heal=纳米医疗 +items.misc.nmhealbag.ac_cook=纳米重组 +items.misc.nmhealbag.ac_add=纳米增值 +items.misc.nmhealbag.need_charge=需要纳米点数 +items.misc.nmhealbag.prompt=选择原石作为献祭素材 +items.misc.nmhealbag.desc=纳米维生包可以使你更好控制纳米点数。\n纳米医疗将消耗大部分纳米点数,来治疗使用者。\n纳米重组将消耗部分纳米点数,来制作一个随机的消耗物。\n纳米增值将消耗使用者的生命,并将其转化为纳米无人机点数。 + +items.misc.ppc.name=个人调查仪 +items.misc.ppc.ac_try=试探 +items.misc.ppc.ac_heal=疗养 +items.misc.ppc.ac_mind=追忆 +items.misc.ppc.need_charge=需要记录 +items.misc.ppc.charge=记录数 %d 。 +items.misc.ppc.desc=疯狂或冷静,这是个问题。每当有生物死亡,它都会留下一条记录。你可以消耗记录数来触发特殊效果。 + +items.misc.needpaper.name=通缉令 +items.misc.needpaper.ac_shop=黑市 +items.misc.needpaper.ac_help=黑帮 +items.misc.needpaper.need_charge=需要点数 +items.misc.needpaper.desc=越知名,越危险。好在,你还有点门路。 + +items.misc.dicetower.name=骰子塔 +items.misc.dicetower.ac_roll=重掷 +items.misc.dicetower.ac_reroll=出千 +items.misc.dicetower.ac_allin=乾坤一掷 +items.misc.dicetower.desc=一个用于重置天命点数的道具。\n重掷将重新生成一个天命点数。\n出千将会把天命点数设置为99。\n乾坤一掷将消耗所有的金币,并将其按比例转化为天命点数。 + items.misc.rangebag.name=飞镖袋 items.misc.rangebag.ac_buy=购买 items.misc.rangebag.need_gold=你需要金币来购买。 diff --git a/resources/com/hmdzl/spspd/messages/misc/misc_zh.properties b/resources/com/hmdzl/spspd/messages/misc/misc_zh.properties index 9562b248..63048e0e 100644 --- a/resources/com/hmdzl/spspd/messages/misc/misc_zh.properties +++ b/resources/com/hmdzl/spspd/messages/misc/misc_zh.properties @@ -95,10 +95,14 @@ skins.normal=经典皮肤 skins.first=暑假特典 skins.second=万圣逃亡 skins.third=年兽猎人 +skins.fourth=奇迹试验 +skins.fifth=幻想之旅 skins.normal_desc=经典的像素地牢皮肤,包括战士,法师,盗贼,猎手,演员,星兵,信徒。\n-开始时获得新手宠物包。 skins.first_desc=2019年暑期的英雄皮肤,包括格斗家,探险者,忍者,女仆长,游戏主播,水管工,建筑工。\n-开始时用更加专业的道具替换原有道具。\n-格斗家习得升龙拳。\n-探险者发现彩虹大炮。\n-忍者成为传奇。\n-女仆长练习飞刀。\n-游戏主播开挂。\n-水管工顶砖块。\n-建筑工拿矿镐。 skins.second_desc=怪物皮肤,包括恶魔,豺狼,亡灵,马人,史莱姆,机甲,星灵。\n-开始时获得独有的属性值。\n-恶魔火焰攻击。\n-豺狼快速充能。\n-亡灵潜行牛逼。\n-马人跑得飞快。\n-史莱姆再生恢复。\n-机甲护甲成长。\n-星灵无视防御。 skins.third_desc=2020年春节皮肤,包括重装,司仪,武者,弩手,舞狮,医疗,行商。\n-失去神圣护盾和鞋子,获得猎杀工具包和一个额外的专属道具。\n-重装有盾牌和头盔。\n-司仪有烧瓶和面具。\n-武者有斗篷和图腾。\n-弩手有弓箭和镖袋。\n-舞狮有铁铲和舞谱。\n-医疗有电枪和血包。\n-行商有信盒和水晶 +skins.fourth_desc=复活节奇迹皮肤,包括???,精灵,逃犯,侦探,???,警官,赌徒。\n-获得一条独特的双面状态。\n-??? \n-精灵获得魔法条。没有魔法时将无法使用法杖,但当有魔法时使用法杖造成的伤害将提升。\n-逃犯拥有声望点数。每次逃犯受到的攻击伤害都会降低,但是会损失一定量的金币,并获得相应的点数。 \n-侦探拥有疯狂值。每次受到伤害都会提升疯狂值,并在疯狂值到达一定值时获得一条随机的负面buff,并提升造成的伤害。 \n-??? \n-警官拥有纳米无人机点数。每点无人机点数每回合都回对周围敌人造成伤害,但会间歇性吞噬背包中的非重要道具。 \n-赌徒拥有天命点数。天命点数会随时改变并赋予不同效果,但其会使攻击输出降低。 +skins.fifth_desc=完全随机的的幻想皮肤,包括战士,法师,盗贼,猎手,演员,星兵,信徒。\n-完全随机的开局,且不会有护甲生成。 skins.info=不同的皮肤将提供不同的初始物品 skins.yes=是的 skins.no=不是 diff --git a/resources/com/hmdzl/spspd/messages/scenes/scenes_zh.properties b/resources/com/hmdzl/spspd/messages/scenes/scenes_zh.properties index 1055355a..ae496557 100644 --- a/resources/com/hmdzl/spspd/messages/scenes/scenes_zh.properties +++ b/resources/com/hmdzl/spspd/messages/scenes/scenes_zh.properties @@ -77,6 +77,6 @@ scenes.titlescene.badges=成就 scenes.titlescene.about=关于 scenes.welcomescene.title=特别惊喜像素地牢(发芽改) -scenes.welcomescene.new_things=2020春节快乐!年兽带着几个新怪物来到了这里,同时引来了新英雄信徒。现在猎手们已经准备好去狩猎年兽了!在额外的英雄皮肤下享受这场长达6个小时的冒险。这里包含大量的彩蛋,你可以和以前一样去打败强大的敌人,但你也可以用其他方式来获得胜利。祝你好运。 +scenes.welcomescene.new_things=好了,生日又到了。是时候庆祝国庆,中秋和生日了。这次更新加强了所有的暑期皮肤,以及许多的细节。这里包含大量的彩蛋,你可以和以前一样去打败强大的敌人,但你也可以用其他方式来获得胜利。祝你好运。 scenes.welcomescene.continue=我懂了