1
1

AppearanceHandler.ts 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. /// <reference path="../Elements.ts" />
  2. module Elements.AppearanceHandler {
  3. var target = document.getElementById("appearanceTarget");
  4. function empty () {
  5. while (target.firstChild) {
  6. target.removeChild(target.firstChild);
  7. }
  8. }
  9. export async function print (say : Say) {
  10. await say.getHTML("p", ["appearanceDescription"]).then(value => {
  11. for (let i = 0; i < value.length; i++) {
  12. target.appendChild(value[i]);
  13. }
  14. });
  15. }
  16. export async function updateAppearance () {
  17. empty();
  18. // TODO: maybe use multiple names for "dick"
  19. let player: Humanoid = <Humanoid> WorldState.player;
  20. let playerGender = player.getGenderValue();
  21. let playerSluttiness = player.getSluttiness();
  22. // let playerTop = player.getTopClothOn(Humanoid.SLOT_BREASTS);
  23. // let playerBottom = player.getTopClothOn(Humanoid.SLOT_LEG_UPPER);
  24. // let playerShoes = player.getTopClothOn(Humanoid.SLOT_FEET);
  25. let you = new SayLink("You");
  26. you.setAction(new ActionExamine(WorldState.player, WorldState.player));
  27. let presentation = new Say(you, " are presenting as ", new SayAn(), player.getShortestDescription(), ".");
  28. if (playerSluttiness.naked) {
  29. presentation.add(" You are naked.");
  30. } else if (playerSluttiness.halfNaked) {
  31. presentation.add(" You are almost naked.");
  32. }
  33. let tits = <HumanoidBreasts> Thing.PartRelation.getRightTypeOne(player, HumanoidBreasts);
  34. let penis = <HumanoidPenis> Thing.PartRelation.getRightTypeOne(player, HumanoidPenis);
  35. let bulges = player.getBulges();
  36. if (bulges.breasts > 0 || playerGender.genderValueCorrected > 60) {
  37. let realTits = tits.getSizeText();
  38. let fakeTits = HumanoidBreasts.getSizeText(bulges.breasts);
  39. presentation.add(" You have " + realTits + " breasts");
  40. if (bulges.breasts != tits.getSize() && realTits != fakeTits) {
  41. presentation.add(", padded to appear as " + fakeTits + " through your clothing.");
  42. } else {
  43. if (!tits.isUncovered()) {
  44. presentation.add(", safely covered.")
  45. } else {
  46. presentation.add(".");
  47. }
  48. }
  49. }
  50. // presentation.add(Say.PARAGRAPH_BREAK, new SayBold("Gender Value: "), playerGender.genderValueCorrected);
  51. // presentation.add(Say.PARAGRAPH_BREAK, new SayBold("Sluttiness Value: "), playerSluttiness.sluttinessCorrected);
  52. //presentation.add(Say.PARAGRAPH_BREAK, new SayBold("Breasts: "), tits.getSizeText(), " (Visible as " + HumanoidBreasts.getSizeText(bulges.breasts) + ")");
  53. if (penis == undefined) {
  54. presentation.add(" You have ", new SayAn(), HumanoidPenis.getSizeText(bulges.crotch) + " crotch bulge visible through your clothing.");
  55. } else {
  56. let realDick = penis.getSizeText();
  57. let fakeDick = HumanoidPenis.getSizeText(bulges.crotch);
  58. presentation.add(" You have ", new SayAn(), realDick + " dick");
  59. if (penis.getActualSize() != bulges.crotch && realDick != fakeDick) {
  60. presentation.add(", which looks like it is " + fakeDick + " due to your clothing.")
  61. } else {
  62. if (!penis.isUncovered()) {
  63. presentation.add(", which is covered.");
  64. } else {
  65. presentation.add(".");
  66. }
  67. }
  68. }
  69. // if (penis == undefined) {
  70. // if (bulges.crotch > 0) {
  71. // presentation.add(Say.PARAGRAPH_BREAK, "You have ", new SayAn(), HumanoidPenis.getSizeText(bulges.crotch) + " bulge visible on your crotch.");
  72. // }
  73. // } else {
  74. // presentation.add(Say.PARAGRAPH_BREAK,
  75. // new SayBold("Dick: "),
  76. // penis.getSizeText(),
  77. // " (Visible as ",
  78. // new SayAn(),
  79. // HumanoidPenis.getSizeText(bulges.crotch),
  80. // playerGender.hasPenis ?
  81. // (penis.isFlaccid ? " flaccid" : " erect") +
  82. // (penis.getActualSize() < 9 ? " microdick" : " cock")
  83. // : " bulge",
  84. // ")"
  85. // );
  86. // }
  87. // TODO: Check if has a specific look to it. Optional. Hard to do.
  88. // Examples: "You are dressed casually like a woman.", "You are wearing formal women's clothing." etc.
  89. await print(presentation);
  90. }
  91. }