HumanoidSkin.ts 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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 HumanoidSkin extends Bodypart {
  7. public sorenessWeight = 0;
  8. public genderWeight = Bodypart.WEIGHT_MEDIUM;
  9. public slots : Array<number> = [
  10. Humanoid.SLOT_FACE, Humanoid.SLOT_NECK, Humanoid.SLOT_SHOULDERS,
  11. Humanoid.SLOT_ARMS, Humanoid.SLOT_HANDS, Humanoid.SLOT_UPPER_CHEST,
  12. Humanoid.SLOT_MIDRIFF, Humanoid.SLOT_WAIST, Humanoid.SLOT_BACK,
  13. Humanoid.SLOT_HIPS, Humanoid.SLOT_BUTT, Humanoid.SLOT_LEG_UPPER,
  14. Humanoid.SLOT_LEG_LOWER
  15. ];
  16. public skinSoftness = 5; // 0 to 10, 0 being rough and 10 being silky
  17. public skinHairiness = 2; // 0 to 10, 10 being literal gorilla and 0 being smooth everywhere, 1~2 probably some armpit or something
  18. public constructor (options? : ThingOptions) {
  19. super(options);
  20. this.addGetAlterations((thing) => {
  21. return {
  22. Softness : this.skinSoftness,
  23. Hairiness : this.skinHairiness
  24. }
  25. });
  26. this.addSetAlterations((thing, changes) => {
  27. this.skinSoftness = changes.Softness;
  28. this.skinHairiness = changes.Hairiness;
  29. });
  30. }
  31. public getSluttiness () {
  32. return this.getGenderValue();
  33. }
  34. public getDescription () {
  35. let owner = <Person> this.getPartOne();
  36. let green = (owner.getStat(Attributes.Corruption) > 50);
  37. let say = new Say("Your skin is ");
  38. if (this.skinSoftness > 7) {
  39. say.add("perfectly smooth");
  40. } else if (this.skinSoftness > 4) {
  41. say.add("smooth");
  42. } else {
  43. say.add("rough");
  44. }
  45. say.add(" and ");
  46. if (this.skinHairiness > 8) {
  47. say.add("hairy, like a gorilla's")
  48. } else if (this.skinHairiness > 6) {
  49. say.add("hairy")
  50. } else if (this.skinHairiness > 3) {
  51. say.add("somewhat hairless");
  52. } else {
  53. say.add("completely hairless");
  54. }
  55. say.add(".");
  56. if (green) {
  57. say.add(" The taint of your corruption has turned your skin green, like an orc's.")
  58. }
  59. return say;
  60. }
  61. public getGenderValue () {
  62. let softnessRank = this.skinSoftness * 100;
  63. let hairinessRank = 1000 - (this.skinHairiness * 100);
  64. return (softnessRank + hairinessRank) / 20;
  65. }
  66. public arrangeGenderValue (genderValue : number) {
  67. let ideal = genderValue / 10;
  68. this.skinHairiness= 10 - Math.round(ideal);
  69. this.skinSoftness = Math.round(ideal);
  70. (<Humanoid> this.getPartOne()).invalidateCaches();
  71. }
  72. }