- Dec 25, 2019
- 1,856
- 3,330
What that even mean? I'm asking in a general way, cause this potentially could ruin at all this mod if ppl start simply obfuscating their stats: for exemple:You're the one correlating the names based on devs that try to make an affection system looks the same as one from (more popular game), but work completely differently under the hood. Nothing forces devs to use the same system, and some of the garbage posted in this thread shows they definitely don't. "The dev isn't supposed to be doing that, it breaks renpy" happens often in this thread.
Code:
INTERNAL_TO_LABEL = {
"fitness": "Sportiness",
"power": "Strength"
}
class Attributes:
def __init__(self, initial_values=None):
self._values = {key: 0 for key in INTERNAL_TO_LABEL}
if initial_values:
for key, value in initial_values.items():
if key in self._values:
self._values[key] = value
def increase(self, key, amount=1):
if key in self._values:
self._values[key] += amount
def decrease(self, key, amount=1):
if key in self._values:
self._values[key] -= amount
def get_value(self, key):
return self._values.get(key)
def __str__(self):
return "\n".join(
f"{INTERNAL_TO_LABEL[key]}: {self._values[key]}"
for key in self._values
)
Last edited: