2022-05-16 23:48:22 +00:00
|
|
|
init python:
|
2022-11-11 22:24:47 +00:00
|
|
|
import asyncio
|
|
|
|
|
2022-05-16 23:48:22 +00:00
|
|
|
class Doll(DollMethods):
|
IO Overhaul, Refactoring, and more
* Refactored DollFace
* Refactored DollBody
* Refactored DollCum
* Refactored DollCloth
* Refactored Doll
* Refactored clothing item zorders
* Refactored implementation of body, face, cum, clothing layers
* Refactored function calls
* Removed DollLipstick
* Added DollMakeup class, allowing adding dynamic clothes tracking face states
* Added DollClothDynamic, allowing dynamic clothes tracking other cloth states with bangs support
* Added cache to frequently called functions, drastically reducing the overhead
* Added hash system, reducing clone redundancy
* Added layer modifiers support for all types (face, body, cum, clothes etc.)
* Added support for an arbitrary number of equipped multislot clothing items (makeup, tattoos, piercings, etc.)
* Simplified initialization for clothing items and dolls
* Simplified class function calls
* Reduced the number of image creation calls
* Added hue support for additional skin layers
* Added displayable support to image cropping function
* Replaced store cache with built-in functools cache for _list_files function
* Refactored all character files
* and more...
2023-01-14 23:04:54 +00:00
|
|
|
layers = [
|
|
|
|
("buttplug", -11),
|
|
|
|
("makeup", 111), # multislot
|
|
|
|
("accessory", 121), # multislot
|
|
|
|
("piercing", 131), # multislot
|
|
|
|
("tattoo", 141), # multislot
|
|
|
|
("pubes", 151),
|
|
|
|
("stockings", 161),
|
|
|
|
("panties", 171),
|
|
|
|
("garterbelt", 181),
|
|
|
|
("bottom", 191),
|
|
|
|
("bra", 201),
|
|
|
|
("top", 211),
|
|
|
|
("gloves", 221),
|
|
|
|
("robe", 231),
|
|
|
|
("neckwear", 241),
|
|
|
|
("hair", 251),
|
|
|
|
("earrings", 261),
|
|
|
|
("glasses", 271),
|
|
|
|
("headgear", 281)
|
|
|
|
]
|
|
|
|
|
|
|
|
def __init__(self, name):
|
2022-05-16 23:48:22 +00:00
|
|
|
self.wardrobe = {}
|
|
|
|
self.wardrobe_list = []
|
|
|
|
self.blacklist = []
|
|
|
|
self.outfits = []
|
|
|
|
self.name = name
|
IO Overhaul, Refactoring, and more
* Refactored DollFace
* Refactored DollBody
* Refactored DollCum
* Refactored DollCloth
* Refactored Doll
* Refactored clothing item zorders
* Refactored implementation of body, face, cum, clothing layers
* Refactored function calls
* Removed DollLipstick
* Added DollMakeup class, allowing adding dynamic clothes tracking face states
* Added DollClothDynamic, allowing dynamic clothes tracking other cloth states with bangs support
* Added cache to frequently called functions, drastically reducing the overhead
* Added hash system, reducing clone redundancy
* Added layer modifiers support for all types (face, body, cum, clothes etc.)
* Added support for an arbitrary number of equipped multislot clothing items (makeup, tattoos, piercings, etc.)
* Simplified initialization for clothing items and dolls
* Simplified class function calls
* Reduced the number of image creation calls
* Added hue support for additional skin layers
* Added displayable support to image cropping function
* Replaced store cache with built-in functools cache for _list_files function
* Refactored all character files
* and more...
2023-01-14 23:04:54 +00:00
|
|
|
self.clothes = {layer[0]: [None, layer[1], True] for layer in self.layers}
|
|
|
|
self.face = DollFace(self)
|
|
|
|
self.body = DollBody(self)
|
2022-05-16 23:48:22 +00:00
|
|
|
self.cum = DollCum(self)
|
IO Overhaul, Refactoring, and more
* Refactored DollFace
* Refactored DollBody
* Refactored DollCum
* Refactored DollCloth
* Refactored Doll
* Refactored clothing item zorders
* Refactored implementation of body, face, cum, clothing layers
* Refactored function calls
* Removed DollLipstick
* Added DollMakeup class, allowing adding dynamic clothes tracking face states
* Added DollClothDynamic, allowing dynamic clothes tracking other cloth states with bangs support
* Added cache to frequently called functions, drastically reducing the overhead
* Added hash system, reducing clone redundancy
* Added layer modifiers support for all types (face, body, cum, clothes etc.)
* Added support for an arbitrary number of equipped multislot clothing items (makeup, tattoos, piercings, etc.)
* Simplified initialization for clothing items and dolls
* Simplified class function calls
* Reduced the number of image creation calls
* Added hue support for additional skin layers
* Added displayable support to image cropping function
* Replaced store cache with built-in functools cache for _list_files function
* Refactored all character files
* and more...
2023-01-14 23:04:54 +00:00
|
|
|
self.pose = ""
|
2022-05-16 23:48:22 +00:00
|
|
|
self.emote = Null()
|
|
|
|
|
|
|
|
# Image properties
|
|
|
|
self.zorder = 15
|
|
|
|
self.layer = "screens"
|
2022-06-24 17:32:41 +00:00
|
|
|
self.animation = None
|
2022-05-16 23:48:22 +00:00
|
|
|
self.tag = get_character_tag(name)
|
|
|
|
|
|
|
|
# Transform properties
|
|
|
|
self.pos = (0, 0)
|
|
|
|
self.zoom = 0.5
|
|
|
|
self.xzoom = 1
|
|
|
|
self.align = (0.5, 1.0)
|
|
|
|
|
|
|
|
def rebuild(self):
|
|
|
|
"""Rebuild character image cache."""
|
|
|
|
self.body.rebuild_image()
|
|
|
|
self.face.rebuild_image()
|
|
|
|
self.cum.rebuild_image()
|
|
|
|
for o in self.wardrobe_list:
|
|
|
|
o.rebuild_image()
|
|
|
|
o.rebuild_icon()
|
|
|
|
for o in self.outfits:
|
|
|
|
o.rebuild_image()
|
|
|
|
self.rebuild_image()
|
|
|
|
|
|
|
|
def show(self):
|
|
|
|
if renpy.get_screen(("wardrobe", "animatedCG", "studio")):
|
|
|
|
return
|
|
|
|
|
|
|
|
base_transform = doll_transform(self.pos, self.zoom, self.xzoom)
|
2022-06-19 21:27:08 +00:00
|
|
|
animation = self.animation
|
2022-05-16 23:48:22 +00:00
|
|
|
|
2022-06-21 19:12:26 +00:00
|
|
|
at_list = [base_transform]
|
2022-06-19 21:27:08 +00:00
|
|
|
|
2022-06-21 19:12:26 +00:00
|
|
|
if animation:
|
2022-06-24 17:32:41 +00:00
|
|
|
at_list.append(animation)
|
2022-06-21 19:12:26 +00:00
|
|
|
|
IO Overhaul, Refactoring, and more
* Refactored DollFace
* Refactored DollBody
* Refactored DollCum
* Refactored DollCloth
* Refactored Doll
* Refactored clothing item zorders
* Refactored implementation of body, face, cum, clothing layers
* Refactored function calls
* Removed DollLipstick
* Added DollMakeup class, allowing adding dynamic clothes tracking face states
* Added DollClothDynamic, allowing dynamic clothes tracking other cloth states with bangs support
* Added cache to frequently called functions, drastically reducing the overhead
* Added hash system, reducing clone redundancy
* Added layer modifiers support for all types (face, body, cum, clothes etc.)
* Added support for an arbitrary number of equipped multislot clothing items (makeup, tattoos, piercings, etc.)
* Simplified initialization for clothing items and dolls
* Simplified class function calls
* Reduced the number of image creation calls
* Added hue support for additional skin layers
* Added displayable support to image cropping function
* Replaced store cache with built-in functools cache for _list_files function
* Refactored all character files
* and more...
2023-01-14 23:04:54 +00:00
|
|
|
renpy.show(name=self.tag, at_list=at_list, layer=self.layer, what=self.image, zorder=self.zorder)
|
2022-05-16 23:48:22 +00:00
|
|
|
|
|
|
|
def hide(self):
|
|
|
|
renpy.hide(name=self.tag, layer=self.layer)
|
|
|
|
|
2022-11-11 22:24:47 +00:00
|
|
|
async def build_image(self):
|
2022-05-16 23:48:22 +00:00
|
|
|
# Add body, face, cum, clothes, masks
|
|
|
|
|
2022-11-11 22:24:47 +00:00
|
|
|
async def build_clothes(clothes):
|
|
|
|
sprites = []
|
|
|
|
masks = []
|
|
|
|
|
|
|
|
for i in clothes.values():
|
IO Overhaul, Refactoring, and more
* Refactored DollFace
* Refactored DollBody
* Refactored DollCum
* Refactored DollCloth
* Refactored Doll
* Refactored clothing item zorders
* Refactored implementation of body, face, cum, clothing layers
* Refactored function calls
* Removed DollLipstick
* Added DollMakeup class, allowing adding dynamic clothes tracking face states
* Added DollClothDynamic, allowing dynamic clothes tracking other cloth states with bangs support
* Added cache to frequently called functions, drastically reducing the overhead
* Added hash system, reducing clone redundancy
* Added layer modifiers support for all types (face, body, cum, clothes etc.)
* Added support for an arbitrary number of equipped multislot clothing items (makeup, tattoos, piercings, etc.)
* Simplified initialization for clothing items and dolls
* Simplified class function calls
* Reduced the number of image creation calls
* Added hue support for additional skin layers
* Added displayable support to image cropping function
* Replaced store cache with built-in functools cache for _list_files function
* Refactored all character files
* and more...
2023-01-14 23:04:54 +00:00
|
|
|
if i[0] and i[2]:
|
|
|
|
for identifier, layer, zorder in i[0].build_image(i[0]._hash):
|
|
|
|
if identifier == "mask":
|
|
|
|
masks.append((layer, zorder))
|
|
|
|
else:
|
|
|
|
sprites.append((layer, zorder))
|
2022-11-11 22:24:47 +00:00
|
|
|
|
|
|
|
return (sprites, masks)
|
2022-05-16 23:48:22 +00:00
|
|
|
|
2022-11-11 22:24:47 +00:00
|
|
|
async def build_face():
|
IO Overhaul, Refactoring, and more
* Refactored DollFace
* Refactored DollBody
* Refactored DollCum
* Refactored DollCloth
* Refactored Doll
* Refactored clothing item zorders
* Refactored implementation of body, face, cum, clothing layers
* Refactored function calls
* Removed DollLipstick
* Added DollMakeup class, allowing adding dynamic clothes tracking face states
* Added DollClothDynamic, allowing dynamic clothes tracking other cloth states with bangs support
* Added cache to frequently called functions, drastically reducing the overhead
* Added hash system, reducing clone redundancy
* Added layer modifiers support for all types (face, body, cum, clothes etc.)
* Added support for an arbitrary number of equipped multislot clothing items (makeup, tattoos, piercings, etc.)
* Simplified initialization for clothing items and dolls
* Simplified class function calls
* Reduced the number of image creation calls
* Added hue support for additional skin layers
* Added displayable support to image cropping function
* Replaced store cache with built-in functools cache for _list_files function
* Refactored all character files
* and more...
2023-01-14 23:04:54 +00:00
|
|
|
return (self.face.image, 1)
|
2022-11-11 22:24:47 +00:00
|
|
|
|
|
|
|
async def build_body():
|
IO Overhaul, Refactoring, and more
* Refactored DollFace
* Refactored DollBody
* Refactored DollCum
* Refactored DollCloth
* Refactored Doll
* Refactored clothing item zorders
* Refactored implementation of body, face, cum, clothing layers
* Refactored function calls
* Removed DollLipstick
* Added DollMakeup class, allowing adding dynamic clothes tracking face states
* Added DollClothDynamic, allowing dynamic clothes tracking other cloth states with bangs support
* Added cache to frequently called functions, drastically reducing the overhead
* Added hash system, reducing clone redundancy
* Added layer modifiers support for all types (face, body, cum, clothes etc.)
* Added support for an arbitrary number of equipped multislot clothing items (makeup, tattoos, piercings, etc.)
* Simplified initialization for clothing items and dolls
* Simplified class function calls
* Reduced the number of image creation calls
* Added hue support for additional skin layers
* Added displayable support to image cropping function
* Replaced store cache with built-in functools cache for _list_files function
* Refactored all character files
* and more...
2023-01-14 23:04:54 +00:00
|
|
|
return (self.body.image, 0)
|
2022-11-11 22:24:47 +00:00
|
|
|
|
IO Overhaul, Refactoring, and more
* Refactored DollFace
* Refactored DollBody
* Refactored DollCum
* Refactored DollCloth
* Refactored Doll
* Refactored clothing item zorders
* Refactored implementation of body, face, cum, clothing layers
* Refactored function calls
* Removed DollLipstick
* Added DollMakeup class, allowing adding dynamic clothes tracking face states
* Added DollClothDynamic, allowing dynamic clothes tracking other cloth states with bangs support
* Added cache to frequently called functions, drastically reducing the overhead
* Added hash system, reducing clone redundancy
* Added layer modifiers support for all types (face, body, cum, clothes etc.)
* Added support for an arbitrary number of equipped multislot clothing items (makeup, tattoos, piercings, etc.)
* Simplified initialization for clothing items and dolls
* Simplified class function calls
* Reduced the number of image creation calls
* Added hue support for additional skin layers
* Added displayable support to image cropping function
* Replaced store cache with built-in functools cache for _list_files function
* Refactored all character files
* and more...
2023-01-14 23:04:54 +00:00
|
|
|
async def build_cum():
|
|
|
|
return (self.cum.image, 100)
|
2022-11-11 22:24:47 +00:00
|
|
|
|
IO Overhaul, Refactoring, and more
* Refactored DollFace
* Refactored DollBody
* Refactored DollCum
* Refactored DollCloth
* Refactored Doll
* Refactored clothing item zorders
* Refactored implementation of body, face, cum, clothing layers
* Refactored function calls
* Removed DollLipstick
* Added DollMakeup class, allowing adding dynamic clothes tracking face states
* Added DollClothDynamic, allowing dynamic clothes tracking other cloth states with bangs support
* Added cache to frequently called functions, drastically reducing the overhead
* Added hash system, reducing clone redundancy
* Added layer modifiers support for all types (face, body, cum, clothes etc.)
* Added support for an arbitrary number of equipped multislot clothing items (makeup, tattoos, piercings, etc.)
* Simplified initialization for clothing items and dolls
* Simplified class function calls
* Reduced the number of image creation calls
* Added hue support for additional skin layers
* Added displayable support to image cropping function
* Replaced store cache with built-in functools cache for _list_files function
* Refactored all character files
* and more...
2023-01-14 23:04:54 +00:00
|
|
|
body, face, cum, (clothes, masks) = await asyncio.gather(
|
2022-11-11 22:24:47 +00:00
|
|
|
build_body(),
|
|
|
|
build_face(),
|
IO Overhaul, Refactoring, and more
* Refactored DollFace
* Refactored DollBody
* Refactored DollCum
* Refactored DollCloth
* Refactored Doll
* Refactored clothing item zorders
* Refactored implementation of body, face, cum, clothing layers
* Refactored function calls
* Removed DollLipstick
* Added DollMakeup class, allowing adding dynamic clothes tracking face states
* Added DollClothDynamic, allowing dynamic clothes tracking other cloth states with bangs support
* Added cache to frequently called functions, drastically reducing the overhead
* Added hash system, reducing clone redundancy
* Added layer modifiers support for all types (face, body, cum, clothes etc.)
* Added support for an arbitrary number of equipped multislot clothing items (makeup, tattoos, piercings, etc.)
* Simplified initialization for clothing items and dolls
* Simplified class function calls
* Reduced the number of image creation calls
* Added hue support for additional skin layers
* Added displayable support to image cropping function
* Replaced store cache with built-in functools cache for _list_files function
* Refactored all character files
* and more...
2023-01-14 23:04:54 +00:00
|
|
|
build_cum(),
|
2022-11-11 22:24:47 +00:00
|
|
|
build_clothes(self.clothes),
|
|
|
|
)
|
|
|
|
|
|
|
|
sprites = [
|
|
|
|
body,
|
IO Overhaul, Refactoring, and more
* Refactored DollFace
* Refactored DollBody
* Refactored DollCum
* Refactored DollCloth
* Refactored Doll
* Refactored clothing item zorders
* Refactored implementation of body, face, cum, clothing layers
* Refactored function calls
* Removed DollLipstick
* Added DollMakeup class, allowing adding dynamic clothes tracking face states
* Added DollClothDynamic, allowing dynamic clothes tracking other cloth states with bangs support
* Added cache to frequently called functions, drastically reducing the overhead
* Added hash system, reducing clone redundancy
* Added layer modifiers support for all types (face, body, cum, clothes etc.)
* Added support for an arbitrary number of equipped multislot clothing items (makeup, tattoos, piercings, etc.)
* Simplified initialization for clothing items and dolls
* Simplified class function calls
* Reduced the number of image creation calls
* Added hue support for additional skin layers
* Added displayable support to image cropping function
* Replaced store cache with built-in functools cache for _list_files function
* Refactored all character files
* and more...
2023-01-14 23:04:54 +00:00
|
|
|
face,
|
2022-11-11 22:24:47 +00:00
|
|
|
cum,
|
|
|
|
*clothes,
|
|
|
|
(self.emote, 1000)
|
|
|
|
]
|
2022-05-16 23:48:22 +00:00
|
|
|
|
2022-11-11 22:24:47 +00:00
|
|
|
# Filter out Nulls
|
|
|
|
sprites = [x for x in sprites if not isinstance(x[0], Null)]
|
2022-05-16 23:48:22 +00:00
|
|
|
|
|
|
|
sprites.sort(key=itemgetter(1))
|
|
|
|
masks.sort(key=itemgetter(1))
|
|
|
|
|
2022-11-11 22:24:47 +00:00
|
|
|
# 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]
|
2022-05-16 23:48:22 +00:00
|
|
|
|
|
|
|
# Apply alpha mask
|
|
|
|
for m in masks:
|
|
|
|
mask, mask_zorder = m
|
|
|
|
|
|
|
|
for i, s in enumerate(sprites):
|
|
|
|
sprite, sprite_zorder = s
|
|
|
|
|
|
|
|
if i < 1 or mask_zorder > sprite_zorder:
|
|
|
|
continue
|
|
|
|
|
|
|
|
c = tuple(x[0] for x in sprites[:i] if not isinstance(x[0], Null))
|
|
|
|
masked = AlphaMask(Fixed(*c, fit_first=True), mask)
|
|
|
|
sprites = sprites[i:]
|
|
|
|
sprites.insert(0, (masked, mask_zorder))
|
|
|
|
break
|
|
|
|
|
2022-11-11 22:24:47 +00:00
|
|
|
sprites = back_sprites + [x[0] for x in sprites]
|
IO Overhaul, Refactoring, and more
* Refactored DollFace
* Refactored DollBody
* Refactored DollCum
* Refactored DollCloth
* Refactored Doll
* Refactored clothing item zorders
* Refactored implementation of body, face, cum, clothing layers
* Refactored function calls
* Removed DollLipstick
* Added DollMakeup class, allowing adding dynamic clothes tracking face states
* Added DollClothDynamic, allowing dynamic clothes tracking other cloth states with bangs support
* Added cache to frequently called functions, drastically reducing the overhead
* Added hash system, reducing clone redundancy
* Added layer modifiers support for all types (face, body, cum, clothes etc.)
* Added support for an arbitrary number of equipped multislot clothing items (makeup, tattoos, piercings, etc.)
* Simplified initialization for clothing items and dolls
* Simplified class function calls
* Reduced the number of image creation calls
* Added hue support for additional skin layers
* Added displayable support to image cropping function
* Replaced store cache with built-in functools cache for _list_files function
* Refactored all character files
* and more...
2023-01-14 23:04:54 +00:00
|
|
|
self._image = Fixed(*sprites, fit_first=True)
|
2022-11-11 22:24:47 +00:00
|
|
|
return
|
2022-05-16 23:48:22 +00:00
|
|
|
|
IO Overhaul, Refactoring, and more
* Refactored DollFace
* Refactored DollBody
* Refactored DollCum
* Refactored DollCloth
* Refactored Doll
* Refactored clothing item zorders
* Refactored implementation of body, face, cum, clothing layers
* Refactored function calls
* Removed DollLipstick
* Added DollMakeup class, allowing adding dynamic clothes tracking face states
* Added DollClothDynamic, allowing dynamic clothes tracking other cloth states with bangs support
* Added cache to frequently called functions, drastically reducing the overhead
* Added hash system, reducing clone redundancy
* Added layer modifiers support for all types (face, body, cum, clothes etc.)
* Added support for an arbitrary number of equipped multislot clothing items (makeup, tattoos, piercings, etc.)
* Simplified initialization for clothing items and dolls
* Simplified class function calls
* Reduced the number of image creation calls
* Added hue support for additional skin layers
* Added displayable support to image cropping function
* Replaced store cache with built-in functools cache for _list_files function
* Refactored all character files
* and more...
2023-01-14 23:04:54 +00:00
|
|
|
@property
|
|
|
|
def image(self):
|
|
|
|
if not renpy.is_skipping():
|
|
|
|
if not self._image_cached:
|
|
|
|
self._image_cached = True
|
|
|
|
asyncio.run(self.build_image())
|
|
|
|
|
|
|
|
return self._image
|
2022-05-16 23:48:22 +00:00
|
|
|
|
IO Overhaul, Refactoring, and more
* Refactored DollFace
* Refactored DollBody
* Refactored DollCum
* Refactored DollCloth
* Refactored Doll
* Refactored clothing item zorders
* Refactored implementation of body, face, cum, clothing layers
* Refactored function calls
* Removed DollLipstick
* Added DollMakeup class, allowing adding dynamic clothes tracking face states
* Added DollClothDynamic, allowing dynamic clothes tracking other cloth states with bangs support
* Added cache to frequently called functions, drastically reducing the overhead
* Added hash system, reducing clone redundancy
* Added layer modifiers support for all types (face, body, cum, clothes etc.)
* Added support for an arbitrary number of equipped multislot clothing items (makeup, tattoos, piercings, etc.)
* Simplified initialization for clothing items and dolls
* Simplified class function calls
* Reduced the number of image creation calls
* Added hue support for additional skin layers
* Added displayable support to image cropping function
* Replaced store cache with built-in functools cache for _list_files function
* Refactored all character files
* and more...
2023-01-14 23:04:54 +00:00
|
|
|
def rebuild_image(self):
|
|
|
|
self._image_cached = False
|
2022-05-16 23:48:22 +00:00
|
|
|
|
IO Overhaul, Refactoring, and more
* Refactored DollFace
* Refactored DollBody
* Refactored DollCum
* Refactored DollCloth
* Refactored Doll
* Refactored clothing item zorders
* Refactored implementation of body, face, cum, clothing layers
* Refactored function calls
* Removed DollLipstick
* Added DollMakeup class, allowing adding dynamic clothes tracking face states
* Added DollClothDynamic, allowing dynamic clothes tracking other cloth states with bangs support
* Added cache to frequently called functions, drastically reducing the overhead
* Added hash system, reducing clone redundancy
* Added layer modifiers support for all types (face, body, cum, clothes etc.)
* Added support for an arbitrary number of equipped multislot clothing items (makeup, tattoos, piercings, etc.)
* Simplified initialization for clothing items and dolls
* Simplified class function calls
* Reduced the number of image creation calls
* Added hue support for additional skin layers
* Added displayable support to image cropping function
* Replaced store cache with built-in functools cache for _list_files function
* Refactored all character files
* and more...
2023-01-14 23:04:54 +00:00
|
|
|
if renpy.showing(get_character_tag(self.name), layer=self.layer):
|
|
|
|
self.show()
|
2022-05-16 23:48:22 +00:00
|
|
|
|
IO Overhaul, Refactoring, and more
* Refactored DollFace
* Refactored DollBody
* Refactored DollCum
* Refactored DollCloth
* Refactored Doll
* Refactored clothing item zorders
* Refactored implementation of body, face, cum, clothing layers
* Refactored function calls
* Removed DollLipstick
* Added DollMakeup class, allowing adding dynamic clothes tracking face states
* Added DollClothDynamic, allowing dynamic clothes tracking other cloth states with bangs support
* Added cache to frequently called functions, drastically reducing the overhead
* Added hash system, reducing clone redundancy
* Added layer modifiers support for all types (face, body, cum, clothes etc.)
* Added support for an arbitrary number of equipped multislot clothing items (makeup, tattoos, piercings, etc.)
* Simplified initialization for clothing items and dolls
* Simplified class function calls
* Reduced the number of image creation calls
* Added hue support for additional skin layers
* Added displayable support to image cropping function
* Replaced store cache with built-in functools cache for _list_files function
* Refactored all character files
* and more...
2023-01-14 23:04:54 +00:00
|
|
|
def equip(self, obj, remove_old=True):
|
|
|
|
"""Takes DollCloth or DollOutfit object to equip."""
|
|
|
|
if isinstance(obj, DollCloth):
|
|
|
|
self._equip_cloth(obj)
|
2022-05-16 23:48:22 +00:00
|
|
|
elif isinstance(obj, DollOutfit):
|
|
|
|
if remove_old:
|
|
|
|
self.unequip("all")
|
IO Overhaul, Refactoring, and more
* Refactored DollFace
* Refactored DollBody
* Refactored DollCum
* Refactored DollCloth
* Refactored Doll
* Refactored clothing item zorders
* Refactored implementation of body, face, cum, clothing layers
* Refactored function calls
* Removed DollLipstick
* Added DollMakeup class, allowing adding dynamic clothes tracking face states
* Added DollClothDynamic, allowing dynamic clothes tracking other cloth states with bangs support
* Added cache to frequently called functions, drastically reducing the overhead
* Added hash system, reducing clone redundancy
* Added layer modifiers support for all types (face, body, cum, clothes etc.)
* Added support for an arbitrary number of equipped multislot clothing items (makeup, tattoos, piercings, etc.)
* Simplified initialization for clothing items and dolls
* Simplified class function calls
* Reduced the number of image creation calls
* Added hue support for additional skin layers
* Added displayable support to image cropping function
* Replaced store cache with built-in functools cache for _list_files function
* Refactored all character files
* and more...
2023-01-14 23:04:54 +00:00
|
|
|
for cloth in obj.group:
|
|
|
|
self._equip_cloth(cloth.parent, color=cloth.color)
|
2022-09-21 17:10:48 +00:00
|
|
|
elif isinstance(obj, (list, tuple)):
|
|
|
|
for cloth in obj:
|
IO Overhaul, Refactoring, and more
* Refactored DollFace
* Refactored DollBody
* Refactored DollCum
* Refactored DollCloth
* Refactored Doll
* Refactored clothing item zorders
* Refactored implementation of body, face, cum, clothing layers
* Refactored function calls
* Removed DollLipstick
* Added DollMakeup class, allowing adding dynamic clothes tracking face states
* Added DollClothDynamic, allowing dynamic clothes tracking other cloth states with bangs support
* Added cache to frequently called functions, drastically reducing the overhead
* Added hash system, reducing clone redundancy
* Added layer modifiers support for all types (face, body, cum, clothes etc.)
* Added support for an arbitrary number of equipped multislot clothing items (makeup, tattoos, piercings, etc.)
* Simplified initialization for clothing items and dolls
* Simplified class function calls
* Reduced the number of image creation calls
* Added hue support for additional skin layers
* Added displayable support to image cropping function
* Replaced store cache with built-in functools cache for _list_files function
* Refactored all character files
* and more...
2023-01-14 23:04:54 +00:00
|
|
|
self._equip_cloth(cloth)
|
2022-09-21 17:10:48 +00:00
|
|
|
|
2022-05-16 23:48:22 +00:00
|
|
|
self.body.rebuild_image()
|
|
|
|
self.rebuild_image()
|
|
|
|
self.rebuild_blacklist()
|
|
|
|
update_chibi(self.name)
|
|
|
|
|
IO Overhaul, Refactoring, and more
* Refactored DollFace
* Refactored DollBody
* Refactored DollCum
* Refactored DollCloth
* Refactored Doll
* Refactored clothing item zorders
* Refactored implementation of body, face, cum, clothing layers
* Refactored function calls
* Removed DollLipstick
* Added DollMakeup class, allowing adding dynamic clothes tracking face states
* Added DollClothDynamic, allowing dynamic clothes tracking other cloth states with bangs support
* Added cache to frequently called functions, drastically reducing the overhead
* Added hash system, reducing clone redundancy
* Added layer modifiers support for all types (face, body, cum, clothes etc.)
* Added support for an arbitrary number of equipped multislot clothing items (makeup, tattoos, piercings, etc.)
* Simplified initialization for clothing items and dolls
* Simplified class function calls
* Reduced the number of image creation calls
* Added hue support for additional skin layers
* Added displayable support to image cropping function
* Replaced store cache with built-in functools cache for _list_files function
* Refactored all character files
* and more...
2023-01-14 23:04:54 +00:00
|
|
|
def _equip_cloth(self, cloth, color=None):
|
|
|
|
if cloth.type in self.multislots:
|
|
|
|
for i in range(100):
|
|
|
|
multitype = cloth.type + str(i)
|
|
|
|
if multitype not in self.clothes or self.clothes[multitype][0] is None:
|
|
|
|
zorder = self.clothes[cloth.type][1]
|
|
|
|
self.clothes[multitype] = [cloth, zorder, True]
|
|
|
|
break
|
|
|
|
else:
|
|
|
|
zorder = self.clothes[cloth.type][1]
|
|
|
|
self.clothes[cloth.type] = [cloth, zorder, True]
|
|
|
|
|
|
|
|
if self.is_blacklisted(cloth.type):
|
|
|
|
self.unequip(*self.get_blacklister(cloth.type))
|
|
|
|
|
|
|
|
if cloth.blacklist:
|
|
|
|
self.unequip(*cloth.blacklist)
|
|
|
|
|
|
|
|
if self.pose:
|
|
|
|
cloth.set_pose(self.pose)
|
|
|
|
|
|
|
|
for tracking in self.get_trackers_list(cloth.type):
|
|
|
|
tracking.rebuild_image()
|
|
|
|
|
|
|
|
if isinstance(cloth, DollClothDynamic):
|
|
|
|
cloth.rebuild_image()
|
|
|
|
|
|
|
|
if color:
|
|
|
|
cloth.set_color(color)
|
|
|
|
|
2022-05-16 23:48:22 +00:00
|
|
|
def unequip(self, *args):
|
|
|
|
"""Takes argument(s) containing string cloth type(s) to unequip."""
|
|
|
|
if "all" in args:
|
2022-09-21 20:57:04 +00:00
|
|
|
for k, v in self.clothes.items():
|
2022-05-16 23:48:22 +00:00
|
|
|
if not k in self.blacklist_unequip:
|
|
|
|
if self.pose and v[0]:
|
|
|
|
v[0].set_pose(None)
|
|
|
|
v[0], v[2] = None, True
|
|
|
|
else:
|
|
|
|
for arg in args:
|
IO Overhaul, Refactoring, and more
* Refactored DollFace
* Refactored DollBody
* Refactored DollCum
* Refactored DollCloth
* Refactored Doll
* Refactored clothing item zorders
* Refactored implementation of body, face, cum, clothing layers
* Refactored function calls
* Removed DollLipstick
* Added DollMakeup class, allowing adding dynamic clothes tracking face states
* Added DollClothDynamic, allowing dynamic clothes tracking other cloth states with bangs support
* Added cache to frequently called functions, drastically reducing the overhead
* Added hash system, reducing clone redundancy
* Added layer modifiers support for all types (face, body, cum, clothes etc.)
* Added support for an arbitrary number of equipped multislot clothing items (makeup, tattoos, piercings, etc.)
* Simplified initialization for clothing items and dolls
* Simplified class function calls
* Reduced the number of image creation calls
* Added hue support for additional skin layers
* Added displayable support to image cropping function
* Replaced store cache with built-in functools cache for _list_files function
* Refactored all character files
* and more...
2023-01-14 23:04:54 +00:00
|
|
|
if isinstance(arg, DollCloth):
|
|
|
|
if arg.type in self.multislots:
|
|
|
|
slot = next((k for k, v in self.clothes.items() if v[0] == arg), None)
|
|
|
|
|
|
|
|
if not slot:
|
|
|
|
continue
|
|
|
|
|
|
|
|
if self.pose and self.clothes[slot][0]:
|
|
|
|
self.clothes[slot][0].set_pose(None)
|
|
|
|
self.clothes[slot][0] = None
|
|
|
|
else:
|
|
|
|
if self.pose and self.clothes[arg.type][0]:
|
|
|
|
self.clothes[arg.type][0].set_pose(None)
|
|
|
|
self.clothes[arg.type][0] = None
|
|
|
|
|
|
|
|
for tracking in self.get_trackers_list(arg.type):
|
|
|
|
tracking.rebuild_image()
|
|
|
|
else:
|
|
|
|
if arg in self.multislots:
|
|
|
|
for k, v in self.clothes.items():
|
|
|
|
if not k in self.blacklist_unequip and any((x in k) for x in self.multislots):
|
|
|
|
if self.pose and v[0]:
|
|
|
|
v[0].set_pose(None)
|
|
|
|
v[0], v[2] = None, True
|
|
|
|
else:
|
|
|
|
if not arg in self.blacklist_unequip:
|
|
|
|
if self.pose and self.clothes[arg][0]:
|
|
|
|
self.clothes[arg][0].set_pose(None)
|
|
|
|
self.clothes[arg][0] = None
|
|
|
|
|
|
|
|
|
2022-05-16 23:48:22 +00:00
|
|
|
|
|
|
|
self.body.rebuild_image()
|
|
|
|
self.rebuild_image()
|
|
|
|
self.rebuild_blacklist()
|
|
|
|
update_chibi(self.name)
|
|
|
|
|
|
|
|
def get_equipped(self, type):
|
|
|
|
"""Takes argument containing string cloth type. Returns equipped object for cloth type."""
|
|
|
|
return self.clothes[type][0]
|
|
|
|
|
|
|
|
def get_equipped_item(self, items):
|
|
|
|
"""Returns first equipped item from a list or None."""
|
|
|
|
for i in items:
|
|
|
|
if self.is_equipped_item(i):
|
|
|
|
return i
|
|
|
|
return None
|
|
|
|
|
|
|
|
def strip(self, *args):
|
|
|
|
"""Takes argument(s) containing string cloth type(s) to temporarily displace (hide)."""
|
|
|
|
if "all" in args:
|
2022-09-21 20:57:04 +00:00
|
|
|
for k, v in self.clothes.items():
|
2022-05-16 23:48:22 +00:00
|
|
|
if not k.startswith(self.blacklist_toggles):
|
|
|
|
v[2] = False
|
|
|
|
else:
|
|
|
|
for arg in args:
|
|
|
|
if arg in self.multislots:
|
2022-09-21 20:57:04 +00:00
|
|
|
for k, v in self.clothes.items():
|
2022-05-16 23:48:22 +00:00
|
|
|
if k.startswith(arg):
|
|
|
|
v[2] = False
|
|
|
|
else:
|
|
|
|
self.clothes[arg][2] = False
|
|
|
|
self.body.rebuild_image()
|
|
|
|
self.rebuild_image()
|
|
|
|
update_chibi(self.name)
|
|
|
|
|
|
|
|
def wear(self, *args):
|
|
|
|
"""Takes argument(s) containing string cloth type(s) to put on (unhide)."""
|
|
|
|
if "all" in args:
|
|
|
|
if self.is_worn("all"):
|
|
|
|
return
|
|
|
|
|
2022-09-21 20:57:04 +00:00
|
|
|
for v in self.clothes.values():
|
2022-05-16 23:48:22 +00:00
|
|
|
v[2] = True
|
|
|
|
else:
|
|
|
|
for arg in args:
|
|
|
|
if arg in self.multislots:
|
2022-09-21 20:57:04 +00:00
|
|
|
for k, v in self.clothes.items():
|
2022-05-16 23:48:22 +00:00
|
|
|
if k.startswith(arg):
|
|
|
|
v[2] = True
|
|
|
|
else:
|
|
|
|
self.clothes[arg][2] = True
|
|
|
|
self.body.rebuild_image()
|
|
|
|
self.rebuild_image()
|
|
|
|
update_chibi(self.name)
|
|
|
|
|
|
|
|
def is_equipped(self, *args):
|
|
|
|
"""Takes argument containing string cloth type. Returns True if slot is occupied, False otherwise."""
|
|
|
|
for arg in args:
|
|
|
|
if arg in self.multislots:
|
2022-09-21 20:57:04 +00:00
|
|
|
return any(bool(v[0]) for k, v in self.clothes.items() if k.startswith(arg))
|
2022-05-16 23:48:22 +00:00
|
|
|
else:
|
|
|
|
if not self.clothes[arg][0]:
|
|
|
|
return False
|
|
|
|
return True
|
|
|
|
|
|
|
|
def is_any_equipped(self, *args):
|
|
|
|
"""Takes arguments containing string cloth types. Returns True if ANY of them is equipped, False otherwise."""
|
|
|
|
if "clothes" in args:
|
2022-09-21 20:57:04 +00:00
|
|
|
for k, v in self.clothes.items():
|
2022-05-16 23:48:22 +00:00
|
|
|
if not k.startswith(self.blacklist_toggles):
|
|
|
|
if self.is_equipped(k):
|
|
|
|
return True
|
|
|
|
else:
|
|
|
|
for arg in args:
|
|
|
|
if self.is_equipped(arg):
|
|
|
|
return True
|
|
|
|
return False
|
|
|
|
|
|
|
|
def is_equipped_item(self, item):
|
|
|
|
"""Takes DollCloth object or list of objects. Returns True if item is equipped, False otherwise."""
|
IO Overhaul, Refactoring, and more
* Refactored DollFace
* Refactored DollBody
* Refactored DollCum
* Refactored DollCloth
* Refactored Doll
* Refactored clothing item zorders
* Refactored implementation of body, face, cum, clothing layers
* Refactored function calls
* Removed DollLipstick
* Added DollMakeup class, allowing adding dynamic clothes tracking face states
* Added DollClothDynamic, allowing dynamic clothes tracking other cloth states with bangs support
* Added cache to frequently called functions, drastically reducing the overhead
* Added hash system, reducing clone redundancy
* Added layer modifiers support for all types (face, body, cum, clothes etc.)
* Added support for an arbitrary number of equipped multislot clothing items (makeup, tattoos, piercings, etc.)
* Simplified initialization for clothing items and dolls
* Simplified class function calls
* Reduced the number of image creation calls
* Added hue support for additional skin layers
* Added displayable support to image cropping function
* Replaced store cache with built-in functools cache for _list_files function
* Refactored all character files
* and more...
2023-01-14 23:04:54 +00:00
|
|
|
if item.is_multislot():
|
|
|
|
return bool(next((k for k, v in self.clothes.items() if v[0] == item), False))
|
|
|
|
|
2022-05-16 23:48:22 +00:00
|
|
|
return self.get_equipped(item.type) == item
|
|
|
|
|
|
|
|
def is_worn(self, *args):
|
|
|
|
"""Takes argument(s) containing string cloth type(s). Returns True if worn, False otherwise."""
|
|
|
|
if "all" in args:
|
2022-09-21 20:57:04 +00:00
|
|
|
for v in self.clothes.values():
|
2022-05-16 23:48:22 +00:00
|
|
|
if not v[2]:
|
|
|
|
return False
|
|
|
|
else:
|
|
|
|
for arg in args:
|
|
|
|
if arg in self.multislots:
|
2022-09-21 20:57:04 +00:00
|
|
|
return any( (v[0] and v[2]) for k, v in self.clothes.items() if k.startswith(arg))
|
2022-05-16 23:48:22 +00:00
|
|
|
else:
|
|
|
|
if not self.clothes[arg][0] or not self.clothes[arg][2]:
|
|
|
|
return False
|
|
|
|
return True
|
|
|
|
|
|
|
|
def is_any_worn(self, *args):
|
|
|
|
"""Takes arguments containing string cloth types. Returns True if ANY of them is worn, False otherwise."""
|
|
|
|
if "clothes" in args:
|
2022-09-21 20:57:04 +00:00
|
|
|
for k, v in self.clothes.items():
|
2022-05-16 23:48:22 +00:00
|
|
|
if not k.startswith(self.blacklist_toggles):
|
|
|
|
if self.is_worn(k):
|
|
|
|
return True
|
|
|
|
else:
|
|
|
|
for arg in args:
|
|
|
|
if self.is_worn(arg):
|
|
|
|
return True
|
|
|
|
return False
|
|
|
|
|
IO Overhaul, Refactoring, and more
* Refactored DollFace
* Refactored DollBody
* Refactored DollCum
* Refactored DollCloth
* Refactored Doll
* Refactored clothing item zorders
* Refactored implementation of body, face, cum, clothing layers
* Refactored function calls
* Removed DollLipstick
* Added DollMakeup class, allowing adding dynamic clothes tracking face states
* Added DollClothDynamic, allowing dynamic clothes tracking other cloth states with bangs support
* Added cache to frequently called functions, drastically reducing the overhead
* Added hash system, reducing clone redundancy
* Added layer modifiers support for all types (face, body, cum, clothes etc.)
* Added support for an arbitrary number of equipped multislot clothing items (makeup, tattoos, piercings, etc.)
* Simplified initialization for clothing items and dolls
* Simplified class function calls
* Reduced the number of image creation calls
* Added hue support for additional skin layers
* Added displayable support to image cropping function
* Replaced store cache with built-in functools cache for _list_files function
* Refactored all character files
* and more...
2023-01-14 23:04:54 +00:00
|
|
|
def set_face(self, *args, **kwargs):
|
|
|
|
self.face.set_face(*args, **kwargs)
|
|
|
|
makeup = next((v[0] for v in self.clothes.values() if v[0] and v[2] and isinstance(v[0], DollMakeup)), None)
|
2022-05-16 23:48:22 +00:00
|
|
|
|
IO Overhaul, Refactoring, and more
* Refactored DollFace
* Refactored DollBody
* Refactored DollCum
* Refactored DollCloth
* Refactored Doll
* Refactored clothing item zorders
* Refactored implementation of body, face, cum, clothing layers
* Refactored function calls
* Removed DollLipstick
* Added DollMakeup class, allowing adding dynamic clothes tracking face states
* Added DollClothDynamic, allowing dynamic clothes tracking other cloth states with bangs support
* Added cache to frequently called functions, drastically reducing the overhead
* Added hash system, reducing clone redundancy
* Added layer modifiers support for all types (face, body, cum, clothes etc.)
* Added support for an arbitrary number of equipped multislot clothing items (makeup, tattoos, piercings, etc.)
* Simplified initialization for clothing items and dolls
* Simplified class function calls
* Reduced the number of image creation calls
* Added hue support for additional skin layers
* Added displayable support to image cropping function
* Replaced store cache with built-in functools cache for _list_files function
* Refactored all character files
* and more...
2023-01-14 23:04:54 +00:00
|
|
|
if makeup:
|
|
|
|
makeup.rebuild_image()
|
|
|
|
self.rebuild_image()
|
2022-05-16 23:48:22 +00:00
|
|
|
|
|
|
|
def get_face(self):
|
|
|
|
"""Returns a dictionary containing currently set facial expressions. Used in character studio."""
|
|
|
|
return self.face.get_face()
|
|
|
|
|
IO Overhaul, Refactoring, and more
* Refactored DollFace
* Refactored DollBody
* Refactored DollCum
* Refactored DollCloth
* Refactored Doll
* Refactored clothing item zorders
* Refactored implementation of body, face, cum, clothing layers
* Refactored function calls
* Removed DollLipstick
* Added DollMakeup class, allowing adding dynamic clothes tracking face states
* Added DollClothDynamic, allowing dynamic clothes tracking other cloth states with bangs support
* Added cache to frequently called functions, drastically reducing the overhead
* Added hash system, reducing clone redundancy
* Added layer modifiers support for all types (face, body, cum, clothes etc.)
* Added support for an arbitrary number of equipped multislot clothing items (makeup, tattoos, piercings, etc.)
* Simplified initialization for clothing items and dolls
* Simplified class function calls
* Reduced the number of image creation calls
* Added hue support for additional skin layers
* Added displayable support to image cropping function
* Replaced store cache with built-in functools cache for _list_files function
* Refactored all character files
* and more...
2023-01-14 23:04:54 +00:00
|
|
|
# def set_body(self, **kwargs):
|
|
|
|
# OBSOLETE! the code in scripts needs to be changed
|
|
|
|
# """Takes keyword argument(s) with the string name of body part file(s)."""
|
|
|
|
# if self.body.set_body(**kwargs):
|
|
|
|
# self.rebuild_image()
|
2022-05-16 23:48:22 +00:00
|
|
|
|
|
|
|
def set_body_hue(self, arg):
|
|
|
|
"""Takes integer between 0 - 359, rotates the character body colour by given amount."""
|
IO Overhaul, Refactoring, and more
* Refactored DollFace
* Refactored DollBody
* Refactored DollCum
* Refactored DollCloth
* Refactored Doll
* Refactored clothing item zorders
* Refactored implementation of body, face, cum, clothing layers
* Refactored function calls
* Removed DollLipstick
* Added DollMakeup class, allowing adding dynamic clothes tracking face states
* Added DollClothDynamic, allowing dynamic clothes tracking other cloth states with bangs support
* Added cache to frequently called functions, drastically reducing the overhead
* Added hash system, reducing clone redundancy
* Added layer modifiers support for all types (face, body, cum, clothes etc.)
* Added support for an arbitrary number of equipped multislot clothing items (makeup, tattoos, piercings, etc.)
* Simplified initialization for clothing items and dolls
* Simplified class function calls
* Reduced the number of image creation calls
* Added hue support for additional skin layers
* Added displayable support to image cropping function
* Replaced store cache with built-in functools cache for _list_files function
* Refactored all character files
* and more...
2023-01-14 23:04:54 +00:00
|
|
|
self.body.hue = HueMatrix(arg)
|
2022-05-16 23:48:22 +00:00
|
|
|
self.body.rebuild_image()
|
|
|
|
self.rebuild_image()
|
|
|
|
|
IO Overhaul, Refactoring, and more
* Refactored DollFace
* Refactored DollBody
* Refactored DollCum
* Refactored DollCloth
* Refactored Doll
* Refactored clothing item zorders
* Refactored implementation of body, face, cum, clothing layers
* Refactored function calls
* Removed DollLipstick
* Added DollMakeup class, allowing adding dynamic clothes tracking face states
* Added DollClothDynamic, allowing dynamic clothes tracking other cloth states with bangs support
* Added cache to frequently called functions, drastically reducing the overhead
* Added hash system, reducing clone redundancy
* Added layer modifiers support for all types (face, body, cum, clothes etc.)
* Added support for an arbitrary number of equipped multislot clothing items (makeup, tattoos, piercings, etc.)
* Simplified initialization for clothing items and dolls
* Simplified class function calls
* Reduced the number of image creation calls
* Added hue support for additional skin layers
* Added displayable support to image cropping function
* Replaced store cache with built-in functools cache for _list_files function
* Refactored all character files
* and more...
2023-01-14 23:04:54 +00:00
|
|
|
# def set_body_zorder(self, **kwargs):
|
|
|
|
# OBSOLETE! the code in scripts needs to be changed
|
|
|
|
# """Takes keyword argument(s) with the name(s) of body part(s) and integer value(s)"""
|
|
|
|
# if self.body.set_zorder(**kwargs):
|
|
|
|
# self.rebuild_image()
|
2022-05-16 23:48:22 +00:00
|
|
|
|
|
|
|
def set_cum(self, *args, **kwargs):
|
|
|
|
"""Takes keyword argument(s) containing string name(s) of cum layers to apply or None."""
|
IO Overhaul, Refactoring, and more
* Refactored DollFace
* Refactored DollBody
* Refactored DollCum
* Refactored DollCloth
* Refactored Doll
* Refactored clothing item zorders
* Refactored implementation of body, face, cum, clothing layers
* Refactored function calls
* Removed DollLipstick
* Added DollMakeup class, allowing adding dynamic clothes tracking face states
* Added DollClothDynamic, allowing dynamic clothes tracking other cloth states with bangs support
* Added cache to frequently called functions, drastically reducing the overhead
* Added hash system, reducing clone redundancy
* Added layer modifiers support for all types (face, body, cum, clothes etc.)
* Added support for an arbitrary number of equipped multislot clothing items (makeup, tattoos, piercings, etc.)
* Simplified initialization for clothing items and dolls
* Simplified class function calls
* Reduced the number of image creation calls
* Added hue support for additional skin layers
* Added displayable support to image cropping function
* Replaced store cache with built-in functools cache for _list_files function
* Refactored all character files
* and more...
2023-01-14 23:04:54 +00:00
|
|
|
self.cum.set_cum(*args, **kwargs)
|
|
|
|
self.rebuild_image()
|
2022-05-16 23:48:22 +00:00
|
|
|
|
|
|
|
def set_pose(self, pose):
|
|
|
|
if pose is None or renpy.loadable("characters/{}/poses/{}/loadable.webp".format(self.name, pose)):
|
|
|
|
self.pose = pose
|
|
|
|
self.face.set_pose(pose)
|
|
|
|
self.body.set_pose(pose)
|
|
|
|
self.cum.set_pose(pose)
|
2022-09-21 20:57:04 +00:00
|
|
|
for v in self.clothes.values():
|
2022-05-16 23:48:22 +00:00
|
|
|
if v[0]:
|
|
|
|
v[0].set_pose(pose)
|
|
|
|
self.rebuild_image()
|
|
|
|
else:
|
|
|
|
raise Exception("'{}' pose doesn't exist for character named '{}'.".format(pose, self.name))
|
|
|
|
|
|
|
|
def rebuild_blacklist(self):
|
|
|
|
blacklist = []
|
2022-09-21 20:57:04 +00:00
|
|
|
for v in self.clothes.values():
|
2022-05-16 23:48:22 +00:00
|
|
|
if v[0]:
|
|
|
|
blacklist.extend(v[0].blacklist)
|
|
|
|
self.blacklist = list(set(blacklist))
|
|
|
|
|
|
|
|
def is_blacklisted(self, type):
|
|
|
|
"""Takes string cloth type. Returns True if cloth type is blacklisted."""
|
|
|
|
return True if type in self.blacklist else False
|
|
|
|
|
|
|
|
def get_blacklister(self, type):
|
|
|
|
"""Takes string cloth type. Returns a list of clothing types that report incompatibility."""
|
2022-09-21 20:57:04 +00:00
|
|
|
return [x[0].type for x in self.clothes.values() if x[0] and type in x[0].blacklist]
|
2022-05-16 23:48:22 +00:00
|
|
|
|
IO Overhaul, Refactoring, and more
* Refactored DollFace
* Refactored DollBody
* Refactored DollCum
* Refactored DollCloth
* Refactored Doll
* Refactored clothing item zorders
* Refactored implementation of body, face, cum, clothing layers
* Refactored function calls
* Removed DollLipstick
* Added DollMakeup class, allowing adding dynamic clothes tracking face states
* Added DollClothDynamic, allowing dynamic clothes tracking other cloth states with bangs support
* Added cache to frequently called functions, drastically reducing the overhead
* Added hash system, reducing clone redundancy
* Added layer modifiers support for all types (face, body, cum, clothes etc.)
* Added support for an arbitrary number of equipped multislot clothing items (makeup, tattoos, piercings, etc.)
* Simplified initialization for clothing items and dolls
* Simplified class function calls
* Reduced the number of image creation calls
* Added hue support for additional skin layers
* Added displayable support to image cropping function
* Replaced store cache with built-in functools cache for _list_files function
* Refactored all character files
* and more...
2023-01-14 23:04:54 +00:00
|
|
|
def get_trackers_list(self, type):
|
|
|
|
"""Takes string cloth type. Returns a list of clothing types that report incompatibility."""
|
|
|
|
return [x[0] for x in self.clothes.values() if isinstance(x[0], DollClothDynamic) and type == x[0].tracking]
|
|
|
|
|
2022-05-16 23:48:22 +00:00
|
|
|
def create_outfit(self, temp=False):
|
|
|
|
"""Creates a copy of the current character clothes and stores it."""
|
2022-09-21 20:57:04 +00:00
|
|
|
return DollOutfit([x[0] for x in self.clothes.values() if x[0]], True, temp=temp)
|
2022-05-16 23:48:22 +00:00
|
|
|
|
|
|
|
def import_outfit(self, path, fromfile=True):
|
|
|
|
"""Imports outfit from .png file or clipboard text."""
|
|
|
|
# Grab data
|
|
|
|
if fromfile:
|
|
|
|
try:
|
|
|
|
imported = image_payload.decode(path)
|
|
|
|
except:
|
|
|
|
if image_payload._file:
|
|
|
|
image_payload._file.close()
|
|
|
|
renpy.notify("Import failed: Corrupted file.")
|
|
|
|
return None
|
|
|
|
else:
|
|
|
|
imported = get_clipboard()
|
|
|
|
|
|
|
|
# Evaluate data
|
|
|
|
if imported:
|
|
|
|
try:
|
|
|
|
imported = make_revertable(evaluate(imported))
|
|
|
|
except:
|
|
|
|
renpy.notify("Import failed: Corrupted outfit data.")
|
|
|
|
renpy.block_rollback()
|
|
|
|
return None
|
|
|
|
|
|
|
|
group = []
|
|
|
|
|
|
|
|
for i, x in enumerate(imported):
|
|
|
|
if i == 0 and not x == self.name:
|
|
|
|
renpy.notify("Import failed: Wrong character.")
|
|
|
|
return None
|
|
|
|
|
|
|
|
for o in self.wardrobe_list:
|
|
|
|
if x[0] == o.id:
|
|
|
|
if not o.unlocked and not game.cheats:
|
|
|
|
renpy.notify("Import failed: You don't own these items. Buy them first.")
|
|
|
|
return None
|
|
|
|
|
|
|
|
x[0] = o.clone()
|
|
|
|
x[0].set_color(x[1])
|
|
|
|
group.append(x[0])
|
|
|
|
|
|
|
|
if group:
|
|
|
|
renpy.notify("Import successful!")
|
|
|
|
return DollOutfit(group, True)
|
|
|
|
renpy.notify("Import failed: Unknown error.")
|
|
|
|
return None
|
|
|
|
|
|
|
|
def get_schedule(self):
|
|
|
|
"""Returns a list of outfits available for current time of day and weather conditions."""
|
|
|
|
schedule = []
|
|
|
|
|
|
|
|
for o in self.outfits:
|
|
|
|
if o.unlocked and o.schedule["day" if game.daytime else "night"]:
|
|
|
|
if game.weather == "overcast" and o.schedule["cloudy"]:
|
|
|
|
schedule.append(o)
|
|
|
|
elif game.weather in {"storm", "rain"} and o.schedule["rainy"]:
|
|
|
|
schedule.append(o)
|
|
|
|
elif game.weather in {"snow", "blizzard"} and o.schedule["snowy"]:
|
|
|
|
schedule.append(o)
|
|
|
|
elif game.weather in {"clear", "cloudy"} and not (o.schedule["cloudy"] or o.schedule["rainy"] or o.schedule["snowy"]):
|
|
|
|
schedule.append(o)
|
|
|
|
return schedule
|
|
|
|
|
|
|
|
def equip_random_outfit(self):
|
|
|
|
"""Equips random outfit based on Outfits Schedule."""
|
|
|
|
schedule = self.get_schedule()
|
|
|
|
|
|
|
|
if schedule:
|
|
|
|
self.equip(renpy.random.choice(schedule))
|
|
|
|
|
|
|
|
def set_emote(self, emote):
|
|
|
|
|
|
|
|
if not emote and not isinstance(emote, Null):
|
|
|
|
self.emote = Null()
|
|
|
|
return
|
|
|
|
|
|
|
|
if self.pose:
|
|
|
|
path = "characters/{}/poses/{}/emote/{}.webp".format(self.name, self.pose, emote)
|
|
|
|
else:
|
|
|
|
path = "characters/{}/emote/{}.webp".format(self.name, emote)
|
|
|
|
|
IO Overhaul, Refactoring, and more
* Refactored DollFace
* Refactored DollBody
* Refactored DollCum
* Refactored DollCloth
* Refactored Doll
* Refactored clothing item zorders
* Refactored implementation of body, face, cum, clothing layers
* Refactored function calls
* Removed DollLipstick
* Added DollMakeup class, allowing adding dynamic clothes tracking face states
* Added DollClothDynamic, allowing dynamic clothes tracking other cloth states with bangs support
* Added cache to frequently called functions, drastically reducing the overhead
* Added hash system, reducing clone redundancy
* Added layer modifiers support for all types (face, body, cum, clothes etc.)
* Added support for an arbitrary number of equipped multislot clothing items (makeup, tattoos, piercings, etc.)
* Simplified initialization for clothing items and dolls
* Simplified class function calls
* Reduced the number of image creation calls
* Added hue support for additional skin layers
* Added displayable support to image cropping function
* Replaced store cache with built-in functools cache for _list_files function
* Refactored all character files
* and more...
2023-01-14 23:04:54 +00:00
|
|
|
self.emote = Image(path)
|