From e5a22e95b5a1ea21d320813ec1f6c600fd70ff0f Mon Sep 17 00:00:00 2001 From: Harbinger Date: Tue, 31 May 2011 10:49:36 -0700 Subject: [PATCH] Guardian support and a refactor. Also damned. + Added Ala, the Wind Guardian. + Added the Wind Blessing + Added Gold Potion, which heals everything. + Added the ability to disable running + Added lightning ability for both Ala and the player Signed-off-by: N3X15 --- src/ItemRegistry.as | 18 ++++ src/org/sevenchan/dongs/Creature.as | 7 ++ src/org/sevenchan/dongs/Town.as | 2 +- src/org/sevenchan/dongs/ability/Lightning.as | 33 +++++++ src/org/sevenchan/dongs/creature/Ala.as | 39 +++++++- src/org/sevenchan/dongs/creature/Harpy.as | 1 - .../sevenchan/dongs/enchantment/WindBlessing.as | 32 +++++++ src/org/sevenchan/dongs/items/GoldPotion.as | 42 +++++++++ src/org/sevenchan/dongs/screens/CombatScreen.as | 3 +- src/org/sevenchan/dongs/towns/TownBanala.as | 3 +- src/org/sevenchan/dongs/towns/TownBarn.as | 3 +- src/org/sevenchan/dongs/towns/TownDamned.as | 101 +++++++++++++++++++++ src/org/sevenchan/dongs/towns/TownHarpyCabin.as | 7 ++ src/org/sevenchan/dongs/towns/WildsHaaraWastes.as | 6 +- src/org/sevenchan/dongs/towns/WildsHorusSpine.as | 6 +- 15 files changed, 291 insertions(+), 12 deletions(-) create mode 100644 src/ItemRegistry.as create mode 100644 src/org/sevenchan/dongs/ability/Lightning.as create mode 100644 src/org/sevenchan/dongs/enchantment/WindBlessing.as create mode 100644 src/org/sevenchan/dongs/items/GoldPotion.as create mode 100644 src/org/sevenchan/dongs/towns/TownDamned.as diff --git a/src/ItemRegistry.as b/src/ItemRegistry.as new file mode 100644 index 0000000..716e93c --- /dev/null +++ b/src/ItemRegistry.as @@ -0,0 +1,18 @@ +package +{ + import org.sevenchan.dongs.items.*; + /** + * ... + * @author N3X15 + */ + public class ItemRegistry + { + public static var BERRY_WHITE:WhiteBerries = new WhiteBerries(1); + public static var HARPY_TINCTURE:HarpyTincture = new HarpyTincture(1); + public static var SPIDER_VENOM:SpiderVenomSac = new SpiderVenomSac(1); + public static var DARK_HARPY_EGG:DarkHarpyEgg = new DarkHarpyEgg(1); + public static var POTION_PINK:PinkPotion = new PinkPotion(1); + public static var POTION_GOLD:GoldPotion = new GoldPotion(1); + } + +} \ No newline at end of file diff --git a/src/org/sevenchan/dongs/Creature.as b/src/org/sevenchan/dongs/Creature.as index 7a2260c..f3cc3a6 100644 --- a/src/org/sevenchan/dongs/Creature.as +++ b/src/org/sevenchan/dongs/Creature.as @@ -264,9 +264,16 @@ package org.sevenchan.dongs * @return String Whatever it's called */ public function getTypeName():String { + throw new Error("SOME DUMBASS DIDN'T GIVE THIS CREATURE A NAME"); return "NOT FUCKING NAMED YET"; } + /** + * Do I have the option to run? + * @return Button visibility + */ + public function canRun():Boolean { return true; } + public function getDescription():String { var descr:String = ""; // a gay human male of average height and build. He also possesses a long, flowing mane of golden hair, diff --git a/src/org/sevenchan/dongs/Town.as b/src/org/sevenchan/dongs/Town.as index db0965a..e0a41a4 100644 --- a/src/org/sevenchan/dongs/Town.as +++ b/src/org/sevenchan/dongs/Town.as @@ -237,7 +237,7 @@ package org.sevenchan.dongs /** * omg new town what's it like */ - public function onRevelation():void { text = "REVELATION"; } + public function onRevelation():Boolean { text = "REVELATION"; return true; } public function onExplore(bumpedInto:Creature):void { text = "EXPLORE"; } diff --git a/src/org/sevenchan/dongs/ability/Lightning.as b/src/org/sevenchan/dongs/ability/Lightning.as new file mode 100644 index 0000000..ac68191 --- /dev/null +++ b/src/org/sevenchan/dongs/ability/Lightning.as @@ -0,0 +1,33 @@ +package org.sevenchan.dongs.ability +{ + import org.sevenchan.dongs.*; + import org.sevenchan.dongs.creature.Ala; + import org.sevenchan.dongs.creature.Player; + import org.sevenchan.dongs.screens.InfoScreen; + /** + * ... + * @author N3X15 + */ + public class Lightning extends Ability + { + + public function Lightning() + { + this.description = "Because the attack damage algorithm is fucked."; + this.label = "Lightning"; + this.name = "Lightning"; + } + + override public function activate(activator:Creature, rapee:Creature):Boolean + { + if(activator is Ala) + InfoScreen.push("

Lightning

The Ala roars and a bolt of lightning streaks out of the sky and hits you. One moment you're staring incredulously at the massive teeth of the Ala, the next you're flat on your ass and your scalp is on fire.

"); + if(activator is Player) + InfoScreen.push("

Lightning

You raise your hands to the sky, and dark clouds immediately form, darkening the blaster landscape. The clouds flicker with internal electrical discharges, and then, suddenly, a bolt slams into your opponent's head, causing significant damage. The shockwave caused by the hot air expanding suddenly causes even more.

"); + rapee.HP -= rapee.HP/rapee.level; + return true; + } + + } + +} \ No newline at end of file diff --git a/src/org/sevenchan/dongs/creature/Ala.as b/src/org/sevenchan/dongs/creature/Ala.as index 0ef3c41..1791c81 100644 --- a/src/org/sevenchan/dongs/creature/Ala.as +++ b/src/org/sevenchan/dongs/creature/Ala.as @@ -5,6 +5,8 @@ package org.sevenchan.dongs.creature import org.sevenchan.dongs.bodyparts.Eye; import org.sevenchan.dongs.bodyparts.Gender; import org.sevenchan.dongs.Creature; + import org.sevenchan.dongs.enchantment.WindBlessing; + import org.sevenchan.dongs.screens.InfoScreen; /** * An ala or hala (plural: ale or hali) is a demon of bad weather recorded in * the folklore of Bulgarians, Macedonians, and Serbs. @@ -27,6 +29,10 @@ package org.sevenchan.dongs.creature BodyPartRegistry.eyes.ghost_yellow, BodyPartRegistry.eyes.ghost_yellow ); + this.gold = 100; + this.inventory.push( + ItemRegistry.POTION_GOLD.id + ); this._gender = Gender.ASEXUAL; } @@ -37,11 +43,24 @@ package org.sevenchan.dongs.creature text += "You groan in frustration at the impending storm and begin to unpack your camp, "; text += " when you remember that storms do not have gigantic, red eyes, and they generally "; text += "do not form clouds at ground level, and they definately do not laugh evilly.

" - if (subj.intellect > 35) - text += "

You remember from your studies at home that this is an Ala, a weather demon. This experience, however, does NOT change the fact that it is hungry for blood and that you are completely fucked.

"; + if (subj.intellect >= 35) + text += "

You remember from your studies at home that this is an Ala, a weather " + +"demon. This experience, however, does NOT change the fact that it is hungry for " + +"blood and that you are completely fucked.

"; + text += "

You begin to appreciate the beast's great size, it fills the valley before " + +"you. The creature's claws, each shaped like bony scythes, are as thick as a house. " + +"Even if they were blunt, they would kill you with their sheer size. The rest of the " + +"creature is an equally grim prospect. The Ala's body is constructed from a " + +"combination of bony, blade-covered plates atop massive, thorny tentacles around " + +"its incredible skeleton. Its burning, yellow eyes (fixed on you) and mouth belch " + +"black clouds of smoke that join with the stormclouds.

"; + text += "

You're scared shitless, but too stubborn to turn back.

"; + text += "

You have engaged the Wind Guardian and therefore cannot run.

"; return gender.doReplace(text); } + override public function canRun():Boolean { return false; } + override public function getTypeName():String { return "Ala"; @@ -57,6 +76,22 @@ package org.sevenchan.dongs.creature return false; } + override public function onWin(ply:Creature):Boolean + { + ply.addEnchantment(new WindBlessing()); + ply.abilities["lightning"] = AbilityRegistry.lightning; + + InfoScreen.push("

The rain slows to a stop as the great beast before you stumbles, its " + +"body disintegrating as the storm dissipates. You stand, and before you are able to " + +"strike the creature a deathblow, blinding white light bursts from its eyes and mouth " + +"and begins spreading across its body as it screams loudly, shaking the ground from the " + +"sheer force of its painful shout. You raise an arm to your eyes, but the light and " + +"sound overwhelms your senses and you pass out.

You awaken a short time later, " + +"and feel rested. You notice that you have 100 more gold, a flask of Gold Potion that " + +"you don't remember buying, and a user's manual for the new lightning ability you now " + +"have.

"); + return true; // Yes, we are overriding the winnings screen. + } } } \ No newline at end of file diff --git a/src/org/sevenchan/dongs/creature/Harpy.as b/src/org/sevenchan/dongs/creature/Harpy.as index 558b972..4fcd5a3 100644 --- a/src/org/sevenchan/dongs/creature/Harpy.as +++ b/src/org/sevenchan/dongs/creature/Harpy.as @@ -5,7 +5,6 @@ package org.sevenchan.dongs.creature import org.sevenchan.dongs.bodyparts.*; import flash.net.registerClassAlias; import org.sevenchan.dongs.Item; - import org.sevenchan.dongs.ItemRegistry; import org.sevenchan.dongs.items.HarpyTincture; import org.sevenchan.dongs.items.WhiteBerries; import org.sevenchan.dongs.screens.HarpyEncounterScreen; diff --git a/src/org/sevenchan/dongs/enchantment/WindBlessing.as b/src/org/sevenchan/dongs/enchantment/WindBlessing.as new file mode 100644 index 0000000..aa4f9b0 --- /dev/null +++ b/src/org/sevenchan/dongs/enchantment/WindBlessing.as @@ -0,0 +1,32 @@ +package org.sevenchan.dongs.enchantment +{ + /** + * ... + * @author N3X15 + */ + public class WindBlessing extends Enchantment + { + + public function WindBlessing() + { + super(); + } + + override public function getName():String + { + return "Blessing of the Wind"; + } + + override public function getDescr():String + { + return "Your hall pass to Damned and beyond."; + } + + override public function getID():String + { + return "windblessing"; + } + + } + +} \ No newline at end of file diff --git a/src/org/sevenchan/dongs/items/GoldPotion.as b/src/org/sevenchan/dongs/items/GoldPotion.as new file mode 100644 index 0000000..83e3bb1 --- /dev/null +++ b/src/org/sevenchan/dongs/items/GoldPotion.as @@ -0,0 +1,42 @@ +package org.sevenchan.dongs.items +{ + import org.sevenchan.dongs.Creature; + import org.sevenchan.dongs.enchantment.Corruption; + import org.sevenchan.dongs.enchantment.Paralyze; + import org.sevenchan.dongs.Item; + import org.sevenchan.dongs.screens.InfoScreen; + /** + * ... + * @author N3X15 + */ + public class GoldPotion extends Potion + { + + public function GoldPotion(num:uint = 0) + { + super(num); + + this.setDescr("liquid gold"); + this.id = 6; + this.name = "Gold Potion"; + this.value = 1000; + } + + override public function copy():Item + { + return new GoldPotion(amount); + } + + override public function Use(host:Creature):Boolean + { + var text:String = "

Golden Potion

Without so much as a moment's hesitation, you chug the golden fluid, enjoying its sweetness. Your body feels warm and you gain a sense of calm. All deadly enchantments have been removed, and you have full HP.

"; + InfoScreen.push(text); + delete host.enchantments["corruption"]; + delete host.enchantments["paralyze"]; + host.HP = host.maxHP; + return true; + } + + } + +} \ No newline at end of file diff --git a/src/org/sevenchan/dongs/screens/CombatScreen.as b/src/org/sevenchan/dongs/screens/CombatScreen.as index 94ab3da..33d723a 100644 --- a/src/org/sevenchan/dongs/screens/CombatScreen.as +++ b/src/org/sevenchan/dongs/screens/CombatScreen.as @@ -86,7 +86,8 @@ package org.sevenchan.dongs.screens setButton(0, "Attack"); setButton(1, "Items"); setButton(2, "Abilities"); - setButton(3, "Run"); + if (combatant.canRun()) + setButton(3, "Run"); setButton(4, "Forfeit"); } else { setButton(0, "PARALYZED"); diff --git a/src/org/sevenchan/dongs/towns/TownBanala.as b/src/org/sevenchan/dongs/towns/TownBanala.as index 6956af2..d6c5632 100644 --- a/src/org/sevenchan/dongs/towns/TownBanala.as +++ b/src/org/sevenchan/dongs/towns/TownBanala.as @@ -47,7 +47,7 @@ package org.sevenchan.dongs.towns // TODO: Rework - override public function onRevelation():void + override public function onRevelation():Boolean { text = "

You round a sand dune, probably the 5th one this hour, and curse to yourself for not bringing enough water. Brilliant fucking work, you scold yourself, and continue walking, feeling faint.

"; text += "

An hour later, you arrive at Banala. You immediately begin drinking out of the community well, and nearly fall in. After a few minutes of slurping noisily from the bucket, you lift your head, suddenly acutely aware of a great number of demons and demonesses looking in your direction, most carrying weapons or shop implements.

"; @@ -56,6 +56,7 @@ package org.sevenchan.dongs.towns text += "

"Are you inferring that I am a part of that sick, traitorous bastard's personal army?" You ask, your mood souring as the insult touches a nerve. The anger boils in your blood. "He burned our villages, raped our women, and sold our children into slavery. I want nothing more than to see him die on my sword."

"; text += "

"... I see." The fat one responds as the villagers lower their weapons, "Then you are welcome here. I assume you arrived from the old barn, yes?" You nod hesistantly. She smiles sadly. "Then you are woefully unprepared for what lies ahead." Without saying more, she waddles away, with the rest of the villagers in tow.

"; text += "

Fuck.

"; + return true; } override public function onFailedRest():void diff --git a/src/org/sevenchan/dongs/towns/TownBarn.as b/src/org/sevenchan/dongs/towns/TownBarn.as index 3d0ceec..5a69e41 100644 --- a/src/org/sevenchan/dongs/towns/TownBarn.as +++ b/src/org/sevenchan/dongs/towns/TownBarn.as @@ -29,7 +29,7 @@ package org.sevenchan.dongs.towns ]); } - override public function onRevelation():void + override public function onRevelation():Boolean { text = "

Welcome to Hell

"; text += "

You slowly awaken.

"; @@ -60,6 +60,7 @@ package org.sevenchan.dongs.towns text += "merchant some more before approaching him for wares. This is Hell, after "; text += "all. Who knows what could happen?

"; text += ""; + return true; } override public function onEnter():void diff --git a/src/org/sevenchan/dongs/towns/TownDamned.as b/src/org/sevenchan/dongs/towns/TownDamned.as new file mode 100644 index 0000000..546a3b6 --- /dev/null +++ b/src/org/sevenchan/dongs/towns/TownDamned.as @@ -0,0 +1,101 @@ +package org.sevenchan.dongs.towns +{ + import org.sevenchan.dongs.Creature; + import org.sevenchan.dongs.ItemRegistry; + import org.sevenchan.dongs.screens.ShopScreen; + import org.sevenchan.dongs.Town; + + /** + * ... + * @author N3X15 + */ + public class TownDamned extends Town + { + + public function TownDamned() + { + super(); + ID = "damned"; + name = "Damned"; + inhabitants = [ + Creature.CreatureRegistry.demon, + Creature.CreatureRegistry.cowgirl + ]; + isWilds = false; + freeRest = false; + connectedTowns = [ + "horus" + ]; + this.shop = new ShopScreen(this, 20, [ + ItemRegistry.BERRY_WHITE.id, + ItemRegistry.POTION_PINK.id, + ItemRegistry.SPIDER_VENOM.id + ]); + } + + override public function onEnter():void + { + text = "

The city festers around you, ignorant of your plans.

"; + } + + override public function onRevelation():Boolean + { + if (main.player.hasEnchantment("windblessing")) { + text = "

Damned

You look up from the rock path cut into the mountain, dust " + +"caked into your travel-tanned skin. As you reach the summit of the mountain, you " + +"look ahead and see a thickly forested valley, with a city in the middle. You make " + +"your way towards it, and begin to make it out.

" + + "

Black towers with eerie red lights stretch into the burning skies, as though " + +"defying gravity itself. Walkways interconnect the tower and swarm with beasts " + +"great and small. A terrible smell, that of death and body odor, fills the murky " + +"air. To top it all off, as you reach the front gate, a tattered iron sign " + +"proudly proclaims the city's name: Damned.

"; + return true; + } else { + // WIND BOSS + main.startCombat(null, Creature.CreatureRegistry.ala); + return false; + } + } + + override public function onExplore(bumpedInto:Creature):void + { + text = "

Damned is an immense city built from a black stone mined from the surrounding " + +"mountains. Torches are everywhere because of the stone making the rooms, towers, and " + +"catwalks around the city look dark. You doubt anyamount of torches would make the " + +"city look even remotely inviting, as the designers seemed to have thrown up their " + +"hands in exasperation and went with the evil theme. Sharp-looking rock spires jut " + +"from every external surface, and some corpses are even skewered on many of them, " + +"either as a warning or, more likely, purely for decoration.

" + +"

The people that live here aren't much friendlier. Roving gangs of thugs " + +"terrorize the business district, demanding money for "protection", many " + +"simply killing the owner after taking his money. Smarter (and richer) business " + +"owners have resorted to hiring their own gangs to protect themselves from the other " + +"gangs (and earn side-money selling narcotics and whores). The entire town is a " + +"cycle of crime.

"; + } + + override public function onShopWelcome():String + { + return "

"Well, I'll be goddamned. If it isn't an outsider." A thick, " + +"italian accent remarks from behind fat, red lips in the middle of an equally " + +"fat red face. You can't do anything but stare at the top of the demon's head, where " + +"a pile of grease that might have once been hair resides.

The man frowns. " + +""Are you gonna buy anything, or what?" He crosses his rather hairy arms." + +"

"; + } + + override public function onShopBuyMenu():String + { + return "

You can hear sweaty palms rub together anxiously as a terrifying grin parts the " + +"shopkeeper's mouth. "Great, so what'll it be?""; + } + + override public function onShopSellMenu():String + { + return "

"Oh, and who did you steal this from? Nah, just kidding, show me what you" + +"'ve got."

"; + } + } + +} \ No newline at end of file diff --git a/src/org/sevenchan/dongs/towns/TownHarpyCabin.as b/src/org/sevenchan/dongs/towns/TownHarpyCabin.as index 8678c36..13d4351 100644 --- a/src/org/sevenchan/dongs/towns/TownHarpyCabin.as +++ b/src/org/sevenchan/dongs/towns/TownHarpyCabin.as @@ -25,6 +25,13 @@ package org.sevenchan.dongs.towns ]; } + override public function onRevelation():Boolean + { + text = "Whoops, I forgot this one. WIP."; + + return true; + } + override public function onEnter():void { text = "

The cabin is warm, despite the falling snow and ice outside.

"; diff --git a/src/org/sevenchan/dongs/towns/WildsHaaraWastes.as b/src/org/sevenchan/dongs/towns/WildsHaaraWastes.as index 893da78..d265b72 100644 --- a/src/org/sevenchan/dongs/towns/WildsHaaraWastes.as +++ b/src/org/sevenchan/dongs/towns/WildsHaaraWastes.as @@ -19,8 +19,7 @@ package org.sevenchan.dongs.towns name = "Haara Wastes"; inhabitants = [ Creature.CreatureRegistry.oldspace, - Creature.CreatureRegistry.arachnid, - Creature.CreatureRegistry.ala + Creature.CreatureRegistry.arachnid ]; isWilds = true; freeRest = true; @@ -65,9 +64,10 @@ package org.sevenchan.dongs.towns text +=".

"; } - override public function onRevelation():void + override public function onRevelation():Boolean { text = new Intro(); + return true; } } diff --git a/src/org/sevenchan/dongs/towns/WildsHorusSpine.as b/src/org/sevenchan/dongs/towns/WildsHorusSpine.as index 9dfd011..99b2c32 100644 --- a/src/org/sevenchan/dongs/towns/WildsHorusSpine.as +++ b/src/org/sevenchan/dongs/towns/WildsHorusSpine.as @@ -25,7 +25,7 @@ package org.sevenchan.dongs.towns isWilds = true; freeRest = true; connectedTowns = [ - "banala" + "banala","damned" ]; } @@ -70,11 +70,13 @@ package org.sevenchan.dongs.towns } - override public function onRevelation():void + override public function onRevelation():Boolean { text = "

Horus' Spine

"; text += "

It's not hard to see how the travelers who crossed these mountains long ago gave them their name. Gigantic white rocks stretch into the sky. You assume them to be limestone, not that it matters here. For all you know, it could be the dried semen that the lustful creatures here collect and dump into massive piles that reach into the sky. You shudder at the thought.

"; text += "

Gripping a random branch on the ground as a walking stick, you begin your ascent into the unknown.

"; + + return true; } -- 2.11.4.GIT