My problem is here:
Code: Select all
init python:
class PointLocker(object):
def __init__(self):
self.dp = 0
self.np = 0
def ch_pts(self, type, num):
if num >= 0:
start = "{color=#6abd45}{size=30}+"
else:
start = "{color=#ed2024}{size=30}"
end = "{/size}{/color}{color=#ffee2e}{size=12}%s{/size}{/color}{image=images/menu/heart_icon.png}" % ("DIDAC" if type == 'dp' else "NEUS")
message = "%s %d %s" % (start, num, end)
if type == "dp":
self.dp += num
else:
self.np += num
renpy.show_screen("Outer_{}Screen".format(type), message)
Code: Select all
% ("DIDAC" if type == 'dp' else "NEUS")
In this code, it's restricted to 2 variables.
I want to have several but when I remove the "Else" and add stuff like "If" or "elif" it simply gives me a syntax error.
Is there a way to add more than those two after the % sign? This here to be specific ("DIDAC" if type == 'dp' else "NEUS"). I spent several hours now and I'm out of ideas. Only thing I can think of is rewriting the code but I won't make anything as good as troopers so I want to ask for a bit of help before giving up.
*edit* To clarify it a bit more;
I want all of these "aaaa" if type == 'aa', "bbbb" if type == 'bb', "cccc" if type == 'cc' etc in the same line as where the original is.