Skip to content

Randomized AI starting lawsets

Rob Nelson requested to merge pull/1442/random_ai_laws into Bleeding-Edge

Created by: Hoshi-chan

Randomly rolls for a base AI lawset when the first silicon in the round comes into existence. All subsequent silicons created during the round will also have that lawset. It currently makes its decisions like this: (40%) Asimov (20%) Corporate (20%) NT Default (10%) Robocop (10%) Paladin

I also added Corporate, Tyrant, and Paladin to ai_laws.dm, since it was necessary to make it work, so a side effect is that they should be available to admins via the game panel for setting the default laws of silicons.

Also included is a change to the way said game panel is laid out, since by default base_law_type is what is clickable on the game panel, but with this change, base_law_type is declared, but isn't initialized unless a silicon comes into existence. Because of this, if the admins wanted to change the base_law_type, and no silicons existed, they couldn't, since the selection was blank. It was fixed by making the whole phrase clickable, rather than just the base_law_type variable. I did the same for the default MoMMI law selection on the game panel for the sake of uniformity.

Tested and successfully rolled all lawtypes (eventually). Asimov is still very frequent. Malf works with it, as well. Works for borgs, too. Can easily have the frequency of lawsets adjusted by modifying the weighted pick in the getLawset proc in ai_laws.dm.

coded-it-now-try-it

Well Pomf, I coded it. Now try it.

Merge request reports