From c8e4f2b6178cf0b826be3b54fa1791b1c6e045d1 Mon Sep 17 00:00:00 2001 From: russm Date: Sat, 15 Feb 2025 18:57:23 -0500 Subject: [PATCH] Updated PC naming code so that the PC cannot have the name of any NPCs --- BytesOfLove/game/script.rpy | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/BytesOfLove/game/script.rpy b/BytesOfLove/game/script.rpy index 1bb7831..4e358c9 100644 --- a/BytesOfLove/game/script.rpy +++ b/BytesOfLove/game/script.rpy @@ -236,12 +236,16 @@ label start: "This is an educational dating simulator where you build relationships with other programming languages that are represented as anime-style characters." "Throughout the game, these characters will immerse you into computer science and the college experience." "The choices you make will affect your standing with other characters and influence the events you experience." + $ npcs = ['Rust', 'Java', 'Cpp' ,'Python' ,'Javascript' ,'Perl', 'Html', 'Fish', 'Ruby', 'Matlab'] default check = True while check: $ mc = renpy.input("Your name: ", length=12).strip() if mc.isalpha() and " " not in mc: - $ mc = mc.capitalize() - $ check = False + if mc.capitalize() in npcs: + "You cannot enter this name. Please enter a different name" + else: + $ mc = mc.capitalize() + $ check = False elif not mc: "Please enter a name" else: