From 7f26b9c33ea726fd1665703240ce89382a99c8d9 Mon Sep 17 00:00:00 2001 From: Harbinger Date: Tue, 2 Oct 2012 17:10:00 -0700 Subject: [PATCH] Add new clothing system --- src/org/sevenchan/dongs/Creature.as | 5 + src/org/sevenchan/dongs/Town.as | 119 ++++++++++++++++++---- src/org/sevenchan/dongs/clothing/Clothing.as | 94 +++++++++++++++++ src/org/sevenchan/dongs/clothing/ClothingType.as | 30 ++++++ src/org/sevenchan/dongs/clothing/Tunic.as | 22 ++++ src/org/sevenchan/dongs/creature/Bova.as | 2 +- src/org/sevenchan/dongs/creature/Player.as | 2 +- src/org/sevenchan/dongs/screens/NewGameScreen.as | 26 ++--- src/org/sevenchan/dongs/screens/Shop.as | 14 ++- src/org/sevenchan/dongs/screens/shops/BodyShop.as | 4 +- src/org/sevenchan/dongs/towns/Biome.as | 26 +++++ src/org/sevenchan/dongs/towns/TownBarn.as | 2 +- src/org/sevenchan/dongs/towns/TownDamned.as | 11 +- 13 files changed, 307 insertions(+), 50 deletions(-) create mode 100644 src/org/sevenchan/dongs/clothing/Clothing.as create mode 100644 src/org/sevenchan/dongs/clothing/ClothingType.as create mode 100644 src/org/sevenchan/dongs/clothing/Tunic.as create mode 100644 src/org/sevenchan/dongs/towns/Biome.as diff --git a/src/org/sevenchan/dongs/Creature.as b/src/org/sevenchan/dongs/Creature.as index bcf3e82..4becae4 100644 --- a/src/org/sevenchan/dongs/Creature.as +++ b/src/org/sevenchan/dongs/Creature.as @@ -3,6 +3,7 @@ package org.sevenchan.dongs import flash.net.*; import org.sevenchan.AdventureController; import org.sevenchan.dongs.bodyparts.*; + import org.sevenchan.dongs.clothing.Clothing; import org.sevenchan.dongs.creature.*; import org.sevenchan.dongs.enchantment.*; import org.sevenchan.dongs.enchantment.events.*; @@ -71,6 +72,10 @@ package org.sevenchan.dongs // Explored locations public var explored:Vector. = new Vector.(); + public var clothing:Vector. = new Vector.(); + + + /** * Do stats scale with the PC (false) or stay the same (true)? * Mostly useful for bosses. diff --git a/src/org/sevenchan/dongs/Town.as b/src/org/sevenchan/dongs/Town.as index 72d8d7d..563e9d1 100644 --- a/src/org/sevenchan/dongs/Town.as +++ b/src/org/sevenchan/dongs/Town.as @@ -2,6 +2,9 @@ package org.sevenchan.dongs { import flash.utils.Dictionary; import org.sevenchan.AdventureController; + import org.sevenchan.dongs.bodyparts.Gender; + import org.sevenchan.dongs.creature.Human; + import org.sevenchan.dongs.creature.Player; import org.sevenchan.dongs.screens.Shop; import org.sevenchan.dongs.towns.*; @@ -13,7 +16,7 @@ package org.sevenchan.dongs { // Explore, Shop, Rest (10G), Leave, Fap private var context:Array = []; - + public var text:String = ""; public static var knownTowns:Object = {}; @@ -54,18 +57,12 @@ package org.sevenchan.dongs private var menu:String = "main"; + public var biome:Biome = Biome.WOODS; + public static function setup():void { Item.fillRegistry(); - knownTowns = { - barn: new TownBarn(), - banala: new TownBanala(), - damned: new TownDamned(), - haara: new WildsHaaraWastes(), - harpycabin: new TownHarpyCabin(), - horus: new WildsHorusSpine(), - lake: new WildsLake() - }; + knownTowns = {barn: new TownBarn(), banala: new TownBanala(), damned: new TownDamned(), haara: new WildsHaaraWastes(), harpycabin: new TownHarpyCabin(), horus: new WildsHorusSpine(), lake: new WildsLake()}; } public function Town() @@ -175,12 +172,12 @@ package org.sevenchan.dongs var i:int = 0; text = "

Shop

You look around cautiously for a place to buy some wares. After a cursory examination of your surroundings, you find the following places of commerce:

    "; context = []; - for(var shopName:String in shops) + for (var shopName:String in shops) { i++; setButton(i, shopName); context.push(shopName); - text += "
  • " + shopName + " - " + (shops[shopName] as Shop).description+"
  • "; + text += "
  • " + shopName + " - " + (shops[shopName] as Shop).description + "
  • "; } text += "
"; updateScreen(); @@ -235,15 +232,97 @@ package org.sevenchan.dongs break; case 4: setButton(NEXT_BUTTON, "NEXT"); - if (main.player.dicks.length > 0 || main.player.vaginas.length > 0) - { - text = "

Masturbate

Blah blah blah, you blast cum everywhere or something.

"; - main.player.lust = 0; - } - else + if (main.player.currentTown.isWilds) { - text = "

You look at your groin, and find nothing there for fap with.

"; + text = "

Masturbate

"; + text += "

The lust boiling in your loins is too much to ignore anymore as you nervously look around "; + text += "for other signs of life; you don’t want some sex crazed Demon or creature to get the drop on "; + text += "you while you tend to your urges. "; + if ((main.player as Player).baseType is Human) + { + text += "Or worse, by some stroke of chance having a survivor from your unit stumble upon you as you "; + text += "relieve a little "tension"."; + } + text += "

"; + text += "Spotting only the harmless landscape, you deem that its safe enough to find someplace private "; + text += "and get intimately acquainted with your body.

"; + + var gbody:String = (main.player.gender == Gender.ASEXUAL) ? "body" : "genitalia"; + + switch (main.player.currentTown.biome) + { + case Biome.WOODS: + text += "

Ducking into a secluded bush, you endeavor to work yourself free of your "; + text += "clothing and free your "; + switch (main.player.gender) + { + case Gender.FEMALE: + text += Utils.pluralize(main.player.vaginas.length, "vagina"); + break; + case Gender.HERM: + text += "genitalia"; + break; + case Gender.MALE: + text += Utils.pluralize(main.player.dicks.length, "cock"); + break; + case Gender.ASEXUAL: + text += "body"; + break; + } + break; + case Biome.PLAINS: + var sexes:String = (main.player.gender == Gender.ASEXUAL) ? "body" : Utils.pluralize(main.player.vaginas.length + main.player.dicks.length, "sex", "sexes"); + text += "

Concealing yourself in between a pair of boulders, you finally indulge the "; + text += "ceaseless lamentations of your " + sexes + " and free "; + switch (main.player.gender) + { + case Gender.FEMALE: + text += "your " + Utils.pluralize(main.player.vaginas.length, "vagina"); + break; + case Gender.HERM: + text += "your genitalia"; + break; + case Gender.MALE: + text += "your " + Utils.pluralize(main.player.dicks.length, "cock"); + break; + case Gender.ASEXUAL: + text += "yourself"; + break; + } + text += " of your clothing

"; + break; + case Biome.BEACH: + text += "

Finding a nice, out of way spot on the hot sand, you eagerly strip down and "; + text += "expose your " + gbody + " to the brisk air that blows over the tranquil environment.

"; + break; + case Biome.JUNGLE: + text += "

Working your way up the humid, slippery trunk of a tree, you manage to perch "; + text += "yourself on a stable branch that’s high enough off the ground to give you some advance "; + text += "warning.

"; + break; + case Biome.MOUNTAINS: + text += "

Shielded from the whipping winds of this plateau by welcome rockface, you "; + text += "breath a sigh of relief and take in the feeling of solid ground under your body; "; + text += "something that's been sorely lacking as you’ve explored these mountains. Now filled "; + text += "with a sense of security, you work to remove your clothing and bring your " + gbody + " to attention.

"; + break; + case Biome.CAVE: + text += "After scoping out and wiping down a well hidden hole in the cavernous "; + text += "tunnels, you climb inside and quickly undo your pant buckles. Even in the darkness, you "; + text += "instinctively know where "; + if (main.player.gender == Gender.ASEXUAL) + { + text += "your "+gbody+" are, reaching down and taking a firm hold on "; + text += Utils.pluralize(main.player.vaginas.length + main.player.dicks.length, "it", "them") + "."; + } + else + { + text += "you need to touch, trying your best to trigger a body shuddering spasm of joyful gratification."; + } + break; + } } + main.player.lust = 0; updateScreen(); return false; break; @@ -258,7 +337,7 @@ package org.sevenchan.dongs case "shop": if (id == 0) { - processButtonPress( -1); + processButtonPress(-1); return false; } AdventureController.screenQueue.write(shops[context[id - 1]] as Shop); diff --git a/src/org/sevenchan/dongs/clothing/Clothing.as b/src/org/sevenchan/dongs/clothing/Clothing.as new file mode 100644 index 0000000..403158c --- /dev/null +++ b/src/org/sevenchan/dongs/clothing/Clothing.as @@ -0,0 +1,94 @@ +package org.sevenchan.dongs.clothing +{ + import org.sevenchan.dongs.bodyparts.IBodyPart; + import org.sevenchan.dongs.Creature; + import org.sevenchan.dongs.Item; + import org.sevenchan.dongs.Screen; + import org.sevenchan.dongs.screens.InfoScreen; + /** + * An article of clothing or armor, is also an item. + * @author Harbinger + */ + public class Clothing extends Item + { + public var HP:Number = 0; + public var maxHP:Number = 5; + public var type:ClothingType = ClothingType.HEADGEAR; // Determines what is obscured. + public var opaque:Boolean = true; + public var isArmor:Boolean = false; + + public function Clothing(num:uint=0) + { + super(num); + } + + /** + * Used by the body part to determine if it's being hidden. + * @param part + */ + public function isObscuring(part:IBodyPart):Boolean { + return opaque && type.obscures.some(function(o:*):Boolean { + return part.category == (o as String); + }); + } + + public function getDescr(host:Creature):String { + return "[LOL NO GetDescr()!]"; + } + + override public function Use(host:Creature):Boolean + { + if ((HP / maxHP) < 0.1){ + InfoScreen.push("This " + this.getDescr(host) + " is too damaged to be worn."); + return false; + } + var text:String = ""; + switch(type) { + case ClothingType.FOOTWEAR: + if (host.legs.length == 0){ + InfoScreen.push("You cannot wear this item, as you have no legs with feet on which to wear them."); + return false; + } + text = "You drop the " + this.getDescr(host) + " onto the ground and slide your feet into them, finding them nice and snug"; + if (HP / maxHP < 0.5) + text += ", despite the holes"; + else if (HP / maxHP < 0.7) + text += ", despite the obvious wear"; + text += "." + break; + case ClothingType.HEADGEAR: + text = "You place the " + this.getDescr(host) + " onto your head, knowing that you now look"; + if (HP / maxHP < 0.5) + text += " like a peasant on his way to a soup kitchen."; + else if (HP / maxHP < 0.7) + text += " like an old gentleman, the item being as worn as it is."; + else + text += " very dapper."; + break; + case ClothingType.PANTS: + if (host.legs.length == 0){ + InfoScreen.push("You cannot wear this item, as you have no legs to wear them on."); + return false; + } + text = "You find a nice secluded area and slip into your " + this.getDescr(host); + if (HP / maxHP < 0.5) + text += ", being mindful of the huge holes slashed into the garment"; + else if (HP / maxHP < 0.7) + text += ", aware of the worn knees and scratches."; + break; + case ClothingType.TOP: + text = "Ensuring no one's around to catch you off-guard, you slip the " + this.getDescr(host) + " over your head"; + if (HP / maxHP < 0.5) + text += ", peeking through the holes and cuts to be sure no one sneaks up on you."; + else if (HP / maxHP < 0.7) + text += ", ignoring the scratches and loose fibers."; + break; + } + InfoScreen.push(text); + host.clothing.push(this); + return true; + } + + } + +} \ No newline at end of file diff --git a/src/org/sevenchan/dongs/clothing/ClothingType.as b/src/org/sevenchan/dongs/clothing/ClothingType.as new file mode 100644 index 0000000..6820f83 --- /dev/null +++ b/src/org/sevenchan/dongs/clothing/ClothingType.as @@ -0,0 +1,30 @@ +package org.sevenchan.dongs.clothing +{ + import org.sevenchan.dongs.bodyparts.IBodyPart; + + public class ClothingType + { + public static const HEADGEAR:ClothingType = new ClothingType("headgear", [], "head"); + public static const TOP:ClothingType = new ClothingType("top", ["breasts"], "torso"); + public static const PANTS:ClothingType = new ClothingType("pants", ["dicks","balls","vaginas"], "legs"); + public static const FOOTWEAR:ClothingType = new ClothingType("footwear", [], "feet"); + + public var name:String = ""; + + /** + * Body part category name(s) that are hidden by this clothing. + */ + public var obscures:Array = []; + + /** + * What kind of body part does this attach to? (BodyPart category, + head, torso) + */ + public var attachesTo:String = "head"; + + public function ClothingType(name:String, obscures:Array, attachesTo:String) { + this.name = name; + this.obscures = obscures; + this.attachesTo = attachesTo; + } + } +} \ No newline at end of file diff --git a/src/org/sevenchan/dongs/clothing/Tunic.as b/src/org/sevenchan/dongs/clothing/Tunic.as new file mode 100644 index 0000000..fc5a709 --- /dev/null +++ b/src/org/sevenchan/dongs/clothing/Tunic.as @@ -0,0 +1,22 @@ +package org.sevenchan.dongs.clothing +{ + /** + * Peasant shirt + * @author Harbinger + */ + public class Tunic extends Clothing + { + public var color:String = "brown"; + + public function Tunic(num:uint=0,color="brown") + { + super(num); + value = 5; + this.isSexuallyTransmitted = false; + this.isArmor = false; + this.opaque = true; + this.color = color; + } + } + +} \ No newline at end of file diff --git a/src/org/sevenchan/dongs/creature/Bova.as b/src/org/sevenchan/dongs/creature/Bova.as index 1742177..5b3d278 100644 --- a/src/org/sevenchan/dongs/creature/Bova.as +++ b/src/org/sevenchan/dongs/creature/Bova.as @@ -40,7 +40,7 @@ package org.sevenchan.dongs.creature this.gender = Gender.HERM; break; } - this.build = Build.AVG; + this.build = Build.CHUBBY; this.hair = new Hair("long, blonde"); this.arms.push(BodyPartRegistry.human_arm, BodyPartRegistry.human_arm); this.legs.push(BodyPartRegistry.human_leg, BodyPartRegistry.human_leg); diff --git a/src/org/sevenchan/dongs/creature/Player.as b/src/org/sevenchan/dongs/creature/Player.as index b85795a..aae3a44 100644 --- a/src/org/sevenchan/dongs/creature/Player.as +++ b/src/org/sevenchan/dongs/creature/Player.as @@ -19,7 +19,7 @@ package org.sevenchan.dongs.creature public class Player extends Creature { private var f:FileReference = new FileReference(); - private var baseType:Creature = new Human(); + public var baseType:Creature = new Human(); private var saveFile:FileReference = null; private var waitingForLoad:Boolean = false; private var cancelled:Boolean = false; diff --git a/src/org/sevenchan/dongs/screens/NewGameScreen.as b/src/org/sevenchan/dongs/screens/NewGameScreen.as index 4ed4cfd..effe475 100644 --- a/src/org/sevenchan/dongs/screens/NewGameScreen.as +++ b/src/org/sevenchan/dongs/screens/NewGameScreen.as @@ -4,6 +4,7 @@ package org.sevenchan.dongs.screens import org.sevenchan.dongs.creature.*; import org.sevenchan.dongs.bodyparts.*; import org.sevenchan.dongs.*; + import org.sevenchan.dongs.creature.Bova; /** * ... * @author Harbinger @@ -67,10 +68,12 @@ package org.sevenchan.dongs.screens break; case 1: main.player.setBaseType(new Bova()); - text += "

You are a Bova, a cow-girl who transforms others into Bovae via flatulence.

"; - text += "

Bovae can be Female or Hermophrodites (Franks, beans AND tacos).

"; + text += "

You are a Bova, a race of cow-girls that was once enslaved by man. Throwing off their shackles, they formed their own nation after a bloody war.

"; + text += "

Bovae can be Male or Female.

"; + text += "

Males (bulls) are very strong, yet not very smart.

"; + text += "

Females are more cunning, yet they need their bulls for protection.

"; clearButtons(); - setButton(1, "Hermophrodite"); + setButton(0, "Male"); setButton(2, "Female"); break; case 2: @@ -101,18 +104,15 @@ package org.sevenchan.dongs.screens this.stage = 3; clearButtons(); text = "

Class Selection

"; - text += "

Here, you choose your initial startup benefits. These aren't classes in the traditional sense, they merely boost your initial stats.

"; + text += "

Here, you choose your initial startup benefits and weapons.

"; text += "
    "; - setButton(0, "Balanced"); - text += "
  • Balanced - You trained all of your skills. (+1 STR, +1 SPD, +1 INT).
  • "; - setButton(1, "Brute"); - text += "
  • Brute - You excel in brute strength, and can benchpress a horse. However, you're not too fast, and not too smart. (+3 STR)
  • "; + setButton(0, "Avg. Joe"); + text += "
  • Avg. Joe - Just go in with the clothes on your back. (1 STR, 1 INT, 1 SPD)
  • "; + setButton(1, "Soldier"); + text += "
  • Soldier - You spent more time on swordplay than books. This lets you dive right into the combat. (+3 STR, Cheap Sword, Leather Armor)
  • "; setButton(2, "Bookworm"); - text += "
  • Bookworm - You read a lot of scrolls as a kid, and paid attention in class. Strength, however, is not your forte. (+2 INT, +1 SPD)
  • "; - if(main.player.gender == Gender.MALE || main.player.gender == Gender.HERM) { - text += "
  • Freak - You were cursed at birth with a third testicle, which gives you more volume and lust, but it reduced your muscle development, despite the extra testosterone. (+1 TESTICLE, +1 STR, +1 SPD)
  • "; - setButton(3, "Freak"); - } + text += "
  • Bookworm - You read a lot of scrolls as a kid, and paid attention in class. Strength, however, is not your forte. (+3 INT, Glasses, Daemonology Book)
  • "; + text += "
"; updateScreen(); break; diff --git a/src/org/sevenchan/dongs/screens/Shop.as b/src/org/sevenchan/dongs/screens/Shop.as index 76ce882..f6db497 100644 --- a/src/org/sevenchan/dongs/screens/Shop.as +++ b/src/org/sevenchan/dongs/screens/Shop.as @@ -28,18 +28,17 @@ package org.sevenchan.dongs.screens protected var inventory:Array = []; protected var town:Town; protected var name:String; + protected var discoveredName:String; public var description:String; public var discoveredDescription:String="A typical shop."; protected var SellMenu:MenuNode; - public static function push():void + public function Shop(discoveredName:String,discoveredDesc:String,undiscoveredname:String, undiscovereddescription:String,t:Town, markup:Number, itemsSold:Array) { - AdventureController.screenQueue.write(new SuperStoreScreen()); - } - - public function Shop(name:String, description:String,t:Town, markup:Number, itemsSold:Array) - { - this.description = description; + this.discoveredName = discoveredName; + this.discoveredDescription = discoveredDescription; + this.name = undiscoveredname; + this.description = undiscovereddescription; this.name = name; this.town = t; this.markup = markup; @@ -48,7 +47,6 @@ package org.sevenchan.dongs.screens inventory = []; currentItem.clearChildren(); - ; var BuyItems:MenuNode = currentItem.pushMenu("Buy", "Buy things at terrible prices."); for each (var item:Item in itemsSold) { diff --git a/src/org/sevenchan/dongs/screens/shops/BodyShop.as b/src/org/sevenchan/dongs/screens/shops/BodyShop.as index 01eedd8..30c4db6 100644 --- a/src/org/sevenchan/dongs/screens/shops/BodyShop.as +++ b/src/org/sevenchan/dongs/screens/shops/BodyShop.as @@ -16,9 +16,9 @@ package org.sevenchan.dongs.screens.shops { private var partsInventory:Dictionary = new Dictionary(); private var BuyItems:MenuNode; - public function BodyShop(name:String, description:String, t:Town, markup:Number, itemsSold:Array) + public function BodyShop(dName:String,dDesc:String, name:String, description:String,t:Town, markup:Number, itemsSold:Array) { - super(name, description, t, markup, []); + super(dName,dDesc,name, description,t, markup, []); inventory = []; currentItem.clearChildren(); diff --git a/src/org/sevenchan/dongs/towns/Biome.as b/src/org/sevenchan/dongs/towns/Biome.as new file mode 100644 index 0000000..9ed316c --- /dev/null +++ b/src/org/sevenchan/dongs/towns/Biome.as @@ -0,0 +1,26 @@ +package org.sevenchan.dongs.towns +{ + + /** + * Used for masturbation scene selection, and other biome-specific text + * @author Harbinger + */ + public class Biome + { + public static const WOODS:Biome = new Biome("woods"); + public static const PLAINS:Biome = new Biome("plains"); + public static const BEACH:Biome = new Biome("beach"); + public static const JUNGLE:Biome = new Biome("jungle"); + public static const MOUNTAINS:Biome = new Biome("mountains"); + public static const CAVE:Biome = new Biome("cave"); + + public var name:String = ""; + + public function Biome(name:String) + { + this.name = name; + } + + } + +} \ No newline at end of file diff --git a/src/org/sevenchan/dongs/towns/TownBarn.as b/src/org/sevenchan/dongs/towns/TownBarn.as index d951469..98acf0a 100644 --- a/src/org/sevenchan/dongs/towns/TownBarn.as +++ b/src/org/sevenchan/dongs/towns/TownBarn.as @@ -25,7 +25,7 @@ package org.sevenchan.dongs.towns ]; this.shops = { - CART: new Shop("CART","The old demon's cart of wonders",this, 0.3, [ + CART: new Shop("CART","The old demon's cart of wonders","CART","The old demon's cart of wonders",this, 0.3, [ ItemRegistry.BERRY_WHITE ]) }; diff --git a/src/org/sevenchan/dongs/towns/TownDamned.as b/src/org/sevenchan/dongs/towns/TownDamned.as index 23f69b2..35a7b78 100644 --- a/src/org/sevenchan/dongs/towns/TownDamned.as +++ b/src/org/sevenchan/dongs/towns/TownDamned.as @@ -27,14 +27,17 @@ package org.sevenchan.dongs.towns "lake" ]; this.shops = { - BEAKER: new Shop("BEAKER","Judging by the old, broken sign with a beaker scrawled across it, probably a potion shop",this, 0.15, [ + BEAKER: new Shop( + "Damned Potions","Headquarters of a potion shop franchise", + "BEAKER","Judging by the old, broken sign with a beaker scrawled across it, probably a potion shop",this, 0.15, [ ItemRegistry.BERRY_WHITE, ItemRegistry.POTION_PINK, ItemRegistry.SPIDER_VENOM ]), - SHIRTS: new Shop("SHIRTS","You have no idea. It looks like someone nailed dozens of ragged shirts to the front of the stall, so possibly a clothier.",this, 0.35, [ - ItemRegistry.GAS_MASK, - + SHIRTS: new Shop( + "Cruel Clothing","A small clothing shop.", + "SHIRTS","You have no idea. It looks like someone nailed dozens of ragged shirts to the front of the stall, so possibly a clothier.",this, 0.35, [ + ItemRegistry.GAS_MASK, // TODO: CLOTHES ]) }; } -- 2.11.4.GIT