Fix hair, dick around with new game screen.
[18plus-7leafadventure.git] / src / org / sevenchan / dongs / bodyparts / Testicle.as
blob8caf25365518f922b9f1d16e233f1bb57c7bbe0f
1 package org.sevenchan.dongs.bodyparts
3 import org.sevenchan.dongs.Creature;
4 import org.sevenchan.dongs.enchantment.*;
5 import flash.net.registerClassAlias;
6 import org.sevenchan.dongs.weapons.IWeapon;
7 import org.sevenchan.dongs.clothing.Clothing;
8 /**
9 * ...
10 * @author Harbinger
12 public class Testicle implements IBodyPart
14 registerClassAlias("P_Ball", Testicle);
16 public var _name:String;
17 public var semen:String;
18 public var loadMult:Number = 1; // multiplies below
19 public var normalLoad:Number; // ml, per testicle
20 public var targetFX:Enchantment = null; // Enchantment to apply to the target after cumming
21 public var hostFX:Enchantment = null; // Enchantment to apply to the host once the balls are applied, and once every action.
22 public var host:Creature = null;
23 public var _location:String = "";
25 private var _value:Number;
26 public function get value():Number {
27 return _value;
30 public function get location():String { return _location; }
31 public function set location(value:String):void { _location=value; }
33 public var TESTICLE_SYNONYMS:Array = [
34 "ball","nut","knocker","testicle"
37 public function get category():String {
38 return "balls";
41 public function Testicle(name:String="",load:Number=0,targetEnch:Enchantment=null,hostEnch:Enchantment=null,semenDesc:String="")
43 this._name = name;
44 this._location = "";
45 normalLoad = load;
46 targetFX = targetEnch;
47 hostFX = hostEnch;
48 semen = semenDesc;
51 public function get name():String {
52 return _name;
55 public function setHost(value:Creature):void {
56 host = value;
57 host.addEnchantment(hostFX);
60 public function get sellDesc():String { return getDescr( -1, null); }
62 public function getDescr(num:Number, host:Creature):String {
63 var sizeDesc:String="standard-issue";
64 if (loadMult < 0.1) {
65 sizeDesc = "shrivelled ";
67 if (loadMult > 100) {
68 sizeDesc = "melon-sized, ballooning ";
70 if (loadMult < 10) {
71 sizeDesc = "apple-sized, greatly swollen ";
73 if (loadMult < 5) {
74 sizeDesc = "large, fat and tight ";
76 if (loadMult < 3)
78 sizeDesc = "slightly swollen ";
80 if (loadMult == 1)
81 sizeDesc = "standard-issue ";
82 var o:String = "";
83 if (num > 0)
84 o += num + " ";
85 o += sizeDesc +" ";
86 o += Utils.pluralize(num, name);
87 if (_location.length > 0)
88 o = o + " growing out of " + _location;
89 return o;
92 public function getShortDescr(withModifier:Boolean = false):String {
93 var t:String = MathUtils.getRandomArrayEntry(TESTICLE_SYNONYMS);
94 if(withModifier)
95 t = name + " " + t;
96 return t;
99 public function onFailedAttack(from:Creature, to:Creature):void{}
100 public function onGoodAttack(from:Creature, to:Creature):void{}
102 private var _weapon:IWeapon = null;
103 public function get weapon():IWeapon { return _weapon; }
105 public function tryEquip(weap:IWeapon):Boolean
107 return false;
110 public function isConcealedBy(host:Creature, clothing:Vector.<Clothing>):Boolean
112 return clothing.some(function(c_:Object, index:int, vector:Vector.<Clothing>):Boolean
114 var c:Clothing = Clothing(c_);
115 if (c != null)
116 return (c.type.obscures.indexOf(category) > -1);
117 else
118 return false;