Horribly wrong! Congratulations regardless.
Thank you! We may not have to send the kittens out to sweep chimneys this Christmas
after all

I'd be interested in seeing the code you've spawned. Postage, please?
OK, you talked me into it

The motivation for this is best summed up in a comment from the slave_market data module
#
# this is the data underlying a slave market
#
# the intention is to have more than one,
# although the auction block in the Souk is the
# only one the initially accessible
#
# different markets are going to have different
# characteristics. The souk has mainly low quality girls
# and refreshes every 4 to 7 days. it never holds more
# than six girls and one or two are sold daily,
# starting with those of highest quality
#
# The J.Pettow and Son are toymakers in the Air Quarter
# who occasionally tinker with gynoids. Sometimes there are
# working models for sale, one, sometimes two,
# never more than three and frequently zero.
# Their stock has a low chance of changing daily.
# Only robot girls are traded at the Toyshop.
#
# Similarly, the Water Quarter has a house of Courtesans
# all highly trained, and capable healers and entertainers.
# None are for sale, although if the PC is of good repute
# and the girl is willing, delicate negotiations may be
# conducted. Similarly, the fire quarter will sell
# gladiators and janissaries, while the Earth Quarter
# houses the richest slave traders (with the highest chance
# of finding exotics or unique girls) and the Warrens
# Bazaar where the cities poorest are often sold into slavery
#
So I want highly configurable slave markets with specialised stock and some fine control over what goes into them. To that end, I've decided that markets are made up of "slots" where each slot can hold a girl. So a market with three slots can hold no more than
three girls at a time
#
# Each market has a number of "slots" that can contain a girl
# Each slot has
#
# * a chance to contain a unique girl
# * failing that a chance for a generic.
# * a chance that a girl will remain unchanged on refresh
# * a scaling factor applied to all a girl's stats
# * a list of required traits (eg "robot girls only")
# * a list of excluded traits (eg "no demons or undead")
#
class Slot(object):
def __init__(self, *args, **kw):
object.__init__(self)
#
# we'll default this to the souk
# so we have a slot with no chance at all of a unique
# 70% chance of a generic, and an 80% chance that
# a girl already in the slot will remain rather than
# be removed and possibly replaced
#
self.unique = kw.get("unique", 0.0)
self.generic = kw.get("generic", 0.7)
self.persist = kw.get("persist", 0.8)
#
# I'd like a bit of variability in the quality.
# this is a tad redundant, since the random girls all
# (obviously) have random elements. Still, it'd be
# nice to have a bit of range of quality beyond that/
# so scaling takes a function. In this case a
# lambda expression that averages out at about .4
# but trails away in a normal distribution so that
# in rare case the scaling can go as high as 1
# or drop as low as zero.
#
# (values <= 0 are capped at 0.05. Values > 1 can
# stand, but the resulting stats still cap at 100.
# so occasionally some higher than average girls
# will come through)
#
func = lambda : .2 + random.normalvariate(1,1) / 5
self.scaling = kw.get("scaling", func)
#
# required and excluded traits
#
self.required = kw.get("required", [])
self.excluded = kw.get("excluded", [])
#
# last but not least, a variable to hold the
# girl instance in question
#
self.girl = None
So, we can check first to see if the girl remains after the slot is refreshed, and then we can check to see if a unique girl is there, and if that fails we look for a generic one. We can set quality modifiers to change the likely quality of the girls, and we can require or exclude any number of traits. So we can exclude demon girls from the souk, or make sure that only robots appear in the Toyshop.
And of course we can configure these on a slot by slot basis...
class SlaveMarket_Souk(SlaveMarketBase):
def __init__(self, *args, **kw):
SlaveMarketBase.__init__(self, *args, **kw)
#
# array of slots to hold the girls
#
self.slots = [
#
# first slot - 1 in 20 chance of a unique
# 100% chance of generic if no unique
# 100% scaling - this one is in good shape
#
self.mk_slot( unique = 0.05,
generic = 1.0,
scaling = 1.0,
),
#
# second slot - 1% chance of unique
# 100% generic, 70% scaling
#
self.mk_slot( unique = 0.01,
generic = 1.0,
scaling = 0.7,
),
#
# remaining slots, no chance of unique
# diminishing chance of generics
#
self.mk_slot( generic = 0.8),
self.mk_slot( generic = 0.5),
self.mk_slot( generic = 0.3,
scaling = 0.2
),
self.mk_slot( generic = 0.1,
scaling = 0.05
),
]
self.refresh()
#
# little func to make sure the exclusions get passed
# to all slots
#
def mk_slot(self, **kw):
xs = [
"Demon", "Gynoid", "Undead",
"Not Human", "Construct",
"No Souk"
]
return Slot(excluded=xs, **kw)
There's some more marginally interesting stuff in the girl manager and how this lot are looked up and filtered, but this post is going on forever and I've posted the essence of it all.
Anyway, that's what I've been up to
