Advertisement
Guest User

NetHack reasonable foocubi patch

a guest
Apr 20th, 2020
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 11.97 KB | None | 0 0
  1. diff --git c/include/mondata.h i/include/mondata.h
  2. index 155ebfa..e815140 100644
  3. --- c/include/mondata.h
  4. +++ i/include/mondata.h
  5. @@ -197,6 +197,10 @@
  6.  
  7.  #define is_vampire(ptr) ((ptr)->mlet == S_VAMPIRE)
  8.  
  9. +/* does not include nymphs; only those who will perform services */
  10. +#define is_seducer(ptr) \
  11. +    ((ptr) == &mons[PM_SUCCUBUS] || (ptr) == &mons[PM_INCUBUS])
  12. +
  13.  #define hates_light(ptr) ((ptr) == &mons[PM_GREMLIN])
  14.  
  15.  /* used to vary a few messages */
  16. diff --git c/src/apply.c i/src/apply.c
  17. index e77984d..2565d67 100644
  18. --- c/src/apply.c
  19. +++ i/src/apply.c
  20. @@ -960,8 +960,7 @@ struct obj *obj;
  21.          if (vis)
  22.              pline("%s confuses itself!", Monnam(mtmp));
  23.          mtmp->mconf = 1;
  24. -    } else if (monable && (mlet == S_NYMPH || mtmp->data == &mons[PM_SUCCUBUS]
  25. -                           || mtmp->data == &mons[PM_INCUBUS])) {
  26. +    } else if (monable && (mlet == S_NYMPH || is_seducer(mtmp->data))) {
  27.          if (vis) {
  28.              char buf[BUFSZ]; /* "She" or "He" */
  29.  
  30. @@ -969,11 +968,15 @@ struct obj *obj;
  31.                    mirror);
  32.              pline("%s takes it!", upstart(strcpy(buf, mhe(mtmp))));
  33.          } else
  34. -            pline("It steals your %s!", mirror);
  35. +            pline("It takes your %s!", mirror);
  36.          setnotworn(obj); /* in case mirror was wielded */
  37.          freeinv(obj);
  38.          (void) mpickobj(mtmp, obj);
  39. -        if (!tele_restrict(mtmp))
  40. +        if (mlet != S_NYMPH && !mtmp->mpeaceful && rn2(3)) {
  41. +            pline("%s thanks you for the gift!", Monnam(mtmp));
  42. +            mtmp->mpeaceful = TRUE;
  43. +            set_malign(mtmp);
  44. +        } else if (!tele_restrict(mtmp))
  45.              (void) rloc(mtmp, TRUE);
  46.      } else if (!is_unicorn(mtmp->data) && !humanoid(mtmp->data)
  47.                 && (!mtmp->minvis || perceives(mtmp->data)) && rn2(5)) {
  48. diff --git c/src/attrib.c i/src/attrib.c
  49. index 028eebf..7df8d62 100644
  50. --- c/src/attrib.c
  51. +++ i/src/attrib.c
  52. @@ -1049,8 +1049,7 @@ int x;
  53.  #endif
  54.      } else if (x == A_CHA) {
  55.          if (tmp < 18
  56. -            && (youmonst.data->mlet == S_NYMPH || u.umonnum == PM_SUCCUBUS
  57. -                || u.umonnum == PM_INCUBUS))
  58. +            && (youmonst.data->mlet == S_NYMPH || is_seducer(youmonst.data)))
  59.              return (schar) 18;
  60.      } else if (x == A_CON) {
  61.          if (uwep && uwep->oartifact == ART_OGRESMASHER)
  62. diff --git c/src/dokick.c i/src/dokick.c
  63. index d9e275f..f903a0e 100644
  64. --- c/src/dokick.c
  65. +++ i/src/dokick.c
  66. @@ -293,7 +293,8 @@ register struct obj *gold;
  67.      boolean msg_given = FALSE;
  68.  
  69.      if (!likes_gold(mtmp->data) && !mtmp->isshk && !mtmp->ispriest
  70. -        && !mtmp->isgd && !is_mercenary(mtmp->data)) {
  71. +        && !mtmp->isgd && !is_mercenary(mtmp->data)
  72. +        && !is_seducer(mtmp->data)) {
  73.          wakeup(mtmp, TRUE);
  74.      } else if (!mtmp->mcanmove) {
  75.          /* too light to do real damage */
  76. @@ -379,6 +380,14 @@ register struct obj *gold;
  77.                  verbalize("That should do.  Now beat it!");
  78.              else
  79.                  verbalize("That's not enough, coward!");
  80. +        } else if (is_seducer(mtmp->data)) {
  81. +            if (value < rnz(300)) /* arbitrary */
  82. +                verbalize("Fie!  I've had Convicts who paid more!");
  83. +            else {
  84. +                mtmp->mpeaceful = TRUE;
  85. +                set_malign(mtmp);
  86. +                verbalize("Impressive!  Let's get down to business, then.");
  87. +            }
  88.          }
  89.          return TRUE;
  90.      }
  91. diff --git c/src/makemon.c i/src/makemon.c
  92. index 3145ad6..a2900eb 100644
  93. --- c/src/makemon.c
  94. +++ i/src/makemon.c
  95. @@ -1332,6 +1332,15 @@ int mmflags;
  96.          if (uwep && uwep->oartifact == ART_EXCALIBUR)
  97.              mtmp->mpeaceful = mtmp->mtame = FALSE;
  98.      }
  99. +    if (is_seducer(ptr)) {
  100. +        /* Let them be more amiable to potential customers. */
  101. +        int reqmoney;
  102. +        if (sgn(ptr->maligntyp) == u.ualign.type)
  103. +            reqmoney = rnz(1000);
  104. +        else
  105. +            reqmoney = rnz(1500);
  106. +        mtmp->mpeaceful = (money_cnt(invent) >= reqmoney);
  107. +    }
  108.  #ifndef DCC30_BUG
  109.      if (mndx == PM_LONG_WORM && (mtmp->wormno = get_wormno()) != 0)
  110.  #else
  111. diff --git c/src/mhitu.c i/src/mhitu.c
  112. index 849ddb1..e076d6f 100644
  113. --- c/src/mhitu.c
  114. +++ i/src/mhitu.c
  115. @@ -270,15 +270,12 @@ struct attack *alt_attk_buf;
  116.  
  117.      /* honor SEDUCE=0 */
  118.      if (!SYSOPT_SEDUCE) {
  119. -        extern const struct attack sa_no[NATTK];
  120. -
  121.          /* if the first attack is for SSEX damage, all six attacks will be
  122.             substituted (expected succubus/incubus handling); if it isn't
  123.             but another one is, only that other one will be substituted */
  124. -        if (mptr->mattk[0].adtyp == AD_SSEX) {
  125. -            *alt_attk_buf = sa_no[indx];
  126. -            attk = alt_attk_buf;
  127. -        } else if (attk->adtyp == AD_SSEX) {
  128. +        /* foocubi always have AD_DRLI attacks now, so only second option
  129. +         * remains... and even it isn't relevant for vanilla */
  130. +        if (attk->adtyp == AD_SSEX) {
  131.              *alt_attk_buf = *attk;
  132.              attk = alt_attk_buf;
  133.              attk->adtyp = AD_DRLI;
  134. @@ -1340,11 +1337,7 @@ register struct attack *mattk;
  135.              if (mtmp->mcan)
  136.                  break;
  137.              /* Continue below */
  138. -        } else if (dmgtype(youmonst.data, AD_SEDU)
  139. -                   /* !SYSOPT_SEDUCE: when hero is attacking and AD_SSEX
  140. -                      is disabled, it would be changed to another damage
  141. -                      type, but when defending, it remains as-is */
  142. -                   || dmgtype(youmonst.data, AD_SSEX)) {
  143. +        } else if (youmonst.data->msound == MS_SEDUCE) {
  144.              pline("%s %s.", Monnam(mtmp),
  145.                    Deaf ? "says something but you can't hear it"
  146.                         : mtmp->minvent
  147. @@ -2406,8 +2399,8 @@ struct attack *mattk; /* non-Null: current attack; Null: general capability */
  148.      }
  149.  
  150.      adtyp = mattk ? mattk->adtyp
  151. -            : dmgtype(pagr, AD_SSEX) ? AD_SSEX
  152. -              : dmgtype(pagr, AD_SEDU) ? AD_SEDU
  153. +            : is_seducer(pagr) ? AD_SSEX
  154. +              : pagr->msound == MS_SEDUCE ? AD_SEDU
  155.                  : AD_PHYS;
  156.      if (adtyp == AD_SSEX && !SYSOPT_SEDUCE)
  157.          adtyp = AD_SEDU;
  158. @@ -2419,8 +2412,7 @@ struct attack *mattk; /* non-Null: current attack; Null: general capability */
  159.         for seduction, both pass the could_seduce() test;
  160.         incubi/succubi have three attacks, their claw attacks for damage
  161.         don't pass the test */
  162. -    if ((pagr->mlet != S_NYMPH
  163. -         && pagr != &mons[PM_INCUBUS] && pagr != &mons[PM_SUCCUBUS])
  164. +    if ((pagr->mlet != S_NYMPH && !is_seducer(pagr))
  165.          || (adtyp != AD_SEDU && adtyp != AD_SSEX && adtyp != AD_SITM))
  166.          return 0;
  167.  
  168. @@ -2447,6 +2439,18 @@ struct monst *mon;
  169.          pline("%s seems dismayed at your lack of response.", Monnam(mon));
  170.          return 0;
  171.      }
  172. +    if (!mon->mtame) {
  173. +        int price = (400 + u.ulevel * 20) * (50 - ACURR(A_CHA)) / 50;
  174. +        verbalize("I'm all yours for %d %s, dear.", price, currency(price));
  175. +        if (yn("Pay?") != 'y')
  176. +            return 0;
  177. +        if (price > money_cnt(invent)) {
  178. +            You("don't have enough money!");
  179. +            return 0;
  180. +        }
  181. +        money2mon(mon, price);
  182. +        context.botl = 1;
  183. +    }
  184.      seewho = canseemon(mon);
  185.      if (!seewho)
  186.          pline("Someone caresses you...");
  187. @@ -2686,37 +2690,6 @@ struct monst *mon;
  188.          }
  189.      }
  190.  
  191. -    if (mon->mtame) { /* don't charge */
  192. -        ;
  193. -    } else if (rn2(20) < ACURR(A_CHA)) {
  194. -        pline("%s demands that you pay %s, but you refuse...",
  195. -              noit_Monnam(mon), noit_mhim(mon));
  196. -    } else if (u.umonnum == PM_LEPRECHAUN) {
  197. -        pline("%s tries to take your money, but fails...", noit_Monnam(mon));
  198. -    } else {
  199. -        long cost;
  200. -        long umoney = money_cnt(invent);
  201. -
  202. -        if (umoney > (long) LARGEST_INT - 10L)
  203. -            cost = (long) rnd(LARGEST_INT) + 500L;
  204. -        else
  205. -            cost = (long) rnd((int) umoney + 10) + 500L;
  206. -        if (mon->mpeaceful) {
  207. -            cost /= 5L;
  208. -            if (!cost)
  209. -                cost = 1L;
  210. -        }
  211. -        if (cost > umoney)
  212. -            cost = umoney;
  213. -        if (!cost) {
  214. -            verbalize("It's on the house!");
  215. -        } else {
  216. -            pline("%s takes %ld %s for services rendered!", noit_Monnam(mon),
  217. -                  cost, currency(cost));
  218. -            money2mon(mon, cost);
  219. -            context.botl = 1;
  220. -        }
  221. -    }
  222.      if (!rn2(25))
  223.          mon->mcan = 1; /* monster is worn out */
  224.      if (!tele_restrict(mon))
  225. diff --git c/src/monst.c i/src/monst.c
  226. index 6b8a5f7..146fffa 100644
  227. --- c/src/monst.c
  228. +++ i/src/monst.c
  229. @@ -2372,9 +2372,9 @@ struct permonst _mons2[] = {
  230.      A(ATTK(AT_CLAW, AD_PHYS, 1, 3), ATTK(AT_CLAW, AD_PHYS, 1, 3), \
  231.        ATTK(AT_BITE, AD_DRLI, 2, 6), NO_ATTK, NO_ATTK, NO_ATTK)
  232.      MON("succubus", S_DEMON, LVL(6, 12, 0, 70, -9), (G_NOCORPSE | 1),
  233. -        SEDUCTION_ATTACKS_YES, SIZ(WT_HUMAN, 400, MS_SEDUCE, MZ_HUMAN),
  234. +        SEDUCTION_ATTACKS_NO, SIZ(WT_HUMAN, 400, MS_SEDUCE, MZ_HUMAN),
  235.          MR_FIRE | MR_POISON, 0, M1_HUMANOID | M1_FLY | M1_POIS,
  236. -        M2_DEMON | M2_STALK | M2_HOSTILE | M2_NASTY | M2_FEMALE,
  237. +        M2_DEMON | M2_STALK | M2_NASTY | M2_FEMALE,
  238.          M3_INFRAVISIBLE | M3_INFRAVISION, 8, CLR_GRAY),
  239.      MON("horned devil", S_DEMON, LVL(6, 9, -5, 50, 11),
  240.          (G_HELL | G_NOCORPSE | 2),
  241. @@ -2385,9 +2385,9 @@ struct permonst _mons2[] = {
  242.          M1_POIS | M1_THICK_HIDE, M2_DEMON | M2_STALK | M2_HOSTILE | M2_NASTY,
  243.          M3_INFRAVISIBLE | M3_INFRAVISION, 9, CLR_BROWN),
  244.      MON("incubus", S_DEMON, LVL(6, 12, 0, 70, -9), (G_NOCORPSE | 1),
  245. -        SEDUCTION_ATTACKS_YES, SIZ(WT_HUMAN, 400, MS_SEDUCE, MZ_HUMAN),
  246. +        SEDUCTION_ATTACKS_NO, SIZ(WT_HUMAN, 400, MS_SEDUCE, MZ_HUMAN),
  247.          MR_FIRE | MR_POISON, 0, M1_HUMANOID | M1_FLY | M1_POIS,
  248. -        M2_DEMON | M2_STALK | M2_HOSTILE | M2_NASTY | M2_MALE,
  249. +        M2_DEMON | M2_STALK | M2_NASTY | M2_MALE,
  250.          M3_INFRAVISIBLE | M3_INFRAVISION, 8, CLR_GRAY),
  251.      /* Used by AD&D for a type of demon, originally one of the Furies
  252.         and spelled this way */
  253. @@ -3234,9 +3234,6 @@ monst_init()
  254.  {
  255.      return;
  256.  }
  257. -
  258. -const struct attack sa_yes[NATTK] = SEDUCTION_ATTACKS_YES;
  259. -const struct attack sa_no[NATTK] = SEDUCTION_ATTACKS_NO;
  260.  #endif
  261.  
  262.  /*monst.c*/
  263. diff --git c/src/sounds.c i/src/sounds.c
  264. index 1bf7716..495213d 100644
  265. --- c/src/sounds.c
  266. +++ i/src/sounds.c
  267. @@ -841,7 +841,7 @@ register struct monst *mtmp;
  268.          int swval;
  269.  
  270.          if (SYSOPT_SEDUCE) {
  271. -            if (ptr->mlet != S_NYMPH
  272. +            if (is_seducer(ptr) && mtmp->mpeaceful
  273.                  && could_seduce(mtmp, &youmonst, (struct attack *) 0) == 1) {
  274.                  (void) doseduce(mtmp);
  275.                  break;
  276. @@ -849,6 +849,13 @@ register struct monst *mtmp;
  277.              swval = ((poly_gender() != (int) mtmp->female) ? rn2(3) : 0);
  278.          } else
  279.              swval = ((poly_gender() == 0) ? rn2(3) : 0);
  280. +        if (is_seducer(ptr) && !mtmp->mpeaceful) {
  281. +            if (is_demon(ptr) && !rn2(3))
  282. +                cuss(mtmp);
  283. +            else
  284. +                verbl_msg = "I doubt thou couldst even afford me, oaf.";
  285. +            break;
  286. +        }
  287.          switch (swval) {
  288.          case 2:
  289.              verbl_msg = "Hello, sailor.";
  290. diff --git c/src/steed.c i/src/steed.c
  291. index 9de2935..28bc045 100644
  292. --- c/src/steed.c
  293. +++ i/src/steed.c
  294. @@ -75,7 +75,7 @@ struct obj *otmp;
  295.              instapetrify(kbuf);
  296.          }
  297.      }
  298. -    if (ptr == &mons[PM_INCUBUS] || ptr == &mons[PM_SUCCUBUS]) {
  299. +    if (is_seducer(ptr)) {
  300.          pline("Shame on you!");
  301.          exercise(A_WIS, FALSE);
  302.          return 1;
  303. diff --git c/src/sys.c i/src/sys.c
  304. index 6a0c52d..651c16c 100644
  305. --- c/src/sys.c
  306. +++ i/src/sys.c
  307. @@ -123,8 +123,10 @@ sysopt_release()
  308.      return;
  309.  }
  310.  
  311. +#if 0
  312.  extern const struct attack sa_yes[NATTK];
  313.  extern const struct attack sa_no[NATTK];
  314. +#endif
  315.  
  316.  void
  317.  sysopt_seduce_set(val)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement