HumanoidExtremity.ts 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /// <reference path="../../Bodypart.ts" />
  2. /// <reference path="../../Humanoid/Humanoid.ts" />
  3. /// <reference path="../SexStick.ts" />
  4. /// <reference path="../SexHole.ts" />
  5. /// <reference path="../../../Measure.ts" />
  6. class HumanoidExtremity extends Bodypart {
  7. public nailsPainted : boolean = false;
  8. public nailColor = 0;
  9. public static nailColorNames = ['none', 'red', 'pink'];
  10. public static getColor (index : number) {
  11. return HumanoidExtremity.nailColorNames[index];
  12. }
  13. public constructor (options? : ThingOptions) {
  14. super(options);
  15. this.addGetAlterations((thing) => {
  16. return {
  17. Painted : this.nailsPainted,
  18. Color : this.nailColor
  19. }
  20. });
  21. this.addSetAlterations((thing, changes) => {
  22. this.nailsPainted = changes.Painted;
  23. this.nailColor = changes.Color;
  24. });
  25. }
  26. public getSluttiness () {
  27. return this.getGenderValue();
  28. }
  29. public getGenderValue () {
  30. let nailPaintedCorrection = this.nailColor * 50; // TODO: Don't leave this as-is... there should be plenty of colors.
  31. let nailPaintedCorrectionWeight = this.nailsPainted ? 3 : 0;
  32. let gv = this.genderValue;
  33. let gw = this.genderWeight;
  34. return ((gv * gw) + (nailPaintedCorrection * nailPaintedCorrectionWeight)) / (gw + nailPaintedCorrectionWeight);
  35. }
  36. public arrangeGenderValue (gv : number) {
  37. this.genderValue = gv; // TODO: This will be extremity size/appearance. Maybe make it more detailed if interested.
  38. this.nailsPainted = gv > 60;
  39. if (this.nailsPainted) {
  40. if (gv > 70) {
  41. this.nailColor = 2;
  42. } else {
  43. this.nailColor = 1;
  44. }
  45. }
  46. (<Humanoid> this.getPartOne()).invalidateCaches();
  47. }
  48. }