Is the way to handle this type of thing, never attempt to make a renpy game, stick to printing out hello world.
So, I found the segment, and yes, this is valid and correct. There's nothing wrong with this code. Is this the only way? Of course not. But that's not what I said. But according to programming 101, this is valid.
Code:
if Girl.Event[1] == 1:
#first time through. . .
if Girl is RogueX:
$ Girl.FaceChange("bemused")
ch_r "Oh, hey there [Girl.Petname]. You seem to be fitting in well. . ."
if not Girl.Kissed:
ch_r "Look, since the other day when I first. . . touched you,"
else:
ch_r "Look, since the other day when I first. . . kissed you,"
ch_r "I've had this kind of. . . buzz. At first I thought it was just from finally being able to touch someone,"
$ Girl.Eyes = "sexy"
ch_r "But I think maybe. . . could I touch you again?"
elif Girl is KittyX:
$ Girl.FaceChange("bemused",2)
ch_k "Oh. . . hey, [Girl.Petname]. I've been thinking. . ."
if not Girl.Kissed:
ch_k "Look, since a while back when I first. . . touched you,"
else:
ch_k "Look, since a while back when I first. . . kissed you,"
ch_k "I've kinda been thinking. . . feeling a little odd. . ."
$ Girl.Eyes = "side"
ch_k "Would you mind if I touched you again real quick?"
elif Girl is EmmaX:
$ Girl.FaceChange("bemused")
ch_e "Oh, hello [Girl.Petname]. . ."
ch_e "You've been doing well in your studies, it seems. . ."
ch_e "Look, since the other day when we first. . . came into contact. . ."
$ Girl.FaceChange("sadside",1,Brows="angry")
ch_e "I've been. . . struggling with something."
ch_e "A feeling. . ."
$ Girl.Eyes = "sexy"
ch_e "I was thinking perhaps that. . . touching you again might help?"
I'll explain why:
First, this is a one off event. You'll never run into this dialogue again for a girl. This means that if you're making a function to handle this section, you're actually adding more computational work. Every function is a jump in ASM code. Every function has overhead. It's a very small one, but it still exists. Which means for one off statements, it's actually computationally faster to just stick a if-else and done with it since if-elses don't push things to the stack. This is the same reason why people will define certain functions as macros in C++. Because at compile time, instead of introducing jumps and having to context load/shift, the compiler will just copy and paste that block of code into the ASM.
Second, as I mentioned, something like this can be done via a switch, but a switch doesn't exist.
Third, each dialogue is unique. No repetition. Meaning calling the same function to then find the girl, then find the varying dialogue and reactions means you'd have to write the same block for each girl anyways due to the fact something like this and renpy's format. Renpy isn't like Unity or other game engines where you can just pipe a block of text from a dialogue tree into a dialogue box and expect auto formatting or parsing.
Are there better ways to do this? Maybe. It's arguable. One can define these into a separate file and jump to it then jump back. But, as I've mentioned with functions, there's a computational cost. There's also the human readability aspect to it too. Like, it's technically faster for the computer to run spaghetti code because there's less characters for the language parser to read through. But it's hell for the programmer to follow and maintain later on. Which is why programmers don't do spaghetti code. In a scripting/interpreted language like Python, this is even more prevalent as the script is the code. Readability is one of the main selling points. Separating every dialogue into it's own file can be more organized file-wise, but it can be argued that it'll be harder for a human to follow and maintain because you'll have to open 3~4 files just to follow one path of dialogue. Any advantage of file organization and neat looking code is directly in contrast to speed in developement because it's easy to go "Everyone's intro dialogue is in this 1 file and 1 block. I can compare and contrast or just add a new block." So, instead of spending a minute or two to find every block or run a:
find ./game -iname "*_dialogue.rpy" -exec filelist+=" "{} \; diff $filelist
you can just do:
vim ./game/script\ Addiction.rpy
Now, is this the perfect way to do this? No. Can it be optimized? Maybe. But there's also the school of thought for running optimization for a code that whose big O is only a constant (As in, not even n. Just a constant like 6.). The benefit vs. time taken to optimize is very small. A literal drop in the bucket compared to all the stuff.
The simplest way to do optimize this code and maintain both readability and speed (i.e. no logical jumps) would have been a switch statement. But, again, they don't exist in renpy.
So, yes, this is valid. There's nothing inherently wrong with this code. There are other code in this game (and many other renpy games) that are WAAAY worse. But the foundation of coding is the if-else statement. To say a literal use of them is a bad thing is to deny that, in ASM, there are no object inheritence. There are no class interfaces. The most basic logic gate after the NOT gate is probably the XOR gate. And if-else is the C++ and higher level analog of that.