Compare commits

...

3 Commits

Author SHA1 Message Date
baa83c8cc5 Footwear support
* Added footwear support for dolls
* Added DollClothDummy subclass dummy controller
2022-11-12 22:32:33 +00:00
54f21f7f50 Merge branch 'Python3' into Chibis 2022-11-12 21:10:26 +00:00
c32d926742 Coroutines
* Implemented asynchronous coroutines for Doll and Outfit generators
2022-11-11 22:24:47 +00:00
11 changed files with 141 additions and 46 deletions

View File

@ -18,6 +18,7 @@ default astoria = Doll(name="astoria",
"stockings": [None, 5, True],
"buttplug": [None, -1, True],
"pubes": [None, 3, True],
"footwear": [None, 6, True],
"tattoo0": [None, 1, True],
"tattoo1": [None, 1, True],
"tattoo2": [None, 1, True],
@ -53,6 +54,7 @@ default astoria = Doll(name="astoria",
## Schoolgirl Outfit ##
#######################
default ast_footwear_shoes = DollClothDummy("astoria", type="footwear")
default ast_hair_base = DollCloth("astoria", ("head", "hair"), "hair", "base", [[229, 198, 129, 255], [163, 125, 80, 255]], unlocked=True)
default ast_hair_short = DollCloth("astoria", ("head", "hair"), "hair", "short", [[229, 198, 129, 255], [163, 125, 80, 255]], unlocked=True)

View File

@ -18,6 +18,7 @@ default cho = Doll(name="cho",
"stockings": [None, 5, True],
"buttplug": [None, -1, True],
"pubes": [None, 3, True],
"footwear": [None, 6, True],
"tattoo0": [None, 1, True],
"tattoo1": [None, 1, True],
"tattoo2": [None, 1, True],
@ -53,6 +54,7 @@ default cho = Doll(name="cho",
## Schoolgirl ##
################
default cho_footwear_shoes = DollClothDummy("cho", type="footwear")
default cho_hair_ponytail1 = DollCloth("cho", ("head", "hair"), "hair", "ponytail", [[52, 59, 80, 255], [70, 90, 147, 255]], unlocked=True)
default cho_top_school1 = DollCloth("cho", ("upper body", "shirts"), "top", "top_school_1", [[183, 183, 184, 255], [109, 105, 121, 255], [216, 163, 10, 255], [89, 116, 194, 255]], unlocked=True)
default cho_top_school2 = DollCloth("cho", ("upper body", "shirts"), "top", "top_school_2", [[183, 183, 184, 255], [109, 105, 121, 255], [216, 163, 10, 255], [89, 116, 194, 255]], level=4, unlocked=True)
@ -73,7 +75,7 @@ default cho_robe_school_3 = DollCloth("cho", ("upper body", "robes"), "robe", "r
#default cho_neckwear_tie1 = DollCloth("cho", ("head", "neckwear"), "neckwear", "tie_1", [[216, 163, 10, 255], [89, 116, 194, 255]])
default cho_outfit_last = DollOutfit([cho_hair_ponytail1], hidden=True)
default cho_outfit_default = DollOutfit([cho_hair_ponytail1, cho_top_school1, cho_bottom_school1, cho_bra_basic1, cho_panties_basic1, cho_stockings_house], unlocked=True)
default cho_outfit_default = DollOutfit([cho_hair_ponytail1, cho_top_school1, cho_bottom_school1, cho_bra_basic1, cho_panties_basic1, cho_stockings_house, cho_footwear_shoes], unlocked=True)
########################
## Cheerleader Outfit ##

View File

@ -18,6 +18,7 @@ default hermione = Doll(name="hermione",
"stockings": [None, 5, True],
"buttplug": [None, -1, True],
"pubes": [None, 3, True],
"footwear": [None, 6, True],
"tattoo0": [None, 1, True],
"tattoo1": [None, 1, True],
"tattoo2": [None, 1, True],
@ -61,6 +62,7 @@ default her_hair_base = DollCloth("hermione", ("head", "hair"), "hair", "base",
## Schoolgirl ##
################
default her_footwear_shoes = DollClothDummy("hermione", type="footwear")
default her_top_school1 = DollCloth("hermione", ("upper body", "shirts"), "top", "top_school_1", [[183, 183, 184, 255], [109, 105, 121, 255], [167, 77, 42, 255], [237, 179, 14, 255]], unlocked=True)
default her_top_school2 = DollCloth("hermione", ("upper body", "shirts"), "top", "top_school_2", [[183, 183, 184, 255], [109, 105, 121, 255], [167, 77, 42, 255], [237, 179, 14, 255]], unlocked=True)
default her_top_school3 = DollCloth("hermione", ("upper body", "shirts"), "top", "top_school_3", [[183, 183, 184, 255], [167, 77, 42, 255], [237, 179, 14, 255]], unlocked=True)

View File

@ -18,6 +18,7 @@ default hooch = Doll(name="hooch",
"stockings": [None, 5, True],
"buttplug": [None, -1, True],
"pubes": [None, 3, True],
"footwear": [None, 6, True],
"tattoo0": [None, 1, True],
"tattoo1": [None, 1, True],
"tattoo2": [None, 1, True],
@ -53,6 +54,7 @@ default hooch = Doll(name="hooch",
## Hair ##
###############
default hoo_footwear_shoes = DollClothDummy("hooch", type="footwear")
default hoo_hair_base = DollCloth("hooch", ("head", "hair"), "hair", "base", [[125, 72, 42, 255]], unlocked=True)
default hoo_panties_sport = DollCloth("hooch", ("lower undergarment", "panties"), "panties", "sport", [[192, 65, 54, 255], [237, 225, 255, 255]], unlocked=True)
default hoo_bra_sport = DollCloth("hooch", ("upper undergarment", "bras"), "bra", "sport", [[192, 65, 54, 255], [237, 225, 255, 255]], unlocked=True)

View File

@ -18,6 +18,7 @@ default luna = Doll(name="luna",
"stockings": [None, 5, True],
"buttplug": [None, -1, True],
"pubes": [None, 3, True],
"footwear": [None, 6, True],
"tattoo0": [None, 1, True],
"tattoo1": [None, 1, True],
"tattoo2": [None, 1, True],
@ -60,6 +61,7 @@ default lun_hair_wand = DollCloth("luna", ("head", "hair"), "hair", "wand", [[23
## Schoolgirl ##
################
default lun_footwear_shoes = DollClothDummy("luna", type="footwear")
default lun_top_school1 = DollCloth("luna", ("upper body", "shirts"), "top", "top_school_1", [[183, 183, 184, 255], [109, 105, 121, 255], [89, 116, 194, 255], [216, 163, 10, 255]], unlocked=True)
default lun_top_school2 = DollCloth("luna", ("upper body", "shirts"), "top", "top_school_2", [[183, 183, 184, 255], [109, 105, 121, 255], [89, 116, 194, 255], [216, 163, 10, 255]], unlocked=True)
default lun_top_school3 = DollCloth("luna", ("upper body", "shirts"), "top", "top_school_3", [[183, 183, 184, 255], [109, 105, 121, 255], [89, 116, 194, 255], [216, 163, 10, 255]], unlocked=True)

View File

@ -18,6 +18,7 @@ default susan = Doll(name="susan",
"stockings": [None, 5, True],
"buttplug": [None, -1, True],
"pubes": [None, 3, True],
"footwear": [None, 6, True],
"tattoo0": [None, 1, True],
"tattoo1": [None, 1, True],
"tattoo2": [None, 1, True],
@ -51,6 +52,7 @@ default susan = Doll(name="susan",
## Schoolgirl Outfit ##
#######################
default sus_footwear_shoes = DollClothDummy("susan", type="footwear")
default sus_hair_base = DollCloth("susan", ("head", "hair"), "hair", "base", [[213, 85, 35, 255], [231, 109, 61, 255]], unlocked=True)

View File

@ -18,6 +18,7 @@ default tonks = Doll(name="tonks",
"stockings": [None, 5, True],
"buttplug": [None, -1, True],
"pubes": [None, 3, True],
"footwear": [None, 6, True],
"tattoo0": [None, 1, True],
"tattoo1": [None, 1, True],
"tattoo2": [None, 1, True],
@ -53,6 +54,7 @@ default tonks = Doll(name="tonks",
## Auror Outfit ##
##################
default ton_footwear_shoes = DollClothDummy("tonks", type="footwear")
default ton_hair_base = DollCloth("tonks", ("head", "hair"), "hair", "base", [[255, 146, 185, 255], [254, 218, 238, 255]], unlocked=True)
default ton_hair_base_new = DollCloth("tonks", ("head", "hair"), "hair", "new", [[255, 146, 185, 255], [254, 218, 238, 255]], unlocked=True)
default ton_neckwear_beads = DollCloth("tonks", ("head", "neckwear"), "neckwear", "choker_beads",[[45, 45, 48, 255], [244, 230, 236, 255]], unlocked=True)

View File

@ -44,7 +44,7 @@ init python:
if renpy.loadable(path + "0.webp"):
self.imagepath = path
return
raise IOError("Couldn't find file \"{}/characters/{}/clothes/{}/{}/0.webp\"".format(self.modpath, self.name, subpath, self.id))
raise IOError("Couldn't find file:\n\"{}0.webp\"".format(path))
def set_layers(self):
for x in self.layers_special:
@ -302,3 +302,28 @@ init python:
if self.parent:
self.parent.unlock()
class DollClothDummy(DollCloth):
def __init__(self, name, type, *args, **kwargs):
super(DollClothDummy, self).__init__(name=name, categories=("dummy", "dummy"), type=type, id="dummy", color=[[0,0,0,0]], *args, **kwargs)
self.cached = True
self.cached_icon = True
def set_imagepath(self):
if any(x in self.type for x in self.multislots):
subpath = self.type[:-1]
else:
subpath = self.type
virt_path = "{}/characters/{}/clothes/{}/{}/".format(self.modpath, self.name, subpath, self.id)
self.imagepath = virt_path
def get_icon(self):
return self.ico
def get_image(self):
return self.sprite
def clone(self):
return DollClothDummy(self.name, self.type, parent=self)

File diff suppressed because it is too large Load Diff

View File

@ -43,13 +43,17 @@ init python:
if self in self.char.outfits:
self.char.outfits.remove(self)
def build_image(self):
masks = []
sprites = [
(self.char.body.get_mannequin(self.group), 0)
]
def make_image(self):
asyncio.run(self.build_image())
for i in self.group:
async def build_image(self):
# Add body, face, cum, clothes, masks
async def build_clothes(group):
sprites = []
masks = []
for i in group:
sprites.append([i.get_image(), i.zorder])
sprites.extend([
@ -62,11 +66,30 @@ init python:
if i.mask:
masks.append((i.mask, i.zorder-1))
return (sprites, masks)
async def build_mannequin(group):
return (self.char.body.get_mannequin(group), 0)
mannequin, (clothes, masks) = await asyncio.gather(
build_mannequin(self.group),
build_clothes(self.group),
)
sprites = [
mannequin,
*clothes,
]
# Filter out Nulls
sprites = [x for x in sprites if not isinstance(x[0], Null)]
sprites.sort(key=itemgetter(1))
masks.sort(key=itemgetter(1))
back_sprites = [x for x in sprites if x[1] < 0]
sprites = [x for x in sprites if x[1] >= 0]
# Filter out sprites with zorder less than zero, there's no need to iterate over them.
back_sprites = [x[0] for x in sprites if x[1] < 0]
sprites = [x for x in sprites if x[1] > -1]
# Apply alpha mask
for m in masks:
@ -84,8 +107,9 @@ init python:
sprites.insert(0, (masked, mask_zorder))
break
sprites = back_sprites + sprites
return tuple(x[0] for x in sprites)
sprites = back_sprites + [x[0] for x in sprites]
self.sprite = DollDisplayable(Fixed(*sprites, fit_first=True))
return
def exists(self):
return (self in self.char.outfits)