game_world = {
"player": {
"name": "Player 1",
"level": 1,
"xp": 0,
"inventory": {
"sword": {"power": 10},
"armor": {"defense": 5},
},
},
"cheat_menu": {
"health_points": {"description": "Add 100 health points"},
"max_health_points": {"description": "Set maximum health points to 500"},
"power_up": {"description": "Increase the power of your sword by 100"},
"power_down": {"description": "Decrease the power of your sword by 100"},
},
}
def activate_cheat(cheat_name):
player = game_world["player"]
cheat_effect = game_world["cheat_menu"][cheat_name]
if cheat_name == "health_points":
player["hp"] += 100
elif cheat_name == "max_health_points":
player["max_hp"] = 500
elif cheat_name == "power_up":
player["inventory"]["sword"]["power"] += 100
elif cheat_name == "power_down":
player["inventory"]["sword"]["power"] -= 100
print(f"Cheat '{cheat_name}' activated: {cheat_effect['description']}")
# Test the function
activate_cheat("health_points")
activate_cheat("power_up")
{"html5":"htmlmixed","css":"css","javascript":"javascript","php":"php","python":"python","ruby":"ruby","lua":"text\/x-lua","bash":"text\/x-sh","go":"go","c":"text\/x-csrc","cpp":"text\/x-c++src","diff":"diff","latex":"stex","sql":"sql","xml":"xml","apl":"apl","asterisk":"asterisk","c_loadrunner":"text\/x-csrc","c_mac":"text\/x-csrc","coffeescript":"text\/x-coffeescript","csharp":"text\/x-csharp","d":"d","ecmascript":"javascript","erlang":"erlang","groovy":"text\/x-groovy","haskell":"text\/x-haskell","haxe":"text\/x-haxe","html4strict":"htmlmixed","java":"text\/x-java","java5":"text\/x-java","jquery":"javascript","mirc":"mirc","mysql":"sql","ocaml":"text\/x-ocaml","pascal":"text\/x-pascal","perl":"perl","perl6":"perl","plsql":"sql","properties":"text\/x-properties","q":"text\/x-q","scala":"scala","scheme":"text\/x-scheme","tcl":"text\/x-tcl","vb":"text\/x-vb","verilog":"text\/x-verilog","yaml":"text\/x-yaml","z80":"text\/x-z80"}