Page 1 of 1

Editing the Effects of Nuclears

Posted: Mon Nov 16, 2015 4:22 pm
by Bob
I'm currently making a ghetto mod of the game in which there are multiple types of nuclear weapons (Nuclear bomber, ICBM, and tactical nuke [for shits and giggles]), looked all through the .ruleset scripts and couldn't find where to change the properties of the nuclear explosions, as in to change the radius of the explosion and its effects on cities.
Being temporarily hindered-in-the-brain I probably overlooked where those settings were, thanks in advance.

Re: Editing the Effects of Nuclears

Posted: Mon Nov 16, 2015 7:20 pm
by cazfi
Unfortunately Nuclear blast moddability exist in my loooong TODO list only.

Re: Editing the Effects of Nuclears

Posted: Tue Nov 24, 2015 12:15 pm
by GriffonSpade
Hmm, a thought, is the SDI defense's thing linked to the nuclear flag? Because really, it should only work on ICBMs, not short range tactical nukes.

Re: Editing the Effects of Nuclears

Posted: Tue Nov 24, 2015 11:12 pm
by JTN
Afraid it is; and it's not possible to make the Nuke_Proof effect (which is what SDI buildings use) depend on properties of the attacking unit, although that wouldn't be so hard to add. It can only depend on properties of the city that is attacked.

See common/combat.c:sdi_try_defend() and callers.

Re: Editing the Effects of Nuclears

Posted: Wed Nov 25, 2015 5:41 am
by Unknown
While looking at sdi_try_defend I noticed something

Code: Select all

struct city *sdi_try_defend(const struct player *owner,
			       const struct tile *ptile)
{
  square_iterate(ptile, 2, ptile1) {
    struct city *pcity = tile_city(ptile1);

    if (pcity
        && !pplayers_allied(city_owner(pcity), owner)
        && fc_rand(100) < get_city_bonus(pcity, EFT_NUKE_PROOF)) {
      return pcity;
    }
  } square_iterate_end;

  return NULL;
}
This code only applies to fixed city radius of 2. Variable city radius is not handled here.