|
@@ -1,4 +1,6 @@
|
|
|
|
|
|
+declare let rand: Window["rand"];
|
|
|
+
|
|
|
const bmi_attractive_range = [18.5,30];
|
|
|
const timed_stat_changes ={ //Hourly
|
|
|
energy: {
|
|
@@ -68,12 +70,12 @@ class PlayerCharacter{
|
|
|
this.birthyear -= difference;
|
|
|
console.log("AGE set to "+v);
|
|
|
}
|
|
|
- get ageDays(){
|
|
|
+ /*get ageDays(){
|
|
|
const oneDay = 86400000;
|
|
|
let now = State.variables.time.now;
|
|
|
let bday = this.birthdayDate;
|
|
|
return Math.floor((now - bday)/oneDay);
|
|
|
- }
|
|
|
+ }*/
|
|
|
|
|
|
_visualAgeDaysOffset = 0;
|
|
|
get visualAgeDays(){return this._visualAgeDaysOffset}
|
|
@@ -107,32 +109,27 @@ class PlayerCharacter{
|
|
|
_mood = new setup.Mood();
|
|
|
|
|
|
get mood(){return this._mood.mood;}
|
|
|
- set mood(v){return (this._mood.mood = v)}
|
|
|
- get moodlets(){return this._mood.moodlets}
|
|
|
+ set mood(v){this._mood.mood = v}
|
|
|
+ //get moodlets(){return this._mood.moodlets}
|
|
|
get moodletsActive(){return this._mood.moodletsActive}
|
|
|
get moodletsActiveByGroup(){return this._mood.moodletsActiveByGroup}
|
|
|
get moodletsActiveEffect(){return this._mood.moodletsActiveEffect}
|
|
|
get moodletsActiveByGroupAccumulationApplied(){return this._mood.moodletsActiveByGroupAccumulationApplied}
|
|
|
moodletApplyById(moodletId,minutes=0){return this._mood.moodletApplyById(moodletId,minutes)}
|
|
|
- moodletCombinedData(moodletId){return this._mood.moodletCombinedData(moodletId)}
|
|
|
+ //moodletCombinedData(moodletId){return this._mood.moodletCombinedData(moodletId)}
|
|
|
moodletDeactivateById(moodletId){return this._mood.moodletDeactivateById(moodletId)}
|
|
|
moodletIncTime(moodletId,minutes,skipIncludedMoodlets=false){return this._mood.moodletIncTime(moodletId,minutes,skipIncludedMoodlets)}
|
|
|
- moodletIsActive(moodletId){return this._mood.moodletIsActive(moodletId)}
|
|
|
+ //moodletIsActive(moodletId){return this._mood.moodletIsActive(moodletId)}
|
|
|
moodletUpdate(moodletId,updateObject){return this._mood.moodletUpdate(moodletId,updateObject)}
|
|
|
#moodletsClean(){return this._mood._moodletsClean();}
|
|
|
|
|
|
- get moodletsSpecial(){return Object.assign({},this.moodletPain,this.activeEffectsMoodlets);}
|
|
|
-
|
|
|
- get moodletPain(){
|
|
|
- let painTotal = this.painTotal;
|
|
|
- if(painTotal > 0){
|
|
|
- const time = State.variables.time;
|
|
|
- let painMoodlet = this.moodletCombinedData('pain');
|
|
|
- painMoodlet.effect = Math.round(painTotal * -1);
|
|
|
- painMoodlet.expiration = time.endTime;
|
|
|
- return {'pain':painMoodlet};
|
|
|
- }
|
|
|
- return {};
|
|
|
+ get moodletsSpecial():{[key: string]: ActiveMoodlet}{
|
|
|
+ //return Object.assign({},this.moodletPain,this.activeEffectsMoodlets);
|
|
|
+ return {pain:this.moodletPain};
|
|
|
+ }
|
|
|
+
|
|
|
+ get moodletPain():ActiveMoodlet{
|
|
|
+ return PainMoodlet.createPainMoodlet(this.painTotal);
|
|
|
}
|
|
|
|
|
|
|
|
@@ -170,8 +167,8 @@ class PlayerCharacter{
|
|
|
set pcs_energy(v){
|
|
|
this._pcs_energy = Math.clamp(v,0,100);
|
|
|
|
|
|
- if(v > 0 && this._death.hunger?.stage){
|
|
|
- this._death.hunger = {stage:0};
|
|
|
+ if(v > 0 && this._death['hunger']?.stage){
|
|
|
+ this._death['hunger'] = {stage:0};
|
|
|
for(let i=1;i<=dieRisks.hunger.durations.length;i++)
|
|
|
this.moodletDeactivateById('hunger_'+i);
|
|
|
}
|
|
@@ -213,9 +210,9 @@ class PlayerCharacter{
|
|
|
_energyHistoryLengthTarget = 7;
|
|
|
get energyHistoryLengthTarget(){return this._energyHistoryLengthTarget;}
|
|
|
set energyHistoryLengthTarget(v){
|
|
|
- _energyHistoryLengthTarget = v;
|
|
|
- while(_energyHistory.length > v)
|
|
|
- _energyHistory.shift();
|
|
|
+ this._energyHistoryLengthTarget = v;
|
|
|
+ while(this._energyHistory.length > v)
|
|
|
+ this._energyHistory.shift();
|
|
|
}
|
|
|
|
|
|
dailyEnergyUpdate(){
|
|
@@ -278,8 +275,8 @@ class PlayerCharacter{
|
|
|
*/
|
|
|
this._pcs_hydra = Math.clamp(v,0,100);
|
|
|
|
|
|
- if(v > 0 && this._death.thirst?.stage){
|
|
|
- this._death.thirst = {stage:0};
|
|
|
+ if(v > 0 && this._death['thirst']?.stage){
|
|
|
+ this._death['thirst'] = {stage:0};
|
|
|
for(let i=1;i<=dieRisks.thirst.durations.length;i++)
|
|
|
this.moodletDeactivateById('thirst_'+i);
|
|
|
}
|
|
@@ -407,7 +404,7 @@ class PlayerCharacter{
|
|
|
drugVol(drugId){return this._drugs.vol(drugId)}
|
|
|
|
|
|
get alko(){return this.drugVol('alcohol')}
|
|
|
- set alko(v){return this.drugVolSet('alcohol',v)}
|
|
|
+ set alko(v){this.drugVolSet('alcohol',v)}
|
|
|
|
|
|
|
|
|
|
|
@@ -474,7 +471,7 @@ class PlayerCharacter{
|
|
|
|
|
|
genbsize = 12; // the set genetic bust size
|
|
|
nbsize = 12; // starts at a set genetic bust size, but can be adjusted down if salo drops too low
|
|
|
- get wratio(){ // waist to hips ratio set in body_shape
|
|
|
+ /*get wratio(){ // waist to hips ratio set in body_shape
|
|
|
let wrtemp = ((2 * this.healthiness + this.muscularity + this.dexterity) / 4);
|
|
|
let result = 85;
|
|
|
if(wrtemp < 11)
|
|
@@ -523,7 +520,7 @@ class PlayerCharacter{
|
|
|
else
|
|
|
return 56;
|
|
|
|
|
|
- }
|
|
|
+ }*/
|
|
|
|
|
|
_fat = 0; //the fat the character consumed recently
|
|
|
get fat(){
|
|
@@ -553,11 +550,11 @@ class PlayerCharacter{
|
|
|
|
|
|
magicf2b = 0; //magicf2b = set in body_shape for the fat moved to bust
|
|
|
|
|
|
- get pcs_hips(){return (this.pcs_hgt * this.hratio) / 100 + this.vhips;}
|
|
|
+ /*get pcs_hips(){return (this.pcs_hgt * this.hratio) / 100 + this.vhips;}
|
|
|
get pcs_waist(){return (this.pcs_hips * this.wratio) / 100 + this.vofat;}
|
|
|
get pcs_band(){return (this.pcs_waist * this.bratio) / 100 + this.vofat;}
|
|
|
get pcs_bust(){return (this.pcs_waist * this.bratio) / 100 + this.nbsize + this.magicf2b + this.silicone;}
|
|
|
- get pcs_butt(){return (this.pcs_hips / 10) + this.silicone_butt + this.butt_cheat;}
|
|
|
+ get pcs_butt(){return (this.pcs_hips / 10) + this.silicone_butt + this.butt_cheat;}*/
|
|
|
//get pcs_cupsize(){return (this.pcs_bust - this.pcs_band);}
|
|
|
|
|
|
_cupsize = 15;
|
|
@@ -703,14 +700,14 @@ class PlayerCharacter{
|
|
|
}
|
|
|
|
|
|
get bodset(){ //body image and descriptor control variable, used to indicate which image and descriptor set is in use
|
|
|
- if(this.isPregnancyAware == 1) return 3;
|
|
|
+ /*if(this.isPregnancyAware == 1) return 3;
|
|
|
if (this.muscularity >= 70) return 2;
|
|
|
- if (this.muscularity <= 40) return 0;
|
|
|
+ if (this.muscularity <= 40) return 0;*/
|
|
|
return 1;
|
|
|
}
|
|
|
|
|
|
get body(){
|
|
|
- let bodimgsets = State.variables.bodimgsets;
|
|
|
+ /*let bodimgsets = State.variables.bodimgsets;
|
|
|
if(this.isPregnancyAware){
|
|
|
if(this.PregChem > 6216)
|
|
|
return bodimgsets[(this.bodset * 10) + 8];
|
|
@@ -720,7 +717,8 @@ class PlayerCharacter{
|
|
|
}
|
|
|
if(this.salocatnow <= 7)
|
|
|
return bodimgsets[((this.bodset * 10) + this.salocatnow)];
|
|
|
- return bodimgsets[(this.bodset * 10) + 7];
|
|
|
+ return bodimgsets[(this.bodset * 10) + 7];*/
|
|
|
+ return null;
|
|
|
}
|
|
|
|
|
|
/*pcs_teeth = 0; //-1: perfectly white
|
|
@@ -756,7 +754,7 @@ class PlayerCharacter{
|
|
|
}
|
|
|
|
|
|
get teethMissingCount(){
|
|
|
- return this._teeethMissing.count();
|
|
|
+ return this._teeethMissing.length;
|
|
|
}
|
|
|
|
|
|
//pcs_breath = 0;
|
|
@@ -849,7 +847,7 @@ class PlayerCharacter{
|
|
|
bodyDailyUpdate(){
|
|
|
this.dailyEnergyUpdate();
|
|
|
|
|
|
- if(this.muscularity > this.strength)
|
|
|
+ /*if(this.muscularity > this.strength)
|
|
|
this.muscularity -= 1;
|
|
|
else if(this.muscularity < this.strength)
|
|
|
this.muscularity += 1;
|
|
@@ -862,7 +860,7 @@ class PlayerCharacter{
|
|
|
if(this.dexterity > this.agility)
|
|
|
this.dexterity -= 1;
|
|
|
else if(this.dexterity < this.agility)
|
|
|
- this.dexterity += 1;
|
|
|
+ this.dexterity += 1;*/
|
|
|
|
|
|
|
|
|
/*if(this.fat > (17 + this.healthiness / 25)){
|
|
@@ -902,9 +900,10 @@ class PlayerCharacter{
|
|
|
}*/
|
|
|
|
|
|
// Hair colour change
|
|
|
- if(this.pcs_haircol != this.nathcol){
|
|
|
+ //TODO: Dasdas
|
|
|
+ /*if(this.pcs_haircol != this.nathcol){
|
|
|
this.hairDyeFade = Math.max(this.hairDyeFade - 1 , 0);
|
|
|
- }
|
|
|
+ }*/
|
|
|
// Leg and pubes hair growth
|
|
|
this.legHair += this.legHairGrowth;
|
|
|
//Pubic hair growth at 1/2 per night
|
|
@@ -991,161 +990,6 @@ class PlayerCharacter{
|
|
|
get vitality(){return this.skillLevel('vitality');} set vitality(v){this.skillSetLevel('vitality',v);}
|
|
|
|
|
|
|
|
|
- bodyInit(){
|
|
|
- this.bodySoftReset();
|
|
|
- /*<<set $normbuffpick = - 1>> <<set $gmstrtflag = 1>>
|
|
|
- <<set $salocatlast = $salocatnow>>
|
|
|
- <<set $normbuffpick = 0>> <<set $magf2bdo = 0>>
|
|
|
- <<set $gmstrtflag to null>>
|
|
|
- <<set $newbdsp = 1>>*/
|
|
|
- }
|
|
|
-
|
|
|
- bodySaloCalc(){
|
|
|
- this.bodySaloCalcBreast();
|
|
|
-
|
|
|
- /*<!-- !!This is if a Succubus has salo < 1-->
|
|
|
- if(this.succubusflag") == 1 and this.salo < 1>>
|
|
|
- <<set $sucexcess -= 1>>
|
|
|
- <<set $salo += 3>>
|
|
|
- <</if>>*/
|
|
|
-
|
|
|
-
|
|
|
- //<!-- !!This is if salo is still < 1-->
|
|
|
- if(this.salo < 1){
|
|
|
- if(this.fat >= 1){
|
|
|
- this.salo = 1;
|
|
|
- this.fat -= 1;
|
|
|
- }
|
|
|
- else if(this.fat <= 0 && this.strength + this.vitality > 0){
|
|
|
- this.skillExperienceGain('strength',-1000);
|
|
|
- this.skillExperienceGain('vitality',-1000);
|
|
|
- this.salo = 1;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- //TODO: GameOver
|
|
|
- /*
|
|
|
- if(this.Enable_nogameover") == 0>>
|
|
|
- <<set $over = 3>>
|
|
|
- <<gt 'gameover'>>
|
|
|
- $exit
|
|
|
- <<else>>
|
|
|
- <font color="red"><B>You starved to death</B><font>
|
|
|
- <<set $salo = 1>>
|
|
|
- <</if>>
|
|
|
- */
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- this.vhtmp = (this.salo - 80) / 2;
|
|
|
- if(this.vhips > this.vhtmp)
|
|
|
- this.vhips -= 1
|
|
|
- if(this.vhips < this.vhtmp)
|
|
|
- this.vhips += 1
|
|
|
-
|
|
|
- if((this.pcs_hgt * this.hratio) / 100 + this.vhips > (this.pcs_hgt * 72) / 100){
|
|
|
- this.vofat = ((this.pcs_hgt * this.hratio) / 100 + this.vhips - (this.pcs_hgt * 72) / 100) / 2;
|
|
|
- this.vhips -= this.vofat * 2;
|
|
|
- }
|
|
|
- //<!-- !!This will trigger the warning notices in the bathing code (the +/- 12 should always be +/- 11 + the max change to salo w/ fat)-->
|
|
|
- if(this.salolast > this.salo && this.salo <= 12 + (20 * (this.salocatnow - 1)))
|
|
|
- State.variables.btwarn = 1;
|
|
|
- else if(this.salolast < this.salo && this.salo >= (20 * (this.salocatnow + 1)) - 12)
|
|
|
- State.variables.btwarn = 2;
|
|
|
-
|
|
|
- //<!-- !!This will trigger the dream for the option to use magic to increase bust-->
|
|
|
- //<!-- !!Three nos at the dream will lock it out (1 yes resets the count)-->
|
|
|
- /*if(this.pcs_magik >= 5 and this.MagikDostup") == 0 and this.magf2bdo") == 0>>
|
|
|
- <<if $salolast < $salo and $salo >= (20 * (salocatnow + 1)) - 11 and this.tits < 10>>
|
|
|
- if(this.mgf2bnocnt < 3>>
|
|
|
- <<set $magf2bdo = 2>>
|
|
|
- <<else>>
|
|
|
- <<set $magf2bdo = 3>>
|
|
|
- <</if>>
|
|
|
- <</if>>
|
|
|
- <</if>>*/
|
|
|
- //<!-- !!This is to deal with the possibility that salocatnow changed by more than 1 (fat burners, vitamins, plastic surgery, etc.)-->
|
|
|
-
|
|
|
- if(this.salocatlast > this.salocatnow)
|
|
|
- this.salocatlast -= 1
|
|
|
- if(this.salocatlast < this.salocatnow)
|
|
|
- this.salocatlast += 1
|
|
|
-
|
|
|
-
|
|
|
- //<!-- !!This is for use in the warning code and as part of the reset routines-->
|
|
|
- if(this.salolast > this.salo)
|
|
|
- this.salolast -= 1
|
|
|
- if(this.salolast < this.salo)
|
|
|
- this.salolast += 1
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- bodySaloCalcBreastPre(){
|
|
|
- if(this.salo < 10)
|
|
|
- this.salocatnow = 0
|
|
|
- else
|
|
|
- this.salocatnow = 1 + (this.salo - 10) / 20
|
|
|
- }
|
|
|
-
|
|
|
- bodySaloCalcBreast(){
|
|
|
- this.bodySaloCalcBreastPre();
|
|
|
-
|
|
|
- //This controls the movement of salo to/from bust in order of precedence
|
|
|
-
|
|
|
- if(this.nbsize < this.genbsize && this.salocatnow > 2){
|
|
|
-
|
|
|
- //if sftrstflag = 0:'<b>Your breasts seem fuller.</b>'
|
|
|
- this.nbsize += 1;
|
|
|
- this.salo -= 3;
|
|
|
- this.bodySaloCalcBreastPre();
|
|
|
- }
|
|
|
-
|
|
|
- if(this.magf2bdo == 1 && this.salocatnow > this.salocatlast && this.pcs_mana >= this.manamax / 2 && this.magikDostup == 0){
|
|
|
- //if sftrstflag = 0:'<b>Your breasts seem fuller.</b>'
|
|
|
- //this.magicf2b += 1
|
|
|
- this.salo -= 3
|
|
|
- /*if magicf2b >= 2 + magtarcup * 5: magf2bdo = 0
|
|
|
- if pcs_magik < 20:
|
|
|
- pcs_mana -= 2000 / pcs_magik
|
|
|
- else
|
|
|
- mana -= 100
|
|
|
- end*/
|
|
|
- this.bodySaloCalcBreastPre();
|
|
|
- }
|
|
|
-
|
|
|
- if(this.salocatnow < 2 && this.salocatlast >= 2 && this.magicf2b > 0 && this.magikDostup == 0){
|
|
|
- //if sftrstflag = 0:'<b>Your breasts seem to be getting smaller.</b>'
|
|
|
- //magicf2b -= 1
|
|
|
- this.salo += 3
|
|
|
- //magf2bdo = 1
|
|
|
- this.bodySaloCalcBreastPre();
|
|
|
- }
|
|
|
-
|
|
|
- if(this.salocatnow < 1 && this.salocatlast >= 1 && this.nbsize > 0){
|
|
|
- //if sftrstflag = 0:'<b>Your breasts seem to be getting smaller.</b>'
|
|
|
- this.nbsize -= 1
|
|
|
- this.salo += 3
|
|
|
- this.bodySaloCalcBreastPre();
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- vhips = 50; //derived from salo in body_shape
|
|
|
- vhtmp = 50; //slows the change to vhips in body_shape
|
|
|
-
|
|
|
-
|
|
|
- bodySoftReset(){
|
|
|
- this.fat = 0;
|
|
|
- this.vhips = (this.salo - 80) / 2;
|
|
|
- let i = 0;
|
|
|
- while(this.salo != this.salolast && i++ < 1000){
|
|
|
- this.bodySaloCalc();
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
// ---- Appearance ------
|
|
|
get pcs_makeup(){
|
|
|
/*if(this.cosmetic_tattoo > 0)
|
|
@@ -1180,260 +1024,13 @@ class PlayerCharacter{
|
|
|
cosmetic_tattoo = 0;
|
|
|
|
|
|
get appearance(){
|
|
|
- return func('Appearance','appearance');
|
|
|
+ return setup.func('Appearance','appearance');
|
|
|
}
|
|
|
|
|
|
get hotcat(){
|
|
|
return this.appearance.hotcat.temp;
|
|
|
}
|
|
|
|
|
|
- faceGeneticAttractiveness = 0;
|
|
|
- faceSurgeries = 0;
|
|
|
- get faceAttractiveness(){
|
|
|
- return Math.clamp(this.faceGeneticAttractiveness+this.faceSurgeries,-3,3);
|
|
|
- }
|
|
|
-
|
|
|
- get appearance_accessoriesBonus(){
|
|
|
- let wardrobe = State.variables.wardrobe;
|
|
|
-
|
|
|
- let coatQualityBonus = wardrobe.coat_appearanceBonus;
|
|
|
- let shoesQualityBonus = wardrobe.shoes_appearanceBonus;
|
|
|
-
|
|
|
- let braBonus = wardrobe.bra_appearanceBonus;
|
|
|
- let pantyBonus = wardrobe.panties_appearanceBonus;
|
|
|
-
|
|
|
- return coatQualityBonus + shoesQualityBonus + pantyBonus + braBonus;
|
|
|
- }
|
|
|
-
|
|
|
- get appearance_clothingBonus(){
|
|
|
- let wardrobe = State.variables.wardrobe;
|
|
|
- let tempRevealing = 0;
|
|
|
- if(wardrobe.clothingIsNude){
|
|
|
- if (this.bmi_is_attractive)
|
|
|
- tempRevealing = 405;
|
|
|
- }else{
|
|
|
- if(this.bmi < bmi_attractive_range[0])
|
|
|
- tempRevealing = ((400 - wardrobe.PXCloThinness) + (500 - wardrobe.PXCloTopCut) + (400 - wardrobe.PXCloBottomShortness)) / 2;
|
|
|
- else if(this.bmi_is_attractive)
|
|
|
- tempRevealing = (wardrobe.PXCloThinness + wardrobe.PXCloTopCut + wardrobe.PXCloBottomShortness) / 2;
|
|
|
- else
|
|
|
- tempRevealing = ((400 - wardrobe.PXCloThinness) + (500 - wardrobe.PXCloTopCut) + (400 - wardrobe.PXCloBottomShortness)) * 3 / 4;
|
|
|
- }
|
|
|
- return tempRevealing / 76 * wardrobe.PCloQuality;
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- get appearance_groomingBonus(){
|
|
|
- let makeupBonus = (this.skillLevel('makeup') / 5) - 5;
|
|
|
- if(this.pcs_makeup == 0)
|
|
|
- makeupBonus = -5;
|
|
|
-
|
|
|
- if(this.pcs_makeup == 1)
|
|
|
- makeupBonus = 0;
|
|
|
-
|
|
|
- if(this.pcs_makeup == 5)
|
|
|
- makeupBonus = 30;
|
|
|
-
|
|
|
- let breathBonus = this.pcs_breath * 5;
|
|
|
- let tempGroomingBonus = makeupBonus + breathBonus;
|
|
|
-
|
|
|
- return this.appearanceAdjustFromBMI(tempGroomingBonus);
|
|
|
- }
|
|
|
-
|
|
|
- glass = 0;
|
|
|
-
|
|
|
- get appearance_groomingPenalty(){
|
|
|
- let lipBalmPenalty = 0;
|
|
|
- if(this.pcs_lipbalm > 0)
|
|
|
- lipBalmPenalty = 0
|
|
|
- else
|
|
|
- lipBalmPenalty = 5
|
|
|
-
|
|
|
-
|
|
|
- let hairPenalty = (1 - this.pcs_hairbsh) * 10;
|
|
|
-
|
|
|
- let buzzCutPenalty = 0;
|
|
|
- if(this.pcs_hairlng < 10)
|
|
|
- buzzCutPenalty = 10
|
|
|
-
|
|
|
-
|
|
|
- //Small penalty for not wearing deodorant, if pcs_sweat is low enough
|
|
|
- let deodorantPenalty = 0;
|
|
|
- if(this.deodorant_on == 0 || this.pcs_sweat >= 20)
|
|
|
- deodorantPenalty = 5
|
|
|
-
|
|
|
- let sweatPenalty = 0;
|
|
|
- if(this.pcs_sweat < 22)
|
|
|
- sweatPenalty = 0
|
|
|
- else if(this.pcs_sweat < 38)
|
|
|
- sweatPenalty = (this.pcs_sweat - 10) / 4
|
|
|
- else if(this.pcs_sweat < 54)
|
|
|
- sweatPenalty = (this.pcs_sweat - 10) / 2
|
|
|
- else
|
|
|
- sweatPenalty = 3 * (this.pcs_sweat - 10) / 4
|
|
|
-
|
|
|
-
|
|
|
- //Glasses Penalty
|
|
|
- let glassesPenalty = 0
|
|
|
- if(this.glass == 1)
|
|
|
- glassesPenalty = 10
|
|
|
-
|
|
|
- let hairDyePenalty = 0;
|
|
|
- //hair color fade penalty
|
|
|
- /*if pcs_haircol ! nathcol:
|
|
|
- if dyefade > 0 and dyefade < 7: hairDyePenalty = 5
|
|
|
- if dyefade = 0: hairDyePenalty = 15
|
|
|
- end*/
|
|
|
- console.info("Hair-fading deactivated in appearance_groomingPenalty");
|
|
|
-
|
|
|
- //Leg hair penalty
|
|
|
- let legPenalty = 0;
|
|
|
- if(this.pcs_leghair <= 0)
|
|
|
- legPenalty = 0
|
|
|
- else if(this.pcs_leghair <= 3)
|
|
|
- legPenalty = 3
|
|
|
- else if(this.pcs_leghair <= 5)
|
|
|
- legPenalty = 6
|
|
|
- else
|
|
|
- legPenalty = 9
|
|
|
-
|
|
|
- return sweatPenalty + glassesPenalty + hairDyePenalty + buzzCutPenalty + legPenalty + lipBalmPenalty + hairPenalty + deodorantPenalty;
|
|
|
- }
|
|
|
-
|
|
|
- get pcs_apprnc(){
|
|
|
- return Math.clamp(this.pcs_apprncbase + this.appearance_clothingBonus + this.appearance_accessoriesBonus + this.appearance_groomingBonus - this.appearance_groomingPenalty,0,200);
|
|
|
- }
|
|
|
-
|
|
|
- get pcs_apprncbase(){
|
|
|
- return this.skinBonus + this.bodyShapeBonus + this.attributeBonus - this.visibleAgePenalty - this.teethPenalty; //+ $supnatvnesh;
|
|
|
- }
|
|
|
-
|
|
|
- get attributeBonus(){
|
|
|
- return this.appearanceAdjustFromBMI((this.agility / 5) + (this.vitality / 5));
|
|
|
- }
|
|
|
-
|
|
|
- get bodyShapeBonus(){
|
|
|
- /*<<if getvar("$dounspell") == 1>>
|
|
|
- <<set $pc.bodytipe = $pc.pcs_hips - $pc.pcs_waist>>
|
|
|
- <<if getvar("$pc.bodytipe") < 20>>
|
|
|
- <<set $result = 0>>
|
|
|
- <<else if getvar("$pc.bodytipe") >= 20 and getvar("$pc.bodytipe") < 25>>
|
|
|
- <<set $result = 2>>
|
|
|
- <<else if (getvar("$pc.bodytipe") >= 25 and getvar("$pc.bodytipe") < 30) or getvar("$pc.bodytipe") >= 35>>
|
|
|
- <<set $result = 4>>
|
|
|
- <<else if getvar("$pc.bodytipe") >= 30 and getvar("$pc.bodytipe") < 35>>
|
|
|
- <<set $result = 8>>
|
|
|
- <</if>>
|
|
|
- <!-- !!Setting the pcs_apprnc bonus based on fat and strength-->
|
|
|
- <<else>>*/
|
|
|
- let tempBodyShapeBonus = 0;
|
|
|
- if(this.bmi < 16){
|
|
|
- // severely underweight
|
|
|
- tempBodyShapeBonus = -10
|
|
|
- }else if(this.bmi < 19){
|
|
|
- //!! underweight
|
|
|
- tempBodyShapeBonus = 25
|
|
|
- }else if(this.bmi < 25){
|
|
|
- //!! healthy weight
|
|
|
- tempBodyShapeBonus = 50
|
|
|
- }else if(this.bmi < 30){
|
|
|
- //!! overweight
|
|
|
- tempBodyShapeBonus = 25
|
|
|
- }else if(this.bmi < 35){
|
|
|
- //!! moderately obese
|
|
|
- tempBodyShapeBonus = 10
|
|
|
- }else if(this.bmi < 40){
|
|
|
- //!! severely obese
|
|
|
- tempBodyShapeBonus = -15
|
|
|
- }else if(this.bmi < 45){
|
|
|
- //!! very severely obese
|
|
|
- tempBodyShapeBonus = -40
|
|
|
- }else{
|
|
|
- //!! morbidly obese
|
|
|
- tempBodyShapeBonus = -80
|
|
|
- }
|
|
|
-
|
|
|
- /*if succubusflag = 1:
|
|
|
- tempBodyShapeBonus += 10
|
|
|
- else*/
|
|
|
- if(this.muscularity > 180)
|
|
|
- tempBodyShapeBonus -= 70
|
|
|
- else if(this.muscularity > 160)
|
|
|
- tempBodyShapeBonus -= 50
|
|
|
- else if(this.muscularity > 140)
|
|
|
- tempBodyShapeBonus -= 30
|
|
|
- else if(this.muscularity <= 5 || this.muscularity > 120)
|
|
|
- tempBodyShapeBonus -= 20
|
|
|
- else if(this.muscularity <= 10 || this.muscularity > 100)
|
|
|
- tempBodyShapeBonus -= 15
|
|
|
- else if(this.muscularity <= 15 || this.muscularity > 95)
|
|
|
- tempBodyShapeBonus -= 10
|
|
|
- else if(this.muscularity <= 25 || this.muscularity > 85)
|
|
|
- tempBodyShapeBonus -= 5
|
|
|
- else if(this.muscularity <= 35 || this.muscularity > 75)
|
|
|
- tempBodyShapeBonus += 0
|
|
|
- else if(this.muscularity <= 45 || this.muscularity > 60)
|
|
|
- tempBodyShapeBonus += 5
|
|
|
- else
|
|
|
- tempBodyShapeBonus += 10
|
|
|
-
|
|
|
- //end
|
|
|
-
|
|
|
- //!!This modifies bodykoef for high or low salo values
|
|
|
- if(this.salocatnow == 0 || this.salocatnow >= 7)
|
|
|
- tempBodyShapeBonus -= 8
|
|
|
- else if(this.salocatnow = 1 || this.salocatnow == 6)
|
|
|
- tempBodyShapeBonus -= 4
|
|
|
-
|
|
|
- if (this.vofat > 0)
|
|
|
- tempBodyShapeBonus -= this.vofat
|
|
|
-
|
|
|
- return tempBodyShapeBonus;
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- get teethPenalty(){
|
|
|
- let tempAttributePenalty = 0;
|
|
|
- if (this.pcs_teeth > 0)
|
|
|
- tempAttributePenalty = 10 * this.pcs_teeth;
|
|
|
- else if(this.pcs_teeth == 0)
|
|
|
- tempAttributePenalty = 5
|
|
|
-
|
|
|
- if(this.pcs_missing_teeth > 0)
|
|
|
- tempAttributePenalty += 10 * this.pcs_missing_teeth;
|
|
|
-
|
|
|
-
|
|
|
- return this.appearanceAdjustFromBMI(tempAttributePenalty);
|
|
|
- }
|
|
|
-
|
|
|
- get visibleAgePenalty(){
|
|
|
- let tempAttributePenalty = 0;
|
|
|
- if (this.vidage < 20)
|
|
|
- tempAttributePenalty = Math.round(5 * (20 - this.vidage) / 2);
|
|
|
- else
|
|
|
- tempAttributePenalty = 0;
|
|
|
- return this.appearanceAdjustFromBMI(tempAttributePenalty);
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- appearanceAdjustFromBMI(a){
|
|
|
- let bmi = this.bmi;
|
|
|
- if(bmi < 16) // severely underweight
|
|
|
- return a * 0.5;
|
|
|
- if(bmi < 19) // underweight
|
|
|
- return a * 0.95;
|
|
|
- if(bmi < 25) // healthy
|
|
|
- return a;
|
|
|
- if(bmi < 30) // overweight
|
|
|
- return a * 0.95;
|
|
|
- if(bmi < 35) // moderately obese
|
|
|
- return a * 0.8;
|
|
|
- if(bmi < 40) // severely obese
|
|
|
- return a * 0.55;
|
|
|
- if(bmi < 45) // very severely obese
|
|
|
- return a * 0.5;
|
|
|
- return a * 0.4; //morbidly obese
|
|
|
- }
|
|
|
|
|
|
// ----- Toys -----
|
|
|
analplugin = 0;
|
|
@@ -1445,7 +1042,7 @@ class PlayerCharacter{
|
|
|
return this.skillLevel('intelligence');
|
|
|
}
|
|
|
|
|
|
- _skills = {
|
|
|
+ _skills:{[key: string]:any} = {
|
|
|
}
|
|
|
|
|
|
get skillsAll(){
|
|
@@ -1523,7 +1120,7 @@ class PlayerCharacter{
|
|
|
console.log("Skill Experience Gain:",skillId,inc,this._skills[skillId].experience );
|
|
|
}
|
|
|
|
|
|
- skillsExperienceGain(skillObj,factor=1){
|
|
|
+ skillsExperienceGain(skillObj:{[key: string]:number},factor=1){
|
|
|
for(const [skillId,inc] of Object.entries(skillObj)){
|
|
|
this.skillExperienceGain(skillId,inc*factor)
|
|
|
}
|
|
@@ -1691,7 +1288,7 @@ class PlayerCharacter{
|
|
|
|
|
|
switch(key){
|
|
|
case 'vaginal_total':
|
|
|
- return (this.stat('vaginal',awareness) + this.stat('vaginal_fist',awareness) + this.stat('vaginal_dildo',awareness) + this.stat('vaginal_strap',awareness));
|
|
|
+ return 0;//return (this.stat('vaginal',awareness) + this.stat('vaginal_fist',awareness) + this.stat('vaginal_dildo',awareness) + this.stat('vaginal_strap',awareness));
|
|
|
}
|
|
|
|
|
|
if(!(key in this._sexStats))
|
|
@@ -1909,7 +1506,7 @@ class PlayerCharacter{
|
|
|
17 = 'In a condom in your vagina
|
|
|
*/
|
|
|
|
|
|
- _cum = {};
|
|
|
+ _cum:{ [key: string]: Array<any>} = {};
|
|
|
|
|
|
get cums(){
|
|
|
this._cumPurgeExpired();
|
|
@@ -1960,7 +1557,7 @@ class PlayerCharacter{
|
|
|
|
|
|
cumCleanByActivity(activityId){
|
|
|
const bodyparts = Object.entries(setup.getBodyparts());
|
|
|
- const bodypartIdsToClean = bodyparts.filter(([id,bodypart]) => bodypart.clean.includes(activityId)).map(([id,bodypart]) => id);
|
|
|
+ const bodypartIdsToClean = bodyparts.filter(([id,bodypart]) => bodypart['clean'].includes(activityId)).map(([id,bodypart]) => id);
|
|
|
for(let bodypartIdToClean of bodypartIdsToClean)
|
|
|
this._cum[bodypartIdToClean] = [];
|
|
|
}
|
|
@@ -2148,7 +1745,7 @@ class PlayerCharacter{
|
|
|
get painRaw(){return this._pain.painRaw}
|
|
|
painInc(bodypart,v){return this._pain.painInc(bodypart,v)}
|
|
|
painIncAll(v){return this._pain.painIncAll(v)}
|
|
|
- get painRelief(){return this._pain.painRelief}
|
|
|
+ //get painRelief(){return this._pain.painRelief}
|
|
|
painSet(bodypart,v){return this._pain.painSet(bodypart,v)}
|
|
|
get painTotal(){return this._pain.painTotal}
|
|
|
|
|
@@ -2315,28 +1912,37 @@ class PlayerCharacter{
|
|
|
|
|
|
|
|
|
// ----- Effects -----
|
|
|
- _effects = {};
|
|
|
+ _effects:{ [key: string]: any } = {};
|
|
|
|
|
|
- get activeEffects(){
|
|
|
+ get activeEffects():{[key: string]:any}{
|
|
|
let result = {};
|
|
|
const time = State.variables.time;
|
|
|
|
|
|
for(const [effectid,effectData] of Object.entries(this._effects)){
|
|
|
if(effectData.expiration === undefined)
|
|
|
continue;
|
|
|
- if(this._effects[effectId] === null || time.isFuture(this._effects[effectId]))
|
|
|
+ if(this._effects[effectid] === null || time.isFuture(this._effects[effectid]))
|
|
|
result[effectid] = effectData;
|
|
|
}
|
|
|
result = Object.assign({},this.drugsActiveEffects,result);
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
- get activeEffectsMoodlets(){
|
|
|
+ get activeEffectsMoodlets():{ [key: string]: ActiveMoodlet; }{
|
|
|
const time = State.variables.time;
|
|
|
- return Object.fromEntries(this.activeEffectsMoodletIDs.map((moodletId) => [moodletId,Object.assign({expiration: time.endTime},setup.getMoodlet(moodletId))]));
|
|
|
+ return Object.fromEntries(
|
|
|
+ this.activeEffectsMoodletIDs.map(
|
|
|
+ (moodletId) =>
|
|
|
+ [
|
|
|
+ moodletId,
|
|
|
+ ActiveMoodlet.create(moodletId, {expiration: time.endTime})
|
|
|
+ ]
|
|
|
+ )
|
|
|
+ );
|
|
|
+
|
|
|
}
|
|
|
|
|
|
- get activeEffectsMoodletIDs(){
|
|
|
+ get activeEffectsMoodletIDs():Array<string>{
|
|
|
var result = [];
|
|
|
const activeEffects = this.activeEffects;
|
|
|
for(const activeEffect of Object.values(activeEffects)){
|
|
@@ -2444,6 +2050,8 @@ class PlayerCharacter{
|
|
|
|
|
|
|
|
|
// ----- Dying -----
|
|
|
+ //TODO
|
|
|
+ /*
|
|
|
for (const [riskId, riskData] of Object.entries(dieRisks)){
|
|
|
this._death[riskId] ??= {stage:0};
|
|
|
if(this[riskData['variable']] == 0){
|
|
@@ -2458,7 +2066,7 @@ class PlayerCharacter{
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
+ }*/
|
|
|
|
|
|
}
|
|
|
|
|
@@ -2692,7 +2300,7 @@ class PlayerCharacter{
|
|
|
get cycleLength(){return this._cycleLength;} // the length of the current cycle
|
|
|
set cycleLength(v){this._cycleLength = v;}
|
|
|
get cycleLengthLast(){return this._cycleLengthLast;}
|
|
|
- set cycleLengthLast(v){return this._cycleLengthLast = v;}
|
|
|
+ set cycleLengthLast(v){this._cycleLengthLast = v;}
|
|
|
get cycleStart(){return this._cycleStart;} // the daystart of the current cycle
|
|
|
set cycleStart(v){this._cycleStart = v;}
|
|
|
cycleStartMessageSent = true;
|
|
@@ -2844,4 +2452,4 @@ class PlayerCharacter{
|
|
|
};
|
|
|
}
|
|
|
|
|
|
-window.PlayerCharacter = PlayerCharacter;
|
|
|
+setup.PlayerCharacter = PlayerCharacter;
|