Fix hair, dick around with new game screen.
[18plus-7leafadventure.git] / src / org / sevenchan / dongs / bodyparts / Breast.as
blob874e3423720adde1cf9c99ae9a5a148b1169feab
1 package org.sevenchan.dongs.bodyparts
4 import flash.net.registerClassAlias;
5 import org.sevenchan.dongs.clothing.Clothing;
6 import org.sevenchan.dongs.clothing.ClothingType;
7 import org.sevenchan.dongs.Creature;
8 import org.sevenchan.dongs.screens.InfoScreen;
9 import org.sevenchan.dongs.weapons.IWeapon;
10 /**
11 * ...
12 * @author Harbinger
14 public class Breast implements IBodyPart
16 registerClassAlias("P_Boob", Breast);
18 private var _name:String;
19 public var isHairy:Boolean=false;
20 public var size:int = 1;
21 public var milkMult:Number = 1;
22 private static var breastSizes:Array = [
23 "flat", // AA
24 "puffy", // A
25 "small", // B
26 "round", // C
27 "large", // D
28 "big",
29 "immense"
31 private static var breastSynonyms:Array = [
32 "boob",
33 "booby",
34 "bosom",
35 "breast",
36 "doorknocker",
37 "knocker",
38 "mammary",
39 "teat",
40 "tit",
41 "titty"
43 //public function Breast(value:Number,name:String="",size:int=1,milkMultiplier:Number=1)
44 //{
45 //_value = value;
46 //_name = name;
47 //this.size = size;
48 //this.milkMult = milkMultiplier;
49 //}
50 public function Breast(value:Number=0,name:String="",furry:Boolean=false)
52 _value = value;
53 _name = name;
54 isHairy = furry;
57 private var _value:Number;
58 public function get value():Number {
59 return _value;
61 public var _location:String = "right where it should be";
62 public function get location():String { return _location;}
65 public function get sellDesc():String { return getShortDescr(true); }
67 public function get category():String {
68 return "breasts";
71 public function get name():String {
72 return _name;
75 public function bigger():void {
76 if (breastSizes.length-1 == size)
77 return;
78 size++;
81 public function smaller():void {
82 if (0 == size)
83 return;
84 size--;
87 /**
88 * How much in need of milking these tits are.
89 * @return
91 public function getMilkFeeling():String {
92 if (milkMult < 0.5) {
93 return "dried-up";
95 if (milkMult >= 0.5 && milkMult < 1.5) {
96 return "perky";
98 if (milkMult >= 1.5 && milkMult < 2) {
99 return "plump";
101 if (milkMult >= 2 && milkMult < 5) {
102 return "slightly swollen";
104 if (milkMult >= 5) {
105 return "painfully swollen";
107 return "";
110 public function getDescr(num:Number, host:Creature):String {
111 // 2 big{, painfully swollen} tits
112 var text:String = num + " " + breastSizes[size];
113 if (milkMult != 1)
114 text += ", " + getMilkFeeling();
115 text += " " + Utils.pluralize(num,getShortDescr());
116 return text;
121 public function getShortDescr(withModifier:Boolean = false):String {
122 var t:String = MathUtils.getRandomArrayEntry(breastSynonyms);
123 if(withModifier)
124 t = name + " " + t;
125 if (isHairy)
126 t = "fuzzy " + t;
127 return t;
130 public function onFailedAttack(from:Creature, to:Creature):void{}
131 public function onGoodAttack(from:Creature, to:Creature):void{}
133 public function onAdded(atStore:Boolean, ply:Creature):void
135 var text:String = "<h2>New Breast</h2>";
136 if (atStore)
138 text += "<p>The witch blows at your chest over her dry, spindly fingers, as though she were blowing a kiss. The creepy throught passes as you ";
140 else
142 text += "<p>You ";
144 text += " feel a bulge of flesh come into being on your chest, slowly expanding into " + Utils.A(getDescr(1, ply)) + " " + getDescr(1, ply)+"</p>";
145 InfoScreen.push(text);
148 public function onRemoved(atStore:Boolean, ply:Creature):void
150 var text:String = "<h2>Remove a Breast</h2>";
152 if (atStore)
153 text += "<p>The old lady simply prods your unwanted flesh tumor with her wand, and it ";
154 else
155 text += "<p>One of your breasts ";
156 text += "slowly deflates, and then recedes back into your body with a warm tingling sensation.</p>";
157 InfoScreen.push(text);
160 private var _weapon:IWeapon = null;
161 public function get weapon():IWeapon { return _weapon; }
162 public function tryEquip(weap:IWeapon):Boolean
164 if (weap.canEquipOn(this)){
165 _weapon = weap;
166 return true;
168 return false;
171 public function getBulgeSize(host:Creature, c:Clothing):Number
173 if (c.type != ClothingType.TOP)
174 return 0;
175 return size;
178 public function isProducingABulge(host:Creature, clothing:Vector.<Clothing>):Boolean
180 for each (var c:Clothing in clothing)
182 if (getBulgeSize(host, c) >= 2)
183 return true;
185 return false;
188 public function isConcealedBy(host:Creature, clothing:Vector.<Clothing>):Boolean
190 return clothing.some(function(c_:Object, index:int, vector:Vector.<Clothing>):Boolean
192 var c:Clothing = Clothing(c_);
193 if (c != null)
195 return (c.type.obscures.indexOf(category) > -1 && !(getBulgeSize(host, c)>=2));
197 else
199 return false;