- הוסף לסימניות
- #1
אם מישהוא יכול לעשות לי מהקוד הזה קישור להורדה אני אשמח תודה
world = {
"כיכר הכניסה": {
"description": "אתם עומדים בכיכר הכניסה המרכזית של העיר העתיקה. שער גדול ניצב מצפון, ושבילים מתפצלים מזרחה ומערבה.",
"items": [],
"characters": ["קבוצת אנשים לבושים בלבוש עתיק"],
"exits": {"צפון": "שער העיר", "מזרח": "השוק הישן", "מערב": "החצר האחורית", "דרום": "הנמל"}
},
"שער העיר": {
"description": "שער אבן עתיק ומרשים. נראה שפעם הגן על הכניסה הראשית לעיר.",
"items": [],
"characters": [],
"exits": {"דרום": "כיכר הכניסה"}
},
"השוק הישן": {
"description": "שוק הומה אדם, דוכנים צבעוניים מציעים מגוון סחורות. אוויר מלא בריחות תבלינים וקולות רוכלים.",
"items": ["ארנק קטן"],
"characters": ["מוכר תבלינים", "קבצן", "כמה אנשים לבושים בלבוש מסורתי"],
"exits": {"מערב": "כיכר הכניסה", "מזרח": "המקדש הנטוש"}
},
"החצר האחורית": {
"description": "חצר מוזנחת עם באר יבשה וכמה ארגזים ישנים.",
"items": ["חבל קצר"],
"characters": [],
"exits": {"מזרח": "כיכר הכניסה"}
},
"המקדש הנטוש": {
"description": "מקדש עתיק ועזוב, צמחייה פראית מטפסת על קירותיו המתפוררים. נשמעים צלילי רוח חזקים.",
"items": [],
"characters": ["נזיר זקן", "שומר המקדש הזועם"],
"exits": {"מערב": "השוק הישן", "פנים": "חדר סודי במקדש"}
},
"חדר סודי במקדש": {
"description": "חדר קטן וחשוך בתוך המקדש הנטוש. על הרצפה פזורים חפצים מוזרים.",
"items": ["אוצר עתיק"],
"characters": [],
"exits": {"חוץ": "המקדש הנטוש"}
},
"הנמל": {
"description": "נמל שוקק חיים, רעש גלים מתנפצים על הרציף וקריאות מלחים באוויר. ספינות רבות עוגנות כאן.",
"items": ["חבל עבה", "תיבת עץ"],
"characters": ["ספן שיכור", "סוחר", "קבוצת אנשים לבושים בלבוש עתיק"],
"exits": {"צפון": "כיכר הכניסה"}
}
}
current_location = "כיכר הכניסה"
inventory = ["חרב ישנה"] # השחקן מתחיל עם חרב
tasks = {}
has_defeated_guardian = False
def give_task(task_name, description):
tasks[task_name] = {"status": "לא התחיל", "description": description}
print(f"קיבלת משימה חדשה: {description}")
def display_location(location):
print(world[location]["description"])
if world[location]["items"]:
print(f"בחדר ישנם הפריטים הבאים: {', '.join(world[location]['items'])}")
if world[location]["characters"]:
characters_in_room = [char for char in world[location]["characters"] if char != "שומר המקדש הזועם" or not has_defeated_guardian]
if characters_in_room:
print(f"בחדר נמצאות הדמויות הבאות: {', '.join(characters_in_room)}")
if location == "הנמל":
print("בנמל עוגנות ספינות רבות בגדלים שונים.")
if inventory:
print(f"בתיק שלך ישנם הפריטים הבאים: {', '.join(inventory)}")
if tasks:
print("המשימות שלך:")
for task_name, task_info in tasks.items():
print(f"- {task_info['description']} (סטטוס: {task_info['status']})")
# מתן המשימה בתחילת המשחק
give_task("מצא את האוצר העתיק", "עליך למצוא את האוצר העתיק החבוי בחדר הסודי שבמקדש הנטוש.")
while True:
display_location(current_location)
command = input("מה תרצה לעשות? (צ, ד, מ, מע, פ, ח, אוסף [פריט], השתמש [פריט], דבר עם [דמות], התקפה, יציאה): ").lower().split()
if not command:
continue
action = command[0]
if action == "יציאה":
break
elif action in ["צ", "ד", "מ", "מע", "פ", "ח"]:
direction = ""
if action == "צ":
direction = "צפון"
elif action == "ד":
direction = "דרום"
elif action == "מ":
direction = "מזרח"
elif action == "מע":
direction = "מערב"
elif action == "פ":
direction = "פנים"
elif action == "ח":
direction = "חוץ"
if current_location == "המקדש הנטוש" and direction == "פנים" and not has_defeated_guardian:
print("שומר המקדש הזועם חוסם את המעבר!")
elif direction in world[current_location]["exits"]:
current_location = world[current_location]["exits"][direction]
else:
print("אין מעבר בכיוון הזה.")
elif action == "אוסף":
if len(command) > 1:
item_name = " ".join(command[1:])
if item_name in world[current_location]["items"]:
inventory.append(item_name)
world[current_location]["items"].remove(item_name)
print(f"אספת את {item_name}.")
else:
print(f"אין פריט כזה '{item_name}' בחדר.")
else:
print("איזה פריט תרצה לאסוף?")
elif action == "השתמש":
if len(command) > 1:
item_name = " ".join(command[1:])
if item_name in inventory:
print(f"השתמשת ב '{item_name}'.")
# בדיקה ספציפית למשימת האוצר
if item_name == "אוצר עתיק" and current_location == "חדר סודי במקדש" and "מצא את האוצר העתיק" in tasks and tasks["מצא את האוצר העתיק"]["status"] != "הושלם":
tasks["מצא את האוצר העתיק"]["status"] = "הושלם"
print("הצלחת למצוא את האוצר העתיק! המשימה הושלמה.")
else:
print(f"אין לך את הפריט '{item_name}' בתיק.")
else:
print("באיזה פריט תרצה להשתמש?")
elif action == "דבר":
if len(command) > 2 and command[1] == "עם":
character_name = " ".join(command[2:])
if character_name in world[current_location]["characters"]:
print(f"דיברת עם {character_name}.")
if character_name == "שומר המקדש הזועם" and not has_defeated_guardian:
print("השומר נוהם עליך ומאיים!")
elif character_name == "נזיר זקן":
print("הנזיר ממלמל מילים עתיקות.")
else:
print("הדמות לא אומרת הרבה.")
else:
print(f"אין דמות כזו '{character_name}' בחדר.")
else:
print("עם מי תרצה לדבר?")
elif action == "התקפה":
if current_location == "המקדש הנטוש" and "שומר המקדש הזועם" in world[current_location]["characters"] and "חרב ישנה" in inventory and not has_defeated_guardian:
print("שלפת את חרבך והסתערת על השומר!")
print("במהלך הקרב המתוח, הצלחת להביס את שומר המקדש הזועם.")
has_defeated_guardian = True
world[current_location]["characters"].remove("שומר המקדש הזועם")
elif current_location == "המקדש הנטוש" and not has_defeated_guardian:
print("אין כאן מישהו להילחם בו.")
elif "חרב ישנה" not in inventory:
print("אין לך חרב כדי לתקוף!")
elif has_defeated_guardian:
print("השומר כבר הובס.")
else:
print("פקודה לא מוכרת.")
print("תודה ששיחקתם!")
world = {
"כיכר הכניסה": {
"description": "אתם עומדים בכיכר הכניסה המרכזית של העיר העתיקה. שער גדול ניצב מצפון, ושבילים מתפצלים מזרחה ומערבה.",
"items": [],
"characters": ["קבוצת אנשים לבושים בלבוש עתיק"],
"exits": {"צפון": "שער העיר", "מזרח": "השוק הישן", "מערב": "החצר האחורית", "דרום": "הנמל"}
},
"שער העיר": {
"description": "שער אבן עתיק ומרשים. נראה שפעם הגן על הכניסה הראשית לעיר.",
"items": [],
"characters": [],
"exits": {"דרום": "כיכר הכניסה"}
},
"השוק הישן": {
"description": "שוק הומה אדם, דוכנים צבעוניים מציעים מגוון סחורות. אוויר מלא בריחות תבלינים וקולות רוכלים.",
"items": ["ארנק קטן"],
"characters": ["מוכר תבלינים", "קבצן", "כמה אנשים לבושים בלבוש מסורתי"],
"exits": {"מערב": "כיכר הכניסה", "מזרח": "המקדש הנטוש"}
},
"החצר האחורית": {
"description": "חצר מוזנחת עם באר יבשה וכמה ארגזים ישנים.",
"items": ["חבל קצר"],
"characters": [],
"exits": {"מזרח": "כיכר הכניסה"}
},
"המקדש הנטוש": {
"description": "מקדש עתיק ועזוב, צמחייה פראית מטפסת על קירותיו המתפוררים. נשמעים צלילי רוח חזקים.",
"items": [],
"characters": ["נזיר זקן", "שומר המקדש הזועם"],
"exits": {"מערב": "השוק הישן", "פנים": "חדר סודי במקדש"}
},
"חדר סודי במקדש": {
"description": "חדר קטן וחשוך בתוך המקדש הנטוש. על הרצפה פזורים חפצים מוזרים.",
"items": ["אוצר עתיק"],
"characters": [],
"exits": {"חוץ": "המקדש הנטוש"}
},
"הנמל": {
"description": "נמל שוקק חיים, רעש גלים מתנפצים על הרציף וקריאות מלחים באוויר. ספינות רבות עוגנות כאן.",
"items": ["חבל עבה", "תיבת עץ"],
"characters": ["ספן שיכור", "סוחר", "קבוצת אנשים לבושים בלבוש עתיק"],
"exits": {"צפון": "כיכר הכניסה"}
}
}
current_location = "כיכר הכניסה"
inventory = ["חרב ישנה"] # השחקן מתחיל עם חרב
tasks = {}
has_defeated_guardian = False
def give_task(task_name, description):
tasks[task_name] = {"status": "לא התחיל", "description": description}
print(f"קיבלת משימה חדשה: {description}")
def display_location(location):
print(world[location]["description"])
if world[location]["items"]:
print(f"בחדר ישנם הפריטים הבאים: {', '.join(world[location]['items'])}")
if world[location]["characters"]:
characters_in_room = [char for char in world[location]["characters"] if char != "שומר המקדש הזועם" or not has_defeated_guardian]
if characters_in_room:
print(f"בחדר נמצאות הדמויות הבאות: {', '.join(characters_in_room)}")
if location == "הנמל":
print("בנמל עוגנות ספינות רבות בגדלים שונים.")
if inventory:
print(f"בתיק שלך ישנם הפריטים הבאים: {', '.join(inventory)}")
if tasks:
print("המשימות שלך:")
for task_name, task_info in tasks.items():
print(f"- {task_info['description']} (סטטוס: {task_info['status']})")
# מתן המשימה בתחילת המשחק
give_task("מצא את האוצר העתיק", "עליך למצוא את האוצר העתיק החבוי בחדר הסודי שבמקדש הנטוש.")
while True:
display_location(current_location)
command = input("מה תרצה לעשות? (צ, ד, מ, מע, פ, ח, אוסף [פריט], השתמש [פריט], דבר עם [דמות], התקפה, יציאה): ").lower().split()
if not command:
continue
action = command[0]
if action == "יציאה":
break
elif action in ["צ", "ד", "מ", "מע", "פ", "ח"]:
direction = ""
if action == "צ":
direction = "צפון"
elif action == "ד":
direction = "דרום"
elif action == "מ":
direction = "מזרח"
elif action == "מע":
direction = "מערב"
elif action == "פ":
direction = "פנים"
elif action == "ח":
direction = "חוץ"
if current_location == "המקדש הנטוש" and direction == "פנים" and not has_defeated_guardian:
print("שומר המקדש הזועם חוסם את המעבר!")
elif direction in world[current_location]["exits"]:
current_location = world[current_location]["exits"][direction]
else:
print("אין מעבר בכיוון הזה.")
elif action == "אוסף":
if len(command) > 1:
item_name = " ".join(command[1:])
if item_name in world[current_location]["items"]:
inventory.append(item_name)
world[current_location]["items"].remove(item_name)
print(f"אספת את {item_name}.")
else:
print(f"אין פריט כזה '{item_name}' בחדר.")
else:
print("איזה פריט תרצה לאסוף?")
elif action == "השתמש":
if len(command) > 1:
item_name = " ".join(command[1:])
if item_name in inventory:
print(f"השתמשת ב '{item_name}'.")
# בדיקה ספציפית למשימת האוצר
if item_name == "אוצר עתיק" and current_location == "חדר סודי במקדש" and "מצא את האוצר העתיק" in tasks and tasks["מצא את האוצר העתיק"]["status"] != "הושלם":
tasks["מצא את האוצר העתיק"]["status"] = "הושלם"
print("הצלחת למצוא את האוצר העתיק! המשימה הושלמה.")
else:
print(f"אין לך את הפריט '{item_name}' בתיק.")
else:
print("באיזה פריט תרצה להשתמש?")
elif action == "דבר":
if len(command) > 2 and command[1] == "עם":
character_name = " ".join(command[2:])
if character_name in world[current_location]["characters"]:
print(f"דיברת עם {character_name}.")
if character_name == "שומר המקדש הזועם" and not has_defeated_guardian:
print("השומר נוהם עליך ומאיים!")
elif character_name == "נזיר זקן":
print("הנזיר ממלמל מילים עתיקות.")
else:
print("הדמות לא אומרת הרבה.")
else:
print(f"אין דמות כזו '{character_name}' בחדר.")
else:
print("עם מי תרצה לדבר?")
elif action == "התקפה":
if current_location == "המקדש הנטוש" and "שומר המקדש הזועם" in world[current_location]["characters"] and "חרב ישנה" in inventory and not has_defeated_guardian:
print("שלפת את חרבך והסתערת על השומר!")
print("במהלך הקרב המתוח, הצלחת להביס את שומר המקדש הזועם.")
has_defeated_guardian = True
world[current_location]["characters"].remove("שומר המקדש הזועם")
elif current_location == "המקדש הנטוש" and not has_defeated_guardian:
print("אין כאן מישהו להילחם בו.")
elif "חרב ישנה" not in inventory:
print("אין לך חרב כדי לתקוף!")
elif has_defeated_guardian:
print("השומר כבר הובס.")
else:
print("פקודה לא מוכרת.")
print("תודה ששיחקתם!")
הנושאים החמים



Reactions: אבסולוט פרימה בלרינה, חלומות ירוקים, Harmonyapro ועוד 113 משתמשים116 //